Commit ba78b0f0 authored by 田翔's avatar 田翔

fix: 代码修复

parent a1051bd6
{
"name": "panda-xform",
"version": "6.0.4",
"description": "6.0.4 台账loding效果",
"version": "6.0.5",
"description": "6.0.5 文本支持自动计算",
"keywords": [
"panda-xform"
],
......
......@@ -133,6 +133,11 @@ const textWidgets = [
disabled: disabled,
dependencies: ['tableTypeParent', 'IsSystemField'],
},
calculateRule: {
title: '计算规则',
type: 'string',
widget: 'CalculateRule',
},
maxLength: {
title: '最大长度',
type: 'number',
......
......@@ -137,10 +137,14 @@ const formAutomatic = async (params) => {
data.forEach(v => {
let path = getPath(params.schema, v.fieldName)
if (path) {
console.log('params', params, path)
if (['DateTime', 'Time'].includes(params.widget)) {
if (v.fieldValue !== 0) {
params.form.setValueByPath(path, v.fieldValue + '')
}
} else if (['TextInput'].includes(params.widget)) {
const schema = params?.form?.getSchemaByPath(path)
params?.form?.setSchemaByPath(path, { ...schema, otherValue: v.fieldValue + '' })
} else {
params.form.setValueByPath(path, v.fieldValue + '')
}
......@@ -216,7 +220,7 @@ export const getWatch = ({ schema, form, startTime, initField }) => {
let formValue = form?.getValues()
let { relationForm } = formValue
const configs = relationForm?.configs || []
const AutoCalculate = getWidgetInfo(schema, ['NumberInput', 'DateTime', 'Time'])
const AutoCalculate = getWidgetInfo(schema, ['NumberInput', 'DateTime', 'Time', 'TextInput'])
const HiddenWidget = getHiddenWidget(schema)
const RelevanceSelect = getWidgetInfo(schema, ['RelevanceSelect'])
if (Array.isArray(AutoCalculate)) {
......
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