cloud-web-corejs 1.0.315 → 1.0.317

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 (25) hide show
  1. package/package.json +1 -1
  2. package/src/components/hiprint/view/json-view.vue +4 -4
  3. package/src/components/mobile/wf/content.vue +2 -2
  4. package/src/components/xform/form-designer/designer.js +1 -0
  5. package/src/components/xform/form-designer/form-widget/dialog/formDialog.vue +30 -4
  6. package/src/components/xform/form-designer/form-widget/dialog/searchFormDialog.vue +27 -4
  7. package/src/components/xform/form-designer/setting-panel/form-setting.vue +60 -39
  8. package/src/components/xform/form-designer/setting-panel/property-editor/container-tab/tab-lazyRender-editor.vue +27 -0
  9. package/src/components/xform/form-designer/setting-panel/property-editor/event-handler/onTabChange-editor.vue +28 -0
  10. package/src/components/xform/form-designer/setting-panel/property-editor/event-handler/onTabClick-editor.vue +28 -0
  11. package/src/components/xform/form-designer/setting-panel/property-editor/project-tag-editor.vue +2 -4
  12. package/src/components/xform/form-designer/setting-panel/propertyRegister.js +8 -3
  13. package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +9 -0
  14. package/src/components/xform/form-render/container-item/containerItemMixin.js +489 -404
  15. package/src/components/xform/form-render/container-item/data-table-mixin.js +1 -0
  16. package/src/components/xform/form-render/container-item/panel-item.vue +1 -1
  17. package/src/components/xform/form-render/container-item/tab-item.vue +48 -0
  18. package/src/components/xform/form-render/indexMixin.js +17 -2
  19. package/src/components/xform/form-render/pageDialogScope.js +54 -0
  20. package/src/components/xform/icon-picker/index.vue +1 -1
  21. package/src/components/xform/lang/en-US.js +3 -0
  22. package/src/components/xform/lang/zh-CN.js +3 -0
  23. package/src/components/xform/utils/util.js +1 -0
  24. package/src/directive/el-drag-dialog/drag.js +32 -2
  25. package/src/views/user/form/view/list.vue +24 -1
@@ -2886,6 +2886,7 @@ modules = {
2886
2886
  tableOption.path = path;
2887
2887
  tableOption.config.proxyConfig = {
2888
2888
  props: {
2889
+ list: isDataPage ? "objx.records" : "objx", // 无分页时 VXE 使用 list 读取行数据
2889
2890
  result: isDataPage ? "objx.records" : "objx", // 配置响应结果列表字段
2890
2891
  total: isDataPage ? "objx.total" : "objx.length", // 配置响应结果总页数字段
2891
2892
  },
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <container-item-wrapper :widget="widget">
3
3
  <div :key="widget.id" class="table-container" v-show="!widget.options.hidden" :style="heightStyle">
4
- <template v-if="!!widget.widgetList && widget.widgetList.length > 0" v-show="!widget.options.hidden">
4
+ <template v-if="!!widget.widgetList && widget.widgetList.length > 0">
5
5
  <template v-for="(subWidget, swIdx) in widget.widgetList">
6
6
  <template v-if="'container' === subWidget.category">
7
7
  <component
@@ -14,6 +14,7 @@
14
14
  :style="{
15
15
  height: widget.options.isFullscreen ? '' : widget.options.height,
16
16
  }"
17
+ @tab-click="handleTabClick"
17
18
  >
18
19
  <el-tab-pane
19
20
  v-for="tab in visibleTabs"
@@ -21,6 +22,7 @@
21
22
  :label="getI18nLabel(tab.options.label)"
22
23
  :disabled="tab.options.disabled"
23
24
  :name="tab.options.name"
25
+ :lazy="lazyRender"
24
26
  >
25
27
  <template v-for="(subWidget, swIdx) in tab.widgetList">
26
28
  <template v-if="'container' === subWidget.category">
@@ -95,12 +97,46 @@ export default {
95
97
  return !tp.options.hidden;
96
98
  });
97
99
  },
