cloud-web-corejs 1.0.54-dev.185 → 1.0.54-dev.186
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/components/xform/form-designer/form-widget/field-widget/checkbox-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +126 -90
- package/src/components/xform/form-designer/form-widget/field-widget/radio-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/select-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/vabUpload-widget.vue +2 -8
- package/src/components/xform/form-render/container-item/data-table-mixin.js +4 -2
package/package.json
CHANGED
@@ -467,11 +467,10 @@ modules = {
|
|
467
467
|
: delete this.refList[e];
|
468
468
|
}
|
469
469
|
},
|
470
|
-
|
471
|
-
|
472
|
-
return key;
|
470
|
+
initOptionItemsHandle() {
|
471
|
+
this.initGloatOptionItems(true);
|
473
472
|
},
|
474
|
-
|
473
|
+
initGloatOptionItems(initFlag) {
|
475
474
|
var t = this;
|
476
475
|
if (this.designState) {
|
477
476
|
return;
|
@@ -489,13 +488,13 @@ modules = {
|
|
489
488
|
let scriptCode = this.field.options.formScriptCode || "getList";
|
490
489
|
let tableParam = this.tableParam;
|
491
490
|
if (formScriptEnabled) {
|
492
|
-
|
493
|
-
let optionItems = this.
|
494
|
-
if(optionItems!==undefined){
|
491
|
+
if (initFlag && tableParam) {
|
492
|
+
let optionItems = this.getOptionItemsFlag()
|
493
|
+
if (optionItems !== undefined) {
|
495
494
|
return
|
496
495
|
}
|
497
|
-
this.
|
498
|
-
}
|
496
|
+
this.setOptionItemsFlag(null)
|
497
|
+
}
|
499
498
|
let accessParam = this.handleCustomEvent(
|
500
499
|
this.field.options.formScriptParam
|
501
500
|
);
|
@@ -511,7 +510,7 @@ modules = {
|
|
511
510
|
},
|
512
511
|
callback: (res) => {
|
513
512
|
let rows = res.objx || [];
|
514
|
-
this.
|
513
|
+
this.loadGloatOptions(rows, initFlag);
|
515
514
|
this.handleCustomEvent(
|
516
515
|
this.field.options.formScriptSuccess,
|
517
516
|
["res"],
|
@@ -522,17 +521,17 @@ modules = {
|
|
522
521
|
} else if (this.field.options.commonAttributeEnabled) {
|
523
522
|
let commonAttributeCode = this.field.options.commonAttributeCode;
|
524
523
|
if (!commonAttributeCode) return;
|
525
|
-
|
526
|
-
let optionItems = this.
|
527
|
-
if(optionItems!==undefined){
|
524
|
+
if (initFlag && tableParam) {
|
525
|
+
let optionItems = this.getOptionItemsFlag();
|
526
|
+
if (optionItems !== undefined) {
|
528
527
|
return
|
529
528
|
}
|
530
|
-
this.
|
531
|
-
}
|
529
|
+
this.setOptionItemsFlag(null)
|
530
|
+
}
|
532
531
|
this.$getBaseDicts({
|
533
532
|
code: commonAttributeCode,
|
534
533
|
success: ({dicts, dictMap}) => {
|
535
|
-
this.
|
534
|
+
this.loadGloatOptions(dicts, initFlag);
|
536
535
|
this.handleCustomEvent(
|
537
536
|
this.field.options.formScriptSuccess,
|
538
537
|
["res"],
|
@@ -540,63 +539,116 @@ modules = {
|
|
540
539
|
);
|
541
540
|
},
|
542
541
|
});
|
543
|
-
} else {
|
544
|
-
if (tableParam) {
|
545
|
-
// tableParam.column.params.optionItems
|
546
|
-
// let key = this.getOptionKey();
|
547
|
-
// let optionItems = tableParam.column.params[key];
|
548
|
-
let optionItems = this.getGloatOptionItems();
|
549
|
-
if (optionItems !== undefined) {
|
550
|
-
return
|
551
|
-
}
|
552
|
-
// tableParam.column.params[key] = this.$baseLodash.cloneDeep(this.field.options.optionItems);
|
553
|
-
this.setGloatOptionItems(this.$baseLodash.cloneDeep(this.field.options.optionItems));
|
554
|
-
}
|
555
542
|
}
|
556
543
|
|
557
544
|
return;
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
545
|
+
}
|
546
|
+
},
|
547
|
+
loadGloatOptions: function (e, initFlag) {
|
548
|
+
let optionItems = baseRefUtil.translateOptionItems(
|
549
|
+
e,
|
550
|
+
this.field.type,
|
551
|
+
this.field.options.labelKey || "label",
|
552
|
+
this.field.options.valueKey || "value"
|
553
|
+
);
|
554
|
+
this.field.options.optionItems = optionItems
|
555
|
+
let tableParam = this.tableParam;
|
556
|
+
if (tableParam) {
|
557
|
+
if (initFlag) {
|
558
|
+
this.setOptionItemsFlag(true)
|
559
|
+
}
|
560
|
+
this.loadTableOtions(e)
|
561
|
+
}
|
562
|
+
},
|
563
|
+
loadTableOtions(optionItems) {
|
564
|
+
let tableParam = this.tableParam;
|
565
|
+
if (tableParam) {
|
566
|
+
let widgetName = this.field.options.name;
|
567
|
+
let tableWidgetName = tableParam.column.params.tableWidgetName
|
568
|
+
let tableTarget = this.getWidgetRef(tableWidgetName);
|
569
|
+
tableTarget.loopHandleWidgetByName(widgetName, (row, widget, target) => {
|
570
|
+
widget.options.optionItems = optionItems
|
571
|
+
})
|
572
|
+
if (tableParam.column.params.widget) {
|
573
|
+
if (tableParam.column.params.widget.options.name == widgetName) {
|
574
|
+
tableParam.column.params.widget.options.optionItems = optionItems
|
577
575
|
}
|
578
|
-
} else {
|
579
|
-
var n, a, l, s, r, d;
|
580
576
|
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
return;
|
577
|
+
}
|
578
|
+
if (tableParam.column.params.editWidget) {
|
579
|
+
if (tableParam.column.params.editWidget.options.name == widgetName) {
|
580
|
+
tableParam.column.params.editWidget.options.optionItems = optionItems
|
586
581
|
}
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
582
|
+
}
|
583
|
+
if (tableParam.column.params.widgetList?.length) {
|
584
|
+
this.loopHandleWidget(tableParam.column.params.widgetList, (item1) => {
|
585
|
+
if (item1.options.name == widgetName) {
|
586
|
+
item1.options.optionItems = optionItems
|
587
|
+
}
|
588
|
+
});
|
589
|
+
}
|
590
|
+
|
591
|
+
delete tableParam.column.params[widgetName]
|
592
|
+
}
|
593
|
+
},
|
594
|
+
async initOptionItems(gloatFlag) {
|
595
|
+
var t = this;
|
596
|
+
if (this.designState) {
|
597
|
+
return;
|
598
|
+
}
|
599
|
+
|
600
|
+
if (
|
601
|
+
this.field.type === "radio" ||
|
602
|
+
this.field.type === "checkbox" ||
|
603
|
+
this.field.type === "select" ||
|
604
|
+
this.field.type === "cascader"
|
605
|
+
) {
|
606
|
+
let reportTemplate = this.getFormRef().reportTemplate;
|
607
|
+
let formCode = reportTemplate.formCode;
|
608
|
+
let formScriptEnabled = this.field.options.formScriptEnabled || false;
|
609
|
+
let scriptCode = this.field.options.formScriptCode || "getList";
|
610
|
+
let tableParam = this.tableParam;
|
611
|
+
if (formScriptEnabled) {
|
612
|
+
let accessParam = this.handleCustomEvent(
|
613
|
+
this.field.options.formScriptParam
|
614
|
+
);
|
615
|
+
return this.formHttp({
|
616
|
+
scriptCode: scriptCode,
|
617
|
+
data: {
|
618
|
+
formCode: formCode,
|
619
|
+
formVersion: reportTemplate.formVersion,
|
620
|
+
taBm: this.fieldKeyName,
|
621
|
+
data: {
|
622
|
+
...accessParam,
|
623
|
+
},
|
624
|
+
},
|
625
|
+
callback: (res) => {
|
626
|
+
let rows = res.objx || [];
|
627
|
+
this.loadOptions(rows);
|
628
|
+
this.handleCustomEvent(
|
629
|
+
this.field.options.formScriptSuccess,
|
630
|
+
["res"],
|
631
|
+
[res]
|
632
|
+
);
|
633
|
+
},
|
634
|
+
});
|
635
|
+
} else if (this.field.options.commonAttributeEnabled) {
|
636
|
+
let commonAttributeCode = this.field.options.commonAttributeCode;
|
637
|
+
if (!commonAttributeCode) return;
|
638
|
+
this.$getBaseDicts({
|
639
|
+
code: commonAttributeCode,
|
640
|
+
success: ({dicts, dictMap}) => {
|
641
|
+
this.loadOptions(dicts);
|
642
|
+
this.handleCustomEvent(
|
643
|
+
this.field.options.formScriptSuccess,
|
644
|
+
["res"],
|
645
|
+
[dicts]
|
646
|
+
);
|
647
|
+
},
|
648
|
+
});
|
649
|
+
}
|
650
|
+
|
651
|
+
return;
|
600
652
|
}
|
601
653
|
},
|
602
654
|
refreshDefaultValue: function () {
|
@@ -1157,19 +1209,18 @@ modules = {
|
|
1157
1209
|
this.field.options.valueKey || "value"
|
1158
1210
|
);
|
1159
1211
|
this.field.options.optionItems = optionItems
|
1160
|
-
/*let tableParam = this.tableParam;
|
1161
|
-
if(tableParam){
|
1162
|
-
this.setGloatOptionItems(optionItems)
|
1163
|
-
tableParam.column.params.rowOptionFlag = rowOptionFlag
|
1164
|
-
}*/
|
1165
1212
|
},
|
1166
|
-
|
1213
|
+
getOptionKey() {
|
1214
|
+
let key = "optionItems-" + this.field.options.name
|
1215
|
+
return key;
|
1216
|
+
},
|
1217
|
+
getOptionItemsFlag: function () {
|
1167
1218
|
let key = this.getOptionKey()
|
1168
1219
|
return this.getGlobalParam(key);
|
1169
1220
|
},
|
1170
|
-
|
1221
|
+
setOptionItemsFlag: function (flag) {
|
1171
1222
|
let key = this.getOptionKey()
|
1172
|
-
return this.setGlobalParam(key,
|
1223
|
+
return this.setGlobalParam(key, flag);
|
1173
1224
|
},
|
1174
1225
|
reloadOptions: function (e) {
|
1175
1226
|
let optionItems = baseRefUtil.translateOptionItems(
|
@@ -1179,13 +1230,6 @@ modules = {
|
|
1179
1230
|
this.field.options.valueKey || "value"
|
1180
1231
|
);
|
1181
1232
|
this.field.options.optionItems = optionItems;
|
1182
|
-
let tableParam = this.tableParam;
|
1183
|
-
if (tableParam) {
|
1184
|
-
// let key = this.getOptionKey();
|
1185
|
-
// tableParam.column.params[key] = optionItems;
|
1186
|
-
this.setGloatOptionItems(optionItems)
|
1187
|
-
// tableParam.column.params.optionItems = optionItems;
|
1188
|
-
}
|
1189
1233
|
},
|
1190
1234
|
getOptions: function () {
|
1191
1235
|
return this.getOptionItems();
|
@@ -1197,15 +1241,7 @@ modules = {
|
|
1197
1241
|
this.enableOptionOfList(this.getOptionItems(), e);
|
1198
1242
|
},
|
1199
1243
|
getOptionItems: function () {
|
1200
|
-
// return this.field.options.optionItems;
|
1201
|
-
let tableParam = this.tableParam;
|
1202
1244
|
let optionItems = this.field.options.optionItems;
|
1203
|
-
/*if(tableParam){
|
1204
|
-
let rows = this.getGloatOptionItems()
|
1205
|
-
if(!tableParam.column.params.rowOptionFlag && rows!==undefined){
|
1206
|
-
optionItems = rows || []
|
1207
|
-
}
|
1208
|
-
}*/
|
1209
1245
|
return optionItems;
|
1210
1246
|
},
|
1211
1247
|
setUploadHeader: function (e, t) {
|
@@ -12,8 +12,8 @@
|
|
12
12
|
</div>
|
13
13
|
<baseUpload accept="file" :file.sync="fieldModel" :hidePasteArea.sync="isH5"
|
14
14
|
:uploadDialogCustomClass="isH5?'dialog-upload-h5':null" :pickPrivateProfile="false"
|
15
|
-
:multi
|
16
|
-
:limit
|
15
|
+
:multi="field.options.limit!==1"
|
16
|
+
:limit="field.options.limit"
|
17
17
|
resultType="Array"
|
18
18
|
:edit="!field.options.disabled"
|
19
19
|
@callback="submitFile"
|
@@ -83,12 +83,6 @@ export default {
|
|
83
83
|
formDataId() {
|
84
84
|
let formRef = this.getFormRef();
|
85
85
|
return formRef.dataId;
|
86
|
-
},
|
87
|
-
limit() {
|
88
|
-
return this.field.options.limit ? this.field.options.limit : null;
|
89
|
-
},
|
90
|
-
multi() {
|
91
|
-
return this.limit !== 1;
|
92
86
|
}
|
93
87
|
},
|
94
88
|
beforeCreate() {
|
@@ -213,8 +213,10 @@ modules = {
|
|
213
213
|
let rows = this.getValue();
|
214
214
|
rows.forEach((row, index) => {
|
215
215
|
let target = this.getWidgetRefByTableRow(index, name)
|
216
|
-
|
217
|
-
|
216
|
+
if (target) {
|
217
|
+
let widget = target.field || target.widget;
|
218
|
+
callback(row, widget, target)
|
219
|
+
}
|
218
220
|
})
|
219
221
|
},
|
220
222
|
getRowWidgetOption(rowParam, fieldWidget) {
|