bri-components 1.4.52 → 1.4.53
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 +1 -1
- package/src/components/controls/base/DshNumber/DshNumber.vue +4 -84
- package/src/components/controls/base/DshNumber/DshNumberange.vue +3 -56
- package/src/components/controls/control.less +2 -1
- package/src/components/controls/mixins/numberMixin.js +108 -0
- package/src/components/list/DshBox/DshBox.vue +2 -1
- package/src/styles/components/BriTable.less +4 -0
package/package.json
CHANGED
|
@@ -62,20 +62,20 @@
|
|
|
62
62
|
v-else
|
|
63
63
|
:canEdit="canEdit"
|
|
64
64
|
:value="value"
|
|
65
|
-
:propsObj="
|
|
65
|
+
:propsObj="selfPropsObj"
|
|
66
66
|
@change="change"
|
|
67
67
|
></dsh-numberange>
|
|
68
68
|
</template>
|
|
69
69
|
|
|
70
70
|
<script>
|
|
71
|
-
import
|
|
71
|
+
import numberMixin from "../../mixins/numberMixin.js";
|
|
72
72
|
import BriInputNumber from "./BriInputNumber/BriInputNumber.vue";
|
|
73
73
|
import DshNumberange from "./DshNumberange.vue";
|
|
74
74
|
|
|
75
75
|
export default {
|
|
76
76
|
name: "DshNumber",
|
|
77
77
|
mixins: [
|
|
78
|
-
|
|
78
|
+
numberMixin
|
|
79
79
|
],
|
|
80
80
|
components: {
|
|
81
81
|
BriInputNumber,
|
|
@@ -85,87 +85,7 @@
|
|
|
85
85
|
data () {
|
|
86
86
|
return {};
|
|
87
87
|
},
|
|
88
|
-
computed: {
|
|
89
|
-
selfPropsObj () {
|
|
90
|
-
return {
|
|
91
|
-
_strokeWidth: 12, // 参数还没配置
|
|
92
|
-
_overflowColor: "#87d068",
|
|
93
|
-
_compeleteColor: "#87d068",
|
|
94
|
-
_lessColor: "#108ee9",
|
|
95
|
-
|
|
96
|
-
...this.propsObj,
|
|
97
|
-
...this.commonDealPropsObj
|
|
98
|
-
};
|
|
99
|
-
},
|
|
100
|
-
formatterFunc () {
|
|
101
|
-
return this.separator
|
|
102
|
-
? this.$numToSeparator
|
|
103
|
-
: value => `${value}`;
|
|
104
|
-
},
|
|
105
|
-
|
|
106
|
-
maxNum () {
|
|
107
|
-
return this.selfPropsObj._max || this.selfPropsObj._max === 0
|
|
108
|
-
? this.selfPropsObj._max
|
|
109
|
-
: Infinity;
|
|
110
|
-
},
|
|
111
|
-
minNum () {
|
|
112
|
-
return this.selfPropsObj._min || this.selfPropsObj._min === 0
|
|
113
|
-
? this.selfPropsObj._min
|
|
114
|
-
: -Infinity;
|
|
115
|
-
},
|
|
116
|
-
// round, decimal, 为其他值不处理
|
|
117
|
-
round () {
|
|
118
|
-
return this.selfPropsObj._round;
|
|
119
|
-
},
|
|
120
|
-
digit () {
|
|
121
|
-
return this.round === "round"
|
|
122
|
-
? 0
|
|
123
|
-
: this.round === "decimal"
|
|
124
|
-
? Number(this.selfPropsObj._digit || 2)
|
|
125
|
-
: undefined;
|
|
126
|
-
},
|
|
127
|
-
numberFormat () {
|
|
128
|
-
return this.selfPropsObj._numberFormat;
|
|
129
|
-
},
|
|
130
|
-
unit () {
|
|
131
|
-
return this.selfPropsObj._unit;
|
|
132
|
-
},
|
|
133
|
-
unitStr () {
|
|
134
|
-
return this.numberFormat === "percent"
|
|
135
|
-
? "%"
|
|
136
|
-
: this.unit
|
|
137
|
-
? `${this.unit}`
|
|
138
|
-
: "";
|
|
139
|
-
},
|
|
140
|
-
separator () {
|
|
141
|
-
return this.selfPropsObj._separator;
|
|
142
|
-
},
|
|
143
|
-
|
|
144
|
-
// 进度条方式使用(此处先这样,实际是进度条使用要受0-100的数值范围限制)
|
|
145
|
-
strokeWidth () {
|
|
146
|
-
return this.selfPropsObj._strokeWidth;
|
|
147
|
-
},
|
|
148
|
-
statusColor () {
|
|
149
|
-
return this.curVal > 100
|
|
150
|
-
? this.selfPropsObj._overflowColor
|
|
151
|
-
: this.curVal === 100
|
|
152
|
-
? this.selfPropsObj._compeleteColor
|
|
153
|
-
: this.selfPropsObj._lessColor;
|
|
154
|
-
},
|
|
155
|
-
progressNum () {
|
|
156
|
-
return this.$isEmptyData(this.curVal) || this.curVal < 0
|
|
157
|
-
? 0
|
|
158
|
-
: Math.round((this.curVal > 100 ? 100 : this.curVal) * 100) / 100;
|
|
159
|
-
},
|
|
160
|
-
progressStr () {
|
|
161
|
-
return this.$numToStrAndUnit(this.$isEmptyData(this.curVal) ? 0 : this.curVal, this.selfPropsObj);
|
|
162
|
-
},
|
|
163
|
-
showVal () {
|
|
164
|
-
return this.$isEmptyData(this.curVal)
|
|
165
|
-
? this.emptyShowVal
|
|
166
|
-
: this.$numToStrAndUnit(this.curVal, this.selfPropsObj);
|
|
167
|
-
}
|
|
168
|
-
},
|
|
88
|
+
computed: {},
|
|
169
89
|
created () {},
|
|
170
90
|
methods: {}
|
|
171
91
|
};
|
|
@@ -52,13 +52,13 @@
|
|
|
52
52
|
</template>
|
|
53
53
|
|
|
54
54
|
<script>
|
|
55
|
-
import
|
|
55
|
+
import numberMixin from "../../mixins/numberMixin.js";
|
|
56
56
|
import BriInputNumber from "./BriInputNumber/BriInputNumber.vue";
|
|
57
57
|
|
|
58
58
|
export default {
|
|
59
59
|
name: "DshNumberange",
|
|
60
60
|
mixins: [
|
|
61
|
-
|
|
61
|
+
numberMixin
|
|
62
62
|
],
|
|
63
63
|
components: {
|
|
64
64
|
BriInputNumber
|
|
@@ -67,60 +67,7 @@
|
|
|
67
67
|
data () {
|
|
68
68
|
return {};
|
|
69
69
|
},
|
|
70
|
-
computed: {
|
|
71
|
-
selfPropsObj () {
|
|
72
|
-
return {
|
|
73
|
-
...this.propsObj,
|
|
74
|
-
...this.commonDealPropsObj
|
|
75
|
-
};
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
formatterFunc () {
|
|
79
|
-
if (this.propsObj._separator) {
|
|
80
|
-
return this.$numToSeparator;
|
|
81
|
-
} else {
|
|
82
|
-
return value => `${value}`;
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
|
|
86
|
-
maxNum () {
|
|
87
|
-
return this.selfPropsObj._max || this.selfPropsObj._max === 0 ? this.selfPropsObj._max : Infinity;
|
|
88
|
-
},
|
|
89
|
-
minNum () {
|
|
90
|
-
return this.selfPropsObj._min || this.selfPropsObj._min === 0 ? this.selfPropsObj._min : -Infinity;
|
|
91
|
-
},
|
|
92
|
-
// round, decimal, 为其他值不处理
|
|
93
|
-
round () {
|
|
94
|
-
return this.selfPropsObj._round;
|
|
95
|
-
},
|
|
96
|
-
digit () {
|
|
97
|
-
return this.round === "round"
|
|
98
|
-
? 0
|
|
99
|
-
: this.round === "decimal"
|
|
100
|
-
? Number(this.selfPropsObj._digit || 2)
|
|
101
|
-
: undefined;
|
|
102
|
-
},
|
|
103
|
-
numberFormat () {
|
|
104
|
-
return this.selfPropsObj._numberFormat;
|
|
105
|
-
},
|
|
106
|
-
unit () {
|
|
107
|
-
return this.selfPropsObj._unit;
|
|
108
|
-
},
|
|
109
|
-
unitStr () {
|
|
110
|
-
return this.numberFormat === "percent"
|
|
111
|
-
? "%"
|
|
112
|
-
: this.unit
|
|
113
|
-
? `${this.unit}`
|
|
114
|
-
: "";
|
|
115
|
-
},
|
|
116
|
-
separator () {
|
|
117
|
-
return this.selfPropsObj._separator;
|
|
118
|
-
},
|
|
119
|
-
|
|
120
|
-
step () {
|
|
121
|
-
return this.selfPropsObj._step;
|
|
122
|
-
}
|
|
123
|
-
},
|
|
70
|
+
computed: {},
|
|
124
71
|
created () {},
|
|
125
72
|
methods: {}
|
|
126
73
|
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import controlMixin from "./controlMixin.js";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
mixins: [
|
|
5
|
+
controlMixin
|
|
6
|
+
],
|
|
7
|
+
components: {},
|
|
8
|
+
props: {},
|
|
9
|
+
data () {
|
|
10
|
+
return {};
|
|
11
|
+
},
|
|
12
|
+
computed: {
|
|
13
|
+
selfPropsObj () {
|
|
14
|
+
return {
|
|
15
|
+
_numberFormat: "normal", // 子类型 "normal", "percent"
|
|
16
|
+
|
|
17
|
+
_unit: "", // 常规-单位
|
|
18
|
+
_separator: true, // 常规-千位分隔符
|
|
19
|
+
_showProgress: false, // 百分比-进度条展示(列表)
|
|
20
|
+
_strokeWidth: 12, // 百分比-进度条宽(高)
|
|
21
|
+
_overflowColor: "#87d068", // 百分比-进度条超100%颜色
|
|
22
|
+
_compeleteColor: "#87d068", // 百分比-进度条100%颜色
|
|
23
|
+
_lessColor: "#108ee9", // 百分比-进度条低于100%颜色
|
|
24
|
+
|
|
25
|
+
_round: "decimal", // 取值方式 "decimal", "round", "normal"
|
|
26
|
+
_digit: "2", // 保留小数位数 "1", "2", "3", "4"
|
|
27
|
+
_max: null, // 最大值
|
|
28
|
+
_min: null, // 最小值
|
|
29
|
+
|
|
30
|
+
...this.propsObj,
|
|
31
|
+
...this.commonDealPropsObj
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
subType () {
|
|
35
|
+
return this.selfPropsObj._numberFormat;
|
|
36
|
+
},
|
|
37
|
+
step () {
|
|
38
|
+
return this.selfPropsObj._step;
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
unit () {
|
|
42
|
+
return this.selfPropsObj._unit;
|
|
43
|
+
},
|
|
44
|
+
unitStr () {
|
|
45
|
+
return this.subType === "percent"
|
|
46
|
+
? "%"
|
|
47
|
+
: this.unit
|
|
48
|
+
? `${this.unit}`
|
|
49
|
+
: "";
|
|
50
|
+
},
|
|
51
|
+
separator () {
|
|
52
|
+
return this.selfPropsObj._separator;
|
|
53
|
+
},
|
|
54
|
+
formatterFunc () {
|
|
55
|
+
return this.separator
|
|
56
|
+
? this.$numToSeparator
|
|
57
|
+
: value => `${value}`;
|
|
58
|
+
},
|
|
59
|
+
// 进度条方式使用(此处先这样,实际是进度条使用要受0-100的数值范围限制)
|
|
60
|
+
strokeWidth () {
|
|
61
|
+
return this.selfPropsObj._strokeWidth;
|
|
62
|
+
},
|
|
63
|
+
statusColor () {
|
|
64
|
+
return this.curVal > 100
|
|
65
|
+
? this.selfPropsObj._overflowColor
|
|
66
|
+
: this.curVal === 100
|
|
67
|
+
? this.selfPropsObj._compeleteColor
|
|
68
|
+
: this.selfPropsObj._lessColor;
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
round () {
|
|
72
|
+
return this.selfPropsObj._round;
|
|
73
|
+
},
|
|
74
|
+
digit () {
|
|
75
|
+
return this.round === "round"
|
|
76
|
+
? 0
|
|
77
|
+
: this.round === "decimal"
|
|
78
|
+
? Number(this.selfPropsObj._digit || 2)
|
|
79
|
+
: undefined;
|
|
80
|
+
},
|
|
81
|
+
maxNum () {
|
|
82
|
+
return this.selfPropsObj._max || this.selfPropsObj._max === 0
|
|
83
|
+
? this.selfPropsObj._max
|
|
84
|
+
: Infinity;
|
|
85
|
+
},
|
|
86
|
+
minNum () {
|
|
87
|
+
return this.selfPropsObj._min || this.selfPropsObj._min === 0
|
|
88
|
+
? this.selfPropsObj._min
|
|
89
|
+
: -Infinity;
|
|
90
|
+
},
|
|
91
|
+
|
|
92
|
+
progressNum () {
|
|
93
|
+
return this.$isEmptyData(this.curVal) || this.curVal < 0
|
|
94
|
+
? 0
|
|
95
|
+
: Math.round((this.curVal > 100 ? 100 : this.curVal) * 100) / 100;
|
|
96
|
+
},
|
|
97
|
+
progressStr () {
|
|
98
|
+
return this.$numToStrAndUnit(this.$isEmptyData(this.curVal) ? 0 : this.curVal, this.selfPropsObj);
|
|
99
|
+
},
|
|
100
|
+
showVal () {
|
|
101
|
+
return this.$isEmptyData(this.curVal)
|
|
102
|
+
? this.emptyShowVal
|
|
103
|
+
: this.$numToStrAndUnit(this.curVal, this.selfPropsObj);
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
created () { },
|
|
107
|
+
methods: {}
|
|
108
|
+
};
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
:extraOperationList="extraOperationList"
|
|
12
12
|
:propsObj="listPropsObj"
|
|
13
13
|
:changedFields="changedFields"
|
|
14
|
-
:isLoading="listPropsObj && listPropsObj.isLoading"
|
|
14
|
+
:isLoading="isLoading ? isLoading : listPropsObj && listPropsObj.isLoading"
|
|
15
15
|
:noDataText="listPropsObj && listPropsObj.noDataText || '暂无数据…'"
|
|
16
16
|
@clickRow="clickRow"
|
|
17
17
|
@sortChange="changeSort"
|
|
@@ -112,6 +112,7 @@
|
|
|
112
112
|
return [];
|
|
113
113
|
}
|
|
114
114
|
},
|
|
115
|
+
isLoading: Boolean,
|
|
115
116
|
listPropsObj: Object,
|
|
116
117
|
|
|
117
118
|
pageMode: String,
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
height: 100%;
|
|
10
10
|
overflow: auto;
|
|
11
11
|
word-break: break-word;
|
|
12
|
+
position: relative;
|
|
12
13
|
|
|
13
14
|
td {
|
|
14
15
|
white-space: normal !important;
|
|
@@ -144,6 +145,9 @@
|
|
|
144
145
|
}
|
|
145
146
|
|
|
146
147
|
&-empty {
|
|
148
|
+
position: absolute;
|
|
149
|
+
top: 0px;
|
|
150
|
+
left: 0px;
|
|
147
151
|
width: 100%;
|
|
148
152
|
height: 100%;
|
|
149
153
|
padding: 9px 16px;
|