eoss 0.1.0-alpha.32 → 0.1.0-alpha.34

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 (56) hide show
  1. package/lib/account-login.js +1 -1
  2. package/lib/audit-trajectory.js +1 -1
  3. package/lib/autocomplete.js +109 -70
  4. package/lib/cascader.js +109 -70
  5. package/lib/checkbox-group.js +1 -1
  6. package/lib/color-picker.js +109 -70
  7. package/lib/config/api.js +1 -1
  8. package/lib/data-table.js +1 -1
  9. package/lib/date-picker.js +109 -70
  10. package/lib/dropdown-menu.js +109 -70
  11. package/lib/email-login.js +1 -1
  12. package/lib/eoss.common.js +320 -147
  13. package/lib/flow.js +1 -1
  14. package/lib/flows.js +1 -1
  15. package/lib/form.js +1 -1
  16. package/lib/icon.js +1 -1
  17. package/lib/index.js +1 -1
  18. package/lib/login.js +1 -1
  19. package/lib/lowcode-view.js +94 -35
  20. package/lib/lowcode.js +98 -24
  21. package/lib/main.js +3 -2
  22. package/lib/menu.js +109 -70
  23. package/lib/phone-login.js +1 -1
  24. package/lib/popover.js +109 -70
  25. package/lib/process-config.js +1 -1
  26. package/lib/process-module.js +1 -1
  27. package/lib/process-rule.js +1 -1
  28. package/lib/qrcode-login.js +1 -1
  29. package/lib/radio-group.js +1 -1
  30. package/lib/select.js +110 -71
  31. package/lib/selector-panel.js +1 -1
  32. package/lib/selector.js +1 -1
  33. package/lib/submenu.js +109 -70
  34. package/lib/table.js +110 -71
  35. package/lib/theme-chalk/base.css +1 -1
  36. package/lib/theme-chalk/index.css +1 -1
  37. package/lib/theme-chalk/main.css +1 -1
  38. package/lib/time-picker.js +109 -70
  39. package/lib/time-select.js +109 -70
  40. package/lib/tips.js +1 -1
  41. package/lib/tooltip.js +109 -70
  42. package/lib/tree-group.js +1 -1
  43. package/lib/tree.js +1 -1
  44. package/lib/update-history.js +1 -1
  45. package/lib/upload.js +1 -1
  46. package/lib/utils/popper.js +97 -48
  47. package/package.json +1 -1
  48. package/packages/lowcode/src/lowcode.vue +43 -2
  49. package/packages/lowcode/src/render.vue +47 -12
  50. package/packages/lowcode-view/src/render.vue +66 -26
  51. package/packages/lowcode-view/src/view.vue +13 -2
  52. package/packages/main/src/minxs.js +2 -1
  53. package/packages/theme-chalk/src/base.scss +2 -1
  54. package/src/config/api.js +1 -1
  55. package/src/index.js +1 -1
  56. package/src/utils/popper.js +109 -70
package/lib/login.js CHANGED
@@ -6535,7 +6535,7 @@ var publishedLists = '/main2/pageComponentConfig/listPublished';
6535
6535
  // 获取自定义配置详情
6536
6536
  var pageInfo = '/main2/pageComponentConfig/info';
6537
6537
  // 获取自定义配置授权列表
6538
- var pageGroup = 'main2/pageComponentTarget/listByConfigIdAndTypeGroup';
6538
+ var pageGroup = '/main2/pageComponentTarget/listByConfigIdAndTypeGroup';
6539
6539
 
6540
6540
  // 保存自定义配置,发布也调这个接口但要加上字段status=1
6541
6541
  var pageSave = '/main2/pageComponentConfig/save';
