bri-components 1.2.4 → 1.2.6
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/lib/0.bri-components.min.js +1 -1
- package/lib/1.bri-components.min.js +1 -1
- package/lib/2.bri-components.min.js +1 -1
- package/lib/3.bri-components.min.js +1 -1
- package/lib/4.bri-components.min.js +1 -1
- package/lib/5.bri-components.min.js +1 -1
- package/lib/6.bri-components.min.js +1 -1
- package/lib/bri-components.min.js +68 -6
- package/package.json +2 -1
- package/src/components/controls/base/BriUpload/uploadMixin.js +4 -3
- package/src/components/controls/base/DshCheckbox.vue +44 -39
- package/src/components/controls/base/DshCoordinates.vue +35 -22
- package/src/components/controls/base/DshDate.vue +2 -2
- package/src/components/controls/base/DshDaterange.vue +6 -0
- package/src/components/controls/base/DshEditor.vue +4 -4
- package/src/components/controls/base/DshInput.vue +26 -4
- package/src/components/controls/base/DshNumber/BriInputNumber/BriInputNumber.vue +27 -29
- package/src/components/controls/base/DshNumber/DshNumber.vue +15 -19
- package/src/components/controls/base/DshSelect.vue +146 -149
- package/src/components/controls/base/DshSwitch.vue +6 -5
- package/src/components/controls/controlMixin.js +4 -1
- package/src/components/controls/senior/selectDepartments.vue +60 -57
- package/src/components/controls/senior/selectUsers/selectUsers.vue +62 -66
- package/src/components/small/BriDrawer.vue +1 -1
- package/src/components/small/DshModal.vue +1 -1
- package/src/index.js +6 -0
- package/src/styles/components/controls/base/DshNumber.less +0 -8
- package/src/styles/components/controls/base/DshSelect.less +0 -19
- package/src/styles/components/small/DshDropdown.less +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bri-components",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.6",
|
|
4
4
|
"author": "dengshanghui",
|
|
5
5
|
"description": "a component lib for vue project",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"axios": "^0.23.0",
|
|
34
|
+
"ali-oss": "^6.13.1",
|
|
34
35
|
"bri-datas": "^1.0.8-0",
|
|
35
36
|
"jshint": "^2.12.0",
|
|
36
37
|
"minio": "^7.0.26",
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
|
-
|
|
2
|
+
import Oss from "ali-oss";
|
|
3
3
|
const minio = require("minio");
|
|
4
4
|
const stream = require("stream");
|
|
5
|
+
|
|
5
6
|
export default {
|
|
6
7
|
props: {
|
|
7
8
|
groupKey: {
|
|
@@ -150,7 +151,7 @@ export default {
|
|
|
150
151
|
callbackBodyType: "application/json",
|
|
151
152
|
callbackBody: this.transferCallBody(callbackBody)
|
|
152
153
|
};
|
|
153
|
-
new
|
|
154
|
+
new Oss(res.ossConfig).multipartUpload(remoteName, file, {
|
|
154
155
|
progress: (percentage) => {
|
|
155
156
|
this.inProgress(Number((percentage * 100).toFixed(0)));
|
|
156
157
|
this.handleProgress && this.handleProgress(percentage, file);
|
|
@@ -291,7 +292,7 @@ export default {
|
|
|
291
292
|
refreshSTSTokenInterval: 3600 * 1000
|
|
292
293
|
};
|
|
293
294
|
|
|
294
|
-
new
|
|
295
|
+
new Oss(newOss).multipartUpload(remoteName, file, {
|
|
295
296
|
progress: (percentage) => {
|
|
296
297
|
this.inProgress(Number((percentage * 100).toFixed(0)));
|
|
297
298
|
this.handleProgress && this.handleProgress(percentage, file);
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
|
|
4
|
-
ref="dshCheckboxRef"
|
|
5
|
-
>
|
|
2
|
+
<div class="DshCheckbox">
|
|
3
|
+
<!-- 编辑 -->
|
|
6
4
|
<template v-if="canEdit">
|
|
7
|
-
<!--
|
|
5
|
+
<!-- 平铺方式 -->
|
|
8
6
|
<template v-if="showType === 'flat'">
|
|
9
7
|
<CheckboxGroup
|
|
10
8
|
:class="{
|
|
@@ -22,19 +20,23 @@
|
|
|
22
20
|
:key="index"
|
|
23
21
|
:class="[
|
|
24
22
|
'DshCheckbox-item',
|
|
25
|
-
getItemColorClass(item
|
|
23
|
+
getItemColorClass(item),
|
|
26
24
|
selfPropsObj.class,
|
|
27
25
|
item.class
|
|
28
26
|
]"
|
|
29
27
|
:style="getItemStyle(item)"
|
|
30
28
|
:label="item._key"
|
|
31
|
-
:border="useColor"
|
|
32
29
|
:disabled="getItemDisabled(item)"
|
|
30
|
+
:border="useColor"
|
|
33
31
|
@click.native="clickOpenTip(item)"
|
|
34
32
|
>
|
|
35
33
|
<slot :item="item"></slot>
|
|
34
|
+
|
|
36
35
|
<span>{{ item.name || item._name }}</span>
|
|
37
36
|
</Checkbox>
|
|
37
|
+
|
|
38
|
+
<!-- tip项弹框提示 -->
|
|
39
|
+
<dsh-render :render="tipModalRender"></dsh-render>
|
|
38
40
|
</template>
|
|
39
41
|
|
|
40
42
|
<!-- 无选项 -->
|
|
@@ -46,7 +48,7 @@
|
|
|
46
48
|
</CheckboxGroup>
|
|
47
49
|
</template>
|
|
48
50
|
|
|
49
|
-
<!--
|
|
51
|
+
<!-- 下拉方式 -->
|
|
50
52
|
<template v-else>
|
|
51
53
|
<Select
|
|
52
54
|
v-model="curValList"
|
|
@@ -65,12 +67,12 @@
|
|
|
65
67
|
:label="item.name || item._name"
|
|
66
68
|
:disabled="getItemDisabled(item)"
|
|
67
69
|
>
|
|
68
|
-
<Checkbox :value="
|
|
70
|
+
<Checkbox :value="getItemSelectStatus(item)"></Checkbox>
|
|
69
71
|
|
|
70
72
|
<slot :item="item"></slot>
|
|
71
73
|
|
|
72
74
|
<span>{{ item.name || item._name }}</span>
|
|
73
|
-
<span style="float:right;
|
|
75
|
+
<span style="float:right; padding-right:20px">
|
|
74
76
|
{{ item.rightName }}
|
|
75
77
|
</span>
|
|
76
78
|
</Option>
|
|
@@ -92,7 +94,7 @@
|
|
|
92
94
|
}">
|
|
93
95
|
<!-- 有值 -->
|
|
94
96
|
<dsh-tags
|
|
95
|
-
v-if="!$isEmptyData(
|
|
97
|
+
v-if="!$isEmptyData(curValObjList)"
|
|
96
98
|
class="text"
|
|
97
99
|
:list="curValObjList"
|
|
98
100
|
></dsh-tags>
|
|
@@ -104,9 +106,6 @@
|
|
|
104
106
|
</div>
|
|
105
107
|
</bri-tooltip>
|
|
106
108
|
</template>
|
|
107
|
-
|
|
108
|
-
<!-- tip项弹框提示 -->
|
|
109
|
-
<dsh-render :render="tipModalRender"></dsh-render>
|
|
110
109
|
</div>
|
|
111
110
|
</template>
|
|
112
111
|
|
|
@@ -129,6 +128,9 @@
|
|
|
129
128
|
computed: {
|
|
130
129
|
selfPropsObj () {
|
|
131
130
|
return {
|
|
131
|
+
_optionKind: "dropdown", // 'flat'、'dropdown'
|
|
132
|
+
_useColor: false,
|
|
133
|
+
colorMap: resourceData.colorMap,
|
|
132
134
|
_filterable: true,
|
|
133
135
|
_transfer: true,
|
|
134
136
|
_data: [],
|
|
@@ -137,10 +139,6 @@
|
|
|
137
139
|
...this.commonDealPropsObj
|
|
138
140
|
};
|
|
139
141
|
},
|
|
140
|
-
listData () {
|
|
141
|
-
return (this.selfPropsObj._data || []).concat(this.initListData);
|
|
142
|
-
},
|
|
143
|
-
|
|
144
142
|
showType () {
|
|
145
143
|
return this.selfPropsObj._optionKind;
|
|
146
144
|
},
|
|
@@ -148,48 +146,55 @@
|
|
|
148
146
|
return this.selfPropsObj._useColor;
|
|
149
147
|
},
|
|
150
148
|
colorMap () {
|
|
151
|
-
return this.selfPropsObj.colorMap
|
|
149
|
+
return this.selfPropsObj.colorMap;
|
|
152
150
|
},
|
|
153
151
|
|
|
152
|
+
listData () {
|
|
153
|
+
return this.selfPropsObj._data.concat(this.initListData);
|
|
154
|
+
},
|
|
154
155
|
// 已选择项的对象列表
|
|
155
156
|
curValObjList () {
|
|
156
|
-
return this.
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
157
|
+
return this.curValList.map(key => {
|
|
158
|
+
const obj = this.listData.find(item => item._key === key) || {
|
|
159
|
+
_key: key,
|
|
160
|
+
name: `温馨提示:选项${key}已找不到`
|
|
161
|
+
};
|
|
162
|
+
return {
|
|
163
|
+
...obj,
|
|
164
|
+
style: this.getItemStyle(obj),
|
|
165
|
+
color: undefined
|
|
166
|
+
};
|
|
164
167
|
});
|
|
165
168
|
},
|
|
166
169
|
showMultipleVal () {
|
|
167
|
-
return this
|
|
170
|
+
return this.$isEmptyData(this.curValList)
|
|
171
|
+
? this.emptyShowVal
|
|
172
|
+
: this.curValObjList.map(item => item.name || item._name).join("、");
|
|
168
173
|
}
|
|
169
174
|
},
|
|
170
175
|
created () {},
|
|
171
176
|
methods: {
|
|
172
|
-
getItemColorClass (
|
|
173
|
-
return this.colorMap[color] ? color : "color-1";
|
|
177
|
+
getItemColorClass (item) {
|
|
178
|
+
return this.colorMap[item.color] ? item.color : "color-1";
|
|
174
179
|
},
|
|
175
180
|
getItemStyle (item) {
|
|
176
|
-
const
|
|
177
|
-
return this.colorMap[color] || this.colorMap["color-1"];
|
|
178
|
-
};
|
|
179
|
-
const getBgColor = (color) => {
|
|
180
|
-
return this.$getColor(getColor(color), 0.1);
|
|
181
|
-
};
|
|
181
|
+
const color = this.colorMap[item.color] || this.colorMap["color-1"];
|
|
182
182
|
return {
|
|
183
|
-
background: this.useColor ?
|
|
184
|
-
color: this.useColor ?
|
|
183
|
+
background: this.useColor ? this.$getColor(color, 0.1) : undefined,
|
|
184
|
+
color: this.useColor ? color : undefined
|
|
185
185
|
};
|
|
186
186
|
},
|
|
187
|
+
// 获取某项的置灰状态
|
|
187
188
|
getItemDisabled (item) {
|
|
188
189
|
return !!(
|
|
189
190
|
!this.finalCanEdit ||
|
|
190
191
|
item._disabled ||
|
|
191
|
-
this.curValList.length >= this.selfPropsObj._max && !this.
|
|
192
|
+
this.curValList.length >= this.selfPropsObj._max && !this.getItemSelectStatus(item)
|
|
192
193
|
);
|
|
194
|
+
},
|
|
195
|
+
// 获取某项的选中状态
|
|
196
|
+
getItemSelectStatus (item) {
|
|
197
|
+
return this.curValList.includes(item._key);
|
|
193
198
|
}
|
|
194
199
|
}
|
|
195
200
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="DshCoordinates">
|
|
3
3
|
<bri-tooltip
|
|
4
|
-
:content="
|
|
4
|
+
:content="showVal"
|
|
5
5
|
placement="top"
|
|
6
6
|
maxWidth="200"
|
|
7
7
|
:transfer="true"
|
|
@@ -9,20 +9,30 @@
|
|
|
9
9
|
<div
|
|
10
10
|
:class="{
|
|
11
11
|
...commonClass,
|
|
12
|
-
'DshCoordinates-edit':
|
|
12
|
+
'DshCoordinates-edit': canEdit,
|
|
13
|
+
'DshCoordinates-unit': !canEdit && isUnitShow,
|
|
14
|
+
'DshCoordinates-show': !canEdit && !isUnitShow
|
|
13
15
|
}"
|
|
14
|
-
@click.stop="
|
|
16
|
+
@click.stop="clickInput"
|
|
15
17
|
>
|
|
16
18
|
<div class="text">
|
|
17
|
-
{{
|
|
19
|
+
{{ showVal }}
|
|
18
20
|
</div>
|
|
19
21
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
<!-- 图标 -->
|
|
23
|
+
<template v-if="canEdit">
|
|
24
|
+
<Icon
|
|
25
|
+
v-if="!$isEmptyData(curVal) && selfPropsObj._clearable && isHover"
|
|
26
|
+
class="icon-close"
|
|
27
|
+
type="ios-close-circle"
|
|
28
|
+
@click.stop="clickClear"
|
|
29
|
+
/>
|
|
30
|
+
<Icon
|
|
31
|
+
v-else
|
|
32
|
+
class="icon-default"
|
|
33
|
+
:type="inputIcon"
|
|
34
|
+
/>
|
|
35
|
+
</template>
|
|
26
36
|
</div>
|
|
27
37
|
</bri-tooltip>
|
|
28
38
|
|
|
@@ -167,9 +177,6 @@
|
|
|
167
177
|
this.value[this.controlKey] = val;
|
|
168
178
|
}
|
|
169
179
|
},
|
|
170
|
-
showText () {
|
|
171
|
-
return this.$isEmptyData(this.curVal) ? this.emptyShowVal : this.curVal.name;
|
|
172
|
-
},
|
|
173
180
|
curLnglat: {
|
|
174
181
|
get () {
|
|
175
182
|
return this.curVal.lnglat || [];
|
|
@@ -187,16 +194,24 @@
|
|
|
187
194
|
},
|
|
188
195
|
kind () {
|
|
189
196
|
return this.selfPropsObj._showType;
|
|
197
|
+
},
|
|
198
|
+
inputIcon () {
|
|
199
|
+
return "ios-map-outline";
|
|
200
|
+
},
|
|
201
|
+
|
|
202
|
+
showVal () {
|
|
203
|
+
return this.$isEmptyData(this.curVal)
|
|
204
|
+
? this.emptyShowVal
|
|
205
|
+
: this.curVal.name;
|
|
190
206
|
}
|
|
191
207
|
},
|
|
192
208
|
data () {
|
|
193
209
|
return {
|
|
194
|
-
|
|
210
|
+
showModal: false,
|
|
195
211
|
cloneValue: {
|
|
196
212
|
name: "",
|
|
197
213
|
lnglat: []
|
|
198
214
|
},
|
|
199
|
-
showModal: false,
|
|
200
215
|
modalStyles: {
|
|
201
216
|
height: document.body.clientHeight * 0.96 + "px",
|
|
202
217
|
width: document.body.clientWidth * 0.96 + "px",
|
|
@@ -206,22 +221,20 @@
|
|
|
206
221
|
kind: "keyword",
|
|
207
222
|
searchText: ""
|
|
208
223
|
},
|
|
224
|
+
|
|
209
225
|
// 地图相应控件
|
|
210
226
|
map: null,
|
|
211
227
|
placeSearch: null,
|
|
212
228
|
mouseTool: null,
|
|
213
|
-
// 标记点
|
|
214
|
-
|
|
215
|
-
//
|
|
216
|
-
plot: null,
|
|
217
|
-
// 提示信息
|
|
218
|
-
searchMessage: ""
|
|
229
|
+
marker: null, // 标记点
|
|
230
|
+
plot: null, // 标记图形
|
|
231
|
+
searchMessage: "" // 提示信息
|
|
219
232
|
};
|
|
220
233
|
},
|
|
221
234
|
created () {},
|
|
222
235
|
methods: {
|
|
223
236
|
// 打开窗体
|
|
224
|
-
|
|
237
|
+
clickInput () {
|
|
225
238
|
if (this.finalCanEdit) {
|
|
226
239
|
this.showModal = true;
|
|
227
240
|
this.cloneValue = this.$deepCopy(this.curVal);
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
<!-- 查看 -->
|
|
39
39
|
<template v-else>
|
|
40
40
|
<bri-tooltip
|
|
41
|
-
:content="
|
|
41
|
+
:content="showVal"
|
|
42
42
|
maxWidth="200"
|
|
43
43
|
:transfer="true"
|
|
44
44
|
>
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
'DshDate-unit': isUnitShow,
|
|
48
48
|
'DshDate-show': !isUnitShow
|
|
49
49
|
}">
|
|
50
|
-
{{
|
|
50
|
+
{{ showVal }}
|
|
51
51
|
</div>
|
|
52
52
|
</bri-tooltip>
|
|
53
53
|
</template>
|
|
@@ -166,6 +166,12 @@
|
|
|
166
166
|
numbers: [1],
|
|
167
167
|
dateTypes: ["date", "datetime", "daterange", "datetimerange"]
|
|
168
168
|
},
|
|
169
|
+
{
|
|
170
|
+
_key: "last_month_start",
|
|
171
|
+
name: "上月初",
|
|
172
|
+
numbers: [0],
|
|
173
|
+
dateTypes: ["month", "date", "datetime", "daterange", "datetimerange"]
|
|
174
|
+
},
|
|
169
175
|
{
|
|
170
176
|
_key: "dyn_month_start",
|
|
171
177
|
name: "月初",
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
<template v-if="canEdit">
|
|
5
5
|
<div
|
|
6
6
|
:class="{
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
...commonClass,
|
|
8
|
+
'DshEditor-edit': true
|
|
9
9
|
}"
|
|
10
10
|
v-show="showType === 'show'"
|
|
11
|
-
v-html="
|
|
11
|
+
v-html="showVal"
|
|
12
12
|
@click="handleEdit"
|
|
13
13
|
></div>
|
|
14
14
|
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
'DshEditor-show': true,
|
|
56
56
|
'DshEditor-show-nodata': $isEmptyData(curVal)
|
|
57
57
|
}"
|
|
58
|
-
v-html="
|
|
58
|
+
v-html="showVal"
|
|
59
59
|
></div>
|
|
60
60
|
</template>
|
|
61
61
|
</div>
|
|
@@ -38,17 +38,17 @@
|
|
|
38
38
|
<!-- 查看 -->
|
|
39
39
|
<template v-else>
|
|
40
40
|
<!-- 查看页 的textarea单独处理 -->
|
|
41
|
-
<template v-if="
|
|
41
|
+
<template v-if="subType === 'textarea' && !isUnitShow && !$isEmptyData(curVal)">
|
|
42
42
|
<p
|
|
43
43
|
class="DshInput-show-textarea"
|
|
44
|
-
v-text="
|
|
44
|
+
v-text="showVal"
|
|
45
45
|
></p>
|
|
46
46
|
</template>
|
|
47
47
|
|
|
48
48
|
<!-- 表格和查看页 里的查看 -->
|
|
49
49
|
<template v-else>
|
|
50
50
|
<bri-tooltip
|
|
51
|
-
:content="
|
|
51
|
+
:content="showVal"
|
|
52
52
|
maxWidth="200"
|
|
53
53
|
:transfer="true"
|
|
54
54
|
>
|
|
@@ -57,7 +57,19 @@
|
|
|
57
57
|
'DshInput-unit': isUnitShow,
|
|
58
58
|
'DshInput-show': !isUnitShow
|
|
59
59
|
}">
|
|
60
|
-
|
|
60
|
+
<!-- 有值 -->
|
|
61
|
+
<a
|
|
62
|
+
v-if="!$isEmptyData(curVal) && textType === 'url'"
|
|
63
|
+
class="text"
|
|
64
|
+
@click="goHttpWindow($event)"
|
|
65
|
+
>
|
|
66
|
+
{{ showVal }}
|
|
67
|
+
</a>
|
|
68
|
+
|
|
69
|
+
<!-- 无值 -->
|
|
70
|
+
<template v-else>
|
|
71
|
+
{{ showVal }}
|
|
72
|
+
</template>
|
|
61
73
|
</div>
|
|
62
74
|
</bri-tooltip>
|
|
63
75
|
</template>
|
|
@@ -82,6 +94,7 @@
|
|
|
82
94
|
computed: {
|
|
83
95
|
selfPropsObj () {
|
|
84
96
|
return {
|
|
97
|
+
_textType: "default",
|
|
85
98
|
_readonly: ["serialNumber"].includes(this.propsObj._type),
|
|
86
99
|
// _disabled: ["serialNumber"].includes(this.propsObj._type),
|
|
87
100
|
_showWordLimit: this.propsObj._showWordLimit || (!!this.propsObj._maxlength || this.propsObj._maxlength === 0),
|
|
@@ -99,6 +112,9 @@
|
|
|
99
112
|
: ["text", "textarea", "password", "url", "email", "number", "tel"].includes(this.selfPropsObj._type)
|
|
100
113
|
? this.selfPropsObj._type
|
|
101
114
|
: "text";
|
|
115
|
+
},
|
|
116
|
+
textType () {
|
|
117
|
+
return this.propsObj._textType;
|
|
102
118
|
}
|
|
103
119
|
},
|
|
104
120
|
created () {},
|
|
@@ -127,6 +143,12 @@
|
|
|
127
143
|
},
|
|
128
144
|
onClear () {
|
|
129
145
|
this.change();
|
|
146
|
+
},
|
|
147
|
+
|
|
148
|
+
// 超链接跳转
|
|
149
|
+
goHttpWindow (e) {
|
|
150
|
+
e.stopPropagation();
|
|
151
|
+
window.open(this.curVal);
|
|
130
152
|
}
|
|
131
153
|
}
|
|
132
154
|
};
|
|
@@ -3,30 +3,7 @@
|
|
|
3
3
|
<!-- <div :class="suffixClasses">
|
|
4
4
|
<slot name="suffix"></slot>
|
|
5
5
|
</div> -->
|
|
6
|
-
|
|
7
|
-
v-if="numberAdjust"
|
|
8
|
-
:class="handlerClasses"
|
|
9
|
-
:style="handlerStyle"
|
|
10
|
-
>
|
|
11
|
-
<a
|
|
12
|
-
@click="up"
|
|
13
|
-
:class="upClasses"
|
|
14
|
-
>
|
|
15
|
-
<span
|
|
16
|
-
:class="innerUpClasses"
|
|
17
|
-
@click="preventDefault"
|
|
18
|
-
></span>
|
|
19
|
-
</a>
|
|
20
|
-
<a
|
|
21
|
-
@click="down"
|
|
22
|
-
:class="downClasses"
|
|
23
|
-
>
|
|
24
|
-
<span
|
|
25
|
-
:class="innerDownClasses"
|
|
26
|
-
@click="preventDefault"
|
|
27
|
-
></span>
|
|
28
|
-
</a>
|
|
29
|
-
</div>
|
|
6
|
+
|
|
30
7
|
<div
|
|
31
8
|
:class="inputWrapClasses"
|
|
32
9
|
style="display:flex"
|
|
@@ -49,7 +26,32 @@
|
|
|
49
26
|
:value="formatterValue"
|
|
50
27
|
:placeholder="placeholder"
|
|
51
28
|
>
|
|
52
|
-
|
|
29
|
+
|
|
30
|
+
<slot name="suffix">
|
|
31
|
+
<div
|
|
32
|
+
:class="handlerClasses"
|
|
33
|
+
:style="handlerStyle"
|
|
34
|
+
>
|
|
35
|
+
<a
|
|
36
|
+
@click="up"
|
|
37
|
+
:class="upClasses"
|
|
38
|
+
>
|
|
39
|
+
<span
|
|
40
|
+
:class="innerUpClasses"
|
|
41
|
+
@click="preventDefault"
|
|
42
|
+
></span>
|
|
43
|
+
</a>
|
|
44
|
+
<a
|
|
45
|
+
@click="down"
|
|
46
|
+
:class="downClasses"
|
|
47
|
+
>
|
|
48
|
+
<span
|
|
49
|
+
:class="innerDownClasses"
|
|
50
|
+
@click="preventDefault"
|
|
51
|
+
></span>
|
|
52
|
+
</a>
|
|
53
|
+
</div>
|
|
54
|
+
</slot>
|
|
53
55
|
</div>
|
|
54
56
|
</div>
|
|
55
57
|
</template>
|
|
@@ -175,10 +177,6 @@
|
|
|
175
177
|
return {};
|
|
176
178
|
}
|
|
177
179
|
},
|
|
178
|
-
numberAdjust: {
|
|
179
|
-
type: Boolean,
|
|
180
|
-
default: true
|
|
181
|
-
},
|
|
182
180
|
isPositive: {
|
|
183
181
|
type: Boolean,
|
|
184
182
|
default: false
|
|
@@ -4,14 +4,13 @@
|
|
|
4
4
|
<template v-if="canEdit">
|
|
5
5
|
<BriInputNumber
|
|
6
6
|
class="DshNumber-edit"
|
|
7
|
-
v-model="
|
|
7
|
+
v-model="curVal"
|
|
8
8
|
:placeholder="selfPropsObj._placeholder"
|
|
9
9
|
:disabled="!finalCanEdit"
|
|
10
10
|
:formatter="formatterFunc"
|
|
11
11
|
:max="maxNum"
|
|
12
12
|
:min="minNum"
|
|
13
13
|
:precision="digit"
|
|
14
|
-
:numberAdjust="selfPropsObj._numberAdjust || !unitStr"
|
|
15
14
|
@on-change="change"
|
|
16
15
|
>
|
|
17
16
|
<div
|
|
@@ -28,25 +27,20 @@
|
|
|
28
27
|
<template v-else>
|
|
29
28
|
<!-- 单元格的查看 进度条模式 -->
|
|
30
29
|
<template v-if="isUnitShow && selfPropsObj._showProgress">
|
|
31
|
-
<Progress
|
|
32
|
-
v-if="selfPropsObj._showProgress"
|
|
33
|
-
:percent="curVal > 100 ? 100 : toDecimal(curVal)"
|
|
34
|
-
/>
|
|
30
|
+
<Progress :percent="progressNum" />
|
|
35
31
|
</template>
|
|
36
32
|
|
|
37
33
|
<!-- 单元格和查看页的查看 -->
|
|
38
34
|
<template v-else>
|
|
39
35
|
<bri-tooltip
|
|
40
|
-
:content="
|
|
36
|
+
:content="showVal"
|
|
41
37
|
maxWidth="200"
|
|
42
38
|
:transfer="true"
|
|
43
39
|
>
|
|
44
40
|
<div :class="{
|
|
45
41
|
...commonClass,
|
|
46
|
-
'DshInput-unit': isUnitShow,
|
|
47
|
-
'DshInput-show': !isUnitShow
|
|
48
42
|
}">
|
|
49
|
-
{{
|
|
43
|
+
{{ showVal }}
|
|
50
44
|
</div>
|
|
51
45
|
</bri-tooltip>
|
|
52
46
|
</template>
|
|
@@ -121,19 +115,21 @@
|
|
|
121
115
|
return this.selfPropsObj._separator;
|
|
122
116
|
},
|
|
123
117
|
|
|
124
|
-
|
|
118
|
+
// 进度条方式使用(此处先这样,实际是进度条使用要受0-100的数值范围限制)
|
|
119
|
+
progressNum () {
|
|
120
|
+
return this.$isEmptyData(this.curVal) || this.curVal < 0
|
|
121
|
+
? 0
|
|
122
|
+
: this.curVal > 100
|
|
123
|
+
? 100
|
|
124
|
+
: Math.round(this.curVal * 100) / 100;
|
|
125
|
+
},
|
|
126
|
+
showVal () {
|
|
125
127
|
return this.$isEmptyData(this.curVal)
|
|
126
128
|
? this.emptyShowVal
|
|
127
|
-
: this.$numToStrAndUnit(this.
|
|
129
|
+
: this.$numToStrAndUnit(this.curVal, this.selfPropsObj);
|
|
128
130
|
}
|
|
129
131
|
},
|
|
130
132
|
created () {},
|
|
131
|
-
methods: {
|
|
132
|
-
toDecimal (num) {
|
|
133
|
-
return isNaN(parseFloat(num))
|
|
134
|
-
? undefined
|
|
135
|
-
: Math.round(num * 100) / 100;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
133
|
+
methods: {}
|
|
138
134
|
};
|
|
139
135
|
</script>
|