cloud-web-corejs 1.1.0-dev.56 → 1.1.0-dev.59
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.
- package/package.json +1 -1
- package/src/boot-assets.legacy.js +6 -0
- package/src/components/hiprint/view/json-view.vue +4 -4
- package/src/components/mobile/wf/content.vue +1734 -1734
- package/src/components/xform/form-designer/setting-panel/form-setting.vue +228 -93
- package/src/components/xform/form-designer/setting-panel/property-editor/container-tab/tab-lazyRender-editor.vue +27 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/event-handler/onTabChange-editor.vue +28 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/event-handler/onTabClick-editor.vue +28 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/project-tag-editor.vue +2 -4
- package/src/components/xform/form-designer/setting-panel/propertyRegister.js +8 -3
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +9 -0
- package/src/components/xform/form-render/container-item/containerItemMixin.js +93 -8
- package/src/components/xform/form-render/container-item/panel-item.vue +1 -1
- package/src/components/xform/form-render/container-item/tab-item.vue +41 -2
- package/src/components/xform/icon-picker/index.vue +1 -1
- package/src/components/xform/lang/en-US.js +3 -0
- package/src/components/xform/lang/zh-CN.js +3 -0
- package/src/router/modules/customer.js +14 -14
- package/src/styles/legacy-base.scss +19 -0
|
@@ -71,10 +71,10 @@ modules = {
|
|
|
71
71
|
// 避免同名容器重建时误删新注册的实例。
|
|
72
72
|
if (this.refList !== null && !!this.widget.options.name) {
|
|
73
73
|
let name = this.widget.options.name;
|
|
74
|
-
let inRow
|
|
75
|
-
this.subFormRowIndex !== -1
|
|
76
|
-
this.subFormRowIndex !== void 0
|
|
77
|
-
!!this.tableParam;
|
|
74
|
+
let inRow
|
|
75
|
+
= this.subFormRowIndex !== -1
|
|
76
|
+
&& this.subFormRowIndex !== void 0
|
|
77
|
+
&& !!this.tableParam;
|
|
78
78
|
let key = inRow ? name + "@row" + this.tableParam.rowIndex : name;
|
|
79
79
|
if (this.refList[key] === this) {
|
|
80
80
|
delete this.refList[key];
|
|
@@ -153,6 +153,91 @@ modules = {
|
|
|
153
153
|
}
|
|
154
154
|
},
|
|
155
155
|
|
|
156
|
+
getTabIndexByName(name) {
|
|
157
|
+
//按页签的 options.name(el-tabs pane name)找下标;不存在返回 -1
|
|
158
|
+
return (this.widget.tabs || []).findIndex((tp) => tp.options.name === name);
|
|
159
|
+
},
|
|
160
|
+
|
|
161
|
+
getTabIndexByLabel(label) {
|
|
162
|
+
//按页签显示名找下标:同时比对配置值与 i18n 翻译值(页面上看到的是翻译后的文案);
|
|
163
|
+
//重名页签取第一个
|
|
164
|
+
return (this.widget.tabs || []).findIndex((tp) => {
|
|
165
|
+
let tpLabel = tp.options.label;
|
|
166
|
+
return tpLabel === label || this.getI18nLabel(tpLabel) === label;
|
|
167
|
+
});
|
|
168
|
+
},
|
|
169
|
+
|
|
170
|
+
activeTabByName(name) {
|
|
171
|
+
//按页签名切换,脚本里免去找下标;未找到时静默忽略
|
|
172
|
+
let index = this.getTabIndexByName(name);
|
|
173
|
+
if (index >= 0) {
|
|
174
|
+
this.activeTab(index);
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
|
|
178
|
+
activeTabByLabel(label) {
|
|
179
|
+
let index = this.getTabIndexByLabel(label);
|
|
180
|
+
if (index >= 0) {
|
|
181
|
+
this.activeTab(index);
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
|
|
185
|
+
disableTabByName(name) {
|
|
186
|
+
let index = this.getTabIndexByName(name);
|
|
187
|
+
if (index >= 0) {
|
|
188
|
+
this.disableTab(index);
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
|
|
192
|
+
disableTabByLabel(label) {
|
|
193
|
+
let index = this.getTabIndexByLabel(label);
|
|
194
|
+
if (index >= 0) {
|
|
195
|
+
this.disableTab(index);
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
|
|
199
|
+
enableTabByName(name) {
|
|
200
|
+
let index = this.getTabIndexByName(name);
|
|
201
|
+
if (index >= 0) {
|
|
202
|
+
this.enableTab(index);
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
|
|
206
|
+
enableTabByLabel(label) {
|
|
207
|
+
let index = this.getTabIndexByLabel(label);
|
|
208
|
+
if (index >= 0) {
|
|
209
|
+
this.enableTab(index);
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
|
|
213
|
+
hideTabByName(name) {
|
|
214
|
+
let index = this.getTabIndexByName(name);
|
|
215
|
+
if (index >= 0) {
|
|
216
|
+
this.hideTab(index);
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
|
|
220
|
+
hideTabByLabel(label) {
|
|
221
|
+
let index = this.getTabIndexByLabel(label);
|
|
222
|
+
if (index >= 0) {
|
|
223
|
+
this.hideTab(index);
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
|
|
227
|
+
showTabByName(name) {
|
|
228
|
+
let index = this.getTabIndexByName(name);
|
|
229
|
+
if (index >= 0) {
|
|
230
|
+
this.showTab(index);
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
|
|
234
|
+
showTabByLabel(label) {
|
|
235
|
+
let index = this.getTabIndexByLabel(label);
|
|
236
|
+
if (index >= 0) {
|
|
237
|
+
this.showTab(index);
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
|
|
156
241
|
disableTab(tabIndex) {
|
|
157
242
|
if (tabIndex >= 0 && tabIndex < this.widget.tabs.length) {
|
|
158
243
|
this.widget.tabs[tabIndex].options.disabled = true;
|
|
@@ -193,8 +278,8 @@ modules = {
|
|
|
193
278
|
|
|
194
279
|
disableSubFormRow(rowIndex) {
|
|
195
280
|
this.widget.widgetList.forEach((subWidget) => {
|
|
196
|
-
let swRefName
|
|
197
|
-
subWidget.options.name + "@row" + this.rowIdData[rowIndex];
|
|
281
|
+
let swRefName
|
|
282
|
+
= subWidget.options.name + "@row" + this.rowIdData[rowIndex];
|
|
198
283
|
let foundSW = this.getWidgetRef(swRefName);
|
|
199
284
|
if (!!foundSW) {
|
|
200
285
|
foundSW.setDisabled(true);
|
|
@@ -204,8 +289,8 @@ modules = {
|
|
|
204
289
|
|
|
205
290
|
enableSubFormRow(rowIndex) {
|
|
206
291
|
this.widget.widgetList.forEach((subWidget) => {
|
|
207
|
-
let swRefName
|
|
208
|
-
subWidget.options.name + "@row" + this.rowIdData[rowIndex];
|
|
292
|
+
let swRefName
|
|
293
|
+
= subWidget.options.name + "@row" + this.rowIdData[rowIndex];
|
|
209
294
|
let foundSW = this.getWidgetRef(swRefName);
|
|
210
295
|
if (!!foundSW) {
|
|
211
296
|
foundSW.setDisabled(false);
|
|
@@ -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"
|
|
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,21 +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
|
+
},
|
|
98
107
|
},
|
|
99
108
|
watch: {
|
|
100
109
|
visibleTabs(tabs) {
|
|
101
110
|
const formRef = this.getFormRef();
|
|
102
|
-
if (
|
|
103
|
-
|
|
111
|
+
if (
|
|
112
|
+
formRef
|
|
113
|
+
&& formRef.isFieldControlEnabled()
|
|
114
|
+
&& !tabs.some(tab => tab.options.name === this.activeTabName)
|
|
115
|
+
) {
|
|
104
116
|
this.activeTabName = tabs.length ? tabs[0].options.name : "";
|
|
105
117
|
}
|
|
106
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
|
+
},
|
|
107
131
|
},
|
|
108
132
|
created() {
|
|
109
133
|
this.initRefList();
|
|
134
|
+
this.handleOnCreated();
|
|
110
135
|
},
|
|
111
136
|
mounted() {
|
|
137
|
+
// 先定初始激活页签再跑 onMounted:懒渲染下脚本里读 activeTabName 时已是最终值
|
|
112
138
|
this.initActiveTab();
|
|
139
|
+
this.handleOnMounted();
|
|
113
140
|
},
|
|
114
141
|
beforeDestroy() {
|
|
115
142
|
this.unregisterFromRefList();
|
|
@@ -127,6 +154,18 @@ export default {
|
|
|
127
154
|
}
|
|
128
155
|
}
|
|
129
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
|
+
},
|
|
130
169
|
},
|
|
131
170
|
};
|
|
132
171
|
</script>
|
|
@@ -285,6 +285,9 @@ export default {
|
|
|
285
285
|
tabPaneSetting: "Tab Panes",
|
|
286
286
|
addTabPane: "Add Tab Pane",
|
|
287
287
|
paneActive: "Active",
|
|
288
|
+
lazyRender: "Lazy Render",
|
|
289
|
+
lazyRenderHint:
|
|
290
|
+
"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.",
|
|
288
291
|
customLabelIcon: "Custom Label",
|
|
289
292
|
labelIconClass: "Label Icon Class",
|
|
290
293
|
labelIconPosition: "Label Icon Position",
|
|
@@ -447,6 +447,9 @@ export default {
|
|
|
447
447
|
tabPaneSetting: "选项卡设置",
|
|
448
448
|
addTabPane: "增加选项卡页",
|
|
449
449
|
tabClass: "选项卡样式",
|
|
450
|
+
lazyRender: "懒渲染",
|
|
451
|
+
lazyRenderHint:
|
|
452
|
+
"开启后页签内容首次激活才挂载(激活后保留),未激活页签不渲染、不请求数据。开启前请确认:无跨页签 getWidgetRef 脚本;未访问页签的字段不参与提交校验。适用于详情展示类模板。",
|
|
450
453
|
paneActive: "激活",
|
|
451
454
|
customLabelIcon: "定制字段标签",
|
|
452
455
|
labelIconClass: "标签Icon样式",
|
|
@@ -72,17 +72,17 @@ export const constantRoutes = [
|
|
|
72
72
|
},
|
|
73
73
|
},
|
|
74
74
|
],
|
|
75
|
-
},*/
|
|
76
|
-
{
|
|
77
|
-
path: "",
|
|
78
|
-
component: () => import("@/layout/index"),
|
|
79
|
-
children: [
|
|
80
|
-
{
|
|
81
|
-
path: "/haier/system/salesman/list",
|
|
82
|
-
component: () => import("@/views/haier/system/salesman/list.vue"),
|
|
83
|
-
name: "haierSalesmanPilot",
|
|
84
|
-
meta: { title: "业务员", icon: "user" },
|
|
85
|
-
},
|
|
86
|
-
],
|
|
87
|
-
},
|
|
88
|
-
];
|
|
75
|
+
},*/
|
|
76
|
+
{
|
|
77
|
+
path: "",
|
|
78
|
+
component: () => import("@/layout/index"),
|
|
79
|
+
children: [
|
|
80
|
+
/* {
|
|
81
|
+
path: "/haier/system/salesman/list",
|
|
82
|
+
component: () => import("@/views/haier/system/salesman/list.vue"),
|
|
83
|
+
name: "haierSalesmanPilot",
|
|
84
|
+
meta: { title: "业务员", icon: "user" },
|
|
85
|
+
}, */
|
|
86
|
+
],
|
|
87
|
+
},
|
|
88
|
+
];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// 旧模式(boot-assets.legacy)消费应用的基础样式兜底层。
|
|
2
|
+
// 背景:legacy 入口应用的样式取自应用自己的 @/styles/index.scss 旧副本,
|
|
3
|
+
// 包内新增的基础文件(dialog/page-shell 等)在应用副本里不存在,样式缺斤短两。
|
|
4
|
+
// 本文件由 boot-assets.legacy.js 在应用自有样式之前注入:
|
|
5
|
+
// - 应用副本缺失的文件由包补齐,随包升级;
|
|
6
|
+
// - 应用自有同名文件在本层之后加载,同名规则仍以应用为准,不影响既有定制;
|
|
7
|
+
// - 仅收编“应用常缺失”的文件,element-ui/btn 等应用普遍有自有定制的
|
|
8
|
+
// 不收进来,避免大面积重复。
|
|
9
|
+
// 自包含:先引 variables/mixin,后面的文件才拿得到变量和混入;
|
|
10
|
+
// 不依赖 element 主题变量(element-variables 由应用自己编译)。
|
|
11
|
+
@import "./variables.scss";
|
|
12
|
+
@import "./mixin.scss";
|
|
13
|
+
@import "./utilities.scss";
|
|
14
|
+
@import "./split-handle.scss";
|
|
15
|
+
@import "./nprogress.scss";
|
|
16
|
+
@import "./menu-icons.scss";
|
|
17
|
+
@import "./dialog.scss";
|
|
18
|
+
@import "./page-shell.scss";
|
|
19
|
+
@import "./layout-skins.scss";
|