@@ -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=a1097a78&
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=4955d640&
3532
3532
  var render = function () {
3533
3533
  var _vm = this
3534
3534
  var _h = _vm.$createElement
@@ -3734,14 +3734,14 @@ var staticRenderFns = []
3734
3734
  render._withStripped = true
3735
3735
 
3736
3736
 
3737
- // CONCATENATED MODULE: ./packages/lowcode-view/src/view.vue?vue&type=template&id=a1097a78&
3737
+ // CONCATENATED MODULE: ./packages/lowcode-view/src/view.vue?vue&type=template&id=4955d640&
3738
3738
 
3739
3739
  // EXTERNAL MODULE: external "sortablejs"
3740
3740
  var external_sortablejs_ = __webpack_require__(55);
3741
3741
  var external_sortablejs_default = /*#__PURE__*/__webpack_require__.n(external_sortablejs_);
3742
3742
 
3743
- // 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/render.vue?vue&type=template&id=30079e52&
3744
- var rendervue_type_template_id_30079e52_render = function () {
3743
+ // 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/render.vue?vue&type=template&id=45a220b2&
3744
+ var rendervue_type_template_id_45a220b2_render = function () {
3745
3745
  var _vm = this
3746
3746
  var _h = _vm.$createElement
3747
3747
  var _c = _vm._self._c || _h
@@ -3777,6 +3777,7 @@ var rendervue_type_template_id_30079e52_render = function () {
3777
3777
  key: _vm.newNode.id,
3778
3778
  tag: "component",
3779
3779
  staticStyle: { width: "100%", height: "100%" },
3780
+ attrs: { height: _vm.newHeight },
3780
3781
  },
3781
3782
  "component",
3782
3783
  _vm.cleanProps,
@@ -3946,11 +3947,11 @@ var rendervue_type_template_id_30079e52_render = function () {
3946
3947
  2
3947
3948
  )
3948
3949
  }
3949
- var rendervue_type_template_id_30079e52_staticRenderFns = []
3950
- rendervue_type_template_id_30079e52_render._withStripped = true
3950
+ var rendervue_type_template_id_45a220b2_staticRenderFns = []
3951
+ rendervue_type_template_id_45a220b2_render._withStripped = true
3951
3952
 
3952
3953
 
3953
- // CONCATENATED MODULE: ./packages/lowcode-view/src/render.vue?vue&type=template&id=30079e52&
3954
+ // CONCATENATED MODULE: ./packages/lowcode-view/src/render.vue?vue&type=template&id=45a220b2&
3954
3955
 
3955
3956
  // 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/Iframe.vue?vue&type=template&id=3a1f5bf7&
3956
3957
  var Iframevue_type_template_id_3a1f5bf7_render = function () {
@@ -4178,6 +4179,7 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument
4178
4179
  //
4179
4180
  //
4180
4181
  //
4182
+ //
4181
4183
 
4182
4184
 
4183
4185
 
@@ -4219,11 +4221,8 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument
4219
4221
  initialMouseY: 0,
4220
4222
  initialWidth: 0,
4221
4223
  initialHeight: 0,
4222
- resizeObserver: null,
4223
4224
  isResizing: false,
4224
- direction: '',
4225
- width: 0,
4226
- height: 0
4225
+ direction: ''
4227
4226
  };
4228
4227
  },
4229
4228
 
@@ -4239,6 +4238,50 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument
4239
4238
  }
4240
4239
  },
