cloud-web-corejs 1.0.54-dev.325 → 1.0.54-dev.327
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/wf/addOpinionButton.vue +3 -52
- package/src/components/wf/mixins/addOpinionButton.js +3 -0
- package/src/components/wf/mixins/setCandidateButton.js +1 -156
- package/src/components/wf/mixins/wfTaskUserRangeDialog.js +3 -0
- package/src/components/wf/wf.js +1 -2111
- package/src/components/wf/wfTaskUserRangeDialog.vue +2 -77
- package/src/components/xform/form-designer/designer.js +1645 -2
- package/src/components/xform/form-designer/form-widget/container-widget/data-table-mixin.js +289 -9
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/table-column-dialog.vue +9 -43
- package/src/components/xform/form-render/container-item/data-table-mixin.js +228 -151
- package/src/components/xform/form-render/indexMixin.js +3141 -2
- package/src/utils/request.js +1 -324
- package/src/utils/vab.js +1 -1092
@@ -5,16 +5,16 @@ 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 {extendDeeply} from "../../../../utils/index.js";
|
8
|
+
import { extendDeeply } from "../../../../utils/index.js";
|
9
9
|
import {
|
10
10
|
assembleAxiosConfig,
|
11
11
|
getReportGlobalMap,
|
12
12
|
generateId,
|
13
13
|
deepClone,
|
14
14
|
loopHandleWidget,
|
15
|
-
columnFormatMap
|
15
|
+
columnFormatMap,
|
16
16
|
} from "../../../../components/xform/utils/util";
|
17
|
-
import {tableTreeMixins} from "../../../../mixins/tableTree/index.js";
|
17
|
+
import { tableTreeMixins } from "../../../../mixins/tableTree/index.js";
|
18
18
|
|
19
19
|
let modules = {};
|
20
20
|
const baseRefUtil = {
|
@@ -152,7 +152,7 @@ modules = {
|
|
152
152
|
return void 0 === this.widget.options.buttonsColumnFixed
|
153
153
|
? "right"
|
154
154
|
: !!this.widget.options.buttonsColumnFixed &&
|
155
|
-
|
155
|
+
this.widget.options.buttonsColumnFixed;
|
156
156
|
},
|
157
157
|
formModel: {
|
158
158
|
cache: !1,
|
@@ -169,7 +169,7 @@ modules = {
|
|
169
169
|
if (!this.formModel[this.fieldKeyName])
|
170
170
|
this.formModel[this.fieldKeyName] = [];
|
171
171
|
this.initRefList();
|
172
|
-
this.initConfig();
|
172
|
+
// this.initConfig();
|
173
173
|
this.initEventHandler();
|
174
174
|
this.registerTableRefList();
|
175
175
|
this.handleOnCreated();
|
@@ -184,7 +184,7 @@ modules = {
|
|
184
184
|
methods: {
|
185
185
|
initConfig() {
|
186
186
|
let formRef = this.getFormRef();
|
187
|
-
this.widget.options.tableColumns.forEach(row => {
|
187
|
+
this.widget.options.tableColumns.forEach((row) => {
|
188
188
|
let type = columnFormatMap[row.formatS];
|
189
189
|
if (type && row.columnOption && !row.widget) {
|
190
190
|
let fieldWidget = formRef.copyNewFieldWidget(
|
@@ -201,10 +201,10 @@ modules = {
|
|
201
201
|
fieldWidget.options = row.editColumnOption;
|
202
202
|
row.editWidget = fieldWidget;
|
203
203
|
}
|
204
|
-
})
|
204
|
+
});
|
205
205
|
},
|
206
206
|
registerTableRefList() {
|
207
|
-
this.sfRefList[this.widget.options.name] = this
|
207
|
+
this.sfRefList[this.widget.options.name] = this;
|
208
208
|
},
|
209
209
|
getRowRefKey(row, name) {
|
210
210
|
let keyVal = row._X_ROW_KEY;
|
@@ -217,8 +217,8 @@ modules = {
|
|
217
217
|
// let row = this.getGridTable().getTableData().fullData[index];
|
218
218
|
let formRows = this.formModel[this.fieldKeyName];
|
219
219
|
let row = formRows[index];
|
220
|
-
let widget = this.getWidgetByTableRowData(row, name)
|
221
|
-
return widget
|
220
|
+
let widget = this.getWidgetByTableRowData(row, name);
|
221
|
+
return widget;
|
222
222
|
},
|
223
223
|
getWidgetRefByTableRow(index, name) {
|
224
224
|
// let row = this.getGridTable().getTableData().fullData[index];
|
@@ -229,7 +229,7 @@ modules = {
|
|
229
229
|
getWidgetByTableRowData(row, name) {
|
230
230
|
let target = this.getWidgetRefByTableRowData(row, name);
|
231
231
|
let widget = target.field || target.widget;
|
232
|
-
return widget
|
232
|
+
return widget;
|
233
233
|
},
|
234
234
|
getWidgetRefByTableRowData(row, name) {
|
235
235
|
let key = this.getRowRefKey(row, name);
|
@@ -240,37 +240,37 @@ modules = {
|
|
240
240
|
// let params = tableParam.column.params;
|
241
241
|
// let name = params.widget.options.name;
|
242
242
|
// let key = this.getRowRefKey(tableParam.row, name);
|
243
|
-
return this.getWidgetRefByTableRowData(tableParam.row, name)
|
243
|
+
return this.getWidgetRefByTableRowData(tableParam.row, name);
|
244
244
|
// return this.getWidgetRef(key);
|
245
245
|
},
|
246
246
|
getRowWidget(rowParam, fieldWidget) {
|
247
247
|
let row = rowParam.row;
|
248
248
|
let params = rowParam.column.params;
|
249
249
|
let widgetId = fieldWidget ? fieldWidget.id : params.widget.id;
|
250
|
-
let widget = this.fieldSchemaMap[row._X_ROW_KEY][widgetId]
|
250
|
+
let widget = this.fieldSchemaMap[row._X_ROW_KEY][widgetId];
|
251
251
|
return widget;
|
252
252
|
},
|
253
253
|
loopHandleWidgetByName(name, callback) {
|
254
254
|
let rows = this.getValue();
|
255
255
|
rows.forEach((row, index) => {
|
256
|
-
let target = this.getWidgetRefByTableRow(index, name)
|
256
|
+
let target = this.getWidgetRefByTableRow(index, name);
|
257
257
|
if (target) {
|
258
258
|
let widget = target.field || target.widget;
|
259
|
-
callback(row, widget, target)
|
259
|
+
callback(row, widget, target);
|
260
260
|
}
|
261
|
-
})
|
261
|
+
});
|
262
262
|
},
|
263
263
|
getRowWidgetOption(rowParam, fieldWidget) {
|
264
264
|
let widget = this.getRowWidget(rowParam, fieldWidget);
|
265
|
-
let field = widget.category ==
|
265
|
+
let field = widget.category == "container" ? "widget" : "field";
|
266
266
|
let option = {
|
267
|
-
[field]: widget
|
268
|
-
}
|
269
|
-
return option
|
267
|
+
[field]: widget,
|
268
|
+
};
|
269
|
+
return option;
|
270
270
|
},
|
271
271
|
getRowWidgetKey(rowParam, fieldWidget) {
|
272
272
|
let widget = this.getRowWidget(rowParam, fieldWidget);
|
273
|
-
let key = widget.id
|
273
|
+
let key = widget.id;
|
274
274
|
return key;
|
275
275
|
},
|
276
276
|
getGridTableName() {
|
@@ -292,36 +292,35 @@ modules = {
|
|
292
292
|
let rows = val || [];
|
293
293
|
this.formModel[this.fieldKeyName] = rows;
|
294
294
|
this.fieldModel = rows;
|
295
|
-
this.initRowIdData(true)
|
296
|
-
this.initFieldSchemaData()
|
295
|
+
this.initRowIdData(true);
|
296
|
+
this.initFieldSchemaData();
|
297
297
|
},
|
298
298
|
initValue(val) {
|
299
299
|
// this.clearRowWidgets()
|
300
300
|
let rows = val || [];
|
301
301
|
rows.forEach((row, index) => {
|
302
|
-
row._X_ROW_KEY = "row_" + generateId()
|
303
|
-
})
|
302
|
+
row._X_ROW_KEY = "row_" + generateId();
|
303
|
+
});
|
304
304
|
this.formModel[this.fieldKeyName] = rows;
|
305
305
|
this.fieldModel = rows;
|
306
|
-
this.initRowIdData(true)
|
307
|
-
this.initFieldSchemaData(true)
|
308
|
-
|
306
|
+
this.initRowIdData(true);
|
307
|
+
this.initFieldSchemaData(true);
|
309
308
|
},
|
310
309
|
setValue(val) {
|
311
310
|
// console.log("rows:",val);
|
312
|
-
this.clearRowWidgets()
|
311
|
+
this.clearRowWidgets();
|
313
312
|
let rows = val || [];
|
314
313
|
rows.forEach((row, index) => {
|
315
314
|
if (!row._X_ROW_KEY) {
|
316
|
-
row._X_ROW_KEY = "row_" + generateId()
|
315
|
+
row._X_ROW_KEY = "row_" + generateId();
|
317
316
|
}
|
318
|
-
})
|
317
|
+
});
|
319
318
|
this.formModel[this.fieldKeyName] = rows;
|
320
319
|
let $grid = this.getGridTable();
|
321
320
|
this.fieldModel = rows;
|
322
321
|
|
323
|
-
this.initRowIdData()
|
324
|
-
this.initFieldSchemaData()
|
322
|
+
this.initRowIdData();
|
323
|
+
this.initFieldSchemaData();
|
325
324
|
// $grid.loadData(rows);
|
326
325
|
},
|
327
326
|
getValue() {
|
@@ -334,7 +333,7 @@ modules = {
|
|
334
333
|
selectWidget: function (e) {
|
335
334
|
this.designer.setSelected(e);
|
336
335
|
},
|
337
|
-
formatterValue: function ({cellValue, row, column}) {
|
336
|
+
formatterValue: function ({ cellValue, row, column }) {
|
338
337
|
if (cellValue === null || cellValue === undefined) return cellValue;
|
339
338
|
|
340
339
|
if (column.params && column.params.formatS)
|
@@ -420,11 +419,10 @@ modules = {
|
|
420
419
|
let formRef = this.getFormRef();
|
421
420
|
let parentTarget = formRef.$attrs["parent-target"];
|
422
421
|
parentTarget &&
|
423
|
-
|
424
|
-
|
425
|
-
},
|
426
|
-
importExcel() {
|
422
|
+
parentTarget.$attrs.openEditDialog &&
|
423
|
+
parentTarget.$attrs.openEditDialog(row, param);
|
427
424
|
},
|
425
|
+
importExcel() {},
|
428
426
|
getGrid(that, tableRef) {
|
429
427
|
var $grid;
|
430
428
|
if (Array.isArray(that.$refs[tableRef])) {
|
@@ -471,7 +469,6 @@ modules = {
|
|
471
469
|
|
472
470
|
let tableWidgetName = this.widget.options.name;
|
473
471
|
const createColumn = (t, isChild) => {
|
474
|
-
|
475
472
|
let col = {
|
476
473
|
fixed: !!t.fixed && t.fixed,
|
477
474
|
field: t.prop,
|
@@ -488,16 +485,16 @@ modules = {
|
|
488
485
|
footerDataType: t.footerDataType,
|
489
486
|
footerMethodConfg: t.footerMethodConfg,
|
490
487
|
widgetList: t.widgetList,
|
491
|
-
tableWidgetName
|
488
|
+
tableWidgetName,
|
492
489
|
},
|
493
490
|
visible: t.show,
|
494
491
|
slots: {},
|
495
492
|
};
|
496
|
-
if(t.required){
|
493
|
+
if (t.required) {
|
497
494
|
/*col.titlePrefix = {
|
498
495
|
icon:"el-icon-star-on"
|
499
496
|
}*/
|
500
|
-
col.title = "* "+col.title
|
497
|
+
col.title = "* " + col.title;
|
501
498
|
}
|
502
499
|
if (t.treeNode) {
|
503
500
|
col.treeNode = true;
|
@@ -530,16 +527,15 @@ modules = {
|
|
530
527
|
col = addColumProperty(col, t);
|
531
528
|
|
532
529
|
if (col.params.widget) {
|
533
|
-
rowWidgetList.push(col.params.widget)
|
530
|
+
rowWidgetList.push(col.params.widget);
|
534
531
|
}
|
535
532
|
if (col.params.editWidget) {
|
536
|
-
rowWidgetList.push(col.params.editWidget)
|
533
|
+
rowWidgetList.push(col.params.editWidget);
|
537
534
|
}
|
538
535
|
if (col.params.widgetList && col.params.widgetList.length) {
|
539
536
|
col.params.widgetList.forEach((item) => {
|
540
|
-
rowWidgetList.push(item)
|
541
|
-
})
|
542
|
-
|
537
|
+
rowWidgetList.push(item);
|
538
|
+
});
|
543
539
|
}
|
544
540
|
return col;
|
545
541
|
};
|
@@ -561,7 +557,6 @@ modules = {
|
|
561
557
|
true
|
562
558
|
);*/
|
563
559
|
|
564
|
-
|
565
560
|
let widget = t.widget ?? null;
|
566
561
|
let editWidget = t.editWidget ?? null;
|
567
562
|
let columnOption = {};
|
@@ -593,7 +588,7 @@ modules = {
|
|
593
588
|
}
|
594
589
|
|
595
590
|
if (editWidget) {
|
596
|
-
col.editRender = {name: "input"};
|
591
|
+
col.editRender = { name: "input" };
|
597
592
|
// col.slots.edit = editWidget.id;
|
598
593
|
col.slots.edit = "editWidget";
|
599
594
|
}
|
@@ -688,9 +683,9 @@ modules = {
|
|
688
683
|
valueFormat: options.valueFormat ?? null,
|
689
684
|
};
|
690
685
|
let typeMap = {
|
691
|
-
input: {type: "input"},
|
692
|
-
number: {type: "number"},
|
693
|
-
inputBatch: {type: "inputBatch"},
|
686
|
+
input: { type: "input" },
|
687
|
+
number: { type: "number" },
|
688
|
+
inputBatch: { type: "inputBatch" },
|
694
689
|
date: {
|
695
690
|
type: "date",
|
696
691
|
widgetType: options.type,
|
@@ -706,7 +701,7 @@ modules = {
|
|
706
701
|
"date-range": {
|
707
702
|
type: "date",
|
708
703
|
widgetType: "daterange",
|
709
|
-
widgetConfig: {...dateConfig, isRange: true},
|
704
|
+
widgetConfig: { ...dateConfig, isRange: true },
|
710
705
|
},
|
711
706
|
"time-range": {
|
712
707
|
type: "time",
|
@@ -803,7 +798,7 @@ modules = {
|
|
803
798
|
parentField: "f_parent",
|
804
799
|
transform: true,
|
805
800
|
expandAll: true,
|
806
|
-
loadMethod({$table, row}) {
|
801
|
+
loadMethod({ $table, row }) {
|
807
802
|
// 模拟后台接口
|
808
803
|
let $grid = that.getGridTable();
|
809
804
|
let parentField = $grid.treeConfig.parentField;
|
@@ -879,26 +874,34 @@ modules = {
|
|
879
874
|
}
|
880
875
|
|
881
876
|
//标题颜色
|
882
|
-
let headerCellStyle = null
|
877
|
+
let headerCellStyle = null;
|
883
878
|
let tableColumns = this.widget.options.tableColumns;
|
884
|
-
let colorMap = {}
|
885
|
-
let flag = 0
|
886
|
-
tableColumns.forEach(item=>{
|
879
|
+
let colorMap = {};
|
880
|
+
let flag = 0;
|
881
|
+
/* tableColumns.forEach(item=>{
|
887
882
|
if(item.labelColor){
|
888
883
|
flag = 1;
|
889
884
|
colorMap[item.columnId] = item.labelColor
|
890
885
|
}
|
891
|
-
})
|
892
|
-
|
893
|
-
|
886
|
+
}) */
|
887
|
+
|
888
|
+
this.loodHandleColumns(tableColumns, (item) => {
|
889
|
+
if (item.labelColor) {
|
890
|
+
flag = 1;
|
891
|
+
colorMap[item.columnId] = item.labelColor;
|
892
|
+
}
|
893
|
+
});
|
894
|
+
|
895
|
+
if (flag) {
|
896
|
+
headerCellStyle = (rowParam) => {
|
894
897
|
let columnId = rowParam.column?.params?.columnId;
|
895
|
-
if(columnId){
|
896
|
-
let color = colorMap[rowParam.column.params.columnId]
|
897
|
-
if(color){
|
898
|
-
return `color:${color}
|
898
|
+
if (columnId) {
|
899
|
+
let color = colorMap[rowParam.column.params.columnId];
|
900
|
+
if (color) {
|
901
|
+
return `color:${color};`;
|
899
902
|
}
|
900
903
|
}
|
901
|
-
}
|
904
|
+
};
|
902
905
|
}
|
903
906
|
|
904
907
|
let tableOption = {
|
@@ -936,23 +939,23 @@ modules = {
|
|
936
939
|
let $grid = this.getGridTable();
|
937
940
|
let pageSize = param.size;
|
938
941
|
let currentPage = param.current;
|
939
|
-
let page = {pageSize, currentPage};
|
942
|
+
let page = { pageSize, currentPage };
|
940
943
|
let customParam = {
|
941
944
|
config: {
|
942
945
|
modal: false,
|
943
946
|
},
|
944
|
-
export: true
|
947
|
+
export: true,
|
945
948
|
};
|
946
949
|
return $grid.$options.propsData.proxyConfig.ajax.query.call(this, {
|
947
950
|
page,
|
948
951
|
param,
|
949
|
-
customParam
|
952
|
+
customParam,
|
950
953
|
});
|
951
954
|
},
|
952
955
|
// treeNodeUrl,
|
953
956
|
editDefaultRow,
|
954
957
|
treeNodeParam,
|
955
|
-
...otherConfig
|
958
|
+
...otherConfig,
|
956
959
|
};
|
957
960
|
|
958
961
|
if (isQueryTable) {
|
@@ -967,7 +970,7 @@ modules = {
|
|
967
970
|
},
|
968
971
|
ajax: {
|
969
972
|
// 接收 Promise 对象
|
970
|
-
query: ({page, sorts, filters, form, param, customParam}) => {
|
973
|
+
query: ({ page, sorts, filters, form, param, customParam }) => {
|
971
974
|
let formData = tableOption.param ? tableOption.param() || {} : {};
|
972
975
|
const queryParams = Object.assign({}, formData);
|
973
976
|
|
@@ -982,7 +985,7 @@ modules = {
|
|
982
985
|
|
983
986
|
// 处理筛选条件
|
984
987
|
if (filters) {
|
985
|
-
filters.forEach(({property, values}) => {
|
988
|
+
filters.forEach(({ property, values }) => {
|
986
989
|
queryParams[property] = values.join(",");
|
987
990
|
});
|
988
991
|
}
|
@@ -1026,12 +1029,11 @@ modules = {
|
|
1026
1029
|
//导出
|
1027
1030
|
this.initExportFieldSchemaData(rows);
|
1028
1031
|
} else {
|
1029
|
-
this.initValue(rows)
|
1032
|
+
this.initValue(rows);
|
1030
1033
|
}
|
1031
1034
|
|
1032
1035
|
resolve(res);
|
1033
1036
|
if (res.type == "success") {
|
1034
|
-
|
1035
1037
|
if (that.widget.options.isTreeTable) {
|
1036
1038
|
if (rows.length > 0) {
|
1037
1039
|
let fullAllDataRowMap =
|
@@ -1044,8 +1046,8 @@ modules = {
|
|
1044
1046
|
.map((item) => item[parentField]);
|
1045
1047
|
let expandRows = expandIds.length
|
1046
1048
|
? rows.filter((item) =>
|
1047
|
-
|
1048
|
-
|
1049
|
+
expandIds.includes(item.id)
|
1050
|
+
)
|
1049
1051
|
: [];
|
1050
1052
|
if (expandAll && expandRows.length) {
|
1051
1053
|
that.$nextTick(() => {
|
@@ -1137,12 +1139,19 @@ modules = {
|
|
1137
1139
|
}
|
1138
1140
|
|
1139
1141
|
if (tableOption.config.showFooter && !tableOption.config.footerMethod) {
|
1140
|
-
let footerColumnIds =
|
1142
|
+
let footerColumnIds = [];
|
1143
|
+
this.loodHandleColumns(columns, (item) => {
|
1144
|
+
if (!item.children?.length && !!item.params?.footerDataType) {
|
1145
|
+
footerColumnIds.push(item.params.columnId);
|
1146
|
+
}
|
1147
|
+
});
|
1148
|
+
|
1149
|
+
/* let footerColumnIds = columns
|
1141
1150
|
.filter((item) => !!item.params?.footerDataType)
|
1142
|
-
.map((item) => item.params.columnId);
|
1151
|
+
.map((item) => item.params.columnId); */
|
1143
1152
|
if (footerColumnIds.length) {
|
1144
1153
|
tableOption.config.footerMethod = (param) => {
|
1145
|
-
let {columns: column1s, data} = param;
|
1154
|
+
let { columns: column1s, data } = param;
|
1146
1155
|
return [
|
1147
1156
|
column1s.map((column, columnIndex) => {
|
1148
1157
|
let columnId = column.params?.columnId;
|
@@ -1190,6 +1199,20 @@ modules = {
|
|
1190
1199
|
}
|
1191
1200
|
});
|
1192
1201
|
},
|
1202
|
+
loodHandleColumns(columns, callback) {
|
1203
|
+
let columnLoopDo = (t, e) => {
|
1204
|
+
callback && callback(t);
|
1205
|
+
if (t.children && t.children.length) {
|
1206
|
+
for (let item of t.children) {
|
1207
|
+
columnLoopDo(item);
|
1208
|
+
}
|
1209
|
+
}
|
1210
|
+
};
|
1211
|
+
for (let item of columns) {
|
1212
|
+
columnLoopDo(item);
|
1213
|
+
}
|
1214
|
+
},
|
1215
|
+
|
1193
1216
|
meanNum(list, field) {
|
1194
1217
|
let count = this.sumNum(list, field);
|
1195
1218
|
return this.$baseDiv(count, list.length);
|
@@ -1202,7 +1225,7 @@ modules = {
|
|
1202
1225
|
return count;
|
1203
1226
|
},
|
1204
1227
|
getSearchFormData() {
|
1205
|
-
let map = {condition: []};
|
1228
|
+
let map = { condition: [] };
|
1206
1229
|
let formData = this.globalModel.formModel;
|
1207
1230
|
let widgetList = this.widget.widgetList;
|
1208
1231
|
if (!!widgetList && widgetList.length > 0) {
|
@@ -1251,18 +1274,27 @@ modules = {
|
|
1251
1274
|
return accessUrl || USER_PREFIX + `/form_ins/getFormInsData`;
|
1252
1275
|
},
|
1253
1276
|
getAttachmentType() {
|
1254
|
-
let vailColumns = this.widget.options.tableColumns.filter(
|
1277
|
+
/* let vailColumns = this.widget.options.tableColumns.filter(
|
1255
1278
|
(item) => item.prop && item.label
|
1256
1279
|
);
|
1257
1280
|
let result = vailColumns
|
1258
1281
|
.filter((item) => {
|
1259
1282
|
return item.formatS == "editAttachment";
|
1260
1283
|
})
|
1261
|
-
.map((item) => item.prop);
|
1284
|
+
.map((item) => item.prop); */
|
1285
|
+
|
1286
|
+
let result = [];
|
1287
|
+
this.loodHandleColumns(this.widget.options.tableColumns, (item) => {
|
1288
|
+
if (!item.children?.length && item.prop && item.label) {
|
1289
|
+
if (item.formatS == "editAttachment") {
|
1290
|
+
result.push(item.prop);
|
1291
|
+
}
|
1292
|
+
}
|
1293
|
+
});
|
1262
1294
|
return result;
|
1263
1295
|
},
|
1264
1296
|
getThirdtabm() {
|
1265
|
-
let vailColumns = this.widget.options.tableColumns.filter(
|
1297
|
+
/* let vailColumns = this.widget.options.tableColumns.filter(
|
1266
1298
|
(item) => item.prop && item.label
|
1267
1299
|
);
|
1268
1300
|
let result = vailColumns
|
@@ -1271,7 +1303,18 @@ modules = {
|
|
1271
1303
|
item.formatS == "editSearch" && item.columnOption.multipleChoices
|
1272
1304
|
);
|
1273
1305
|
})
|
1274
|
-
.map((item) => item.prop);
|
1306
|
+
.map((item) => item.prop); */
|
1307
|
+
let result = [];
|
1308
|
+
this.loodHandleColumns(this.widget.options.tableColumns, (item) => {
|
1309
|
+
if (!item.children?.length && item.prop && item.label) {
|
1310
|
+
if (
|
1311
|
+
item.formatS == "editSearch" &&
|
1312
|
+
item.widget?.options?.multipleChoices
|
1313
|
+
) {
|
1314
|
+
result.push(item.prop);
|
1315
|
+
}
|
1316
|
+
}
|
1317
|
+
});
|
1275
1318
|
return result;
|
1276
1319
|
},
|
1277
1320
|
|
@@ -1367,7 +1410,7 @@ modules = {
|
|
1367
1410
|
|
1368
1411
|
let requestData = {
|
1369
1412
|
...reqData,
|
1370
|
-
...otherParam
|
1413
|
+
...otherParam,
|
1371
1414
|
};
|
1372
1415
|
requestData = extendDeeply(requestData, accessParam);
|
1373
1416
|
|
@@ -1389,7 +1432,10 @@ modules = {
|
|
1389
1432
|
});
|
1390
1433
|
},
|
1391
1434
|
loadAccessData(flag) {
|
1392
|
-
if(
|
1435
|
+
if (
|
1436
|
+
this.formModel[this.fieldKeyName] &&
|
1437
|
+
this.formModel[this.fieldKeyName].length
|
1438
|
+
) {
|
1393
1439
|
this.initValue(this.formModel[this.fieldKeyName]);
|
1394
1440
|
}
|
1395
1441
|
if (flag === 1) {
|
@@ -1418,7 +1464,7 @@ modules = {
|
|
1418
1464
|
param = item.accessParam;
|
1419
1465
|
}
|
1420
1466
|
} else {
|
1421
|
-
param = {id: dataId};
|
1467
|
+
param = { id: dataId };
|
1422
1468
|
}
|
1423
1469
|
return param;
|
1424
1470
|
},
|
@@ -1432,14 +1478,14 @@ modules = {
|
|
1432
1478
|
option.prefix = option.prefix || "/" + serviceName;
|
1433
1479
|
let exportTableTarget = this.$refs.exportTable;
|
1434
1480
|
let getExportTableRef = () => {
|
1435
|
-
return exportTableTarget
|
1436
|
-
}
|
1437
|
-
this.$excelExport({targetRef: tableRef, ...option});
|
1481
|
+
return exportTableTarget;
|
1482
|
+
};
|
1483
|
+
this.$excelExport({ targetRef: tableRef, ...option });
|
1438
1484
|
},
|
1439
1485
|
async deleteRow(row, rowIndex) {
|
1440
1486
|
let isTreeTable = this.widget.options.isTreeTable;
|
1441
1487
|
if (isTreeTable) {
|
1442
|
-
this.removeTreeRow({row});
|
1488
|
+
this.removeTreeRow({ row });
|
1443
1489
|
return;
|
1444
1490
|
}
|
1445
1491
|
let $grid = this.getGridTable();
|
@@ -1454,13 +1500,40 @@ modules = {
|
|
1454
1500
|
this.$nextTick(() => {
|
1455
1501
|
this.handleWbs();
|
1456
1502
|
});
|
1457
|
-
this.deleteRowWidgets(row)
|
1503
|
+
this.deleteRowWidgets(row);
|
1458
1504
|
},
|
1459
1505
|
createNewTableData(isEdit) {
|
1460
|
-
let
|
1506
|
+
let newData = {};
|
1507
|
+
this.loodHandleColumns(this.widget.options.tableColumns, (item) => {
|
1508
|
+
if (!item.children?.length && item.prop && item.label) {
|
1509
|
+
let formatS = !isEdit ? item.formatS : item.editFormatS;
|
1510
|
+
let columnOption = !isEdit
|
1511
|
+
? item.columnOption
|
1512
|
+
: item.editColumnOption;
|
1513
|
+
if (formatS == "editSearch") {
|
1514
|
+
newData[item.prop] = null;
|
1515
|
+
let vabSearchName = item?.columnOption?.vabSearchName;
|
1516
|
+
if (vabSearchName) newData[vabSearchName] = null;
|
1517
|
+
}
|
1518
|
+
if (formatS == "editAttachment") {
|
1519
|
+
newData[item.prop] = [];
|
1520
|
+
} else {
|
1521
|
+
newData[item.prop] = null;
|
1522
|
+
if (
|
1523
|
+
columnOption &&
|
1524
|
+
columnOption.defaultValue !== undefined &&
|
1525
|
+
columnOption.defaultValue !== null &&
|
1526
|
+
columnOption.defaultValue !== ""
|
1527
|
+
) {
|
1528
|
+
newData[item.prop] = columnOption.defaultValue;
|
1529
|
+
}
|
1530
|
+
}
|
1531
|
+
}
|
1532
|
+
});
|
1533
|
+
|
1534
|
+
/* let vailColumns = this.widget.options.tableColumns.filter(
|
1461
1535
|
(item) => item.prop && item.label
|
1462
1536
|
);
|
1463
|
-
let newData = {};
|
1464
1537
|
vailColumns.forEach((item) => {
|
1465
1538
|
let formatS = !isEdit ? item.formatS : item.editFormatS;
|
1466
1539
|
let columnOption = !isEdit ? item.columnOption : item.editColumnOption;
|
@@ -1482,7 +1555,7 @@ modules = {
|
|
1482
1555
|
newData[item.prop] = columnOption.defaultValue;
|
1483
1556
|
}
|
1484
1557
|
}
|
1485
|
-
});
|
1558
|
+
}); */
|
1486
1559
|
return newData;
|
1487
1560
|
},
|
1488
1561
|
addTableData(rows, field) {
|
@@ -1626,7 +1699,7 @@ modules = {
|
|
1626
1699
|
columnSelectedWidget.options.labelHidden = true;
|
1627
1700
|
}
|
1628
1701
|
}
|
1629
|
-
return {columnSelectedWidget, columnEditFields};
|
1702
|
+
return { columnSelectedWidget, columnEditFields };
|
1630
1703
|
},
|
1631
1704
|
getColumnProp(widget, obj, isEdit) {
|
1632
1705
|
if (!widget) {
|
@@ -1662,7 +1735,9 @@ modules = {
|
|
1662
1735
|
},
|
1663
1736
|
isVabsearchFlagWidget(widget) {
|
1664
1737
|
let type = widget?.type;
|
1665
|
-
return
|
1738
|
+
return (
|
1739
|
+
type == "vabsearch" || type == "singerSearch" || type == "multiSearch"
|
1740
|
+
);
|
1666
1741
|
},
|
1667
1742
|
getColumnWidgetName(e) {
|
1668
1743
|
if (e && e.type) {
|
@@ -1703,7 +1778,7 @@ modules = {
|
|
1703
1778
|
let formRef = this.getFormRef();
|
1704
1779
|
let dataTableConfig = formRef.$attrs.dataTableOption || {};
|
1705
1780
|
dataTableConfig.onCheckboxChange &&
|
1706
|
-
|
1781
|
+
dataTableConfig.onCheckboxChange(param);
|
1707
1782
|
},
|
1708
1783
|
handleCheckboxAll(param) {
|
1709
1784
|
if (this.widget.options.onCheckboxAll) {
|
@@ -1931,9 +2006,9 @@ modules = {
|
|
1931
2006
|
let loopDo = (item) => {
|
1932
2007
|
if (item.id) delIds.push(item.id);
|
1933
2008
|
item[childrenField] &&
|
1934
|
-
|
1935
|
-
|
1936
|
-
|
2009
|
+
item[childrenField].forEach((subItem) => {
|
2010
|
+
loopDo(subItem);
|
2011
|
+
});
|
1937
2012
|
};
|
1938
2013
|
loopDo(row);
|
1939
2014
|
}
|
@@ -1941,8 +2016,7 @@ modules = {
|
|
1941
2016
|
let index = tableRows.findIndex((item) => item.id === id);
|
1942
2017
|
let delRow = tableRows[index];
|
1943
2018
|
tableRows.splice(index, 1);
|
1944
|
-
this.deleteRowWidgets(delRow)
|
1945
|
-
|
2019
|
+
this.deleteRowWidgets(delRow);
|
1946
2020
|
});
|
1947
2021
|
this.$nextTick(() => {
|
1948
2022
|
this.handleWbs();
|
@@ -2055,10 +2129,10 @@ modules = {
|
|
2055
2129
|
item.f_wbs = wbs;
|
2056
2130
|
map[item._X_ROW_KEY] = wbs;
|
2057
2131
|
item[childrenField] &&
|
2058
|
-
|
2059
|
-
|
2060
|
-
|
2061
|
-
|
2132
|
+
item[childrenField].forEach((subitem, subindex) => {
|
2133
|
+
let sub_wbs = wbs + "." + (subindex + 1) + "";
|
2134
|
+
loopDo(subitem, sub_wbs);
|
2135
|
+
});
|
2062
2136
|
};
|
2063
2137
|
fullData.forEach((item, index) => {
|
2064
2138
|
let wbs = index + 1 + "";
|
@@ -2213,7 +2287,7 @@ modules = {
|
|
2213
2287
|
},
|
2214
2288
|
// 通用行合并函数(将相同多列数据合并为一行)
|
2215
2289
|
mergeRowMethod(tableParam) {
|
2216
|
-
let {row, _rowIndex, column, visibleData} = tableParam;
|
2290
|
+
let { row, _rowIndex, column, visibleData } = tableParam;
|
2217
2291
|
let mergeRowEnabled = this.widget.options.mergeRowEnabled || false;
|
2218
2292
|
let unikey = this.widget.options.mergeRowKey;
|
2219
2293
|
const cellValue = row[unikey];
|
@@ -2222,35 +2296,35 @@ modules = {
|
|
2222
2296
|
const prevRow = visibleData[_rowIndex - 1];
|
2223
2297
|
let nextRow = visibleData[_rowIndex + 1];
|
2224
2298
|
if (prevRow && prevRow[unikey] === cellValue) {
|
2225
|
-
return {rowspan: 0, colspan: 0};
|
2299
|
+
return { rowspan: 0, colspan: 0 };
|
2226
2300
|
} else {
|
2227
2301
|
let countRowspan = 1;
|
2228
2302
|
while (nextRow && nextRow[unikey] === cellValue) {
|
2229
2303
|
nextRow = visibleData[++countRowspan + _rowIndex];
|
2230
2304
|
}
|
2231
2305
|
if (countRowspan > 1) {
|
2232
|
-
return {rowspan: countRowspan, colspan: 1};
|
2306
|
+
return { rowspan: countRowspan, colspan: 1 };
|
2233
2307
|
}
|
2234
2308
|
}
|
2235
2309
|
} else {
|
2236
2310
|
// return { rowspan: 1, colspan: 1 }
|
2237
2311
|
}
|
2238
2312
|
},
|
2239
|
-
mergeRowMethod2({row, _rowIndex, column, visibleData}) {
|
2313
|
+
mergeRowMethod2({ row, _rowIndex, column, visibleData }) {
|
2240
2314
|
const fields = ["key"];
|
2241
2315
|
const cellValue = row[column.field];
|
2242
2316
|
if (cellValue && fields.includes(column.field)) {
|
2243
2317
|
const prevRow = visibleData[_rowIndex - 1];
|
2244
2318
|
let nextRow = visibleData[_rowIndex + 1];
|
2245
2319
|
if (prevRow && prevRow[column.field] === cellValue) {
|
2246
|
-
return {rowspan: 0, colspan: 0};
|
2320
|
+
return { rowspan: 0, colspan: 0 };
|
2247
2321
|
} else {
|
2248
2322
|
let countRowspan = 1;
|
2249
2323
|
while (nextRow && nextRow[column.field] === cellValue) {
|
2250
2324
|
nextRow = visibleData[++countRowspan + _rowIndex];
|
2251
2325
|
}
|
2252
2326
|
if (countRowspan > 1) {
|
2253
|
-
return {rowspan: countRowspan, colspan: 1};
|
2327
|
+
return { rowspan: countRowspan, colspan: 1 };
|
2254
2328
|
}
|
2255
2329
|
}
|
2256
2330
|
}
|
@@ -2300,10 +2374,10 @@ modules = {
|
|
2300
2374
|
// this.widgetMap = {};
|
2301
2375
|
},
|
2302
2376
|
deleteRowWidgets(row) {
|
2303
|
-
this.rowWidgetList.forEach(widget => {
|
2377
|
+
this.rowWidgetList.forEach((widget) => {
|
2304
2378
|
let key = this.getRowRefKey(row, widget.options.name);
|
2305
2379
|
delete this.widgetMap[key];
|
2306
|
-
})
|
2380
|
+
});
|
2307
2381
|
},
|
2308
2382
|
/**end*/
|
2309
2383
|
|
@@ -2313,13 +2387,13 @@ modules = {
|
|
2313
2387
|
this.initFieldSchemaData();
|
2314
2388
|
},
|
2315
2389
|
initRowIdData(initFlag) {
|
2316
|
-
this.rowIdData.splice(0, this.rowIdData.length)
|
2317
|
-
let subFormModel = this.formModel[this.fieldKeyName]
|
2318
|
-
if (!!subFormModel &&
|
2390
|
+
this.rowIdData.splice(0, this.rowIdData.length); //清除数组必须用splice,length=0不会响应式更新!!
|
2391
|
+
let subFormModel = this.formModel[this.fieldKeyName];
|
2392
|
+
if (!!subFormModel && subFormModel.length > 0) {
|
2319
2393
|
subFormModel.forEach((row) => {
|
2320
2394
|
if (!row._X_ROW_KEY) row._X_ROW_KEY = "row_" + generateId();
|
2321
|
-
this.rowIdData.push(row._X_ROW_KEY)
|
2322
|
-
})
|
2395
|
+
this.rowIdData.push(row._X_ROW_KEY);
|
2396
|
+
});
|
2323
2397
|
|
2324
2398
|
/*if (!!initFlag) {
|
2325
2399
|
//注意:事件触发需延期执行,SumFormDataChange事件处理代码中可能存在尚未创建完成的组件!!
|
@@ -2329,31 +2403,34 @@ modules = {
|
|
2329
2403
|
}*/
|
2330
2404
|
}
|
2331
2405
|
},
|
2332
|
-
initFieldSchemaData(initFlag) {
|
2406
|
+
initFieldSchemaData(initFlag) {
|
2407
|
+
//初始化fieldSchemaData!!!
|
2333
2408
|
/*if (this.widget.type !== 'sub-form') {
|
2334
2409
|
return
|
2335
2410
|
}*/
|
2336
2411
|
|
2337
2412
|
let rows = this.formModel[this.fieldKeyName];
|
2338
2413
|
let rowIdData = this.rowIdData;
|
2339
|
-
let rowLength = this.rowIdData.length
|
2414
|
+
let rowLength = this.rowIdData.length;
|
2340
2415
|
// this.fieldSchemaData.splice(0, this.fieldSchemaData.length) //清除数组必须用splice,length=0不会响应式更新!!
|
2341
2416
|
// if(initFlag)this.fieldSchemaMap = {};
|
2342
2417
|
if (rowLength > 0) {
|
2343
2418
|
let target = this.getGridTable();
|
2344
|
-
let {fullColumn} = target.getTableColumn();
|
2419
|
+
let { fullColumn } = target.getTableColumn();
|
2345
2420
|
let allWidgets = [];
|
2346
|
-
let fieldSchemaMap = {}
|
2421
|
+
let fieldSchemaMap = {};
|
2347
2422
|
let fieldSchemaMap0 = this.fieldSchemaMap;
|
2348
2423
|
for (let i = 0; i < rowLength; i++) {
|
2349
2424
|
let rowId = rowIdData[i];
|
2350
|
-
let fieldSchemas = []
|
2425
|
+
let fieldSchemas = [];
|
2351
2426
|
let fieldSchemaMap2 = null;
|
2352
2427
|
if (initFlag) {
|
2353
2428
|
fieldSchemaMap2 = this.createRowFieldSchemaMap();
|
2354
2429
|
} else {
|
2355
|
-
let fieldSchemaMap01 = fieldSchemaMap0[rowId]
|
2356
|
-
fieldSchemaMap2 = fieldSchemaMap01
|
2430
|
+
let fieldSchemaMap01 = fieldSchemaMap0[rowId];
|
2431
|
+
fieldSchemaMap2 = fieldSchemaMap01
|
2432
|
+
? this.$baseLodash.cloneDeep(fieldSchemaMap01)
|
2433
|
+
: this.createRowFieldSchemaMap();
|
2357
2434
|
}
|
2358
2435
|
fieldSchemaMap[rowId] = fieldSchemaMap2;
|
2359
2436
|
}
|
@@ -2362,74 +2439,74 @@ modules = {
|
|
2362
2439
|
},
|
2363
2440
|
createRowFieldSchemaMap() {
|
2364
2441
|
let target = this.getGridTable();
|
2365
|
-
let {fullColumn} = target.getTableColumn();
|
2442
|
+
let { fullColumn } = target.getTableColumn();
|
2366
2443
|
|
2367
2444
|
let fieldSchemaMap2 = {};
|
2368
2445
|
fullColumn.forEach((column) => {
|
2369
2446
|
let params = column.params;
|
2370
2447
|
if (params) {
|
2371
2448
|
if (params.widget) {
|
2372
|
-
let item1 = this.cloneFieldSchema(params.widget)
|
2449
|
+
let item1 = this.cloneFieldSchema(params.widget);
|
2373
2450
|
fieldSchemaMap2[params.widget.id] = item1;
|
2374
2451
|
}
|
2375
2452
|
if (params.editWidget) {
|
2376
|
-
let item1 = this.cloneFieldSchema(params.editWidget)
|
2453
|
+
let item1 = this.cloneFieldSchema(params.editWidget);
|
2377
2454
|
fieldSchemaMap2[params.editWidget.id] = item1;
|
2378
2455
|
}
|
2379
2456
|
if (params.widgetList) {
|
2380
|
-
let widgetList = this.$baseLodash.cloneDeep(params.widgetList)
|
2457
|
+
let widgetList = this.$baseLodash.cloneDeep(params.widgetList);
|
2381
2458
|
loopHandleWidget(widgetList, (w, p) => {
|
2382
2459
|
// let item1 = this.cloneFieldSchema(w)
|
2383
|
-
let id = w.id
|
2384
|
-
w.id = w.type + generateId()
|
2460
|
+
let id = w.id;
|
2461
|
+
w.id = w.type + generateId();
|
2385
2462
|
fieldSchemaMap2[id] = w;
|
2386
|
-
})
|
2463
|
+
});
|
2387
2464
|
}
|
2388
2465
|
}
|
2389
|
-
})
|
2466
|
+
});
|
2390
2467
|
return fieldSchemaMap2;
|
2391
2468
|
},
|
2392
2469
|
addToFieldSchemaData(rowIndex) {
|
2393
|
-
let fieldSchemas = []
|
2394
|
-
this.widget.widgetList.forEach(swItem => {
|
2395
|
-
fieldSchemas.push(this.cloneFieldSchema(swItem))
|
2396
|
-
})
|
2470
|
+
let fieldSchemas = [];
|
2471
|
+
this.widget.widgetList.forEach((swItem) => {
|
2472
|
+
fieldSchemas.push(this.cloneFieldSchema(swItem));
|
2473
|
+
});
|
2397
2474
|
|
2398
2475
|
if (rowIndex === undefined) {
|
2399
|
-
this.fieldSchemaData.push(fieldSchemas)
|
2476
|
+
this.fieldSchemaData.push(fieldSchemas);
|
2400
2477
|
} else {
|
2401
|
-
this.fieldSchemaData.splice(rowIndex, 0, fieldSchemas)
|
2478
|
+
this.fieldSchemaData.splice(rowIndex, 0, fieldSchemas);
|
2402
2479
|
}
|
2403
2480
|
},
|
2404
2481
|
|
2405
2482
|
deleteFromFieldSchemaData(rowIndex) {
|
2406
|
-
this.fieldSchemaData.splice(rowIndex, 1)
|
2483
|
+
this.fieldSchemaData.splice(rowIndex, 1);
|
2407
2484
|
},
|
2408
2485
|
|
2409
2486
|
cloneFieldSchema(fieldWidget) {
|
2410
|
-
let newFieldSchema = deepClone(fieldWidget)
|
2411
|
-
newFieldSchema.id = fieldWidget.type + generateId()
|
2412
|
-
return newFieldSchema
|
2487
|
+
let newFieldSchema = deepClone(fieldWidget);
|
2488
|
+
newFieldSchema.id = fieldWidget.type + generateId();
|
2489
|
+
return newFieldSchema;
|
2413
2490
|
},
|
2414
2491
|
//end1
|
2415
2492
|
initExportFieldSchemaData(rows) {
|
2416
|
-
if (!rows) return
|
2493
|
+
if (!rows) return;
|
2417
2494
|
//初始化fieldSchemaData!!!
|
2418
|
-
let fieldSchemaMap = this.fieldSchemaMap
|
2495
|
+
let fieldSchemaMap = this.fieldSchemaMap;
|
2419
2496
|
for (let row of rows) {
|
2420
2497
|
if (!row._X_ROW_KEY) row._X_ROW_KEY = "row_" + generateId();
|
2421
|
-
this.rowIdData.push(row._X_ROW_KEY)
|
2498
|
+
this.rowIdData.push(row._X_ROW_KEY);
|
2422
2499
|
let fieldSchemaMap2 = this.createRowFieldSchemaMap();
|
2423
2500
|
fieldSchemaMap[row._X_ROW_KEY] = fieldSchemaMap2;
|
2424
2501
|
}
|
2425
2502
|
},
|
2426
2503
|
initEventHandler() {
|
2427
|
-
if(this.designState)return
|
2504
|
+
if (this.designState) return;
|
2428
2505
|
this.$on("setFormData", (o) => {
|
2429
2506
|
let rows = this.formModel[this.fieldKeyName] || [];
|
2430
2507
|
this.setValue(rows);
|
2431
|
-
})
|
2432
|
-
}
|
2508
|
+
});
|
2509
|
+
},
|
2433
2510
|
},
|
2434
2511
|
};
|
2435
2512
|
|