bri-components 1.4.27 → 1.4.29
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
CHANGED
|
@@ -376,13 +376,13 @@
|
|
|
376
376
|
];
|
|
377
377
|
},
|
|
378
378
|
allDepartShowKeys () {
|
|
379
|
-
const loop = (
|
|
380
|
-
return
|
|
379
|
+
const loop = (arr = []) => {
|
|
380
|
+
return arr.reduce((totalList, item) => {
|
|
381
381
|
return [
|
|
382
|
-
...
|
|
382
|
+
...totalList,
|
|
383
383
|
...loop(item.children)
|
|
384
384
|
];
|
|
385
|
-
},
|
|
385
|
+
}, []);
|
|
386
386
|
};
|
|
387
387
|
|
|
388
388
|
return loop(this.departShowList).map(item => item._key);
|
|
@@ -269,13 +269,14 @@ export default {
|
|
|
269
269
|
_showByNumFieldKey: "", // 控制联动隐藏字段的外层字段
|
|
270
270
|
_hideColKeys: [], // 隐藏/查看列字段的keys
|
|
271
271
|
_isQuote: false, // 引用
|
|
272
|
-
_quoteDisabledColKeys: [], //
|
|
272
|
+
_quoteDisabledColKeys: [], // 引用数据行不可编辑列
|
|
273
273
|
_quoteListFields: [], // 引用列表的显示字段
|
|
274
274
|
_quoteAdvSearch: {
|
|
275
275
|
logic: "and",
|
|
276
276
|
conditions: []
|
|
277
277
|
}, // 引用列表筛选条件
|
|
278
278
|
_isImport: false, // 导入
|
|
279
|
+
_importAsDft: false, // 导入的数据作为默认数据
|
|
279
280
|
_isExport: false, // 导出
|
|
280
281
|
_useEnlarge: true, // 全屏
|
|
281
282
|
|
|
@@ -645,6 +646,9 @@ export default {
|
|
|
645
646
|
isImport () {
|
|
646
647
|
return this.selfPropsObj._isImport;
|
|
647
648
|
},
|
|
649
|
+
importAsDft () {
|
|
650
|
+
return this.selfPropsObj._importAsDft;
|
|
651
|
+
},
|
|
648
652
|
importParams () {
|
|
649
653
|
return {
|
|
650
654
|
_id: this.parentDataId,
|
|
@@ -947,7 +951,40 @@ export default {
|
|
|
947
951
|
},
|
|
948
952
|
// 导入回调
|
|
949
953
|
importCb (dataObj) {
|
|
950
|
-
|
|
954
|
+
const fieldVal = dataObj;
|
|
955
|
+
if (this.importAsDft) {
|
|
956
|
+
if (["cascaderTable"].includes(this.controlType)) {
|
|
957
|
+
const transformData = (list = []) => {
|
|
958
|
+
const loop = (list = []) =>
|
|
959
|
+
list.map(item => ({
|
|
960
|
+
...item,
|
|
961
|
+
children: item.children ? loop(item.children) : item.children,
|
|
962
|
+
__isDefault__: true,
|
|
963
|
+
__old__: false
|
|
964
|
+
}));
|
|
965
|
+
|
|
966
|
+
return loop(list);
|
|
967
|
+
};
|
|
968
|
+
|
|
969
|
+
this.parentObj[this.controlKey] = {
|
|
970
|
+
...fieldVal,
|
|
971
|
+
tree: transformData(fieldVal.tree)
|
|
972
|
+
};
|
|
973
|
+
}
|
|
974
|
+
else if (["flatTable"].includes(this.controlType)) {
|
|
975
|
+
this.parentObj[this.controlKey] = {
|
|
976
|
+
...fieldVal,
|
|
977
|
+
list: fieldVal.list.map(item => ({
|
|
978
|
+
...item,
|
|
979
|
+
__isDefault__: true,
|
|
980
|
+
__old__: false
|
|
981
|
+
}))
|
|
982
|
+
};
|
|
983
|
+
}
|
|
984
|
+
} else {
|
|
985
|
+
this.parentObj[this.controlKey] = dataObj;
|
|
986
|
+
}
|
|
987
|
+
|
|
951
988
|
this.change("import");
|
|
952
989
|
},
|
|
953
990
|
|
|
@@ -1094,7 +1131,7 @@ export default {
|
|
|
1094
1131
|
e.stopPropagation();
|
|
1095
1132
|
}
|
|
1096
1133
|
}
|
|
1097
|
-
|
|
1134
|
+
});
|
|
1098
1135
|
},
|
|
1099
1136
|
topSearchRender (h) {
|
|
1100
1137
|
return this.searchFormList.length
|
|
@@ -1384,7 +1421,7 @@ export default {
|
|
|
1384
1421
|
getRowDelBtnCanEdit (row, rowIndex) {
|
|
1385
1422
|
return row.__readonly__ !== true && // 不能为只读数据
|
|
1386
1423
|
(this.disabledDeleteDftRow ? row.__isDefault__ !== true : true) && // 默认数据可删除
|
|
1387
|
-
|
|
1424
|
+
(this.disabledDeleteOldRow ? row.__old__ !== true : true); // 老数据可删除
|
|
1388
1425
|
},
|
|
1389
1426
|
// 行内容是否可编辑
|
|
1390
1427
|
getRowCanEdit (row, rowIndex) {
|
|
@@ -1443,7 +1480,7 @@ export default {
|
|
|
1443
1480
|
getColCanEdit ({ row, rowIndex, column }) {
|
|
1444
1481
|
return (this.getIsDftRow(row) ? !this.dftReadonlyColKeys.includes(column._key) : true) && // 默认行的某列是否可编辑
|
|
1445
1482
|
(row.__old__ === true ? !this.oldReadonlyColKeys.includes(column._key) : true) && // 老数据行里某些列不可编辑
|
|
1446
|
-
(row.__isQuote__ ? !this.quoteReadonlyColKeys.includes(column._key) : true) && //
|
|
1483
|
+
(row.__isQuote__ ? !this.quoteReadonlyColKeys.includes(column._key) : true) && // 引用的数据是否可编辑
|
|
1447
1484
|
(this.getSelfColCanEdit ? this.getSelfColCanEdit({ row, rowIndex, column }) : true) &&
|
|
1448
1485
|
(
|
|
1449
1486
|
["treeTable"].includes(this.inTableType) && ["number", "date"].includes(column._type)
|