100
+ /* 懒渲染(P0-1,内存优化):开启后每个页签内容首次激活才挂载、激活后保留(element 的
101
+ el-tab-pane lazy 语义,即"保守版"),未激活页签不建组件、不发数据请求。
102
+ 默认关闭——校验(el-form 只认已挂载的 form-item)和跨页签 getWidgetRef 在未激活页签
103
+ 上都会失效,必须逐模板审计后由设计器显式开启(见 docs/2026-09 低配电脑渲染进程崩溃内存优化方案.md)。 */
104
+ lazyRender() {
105
+ return this.widget.options.lazyRender === true;
106
+ },
107
+ },
108
+ watch: {
109
+ visibleTabs(tabs) {
110
+ const formRef = this.getFormRef();
111
+ if (
112
+ formRef
113
+ && formRef.isFieldControlEnabled()
114
+ && !tabs.some(tab => tab.options.name === this.activeTabName)
115
+ ) {
116
+ this.activeTabName = tabs.length ? tabs[0].options.name : "";
117
+ }
118
+ },
119
+ /* onTabChange:任何激活页签变化(用户点击 + 脚本 activeTab()/隐藏重置等程序化切换)。
120
+ initActiveTab 在 mounted 的首次赋值不算切换(oldName 为空),避免打开详情即触发联动。 */
121
+ activeTabName(name, oldName) {
122
+ if (!oldName) return;
123
+ if (this.widget.options.onTabChange) {
124
+ new Function("name", "oldName", this.widget.options.onTabChange).call(
125
+ this,
126
+ name,
127
+ oldName
128
+ );
129
+ }
130
+ },
98
131
  },
99
132
  created() {
100
133
  this.initRefList();
134
+ this.handleOnCreated();
101
135
  },
102
136
  mounted() {
137
+ // 先定初始激活页签再跑 onMounted:懒渲染下脚本里读 activeTabName 时已是最终值
103
138
  this.initActiveTab();
139
+ this.handleOnMounted();
104
140
  },
105
141
  beforeDestroy() {
106
142
  this.unregisterFromRefList();
@@ -118,6 +154,18 @@ export default {
118
154
  }
119
155
  }
120
156
  },
157
+ /* onTabClick:仅用户点击页签头(element 原生事件,disabled 页签不会触发)。
158
+ 实参对齐编辑器声明;此刻新页签内容(懒渲染)尚未挂载,取新页签内部组件 ref 会拿不到。 */
159
+ handleTabClick(tab) {
160
+ if (this.widget.options.onTabClick) {
161
+ new Function("name", "index", "label", this.widget.options.onTabClick).call(
162
+ this,
163
+ tab.name,
164
+ tab.index != null ? Number(tab.index) : null,
165
+ tab.label
166
+ );
167
+ }
168
+ },
121
169
  },
122
170
  };
123
171
  </script>
@@ -53,6 +53,7 @@ import html2Canvas from "html2canvas";
53
53
  import JsPDF from "jspdf";
54
54
  import formulaDialog from "@base/components/xform/form-designer/form-widget/dialog/formulaDialog.vue";
55
55
  import baseFormulaDialog from "@base/components/xform/form-designer/form-widget/dialog/baseFormulaDialog.vue";
56
+ import { resolveDialogOption } from "@base/components/xform/form-render/pageDialogScope";
56
57
  import QRCode from "qrcode";
57
58
  import { openLuckysheetDialog } from "@base/components/luckysheet";
58
59
  import {
@@ -164,6 +165,10 @@ modules = {
164
165
  type: Boolean,
165
166
  default: false,
166
167
  },
168
+ dialogScope: {
169
+ type: String,
170
+ default: null,
171
+ },
167
172
  },
168
173
  provide() {
169
174
  let e = this;
@@ -4954,14 +4959,24 @@ modules = {
4954
4959
  }
4955
4960
  },*/
4956
4961
  openSearchDialog(option) {
4957
- this.searchDialogOption = option;
4962
+ this.searchDialogOption = resolveDialogOption(
4963
+ option,
4964
+ this.formJsonObj?.formConfig,
4965
+ this.dialogScope,
4966
+ this.$el
4967
+ );
4958
4968
  this.showSearchDialog = true;
4959
4969
  },
4960
4970
  confirmSearchDialog(rows) {
4961
4971
  this.searchDialogOption.confirm && this.searchDialogOption.confirm(rows);
4962
4972
  },
4963
4973
  openFormDialog(option) {
4964
- this.formDialogOption = option;
4974
+ this.formDialogOption = resolveDialogOption(
4975
+ option,
4976
+ this.formJsonObj?.formConfig,
4977
+ this.dialogScope,
4978
+ this.$el
4979
+ );
4965
4980
  this.showFormDialog = true;
4966
4981
  },
