bri-components 1.3.94 → 1.3.96
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/list/DshCascaderTable.vue +3 -0
- package/src/components/list/DshFlatTable.vue +0 -2
- package/src/components/list/DshTreeTable.vue +2 -0
- package/src/components/list/mixins/DshCascaderTableMixin.js +41 -32
- package/src/components/list/mixins/DshFlatTableMixin.js +3 -4
- package/src/components/list/mixins/tableBaseMixin.js +19 -17
- package/src/components/list/mixins/treeTableBaseMixin.js +20 -20
package/package.json
CHANGED
|
@@ -126,7 +126,6 @@
|
|
|
126
126
|
|
|
127
127
|
<script>
|
|
128
128
|
import tableBaseMixin from "./mixins/tableBaseMixin.js";
|
|
129
|
-
import treeTableBaseMixin from "./mixins/treeTableBaseMixin.js";
|
|
130
129
|
import DshFlatTableMixin from "./mixins/DshFlatTableMixin.js";
|
|
131
130
|
import DshDivider from "../controls/base/DshDivider.vue";
|
|
132
131
|
|
|
@@ -134,7 +133,6 @@
|
|
|
134
133
|
name: "DshFlatTable",
|
|
135
134
|
mixins: [
|
|
136
135
|
tableBaseMixin,
|
|
137
|
-
treeTableBaseMixin,
|
|
138
136
|
DshFlatTableMixin
|
|
139
137
|
],
|
|
140
138
|
components: {
|
|
@@ -86,12 +86,14 @@
|
|
|
86
86
|
|
|
87
87
|
<script>
|
|
88
88
|
import tableBaseMixin from "./mixins/tableBaseMixin.js";
|
|
89
|
+
import treeTableBaseMixin from "./mixins/treeTableBaseMixin.js";
|
|
89
90
|
import DshTreeTableMixin from "./mixins/DshTreeTableMixin.js";
|
|
90
91
|
|
|
91
92
|
export default {
|
|
92
93
|
name: "DshTreeTable",
|
|
93
94
|
mixins: [
|
|
94
95
|
tableBaseMixin,
|
|
96
|
+
treeTableBaseMixin,
|
|
95
97
|
DshTreeTableMixin
|
|
96
98
|
],
|
|
97
99
|
components: {},
|
|
@@ -52,27 +52,26 @@ export default {
|
|
|
52
52
|
name: "改变节点值",
|
|
53
53
|
type: "changeNode",
|
|
54
54
|
event: "changeNode"
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
canClearNode: {
|
|
58
|
-
name: "清除内容",
|
|
59
|
-
type: "canClearNode",
|
|
60
|
-
icon: "md-trash",
|
|
61
|
-
divided: true,
|
|
62
|
-
event: "clickClearNode"
|
|
63
|
-
},
|
|
64
|
-
canClearChildNodes: {
|
|
65
|
-
name: "清除所有下级内容",
|
|
66
|
-
type: "canClearChildNodes",
|
|
67
|
-
icon: "md-trash",
|
|
68
|
-
event: "clickClearChildNodes"
|
|
69
55
|
}
|
|
56
|
+
|
|
57
|
+
// canClearNode: {
|
|
58
|
+
// name: "清除内容",
|
|
59
|
+
// type: "canClearNode",
|
|
60
|
+
// icon: "md-trash",
|
|
61
|
+
// divided: true,
|
|
62
|
+
// event: "clickClearNode"
|
|
63
|
+
// },
|
|
64
|
+
// canClearChildNodes: {
|
|
65
|
+
// name: "清除所有下级内容",
|
|
66
|
+
// type: "canClearChildNodes",
|
|
67
|
+
// icon: "md-trash",
|
|
68
|
+
// event: "clickClearChildNodes"
|
|
69
|
+
// }
|
|
70
70
|
}
|
|
71
71
|
};
|
|
72
72
|
},
|
|
73
73
|
computed: {
|
|
74
74
|
allTreeData () {
|
|
75
|
-
// console.log("allTreeData");
|
|
76
75
|
return this.getCalcuedTree(this.data, this.treeColumns, this.selfColumns);
|
|
77
76
|
},
|
|
78
77
|
allListData () {
|
|
@@ -165,18 +164,18 @@ export default {
|
|
|
165
164
|
changeNode (operationItem, col, row, rowIndex) {
|
|
166
165
|
this.change("changeNode", col, row, rowIndex);
|
|
167
166
|
},
|
|
168
|
-
// 节点操作 -清除该节点内容
|
|
169
|
-
clickClearNode (operationItem, row, rowIndex, col) {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
},
|
|
174
|
-
// 节点操作 -清除所有子节点内容
|
|
175
|
-
clickClearChildNodes (operationItem, row, rowIndex, col) {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
},
|
|
167
|
+
// // 节点操作 -清除该节点内容
|
|
168
|
+
// clickClearNode (operationItem, row, rowIndex, col) {
|
|
169
|
+
// row.name = "";
|
|
170
|
+
|
|
171
|
+
// this.change("clearNode", null, row, rowIndex);
|
|
172
|
+
// },
|
|
173
|
+
// // 节点操作 -清除所有子节点内容
|
|
174
|
+
// clickClearChildNodes (operationItem, row, rowIndex, col) {
|
|
175
|
+
// this.$clearPropertyValToLeaf(row.children);
|
|
176
|
+
|
|
177
|
+
// this.change("clearChildNodes", null, row, rowIndex);
|
|
178
|
+
// },
|
|
180
179
|
change (eventType, col, row, rowIndex, ...params) {
|
|
181
180
|
this.$emit("change", this.tableDataObj, eventType, col, row, rowIndex, ...params);
|
|
182
181
|
},
|
|
@@ -379,7 +378,15 @@ export default {
|
|
|
379
378
|
"td",
|
|
380
379
|
{
|
|
381
380
|
class: this.tablePropsObj.cellStyleOption.bodyCellClass({ row, rowIndex, column }),
|
|
382
|
-
style: this.getTdStyle(column, row, rowIndex)
|
|
381
|
+
style: this.getTdStyle(column, row, rowIndex),
|
|
382
|
+
on: {
|
|
383
|
+
mouseenter: (event) => {
|
|
384
|
+
this.$set(this.hoverRecordMap, `${row._id}dsh${column._key}`, true);
|
|
385
|
+
},
|
|
386
|
+
mouseleave: (event) => {
|
|
387
|
+
this.$set(this.hoverRecordMap, `${row._id}dsh${column._key}`, false);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
383
390
|
},
|
|
384
391
|
column
|
|
385
392
|
? column.renderBodyCell({ row, rowIndex, column }, h)
|
|
@@ -392,12 +399,14 @@ export default {
|
|
|
392
399
|
const list = this.$getOperationList(
|
|
393
400
|
position === "th"
|
|
394
401
|
? [
|
|
395
|
-
...(column.level
|
|
402
|
+
...(column.level < this.maxLevel ? ["canCreateCol"] : []), // 限制最大添加到几级
|
|
396
403
|
...(column.level > 1 && column.canDelete === true ? ["canDeleteCol"] : []) // 只有一级和最后两级节点数不一致时,不能删
|
|
397
404
|
]
|
|
398
|
-
: row
|
|
399
|
-
? [
|
|
400
|
-
:
|
|
405
|
+
: this.getRowIsDftDisabled(row)
|
|
406
|
+
? []
|
|
407
|
+
: row.isLeaf === true
|
|
408
|
+
? ["canCreate", "canDelete"]
|
|
409
|
+
: ["canCreate", "canCreateChild", "canDelete", "canDeleteChilds"]
|
|
401
410
|
);
|
|
402
411
|
|
|
403
412
|
return !this.isSearching &&
|
|
@@ -79,9 +79,6 @@ export default {
|
|
|
79
79
|
clickCreate (operationItem, row, rowIndex, col) {
|
|
80
80
|
const list = this.data;
|
|
81
81
|
const newRow = this.getNewRowData();
|
|
82
|
-
const newRowIndex = row
|
|
83
|
-
? list.findIndex(rowItem => rowItem._id === row._id) + 1
|
|
84
|
-
: list.length;
|
|
85
82
|
|
|
86
83
|
// 处理单元格合并相关(当前列是合并列,则该列之前的合并列,要复制这一行对应列的值;当前列是普通列,按最后合并列的操作处理)
|
|
87
84
|
if (col) {
|
|
@@ -109,7 +106,9 @@ export default {
|
|
|
109
106
|
}, newRow);
|
|
110
107
|
}
|
|
111
108
|
}
|
|
112
|
-
|
|
109
|
+
const newRowIndex = row
|
|
110
|
+
? list.findIndex(rowItem => rowItem._id === row._id) + 1
|
|
111
|
+
: list.length;
|
|
113
112
|
list.splice(newRowIndex, 0, newRow);
|
|
114
113
|
|
|
115
114
|
this.change("createRow", null, newRow, newRowIndex);
|
|
@@ -64,7 +64,7 @@ export default {
|
|
|
64
64
|
widthMap: this.$getModFieldPropertyMap("width"),
|
|
65
65
|
initDftValMap: this.$getModFieldPropertyMap("initDefaultVal"),
|
|
66
66
|
saveProperties: ["__readonly__", "__isDefault__", "__old__", "__isQuote__"],
|
|
67
|
-
resetProperties: ["
|
|
67
|
+
resetProperties: ["__isRendered__", "__isShow__", "__isTmpShow__", "__isSearchShow__", "__isExpand__", "__treeIndex__"],
|
|
68
68
|
|
|
69
69
|
initFlag: true,
|
|
70
70
|
showRuleMessage: false, // 进行全体校验
|
|
@@ -328,10 +328,10 @@ export default {
|
|
|
328
328
|
return this.controlKey === "_default" ? false : this.selfPropsObj._disabledOldDataRow;
|
|
329
329
|
},
|
|
330
330
|
showCreateBtnColKeys () {
|
|
331
|
-
return this.selfPropsObj._showCreateBtnColKeys;
|
|
331
|
+
return this.selfPropsObj._showCreateBtnColKeys || []; // 配置端有问题,高级以依赖时候值成undefined了
|
|
332
332
|
},
|
|
333
333
|
hideColKeys () {
|
|
334
|
-
return this.selfPropsObj._hideColKeys
|
|
334
|
+
return this.selfPropsObj._hideColKeys;
|
|
335
335
|
},
|
|
336
336
|
|
|
337
337
|
searchLabelWidth () {
|
|
@@ -635,7 +635,7 @@ export default {
|
|
|
635
635
|
: undefined,
|
|
636
636
|
|
|
637
637
|
// 添加符
|
|
638
|
-
...this.createIconRender(h, { row, rowIndex, column })
|
|
638
|
+
...this.createIconRender(h, { row, rowIndex, column }, 12)
|
|
639
639
|
];
|
|
640
640
|
},
|
|
641
641
|
...colItem
|
|
@@ -1152,7 +1152,7 @@ export default {
|
|
|
1152
1152
|
})
|
|
1153
1153
|
: undefined;
|
|
1154
1154
|
},
|
|
1155
|
-
createIconRender (h, { row, rowIndex, column }) {
|
|
1155
|
+
createIconRender (h, { row, rowIndex, column }, iconSize = 14) {
|
|
1156
1156
|
return [
|
|
1157
1157
|
// 插入一行添加符
|
|
1158
1158
|
(this.operationMap.canCreate && this.operationMap.canCreate.disabled !== true) &&
|
|
@@ -1164,11 +1164,11 @@ export default {
|
|
|
1164
1164
|
position: "absolute",
|
|
1165
1165
|
bottom: "0px",
|
|
1166
1166
|
right: "0px",
|
|
1167
|
-
width:
|
|
1168
|
-
height:
|
|
1167
|
+
width: `${iconSize + 2}px`,
|
|
1168
|
+
height: `${iconSize + 2}px`,
|
|
1169
1169
|
border: `1px solid ${this.appColor}`,
|
|
1170
1170
|
backgroundColor: "#ffffff",
|
|
1171
|
-
lineHeight:
|
|
1171
|
+
lineHeight: `${iconSize - 2}px`,
|
|
1172
1172
|
cursor: "pointer",
|
|
1173
1173
|
verticalAlign: "middle",
|
|
1174
1174
|
transition: "color .2s ease-in-out,border-color .2s ease-in-out"
|
|
@@ -1188,7 +1188,7 @@ export default {
|
|
|
1188
1188
|
},
|
|
1189
1189
|
props: {
|
|
1190
1190
|
type: this.operationMap.canCreate.icon,
|
|
1191
|
-
size:
|
|
1191
|
+
size: iconSize
|
|
1192
1192
|
},
|
|
1193
1193
|
on: {
|
|
1194
1194
|
click: () => {
|
|
@@ -1201,7 +1201,7 @@ export default {
|
|
|
1201
1201
|
: h("span", ""),
|
|
1202
1202
|
|
|
1203
1203
|
// 添加一行下级添加符
|
|
1204
|
-
["
|
|
1204
|
+
["treeTable"].includes(this.inTableType) &&
|
|
1205
1205
|
(this.operationMap.canCreateChild && this.operationMap.canCreateChild.disabled !== true) &&
|
|
1206
1206
|
!this.isSearching &&
|
|
1207
1207
|
(column._key === "__index__" ? !this.showCreateBtnColKeys.length : this.showCreateBtnColKeys.includes(column._key)) &&
|
|
@@ -1211,13 +1211,13 @@ export default {
|
|
|
1211
1211
|
style: {
|
|
1212
1212
|
position: "absolute",
|
|
1213
1213
|
bottom: "0px",
|
|
1214
|
-
right:
|
|
1214
|
+
right: `${iconSize + 3}px`,
|
|
1215
1215
|
display: "inline-block",
|
|
1216
|
-
width:
|
|
1217
|
-
height:
|
|
1216
|
+
width: `${iconSize + 2}px`,
|
|
1217
|
+
height: `${iconSize + 2}px`,
|
|
1218
1218
|
border: `1px solid ${this.appColor}`,
|
|
1219
1219
|
backgroundColor: "#ffffff",
|
|
1220
|
-
lineHeight:
|
|
1220
|
+
lineHeight: `${iconSize - 2}px`,
|
|
1221
1221
|
cursor: "pointer",
|
|
1222
1222
|
verticalAlign: "middle",
|
|
1223
1223
|
transition: "color .2s ease-in-out,border-color .2s ease-in-out"
|
|
@@ -1237,7 +1237,7 @@ export default {
|
|
|
1237
1237
|
},
|
|
1238
1238
|
props: {
|
|
1239
1239
|
type: this.operationMap.canCreateChild.icon,
|
|
1240
|
-
size:
|
|
1240
|
+
size: iconSize
|
|
1241
1241
|
},
|
|
1242
1242
|
on: {
|
|
1243
1243
|
click: () => {
|
|
@@ -1285,7 +1285,8 @@ export default {
|
|
|
1285
1285
|
__isRendered__: true,
|
|
1286
1286
|
__isShow__: true,
|
|
1287
1287
|
__isTmpShow__: true,
|
|
1288
|
-
__isSearchShow__: false
|
|
1288
|
+
__isSearchShow__: false,
|
|
1289
|
+
__isExpand__: false
|
|
1289
1290
|
};
|
|
1290
1291
|
}
|
|
1291
1292
|
},
|
|
@@ -1451,8 +1452,8 @@ export default {
|
|
|
1451
1452
|
delete row[property];
|
|
1452
1453
|
});
|
|
1453
1454
|
if (["treeTable"].includes(this.inTableType)) {
|
|
1454
|
-
// row.__isExpand__ = false;
|
|
1455
1455
|
// row.__isSearchShow__ = false;
|
|
1456
|
+
// row.__isExpand__ = false;
|
|
1456
1457
|
// 第一级的需要显示出来
|
|
1457
1458
|
if (row.level == 1) {
|
|
1458
1459
|
row.__isRendered__ = true;
|
|
@@ -1468,6 +1469,7 @@ export default {
|
|
|
1468
1469
|
row.__isShow__ = true;
|
|
1469
1470
|
row.__isTmpShow__ = true;
|
|
1470
1471
|
row.__isSearchShow__ = false;
|
|
1472
|
+
row.__isExpand__ = false;
|
|
1471
1473
|
}
|
|
1472
1474
|
}
|
|
1473
1475
|
}
|
|
@@ -50,10 +50,10 @@ export default {
|
|
|
50
50
|
const list = row
|
|
51
51
|
? this.getParentRow(row, this.data).children
|
|
52
52
|
: this.data;
|
|
53
|
+
const newRow = this.getNewRowData(row ? row.level : 1, list);
|
|
53
54
|
const newRowIndex = row
|
|
54
55
|
? list.findIndex(rowItem => rowItem._id === row._id) + 1
|
|
55
56
|
: list.length;
|
|
56
|
-
const newRow = this.getNewRowData(row ? row.level : 1, list);
|
|
57
57
|
list.splice(newRowIndex, 0, newRow);
|
|
58
58
|
|
|
59
59
|
this.change("createRow", null, newRow, newRowIndex);
|
|
@@ -61,8 +61,8 @@ export default {
|
|
|
61
61
|
// 节点操作 -添加子行
|
|
62
62
|
clickCreateChild (operationItem, row, rowIndex, col) {
|
|
63
63
|
const list = row.children;
|
|
64
|
-
const newRowIndex = list.length;
|
|
65
64
|
const newRow = this.getNewRowData(row.level + 1, list);
|
|
65
|
+
const newRowIndex = list.length;
|
|
66
66
|
list.splice(newRowIndex, 0, newRow);
|
|
67
67
|
|
|
68
68
|
// 展开子级
|
|
@@ -72,29 +72,29 @@ export default {
|
|
|
72
72
|
},
|
|
73
73
|
// 节点操作 -删除行
|
|
74
74
|
clickDelete (operationItem, row, rowIndex, col) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
75
|
+
this.$Modal.confirm({
|
|
76
|
+
title: "警告",
|
|
77
|
+
content: "确定删除该行及其所有下级吗?",
|
|
78
|
+
onOk: () => {
|
|
79
|
+
const parentRow = this.getParentRow(row, this.data);
|
|
80
|
+
const index = parentRow.children.findIndex(childRowItem => childRowItem._id === row._id);
|
|
81
|
+
parentRow.children.splice(index, 1);
|
|
82
82
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
this.change("deleteRow", null, row, rowIndex);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
86
|
},
|
|
87
87
|
// 节点操作 -删除所有子行
|
|
88
88
|
clickDeleteChilds (operationItem, row, rowIndex, col) {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
89
|
+
this.$Modal.confirm({
|
|
90
|
+
title: "警告",
|
|
91
|
+
content: "确定删除该行及其所有下级吗?",
|
|
92
|
+
onOk: () => {
|
|
93
|
+
row.children.splice(0);
|
|
94
94
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
this.change("deleteChildRows", null, row, rowIndex);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
98
|
},
|
|
99
99
|
|
|
100
100
|
// 展开/隐藏节点
|