eoss 0.1.0-alpha.30 → 0.1.0-alpha.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/lib/eoss.common.js +472 -312
  2. package/lib/index.js +1 -1
  3. package/lib/lowcode-view.js +181 -110
  4. package/lib/lowcode.js +155 -104
  5. package/lib/main.js +83 -38
  6. package/lib/process-config.js +14 -18
  7. package/lib/process-module.js +9 -12
  8. package/lib/process-rule.js +2 -5
  9. package/lib/tabs.js +4 -0
  10. package/lib/theme-chalk/index.css +1 -1
  11. package/lib/theme-chalk/lowcode-view.css +1 -1
  12. package/lib/theme-chalk/tabs.css +1 -1
  13. package/lib/wujie.js +2 -3
  14. package/package.json +1 -1
  15. package/packages/lowcode/src/attribute/javascript.vue +2 -0
  16. package/packages/lowcode/src/attribute/property.vue +38 -56
  17. package/packages/lowcode/src/attribute.vue +3 -1
  18. package/packages/lowcode/src/lowcode.vue +8 -2
  19. package/packages/lowcode/src/pages.vue +0 -1
  20. package/packages/lowcode/src/render.vue +15 -1
  21. package/packages/lowcode/src/util/source-generator.js +29 -15
  22. package/packages/lowcode/src/util/source-parser.js +35 -3
  23. package/packages/lowcode-view/src/{Modulels.vue → Modules.vue} +63 -74
  24. package/packages/lowcode-view/src/view.vue +44 -11
  25. package/packages/main/src/components/pages.vue +4 -1
  26. package/packages/main/src/components/router-page.vue +29 -1
  27. package/packages/main/src/components/sub-menu.vue +2 -0
  28. package/packages/main/src/early.vue +1 -0
  29. package/packages/main/src/gzw.vue +1 -0
  30. package/packages/main/src/minxs.js +7 -0
  31. package/packages/process-config/src/NodeConfig.vue +0 -1
  32. package/packages/process-config/src/NodeForm.vue +0 -1
  33. package/packages/process-module/src/FormList.vue +0 -1
  34. package/packages/process-module/src/main.vue +0 -2
  35. package/packages/process-rule/src/main.vue +0 -3
  36. package/packages/tabs/src/tabs.vue +5 -1
  37. package/packages/theme-chalk/src/lowcode-view.scss +1 -0
  38. package/packages/theme-chalk/src/tabs.scss +2 -1
  39. package/packages/wujie/src/wujie.vue +0 -1
  40. package/src/index.js +1 -1
@@ -3528,7 +3528,7 @@ module.exports = require("lodash/set");
3528
3528
  // ESM COMPAT FLAG
3529
3529
  __webpack_require__.r(__webpack_exports__);
3530
3530
 
