cloud-web-corejs 1.0.54-dev.146 → 1.0.54-dev.149
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/table/CellSlot.vue +1 -0
- package/src/components/table/vxeFilter/mixin.js +1 -1
- package/src/components/vb-tabs/x-tabs.vue +3 -2
- package/src/components/xform/form-designer/designer.js +1 -1514
- package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +1230 -1
- package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +4 -2
- package/src/components/xform/form-designer/indexMixin.js +3 -1
- package/src/components/xform/form-designer/setting-panel/form-setting.vue +8 -0
- package/src/components/xform/form-designer/setting-panel/indexMixin.js +322 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/columnRenderDialog.vue +76 -30
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/table-column-dialog.vue +20 -8
- package/src/components/xform/form-designer/setting-panel/property-editor/container-detail/detail-editor.vue +2 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/field-button/search-dialog-event-editor.vue +7 -1
- package/src/components/xform/form-designer/toolbar-panel/indexMixin.js +1 -566
- package/src/components/xform/form-designer/widget-panel/indexMixin.js +276 -1
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +36 -1
- package/src/components/xform/form-render/container-item/containerItemMixin.js +330 -1
- package/src/components/xform/form-render/container-item/data-table-item.vue +42 -20
- package/src/components/xform/form-render/container-item/data-table-mixin.js +140 -191
- package/src/components/xform/form-render/container-item/grid-col-item.vue +10 -3
- package/src/components/xform/form-render/container-item/grid-item.vue +1 -1
- package/src/components/xform/form-render/container-item/tab-item.vue +11 -6
- package/src/components/xform/form-render/container-item/table-cell-item.vue +38 -32
- package/src/components/xform/form-render/container-item/table-item.vue +4 -2
- package/src/components/xform/form-render/indexMixin.js +13 -11
- package/src/components/xform/mixins/scriptHttp.js +106 -61
- package/src/views/user/form/vform/designer.vue +8 -3
- package/src/views/user/form/view/list.vue +27 -9
@@ -5,13 +5,13 @@ import containerItemMixin from "./containerItemMixin";
|
|
5
5
|
|
6
6
|
import * as formatUtil from "../../../../components/xform/utils/format.js";
|
7
7
|
import tableConfig from "../../../../components/table/config.js";
|
8
|
-
import {
|
8
|
+
import {extendDeeply} from "../../../../utils/index.js";
|
9
9
|
import {
|
10
10
|
assembleAxiosConfig,
|
11
11
|
getReportGlobalMap,
|
12
12
|
generateId,
|
13
13
|
} from "../../../../components/xform/utils/util";
|
14
|
-
import {
|
14
|
+
import {tableTreeMixins} from "../../../../mixins/tableTree/index.js";
|
15
15
|
|
16
16
|
let modules = {};
|
17
17
|
const baseRefUtil = {
|
@@ -106,6 +106,7 @@ modules = {
|
|
106
106
|
tableConfig: {},
|
107
107
|
showTableFormDialogContent: true,
|
108
108
|
widgetMap: {},
|
109
|
+
rowWidgetList:[]
|
109
110
|
};
|
110
111
|
},
|
111
112
|
watch: {
|
@@ -141,7 +142,7 @@ modules = {
|
|
141
142
|
return void 0 === this.widget.options.buttonsColumnFixed
|
142
143
|
? "right"
|
143
144
|
: !!this.widget.options.buttonsColumnFixed &&
|
144
|
-
|
145
|
+
this.widget.options.buttonsColumnFixed;
|
145
146
|
},
|
146
147
|
formModel: {
|
147
148
|
cache: !1,
|
@@ -184,24 +185,35 @@ modules = {
|
|
184
185
|
let name = params.widget.options.name;
|
185
186
|
return this.getWidgetRefByTableRow(index, name);
|
186
187
|
},
|
187
|
-
getRowWidget(rowParam) {
|
188
|
+
getRowWidget(rowParam, fieldWidget) {
|
188
189
|
let row = rowParam.row;
|
189
190
|
let params = rowParam.column.params;
|
190
|
-
let
|
191
|
+
let name = fieldWidget ? fieldWidget.options.name : params.widget.options.name;
|
192
|
+
let key = this.getRowRefKey(row, name);
|
191
193
|
let widget = this.widgetMap[key];
|
192
194
|
if (!widget) {
|
193
195
|
this.$set(
|
194
196
|
this.widgetMap,
|
195
197
|
key,
|
196
|
-
this.$baseLodash.cloneDeep(params.widget)
|
198
|
+
this.$baseLodash.cloneDeep(fieldWidget ? fieldWidget : params.widget)
|
197
199
|
);
|
198
200
|
}
|
201
|
+
|
199
202
|
return this.widgetMap[key];
|
200
203
|
},
|
201
|
-
|
204
|
+
getRowWidgetOption(rowParam, fieldWidget) {
|
205
|
+
let widget = this.getRowWidget(rowParam, fieldWidget);
|
206
|
+
let field = widget.category == 'container' ? 'widget' : 'field'
|
207
|
+
let option = {
|
208
|
+
[field]:widget
|
209
|
+
}
|
210
|
+
return option
|
211
|
+
},
|
212
|
+
getRowWidgetKey(rowParam, fieldWidget) {
|
202
213
|
let row = rowParam.row;
|
203
214
|
let params = rowParam.column.params;
|
204
|
-
let
|
215
|
+
let name = fieldWidget ? fieldWidget.options.name : params.widget.options.name;
|
216
|
+
let key = this.getRowRefKey(row, name);
|
205
217
|
return key;
|
206
218
|
},
|
207
219
|
getGridTableName() {
|
@@ -221,6 +233,7 @@ modules = {
|
|
221
233
|
},
|
222
234
|
setValue(val) {
|
223
235
|
// console.log("rows:",val);
|
236
|
+
this.clearRowWidgets()
|
224
237
|
let rows = val || [];
|
225
238
|
this.formModel[this.fieldKeyName] = rows;
|
226
239
|
let $grid = this.getGridTable();
|
@@ -237,7 +250,7 @@ modules = {
|
|
237
250
|
selectWidget: function (e) {
|
238
251
|
this.designer.setSelected(e);
|
239
252
|
},
|
240
|
-
formatterValue: function ({
|
253
|
+
formatterValue: function ({cellValue, row, column}) {
|
241
254
|
if (cellValue === null || cellValue === undefined) return cellValue;
|
242
255
|
|
243
256
|
if (column.params && column.params.formatS)
|
@@ -323,10 +336,11 @@ modules = {
|
|
323
336
|
let formRef = this.getFormRef();
|
324
337
|
let parentTarget = formRef.$attrs["parent-target"];
|
325
338
|
parentTarget &&
|
326
|
-
|
327
|
-
|
339
|
+
parentTarget.$attrs.openEditDialog &&
|
340
|
+
parentTarget.$attrs.openEditDialog(row, param);
|
341
|
+
},
|
342
|
+
importExcel() {
|
328
343
|
},
|
329
|
-
importExcel() {},
|
330
344
|
getGrid(that, tableRef) {
|
331
345
|
var $grid;
|
332
346
|
if (Array.isArray(that.$refs[tableRef])) {
|
@@ -359,6 +373,7 @@ modules = {
|
|
359
373
|
return conditions;
|
360
374
|
},
|
361
375
|
createColumns() {
|
376
|
+
let rowWidgetList = [];
|
362
377
|
let tableColumns = this.widget.options.tableColumns;
|
363
378
|
let newColumns = [];
|
364
379
|
newColumns.push({
|
@@ -383,6 +398,7 @@ modules = {
|
|
383
398
|
isItemLine: t.isItemLine,
|
384
399
|
footerDataType: t.footerDataType,
|
385
400
|
footerMethodConfg: t.footerMethodConfg,
|
401
|
+
widgetList: t.widgetList
|
386
402
|
},
|
387
403
|
visible: t.show,
|
388
404
|
slots: {},
|
@@ -416,6 +432,19 @@ modules = {
|
|
416
432
|
}
|
417
433
|
}
|
418
434
|
col = addColumProperty(col, t);
|
435
|
+
|
436
|
+
if(col.params.widget){
|
437
|
+
rowWidgetList.push(col.params.widget)
|
438
|
+
}
|
439
|
+
if(col.params.editWidget){
|
440
|
+
rowWidgetList.push(col.params.editWidget)
|
441
|
+
}
|
442
|
+
if(col.params.widgetList && col.params.widgetList.length){
|
443
|
+
col.params.widgetList.forEach((item) => {
|
444
|
+
rowWidgetList.push(item)
|
445
|
+
})
|
446
|
+
|
447
|
+
}
|
419
448
|
return col;
|
420
449
|
};
|
421
450
|
|
@@ -423,7 +452,7 @@ modules = {
|
|
423
452
|
let columnOption;
|
424
453
|
let widget;
|
425
454
|
let columnWidgetConfig = this.getColumnWidgetConfig(t);
|
426
|
-
let {
|
455
|
+
let {columnSelectedWidget, columnEditFields} = columnWidgetConfig;
|
427
456
|
if (columnSelectedWidget) {
|
428
457
|
widget = columnSelectedWidget;
|
429
458
|
columnOption = widget.options;
|
@@ -431,7 +460,7 @@ modules = {
|
|
431
460
|
columnOption = {};
|
432
461
|
}
|
433
462
|
|
434
|
-
let {
|
463
|
+
let {columnSelectedWidget: editWidget} = this.getColumnWidgetConfig(
|
435
464
|
t,
|
436
465
|
true
|
437
466
|
);
|
@@ -456,10 +485,12 @@ modules = {
|
|
456
485
|
col.slots.default = "widget";
|
457
486
|
} else if (t.formatS == "editTreeButtonGroup") {
|
458
487
|
col.slots.default = "editTreeButtonGroup";
|
488
|
+
} else if (t.formatS == "widgetRender") {
|
489
|
+
col.slots.default = "widgetList";
|
459
490
|
}
|
460
491
|
|
461
492
|
if (editWidget) {
|
462
|
-
col.editRender = {
|
493
|
+
col.editRender = {name: "input"};
|
463
494
|
// col.slots.edit = editWidget.id;
|
464
495
|
col.slots.edit = "editWidget";
|
465
496
|
}
|
@@ -494,6 +525,7 @@ modules = {
|
|
494
525
|
}
|
495
526
|
}
|
496
527
|
}
|
528
|
+
this.rowWidgetList = rowWidgetList;
|
497
529
|
return this.$baseLodash.cloneDeep(newColumns);
|
498
530
|
},
|
499
531
|
initTableList() {
|
@@ -511,6 +543,7 @@ modules = {
|
|
511
543
|
let dataId = this.formDataId;
|
512
544
|
let accessScript = this.widget.options.accessScript;
|
513
545
|
let searchColumns = null;
|
546
|
+
|
514
547
|
if (isQueryTable) {
|
515
548
|
path = "#";
|
516
549
|
paramFun = () => {
|
@@ -550,9 +583,9 @@ modules = {
|
|
550
583
|
valueFormat: options.valueFormat ?? null,
|
551
584
|
};
|
552
585
|
let typeMap = {
|
553
|
-
input: {
|
554
|
-
number: {
|
555
|
-
inputBatch: {
|
586
|
+
input: {type: "input"},
|
587
|
+
number: {type: "number"},
|
588
|
+
inputBatch: {type: "inputBatch"},
|
556
589
|
date: {
|
557
590
|
type: "date",
|
558
591
|
widgetType: options.type,
|
@@ -568,7 +601,7 @@ modules = {
|
|
568
601
|
"date-range": {
|
569
602
|
type: "date",
|
570
603
|
widgetType: "daterange",
|
571
|
-
widgetConfig: {
|
604
|
+
widgetConfig: {...dateConfig, isRange: true},
|
572
605
|
},
|
573
606
|
"time-range": {
|
574
607
|
type: "time",
|
@@ -665,7 +698,7 @@ modules = {
|
|
665
698
|
parentField: "f_parent",
|
666
699
|
transform: true,
|
667
700
|
expandAll: true,
|
668
|
-
loadMethod({
|
701
|
+
loadMethod({$table, row}) {
|
669
702
|
// 模拟后台接口
|
670
703
|
let $grid = that.getGridTable();
|
671
704
|
let parentField = $grid.treeConfig.parentField;
|
@@ -755,7 +788,7 @@ modules = {
|
|
755
788
|
let $grid = this.getGridTable();
|
756
789
|
let pageSize = param.size;
|
757
790
|
let currentPage = param.current;
|
758
|
-
let page = {
|
791
|
+
let page = {pageSize, currentPage};
|
759
792
|
let customParam = {
|
760
793
|
config: {
|
761
794
|
modal: false,
|
@@ -784,7 +817,7 @@ modules = {
|
|
784
817
|
},
|
785
818
|
ajax: {
|
786
819
|
// 接收 Promise 对象
|
787
|
-
query: ({
|
820
|
+
query: ({page, sorts, filters, form, param, customParam}) => {
|
788
821
|
let formData = tableOption.param ? tableOption.param() || {} : {};
|
789
822
|
const queryParams = Object.assign({}, formData);
|
790
823
|
|
@@ -799,7 +832,7 @@ modules = {
|
|
799
832
|
|
800
833
|
// 处理筛选条件
|
801
834
|
if (filters) {
|
802
|
-
filters.forEach(({
|
835
|
+
filters.forEach(({property, values}) => {
|
803
836
|
queryParams[property] = values.join(",");
|
804
837
|
});
|
805
838
|
}
|
@@ -821,151 +854,6 @@ modules = {
|
|
821
854
|
let accessReturnType = this.widget.options.accessReturnType || 2;
|
822
855
|
let scriptCode = this.getScriptCode();
|
823
856
|
return new Promise((resolve, reject) => {
|
824
|
-
/*let items = [
|
825
|
-
{
|
826
|
-
"create_by": "admin",
|
827
|
-
"object_foreign_id": 224,
|
828
|
-
"f_code": "202501068569",
|
829
|
-
"f_grade": "1",
|
830
|
-
"f_name": "呃呃呃呃呃呃俄文",
|
831
|
-
"company_code": "mk1",
|
832
|
-
"id": 95,
|
833
|
-
"modify_by": "admin",
|
834
|
-
"create_date": "2025-01-06 17:53:34",
|
835
|
-
"f_flag": "A",
|
836
|
-
"modify_date": "2025-01-16 21:11:44"
|
837
|
-
},
|
838
|
-
{
|
839
|
-
"create_by": "admin",
|
840
|
-
"object_foreign_id": 224,
|
841
|
-
"f_code": "202501068569",
|
842
|
-
"f_grade": "1",
|
843
|
-
"f_name": "呃呃呃呃呃呃俄文",
|
844
|
-
"company_code": "mk1",
|
845
|
-
"id": 10095,
|
846
|
-
"modify_by": "admin",
|
847
|
-
"create_date": "2025-01-06 17:53:34",
|
848
|
-
"f_flag": "A",
|
849
|
-
"modify_date": "2025-01-16 21:11:44"
|
850
|
-
},
|
851
|
-
{
|
852
|
-
"create_by": "admin",
|
853
|
-
"object_foreign_id": 221,
|
854
|
-
"f_code": "202501037347",
|
855
|
-
"f_grade": "1",
|
856
|
-
"f_name": "张三",
|
857
|
-
"company_code": "mk1",
|
858
|
-
"id": 92,
|
859
|
-
"modify_by": "admin",
|
860
|
-
"create_date": "2025-01-03 17:49:55",
|
861
|
-
"f_flag": "A",
|
862
|
-
"modify_date": "2025-01-05 17:21:46"
|
863
|
-
},
|
864
|
-
{
|
865
|
-
"create_by": "admin",
|
866
|
-
"object_foreign_id": 222,
|
867
|
-
"f_code": "202501037348",
|
868
|
-
"f_grade": "2",
|
869
|
-
"f_name": "李四",
|
870
|
-
"company_code": "mk1",
|
871
|
-
"id": 93,
|
872
|
-
"modify_by": "admin",
|
873
|
-
"create_date": "2025-01-03 17:49:55",
|
874
|
-
"f_flag": "A",
|
875
|
-
"modify_date": "2025-01-03 17:49:55"
|
876
|
-
},
|
877
|
-
{
|
878
|
-
"create_by": "admin",
|
879
|
-
"object_foreign_id": 222,
|
880
|
-
"f_code": "202501037348",
|
881
|
-
"f_grade": "2",
|
882
|
-
"f_name": "李四",
|
883
|
-
"company_code": "mk1",
|
884
|
-
"id": 10093,
|
885
|
-
"modify_by": "admin",
|
886
|
-
"create_date": "2025-01-03 17:49:55",
|
887
|
-
"f_flag": "A",
|
888
|
-
"modify_date": "2025-01-03 17:49:55"
|
889
|
-
},
|
890
|
-
{
|
891
|
-
"create_by": "admin",
|
892
|
-
"object_foreign_id": 223,
|
893
|
-
"f_code": "202501037349",
|
894
|
-
"f_grade": "3",
|
895
|
-
"f_name": "王五",
|
896
|
-
"company_code": "mk1",
|
897
|
-
"id": 94,
|
898
|
-
"modify_by": "admin",
|
899
|
-
"create_date": "2025-01-03 17:49:55",
|
900
|
-
"f_flag": "A",
|
901
|
-
"modify_date": "2025-01-03 17:49:55"
|
902
|
-
},
|
903
|
-
{
|
904
|
-
"create_by": "admin",
|
905
|
-
"object_foreign_id": 218,
|
906
|
-
"f_code": "202501037340",
|
907
|
-
"f_grade": "4",
|
908
|
-
"f_name": "林一",
|
909
|
-
"company_code": "mk1",
|
910
|
-
"id": 89,
|
911
|
-
"modify_by": "admin",
|
912
|
-
"create_date": "2025-01-03 15:02:31",
|
913
|
-
"f_flag": "A",
|
914
|
-
"modify_date": "2025-01-03 15:02:31"
|
915
|
-
},
|
916
|
-
{
|
917
|
-
"create_by": "admin",
|
918
|
-
"object_foreign_id": 219,
|
919
|
-
"f_code": "202501037341",
|
920
|
-
"f_grade": "3",
|
921
|
-
"f_name": "林二",
|
922
|
-
"company_code": "mk1",
|
923
|
-
"id": 90,
|
924
|
-
"modify_by": "admin",
|
925
|
-
"create_date": "2025-01-03 15:02:31",
|
926
|
-
"f_flag": "A",
|
927
|
-
"modify_date": "2025-01-03 15:02:31"
|
928
|
-
}
|
929
|
-
];
|
930
|
-
let currentId = 0;
|
931
|
-
let records = [];
|
932
|
-
for(let i=0;i<50;i++){
|
933
|
-
let newItems = items.map((item,index)=>{
|
934
|
-
let flag = (index+1)%2!=0;
|
935
|
-
let line = flag ? index : (index-1)
|
936
|
-
let f_code = '10000'+i+''+line;
|
937
|
-
currentId++
|
938
|
-
return {
|
939
|
-
...item,
|
940
|
-
id:currentId,
|
941
|
-
f_code
|
942
|
-
};
|
943
|
-
})
|
944
|
-
records.push(...newItems)
|
945
|
-
}
|
946
|
-
|
947
|
-
let res = {
|
948
|
-
"time": "2025-03-21 11:24:55",
|
949
|
-
"type": "success",
|
950
|
-
"content": "success",
|
951
|
-
"objx": {
|
952
|
-
"records": [],
|
953
|
-
"total": 77,
|
954
|
-
"size": 100,
|
955
|
-
"current": 1,
|
956
|
-
"orders": [],
|
957
|
-
"optimizeCountSql": true,
|
958
|
-
"hitCount": false,
|
959
|
-
"countId": null,
|
960
|
-
"maxLimit": null,
|
961
|
-
"searchCount": true,
|
962
|
-
"pages": 1
|
963
|
-
},
|
964
|
-
"rmid": null
|
965
|
-
};
|
966
|
-
res.objx.records = records
|
967
|
-
resolve(res);
|
968
|
-
return*/
|
969
857
|
let reqData = {
|
970
858
|
...queryParams,
|
971
859
|
};
|
@@ -974,6 +862,7 @@ modules = {
|
|
974
862
|
let toDo = () => {
|
975
863
|
// let f = new Function("dataId", "formCode", "param", "done", accessScript);
|
976
864
|
let done = (res) => {
|
865
|
+
this.clearRowWidgets();
|
977
866
|
resolve(res);
|
978
867
|
if (res.type == "success") {
|
979
868
|
let rows = res.objx
|
@@ -991,8 +880,8 @@ modules = {
|
|
991
880
|
.map((item) => item[parentField]);
|
992
881
|
let expandRows = expandIds.length
|
993
882
|
? rows.filter((item) =>
|
994
|
-
|
995
|
-
|
883
|
+
expandIds.includes(item.id)
|
884
|
+
)
|
996
885
|
: [];
|
997
886
|
if (expandAll && expandRows.length) {
|
998
887
|
that.$nextTick(() => {
|
@@ -1089,7 +978,7 @@ modules = {
|
|
1089
978
|
.map((item) => item.params.columnId);
|
1090
979
|
if (footerColumnIds.length) {
|
1091
980
|
tableOption.config.footerMethod = (param) => {
|
1092
|
-
let {
|
981
|
+
let {columns: column1s, data} = param;
|
1093
982
|
return [
|
1094
983
|
column1s.map((column, columnIndex) => {
|
1095
984
|
let columnId = column.params?.columnId;
|
@@ -1141,7 +1030,7 @@ modules = {
|
|
1141
1030
|
return count;
|
1142
1031
|
},
|
1143
1032
|
getSearchFormData() {
|
1144
|
-
let map = {
|
1033
|
+
let map = {condition: []};
|
1145
1034
|
let formData = this.globalModel.formModel;
|
1146
1035
|
let widgetList = this.widget.widgetList;
|
1147
1036
|
if (!!widgetList && widgetList.length > 0) {
|
@@ -1351,7 +1240,7 @@ modules = {
|
|
1351
1240
|
param = item.accessParam;
|
1352
1241
|
}
|
1353
1242
|
} else {
|
1354
|
-
param = {
|
1243
|
+
param = {id: dataId};
|
1355
1244
|
}
|
1356
1245
|
return param;
|
1357
1246
|
},
|
@@ -1363,12 +1252,12 @@ modules = {
|
|
1363
1252
|
let tableRef = this.getTableRef();
|
1364
1253
|
let serviceName = this.getFormRef().reportTemplate.serviceName;
|
1365
1254
|
option.prefix = option.prefix || "/" + serviceName;
|
1366
|
-
this.$excelExport({
|
1255
|
+
this.$excelExport({targetRef: tableRef, ...option});
|
1367
1256
|
},
|
1368
1257
|
async deleteRow(row, rowIndex) {
|
1369
1258
|
let isTreeTable = this.widget.options.isTreeTable;
|
1370
1259
|
if (isTreeTable) {
|
1371
|
-
this.removeTreeRow({
|
1260
|
+
this.removeTreeRow({row});
|
1372
1261
|
return;
|
1373
1262
|
}
|
1374
1263
|
let $grid = this.getGridTable();
|
@@ -1383,6 +1272,7 @@ modules = {
|
|
1383
1272
|
this.$nextTick(() => {
|
1384
1273
|
this.handleWbs();
|
1385
1274
|
});
|
1275
|
+
this.deleteRowWidgets(row)
|
1386
1276
|
},
|
1387
1277
|
createNewTableData(isEdit) {
|
1388
1278
|
let vailColumns = this.widget.options.tableColumns.filter(
|
@@ -1554,7 +1444,7 @@ modules = {
|
|
1554
1444
|
columnSelectedWidget.options.labelHidden = true;
|
1555
1445
|
}
|
1556
1446
|
}
|
1557
|
-
return {
|
1447
|
+
return {columnSelectedWidget, columnEditFields};
|
1558
1448
|
},
|
1559
1449
|
getColumnProp(widget, obj, isEdit) {
|
1560
1450
|
if (!widget) {
|
@@ -1590,7 +1480,11 @@ modules = {
|
|
1590
1480
|
},
|
1591
1481
|
getColumnWidgetName(e) {
|
1592
1482
|
if (e && e.type) {
|
1593
|
-
|
1483
|
+
if (e.category == "container") {
|
1484
|
+
return this.getContainerWidgetName(e);
|
1485
|
+
} else {
|
1486
|
+
return e.type + "-widget";
|
1487
|
+
}
|
1594
1488
|
}
|
1595
1489
|
},
|
1596
1490
|
getGridTable() {
|
@@ -1623,7 +1517,7 @@ modules = {
|
|
1623
1517
|
let formRef = this.getFormRef();
|
1624
1518
|
let dataTableConfig = formRef.$attrs.dataTableOption || {};
|
1625
1519
|
dataTableConfig.onCheckboxChange &&
|
1626
|
-
|
1520
|
+
dataTableConfig.onCheckboxChange(param);
|
1627
1521
|
},
|
1628
1522
|
handleCheckboxAll(param) {
|
1629
1523
|
if (this.widget.options.onCheckboxAll) {
|
@@ -1851,15 +1745,18 @@ modules = {
|
|
1851
1745
|
let loopDo = (item) => {
|
1852
1746
|
if (item.id) delIds.push(item.id);
|
1853
1747
|
item[childrenField] &&
|
1854
|
-
|
1855
|
-
|
1856
|
-
|
1748
|
+
item[childrenField].forEach((subItem) => {
|
1749
|
+
loopDo(subItem);
|
1750
|
+
});
|
1857
1751
|
};
|
1858
1752
|
loopDo(row);
|
1859
1753
|
}
|
1860
1754
|
delIds.forEach((id) => {
|
1861
1755
|
let index = tableRows.findIndex((item) => item.id === id);
|
1756
|
+
let delRow = tableRows[index];
|
1862
1757
|
tableRows.splice(index, 1);
|
1758
|
+
this.deleteRowWidgets(delRow)
|
1759
|
+
|
1863
1760
|
});
|
1864
1761
|
this.$nextTick(() => {
|
1865
1762
|
this.handleWbs();
|
@@ -1972,10 +1869,10 @@ modules = {
|
|
1972
1869
|
item.f_wbs = wbs;
|
1973
1870
|
map[item._X_ROW_KEY] = wbs;
|
1974
1871
|
item[childrenField] &&
|
1975
|
-
|
1976
|
-
|
1977
|
-
|
1978
|
-
|
1872
|
+
item[childrenField].forEach((subitem, subindex) => {
|
1873
|
+
let sub_wbs = wbs + "." + (subindex + 1) + "";
|
1874
|
+
loopDo(subitem, sub_wbs);
|
1875
|
+
});
|
1979
1876
|
};
|
1980
1877
|
fullData.forEach((item, index) => {
|
1981
1878
|
let wbs = index + 1 + "";
|
@@ -2130,7 +2027,7 @@ modules = {
|
|
2130
2027
|
},
|
2131
2028
|
// 通用行合并函数(将相同多列数据合并为一行)
|
2132
2029
|
mergeRowMethod(tableParam) {
|
2133
|
-
let {
|
2030
|
+
let {row, _rowIndex, column, visibleData} = tableParam;
|
2134
2031
|
let mergeRowEnabled = this.widget.options.mergeRowEnabled || false;
|
2135
2032
|
let unikey = this.widget.options.mergeRowKey;
|
2136
2033
|
const cellValue = row[unikey];
|
@@ -2139,39 +2036,91 @@ modules = {
|
|
2139
2036
|
const prevRow = visibleData[_rowIndex - 1];
|
2140
2037
|
let nextRow = visibleData[_rowIndex + 1];
|
2141
2038
|
if (prevRow && prevRow[unikey] === cellValue) {
|
2142
|
-
return {
|
2039
|
+
return {rowspan: 0, colspan: 0};
|
2143
2040
|
} else {
|
2144
2041
|
let countRowspan = 1;
|
2145
2042
|
while (nextRow && nextRow[unikey] === cellValue) {
|
2146
2043
|
nextRow = visibleData[++countRowspan + _rowIndex];
|
2147
2044
|
}
|
2148
2045
|
if (countRowspan > 1) {
|
2149
|
-
return {
|
2046
|
+
return {rowspan: countRowspan, colspan: 1};
|
2150
2047
|
}
|
2151
2048
|
}
|
2152
2049
|
} else {
|
2153
2050
|
// return { rowspan: 1, colspan: 1 }
|
2154
2051
|
}
|
2155
2052
|
},
|
2156
|
-
mergeRowMethod2({
|
2053
|
+
mergeRowMethod2({row, _rowIndex, column, visibleData}) {
|
2157
2054
|
const fields = ["key"];
|
2158
2055
|
const cellValue = row[column.field];
|
2159
2056
|
if (cellValue && fields.includes(column.field)) {
|
2160
2057
|
const prevRow = visibleData[_rowIndex - 1];
|
2161
2058
|
let nextRow = visibleData[_rowIndex + 1];
|
2162
2059
|
if (prevRow && prevRow[column.field] === cellValue) {
|
2163
|
-
return {
|
2060
|
+
return {rowspan: 0, colspan: 0};
|
2164
2061
|
} else {
|
2165
2062
|
let countRowspan = 1;
|
2166
2063
|
while (nextRow && nextRow[column.field] === cellValue) {
|
2167
2064
|
nextRow = visibleData[++countRowspan + _rowIndex];
|
2168
2065
|
}
|
2169
2066
|
if (countRowspan > 1) {
|
2170
|
-
return {
|
2067
|
+
return {rowspan: countRowspan, colspan: 1};
|
2171
2068
|
}
|
2172
2069
|
}
|
2173
2070
|
}
|
2174
2071
|
},
|
2072
|
+
|
2073
|
+
/**begin*/
|
2074
|
+
/*initFieldSchemaData() { //初始化fieldSchemaData!!!
|
2075
|
+
|
2076
|
+
let rowWidgetList = this.rowWidgetList
|
2077
|
+
let rows = this.getValue();
|
2078
|
+
let rowLength = rows.length
|
2079
|
+
this.widgetMap = {} //清除数组必须用splice,length=0不会响应式更新!!
|
2080
|
+
if (rowLength > 0) {
|
2081
|
+
for (let i = 0; i < rowLength; i++) {
|
2082
|
+
let row = rows[i];
|
2083
|
+
let fieldSchemas = []
|
2084
|
+
rowWidgetList.forEach(swItem => {
|
2085
|
+
fieldSchemas.push( this.cloneFieldSchema(swItem) )
|
2086
|
+
})
|
2087
|
+
let keyVal = row._X_ROW_KEY;
|
2088
|
+
this.widgetMap[keyVal] = fieldSchemas;
|
2089
|
+
}
|
2090
|
+
}
|
2091
|
+
},
|
2092
|
+
|
2093
|
+
addToFieldSchemaData(row) {
|
2094
|
+
let fieldSchemas = []
|
2095
|
+
this.rowWidgetList.forEach(swItem => {
|
2096
|
+
fieldSchemas.push( this.cloneFieldSchema(swItem) )
|
2097
|
+
})
|
2098
|
+
|
2099
|
+
let keyVal = row._X_ROW_KEY;
|
2100
|
+
this.widgetMap[keyVal] = fieldSchemas;
|
2101
|
+
},
|
2102
|
+
|
2103
|
+
deleteFromFieldSchemaData(row) {
|
2104
|
+
let keyVal = row._X_ROW_KEY;
|
2105
|
+
delete this.widgetMap[keyVal] ;
|
2106
|
+
},
|
2107
|
+
|
2108
|
+
cloneFieldSchema(fieldWidget) {
|
2109
|
+
let newFieldSchema = this.$baseLodash.cloneDeep(fieldWidget)
|
2110
|
+
newFieldSchema.id = fieldWidget.type + generateId()
|
2111
|
+
return newFieldSchema
|
2112
|
+
},*/
|
2113
|
+
clearRowWidgets(){
|
2114
|
+
this.widgetMap = {};
|
2115
|
+
},
|
2116
|
+
deleteRowWidgets(row) {
|
2117
|
+
this.rowWidgetList.forEach(widget=>{
|
2118
|
+
let key = this.getRowRefKey(row, widget.options.name);
|
2119
|
+
delete this.widgetMap[key];
|
2120
|
+
})
|
2121
|
+
}
|
2122
|
+
/**end*/
|
2123
|
+
|
2175
2124
|
},
|
2176
2125
|
};
|
2177
2126
|
|
@@ -5,7 +5,7 @@
|
|
5
5
|
<template v-for="(subWidget, swIdx) in widget.widgetList">
|
6
6
|
<template v-if="'container' === subWidget.category">
|
7
7
|
<component :is="subWidget.type + '-item'" :widget="subWidget" :key="swIdx" :parent-list="widget.widgetList"
|
8
|
-
:index-of-parent-list="swIdx" :parent-widget="widget">
|
8
|
+
:index-of-parent-list="swIdx" :parent-widget="widget" :tableParam="tableParam" :formItemProp="formItemProp">
|
9
9
|
<!-- 递归传递插槽!!! -->
|
10
10
|
<template v-for="slot in Object.keys($scopedSlots)" v-slot:[slot]="scope">
|
11
11
|
<slot :name="slot" v-bind="scope"/>
|
@@ -14,7 +14,7 @@
|
|
14
14
|
</template>
|
15
15
|
<template v-else>
|
16
16
|
<component :is="subWidget.type + '-widget'" :field="subWidget" :designer="null" :key="swIdx" :parent-list="widget.widgetList"
|
17
|
-
:index-of-parent-list="swIdx" :parent-widget="widget">
|
17
|
+
:index-of-parent-list="swIdx" :parent-widget="widget" :tableParam="tableParam" :formItemProp="formItemProp">
|
18
18
|
<!-- 递归传递插槽!!! -->
|
19
19
|
<template v-for="slot in Object.keys($scopedSlots)" v-slot:[slot]="scope">
|
20
20
|
<slot :name="slot" v-bind="scope"/>
|
@@ -54,7 +54,14 @@
|
|
54
54
|
type: String,
|
55
55
|
default: null
|
56
56
|
},
|
57
|
-
|
57
|
+
tableParam: {
|
58
|
+
type: Object,
|
59
|
+
default: null,
|
60
|
+
},
|
61
|
+
formItemProp: {
|
62
|
+
type: String,
|
63
|
+
default: null,
|
64
|
+
},
|
58
65
|
},
|
59
66
|
inject: ['refList', 'globalModel', 'previewState'],
|
60
67
|
data() {
|
@@ -7,7 +7,7 @@
|
|
7
7
|
<template v-for="(colWidget, colIdx) in widget.cols">
|
8
8
|
<grid-col-item :widget="colWidget" :key="colIdx" :parent-list="widget.cols"
|
9
9
|
:index-of-parent-list="colIdx" :parent-widget="widget"
|
10
|
-
:col-height="widget.options.colHeight">
|
10
|
+
:col-height="widget.options.colHeight" :tableParam="tableParam" :formItemProp="formItemProp">
|
11
11
|
<!-- 递归传递插槽!!! -->
|
12
12
|
<template v-for="slot in Object.keys($scopedSlots)" v-slot:[slot]="scope">
|
13
13
|
<slot :name="slot" v-bind="scope"/>
|