bri-components 1.3.14 → 1.3.15
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/senior/selectUsers/selectUsers.vue +14 -2
- package/src/components/form/DshForm.vue +10 -11
- package/src/components/list/BriFlatTable.vue +16 -8
- package/src/components/list/DshCascaderTable.vue +55 -45
- package/src/styles/components/list/BriTable.less +4 -1
- package/src/styles/global/control.less +4 -0
package/package.json
CHANGED
|
@@ -287,6 +287,10 @@
|
|
|
287
287
|
...this.commonDealPropsObj
|
|
288
288
|
};
|
|
289
289
|
},
|
|
290
|
+
// 反向过滤
|
|
291
|
+
reverseFilter () {
|
|
292
|
+
return this.selfPropsObj._reverseFilter;
|
|
293
|
+
},
|
|
290
294
|
// 禁止显示的部门以及部门下人员
|
|
291
295
|
userDepartFilterVals () {
|
|
292
296
|
return this.selfPropsObj._userDepartFilterVals || [];
|
|
@@ -415,7 +419,11 @@
|
|
|
415
419
|
},
|
|
416
420
|
loadingName: "loading",
|
|
417
421
|
callback: data => {
|
|
418
|
-
this.userList = data.list.filter(item =>
|
|
422
|
+
this.userList = data.list.filter(item =>
|
|
423
|
+
this.reverseFilter
|
|
424
|
+
? !this.userDepartFilterVals.includes(item.departmentKey)
|
|
425
|
+
: this.userDepartFilterVals.includes(item.departmentKey)
|
|
426
|
+
);
|
|
419
427
|
this.total = data.total;
|
|
420
428
|
}
|
|
421
429
|
});
|
|
@@ -490,7 +498,11 @@
|
|
|
490
498
|
name: "全部",
|
|
491
499
|
_key: ""
|
|
492
500
|
},
|
|
493
|
-
...data.list.filter(item =>
|
|
501
|
+
...data.list.filter(item =>
|
|
502
|
+
this.reverseFilter
|
|
503
|
+
? !this.userDepartFilterVals.includes(item._key)
|
|
504
|
+
: this.userDepartFilterVals.includes(item._key)
|
|
505
|
+
)
|
|
494
506
|
];
|
|
495
507
|
}
|
|
496
508
|
});
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
@on-validate="validateCb"
|
|
9
9
|
>
|
|
10
10
|
<Row>
|
|
11
|
-
<template v-if="
|
|
12
|
-
<template v-for="formItem in
|
|
11
|
+
<template v-if="showFormList.length">
|
|
12
|
+
<template v-for="formItem in showFormList">
|
|
13
13
|
<i-col
|
|
14
14
|
:key="formItem._key"
|
|
15
15
|
:id="formItem._key"
|
|
@@ -179,12 +179,16 @@
|
|
|
179
179
|
};
|
|
180
180
|
},
|
|
181
181
|
computed: {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
return formList;
|
|
182
|
+
showFormList () {
|
|
183
|
+
return this.formList.filter(formItem => this.isShow(formItem, this.formData));
|
|
185
184
|
// return this.$getNotEmptyFieldList(formList, this.formData, this.canEdit, this.notShowEmpty);
|
|
186
185
|
}
|
|
187
186
|
},
|
|
187
|
+
watch: {
|
|
188
|
+
formList () {
|
|
189
|
+
this.init();
|
|
190
|
+
}
|
|
191
|
+
},
|
|
188
192
|
created () {
|
|
189
193
|
this.init();
|
|
190
194
|
},
|
|
@@ -203,7 +207,7 @@
|
|
|
203
207
|
// 初始化校验
|
|
204
208
|
initRules () {
|
|
205
209
|
// 此处代码可以改,但写法不能改!不然会引起表单页面渲染完就自动校验
|
|
206
|
-
|
|
210
|
+
this.formList.reduce((rulesObj, formItem) => {
|
|
207
211
|
rulesObj[formItem._key] = this.getRules(formItem);
|
|
208
212
|
return rulesObj;
|
|
209
213
|
}, this.rules);
|
|
@@ -390,11 +394,6 @@
|
|
|
390
394
|
this.$refs.form.validateField(curFormItem._key);
|
|
391
395
|
}
|
|
392
396
|
}
|
|
393
|
-
},
|
|
394
|
-
watch: {
|
|
395
|
-
formList () {
|
|
396
|
-
this.init();
|
|
397
|
-
}
|
|
398
397
|
}
|
|
399
398
|
};
|
|
400
399
|
</script>
|
|
@@ -88,13 +88,21 @@
|
|
|
88
88
|
return this.data;
|
|
89
89
|
},
|
|
90
90
|
footerData () {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
91
|
+
if (this.useSummary && this.listData.length) {
|
|
92
|
+
const row = this.filterColumns.reduce((row, col) => {
|
|
93
|
+
if (col._type === "number") {
|
|
94
|
+
row[col._key] = this.$calNumList(this.listData.map(item => item[col._key]), col._summaryType, { ...col, _defaultDigit: 2 });
|
|
95
|
+
}
|
|
96
|
+
return row;
|
|
97
|
+
}, {
|
|
98
|
+
_id: this.$ObjectID().str,
|
|
99
|
+
custome: "汇总"
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
return [row];
|
|
103
|
+
} else {
|
|
104
|
+
return [];
|
|
105
|
+
}
|
|
98
106
|
},
|
|
99
107
|
oldListData () {
|
|
100
108
|
this.oldData.forEach(item => {
|
|
@@ -108,7 +116,7 @@
|
|
|
108
116
|
maxHeight: this.contentHeight,
|
|
109
117
|
cellStyleOption: {
|
|
110
118
|
bodyCellClass: ({rowIndex}) => {
|
|
111
|
-
return
|
|
119
|
+
return `bri-table-td ${this.canEdit ? "bri-table-td-edit" : "bri-table-td-show"}`;
|
|
112
120
|
}
|
|
113
121
|
}
|
|
114
122
|
};
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
class="
|
|
3
|
+
class="DshCasTable"
|
|
4
4
|
ref="DshCascaderTable"
|
|
5
5
|
>
|
|
6
|
-
<div
|
|
7
|
-
'DshCascaderTable-wrap': true,
|
|
8
|
-
'DshCascaderTable-readonly': !canEdit
|
|
9
|
-
}">
|
|
6
|
+
<div class="DshCasTable-wrap">
|
|
10
7
|
<div
|
|
11
|
-
class="
|
|
8
|
+
class="DshCasTable-wrap-center"
|
|
12
9
|
:style="{
|
|
13
|
-
maxHeight: `${contentHeight}px
|
|
10
|
+
maxHeight: `${contentHeight}px`,
|
|
11
|
+
height: `${contentHeight}px`
|
|
14
12
|
}"
|
|
15
13
|
>
|
|
16
14
|
<!-- 表头 -->
|
|
17
|
-
<div class="
|
|
18
|
-
<div class="
|
|
15
|
+
<div class="DshCasTable-wrap-center-top">
|
|
16
|
+
<div class="DshCasTable-wrap-center-top-inner">
|
|
19
17
|
<table
|
|
20
18
|
class="table"
|
|
21
19
|
border="1"
|
|
@@ -23,11 +21,11 @@
|
|
|
23
21
|
bordercolor="#E7EDF8"
|
|
24
22
|
>
|
|
25
23
|
<tbody>
|
|
26
|
-
<tr
|
|
24
|
+
<tr>
|
|
27
25
|
<th
|
|
28
26
|
v-for="(col, colIndex) in columns"
|
|
29
27
|
:key="col._id"
|
|
30
|
-
class="table-
|
|
28
|
+
class="table-th bri-table-th"
|
|
31
29
|
:style="getThStyle(col, 'th')"
|
|
32
30
|
@click="$dispatchEvent(operationMap.clickTh, col)"
|
|
33
31
|
>
|
|
@@ -41,8 +39,8 @@
|
|
|
41
39
|
col.level === treeColumns.length &&
|
|
42
40
|
$getOperationList(getColOperationNames(col)).length
|
|
43
41
|
"
|
|
44
|
-
class="table-
|
|
45
|
-
menuClass="table-
|
|
42
|
+
class="table-th-dropdown"
|
|
43
|
+
menuClass="table-th-dropdown-list"
|
|
46
44
|
trigger="hover"
|
|
47
45
|
:list="$getOperationList(getColOperationNames(col))"
|
|
48
46
|
@click="$dispatchEvent($event, col, colIndex, columns)"
|
|
@@ -63,8 +61,8 @@
|
|
|
63
61
|
</div>
|
|
64
62
|
|
|
65
63
|
<!-- 数据行 -->
|
|
66
|
-
<div class="
|
|
67
|
-
<div class="
|
|
64
|
+
<div class="DshCasTable-wrap-center-list">
|
|
65
|
+
<div class="DshCasTable-wrap-center-list-inner">
|
|
68
66
|
<table
|
|
69
67
|
class="table"
|
|
70
68
|
border="1"
|
|
@@ -83,7 +81,12 @@
|
|
|
83
81
|
<td
|
|
84
82
|
v-if="['tree', 'summary'].includes(col.colType)"
|
|
85
83
|
:key="col._key"
|
|
86
|
-
:class="
|
|
84
|
+
:class="{
|
|
85
|
+
[`table-td-${col.colType}`]: true,
|
|
86
|
+
'bri-table-td': true , // 可以不要,为了position: relative,上面有
|
|
87
|
+
'bri-table-td-edit': canEdit,
|
|
88
|
+
'bri-table-td-show': !canEdit,
|
|
89
|
+
}"
|
|
87
90
|
:style="getTdStyle(col, row)"
|
|
88
91
|
:rowspan="geTdRowspan(col, row)"
|
|
89
92
|
:colspan="geTdColspan(col, row)"
|
|
@@ -115,8 +118,8 @@
|
|
|
115
118
|
<!-- 操作下拉 -->
|
|
116
119
|
<dsh-dropdown
|
|
117
120
|
v-if="$getOperationList(getNodeOperationNames(col, row, row[col._key])).length"
|
|
118
|
-
class="table-
|
|
119
|
-
menuClass="table-
|
|
121
|
+
class="table-td-tree-dropdown"
|
|
122
|
+
menuClass="table-td-tree-dropdown-list"
|
|
120
123
|
trigger="hover"
|
|
121
124
|
:list="$getOperationList(getNodeOperationNames(col, row, row[col._key]))"
|
|
122
125
|
@click="$dispatchEvent($event, row, rowIndex, col)"
|
|
@@ -141,8 +144,13 @@
|
|
|
141
144
|
<!-- 普通单元格 -->
|
|
142
145
|
<td
|
|
143
146
|
v-else
|
|
144
|
-
:key="col._key + ''"
|
|
145
|
-
class="
|
|
147
|
+
:key="col._key + 'data'"
|
|
148
|
+
:class="{
|
|
149
|
+
// [`table-td-${col.colType}`]: true,
|
|
150
|
+
'bri-table-td': true , // 可以不要,为了position: relative,上面有
|
|
151
|
+
'bri-table-td-edit': canEdit,
|
|
152
|
+
'bri-table-td-show': !canEdit,
|
|
153
|
+
}"
|
|
146
154
|
:style="getTdStyle(col, row)"
|
|
147
155
|
>
|
|
148
156
|
<dsh-list-unit
|
|
@@ -194,14 +202,14 @@
|
|
|
194
202
|
DshListUnit
|
|
195
203
|
},
|
|
196
204
|
props: {
|
|
197
|
-
useCol: {
|
|
198
|
-
type: Boolean,
|
|
199
|
-
default: false
|
|
200
|
-
},
|
|
201
205
|
canEdit: {
|
|
202
206
|
type: Boolean,
|
|
203
207
|
default: true
|
|
204
208
|
},
|
|
209
|
+
useCol: {
|
|
210
|
+
type: Boolean,
|
|
211
|
+
default: false
|
|
212
|
+
},
|
|
205
213
|
|
|
206
214
|
data: {
|
|
207
215
|
type: Object,
|
|
@@ -349,7 +357,7 @@
|
|
|
349
357
|
_disabledBtns: false, // 禁用增删按钮
|
|
350
358
|
...this.propsObj,
|
|
351
359
|
|
|
352
|
-
_contentHeight: this.propsObj._contentHeight ||
|
|
360
|
+
_contentHeight: this.propsObj._contentHeight || 400 // 表格最大高度
|
|
353
361
|
};
|
|
354
362
|
},
|
|
355
363
|
isShare () {
|
|
@@ -404,8 +412,8 @@
|
|
|
404
412
|
},
|
|
405
413
|
mounted () {
|
|
406
414
|
setTimeout(() => {
|
|
407
|
-
this.$el.querySelector(".
|
|
408
|
-
this.$el.querySelector(".
|
|
415
|
+
this.$el.querySelector(".DshCasTable-wrap-center-list").addEventListener("scroll", (e) => {
|
|
416
|
+
this.$el.querySelector(".DshCasTable-wrap-center-top").scrollLeft = e.srcElement.scrollLeft;
|
|
409
417
|
}, false);
|
|
410
418
|
this.boxWidth = this.$refs.DshCascaderTable.clientWidth;
|
|
411
419
|
}, 0);
|
|
@@ -887,7 +895,7 @@
|
|
|
887
895
|
</script>
|
|
888
896
|
|
|
889
897
|
<style lang="less">
|
|
890
|
-
.
|
|
898
|
+
.DshCasTable {
|
|
891
899
|
width: 100%;
|
|
892
900
|
|
|
893
901
|
&-wrap {
|
|
@@ -907,8 +915,10 @@
|
|
|
907
915
|
border-color: #E5E5E5;
|
|
908
916
|
line-height: 18px;
|
|
909
917
|
|
|
910
|
-
&-
|
|
911
|
-
&-
|
|
918
|
+
&-th,
|
|
919
|
+
&-td-tree {
|
|
920
|
+
position: relative;
|
|
921
|
+
|
|
912
922
|
&-dropdown {
|
|
913
923
|
position: absolute;
|
|
914
924
|
right: 0px;
|
|
@@ -928,26 +938,24 @@
|
|
|
928
938
|
}
|
|
929
939
|
|
|
930
940
|
&:hover {
|
|
931
|
-
.table-
|
|
932
|
-
.table-
|
|
941
|
+
.table-th-dropdown,
|
|
942
|
+
.table-td-tree-dropdown {
|
|
933
943
|
display: inline-block;
|
|
934
944
|
}
|
|
935
945
|
}
|
|
936
946
|
}
|
|
937
947
|
|
|
938
|
-
&-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
box-shadow: none;
|
|
950
|
-
line-height: 18px;
|
|
948
|
+
&-td {
|
|
949
|
+
&-tree {
|
|
950
|
+
.textarea {
|
|
951
|
+
.ivu-input {
|
|
952
|
+
min-height: 18px;
|
|
953
|
+
padding: 0px;
|
|
954
|
+
border: none;
|
|
955
|
+
background-color: transparent;
|
|
956
|
+
box-shadow: none;
|
|
957
|
+
line-height: 18px;
|
|
958
|
+
}
|
|
951
959
|
}
|
|
952
960
|
}
|
|
953
961
|
}
|
|
@@ -958,6 +966,7 @@
|
|
|
958
966
|
}
|
|
959
967
|
}
|
|
960
968
|
|
|
969
|
+
// 头部
|
|
961
970
|
&-top {
|
|
962
971
|
width: 100%;
|
|
963
972
|
z-index: 99;
|
|
@@ -970,6 +979,7 @@
|
|
|
970
979
|
}
|
|
971
980
|
}
|
|
972
981
|
|
|
982
|
+
// 主体
|
|
973
983
|
&-list {
|
|
974
984
|
width: 100%;
|
|
975
985
|
flex: 1;
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
// tbody.ve-table-body tr.ve-table-body-tr td.ve-table-body-td {
|
|
66
|
-
// padding: 4px 20px
|
|
66
|
+
// padding: 4px 20px;
|
|
67
67
|
// }
|
|
68
68
|
}
|
|
69
69
|
}
|
|
@@ -144,6 +144,9 @@
|
|
|
144
144
|
&-edit {
|
|
145
145
|
padding: 4px 20px 12px 20px!important;
|
|
146
146
|
}
|
|
147
|
+
&-show {
|
|
148
|
+
padding: 4px 20px!important;
|
|
149
|
+
}
|
|
147
150
|
}
|
|
148
151
|
}
|
|
149
152
|
|