sone-ui-component-3.2.4 2.1.40 → 2.1.42
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/sone-ui.common.js +68 -26
- package/lib/sone-ui.common.js.map +1 -1
- package/lib/sone-ui.umd.js +68 -26
- package/lib/sone-ui.umd.js.map +1 -1
- package/lib/sone-ui.umd.min.js +2 -2
- package/lib/sone-ui.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/packages/inputNumber/src/main.vue +22 -0
- package/packages/table/src/mainNew.vue +4 -4
- package/packages/tree/src/main.vue +30 -10
- package/src/index.js +1 -1
package/package.json
CHANGED
|
@@ -231,6 +231,7 @@ export default {
|
|
|
231
231
|
|
|
232
232
|
if (this.precision !== undefined) {
|
|
233
233
|
currentValue = this.toPrecision(currentValue, this.precision);
|
|
234
|
+
// currentValue = this.fixPrecision(currentValue, this.precision);
|
|
234
235
|
}
|
|
235
236
|
}
|
|
236
237
|
this.$emit("updateDisplayValue", currentValue);
|
|
@@ -238,6 +239,27 @@ export default {
|
|
|
238
239
|
}
|
|
239
240
|
},
|
|
240
241
|
methods: {
|
|
242
|
+
fixPrecision(num, precision){
|
|
243
|
+
if(precision === 0) return num;
|
|
244
|
+
if(typeof num !== 'number') return num;
|
|
245
|
+
let val = num;
|
|
246
|
+
if(String(val).indexOf('.') === -1){
|
|
247
|
+
for(let i = 0; i < precision; i++){
|
|
248
|
+
if(i === 0){
|
|
249
|
+
val = val + '.0'
|
|
250
|
+
}else{
|
|
251
|
+
val = val + '0'
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}else{
|
|
255
|
+
let arr = String(val).split('.');
|
|
256
|
+
let newPrecision = precision - arr[1].length;
|
|
257
|
+
for(let i = 0; i < newPrecision; i++){
|
|
258
|
+
val = val + '0'
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
return val;
|
|
262
|
+
},
|
|
241
263
|
toPrecision(num, precision) {
|
|
242
264
|
if (num === "" || num === null || num === undefined) {
|
|
243
265
|
return "";
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
>
|
|
100
100
|
<template v-for="(item,index) in operation.buttonList">
|
|
101
101
|
<el-tooltip
|
|
102
|
-
:content="item.label"
|
|
102
|
+
:content="String(item.label)"
|
|
103
103
|
:key="index"
|
|
104
104
|
effect="light"
|
|
105
105
|
placement="top"
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
>
|
|
124
124
|
<template v-for="(item,index) in scope.row.buttonShow.filter(d=>d.isShow).slice(0,2)">
|
|
125
125
|
<el-tooltip
|
|
126
|
-
:content="operation.buttonList.find(d=>d.id===item.id).label"
|
|
126
|
+
:content="String(operation.buttonList.find(d=>d.id===item.id).label)"
|
|
127
127
|
:key="index"
|
|
128
128
|
effect="light"
|
|
129
129
|
placement="top"
|
|
@@ -176,7 +176,7 @@
|
|
|
176
176
|
>
|
|
177
177
|
<template v-for="(item,index) in operation.buttonList">
|
|
178
178
|
<el-tooltip
|
|
179
|
-
:content="item.label"
|
|
179
|
+
:content="String(item.label)"
|
|
180
180
|
:key="index"
|
|
181
181
|
effect="light"
|
|
182
182
|
placement="top"
|
|
@@ -198,7 +198,7 @@
|
|
|
198
198
|
>
|
|
199
199
|
<template v-for="(item,index) in operation.buttonList.slice(0,2)">
|
|
200
200
|
<el-tooltip
|
|
201
|
-
:content="item.label"
|
|
201
|
+
:content="String(item.label)"
|
|
202
202
|
:key="index"
|
|
203
203
|
effect="light"
|
|
204
204
|
placement="top"
|
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
<div style="height:100%;" >
|
|
9
9
|
<!-- 展示类型 -->
|
|
10
10
|
<div class="sone-tree" v-if="type === 'normal'">
|
|
11
|
+
<div v-if="lineDirection === 'left'" class="show-line" :style="dragWidth?'cursor:col-resize;':''" ref='line'>
|
|
12
|
+
<div class="show-line-box" @click="onShow(2)" :style="showStyle2"></div>
|
|
13
|
+
</div>
|
|
11
14
|
<div class="tree-wrap" ref="menu" v-show="show" :style="'width:' + defaultWidth + 'px'">
|
|
12
15
|
<div class="sone-tree-title">
|
|
13
16
|
<el-select v-if="treeData.length>1" v-model="checkedTreeData" @change="changeTreeData" class="sone-tree-components-class">
|
|
@@ -55,12 +58,15 @@
|
|
|
55
58
|
</el-tree>
|
|
56
59
|
</div>
|
|
57
60
|
</div>
|
|
58
|
-
<div class="show-line" :style="dragWidth?'cursor:col-resize;':''" ref='line'>
|
|
59
|
-
<div class="show-line-box" @click="onShow" :style="showStyle"></div>
|
|
61
|
+
<div v-if="lineDirection === 'right'" class="show-line" :style="dragWidth?'cursor:col-resize;':''" ref='line'>
|
|
62
|
+
<div class="show-line-box" @click="onShow(1)" :style="showStyle"></div>
|
|
60
63
|
</div>
|
|
61
64
|
</div>
|
|
62
65
|
<!-- 操作类型 -->
|
|
63
66
|
<div class="sone-tree" v-else >
|
|
67
|
+
<div v-if="lineDirection === 'left'" class="show-line" :style="dragWidth?'cursor:col-resize;':''" ref='line'>
|
|
68
|
+
<div class="show-line-box" @click="onShow(2)" :style="showStyle2"></div>
|
|
69
|
+
</div>
|
|
64
70
|
<div class="tree-wrap" ref="menu" v-show="show" :style="'width:' + defaultWidth + 'px'" >
|
|
65
71
|
<div class="sone-tree-title">
|
|
66
72
|
<span>{{ handleTypeTitle }}</span>
|
|
@@ -150,8 +156,8 @@
|
|
|
150
156
|
|
|
151
157
|
|
|
152
158
|
</div>
|
|
153
|
-
<div class="show-line" :style="dragWidth?'cursor:col-resize;':''" ref='line'>
|
|
154
|
-
<div class="show-line-box" @click="onShow" :style="showStyle"></div>
|
|
159
|
+
<div v-if="lineDirection === 'right'" class="show-line" :style="dragWidth?'cursor:col-resize;':''" ref='line'>
|
|
160
|
+
<div class="show-line-box" @click="onShow(1)" :style="showStyle"></div>
|
|
155
161
|
</div>
|
|
156
162
|
</div>
|
|
157
163
|
</div>
|
|
@@ -266,12 +272,18 @@ export default {
|
|
|
266
272
|
type:Boolean,
|
|
267
273
|
default:true,
|
|
268
274
|
remark:"handle模式下是否展示label"
|
|
275
|
+
},
|
|
276
|
+
lineDirection:{
|
|
277
|
+
type: String,
|
|
278
|
+
default:'right',
|
|
279
|
+
remark:"折叠线方向"
|
|
269
280
|
}
|
|
270
281
|
},
|
|
271
282
|
data() {
|
|
272
283
|
return {
|
|
273
284
|
show: true,
|
|
274
285
|
showStyle: "border-right: 6px solid #019bee;transform: translate(-100%,-50%)",
|
|
286
|
+
showStyle2: "border-left: 6px solid #019bee;transform: translate(0,-50%)",
|
|
275
287
|
filterText: "",
|
|
276
288
|
|
|
277
289
|
// normal
|
|
@@ -425,13 +437,21 @@ export default {
|
|
|
425
437
|
handleNodeCollapse(obj, node, self) {
|
|
426
438
|
this.$emit("node-collapse", obj, node, self);
|
|
427
439
|
},
|
|
428
|
-
onShow() {
|
|
440
|
+
onShow(direct) {
|
|
429
441
|
this.show = !this.show;
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
442
|
+
if(direct === 1) {
|
|
443
|
+
this.show
|
|
444
|
+
? (this.showStyle =
|
|
445
|
+
"border-right: 6px solid #019bee;transform: translate(-100%,-50%)")
|
|
446
|
+
: (this.showStyle =
|
|
447
|
+
"border-left: 6px solid #019bee;transform: translate(0,-50%)");
|
|
448
|
+
}else {
|
|
449
|
+
this.show
|
|
450
|
+
? (this.showStyle2 =
|
|
451
|
+
"border-left: 6px solid #019bee;transform: translate(0,-50%)")
|
|
452
|
+
: (this.showStyle2 =
|
|
453
|
+
"border-right: 6px solid #019bee;transform: translate(-100%,-50%)");
|
|
454
|
+
}
|
|
435
455
|
this.$emit('handleDisplay',this.show)
|
|
436
456
|
},
|
|
437
457
|
handleDragEnd(draggingNode, dropNode, dropType, ev) {
|