bri-components 1.4.10 → 1.4.12
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/lib/0.bri-components.min.js +1 -0
- package/lib/1.bri-components.min.js +1 -0
- package/lib/10.bri-components.min.js +1 -0
- package/lib/11.bri-components.min.js +1 -0
- package/lib/2.bri-components.min.js +1 -0
- package/lib/3.bri-components.min.js +1 -0
- package/lib/4.bri-components.min.js +1 -0
- package/lib/5.bri-components.min.js +1 -0
- package/lib/6.bri-components.min.js +1 -0
- package/lib/7.bri-components.min.js +1 -0
- package/lib/8.bri-components.min.js +1 -0
- package/lib/9.bri-components.min.js +1 -0
- package/lib/bri-components.min.js +90 -0
- package/package.json +1 -1
- package/src/components/controls/base/BriUpload/uploadList.vue +12 -3
- package/src/components/controls/base/DshNumber/DshNumber.vue +27 -2
- package/src/components/controls/mixins/controlMixin.js +103 -99
- package/src/components/controls/senior/flatTable.vue +0 -2
- package/src/components/list/DshCascaderTable.vue +14 -8
- package/src/components/list/DshFlatTable.vue +15 -25
- package/src/components/list/DshTreeTable.vue +13 -4
- package/src/components/list/mixins/DshCascaderTableMixin.js +10 -0
- package/src/components/list/mixins/DshFlatTableMixin.js +27 -29
- package/src/components/list/mixins/tableBaseMixin.js +13 -8
package/package.json
CHANGED
|
@@ -433,9 +433,18 @@
|
|
|
433
433
|
}
|
|
434
434
|
},
|
|
435
435
|
getBtns (fileItem) {
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
436
|
+
if (["image", "application/pdf", "text/plain"].some(type => fileItem.mimetype.includes(type)) ||
|
|
437
|
+
fileItem.mimetype.includes("wordprocessingml.document") ||
|
|
438
|
+
fileItem.mimetype.includes("application/msword") ||
|
|
439
|
+
fileItem.mimetype.includes("presentationml.presentation") ||
|
|
440
|
+
fileItem.mimetype.includes("application/vnd.ms-powerpoint") ||
|
|
441
|
+
fileItem.mimetype.includes("spreadsheetml.sheet"))
|
|
442
|
+
{
|
|
443
|
+
return undefined;
|
|
444
|
+
}
|
|
445
|
+
else {
|
|
446
|
+
["canDelete", "canEdit", "canDownload"];
|
|
447
|
+
}
|
|
439
448
|
}
|
|
440
449
|
}
|
|
441
450
|
};
|
|
@@ -32,7 +32,10 @@
|
|
|
32
32
|
<!-- 单元格的查看 进度条模式 -->
|
|
33
33
|
<div
|
|
34
34
|
v-if="selfPropsObj._showProgress"
|
|
35
|
-
class="
|
|
35
|
+
:class="{
|
|
36
|
+
'DshNumber-show': true,
|
|
37
|
+
[`DshNumber-show-${unitAlign}`]: true
|
|
38
|
+
}"
|
|
36
39
|
>
|
|
37
40
|
<Progress
|
|
38
41
|
:percent="progressNum"
|
|
@@ -198,13 +201,35 @@
|
|
|
198
201
|
align-items: center;
|
|
199
202
|
|
|
200
203
|
.ivu-progress-outer {
|
|
204
|
+
flex: 1;
|
|
201
205
|
padding-right: 0px;
|
|
202
206
|
margin-right: 0px;
|
|
203
207
|
}
|
|
204
208
|
|
|
205
209
|
.ivu-progress-text {
|
|
206
210
|
width: 55px;
|
|
207
|
-
|
|
211
|
+
min-width: 55px;
|
|
212
|
+
margin-left: 0px;
|
|
213
|
+
text-align: right;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
&-center {
|
|
218
|
+
.ivu-progress-show-info {
|
|
219
|
+
.ivu-progress-outer {}
|
|
220
|
+
|
|
221
|
+
.ivu-progress-text {
|
|
222
|
+
text-align: center;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
&-right {
|
|
227
|
+
.ivu-progress-show-info {
|
|
228
|
+
.ivu-progress-outer {}
|
|
229
|
+
|
|
230
|
+
.ivu-progress-text {
|
|
231
|
+
text-align: right;
|
|
232
|
+
}
|
|
208
233
|
}
|
|
209
234
|
}
|
|
210
235
|
}
|
|
@@ -72,75 +72,14 @@ export default {
|
|
|
72
72
|
};
|
|
73
73
|
},
|
|
74
74
|
computed: {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
get () {
|
|
78
|
-
// // 原选项变动了或选项动态改变时,过滤掉已不存在的选项值
|
|
79
|
-
// if (!this.isInTable) {
|
|
80
|
-
// if (["select"].includes(this.controlType)) {
|
|
81
|
-
// if (!this.$dataType(this.propsObj._filterFunc, "function")) {
|
|
82
|
-
// this.value[this.controlKey] = this.listData.some(item => item[this.saveKey] === this.value[this.controlKey])
|
|
83
|
-
// ? this.value[this.controlKey]
|
|
84
|
-
// : "";
|
|
85
|
-
// }
|
|
86
|
-
// }
|
|
87
|
-
// }
|
|
88
|
-
|
|
89
|
-
return this.value[this.controlKey];
|
|
90
|
-
},
|
|
91
|
-
set (val) {
|
|
92
|
-
// 修复文本框clear后值为undefined,后端无法更新保存数据bug
|
|
93
|
-
if (["select"].includes(this.controlType) && val === undefined) {
|
|
94
|
-
val = "";
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
this.$set(this.value, this.controlKey, val);
|
|
98
|
-
this.change();
|
|
99
|
-
}
|
|
75
|
+
typeInfoData () {
|
|
76
|
+
return this.$modFieldMap[this.controlType] || {};
|
|
100
77
|
},
|
|
101
|
-
// 值为[]类型用的
|
|
102
|
-
curValList: {
|
|
103
|
-
get () {
|
|
104
|
-
// // 原选项变动了或选项动态改变时,过滤掉已不存在的选项值
|
|
105
|
-
// if (!this.isInTable) {
|
|
106
|
-
// const valList = this.value[this.controlKey] || [];
|
|
107
|
-
// if ((["select"].includes(this.controlType) && this.multipleMode) || ["checkbox"].includes(this.controlType)) {
|
|
108
|
-
// this.value[this.controlKey] = valList.some(valKey => !this.listDataKeys.includes(valKey))
|
|
109
|
-
// ? valList.filter(valKey => this.listDataKeys.includes(valKey))
|
|
110
|
-
// : valList;
|
|
111
|
-
// }
|
|
112
|
-
// // else if (["region", "cascader"].includes(this.controlType)) {
|
|
113
|
-
// // this.value[this.controlKey] = this.$getTreeLinealDatas(valList, this.cascaderAllData, undefined, this.saveKey).length
|
|
114
|
-
// // ? valList
|
|
115
|
-
// // : [];
|
|
116
|
-
// // }
|
|
117
|
-
// // else if (["regions", "cascaders"].includes(this.controlType)) {
|
|
118
|
-
// // this.value[this.controlKey] = valList.filter(valListItem =>
|
|
119
|
-
// // this.$getTreeLinealDatas(valListItem, this.cascaderAllData, undefined, this.saveKey).length
|
|
120
|
-
// // );
|
|
121
|
-
// // }
|
|
122
|
-
// }
|
|
123
78
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
this.$set(this.value, this.controlKey, valList);
|
|
128
|
-
this.change();
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
emptyShowVal () {
|
|
132
|
-
return this.canEdit
|
|
133
|
-
? this.commonDealPropsObj._placeholder
|
|
134
|
-
: this.isUnitShow
|
|
135
|
-
? "--"
|
|
136
|
-
: "暂无内容";
|
|
137
|
-
},
|
|
138
|
-
showVal () {
|
|
139
|
-
return this.$isEmptyData(this.curVal)
|
|
140
|
-
? this.emptyShowVal
|
|
141
|
-
: this.curVal;
|
|
79
|
+
/* ----- 基本 ----- */
|
|
80
|
+
finalCanEdit () {
|
|
81
|
+
return this.canEdit && (this.propsObj.canEdit == undefined ? true : this.propsObj.canEdit);
|
|
142
82
|
},
|
|
143
|
-
|
|
144
83
|
controlKey () {
|
|
145
84
|
return this.propsObj._key;
|
|
146
85
|
},
|
|
@@ -156,19 +95,6 @@ export default {
|
|
|
156
95
|
controlName () {
|
|
157
96
|
return this.propsObj._name;
|
|
158
97
|
},
|
|
159
|
-
finalCanEdit () {
|
|
160
|
-
return this.canEdit && (this.propsObj.canEdit == undefined ? true : this.propsObj.canEdit);
|
|
161
|
-
},
|
|
162
|
-
// 是否为多选模式
|
|
163
|
-
multipleMode () {
|
|
164
|
-
return this.isOnDftSearch || this.isOnSearch
|
|
165
|
-
? true
|
|
166
|
-
: ["checkbox", "regions", "cascaders"].includes(this.controlType) || !!this.selfPropsObj._multiple;
|
|
167
|
-
},
|
|
168
|
-
// 是否为tag显示
|
|
169
|
-
tagShow () {
|
|
170
|
-
return ["users", "departments", "select", "checkbox", "regions", "cascaders", "switch", "labels", "refSelect"].includes(this.controlType);
|
|
171
|
-
},
|
|
172
98
|
commonDealPropsObj () {
|
|
173
99
|
const selectControlTypes = ["coordinates", "date", "switch", "select", "checkbox", "file", "region", "regions", "cascader", "cascaders", "users", "departments", "reference"];
|
|
174
100
|
return {
|
|
@@ -180,13 +106,29 @@ export default {
|
|
|
180
106
|
_disabled: this.propsObj._disabled || ["serialNumber"].includes(this.controlType) || !this.finalCanEdit
|
|
181
107
|
};
|
|
182
108
|
},
|
|
109
|
+
// 是否为多选模式
|
|
110
|
+
multipleMode () {
|
|
111
|
+
return this.isOnDftSearch || this.isOnSearch
|
|
112
|
+
? true
|
|
113
|
+
: ["checkbox", "regions", "cascaders"].includes(this.controlType) || !!this.selfPropsObj._multiple;
|
|
114
|
+
},
|
|
115
|
+
// 是否高度自由(在表格内且_heightAuto为true,2.详情页内且独占一行)
|
|
116
|
+
isHeightAuto () {
|
|
117
|
+
return this.isInTable
|
|
118
|
+
? !!this.propsObj._heightAuto
|
|
119
|
+
: this.isFullRow;
|
|
120
|
+
},
|
|
121
|
+
// 是否为tag显示
|
|
122
|
+
isTagShow () {
|
|
123
|
+
return ["users", "departments", "select", "checkbox", "regions", "cascaders", "switch", "labels", "refSelect"].includes(this.controlType);
|
|
124
|
+
},
|
|
183
125
|
commonClass () {
|
|
184
126
|
return {
|
|
185
127
|
"bri-control-edit": this.canEdit && this.finalCanEdit,
|
|
186
128
|
"bri-control-disabled": this.canEdit && !this.finalCanEdit,
|
|
187
129
|
"bri-control-unit": this.isUnitShow,
|
|
188
130
|
"bri-control-show": this.isDetailShow,
|
|
189
|
-
[`control-show-${this.showStatusMode}${this.
|
|
131
|
+
[`control-show-${this.showStatusMode}${this.isTagShow ? "-tag" : ""}`]: this.isDetailShow,
|
|
190
132
|
"dsh-ellipsis": this.isUnitShow,
|
|
191
133
|
"bri-control-nodata": this.$isEmptyData(this.curVal)
|
|
192
134
|
};
|
|
@@ -197,10 +139,12 @@ export default {
|
|
|
197
139
|
"bri-control-disabled": this.canEdit && !this.finalCanEdit,
|
|
198
140
|
"bri-control-unit": this.isUnitShow,
|
|
199
141
|
"bri-control-show": this.isDetailShow,
|
|
200
|
-
[`control-show-${this.showStatusMode}${this.
|
|
142
|
+
[`control-show-${this.showStatusMode}${this.isTagShow ? "-tag" : ""}`]: this.isDetailShow,
|
|
201
143
|
"bri-control-nodata": this.$isEmptyData(this.curVal)
|
|
202
144
|
};
|
|
203
145
|
},
|
|
146
|
+
|
|
147
|
+
/* ----- 表单相关 ----- */
|
|
204
148
|
clearable () {
|
|
205
149
|
return this.commonDealPropsObj._clearable;
|
|
206
150
|
},
|
|
@@ -208,18 +152,17 @@ export default {
|
|
|
208
152
|
isFullRow () {
|
|
209
153
|
return this.propsObj._span === 24 || !this.propsObj._span;
|
|
210
154
|
},
|
|
211
|
-
// 控件内容的高度自由(在表格内且_heightAuto为true,2.详情页内且独占一行)
|
|
212
|
-
isHeightAuto () {
|
|
213
|
-
return this.isInTable
|
|
214
|
-
? !!this.propsObj._heightAuto
|
|
215
|
-
: this.isFullRow;
|
|
216
|
-
},
|
|
217
155
|
// 查看页下的展示模式
|
|
218
156
|
showStatusMode () {
|
|
219
157
|
return this.propsObj.showStatusMode || "defaut"; // "default", "frame", "backdrop"
|
|
220
158
|
},
|
|
221
159
|
|
|
222
|
-
/*
|
|
160
|
+
/* ----- 单元格相关 ----- */
|
|
161
|
+
unitAlign () {
|
|
162
|
+
return this.propsObj._align || this.typeInfoData.align || "left"; // "left", "center", "right"
|
|
163
|
+
},
|
|
164
|
+
|
|
165
|
+
/* ----- 部分条件下 才使用的属性 ----- */
|
|
223
166
|
// isShare () {
|
|
224
167
|
// return !!this.propsObj.isShare;
|
|
225
168
|
// },
|
|
@@ -255,17 +198,8 @@ export default {
|
|
|
255
198
|
isDetailShow () {
|
|
256
199
|
return !this.isInTable && !this.canEdit;
|
|
257
200
|
},
|
|
258
|
-
// showAlign () {
|
|
259
|
-
// return !this.isUnitShow
|
|
260
|
-
// ? "flex-start"
|
|
261
|
-
// : this.propsObj._align === "right"
|
|
262
|
-
// ? "flex-end"
|
|
263
|
-
// : this.propsObj._align === "center"
|
|
264
|
-
// ? "center"
|
|
265
|
-
// : "flex-start";
|
|
266
|
-
// },
|
|
267
201
|
|
|
268
|
-
/* 部分控件下 才使用的属性 */
|
|
202
|
+
/* ----- 部分控件下 才使用的属性 ----- */
|
|
269
203
|
compKey () {
|
|
270
204
|
return this.propsObj.compKey;
|
|
271
205
|
},
|
|
@@ -285,7 +219,7 @@ export default {
|
|
|
285
219
|
return this.propsObj.allScreenKey;
|
|
286
220
|
},
|
|
287
221
|
|
|
288
|
-
/* 移动端在用 */
|
|
222
|
+
/* ----- 移动端在用 ----- */
|
|
289
223
|
// 只做校验而隐藏的的field框,所用的propsObj
|
|
290
224
|
ruleFieldPropsObj () {
|
|
291
225
|
return {
|
|
@@ -297,6 +231,76 @@ export default {
|
|
|
297
231
|
return this.$isEmptyData(this.curVal) && this.$isEmptyData(this.curValList)
|
|
298
232
|
? ""
|
|
299
233
|
: "有值";
|
|
234
|
+
},
|
|
235
|
+
|
|
236
|
+
/* ----- 值 ----- */
|
|
237
|
+
// 值为不是[]类型用的
|
|
238
|
+
curVal: {
|
|
239
|
+
get () {
|
|
240
|
+
// // 原选项变动了或选项动态改变时,过滤掉已不存在的选项值
|
|
241
|
+
// if (!this.isInTable) {
|
|
242
|
+
// if (["select"].includes(this.controlType)) {
|
|
243
|
+
// if (!this.$dataType(this.propsObj._filterFunc, "function")) {
|
|
244
|
+
// this.value[this.controlKey] = this.listData.some(item => item[this.saveKey] === this.value[this.controlKey])
|
|
245
|
+
// ? this.value[this.controlKey]
|
|
246
|
+
// : "";
|
|
247
|
+
// }
|
|
248
|
+
// }
|
|
249
|
+
// }
|
|
250
|
+
|
|
251
|
+
return this.value[this.controlKey];
|
|
252
|
+
},
|
|
253
|
+
set (val) {
|
|
254
|
+
// 修复文本框clear后值为undefined,后端无法更新保存数据bug
|
|
255
|
+
if (["select"].includes(this.controlType) && val === undefined) {
|
|
256
|
+
val = "";
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
this.$set(this.value, this.controlKey, val);
|
|
260
|
+
this.change();
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
// 值为[]类型用的
|
|
264
|
+
curValList: {
|
|
265
|
+
get () {
|
|
266
|
+
// // 原选项变动了或选项动态改变时,过滤掉已不存在的选项值
|
|
267
|
+
// if (!this.isInTable) {
|
|
268
|
+
// const valList = this.value[this.controlKey] || [];
|
|
269
|
+
// if ((["select"].includes(this.controlType) && this.multipleMode) || ["checkbox"].includes(this.controlType)) {
|
|
270
|
+
// this.value[this.controlKey] = valList.some(valKey => !this.listDataKeys.includes(valKey))
|
|
271
|
+
// ? valList.filter(valKey => this.listDataKeys.includes(valKey))
|
|
272
|
+
// : valList;
|
|
273
|
+
// }
|
|
274
|
+
// // else if (["region", "cascader"].includes(this.controlType)) {
|
|
275
|
+
// // this.value[this.controlKey] = this.$getTreeLinealDatas(valList, this.cascaderAllData, undefined, this.saveKey).length
|
|
276
|
+
// // ? valList
|
|
277
|
+
// // : [];
|
|
278
|
+
// // }
|
|
279
|
+
// // else if (["regions", "cascaders"].includes(this.controlType)) {
|
|
280
|
+
// // this.value[this.controlKey] = valList.filter(valListItem =>
|
|
281
|
+
// // this.$getTreeLinealDatas(valListItem, this.cascaderAllData, undefined, this.saveKey).length
|
|
282
|
+
// // );
|
|
283
|
+
// // }
|
|
284
|
+
// }
|
|
285
|
+
|
|
286
|
+
return this.value[this.controlKey] || [];
|
|
287
|
+
},
|
|
288
|
+
set (valList) {
|
|
289
|
+
this.$set(this.value, this.controlKey, valList);
|
|
290
|
+
this.change();
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
emptyShowVal () {
|
|
294
|
+
return this.canEdit
|
|
295
|
+
? this.commonDealPropsObj._placeholder
|
|
296
|
+
: this.isUnitShow
|
|
297
|
+
? "--"
|
|
298
|
+
: "暂无内容";
|
|
299
|
+
},
|
|
300
|
+
showVal () {
|
|
301
|
+
return this.$isEmptyData(this.curVal)
|
|
302
|
+
? this.emptyShowVal
|
|
303
|
+
: this.curVal;
|
|
300
304
|
}
|
|
301
305
|
},
|
|
302
306
|
methods: {
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
:tableDataObj="curVal"
|
|
23
23
|
:data="curVal.list"
|
|
24
24
|
:rowDefault="curVal.rowDefault"
|
|
25
|
-
:rowspanMap="curVal.rowspanMap"
|
|
26
25
|
:columns="subForm"
|
|
27
26
|
:propsObj="defaultPropsObj"
|
|
28
27
|
:allFormList="allFormList"
|
|
@@ -39,7 +38,6 @@
|
|
|
39
38
|
:tableDataObj="curVal"
|
|
40
39
|
:data="curVal.list"
|
|
41
40
|
:rowDefault="curVal.rowDefault"
|
|
42
|
-
:rowspanMap="curVal.rowspanMap"
|
|
43
41
|
:compareData="curVal.oldList"
|
|
44
42
|
:columns="subForm"
|
|
45
43
|
:propsObj="propsObj"
|
|
@@ -52,14 +52,8 @@
|
|
|
52
52
|
<!-- 搜索条件 -->
|
|
53
53
|
<dsh-render :render="topSearchRender"></dsh-render>
|
|
54
54
|
|
|
55
|
-
<div class="DshCasTable-main">
|
|
56
|
-
<div
|
|
57
|
-
class="DshCasTable-main-center"
|
|
58
|
-
:style="{
|
|
59
|
-
maxHeight: `${contentHeight}px`,
|
|
60
|
-
height: `${contentHeight}px`
|
|
61
|
-
}"
|
|
62
|
-
>
|
|
55
|
+
<div class="DshCasTable-fullscreen-inner-main DshCasTable-main">
|
|
56
|
+
<div class="DshCasTable-main-center">
|
|
63
57
|
<!-- 表头 -->
|
|
64
58
|
<dsh-render :render="tableHeadRender"></dsh-render>
|
|
65
59
|
|
|
@@ -67,6 +61,9 @@
|
|
|
67
61
|
<dsh-render :render="tableBodyRender"></dsh-render>
|
|
68
62
|
</div>
|
|
69
63
|
</div>
|
|
64
|
+
|
|
65
|
+
<!-- 添加行 -->
|
|
66
|
+
<dsh-render :render="createBtnRender"></dsh-render>
|
|
70
67
|
</div>
|
|
71
68
|
</dsh-modal>
|
|
72
69
|
</div>
|
|
@@ -147,7 +144,16 @@
|
|
|
147
144
|
|
|
148
145
|
&-fullscreen {
|
|
149
146
|
&-inner {
|
|
147
|
+
width: 100%;
|
|
148
|
+
height: 100%;
|
|
150
149
|
padding: 10px 20px;
|
|
150
|
+
display: flex;
|
|
151
|
+
flex-direction: column;
|
|
152
|
+
|
|
153
|
+
&-main {
|
|
154
|
+
flex: 1;
|
|
155
|
+
min-height: 0px;
|
|
156
|
+
}
|
|
151
157
|
}
|
|
152
158
|
}
|
|
153
159
|
}
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
@selectAll="changeSelect"
|
|
62
62
|
></bri-table>
|
|
63
63
|
<bri-table
|
|
64
|
-
v-show="showListData.length
|
|
64
|
+
v-show="!showListData.length || isSearching"
|
|
65
65
|
ref="briTable"
|
|
66
66
|
class="DshFlatTable-main"
|
|
67
67
|
:columns="showColumns"
|
|
@@ -71,16 +71,6 @@
|
|
|
71
71
|
@changeSelect="changeSelect"
|
|
72
72
|
@selectAll="changeSelect"
|
|
73
73
|
></bri-table>
|
|
74
|
-
<bri-table
|
|
75
|
-
v-show="!showListData.length"
|
|
76
|
-
class="DshFlatTable-main"
|
|
77
|
-
:columns="showColumns"
|
|
78
|
-
:data="showListData"
|
|
79
|
-
:footer-data="footerData"
|
|
80
|
-
:propsObj="tablePropsObj"
|
|
81
|
-
@changeSelect="changeSelect"
|
|
82
|
-
@selectAll="changeSelect"
|
|
83
|
-
></bri-table>
|
|
84
74
|
</template>
|
|
85
75
|
|
|
86
76
|
<!-- 添加行 -->
|
|
@@ -108,22 +98,22 @@
|
|
|
108
98
|
|
|
109
99
|
<!-- 表格 -->
|
|
110
100
|
<bri-table
|
|
111
|
-
v-show="showListData.length"
|
|
112
|
-
class="DshFlatTable-main"
|
|
101
|
+
v-show="showListData.length && !isSearching"
|
|
102
|
+
class="DshFlatTable-fullscreen-inner-main"
|
|
113
103
|
:columns="showColumns"
|
|
114
104
|
:data="renderedListData"
|
|
115
105
|
:footer-data="footerData"
|
|
116
|
-
:propsObj="
|
|
106
|
+
:propsObj="tableInModalPropsObj"
|
|
117
107
|
@changeSelect="changeSelect"
|
|
118
108
|
@selectAll="changeSelect"
|
|
119
109
|
></bri-table>
|
|
120
110
|
<bri-table
|
|
121
|
-
v-show="!showListData.length"
|
|
122
|
-
class="DshFlatTable-main"
|
|
111
|
+
v-show="!showListData.length || isSearching"
|
|
112
|
+
class="DshFlatTable-fullscreen-inner-main"
|
|
123
113
|
:columns="showColumns"
|
|
124
114
|
:data="showListData"
|
|
125
115
|
:footer-data="footerData"
|
|
126
|
-
:propsObj="
|
|
116
|
+
:propsObj="tableInModalPropsObj"
|
|
127
117
|
@changeSelect="changeSelect"
|
|
128
118
|
@selectAll="changeSelect"
|
|
129
119
|
></bri-table>
|
|
@@ -228,16 +218,16 @@
|
|
|
228
218
|
|
|
229
219
|
&-fullscreen {
|
|
230
220
|
&-inner {
|
|
221
|
+
width: 100%;
|
|
222
|
+
height: 100%;
|
|
231
223
|
padding: 10px 20px;
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
}
|
|
235
|
-
</style>
|
|
236
|
-
<style lang="less">
|
|
237
|
-
.DshFlatTable {
|
|
238
|
-
&-form {
|
|
239
|
-
.item {
|
|
224
|
+
display: flex;
|
|
225
|
+
flex-direction: column;
|
|
240
226
|
|
|
227
|
+
&-main {
|
|
228
|
+
flex: 1;
|
|
229
|
+
min-height: 0px;
|
|
230
|
+
}
|
|
241
231
|
}
|
|
242
232
|
}
|
|
243
233
|
}
|
|
@@ -58,21 +58,21 @@
|
|
|
58
58
|
<!-- 表格 -->
|
|
59
59
|
<bri-table
|
|
60
60
|
v-show="showListData.length"
|
|
61
|
-
class="DshTreeTable-main"
|
|
61
|
+
class="DshTreeTable-fullscreen-inner-main"
|
|
62
62
|
:columns="showColumns"
|
|
63
63
|
:data="renderedListData"
|
|
64
64
|
:footer-data="footerData"
|
|
65
|
-
:propsObj="
|
|
65
|
+
:propsObj="tableInModalPropsObj"
|
|
66
66
|
@changeSelect="changeSelect"
|
|
67
67
|
@selectAll="changeSelect"
|
|
68
68
|
></bri-table>
|
|
69
69
|
<bri-table
|
|
70
70
|
v-show="!showListData.length"
|
|
71
|
-
class="DshTreeTable-main"
|
|
71
|
+
class="DshTreeTable-fullscreen-inner-main"
|
|
72
72
|
:columns="showColumns"
|
|
73
73
|
:data="showListData"
|
|
74
74
|
:footer-data="footerData"
|
|
75
|
-
:propsObj="
|
|
75
|
+
:propsObj="tableInModalPropsObj"
|
|
76
76
|
@changeSelect="changeSelect"
|
|
77
77
|
@selectAll="changeSelect"
|
|
78
78
|
></bri-table>
|
|
@@ -117,7 +117,16 @@
|
|
|
117
117
|
|
|
118
118
|
&-fullscreen {
|
|
119
119
|
&-inner {
|
|
120
|
+
width: 100%;
|
|
121
|
+
height: 100%;
|
|
120
122
|
padding: 10px 20px;
|
|
123
|
+
display: flex;
|
|
124
|
+
flex-direction: column;
|
|
125
|
+
|
|
126
|
+
&-main {
|
|
127
|
+
flex: 1;
|
|
128
|
+
min-height: 0px;
|
|
129
|
+
}
|
|
121
130
|
}
|
|
122
131
|
}
|
|
123
132
|
}
|
|
@@ -73,6 +73,16 @@ export default {
|
|
|
73
73
|
// this.$set(treeFormItem, "canDelete", true);
|
|
74
74
|
});
|
|
75
75
|
},
|
|
76
|
+
// 点开模态框后处理 -表头跟着内容行滚动
|
|
77
|
+
dealingOpenModal () {
|
|
78
|
+
if (this.isEnlargeFlag) {
|
|
79
|
+
setTimeout(() => {
|
|
80
|
+
document.querySelector(".DshCasTable-fullscreen-inner-main .DshCasTable-main-center-list").addEventListener("scroll", (e) => {
|
|
81
|
+
document.querySelector(".DshCasTable-fullscreen-inner-main .DshCasTable-main-center-top").scrollLeft = e.srcElement.scrollLeft;
|
|
82
|
+
}, false);
|
|
83
|
+
}, 0);
|
|
84
|
+
}
|
|
85
|
+
},
|
|
76
86
|
|
|
77
87
|
/* ----------- 渲染函数(声明:为了代码更加规范清晰,return的是h相关的函数,则函数名get开头;return的是h的直接调用,函数名不要get开头)---------- */
|
|
78
88
|
// 表格表头渲染函数
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
mixins: [],
|
|
3
3
|
components: {},
|
|
4
|
-
props: {
|
|
5
|
-
rowspanMap: {
|
|
6
|
-
type: Object,
|
|
7
|
-
default () {
|
|
8
|
-
return {};
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
},
|
|
4
|
+
props: {},
|
|
12
5
|
data () {
|
|
13
6
|
return {};
|
|
14
7
|
},
|
|
15
8
|
computed: {
|
|
9
|
+
rowspanMap () {
|
|
10
|
+
return this.tableDataObj.rowspanMap || {};
|
|
11
|
+
},
|
|
16
12
|
selfBasePropsObj () {
|
|
17
13
|
return {
|
|
18
14
|
_mergeRowColKeys: [] // 合并行的列
|
|
@@ -126,33 +122,37 @@ export default {
|
|
|
126
122
|
if (this.mergeRowColKeys.length) {
|
|
127
123
|
this.$set(this.tableDataObj, "rowspanMap", this.tableDataObj.rowspanMap || {});
|
|
128
124
|
|
|
125
|
+
// TODO: 待删除
|
|
126
|
+
Object.entries(this.rowspanMap).forEach(arr => {
|
|
127
|
+
if (arr[0].includes("dsh")) {
|
|
128
|
+
this.rowspanMap[arr[0].split("dsh").join("--")] = this.rowspanMap[arr[1]];
|
|
129
|
+
delete this.rowspanMap[arr[0]];
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
|
|
129
133
|
this.allListData.forEach((rowItem, rowIndex) => {
|
|
130
134
|
this.mergeRowColKeys.forEach(colKey => {
|
|
131
135
|
const column = { _key: colKey };
|
|
132
136
|
|
|
133
|
-
//
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
// 清除rowspanMap里和默认行老_id相关的
|
|
143
|
-
delete this.rowspanMap[this.getMixKey({ _id: oldId }, column)];
|
|
144
|
-
}
|
|
145
|
-
else {
|
|
137
|
+
// 新增页 -行的_id被置换,rowspanMap也要相应置换,还要清除rowspanMap里和默认行老_id相关的
|
|
138
|
+
const oldId = this.idRecordMap[rowItem._id];
|
|
139
|
+
const oldRow = { ...rowItem, _id: oldId };
|
|
140
|
+
if (oldId && ![undefined, null].includes(this.rowspanMap[this.getMixKey(oldRow, column)])) {
|
|
141
|
+
this.rowspanMap[this.getMixKey(rowItem, column)] = this.getRealRowspan({ row: oldRow, rowIndex, column });
|
|
142
|
+
delete this.rowspanMap[this.getMixKey(oldRow, column)];
|
|
143
|
+
} else {
|
|
146
144
|
this.rowspanMap[this.getMixKey(rowItem, column)] = this.getRealRowspan({ row: rowItem, rowIndex, column });
|
|
147
145
|
}
|
|
148
146
|
});
|
|
149
147
|
});
|
|
150
148
|
|
|
151
|
-
// 清除rowspanMap
|
|
152
|
-
Object.
|
|
153
|
-
const
|
|
154
|
-
|
|
155
|
-
|
|
149
|
+
// 清除rowspanMap无用的(针对来回改mergeRowColKeys)
|
|
150
|
+
Object.entries(this.rowspanMap).forEach(arr => {
|
|
151
|
+
const keyArr = arr[0].split("--");
|
|
152
|
+
const id = keyArr[0];
|
|
153
|
+
const colKey = keyArr.slice(1).join("--");
|
|
154
|
+
if (!this.allListMap[id] || !this.mergeRowColKeys.includes(colKey)) {
|
|
155
|
+
delete this.rowspanMap[arr[0]];
|
|
156
156
|
}
|
|
157
157
|
});
|
|
158
158
|
}
|
|
@@ -312,9 +312,7 @@ export default {
|
|
|
312
312
|
getRealRowspan ({ row, rowIndex, column }) {
|
|
313
313
|
return ![undefined, null].includes(this.rowspanMap[this.getMixKey(row, column)])
|
|
314
314
|
? this.rowspanMap[this.getMixKey(row, column)]
|
|
315
|
-
:
|
|
316
|
-
? this.rowspanMap[this.getMixKey(row, column, false)]
|
|
317
|
-
: this.getRowspan({ row, rowIndex, column }, this.allListData);
|
|
315
|
+
: this.getRowspan({ row, rowIndex, column }, this.allListData);
|
|
318
316
|
},
|
|
319
317
|
// 计算rowspan
|
|
320
318
|
getRowspan ({ row, rowIndex, column }, list = this.showListData) {
|