bri-components 1.4.6 → 1.4.7
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 +2 -2
- package/src/components/controls/base/BriUpload/uploadList.vue +13 -4
- package/src/components/controls/base/DshInput/DshInput.vue +2 -1
- package/src/components/controls/mixins/controlMixin.js +3 -0
- package/src/components/controls/senior/flatTable.vue +3 -1
- package/src/components/controls/senior/selectUsers/selectUsers.vue +122 -78
- package/src/components/form/DshForm.vue +7 -7
- package/src/components/list/mixins/DshCascaderTableMixin.js +14 -6
- package/src/components/list/mixins/DshFlatTableMixin.js +246 -61
- package/src/components/list/mixins/tableBaseMixin.js +161 -117
- package/src/components/list/mixins/treeTableBaseMixin.js +6 -0
- package/src/components/small/DshTags.vue +8 -2
- package/src/components/unit/DshListUnit.vue +1 -0
- package/src/components/unit/unitMixin.js +3 -0
- package/src/styles/components/list/BriTable.less +43 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bri-components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.7",
|
|
4
4
|
"author": "dengshanghui",
|
|
5
5
|
"description": "a component lib for vue project",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"babel-preset-stage-2": "^6.22.0",
|
|
62
62
|
"babel-register": "^6.22.0",
|
|
63
63
|
"chalk": "^2.0.1",
|
|
64
|
-
"chromedriver": "^
|
|
64
|
+
"chromedriver": "^120.0.0",
|
|
65
65
|
"compression-webpack-plugin": "^1.1.12",
|
|
66
66
|
"copy-webpack-plugin": "^4.0.1",
|
|
67
67
|
"cross-spawn": "^5.0.1",
|
|
@@ -349,15 +349,22 @@
|
|
|
349
349
|
},
|
|
350
350
|
// 点击文件编辑
|
|
351
351
|
clickEdit (operationItem, fileItem) {
|
|
352
|
-
let
|
|
353
|
-
|
|
352
|
+
let fileName = fileItem.name;
|
|
353
|
+
const lastIndex = fileName.lastIndexOf(".");
|
|
354
|
+
const formate = fileName.substring(lastIndex);
|
|
355
|
+
fileName = fileName.substring(0, lastIndex);
|
|
354
356
|
|
|
355
357
|
this.$Modal.confirm({
|
|
356
358
|
title: "修改名称",
|
|
357
359
|
render: (h) => {
|
|
360
|
+
// // 第二种方式
|
|
361
|
+
// const lastIndex = fileName.lastIndexOf(".");
|
|
362
|
+
// const formate = fileName.substring(lastIndex);
|
|
363
|
+
|
|
358
364
|
return h("Input", {
|
|
359
365
|
props: {
|
|
360
|
-
value: fileItem.name.substring(0, lastIndex),
|
|
366
|
+
// value: fileItem.name.substring(0, lastIndex),
|
|
367
|
+
value: fileName,
|
|
361
368
|
autofocus: true,
|
|
362
369
|
placeholder: "请输入名称"
|
|
363
370
|
},
|
|
@@ -366,12 +373,14 @@
|
|
|
366
373
|
},
|
|
367
374
|
on: {
|
|
368
375
|
input: (val) => {
|
|
369
|
-
fileItem.name = val + formate;
|
|
376
|
+
// fileItem.name = val + formate;
|
|
377
|
+
fileName = val;
|
|
370
378
|
}
|
|
371
379
|
}
|
|
372
380
|
});
|
|
373
381
|
},
|
|
374
382
|
onOk: () => {
|
|
383
|
+
fileItem.name = fileName + formate;
|
|
375
384
|
this.$emit("editItemName", fileItem);
|
|
376
385
|
},
|
|
377
386
|
onCancel: () => {}
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
_showWordLimit: this.propsObj._showWordLimit || (!!this.propsObj._maxlength || this.propsObj._maxlength === 0),
|
|
148
148
|
_autosize: {
|
|
149
149
|
minRows: 2,
|
|
150
|
-
maxRows: this.isUnitUpdate ?
|
|
150
|
+
maxRows: this.isUnitUpdate ? 40 : 30
|
|
151
151
|
},
|
|
152
152
|
|
|
153
153
|
...this.propsObj,
|
|
@@ -192,6 +192,7 @@
|
|
|
192
192
|
// 参数event
|
|
193
193
|
onChange (event) {
|
|
194
194
|
this.changeStatus = true;
|
|
195
|
+
this.quickChange();
|
|
195
196
|
|
|
196
197
|
clearTimeout(this.timer);
|
|
197
198
|
this.timer = setTimeout(() => {
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
:tableDataObj="curVal"
|
|
23
23
|
:data="curVal.list"
|
|
24
24
|
:rowDefault="curVal.rowDefault"
|
|
25
|
+
:rowspanMap="curVal.rowspanMap"
|
|
25
26
|
:columns="subForm"
|
|
26
27
|
:propsObj="defaultPropsObj"
|
|
27
28
|
:allFormList="allFormList"
|
|
@@ -37,8 +38,9 @@
|
|
|
37
38
|
:canEdit="finalCanEdit"
|
|
38
39
|
:tableDataObj="curVal"
|
|
39
40
|
:data="curVal.list"
|
|
40
|
-
:compareData="curVal.oldList"
|
|
41
41
|
:rowDefault="curVal.rowDefault"
|
|
42
|
+
:rowspanMap="curVal.rowspanMap"
|
|
43
|
+
:compareData="curVal.oldList"
|
|
42
44
|
:columns="subForm"
|
|
43
45
|
:propsObj="propsObj"
|
|
44
46
|
:allFormList="allFormList"
|
|
@@ -1,70 +1,24 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
2
|
+
<!-- 编辑 -->
|
|
3
|
+
<div
|
|
4
|
+
v-if="canEdit"
|
|
5
|
+
class="selectUsers"
|
|
6
|
+
>
|
|
3
7
|
<bri-tooltip
|
|
4
8
|
:content="showVal"
|
|
5
|
-
placement="top"
|
|
6
9
|
:transfer="true"
|
|
7
|
-
maxWidth="200"
|
|
8
10
|
>
|
|
9
11
|
<div @click="clickInput">
|
|
10
12
|
<slot>
|
|
11
|
-
<!-- 编辑 -->
|
|
12
13
|
<dsh-control-input
|
|
13
|
-
v-if="canEdit"
|
|
14
14
|
:class="commonClass"
|
|
15
15
|
:value="curValList"
|
|
16
16
|
:disabled="selfPropsObj._disabled"
|
|
17
|
+
:heightAuto="isHeightAuto"
|
|
17
18
|
:propsObj="selfPropsObj"
|
|
18
19
|
@deleteItem="clickDeleteItem"
|
|
19
20
|
@clear="clickClear"
|
|
20
21
|
></dsh-control-input>
|
|
21
|
-
|
|
22
|
-
<!-- 表格查看 -->
|
|
23
|
-
<div
|
|
24
|
-
v-else-if="isUnitShow"
|
|
25
|
-
:class="{
|
|
26
|
-
...commonClass,
|
|
27
|
-
'selectUsers-unit': true
|
|
28
|
-
}"
|
|
29
|
-
>
|
|
30
|
-
<template v-if="!$isEmptyData(curValList)">
|
|
31
|
-
<template v-for="item in curValList">
|
|
32
|
-
<img
|
|
33
|
-
:src="item.avatarurl ? $imageResize(item.avatarurl, imageResizeConfig) : $imageSrcMap.system.boy"
|
|
34
|
-
:key="item._key"
|
|
35
|
-
class="selectUsers-unit-img"
|
|
36
|
-
/>
|
|
37
|
-
<span
|
|
38
|
-
:key="item._key + 'span'"
|
|
39
|
-
class="selectUsers-unit-text"
|
|
40
|
-
>
|
|
41
|
-
{{ item.name || item.realname || item.mobile }}
|
|
42
|
-
</span>
|
|
43
|
-
</template>
|
|
44
|
-
</template>
|
|
45
|
-
|
|
46
|
-
<template v-else>
|
|
47
|
-
{{ emptyShowVal }}
|
|
48
|
-
</template>
|
|
49
|
-
</div>
|
|
50
|
-
|
|
51
|
-
<!-- 弹窗查看 -->
|
|
52
|
-
<div
|
|
53
|
-
v-else
|
|
54
|
-
:class="{
|
|
55
|
-
...commonClass
|
|
56
|
-
}"
|
|
57
|
-
>
|
|
58
|
-
<dsh-tags
|
|
59
|
-
v-if="!$isEmptyData(curValList)"
|
|
60
|
-
class="text"
|
|
61
|
-
:list="curValList"
|
|
62
|
-
></dsh-tags>
|
|
63
|
-
|
|
64
|
-
<template v-else>
|
|
65
|
-
{{ emptyShowVal }}
|
|
66
|
-
</template>
|
|
67
|
-
</div>
|
|
68
22
|
</slot>
|
|
69
23
|
</div>
|
|
70
24
|
</bri-tooltip>
|
|
@@ -198,6 +152,79 @@
|
|
|
198
152
|
></dsh-buttons>
|
|
199
153
|
</dsh-modal>
|
|
200
154
|
</div>
|
|
155
|
+
|
|
156
|
+
<!-- 查看 -->
|
|
157
|
+
<div
|
|
158
|
+
v-else
|
|
159
|
+
class="selectUsers-show"
|
|
160
|
+
>
|
|
161
|
+
<!-- 有值 -->
|
|
162
|
+
<template v-if="!$isEmptyData(curValList)">
|
|
163
|
+
<!-- 单元格查看 -->
|
|
164
|
+
<bri-tooltip
|
|
165
|
+
v-if="isUnitShow"
|
|
166
|
+
:content="showVal"
|
|
167
|
+
:transfer="true"
|
|
168
|
+
>
|
|
169
|
+
<div :class="{
|
|
170
|
+
...commonClass,
|
|
171
|
+
'selectUsers-show-unit': true
|
|
172
|
+
}">
|
|
173
|
+
<template v-for="item in curValList">
|
|
174
|
+
<img
|
|
175
|
+
:src="item.avatarurl ? $imageResize(item.avatarurl, imageResizeConfig) : $imageSrcMap.system.boy"
|
|
176
|
+
:key="item._key"
|
|
177
|
+
class="selectUsers-show-unit-img"
|
|
178
|
+
/>
|
|
179
|
+
<span
|
|
180
|
+
:key="item._key + 'span'"
|
|
181
|
+
class="selectUsers-show-unit-text"
|
|
182
|
+
>
|
|
183
|
+
{{ item.name || item.realname || item.mobile }}
|
|
184
|
+
</span>
|
|
185
|
+
</template>
|
|
186
|
+
</div>
|
|
187
|
+
</bri-tooltip>
|
|
188
|
+
|
|
189
|
+
<!-- 表单查看 -->
|
|
190
|
+
<template v-else>
|
|
191
|
+
<!-- 高度自由时 -->
|
|
192
|
+
<dsh-tags
|
|
193
|
+
v-if="isHeightAuto"
|
|
194
|
+
:class="{
|
|
195
|
+
...commonClass,
|
|
196
|
+
'selectUsers-show-auto': true
|
|
197
|
+
}"
|
|
198
|
+
itemClass="selectUsers-show-auto-tag"
|
|
199
|
+
:list="curValObjList"
|
|
200
|
+
></dsh-tags>
|
|
201
|
+
|
|
202
|
+
<!-- 高度不自由(不换行) -->
|
|
203
|
+
<bri-tooltip
|
|
204
|
+
v-else
|
|
205
|
+
:content="showVal"
|
|
206
|
+
:transfer="true"
|
|
207
|
+
>
|
|
208
|
+
<dsh-tags
|
|
209
|
+
:class="{
|
|
210
|
+
...commonClass,
|
|
211
|
+
'selectUsers-show-ellipsis': true
|
|
212
|
+
}"
|
|
213
|
+
itemClass="selectUsers-show-ellipsis-tag"
|
|
214
|
+
:list="curValObjList"
|
|
215
|
+
></dsh-tags>
|
|
216
|
+
</bri-tooltip>
|
|
217
|
+
</template>
|
|
218
|
+
</template>
|
|
219
|
+
|
|
220
|
+
<!-- 无值 -->
|
|
221
|
+
<div
|
|
222
|
+
v-else
|
|
223
|
+
:class="commonClass"
|
|
224
|
+
>
|
|
225
|
+
{{ emptyShowVal }}
|
|
226
|
+
</div>
|
|
227
|
+
</div>
|
|
201
228
|
</template>
|
|
202
229
|
|
|
203
230
|
<script>
|
|
@@ -306,11 +333,15 @@
|
|
|
306
333
|
isCompAdmin () {
|
|
307
334
|
return (JSON.parse(sessionStorage.getItem("userData")) || {}).isCompAdmin || this.selfPropsObj._isCompAdmin;
|
|
308
335
|
},
|
|
336
|
+
|
|
309
337
|
curCheckAll () {
|
|
310
338
|
return this.userList.length && this.userList.every(userItem =>
|
|
311
339
|
this.newValList.some(newItem => newItem._key === userItem._key)
|
|
312
340
|
);
|
|
313
341
|
},
|
|
342
|
+
curValObjList () {
|
|
343
|
+
return this.curValList;
|
|
344
|
+
},
|
|
314
345
|
showVal () {
|
|
315
346
|
return this.$isEmptyData(this.curValList)
|
|
316
347
|
? this.emptyShowVal
|
|
@@ -490,18 +521,6 @@
|
|
|
490
521
|
]
|
|
491
522
|
: []
|
|
492
523
|
),
|
|
493
|
-
...(
|
|
494
|
-
this.highSearch && this.isCompAdmin
|
|
495
|
-
? [
|
|
496
|
-
{
|
|
497
|
-
is_leaf: true,
|
|
498
|
-
level: 1,
|
|
499
|
-
name: "离职人员",
|
|
500
|
-
_key: "_resign"
|
|
501
|
-
}
|
|
502
|
-
]
|
|
503
|
-
: []
|
|
504
|
-
),
|
|
505
524
|
{
|
|
506
525
|
is_leaf: true,
|
|
507
526
|
level: 1,
|
|
@@ -516,6 +535,18 @@
|
|
|
516
535
|
: this.listFilterVals.includes(item._key)
|
|
517
536
|
)
|
|
518
537
|
: data.list
|
|
538
|
+
),
|
|
539
|
+
...(
|
|
540
|
+
this.isCompAdmin
|
|
541
|
+
? [
|
|
542
|
+
{
|
|
543
|
+
is_leaf: true,
|
|
544
|
+
level: 1,
|
|
545
|
+
name: "离职人员",
|
|
546
|
+
_key: "_resign"
|
|
547
|
+
}
|
|
548
|
+
]
|
|
549
|
+
: []
|
|
519
550
|
)
|
|
520
551
|
];
|
|
521
552
|
|
|
@@ -542,27 +573,40 @@
|
|
|
542
573
|
};
|
|
543
574
|
</script>
|
|
544
575
|
|
|
545
|
-
<style lang="less">
|
|
576
|
+
<style lang="less" scoped>
|
|
577
|
+
@import url("../../control.less");
|
|
578
|
+
|
|
546
579
|
.selectUsers {
|
|
547
580
|
width: 100%;
|
|
548
581
|
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
width: 18px;
|
|
555
|
-
height: 18px;
|
|
556
|
-
vertical-align: middle;
|
|
557
|
-
margin-left: -5px;
|
|
558
|
-
border-radius: 50%;
|
|
582
|
+
#control-show();
|
|
583
|
+
&-show {
|
|
584
|
+
&-auto,
|
|
585
|
+
&-ellipsis {
|
|
586
|
+
margin: 5px 0px;
|
|
559
587
|
}
|
|
560
588
|
|
|
561
|
-
&-
|
|
562
|
-
|
|
589
|
+
&-unit {
|
|
590
|
+
.dsh-ellipsis();
|
|
591
|
+
padding-left: 5px;
|
|
592
|
+
|
|
593
|
+
&-img {
|
|
594
|
+
width: 18px;
|
|
595
|
+
height: 18px;
|
|
596
|
+
vertical-align: middle;
|
|
597
|
+
margin-left: -5px;
|
|
598
|
+
border-radius: 50%;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
&-text {
|
|
602
|
+
vertical-align: middle;
|
|
603
|
+
}
|
|
563
604
|
}
|
|
564
605
|
}
|
|
565
|
-
|
|
606
|
+
}
|
|
607
|
+
</style>
|
|
608
|
+
<style lang="less">
|
|
609
|
+
.selectUsers {
|
|
566
610
|
// 弹框部分
|
|
567
611
|
&-modal {
|
|
568
612
|
&-wrap {
|
|
@@ -356,7 +356,7 @@
|
|
|
356
356
|
(!["select", "checkbox"].includes(formItem._type)) // 考虑到选项用数字类型时,应该type: "number"
|
|
357
357
|
) {
|
|
358
358
|
rules.push({
|
|
359
|
-
message:
|
|
359
|
+
message: `"${formItem._name}"数据格式有错!`,
|
|
360
360
|
trigger: "blur, change",
|
|
361
361
|
type: "string",
|
|
362
362
|
...ruleConfig,
|
|
@@ -366,7 +366,7 @@
|
|
|
366
366
|
[arr[0]]: {
|
|
367
367
|
...arr[1],
|
|
368
368
|
required: false,
|
|
369
|
-
message:
|
|
369
|
+
message: `"${formItem._name}"${arr[1].message || ""}`
|
|
370
370
|
}
|
|
371
371
|
};
|
|
372
372
|
}, ruleConfig.fields)
|
|
@@ -376,7 +376,7 @@
|
|
|
376
376
|
// 必填校验
|
|
377
377
|
if (formItem._required) {
|
|
378
378
|
rules.push({
|
|
379
|
-
message:
|
|
379
|
+
message: `"${formItem._name}"为必填项!`,
|
|
380
380
|
trigger: "blur, change",
|
|
381
381
|
type: "string",
|
|
382
382
|
required: true,
|
|
@@ -386,7 +386,7 @@
|
|
|
386
386
|
...obj,
|
|
387
387
|
[arr[0]]: {
|
|
388
388
|
...arr[1],
|
|
389
|
-
message:
|
|
389
|
+
message: `"${formItem._name}"${arr[1].message || ""}`
|
|
390
390
|
}
|
|
391
391
|
};
|
|
392
392
|
}, ruleConfig.fields)
|
|
@@ -396,7 +396,7 @@
|
|
|
396
396
|
// 格式校验(不依赖必填)
|
|
397
397
|
if (ruleConfig.regs && ruleConfig.regs.length) {
|
|
398
398
|
rules.push({
|
|
399
|
-
message: formItem._regMessage ||
|
|
399
|
+
message: formItem._regMessage || `"${formItem._name}"格式不正确!`,
|
|
400
400
|
trigger: "blur, change",
|
|
401
401
|
type: "string",
|
|
402
402
|
transform: (val) => {
|
|
@@ -411,7 +411,7 @@
|
|
|
411
411
|
// 对比校验(横向同类型字段对比)-暂时只number和date对比校验
|
|
412
412
|
if (formItem._saveRuleConfigs && formItem._saveRuleConfigs.length) {
|
|
413
413
|
const ruleObj = {
|
|
414
|
-
message:
|
|
414
|
+
message: `"${formItem._name}"对比不通过!`,
|
|
415
415
|
trigger: "blur, change",
|
|
416
416
|
type: "string",
|
|
417
417
|
transform: (val) => {
|
|
@@ -428,7 +428,7 @@
|
|
|
428
428
|
// 对比校验(层级表格的层级对比)-暂时只number和date对比校验
|
|
429
429
|
if (this.inTableType === "treeTable" && ["downToUp", "upToDown"].includes(formItem._writeSort)) {
|
|
430
430
|
const ruleObj = {
|
|
431
|
-
message:
|
|
431
|
+
message: `"${formItem._name}"层级对比不通过!`,
|
|
432
432
|
trigger: "blur, change",
|
|
433
433
|
type: "string",
|
|
434
434
|
transform: (val) => {
|
|
@@ -215,7 +215,7 @@ export default {
|
|
|
215
215
|
/* ----------- 方法 ---------- */
|
|
216
216
|
selfBodyCellClass ({ row, rowIndex, column }) {
|
|
217
217
|
return `${["tree"].includes(column.colType)
|
|
218
|
-
? " bri-table-td-
|
|
218
|
+
? " bri-table-td-noborder"
|
|
219
219
|
: ""
|
|
220
220
|
}`;
|
|
221
221
|
},
|
|
@@ -244,8 +244,7 @@ export default {
|
|
|
244
244
|
return {
|
|
245
245
|
...this.getThStyle({ column }),
|
|
246
246
|
paddingTop: undefined,
|
|
247
|
-
paddingBottom: undefined
|
|
248
|
-
backgroundColor: "#ffffff"
|
|
247
|
+
paddingBottom: undefined
|
|
249
248
|
};
|
|
250
249
|
},
|
|
251
250
|
// 单元格 -获取行合并数
|
|
@@ -286,13 +285,22 @@ export default {
|
|
|
286
285
|
: "未选择算法";
|
|
287
286
|
}
|
|
288
287
|
},
|
|
289
|
-
//
|
|
290
|
-
|
|
288
|
+
// 加工单元格对应的配置
|
|
289
|
+
getSelfResetCol ({ row, rowIndex, column }) {
|
|
290
|
+
return column.colType === "tree"
|
|
291
|
+
? {
|
|
292
|
+
_heightAuto: true,
|
|
293
|
+
_placeholder: " "
|
|
294
|
+
}
|
|
295
|
+
: {};
|
|
296
|
+
},
|
|
297
|
+
// 单元格本身是否可编辑性 -针对表头列
|
|
298
|
+
getSelfColCanEdit ({ row, rowIndex, column }) {
|
|
291
299
|
return (this.getIsDftRow(row) ? !this.dftReadonlyTreeColKeys.includes(column._key) : true) && // 默认行的某列是否可编辑
|
|
292
300
|
(row.__old__ === true ? !this.oldReadonlyTreeColKeys.includes(column._key) : true); // 老数据行里某些列不可编辑
|
|
293
301
|
},
|
|
294
302
|
// getNewRowData时,额外补充的行相关的数据(针对层级属性的列)
|
|
295
|
-
|
|
303
|
+
getSelfNewRowData (level, list = []) {
|
|
296
304
|
const column = this.treeForm[level - 1];
|
|
297
305
|
const dftVal = column._default;
|
|
298
306
|
const initDftVal = this.initDftValMap[column._type];
|