Commit ed692f05 authored by 田翔's avatar 田翔

fix: 不允许清空编码

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