resolver-egretimp-plus 0.1.87 → 0.1.89

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "resolver-egretimp-plus",
3
- "version": "0.1.87",
3
+ "version": "0.1.89",
4
4
  "description": "交付体验渲染",
5
5
  "main": "./dist/web/index.js",
6
6
  "module": "./dist/web/index.js",
@@ -28,6 +28,11 @@ const props = defineProps({
28
28
  type: [String, Number],
29
29
  default: ''
30
30
  },
31
+ // 金额显示的分割,默认‘,’
32
+ moneySeg: {
33
+ type: [String],
34
+ default: ','
35
+ },
31
36
  min: {
32
37
  type: Number,
33
38
  default: -Infinity
@@ -173,7 +178,8 @@ function formatValue(value) {
173
178
  return value
174
179
  }
175
180
  if (value === null || isNaN(value)) return ''
176
- let val = parseFloat(value)
181
+ let val = `${value}`.replace(props.moneySeg, '')
182
+ val = parseFloat(val)
177
183
  if (isNaN(val)) {
178
184
  return ''
179
185
  }
@@ -190,7 +196,7 @@ function formatValue(value) {
190
196
  }
191
197
  const parts = `${val}`.split('.')
192
198
 
193
- parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
199
+ parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, props.moneySeg)
194
200
 
195
201
  // 添加货币符号
196
202
  const formatted = parts.join('.')
@@ -102,6 +102,7 @@ const initSelEmployee = async () => {
102
102
  placeholder: lang?.value?.indexOf('zh') > -1 ? props.placeholder : props.placeholderEn,
103
103
  // disabled: props.disabled,
104
104
  onSelectedChange: (data, arr) => {
105
+ console.log('onSelectedChange===:', data, arr)
105
106
  emit('change', data, arr, props)
106
107
  modelValue.value = data?.join(separator.value) || ''
107
108
  },
@@ -116,7 +116,7 @@
116
116
  }
117
117
 
118
118
  .CustomComponentCollapse:has(+ .CustomComponentCollapse) {
119
- margin-bottom: 12px;
119
+ margin-bottom: 16px;
120
120
  }
121
121
 
122
122
  // 选择第一个
@@ -13,26 +13,30 @@ export default function defaultVal(config) {
13
13
  let defaultVal = null
14
14
  try {
15
15
  if (typeof configDefaultVal === 'string') {
16
+ const trimValue = configDefaultVal.trim()
16
17
  let routeMatchs = null
17
- if ( typeof configDefaultVal === 'string' && (routeMatchs = configDefaultVal.match(/^_route:(.*)$/))) {
18
+ if (routeMatchs = trimValue.match(/^_route:(.*)$/)) {
18
19
  const queryKey = routeMatchs[1]
19
20
  const routeQuery = config?.route?.query
20
21
  defaultVal = routeQuery?.[queryKey]
21
- } else if ( typeof configDefaultVal === 'string' && (/^_lang$/.test(configDefaultVal))) {
22
+ } else if (routeMatchs = trimValue.match(/^_native:(.*)$/)) {
23
+ const val = routeMatchs[1]
24
+ defaultVal = val
25
+ } else if (/^_lang$/.test(trimValue)) {
22
26
  defaultVal = config?._lang
23
- } else if (/^{[\w\W]*}$/.test(configDefaultVal) || /^\[[\w\W]*\]$/.test(configDefaultVal)) {
24
- defaultVal = JSON.parse(configDefaultVal)
27
+ } else if (/^{[\w\W]*}$/.test(trimValue) || /^\[[\w\W]*\]$/.test(trimValue)) {
28
+ defaultVal = JSON.parse(trimValue)
25
29
  } else {
26
- if (configDefaultVal === ARG_FLAGS.CURRENT_DATE || configDefaultVal === 'currentDate' || configDefaultVal === ARG_FLAGS.CURRENT_DATE_TIME) {
27
- if (configDefaultVal === ARG_FLAGS.CURRENT_DATE_TIME) {
30
+ if (trimValue === ARG_FLAGS.CURRENT_DATE || trimValue === 'currentDate' || trimValue === ARG_FLAGS.CURRENT_DATE_TIME) {
31
+ if (trimValue === ARG_FLAGS.CURRENT_DATE_TIME) {
28
32
  defaultVal = formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')
29
33
  } else {
30
34
  defaultVal = formatDate(new Date(), 'yyyy-MM-dd')
31
35
  }
32
- } else if (['true', 'false'].includes(configDefaultVal)) {
33
- defaultVal = configDefaultVal == 'true' ? true : false
36
+ } else if (['true', 'false'].includes(trimValue)) {
37
+ defaultVal = trimValue == 'true' ? true : false
34
38
  } else {
35
- defaultVal = configDefaultVal
39
+ defaultVal = trimValue
36
40
  }
37
41
  }
38
42
  } else {