bri-components 1.3.98 → 1.4.1
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/controls/base/BriUpload/BriUpload.vue +17 -2
- package/src/components/controls/base/BriUpload/uploadList.vue +271 -56
- package/src/components/controls/base/DshSelect/DshCheckbox.vue +1 -1
- package/src/components/controls/base/DshSelect/DshSelect.vue +1 -1
- package/src/components/controls/mixins/controlMixin.js +29 -29
- package/src/components/controls/mixins/selectMixin.js +1 -1
- package/src/components/controls/senior/cascaderTable.vue +4 -2
- package/src/components/controls/senior/flatTable.vue +2 -0
- package/src/components/controls/senior/selectUsers/departMenu.vue +2 -1
- package/src/components/form/DshForm.vue +1 -1
- package/src/components/list/DshBox/DshCrossTable.vue +0 -3
- package/src/components/list/mixins/DshCascaderTableMixin.js +227 -332
- package/src/components/list/mixins/DshFlatTableMixin.js +44 -8
- package/src/components/list/mixins/DshTreeTableMixin.js +14 -14
- package/src/components/list/mixins/tableBaseMixin.js +209 -193
- package/src/components/list/mixins/treeTableBaseMixin.js +57 -20
- package/src/components/small/DshDropdown.vue +2 -1
- package/src/styles/components/list/BriTable.less +3 -2
|
@@ -45,6 +45,12 @@ export default {
|
|
|
45
45
|
return {};
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
|
+
tableDataObj: {
|
|
49
|
+
type: Object,
|
|
50
|
+
default () {
|
|
51
|
+
return {};
|
|
52
|
+
}
|
|
53
|
+
},
|
|
48
54
|
|
|
49
55
|
allFormList: {
|
|
50
56
|
type: Array,
|
|
@@ -108,41 +114,21 @@ export default {
|
|
|
108
114
|
disabled: false,
|
|
109
115
|
event: "clickCreate"
|
|
110
116
|
},
|
|
111
|
-
canCreateChild: {
|
|
112
|
-
name: "添加一行下级",
|
|
113
|
-
type: "canCreateChild",
|
|
114
|
-
btnType: "default",
|
|
115
|
-
icon: "md-add-circle",
|
|
116
|
-
size: "default",
|
|
117
|
-
color: "#3DB8C5",
|
|
118
|
-
disabled: false,
|
|
119
|
-
event: "clickCreateChild"
|
|
120
|
-
},
|
|
121
117
|
canDelete: {
|
|
122
118
|
name: "删除",
|
|
123
119
|
type: "canDelete",
|
|
124
120
|
btnType: "errorText",
|
|
125
|
-
icon: "
|
|
121
|
+
icon: "md-trash",
|
|
126
122
|
size: "small",
|
|
127
123
|
color: "#E83636",
|
|
128
124
|
disabled: false,
|
|
129
125
|
event: "clickDelete"
|
|
130
|
-
},
|
|
131
|
-
canDeleteChilds: {
|
|
132
|
-
name: "删除所有子级",
|
|
133
|
-
type: "canDeleteChilds",
|
|
134
|
-
btnType: "errorText",
|
|
135
|
-
icon: "ios-trash-outline",
|
|
136
|
-
size: "small",
|
|
137
|
-
color: "#E83636",
|
|
138
|
-
disabled: false,
|
|
139
|
-
event: "clickDeleteChilds"
|
|
140
126
|
}
|
|
141
127
|
},
|
|
142
128
|
otherOperationMap: {
|
|
143
|
-
|
|
129
|
+
canChangeVal: {
|
|
144
130
|
name: "改变输入框值",
|
|
145
|
-
type: "
|
|
131
|
+
type: "canChangeVal",
|
|
146
132
|
event: "changeVal"
|
|
147
133
|
}
|
|
148
134
|
},
|
|
@@ -231,15 +217,15 @@ export default {
|
|
|
231
217
|
|
|
232
218
|
_showRequired: true, // 表头显示校验符号*
|
|
233
219
|
_showDescription: true, // 表头显示提示
|
|
220
|
+
_contentHeight: 500, // 表格最大高度
|
|
234
221
|
_headHeightAuto: false, // 表头高度自适应
|
|
235
222
|
_heightAuto: false, // 单元格高度自适应
|
|
236
223
|
_useSelection: false, // 使用选择列 -配置端暂时用不到
|
|
237
224
|
_useIndex: true, // 使用序号列
|
|
238
225
|
_useSummary: false, // 使用汇总行
|
|
239
|
-
_mergeRowColKeys: [], // 合并行的列
|
|
240
226
|
|
|
241
227
|
_disabledBtns: false, // 禁用增删按钮
|
|
242
|
-
_showCreateBtnColKeys: [], //
|
|
228
|
+
_showCreateBtnColKeys: [], // 显示增删图标的列
|
|
243
229
|
_disabledFootCreateBtn: false, // 禁用底部新增按钮
|
|
244
230
|
_disabledDeleteDftRow: false, // 默认的数据行禁止删除
|
|
245
231
|
_disabledDeleteOldRow: false, // 保存的数据行禁止删除
|
|
@@ -271,9 +257,9 @@ export default {
|
|
|
271
257
|
list: [],
|
|
272
258
|
tree: []
|
|
273
259
|
},
|
|
260
|
+
...(this.selfBasePropsObj || {}),
|
|
274
261
|
|
|
275
|
-
...this.propsObj
|
|
276
|
-
_contentHeight: this.propsObj._contentHeight || 500 // 表格最大高度
|
|
262
|
+
...this.propsObj
|
|
277
263
|
};
|
|
278
264
|
},
|
|
279
265
|
selfPropsObj () {
|
|
@@ -297,7 +283,7 @@ export default {
|
|
|
297
283
|
},
|
|
298
284
|
|
|
299
285
|
contentHeight () {
|
|
300
|
-
return this.selfPropsObj._contentHeight;
|
|
286
|
+
return this.selfPropsObj._contentHeight || 500;
|
|
301
287
|
},
|
|
302
288
|
showRequired () {
|
|
303
289
|
return this.selfPropsObj._showRequired;
|
|
@@ -320,15 +306,12 @@ export default {
|
|
|
320
306
|
useSummary () {
|
|
321
307
|
return this.selfPropsObj._useSummary;
|
|
322
308
|
},
|
|
323
|
-
mergeRowColKeys () {
|
|
324
|
-
return this.selfPropsObj._mergeRowColKeys || []; // 配置端有问题,高级以依赖时候值成undefined了
|
|
325
|
-
},
|
|
326
309
|
|
|
327
310
|
disabledBtns () {
|
|
328
311
|
return this.isDftSet ? false : this.selfPropsObj._disabledBtns;
|
|
329
312
|
},
|
|
330
313
|
showCreateBtnColKeys () {
|
|
331
|
-
return this.selfPropsObj._showCreateBtnColKeys || []; //
|
|
314
|
+
return this.selfPropsObj._showCreateBtnColKeys || []; // 配置端有问题,高级依赖时值成undefined了
|
|
332
315
|
},
|
|
333
316
|
disabledFootCreateBtn () {
|
|
334
317
|
return this.isDftSet ? false : this.selfPropsObj._disabledFootCreateBtn;
|
|
@@ -344,13 +327,13 @@ export default {
|
|
|
344
327
|
return this.isDftSet ? false : this.selfPropsObj._dftReadonly;
|
|
345
328
|
},
|
|
346
329
|
dftReadonlyColKeys () {
|
|
347
|
-
return this.isDftSet ? [] : this.selfPropsObj._dftReadonlyColKeys || []; //
|
|
330
|
+
return this.isDftSet ? [] : this.selfPropsObj._dftReadonlyColKeys || []; // 配置端有问题,高级依赖时值成undefined了
|
|
348
331
|
},
|
|
349
332
|
oldReadonly () {
|
|
350
333
|
return this.isDftSet ? false : this.selfPropsObj._oldReadonly;
|
|
351
334
|
},
|
|
352
335
|
oldReadonlyColKeys () {
|
|
353
|
-
return this.isDftSet ? [] : this.selfPropsObj._oldReadonlyColKeys || []; //
|
|
336
|
+
return this.isDftSet ? [] : this.selfPropsObj._oldReadonlyColKeys || []; // 配置端有问题,高级依赖时值成undefined了
|
|
354
337
|
},
|
|
355
338
|
|
|
356
339
|
searchLabelWidth () {
|
|
@@ -444,14 +427,14 @@ export default {
|
|
|
444
427
|
parentDataId () {
|
|
445
428
|
return this.parentObj._id;
|
|
446
429
|
},
|
|
447
|
-
|
|
430
|
+
selfRowDft () {
|
|
448
431
|
return this.selfColumns.reduce((obj, column) => {
|
|
449
432
|
const dftInRowVal = this.rowDefault[column._key];
|
|
450
433
|
const dftVal = column._default;
|
|
451
434
|
const initDftVal = this.initDftValMap[column._type];
|
|
452
435
|
|
|
453
436
|
return Object.assign(obj, {
|
|
454
|
-
[column._key]: dftInRowVal
|
|
437
|
+
[column._key]: this.$isEmptyData(dftInRowVal)
|
|
455
438
|
? this.$isEmptyData(dftVal)
|
|
456
439
|
? initDftVal
|
|
457
440
|
: dftVal
|
|
@@ -473,9 +456,6 @@ export default {
|
|
|
473
456
|
selfColumns () {
|
|
474
457
|
return this.columns;
|
|
475
458
|
},
|
|
476
|
-
mergeRowColumns () {
|
|
477
|
-
return this.selfColumns.filter(colItem => this.mergeRowColKeys.includes(colItem._key));
|
|
478
|
-
},
|
|
479
459
|
filterColumns () {
|
|
480
460
|
return this.selfColumns.filter(colItem => this.$isAdvRelyShow(colItem, this.allListData, this.parentObj, true));
|
|
481
461
|
},
|
|
@@ -516,25 +496,14 @@ export default {
|
|
|
516
496
|
_key: "__operation__",
|
|
517
497
|
key: "__operation__",
|
|
518
498
|
field: "__operation__",
|
|
499
|
+
_align: "center",
|
|
519
500
|
align: "center",
|
|
501
|
+
_fixed: "right",
|
|
520
502
|
fixed: "right",
|
|
503
|
+
_width: 100,
|
|
521
504
|
width: 100,
|
|
522
505
|
renderBodyCell: ({ row, rowIndex, column }, h) => {
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
return h("dsh-buttons", {
|
|
526
|
-
props: {
|
|
527
|
-
list: operationList.map(btnItem => ({
|
|
528
|
-
...btnItem,
|
|
529
|
-
disabled: !this.getRowBtnCanEdit(row, rowIndex)
|
|
530
|
-
}))
|
|
531
|
-
},
|
|
532
|
-
on: {
|
|
533
|
-
click: (operationItem) => {
|
|
534
|
-
this.$dispatchEvent(operationItem, row, rowIndex);
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
});
|
|
506
|
+
return this.operationTdCellRender(h, { row, rowIndex, column });
|
|
538
507
|
}
|
|
539
508
|
};
|
|
540
509
|
},
|
|
@@ -551,89 +520,14 @@ export default {
|
|
|
551
520
|
columnHiddenOption: {
|
|
552
521
|
defaultHiddenColumnKeys: [...this.hideColKeys] // 必须这么写,不解构,切换一次隐藏/显示后,hideColKeys会变成空数组
|
|
553
522
|
},
|
|
554
|
-
cellStyleOption:
|
|
523
|
+
cellStyleOption: {
|
|
524
|
+
bodyCellClass: this.bodyCellClass
|
|
525
|
+
},
|
|
555
526
|
cellSpanOption: {
|
|
556
|
-
bodyCellSpan:
|
|
557
|
-
// 合并单元格(单元格值为空时不合并)
|
|
558
|
-
if (this.mergeRowColKeys.includes(column._key)) {
|
|
559
|
-
if (this.$isEmptyData(row[column._key])) {
|
|
560
|
-
return {
|
|
561
|
-
rowspan: 1,
|
|
562
|
-
colspan: 1
|
|
563
|
-
};
|
|
564
|
-
}
|
|
565
|
-
else {
|
|
566
|
-
if (
|
|
567
|
-
rowIndex !== 0 &&
|
|
568
|
-
row[column._key] === this.showListData[rowIndex - 1][column._key]
|
|
569
|
-
) {
|
|
570
|
-
return {
|
|
571
|
-
rowspan: 0,
|
|
572
|
-
colspan: 0
|
|
573
|
-
};
|
|
574
|
-
} else {
|
|
575
|
-
const newList = this.showListData.slice(rowIndex);
|
|
576
|
-
const newIndex = newList.findIndex(rowItem => row[column._key] !== rowItem[column._key]);
|
|
577
|
-
return {
|
|
578
|
-
rowspan: newIndex === -1 ? newList.length : newIndex,
|
|
579
|
-
colspan: 1
|
|
580
|
-
};
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
}
|
|
527
|
+
bodyCellSpan: this.bodyCellSpan
|
|
585
528
|
},
|
|
586
529
|
eventCustomOption: {
|
|
587
|
-
bodyCellEvents:
|
|
588
|
-
return {
|
|
589
|
-
click: (event) => {
|
|
590
|
-
// console.log("click::", row, rowIndex, column, event);
|
|
591
|
-
},
|
|
592
|
-
dblclick: (event) => {
|
|
593
|
-
// console.log("dblclick::", row, rowIndex, column, event);
|
|
594
|
-
},
|
|
595
|
-
contextmenu: (event) => {
|
|
596
|
-
// console.log("contextmenu::", row, rowIndex, column, event);
|
|
597
|
-
},
|
|
598
|
-
mouseenter: (event) => {
|
|
599
|
-
this.$set(this.hoverRecordMap, `${row._id}dsh${column._key}`, true);
|
|
600
|
-
},
|
|
601
|
-
mouseleave: (event) => {
|
|
602
|
-
this.$set(this.hoverRecordMap, `${row._id}dsh${column._key}`, false);
|
|
603
|
-
}
|
|
604
|
-
};
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
};
|
|
608
|
-
},
|
|
609
|
-
cellStyleOption () {
|
|
610
|
-
return {
|
|
611
|
-
bodyCellClass: ({ row, rowIndex, column }) => {
|
|
612
|
-
return "bri-table-td" +
|
|
613
|
-
`${this.mergeRowColKeys.includes(column._key)
|
|
614
|
-
? " bri-table-td-merge"
|
|
615
|
-
: ""
|
|
616
|
-
}` +
|
|
617
|
-
`${this.getRowCanEdit(row, rowIndex)
|
|
618
|
-
? " bri-table-td-edit"
|
|
619
|
-
: ""
|
|
620
|
-
}` +
|
|
621
|
-
`${this.isSearching
|
|
622
|
-
? row.__isSearchShow__ === false
|
|
623
|
-
? " bri-table-td-hide"
|
|
624
|
-
: ""
|
|
625
|
-
: row.__isShow__ === true
|
|
626
|
-
? this.isExpandAction
|
|
627
|
-
? " bri-table-td-visible"
|
|
628
|
-
: ""
|
|
629
|
-
: " bri-table-td-hide"
|
|
630
|
-
}` +
|
|
631
|
-
`${["__isExpand__"].includes(column._key)
|
|
632
|
-
? " bri-table-td-expand"
|
|
633
|
-
: ["__index__"].includes(column._key)
|
|
634
|
-
? " bri-table-td-index"
|
|
635
|
-
: ""
|
|
636
|
-
}`;
|
|
530
|
+
bodyCellEvents: this.eventCustomOption
|
|
637
531
|
}
|
|
638
532
|
};
|
|
639
533
|
},
|
|
@@ -724,17 +618,12 @@ export default {
|
|
|
724
618
|
: this.baseOperationMap.canCreate.name
|
|
725
619
|
// disabled: !!this.disabledCreateBtn
|
|
726
620
|
},
|
|
727
|
-
canCreateChild: {
|
|
728
|
-
...this.baseOperationMap.canCreateChild,
|
|
729
|
-
name: this.showMode === "form"
|
|
730
|
-
? this.baseOperationMap.canCreateChild.name.replace("行", "条")
|
|
731
|
-
: this.baseOperationMap.canCreateChild.name
|
|
732
|
-
// disabled: !!this.disabledCreateBtn
|
|
733
|
-
},
|
|
734
621
|
canHideOrShow: {
|
|
735
622
|
...this.topOperationMap.canHideOrShow,
|
|
736
623
|
name: this.hideStatus ? "显示字段" : "隐藏字段"
|
|
737
|
-
}
|
|
624
|
+
},
|
|
625
|
+
|
|
626
|
+
...(this.selfAllOperationMap || {})
|
|
738
627
|
};
|
|
739
628
|
},
|
|
740
629
|
operationMap () {
|
|
@@ -818,6 +707,9 @@ export default {
|
|
|
818
707
|
this.$set(this.ruleRecordMap, `${row._id}dsh${col._key}`, { showRuleMessage: true });
|
|
819
708
|
this.change("changeVal", row, rowIndex, col, ...params);
|
|
820
709
|
},
|
|
710
|
+
change (eventType, row, rowIndex, col, ...params) {
|
|
711
|
+
this.$emit("change", this.tableDataObj, eventType, col, row, rowIndex, ...params);
|
|
712
|
+
},
|
|
821
713
|
|
|
822
714
|
/* ----------- 隐藏/显示字段 ---------- */
|
|
823
715
|
toggleHideOrShow () {
|
|
@@ -990,7 +882,7 @@ export default {
|
|
|
990
882
|
window.location.href = data.url;
|
|
991
883
|
} else if (data.status === "failed") {
|
|
992
884
|
this.$Message.info({
|
|
993
|
-
content: "
|
|
885
|
+
content: "操作失败,请稍后再试!"
|
|
994
886
|
});
|
|
995
887
|
}
|
|
996
888
|
},
|
|
@@ -1069,6 +961,7 @@ export default {
|
|
|
1069
961
|
"font-weight": "500"
|
|
1070
962
|
}
|
|
1071
963
|
}, this.selfLogicPropsObj._name + ":"),
|
|
964
|
+
|
|
1072
965
|
h("dsh-select", {
|
|
1073
966
|
style: {
|
|
1074
967
|
"margin-left": "8px",
|
|
@@ -1104,6 +997,24 @@ export default {
|
|
|
1104
997
|
}
|
|
1105
998
|
});
|
|
1106
999
|
},
|
|
1000
|
+
createBtnRender (h) {
|
|
1001
|
+
return !this.isSearching && this.disabledFootCreateBtn !== true
|
|
1002
|
+
? h("dsh-buttons", {
|
|
1003
|
+
style: {
|
|
1004
|
+
"margin-top": "3px"
|
|
1005
|
+
},
|
|
1006
|
+
props: {
|
|
1007
|
+
itemClass: undefined,
|
|
1008
|
+
list: this.$getOperationList(["canCreate"])
|
|
1009
|
+
},
|
|
1010
|
+
on: {
|
|
1011
|
+
click: (event) => {
|
|
1012
|
+
this.$dispatchEvent(event);
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
})
|
|
1016
|
+
: undefined;
|
|
1017
|
+
},
|
|
1107
1018
|
contentThCellRender (h, { column }) {
|
|
1108
1019
|
column = this.$transformDynamicProperty(column, undefined, this.parentObj);
|
|
1109
1020
|
|
|
@@ -1138,7 +1049,18 @@ export default {
|
|
|
1138
1049
|
props: {
|
|
1139
1050
|
canEdit: unitCanEdit,
|
|
1140
1051
|
formData: row,
|
|
1141
|
-
formItem:
|
|
1052
|
+
formItem: {
|
|
1053
|
+
...column,
|
|
1054
|
+
...(
|
|
1055
|
+
column.colType === "tree"
|
|
1056
|
+
? {
|
|
1057
|
+
_key: "name",
|
|
1058
|
+
_heightAuto: true,
|
|
1059
|
+
_placeholder: " "
|
|
1060
|
+
}
|
|
1061
|
+
: column
|
|
1062
|
+
)
|
|
1063
|
+
},
|
|
1142
1064
|
allFormList: this.selfColumns,
|
|
1143
1065
|
inTableType: this.inTableType,
|
|
1144
1066
|
allListRows: this.allListData,
|
|
@@ -1148,7 +1070,7 @@ export default {
|
|
|
1148
1070
|
},
|
|
1149
1071
|
on: {
|
|
1150
1072
|
blur: () => this.controlBlur(null, row, rowIndex, column, arguments),
|
|
1151
|
-
change: () => this.$dispatchEvent(this.operationMap.
|
|
1073
|
+
change: () => this.$dispatchEvent(this.operationMap.canChangeVal, row, rowIndex, column, arguments)
|
|
1152
1074
|
}
|
|
1153
1075
|
})
|
|
1154
1076
|
}
|
|
@@ -1157,7 +1079,18 @@ export default {
|
|
|
1157
1079
|
props: {
|
|
1158
1080
|
canEdit: unitCanEdit,
|
|
1159
1081
|
formData: row,
|
|
1160
|
-
formItem:
|
|
1082
|
+
formItem: {
|
|
1083
|
+
...column,
|
|
1084
|
+
...(
|
|
1085
|
+
column.colType === "tree"
|
|
1086
|
+
? {
|
|
1087
|
+
_key: "name",
|
|
1088
|
+
_heightAuto: true,
|
|
1089
|
+
_placeholder: " "
|
|
1090
|
+
}
|
|
1091
|
+
: column
|
|
1092
|
+
)
|
|
1093
|
+
},
|
|
1161
1094
|
allFormList: this.selfColumns,
|
|
1162
1095
|
inTableType: this.inTableType,
|
|
1163
1096
|
allListRows: this.allListData,
|
|
@@ -1167,7 +1100,7 @@ export default {
|
|
|
1167
1100
|
},
|
|
1168
1101
|
on: {
|
|
1169
1102
|
blur: () => this.controlBlur(null, row, rowIndex, column, arguments),
|
|
1170
|
-
change: () => this.$dispatchEvent(this.operationMap.
|
|
1103
|
+
change: () => this.$dispatchEvent(this.operationMap.canChangeVal, row, rowIndex, column, arguments)
|
|
1171
1104
|
}
|
|
1172
1105
|
}),
|
|
1173
1106
|
|
|
@@ -1179,34 +1112,38 @@ export default {
|
|
|
1179
1112
|
: undefined,
|
|
1180
1113
|
|
|
1181
1114
|
// 添加符
|
|
1182
|
-
...this.
|
|
1115
|
+
...this.operationIconRender(h, { row, rowIndex, column }, 12)
|
|
1183
1116
|
];
|
|
1184
1117
|
},
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1118
|
+
operationTdCellRender (h, { row, rowIndex, column }) {
|
|
1119
|
+
const operationList = this.$getOperationList(["canDelete"]).map(btnItem => ({
|
|
1120
|
+
...btnItem,
|
|
1121
|
+
disabled: !this.getRowDelBtnCanEdit(row, rowIndex)
|
|
1122
|
+
}));
|
|
1123
|
+
|
|
1124
|
+
return [
|
|
1125
|
+
h("dsh-buttons", {
|
|
1191
1126
|
props: {
|
|
1192
|
-
|
|
1193
|
-
list: this.$getOperationList(["canCreate"])
|
|
1127
|
+
list: operationList
|
|
1194
1128
|
},
|
|
1195
1129
|
on: {
|
|
1196
|
-
click: (
|
|
1197
|
-
this.$dispatchEvent(
|
|
1130
|
+
click: (operationItem) => {
|
|
1131
|
+
this.$dispatchEvent(operationItem, row, rowIndex);
|
|
1198
1132
|
}
|
|
1199
1133
|
}
|
|
1200
1134
|
})
|
|
1201
|
-
|
|
1135
|
+
];
|
|
1202
1136
|
},
|
|
1203
|
-
|
|
1137
|
+
operationIconRender (h, { row, rowIndex, column }, iconSize = 14) {
|
|
1138
|
+
const baseBool = !this.isSearching &&
|
|
1139
|
+
(this.showCreateBtnColKeys.length ? this.showCreateBtnColKeys.includes(column._key) : ["__index__", "__treeIndex__"].includes(column._key)) &&
|
|
1140
|
+
this.hoverRecordMap[`${row._id}`];
|
|
1141
|
+
// this.hoverRecordMap[`${row._id}dsh${column._key}`]
|
|
1142
|
+
|
|
1204
1143
|
return [
|
|
1205
|
-
//
|
|
1144
|
+
// 插入一行图标
|
|
1206
1145
|
(this.operationMap.canCreate && this.operationMap.canCreate.disabled !== true) &&
|
|
1207
|
-
|
|
1208
|
-
(column._key === "__index__" ? !this.showCreateBtnColKeys.length : this.showCreateBtnColKeys.includes(column._key)) &&
|
|
1209
|
-
this.hoverRecordMap[`${row._id}dsh${column._key}`]
|
|
1146
|
+
baseBool
|
|
1210
1147
|
? h("div", {
|
|
1211
1148
|
style: {
|
|
1212
1149
|
position: "absolute",
|
|
@@ -1215,6 +1152,7 @@ export default {
|
|
|
1215
1152
|
width: `${iconSize + 2}px`,
|
|
1216
1153
|
height: `${iconSize + 2}px`,
|
|
1217
1154
|
border: `1px solid ${this.appColor}`,
|
|
1155
|
+
borderRadius: "2px",
|
|
1218
1156
|
backgroundColor: "#ffffff",
|
|
1219
1157
|
lineHeight: `${iconSize - 2}px`,
|
|
1220
1158
|
cursor: "pointer",
|
|
@@ -1248,13 +1186,11 @@ export default {
|
|
|
1248
1186
|
])
|
|
1249
1187
|
: h("span", ""),
|
|
1250
1188
|
|
|
1251
|
-
//
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
this.hoverRecordMap[`${row._id}dsh${column._key}`] &&
|
|
1257
|
-
row.level < this.maxLevel
|
|
1189
|
+
// 添加一行下级图标
|
|
1190
|
+
(this.operationMap.canCreateChild && this.operationMap.canCreateChild.disabled !== true) &&
|
|
1191
|
+
baseBool &&
|
|
1192
|
+
row.level < this.maxLevel &&
|
|
1193
|
+
!["cascaderTable"].includes(this.inTableType) // 老版级联表格类型不要“添加下级”图标
|
|
1258
1194
|
? h("div", {
|
|
1259
1195
|
style: {
|
|
1260
1196
|
position: "absolute",
|
|
@@ -1264,6 +1200,7 @@ export default {
|
|
|
1264
1200
|
width: `${iconSize + 2}px`,
|
|
1265
1201
|
height: `${iconSize + 2}px`,
|
|
1266
1202
|
border: `1px solid ${this.appColor}`,
|
|
1203
|
+
borderRadius: "2px",
|
|
1267
1204
|
backgroundColor: "#ffffff",
|
|
1268
1205
|
lineHeight: `${iconSize - 2}px`,
|
|
1269
1206
|
cursor: "pointer",
|
|
@@ -1280,7 +1217,7 @@ export default {
|
|
|
1280
1217
|
}, [
|
|
1281
1218
|
h("Icon", {
|
|
1282
1219
|
style: {
|
|
1283
|
-
fontWeight: "
|
|
1220
|
+
fontWeight: "500",
|
|
1284
1221
|
color: this.appColor
|
|
1285
1222
|
},
|
|
1286
1223
|
props: {
|
|
@@ -1295,27 +1232,114 @@ export default {
|
|
|
1295
1232
|
})
|
|
1296
1233
|
])
|
|
1297
1234
|
])
|
|
1235
|
+
: h("span", ""),
|
|
1236
|
+
|
|
1237
|
+
// 删除该行图标
|
|
1238
|
+
(this.operationMap.canDelete && this.operationMap.canDelete.disabled !== true) &&
|
|
1239
|
+
baseBool &&
|
|
1240
|
+
this.getRowDelBtnCanEdit(row, rowIndex) &&
|
|
1241
|
+
["cascaderTable"].includes(this.inTableType)
|
|
1242
|
+
? h("div", {
|
|
1243
|
+
style: {
|
|
1244
|
+
position: "absolute",
|
|
1245
|
+
bottom: "0px",
|
|
1246
|
+
right: `${iconSize + 3}px`,
|
|
1247
|
+
width: `${iconSize + 2}px`,
|
|
1248
|
+
height: `${iconSize + 2}px`,
|
|
1249
|
+
border: `1px solid ${this.operationMap.canDelete.color}`,
|
|
1250
|
+
borderRadius: "2px",
|
|
1251
|
+
backgroundColor: "#ffffff",
|
|
1252
|
+
lineHeight: `${iconSize - 2}px`,
|
|
1253
|
+
cursor: "pointer",
|
|
1254
|
+
verticalAlign: "middle",
|
|
1255
|
+
transition: "color .2s ease-in-out,border-color .2s ease-in-out"
|
|
1256
|
+
}
|
|
1257
|
+
}, [
|
|
1258
|
+
h("Tooltip", {
|
|
1259
|
+
props: {
|
|
1260
|
+
content: "删除该行",
|
|
1261
|
+
maxWidth: "250",
|
|
1262
|
+
transfer: true
|
|
1263
|
+
}
|
|
1264
|
+
}, [
|
|
1265
|
+
h("Icon", {
|
|
1266
|
+
style: {
|
|
1267
|
+
fontWeight: "500",
|
|
1268
|
+
color: this.operationMap.canDelete.color
|
|
1269
|
+
},
|
|
1270
|
+
props: {
|
|
1271
|
+
type: this.operationMap.canDelete.icon,
|
|
1272
|
+
size: iconSize
|
|
1273
|
+
},
|
|
1274
|
+
on: {
|
|
1275
|
+
click: () => {
|
|
1276
|
+
this.$dispatchEvent(this.operationMap.canDelete, row, rowIndex, column);
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
})
|
|
1280
|
+
])
|
|
1281
|
+
])
|
|
1298
1282
|
: h("span", "")
|
|
1299
1283
|
];
|
|
1300
1284
|
},
|
|
1285
|
+
bodyCellClass ({ row, rowIndex, column }) {
|
|
1286
|
+
return "bri-table-td" +
|
|
1287
|
+
`${this.mergeRowColKeys && this.mergeRowColKeys.includes(column._key)
|
|
1288
|
+
? " bri-table-td-merge"
|
|
1289
|
+
: ""
|
|
1290
|
+
}` +
|
|
1291
|
+
`${["__isExpand__"].includes(column._key)
|
|
1292
|
+
? " bri-table-td-expand"
|
|
1293
|
+
: ["__treeIndex__"].includes(column._key)
|
|
1294
|
+
? " bri-table-td-treeIndex"
|
|
1295
|
+
: this.getRowCanEdit(row, rowIndex)
|
|
1296
|
+
? " bri-table-td-edit"
|
|
1297
|
+
: ""
|
|
1298
|
+
}` +
|
|
1299
|
+
`${this.isSearching
|
|
1300
|
+
? row.__isSearchShow__ === false
|
|
1301
|
+
? " bri-table-td-hide"
|
|
1302
|
+
: ""
|
|
1303
|
+
: row.__isShow__ === true
|
|
1304
|
+
? this.isExpandAction
|
|
1305
|
+
? " bri-table-td-visible"
|
|
1306
|
+
: ""
|
|
1307
|
+
: " bri-table-td-hide"
|
|
1308
|
+
}`;
|
|
1309
|
+
},
|
|
1310
|
+
eventCustomOption ({ row, rowIndex, column }) {
|
|
1311
|
+
return {
|
|
1312
|
+
click: (event) => {
|
|
1313
|
+
// console.log("click::", row, rowIndex, column, event);
|
|
1314
|
+
},
|
|
1315
|
+
dblclick: (event) => {
|
|
1316
|
+
// console.log("dblclick::", row, rowIndex, column, event);
|
|
1317
|
+
},
|
|
1318
|
+
contextmenu: (event) => {
|
|
1319
|
+
// console.log("contextmenu::", row, rowIndex, column, event);
|
|
1320
|
+
},
|
|
1321
|
+
mouseenter: (event) => {
|
|
1322
|
+
this.$set(this.hoverRecordMap, `${row._id}`, true);
|
|
1323
|
+
// this.$set(this.hoverRecordMap, `${row._id}dsh${column._key}`, true);
|
|
1324
|
+
},
|
|
1325
|
+
mouseleave: (event) => {
|
|
1326
|
+
this.$set(this.hoverRecordMap, `${row._id}`, false);
|
|
1327
|
+
// this.$set(this.hoverRecordMap, `${row._id}dsh${column._key}`, false);
|
|
1328
|
+
}
|
|
1329
|
+
};
|
|
1330
|
+
},
|
|
1301
1331
|
|
|
1302
1332
|
/* ----------- 方法 ---------- */
|
|
1303
1333
|
// 生成新的一行数据
|
|
1304
1334
|
getNewRowData (level, list) {
|
|
1305
1335
|
if (["cascaderTable"].includes(this.controlType)) {
|
|
1306
1336
|
return {
|
|
1307
|
-
...this.$deepCopy(this.
|
|
1337
|
+
...this.$deepCopy(this.selfRowDft),
|
|
1338
|
+
...(this.getRowOtherDft ? this.$deepCopy(this.getRowOtherDft(level, list)) : {}),
|
|
1308
1339
|
_id: this.$ObjectID().str,
|
|
1309
1340
|
level: level,
|
|
1310
1341
|
isLeaf: true,
|
|
1311
1342
|
children: [],
|
|
1312
|
-
...(
|
|
1313
|
-
["treeTable"].includes(this.inTableType)
|
|
1314
|
-
? {}
|
|
1315
|
-
: {
|
|
1316
|
-
name: `${this.$numToChinese(level)}级节点${list.length + 1}`
|
|
1317
|
-
}
|
|
1318
|
-
),
|
|
1319
1343
|
// __old__: false,
|
|
1320
1344
|
__isDefault__: this.isDftSet,
|
|
1321
1345
|
__isRendered__: true,
|
|
@@ -1326,7 +1350,7 @@ export default {
|
|
|
1326
1350
|
};
|
|
1327
1351
|
} else {
|
|
1328
1352
|
return {
|
|
1329
|
-
...this.$deepCopy(this.
|
|
1353
|
+
...this.$deepCopy(this.selfRowDft),
|
|
1330
1354
|
_id: this.$ObjectID().str,
|
|
1331
1355
|
// __old__: false,
|
|
1332
1356
|
__isDefault__: this.isDftSet,
|
|
@@ -1358,7 +1382,7 @@ export default {
|
|
|
1358
1382
|
return this.isDftSet ? false : row.__isDefault__;
|
|
1359
1383
|
},
|
|
1360
1384
|
// 行按钮是否可操作(删除按钮可编辑 不代表行内容是可编辑的)
|
|
1361
|
-
|
|
1385
|
+
getRowDelBtnCanEdit (row, rowIndex) {
|
|
1362
1386
|
return this.canEdit && // 是编辑状态
|
|
1363
1387
|
(this.disabledDeleteDftRow ? row.__isDefault__ !== true : true) && // 默认数据可删除
|
|
1364
1388
|
(this.disabledDeleteOldRow ? row.__old__ !== true : true) && // 老数据可删除
|
|
@@ -1406,18 +1430,9 @@ export default {
|
|
|
1406
1430
|
},
|
|
1407
1431
|
// 加工单元格对应的配置
|
|
1408
1432
|
getResetCol (row, rowIndex, col) {
|
|
1409
|
-
let resetMap = {
|
|
1410
|
-
select: {
|
|
1411
|
-
_optionKind: "dropdown"
|
|
1412
|
-
},
|
|
1413
|
-
checkbox: {
|
|
1414
|
-
_optionKind: "dropdown"
|
|
1415
|
-
}
|
|
1416
|
-
};
|
|
1417
1433
|
return {
|
|
1418
|
-
...col,
|
|
1419
|
-
...(resetMap[col._type] || {}),
|
|
1420
1434
|
// isShare: this.isShare,
|
|
1435
|
+
...col,
|
|
1421
1436
|
_heightAuto: this.heightAuto
|
|
1422
1437
|
};
|
|
1423
1438
|
},
|
|
@@ -1443,7 +1458,8 @@ export default {
|
|
|
1443
1458
|
(row.__isQuote__ ? !this.quoteReadonlyColKeys.includes(col._key) : true) && // 引用过来的数据是否可编辑
|
|
1444
1459
|
!["calculate"].includes(col._enterType) && // 计算的不可编辑
|
|
1445
1460
|
col._readonly !== true && // 只读
|
|
1446
|
-
col.canEdit !== false
|
|
1461
|
+
col.canEdit !== false && // 字段本身编辑权限 考虑为undefined时候
|
|
1462
|
+
(!this.getTypeColCanEdit || this.getTypeColCanEdit(row, rowIndex, col));
|
|
1447
1463
|
},
|
|
1448
1464
|
// 单元格最终编辑状态
|
|
1449
1465
|
getUnitCanEdit (row, rowIndex, col) {
|