bri-components 1.2.58 → 1.2.60
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 +1 -1
- package/src/components/controls/base/DshCascader/DshCascader.vue +20 -28
- package/src/components/controls/base/DshSelect/DshCheckbox.vue +97 -233
- package/src/components/controls/base/DshSelect/DshSelect.vue +99 -207
- package/src/components/controls/control.less +194 -0
- package/src/components/controls/mixins/controlMixin.js +30 -4
- package/src/components/controls/mixins/selectMixin.js +85 -127
- package/src/components/small/BriTooltip.vue +0 -1
- package/src/components/unit/DshFormUnit.vue +5 -5
- package/src/styles/components/small/BriTooltip.less +0 -0
package/package.json
CHANGED
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
selfPropsObj () {
|
|
139
139
|
return {
|
|
140
140
|
_fileType: "file",
|
|
141
|
-
_showType: this.
|
|
141
|
+
_showType: this.isHeightAuto ? "old" : "inline", // 宽度为100%、且不在级联表格或内部表格里的 显示老版
|
|
142
142
|
// _multiple: true,
|
|
143
143
|
_useType: "drag",
|
|
144
144
|
_maxSize: 1024 * 1024,
|
|
@@ -26,17 +26,18 @@
|
|
|
26
26
|
<!-- 单选模式 查看 -->
|
|
27
27
|
<div
|
|
28
28
|
v-else-if="!multipleMode && !canEdit"
|
|
29
|
-
class="DshCascader"
|
|
29
|
+
class="DshCascader-show"
|
|
30
30
|
>
|
|
31
31
|
<!-- 有值 -->
|
|
32
32
|
<bri-tooltip
|
|
33
33
|
v-if="!$isEmptyData(curValList)"
|
|
34
34
|
:content="showVal"
|
|
35
|
-
placement="top"
|
|
36
|
-
maxWidth="200"
|
|
37
35
|
:transfer="true"
|
|
38
36
|
>
|
|
39
|
-
<div :class="
|
|
37
|
+
<div :class="{
|
|
38
|
+
commonClass,
|
|
39
|
+
'DshCascader-show-ellipsis': true
|
|
40
|
+
}">
|
|
40
41
|
{{ showVal }}
|
|
41
42
|
</div>
|
|
42
43
|
</bri-tooltip>
|
|
@@ -83,19 +84,15 @@
|
|
|
83
84
|
<bri-tooltip
|
|
84
85
|
v-if="!$isEmptyData(curValList)"
|
|
85
86
|
:content="showMulVal"
|
|
86
|
-
placement="top"
|
|
87
|
-
maxWidth="200"
|
|
88
87
|
:transfer="true"
|
|
89
88
|
>
|
|
90
|
-
<
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
></dsh-tags>
|
|
98
|
-
</div>
|
|
89
|
+
<dsh-tags
|
|
90
|
+
:class="{
|
|
91
|
+
...commonClass,
|
|
92
|
+
'DshCascaders-show-ellipsis': !(isDetailShow && isHeightAuto)
|
|
93
|
+
}"
|
|
94
|
+
:list="curValNameList"
|
|
95
|
+
></dsh-tags>
|
|
99
96
|
</bri-tooltip>
|
|
100
97
|
|
|
101
98
|
<!-- 无值 -->
|
|
@@ -139,7 +136,7 @@
|
|
|
139
136
|
computed: {
|
|
140
137
|
selfPropsObj () {
|
|
141
138
|
return {
|
|
142
|
-
_showMode: "default", //
|
|
139
|
+
_showMode: "default", // 值为"default", "custom", "simple"
|
|
143
140
|
_transfer: true,
|
|
144
141
|
_transferClassName: "",
|
|
145
142
|
|
|
@@ -165,23 +162,18 @@
|
|
|
165
162
|
|
|
166
163
|
<style lang="less">
|
|
167
164
|
.DshCascader {
|
|
168
|
-
|
|
165
|
+
&-show {
|
|
166
|
+
&-ellipsis {
|
|
167
|
+
.dsh-ellipsis();
|
|
168
|
+
}
|
|
169
|
+
}
|
|
169
170
|
}
|
|
170
171
|
|
|
171
172
|
// 多选
|
|
172
173
|
.DshCascaders {
|
|
173
174
|
&-show {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
&-row {
|
|
177
|
-
.text,
|
|
178
|
-
.overflow {
|
|
179
|
-
.bri-scrollbar3();
|
|
180
|
-
width: 100%;
|
|
181
|
-
height: 100%;
|
|
182
|
-
white-space: normal;
|
|
183
|
-
overflow: auto;
|
|
184
|
-
}
|
|
175
|
+
&-ellipsis {
|
|
176
|
+
.dsh-ellipsis();
|
|
185
177
|
}
|
|
186
178
|
}
|
|
187
179
|
}
|
|
@@ -1,111 +1,100 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
<!-- 编辑 -->
|
|
3
|
+
<div
|
|
4
|
+
v-if="canEdit"
|
|
5
|
+
class="DshCheckbox"
|
|
6
|
+
>
|
|
7
|
+
<!-- 有选项 -->
|
|
8
|
+
<template v-if="listData.length">
|
|
9
|
+
<!-- flat方式 -->
|
|
10
|
+
<template v-if="showType === 'flat'">
|
|
11
|
+
<CheckboxGroup
|
|
12
|
+
:class="{
|
|
11
13
|
'DshCheckbox-flat': true,
|
|
12
14
|
'DshCheckbox-flat-color': useColor,
|
|
13
|
-
'DshCheckbox-flat-
|
|
14
|
-
'DshCheckbox-flat-scroll': selfPropsObj._span < 24 && !selfPropsObj._br,
|
|
15
|
+
'DshCheckbox-flat-scroll': !isHeightAuto,
|
|
15
16
|
}"
|
|
16
|
-
|
|
17
|
+
v-model="curValList"
|
|
18
|
+
>
|
|
19
|
+
<Checkbox
|
|
20
|
+
v-for="(item, index) in listData"
|
|
21
|
+
:key="item._key"
|
|
22
|
+
:class="getItemClass(item)"
|
|
23
|
+
:style="getItemColorStyle(item)"
|
|
24
|
+
:label="item._key"
|
|
25
|
+
:disabled="getCheckItemDisabled(item, index)"
|
|
26
|
+
:border="useColor"
|
|
17
27
|
>
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
'DshCheckbox-item',
|
|
23
|
-
getItemColorClass(item),
|
|
24
|
-
selfPropsObj.class,
|
|
25
|
-
item.class
|
|
26
|
-
]"
|
|
27
|
-
:style="getItemStyle(item)"
|
|
28
|
-
:label="item._key"
|
|
29
|
-
:disabled="getItemDisabled(item)"
|
|
30
|
-
:border="useColor"
|
|
31
|
-
@click.native="clickOpenTip(item)"
|
|
32
|
-
>
|
|
33
|
-
<slot :item="item"></slot>
|
|
34
|
-
|
|
35
|
-
<span>{{ item.name || item._name }}</span>
|
|
36
|
-
</Checkbox>
|
|
37
|
-
|
|
38
|
-
<!-- tip项弹框提示 -->
|
|
39
|
-
<dsh-render :render="tipModalRender"></dsh-render>
|
|
40
|
-
</CheckboxGroup>
|
|
41
|
-
</template>
|
|
28
|
+
<span>{{ item.name || item._name }}</span>
|
|
29
|
+
</Checkbox>
|
|
30
|
+
</CheckboxGroup>
|
|
31
|
+
</template>
|
|
42
32
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
33
|
+
<!-- dropdown模式 -->
|
|
34
|
+
<template v-else>
|
|
35
|
+
<Select
|
|
36
|
+
class="DshCheckbox-dropdown"
|
|
37
|
+
:value="curValList"
|
|
38
|
+
:multiple="true"
|
|
39
|
+
:placeholder="selfPropsObj._placeholder"
|
|
40
|
+
:disabled="selfPropsObj._disabled"
|
|
41
|
+
:filterable="selfPropsObj._filterable"
|
|
42
|
+
:transfer="selfPropsObj._transfer"
|
|
43
|
+
:transfer-class-name="selfPropsObj._transferClassName"
|
|
44
|
+
:max-tag-count="selfPropsObj._maxTagCount"
|
|
45
|
+
@on-select="changeCheckValue"
|
|
46
|
+
>
|
|
47
|
+
<Option
|
|
48
|
+
v-for="(item, index) in listData"
|
|
49
|
+
:key="item._key"
|
|
50
|
+
:value="item._key"
|
|
51
|
+
:label="item.name || item._name"
|
|
52
|
+
:disabled="getCheckItemDisabled(item, index)"
|
|
55
53
|
>
|
|
56
|
-
<
|
|
57
|
-
v-for="(item, index) in listData"
|
|
58
|
-
:key="index"
|
|
59
|
-
:value="item._key"
|
|
60
|
-
:label="item.name || item._name"
|
|
61
|
-
:disabled="getItemDisabled(item)"
|
|
62
|
-
>
|
|
63
|
-
<Checkbox :value="getItemSelectStatus(item)"></Checkbox>
|
|
54
|
+
<Checkbox :value="curValList.includes(item._key)"></Checkbox>
|
|
64
55
|
|
|
65
|
-
|
|
56
|
+
<slot :item="item"></slot>
|
|
66
57
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
</span>
|
|
71
|
-
</Option>
|
|
72
|
-
</Select>
|
|
73
|
-
</template>
|
|
58
|
+
<span>{{ item.name || item._name }}</span>
|
|
59
|
+
</Option>
|
|
60
|
+
</Select>
|
|
74
61
|
</template>
|
|
75
|
-
|
|
76
|
-
<!-- 无选项 -->
|
|
77
|
-
<div
|
|
78
|
-
v-else
|
|
79
|
-
class="dsh-subtip"
|
|
80
|
-
>-- 无选择项 --</div>
|
|
81
62
|
</template>
|
|
82
63
|
|
|
83
|
-
<!--
|
|
84
|
-
<
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
:transfer="true"
|
|
90
|
-
>
|
|
91
|
-
<div :class="{
|
|
92
|
-
...commonClass,
|
|
93
|
-
'DshCheckbox-show': true
|
|
94
|
-
}">
|
|
95
|
-
<!-- 有值 -->
|
|
96
|
-
<dsh-tags
|
|
97
|
-
v-if="!$isEmptyData(curValList)"
|
|
98
|
-
class="text"
|
|
99
|
-
:list="curValObjList"
|
|
100
|
-
></dsh-tags>
|
|
64
|
+
<!-- 无选项 -->
|
|
65
|
+
<div
|
|
66
|
+
v-else
|
|
67
|
+
class="dsh-subtip"
|
|
68
|
+
>-- 无选择项 --</div>
|
|
69
|
+
</div>
|
|
101
70
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
71
|
+
<!-- 查看 -->
|
|
72
|
+
<div
|
|
73
|
+
v-else
|
|
74
|
+
class="DshCheckbox-show"
|
|
75
|
+
>
|
|
76
|
+
<!-- 有值 -->
|
|
77
|
+
<bri-tooltip
|
|
78
|
+
v-if="!$isEmptyData(curValList)"
|
|
79
|
+
:content="showMulVal"
|
|
80
|
+
:transfer="true"
|
|
81
|
+
>
|
|
82
|
+
<dsh-tags
|
|
83
|
+
:class="{
|
|
84
|
+
...commonClass,
|
|
85
|
+
'DshCheckbox-show-ellipsis': !(isDetailShow && isHeightAuto)
|
|
86
|
+
}"
|
|
87
|
+
:list="curValObjList"
|
|
88
|
+
></dsh-tags>
|
|
89
|
+
</bri-tooltip>
|
|
90
|
+
|
|
91
|
+
<!-- 无值 -->
|
|
92
|
+
<div
|
|
93
|
+
v-else
|
|
94
|
+
:class="commonClass"
|
|
95
|
+
>
|
|
96
|
+
{{ emptyShowVal }}
|
|
97
|
+
</div>
|
|
109
98
|
</div>
|
|
110
99
|
</template>
|
|
111
100
|
|
|
@@ -125,156 +114,31 @@
|
|
|
125
114
|
computed: {
|
|
126
115
|
selfPropsObj () {
|
|
127
116
|
return {
|
|
117
|
+
_max: 100000000,
|
|
128
118
|
_transfer: true,
|
|
129
|
-
|
|
119
|
+
_transferClassName: "",
|
|
120
|
+
|
|
121
|
+
...this.basePropsObj
|
|
130
122
|
};
|
|
131
123
|
}
|
|
132
124
|
},
|
|
133
125
|
created () {},
|
|
134
126
|
methods: {
|
|
135
|
-
//
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
}
|
|
141
|
-
this.curValList.push(item.value);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
this.curValList = [...this.curValList];
|
|
145
|
-
},
|
|
146
|
-
|
|
147
|
-
getItemColorClass (item) {
|
|
148
|
-
return this.colorMap[item.color] ? item.color : "color-1";
|
|
149
|
-
},
|
|
150
|
-
getItemStyle (item) {
|
|
151
|
-
const color = this.colorMap[item.color] || this.colorMap["color-1"];
|
|
152
|
-
return {
|
|
153
|
-
background: this.useColor ? this.$getColor(color, 0.1) : undefined,
|
|
154
|
-
color: this.useColor ? color : undefined
|
|
155
|
-
};
|
|
156
|
-
},
|
|
157
|
-
// 获取某项的置灰状态
|
|
158
|
-
getItemDisabled (item) {
|
|
159
|
-
return !!(
|
|
160
|
-
!this.finalCanEdit ||
|
|
161
|
-
item._disabled ||
|
|
162
|
-
this.curValList.length >= this.selfPropsObj._max && !this.getItemSelectStatus(item)
|
|
163
|
-
);
|
|
164
|
-
},
|
|
165
|
-
// 获取某项的选中状态
|
|
166
|
-
getItemSelectStatus (item) {
|
|
167
|
-
return this.curValList.includes(item._key);
|
|
127
|
+
// 多选模式 值改变 (pc端下拉方式时,用v-model触发change有问题,组件进来如果值不为空的,就会v-model返值一次)
|
|
128
|
+
changeCheckValue (item) {
|
|
129
|
+
this.clickCheckItem({
|
|
130
|
+
...item,
|
|
131
|
+
_key: item.value
|
|
132
|
+
});
|
|
168
133
|
}
|
|
169
134
|
}
|
|
170
135
|
};
|
|
171
136
|
</script>
|
|
172
137
|
|
|
173
138
|
<style lang="less">
|
|
174
|
-
.
|
|
175
|
-
width: 100%;
|
|
176
|
-
|
|
177
|
-
&-flat {
|
|
178
|
-
width: 100%;
|
|
179
|
-
|
|
180
|
-
// 选中时背景为白色
|
|
181
|
-
.ivu-checkbox-checked .ivu-checkbox-inner {
|
|
182
|
-
background-color: @themeColor;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
&-item {}
|
|
186
|
-
|
|
187
|
-
&-color {
|
|
188
|
-
.ivu-checkbox-border {
|
|
189
|
-
margin-right: 16px;
|
|
190
|
-
height: 32px;
|
|
191
|
-
border: none;
|
|
192
|
-
border-radius: 4px;
|
|
193
|
-
line-height: 32px;
|
|
194
|
-
color: #FFF;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
.ivu-checkbox {
|
|
198
|
-
.ivu-checkbox-inner {
|
|
199
|
-
border: 2px solid @themeColor;
|
|
200
|
-
background-color: transparent;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
.ivu-checkbox-focus {
|
|
204
|
-
box-shadow: 0 0 0 0;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
139
|
+
@import url("../../control.less");
|
|
207
140
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
each(@resourceColor, {
|
|
213
|
-
.color-@{index} {
|
|
214
|
-
.ivu-checkbox {
|
|
215
|
-
.ivu-checkbox-inner {
|
|
216
|
-
border-color: @value;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
.ivu-checkbox-checked {
|
|
221
|
-
.ivu-checkbox-inner {
|
|
222
|
-
background-color: @value;
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
});
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
&-disabled {
|
|
230
|
-
.ivu-checkbox-disabled+span {
|
|
231
|
-
color: #515a6e;
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
&-scroll {
|
|
236
|
-
overflow: auto;
|
|
237
|
-
white-space: nowrap;
|
|
238
|
-
|
|
239
|
-
.bri-scrollbar3();
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
&-show {}
|
|
244
|
-
|
|
245
|
-
.ivu-select-multiple {
|
|
246
|
-
.ivu-select-selection {
|
|
247
|
-
height: 32px;
|
|
248
|
-
.dsh-flex-row-between-center();
|
|
249
|
-
|
|
250
|
-
& > div {
|
|
251
|
-
width: 100%;
|
|
252
|
-
height: 100%;
|
|
253
|
-
word-break: keep-all;
|
|
254
|
-
white-space: nowrap;
|
|
255
|
-
overflow: auto;
|
|
256
|
-
.bri-scrollbar3();
|
|
257
|
-
|
|
258
|
-
.ivu-tag {
|
|
259
|
-
margin: 2px 4px 0px 0px;
|
|
260
|
-
background-color: @borderColor;
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
&.ivu-select-disabled {
|
|
266
|
-
.ivu-select-selection {
|
|
267
|
-
& > div {
|
|
268
|
-
.ivu-tag {
|
|
269
|
-
background-color: @border-disabled;
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
.ivu-select-item-selected:after {
|
|
276
|
-
content: none;
|
|
277
|
-
}
|
|
278
|
-
}
|
|
141
|
+
.DshCheckbox {
|
|
142
|
+
#control-select(checkbox);
|
|
279
143
|
}
|
|
280
144
|
</style>
|