bri-components 1.2.57 → 1.2.59
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/BriUpload.vue +1 -1
- package/src/components/controls/base/DshCascader/DshCascader.vue +68 -231
- package/src/components/controls/base/DshCascader/{cascaderModal.vue → components/cascaderModal.vue} +22 -31
- package/src/components/controls/base/DshCascader/{cascaderPicker.vue → components/cascaderPicker.vue} +22 -18
- package/src/components/controls/base/DshCascader/components/cascaderSimple.vue +141 -0
- package/src/components/controls/base/DshCoordinates.vue +1 -1
- package/src/components/controls/base/DshDate/DshDate.vue +1 -1
- package/src/components/controls/base/DshDate/DshDaterange.vue +1 -1
- package/src/components/controls/base/DshDivider.vue +1 -1
- package/src/components/controls/base/DshEditor.vue +1 -1
- package/src/components/controls/base/DshInput/BriInputs.vue +1 -1
- package/src/components/controls/base/DshInput/DshInput.vue +1 -1
- package/src/components/controls/base/DshNumber/DshNumber.vue +1 -1
- package/src/components/controls/base/DshNumber/DshNumberange.vue +1 -1
- package/src/components/controls/base/DshSelect/DshCheckbox.vue +187 -185
- package/src/components/controls/base/DshSelect/DshSelect.vue +140 -137
- package/src/components/controls/base/DshSwitch/switchMixin.js +1 -1
- package/src/components/controls/extra/themeColor.vue +1 -1
- package/src/components/controls/extra/themeIcon.vue +1 -1
- package/src/components/controls/{base/DshCascader → mixins}/cascaderMixin.js +16 -33
- package/src/components/controls/{base/DshCascader → mixins}/cascaderPickerMixin.js +52 -44
- package/src/components/controls/{controlMixin.js → mixins/controlMixin.js} +25 -4
- package/src/components/controls/mixins/selectMixin.js +192 -0
- package/src/components/controls/senior/BriLabels.vue +1 -1
- package/src/components/controls/senior/DshPackage.vue +1 -1
- package/src/components/controls/senior/cascaderTable.vue +1 -1
- package/src/components/controls/senior/flatTable.vue +1 -1
- package/src/components/controls/senior/selectDepartments.vue +1 -1
- package/src/components/controls/senior/selectUsers/selectUsers.vue +1 -1
- package/src/components/controls/special/DshBack.vue +1 -1
- package/src/components/controls/special/DshUndeveloped.vue +1 -1
- package/src/components/form/DshAdvSearch.vue +1 -1
- package/src/components/list/DshBox/DshCard.vue +153 -38
- package/src/components/list/DshBox/DshPanel.vue +260 -93
- package/src/components/small/BriTooltip.vue +2 -3
- package/src/components/unit/DshFormUnit.vue +7 -19
- package/src/styles/components/index.less +0 -2
- package/src/components/controls/base/DshSelect/selectMixin.js +0 -239
- package/src/styles/components/list/DshBox/DshCard.less +0 -59
- package/src/styles/components/list/DshBox/DshPanel.less +0 -107
- package/src/styles/components/small/BriTooltip.less +0 -0
|
@@ -1,116 +1,110 @@
|
|
|
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': !isFullRow,
|
|
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)"
|
|
26
|
+
:border="useColor"
|
|
27
|
+
@click.native="clickCheckItem(item, index)"
|
|
17
28
|
>
|
|
18
|
-
<
|
|
19
|
-
v-for="(item, index) in listData"
|
|
20
|
-
:key="index"
|
|
21
|
-
:class="[
|
|
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>
|
|
29
|
+
<slot :item="item"></slot>
|
|
34
30
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
<dsh-render :render="tipModalRender"></dsh-render>
|
|
40
|
-
</CheckboxGroup>
|
|
41
|
-
</template>
|
|
31
|
+
<span>{{ item.name || item._name }}</span>
|
|
32
|
+
</Checkbox>
|
|
33
|
+
</CheckboxGroup>
|
|
34
|
+
</template>
|
|
42
35
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
36
|
+
<!-- dropdown模式 -->
|
|
37
|
+
<template v-else>
|
|
38
|
+
<Select
|
|
39
|
+
:class="{
|
|
40
|
+
'DshCheckbox-dropdown': true,
|
|
41
|
+
}"
|
|
42
|
+
:value="curValList"
|
|
43
|
+
:multiple="true"
|
|
44
|
+
:placeholder="selfPropsObj._placeholder"
|
|
45
|
+
:disabled="selfPropsObj._disabled"
|
|
46
|
+
:filterable="selfPropsObj._filterable"
|
|
47
|
+
:transfer="selfPropsObj._transfer"
|
|
48
|
+
:transfer-class-name="selfPropsObj._transferClassName"
|
|
49
|
+
:max-tag-count="selfPropsObj._maxTagCount"
|
|
50
|
+
@on-select="changeCheckValue"
|
|
51
|
+
>
|
|
52
|
+
<Option
|
|
53
|
+
v-for="(item, index) in listData"
|
|
54
|
+
:key="item._key"
|
|
55
|
+
:value="item._key"
|
|
56
|
+
:label="item.name || item._name"
|
|
57
|
+
:disabled="getCheckItemDisabled(item, index)"
|
|
55
58
|
>
|
|
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>
|
|
59
|
+
<Checkbox :value="getCheckItemStatus(item)"></Checkbox>
|
|
64
60
|
|
|
65
|
-
|
|
61
|
+
<slot :item="item"></slot>
|
|
66
62
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
</span>
|
|
71
|
-
</Option>
|
|
72
|
-
</Select>
|
|
73
|
-
</template>
|
|
63
|
+
<span>{{ item.name || item._name }}</span>
|
|
64
|
+
</Option>
|
|
65
|
+
</Select>
|
|
74
66
|
</template>
|
|
75
|
-
|
|
76
|
-
<!-- 无选项 -->
|
|
77
|
-
<div
|
|
78
|
-
v-else
|
|
79
|
-
class="dsh-subtip"
|
|
80
|
-
>-- 无选择项 --</div>
|
|
81
67
|
</template>
|
|
82
68
|
|
|
83
|
-
<!--
|
|
84
|
-
<
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
69
|
+
<!-- 无选项 -->
|
|
70
|
+
<div
|
|
71
|
+
v-else
|
|
72
|
+
class="dsh-subtip"
|
|
73
|
+
>-- 无选择项 --</div>
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
<!-- 查看 -->
|
|
77
|
+
<div
|
|
78
|
+
v-else
|
|
79
|
+
class="DshCheckbox-show"
|
|
80
|
+
>
|
|
81
|
+
<!-- 有值 -->
|
|
82
|
+
<bri-tooltip
|
|
83
|
+
v-if="!$isEmptyData(curValList)"
|
|
84
|
+
:content="showMulVal"
|
|
85
|
+
:transfer="true"
|
|
86
|
+
>
|
|
87
|
+
<dsh-tags
|
|
88
|
+
:class="{
|
|
92
89
|
...commonClass,
|
|
93
|
-
'DshCheckbox-show':
|
|
94
|
-
}"
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
class="text"
|
|
99
|
-
:list="curValObjList"
|
|
100
|
-
></dsh-tags>
|
|
90
|
+
'DshCheckbox-show-ellipsis': !(isDetailShow && isFullRow)
|
|
91
|
+
}"
|
|
92
|
+
:list="curValObjList"
|
|
93
|
+
></dsh-tags>
|
|
94
|
+
</bri-tooltip>
|
|
101
95
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
</
|
|
96
|
+
<!-- 无值 -->
|
|
97
|
+
<div
|
|
98
|
+
v-else
|
|
99
|
+
:class="commonClass"
|
|
100
|
+
>
|
|
101
|
+
{{ emptyShowVal }}
|
|
102
|
+
</div>
|
|
109
103
|
</div>
|
|
110
104
|
</template>
|
|
111
105
|
|
|
112
106
|
<script>
|
|
113
|
-
import selectMixin from "
|
|
107
|
+
import selectMixin from "../../mixins/selectMixin.js";
|
|
114
108
|
|
|
115
109
|
export default {
|
|
116
110
|
name: "DshCheckbox",
|
|
@@ -125,46 +119,22 @@
|
|
|
125
119
|
computed: {
|
|
126
120
|
selfPropsObj () {
|
|
127
121
|
return {
|
|
122
|
+
_max: 100000000,
|
|
128
123
|
_transfer: true,
|
|
129
|
-
|
|
124
|
+
_transferClassName: "",
|
|
125
|
+
|
|
126
|
+
...this.basePropsObj
|
|
130
127
|
};
|
|
131
128
|
}
|
|
132
129
|
},
|
|
133
130
|
created () {},
|
|
134
131
|
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);
|
|
132
|
+
// 多选模式 值改变 (pc端下拉方式时,用v-model触发change有问题,组件进来如果值不为空的,就会v-model返值一次)
|
|
133
|
+
changeCheckValue (item) {
|
|
134
|
+
this.clickCheckItem({
|
|
135
|
+
...item,
|
|
136
|
+
_key: item.value
|
|
137
|
+
});
|
|
168
138
|
}
|
|
169
139
|
}
|
|
170
140
|
};
|
|
@@ -172,108 +142,140 @@
|
|
|
172
142
|
|
|
173
143
|
<style lang="less">
|
|
174
144
|
.DshCheckbox {
|
|
175
|
-
width: 100%;
|
|
176
|
-
|
|
177
145
|
&-flat {
|
|
178
146
|
width: 100%;
|
|
179
147
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
}
|
|
148
|
+
.ivu-checkbox-wrapper {
|
|
149
|
+
margin-bottom: 4px;
|
|
150
|
+
margin-right: 16px;
|
|
184
151
|
|
|
185
|
-
|
|
152
|
+
.ivu-checkbox {
|
|
153
|
+
&.ivu-checkbox-checked {
|
|
154
|
+
.ivu-checkbox-inner {
|
|
155
|
+
background-color: @themeColor;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
186
160
|
|
|
187
161
|
&-color {
|
|
188
|
-
.ivu-checkbox-
|
|
189
|
-
margin-right: 16px;
|
|
162
|
+
.ivu-checkbox-wrapper {
|
|
190
163
|
height: 32px;
|
|
191
164
|
border: none;
|
|
192
165
|
border-radius: 4px;
|
|
193
166
|
line-height: 32px;
|
|
194
|
-
color: #FFF;
|
|
195
|
-
}
|
|
196
167
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
168
|
+
.ivu-checkbox {
|
|
169
|
+
.ivu-checkbox-inner {
|
|
170
|
+
border: 2px solid @themeColor;
|
|
171
|
+
background-color: transparent;
|
|
172
|
+
}
|
|
173
|
+
.ivu-checkbox-focus {
|
|
174
|
+
box-shadow: 0 0 0 0;
|
|
175
|
+
}
|
|
202
176
|
|
|
203
|
-
|
|
204
|
-
|
|
177
|
+
&.ivu-checkbox-checked {
|
|
178
|
+
.ivu-checkbox-inner {
|
|
179
|
+
&:after {
|
|
180
|
+
top: 2px;
|
|
181
|
+
left: 4px;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
205
185
|
}
|
|
206
|
-
}
|
|
207
186
|
|
|
208
|
-
|
|
209
|
-
|
|
187
|
+
&-disabled {
|
|
188
|
+
background-color: #f3f3f3!important;
|
|
189
|
+
color: #E5E5E5!important;
|
|
190
|
+
|
|
191
|
+
.ivu-checkbox.ivu-checkbox-disabled {
|
|
192
|
+
.ivu-checkbox-inner {
|
|
193
|
+
border-color: #E5E5E5;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
&.ivu-checkbox-checked {
|
|
197
|
+
.ivu-checkbox-inner {
|
|
198
|
+
background-color: #E5E5E5;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
& + span {
|
|
203
|
+
color: #E5E5E5;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
210
207
|
}
|
|
211
208
|
|
|
209
|
+
// ivu-checkbox-wrapper 和 color-1 在一个div上
|
|
212
210
|
each(@resourceColor, {
|
|
213
211
|
.color-@{index} {
|
|
214
212
|
.ivu-checkbox {
|
|
215
213
|
.ivu-checkbox-inner {
|
|
216
214
|
border-color: @value;
|
|
217
215
|
}
|
|
218
|
-
}
|
|
219
216
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
217
|
+
&.ivu-checkbox-checked {
|
|
218
|
+
.ivu-checkbox-inner {
|
|
219
|
+
background-color: @value;
|
|
220
|
+
}
|
|
223
221
|
}
|
|
224
222
|
}
|
|
225
223
|
}
|
|
226
224
|
});
|
|
227
225
|
}
|
|
228
226
|
|
|
229
|
-
&-disabled {
|
|
230
|
-
.ivu-checkbox-disabled+span {
|
|
231
|
-
color: #515a6e;
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
|
|
235
227
|
&-scroll {
|
|
236
|
-
|
|
228
|
+
.bri-scrollbar3();
|
|
237
229
|
white-space: nowrap;
|
|
230
|
+
overflow: auto;
|
|
238
231
|
|
|
239
|
-
.
|
|
232
|
+
.ivu-checkbox-wrapper {
|
|
233
|
+
margin-bottom: 4px;
|
|
234
|
+
}
|
|
240
235
|
}
|
|
241
236
|
}
|
|
242
237
|
|
|
243
|
-
&-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
.dsh-flex-row-between-center();
|
|
238
|
+
&-dropdown {
|
|
239
|
+
.ivu-select-multiple {
|
|
240
|
+
.ivu-select-selection {
|
|
241
|
+
height: 32px;
|
|
242
|
+
.dsh-flex-row-between-center();
|
|
249
243
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
244
|
+
& > div {
|
|
245
|
+
width: 100%;
|
|
246
|
+
height: 100%;
|
|
247
|
+
word-break: keep-all;
|
|
248
|
+
white-space: nowrap;
|
|
249
|
+
overflow: auto;
|
|
250
|
+
.bri-scrollbar3();
|
|
257
251
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
252
|
+
.ivu-tag {
|
|
253
|
+
margin: 2px 4px 0px 0px;
|
|
254
|
+
background-color: @borderColor;
|
|
255
|
+
}
|
|
261
256
|
}
|
|
262
257
|
}
|
|
263
|
-
}
|
|
264
258
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
259
|
+
&.ivu-select-disabled {
|
|
260
|
+
.ivu-select-selection {
|
|
261
|
+
& > div {
|
|
262
|
+
.ivu-tag {
|
|
263
|
+
background-color: @border-disabled;
|
|
264
|
+
}
|
|
270
265
|
}
|
|
271
266
|
}
|
|
272
267
|
}
|
|
268
|
+
|
|
269
|
+
.ivu-select-item-selected:after {
|
|
270
|
+
content: none;
|
|
271
|
+
}
|
|
273
272
|
}
|
|
273
|
+
}
|
|
274
274
|
|
|
275
|
-
|
|
276
|
-
|
|
275
|
+
// 查看
|
|
276
|
+
&-show {
|
|
277
|
+
&-ellipsis {
|
|
278
|
+
.dsh-ellipsis();
|
|
277
279
|
}
|
|
278
280
|
}
|
|
279
281
|
}
|