bri-components 1.4.2 → 1.4.4
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/form/DshForm.vue +2 -1
- package/src/components/list/DshFlatTable.vue +2 -2
- package/src/components/list/mixins/DshCascaderTableMixin.js +2 -4
- package/src/components/list/mixins/DshFlatTableMixin.js +29 -28
- package/src/components/list/mixins/DshTreeTableMixin.js +2 -6
- package/src/components/list/mixins/tableBaseMixin.js +113 -158
- package/src/components/list/mixins/treeTableBaseMixin.js +12 -6
- package/src/components/other/BriCollapseTree.vue +5 -2
package/package.json
CHANGED
|
@@ -352,7 +352,8 @@
|
|
|
352
352
|
if (
|
|
353
353
|
ruleConfig.type &&
|
|
354
354
|
(!ruleConfig.fields || Object.entries(ruleConfig.fields).every(arr => !arr[1].transform)) &&
|
|
355
|
-
(!["date"].includes(formItem._type) || !["daterange", "datetimerange"].includes(formItem._dateType))
|
|
355
|
+
(!["date"].includes(formItem._type) || !["daterange", "datetimerange"].includes(formItem._dateType)) &&
|
|
356
|
+
(!["select", "checkbox"].includes(formItem._type)) // 考虑到选项用数字类型时,应该type: "number"
|
|
356
357
|
) {
|
|
357
358
|
rules.push({
|
|
358
359
|
message: `${formItem._name}数据格式有错!`,
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
></dsh-form>
|
|
39
39
|
|
|
40
40
|
<dsh-icons
|
|
41
|
-
v-if="$getOperationList(['
|
|
41
|
+
v-if="$getOperationList(['canInsert', 'canDelete']).length"
|
|
42
42
|
class="item-icons"
|
|
43
43
|
itemClass="item-icons-item"
|
|
44
|
-
:list="$getOperationList(['
|
|
44
|
+
:list="$getOperationList(['canInsert', 'canDelete'])"
|
|
45
45
|
@click="$dispatchEvent($event, row, rowIndex)"
|
|
46
46
|
></dsh-icons>
|
|
47
47
|
</div>
|
|
@@ -199,16 +199,14 @@ export default {
|
|
|
199
199
|
on: {
|
|
200
200
|
mouseenter: (event) => {
|
|
201
201
|
this.$set(this.hoverRecordMap, `${row._id}`, true);
|
|
202
|
-
// this.$set(this.hoverRecordMap, `${row._id}dsh${column._key}`, true);
|
|
203
202
|
},
|
|
204
203
|
mouseleave: (event) => {
|
|
205
204
|
this.$set(this.hoverRecordMap, `${row._id}`, false);
|
|
206
|
-
// this.$set(this.hoverRecordMap, `${row._id}dsh${column._key}`, false);
|
|
207
205
|
}
|
|
208
206
|
}
|
|
209
207
|
},
|
|
210
208
|
column.colType === "summary"
|
|
211
|
-
?
|
|
209
|
+
? this.getSummaryTdVal(row, rowIndex, column)
|
|
212
210
|
: column.colType === "operation"
|
|
213
211
|
? this.operationTdCellRender(h, { row, rowIndex, column })
|
|
214
212
|
: this.contentTdCellRender(h, { row, rowIndex, column })
|
|
@@ -326,7 +324,7 @@ export default {
|
|
|
326
324
|
colType: "data"
|
|
327
325
|
})),
|
|
328
326
|
...(
|
|
329
|
-
!this.isSearching && this
|
|
327
|
+
!this.isSearching && this.rowOperationList.length
|
|
330
328
|
? [{
|
|
331
329
|
...this.operationColumn,
|
|
332
330
|
nodeKey: treeForm[treeForm.length - 1]._key,
|
|
@@ -53,11 +53,7 @@ export default {
|
|
|
53
53
|
...(this.useSelection === true ? [this.selectionColumn] : []),
|
|
54
54
|
...(this.useIndex === true ? [this.indexColumn] : []),
|
|
55
55
|
...this.$transformToColumns(this.contentColumns),
|
|
56
|
-
...(
|
|
57
|
-
!this.isSearching && this.$getOperationList(["canDelete"]).length
|
|
58
|
-
? [this.operationColumn]
|
|
59
|
-
: []
|
|
60
|
-
)
|
|
56
|
+
...(!this.isSearching && this.rowOperationList.length ? [this.operationColumn] : [])
|
|
61
57
|
];
|
|
62
58
|
},
|
|
63
59
|
indexColumn () {
|
|
@@ -90,8 +86,9 @@ export default {
|
|
|
90
86
|
const list = this.data;
|
|
91
87
|
const newRow = this.getNewRowData();
|
|
92
88
|
|
|
93
|
-
//
|
|
89
|
+
// 处理单元格合并相关
|
|
94
90
|
if (col) {
|
|
91
|
+
// 当前列是合并列,则该列之前的合并列,要复制这一行对应列的值;
|
|
95
92
|
if (this.mergeRowColKeys.includes(col._key)) {
|
|
96
93
|
const newList = this.allListData.slice(rowIndex); // 从该行开始截取
|
|
97
94
|
const nextRowIndex = this.$isEmptyData(row[col._key])
|
|
@@ -110,9 +107,13 @@ export default {
|
|
|
110
107
|
: obj;
|
|
111
108
|
}, newRow);
|
|
112
109
|
}
|
|
110
|
+
// 当前列是非合并列,按该列前的最后合并列的操作处理(操作列时,colIndex < 0)
|
|
113
111
|
else {
|
|
114
112
|
const colIndex = this.selfColumns.findIndex(column => column._key === col._key);
|
|
115
|
-
const mergeRowColumns = this.selfColumns.filter((column, columnIndex) =>
|
|
113
|
+
const mergeRowColumns = this.selfColumns.filter((column, columnIndex) =>
|
|
114
|
+
(colIndex < 0 ? true : columnIndex <= colIndex) &&
|
|
115
|
+
this.mergeRowColKeys.includes(column._key)
|
|
116
|
+
);
|
|
116
117
|
mergeRowColumns.slice(0, mergeRowColumns.length - 1).reduce((obj, column) => {
|
|
117
118
|
return Object.assign(obj, {
|
|
118
119
|
[column._key]: this.$deepCopy(row[column._key])
|
|
@@ -140,33 +141,33 @@ export default {
|
|
|
140
141
|
});
|
|
141
142
|
},
|
|
142
143
|
|
|
144
|
+
/* ----------- 方法 ---------- */
|
|
143
145
|
bodyCellSpan ({ row, rowIndex, column }) {
|
|
146
|
+
rowIndex = this.showListData.findIndex(dataItem => dataItem._id === row._id);
|
|
147
|
+
|
|
144
148
|
// 合并单元格(单元格值为空时不合并)
|
|
145
|
-
if (
|
|
146
|
-
|
|
149
|
+
if (
|
|
150
|
+
this.mergeRowColKeys.includes(column._key) &&
|
|
151
|
+
rowIndex > -1 &&
|
|
152
|
+
!this.$isEmptyData(row[column._key])
|
|
153
|
+
) {
|
|
154
|
+
if (
|
|
155
|
+
rowIndex !== 0 &&
|
|
156
|
+
row[column._key] === this.showListData[rowIndex - 1][column._key]
|
|
157
|
+
) {
|
|
158
|
+
return {
|
|
159
|
+
rowspan: 0,
|
|
160
|
+
colspan: 0
|
|
161
|
+
};
|
|
162
|
+
} else {
|
|
163
|
+
const newList = this.showListData.slice(rowIndex);
|
|
164
|
+
const newIndex = newList.findIndex(rowItem => row[column._key] !== rowItem[column._key]);
|
|
165
|
+
|
|
147
166
|
return {
|
|
148
|
-
rowspan: 1,
|
|
167
|
+
rowspan: newIndex === -1 ? newList.length : newIndex,
|
|
149
168
|
colspan: 1
|
|
150
169
|
};
|
|
151
170
|
}
|
|
152
|
-
else {
|
|
153
|
-
if (
|
|
154
|
-
rowIndex !== 0 &&
|
|
155
|
-
row[column._key] === this.showListData[rowIndex - 1][column._key]
|
|
156
|
-
) {
|
|
157
|
-
return {
|
|
158
|
-
rowspan: 0,
|
|
159
|
-
colspan: 0
|
|
160
|
-
};
|
|
161
|
-
} else {
|
|
162
|
-
const newList = this.showListData.slice(rowIndex);
|
|
163
|
-
const newIndex = newList.findIndex(rowItem => row[column._key] !== rowItem[column._key]);
|
|
164
|
-
return {
|
|
165
|
-
rowspan: newIndex === -1 ? newList.length : newIndex,
|
|
166
|
-
colspan: 1
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
171
|
}
|
|
171
172
|
}
|
|
172
173
|
}
|
|
@@ -52,11 +52,7 @@ export default {
|
|
|
52
52
|
this.expandColumn,
|
|
53
53
|
...(this.useIndex === true ? [this.indexColumn] : []),
|
|
54
54
|
...this.$transformToColumns(this.contentColumns),
|
|
55
|
-
...(
|
|
56
|
-
!this.isSearching && this.$getOperationList(["canDelete"]).length
|
|
57
|
-
? [this.operationColumn]
|
|
58
|
-
: []
|
|
59
|
-
)
|
|
55
|
+
...(!this.isSearching && this.rowOperationList.length ? [this.operationColumn] : [])
|
|
60
56
|
];
|
|
61
57
|
},
|
|
62
58
|
expandColumn () {
|
|
@@ -100,7 +96,7 @@ export default {
|
|
|
100
96
|
_key: "__treeIndex__",
|
|
101
97
|
key: "__treeIndex__",
|
|
102
98
|
field: "__treeIndex__",
|
|
103
|
-
width: 28 + 16 + (this.maxLevel - 1) *
|
|
99
|
+
width: 28 + 16 + (this.maxLevel - 1) * 36,
|
|
104
100
|
align: "left",
|
|
105
101
|
fixed: "left",
|
|
106
102
|
renderBodyCell: ({ row, rowIndex, column }, h) => {
|
|
@@ -105,17 +105,28 @@ export default {
|
|
|
105
105
|
baseOperationMap: {
|
|
106
106
|
canCreate: {
|
|
107
107
|
name: "添加一行",
|
|
108
|
+
tip: "添加一行",
|
|
108
109
|
type: "canCreate",
|
|
109
110
|
btnType: "default",
|
|
110
111
|
icon: "md-add",
|
|
111
112
|
size: "default",
|
|
112
|
-
color: "#3DB8C5",
|
|
113
113
|
long: true,
|
|
114
114
|
disabled: false,
|
|
115
115
|
event: "clickCreate"
|
|
116
116
|
},
|
|
117
|
+
canInsert: {
|
|
118
|
+
name: "插入一行",
|
|
119
|
+
tip: "插入一行",
|
|
120
|
+
type: "canInsert",
|
|
121
|
+
btnType: "primaryText",
|
|
122
|
+
icon: "md-add",
|
|
123
|
+
size: "small",
|
|
124
|
+
disabled: false,
|
|
125
|
+
event: "clickCreate"
|
|
126
|
+
},
|
|
117
127
|
canDelete: {
|
|
118
128
|
name: "删除",
|
|
129
|
+
tip: "删除该行",
|
|
119
130
|
type: "canDelete",
|
|
120
131
|
btnType: "errorText",
|
|
121
132
|
icon: "md-trash",
|
|
@@ -178,6 +189,9 @@ export default {
|
|
|
178
189
|
},
|
|
179
190
|
computed: {
|
|
180
191
|
...mapGetters(["appObj"]),
|
|
192
|
+
appObj () {
|
|
193
|
+
return this.$store.getters.appObj || {};
|
|
194
|
+
},
|
|
181
195
|
appColor () {
|
|
182
196
|
const themeColorMap = this.$appData.themeColors || {};
|
|
183
197
|
return (themeColorMap[this.appObj.colorType] || { color: "#3DB8C5" }).color;
|
|
@@ -501,8 +515,8 @@ export default {
|
|
|
501
515
|
align: "center",
|
|
502
516
|
_fixed: "right",
|
|
503
517
|
fixed: "right",
|
|
504
|
-
_width:
|
|
505
|
-
width:
|
|
518
|
+
_width: 210,
|
|
519
|
+
width: 210,
|
|
506
520
|
renderBodyCell: ({ row, rowIndex, column }, h) => {
|
|
507
521
|
return this.operationTdCellRender(h, { row, rowIndex, column });
|
|
508
522
|
}
|
|
@@ -619,8 +633,23 @@ export default {
|
|
|
619
633
|
...this.baseOperationMap.canCreate,
|
|
620
634
|
name: this.showMode === "form"
|
|
621
635
|
? this.baseOperationMap.canCreate.name.replace("行", "条")
|
|
622
|
-
: this.baseOperationMap.canCreate.name
|
|
623
|
-
|
|
636
|
+
: this.baseOperationMap.canCreate.name,
|
|
637
|
+
tip: this.showMode === "form"
|
|
638
|
+
? this.baseOperationMap.canCreate.tip.replace("行", "条")
|
|
639
|
+
: this.baseOperationMap.canCreate.tip
|
|
640
|
+
},
|
|
641
|
+
canInsert: {
|
|
642
|
+
...this.baseOperationMap.canInsert,
|
|
643
|
+
name: this.showMode === "form"
|
|
644
|
+
? this.baseOperationMap.canInsert.name.replace("行", "条")
|
|
645
|
+
: this.baseOperationMap.canInsert.name,
|
|
646
|
+
tip: this.showMode === "form"
|
|
647
|
+
? this.baseOperationMap.canInsert.tip.replace("行", "条")
|
|
648
|
+
: this.baseOperationMap.canInsert.tip,
|
|
649
|
+
color: this.appColor
|
|
650
|
+
// style: {
|
|
651
|
+
// color: this.appColor
|
|
652
|
+
// }
|
|
624
653
|
},
|
|
625
654
|
canHideOrShow: {
|
|
626
655
|
...this.topOperationMap.canHideOrShow,
|
|
@@ -651,6 +680,9 @@ export default {
|
|
|
651
680
|
...(this.hideColKeys.length ? ["canHideOrShow"] : [])
|
|
652
681
|
]
|
|
653
682
|
);
|
|
683
|
+
},
|
|
684
|
+
rowOperationList () {
|
|
685
|
+
return this.$getOperationList(["canInsert", "canDelete"]);
|
|
654
686
|
}
|
|
655
687
|
},
|
|
656
688
|
watch: {
|
|
@@ -1122,9 +1154,11 @@ export default {
|
|
|
1122
1154
|
];
|
|
1123
1155
|
},
|
|
1124
1156
|
operationTdCellRender (h, { row, rowIndex, column }) {
|
|
1125
|
-
const operationList = this
|
|
1157
|
+
const operationList = this.rowOperationList.map(btnItem => ({
|
|
1126
1158
|
...btnItem,
|
|
1127
|
-
disabled:
|
|
1159
|
+
disabled: btnItem.type === "canDelete"
|
|
1160
|
+
? !this.getRowDelBtnCanEdit(row, rowIndex)
|
|
1161
|
+
: btnItem.disabled
|
|
1128
1162
|
}));
|
|
1129
1163
|
|
|
1130
1164
|
return [
|
|
@@ -1134,7 +1168,7 @@ export default {
|
|
|
1134
1168
|
},
|
|
1135
1169
|
on: {
|
|
1136
1170
|
click: (operationItem) => {
|
|
1137
|
-
this.$dispatchEvent(operationItem, row, rowIndex);
|
|
1171
|
+
this.$dispatchEvent(operationItem, row, rowIndex, column);
|
|
1138
1172
|
}
|
|
1139
1173
|
}
|
|
1140
1174
|
})
|
|
@@ -1142,151 +1176,75 @@ export default {
|
|
|
1142
1176
|
},
|
|
1143
1177
|
operationIconRender (h, { row, rowIndex, column }, iconSize = 14) {
|
|
1144
1178
|
const baseBool = !this.isSearching &&
|
|
1145
|
-
(this.showCreateBtnColKeys.length ? this.showCreateBtnColKeys.includes(column._key) : ["__index__", "__treeIndex__"].includes(column._key))
|
|
1146
|
-
|
|
1147
|
-
// this.hoverRecordMap[`${row._id}dsh${column._key}`]
|
|
1179
|
+
(this.showCreateBtnColKeys.length ? this.showCreateBtnColKeys.includes(column._key) : ["__index__", "__treeIndex__"].includes(column._key));
|
|
1180
|
+
// this.hoverRecordMap[`${row._id}`];
|
|
1148
1181
|
|
|
1149
1182
|
return [
|
|
1150
1183
|
// 插入一行图标
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
? h("div", {
|
|
1154
|
-
style: {
|
|
1155
|
-
position: "absolute",
|
|
1156
|
-
bottom: "0px",
|
|
1157
|
-
right: "0px",
|
|
1158
|
-
width: `${iconSize + 2}px`,
|
|
1159
|
-
height: `${iconSize + 2}px`,
|
|
1160
|
-
border: `1px solid ${this.appColor}`,
|
|
1161
|
-
borderRadius: "2px",
|
|
1162
|
-
backgroundColor: "#ffffff",
|
|
1163
|
-
lineHeight: `${iconSize - 2}px`,
|
|
1164
|
-
cursor: "pointer",
|
|
1165
|
-
verticalAlign: "middle",
|
|
1166
|
-
transition: "color .2s ease-in-out,border-color .2s ease-in-out"
|
|
1167
|
-
}
|
|
1168
|
-
}, [
|
|
1169
|
-
h("Tooltip", {
|
|
1170
|
-
props: {
|
|
1171
|
-
content: "插入一行",
|
|
1172
|
-
maxWidth: "250",
|
|
1173
|
-
transfer: true
|
|
1174
|
-
}
|
|
1175
|
-
}, [
|
|
1176
|
-
h("Icon", {
|
|
1177
|
-
style: {
|
|
1178
|
-
fontWeight: "500",
|
|
1179
|
-
color: this.appColor
|
|
1180
|
-
},
|
|
1181
|
-
props: {
|
|
1182
|
-
type: this.operationMap.canCreate.icon,
|
|
1183
|
-
size: iconSize
|
|
1184
|
-
},
|
|
1185
|
-
on: {
|
|
1186
|
-
click: () => {
|
|
1187
|
-
this.$dispatchEvent(this.operationMap.canCreate, row, rowIndex, column);
|
|
1188
|
-
}
|
|
1189
|
-
}
|
|
1190
|
-
})
|
|
1191
|
-
])
|
|
1192
|
-
])
|
|
1184
|
+
baseBool
|
|
1185
|
+
? this.getOperationIconRender(h, { row, rowIndex, column }, "canInsert", iconSize)
|
|
1193
1186
|
: h("span", ""),
|
|
1194
1187
|
|
|
1195
1188
|
// 添加一行下级图标
|
|
1196
|
-
|
|
1197
|
-
baseBool &&
|
|
1189
|
+
baseBool &&
|
|
1198
1190
|
row.level < this.maxLevel &&
|
|
1199
1191
|
!["cascaderTable"].includes(this.inTableType) // 老版级联表格类型不要“添加下级”图标
|
|
1200
|
-
? h
|
|
1201
|
-
style: {
|
|
1202
|
-
position: "absolute",
|
|
1203
|
-
bottom: "0px",
|
|
1204
|
-
right: `${iconSize + 3}px`,
|
|
1205
|
-
display: "inline-block",
|
|
1206
|
-
width: `${iconSize + 2}px`,
|
|
1207
|
-
height: `${iconSize + 2}px`,
|
|
1208
|
-
border: `1px solid ${this.appColor}`,
|
|
1209
|
-
borderRadius: "2px",
|
|
1210
|
-
backgroundColor: "#ffffff",
|
|
1211
|
-
lineHeight: `${iconSize - 2}px`,
|
|
1212
|
-
cursor: "pointer",
|
|
1213
|
-
verticalAlign: "middle",
|
|
1214
|
-
transition: "color .2s ease-in-out,border-color .2s ease-in-out"
|
|
1215
|
-
}
|
|
1216
|
-
}, [
|
|
1217
|
-
h("Tooltip", {
|
|
1218
|
-
props: {
|
|
1219
|
-
content: "添加下级",
|
|
1220
|
-
maxWidth: "250",
|
|
1221
|
-
transfer: true
|
|
1222
|
-
}
|
|
1223
|
-
}, [
|
|
1224
|
-
h("Icon", {
|
|
1225
|
-
style: {
|
|
1226
|
-
fontWeight: "500",
|
|
1227
|
-
color: this.appColor
|
|
1228
|
-
},
|
|
1229
|
-
props: {
|
|
1230
|
-
type: this.operationMap.canCreateChild.icon,
|
|
1231
|
-
size: iconSize
|
|
1232
|
-
},
|
|
1233
|
-
on: {
|
|
1234
|
-
click: () => {
|
|
1235
|
-
this.$dispatchEvent(this.operationMap.canCreateChild, row, rowIndex);
|
|
1236
|
-
}
|
|
1237
|
-
}
|
|
1238
|
-
})
|
|
1239
|
-
])
|
|
1240
|
-
])
|
|
1192
|
+
? this.getOperationIconRender(h, { row, rowIndex, column }, "canCreateChild", iconSize, true)
|
|
1241
1193
|
: h("span", ""),
|
|
1242
1194
|
|
|
1243
1195
|
// 删除该行图标
|
|
1244
|
-
|
|
1245
|
-
baseBool &&
|
|
1196
|
+
baseBool &&
|
|
1246
1197
|
this.getRowDelBtnCanEdit(row, rowIndex) &&
|
|
1247
1198
|
["cascaderTable"].includes(this.inTableType)
|
|
1248
|
-
? h
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1199
|
+
? this.getOperationIconRender(h, { row, rowIndex, column }, "canDelete", iconSize, true)
|
|
1200
|
+
: h("span", "")
|
|
1201
|
+
];
|
|
1202
|
+
},
|
|
1203
|
+
getOperationIconRender (h, { row, rowIndex, column }, operationType, iconSize = 14, isLeft = false) {
|
|
1204
|
+
const operationItem = this.operationMap[operationType];
|
|
1205
|
+
|
|
1206
|
+
return operationItem && operationItem.disabled !== true
|
|
1207
|
+
? h("div", {
|
|
1208
|
+
style: {
|
|
1209
|
+
position: "absolute",
|
|
1210
|
+
bottom: "0px",
|
|
1211
|
+
right: isLeft ? `${iconSize + 3}px` : "0px",
|
|
1212
|
+
width: `${iconSize + 2}px`,
|
|
1213
|
+
height: `${iconSize + 2}px`,
|
|
1214
|
+
border: `1px solid ${operationItem.color}`,
|
|
1215
|
+
borderRadius: "2px",
|
|
1216
|
+
backgroundColor: "#ffffff",
|
|
1217
|
+
lineHeight: `${iconSize - 2}px`,
|
|
1218
|
+
cursor: "pointer",
|
|
1219
|
+
verticalAlign: "middle",
|
|
1220
|
+
transition: "color .2s ease-in-out,border-color .2s ease-in-out"
|
|
1221
|
+
}
|
|
1222
|
+
}, [
|
|
1223
|
+
h("Tooltip", {
|
|
1224
|
+
props: {
|
|
1225
|
+
content: operationItem.tip,
|
|
1226
|
+
maxWidth: "250",
|
|
1227
|
+
transfer: true
|
|
1262
1228
|
}
|
|
1263
1229
|
}, [
|
|
1264
|
-
h("
|
|
1230
|
+
h("Icon", {
|
|
1231
|
+
style: {
|
|
1232
|
+
fontWeight: "500",
|
|
1233
|
+
color: operationItem.color
|
|
1234
|
+
},
|
|
1265
1235
|
props: {
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
style: {
|
|
1273
|
-
fontWeight: "500",
|
|
1274
|
-
color: this.operationMap.canDelete.color
|
|
1275
|
-
},
|
|
1276
|
-
props: {
|
|
1277
|
-
type: this.operationMap.canDelete.icon,
|
|
1278
|
-
size: iconSize
|
|
1279
|
-
},
|
|
1280
|
-
on: {
|
|
1281
|
-
click: () => {
|
|
1282
|
-
this.$dispatchEvent(this.operationMap.canDelete, row, rowIndex, column);
|
|
1283
|
-
}
|
|
1236
|
+
type: operationItem.icon,
|
|
1237
|
+
size: iconSize
|
|
1238
|
+
},
|
|
1239
|
+
on: {
|
|
1240
|
+
click: () => {
|
|
1241
|
+
this.$dispatchEvent(operationItem, row, rowIndex, column);
|
|
1284
1242
|
}
|
|
1285
|
-
}
|
|
1286
|
-
|
|
1243
|
+
}
|
|
1244
|
+
})
|
|
1287
1245
|
])
|
|
1288
|
-
|
|
1289
|
-
|
|
1246
|
+
])
|
|
1247
|
+
: h("span", "");
|
|
1290
1248
|
},
|
|
1291
1249
|
bodyCellClass ({ row, rowIndex, column }) {
|
|
1292
1250
|
return "bri-table-td" +
|
|
@@ -1326,11 +1284,9 @@ export default {
|
|
|
1326
1284
|
},
|
|
1327
1285
|
mouseenter: (event) => {
|
|
1328
1286
|
this.$set(this.hoverRecordMap, `${row._id}`, true);
|
|
1329
|
-
// this.$set(this.hoverRecordMap, `${row._id}dsh${column._key}`, true);
|
|
1330
1287
|
},
|
|
1331
1288
|
mouseleave: (event) => {
|
|
1332
1289
|
this.$set(this.hoverRecordMap, `${row._id}`, false);
|
|
1333
|
-
// this.$set(this.hoverRecordMap, `${row._id}dsh${column._key}`, false);
|
|
1334
1290
|
}
|
|
1335
1291
|
};
|
|
1336
1292
|
},
|
|
@@ -1389,10 +1345,9 @@ export default {
|
|
|
1389
1345
|
},
|
|
1390
1346
|
// 行按钮是否可操作(删除按钮可编辑 不代表行内容是可编辑的)
|
|
1391
1347
|
getRowDelBtnCanEdit (row, rowIndex) {
|
|
1392
|
-
return
|
|
1348
|
+
return row.__readonly__ !== true && // 不能为只读数据
|
|
1393
1349
|
(this.disabledDeleteDftRow ? row.__isDefault__ !== true : true) && // 默认数据可删除
|
|
1394
|
-
|
|
1395
|
-
row.__readonly__ !== true; // 不能为只读数据
|
|
1350
|
+
(this.disabledDeleteOldRow ? row.__old__ !== true : true); // 老数据可删除
|
|
1396
1351
|
},
|
|
1397
1352
|
// 行内容是否可编辑
|
|
1398
1353
|
getRowCanEdit (row, rowIndex) {
|
|
@@ -1444,28 +1399,28 @@ export default {
|
|
|
1444
1399
|
},
|
|
1445
1400
|
// 列本身是否可编辑
|
|
1446
1401
|
getColCanEdit (row, rowIndex, col) {
|
|
1447
|
-
return (
|
|
1448
|
-
["treeTable"].includes(this.inTableType) && ["number", "date"].includes(col._type)
|
|
1449
|
-
? col._summaryType
|
|
1450
|
-
? row.isLeaf === true
|
|
1451
|
-
: ["downToUp", "upToDown"].includes(col._writeSort)
|
|
1452
|
-
? col._noLimitWrite === true
|
|
1453
|
-
? true
|
|
1454
|
-
: ["downToUp"].includes(col._writeSort)
|
|
1455
|
-
? !(row.children && row.children.length) || row.children.every(sonRow => !this.$isEmptyData(sonRow[col._key]))
|
|
1456
|
-
: row.level === 1 || !this.$isEmptyData(this.getParentRow(row, this.data)[col._key])
|
|
1457
|
-
: true
|
|
1458
|
-
: true
|
|
1459
|
-
) &&
|
|
1460
|
-
!(["cascaderTable"].includes(this.controlType) && ["level", "children"].includes(col._key)) && // 层级表格的固定字段不可编辑
|
|
1461
|
-
(col._oldReadonly ? row.__old__ !== true : true) && // 某些列在老数据行里不可编辑
|
|
1402
|
+
return (col._oldReadonly ? row.__old__ !== true : true) && // 某些列在老数据行里不可编辑
|
|
1462
1403
|
(this.getIsDftRow(row) ? !this.dftReadonlyColKeys.includes(col._key) : true) && // 默认行的某列是否可编辑
|
|
1463
1404
|
(row.__old__ === true ? !this.oldReadonlyColKeys.includes(col._key) : true) && // 老数据行里某些列不可编辑
|
|
1464
1405
|
(row.__isQuote__ ? !this.quoteReadonlyColKeys.includes(col._key) : true) && // 引用过来的数据是否可编辑
|
|
1465
|
-
!
|
|
1406
|
+
(!this.getTypeColCanEdit || this.getTypeColCanEdit(row, rowIndex, col)) &&
|
|
1407
|
+
(
|
|
1408
|
+
["treeTable"].includes(this.inTableType) && ["number", "date"].includes(col._type)
|
|
1409
|
+
? col._summaryType
|
|
1410
|
+
? row.isLeaf === true
|
|
1411
|
+
: ["downToUp", "upToDown"].includes(col._writeSort)
|
|
1412
|
+
? col._noLimitWrite === true
|
|
1413
|
+
? true
|
|
1414
|
+
: ["downToUp"].includes(col._writeSort)
|
|
1415
|
+
? !(row.children && row.children.length) || row.children.every(sonRow => !this.$isEmptyData(sonRow[col._key]))
|
|
1416
|
+
: row.level === 1 || !this.$isEmptyData(this.getParentRow(row, this.data)[col._key])
|
|
1417
|
+
: true
|
|
1418
|
+
: true
|
|
1419
|
+
) &&
|
|
1420
|
+
!(["cascaderTable"].includes(this.controlType) && ["level", "children"].includes(col._key)) && // 层级表格的固定字段不可编辑
|
|
1421
|
+
col._enterType !== "calculate" && // 计算的不可编辑
|
|
1466
1422
|
col._readonly !== true && // 只读
|
|
1467
|
-
col.canEdit !== false
|
|
1468
|
-
(!this.getTypeColCanEdit || this.getTypeColCanEdit(row, rowIndex, col));
|
|
1423
|
+
col.canEdit !== false; // 字段本身编辑权限 考虑为undefined时候
|
|
1469
1424
|
},
|
|
1470
1425
|
// 单元格最终编辑状态
|
|
1471
1426
|
getUnitCanEdit (row, rowIndex, col) {
|
|
@@ -10,12 +10,12 @@ export default {
|
|
|
10
10
|
|
|
11
11
|
baseOperationMap: {
|
|
12
12
|
canCreateChild: {
|
|
13
|
-
name: "
|
|
13
|
+
name: "添加下级",
|
|
14
|
+
tip: "添加一行下级",
|
|
14
15
|
type: "canCreateChild",
|
|
15
|
-
btnType: "
|
|
16
|
+
btnType: "primaryText",
|
|
16
17
|
icon: "md-add-circle",
|
|
17
|
-
size: "
|
|
18
|
-
color: "#3DB8C5",
|
|
18
|
+
size: "small",
|
|
19
19
|
disabled: false,
|
|
20
20
|
event: "clickCreateChild"
|
|
21
21
|
}
|
|
@@ -70,8 +70,14 @@ export default {
|
|
|
70
70
|
...this.baseOperationMap.canCreateChild,
|
|
71
71
|
name: this.showMode === "form"
|
|
72
72
|
? this.baseOperationMap.canCreateChild.name.replace("行", "条")
|
|
73
|
-
: this.baseOperationMap.canCreateChild.name
|
|
74
|
-
|
|
73
|
+
: this.baseOperationMap.canCreateChild.name,
|
|
74
|
+
tip: this.showMode === "form"
|
|
75
|
+
? this.baseOperationMap.canCreateChild.tip.replace("行", "条")
|
|
76
|
+
: this.baseOperationMap.canCreateChild.tip,
|
|
77
|
+
color: this.appColor
|
|
78
|
+
// style: {
|
|
79
|
+
// color: this.appColor
|
|
80
|
+
// }
|
|
75
81
|
}
|
|
76
82
|
};
|
|
77
83
|
}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
:accordion="listItem._accordion"
|
|
13
13
|
:simple="listItem._simple === false ? false : true"
|
|
14
14
|
:hide-arrow="true"
|
|
15
|
-
:value="listItem.expansion
|
|
15
|
+
:value="listItem.expansion ? [listItem._key] : []"
|
|
16
16
|
>
|
|
17
17
|
<Panel :name="listItem._key">
|
|
18
18
|
<div
|
|
@@ -70,7 +70,10 @@
|
|
|
70
70
|
{{ listItem._simpleDescription }}
|
|
71
71
|
</span>
|
|
72
72
|
</Tooltip>
|
|
73
|
-
<span
|
|
73
|
+
<span
|
|
74
|
+
v-else
|
|
75
|
+
class="BriCollapseTree-listItem-rightText"
|
|
76
|
+
>{{ listItem._simpleDescription }}</span>
|
|
74
77
|
</div>
|
|
75
78
|
</div>
|
|
76
79
|
</li>
|