Commit 9ec718a4 authored by 田翔's avatar 田翔

fix: 删除选项控制

parent fb19448c
{
"name": "panda-xform",
"version": "2.8.7",
"description": "2.8.7: 选项长度修改",
"version": "2.9.0",
"description": "2.9.0: 删除选项控制",
"keywords": [
"panda-xform"
],
......
......@@ -44,6 +44,7 @@ const layoutWidgets = [
title: '展示名称',
type: 'string',
required: true,
disabled: '{{formData.title === "物联数据"}}',
},
},
},
......
......@@ -162,6 +162,10 @@ const FormDesigner = (props, ref) => {
return message.error('请按照提示完善表单内容')
}
let json = getJSON(designerRef.current.getValue(), fieldName)
let groups = Object.keys(json.properties)
if (groups.some(v => v.includes('_'))) {
return message.error('分组包含重复字段!')
}
designerRef.current.setValue(json)
const { code, data, msg } = await saveTableConfig(json)
if (code === 0) {
......@@ -225,13 +229,17 @@ const FormDesigner = (props, ref) => {
}
const canDelete = (values) => {
const { $id, tableTypeParent, IsSystemField } = values
const { $id, tableTypeParent, IsSystemField, title, type } = values
if (tableTypeParent === '物联设备表' && IsSystemField) {
if (fieldName.some(v => v.name === $id)) {
message.info(`表类型为:【${tableTypeParent}】,内部字段【${$id}】不允许删除!`)
message.info(`表类型为:【物联设备表】内部字段【${$id}】不允许删除!`)
return false
}
}
if (type === 'object' && ($id === '#/物联数据' || $id === '物联数据')) {
message.info(`表类型为:【物联设备表】包含内部字段不允许删除`)
return false
}
return true
}
......
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