Commit f38a1746 authored by 田翔's avatar 田翔

fix: 自动计算逻辑修复

parent 4010d673
{ {
"name": "panda-xform", "name": "panda-xform",
"version": "6.0.33", "version": "6.0.34",
"description": "6.0.33 删除预览ofd组件", "description": "6.0.34 自动计算逻辑修复",
"keywords": [ "keywords": [
"panda-xform" "panda-xform"
], ],
...@@ -137,4 +137,4 @@ ...@@ -137,4 +137,4 @@
"publishConfig": { "publishConfig": {
"registry": "https://g.civnet.cn:4873" "registry": "https://g.civnet.cn:4873"
} }
} }
\ No newline at end of file
...@@ -145,7 +145,10 @@ const formAutomatic = async (params) => { ...@@ -145,7 +145,10 @@ const formAutomatic = async (params) => {
const schema = params?.form?.getSchemaByPath(path) const schema = params?.form?.getSchemaByPath(path)
params?.form?.setSchemaByPath(path, { ...schema, otherValue: v.fieldValue + '' }) params?.form?.setSchemaByPath(path, { ...schema, otherValue: v.fieldValue + '' })
} else { } else {
params.form.setValueByPath(path, v.fieldValue + '') const schema = params?.form?.getSchemaByPath(path)
if (schema.formatter !== '小数') {
params.form.setValueByPath(path, Number(v.fieldValue || 0) + '')
}
} }
} }
}) })
......
...@@ -26,8 +26,6 @@ const NumberInput = (props) => { ...@@ -26,8 +26,6 @@ const NumberInput = (props) => {
const { value, onChange, schema, addons } = props const { value, onChange, schema, addons } = props
const { disabled, presetValue, placeholder, prefix, formatter, decimalDigits, isStoreFormatter, addonBefore, addonAfter, min, max } = schema const { disabled, presetValue, placeholder, prefix, formatter, decimalDigits, isStoreFormatter, addonBefore, addonAfter, min, max } = schema
const [once, setOnce] = useState(true)
useEffect(() => { useEffect(() => {
if (addons) { if (addons) {
addons.setValueByPath(addons.dataPath, presetValue) addons.setValueByPath(addons.dataPath, presetValue)
...@@ -72,21 +70,6 @@ const NumberInput = (props) => { ...@@ -72,21 +70,6 @@ const NumberInput = (props) => {
return value return value
} }
// if (formatter === '${小数}') {
// return (
// <div className={styles.textInput} isdisabled={JSON.stringify(disabled)}>
// <Input
// disabled={disabled}
// value={value ? `${value}` : ''}
// placeholder={disabled ? (placeholder || '') : (placeholder || '请输入内容')}
// onChange={inputChange}
// addonBefore={addonBefore}
// addonAfter={addonAfter}
// />
// </div>
// )
// }
return ( return (
<div className={styles.inputNumber} isdisabled={JSON.stringify(disabled)}> <div className={styles.inputNumber} isdisabled={JSON.stringify(disabled)}>
<InputNumber <InputNumber
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment