resolver-egretimp-plus 0.0.222 → 0.0.224
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
CHANGED
|
@@ -50,8 +50,9 @@ const calcProps = computed(() => {
|
|
|
50
50
|
const getColumns = () => {
|
|
51
51
|
const selectKeyArr = props.config?.selectKey?.split?.(',') || []
|
|
52
52
|
return selectKeyArr.map((key, idx) => {
|
|
53
|
+
let index = selects?.value?.[key]?.findIndex(option => option?.columnValue === formatValue.value[idx])
|
|
53
54
|
return {
|
|
54
|
-
defaultIndex:
|
|
55
|
+
defaultIndex: index > -1 ? index : 0,
|
|
55
56
|
values: selects?.value?.[key]?.map(option => ({
|
|
56
57
|
label: lang?.value?.indexOf('zh') > -1 ? option.columnDesc_zh : option.columnDesc,
|
|
57
58
|
value: option.columnValue
|
|
@@ -18,9 +18,17 @@ export default {
|
|
|
18
18
|
default: 2,
|
|
19
19
|
},
|
|
20
20
|
showMoney: {
|
|
21
|
-
type: String,
|
|
21
|
+
type: [String, Number],
|
|
22
22
|
default: ''
|
|
23
23
|
},
|
|
24
|
+
min: {
|
|
25
|
+
type: Number,
|
|
26
|
+
default: -Infinity
|
|
27
|
+
},
|
|
28
|
+
max: {
|
|
29
|
+
type: Number,
|
|
30
|
+
default: Infinity
|
|
31
|
+
},
|
|
24
32
|
// 小数位数
|
|
25
33
|
decimal: {
|
|
26
34
|
type: Number,
|
|
@@ -248,6 +256,10 @@ export default {
|
|
|
248
256
|
if (isNaN(val)) {
|
|
249
257
|
return ''
|
|
250
258
|
}
|
|
259
|
+
|
|
260
|
+
// 转换数字并限制范围
|
|
261
|
+
val = Math.max(props.min, Math.min(props.max, val))
|
|
262
|
+
|
|
251
263
|
// 处理千分位
|
|
252
264
|
const parts = val.toFixed(props.decimal).split('.')
|
|
253
265
|
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
|