bri-components 1.2.49 → 1.2.51
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/BriControlInput.vue +13 -9
- package/src/components/controls/base/DshCascader/DshCascader.vue +40 -23
- package/src/components/controls/base/DshCascader/InfoCascader.vue +7 -15
- package/src/components/controls/base/DshDate/DshDate.vue +146 -0
- package/src/components/controls/base/{DshDaterange.vue → DshDate/DshDaterange.vue} +74 -64
- package/src/components/controls/base/DshEditor.vue +1 -1
- package/src/components/controls/base/{BriInputs.vue → DshInput/BriInputs.vue} +1 -1
- package/src/components/controls/base/{DshInput.vue → DshInput/DshInput.vue} +21 -4
- package/src/components/controls/base/DshNumber/DshNumber.vue +33 -2
- package/src/components/controls/base/{DshNumberange.vue → DshNumber/DshNumberange.vue} +37 -2
- package/src/components/controls/base/DshSelect/DshCheckbox.vue +280 -0
- package/src/components/controls/base/DshSelect/DshSelect.vue +319 -0
- package/src/components/controls/base/DshSelect/selectMixin.js +239 -0
- package/src/components/controls/base/DshSwitch/DshSwitch.vue +79 -0
- package/src/components/controls/base/DshSwitch/switchMixin.js +73 -0
- package/src/components/controls/controlMap.js +8 -11
- package/src/components/controls/controlMixin.js +38 -6
- package/src/components/controls/senior/BriLabels.vue +1 -1
- package/src/components/controls/senior/selectDepartments.vue +9 -13
- package/src/components/controls/senior/selectUsers/selectUsers.vue +23 -21
- package/src/components/controls/special/DshBack.vue +1 -1
- package/src/components/controls/special/DshUndeveloped.vue +1 -1
- package/src/components/form/DshAdvSearch.vue +155 -3
- package/src/components/form/DshDefaultSearch.vue +84 -40
- package/src/components/form/DshForm.vue +24 -0
- package/src/components/form/searchMixin.js +5 -18
- package/src/components/other/BriGantt.vue +2 -2
- package/src/components/unit/DshFormUnit.vue +111 -2
- package/src/components/unit/DshListUnit.vue +6 -0
- package/src/index.js +10 -10
- package/src/styles/components/controls/base/DshInput.less +0 -16
- package/src/styles/components/index.less +0 -14
- package/src/styles/components/other/BriGantt.less +1 -12
- package/src/styles/index.less +5 -3
- package/src/styles/reset-iview-controls.less +104 -0
- package/src/abolish/BriTransfer.less +0 -65
- package/src/abolish/BriTransfer.vue +0 -71
- package/src/abolish/BriTree.less +0 -57
- package/src/abolish/DshCascaders.less +0 -11
- package/src/abolish/DshCascaders.vue +0 -151
- package/src/abolish/DshCrumbs.less +0 -0
- package/src/abolish/DshCrumbs.vue +0 -62
- package/src/abolish/DshCrumbsItem.vue +0 -109
- package/src/abolish/DshEditPanel.less +0 -70
- package/src/abolish/DshEditPanel.vue +0 -152
- package/src/abolish/DshFileShow.less +0 -61
- package/src/abolish/DshFileShow.vue +0 -0
- package/src/abolish/DshFlatTable.less +0 -93
- package/src/abolish/DshFlatTable.vue +0 -605
- package/src/abolish/DshMenu.less +0 -37
- package/src/abolish/DshMenu.vue +0 -133
- package/src/abolish/DshTexts.less +0 -13
- package/src/abolish/DshTexts.vue +0 -89
- package/src/components/controls/base/DshCheckbox.vue +0 -213
- package/src/components/controls/base/DshDate.vue +0 -122
- package/src/components/controls/base/DshSelect.vue +0 -242
- package/src/components/controls/base/DshSwitch.vue +0 -70
- package/src/components/controls/base/selectMixin.js +0 -110
- package/src/styles/components/controls/base/DshCheckbox.less +0 -115
- package/src/styles/components/controls/base/DshDate.less +0 -15
- package/src/styles/components/controls/base/DshDaterange.less +0 -49
- package/src/styles/components/controls/base/DshNumber.less +0 -55
- package/src/styles/components/controls/base/DshNumberange.less +0 -29
- package/src/styles/components/controls/base/DshSelect.less +0 -190
- package/src/styles/components/form/DshAdvSearch.less +0 -149
- package/src/styles/components/form/DshDefaultSearch.less +0 -82
- package/src/styles/components/form/DshForm.less +0 -18
- package/src/styles/components/unit/DshFormUnit.less +0 -105
- package/src/styles/components/unit/DshListUnit.less +0 -3
- /package/src/{abolish/DshCrumbItem.less → styles/reset-iview-other.less} +0 -0
- /package/src/styles/{reset-iview.less → reset-iview-variables.less} +0 -0
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
2
|
+
<!-- 单选模式 -->
|
|
3
|
+
<div
|
|
4
|
+
v-if="!multipleMode"
|
|
5
|
+
class="DshNumber"
|
|
6
|
+
>
|
|
3
7
|
<!-- 编辑 -->
|
|
4
8
|
<template v-if="canEdit">
|
|
5
9
|
<BriInputNumber
|
|
@@ -46,11 +50,21 @@
|
|
|
46
50
|
</template>
|
|
47
51
|
</template>
|
|
48
52
|
</div>
|
|
53
|
+
|
|
54
|
+
<!-- 多选模式 -->
|
|
55
|
+
<dsh-numberange
|
|
56
|
+
v-else
|
|
57
|
+
:canEdit="canEdit"
|
|
58
|
+
:value="value"
|
|
59
|
+
:propsObj="propsObj"
|
|
60
|
+
@change="change"
|
|
61
|
+
></dsh-numberange>
|
|
49
62
|
</template>
|
|
50
63
|
|
|
51
64
|
<script>
|
|
52
65
|
import controlMixin from "../../controlMixin.js";
|
|
53
66
|
import BriInputNumber from "./BriInputNumber/BriInputNumber.vue";
|
|
67
|
+
import DshNumberange from "./DshNumberange.vue";
|
|
54
68
|
|
|
55
69
|
export default {
|
|
56
70
|
name: "DshNumber",
|
|
@@ -58,7 +72,8 @@
|
|
|
58
72
|
controlMixin
|
|
59
73
|
],
|
|
60
74
|
components: {
|
|
61
|
-
BriInputNumber
|
|
75
|
+
BriInputNumber,
|
|
76
|
+
DshNumberange
|
|
62
77
|
},
|
|
63
78
|
props: {},
|
|
64
79
|
data () {
|
|
@@ -133,3 +148,19 @@
|
|
|
133
148
|
methods: {}
|
|
134
149
|
};
|
|
135
150
|
</script>
|
|
151
|
+
|
|
152
|
+
<style lang="less">
|
|
153
|
+
.DshNumber {
|
|
154
|
+
width: 100%;
|
|
155
|
+
|
|
156
|
+
&-edit {
|
|
157
|
+
&-suffix {
|
|
158
|
+
min-width: 32px;
|
|
159
|
+
border-left: 1px solid @borderColor;
|
|
160
|
+
background-color: #F0F0F0;
|
|
161
|
+
text-align: center;
|
|
162
|
+
color: @textColor;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
</style>
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
</template>
|
|
53
53
|
|
|
54
54
|
<script>
|
|
55
|
-
import controlMixin from "
|
|
56
|
-
import BriInputNumber from "./
|
|
55
|
+
import controlMixin from "../../controlMixin.js";
|
|
56
|
+
import BriInputNumber from "./BriInputNumber/BriInputNumber.vue";
|
|
57
57
|
|
|
58
58
|
export default {
|
|
59
59
|
name: "DshNumberange",
|
|
@@ -125,3 +125,38 @@
|
|
|
125
125
|
methods: {}
|
|
126
126
|
};
|
|
127
127
|
</script>
|
|
128
|
+
|
|
129
|
+
<style lang="less">
|
|
130
|
+
.DshNumberange {
|
|
131
|
+
width: 100%;
|
|
132
|
+
display: flex;
|
|
133
|
+
align-items: center;
|
|
134
|
+
|
|
135
|
+
&-left,
|
|
136
|
+
&-right {
|
|
137
|
+
flex: 7;
|
|
138
|
+
flex: 7;
|
|
139
|
+
min-width: 0px;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
&-center {
|
|
143
|
+
flex: 1;
|
|
144
|
+
min-width: 10px;
|
|
145
|
+
text-align: center;
|
|
146
|
+
color: @textColor;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
&-suffix {
|
|
150
|
+
padding-right: 8px;
|
|
151
|
+
padding-left: 2px;
|
|
152
|
+
line-height: 30px;
|
|
153
|
+
white-space: nowrap;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
input {
|
|
157
|
+
text-overflow: ellipsis;
|
|
158
|
+
overflow: hidden;
|
|
159
|
+
white-space: nowrap;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
</style>
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="DshCheckbox">
|
|
3
|
+
<!-- 编辑 -->
|
|
4
|
+
<template v-if="canEdit">
|
|
5
|
+
<!-- 有选项 -->
|
|
6
|
+
<template v-if="listData.length">
|
|
7
|
+
<!-- flat方式 -->
|
|
8
|
+
<template v-if="showType === 'flat'">
|
|
9
|
+
<CheckboxGroup
|
|
10
|
+
:class="{
|
|
11
|
+
'DshCheckbox-flat': true,
|
|
12
|
+
'DshCheckbox-flat-color': useColor,
|
|
13
|
+
'DshCheckbox-flat-disabled': !canEdit,
|
|
14
|
+
'DshCheckbox-flat-scroll': selfPropsObj._span < 24 && !selfPropsObj._br,
|
|
15
|
+
}"
|
|
16
|
+
v-model="curValList"
|
|
17
|
+
>
|
|
18
|
+
<Checkbox
|
|
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>
|
|
34
|
+
|
|
35
|
+
<span>{{ item.name || item._name }}</span>
|
|
36
|
+
</Checkbox>
|
|
37
|
+
|
|
38
|
+
<!-- tip项弹框提示 -->
|
|
39
|
+
<dsh-render :render="tipModalRender"></dsh-render>
|
|
40
|
+
</CheckboxGroup>
|
|
41
|
+
</template>
|
|
42
|
+
|
|
43
|
+
<!-- dropdown模式 -->
|
|
44
|
+
<template v-else>
|
|
45
|
+
<Select
|
|
46
|
+
v-model="value[controlKey]"
|
|
47
|
+
:multiple="true"
|
|
48
|
+
:placeholder="selfPropsObj._placeholder"
|
|
49
|
+
:disabled="!finalCanEdit"
|
|
50
|
+
:filterable="selfPropsObj._filterable"
|
|
51
|
+
:transfer="selfPropsObj._transfer"
|
|
52
|
+
:transfer-class-name="selfPropsObj._transferClassName"
|
|
53
|
+
:max-tag-count="selfPropsObj._maxTagCount"
|
|
54
|
+
@on-select="changeSelect"
|
|
55
|
+
>
|
|
56
|
+
<Option
|
|
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>
|
|
64
|
+
|
|
65
|
+
<slot :item="item"></slot>
|
|
66
|
+
|
|
67
|
+
<span>{{ item.name || item._name }}</span>
|
|
68
|
+
<span style="float:right; padding-right:20px">
|
|
69
|
+
{{ item.rightName }}
|
|
70
|
+
</span>
|
|
71
|
+
</Option>
|
|
72
|
+
</Select>
|
|
73
|
+
</template>
|
|
74
|
+
</template>
|
|
75
|
+
|
|
76
|
+
<!-- 无选项 -->
|
|
77
|
+
<div
|
|
78
|
+
v-else
|
|
79
|
+
class="dsh-subtip"
|
|
80
|
+
>-- 无选择项 --</div>
|
|
81
|
+
</template>
|
|
82
|
+
|
|
83
|
+
<!-- 查看 -->
|
|
84
|
+
<template v-else>
|
|
85
|
+
<bri-tooltip
|
|
86
|
+
:content="showMulVal"
|
|
87
|
+
placement="top"
|
|
88
|
+
maxWidth="200"
|
|
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>
|
|
101
|
+
|
|
102
|
+
<!-- 无值 -->
|
|
103
|
+
<template v-else>
|
|
104
|
+
{{ emptyShowVal }}
|
|
105
|
+
</template>
|
|
106
|
+
</div>
|
|
107
|
+
</bri-tooltip>
|
|
108
|
+
</template>
|
|
109
|
+
</div>
|
|
110
|
+
</template>
|
|
111
|
+
|
|
112
|
+
<script>
|
|
113
|
+
import selectMixin from "./selectMixin.js";
|
|
114
|
+
|
|
115
|
+
export default {
|
|
116
|
+
name: "DshCheckbox",
|
|
117
|
+
mixins: [
|
|
118
|
+
selectMixin
|
|
119
|
+
],
|
|
120
|
+
components: {},
|
|
121
|
+
props: {},
|
|
122
|
+
data () {
|
|
123
|
+
return {};
|
|
124
|
+
},
|
|
125
|
+
computed: {
|
|
126
|
+
selfPropsObj () {
|
|
127
|
+
return {
|
|
128
|
+
_transfer: true,
|
|
129
|
+
...this.selectPropsObj
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
created () {},
|
|
134
|
+
methods: {
|
|
135
|
+
// 下拉框的change (下拉方式时用v-model触发change有问题,组件进来如果值不为空的,就会v-model返值一次)
|
|
136
|
+
changeSelect (item) {
|
|
137
|
+
if (this.curValList.includes(item.value)) {
|
|
138
|
+
let itemIndex = this.curValList.findIndex(valItem => valItem === item.value);
|
|
139
|
+
this.curValList.splice(itemIndex, 1);
|
|
140
|
+
} else {
|
|
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);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
</script>
|
|
172
|
+
|
|
173
|
+
<style lang="less">
|
|
174
|
+
.DshCheckbox {
|
|
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
|
+
}
|
|
207
|
+
|
|
208
|
+
.ivu-checkbox-disabled+span {
|
|
209
|
+
color: inherit;
|
|
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
|
+
}
|
|
279
|
+
}
|
|
280
|
+
</style>
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<!-- 单选模式 -->
|
|
3
|
+
<div
|
|
4
|
+
v-if="!multipleMode"
|
|
5
|
+
class="DshSelect"
|
|
6
|
+
>
|
|
7
|
+
<template v-if="canEdit">
|
|
8
|
+
<!-- 有选项 -->
|
|
9
|
+
<template v-if="listData.length">
|
|
10
|
+
<!-- flat方式 -->
|
|
11
|
+
<template v-if="['flat', 'button'].includes(showType)">
|
|
12
|
+
<RadioGroup
|
|
13
|
+
:class="{
|
|
14
|
+
'DshSelect-flat': true,
|
|
15
|
+
'DshSelect-flat-color': useColor,
|
|
16
|
+
'DshSelect-flat-scroll': selfPropsObj._span < 24 && !selfPropsObj._br
|
|
17
|
+
}"
|
|
18
|
+
v-model="value[controlKey]"
|
|
19
|
+
:type="radioGroupType"
|
|
20
|
+
@on-change="change"
|
|
21
|
+
>
|
|
22
|
+
<Radio
|
|
23
|
+
v-for="(item, index) in listData"
|
|
24
|
+
:key="index"
|
|
25
|
+
:class="getItemColorClass(item)"
|
|
26
|
+
:style="getItemStyle(item)"
|
|
27
|
+
:label="item._key"
|
|
28
|
+
:disabled="getItemDisabled(item)"
|
|
29
|
+
:border="useColor"
|
|
30
|
+
@click.native="cancelSelect(item)"
|
|
31
|
+
>
|
|
32
|
+
<span @click.stop="clickOpenTip(item)">
|
|
33
|
+
{{ item.name || item._name }}
|
|
34
|
+
</span>
|
|
35
|
+
</Radio>
|
|
36
|
+
</RadioGroup>
|
|
37
|
+
|
|
38
|
+
<!-- tip项弹框提示 -->
|
|
39
|
+
<dsh-render :render="tipModalRender"></dsh-render>
|
|
40
|
+
</template>
|
|
41
|
+
|
|
42
|
+
<!-- dropdown模式 -->
|
|
43
|
+
<template v-else>
|
|
44
|
+
<Select
|
|
45
|
+
v-model="curVal"
|
|
46
|
+
:placeholder="selfPropsObj._placeholder"
|
|
47
|
+
:multiple="false"
|
|
48
|
+
:disabled="!finalCanEdit"
|
|
49
|
+
:clearable="selfPropsObj._clearable"
|
|
50
|
+
:filterable="selfPropsObj._filterable"
|
|
51
|
+
:size="selfPropsObj._size"
|
|
52
|
+
:transfer="selfPropsObj._transfer"
|
|
53
|
+
:transfer-class-name="selfPropsObj._transferClassName"
|
|
54
|
+
@on-change="change"
|
|
55
|
+
>
|
|
56
|
+
<!-- </Option>必须和输出内容在一行,否则出现空格导致_filterable出bug -->
|
|
57
|
+
<Option
|
|
58
|
+
v-for="(item, index) in listData"
|
|
59
|
+
:key="index"
|
|
60
|
+
:value="item._key"
|
|
61
|
+
:label="item.name || item._name"
|
|
62
|
+
:disabled="getItemDisabled(item)"
|
|
63
|
+
>
|
|
64
|
+
<Icon
|
|
65
|
+
v-if="item.icon || item.customIcon"
|
|
66
|
+
:type="item.icon"
|
|
67
|
+
:custom="item.customIcon ? `bico-font ${item.customIcon}` : undefined"
|
|
68
|
+
:color="item.color"
|
|
69
|
+
:size="item.size || 20"
|
|
70
|
+
/>{{ item.name || item._name }}
|
|
71
|
+
</Option>
|
|
72
|
+
</Select>
|
|
73
|
+
</template>
|
|
74
|
+
</template>
|
|
75
|
+
|
|
76
|
+
<!-- 无选项 -->
|
|
77
|
+
<div
|
|
78
|
+
v-else
|
|
79
|
+
class="dsh-subtip"
|
|
80
|
+
>-- 无选择项 --</div>
|
|
81
|
+
</template>
|
|
82
|
+
|
|
83
|
+
<!-- 查看 -->
|
|
84
|
+
<template v-else>
|
|
85
|
+
<bri-tooltip
|
|
86
|
+
:content="showVal"
|
|
87
|
+
maxWidth="200"
|
|
88
|
+
placement="top"
|
|
89
|
+
:transfer="true"
|
|
90
|
+
>
|
|
91
|
+
<div :class="{
|
|
92
|
+
...commonClass,
|
|
93
|
+
'DshSelect-show': true
|
|
94
|
+
}">
|
|
95
|
+
<!-- 有值 -->
|
|
96
|
+
<dsh-tags
|
|
97
|
+
v-if="!$isEmptyData(curVal)"
|
|
98
|
+
class="text"
|
|
99
|
+
:list="[curValObj]"
|
|
100
|
+
></dsh-tags>
|
|
101
|
+
|
|
102
|
+
<!-- 无值 -->
|
|
103
|
+
<template v-else>
|
|
104
|
+
{{ emptyShowVal }}
|
|
105
|
+
</template>
|
|
106
|
+
</div>
|
|
107
|
+
</bri-tooltip>
|
|
108
|
+
</template>
|
|
109
|
+
</div>
|
|
110
|
+
|
|
111
|
+
<!-- 多选模式 -->
|
|
112
|
+
<dsh-checkbox
|
|
113
|
+
v-else
|
|
114
|
+
:canEdit="canEdit"
|
|
115
|
+
:value="value"
|
|
116
|
+
:propsObj="propsObj"
|
|
117
|
+
@change="change"
|
|
118
|
+
></dsh-checkbox>
|
|
119
|
+
</template>
|
|
120
|
+
|
|
121
|
+
<script>
|
|
122
|
+
import selectMixin from "./selectMixin.js";
|
|
123
|
+
import DshCheckbox from "./DshCheckbox.vue";
|
|
124
|
+
|
|
125
|
+
export default {
|
|
126
|
+
name: "DshSelect",
|
|
127
|
+
mixins: [
|
|
128
|
+
selectMixin
|
|
129
|
+
],
|
|
130
|
+
components: {
|
|
131
|
+
DshCheckbox
|
|
132
|
+
},
|
|
133
|
+
props: {},
|
|
134
|
+
data () {
|
|
135
|
+
return {};
|
|
136
|
+
},
|
|
137
|
+
computed: {
|
|
138
|
+
selfPropsObj () {
|
|
139
|
+
return {
|
|
140
|
+
_transfer: true,
|
|
141
|
+
...this.selectPropsObj
|
|
142
|
+
};
|
|
143
|
+
},
|
|
144
|
+
radioGroupType () {
|
|
145
|
+
return this.showType === "button" ? "button" : undefined;
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
created () {},
|
|
149
|
+
methods: {
|
|
150
|
+
// 取消flat模式的选择项
|
|
151
|
+
cancelSelect (item) {
|
|
152
|
+
if (item._disabled !== true && this.selfPropsObj._clearable !== false) {
|
|
153
|
+
if (item._key === this.curVal) {
|
|
154
|
+
this.value[this.controlKey] = "";
|
|
155
|
+
this.change();
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
this.clickOpenTip(item);
|
|
160
|
+
},
|
|
161
|
+
change (...params) {
|
|
162
|
+
// 修复clear后值为undefined,数据库不更新数据bug
|
|
163
|
+
if (this.value[this.controlKey] == undefined) {
|
|
164
|
+
this.value[this.controlKey] = "";
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
this.$emit("change", this.curVal);
|
|
168
|
+
},
|
|
169
|
+
|
|
170
|
+
getItemColorClass (item) {
|
|
171
|
+
return this.colorMap[item.color] ? item.color : "color-1";
|
|
172
|
+
},
|
|
173
|
+
getItemStyle (item) {
|
|
174
|
+
const color = this.colorMap[item.color] || this.colorMap["color-1"];
|
|
175
|
+
return {
|
|
176
|
+
backgroundColor: this.useColor ? this.$getColor(color, 0.1) : undefined,
|
|
177
|
+
color: this.useColor ? color : undefined
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
</script>
|
|
183
|
+
|
|
184
|
+
<style lang="less">
|
|
185
|
+
.DshSelect {
|
|
186
|
+
width: 100%;
|
|
187
|
+
|
|
188
|
+
&-flat {
|
|
189
|
+
width: 100%;
|
|
190
|
+
|
|
191
|
+
&-color {
|
|
192
|
+
.ivu-radio-border {
|
|
193
|
+
height: 32px;
|
|
194
|
+
line-height: 32px;
|
|
195
|
+
border-radius: 4px;
|
|
196
|
+
border: none;
|
|
197
|
+
color: #FFF;
|
|
198
|
+
margin-right: 16px;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.ivu-radio {
|
|
202
|
+
.ivu-radio-inner {
|
|
203
|
+
border: 2px solid @themeColor;
|
|
204
|
+
background-color: transparent;
|
|
205
|
+
width: 14px;
|
|
206
|
+
height: 14px;
|
|
207
|
+
|
|
208
|
+
&::after {
|
|
209
|
+
width: 6px;
|
|
210
|
+
height: 6px;
|
|
211
|
+
left: 2px;
|
|
212
|
+
top: 2px;
|
|
213
|
+
background-color: transparent;
|
|
214
|
+
opacity: 1;
|
|
215
|
+
transform: scale(1);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.ivu-radio-focus {
|
|
220
|
+
box-shadow: 0 0 0 0;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.ivu-radio-checked {
|
|
225
|
+
.ivu-radio-inner {
|
|
226
|
+
&::after {
|
|
227
|
+
background-color: @themeColor;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
each(@resourceColor, {
|
|
233
|
+
.color-@{index} {
|
|
234
|
+
.ivu-radio {
|
|
235
|
+
.ivu-radio-inner {
|
|
236
|
+
border-color: @value;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.ivu-radio-checked {
|
|
241
|
+
.ivu-radio-inner {
|
|
242
|
+
&::after {
|
|
243
|
+
background-color: @value;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
&-scroll {
|
|
252
|
+
overflow: auto;
|
|
253
|
+
white-space: nowrap;
|
|
254
|
+
|
|
255
|
+
.bri-scrollbar3();
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
&-modal {
|
|
260
|
+
.ivu-modal-wrap {
|
|
261
|
+
display: flex;
|
|
262
|
+
align-items: center;
|
|
263
|
+
justify-content: center;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.ivu-modal {
|
|
267
|
+
width: 544px !important;
|
|
268
|
+
position: static;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.ivu-modal-content {
|
|
272
|
+
border-radius: 8px;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.ivu-modal-header {
|
|
276
|
+
border-bottom: none;
|
|
277
|
+
padding: 32px 32px 0;
|
|
278
|
+
|
|
279
|
+
.ivu-modal-header-inner {
|
|
280
|
+
font-size: 18px;
|
|
281
|
+
font-family: Microsoft YaHei-Semibold, Microsoft YaHei;
|
|
282
|
+
font-weight: 600;
|
|
283
|
+
color: #252F36;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.DshModal-close {
|
|
288
|
+
right: 30px !important;
|
|
289
|
+
top: 30px !important;
|
|
290
|
+
background: #F4F6F8;
|
|
291
|
+
border-radius: 4px 4px 4px 4px;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.ivu-modal-body {
|
|
295
|
+
padding: 24px 32px 32px;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
&-footer {
|
|
299
|
+
margin-top: 24px;
|
|
300
|
+
text-align: right;
|
|
301
|
+
|
|
302
|
+
.ivu-btn {
|
|
303
|
+
font-size: 16px;
|
|
304
|
+
font-family: Microsoft YaHei-Semibold, Microsoft YaHei;
|
|
305
|
+
font-weight: 600;
|
|
306
|
+
border-radius: 4px;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
&-tip {
|
|
312
|
+
cursor: pointer;
|
|
313
|
+
|
|
314
|
+
.ivu-radio {
|
|
315
|
+
display: none;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
</style>
|