4967
4982
  closeFormDialog() {
@@ -0,0 +1,54 @@
1
+ export const PAGE_DIALOG_SCOPE = "page";
2
+
3
+ // 模板里的 top: "25vh" 是按整个窗口居中。当前页面弹框改由页面内容区 flex 居中,
4
+ // 再套视口 vh 会从内容区顶部再下移一截,弹框就偏下。px 等显式偏移仍保留。
5
+ export function pageDialogTop(top) {
6
+ const value = top == null ? "" : String(top).trim();
7
+ if (!value || /vh$/i.test(value)) return "0";
8
+ return value;
9
+ }
10
+
11
+ const PAGE_HOST_SELECTOR = "[data-xform-page-dialog-host]";
12
+
13
+ export function resolveDialogOption(option, formConfig, inheritedScope, element) {
14
+ const source = option || {};
15
+ const scope = source.dialogScope ?? formConfig?.dialogScope ?? inheritedScope;
16
+ if (scope !== PAGE_DIALOG_SCOPE) return source;
17
+
18
+ const host = element?.closest?.(PAGE_HOST_SELECTOR);
19
+ if (!host) {
20
+ console.warn("xform page dialog host not found; using global dialog");
21
+ return { ...source, dialogScope: "global" };
22
+ }
23
+ return { ...source, dialogScope: PAGE_DIALOG_SCOPE, pageDialogHost: host };
24
+ }
25
+
26
+ export const pageScopedDialogMixin = {
27
+ computed: {
28
+ isPageScope() {
29
+ return (
30
+ this.option?.dialogScope === PAGE_DIALOG_SCOPE
31
+ && !!this.option.pageDialogHost
32
+ );
33
+ },
34
+ pageDialogHasTop() {
35
+ return this.isPageScope && pageDialogTop(this.option.dialogConfig?.top) !== "0";
36
+ },
37
+ },
38
+ mounted() {
39
+ if (!this.isPageScope) return;
40
+ const dialog = this.$refs.pageDialog;
41
+ const wrapper = dialog?.$el;
42
+ const host = this.option.pageDialogHost;
43
+ if (!wrapper || !host) return;
44
+ host.appendChild(wrapper);
45
+ this.pageDialogWrapper = wrapper;
46
+ // The surrounding menu and route tabs remain interactive.
47
+ dialog.$refs.dialog?.setAttribute("aria-modal", "false");
48
+ },
49
+ beforeDestroy() {
50
+ const wrapper = this.pageDialogWrapper;
51
+ if (wrapper?.parentNode) wrapper.parentNode.removeChild(wrapper);
52
+ this.pageDialogWrapper = null;
53
+ },
54
+ };
@@ -30,7 +30,7 @@ export default {
30
30
  name: "icon-picker",
31
31
  props: {
32
32
  value: {
33
- type: String | null,
33
+ type: String,
34
34
  required: true,
35
35
  },
36
36
  disabled: {
@@ -281,6 +281,9 @@ export default {
281
281
  tabPaneSetting: "Tab Panes",
282
282
  addTabPane: "Add Tab Pane",
283
283
  paneActive: "Active",
284
+ lazyRender: "Lazy Render",
285
+ lazyRenderHint:
286
+ "Pane content mounts on first activation and stays mounted; inactive panes render nothing and request no data. Ensure there are no cross-pane getWidgetRef scripts and that fields on unvisited panes need no submit validation. Intended for view/detail templates.",
284
287
  customLabelIcon: "Custom Label",
285
288
  labelIconClass: "Label Icon Class",
286
289
  labelIconPosition: "Label Icon Position",
@@ -441,6 +441,9 @@ export default {
441
441
  tabPaneSetting: "选项卡设置",
442
442
  addTabPane: "增加选项卡页",
443
443
  tabClass: "选项卡样式",
444
+ lazyRender: "懒渲染",
445
+ lazyRenderHint:
446
+ "开启后页签内容首次激活才挂载(激活后保留),未激活页签不渲染、不请求数据。开启前请确认:无跨页签 getWidgetRef 脚本;未访问页签的字段不参与提交校验。适用于详情展示类模板。",
444
447
  paneActive: "激活",
445
448
  customLabelIcon: "定制字段标签",
446
449
  labelIconClass: "标签Icon样式",
@@ -1094,6 +1094,7 @@ export function getDefaultFormConfig() {
1094
1094
  customClass: "",
1095
1095
  functions: "",
1096
1096
  layoutType: "PC",
1097
+ dialogScope: null,
1097
1098
  dataSources: [],
1098
1099
  onBeforeCreated: "",
1099
1100
  onFormCreated: "",
@@ -1,6 +1,6 @@
1
1
  /**version-1.0*/
2
2
  import indexUtil0 from "../../utils/index.js"
3
- let indexUtil = indexUtil0;
3
+ let indexUtil = indexUtil0;
4
4
  let modules = {};
5
5
  modules = {
6
6
  bind(el, binding, vnode) {
@@ -21,6 +21,36 @@ modules = {
21
21
  dialogHeaderEl.onmousedown = function(e) {
22
22
  indexUtil.addClass(document.body, 'resize-ing');
23
23
 
24
+ if (el.classList.contains('xform-page-dialog-wrapper')) {
25
+ const hostRect = el.parentNode.getBoundingClientRect();
26
+ const dialogRect = dragDom.getBoundingClientRect();
27
+ const startX = e.clientX;
28
+ const startY = e.clientY;
29
+ const startLeft = parseFloat(getStyle(dragDom, 'left')) || 0;
30
+ const startTop = parseFloat(getStyle(dragDom, 'top')) || 0;
31
+
32
+ document.onmousemove = function(moveEvent) {
33
+ const deltaX = Math.min(
34
+ Math.max(moveEvent.clientX - startX, hostRect.left - dialogRect.left),
35
+ hostRect.right - dialogRect.right
36
+ );
37
+ const deltaY = Math.min(
38
+ Math.max(moveEvent.clientY - startY, hostRect.top - dialogRect.top),
39
+ hostRect.bottom - dialogRect.bottom
40
+ );
41
+ dragDom.style.left = startLeft + deltaX + 'px';
42
+ dragDom.style.top = startTop + deltaY + 'px';
43
+ vnode.child.$emit('dragDialog');
44
+ };
45
+
46
+ document.onmouseup = function() {
47
+ indexUtil.removeClass(document.body, 'resize-ing');
48
+ document.onmousemove = null;
49
+ document.onmouseup = null;
50
+ };
51
+ return;
52
+ }
53
+
24
54
  // 鼠标按下,计算当前元素距离可视区的距离
25
55
  let disX = e.clientX - dialogHeaderEl.offsetLeft;
26
56
  let disY = e.clientY - dialogHeaderEl.offsetTop;
@@ -83,4 +113,4 @@ modules = {
83
113
  }
84
114
  };
85
115
 
86
- export default modules
116
+ export default modules
@@ -1,5 +1,16 @@
1
1
  <template>
2
- <div id="containt">
2
+ <div
3
+ id="containt"
4
+ :class="{
5
+ 'xform-page-dialog-host':
6
+ layoutType === 'PC' && !dialogScope && formConfig.dialogScope === 'page',
7
+ }"
8
+ :data-xform-page-dialog-host="
9
+ layoutType === 'PC' && !dialogScope && formConfig.dialogScope === 'page'
10
+ ? ''
11
+ : null
12
+ "
13
+ >
3
14
  <template v-if="layoutType === 'PC'">
4
15
  <x-tabs
5
16
  ref="xTabs"
@@ -22,6 +33,7 @@
22
33
  visible-key="showEdit"
23
34
  :visiable.sync="showEdit"
24
35
  :parent-target="_self"
36
+ :dialogScope="dialogScope"
25
37
  @reload="reload"
26
38
  @openCopyEditTab="openCopyEditTab"
27
39
  ></vFormRender>
@@ -40,6 +52,7 @@
40
52
  visible-key="showRender"
41
53
  :visiable.sync="showRender"
42
54
  :parent-target="_self"
55
+ :dialogScope="dialogScope"
43
56
  @reload="$reloadHandle"
44
57
  :openEditDialog="openEditDialog"
45
58
  ></vFormRender>
@@ -59,6 +72,7 @@
59
72
  :param="item.param"
60
73
  v-if="item.showContent"
61
74
  :parent-target="_self"
75
+ :dialogScope="dialogScope"
62
76
  @reload="(...args) => reloadAutoContent(...args)"
63
77
  :openEditDialog="openEditDialog1"
64
78
  ></vFormRender>
@@ -78,6 +92,7 @@
78
92
  :param="tab.param"
79
93
  v-if="tab.showContent"
80
94
  :parent-target="_self"
95
+ :dialogScope="dialogScope"
81
96
  @reload="(...args) => onEditTabReload(tab, ...args)"
82
97
  @openCopyEditTab="openCopyEditTab"
83
98
  ></vFormRender>
@@ -107,6 +122,7 @@
107
122
  v-if="showEditDialog && showEdit"
108
123
  visible-key="showEdit"
109
124
  :parent-target="_self"
125
+ :dialogScope="dialogScope"
110
126
  @reload="$reloadHandle"
111
127
  ></vFormRender>
112
128
  </div>
@@ -118,6 +134,7 @@
118
134
  v-if="showRender"
119
135
  visible-key="showRender"
120
136
  :parent-target="_self"
137
+ :dialogScope="dialogScope"
121
138
  @reload="$reloadHandle"
122
139
  :openEditDialog="openEditDialog"
123
140
  ></vFormRender>
@@ -131,6 +148,12 @@ import vFormRender from "../../../../views/user/form/vform/render";
131
148
  export default {
132
149
  name: "form_view:list",
133
150
  components: { vFormRender },
151
+ props: {
152
+ dialogScope: {
153
+ type: String,
154
+ default: null,
155
+ },
156
+ },
134
157
  mounted() {},
135
158
  data() {
136
159
  let that = this;