bri-components 1.2.3 → 1.2.5
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/7.bri-components.min.js +1 -1
- package/lib/8.bri-components.min.js +1 -1
- package/lib/9.bri-components.min.js +1 -1
- package/lib/bri-components.min.js +6 -6
- package/package.json +1 -1
- package/src/components/controls/base/BriUpload/uploadMixin.js +16 -4
- package/src/components/controls/base/DshCascader/DshCascader.vue +2 -1
- package/src/components/controls/base/DshCheckbox.vue +49 -44
- package/src/components/controls/base/DshCoordinates.vue +38 -25
- package/src/components/controls/base/DshDate.vue +2 -2
- package/src/components/controls/base/DshEditor.vue +4 -4
- package/src/components/controls/base/DshInput.vue +3 -3
- 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 +121 -123
- package/src/components/controls/base/DshSwitch.vue +6 -5
- package/src/components/controls/controlMixin.js +4 -1
- package/src/components/controls/senior/BriLabels.vue +2 -1
- package/src/components/controls/senior/selectDepartments.vue +2 -1
- package/src/components/controls/senior/selectUsers/selectUsers.vue +77 -95
- package/src/components/list/BriTreeItem.vue +2 -2
- package/src/components/list/DshBox/DshPanel.vue +6 -6
- package/src/components/small/BriDrawer.vue +1 -1
- package/src/components/small/DshModal.vue +1 -1
- package/src/components/small/DshTags.vue +2 -4
- package/src/index.js +6 -0
- package/src/styles/common/control.less +5 -3
- package/src/styles/components/controls/base/DshCascader/DshCascader.less +1 -1
- package/src/styles/components/controls/base/DshNumber.less +0 -8
- package/src/styles/components/controls/base/DshSelect.less +0 -19
- package/src/styles/components/controls/senior/BriLabels.less +1 -1
- package/src/styles/components/controls/senior/selectDepartments.less +1 -1
- package/src/styles/components/controls/senior/selectUsers/selectUsers.less +1 -1
- package/src/styles/components/list/DshBox/DshPanel.less +2 -2
- package/src/styles/components/small/DshDropdown.less +1 -1
package/package.json
CHANGED
|
@@ -64,7 +64,6 @@ export default {
|
|
|
64
64
|
callback: res => {
|
|
65
65
|
this.inputType = "file";
|
|
66
66
|
if (res.ossType === "ali-oss") {
|
|
67
|
-
console.log(this.computedOssType, res);
|
|
68
67
|
// 上传到阿里云res
|
|
69
68
|
this[this.computedOssType](file, res, callback);
|
|
70
69
|
} else if (res.ossType === "local") {
|
|
@@ -260,7 +259,6 @@ export default {
|
|
|
260
259
|
binaryMultipartUpload (file, res, callback) {
|
|
261
260
|
let type = "jpg";
|
|
262
261
|
let remoteName = `${this.randomTimeStampFn()}.${type}`;
|
|
263
|
-
console.log("调binaryMultipartUpload");
|
|
264
262
|
// 上传成功的回调参数
|
|
265
263
|
let callbackBody = {
|
|
266
264
|
name: remoteName,
|
|
@@ -278,8 +276,22 @@ export default {
|
|
|
278
276
|
callbackBodyType: "application/json",
|
|
279
277
|
callbackBody: this.transferCallBody(callbackBody)
|
|
280
278
|
};
|
|
281
|
-
|
|
282
|
-
|
|
279
|
+
|
|
280
|
+
let newOss = {
|
|
281
|
+
...res.ossConfig,
|
|
282
|
+
refreshSTSToken: async () => {
|
|
283
|
+
// 向您搭建的STS服务获取临时访问凭证。
|
|
284
|
+
return {
|
|
285
|
+
accessKeyId: res.ossConfig.accessKeyId, // 自己账户的accessKeyId或临时秘钥
|
|
286
|
+
accessKeySecret: res.ossConfig.accessKeySecret, // 自己账户的accessKeySecret或临时秘钥
|
|
287
|
+
stsToken: res.ossConfig.stsToken // 从STS服务获取的安全令牌(SecurityToken)。
|
|
288
|
+
};
|
|
289
|
+
},
|
|
290
|
+
// 刷新临时访问凭证的时间间隔,单位为毫秒。
|
|
291
|
+
refreshSTSTokenInterval: 3600 * 1000
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
new this.$aliOss(newOss).multipartUpload(remoteName, file, {
|
|
283
295
|
progress: (percentage) => {
|
|
284
296
|
this.inProgress(Number((percentage * 100).toFixed(0)));
|
|
285
297
|
this.handleProgress && this.handleProgress(percentage, file);
|
|
@@ -1,18 +1,16 @@
|
|
|
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="{
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
'DshCheckbox-group': true,
|
|
10
|
+
'DshCheckbox-group-color': useColor,
|
|
11
|
+
'DshCheckbox-group-disabled': !canEdit,
|
|
12
|
+
'DshCheckbox-group-scroll': selfPropsObj._span < 24 && !selfPropsObj._br,
|
|
13
|
+
}"
|
|
16
14
|
v-model="curValList"
|
|
17
15
|
>
|
|
18
16
|
<!-- 有选项 -->
|
|
@@ -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>
|
|
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
|
|
|
@@ -81,7 +91,7 @@
|
|
|
81
91
|
:value="curVal.name"
|
|
82
92
|
:readonly="true"
|
|
83
93
|
:clearable="true"
|
|
84
|
-
@on-clear="
|
|
94
|
+
@on-clear="clickModalClear"
|
|
85
95
|
@click.native="clickMapFitView"
|
|
86
96
|
/>
|
|
87
97
|
</Col>
|
|
@@ -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);
|
|
@@ -238,7 +251,7 @@
|
|
|
238
251
|
this.curVal = this.cloneValue;
|
|
239
252
|
},
|
|
240
253
|
// 点击删除
|
|
241
|
-
|
|
254
|
+
clickClear () {
|
|
242
255
|
this.curVal = {
|
|
243
256
|
name: "",
|
|
244
257
|
lnglat: []
|
|
@@ -246,7 +259,7 @@
|
|
|
246
259
|
this.$emit("change", []);
|
|
247
260
|
},
|
|
248
261
|
// 清除已选内容
|
|
249
|
-
|
|
262
|
+
clickModalClear () {
|
|
250
263
|
this.curVal = {
|
|
251
264
|
name: "",
|
|
252
265
|
lnglat: []
|
|
@@ -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>
|
|
@@ -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>
|
|
@@ -41,14 +41,14 @@
|
|
|
41
41
|
<template v-if="!isUnitShow && subType === 'textarea' && !$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,7 @@
|
|
|
57
57
|
'DshInput-unit': isUnitShow,
|
|
58
58
|
'DshInput-show': !isUnitShow
|
|
59
59
|
}">
|
|
60
|
-
{{
|
|
60
|
+
{{ showVal }}
|
|
61
61
|
</div>
|
|
62
62
|
</bri-tooltip>
|
|
63
63
|
</template>
|
|
@@ -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>
|