resolver-egretimp-plus 0.1.47 → 0.1.49

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.47",
3
+ "version": "0.1.49",
4
4
  "description": "交付体验渲染",
5
5
  "main": "./dist/web/index.js",
6
6
  "module": "./dist/web/index.js",
@@ -4,9 +4,12 @@
4
4
  <script setup>
5
5
  import { findComponent } from '../../utils/common';
6
6
  import { commonPropsType, PLAIN_TYPE_OPTIONS_COLUMNS } from '../../utils/const' // 这边不能用utils/index去引用,因为这个组件在utils/render.js中被引入了,会造成循环引用
7
- import { computed, defineModel, defineProps, inject, getCurrentInstance } from 'vue'
7
+ import { computed, defineModel, defineProps, inject, getCurrentInstance, watch, nextTick } from 'vue'
8
8
  import dayjs from 'dayjs'
9
+ import { isNaN } from '../../utils/is';
10
+ import { useFormItem } from 'element-plus'
9
11
 
12
+ const { formItem: elFormItem } = useFormItem()
10
13
  const modelValue = defineModel()
11
14
  const props = defineProps({
12
15
  ...commonPropsType,
@@ -99,8 +102,12 @@ const value = computed(() => {
99
102
  // 转换inputNumber类型的值
100
103
  function inputNumebrFormat(val, props) {
101
104
  if (val === undefined || val === null) return ''
102
- const precise = parseInt(props.config.precise) || 0
103
- return parseFloat(val)?.toFixed?.(precise)
105
+ const precise = parseInt(props.config.precise)
106
+ if (isNaN(precise)) {
107
+ return parseFloat(val)
108
+ } else {
109
+ return parseFloat(val)?.toFixed?.(precise)
110
+ }
104
111
  }
105
112
 
106
113
  const classObj = computed(() => ({
@@ -184,6 +191,12 @@ function formatValue(value) {
184
191
  : `${formatted} ${props.symbol}`
185
192
  : formatted
186
193
  }
194
+
195
+ watch(modelValue, () => {
196
+ nextTick(() => {
197
+ elFormItem?.validate?.('blur').catch()
198
+ })
199
+ })
187
200
  </script>
188
201
  <style lang="scss" scoped>
189
202
  .custom-component-plain {
package/src/utils/is.js CHANGED
@@ -31,6 +31,7 @@ export {
31
31
  isUndefined,
32
32
  isWeakMap,
33
33
  isWeakSet,
34
+ isNaN
34
35
  } from 'lodash-es';
35
36
  const toString = Object.prototype.toString;
36
37