3531
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/lowcode-view/src/view.vue?vue&type=template&id=0f1c9eba&
3531
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/lowcode-view/src/view.vue?vue&type=template&id=5c7ae5e9&
3532
3532
  var render = function () {
3533
3533
  var _vm = this
3534
3534
  var _h = _vm.$createElement
@@ -3712,11 +3712,13 @@ var render = function () {
3712
3712
  },
3713
3713
  [
3714
3714
  _vm.visible
3715
- ? _c("modulels", {
3715
+ ? _c("modules", {
3716
3716
  attrs: {
3717
3717
  modules: _vm.pagesMap,
3718
3718
  filters: _vm.pages,
3719
3719
  url: _vm.listsUrl,
3720
+ styles: _vm.containerStyle,
3721
+ pageStyle: _vm.pageStyle,
3720
3722
  },
3721
3723
  on: { add: _vm.handleAdd },
3722
3724
  })
@@ -3732,7 +3734,7 @@ var staticRenderFns = []
3732
3734
  render._withStripped = true
3733
3735
 
3734
3736
 
3735
- // CONCATENATED MODULE: ./packages/lowcode-view/src/view.vue?vue&type=template&id=0f1c9eba&
3737
+ // CONCATENATED MODULE: ./packages/lowcode-view/src/view.vue?vue&type=template&id=5c7ae5e9&
3736
3738
 
3737
3739
  // EXTERNAL MODULE: external "sortablejs"
3738
3740
  var external_sortablejs_ = __webpack_require__(55);
@@ -4444,8 +4446,8 @@ var render_component = Object(componentNormalizer["a" /* default */])(
4444
4446
  )
4445
4447
 
4446
4448
  /* harmony default export */ var src_render = (render_component.exports);
4447
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/lowcode-view/src/Modulels.vue?vue&type=template&id=1f83c988&
4448
- var Modulelsvue_type_template_id_1f83c988_render = function () {
4449
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/lowcode-view/src/Modules.vue?vue&type=template&id=00a7fee8&
4450
+ var Modulesvue_type_template_id_00a7fee8_render = function () {
4449
4451
  var _vm = this
4450
4452
  var _h = _vm.$createElement
4451
4453
  var _c = _vm._self._c || _h
@@ -4468,6 +4470,7 @@ var Modulelsvue_type_template_id_1f83c988_render = function () {
4468
4470
  {
4469
4471
  ref: "waterfallContainer",
4470
4472
  staticClass: "es-lowcode-view__modules--waterfall",
4473
+ style: _vm.styles,
4471
4474
  model: {
4472
4475
  value: _vm.models,
4473
4476
  callback: function ($$v) {
@@ -4533,15 +4536,18 @@ var Modulelsvue_type_template_id_1f83c988_render = function () {
4533
4536
  1
4534
4537
  )
4535
4538
  }
4536
- var Modulelsvue_type_template_id_1f83c988_staticRenderFns = []
4537
- Modulelsvue_type_template_id_1f83c988_render._withStripped = true
4539
+ var Modulesvue_type_template_id_00a7fee8_staticRenderFns = []
4540
+ Modulesvue_type_template_id_00a7fee8_render._withStripped = true
4538
4541
 
4539
4542
 
4540
- // CONCATENATED MODULE: ./packages/lowcode-view/src/Modulels.vue?vue&type=template&id=1f83c988&
4543
+ // CONCATENATED MODULE: ./packages/lowcode-view/src/Modules.vue?vue&type=template&id=00a7fee8&
4541
4544
 
4542
4545
  // EXTERNAL MODULE: ./src/utils/ajax.js
4543
4546
  var ajax = __webpack_require__(9);
4544
4547
 
4548
+ // EXTERNAL MODULE: ./src/utils/util.js
4549
+ var util = __webpack_require__(1);
4550
+
4545
4551
  // EXTERNAL MODULE: external "eoss/lib/checkbox"
4546
4552
  var checkbox_ = __webpack_require__(38);
4547
4553
  var checkbox_default = /*#__PURE__*/__webpack_require__.n(checkbox_);
@@ -4562,7 +4568,8 @@ var scrollbar_default = /*#__PURE__*/__webpack_require__.n(scrollbar_);
4562
4568
  var pagination_ = __webpack_require__(84);
4563
4569
  var pagination_default = /*#__PURE__*/__webpack_require__.n(pagination_);
4564
4570
 
4565
- // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/lowcode-view/src/Modulels.vue?vue&type=script&lang=js&
4571
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/lowcode-view/src/Modules.vue?vue&type=script&lang=js&
4572
+ //
4566
4573
  //
4567
4574
  //
4568
4575
  //
@@ -4618,8 +4625,9 @@ var pagination_default = /*#__PURE__*/__webpack_require__.n(pagination_);
4618
4625
 
4619
4626
 
4620
4627
 
4621
- /* harmony default export */ var Modulelsvue_type_script_lang_js_ = ({
4622
- name: 'Modulels',
4628
+
4629
+ /* harmony default export */ var Modulesvue_type_script_lang_js_ = ({
4630
+ name: 'Modules',
4623
4631
 
4624
4632
  components: {
4625
4633
  EsPagination: pagination_default.a,
@@ -4632,6 +4640,18 @@ var pagination_default = /*#__PURE__*/__webpack_require__.n(pagination_);
4632
4640
 
4633
4641
  props: {
4634
4642
  url: String,
4643
+ styles: {
4644
+ type: Object,
4645
+ default: function _default() {
4646
+ return {};
4647
+ }
4648
+ },
4649
+ pageStyle: {
4650
+ type: Object,
4651
+ default: function _default() {
4652
+ return {};
4653
+ }
4654
+ },
4635
4655
  filters: {
4636
4656
  type: Array,
4637
4657
  default: function _default() {
@@ -4643,9 +4663,7 @@ var pagination_default = /*#__PURE__*/__webpack_require__.n(pagination_);
4643
4663
  default: function _default() {
4644
4664
  return [];
4645
4665
  }
4646
- },
4647
- columns: Number,
4648
- gap: Number
4666
+ }
4649
4667
  },
4650
4668
 
4651
4669
  data: function data() {
@@ -4667,6 +4685,14 @@ var pagination_default = /*#__PURE__*/__webpack_require__.n(pagination_);
4667
4685
  return this.filters.map(function (item) {
4668
4686
  return item.id;
4669
4687
  });
4688
+ },
4689
+
4690
+ // 列数/列间距与 view.vue 同源:从 pageStyle 解析,缺省 2 列 0 间距
4691
+ columnCount: function columnCount() {
4692
+ return parseInt((this.pageStyle || {}).columns || 2, 10);
4693
+ },
4694
+ columnGap: function columnGap() {
4695
+ return parseInt((this.pageStyle || {}).gap || 0, 10);
4670
4696
  }
4671
4697
  },
4672
4698
 
@@ -4690,7 +4716,7 @@ var pagination_default = /*#__PURE__*/__webpack_require__.n(pagination_);
4690
4716
  var _this = this;
4691
4717
 
4692
4718
  this.$nextTick(function () {
4693
- _this.models.length && _this.layoutWaterfall();
4719
+ _this.layoutWaterfall();
4694
4720
  });
4695
4721
  },
4696
4722
 
@@ -4743,77 +4769,59 @@ var pagination_default = /*#__PURE__*/__webpack_require__.n(pagination_);
4743
4769
  },
4744
4770
 
4745
4771
  /**
4746
- * 瀑布流布局算法(双列版本)
4747
- * 计算元素的高度和位置,一行显示2列
4772
+ * 瀑布流布局:与 view.vue 保持同一套行为,
4773
+ * masonry 模式复用 util.layoutWaterfall 完成元素分配与定位,
4774
+ * 非 masonry(grid/flex)只清理子元素绝对定位残留,交还容器 CSS 控制
4748
4775
  */
4749
4776
  layoutWaterfall: function layoutWaterfall() {
4750
4777
  var _this3 = this;
4751
4778
 
4752
- var container = this.$refs.waterfallContainer.$el;
4779
+ var ref = this.$refs.waterfallContainer;
4780
+ var container = ref && ref.$el ? ref.$el : ref;
4753
4781
  if (!container) return;
4782
+ if (this.results.length === 0) return;
4754
4783
 
4755
- // 获取容器宽度
4756
- var containerWidth = container.clientWidth;
4757
- if (containerWidth === 0) return;
4758
-
4759
- // 计算每列宽度
4760
- var columnWidth = (containerWidth - this.gap) / this.columns;
4761
-
4762
- // 初始化每列高度数组
4763
- var columnHeights = [0, 0];
4784
+ // 非瀑布流模式:grid/flex 由容器 CSS(styles prop)控制,重置子元素为普通流式布局
4785
+ if ((this.pageStyle || {}).display !== 'masonry') {
4786
+ var display = (this.pageStyle || {}).display;
4787
+ this.results.forEach(function (item) {
4788
+ if (!item.style) _this3.$set(item, 'style', {});
4789
+ if (item.style.position !== undefined) {
4790
+ _this3.$set(item.style, 'position', '');
4791
+ }
4792
+ if (item.style.left !== undefined) {
4793
+ _this3.$set(item.style, 'left', '');
4794
+ }
4795
+ if (item.style.top !== undefined) {
4796
+ _this3.$set(item.style, 'top', '');
4797
+ }
4798
+ // grid 宽度由列宽/span 决定,移除瀑布流残留的 width
4799
+ if (display === 'grid' && item.style.width) {
4800
+ _this3.$delete(item.style, 'width');
4801
+ }
4802
+ });
4803
+ container.style.height = 'auto';
4804
+ container.style.position = '';
4805
+ return;
4806
+ }
4764
4807
 
4765
- // 遍历所有元素,分配到高度最小的列
4808
+ // util 按 px 解析 width,百分比宽度(如 '100%')会被 parseInt
4809
+ // 误判成自定义像素宽度,这里先移除,让 util 回退到按 span 计算列宽
4766
4810
  this.results.forEach(function (item) {
4767
- var span = Math.max(1, Math.min(parseInt(item.style.span ? item.style.span : item.span || 1), _this3.columns));
4768
- // 找到高度最小的列
4769
- var minColIndex = 0;
4770
- if (columnHeights[1] < columnHeights[0]) {
4771
- minColIndex = 1;
4772
- }
4773
-
4774
- // 计算元素位置
4775
- var left = 0;
4776
- var top = 0;
4777
- var width = parseInt(item.style.width ? item.style.width : item.width);
4778
- var height = parseInt(item.style.height ? item.style.height : item.height);
4779
- var eleWidth = columnWidth * span + _this3.gap * (span - 1);
4780
- if (width == '100%' || span == _this3.columns) {
4781
- // 通栏元素,放在第一列顶部
4782
- left = 0;
4783
- top = Math.max.apply(Math, columnHeights);
4784
- // 更新两列的高度为相同值
4785
- columnHeights[0] = columnHeights[1] = top + (height || 0) + _this3.gap;
4786
- } else {
4787
- // 普通元素,放在高度最小的列
4788
- left = minColIndex * (eleWidth + _this3.gap);
4789
- top = columnHeights[minColIndex];
4790
- // 更新该列的高度
4791
- columnHeights[minColIndex] += (height || 0) + _this3.gap;
4792
- }
4793
-
4794
- // 设置元素样式(使用Vue的$set确保响应式)
4795
- if (!item.style) {
4796
- _this3.$set(item, 'style', {});
4811
+ var width = item.style && item.style.width;
4812
+ if (width && /%$/.test(String(width).trim())) {
4813
+ _this3.$delete(item.style, 'width');
4797
4814
  }
4798
- _this3.$set(item.style, 'position', 'absolute');
4799
- _this3.$set(item.style, 'width', width == '100%' ? '100%' : eleWidth + 'px');
4800
- _this3.$set(item.style, 'height', height + 'px');
4801
- _this3.$set(item.style, 'left', left + 'px');
4802
- _this3.$set(item.style, 'top', top + 'px');
4803
-
4804
- // 已在位置计算部分更新了列高度
4805
4815
  });
4806
4816
 
4807
- // 设置容器高度
4808
- var maxHeight = Math.max.apply(Math, columnHeights);
4809
- container.style.position = 'relative';
4810
- container.style.height = maxHeight - this.gap + 'px'; // 减去最后一个间隙
4817
+ // 瀑布流核心计算复用 util,与页面渲染态保持同一套行为
4818
+ Object(util["J" /* layoutWaterfall */])(this, container, this.results, this.columnCount, this.columnGap);
4811
4819
  }
4812
4820
  }
4813
4821
  });
4814
- // CONCATENATED MODULE: ./packages/lowcode-view/src/Modulels.vue?vue&type=script&lang=js&
4815
- /* harmony default export */ var src_Modulelsvue_type_script_lang_js_ = (Modulelsvue_type_script_lang_js_);
4816
- // CONCATENATED MODULE: ./packages/lowcode-view/src/Modulels.vue
4822
+ // CONCATENATED MODULE: ./packages/lowcode-view/src/Modules.vue?vue&type=script&lang=js&
4823
+ /* harmony default export */ var src_Modulesvue_type_script_lang_js_ = (Modulesvue_type_script_lang_js_);
4824
+ // CONCATENATED MODULE: ./packages/lowcode-view/src/Modules.vue
4817
4825
 
4818
4826
 
4819
4827
 
@@ -4821,10 +4829,10 @@ var pagination_default = /*#__PURE__*/__webpack_require__.n(pagination_);
4821
4829
 
4822
4830
  /* normalize component */
4823
4831
 
4824
- var Modulels_component = Object(componentNormalizer["a" /* default */])(
4825
- src_Modulelsvue_type_script_lang_js_,
4826
- Modulelsvue_type_template_id_1f83c988_render,
4827
- Modulelsvue_type_template_id_1f83c988_staticRenderFns,
4832
+ var Modules_component = Object(componentNormalizer["a" /* default */])(
4833
+ src_Modulesvue_type_script_lang_js_,
4834
+ Modulesvue_type_template_id_00a7fee8_render,
4835
+ Modulesvue_type_template_id_00a7fee8_staticRenderFns,
4828
4836
  false,
4829
4837
  null,
4830
4838
  null,
@@ -4832,13 +4840,10 @@ var Modulels_component = Object(componentNormalizer["a" /* default */])(
4832
4840
 
4833
4841
  )
4834
4842
 
4835
- /* harmony default export */ var Modulels = (Modulels_component.exports);
4843
+ /* harmony default export */ var Modules = (Modules_component.exports);
4836
4844
  // EXTERNAL MODULE: ./src/config/api.js
4837
4845
  var api = __webpack_require__(6);
4838
4846
 
4839
- // EXTERNAL MODULE: ./src/utils/util.js
4840
- var util = __webpack_require__(1);
4841
-
4842
4847
  // EXTERNAL MODULE: ./src/utils/resize-event.js
4843
4848
  var resize_event = __webpack_require__(37);
4844
4849
 
@@ -4853,6 +4858,8 @@ var icon_default = /*#__PURE__*/__webpack_require__.n(icon_);
4853
4858
  // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/lowcode-view/src/view.vue?vue&type=script&lang=js&
4854
4859
  var viewvue_type_script_lang_js_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
4855
4860
 
4861
+ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }
4862
+
4856
4863
  function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
4857
4864
 
4858
4865
  //
@@ -4947,6 +4954,8 @@ function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in ob
4947
4954
  //
4948
4955
  //
4949
4956
  //
4957
+ //
4958
+ //
4950
4959
 
4951
4960
 
4952
4961
 
@@ -4964,7 +4973,7 @@ var DROP_SPACE = 200;
4964
4973
  /* harmony default export */ var viewvue_type_script_lang_js_ = ({
4965
4974
  name: 'LowcodeView',
4966
4975
 
4967
- components: { EsScrollbar: scrollbar_default.a, Render: src_render, Modulels: Modulels, EsButton: button_default.a, EsDialog: dialog_default.a, EsIcon: icon_default.a },
4976
+ components: { EsScrollbar: scrollbar_default.a, Render: src_render, Modules: Modules, EsButton: button_default.a, EsDialog: dialog_default.a, EsIcon: icon_default.a },
4968
4977
 
4969
4978
  props: {
4970
4979
  isEdit: {
@@ -4982,6 +4991,7 @@ var DROP_SPACE = 200;
4982
4991
 
4983
4992
  data: function data() {
4984
4993
  return {
4994
+ pageData: this.page,
4985
4995
  // 组件列表
4986
4996
  components: [],
4987
4997
  // 列宽
@@ -5140,34 +5150,94 @@ var DROP_SPACE = 200;
5140
5150
  params: {
5141
5151
  mainPageComponentConfigId: this.pageId
5142
5152
  }
5143
- }).then(function (res) {
5144
- if (res.rCode != 0) return;
5145
-
5146
- var _ref = res.results || {},
5147
- pageInfo = _ref.pageInfo,
5148
- targetList = _ref.targetList;
5149
-
5150
- console.log('pageInfo', pageInfo, targetList);
5151
- //targetList后续需要完善
5152
- if (!pageInfo) return;
5153
- // pageInfo.content 是一段 JSON 字符串,内部结构为 { children, style, ... }
5154
-
5155
- var content = pageInfo.content,
5156
- page = _objectWithoutProperties(pageInfo, ['content']);
5153
+ }).then(function () {
5154
+ var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(res) {
5155
+ var _ref2, pageInfo, targetList, content, page, parsed, userConfig, modules, _parsed, children, parseds;
5156
+
5157
+ return regeneratorRuntime.wrap(function _callee$(_context) {
5158
+ while (1) {
5159
+ switch (_context.prev = _context.next) {
5160
+ case 0:
5161
+ if (!(res.rCode != 0)) {
5162
+ _context.next = 2;
5163
+ break;
5164
+ }
5165
+
5166
+ return _context.abrupt('return');
5167
+
5168
+ case 2:
5169
+ _ref2 = res.results || {}, pageInfo = _ref2.pageInfo, targetList = _ref2.targetList;
5170
+ //targetList后续需要完善
5171
+
5172
+ if (pageInfo) {
5173
+ _context.next = 5;
5174
+ break;
5175
+ }
5176
+
5177
+ return _context.abrupt('return');
5178
+
5179
+ case 5:
5180
+ content = pageInfo.content, page = _objectWithoutProperties(pageInfo, ['content']);
5181
+ parsed = {};
5182
+
5183
+ try {
5184
+ parsed = JSON.parse(content);
5185
+ } catch (e) {
5186
+ parsed = {};
5187
+ }
5188
+ // pageInfo.content 是一段 JSON 字符串,内部结构为 { children, style, ... }
5189
+
5190
+ if (!pageInfo.code) {
5191
+ _context.next = 15;
5192
+ break;
5193
+ }
5194
+
5195
+ _context.next = 11;
5196
+ return Object(ajax["a" /* ajax */])({
5197
+ url: api["J" /* getByType */],
5198
+ params: {
5199
+ type: pageInfo.code
5200
+ }
5201
+ });
5202
+
5203
+ case 11:
5204
+ userConfig = _context.sent;
5205
+
5206
+ if (userConfig.rCode === 0 && userConfig.results && userConfig.results[pageInfo.code] && userConfig.results[pageInfo.code].userConfig) {
5207
+ modules = JSON.parse(userConfig.results[pageInfo.code].userConfig);
5208
+ _parsed = parsed, children = _parsed.children, parseds = _objectWithoutProperties(_parsed, ['children']);
5209
+
5210
+ _this.pageData = viewvue_type_script_lang_js_extends({}, page, parseds, { children: modules });
5211
+ _this.pagesMap = children || [];
5212
+ } else {
5213
+ _this.pageData = viewvue_type_script_lang_js_extends({}, page, parsed);
5214
+ }
5215
+ _context.next = 16;
5216
+ break;
5217
+
5218
+ case 15:
5219
+ _this.pageData = viewvue_type_script_lang_js_extends({}, page, parsed);
5220
+
5221
+ case 16:
5222
+ // 合并:page 保留元信息,parsed 提供 children/style 等渲染所需结构
5223
+ _this.setPageData(_this.pageData);
5224
+ // mounted 时 pages 尚为空,异步拿到数据后需重新触发布局
5225
+ _this.$nextTick(function () {
5226
+ _this.init();
5227
+ });
5228
+
5229
+ case 18:
5230
+ case 'end':
5231
+ return _context.stop();
5232
+ }
5233
+ }
5234
+ }, _callee, _this);
5235
+ }));
5157
5236
 
5158
- var parsed = {};
5159
- try {
5160
- parsed = JSON.parse(content);
5161
- } catch (e) {
5162
- parsed = {};
5163
- }
5164
- // 合并:page 保留元信息,parsed 提供 children/style 等渲染所需结构
5165
- _this.setPageData(viewvue_type_script_lang_js_extends({}, page, parsed));
5166
- // mounted 时 pages 尚为空,异步拿到数据后需重新触发布局
5167
- _this.$nextTick(function () {
5168
- _this.init();
5169
- });
5170
- }).catch(function (err) {}).finally(function () {
5237
+ return function (_x) {
5238
+ return _ref.apply(this, arguments);
5239
+ };
5240
+ }()).catch(function (err) {}).finally(function () {
5171
5241
  loadingInstance.close();
5172
5242
  });
5173
5243
  },
@@ -5253,13 +5323,14 @@ var DROP_SPACE = 200;
5253
5323
  method: 'post',
5254
5324
  format: false,
5255
5325
  data: {
5256
- type: 'customHomePages',
5326
+ type: this.pageData.code,
5257
5327
  userConfig: JSON.stringify(this.pages)
5258
5328
  }
5259
5329
  }).then(function (res) {
5260
5330
  if (res.rCode == 0 || res.status == 'success') {
5261
5331
  _this4.$message.success('保存成功!');
5262
- _this4.getData();
5332
+ // 保存成功后重新拉取页面配置,刷新渲染数据
5333
+ _this4.getPagesMap();
5263
5334
  _this4.edit = false;
5264
5335
  _this4.$nextTick(function () {
5265
5336
  _this4.layoutWaterfall();