bri-components 1.3.31 → 1.3.33
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 +2 -12
- package/src/components/controls/base/BriUpload/uploadList.vue +35 -31
- package/src/components/controls/base/DshCascader/components/cascaderSimple.vue +1 -2
- package/src/components/controls/senior/selectUsers/selectUsers.vue +16 -13
- package/src/components/form/DshDefaultSearch.vue +1 -2
- package/src/components/list/DshCascaderTable.vue +1 -1
- package/src/components/list/DshFlatTable.vue +2 -4
- package/src/components/list/DshTreeTable.vue +146 -98
- package/src/components/list/common/flatTableImportModal.vue +1 -9
- package/src/components/list/mixins/flatTableMixin.js +11 -6
- package/src/components/list/mixins/quoteListModal.vue +215 -0
- package/src/components/list/mixins/tableBaseMixin.js +173 -32
- package/src/styles/components/list/BriTable.less +4 -16
- package/src/styles/global/variables.less +3 -0
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import DshListUnit from "../../unit/DshListUnit.vue";
|
|
2
|
+
import quoteListModal from "./quoteListModal.vue";
|
|
2
3
|
|
|
3
4
|
export default {
|
|
4
5
|
mixins: [],
|
|
5
6
|
components: {
|
|
6
|
-
DshListUnit
|
|
7
|
+
DshListUnit,
|
|
8
|
+
quoteListModal
|
|
7
9
|
},
|
|
8
10
|
props: {
|
|
9
11
|
canEdit: {
|
|
@@ -38,15 +40,26 @@ export default {
|
|
|
38
40
|
},
|
|
39
41
|
data () {
|
|
40
42
|
return {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
initFlag: true,
|
|
44
|
+
showRuleMessage: false, // 进行全体校验
|
|
45
|
+
ruleRecordMap: {}, // 单元格是否发生校验的记录映射
|
|
43
46
|
|
|
44
|
-
|
|
45
|
-
|
|
47
|
+
dshRenderName: undefined,
|
|
48
|
+
showQuoteModal: false,
|
|
46
49
|
showImportModal: false,
|
|
47
|
-
|
|
50
|
+
exportTimer: null,
|
|
51
|
+
isEnlarge: false,
|
|
52
|
+
isEnlargeFlag: true, // 为重渲染膜态框内容而用
|
|
48
53
|
|
|
49
54
|
topOperationMap: {
|
|
55
|
+
canQuote: {
|
|
56
|
+
name: "引用",
|
|
57
|
+
type: "canQuote",
|
|
58
|
+
icon: "ios-copy",
|
|
59
|
+
size: "small",
|
|
60
|
+
btnType: "text",
|
|
61
|
+
event: "clickQuote"
|
|
62
|
+
},
|
|
50
63
|
canImport: {
|
|
51
64
|
name: "导入",
|
|
52
65
|
type: "canImport",
|
|
@@ -100,10 +113,31 @@ export default {
|
|
|
100
113
|
};
|
|
101
114
|
},
|
|
102
115
|
computed: {
|
|
116
|
+
dshRender () {
|
|
117
|
+
return this[this.dshRenderName];
|
|
118
|
+
},
|
|
119
|
+
parentDataId () {
|
|
120
|
+
return this.parentObj._id;
|
|
121
|
+
},
|
|
103
122
|
selfRowDefault () {
|
|
104
123
|
return this.$filterObj(this.filterColumns, this.rowDefault);
|
|
105
124
|
},
|
|
106
125
|
|
|
126
|
+
controlKey () {
|
|
127
|
+
return this.propsObj._key;
|
|
128
|
+
},
|
|
129
|
+
controlType () {
|
|
130
|
+
return this.propsObj._type;
|
|
131
|
+
},
|
|
132
|
+
controlName () {
|
|
133
|
+
return this.propsObj._name;
|
|
134
|
+
},
|
|
135
|
+
modKey () {
|
|
136
|
+
return this.propsObj.modKey;
|
|
137
|
+
},
|
|
138
|
+
screenKey () {
|
|
139
|
+
return this.propsObj.screenKey;
|
|
140
|
+
},
|
|
107
141
|
commonPropsObj () {
|
|
108
142
|
return {
|
|
109
143
|
// isShare: false, // 是否是分享页在用
|
|
@@ -120,6 +154,8 @@ export default {
|
|
|
120
154
|
_disabledOldDataRow: false, // 置灰老数据行包含删除
|
|
121
155
|
_isImport: false, // 导入
|
|
122
156
|
_isExport: false, // 导出
|
|
157
|
+
_isQuote: false, // 引用
|
|
158
|
+
_quoteListFields: [], // 引用列表的显示字段
|
|
123
159
|
...this.propsObj,
|
|
124
160
|
|
|
125
161
|
_contentHeight: this.propsObj._contentHeight || 500 // 表格最大高度
|
|
@@ -161,6 +197,12 @@ export default {
|
|
|
161
197
|
disabledOldDataRow () {
|
|
162
198
|
return this.selfPropsObj._disabledOldDataRow;
|
|
163
199
|
},
|
|
200
|
+
isQuote () {
|
|
201
|
+
return this.selfPropsObj._isQuote;
|
|
202
|
+
},
|
|
203
|
+
quoteListFields () {
|
|
204
|
+
return this.selfPropsObj._quoteListFields;
|
|
205
|
+
},
|
|
164
206
|
isImport () {
|
|
165
207
|
return this.selfPropsObj._isImport;
|
|
166
208
|
},
|
|
@@ -170,16 +212,32 @@ export default {
|
|
|
170
212
|
|
|
171
213
|
modalPropsObj () {
|
|
172
214
|
return {
|
|
173
|
-
title: this.
|
|
215
|
+
title: this.controlName,
|
|
174
216
|
fullscreen: true,
|
|
175
217
|
showSlotClose: false,
|
|
176
218
|
closable: true
|
|
177
219
|
};
|
|
178
220
|
},
|
|
221
|
+
quoteParams () {
|
|
222
|
+
return {
|
|
223
|
+
screenKey: this.screenKey,
|
|
224
|
+
fields: [...this.quoteListFields, this.controlKey, "createdAt"],
|
|
225
|
+
advSearch: {
|
|
226
|
+
logic: "and",
|
|
227
|
+
conditions: [
|
|
228
|
+
{
|
|
229
|
+
fieldKey: "_id",
|
|
230
|
+
fieldOperator: "ne",
|
|
231
|
+
fieldValue: [this.parentDataId]
|
|
232
|
+
}
|
|
233
|
+
]
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
},
|
|
179
237
|
importParams () {
|
|
180
238
|
return {
|
|
181
|
-
|
|
182
|
-
|
|
239
|
+
_id: this.parentDataId,
|
|
240
|
+
_key: this.controlKey
|
|
183
241
|
};
|
|
184
242
|
},
|
|
185
243
|
|
|
@@ -207,14 +265,15 @@ export default {
|
|
|
207
265
|
undefined,
|
|
208
266
|
this.canEdit
|
|
209
267
|
? [
|
|
210
|
-
"
|
|
268
|
+
...(this.isQuote ? ["canQuote"] : []),
|
|
211
269
|
...(this.isImport ? ["canImport"] : []),
|
|
212
270
|
...(this.isExport ? ["canExport"] : []),
|
|
271
|
+
"canEnlarge",
|
|
213
272
|
...(this.disabledBtns ? ["changeVal"] : this.baseOperationBtns)
|
|
214
273
|
]
|
|
215
274
|
: [
|
|
216
|
-
"
|
|
217
|
-
|
|
275
|
+
...(this.isExport ? ["canExport"] : []),
|
|
276
|
+
"canEnlarge"
|
|
218
277
|
]
|
|
219
278
|
);
|
|
220
279
|
}
|
|
@@ -222,7 +281,7 @@ export default {
|
|
|
222
281
|
watch: {
|
|
223
282
|
isEnlarge (bool) {
|
|
224
283
|
setTimeout(() => {
|
|
225
|
-
this.
|
|
284
|
+
this.isEnlargeFlag = bool;
|
|
226
285
|
}, 0);
|
|
227
286
|
}
|
|
228
287
|
},
|
|
@@ -234,10 +293,17 @@ export default {
|
|
|
234
293
|
|
|
235
294
|
return this.listData.every((row, rowIndex) => this.getRowRuleResult(row, rowIndex));
|
|
236
295
|
},
|
|
296
|
+
// 重置
|
|
297
|
+
reset () {
|
|
298
|
+
this.initFlag = true;
|
|
299
|
+
this.showRuleMessage = false;
|
|
300
|
+
this.ruleRecordMap = {};
|
|
301
|
+
},
|
|
237
302
|
|
|
238
|
-
//
|
|
239
|
-
|
|
240
|
-
this.
|
|
303
|
+
// 点击引用
|
|
304
|
+
clickQuote () {
|
|
305
|
+
this.dshRenderName = "quoteModalRender";
|
|
306
|
+
this.showQuoteModal = true;
|
|
241
307
|
},
|
|
242
308
|
// 点击导入
|
|
243
309
|
clickImport () {
|
|
@@ -247,10 +313,88 @@ export default {
|
|
|
247
313
|
clickExport (operationItem) {
|
|
248
314
|
this.handleExport(operationItem);
|
|
249
315
|
},
|
|
316
|
+
// 打开全屏模态框
|
|
317
|
+
clickEnlarge (operationItem) {
|
|
318
|
+
this.isEnlarge = true;
|
|
319
|
+
},
|
|
320
|
+
|
|
321
|
+
// 引用模态框渲染函数
|
|
322
|
+
quoteModalRender (h, params) {
|
|
323
|
+
return this.showQuoteModal
|
|
324
|
+
? h("quote-list-modal", {
|
|
325
|
+
props: {
|
|
326
|
+
value: this.showQuoteModal,
|
|
327
|
+
propsObj: this.propsObj,
|
|
328
|
+
listParams: this.quoteParams
|
|
329
|
+
},
|
|
330
|
+
on: {
|
|
331
|
+
input: bool => {
|
|
332
|
+
this.showQuoteModal = bool;
|
|
333
|
+
},
|
|
334
|
+
confirm: this.quoteCb
|
|
335
|
+
}
|
|
336
|
+
})
|
|
337
|
+
: undefined;
|
|
338
|
+
},
|
|
339
|
+
// 引用回调
|
|
340
|
+
quoteCb (dataObj) {
|
|
341
|
+
if (dataObj) {
|
|
342
|
+
const cb = () => {
|
|
343
|
+
this.$Message.success("引用成功!");
|
|
344
|
+
this.reset();
|
|
345
|
+
this.selfReset && this.selfReset();
|
|
250
346
|
|
|
251
|
-
|
|
347
|
+
if (["flatTable"].includes(this.controlType)) {
|
|
348
|
+
this.parentObj[this.controlKey] = {
|
|
349
|
+
...dataObj[this.controlKey],
|
|
350
|
+
list: dataObj[this.controlKey].list.map(item => ({
|
|
351
|
+
...item,
|
|
352
|
+
__readonly__: true
|
|
353
|
+
}))
|
|
354
|
+
};
|
|
355
|
+
} else if (["cascaderTable"].includes(this.controlType)) {
|
|
356
|
+
const transformData = (data = []) => {
|
|
357
|
+
const loop = (list = []) =>
|
|
358
|
+
list.map(item => ({
|
|
359
|
+
...item,
|
|
360
|
+
children: item.children && item.children.length ? loop(item.children) : item.children,
|
|
361
|
+
__readonly__: true
|
|
362
|
+
}));
|
|
363
|
+
|
|
364
|
+
return loop(data);
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
this.parentObj[this.controlKey] = {
|
|
368
|
+
...dataObj[this.controlKey],
|
|
369
|
+
tree: transformData(dataObj[this.controlKey].tree)
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
this.change("quote");
|
|
374
|
+
};
|
|
375
|
+
|
|
376
|
+
const isEmpty = this.$isEmptyData(dataObj[this.controlKey]) ||
|
|
377
|
+
(["flatTable"].includes(this.controlType)
|
|
378
|
+
? !dataObj[this.controlKey].list || !dataObj[this.controlKey].list.length
|
|
379
|
+
: ["cascaderTable"].includes(this.controlType)
|
|
380
|
+
? !dataObj[this.controlKey].tree || !dataObj[this.controlKey].tree.length
|
|
381
|
+
: false);
|
|
382
|
+
if (isEmpty) {
|
|
383
|
+
this.$Modal.confirm({
|
|
384
|
+
title: "提示",
|
|
385
|
+
content: "该数据下此内容为空,无法引用!",
|
|
386
|
+
onOk: () => { }
|
|
387
|
+
});
|
|
388
|
+
} else {
|
|
389
|
+
cb();
|
|
390
|
+
}
|
|
391
|
+
} else {
|
|
392
|
+
this.$Message.error("未选择引用数据!");
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
// 导入回调
|
|
252
396
|
importCb (data) {
|
|
253
|
-
this.parentObj[this.
|
|
397
|
+
this.parentObj[this.controlKey] = data;
|
|
254
398
|
this.change("import");
|
|
255
399
|
},
|
|
256
400
|
// 接口 -导出
|
|
@@ -260,19 +404,16 @@ export default {
|
|
|
260
404
|
this.$https({
|
|
261
405
|
url: {
|
|
262
406
|
module: "sheet",
|
|
263
|
-
name: this.
|
|
264
|
-
params: {
|
|
265
|
-
modKey: this.propsObj.modKey
|
|
266
|
-
}
|
|
407
|
+
name: ["flatTable"].includes(this.controlType) ? "exportFlatTableExcel" : "exportCascaderTableExcel"
|
|
267
408
|
},
|
|
268
409
|
params: {
|
|
269
|
-
screenKey: this.
|
|
270
|
-
|
|
271
|
-
|
|
410
|
+
screenKey: this.screenKey,
|
|
411
|
+
_id: this.parentObj._id,
|
|
412
|
+
_key: this.controlKey
|
|
272
413
|
},
|
|
273
414
|
callback: data => {
|
|
274
415
|
this.getJobStatus(operationItem, data.jobId, data.excel_url);
|
|
275
|
-
this.
|
|
416
|
+
this.exportTimer = setInterval(() => {
|
|
276
417
|
this.getJobStatus(operationItem, data.jobId, data.excel_url);
|
|
277
418
|
}, 1000);
|
|
278
419
|
}
|
|
@@ -290,7 +431,7 @@ export default {
|
|
|
290
431
|
},
|
|
291
432
|
callback: data => {
|
|
292
433
|
operationItem.disabled = false;
|
|
293
|
-
clearInterval(this.
|
|
434
|
+
clearInterval(this.exportTimer);
|
|
294
435
|
|
|
295
436
|
if (data.status === "completed") {
|
|
296
437
|
window.location.href = data.url;
|
|
@@ -302,7 +443,7 @@ export default {
|
|
|
302
443
|
},
|
|
303
444
|
error: data => {
|
|
304
445
|
operationItem.disabled = false;
|
|
305
|
-
this.
|
|
446
|
+
this.exportTimer = null;
|
|
306
447
|
}
|
|
307
448
|
});
|
|
308
449
|
},
|
|
@@ -324,12 +465,12 @@ export default {
|
|
|
324
465
|
}
|
|
325
466
|
},
|
|
326
467
|
getRowCanEdit (row) {
|
|
327
|
-
return this.canEdit &&
|
|
328
|
-
this.disabledOldDataRow ?
|
|
468
|
+
return this.canEdit && // 是编辑状态
|
|
469
|
+
(this.disabledOldDataRow ? !row.__old__ : true) && // 老数据行不置灰/置灰时是新增数据
|
|
470
|
+
!row.__readonly__; // 不能为只读数据
|
|
329
471
|
},
|
|
330
472
|
getColCanEdit (col, row) {
|
|
331
|
-
return (col.
|
|
332
|
-
(row.__old__ ? col._oldCanEdit : true) && // 在老数据行不可编辑(除_oldCanEdit=true的外)
|
|
473
|
+
return (col._oldReadonly ? !row.__old__ : true) && // 老数据行里某些列不可编辑
|
|
333
474
|
(["number"].includes(col._type) && ![undefined, null, "", "no"].includes(col._summaryType) ? row.isLeaf !== false : true) && // 级联表格 -“需要计的数字列 且 不是叶子行的”不可编辑(必须用isLeaf !== false判断,因为牵扯内部表格也在用)
|
|
334
475
|
col._enterType !== "calculate" && // 计算的不可编辑
|
|
335
476
|
col._readonly !== true; // 不能为只读
|
|
@@ -151,8 +151,9 @@
|
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
&-show {
|
|
155
|
-
|
|
154
|
+
&-show { // 级联表格会生效 自己写的table
|
|
155
|
+
height: 40px;
|
|
156
|
+
padding: 4px 16px;
|
|
156
157
|
}
|
|
157
158
|
&-edit {
|
|
158
159
|
padding: 4px 16px 12px 16px!important;
|
|
@@ -161,7 +162,7 @@
|
|
|
161
162
|
&-visible {
|
|
162
163
|
@keyframes slideDown {
|
|
163
164
|
from {
|
|
164
|
-
top: -
|
|
165
|
+
top: -49px;
|
|
165
166
|
opacity: 0.9;
|
|
166
167
|
}
|
|
167
168
|
|
|
@@ -174,20 +175,7 @@
|
|
|
174
175
|
animation: slideDown .2s linear;
|
|
175
176
|
}
|
|
176
177
|
&-hide {
|
|
177
|
-
// @keyframes slideDown2 {
|
|
178
|
-
// from {
|
|
179
|
-
// top: 0px;
|
|
180
|
-
// opacity: 1;
|
|
181
|
-
// }
|
|
182
|
-
|
|
183
|
-
// to {
|
|
184
|
-
// top: -40px;
|
|
185
|
-
// opacity: 0.9;
|
|
186
|
-
// }
|
|
187
|
-
// }
|
|
188
|
-
|
|
189
178
|
display: none!important;
|
|
190
|
-
// animation: slideDown2 .2s linear;
|
|
191
179
|
}
|
|
192
180
|
|
|
193
181
|
&-index {
|