Commit ed692f05 authored by 田翔's avatar 田翔

fix: 不允许清空编码

parent 4e4bf0c7
......@@ -605,6 +605,7 @@ const textWidgets = [
title: '编码',
type: 'string',
widget: 'Coding',
disabled: true,
},
setting: {
widget: {
......@@ -657,15 +658,6 @@ const textWidgets = [
disabled: disabled,
dependencies: ['tableTypeParent', 'IsSystemField'],
},
disabled: {
title: '只读',
type: 'boolean',
widget: 'checkbox',
default: true,
width: '30%',
disabled: disabled,
dependencies: ['tableTypeParent', 'IsSystemField'],
},
prefixion: {
title: '前缀',
type: 'string',
......
......@@ -134,12 +134,33 @@ const FormDesigner = (props, ref) => {
},
onOk: () => {
const schema = designerRef.current.getValue()
let newschema = {}
for (let key in schema) {
if (key !== 'properties') {
newschema[key] = schema[key]
const { tableName, properties: parent } = schema
let parentObj = {}
if (tableName?.includes('设备_台账')) {
for (let v in parent) {
if (isObject(parent)) {
let child = parent[v].properties
if (isObject(child)) {
for (let s in child) {
if (s === '编码') {
parentObj = {
[v]: {
...parent[v],
properties: {
[s]: child[s]
}
},
}
}
}
}
}
}
}
let newschema = {
...schema,
properties: parentObj
}
designerRef.current.setValue(newschema)
}
})
......
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