resolver-egretimp-plus 0.0.284 → 0.0.286

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.0.284",
3
+ "version": "0.0.286",
4
4
  "description": "交付体验渲染",
5
5
  "main": "./dist/web/index.js",
6
6
  "module": "./dist/web/index.js",
@@ -38,6 +38,11 @@ const props = defineProps({
38
38
  type: Number,
39
39
  default: 2
40
40
  },
41
+ // 保留小数点0后缀
42
+ decimalSuffix: {
43
+ type: [Number, String],
44
+ default: '0'
45
+ },
41
46
  // 在显示金额的时候,可以显示的符号
42
47
  canShowFlag: {
43
48
  type: Array,
@@ -147,7 +152,14 @@ function formatValue(value) {
147
152
  val = Math.max(props.min, Math.min(props.max, val))
148
153
 
149
154
  // 处理千分位
150
- const parts = val.toFixed(props.decimal).split('.')
155
+ if (props.decimal != '-1') {
156
+ val = val.toFixed(props.decimal)
157
+ }
158
+ if (props.decimalSuffix != '1') {
159
+ val = parseFloat(val)
160
+ }
161
+ const parts = `${val}`.split('.')
162
+
151
163
  parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
152
164
 
153
165
  // 添加货币符号
@@ -109,8 +109,9 @@ export default {
109
109
  })
110
110
  // 开启金额展示的时候需要isFocus来控制格式的转换
111
111
  const isFocus = ref(false)
112
+ const currentVal = ref('')
112
113
  const displayValue = computed(() => {
113
- return props.showMoney == '1' ? (isFocus.value ? modelValue.value : formatValue(modelValue.value)) : modelValue.value
114
+ return props.showMoney == '1' ? (isFocus.value ? currentVal.value : formatValue(modelValue.value)) : modelValue.value
114
115
  })
115
116
  const isPagePopup = computed(() => {
116
117
  return props.config?.lcpPagePopupMapVO
@@ -129,15 +130,20 @@ export default {
129
130
  }
130
131
  if (!(isPagePopup.value && !isPagePopupAlwayEdit.value)) {
131
132
  ret['onUpdate:modelValue'] = (val) => {
132
- modelValue.value = val
133
+ if (props.showMoney == '1') {
134
+ currentVal.value = val
135
+ } else {
136
+ modelValue.value = val
137
+ }
133
138
  }
134
139
  if (props.showMoney == '1') {
135
140
  ret['onFocus'] = () => {
141
+ currentVal.value = modelValue.value
136
142
  isFocus.value = true
137
143
  }
138
144
  ret['onBlur'] = () => {
145
+ modelValue.value = parseValue(formatValue(currentVal.value))
139
146
  isFocus.value = false
140
- modelValue.value = parseValue(formatValue(modelValue.value))
141
147
  }
142
148
  }
143
149
  } else {
@@ -268,7 +274,9 @@ export default {
268
274
  val = Math.max(props.min, Math.min(props.max, val))
269
275
 
270
276
  // 处理千分位
271
- val = val.toFixed(props.decimal)
277
+ if (props.decimal != '-1') {
278
+ val = val.toFixed(props.decimal)
279
+ }
272
280
  if (props.decimalSuffix != '1') {
273
281
  val = parseFloat(val)
274
282
  }
@@ -959,7 +959,7 @@ function normalLabelTipContent(content = '') {
959
959
  function createFormLable(config, lang = 'zh') {
960
960
  const ElTooltip = resolveComponent('el-tooltip')
961
961
  const elIcon = resolveComponent('el-icon')
962
- const required = config.requiredFlag === '1'
962
+ const required = config.requiredFlag === '1' && config.hiddenRequiredFlag != '1'
963
963
  const slots = {}
964
964
  slots.default = () => {
965
965
  return <span class="label-tip"><elIcon size="17">