bri-components 1.3.90 → 1.3.91
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 +1 -1
- package/src/components/controls/base/BriUpload/uploadList.vue +0 -1
- package/src/components/controls/base/DshCascader/DshCascader.vue +2 -2
- package/src/components/controls/base/DshInput/DshInput.vue +1 -1
- package/src/components/controls/base/DshSelect/DshCheckbox.vue +1 -1
- package/src/components/controls/base/DshSelect/DshSelect.vue +1 -1
- package/src/components/controls/base/DshSwitch/DshSwitch.vue +1 -1
- package/src/components/controls/mixins/controlMixin.js +1 -1
- package/src/components/controls/senior/cascaderTable.vue +1 -1
- package/src/components/controls/senior/flatTable.vue +1 -1
- package/src/components/form/DshForm.vue +1 -1
- package/src/components/list/BriTable.vue +1 -1
- package/src/components/list/DshBox/DshTable.vue +1 -1
- package/src/components/list/mixins/DshCascaderTableMixin.js +1 -1
- package/src/components/list/mixins/DshFlatTableMixin.js +18 -9
- package/src/components/list/mixins/DshTreeTableMixin.js +3 -3
- package/src/components/list/mixins/tableBaseMixin.js +32 -25
- package/src/components/unit/unitMixin.js +1 -1
- package/src/utils/table.js +3 -3
package/package.json
CHANGED
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
selfPropsObj () {
|
|
143
143
|
return {
|
|
144
144
|
_fileType: "file",
|
|
145
|
-
_showMode: this.isHeightAuto ? "old" : "inline", // 宽度为100
|
|
145
|
+
_showMode: this.isHeightAuto ? "old" : "inline", // 宽度为100%、且不在表格字段里的 显示老版
|
|
146
146
|
|
|
147
147
|
_multiple: true,
|
|
148
148
|
_useType: "drag",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
>
|
|
30
30
|
<!-- 有值 -->
|
|
31
31
|
<template v-if="!$isEmptyData(curValList)">
|
|
32
|
-
<!-- 高度自由时
|
|
32
|
+
<!-- 高度自由时 单元格-表格字段内,详情页-独占一行宽度时 -->
|
|
33
33
|
<div
|
|
34
34
|
v-if="isHeightAuto"
|
|
35
35
|
:class="{
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
>
|
|
104
104
|
<!-- 有值 -->
|
|
105
105
|
<template v-if="!$isEmptyData(curValList)">
|
|
106
|
-
<!-- 高度自由时
|
|
106
|
+
<!-- 高度自由时 单元格-表格字段内,详情页-独占一行宽度时 -->
|
|
107
107
|
<dsh-tags
|
|
108
108
|
v-if="isHeightAuto"
|
|
109
109
|
:class="{
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
// 自定义表格事件,也可配置鼠标事件
|
|
123
123
|
eventCustomOption () {
|
|
124
124
|
return {
|
|
125
|
-
bodyCellEvents: ({ row,
|
|
125
|
+
bodyCellEvents: ({ row, rowIndex, column }) => {
|
|
126
126
|
return {
|
|
127
127
|
click: (event) => {
|
|
128
128
|
if (!["checkbox"].includes(column.type)) {
|
|
@@ -594,7 +594,7 @@ export default {
|
|
|
594
594
|
]);
|
|
595
595
|
};
|
|
596
596
|
},
|
|
597
|
-
// 表头单元格渲染函数 (无法共用contentColumns的renderHeaderCell
|
|
597
|
+
// 表头单元格渲染函数 (无法共用contentColumns的renderHeaderCell,因为级联老版表头的无renderHeaderCell)
|
|
598
598
|
getThRender (column, colIndex) {
|
|
599
599
|
column = this.$transformDynamicProperty(column, undefined, this.parentObj);
|
|
600
600
|
|
|
@@ -72,7 +72,7 @@ export default {
|
|
|
72
72
|
width: 76,
|
|
73
73
|
align: "center",
|
|
74
74
|
fixed: "left",
|
|
75
|
-
renderBodyCell: ({ row,
|
|
75
|
+
renderBodyCell: ({ row, rowIndex, column }, h) => {
|
|
76
76
|
return [
|
|
77
77
|
h("div", rowIndex + 1),
|
|
78
78
|
|
|
@@ -121,14 +121,23 @@ export default {
|
|
|
121
121
|
created () { },
|
|
122
122
|
methods: {
|
|
123
123
|
// 点击 -添加行
|
|
124
|
-
clickCreate (operationItem, row, rowIndex,
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
124
|
+
clickCreate (operationItem, row, rowIndex, col) {
|
|
125
|
+
// 处理单元格合并相关
|
|
126
|
+
let mergeRowData = {};
|
|
127
|
+
if (col && col._mergeRow) {
|
|
128
|
+
const newList = this.showListData.slice(rowIndex);
|
|
129
|
+
const newIndex = newList.findIndex(rowItem => row[col._key] !== rowItem[col._key]);
|
|
130
|
+
row = newList[newIndex - 1];
|
|
131
|
+
|
|
132
|
+
const curIndex = this.mergeRowColumns.findIndex(column => col._key === column._key);
|
|
133
|
+
mergeRowData = this.mergeRowColumns.reduce((obj, column, colIndex) => {
|
|
134
|
+
// 该列之前的合并列,要复制这一行对应列的值
|
|
135
|
+
return colIndex < curIndex
|
|
136
|
+
? Object.assign(obj, { [column._key]: row[column._key] })
|
|
137
|
+
: obj;
|
|
138
|
+
}, {});
|
|
139
|
+
}
|
|
140
|
+
|
|
132
141
|
const newRow = {
|
|
133
142
|
...this.$deepCopy(this.selfRowDefault),
|
|
134
143
|
...this.$deepCopy(mergeRowData),
|
|
@@ -85,7 +85,7 @@ export default {
|
|
|
85
85
|
defaultHiddenColumnKeys: [...this.hideColKeys] // 必须这么写,不解构,切换一次隐藏/显示后,hideColKeys会变成空数组
|
|
86
86
|
},
|
|
87
87
|
cellStyleOption: {
|
|
88
|
-
bodyCellClass: ({ row,
|
|
88
|
+
bodyCellClass: ({ row, rowIndex, column }) => {
|
|
89
89
|
return "bri-table-td" +
|
|
90
90
|
`${this.getRowCanEdit(row)
|
|
91
91
|
? " bri-table-td-edit"
|
|
@@ -135,7 +135,7 @@ export default {
|
|
|
135
135
|
width: 48,
|
|
136
136
|
align: "center",
|
|
137
137
|
fixed: "left",
|
|
138
|
-
renderBodyCell: ({ row,
|
|
138
|
+
renderBodyCell: ({ row, rowIndex, column }, h) => {
|
|
139
139
|
return this.isSearching && this.searchMode === "flat"
|
|
140
140
|
? h("span", "")
|
|
141
141
|
: row.children && row.children.length
|
|
@@ -170,7 +170,7 @@ export default {
|
|
|
170
170
|
width: 28 + 16 + (this.maxLevel - 1) * 38,
|
|
171
171
|
align: "left",
|
|
172
172
|
fixed: "left",
|
|
173
|
-
renderBodyCell: ({ row,
|
|
173
|
+
renderBodyCell: ({ row, rowIndex, column }, h) => {
|
|
174
174
|
return [
|
|
175
175
|
h("div", {
|
|
176
176
|
style: {
|
|
@@ -317,7 +317,7 @@ export default {
|
|
|
317
317
|
return this.selfPropsObj._searchLabelWidth;
|
|
318
318
|
},
|
|
319
319
|
searchList () {
|
|
320
|
-
return this.selfPropsObj._searchList
|
|
320
|
+
return this.selfPropsObj._searchList;
|
|
321
321
|
},
|
|
322
322
|
searchListMap () {
|
|
323
323
|
return this.$arrToMap(this.searchList, "_key");
|
|
@@ -447,38 +447,45 @@ export default {
|
|
|
447
447
|
}
|
|
448
448
|
},
|
|
449
449
|
cellSpanOption: {
|
|
450
|
-
bodyCellSpan: ({ row,
|
|
450
|
+
bodyCellSpan: ({ row, rowIndex, column }) => {
|
|
451
451
|
if (column._mergeRow === true) {
|
|
452
|
-
if (
|
|
453
|
-
rowIndex !== 0 &&
|
|
454
|
-
row[column._key] === this.showListData[rowIndex - 1][column._key]
|
|
455
|
-
) {
|
|
452
|
+
if (this.$isEmptyData(row[column._key])) {
|
|
456
453
|
return {
|
|
457
|
-
rowspan:
|
|
458
|
-
colspan: 0
|
|
459
|
-
};
|
|
460
|
-
} else {
|
|
461
|
-
const newList = this.showListData.slice(rowIndex);
|
|
462
|
-
const newIndex = newList.findIndex(rowItem => row[column._key] !== rowItem[column._key]);
|
|
463
|
-
return {
|
|
464
|
-
rowspan: newIndex === -1 ? newList.length : newIndex,
|
|
454
|
+
rowspan: 1,
|
|
465
455
|
colspan: 1
|
|
466
456
|
};
|
|
457
|
+
} else {
|
|
458
|
+
if (
|
|
459
|
+
rowIndex !== 0 &&
|
|
460
|
+
row[column._key] === this.showListData[rowIndex - 1][column._key]
|
|
461
|
+
) {
|
|
462
|
+
return {
|
|
463
|
+
rowspan: 0,
|
|
464
|
+
colspan: 0
|
|
465
|
+
};
|
|
466
|
+
} else {
|
|
467
|
+
const newList = this.showListData.slice(rowIndex);
|
|
468
|
+
const newIndex = newList.findIndex(rowItem => row[column._key] !== rowItem[column._key]);
|
|
469
|
+
return {
|
|
470
|
+
rowspan: newIndex === -1 ? newList.length : newIndex,
|
|
471
|
+
colspan: 1
|
|
472
|
+
};
|
|
473
|
+
}
|
|
467
474
|
}
|
|
468
475
|
}
|
|
469
476
|
}
|
|
470
477
|
},
|
|
471
478
|
eventCustomOption: {
|
|
472
|
-
bodyCellEvents: ({ row,
|
|
479
|
+
bodyCellEvents: ({ row, rowIndex, column }) => {
|
|
473
480
|
return {
|
|
474
481
|
click: (event) => {
|
|
475
|
-
// console.log("click::", row,
|
|
482
|
+
// console.log("click::", row, rowIndex, column, event);
|
|
476
483
|
},
|
|
477
484
|
dblclick: (event) => {
|
|
478
|
-
// console.log("dblclick::", row,
|
|
485
|
+
// console.log("dblclick::", row, rowIndex, column, event);
|
|
479
486
|
},
|
|
480
487
|
contextmenu: (event) => {
|
|
481
|
-
// console.log("contextmenu::", row,
|
|
488
|
+
// console.log("contextmenu::", row, rowIndex, column, event);
|
|
482
489
|
},
|
|
483
490
|
mouseenter: (event) => {
|
|
484
491
|
this.$set(this.hoverRecordMap, `${row._id}dsh${column._key}`, true);
|
|
@@ -642,7 +649,7 @@ export default {
|
|
|
642
649
|
list: operationList.map(btnItem => ({
|
|
643
650
|
...btnItem,
|
|
644
651
|
disabled: !this.getRowBtnCanEdit(row) ||
|
|
645
|
-
(this.disabledDeleteDftRow ? row
|
|
652
|
+
(this.disabledDeleteDftRow ? this.isDftRowDisabled(row) : false)
|
|
646
653
|
}))
|
|
647
654
|
},
|
|
648
655
|
on: {
|
|
@@ -1137,6 +1144,10 @@ export default {
|
|
|
1137
1144
|
!(this.$isEmptyData(row[col._key]) && this.$isEmptyData(oldRow[col._key])) &&
|
|
1138
1145
|
row[col._key] !== oldRow[col._key];
|
|
1139
1146
|
},
|
|
1147
|
+
// 是否禁止操作 在关于默认行方面
|
|
1148
|
+
isDftRowDisabled (row) {
|
|
1149
|
+
return this.controlKey === "_default" ? false : row.__isDefault__;
|
|
1150
|
+
},
|
|
1140
1151
|
// 整行校验结果
|
|
1141
1152
|
getRowRuleResult (row, rowIndex) {
|
|
1142
1153
|
return this.filterColumns.every(column => this.getColRuleResult(column, row, rowIndex).bool);
|
|
@@ -1187,16 +1198,12 @@ export default {
|
|
|
1187
1198
|
: true
|
|
1188
1199
|
: true
|
|
1189
1200
|
) &&
|
|
1190
|
-
!(["cascaderTable"].includes(this.controlType) && ["level", "children"].includes(col._key)) && //
|
|
1201
|
+
!(["cascaderTable"].includes(this.controlType) && ["level", "children"].includes(col._key)) && // 层级表格的固定字段不可编辑
|
|
1191
1202
|
(col._oldReadonly ? row.__old__ !== true : true) && // 老数据行里某些列不可编辑
|
|
1192
1203
|
(row.__isQuote__ ? !this.quoteDisabledColKeys.includes(col._key) : true) && // 引用过来的数据是否可编辑
|
|
1193
1204
|
!["calculate"].includes(col._enterType) && // 计算的不可编辑
|
|
1194
1205
|
col._readonly !== true && // 不能为只读
|
|
1195
|
-
(
|
|
1196
|
-
col._mergeRow === true
|
|
1197
|
-
? this.controlKey === "_default" || (col._canEditOnMergeRow === true && row.__isDefault__ !== true)
|
|
1198
|
-
: true
|
|
1199
|
-
) && // 合并单元格的且不配置"新增数据的可编辑"的不可编辑
|
|
1206
|
+
(!this.isDftRowDisabled(row) || col._readonlyOnDftRow !== true) && // 合并单元格的且不配置"新增数据的可编辑"的不可编辑
|
|
1200
1207
|
col.canEdit !== false; // 字段本身编辑权限 考虑为undefined时候
|
|
1201
1208
|
},
|
|
1202
1209
|
// 单元格最终编辑状态
|
package/src/utils/table.js
CHANGED
|
@@ -132,7 +132,7 @@ const transformToColumns = function (form, {
|
|
|
132
132
|
},
|
|
133
133
|
renderBodyCell: col._type
|
|
134
134
|
? col._type === "operation"
|
|
135
|
-
? ({ row,
|
|
135
|
+
? ({ row, rowIndex, column }, h) => {
|
|
136
136
|
return h("dsh-buttons", {
|
|
137
137
|
class: "bri-table-td-operation",
|
|
138
138
|
props: {
|
|
@@ -141,12 +141,12 @@ const transformToColumns = function (form, {
|
|
|
141
141
|
},
|
|
142
142
|
on: {
|
|
143
143
|
click: (operationItem) => {
|
|
144
|
-
this.$dispatchEvent(operationItem, { row,
|
|
144
|
+
this.$dispatchEvent(operationItem, { row, rowIndex, column });
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
});
|
|
148
148
|
}
|
|
149
|
-
: ({ row,
|
|
149
|
+
: ({ row, rowIndex, column }, h) => {
|
|
150
150
|
return h("dsh-list-unit", {
|
|
151
151
|
props: {
|
|
152
152
|
canEdit: false,
|