cloud-web-corejs 1.0.218 → 1.0.220
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/baseAlert/index.vue +1 -1
- package/src/components/excelExport/button.vue +55 -46
- package/src/components/excelExport/exportFieldDialog.vue +3 -3
- package/src/components/excelExport/index.vue +62 -34
- package/src/components/excelExport/mixins.js +969 -2
- package/src/components/table/config.js +74 -1
- package/src/components/table/index.js +203 -89
- package/src/components/table/tableFormMixin.js +285 -1
- package/src/components/table/util/index.js +5 -1
- package/src/components/table/vxeFilter/index.js +3 -3
- package/src/components/table/vxeFilter/mixin.js +4 -4
- package/src/components/xform/form-designer/form-widget/dialog/importDialogMixin.js +104 -101
- package/src/components/xform/form-designer/setting-panel/form-setting.vue +4 -4
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/table-column-dialog.vue +3 -3
- package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import-button-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import2-button-editor.vue +1 -1
- package/src/components/xform/form-render/container-item/data-table-mixin.js +321 -103
- package/src/components/xform/mixins/defaultHandle.js +75 -48
- package/src/layout/components/Sidebar/default.vue +11 -6
- package/src/layout/components/langTool.vue +32 -29
- package/src/store/getters.js +2 -1
- package/src/store/modules/user.js +27 -3
- package/src/utils/vab.js +83 -73
- package/src/views/user/user/edit.vue +45 -0
|
@@ -243,7 +243,7 @@ modules = {
|
|
|
243
243
|
let formScriptEnabledTypes = ["select", "checkbox", "radio"];
|
|
244
244
|
if (formScriptEnabledTypes.includes(widgetType)) {
|
|
245
245
|
widget.options.optionItems = rows || [];
|
|
246
|
-
} else if (widgetType
|
|
246
|
+
} else if (widgetType === "status") {
|
|
247
247
|
widget.options.statusParam = rows || [];
|
|
248
248
|
}
|
|
249
249
|
widget._syncInited = true;
|
|
@@ -359,8 +359,8 @@ modules = {
|
|
|
359
359
|
},
|
|
360
360
|
|
|
361
361
|
getWidgetRefByTableParam(tableParam) {
|
|
362
|
-
|
|
363
|
-
|
|
362
|
+
let params = tableParam.column.params;
|
|
363
|
+
let name = params.widget.options.name;
|
|
364
364
|
// let key = this.getRowRefKey(tableParam.row, name);
|
|
365
365
|
return this.getWidgetRefByTableRowData(tableParam.row, name);
|
|
366
366
|
// return this.getWidgetRef(key);
|
|
@@ -384,7 +384,7 @@ modules = {
|
|
|
384
384
|
},
|
|
385
385
|
getRowWidgetOption(rowParam, fieldWidget) {
|
|
386
386
|
let widget = this.getRowWidget(rowParam, fieldWidget);
|
|
387
|
-
let field = widget.category
|
|
387
|
+
let field = widget.category === "container" ? "widget" : "field";
|
|
388
388
|
let option = {
|
|
389
389
|
[field]: widget,
|
|
390
390
|
};
|
|
@@ -412,6 +412,7 @@ modules = {
|
|
|
412
412
|
},
|
|
413
413
|
initFieldSchema(val) {
|
|
414
414
|
let rows = val || [];
|
|
415
|
+
// 处理树结构数据排序
|
|
415
416
|
this.formModel[this.fieldKeyName] = rows;
|
|
416
417
|
this.fieldModel = rows;
|
|
417
418
|
this.initRowIdData(true);
|
|
@@ -420,6 +421,7 @@ modules = {
|
|
|
420
421
|
initValue(val) {
|
|
421
422
|
// this.clearRowWidgets()
|
|
422
423
|
let rows = val || [];
|
|
424
|
+
// this.handleNullValue(rows);
|
|
423
425
|
rows.forEach((row, index) => {
|
|
424
426
|
row._X_ROW_KEY = "row_" + generateId();
|
|
425
427
|
});
|
|
@@ -428,6 +430,65 @@ modules = {
|
|
|
428
430
|
this.initRowIdData(true);
|
|
429
431
|
this.initFieldSchemaData(true);
|
|
430
432
|
},
|
|
433
|
+
handleTreeData(rows) {
|
|
434
|
+
let isTreeTable = this.widget.options.isTreeTable;
|
|
435
|
+
if (isTreeTable) {
|
|
436
|
+
let $grid = this.getGridTable();
|
|
437
|
+
if(!$grid)return
|
|
438
|
+
let parentField = $grid.treeConfig.parentField;
|
|
439
|
+
if(parentField) {
|
|
440
|
+
// 构建树结构并排序
|
|
441
|
+
let sortedRows = [];
|
|
442
|
+
let nodeMap = new Map();
|
|
443
|
+
|
|
444
|
+
// 第一步:构建节点映射
|
|
445
|
+
rows.forEach(row => {
|
|
446
|
+
if (row.id !== undefined && row.id !== null) {
|
|
447
|
+
nodeMap.set(row.id, row);
|
|
448
|
+
}
|
|
449
|
+
});
|
|
450
|
+
|
|
451
|
+
// 第二步:按层次排序,先根节点,然后子节点
|
|
452
|
+
rows.forEach(row => {
|
|
453
|
+
let parentValue = row[parentField];
|
|
454
|
+
// 根节点(parentField为null、undefined、空字符串或0)
|
|
455
|
+
if (parentValue === null || parentValue === undefined || parentValue === '' || parentValue === 0) {
|
|
456
|
+
sortedRows.push(row);
|
|
457
|
+
// 递归添加子节点
|
|
458
|
+
this.addChildNodes(row.id, nodeMap, parentField, sortedRows);
|
|
459
|
+
}
|
|
460
|
+
});
|
|
461
|
+
|
|
462
|
+
// 如果没有找到根节点,返回原始数组
|
|
463
|
+
if (sortedRows.length === 0) {
|
|
464
|
+
return rows;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
return sortedRows;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
return rows;
|
|
471
|
+
},
|
|
472
|
+
addChildNodes(parentId, nodeMap, parentField, sortedRows) {
|
|
473
|
+
// 遍历所有节点,找出当前父节点的子节点
|
|
474
|
+
for (let [id, node] of nodeMap.entries()) {
|
|
475
|
+
// 处理parentField值的类型转换,确保比较正确
|
|
476
|
+
let nodeParentValue = node[parentField];
|
|
477
|
+
let targetParentId = parentId;
|
|
478
|
+
|
|
479
|
+
// 转换为相同类型进行比较
|
|
480
|
+
if (typeof nodeParentValue !== typeof targetParentId) {
|
|
481
|
+
nodeParentValue = String(nodeParentValue);
|
|
482
|
+
targetParentId = String(targetParentId);
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
if (nodeParentValue === targetParentId) {
|
|
486
|
+
sortedRows.push(node);
|
|
487
|
+
// 递归添加子节点的子节点
|
|
488
|
+
this.addChildNodes(id, nodeMap, parentField, sortedRows);
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
},
|
|
431
492
|
setValue(val) {
|
|
432
493
|
// console.log("rows:",val);
|
|
433
494
|
this.clearRowWidgets();
|
|
@@ -496,7 +557,7 @@ modules = {
|
|
|
496
557
|
return this.widget.options.tableData.lastIndexOf(e);
|
|
497
558
|
},
|
|
498
559
|
setTableColumns: function (e) {
|
|
499
|
-
|
|
560
|
+
let t = this;
|
|
500
561
|
(this.widget.options.tableColumns = e),
|
|
501
562
|
this.$nextTick(function () {
|
|
502
563
|
t.$refs.dataTable.doLayout();
|
|
@@ -563,7 +624,7 @@ modules = {
|
|
|
563
624
|
},
|
|
564
625
|
importExcel() {},
|
|
565
626
|
getGrid(that, tableRef) {
|
|
566
|
-
|
|
627
|
+
let $grid;
|
|
567
628
|
if (Array.isArray(that.$refs[tableRef])) {
|
|
568
629
|
$grid = that.$refs[tableRef][0];
|
|
569
630
|
} else {
|
|
@@ -573,7 +634,7 @@ modules = {
|
|
|
573
634
|
},
|
|
574
635
|
getTableCondition: function () {
|
|
575
636
|
if (this.widget.options.tableCondition) {
|
|
576
|
-
|
|
637
|
+
let e = new Function(this.widget.options.tableCondition);
|
|
577
638
|
return e.call(this);
|
|
578
639
|
}
|
|
579
640
|
},
|
|
@@ -607,6 +668,7 @@ modules = {
|
|
|
607
668
|
}
|
|
608
669
|
|
|
609
670
|
let tableWidgetName = this.widget.options.name;
|
|
671
|
+
let isEditTable = this.widget.options.isEditTable || false;
|
|
610
672
|
const createColumn = (t, isChild) => {
|
|
611
673
|
let filterable = t.filterable ?? true;
|
|
612
674
|
let filterType = filterable ? null : false;
|
|
@@ -634,6 +696,11 @@ modules = {
|
|
|
634
696
|
};
|
|
635
697
|
if (t.required) {
|
|
636
698
|
col.title = col.title;
|
|
699
|
+
/* if(!isEditTable){
|
|
700
|
+
col.titlePrefix = {
|
|
701
|
+
icon: "vxe-cell--required-icon"
|
|
702
|
+
}
|
|
703
|
+
} */
|
|
637
704
|
col.titlePrefix = {
|
|
638
705
|
icon: "vxe-cell--required-icon"
|
|
639
706
|
}
|
|
@@ -715,9 +782,75 @@ modules = {
|
|
|
715
782
|
columnConfig: t,
|
|
716
783
|
editWidget,
|
|
717
784
|
};
|
|
785
|
+
|
|
718
786
|
Object.assign(col.params, params);
|
|
787
|
+
let types = ['input','number', 'text','select','checkbox','radio','status','vabsearch','date']
|
|
788
|
+
if(widget && types.includes(widget.type)){
|
|
789
|
+
const func = (obj)=>{
|
|
790
|
+
let value = obj.row[obj.column.field]
|
|
791
|
+
let fieldWidget = null;
|
|
792
|
+
if(!!obj.column?.params?.widget){
|
|
793
|
+
fieldWidget = this.getRowWidget(obj)
|
|
794
|
+
}
|
|
795
|
+
if(fieldWidget && !fieldWidget.options.hidden){
|
|
796
|
+
let widgetType = fieldWidget.type;
|
|
797
|
+
if(['input','number'].includes(widgetType)){
|
|
798
|
+
return value;
|
|
799
|
+
}
|
|
800
|
+
let widgetRef = this.getWidgetRefByTableParam(obj)
|
|
801
|
+
if('text' === widgetType){
|
|
802
|
+
return widgetRef ? widgetRef.showVaule : value;
|
|
803
|
+
}else if('select' === widgetType){
|
|
804
|
+
return this.getOptionLabel(fieldWidget, value);
|
|
805
|
+
}else if('checkbox' === widgetType){
|
|
806
|
+
return this.getOptionLabel(fieldWidget, value);
|
|
807
|
+
}else if('radio' === widgetType){
|
|
808
|
+
return this.getOptionLabel(fieldWidget, value);
|
|
809
|
+
}else if('status' === widgetType){
|
|
810
|
+
let statusParam = fieldWidget.options.statusParam || [];
|
|
811
|
+
let statusItem = statusParam.find(item => item.value === value)
|
|
812
|
+
return statusItem ? this.$t1(statusItem.label): null;
|
|
813
|
+
}else if('vabsearch' === widgetType){
|
|
814
|
+
let result = null;
|
|
815
|
+
let currentData = obj.row;
|
|
816
|
+
let fieldKeyName = this.getFieldKeyName(fieldWidget);
|
|
817
|
+
let vabSearchName = fieldWidget.options.vabSearchName;
|
|
818
|
+
let multipleChoices = fieldWidget.options.multipleChoices || false;
|
|
819
|
+
let labelField = vabSearchName || fieldKeyName;
|
|
820
|
+
if (!multipleChoices) {
|
|
821
|
+
result = currentData[labelField] ?? null;
|
|
822
|
+
} else {
|
|
823
|
+
if (value) {
|
|
824
|
+
result = value.map(item => item[labelField]).join(",");
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
return result;
|
|
828
|
+
}else if('date' === widgetType){
|
|
829
|
+
let dateType = fieldWidget.options.type;
|
|
830
|
+
if(['date','week'].includes(dateType)){
|
|
831
|
+
return value?value.substring(0,10):null;
|
|
832
|
+
}else if(dateType === 'dates'){
|
|
833
|
+
if(value){
|
|
834
|
+
if(Array.isArray(value)){
|
|
835
|
+
return value.map(item => item.substring(0,10)).join(",");
|
|
836
|
+
}else{
|
|
837
|
+
return value;
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
return null;
|
|
841
|
+
}else{
|
|
842
|
+
return value
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
}else{
|
|
846
|
+
return null
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
};
|
|
850
|
+
col.slots.filterVal = func;
|
|
851
|
+
}
|
|
719
852
|
if (!col.children || !col.children.length) {
|
|
720
|
-
if (t.formatS
|
|
853
|
+
if (t.formatS === "render") {
|
|
721
854
|
let r = t.render ? new Function("params", "h", t.render) : null;
|
|
722
855
|
col.slots.default = (params, h) => {
|
|
723
856
|
return r ? r.call(this, params, h) : "";
|
|
@@ -725,9 +858,9 @@ modules = {
|
|
|
725
858
|
} else if (widget) {
|
|
726
859
|
// col.slots.default = columnSelectedWidget.id;
|
|
727
860
|
col.slots.default = "widget";
|
|
728
|
-
} else if (t.formatS
|
|
861
|
+
} else if (t.formatS === "editTreeButtonGroup") {
|
|
729
862
|
col.slots.default = "editTreeButtonGroup";
|
|
730
|
-
} else if (t.formatS
|
|
863
|
+
} else if (t.formatS === "widgetRender") {
|
|
731
864
|
col.slots.default = "widgetList";
|
|
732
865
|
}
|
|
733
866
|
|
|
@@ -755,12 +888,12 @@ modules = {
|
|
|
755
888
|
let flag = tableConfig?.config?.toolbarConfig?.custom !== false;
|
|
756
889
|
if (
|
|
757
890
|
baseRefUtil.tableConfig &&
|
|
758
|
-
baseRefUtil.tableConfig.className
|
|
891
|
+
baseRefUtil.tableConfig.className === "list-table" &&
|
|
759
892
|
flag
|
|
760
893
|
) {
|
|
761
894
|
if (tableColumns.length) {
|
|
762
895
|
let tableColumn = tableColumns[tableColumns.length - 1];
|
|
763
|
-
if (tableColumn.fixed
|
|
896
|
+
if (tableColumn.fixed !== "right") {
|
|
764
897
|
newColumns.push({
|
|
765
898
|
width: 47,
|
|
766
899
|
title: "",
|
|
@@ -773,8 +906,38 @@ modules = {
|
|
|
773
906
|
this.rowWidgetList = rowWidgetList;
|
|
774
907
|
return this.$baseLodash.cloneDeep(newColumns);
|
|
775
908
|
},
|
|
909
|
+
//begin
|
|
910
|
+
getOptionLabel(fieldWidget, fieldModel){
|
|
911
|
+
if (fieldModel === null) {
|
|
912
|
+
return null
|
|
913
|
+
} else {
|
|
914
|
+
let resultList = []
|
|
915
|
+
let labelField = fieldWidget.options.labelKey || "label";
|
|
916
|
+
let valueField = fieldWidget.options.valueKey || "value";
|
|
917
|
+
fieldWidget.options.optionItems.forEach(oItem => {
|
|
918
|
+
if ((oItem[valueField] === fieldModel) || (this.findInArray(fieldModel, oItem[valueField])) !== -1) {
|
|
919
|
+
resultList.push(this.$t1(oItem[labelField]))
|
|
920
|
+
}
|
|
921
|
+
})
|
|
922
|
+
return resultList.join(",")
|
|
923
|
+
}
|
|
924
|
+
},
|
|
925
|
+
findInArray: function (e, t) {
|
|
926
|
+
if (!Array.isArray(e)) return -1;
|
|
927
|
+
var i = -1;
|
|
928
|
+
return (
|
|
929
|
+
e.forEach(function (e, n) {
|
|
930
|
+
e === t && (i = n);
|
|
931
|
+
}),
|
|
932
|
+
i
|
|
933
|
+
);
|
|
934
|
+
},
|
|
935
|
+
//end
|
|
936
|
+
|
|
937
|
+
|
|
776
938
|
async initTableList() {
|
|
777
939
|
let that = this;
|
|
940
|
+
let tableOption = null;
|
|
778
941
|
let path = null;
|
|
779
942
|
let paramFun = null;
|
|
780
943
|
// let mainDataSetDTO = null;
|
|
@@ -782,7 +945,7 @@ modules = {
|
|
|
782
945
|
let tableRef = this.getTableRef();
|
|
783
946
|
let formDataModel = this.getFormRef().formDataModel;
|
|
784
947
|
let isQueryTable = this.widget.options.isQueryTable || false;
|
|
785
|
-
let isDataPage = this.widget.options.accessReturnType
|
|
948
|
+
let isDataPage = this.widget.options.accessReturnType === "2";
|
|
786
949
|
let reportTemplate = this.getFormRef().reportTemplate;
|
|
787
950
|
let formCode = reportTemplate.formCode;
|
|
788
951
|
let dataId = this.formDataId;
|
|
@@ -953,7 +1116,7 @@ modules = {
|
|
|
953
1116
|
parentField: "f_parent",
|
|
954
1117
|
transform: true,
|
|
955
1118
|
expandAll: true,
|
|
956
|
-
loadMethod({ $table, row }) {
|
|
1119
|
+
loadMethod:({ $table, row })=> {
|
|
957
1120
|
// 模拟后台接口
|
|
958
1121
|
let $grid = that.getGridTable();
|
|
959
1122
|
let parentField = $grid.treeConfig.parentField;
|
|
@@ -981,10 +1144,20 @@ modules = {
|
|
|
981
1144
|
},
|
|
982
1145
|
},
|
|
983
1146
|
callback: (res) => {
|
|
984
|
-
if (res.type
|
|
1147
|
+
if (res.type === "success") {
|
|
1148
|
+
let items = this.handleTreeData((res.objx?.records || res.objx || []));
|
|
1149
|
+
if(res.objx?.records !== undefined){
|
|
1150
|
+
res.objx.records = items;
|
|
1151
|
+
}else{
|
|
1152
|
+
res.objx = items;
|
|
1153
|
+
}
|
|
985
1154
|
let rows = res.objx
|
|
986
|
-
|
|
987
|
-
|
|
1155
|
+
? res.objx.records || res.objx || []
|
|
1156
|
+
: [];
|
|
1157
|
+
// let rows = res.objx
|
|
1158
|
+
// ? res.objx.records || res.objx || []
|
|
1159
|
+
// : [];
|
|
1160
|
+
// that.handleNullValue(rows);
|
|
988
1161
|
that.initExportFieldSchemaData(rows);
|
|
989
1162
|
/* rows.forEach((row, index) => {
|
|
990
1163
|
if (!row._X_ROW_KEY) {
|
|
@@ -998,14 +1171,21 @@ modules = {
|
|
|
998
1171
|
}
|
|
999
1172
|
|
|
1000
1173
|
resolve(rows);
|
|
1001
|
-
let treeCallback = tableConfig?.treeCallback;
|
|
1174
|
+
/* let treeCallback = tableConfig?.treeCallback;
|
|
1002
1175
|
if (treeCallback) {
|
|
1003
1176
|
that.$nextTick(() => {
|
|
1004
1177
|
setTimeout(function () {
|
|
1005
1178
|
treeCallback(rows);
|
|
1006
1179
|
}, 0);
|
|
1007
1180
|
});
|
|
1008
|
-
}
|
|
1181
|
+
} */
|
|
1182
|
+
that.$nextTick(() => {
|
|
1183
|
+
setTimeout(function () {
|
|
1184
|
+
dataTableConfig.callback && dataTableConfig.callback(rows);
|
|
1185
|
+
tableOption.callback && tableOption.callback(rows);
|
|
1186
|
+
tableConfig.treeCallback && tableConfig.treeCallback(rows);
|
|
1187
|
+
}, 0);
|
|
1188
|
+
});
|
|
1009
1189
|
} else {
|
|
1010
1190
|
reject(res);
|
|
1011
1191
|
}
|
|
@@ -1017,6 +1197,18 @@ modules = {
|
|
|
1017
1197
|
}
|
|
1018
1198
|
let editOpts = {};
|
|
1019
1199
|
if (this.widget.options.isEditTable) {
|
|
1200
|
+
// let editRules = {};
|
|
1201
|
+
this.loodHandleColumns(this.widget.options.tableColumns, (item) => {
|
|
1202
|
+
if (!item.children?.length) {
|
|
1203
|
+
let editWidget = item.editWidget;
|
|
1204
|
+
if(editWidget && editWidget.options.required){
|
|
1205
|
+
let formField = this.getFieldKeyName(editWidget);
|
|
1206
|
+
/* editRules[formField] = [
|
|
1207
|
+
{ required: true, message: `[${editWidget.options.label}]不能为空` }
|
|
1208
|
+
]; */
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
});
|
|
1020
1212
|
editOpts = {
|
|
1021
1213
|
keepSource: true,
|
|
1022
1214
|
editConfig: {
|
|
@@ -1025,6 +1217,7 @@ modules = {
|
|
|
1025
1217
|
showStatus: true,
|
|
1026
1218
|
autoClear: false,
|
|
1027
1219
|
},
|
|
1220
|
+
// editRules
|
|
1028
1221
|
};
|
|
1029
1222
|
}
|
|
1030
1223
|
let showFooter = this.widget.options.showGridFooter || false;
|
|
@@ -1104,7 +1297,7 @@ modules = {
|
|
|
1104
1297
|
(item) => {
|
|
1105
1298
|
let columnSlots = null;
|
|
1106
1299
|
let columnParams = {};
|
|
1107
|
-
if (item.formatS
|
|
1300
|
+
if (item.formatS === "render") {
|
|
1108
1301
|
let r = item.render
|
|
1109
1302
|
? new Function("params", "h", item.render)
|
|
1110
1303
|
: null;
|
|
@@ -1150,7 +1343,7 @@ modules = {
|
|
|
1150
1343
|
rowConfig.height = this.widget.options.tableRowHeight
|
|
1151
1344
|
}
|
|
1152
1345
|
|
|
1153
|
-
|
|
1346
|
+
tableOption = {
|
|
1154
1347
|
// vue: this,
|
|
1155
1348
|
tableRef: tableRef,
|
|
1156
1349
|
tableName: this.getGridTableName(),
|
|
@@ -1226,7 +1419,7 @@ modules = {
|
|
|
1226
1419
|
query: ({ page, sorts, filters, form, param, customParam }) => {
|
|
1227
1420
|
let scriptCode = this.getScriptCode();
|
|
1228
1421
|
let $grid = this.getGridTable();
|
|
1229
|
-
let originOption = $grid.originOption;
|
|
1422
|
+
let originOption = $grid.params.originOption;
|
|
1230
1423
|
let formData = {};
|
|
1231
1424
|
|
|
1232
1425
|
if (customParam?.exportParam?.type !== "exportItem") {
|
|
@@ -1271,8 +1464,8 @@ modules = {
|
|
|
1271
1464
|
Object.assign(queryParams, that.dataTableConfig.queryParam);
|
|
1272
1465
|
}
|
|
1273
1466
|
|
|
1274
|
-
|
|
1275
|
-
let accessReturnType = this.widget.options.accessReturnType || 2;
|
|
1467
|
+
let reqPath = typeof path === "function" ? path() : path;
|
|
1468
|
+
let accessReturnType = this.widget.options.accessReturnType || "2";
|
|
1276
1469
|
|
|
1277
1470
|
return new Promise((resolve, reject) => {
|
|
1278
1471
|
let reqData = {
|
|
@@ -1284,9 +1477,17 @@ modules = {
|
|
|
1284
1477
|
// let f = new Function("dataId", "formCode", "param", "done", accessScript);
|
|
1285
1478
|
let done = (res) => {
|
|
1286
1479
|
// this.clearRowWidgets();
|
|
1287
|
-
|
|
1480
|
+
|
|
1481
|
+
let items = this.handleTreeData((res.objx?.records || res.objx || []));
|
|
1482
|
+
if(res.objx?.records !== undefined){
|
|
1483
|
+
res.objx.records = items;
|
|
1484
|
+
}else{
|
|
1485
|
+
res.objx = items;
|
|
1486
|
+
}
|
|
1487
|
+
let rows = res.objx
|
|
1288
1488
|
? res.objx.records || res.objx || []
|
|
1289
1489
|
: [];
|
|
1490
|
+
// that.handleNullValue(rows);
|
|
1290
1491
|
if (customParam?.export) {
|
|
1291
1492
|
//导出
|
|
1292
1493
|
this.initExportFieldSchemaData(rows);
|
|
@@ -1295,7 +1496,7 @@ modules = {
|
|
|
1295
1496
|
}
|
|
1296
1497
|
|
|
1297
1498
|
resolve(res);
|
|
1298
|
-
if (res.type
|
|
1499
|
+
if (res.type === "success") {
|
|
1299
1500
|
if (that.widget.options.isTreeTable) {
|
|
1300
1501
|
if (rows.length > 0) {
|
|
1301
1502
|
let fullAllDataRowMap
|
|
@@ -1351,6 +1552,7 @@ modules = {
|
|
|
1351
1552
|
}
|
|
1352
1553
|
that.$nextTick(() => {
|
|
1353
1554
|
setTimeout(function () {
|
|
1555
|
+
dataTableConfig.callback && dataTableConfig.callback(rows);
|
|
1354
1556
|
tableOption.callback && tableOption.callback(rows);
|
|
1355
1557
|
that.handleCustomEvent(
|
|
1356
1558
|
that.widget.options.formScriptCallback,
|
|
@@ -1419,13 +1621,13 @@ modules = {
|
|
|
1419
1621
|
let columnId = column.params?.columnId;
|
|
1420
1622
|
if (columnId && footerColumnIds.includes(columnId)) {
|
|
1421
1623
|
let footerDataType = column.params.footerDataType;
|
|
1422
|
-
if (footerDataType
|
|
1624
|
+
if (footerDataType === "1") {
|
|
1423
1625
|
//求和
|
|
1424
1626
|
return this.sumNum(data, column.field);
|
|
1425
|
-
} else if (footerDataType
|
|
1627
|
+
} else if (footerDataType === "2") {
|
|
1426
1628
|
//求平均值
|
|
1427
1629
|
return this.meanNum(data, column.field);
|
|
1428
|
-
} else if (footerDataType
|
|
1630
|
+
} else if (footerDataType === "3") {
|
|
1429
1631
|
if (column.params.footerMethodConfg) {
|
|
1430
1632
|
let n = new Function(
|
|
1431
1633
|
"dataId",
|
|
@@ -1451,7 +1653,6 @@ modules = {
|
|
|
1451
1653
|
if (mergeRowEnabled && unikey) {
|
|
1452
1654
|
tableOption.config.spanMethod = this.mergeRowMethod;
|
|
1453
1655
|
}
|
|
1454
|
-
|
|
1455
1656
|
this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
|
|
1456
1657
|
this.vxeOption = opts;
|
|
1457
1658
|
if (!isQueryTable) {
|
|
@@ -1510,12 +1711,12 @@ modules = {
|
|
|
1510
1711
|
item.filter = "between";
|
|
1511
1712
|
} else if (
|
|
1512
1713
|
["input-batch", "checkbox"].includes(wType)
|
|
1513
|
-
|| (wType
|
|
1714
|
+
|| (wType === "select" && wItem.options.multiple)
|
|
1514
1715
|
) {
|
|
1515
1716
|
item.filter = "in";
|
|
1516
1717
|
} else if (
|
|
1517
1718
|
["radio", "time", "date"].includes(wType)
|
|
1518
|
-
|| (wType
|
|
1719
|
+
|| (wType === "select" && !wItem.options.multiple)
|
|
1519
1720
|
) {
|
|
1520
1721
|
item.filter = "eq";
|
|
1521
1722
|
} else {
|
|
@@ -1542,14 +1743,14 @@ modules = {
|
|
|
1542
1743
|
);
|
|
1543
1744
|
let result = vailColumns
|
|
1544
1745
|
.filter((item) => {
|
|
1545
|
-
return item.formatS
|
|
1746
|
+
return item.formatS === "editAttachment";
|
|
1546
1747
|
})
|
|
1547
1748
|
.map((item) => item.prop); */
|
|
1548
1749
|
|
|
1549
1750
|
let result = [];
|
|
1550
1751
|
this.loodHandleColumns(this.widget.options.tableColumns, (item) => {
|
|
1551
1752
|
if (!item.children?.length && item.prop && item.label) {
|
|
1552
|
-
if (item.formatS
|
|
1753
|
+
if (item.formatS === "editAttachment") {
|
|
1553
1754
|
result.push(item.prop);
|
|
1554
1755
|
}
|
|
1555
1756
|
}
|
|
@@ -1563,7 +1764,7 @@ modules = {
|
|
|
1563
1764
|
let result = vailColumns
|
|
1564
1765
|
.filter((item) => {
|
|
1565
1766
|
return (
|
|
1566
|
-
item.formatS
|
|
1767
|
+
item.formatS === "editSearch" && item.columnOption.multipleChoices
|
|
1567
1768
|
);
|
|
1568
1769
|
})
|
|
1569
1770
|
.map((item) => item.prop); */
|
|
@@ -1571,7 +1772,7 @@ modules = {
|
|
|
1571
1772
|
this.loodHandleColumns(this.widget.options.tableColumns, (item) => {
|
|
1572
1773
|
if (!item.children?.length && item.prop && item.label) {
|
|
1573
1774
|
if (
|
|
1574
|
-
item.formatS
|
|
1775
|
+
item.formatS === "editSearch"
|
|
1575
1776
|
&& item.widget?.options?.multipleChoices
|
|
1576
1777
|
) {
|
|
1577
1778
|
result.push(item.prop);
|
|
@@ -1611,7 +1812,20 @@ modules = {
|
|
|
1611
1812
|
},
|
|
1612
1813
|
callback: (res) => {
|
|
1613
1814
|
let $grid = this.getGridTable();
|
|
1614
|
-
let rows = res.objx ? res.objx.records || res.objx || [] : [];
|
|
1815
|
+
// let rows = res.objx ? res.objx.records || res.objx || [] : [];
|
|
1816
|
+
|
|
1817
|
+
let items = this.handleTreeData((res.objx?.records || res.objx || []));
|
|
1818
|
+
if(res.objx?.records !== undefined){
|
|
1819
|
+
res.objx.records = items;
|
|
1820
|
+
}else{
|
|
1821
|
+
res.objx = items;
|
|
1822
|
+
}
|
|
1823
|
+
let rows = res.objx
|
|
1824
|
+
? res.objx.records || res.objx || []
|
|
1825
|
+
: [];
|
|
1826
|
+
|
|
1827
|
+
|
|
1828
|
+
// that.handleNullValue(rows);
|
|
1615
1829
|
let defaultRow = this.createNewTableData();
|
|
1616
1830
|
rows = rows.map((row) => {
|
|
1617
1831
|
return {
|
|
@@ -1644,9 +1858,9 @@ modules = {
|
|
|
1644
1858
|
getScriptCode() {
|
|
1645
1859
|
let accessReturnType = this.widget.options.accessReturnType;
|
|
1646
1860
|
let defaultScriptCode = "getList";
|
|
1647
|
-
if (accessReturnType
|
|
1861
|
+
if (accessReturnType === "1") {
|
|
1648
1862
|
defaultScriptCode = "getList";
|
|
1649
|
-
} else if (accessReturnType
|
|
1863
|
+
} else if (accessReturnType === "2") {
|
|
1650
1864
|
defaultScriptCode = "getPage";
|
|
1651
1865
|
}
|
|
1652
1866
|
let scriptCode = this.widget.options.formScriptCode || defaultScriptCode;
|
|
@@ -1661,9 +1875,9 @@ modules = {
|
|
|
1661
1875
|
let scriptCode = this.getScriptCode();
|
|
1662
1876
|
let accessParam = {};
|
|
1663
1877
|
let otherParam = {};
|
|
1664
|
-
if (customParam?.exportParam?.type
|
|
1878
|
+
if (customParam?.exportParam?.type === "exportItem") {
|
|
1665
1879
|
let $grid = this.getGridTable();
|
|
1666
|
-
let originOption = $grid.originOption;
|
|
1880
|
+
let originOption = $grid.params.originOption;
|
|
1667
1881
|
let exportItemConfig = originOption.exportItemConfig || {};
|
|
1668
1882
|
if (exportItemConfig.scriptCode) {
|
|
1669
1883
|
scriptCode = exportItemConfig.scriptCode;
|
|
@@ -1801,7 +2015,7 @@ modules = {
|
|
|
1801
2015
|
|| (widgetType === "vabsearch" && !widget.options.multipleChoices);
|
|
1802
2016
|
return result;
|
|
1803
2017
|
},
|
|
1804
|
-
getColumnNullValue(widget) {
|
|
2018
|
+
getColumnNullValue(widget, defaultValueEnabled) {
|
|
1805
2019
|
if (!widget) return null;
|
|
1806
2020
|
let nullValue = null;
|
|
1807
2021
|
let widgetType = widget.type;
|
|
@@ -1818,11 +2032,12 @@ modules = {
|
|
|
1818
2032
|
defaultValue !== undefined
|
|
1819
2033
|
&& defaultValue !== null
|
|
1820
2034
|
&& defaultValue !== ""
|
|
2035
|
+
&& defaultValueEnabled !== false
|
|
1821
2036
|
) {
|
|
1822
2037
|
nullValue = defaultValue;
|
|
1823
2038
|
} else if (widgetType === "select" && widget.options.multiple) {
|
|
1824
2039
|
nullValue = [];
|
|
1825
|
-
} else if (widgetType === "date" && widget.options.type
|
|
2040
|
+
} else if (widgetType === "date" && widget.options.type === "dates") {
|
|
1826
2041
|
nullValue = [];
|
|
1827
2042
|
} else if (widgetType === "vabsearch" && widget.options.multipleChoices) {
|
|
1828
2043
|
nullValue = [];
|
|
@@ -1853,7 +2068,7 @@ modules = {
|
|
|
1853
2068
|
}
|
|
1854
2069
|
}
|
|
1855
2070
|
},
|
|
1856
|
-
createNewTableData(isEdit) {
|
|
2071
|
+
createNewTableData(isEdit, defaultValueEnabled=true) {
|
|
1857
2072
|
let newData = {};
|
|
1858
2073
|
this.loodHandleColumns(this.widget.options.tableColumns, (item) => {
|
|
1859
2074
|
if (!item.children?.length && item.prop && item.label) {
|
|
@@ -1864,46 +2079,21 @@ modules = {
|
|
|
1864
2079
|
} else {
|
|
1865
2080
|
widget = item.widget;
|
|
1866
2081
|
}
|
|
1867
|
-
if (formatS
|
|
2082
|
+
if (formatS === "widgetRender") {
|
|
1868
2083
|
if (item.widgetList) {
|
|
1869
2084
|
loopHandleWidget(item.widgetList, (w, p) => {
|
|
1870
|
-
this.handleWidgetNullValue(w, newData);
|
|
2085
|
+
this.handleWidgetNullValue(w, newData, defaultValueEnabled);
|
|
1871
2086
|
});
|
|
1872
2087
|
}
|
|
1873
2088
|
} else {
|
|
1874
2089
|
if (widget) {
|
|
1875
|
-
this.handleWidgetNullValue(widget, newData);
|
|
2090
|
+
this.handleWidgetNullValue(widget, newData, defaultValueEnabled);
|
|
1876
2091
|
} else {
|
|
1877
2092
|
newData[item.prop] = null;
|
|
1878
2093
|
}
|
|
1879
2094
|
}
|
|
1880
2095
|
}
|
|
1881
2096
|
});
|
|
1882
|
-
/* let vailColumns = this.widget.options.tableColumns.filter(
|
|
1883
|
-
(item) => item.prop && item.label
|
|
1884
|
-
);
|
|
1885
|
-
vailColumns.forEach((item) => {
|
|
1886
|
-
let formatS = !isEdit ? item.formatS : item.editFormatS;
|
|
1887
|
-
let columnOption = !isEdit ? item.columnOption : item.editColumnOption;
|
|
1888
|
-
if (formatS == "editSearch") {
|
|
1889
|
-
newData[item.prop] = null;
|
|
1890
|
-
let vabSearchName = item?.columnOption?.vabSearchName;
|
|
1891
|
-
if (vabSearchName) newData[vabSearchName] = null;
|
|
1892
|
-
}
|
|
1893
|
-
if (formatS == "editAttachment") {
|
|
1894
|
-
newData[item.prop] = [];
|
|
1895
|
-
} else {
|
|
1896
|
-
newData[item.prop] = null;
|
|
1897
|
-
if (
|
|
1898
|
-
columnOption &&
|
|
1899
|
-
columnOption.defaultValue !== undefined &&
|
|
1900
|
-
columnOption.defaultValue !== null &&
|
|
1901
|
-
columnOption.defaultValue !== ""
|
|
1902
|
-
) {
|
|
1903
|
-
newData[item.prop] = columnOption.defaultValue;
|
|
1904
|
-
}
|
|
1905
|
-
}
|
|
1906
|
-
}); */
|
|
1907
2097
|
return newData;
|
|
1908
2098
|
},
|
|
1909
2099
|
addTableData(rows, field) {
|
|
@@ -1979,55 +2169,55 @@ modules = {
|
|
|
1979
2169
|
if (columnOption && Object.keys(columnOption).length) {
|
|
1980
2170
|
columnOption.required = row.required || false;
|
|
1981
2171
|
columnSelectedWidget.options = columnOption;
|
|
1982
|
-
if ("editDelete"
|
|
2172
|
+
if ("editDelete" === formatS) {
|
|
1983
2173
|
columnSelectedWidget.options.hiddenByWf
|
|
1984
2174
|
= columnSelectedWidget.options.hiddenByWf ?? true;
|
|
1985
2175
|
columnSelectedWidget.options.prefixIcon
|
|
1986
2176
|
= columnSelectedWidget.options.prefixIcon || "el-icon-delete";
|
|
1987
|
-
} else if ("editButton"
|
|
2177
|
+
} else if ("editButton" === formatS) {
|
|
1988
2178
|
columnSelectedWidget.options.prefixIcon
|
|
1989
2179
|
= columnSelectedWidget.options.prefixIcon || "el-icon-edit";
|
|
1990
2180
|
}
|
|
1991
2181
|
} else {
|
|
1992
2182
|
columnSelectedWidget.options.required = row.required || false;
|
|
1993
|
-
if ("editDelete"
|
|
2183
|
+
if ("editDelete" === formatS) {
|
|
1994
2184
|
columnSelectedWidget.options.prefixIcon = "el-icon-delete";
|
|
1995
2185
|
columnSelectedWidget.options.label = "删除";
|
|
1996
2186
|
columnSelectedWidget.options.labelHidden = true;
|
|
1997
2187
|
columnSelectedWidget.options.hiddenByWf = true;
|
|
1998
2188
|
columnSelectedWidget.options.onClick
|
|
1999
2189
|
= "let tableParam = this.tableParam;\nlet tableRef = this.getWidgetRef(this.parentWidget.options.name);\ntableRef.deleteRow(tableParam.row,tableParam.rowIndex);";
|
|
2000
|
-
} else if ("editButton"
|
|
2190
|
+
} else if ("editButton" === formatS) {
|
|
2001
2191
|
columnSelectedWidget.options.prefixIcon = "el-icon-edit";
|
|
2002
2192
|
columnSelectedWidget.options.label = "查看";
|
|
2003
2193
|
columnSelectedWidget.options.labelHidden = true;
|
|
2004
2194
|
columnSelectedWidget.options.onClick
|
|
2005
2195
|
= "let tableParam = this.tableParam;\nlet tableRef = this.getWidgetRef(this.parentWidget.options.name);\ntableRef.openEditDialog(tableParam.row)";
|
|
2006
|
-
} else if ("addSiblingEditRow"
|
|
2196
|
+
} else if ("addSiblingEditRow" === formatS) {
|
|
2007
2197
|
columnSelectedWidget.options.prefixIcon = "el-icon-plus";
|
|
2008
2198
|
columnSelectedWidget.options.label = "新增兄弟节点";
|
|
2009
2199
|
columnSelectedWidget.options.labelHidden = false;
|
|
2010
2200
|
columnSelectedWidget.options.onClick
|
|
2011
2201
|
= "let tableParam = this.tableParam;\nthis.getParentTarget().addSiblingTreeRow(null,tableParam);";
|
|
2012
|
-
} else if ("addChildTreeRow"
|
|
2202
|
+
} else if ("addChildTreeRow" === formatS) {
|
|
2013
2203
|
columnSelectedWidget.options.prefixIcon = "el-icon-plus";
|
|
2014
2204
|
columnSelectedWidget.options.label = "新增子节点";
|
|
2015
2205
|
columnSelectedWidget.options.labelHidden = false;
|
|
2016
2206
|
columnSelectedWidget.options.onClick
|
|
2017
2207
|
= "let tableParam = this.tableParam;\nthis.getParentTarget().addChildTreeRow(null,tableParam);";
|
|
2018
|
-
} else if ("moveUpRow"
|
|
2208
|
+
} else if ("moveUpRow" === formatS) {
|
|
2019
2209
|
// columnSelectedWidget.options.prefixIcon = "el-icon-plus";
|
|
2020
2210
|
columnSelectedWidget.options.label = "↑上移";
|
|
2021
2211
|
columnSelectedWidget.options.labelHidden = false;
|
|
2022
2212
|
columnSelectedWidget.options.onClick
|
|
2023
2213
|
= "let tableParam = this.tableParam;\nthis.getParentTarget().moveUpRow(tableParam);";
|
|
2024
|
-
} else if ("moveDownRow"
|
|
2214
|
+
} else if ("moveDownRow" === formatS) {
|
|
2025
2215
|
// columnSelectedWidget.options.prefixIcon = "el-icon-plus";
|
|
2026
2216
|
columnSelectedWidget.options.label = "↓下移";
|
|
2027
2217
|
columnSelectedWidget.options.labelHidden = false;
|
|
2028
2218
|
columnSelectedWidget.options.onClick
|
|
2029
2219
|
= "let tableParam = this.tableParam;\nthis.getParentTarget().moveDownRow(tableParam);";
|
|
2030
|
-
} else if ("removeTreeRow"
|
|
2220
|
+
} else if ("removeTreeRow" === formatS) {
|
|
2031
2221
|
columnSelectedWidget.options.prefixIcon = "el-icon-delete";
|
|
2032
2222
|
columnSelectedWidget.options.label = "删除";
|
|
2033
2223
|
columnSelectedWidget.options.labelHidden = true;
|
|
@@ -2042,7 +2232,7 @@ modules = {
|
|
|
2042
2232
|
} else {
|
|
2043
2233
|
columnSelectedWidget.options.name = row.prop;
|
|
2044
2234
|
}
|
|
2045
|
-
if (type
|
|
2235
|
+
if (type !== "button" && type !== "a-link") {
|
|
2046
2236
|
columnSelectedWidget.options.label = row.label;
|
|
2047
2237
|
columnSelectedWidget.options.labelHidden = true;
|
|
2048
2238
|
}
|
|
@@ -2070,7 +2260,7 @@ modules = {
|
|
|
2070
2260
|
validateCheckRow() {
|
|
2071
2261
|
let $grid = this.getGridTable();
|
|
2072
2262
|
let checkRows = $grid.getCheckboxRecords(true);
|
|
2073
|
-
if (checkRows.length
|
|
2263
|
+
if (checkRows.length === 0) {
|
|
2074
2264
|
this.$message({
|
|
2075
2265
|
message: "请选择要操作的行",
|
|
2076
2266
|
type: "warning",
|
|
@@ -2142,6 +2332,14 @@ modules = {
|
|
|
2142
2332
|
let fieldKeyName = this.getFieldKeyName(this.widget);
|
|
2143
2333
|
let rowIndex = Math.max(obj.rowIndex, 0);
|
|
2144
2334
|
|
|
2335
|
+
let isTreeTable = this.widget.options.isTreeTable || false;
|
|
2336
|
+
if(isTreeTable){
|
|
2337
|
+
rowIndex = this.getValue().findIndex((item) => item._X_ROW_KEY === obj.row._X_ROW_KEY);
|
|
2338
|
+
if(rowIndex<0){
|
|
2339
|
+
return "false";
|
|
2340
|
+
}
|
|
2341
|
+
}
|
|
2342
|
+
|
|
2145
2343
|
let property = this.getFieldKeyName(fieldWidget);
|
|
2146
2344
|
if (obj.row[property] && Array.isArray(obj.row[property])) {
|
|
2147
2345
|
return "false";
|
|
@@ -2159,12 +2357,12 @@ modules = {
|
|
|
2159
2357
|
isVabsearchFlagWidget(widget) {
|
|
2160
2358
|
let type = widget?.type;
|
|
2161
2359
|
return (
|
|
2162
|
-
type
|
|
2360
|
+
type === "vabsearch" || type === "singerSearch" || type === "multiSearch"
|
|
2163
2361
|
);
|
|
2164
2362
|
},
|
|
2165
2363
|
getColumnWidgetName(e) {
|
|
2166
2364
|
if (e && e.type) {
|
|
2167
|
-
if (e.category
|
|
2365
|
+
if (e.category === "container") {
|
|
2168
2366
|
return this.getContainerWidgetName(e);
|
|
2169
2367
|
} else {
|
|
2170
2368
|
return e.type + "-widget";
|
|
@@ -2223,7 +2421,7 @@ modules = {
|
|
|
2223
2421
|
},
|
|
2224
2422
|
advancedClear() {
|
|
2225
2423
|
let formModel = this.formModel;
|
|
2226
|
-
let searchColumns = this.getGridTable().searchColumns;
|
|
2424
|
+
let searchColumns = this.getGridTable().params.searchColumns;
|
|
2227
2425
|
searchColumns.forEach((form1Field) => {
|
|
2228
2426
|
if (!form1Field.common) {
|
|
2229
2427
|
let field = form1Field.field;
|
|
@@ -2241,7 +2439,7 @@ modules = {
|
|
|
2241
2439
|
},
|
|
2242
2440
|
|
|
2243
2441
|
//editTable begin
|
|
2244
|
-
saveEditRow(obj) {
|
|
2442
|
+
async saveEditRow(obj) {
|
|
2245
2443
|
let formRef = this.getFormRef();
|
|
2246
2444
|
let formConfig = this.formConfig;
|
|
2247
2445
|
let entity = formConfig.entity;
|
|
@@ -2253,11 +2451,18 @@ modules = {
|
|
|
2253
2451
|
|
|
2254
2452
|
let that = this;
|
|
2255
2453
|
let $grid = obj.$table.$xegrid;
|
|
2256
|
-
let originOption = $grid.originOption;
|
|
2454
|
+
let originOption = $grid.params.originOption;
|
|
2257
2455
|
|
|
2258
2456
|
let formModel = this.formModel;
|
|
2259
2457
|
let dataMap = this.getGridTable().getTableData();
|
|
2260
2458
|
|
|
2459
|
+
/* const errMap = await $grid.validate(obj.row).catch(errMap => errMap)
|
|
2460
|
+
if (errMap) {
|
|
2461
|
+
let title = errMap[Object.keys(errMap)[0]][0].column.title
|
|
2462
|
+
this.$message.error(`[${title}]不能为空`)
|
|
2463
|
+
return
|
|
2464
|
+
} */
|
|
2465
|
+
|
|
2261
2466
|
formRef.validate((valid) => {
|
|
2262
2467
|
if (valid) {
|
|
2263
2468
|
$grid.clearActived().then(() => {
|
|
@@ -2296,7 +2501,7 @@ modules = {
|
|
|
2296
2501
|
confirmText: "您确定要保存吗?",
|
|
2297
2502
|
success: (res0) => {
|
|
2298
2503
|
this.getRowData(res0.objx, (res) => {
|
|
2299
|
-
if (obj.row.id
|
|
2504
|
+
if (obj.row.id === res.objx.id) {
|
|
2300
2505
|
$grid.clearActived().then(() => {
|
|
2301
2506
|
Object.assign(obj.row, res.objx);
|
|
2302
2507
|
});
|
|
@@ -2360,10 +2565,10 @@ modules = {
|
|
|
2360
2565
|
}
|
|
2361
2566
|
let parentField = $grid.treeConfig.parentField;
|
|
2362
2567
|
let newRow = {};
|
|
2363
|
-
let originOption = $grid.originOption;
|
|
2568
|
+
let originOption = $grid.params.originOption;
|
|
2364
2569
|
let editDefaultRow;
|
|
2365
2570
|
if (originOption.editDefaultRow) {
|
|
2366
|
-
if (typeof originOption.editDefaultRow
|
|
2571
|
+
if (typeof originOption.editDefaultRow === "function") {
|
|
2367
2572
|
editDefaultRow = originOption.editDefaultRow() || {};
|
|
2368
2573
|
} else {
|
|
2369
2574
|
editDefaultRow = originOption.editDefaultRow || {};
|
|
@@ -2389,7 +2594,7 @@ modules = {
|
|
|
2389
2594
|
} else if (toSibling === true) {
|
|
2390
2595
|
let addIndex
|
|
2391
2596
|
= tableRows.findIndex(
|
|
2392
|
-
(item) => item._X_ROW_KEY
|
|
2597
|
+
(item) => item._X_ROW_KEY === obj.row._X_ROW_KEY
|
|
2393
2598
|
) + 1;
|
|
2394
2599
|
tableRows.splice(addIndex, 0, newRow);
|
|
2395
2600
|
} else {
|
|
@@ -2411,7 +2616,7 @@ modules = {
|
|
|
2411
2616
|
} else if (toSibling === true) {
|
|
2412
2617
|
let addIndex
|
|
2413
2618
|
= tableRows.findIndex(
|
|
2414
|
-
(item) => item._X_ROW_KEY
|
|
2619
|
+
(item) => item._X_ROW_KEY === obj.row._X_ROW_KEY
|
|
2415
2620
|
) + 1;
|
|
2416
2621
|
tableRows.splice(addIndex, 0, newRow);
|
|
2417
2622
|
} else {
|
|
@@ -2483,10 +2688,10 @@ modules = {
|
|
|
2483
2688
|
}
|
|
2484
2689
|
|
|
2485
2690
|
let newRow = {};
|
|
2486
|
-
let originOption = $grid.originOption;
|
|
2691
|
+
let originOption = $grid.params.originOption;
|
|
2487
2692
|
let editDefaultRow;
|
|
2488
2693
|
if (originOption.editDefaultRow) {
|
|
2489
|
-
if (typeof originOption.editDefaultRow
|
|
2694
|
+
if (typeof originOption.editDefaultRow === "function") {
|
|
2490
2695
|
editDefaultRow = originOption.editDefaultRow() || {};
|
|
2491
2696
|
} else {
|
|
2492
2697
|
editDefaultRow = originOption.editDefaultRow || {};
|
|
@@ -2515,7 +2720,7 @@ modules = {
|
|
|
2515
2720
|
} else if (toSibling === true) {
|
|
2516
2721
|
let addIndex
|
|
2517
2722
|
= tableRows.findIndex(
|
|
2518
|
-
(item) => item._X_ROW_KEY
|
|
2723
|
+
(item) => item._X_ROW_KEY === obj.row._X_ROW_KEY
|
|
2519
2724
|
) + 1;
|
|
2520
2725
|
tableRows.splice(addIndex, 0, newRow);
|
|
2521
2726
|
} else {
|
|
@@ -2537,7 +2742,7 @@ modules = {
|
|
|
2537
2742
|
} else if (toSibling === true) {
|
|
2538
2743
|
let addIndex
|
|
2539
2744
|
= tableRows.findIndex(
|
|
2540
|
-
(item) => item._X_ROW_KEY
|
|
2745
|
+
(item) => item._X_ROW_KEY === obj.row._X_ROW_KEY
|
|
2541
2746
|
) + 1;
|
|
2542
2747
|
tableRows.splice(addIndex, 0, newRow);
|
|
2543
2748
|
} else {
|
|
@@ -2607,15 +2812,15 @@ modules = {
|
|
|
2607
2812
|
);
|
|
2608
2813
|
if (siblingRows.length > 1) {
|
|
2609
2814
|
let currentIndex = tableRows.findIndex(
|
|
2610
|
-
(item) => item[rowField]
|
|
2815
|
+
(item) => item[rowField] === row[rowField]
|
|
2611
2816
|
);
|
|
2612
2817
|
let index1 = siblingRows.findIndex(
|
|
2613
|
-
(item) => item[rowField]
|
|
2818
|
+
(item) => item[rowField] === row[rowField]
|
|
2614
2819
|
);
|
|
2615
2820
|
if (index1 > 0) {
|
|
2616
2821
|
let prevRow = siblingRows[index1 - 1];
|
|
2617
2822
|
let prevIndex = tableRows.findIndex(
|
|
2618
|
-
(item) => item[rowField]
|
|
2823
|
+
(item) => item[rowField] === prevRow[rowField]
|
|
2619
2824
|
);
|
|
2620
2825
|
tableRows.splice(currentIndex, 1);
|
|
2621
2826
|
tableRows.splice(prevIndex, 0, row);
|
|
@@ -2651,15 +2856,15 @@ modules = {
|
|
|
2651
2856
|
);
|
|
2652
2857
|
if (siblingRows.length > 1) {
|
|
2653
2858
|
let currentIndex = tableRows.findIndex(
|
|
2654
|
-
(item) => item[rowField]
|
|
2859
|
+
(item) => item[rowField] === row[rowField]
|
|
2655
2860
|
);
|
|
2656
2861
|
let index1 = siblingRows.findIndex(
|
|
2657
|
-
(item) => item[rowField]
|
|
2862
|
+
(item) => item[rowField] === row[rowField]
|
|
2658
2863
|
);
|
|
2659
2864
|
if (index1 < siblingRows.length - 1) {
|
|
2660
2865
|
let nextRow = siblingRows[index1 + 1];
|
|
2661
2866
|
let nextIndex = tableRows.findIndex(
|
|
2662
|
-
(item) => item[rowField]
|
|
2867
|
+
(item) => item[rowField] === nextRow[rowField]
|
|
2663
2868
|
);
|
|
2664
2869
|
tableRows.splice(currentIndex, 1);
|
|
2665
2870
|
tableRows.splice(nextIndex, 0, row);
|
|
@@ -3068,6 +3273,19 @@ modules = {
|
|
|
3068
3273
|
this.setGridDisabled(false);
|
|
3069
3274
|
},
|
|
3070
3275
|
//xk end
|
|
3276
|
+
handleNullValue(rows) {
|
|
3277
|
+
let newData = this.createNewTableData(true, false);
|
|
3278
|
+
let keys = Object.keys(newData);
|
|
3279
|
+
if(keys.length){
|
|
3280
|
+
rows.forEach((row) => {
|
|
3281
|
+
keys.forEach((key) => {
|
|
3282
|
+
if (row[key] === undefined) {
|
|
3283
|
+
row[key] = newData[key];
|
|
3284
|
+
}
|
|
3285
|
+
});
|
|
3286
|
+
});
|
|
3287
|
+
}
|
|
3288
|
+
},
|
|
3071
3289
|
},
|
|
3072
3290
|
};
|
|
3073
3291
|
|