cloud-web-corejs 1.0.314 → 1.0.316
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/app-bootstrap.js +8 -1
- package/src/app-bootstrap.sync.js +8 -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 +2 -2
- package/src/components/table/plugins/cell-area/index.js +1062 -0
- package/src/components/table/plugins/cell-area/index.scss +77 -0
- package/src/components/table/plugins/cell-area/util.js +224 -0
- package/src/components/xform/form-designer/designer.js +1 -0
- package/src/components/xform/form-designer/form-widget/dialog/formDialog.vue +30 -4
- package/src/components/xform/form-designer/form-widget/dialog/searchFormDialog.vue +27 -4
- package/src/components/xform/form-designer/setting-panel/form-setting.vue +60 -39
- 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 +489 -404
- package/src/components/xform/form-render/container-item/panel-item.vue +1 -1
- package/src/components/xform/form-render/container-item/tab-item.vue +48 -0
- package/src/components/xform/form-render/indexMixin.js +17 -2
- package/src/components/xform/form-render/pageDialogScope.js +54 -0
- 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/components/xform/styles/h5-designer.scss +13 -13
- package/src/components/xform/styles/h5-runtime.scss +520 -0
- package/src/components/xform/styles/h5.scss +5 -2
- package/src/components/xform/utils/util.js +1 -0
- package/src/directive/el-drag-dialog/drag.js +32 -2
- package/src/router/index.js +41 -32
- package/src/styles/btn.scss +214 -3
- package/src/styles/dialog.scss +1710 -0
- package/src/styles/element-ui.scss +957 -36
- package/src/styles/index.scss +45 -0
- package/src/styles/layout-skins.scss +840 -0
- package/src/styles/legacy-base.scss +19 -0
- package/src/styles/mixin.scss +8 -0
- package/src/styles/page-shell.scss +723 -0
- package/src/styles/sidebar.scss +15 -0
- package/src/styles/utilities.scss +234 -118
- package/src/styles/variables.scss +28 -0
- package/src/views/user/form/view/list.vue +24 -1
|
@@ -1,404 +1,489 @@
|
|
|
1
|
-
import {
|
|
2
|
-
traverseFieldWidgetsOfContainer,
|
|
3
|
-
traverseWidgetsOfContainer,
|
|
4
|
-
} from "../../../../components/xform/utils/util";
|
|
5
|
-
import {
|
|
6
|
-
getReportGlobalMap,
|
|
7
|
-
getAccessUrl,
|
|
8
|
-
} from "../../../../components/xform/utils/util";
|
|
9
|
-
import scriptHttpMixin from "../../../../components/xform/mixins/scriptHttp";
|
|
10
|
-
import defaultHandleMixin from "../../../../components/xform/mixins/defaultHandle";
|
|
11
|
-
import settingConfig from "@/settings.js";
|
|
12
|
-
let modules = {};
|
|
13
|
-
const isDev = process.env.NODE_ENV === "development";
|
|
14
|
-
const baseRefUtil = {
|
|
15
|
-
traverseFieldWidgetsOfContainer,
|
|
16
|
-
getReportGlobalMap,
|
|
17
|
-
getAccessUrl,
|
|
18
|
-
};
|
|
19
|
-
modules = {
|
|
20
|
-
props: {
|
|
21
|
-
tableParam: {
|
|
22
|
-
type: Object,
|
|
23
|
-
default: null,
|
|
24
|
-
},
|
|
25
|
-
formItemProp: {
|
|
26
|
-
type: String,
|
|
27
|
-
default: null,
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
mixins: [scriptHttpMixin, defaultHandleMixin],
|
|
31
|
-
inject: ["widgetKeyNameMap", "doScriptAccess", "getReportTemplate"],
|
|
32
|
-
data() {
|
|
33
|
-
return {
|
|
34
|
-
extraAccessData: {},
|
|
35
|
-
timerMap: {},
|
|
36
|
-
};
|
|
37
|
-
},
|
|
38
|
-
computed: {
|
|
39
|
-
customClass() {
|
|
40
|
-
return this.widget.options.customClass || "";
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
formModel: {
|
|
44
|
-
cache: false,
|
|
45
|
-
get() {
|
|
46
|
-
return this.globalModel.formModel;
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
fieldKeyName() {
|
|
50
|
-
let o = this.widget.options.name;
|
|
51
|
-
return (
|
|
52
|
-
(this.widget.options.keyNameEnabled && this.widget.options.keyName) || o
|
|
53
|
-
);
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
beforeDestroy() {
|
|
57
|
-
this.clearAllInterval();
|
|
58
|
-
},
|
|
59
|
-
created() {},
|
|
60
|
-
mounted() {
|
|
61
|
-
this.callSetHidden();
|
|
62
|
-
},
|
|
63
|
-
methods: {
|
|
64
|
-
setFormScriptEnabled(value) {
|
|
65
|
-
this.widget.options.formScriptEnabled = value || false;
|
|
66
|
-
},
|
|
67
|
-
unregisterFromRefList() {
|
|
68
|
-
//销毁容器组件时注销组件ref
|
|
69
|
-
// 注销 key 必须与 refMixin.initRefList 对齐:行内容器注册的是 name + "@row" + rowIndex,
|
|
70
|
-
// 且 initRefList 会无条件注册一份不带后缀的 name。仅当 key 仍指向当前实例时才删除,
|
|
71
|
-
// 避免同名容器重建时误删新注册的实例。
|
|
72
|
-
if (this.refList !== null && !!this.widget.options.name) {
|
|
73
|
-
let name = this.widget.options.name;
|
|
74
|
-
let inRow
|
|
75
|
-
this.subFormRowIndex !== -1
|
|
76
|
-
this.subFormRowIndex !== void 0
|
|
77
|
-
!!this.tableParam;
|
|
78
|
-
let key = inRow ? name + "@row" + this.tableParam.rowIndex : name;
|
|
79
|
-
if (this.refList[key] === this) {
|
|
80
|
-
delete this.refList[key];
|
|
81
|
-
}
|
|
82
|
-
if (key !== name && this.refList[name] === this) {
|
|
83
|
-
delete this.refList[name];
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
|
|
88
|
-
/* 主动触发setHidden()方法,以清空被隐藏容器内字段组件的校验规则!! */
|
|
89
|
-
callSetHidden() {
|
|
90
|
-
if (this.widget.options.hidden === true) {
|
|
91
|
-
this.setHidden(true);
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
-
//--------------------- 以下为组件支持外部调用的API方法 begin ------------------//
|
|
96
|
-
/* 提示:用户可自行扩充这些方法!!! */
|
|
97
|
-
|
|
98
|
-
setHidden(flag) {
|
|
99
|
-
this.widget.options.hidden = flag;
|
|
100
|
-
|
|
101
|
-
/* 容器被隐藏后,需要同步清除容器内部字段组件的校验规则 */
|
|
102
|
-
let clearRulesFn = (fieldWidget) => {
|
|
103
|
-
let fwName = fieldWidget.options.name;
|
|
104
|
-
let fwRef = this.getWidgetRef(fwName);
|
|
105
|
-
if (flag && !!fwRef && !!fwRef.clearFieldRules) {
|
|
106
|
-
fwRef.clearFieldRules();
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
if (!flag && !!fwRef && !!fwRef.buildFieldRules) {
|
|
110
|
-
fwRef.buildFieldRules();
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
baseRefUtil.traverseFieldWidgetsOfContainer(this.widget, clearRulesFn);
|
|
115
|
-
},
|
|
116
|
-
/**
|
|
117
|
-
* 禁用或启用容器组件(包含容器内部的所有组件)
|
|
118
|
-
* @param flag
|
|
119
|
-
*/
|
|
120
|
-
/* setDisabled(flag) {
|
|
121
|
-
const fwHandler = (fw) => {
|
|
122
|
-
const fwName = fw.options.name
|
|
123
|
-
const fwRef = this.getWidgetRef(fwName)
|
|
124
|
-
if (!!fwRef && !!fwRef.setDisabled) {
|
|
125
|
-
fwRef.setDisabled(flag, true)
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
const cwHandler = (cw) => {
|
|
129
|
-
if (cw.id === this.widget.id) { //避免死循环!!!
|
|
130
|
-
return
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
const cwName = cw.options.name
|
|
134
|
-
const cwRef = this.getWidgetRef(cwName)
|
|
135
|
-
if (!!cwRef && !!cwRef.setDisabled) {
|
|
136
|
-
cwRef.setDisabled(flag)
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
traverseWidgetsOfContainer(this.widget, fwHandler, cwHandler)
|
|
140
|
-
|
|
141
|
-
//注意:单行子表单、多行子表单容器的setDisabled方法由单行子表单、多行子表单组件自己实现!!
|
|
142
|
-
}, */
|
|
143
|
-
|
|
144
|
-
activeTab(tabIndex) {
|
|
145
|
-
//tabIndex从0计数
|
|
146
|
-
if (tabIndex >= 0 && tabIndex < this.widget.tabs.length) {
|
|
147
|
-
this.widget.tabs.forEach((tp, idx) => {
|
|
148
|
-
tp.options.active = idx === tabIndex;
|
|
149
|
-
if (idx === tabIndex) {
|
|
150
|
-
this.activeTabName = tp.options.name;
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
},
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
},
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
}
|
|
251
|
-
},
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
if (this.widget.
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
this.
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
if (
|
|
314
|
-
|
|
315
|
-
this.
|
|
316
|
-
});
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
this.
|
|
321
|
-
},
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
},
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
|
|
1
|
+
import {
|
|
2
|
+
traverseFieldWidgetsOfContainer,
|
|
3
|
+
traverseWidgetsOfContainer,
|
|
4
|
+
} from "../../../../components/xform/utils/util";
|
|
5
|
+
import {
|
|
6
|
+
getReportGlobalMap,
|
|
7
|
+
getAccessUrl,
|
|
8
|
+
} from "../../../../components/xform/utils/util";
|
|
9
|
+
import scriptHttpMixin from "../../../../components/xform/mixins/scriptHttp";
|
|
10
|
+
import defaultHandleMixin from "../../../../components/xform/mixins/defaultHandle";
|
|
11
|
+
import settingConfig from "@/settings.js";
|
|
12
|
+
let modules = {};
|
|
13
|
+
const isDev = process.env.NODE_ENV === "development";
|
|
14
|
+
const baseRefUtil = {
|
|
15
|
+
traverseFieldWidgetsOfContainer,
|
|
16
|
+
getReportGlobalMap,
|
|
17
|
+
getAccessUrl,
|
|
18
|
+
};
|
|
19
|
+
modules = {
|
|
20
|
+
props: {
|
|
21
|
+
tableParam: {
|
|
22
|
+
type: Object,
|
|
23
|
+
default: null,
|
|
24
|
+
},
|
|
25
|
+
formItemProp: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: null,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
mixins: [scriptHttpMixin, defaultHandleMixin],
|
|
31
|
+
inject: ["widgetKeyNameMap", "doScriptAccess", "getReportTemplate"],
|
|
32
|
+
data() {
|
|
33
|
+
return {
|
|
34
|
+
extraAccessData: {},
|
|
35
|
+
timerMap: {},
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
computed: {
|
|
39
|
+
customClass() {
|
|
40
|
+
return this.widget.options.customClass || "";
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
formModel: {
|
|
44
|
+
cache: false,
|
|
45
|
+
get() {
|
|
46
|
+
return this.globalModel.formModel;
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
fieldKeyName() {
|
|
50
|
+
let o = this.widget.options.name;
|
|
51
|
+
return (
|
|
52
|
+
(this.widget.options.keyNameEnabled && this.widget.options.keyName) || o
|
|
53
|
+
);
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
beforeDestroy() {
|
|
57
|
+
this.clearAllInterval();
|
|
58
|
+
},
|
|
59
|
+
created() {},
|
|
60
|
+
mounted() {
|
|
61
|
+
this.callSetHidden();
|
|
62
|
+
},
|
|
63
|
+
methods: {
|
|
64
|
+
setFormScriptEnabled(value) {
|
|
65
|
+
this.widget.options.formScriptEnabled = value || false;
|
|
66
|
+
},
|
|
67
|
+
unregisterFromRefList() {
|
|
68
|
+
//销毁容器组件时注销组件ref
|
|
69
|
+
// 注销 key 必须与 refMixin.initRefList 对齐:行内容器注册的是 name + "@row" + rowIndex,
|
|
70
|
+
// 且 initRefList 会无条件注册一份不带后缀的 name。仅当 key 仍指向当前实例时才删除,
|
|
71
|
+
// 避免同名容器重建时误删新注册的实例。
|
|
72
|
+
if (this.refList !== null && !!this.widget.options.name) {
|
|
73
|
+
let name = this.widget.options.name;
|
|
74
|
+
let inRow
|
|
75
|
+
= this.subFormRowIndex !== -1
|
|
76
|
+
&& this.subFormRowIndex !== void 0
|
|
77
|
+
&& !!this.tableParam;
|
|
78
|
+
let key = inRow ? name + "@row" + this.tableParam.rowIndex : name;
|
|
79
|
+
if (this.refList[key] === this) {
|
|
80
|
+
delete this.refList[key];
|
|
81
|
+
}
|
|
82
|
+
if (key !== name && this.refList[name] === this) {
|
|
83
|
+
delete this.refList[name];
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
/* 主动触发setHidden()方法,以清空被隐藏容器内字段组件的校验规则!! */
|
|
89
|
+
callSetHidden() {
|
|
90
|
+
if (this.widget.options.hidden === true) {
|
|
91
|
+
this.setHidden(true);
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
//--------------------- 以下为组件支持外部调用的API方法 begin ------------------//
|
|
96
|
+
/* 提示:用户可自行扩充这些方法!!! */
|
|
97
|
+
|
|
98
|
+
setHidden(flag) {
|
|
99
|
+
this.widget.options.hidden = flag;
|
|
100
|
+
|
|
101
|
+
/* 容器被隐藏后,需要同步清除容器内部字段组件的校验规则 */
|
|
102
|
+
let clearRulesFn = (fieldWidget) => {
|
|
103
|
+
let fwName = fieldWidget.options.name;
|
|
104
|
+
let fwRef = this.getWidgetRef(fwName);
|
|
105
|
+
if (flag && !!fwRef && !!fwRef.clearFieldRules) {
|
|
106
|
+
fwRef.clearFieldRules();
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (!flag && !!fwRef && !!fwRef.buildFieldRules) {
|
|
110
|
+
fwRef.buildFieldRules();
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
baseRefUtil.traverseFieldWidgetsOfContainer(this.widget, clearRulesFn);
|
|
115
|
+
},
|
|
116
|
+
/**
|
|
117
|
+
* 禁用或启用容器组件(包含容器内部的所有组件)
|
|
118
|
+
* @param flag
|
|
119
|
+
*/
|
|
120
|
+
/* setDisabled(flag) {
|
|
121
|
+
const fwHandler = (fw) => {
|
|
122
|
+
const fwName = fw.options.name
|
|
123
|
+
const fwRef = this.getWidgetRef(fwName)
|
|
124
|
+
if (!!fwRef && !!fwRef.setDisabled) {
|
|
125
|
+
fwRef.setDisabled(flag, true)
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
const cwHandler = (cw) => {
|
|
129
|
+
if (cw.id === this.widget.id) { //避免死循环!!!
|
|
130
|
+
return
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const cwName = cw.options.name
|
|
134
|
+
const cwRef = this.getWidgetRef(cwName)
|
|
135
|
+
if (!!cwRef && !!cwRef.setDisabled) {
|
|
136
|
+
cwRef.setDisabled(flag)
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
traverseWidgetsOfContainer(this.widget, fwHandler, cwHandler)
|
|
140
|
+
|
|
141
|
+
//注意:单行子表单、多行子表单容器的setDisabled方法由单行子表单、多行子表单组件自己实现!!
|
|
142
|
+
}, */
|
|
143
|
+
|
|
144
|
+
activeTab(tabIndex) {
|
|
145
|
+
//tabIndex从0计数
|
|
146
|
+
if (tabIndex >= 0 && tabIndex < this.widget.tabs.length) {
|
|
147
|
+
this.widget.tabs.forEach((tp, idx) => {
|
|
148
|
+
tp.options.active = idx === tabIndex;
|
|
149
|
+
if (idx === tabIndex) {
|
|
150
|
+
this.activeTabName = tp.options.name;
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
},
|
|
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
|
+
|
|
241
|
+
disableTab(tabIndex) {
|
|
242
|
+
if (tabIndex >= 0 && tabIndex < this.widget.tabs.length) {
|
|
243
|
+
this.widget.tabs[tabIndex].options.disabled = true;
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
|
|
247
|
+
enableTab(tabIndex) {
|
|
248
|
+
if (tabIndex >= 0 && tabIndex < this.widget.tabs.length) {
|
|
249
|
+
this.widget.tabs[tabIndex].options.disabled = false;
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
|
|
253
|
+
hideTab(tabIndex) {
|
|
254
|
+
if (tabIndex >= 0 && tabIndex < this.widget.tabs.length) {
|
|
255
|
+
this.widget.tabs[tabIndex].options.hidden = true;
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
|
|
259
|
+
showTab(tabIndex) {
|
|
260
|
+
if (tabIndex >= 0 && tabIndex < this.widget.tabs.length) {
|
|
261
|
+
this.widget.tabs[tabIndex].options.hidden = false;
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
|
|
265
|
+
setWidgetOption(optionName, optionValue) {
|
|
266
|
+
//通用组件选项修改API
|
|
267
|
+
if (this.widget.options.hasOwnProperty(optionName)) {
|
|
268
|
+
this.widget.options[optionName] = optionValue;
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* 获取子表单的行数
|
|
274
|
+
*/
|
|
275
|
+
getSubFormRowCount() {
|
|
276
|
+
return !this.rowIdData ? 0 : this.rowIdData.length;
|
|
277
|
+
},
|
|
278
|
+
|
|
279
|
+
disableSubFormRow(rowIndex) {
|
|
280
|
+
this.widget.widgetList.forEach((subWidget) => {
|
|
281
|
+
let swRefName
|
|
282
|
+
= subWidget.options.name + "@row" + this.rowIdData[rowIndex];
|
|
283
|
+
let foundSW = this.getWidgetRef(swRefName);
|
|
284
|
+
if (!!foundSW) {
|
|
285
|
+
foundSW.setDisabled(true);
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
},
|
|
289
|
+
|
|
290
|
+
enableSubFormRow(rowIndex) {
|
|
291
|
+
this.widget.widgetList.forEach((subWidget) => {
|
|
292
|
+
let swRefName
|
|
293
|
+
= subWidget.options.name + "@row" + this.rowIdData[rowIndex];
|
|
294
|
+
let foundSW = this.getWidgetRef(swRefName);
|
|
295
|
+
if (!!foundSW) {
|
|
296
|
+
foundSW.setDisabled(false);
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
},
|
|
300
|
+
|
|
301
|
+
disableSubForm() {
|
|
302
|
+
if (this.rowIdData.length > 0) {
|
|
303
|
+
this.rowIdData.forEach((dataRow, rIdx) => {
|
|
304
|
+
this.disableSubFormRow(rIdx);
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
//禁用3个操作按钮
|
|
309
|
+
this.actionDisabled = true;
|
|
310
|
+
},
|
|
311
|
+
|
|
312
|
+
enableSubForm() {
|
|
313
|
+
if (this.rowIdData.length > 0) {
|
|
314
|
+
this.rowIdData.forEach((dataRow, rIdx) => {
|
|
315
|
+
this.enableSubFormRow(rIdx);
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
//启用3个操作按钮
|
|
320
|
+
this.actionDisabled = false;
|
|
321
|
+
},
|
|
322
|
+
|
|
323
|
+
resetSubForm() {
|
|
324
|
+
//重置subForm数据为空
|
|
325
|
+
if (this.widget.type === "sub-form") {
|
|
326
|
+
let subFormModel = this.formModel[this.widget.options.name];
|
|
327
|
+
if (!!subFormModel) {
|
|
328
|
+
subFormModel.splice(0, subFormModel.length);
|
|
329
|
+
this.rowIdData.splice(0, this.rowIdData.length);
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
if (this.widget.options.showBlankRow) {
|
|
333
|
+
this.addSubFormRow();
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
},
|
|
337
|
+
|
|
338
|
+
getSubFormValues(needValidation = true) {
|
|
339
|
+
if (this.widget.type === "sub-form") {
|
|
340
|
+
//TODO: 逐行校验子表单!暂未实现!!
|
|
341
|
+
return this.formModel[this.widget.options.name];
|
|
342
|
+
} else {
|
|
343
|
+
this.$message.error(this.i18nt("render.hint.nonSubFormType"));
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
|
|
347
|
+
setSubFormValues(subFormValues) {
|
|
348
|
+
//TODO: 待实现!!
|
|
349
|
+
},
|
|
350
|
+
|
|
351
|
+
// validateField(fieldName) { //逐行校验子表单字段
|
|
352
|
+
// //TODO:
|
|
353
|
+
// },
|
|
354
|
+
//
|
|
355
|
+
// validateSubForm() { //逐行校验子表单全部字段
|
|
356
|
+
// //TODO:
|
|
357
|
+
// },
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* 动态增加自定义css样式
|
|
361
|
+
* @param className
|
|
362
|
+
*/
|
|
363
|
+
addCssClass(className) {
|
|
364
|
+
if (!this.widget.options.customClass) {
|
|
365
|
+
this.widget.options.customClass = [className];
|
|
366
|
+
} else {
|
|
367
|
+
this.widget.options.customClass.push(className);
|
|
368
|
+
}
|
|
369
|
+
},
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* 动态移除自定义css样式
|
|
373
|
+
* @param className
|
|
374
|
+
*/
|
|
375
|
+
removeCssClass(className) {
|
|
376
|
+
if (!this.widget.options.customClass) {
|
|
377
|
+
return;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
let foundIdx = -1;
|
|
381
|
+
this.widget.options.customClass.map((cc, idx) => {
|
|
382
|
+
if (cc === className) {
|
|
383
|
+
foundIdx = idx;
|
|
384
|
+
}
|
|
385
|
+
});
|
|
386
|
+
if (foundIdx > -1) {
|
|
387
|
+
this.widget.options.customClass.splice(foundIdx, 1);
|
|
388
|
+
}
|
|
389
|
+
},
|
|
390
|
+
handleOnCreated: function () {
|
|
391
|
+
this.handleCustomEvent(this.widget.options.onCreated);
|
|
392
|
+
},
|
|
393
|
+
handleOnMounted: function () {
|
|
394
|
+
this.handleCustomEvent(this.widget.options.onMounted);
|
|
395
|
+
// this.autoExcScript();
|
|
396
|
+
},
|
|
397
|
+
addExtraAccessData(data) {
|
|
398
|
+
if (data) {
|
|
399
|
+
Object.keys(data).forEach((field) => {
|
|
400
|
+
this.extraAccessData[field] = data[field];
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
},
|
|
404
|
+
clearExtraAccessData() {
|
|
405
|
+
this.extraAccessData = {};
|
|
406
|
+
},
|
|
407
|
+
doAccess(accessCode, conditions, callback) {
|
|
408
|
+
let path = baseRefUtil.getAccessUrl();
|
|
409
|
+
let globalReqData = baseRefUtil.getReportGlobalMap(); //全局请求参数
|
|
410
|
+
return this.$http({
|
|
411
|
+
url: path,
|
|
412
|
+
method: `post`,
|
|
413
|
+
loadingTarget: document.body,
|
|
414
|
+
data: {
|
|
415
|
+
accessCode: accessCode,
|
|
416
|
+
conditions: {
|
|
417
|
+
...conditions,
|
|
418
|
+
...globalReqData,
|
|
419
|
+
},
|
|
420
|
+
},
|
|
421
|
+
isLoading: true,
|
|
422
|
+
success: (res) => {
|
|
423
|
+
callback && callback(res.objx);
|
|
424
|
+
},
|
|
425
|
+
});
|
|
426
|
+
},
|
|
427
|
+
//--------------------- 以上为组件支持外部调用的API方法 end ------------------//
|
|
428
|
+
getEventParam() {
|
|
429
|
+
let formRef = this.getFormRef();
|
|
430
|
+
let dataId = formRef?.dataId;
|
|
431
|
+
let formCode = formRef?.reportTemplate?.formCode;
|
|
432
|
+
return {
|
|
433
|
+
eventParamNames: ["dataId", "formCode"],
|
|
434
|
+
eventParamValues: [dataId, formCode],
|
|
435
|
+
};
|
|
436
|
+
},
|
|
437
|
+
handleCustomEvent(funtionStr, eventParamNames = [], eventParamValues = []) {
|
|
438
|
+
if (!this.designState && funtionStr) {
|
|
439
|
+
let eventParam = this.getEventParam();
|
|
440
|
+
var e = new Function(
|
|
441
|
+
...eventParam.eventParamNames,
|
|
442
|
+
...eventParamNames,
|
|
443
|
+
funtionStr
|
|
444
|
+
);
|
|
445
|
+
// return e.call(this, ...eventParam.eventParamValues, ...eventParamValues);
|
|
446
|
+
let that = this;
|
|
447
|
+
try {
|
|
448
|
+
return e.call(
|
|
449
|
+
this,
|
|
450
|
+
...eventParam.eventParamValues,
|
|
451
|
+
...eventParamValues
|
|
452
|
+
);
|
|
453
|
+
} catch (error) {
|
|
454
|
+
if (settingConfig.fontErrorTipEnabled) {
|
|
455
|
+
that.$errorMsg({
|
|
456
|
+
rmid: that.$t1("前端脚本异常"),
|
|
457
|
+
content: error.message,
|
|
458
|
+
type: "error",
|
|
459
|
+
_errorMsg: error.stack,
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
throw error;
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
},
|
|
466
|
+
addInterval(handler, timeout) {
|
|
467
|
+
let timer = setInterval(handler, timeout);
|
|
468
|
+
this.timerMap[timer] = timer;
|
|
469
|
+
return timer;
|
|
470
|
+
},
|
|
471
|
+
clearAllInterval() {
|
|
472
|
+
let timerMap = this.timerMap;
|
|
473
|
+
for (let key in timerMap) {
|
|
474
|
+
let timer = timerMap[key];
|
|
475
|
+
clearInterval(timer);
|
|
476
|
+
}
|
|
477
|
+
this.timerMap = {};
|
|
478
|
+
},
|
|
479
|
+
getI18nLabel(label, path, param) {
|
|
480
|
+
return !this.designState && label ? this.$t2(label, path, param) : label;
|
|
481
|
+
},
|
|
482
|
+
getParentTarget() {
|
|
483
|
+
let name = this.parentWidget?.options?.name ?? null;
|
|
484
|
+
return name ? this.getWidgetRef(name) : null;
|
|
485
|
+
},
|
|
486
|
+
},
|
|
487
|
+
};
|
|
488
|
+
|
|
489
|
+
export default modules;
|