bri-components 1.2.65 → 1.2.67
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/DshInput/DshInput.vue +87 -69
- package/src/components/controls/base/DshSelect/DshCheckbox.vue +6 -2
- package/src/components/controls/base/DshSelect/DshSelect.vue +1 -0
- package/src/components/controls/control.less +88 -20
- package/src/components/controls/mixins/cascaderMixin.js +16 -7
- package/src/components/controls/mixins/selectMixin.js +19 -4
- package/src/components/controls/senior/selectDepartments.vue +1 -1
- package/src/components/form/DshForm.vue +8 -2
- package/src/components/list/BriCard.vue +1 -1
- package/src/components/list/BriTable.vue +1 -1
- package/src/components/list/DshBox/DshBox.vue +1 -1
- package/src/components/list/DshBox/DshCard.vue +295 -156
- package/src/components/list/DshBox/DshCrossTable.vue +1 -1
- package/src/components/list/DshBox/DshList.vue +7 -14
- package/src/components/list/DshBox/DshPanel.vue +378 -262
- package/src/components/list/DshCascaderTable.vue +1 -1
- package/src/components/other/BriLoading.vue +1 -1
- package/src/components/small/DshDropdown.vue +7 -4
- package/src/components/unit/DshFormUnit.vue +80 -62
- package/src/styles/components/list/DshBox/DshList.less +2 -3
- package/src/styles/global/control.less +1 -2
- package/src/styles/global/text.less +10 -3
- package/src/styles/reset-iview-controls.less +32 -15
package/package.json
CHANGED
|
@@ -1,32 +1,30 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<!-- 单选模式 -->
|
|
2
|
+
<!-- 单选模式 编辑 -->
|
|
3
3
|
<div
|
|
4
|
-
v-if="!multipleMode"
|
|
4
|
+
v-if="!multipleMode && canEdit"
|
|
5
5
|
class="DshInput"
|
|
6
6
|
>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
@on-clear="onClear"
|
|
29
|
-
>
|
|
7
|
+
<i-input
|
|
8
|
+
class="DshInput-edit"
|
|
9
|
+
v-model="value[controlKey]"
|
|
10
|
+
:type="inputType"
|
|
11
|
+
:placeholder="selfPropsObj._placeholder"
|
|
12
|
+
:readonly="selfPropsObj._readonly"
|
|
13
|
+
:disabled="selfPropsObj._disabled"
|
|
14
|
+
:clearable="selfPropsObj._clearable"
|
|
15
|
+
:size="selfPropsObj._size"
|
|
16
|
+
:rows="selfPropsObj._rows"
|
|
17
|
+
:search="selfPropsObj._search"
|
|
18
|
+
:show-word-limit="selfPropsObj._showWordLimit"
|
|
19
|
+
:maxlength="selfPropsObj._maxlength"
|
|
20
|
+
:autosize="selfPropsObj._autosize"
|
|
21
|
+
@on-enter="onEnter"
|
|
22
|
+
@on-search="onSearch"
|
|
23
|
+
@on-focus="onFocus"
|
|
24
|
+
@on-change="onChange"
|
|
25
|
+
@on-blur="onBlur"
|
|
26
|
+
@on-clear="onClear"
|
|
27
|
+
>
|
|
30
28
|
<span
|
|
31
29
|
v-if="selfPropsObj._prepend"
|
|
32
30
|
slot="prepend"
|
|
@@ -36,49 +34,61 @@
|
|
|
36
34
|
v-if="selfPropsObj._append"
|
|
37
35
|
slot="append"
|
|
38
36
|
>{{ selfPropsObj._append }}</span>
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
</i-input>
|
|
38
|
+
</div>
|
|
41
39
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
40
|
+
<!-- 单选模式 查看 -->
|
|
41
|
+
<div v-else-if="!multipleMode && !canEdit">
|
|
42
|
+
<!-- 有值 -->
|
|
43
|
+
<template v-if="!$isEmptyData(curVal)">
|
|
44
|
+
<!-- 详情页查看 且单独占一行高度自由时 -->
|
|
45
|
+
<div
|
|
46
|
+
v-if="isHeightAuto"
|
|
47
|
+
:class="{
|
|
48
|
+
...commonClass,
|
|
49
|
+
'DshInput-show-auto': true
|
|
50
|
+
}"
|
|
51
|
+
v-html="showVal"
|
|
52
|
+
></div>
|
|
51
53
|
|
|
52
54
|
<!-- 表格和查看页 里的查看 -->
|
|
53
|
-
<
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
<bri-tooltip
|
|
56
|
+
v-else
|
|
57
|
+
:content="showVal"
|
|
58
|
+
:defaultDisabled="false"
|
|
59
|
+
:transfer="true"
|
|
60
|
+
>
|
|
61
|
+
<a
|
|
62
|
+
v-if="inputType === 'url'"
|
|
63
|
+
:class="{
|
|
61
64
|
...commonClass,
|
|
62
|
-
'DshInput-
|
|
63
|
-
'DshInput-show':
|
|
64
|
-
}"
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
@click="goHttpWindow($event)"
|
|
70
|
-
>
|
|
71
|
-
{{ showVal }}
|
|
72
|
-
</a>
|
|
65
|
+
'DshInput-show-ellipsis': true,
|
|
66
|
+
'DshInput-show-ellipsis-url': true
|
|
67
|
+
}"
|
|
68
|
+
@click="goHttpWindow($event)"
|
|
69
|
+
>
|
|
70
|
+
{{ showVal }}
|
|
71
|
+
</a>
|
|
73
72
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
73
|
+
<div
|
|
74
|
+
v-else
|
|
75
|
+
:class="{
|
|
76
|
+
...commonClass,
|
|
77
|
+
'DshInput-show-ellipsis': true
|
|
78
|
+
}"
|
|
79
|
+
>
|
|
80
|
+
{{ showVal }}
|
|
81
|
+
</div>
|
|
82
|
+
</bri-tooltip>
|
|
81
83
|
</template>
|
|
84
|
+
|
|
85
|
+
<!-- 无值 -->
|
|
86
|
+
<div
|
|
87
|
+
v-else
|
|
88
|
+
:class="commonClass"
|
|
89
|
+
>
|
|
90
|
+
{{ emptyShowVal }}
|
|
91
|
+
</div>
|
|
82
92
|
</div>
|
|
83
93
|
|
|
84
94
|
<!-- 多选模式 -->
|
|
@@ -117,7 +127,8 @@
|
|
|
117
127
|
_readonly: ["serialNumber"].includes(this.controlType),
|
|
118
128
|
_showWordLimit: this.propsObj._showWordLimit || (!!this.propsObj._maxlength || this.propsObj._maxlength === 0),
|
|
119
129
|
_autosize: {
|
|
120
|
-
minRows: 2
|
|
130
|
+
minRows: 2,
|
|
131
|
+
maxRows: 20
|
|
121
132
|
},
|
|
122
133
|
|
|
123
134
|
...this.propsObj,
|
|
@@ -182,16 +193,23 @@
|
|
|
182
193
|
</script>
|
|
183
194
|
|
|
184
195
|
<style lang="less">
|
|
196
|
+
@import url("../../control.less");
|
|
197
|
+
|
|
185
198
|
.DshInput {
|
|
199
|
+
#control-show();
|
|
186
200
|
width: 100%;
|
|
187
201
|
|
|
188
202
|
&-show {
|
|
189
|
-
&-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
203
|
+
&-auto {
|
|
204
|
+
white-space: pre-wrap!important;
|
|
205
|
+
max-height: 500px;
|
|
206
|
+
overflow: auto;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
&-ellipsis {
|
|
210
|
+
&-url {
|
|
211
|
+
color: @themeColor!important;
|
|
212
|
+
}
|
|
195
213
|
}
|
|
196
214
|
}
|
|
197
215
|
}
|
|
@@ -33,7 +33,11 @@
|
|
|
33
33
|
<!-- dropdown模式 -->
|
|
34
34
|
<template v-else>
|
|
35
35
|
<Select
|
|
36
|
-
class="
|
|
36
|
+
:class="{
|
|
37
|
+
'DshCheckbox-dropdown': true,
|
|
38
|
+
'DshCheckbox-dropdown-auto': isHeightAuto,
|
|
39
|
+
'DshCheckbox-dropdown-scroll': !isHeightAuto,
|
|
40
|
+
}"
|
|
37
41
|
:value="curValList"
|
|
38
42
|
:multiple="true"
|
|
39
43
|
:placeholder="selfPropsObj._placeholder"
|
|
@@ -130,7 +134,7 @@
|
|
|
130
134
|
return {
|
|
131
135
|
_max: 100000000,
|
|
132
136
|
_transfer: true,
|
|
133
|
-
_transferClassName: "",
|
|
137
|
+
_transferClassName: "DshCheckbox-dropdown-transfer",
|
|
134
138
|
|
|
135
139
|
...this.basePropsObj
|
|
136
140
|
};
|
|
@@ -50,7 +50,6 @@
|
|
|
50
50
|
background-color: @themeColor;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
|
|
54
53
|
.ivu-checkbox-inner {
|
|
55
54
|
background-color: @themeColor;
|
|
56
55
|
}
|
|
@@ -65,22 +64,29 @@
|
|
|
65
64
|
&-disabled {
|
|
66
65
|
.ivu-@{control-type} {
|
|
67
66
|
.ivu-@{control-type}-inner {
|
|
68
|
-
border-color: #aaaaaa
|
|
67
|
+
border-color: #aaaaaa;
|
|
69
68
|
}
|
|
70
69
|
|
|
71
70
|
&-checked {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
// 因为不一致,所以明确名字分开写
|
|
72
|
+
.ivu-radio-inner {
|
|
73
|
+
&::after {
|
|
74
|
+
background-color: #aaaaaa;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
.ivu-checkbox-inner {
|
|
78
|
+
background-color: #aaaaaa;
|
|
79
|
+
|
|
80
|
+
// 对勾的颜色
|
|
75
81
|
&::after {
|
|
76
|
-
|
|
82
|
+
border-color: #f3f3f3;
|
|
77
83
|
}
|
|
78
84
|
}
|
|
79
85
|
}
|
|
80
86
|
|
|
81
87
|
|
|
82
88
|
& + span {
|
|
83
|
-
color: #aaaaaa
|
|
89
|
+
color: #aaaaaa;
|
|
84
90
|
}
|
|
85
91
|
}
|
|
86
92
|
}
|
|
@@ -149,11 +155,39 @@
|
|
|
149
155
|
}
|
|
150
156
|
|
|
151
157
|
&-disabled {
|
|
152
|
-
border-color:
|
|
153
|
-
|
|
158
|
+
border-color: transparent;
|
|
159
|
+
|
|
160
|
+
.ivu-@{control-type} {
|
|
161
|
+
.ivu-@{control-type}-inner {
|
|
162
|
+
border-color: #cccccc;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
&-checked {
|
|
166
|
+
// 因为不一致,所以明确名字分开写
|
|
167
|
+
.ivu-radio-inner {
|
|
168
|
+
&::after {
|
|
169
|
+
background-color: #cccccc;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
.ivu-checkbox-inner {
|
|
173
|
+
background-color: #cccccc;
|
|
174
|
+
|
|
175
|
+
// 对勾的颜色
|
|
176
|
+
&::after {
|
|
177
|
+
border-color: #f3f3f3;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
& + span {
|
|
184
|
+
color: @value;
|
|
185
|
+
opacity: 0.5;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
154
188
|
|
|
155
189
|
&.ivu-@{control-type}-wrapper-checked {
|
|
156
|
-
border-color: #
|
|
190
|
+
border-color: #cccccc;
|
|
157
191
|
}
|
|
158
192
|
}
|
|
159
193
|
}
|
|
@@ -174,21 +208,14 @@
|
|
|
174
208
|
}
|
|
175
209
|
|
|
176
210
|
&-dropdown {
|
|
211
|
+
// 输入框部分
|
|
177
212
|
&.ivu-select-multiple {
|
|
178
213
|
.ivu-select-selection {
|
|
179
|
-
height: 32px;
|
|
180
|
-
|
|
181
214
|
& > div {
|
|
182
|
-
.bri-scrollbar3();
|
|
183
215
|
width: 100%;
|
|
184
216
|
height: 100%;
|
|
185
|
-
word-break: keep-all;
|
|
186
|
-
white-space: nowrap;
|
|
187
|
-
overflow: auto;
|
|
188
|
-
overflow-y: hidden;
|
|
189
217
|
|
|
190
218
|
.ivu-tag {
|
|
191
|
-
margin: 2px 4px 0px 0px;
|
|
192
219
|
background-color: @borderColor;
|
|
193
220
|
}
|
|
194
221
|
}
|
|
@@ -203,9 +230,50 @@
|
|
|
203
230
|
}
|
|
204
231
|
}
|
|
205
232
|
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
&-auto {
|
|
236
|
+
&.ivu-select-multiple {
|
|
237
|
+
.ivu-select-selection {
|
|
238
|
+
& > div {
|
|
239
|
+
.ivu-tag {
|
|
240
|
+
height: auto;
|
|
241
|
+
|
|
242
|
+
span:not(.ivu-select-max-tag) {
|
|
243
|
+
text-overflow: auto;
|
|
244
|
+
white-space: normal;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
&-scroll {
|
|
253
|
+
&.ivu-select-multiple {
|
|
254
|
+
.ivu-select-selection {
|
|
255
|
+
height: 32px;
|
|
256
|
+
|
|
257
|
+
& > div {
|
|
258
|
+
.bri-scrollbar3();
|
|
259
|
+
word-break: keep-all;
|
|
260
|
+
white-space: nowrap;
|
|
261
|
+
overflow: auto;
|
|
262
|
+
overflow-y: hidden;
|
|
263
|
+
|
|
264
|
+
.ivu-tag {
|
|
265
|
+
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
206
271
|
|
|
207
|
-
|
|
208
|
-
|
|
272
|
+
// 下拉面板
|
|
273
|
+
&-transfer {
|
|
274
|
+
&.ivu-select-dropdown {
|
|
275
|
+
max-width: 200px;
|
|
276
|
+
max-height: 350px;
|
|
209
277
|
}
|
|
210
278
|
}
|
|
211
279
|
}
|
|
@@ -14,14 +14,16 @@ export default {
|
|
|
14
14
|
basePropsObj () {
|
|
15
15
|
const _joinSymbol = this.propsObj._joinSymbol || "/";
|
|
16
16
|
return {
|
|
17
|
-
_showMode: "default",
|
|
17
|
+
_showMode: "default", // "default", "custom", "simple"
|
|
18
18
|
colorMap: resourceData.colorMap,
|
|
19
19
|
_useColor: false,
|
|
20
20
|
_saveKey: "_key",
|
|
21
21
|
_valueKey: "code",
|
|
22
22
|
_nameKey: "name",
|
|
23
|
-
_filterable: true,
|
|
24
|
-
|
|
23
|
+
_filterable: true, // 是否支持搜索
|
|
24
|
+
_data: [],
|
|
25
|
+
_reverseFilter: false, // 是否反向过滤,默认正向过滤
|
|
26
|
+
_cascaderFilterVals: [], // 过滤的级联数据
|
|
25
27
|
_renderFormat: (labels) => labels.join(_joinSymbol),
|
|
26
28
|
|
|
27
29
|
...this.propsObj,
|
|
@@ -54,6 +56,9 @@ export default {
|
|
|
54
56
|
cascaderLevel () {
|
|
55
57
|
return this.selfPropsObj._cascaderLevel;
|
|
56
58
|
},
|
|
59
|
+
reverseFilter () {
|
|
60
|
+
return this.selfPropsObj._reverseFilter;
|
|
61
|
+
},
|
|
57
62
|
cascaderFilterVals () {
|
|
58
63
|
return this.selfPropsObj._cascaderFilterVals;
|
|
59
64
|
},
|
|
@@ -70,8 +75,12 @@ export default {
|
|
|
70
75
|
},
|
|
71
76
|
cascaderData () {
|
|
72
77
|
const loop = (arr = [], level, parentKeys = [], filterVals = [], isMobile = false) => {
|
|
73
|
-
if (
|
|
74
|
-
arr = arr.filter(item =>
|
|
78
|
+
if (filterVals.length) {
|
|
79
|
+
arr = arr.filter(item =>
|
|
80
|
+
this.reverseFilter
|
|
81
|
+
? !filterVals.includes(item[this.saveKey])
|
|
82
|
+
: filterVals.includes(item[this.saveKey])
|
|
83
|
+
);
|
|
75
84
|
}
|
|
76
85
|
|
|
77
86
|
return arr
|
|
@@ -154,7 +163,7 @@ export default {
|
|
|
154
163
|
confirmMulCb (selectedValue, selectedOptions) {
|
|
155
164
|
if (this.curValList.some(item => JSON.stringify(item) === JSON.stringify(selectedValue))) {
|
|
156
165
|
this.$Message.error({
|
|
157
|
-
content:
|
|
166
|
+
content: `请勿重复选择"${this.transformFullName(selectedValue)}"!`,
|
|
158
167
|
duration: 4
|
|
159
168
|
});
|
|
160
169
|
} else {
|
|
@@ -187,7 +196,7 @@ export default {
|
|
|
187
196
|
}
|
|
188
197
|
: {
|
|
189
198
|
_key: val,
|
|
190
|
-
name: `提示:选项${val}
|
|
199
|
+
name: `提示:选项${val}已不存在`,
|
|
191
200
|
style: {
|
|
192
201
|
...this.tagStyle
|
|
193
202
|
}
|
|
@@ -18,9 +18,11 @@ export default {
|
|
|
18
18
|
_optionKind: "dropdown", // "flat"、"dropdown"
|
|
19
19
|
colorMap: resourceData.colorMap,
|
|
20
20
|
_useColor: false,
|
|
21
|
-
_filterable: true,
|
|
21
|
+
_filterable: true, // 是否支持搜索
|
|
22
22
|
_data: [],
|
|
23
23
|
_customData: [],
|
|
24
|
+
_reverseFilter: false, // 是否反向过滤,默认正向过滤
|
|
25
|
+
_selectFilterVals: [], // 过滤的数据
|
|
24
26
|
|
|
25
27
|
...this.propsObj,
|
|
26
28
|
...this.commonDealPropsObj
|
|
@@ -35,14 +37,27 @@ export default {
|
|
|
35
37
|
useColor () {
|
|
36
38
|
return this.selfPropsObj._useColor;
|
|
37
39
|
},
|
|
40
|
+
reverseFilter () {
|
|
41
|
+
return this.selfPropsObj._reverseFilter;
|
|
42
|
+
},
|
|
43
|
+
selectFilterVals () {
|
|
44
|
+
return this.selfPropsObj._selectFilterVals;
|
|
45
|
+
},
|
|
46
|
+
|
|
38
47
|
listData () {
|
|
39
|
-
|
|
48
|
+
let listData = this.selfPropsObj._data.concat(this.initListData);
|
|
49
|
+
if (this.selectFilterVals.length) {
|
|
50
|
+
listData = listData.filter(item =>
|
|
51
|
+
this.reverseFilter
|
|
52
|
+
? !this.selectFilterVals.includes(item._key)
|
|
53
|
+
: this.selectFilterVals.includes(item._key)
|
|
54
|
+
);
|
|
55
|
+
}
|
|
40
56
|
|
|
41
57
|
return this.$dataType(this.selfPropsObj._filterFunc, "function")
|
|
42
58
|
? this.selfPropsObj._filterFunc(listData, this.selfPropsObj, this.value)
|
|
43
59
|
: listData;
|
|
44
60
|
},
|
|
45
|
-
|
|
46
61
|
curValObj () {
|
|
47
62
|
return this.getItemObj(this.curVal);
|
|
48
63
|
},
|
|
@@ -120,7 +135,7 @@ export default {
|
|
|
120
135
|
getItemObj (val) {
|
|
121
136
|
const obj = this.listData.find(item => item._key === val) || {
|
|
122
137
|
_key: val,
|
|
123
|
-
name: `提示:选项${val}
|
|
138
|
+
name: `提示:选项${val}已不存在`
|
|
124
139
|
};
|
|
125
140
|
|
|
126
141
|
return !this.$isEmptyData(val)
|
|
@@ -85,8 +85,10 @@
|
|
|
85
85
|
|
|
86
86
|
<div
|
|
87
87
|
v-else
|
|
88
|
-
class="
|
|
89
|
-
>
|
|
88
|
+
class="DshForm-nodata"
|
|
89
|
+
>
|
|
90
|
+
{{ "--- 无字段 ---" }}
|
|
91
|
+
</div>
|
|
90
92
|
</Row>
|
|
91
93
|
</Form>
|
|
92
94
|
</template>
|
|
@@ -400,6 +402,10 @@
|
|
|
400
402
|
&-item-FormItem {
|
|
401
403
|
margin-bottom: 0px;
|
|
402
404
|
}
|
|
405
|
+
|
|
406
|
+
&-nodata {
|
|
407
|
+
#dsh-nodata();
|
|
408
|
+
}
|
|
403
409
|
}
|
|
404
410
|
</style>
|
|
405
411
|
<style lang="less">
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
:propsObj="listPropsObj"
|
|
14
14
|
:changedFields="changedFields"
|
|
15
15
|
:isLoading="listPropsObj && listPropsObj.isLoading"
|
|
16
|
-
:noDataText="listPropsObj && listPropsObj.noDataText || '
|
|
16
|
+
:noDataText="listPropsObj && listPropsObj.noDataText || '暂无数据…'"
|
|
17
17
|
@clickRow="clickRow"
|
|
18
18
|
@sortChange="changeSort"
|
|
19
19
|
@changeSelect="changeSelect"
|