bri-components 1.2.49 → 1.2.50
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 +4 -3
- 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} +55 -1
- package/src/components/controls/base/{BriInputs.vue → DshInput/BriInputs.vue} +1 -1
- package/src/components/controls/base/{DshInput.vue → DshInput/DshInput.vue} +24 -5
- package/src/components/controls/base/DshNumber/DshNumber.vue +74 -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 +241 -0
- package/src/components/controls/base/DshSwitch/DshSwitch.vue +84 -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 +33 -5
- 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/form/DshAdvSearch.vue +155 -3
- package/src/components/form/DshDefaultSearch.vue +94 -12
- 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 +108 -0
- package/src/components/unit/DshListUnit.vue +6 -0
- package/src/index.js +10 -10
- package/src/styles/components/index.less +0 -14
- package/src/styles/components/other/BriGantt.less +1 -12
- package/src/styles/reset-iview.less +47 -1
- 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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bri-components",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.50",
|
|
4
4
|
"author": "dengshanghui",
|
|
5
5
|
"description": "a component lib for vue project",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"ali-oss": "^6.13.1",
|
|
34
34
|
"axios": "^0.23.0",
|
|
35
|
-
"bri-datas": "^1.0.
|
|
35
|
+
"bri-datas": "^1.0.42",
|
|
36
36
|
"jshint": "^2.12.0",
|
|
37
37
|
"jsonlint": "^1.6.3",
|
|
38
38
|
"minio": "7.1.0",
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
class="overflow"
|
|
14
14
|
:list="value"
|
|
15
15
|
:propsObj="{
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
disabled: !canEdit,
|
|
17
|
+
closable: true
|
|
18
|
+
}"
|
|
19
19
|
@delete="clickDeleteItem"
|
|
20
20
|
></dsh-tags>
|
|
21
21
|
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
{{ value }}
|
|
36
36
|
</div>
|
|
37
37
|
</template>
|
|
38
|
+
|
|
38
39
|
<!-- 无值 -->
|
|
39
40
|
<template v-else>
|
|
40
41
|
<div class="placeholder">
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
:load-data="loadData"
|
|
84
84
|
@on-visible-change="visibleChange"
|
|
85
85
|
@on-change="changeVal"
|
|
86
|
-
@click
|
|
86
|
+
@click="clickCascader"
|
|
87
87
|
></Cascader>
|
|
88
88
|
</template>
|
|
89
89
|
</template>
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
<!-- 多选 -->
|
|
95
95
|
<template v-if="multipleMode">
|
|
96
96
|
<bri-tooltip
|
|
97
|
-
:content="
|
|
97
|
+
:content="showMulVal"
|
|
98
98
|
placement="top"
|
|
99
99
|
maxWidth="200"
|
|
100
100
|
:transfer="true"
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
}">
|
|
107
107
|
<!-- 有值 -->
|
|
108
108
|
<dsh-tags
|
|
109
|
-
v-if="!$isEmptyData(
|
|
109
|
+
v-if="!$isEmptyData(curValList)"
|
|
110
110
|
class="text"
|
|
111
111
|
:list="curValNameList"
|
|
112
112
|
></dsh-tags>
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
</template>
|
|
141
141
|
|
|
142
142
|
<script>
|
|
143
|
-
import { regionData } from "bri-datas";
|
|
143
|
+
import { regionData, userIndustryData } from "bri-datas";
|
|
144
144
|
import controlMixin from "../../controlMixin.js";
|
|
145
145
|
import InfoCascader from "./InfoCascader.vue";
|
|
146
146
|
|
|
@@ -190,22 +190,37 @@
|
|
|
190
190
|
};
|
|
191
191
|
},
|
|
192
192
|
computed: {
|
|
193
|
+
// 级联拼接符
|
|
194
|
+
joinSymbol () {
|
|
195
|
+
return this.propsObj._joinSymbol || "/";
|
|
196
|
+
},
|
|
197
|
+
nameKey () {
|
|
198
|
+
return this.propsObj._nameKey || "name";
|
|
199
|
+
},
|
|
200
|
+
|
|
193
201
|
selfPropsObj () {
|
|
194
202
|
return {
|
|
195
203
|
_showMode: false,
|
|
196
|
-
_changeOnSelect: false, // 每级菜单都可取值
|
|
197
204
|
_filterable: true,
|
|
198
|
-
|
|
205
|
+
_changeOnSelect: false,
|
|
206
|
+
_renderFormat: (label) => label.join(this.joinSymbol),
|
|
199
207
|
_transfer: true,
|
|
208
|
+
|
|
200
209
|
...this.propsObj,
|
|
201
210
|
...this.commonDealPropsObj
|
|
202
211
|
};
|
|
203
212
|
},
|
|
204
|
-
//
|
|
205
|
-
|
|
206
|
-
return
|
|
213
|
+
// 每级菜单都可取值
|
|
214
|
+
changeOnSelect () {
|
|
215
|
+
return this.isOnSearch ? true : this.selfPropsObj._changeOnSelect;
|
|
207
216
|
},
|
|
208
|
-
|
|
217
|
+
cascaderLevel () {
|
|
218
|
+
return this.selfPropsObj._cascaderLevel;
|
|
219
|
+
},
|
|
220
|
+
cascaderFilterVals () {
|
|
221
|
+
return this.selfPropsObj._cascaderFilterVals;
|
|
222
|
+
},
|
|
223
|
+
// 只有单选模式有效
|
|
209
224
|
showMode () {
|
|
210
225
|
return this.selfPropsObj._showMode;
|
|
211
226
|
},
|
|
@@ -213,14 +228,16 @@
|
|
|
213
228
|
return this.isVisible ? "ios-arrow-up" : "ios-arrow-down";
|
|
214
229
|
},
|
|
215
230
|
|
|
231
|
+
originData () {
|
|
232
|
+
return ["region", "regions"].includes(this.controlType)
|
|
233
|
+
? regionData
|
|
234
|
+
: ["userIndustry"].includes(this.controlType)
|
|
235
|
+
? userIndustryData
|
|
236
|
+
: this.selfPropsObj._data;
|
|
237
|
+
},
|
|
216
238
|
cascaderData: {
|
|
217
239
|
get () {
|
|
218
|
-
return loop(
|
|
219
|
-
["region", "regions"].includes(this.propsObj._type) ? regionData : this.selfPropsObj._data,
|
|
220
|
-
this.selfPropsObj._cascaderLevel,
|
|
221
|
-
undefined,
|
|
222
|
-
this.selfPropsObj._cascaderFilterVals
|
|
223
|
-
);
|
|
240
|
+
return loop(this.originData, this.cascaderLevel, undefined, this.cascaderFilterVals);
|
|
224
241
|
},
|
|
225
242
|
set () {}
|
|
226
243
|
},
|
|
@@ -235,20 +252,20 @@
|
|
|
235
252
|
: this.cascaderData;
|
|
236
253
|
},
|
|
237
254
|
curValName () {
|
|
238
|
-
return this.$getTreeLinealDatas(this.curValList, this.cascaderData,
|
|
255
|
+
return this.$getTreeLinealDatas(this.curValList, this.cascaderData, this.nameKey).join(this.joinSymbol);
|
|
239
256
|
},
|
|
240
257
|
showVal () {
|
|
241
258
|
return this.$isEmptyData(this.curValList)
|
|
242
259
|
? this.emptyShowVal
|
|
243
260
|
: this.curValName;
|
|
244
261
|
},
|
|
245
|
-
// 多选用
|
|
262
|
+
// 多选用
|
|
246
263
|
curValNameList () {
|
|
247
264
|
return this.curValList.map(item =>
|
|
248
|
-
this.$getTreeLinealDatas(item, this.cascaderData,
|
|
265
|
+
this.$getTreeLinealDatas(item, this.cascaderData, this.nameKey).join(this.joinSymbol)
|
|
249
266
|
);
|
|
250
267
|
},
|
|
251
|
-
|
|
268
|
+
showMulVal () {
|
|
252
269
|
return this.$isEmptyData(this.curValList)
|
|
253
270
|
? this.emptyShowVal
|
|
254
271
|
: this.curValNameList.join("、");
|
|
@@ -280,9 +297,9 @@
|
|
|
280
297
|
|
|
281
298
|
if (bool === false) {
|
|
282
299
|
if (this.selectVal.length) {
|
|
283
|
-
if (this.curValList.some(item => JSON.stringify(item)
|
|
300
|
+
if (this.curValList.some(item => JSON.stringify(item) === JSON.stringify(this.selectVal))) {
|
|
284
301
|
this.$Message.error({
|
|
285
|
-
content: `"${this.$getTreeLinealDatas(this.selectVal, this.cascaderData,
|
|
302
|
+
content: `"${this.$getTreeLinealDatas(this.selectVal, this.cascaderData, this.nameKey).join(this.joinSymbol)}"已选择,请勿重复选择!`,
|
|
286
303
|
duration: 5
|
|
287
304
|
});
|
|
288
305
|
} else {
|
|
@@ -353,7 +370,7 @@
|
|
|
353
370
|
}
|
|
354
371
|
},
|
|
355
372
|
watch: {
|
|
356
|
-
"
|
|
373
|
+
"cascaderLevel" () {
|
|
357
374
|
this.value[this.controlKey] = [];
|
|
358
375
|
}
|
|
359
376
|
}
|
|
@@ -175,22 +175,14 @@
|
|
|
175
175
|
},
|
|
176
176
|
methods: {
|
|
177
177
|
change (node) {
|
|
178
|
-
|
|
179
|
-
if (node.
|
|
180
|
-
this.curName = node.name;
|
|
181
|
-
this.getDescription(node.codeArr);
|
|
182
|
-
if (node.codeArr.length && this.curSelect.codeArr && this.curSelect.codeArr.length === node.codeArr.length && node.codeArr.every((code, idx) => code === this.curSelect.codeArr[idx])) {
|
|
183
|
-
this.curSelect = {};
|
|
184
|
-
this.description = "";
|
|
185
|
-
} else {
|
|
186
|
-
if (!this.propsObj._cascaderLevel || node.level == this.propsObj._cascaderLevel || !node.children.length) {
|
|
187
|
-
this.curSelect = node;
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
} else {
|
|
191
|
-
this.curName = "";
|
|
192
|
-
this.description = "";
|
|
178
|
+
this.curName = node.name;
|
|
179
|
+
if (node.codeArr.length && this.curSelect.codeArr && this.curSelect.codeArr.length === node.codeArr.length && node.codeArr.every((code, idx) => code === this.curSelect.codeArr[idx])) {
|
|
193
180
|
this.curSelect = {};
|
|
181
|
+
} else {
|
|
182
|
+
if (!this.propsObj._cascaderLevel || node.level == this.propsObj._cascaderLevel || !node.children.length) {
|
|
183
|
+
this.curSelect = node;
|
|
184
|
+
this.getDescription(node.codeArr);
|
|
185
|
+
}
|
|
194
186
|
}
|
|
195
187
|
},
|
|
196
188
|
getDescription (nodeKeys) {
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<!-- 单选模式 -->
|
|
3
|
+
<div
|
|
4
|
+
v-if="!multipleMode"
|
|
5
|
+
class="DshDate"
|
|
6
|
+
>
|
|
7
|
+
<template v-if="show">
|
|
8
|
+
<!-- 编辑 -->
|
|
9
|
+
<template v-if="canEdit">
|
|
10
|
+
<!-- 时间子类型 -->
|
|
11
|
+
<template v-if="['time'].includes(subType)">
|
|
12
|
+
<TimePicker
|
|
13
|
+
class="DshDate-edit"
|
|
14
|
+
v-model="curValDate"
|
|
15
|
+
:type="subType"
|
|
16
|
+
:placeholder="selfPropsObj._placeholder"
|
|
17
|
+
:disabled="!finalCanEdit"
|
|
18
|
+
:clearable="selfPropsObj._clearable"
|
|
19
|
+
:transfer="selfPropsObj._transfer"
|
|
20
|
+
@on-change="change"
|
|
21
|
+
></TimePicker>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<!-- 日期、日期时间、年、月 -->
|
|
25
|
+
<template v-else>
|
|
26
|
+
<DatePicker
|
|
27
|
+
class="DshDate-edit"
|
|
28
|
+
v-model="curValDate"
|
|
29
|
+
:type="subType"
|
|
30
|
+
:placeholder="selfPropsObj._placeholder"
|
|
31
|
+
:disabled="!finalCanEdit"
|
|
32
|
+
:clearable="selfPropsObj._clearable"
|
|
33
|
+
:options="options"
|
|
34
|
+
:transfer="selfPropsObj._transfer"
|
|
35
|
+
@on-change="change"
|
|
36
|
+
></DatePicker>
|
|
37
|
+
</template>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<!-- 查看 -->
|
|
41
|
+
<template v-else>
|
|
42
|
+
<bri-tooltip
|
|
43
|
+
:content="showVal"
|
|
44
|
+
maxWidth="200"
|
|
45
|
+
:transfer="true"
|
|
46
|
+
>
|
|
47
|
+
<div :class="{
|
|
48
|
+
...commonClass
|
|
49
|
+
}">
|
|
50
|
+
{{ showVal }}
|
|
51
|
+
</div>
|
|
52
|
+
</bri-tooltip>
|
|
53
|
+
</template>
|
|
54
|
+
</template>
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
<!-- 多选模式 -->
|
|
58
|
+
<dsh-daterange
|
|
59
|
+
v-else
|
|
60
|
+
:canEdit="canEdit"
|
|
61
|
+
:value="value"
|
|
62
|
+
:propsObj="propsObj"
|
|
63
|
+
@change="change"
|
|
64
|
+
></dsh-daterange>
|
|
65
|
+
</template>
|
|
66
|
+
|
|
67
|
+
<script>
|
|
68
|
+
import controlMixin from "../../controlMixin.js";
|
|
69
|
+
import DshDaterange from "./DshDaterange.vue";
|
|
70
|
+
|
|
71
|
+
export default {
|
|
72
|
+
name: "DshDate",
|
|
73
|
+
mixins: [
|
|
74
|
+
controlMixin
|
|
75
|
+
],
|
|
76
|
+
components: {
|
|
77
|
+
DshDaterange
|
|
78
|
+
},
|
|
79
|
+
props: {},
|
|
80
|
+
data () {
|
|
81
|
+
return {
|
|
82
|
+
show: true
|
|
83
|
+
};
|
|
84
|
+
},
|
|
85
|
+
computed: {
|
|
86
|
+
selfPropsObj () {
|
|
87
|
+
return {
|
|
88
|
+
_transfer: true,
|
|
89
|
+
|
|
90
|
+
...this.propsObj,
|
|
91
|
+
...this.commonDealPropsObj
|
|
92
|
+
};
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
curValDate: {
|
|
96
|
+
get () {
|
|
97
|
+
const val = this.value[this.controlKey];
|
|
98
|
+
return this.$transformDateCompatible(val, this.subType);
|
|
99
|
+
},
|
|
100
|
+
set (val) {
|
|
101
|
+
this.value[this.controlKey] = this.$transformDate(val, "-", this.subType);
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
subType () {
|
|
105
|
+
return this.selfPropsObj._dateType;
|
|
106
|
+
},
|
|
107
|
+
options () {
|
|
108
|
+
return {
|
|
109
|
+
shortcuts: [],
|
|
110
|
+
disabledDate: (date) => {
|
|
111
|
+
const resultObj = this.$validateComparedRule(
|
|
112
|
+
[this.selfPropsObj],
|
|
113
|
+
{
|
|
114
|
+
...this.value,
|
|
115
|
+
[this.controlKey]: this.$transformDate(date, "/", this.subType)
|
|
116
|
+
},
|
|
117
|
+
this.allFormList
|
|
118
|
+
);
|
|
119
|
+
return !resultObj.bool;
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
created () {},
|
|
125
|
+
methods: {},
|
|
126
|
+
watch: {
|
|
127
|
+
"subType" () {
|
|
128
|
+
this.show = false;
|
|
129
|
+
this.$nextTick(() => {
|
|
130
|
+
this.value[this.controlKey] = this.selfPropsObj._default;
|
|
131
|
+
this.show = true;
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
</script>
|
|
137
|
+
|
|
138
|
+
<style lang="less" scoped>
|
|
139
|
+
.DshDate {
|
|
140
|
+
width: 100%;
|
|
141
|
+
|
|
142
|
+
&-edit {
|
|
143
|
+
width: 100%;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
</style>
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
</template>
|
|
93
93
|
|
|
94
94
|
<script>
|
|
95
|
-
import controlMixin from "
|
|
95
|
+
import controlMixin from "../../controlMixin.js";
|
|
96
96
|
|
|
97
97
|
export default {
|
|
98
98
|
name: "DshDaterange",
|
|
@@ -341,3 +341,57 @@
|
|
|
341
341
|
}
|
|
342
342
|
};
|
|
343
343
|
</script>
|
|
344
|
+
|
|
345
|
+
<style lang="less" scoped>
|
|
346
|
+
.DshDaterange {
|
|
347
|
+
width: 100%;
|
|
348
|
+
|
|
349
|
+
&-left,
|
|
350
|
+
&-right {
|
|
351
|
+
width: 47%;
|
|
352
|
+
float: left;
|
|
353
|
+
background-color: #ffffff;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
&-center {
|
|
357
|
+
width: 3%;
|
|
358
|
+
text-align: center;
|
|
359
|
+
color: @textColor;
|
|
360
|
+
overflow: hidden;
|
|
361
|
+
line-height: 30px;
|
|
362
|
+
float: left;
|
|
363
|
+
margin: 0 1.5%;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
&-item {
|
|
367
|
+
height: 32px;
|
|
368
|
+
border: 1px solid @borderColor;
|
|
369
|
+
border-radius: 4px;
|
|
370
|
+
overflow: hidden;
|
|
371
|
+
position: relative;
|
|
372
|
+
|
|
373
|
+
&-name {
|
|
374
|
+
display: inline-block;
|
|
375
|
+
width: 100%;
|
|
376
|
+
height: 100%;
|
|
377
|
+
line-height: 30px;
|
|
378
|
+
overflow: hidden;
|
|
379
|
+
padding-right: 32px;
|
|
380
|
+
padding-left: 7px;
|
|
381
|
+
white-space: nowrap;
|
|
382
|
+
text-overflow: ellipsis;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
&-icon {
|
|
386
|
+
position: absolute;
|
|
387
|
+
right: 0px;
|
|
388
|
+
top: 0px;
|
|
389
|
+
display: inline-block;
|
|
390
|
+
width: 32px;
|
|
391
|
+
height: 100%;
|
|
392
|
+
text-align: center;
|
|
393
|
+
line-height: 30px;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
</style>
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
2
|
+
<!-- 单选模式 -->
|
|
3
|
+
<div
|
|
4
|
+
v-if="!multipleMode"
|
|
5
|
+
class="DshInput"
|
|
6
|
+
>
|
|
3
7
|
<!-- 编辑 -->
|
|
4
8
|
<template v-if="canEdit">
|
|
5
9
|
<Input
|
|
@@ -8,7 +12,7 @@
|
|
|
8
12
|
:type="inputType"
|
|
9
13
|
:placeholder="selfPropsObj._placeholder"
|
|
10
14
|
:readonly="selfPropsObj._readonly"
|
|
11
|
-
:disabled="
|
|
15
|
+
:disabled="selfPropsObj._disabled"
|
|
12
16
|
:clearable="selfPropsObj._clearable"
|
|
13
17
|
:size="selfPropsObj._size"
|
|
14
18
|
:rows="selfPropsObj._rows"
|
|
@@ -76,16 +80,29 @@
|
|
|
76
80
|
</template>
|
|
77
81
|
</template>
|
|
78
82
|
</div>
|
|
83
|
+
|
|
84
|
+
<!-- 多选模式 -->
|
|
85
|
+
<dsh-inputs
|
|
86
|
+
v-else
|
|
87
|
+
:canEdit="canEdit"
|
|
88
|
+
:value="value"
|
|
89
|
+
:propsObj="propsObj"
|
|
90
|
+
@change="change"
|
|
91
|
+
></dsh-inputs>
|
|
79
92
|
</template>
|
|
80
93
|
|
|
81
94
|
<script>
|
|
82
|
-
import controlMixin from "
|
|
95
|
+
import controlMixin from "../../controlMixin.js";
|
|
96
|
+
import DshInputs from "./BriInputs.vue";
|
|
83
97
|
|
|
84
98
|
export default {
|
|
85
99
|
name: "DshInput",
|
|
86
100
|
mixins: [
|
|
87
101
|
controlMixin
|
|
88
102
|
],
|
|
103
|
+
components: {
|
|
104
|
+
DshInputs
|
|
105
|
+
},
|
|
89
106
|
props: {},
|
|
90
107
|
data () {
|
|
91
108
|
return {
|
|
@@ -95,16 +112,18 @@
|
|
|
95
112
|
computed: {
|
|
96
113
|
selfPropsObj () {
|
|
97
114
|
return {
|
|
115
|
+
_search: false,
|
|
98
116
|
_textType: "default", // ["default", "url"]
|
|
99
117
|
_readonly: ["serialNumber"].includes(this.controlType),
|
|
100
|
-
_disabled: ["serialNumber"].includes(this.controlType),
|
|
101
118
|
_showWordLimit: this.propsObj._showWordLimit || (!!this.propsObj._maxlength || this.propsObj._maxlength === 0),
|
|
102
119
|
_autosize: {
|
|
103
120
|
minRows: 2
|
|
104
121
|
},
|
|
105
122
|
|
|
106
123
|
...this.propsObj,
|
|
107
|
-
...this.commonDealPropsObj
|
|
124
|
+
...this.commonDealPropsObj,
|
|
125
|
+
|
|
126
|
+
_disabled: this.propsObj._disabled || ["serialNumber"].includes(this.controlType) || !this.finalCanEdit
|
|
108
127
|
};
|
|
109
128
|
},
|
|
110
129
|
inputType () {
|
|
@@ -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,60 @@
|
|
|
133
148
|
methods: {}
|
|
134
149
|
};
|
|
135
150
|
</script>
|
|
151
|
+
|
|
152
|
+
<style lang="less" scoped>
|
|
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>
|
|
167
|
+
<style lang="less">
|
|
168
|
+
.ivu-input-number {
|
|
169
|
+
width: 100%;
|
|
170
|
+
|
|
171
|
+
.ivu-input-number-input {
|
|
172
|
+
color: @textColor;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
&-disabled {
|
|
176
|
+
.ivu-input-number-input {
|
|
177
|
+
opacity: 1;
|
|
178
|
+
background: @inputBg-disabled;
|
|
179
|
+
color: @textColor;
|
|
180
|
+
&::-webkit-input-placeholder {
|
|
181
|
+
color: @placeholder-disabled-color;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
&-handler {
|
|
187
|
+
&-wrap {
|
|
188
|
+
border-left: none;
|
|
189
|
+
}
|
|
190
|
+
&-down {
|
|
191
|
+
border: none;
|
|
192
|
+
}
|
|
193
|
+
&:hover {
|
|
194
|
+
background-color: @hoverBg;
|
|
195
|
+
|
|
196
|
+
.ivu-input-number-handler-down-inner,
|
|
197
|
+
.ivu-input-number-handler-up-inner {
|
|
198
|
+
color: @textColor;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
&-down-inner,
|
|
202
|
+
&-up-inner {
|
|
203
|
+
color: @contentColor;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
</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" scoped>
|
|
130
|
+
.DshNumberange {
|
|
131
|
+
width: 100%;
|
|
132
|
+
display: flex;
|
|
133
|
+
align-items: center;
|
|
134
|
+
|
|
135
|
+
&-left,
|
|
136
|
+
&-right {
|
|
137
|
+
flex: 1;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
&-center {
|
|
141
|
+
width: 30px;
|
|
142
|
+
text-align: center;
|
|
143
|
+
color: @textColor;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
&-suffix {
|
|
147
|
+
padding-right: 24px;
|
|
148
|
+
padding-left: 8px;
|
|
149
|
+
line-height: 30px;
|
|
150
|
+
white-space: nowrap;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
</style>
|
|
154
|
+
<style lang="less">
|
|
155
|
+
.DshNumberange {
|
|
156
|
+
input {
|
|
157
|
+
text-overflow: ellipsis;
|
|
158
|
+
overflow: hidden;
|
|
159
|
+
white-space: nowrap;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
</style>
|