4241
4240
  computed: {
4241
+ /**
4242
+ * 手柄旁 span 展示的宽度
4243
+ * - masonry:style.width 由 layoutWaterfall 按 span×列宽 算好写入
4244
+ * - flex:style.width 补默认值 / 拖拽写入
4245
+ * - grid:style.width 被删除,宽度由 grid-column: span N 决定,
4246
+ * 按 span×列宽+(span-1)×gap 计算(公式与 util.js layoutWaterfall 一致);
4247
+ * 读取 style.span 建立响应式依赖,span 变化时立即重算
4248
+ */
4249
+ width: function width() {
4250
+ var style = this.newNode && this.newNode.style || {};
4251
+ if (style.width) {
4252
+ var w = parseInt(style.width);
4253
+ if (!isNaN(w)) return w;
4254
+ }
4255
+ // grid 模式:按 span 计算列宽
4256
+ var pageStyle = this.page && this.page.style || {};
4257
+ var columns = parseInt(pageStyle.columns) || 1;
4258
+ var gap = parseInt(pageStyle.gap) || 0;
4259
+ var span = Math.max(1, Math.min(parseInt(style.span) || 1, columns));
4260
+ var parent = this.$el && this.$el.parentElement;
4261
+ if (!parent) return 0;
4262
+ var cs = window.getComputedStyle(parent);
4263
+ var containerWidth = parent.clientWidth - (parseFloat(cs.paddingLeft) || 0) - (parseFloat(cs.paddingRight) || 0);
4264
+ if (containerWidth <= 0) return 0;
4265
+ var columnWidth = (containerWidth - gap * (columns - 1)) / columns;
4266
+ return Math.round(columnWidth * span + gap * (span - 1));
4267
+ },
4268
+
4269
+ /**
4270
+ * 手柄旁 span 展示的高度:style.height 由编辑器保证存在,直接派生
4271
+ */
4272
+ height: function height() {
4273
+ var h = this.newNode && this.newNode.style && this.newNode.style.height;
4274
+ return parseInt(h) || 0;
4275
+ },
4276
+
4277
+ /**
4278
+ * 传递给内层业务组件的 height(:height):与展示用 height 同源,取自 style.height,
4279
+ * 保证业务组件(如图表/表格)拿到的是节点真实像素高度,且随 style.height 响应式变化
4280
+ */
4281
+ newHeight: function newHeight() {
4282
+ return this.height;
4283
+ },
4284
+
4242
4285
  /**
4243
4286
  * 解析 text 指令中的表达式
4244
4287
  * 支持 {{variable}} 形式,从 page.data 中获取值
@@ -4295,18 +4338,17 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument
4295
4338
  this.direction = direction;
4296
4339
  // 只响应鼠标左键或触摸
4297
4340
  if (event.pointerType === 'mouse' && event.button !== 0) return;
4298
- if (!node.style || !node.style.width || !node.style.height) {
4299
- // 从组件 DOM 元素获取实际宽高
4341
+ // 防御性兜底:历史数据中 style.height 缺失时从 DOM 补一次
4342
+ // (grid 模式 style.width 本就被删除,不强行补,交给 computed 按 span 计算)
4343
+ if (!node.style || !node.style.height) {
4300
4344
  var componentElement = document.querySelector('[data-id="' + node.id + '"]');
4301
4345
  if (componentElement) {
4302
- // 获取计算后的样式
4303
4346
  var computedStyle = window.getComputedStyle(componentElement);
4304
- var width = parseInt(computedStyle.width) || componentElement.offsetWidth;
4305
- var height = parseInt(computedStyle.height) || componentElement.offsetHeight;
4306
- // 只设置 width 和 height,不替换整个 style 对象(保留 span 等其他属性)
4307
4347
  if (!node.style) this.$set(this.newNode, 'style', {});
4308
- this.$set(this.newNode.style, 'width', width + 'px');
4309
- this.$set(this.newNode.style, 'height', height + 'px');
4348
+ if (!this.newNode.style.height) {
4349
+ var height = parseInt(computedStyle.height) || componentElement.offsetHeight;
4350
+ this.$set(this.newNode.style, 'height', height + 'px');
4351
+ }
4310
4352
  }
4311
4353
  }
4312
4354
 
@@ -4314,9 +4356,9 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument
4314
4356
  this.resizingComponent = _extends({}, this.newNode, { direction: direction });
4315
4357
  this.initialMouseX = event.clientX;
4316
4358
  this.initialMouseY = event.clientY;
4317
- // 记录初始宽高
4318
- this.initialWidth = parseInt(this.newNode.style.width) || 200;
4319
- this.initialHeight = parseInt(this.newNode.style.height) || 100;
4359
+ // 记录初始宽高:直接取 computed width/height,已覆盖 grid(按 span 计算)/masonry/flex 各模式,与展示值同源
4360
+ this.initialWidth = this.width || 0;
4361
+ this.initialHeight = this.height || 0;
4320
4362
  this.$emit('change', this.newNode, true);
4321
4363
 
4322
4364
  document.addEventListener('pointermove', this.handleResizeMove);
@@ -4336,8 +4378,11 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument
4336
4378
  var deltaX = pointerEvent.clientX - this.initialMouseX;
4337
4379
  var deltaY = pointerEvent.clientY - this.initialMouseY;
4338
4380
  var direction = this.resizingComponent.direction;
4339
- var canvasElement = document.querySelector('.es-lowcode__canvas--content');
4340
- var canvasWidth = canvasElement && canvasElement.offsetWidth || 0;
4381
+ // 容器宽度:view 版内容容器是 .es-lowcode-view__waterfall(即当前元素的父容器),
4382
+ // 不能沿用编辑器 canvas.vue 的 .es-lowcode__canvas--content 类名(view 版不存在,
4383
+ // 会查到 null 使 canvasWidth=0,进而把宽度钳成 0 导致元素塌成竖线)
4384
+ var parent = this.$el && this.$el.parentElement;
4385
+ var canvasWidth = parent ? parent.clientWidth : 0;
4341
4386
 
4342
4387
  // 使用初始宽高进行计算
4343
4388
  var newWidth = this.initialWidth;
@@ -4374,12 +4419,11 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument
4374
4419
  break;
4375
4420
  }
4376
4421
 
4377
- // 限制最大宽度不超过画布宽度
4378
- newWidth = Math.min(canvasWidth, newWidth);
4379
- this.width = parseInt(newWidth);
4380
- this.height = parseInt(newHeight);
4422
+ // 限制最大宽度不超过容器宽度;容器宽度不可用时不钳制,避免误塌成 0
4423
+ newWidth = canvasWidth > 0 ? Math.min(canvasWidth, newWidth) : newWidth;
4381
4424
  if (this.newNode) {
4382
- // grid 模式下宽度由列宽/span 决定,拖动过程中不更新 width 样式,避免视觉跳动
4425
+ // grid 模式下宽度由列宽/span 决定,拖动过程中不更新 width 样式,避免视觉跳动;
4426
+ // 展示用的 width/height 为 computed,写入 style 后会自动跟随更新
4383
4427
  if (this.displayMode !== 'grid') {
4384
4428
  this.$set(this.newNode.style, 'width', newWidth + 'px');
4385
4429
  }
@@ -4436,8 +4480,8 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument
4436
4480
 
4437
4481
  var render_component = Object(componentNormalizer["a" /* default */])(
4438
4482
  src_rendervue_type_script_lang_js_,
4439
- rendervue_type_template_id_30079e52_render,
4440
- rendervue_type_template_id_30079e52_staticRenderFns,
4483
+ rendervue_type_template_id_45a220b2_render,
4484
+ rendervue_type_template_id_45a220b2_staticRenderFns,
4441
4485
  false,
4442
4486
  null,
4443
4487
  null,
@@ -5160,7 +5204,7 @@ var DROP_SPACE = 200;
5160
5204
  }
