cloud-web-corejs 1.0.54-dev.646 → 1.0.54-dev.648
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/setting-panel/index.vue +41 -36
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/data-table-editor.vue +18 -178
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/edit-tree-button-group-config-dialog.vue +281 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/table-column-dialog.vue +37 -17
- package/src/components/xform/form-designer/setting-panel/widgetPropertyDialogMixin.js +173 -0
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +0 -4
- package/src/components/xform/form-render/container-item/containerItemMixin.js +1229 -4
- package/src/components/xform/form-render/container-item/data-table-mixin.js +123 -126
- package/src/components/xform/form-render/container-item/list-h5-item.vue +0 -2
|
@@ -153,8 +153,8 @@ modules = {
|
|
|
153
153
|
buttonsColumnFixed: function () {
|
|
154
154
|
return void 0 === this.widget.options.buttonsColumnFixed
|
|
155
155
|
? "right"
|
|
156
|
-
: !!this.widget.options.buttonsColumnFixed
|
|
157
|
-
|
|
156
|
+
: !!this.widget.options.buttonsColumnFixed &&
|
|
157
|
+
this.widget.options.buttonsColumnFixed;
|
|
158
158
|
},
|
|
159
159
|
formModel: {
|
|
160
160
|
cache: !1,
|
|
@@ -188,8 +188,8 @@ modules = {
|
|
|
188
188
|
},
|
|
189
189
|
methods: {
|
|
190
190
|
initTableCustomEvent() {
|
|
191
|
-
let tableConfig
|
|
192
|
-
|
|
191
|
+
let tableConfig =
|
|
192
|
+
this.handleCustomEvent(this.widget.options.tableConfig) || {};
|
|
193
193
|
this.eventConfig = tableConfig.eventConfig || {};
|
|
194
194
|
},
|
|
195
195
|
getTableColumnStatusWidgetLabelKey(obj) {
|
|
@@ -255,8 +255,8 @@ modules = {
|
|
|
255
255
|
if (!formScriptEnabledTypes.includes(widgetType)) return;
|
|
256
256
|
|
|
257
257
|
let formScriptEnabled = widget.options.formScriptEnabled || false;
|
|
258
|
-
let commonAttributeEnabled
|
|
259
|
-
|
|
258
|
+
let commonAttributeEnabled =
|
|
259
|
+
widget.options.commonAttributeEnabled || false;
|
|
260
260
|
let commonAttributeCode = widget.options.commonAttributeCode;
|
|
261
261
|
if (commonAttributeEnabled) {
|
|
262
262
|
if (!commonAttributeCode) return;
|
|
@@ -453,10 +453,10 @@ modules = {
|
|
|
453
453
|
let parentValue = row[parentField];
|
|
454
454
|
// 根节点(parentField为null、undefined、空字符串或0)
|
|
455
455
|
if (
|
|
456
|
-
parentValue === null
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
456
|
+
parentValue === null ||
|
|
457
|
+
parentValue === undefined ||
|
|
458
|
+
parentValue === "" ||
|
|
459
|
+
parentValue === 0
|
|
460
460
|
) {
|
|
461
461
|
sortedRows.push(row);
|
|
462
462
|
// 递归添加子节点
|
|
@@ -579,8 +579,8 @@ modules = {
|
|
|
579
579
|
let ignoreFields = options?.ignoreFields || [];
|
|
580
580
|
this.widget.widgetList.forEach((subWidget) => {
|
|
581
581
|
if (
|
|
582
|
-
!ignoreFields.length
|
|
583
|
-
|
|
582
|
+
!ignoreFields.length ||
|
|
583
|
+
!ignoreFields.includes(subWidget.options.name)
|
|
584
584
|
) {
|
|
585
585
|
let widgetRef = this.getWidgetRef(subWidget.options.name);
|
|
586
586
|
if (widgetRef && widgetRef.setValue) widgetRef.setValue(null);
|
|
@@ -620,9 +620,9 @@ modules = {
|
|
|
620
620
|
formCode = formConfig.addFormCode || formConfig.editFormCode;
|
|
621
621
|
}
|
|
622
622
|
let parentTarget = formRef.$attrs["parent-target"];
|
|
623
|
-
parentTarget
|
|
624
|
-
|
|
625
|
-
|
|
623
|
+
parentTarget &&
|
|
624
|
+
parentTarget.$attrs.openEditDialog &&
|
|
625
|
+
parentTarget.$attrs.openEditDialog(row, param, {
|
|
626
626
|
formCode,
|
|
627
627
|
...option,
|
|
628
628
|
});
|
|
@@ -833,8 +833,8 @@ modules = {
|
|
|
833
833
|
let currentData = obj.row;
|
|
834
834
|
let fieldKeyName = this.getFieldKeyName(fieldWidget);
|
|
835
835
|
let vabSearchName = fieldWidget.options.vabSearchName;
|
|
836
|
-
let multipleChoices
|
|
837
|
-
|
|
836
|
+
let multipleChoices =
|
|
837
|
+
fieldWidget.options.multipleChoices || false;
|
|
838
838
|
let labelField = vabSearchName || fieldKeyName;
|
|
839
839
|
if (!multipleChoices) {
|
|
840
840
|
result = currentData[labelField] ?? null;
|
|
@@ -891,8 +891,8 @@ modules = {
|
|
|
891
891
|
}
|
|
892
892
|
}
|
|
893
893
|
if (t.tableColumnConfig) {
|
|
894
|
-
let tableColumnConfig
|
|
895
|
-
|
|
894
|
+
let tableColumnConfig =
|
|
895
|
+
this.handleCustomEvent(t.tableColumnConfig) || {};
|
|
896
896
|
col = extendDeeply(col, tableColumnConfig);
|
|
897
897
|
}
|
|
898
898
|
return col;
|
|
@@ -936,8 +936,8 @@ modules = {
|
|
|
936
936
|
let valueField = fieldWidget.options.valueKey || "value";
|
|
937
937
|
fieldWidget.options.optionItems.forEach((oItem) => {
|
|
938
938
|
if (
|
|
939
|
-
oItem[valueField] === fieldModel
|
|
940
|
-
|
|
939
|
+
oItem[valueField] === fieldModel ||
|
|
940
|
+
this.findInArray(fieldModel, oItem[valueField]) !== -1
|
|
941
941
|
) {
|
|
942
942
|
resultList.push(this.$t1(oItem[labelField]));
|
|
943
943
|
}
|
|
@@ -976,8 +976,8 @@ modules = {
|
|
|
976
976
|
|
|
977
977
|
let isQueryAllPage = !this.widget.options.isNotQueryAllPage;
|
|
978
978
|
|
|
979
|
-
let tableConfig
|
|
980
|
-
|
|
979
|
+
let tableConfig =
|
|
980
|
+
this.handleCustomEvent(this.widget.options.tableConfig) || {};
|
|
981
981
|
this.tableConfig = tableConfig;
|
|
982
982
|
|
|
983
983
|
let tableConfig2 = this.$baseLodash.cloneDeep(tableConfig);
|
|
@@ -1093,12 +1093,12 @@ modules = {
|
|
|
1093
1093
|
.filter((column) => !!column?.params?.editWidget)
|
|
1094
1094
|
.map((column) => column.params.editWidget);
|
|
1095
1095
|
|
|
1096
|
-
let height
|
|
1097
|
-
|
|
1096
|
+
let height =
|
|
1097
|
+
this.widget.options.tableHeight || (isQueryTable ? "auto" : null);
|
|
1098
1098
|
if (
|
|
1099
|
-
!this.widget.options.tableHeight
|
|
1100
|
-
&&
|
|
1101
|
-
|
|
1099
|
+
!this.widget.options.tableHeight &&
|
|
1100
|
+
isQueryTable &&
|
|
1101
|
+
this.previewState
|
|
1102
1102
|
) {
|
|
1103
1103
|
height = "550px";
|
|
1104
1104
|
}
|
|
@@ -1205,11 +1205,11 @@ modules = {
|
|
|
1205
1205
|
} */
|
|
1206
1206
|
that.$nextTick(() => {
|
|
1207
1207
|
setTimeout(function () {
|
|
1208
|
-
dataTableConfig.callback
|
|
1209
|
-
|
|
1208
|
+
dataTableConfig.callback &&
|
|
1209
|
+
dataTableConfig.callback(rows);
|
|
1210
1210
|
tableOption.callback && tableOption.callback(rows);
|
|
1211
|
-
tableConfig.treeCallback
|
|
1212
|
-
|
|
1211
|
+
tableConfig.treeCallback &&
|
|
1212
|
+
tableConfig.treeCallback(rows);
|
|
1213
1213
|
}, 0);
|
|
1214
1214
|
});
|
|
1215
1215
|
} else {
|
|
@@ -1302,8 +1302,8 @@ modules = {
|
|
|
1302
1302
|
|
|
1303
1303
|
let exportItemConfig = null;
|
|
1304
1304
|
if (
|
|
1305
|
-
this.widget.options.exportItemColumns
|
|
1306
|
-
|
|
1305
|
+
this.widget.options.exportItemColumns &&
|
|
1306
|
+
this.widget.options.exportItemColumns.length > 0
|
|
1307
1307
|
) {
|
|
1308
1308
|
let formatKeys = [
|
|
1309
1309
|
"d1",
|
|
@@ -1354,8 +1354,8 @@ modules = {
|
|
|
1354
1354
|
);
|
|
1355
1355
|
exportItemConfig = {
|
|
1356
1356
|
scriptCode:
|
|
1357
|
-
this.widget.options.exportItemScriptCode
|
|
1358
|
-
|
|
1357
|
+
this.widget.options.exportItemScriptCode ||
|
|
1358
|
+
this.widget.options.formScriptCode,
|
|
1359
1359
|
columns: exportItemColumns,
|
|
1360
1360
|
param: () => {
|
|
1361
1361
|
if (this.widget.options.exportItemParam) {
|
|
@@ -1493,8 +1493,8 @@ modules = {
|
|
|
1493
1493
|
}
|
|
1494
1494
|
|
|
1495
1495
|
let reqPath = typeof path === "function" ? path() : path;
|
|
1496
|
-
let accessReturnType
|
|
1497
|
-
|
|
1496
|
+
let accessReturnType =
|
|
1497
|
+
this.widget.options.accessReturnType || "2";
|
|
1498
1498
|
|
|
1499
1499
|
return new Promise((resolve, reject) => {
|
|
1500
1500
|
let reqData = {
|
|
@@ -1530,8 +1530,8 @@ modules = {
|
|
|
1530
1530
|
if (res.type === "success") {
|
|
1531
1531
|
if (that.widget.options.isTreeTable) {
|
|
1532
1532
|
if (rows.length > 0) {
|
|
1533
|
-
let fullAllDataRowMap
|
|
1534
|
-
|
|
1533
|
+
let fullAllDataRowMap =
|
|
1534
|
+
$grid.$refs.xTable.fullAllDataRowMap;
|
|
1535
1535
|
let parentField = $grid.treeConfig.parentField;
|
|
1536
1536
|
let expandAll = $grid.treeConfig.expandAll || false;
|
|
1537
1537
|
let isLazy = $grid.treeConfig.lazy;
|
|
@@ -1554,8 +1554,8 @@ modules = {
|
|
|
1554
1554
|
lineData
|
|
1555
1555
|
)
|
|
1556
1556
|
) {
|
|
1557
|
-
let rest
|
|
1558
|
-
|
|
1557
|
+
let rest =
|
|
1558
|
+
fullAllDataRowMap.get(lineData);
|
|
1559
1559
|
rest.treeLoaded = true;
|
|
1560
1560
|
}
|
|
1561
1561
|
});
|
|
@@ -1567,8 +1567,8 @@ modules = {
|
|
|
1567
1567
|
|
|
1568
1568
|
let row = rows.find((item) => !item[parentField]);
|
|
1569
1569
|
if (
|
|
1570
|
-
row
|
|
1571
|
-
|
|
1570
|
+
row &&
|
|
1571
|
+
(!expandAll || !expandIds.includes(row.id))
|
|
1572
1572
|
) {
|
|
1573
1573
|
let hasChild = $grid.treeConfig.hasChild;
|
|
1574
1574
|
if (row[hasChild]) {
|
|
@@ -1583,8 +1583,8 @@ modules = {
|
|
|
1583
1583
|
}
|
|
1584
1584
|
that.$nextTick(() => {
|
|
1585
1585
|
setTimeout(function () {
|
|
1586
|
-
dataTableConfig.callback
|
|
1587
|
-
|
|
1586
|
+
dataTableConfig.callback &&
|
|
1587
|
+
dataTableConfig.callback(rows);
|
|
1588
1588
|
tableOption.callback && tableOption.callback(rows);
|
|
1589
1589
|
that.handleCustomEvent(
|
|
1590
1590
|
that.widget.options.formScriptCallback,
|
|
@@ -1742,13 +1742,13 @@ modules = {
|
|
|
1742
1742
|
if (["date-range", "time-range"].includes(wType)) {
|
|
1743
1743
|
item.filter = "between";
|
|
1744
1744
|
} else if (
|
|
1745
|
-
["input-batch", "checkbox"].includes(wType)
|
|
1746
|
-
|
|
1745
|
+
["input-batch", "checkbox"].includes(wType) ||
|
|
1746
|
+
(wType === "select" && wItem.options.multiple)
|
|
1747
1747
|
) {
|
|
1748
1748
|
item.filter = "in";
|
|
1749
1749
|
} else if (
|
|
1750
|
-
["radio", "time", "date"].includes(wType)
|
|
1751
|
-
|
|
1750
|
+
["radio", "time", "date"].includes(wType) ||
|
|
1751
|
+
(wType === "select" && !wItem.options.multiple)
|
|
1752
1752
|
) {
|
|
1753
1753
|
item.filter = "eq";
|
|
1754
1754
|
} else {
|
|
@@ -1804,8 +1804,8 @@ modules = {
|
|
|
1804
1804
|
this.loodHandleColumns(this.widget.options.tableColumns, (item) => {
|
|
1805
1805
|
if (!item.children?.length && item.prop && item.label) {
|
|
1806
1806
|
if (
|
|
1807
|
-
item.formatS === "editSearch"
|
|
1808
|
-
|
|
1807
|
+
item.formatS === "editSearch" &&
|
|
1808
|
+
item.widget?.options?.multipleChoices
|
|
1809
1809
|
) {
|
|
1810
1810
|
result.push(item.prop);
|
|
1811
1811
|
}
|
|
@@ -1969,8 +1969,8 @@ modules = {
|
|
|
1969
1969
|
},
|
|
1970
1970
|
loadAccessData(flag) {
|
|
1971
1971
|
if (
|
|
1972
|
-
this.formModel[this.fieldKeyName]
|
|
1973
|
-
|
|
1972
|
+
this.formModel[this.fieldKeyName] &&
|
|
1973
|
+
this.formModel[this.fieldKeyName].length
|
|
1974
1974
|
) {
|
|
1975
1975
|
this.initValue(this.formModel[this.fieldKeyName]);
|
|
1976
1976
|
}
|
|
@@ -2039,9 +2039,9 @@ modules = {
|
|
|
2039
2039
|
},
|
|
2040
2040
|
isSingerlSearch(widget) {
|
|
2041
2041
|
let widgetType = widget?.type;
|
|
2042
|
-
let result
|
|
2043
|
-
|
|
2044
|
-
|
|
2042
|
+
let result =
|
|
2043
|
+
widgetType === "singerSearch" ||
|
|
2044
|
+
(widgetType === "vabsearch" && !widget.options.multipleChoices);
|
|
2045
2045
|
return result;
|
|
2046
2046
|
},
|
|
2047
2047
|
getColumnNullValue(widget, defaultValueEnabled) {
|
|
@@ -2058,10 +2058,10 @@ modules = {
|
|
|
2058
2058
|
|
|
2059
2059
|
let defaultValue = widget.options.defaultValue;
|
|
2060
2060
|
if (
|
|
2061
|
-
defaultValue !== undefined
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2061
|
+
defaultValue !== undefined &&
|
|
2062
|
+
defaultValue !== null &&
|
|
2063
|
+
defaultValue !== "" &&
|
|
2064
|
+
defaultValueEnabled !== false
|
|
2065
2065
|
) {
|
|
2066
2066
|
nullValue = defaultValue;
|
|
2067
2067
|
} else if (widgetType === "select" && widget.options.multiple) {
|
|
@@ -2199,13 +2199,13 @@ modules = {
|
|
|
2199
2199
|
columnOption.required = row.required || false;
|
|
2200
2200
|
columnSelectedWidget.options = columnOption;
|
|
2201
2201
|
if ("editDelete" === formatS) {
|
|
2202
|
-
columnSelectedWidget.options.hiddenByWf
|
|
2203
|
-
|
|
2204
|
-
columnSelectedWidget.options.prefixIcon
|
|
2205
|
-
|
|
2202
|
+
columnSelectedWidget.options.hiddenByWf =
|
|
2203
|
+
columnSelectedWidget.options.hiddenByWf ?? true;
|
|
2204
|
+
columnSelectedWidget.options.prefixIcon =
|
|
2205
|
+
columnSelectedWidget.options.prefixIcon || "el-icon-delete";
|
|
2206
2206
|
} else if ("editButton" === formatS) {
|
|
2207
|
-
columnSelectedWidget.options.prefixIcon
|
|
2208
|
-
|
|
2207
|
+
columnSelectedWidget.options.prefixIcon =
|
|
2208
|
+
columnSelectedWidget.options.prefixIcon || "el-icon-edit";
|
|
2209
2209
|
}
|
|
2210
2210
|
} else {
|
|
2211
2211
|
columnSelectedWidget.options.required = row.required || false;
|
|
@@ -2214,44 +2214,44 @@ modules = {
|
|
|
2214
2214
|
columnSelectedWidget.options.label = "删除";
|
|
2215
2215
|
columnSelectedWidget.options.labelHidden = true;
|
|
2216
2216
|
columnSelectedWidget.options.hiddenByWf = true;
|
|
2217
|
-
columnSelectedWidget.options.onClick
|
|
2218
|
-
|
|
2217
|
+
columnSelectedWidget.options.onClick =
|
|
2218
|
+
"let tableParam = this.tableParam;\nlet tableRef = this.getWidgetRef(this.parentWidget.options.name);\ntableRef.deleteRow(tableParam.row,tableParam.rowIndex);";
|
|
2219
2219
|
} else if ("editButton" === formatS) {
|
|
2220
2220
|
columnSelectedWidget.options.prefixIcon = "el-icon-edit";
|
|
2221
2221
|
columnSelectedWidget.options.label = "查看";
|
|
2222
2222
|
columnSelectedWidget.options.labelHidden = true;
|
|
2223
|
-
columnSelectedWidget.options.onClick
|
|
2224
|
-
|
|
2223
|
+
columnSelectedWidget.options.onClick =
|
|
2224
|
+
"let tableParam = this.tableParam;\nlet tableRef = this.getWidgetRef(this.parentWidget.options.name);\ntableRef.openEditDialog(tableParam.row)";
|
|
2225
2225
|
} else if ("addSiblingEditRow" === formatS) {
|
|
2226
2226
|
columnSelectedWidget.options.prefixIcon = "el-icon-plus";
|
|
2227
2227
|
columnSelectedWidget.options.label = "新增兄弟节点";
|
|
2228
2228
|
columnSelectedWidget.options.labelHidden = false;
|
|
2229
|
-
columnSelectedWidget.options.onClick
|
|
2230
|
-
|
|
2229
|
+
columnSelectedWidget.options.onClick =
|
|
2230
|
+
"let tableParam = this.tableParam;\nthis.getParentTarget().addSiblingTreeRow(null,tableParam);";
|
|
2231
2231
|
} else if ("addChildTreeRow" === formatS) {
|
|
2232
2232
|
columnSelectedWidget.options.prefixIcon = "el-icon-plus";
|
|
2233
2233
|
columnSelectedWidget.options.label = "新增子节点";
|
|
2234
2234
|
columnSelectedWidget.options.labelHidden = false;
|
|
2235
|
-
columnSelectedWidget.options.onClick
|
|
2236
|
-
|
|
2235
|
+
columnSelectedWidget.options.onClick =
|
|
2236
|
+
"let tableParam = this.tableParam;\nthis.getParentTarget().addChildTreeRow(null,tableParam);";
|
|
2237
2237
|
} else if ("moveUpRow" === formatS) {
|
|
2238
2238
|
// columnSelectedWidget.options.prefixIcon = "el-icon-plus";
|
|
2239
2239
|
columnSelectedWidget.options.label = "↑上移";
|
|
2240
2240
|
columnSelectedWidget.options.labelHidden = false;
|
|
2241
|
-
columnSelectedWidget.options.onClick
|
|
2242
|
-
|
|
2241
|
+
columnSelectedWidget.options.onClick =
|
|
2242
|
+
"let tableParam = this.tableParam;\nthis.getParentTarget().moveUpRow(tableParam);";
|
|
2243
2243
|
} else if ("moveDownRow" === formatS) {
|
|
2244
2244
|
// columnSelectedWidget.options.prefixIcon = "el-icon-plus";
|
|
2245
2245
|
columnSelectedWidget.options.label = "↓下移";
|
|
2246
2246
|
columnSelectedWidget.options.labelHidden = false;
|
|
2247
|
-
columnSelectedWidget.options.onClick
|
|
2248
|
-
|
|
2247
|
+
columnSelectedWidget.options.onClick =
|
|
2248
|
+
"let tableParam = this.tableParam;\nthis.getParentTarget().moveDownRow(tableParam);";
|
|
2249
2249
|
} else if ("removeTreeRow" === formatS) {
|
|
2250
2250
|
columnSelectedWidget.options.prefixIcon = "el-icon-delete";
|
|
2251
2251
|
columnSelectedWidget.options.label = "删除";
|
|
2252
2252
|
columnSelectedWidget.options.labelHidden = true;
|
|
2253
|
-
columnSelectedWidget.options.onClick
|
|
2254
|
-
|
|
2253
|
+
columnSelectedWidget.options.onClick =
|
|
2254
|
+
"let tableParam = this.tableParam;\nthis.getParentTarget().removeTreeRow(tableParam);";
|
|
2255
2255
|
}
|
|
2256
2256
|
columnOption = columnSelectedWidget.options;
|
|
2257
2257
|
}
|
|
@@ -2388,9 +2388,9 @@ modules = {
|
|
|
2388
2388
|
isVabsearchFlagWidget(widget) {
|
|
2389
2389
|
let type = widget?.type;
|
|
2390
2390
|
return (
|
|
2391
|
-
type === "vabsearch"
|
|
2392
|
-
|
|
2393
|
-
|
|
2391
|
+
type === "vabsearch" ||
|
|
2392
|
+
type === "singerSearch" ||
|
|
2393
|
+
type === "multiSearch"
|
|
2394
2394
|
);
|
|
2395
2395
|
},
|
|
2396
2396
|
getColumnWidgetName(e) {
|
|
@@ -2431,8 +2431,8 @@ modules = {
|
|
|
2431
2431
|
}
|
|
2432
2432
|
let formRef = this.getFormRef();
|
|
2433
2433
|
let dataTableConfig = formRef.$attrs.dataTableOption || {};
|
|
2434
|
-
dataTableConfig.onCheckboxChange
|
|
2435
|
-
|
|
2434
|
+
dataTableConfig.onCheckboxChange &&
|
|
2435
|
+
dataTableConfig.onCheckboxChange(param);
|
|
2436
2436
|
},
|
|
2437
2437
|
handleCheckboxAll(param) {
|
|
2438
2438
|
if (this.widget.options.onCheckboxAll) {
|
|
@@ -2611,8 +2611,8 @@ modules = {
|
|
|
2611
2611
|
}
|
|
2612
2612
|
|
|
2613
2613
|
// Object.assign(newRow, editDefaultRow, rowData);
|
|
2614
|
-
newRow.id
|
|
2615
|
-
|
|
2614
|
+
newRow.id =
|
|
2615
|
+
"row_" + new Date().valueOf() + Math.floor(Math.random() * 1000000);
|
|
2616
2616
|
if (!toSibling) {
|
|
2617
2617
|
newRow[parentField] = parent?.id || 0;
|
|
2618
2618
|
} else {
|
|
@@ -2627,8 +2627,8 @@ modules = {
|
|
|
2627
2627
|
if (toEnd === true) {
|
|
2628
2628
|
tableRows.push(newRow);
|
|
2629
2629
|
} else if (toSibling === true) {
|
|
2630
|
-
let addIndex
|
|
2631
|
-
|
|
2630
|
+
let addIndex =
|
|
2631
|
+
tableRows.findIndex(
|
|
2632
2632
|
(item) => item._X_ROW_KEY === obj.row._X_ROW_KEY
|
|
2633
2633
|
) + 1;
|
|
2634
2634
|
tableRows.splice(addIndex, 0, newRow);
|
|
@@ -2649,8 +2649,8 @@ modules = {
|
|
|
2649
2649
|
if (toEnd === true) {
|
|
2650
2650
|
tableRows.push(newRow);
|
|
2651
2651
|
} else if (toSibling === true) {
|
|
2652
|
-
let addIndex
|
|
2653
|
-
|
|
2652
|
+
let addIndex =
|
|
2653
|
+
tableRows.findIndex(
|
|
2654
2654
|
(item) => item._X_ROW_KEY === obj.row._X_ROW_KEY
|
|
2655
2655
|
) + 1;
|
|
2656
2656
|
tableRows.splice(addIndex, 0, newRow);
|
|
@@ -2731,50 +2731,47 @@ modules = {
|
|
|
2731
2731
|
let dispermissions = this.$store.getters.dispermissions;
|
|
2732
2732
|
return !dispermissions.includes(authCode);
|
|
2733
2733
|
},
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2734
|
+
getEditTreeButtonGroupConfig(obj) {
|
|
2735
|
+
let columnConfig = obj?.column?.params?.columnConfig || {};
|
|
2736
|
+
let tableOptions = this.widget.options || {};
|
|
2737
|
+
return {
|
|
2738
|
+
rowAddAuthName: columnConfig.rowAddAuthName,
|
|
2739
|
+
rowEditAuthName: columnConfig.rowEditAuthName,
|
|
2740
|
+
rowAddShow: columnConfig.rowAddShow,
|
|
2741
|
+
rowEditShow: columnConfig.rowEditShow,
|
|
2742
|
+
};
|
|
2738
2743
|
},
|
|
2739
|
-
|
|
2740
|
-
return (
|
|
2741
|
-
this.widget.options.rowEditAuthName
|
|
2742
|
-
?? this.widget.options.treeRowEditName
|
|
2743
|
-
);
|
|
2744
|
+
getRowAddAuthName(obj) {
|
|
2745
|
+
return this.getEditTreeButtonGroupConfig(obj).rowAddAuthName;
|
|
2744
2746
|
},
|
|
2745
|
-
|
|
2746
|
-
return (
|
|
2747
|
-
this.widget.options.rowAddShow ?? this.widget.options.treeRowAddShow
|
|
2748
|
-
);
|
|
2747
|
+
getRowEditAuthName(obj) {
|
|
2748
|
+
return this.getEditTreeButtonGroupConfig(obj).rowEditAuthName;
|
|
2749
2749
|
},
|
|
2750
|
-
|
|
2751
|
-
return (
|
|
2752
|
-
|
|
2753
|
-
|
|
2750
|
+
getRowAddShow(obj) {
|
|
2751
|
+
return this.getEditTreeButtonGroupConfig(obj).rowAddShow;
|
|
2752
|
+
},
|
|
2753
|
+
getRowEditShow(obj) {
|
|
2754
|
+
return this.getEditTreeButtonGroupConfig(obj).rowEditShow;
|
|
2754
2755
|
},
|
|
2755
2756
|
isRowButtonShow(script, obj) {
|
|
2756
2757
|
if (!script) {
|
|
2757
2758
|
return true;
|
|
2758
2759
|
}
|
|
2759
|
-
let result = this.handleCustomEvent(
|
|
2760
|
-
script,
|
|
2761
|
-
["row", "rowIndex"],
|
|
2762
|
-
[obj?.row, obj?.rowIndex]
|
|
2763
|
-
);
|
|
2760
|
+
let result = this.handleCustomEvent(script, ["tableParam"], [obj]);
|
|
2764
2761
|
return result !== false;
|
|
2765
2762
|
},
|
|
2766
2763
|
canShowRowAdd(obj) {
|
|
2767
2764
|
return (
|
|
2768
|
-
this.hasTableRowPermission(this.getRowAddAuthName())
|
|
2769
|
-
|
|
2765
|
+
this.hasTableRowPermission(this.getRowAddAuthName(obj)) &&
|
|
2766
|
+
this.isRowButtonShow(this.getRowAddShow(obj), obj)
|
|
2770
2767
|
);
|
|
2771
2768
|
},
|
|
2772
2769
|
canShowRowEdit(obj) {
|
|
2773
2770
|
let isAddRow = !this.hasSaveRow(obj?.row);
|
|
2774
2771
|
if (isAddRow) return true;
|
|
2775
2772
|
return (
|
|
2776
|
-
this.hasTableRowPermission(this.getRowEditAuthName())
|
|
2777
|
-
|
|
2773
|
+
this.hasTableRowPermission(this.getRowEditAuthName(obj)) &&
|
|
2774
|
+
this.isRowButtonShow(this.getRowEditShow(obj), obj)
|
|
2778
2775
|
);
|
|
2779
2776
|
},
|
|
2780
2777
|
editRowEvent(obj) {
|
|
@@ -2814,8 +2811,8 @@ modules = {
|
|
|
2814
2811
|
}
|
|
2815
2812
|
}
|
|
2816
2813
|
|
|
2817
|
-
newRow.id
|
|
2818
|
-
|
|
2814
|
+
newRow.id =
|
|
2815
|
+
"row_" + new Date().valueOf() + Math.floor(Math.random() * 1000000);
|
|
2819
2816
|
if (isTreeTable) {
|
|
2820
2817
|
let parentField = $grid.treeConfig.parentField;
|
|
2821
2818
|
if (!toSibling) {
|
|
@@ -2833,8 +2830,8 @@ modules = {
|
|
|
2833
2830
|
if (toEnd === true) {
|
|
2834
2831
|
tableRows.push(newRow);
|
|
2835
2832
|
} else if (toSibling === true) {
|
|
2836
|
-
let addIndex
|
|
2837
|
-
|
|
2833
|
+
let addIndex =
|
|
2834
|
+
tableRows.findIndex(
|
|
2838
2835
|
(item) => item._X_ROW_KEY === obj.row._X_ROW_KEY
|
|
2839
2836
|
) + 1;
|
|
2840
2837
|
tableRows.splice(addIndex, 0, newRow);
|
|
@@ -2855,8 +2852,8 @@ modules = {
|
|
|
2855
2852
|
if (toEnd === true) {
|
|
2856
2853
|
tableRows.push(newRow);
|
|
2857
2854
|
} else if (toSibling === true) {
|
|
2858
|
-
let addIndex
|
|
2859
|
-
|
|
2855
|
+
let addIndex =
|
|
2856
|
+
tableRows.findIndex(
|
|
2860
2857
|
(item) => item._X_ROW_KEY === obj.row._X_ROW_KEY
|
|
2861
2858
|
) + 1;
|
|
2862
2859
|
tableRows.splice(addIndex, 0, newRow);
|
|
@@ -2901,8 +2898,8 @@ modules = {
|
|
|
2901
2898
|
let loopDo = (item, wbs) => {
|
|
2902
2899
|
item.f_wbs = wbs;
|
|
2903
2900
|
map[item._X_ROW_KEY] = wbs;
|
|
2904
|
-
item[childrenField]
|
|
2905
|
-
|
|
2901
|
+
item[childrenField] &&
|
|
2902
|
+
item[childrenField].forEach((subitem, subindex) => {
|
|
2906
2903
|
let sub_wbs = wbs + "." + (subindex + 1) + "";
|
|
2907
2904
|
loopDo(subitem, sub_wbs);
|
|
2908
2905
|
});
|