bri-components 1.4.27 → 1.4.30
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,8 +951,45 @@ export default {
|
|
|
947
951
|
},
|
|
948
952
|
// 导入回调
|
|
949
953
|
importCb (dataObj) {
|
|
950
|
-
|
|
951
|
-
this.
|
|
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
|
+
|
|
988
|
+
// 因为data和rowspanMap不马上更新
|
|
989
|
+
this.$nextTick(() => {
|
|
990
|
+
this.reset();
|
|
991
|
+
this.change("import");
|
|
992
|
+
});
|
|
952
993
|
},
|
|
953
994
|
|
|
954
995
|
/* ----------- 导出 ---------- */
|
|
@@ -1443,7 +1484,7 @@ export default {
|
|
|
1443
1484
|
getColCanEdit ({ row, rowIndex, column }) {
|
|
1444
1485
|
return (this.getIsDftRow(row) ? !this.dftReadonlyColKeys.includes(column._key) : true) && // 默认行的某列是否可编辑
|
|
1445
1486
|
(row.__old__ === true ? !this.oldReadonlyColKeys.includes(column._key) : true) && // 老数据行里某些列不可编辑
|
|
1446
|
-
(row.__isQuote__ ? !this.quoteReadonlyColKeys.includes(column._key) : true) && //
|
|
1487
|
+
(row.__isQuote__ ? !this.quoteReadonlyColKeys.includes(column._key) : true) && // 引用的数据是否可编辑
|
|
1447
1488
|
(this.getSelfColCanEdit ? this.getSelfColCanEdit({ row, rowIndex, column }) : true) &&
|
|
1448
1489
|
(
|
|
1449
1490
|
["treeTable"].includes(this.inTableType) && ["number", "date"].includes(column._type)
|