5161
5205
  }).then(function () {
5162
5206
  var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(res) {
5163
- var _ref2, pageInfo, targetList, content, page, parsed, userConfig, modules, _parsed, children, parseds;
5207
+ var _ref2, pageInfo, targetList, content, page, parsed, userConfig, modules, _parsed, children, parseds, childrens;
5164
5208
 
5165
5209
  return regeneratorRuntime.wrap(function _callee$(_context) {
5166
5210
  while (1) {
@@ -5214,8 +5258,17 @@ var DROP_SPACE = 200;
5214
5258
  if (userConfig.rCode === 0 && userConfig.results && userConfig.results[pageInfo.code] && userConfig.results[pageInfo.code].userConfig) {
5215
5259
  modules = JSON.parse(userConfig.results[pageInfo.code].userConfig);
5216
5260
  _parsed = parsed, children = _parsed.children, parseds = _objectWithoutProperties(_parsed, ['children']);
5261
+ // 以模块(modules)为准,按 id 合并已保存的子节点配置(child),
5262
+ // 使渲染节点同时具备模块信息与编辑器保存的布局/样式等配置
5263
+
5264
+ childrens = modules.map(function (item) {
5265
+ var child = (children || []).find(function (c) {
5266
+ return c.id === item.id;
5267
+ }) || {};
5268
+ return viewvue_type_script_lang_js_extends({}, child, item);
5269
+ });
5217
5270
 
5218
- _this.pageData = viewvue_type_script_lang_js_extends({}, page, parseds, { children: modules });
5271
+ _this.pageData = viewvue_type_script_lang_js_extends({}, page, parseds, { children: childrens });
5219
5272
  _this.pagesMap = children || [];
5220
5273
  } else {
5221
5274
  _this.pageData = viewvue_type_script_lang_js_extends({}, page, parsed);
@@ -5328,13 +5381,19 @@ var DROP_SPACE = 200;
5328
5381
  return;
5329
5382
  }
5330
5383
  var loadingInstance = Object(util["K" /* loading */])('保存中...');
5384
+ var data = this.pages.map(function (item) {
5385
+ return {
5386
+ id: item.id,
5387
+ style: item.style
5388
+ };
5389
+ });
5331
5390
  Object(ajax["a" /* ajax */])({
5332
5391
  url: api["Zb" /* saveOrUpdate */],
5333
5392
  method: 'post',
5334
5393
  format: false,
5335
5394
  data: {
5336
5395
  type: this.pageData.code,
5337
- userConfig: JSON.stringify(this.pages)
5396
+ userConfig: JSON.stringify(data)
5338
5397
  }
5339
5398
  }).then(function (res) {
5340
5399
  if (res.rCode == 0 || res.status == 'success') {
@@ -6763,7 +6822,7 @@ var publishedLists = '/main2/pageComponentConfig/listPublished';
6763
6822
  // 获取自定义配置详情
6764
6823
  var pageInfo = '/main2/pageComponentConfig/info';
6765
6824
  // 获取自定义配置授权列表
6766
- var pageGroup = 'main2/pageComponentTarget/listByConfigIdAndTypeGroup';
6825
+ var pageGroup = '/main2/pageComponentTarget/listByConfigIdAndTypeGroup';
6767
6826
 
6768
6827
  // 保存自定义配置,发布也调这个接口但要加上字段status=1
6769
6828
  var pageSave = '/main2/pageComponentConfig/save';
package/lib/lowcode.js CHANGED
@@ -4323,7 +4323,7 @@ module.exports = require("lodash/get");
4323
4323
  // ESM COMPAT FLAG
4324
4324
  __webpack_require__.r(__webpack_exports__);
4325
4325
 
4326
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/lowcode/src/lowcode.vue?vue&type=template&id=ac68474e&
4326
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/lowcode/src/lowcode.vue?vue&type=template&id=2c9b5e4a&
4327
4327
  var render = function () {
4328
4328
  var _vm = this
4329
4329
  var _h = _vm.$createElement
@@ -4812,7 +4812,7 @@ var staticRenderFns = []
4812
4812
  render._withStripped = true
4813
4813
 
4814
4814
 
4815
- // CONCATENATED MODULE: ./packages/lowcode/src/lowcode.vue?vue&type=template&id=ac68474e&
4815
+ // CONCATENATED MODULE: ./packages/lowcode/src/lowcode.vue?vue&type=template&id=2c9b5e4a&
4816
4816
 
4817
4817
  // EXTERNAL MODULE: external "vue"
4818
4818
  var external_vue_ = __webpack_require__(2);
@@ -6770,8 +6770,8 @@ canvasvue_type_template_id_3f236c3d_render._withStripped = true
6770
6770
 
6771
6771
  // CONCATENATED MODULE: ./packages/lowcode/src/canvas.vue?vue&type=template&id=3f236c3d&
6772
6772
 
6773
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/lowcode/src/render.vue?vue&type=template&id=12ff94c0&
6774
- var rendervue_type_template_id_12ff94c0_render = function () {
6773
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/lowcode/src/render.vue?vue&type=template&id=274525cb&
6774
+ var rendervue_type_template_id_274525cb_render = function () {
6775
6775
  var _vm = this
6776
6776
  var _h = _vm.$createElement
6777
6777
  var _c = _vm._self._c || _h
@@ -6822,6 +6822,7 @@ var rendervue_type_template_id_12ff94c0_render = function () {
6822
6822
  key: _vm.instanceKey,
6823
6823
  tag: "component",
6824
6824
  style: _vm.innerLayoutStyle,
6825
+ attrs: { height: _vm.newHeight },
6825
6826
  },
6826
6827
  "component",
6827
6828
  _vm.cleanProps,
@@ -7074,11 +7075,11 @@ var rendervue_type_template_id_12ff94c0_render = function () {
7074
7075
  2
7075
7076
  )
7076
7077
  }
7077
- var rendervue_type_template_id_12ff94c0_staticRenderFns = []
7078
- rendervue_type_template_id_12ff94c0_render._withStripped = true
7078
+ var rendervue_type_template_id_274525cb_staticRenderFns = []
7079
+ rendervue_type_template_id_274525cb_render._withStripped = true
7079
7080
 
7080
7081
 
7081
- // CONCATENATED MODULE: ./packages/lowcode/src/render.vue?vue&type=template&id=12ff94c0&
7082
+ // CONCATENATED MODULE: ./packages/lowcode/src/render.vue?vue&type=template&id=274525cb&
7082
7083
 
7083
7084
  // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/lowcode/src/iframe.vue?vue&type=template&id=ceca7cf4&scoped=true&
7084
7085
  var iframevue_type_template_id_ceca7cf4_scoped_true_render = function () {
@@ -7334,6 +7335,7 @@ var rendervue_type_script_lang_js_extends = Object.assign || function (target) {
7334
7335
  //
7335
7336
  //
7336
7337
  //
7338
+ //
7337
7339
 
7338
7340
 
7339
7341
 
@@ -7380,11 +7382,9 @@ var LAYOUT_PROPS = ['display', 'gap', 'grid-gap', 'grid-template-columns', 'flex
7380
7382
  initialMouseY: 0,
7381
7383
  initialWidth: 0,
7382
7384
  initialHeight: 0,
7383
- resizeObserver: null,
7384
7385
  isResizing: false,
7385
7386
  direction: '',
7386
- width: 0,
7387
- height: 0,
7387
+ newHeight: 0,
7388
7388
  isDragOver: false
7389
7389
  };
7390
7390
  },
@@ -7401,6 +7401,42 @@ var LAYOUT_PROPS = ['display', 'gap', 'grid-gap', 'grid-template-columns', 'flex
7401
7401
  }
7402
7402
  },
7403
7403
  computed: {
7404
+ /**
7405
+ * 手柄旁 span 展示的宽度
7406
+ * - masonry:style.width 由 layoutWaterfall 按 span×列宽 算好写入
7407
+ * - flex:style.width 补默认值 / 拖拽写入
7408
+ * - grid:canvas 会删除 style.width,宽度由 grid-column: span N 决定,
7409
+ * 按 span×列宽+(span-1)×gap 计算(公式与 util.js layoutWaterfall 一致);
7410
+ * 读取 style.span 建立响应式依赖,span 变化时立即重算,无需等浏览器重排
7411
+ */
7412
+ width: function width() {
7413
+ var style = this.newNode && this.newNode.style || {};
7414
+ if (style.width) {
7415
+ var w = parseInt(style.width);
7416
+ if (!isNaN(w)) return w;
7417
+ }
7418
+ // grid 模式:按 span 计算列宽
7419
+ var pageStyle = this.page && this.page.style || {};
7420
+ var columns = parseInt(pageStyle.columns) || 1;
7421
+ var gap = parseInt(pageStyle.gap) || 0;
7422
+ var span = Math.max(1, Math.min(parseInt(style.span) || 1, columns));
7423
+ var parent = this.$el && this.$el.parentElement;
7424
+ if (!parent) return 0;
7425
+ var cs = window.getComputedStyle(parent);
7426
+ var containerWidth = parent.clientWidth - (parseFloat(cs.paddingLeft) || 0) - (parseFloat(cs.paddingRight) || 0);
7427
+ if (containerWidth <= 0) return 0;
7428
+ var columnWidth = (containerWidth - gap * (columns - 1)) / columns;
7429
+ return Math.round(columnWidth * span + gap * (span - 1));
7430
+ },
7431
+
7432
+ /**
7433
+ * 手柄旁 span 展示的高度:style.height 由编辑器保证存在,直接派生
7434
+ */
7435
+ height: function height() {
7436
+ var h = this.newNode && this.newNode.style && this.newNode.style.height;
7437
+ return parseInt(h) || 0;
7438
+ },
7439
+
7404
7440
  /**
7405
7441
  * 解析 text 指令中的表达式
7406
7442
  * 支持 {{variable}} 形式,从 page.data 中获取值
@@ -7506,6 +7542,7 @@ var LAYOUT_PROPS = ['display', 'gap', 'grid-gap', 'grid-template-columns', 'flex
7506
7542
  if (src[key]) style[key] = src[key];
7507
7543
  });
7508
7544
  }
7545
+ this.newHeight = parseInt(style.height) || 0;
7509
7546
  return style;
7510
7547
  },
7511
7548
 
@@ -7619,15 +7656,14 @@ var LAYOUT_PROPS = ['display', 'gap', 'grid-gap', 'grid-template-columns', 'flex
7619
7656
  this.direction = direction;
7620
7657
  // 只响应鼠标左键或触摸
7621
7658
  if (event.pointerType === 'mouse' && event.button !== 0) return;
7659
+ // 防御性兜底:若历史数据中 style.width/height 缺失,从 DOM 补一次
7660
+ // (正常流程下 canvas.vue 会保证 style.height 存在,这里仅防异常数据)
7622
7661
  if (!node.style || !node.style.width || !node.style.height) {
7623
- // 从组件DOM元素获取实际宽高
7624
7662
  var componentElement = document.querySelector('[data-id="' + node.id + '"]');
7625
7663
  if (componentElement) {
7626
- // 获取计算后的样式
7627
7664
  var computedStyle = window.getComputedStyle(componentElement);
7628
7665
  var width = parseInt(computedStyle.width) || componentElement.offsetWidth;
7629
7666
  var height = parseInt(computedStyle.height) || componentElement.offsetHeight;
7630
- // 只补全缺失的 width/height,保留 span 等其它属性
7631
7667
  if (!node.style) this.$set(this.newNode, 'style', {});
7632
7668
  if (!this.newNode.style.width) {
7633
7669
  this.$set(this.newNode.style, 'width', width + 'px');
@@ -7648,9 +7684,10 @@ var LAYOUT_PROPS = ['display', 'gap', 'grid-gap', 'grid-template-columns', 'flex
7648
7684
  this.resizingComponent = rendervue_type_script_lang_js_extends({}, this.newNode, { direction: direction });
7649
7685
  this.initialMouseX = event.clientX;
7650
7686
  this.initialMouseY = event.clientY;
7651
- // 记录初始宽高
7652
- this.initialWidth = parseInt(this.newNode.style.width) || 200;
7653
- this.initialHeight = parseInt(this.newNode.style.height) || 100;
7687
+ // 记录初始宽高:直接取 computed width/height,已覆盖 grid(按 span 计算)/masonry/flex 各模式,
7688
+ // 与展示值同源,避免 grid 模式下 style.width 缺失导致拖拽基准为 0
7689
+ this.initialWidth = this.width || 0;
7690
+ this.initialHeight = this.height || 0;
7654
7691
  this.$emit('change', this.newNode, true, this.initialWidth);
7655
7692
 
7656
7693
  document.addEventListener('pointermove', this.handleResizeMove);
@@ -7710,10 +7747,8 @@ var LAYOUT_PROPS = ['display', 'gap', 'grid-gap', 'grid-template-columns', 'flex
7710
7747
 
7711
7748
  // 限制最大宽度不超过画布宽度
7712
7749
  newWidth = Math.min(canvasWidth, newWidth);
7713
- this.width = parseInt(newWidth);
7714
- this.height = parseInt(newHeight);
7715
7750
  if (this.newNode) {
7716
- // 使用Vue.set确保样式变化能触发响应式更新
7751
+ // 写入 style 后,computed width/height 会自动跟随更新,无需再手动赋值
7717
7752
  this.$set(this.newNode.style, 'width', newWidth + 'px');
7718
7753
  this.$set(this.newNode.style, 'height', newHeight + 'px');
7719
7754
  }
@@ -7839,8 +7874,8 @@ var LAYOUT_PROPS = ['display', 'gap', 'grid-gap', 'grid-template-columns', 'flex
7839
7874
 
7840
7875
  var render_component = Object(componentNormalizer["a" /* default */])(
7841
7876
  src_rendervue_type_script_lang_js_,
7842
- rendervue_type_template_id_12ff94c0_render,
7843
- rendervue_type_template_id_12ff94c0_staticRenderFns,
7877
+ rendervue_type_template_id_274525cb_render,
7878
+ rendervue_type_template_id_274525cb_staticRenderFns,
7844
7879
  false,
7845
7880
  null,
7846
7881
  null,
@@ -16969,10 +17004,49 @@ function lowcodevue_type_script_lang_js_objectWithoutProperties(obj, keys) { var
16969
17004
 
16970
17005
  /**
16971
17006
  * 复制 URL 到剪贴板
17007
+ * 说明:wujie 微前端 / dialog 挂载到子应用 document 时,navigator.clipboard
17008
+ * 会因 "Document is not focused" 抛出 NotAllowedError,这里采用
17009
+ * 异步 Clipboard API + execCommand('copy') 同步兜底 的双通道策略。
16972
17010
  */
16973
17011
  copyUrl: function copyUrl() {
16974
- navigator.clipboard.writeText(this.publishForm.url);
16975
- message_default.a.success('复制成功');
17012
+ var text = this.publishForm.url;
17013
+ if (!text) {
17014
+ message_default.a.warning('没有可复制的内容');
17015
+ return;
17016
+ }
17017
+ var fallbackCopy = function fallbackCopy() {
17018
+ var textarea = document.createElement('textarea');
17019
+ textarea.value = text;
17020
+ textarea.setAttribute('readonly', '');
17021
+ textarea.style.position = 'fixed';
17022
+ textarea.style.top = '-1000px';
17023
+ textarea.style.left = '-1000px';
17024
+ textarea.style.opacity = '0';
17025
+ document.body.appendChild(textarea);
17026
+ textarea.select();
17027
+ textarea.setSelectionRange(0, textarea.value.length);
17028
+ var ok = false;
17029
+ try {
17030
+ ok = document.execCommand('copy');
17031
+ } catch (e) {
17032
+ ok = false;
17033
+ }
17034
+ document.body.removeChild(textarea);
17035
+ if (ok) {
17036
+ message_default.a.success('复制成功');
17037
+ } else {
17038
+ message_default.a.error('复制失败,请手动选择地址复制');
17039
+ }
17040
+ };
17041
+ if (navigator.clipboard && typeof navigator.clipboard.writeText === 'function') {
17042
+ navigator.clipboard.writeText(text).then(function () {
17043
+ return message_default.a.success('复制成功');
17044
+ }, function () {
17045
+ return fallbackCopy();
17046
+ });
17047
+ } else {
17048
+ fallbackCopy();
17049
+ }
16976
17050
  },
16977
17051
 
16978
17052
  /**
@@ -18199,7 +18273,7 @@ var publishedLists = '/main2/pageComponentConfig/listPublished';
18199
18273
  // 获取自定义配置详情
18200
18274
  var pageInfo = '/main2/pageComponentConfig/info';
18201
18275
  // 获取自定义配置授权列表
18202
- var pageGroup = 'main2/pageComponentTarget/listByConfigIdAndTypeGroup';
18276
+ var pageGroup = '/main2/pageComponentTarget/listByConfigIdAndTypeGroup';
18203
18277
 
18204
18278
  // 保存自定义配置,发布也调这个接口但要加上字段status=1
18205
18279
  var pageSave = '/main2/pageComponentConfig/save';
package/lib/main.js CHANGED
@@ -4200,7 +4200,7 @@ var publishedLists = '/main2/pageComponentConfig/listPublished';
4200
4200
  // 获取自定义配置详情
4201
4201
  var pageInfo = '/main2/pageComponentConfig/info';
4202
4202
  // 获取自定义配置授权列表
4203
- var pageGroup = 'main2/pageComponentTarget/listByConfigIdAndTypeGroup';
4203
+ var pageGroup = '/main2/pageComponentTarget/listByConfigIdAndTypeGroup';
4204
4204
 
4205
4205
  // 保存自定义配置,发布也调这个接口但要加上字段status=1
4206
4206
  var pageSave = '/main2/pageComponentConfig/save';
@@ -18519,7 +18519,7 @@ var appid = Object(util["s" /* getParams */])('applicationId');
18519
18519
  return t.id === item.id;
18520
18520
  });
18521
18521
  });
18522
- var customMenus = _this8.customMenus.split(',');
18522
+ var customMenus = typeof _this8.customMenus === 'string' ? _this8.customMenus.split(',') : _this8.customMenus;
18523
18523
  var filteredApps = allApps.filter(function (item) {
18524
18524
  return customMenus.includes(item.id);
18525
18525
  });
@@ -18575,6 +18575,7 @@ var appid = Object(util["s" /* getParams */])('applicationId');
18575
18575
  case 'themeColor':
18576
18576
  var themeColor = unescape(res[i]).toLowerCase();
18577
18577
  if (Object(util["R" /* startWith */])(themeColor, '#')) {
18578
+ Object(util["W" /* updateTheme */])(themeColor);
18578
18579
  this.themeColor = themeColor;
18579
18580
  }
18580
18581
  break;