Commit fd30c8f7 authored by 田翔's avatar 田翔

fix: 取消表单设计器校验

parent 09f1b5ad
{ {
"name": "panda-xform", "name": "panda-xform",
"version": "4.0.5", "version": "4.0.6",
"description": "4.0.5: 未知原因出现关联表单配置后无法操作问题", "description": "4.0.6: 取消表单设计器校验",
"keywords": [ "keywords": [
"panda-xform" "panda-xform"
], ],
......
...@@ -778,30 +778,7 @@ const selectWidgets = [ ...@@ -778,30 +778,7 @@ const selectWidgets = [
type: 'array', type: 'array',
hidden: '{{formData.sourceType !== "手动输入"}}', hidden: '{{formData.sourceType !== "手动输入"}}',
default: [{ value: '选项一' }], default: [{ value: '选项一' }],
// widget: 'simpleList',
widget: 'SimpleList', widget: 'SimpleList',
items: {
type: 'object',
properties: {
value: {
title: '',
type: 'string',
displayType: 'row',
labelWidth: 10,
required: true,
default: '',
props: {
style: {
width: '200px',
color: 'blue'
}
}
},
},
},
props: {
hideCopy: true,
},
displayType: 'row', displayType: 'row',
labelWidth: 80, labelWidth: 80,
dependencies: ['sourceType', 'color'] dependencies: ['sourceType', 'color']
...@@ -874,7 +851,6 @@ const selectWidgets = [ ...@@ -874,7 +851,6 @@ const selectWidgets = [
}, },
isStoreID: { isStoreID: {
title: '是否存储ID', title: '是否存储ID',
required: true,
default: false, default: false,
hidden: '{{formData.sourceType !== "站点"}}', hidden: '{{formData.sourceType !== "站点"}}',
type: 'boolean', type: 'boolean',
...@@ -971,29 +947,6 @@ const selectWidgets = [ ...@@ -971,29 +947,6 @@ const selectWidgets = [
hidden: '{{formData.sourceType !== "手动输入"}}', hidden: '{{formData.sourceType !== "手动输入"}}',
default: [{ value: '选项一' }], default: [{ value: '选项一' }],
widget: 'SimpleList', widget: 'SimpleList',
items: {
type: 'object',
properties: {
value: {
title: '',
type: 'string',
displayType: 'row',
labelWidth: 10,
// required: true,
default: '',
props: {
style: {
width: '200px',
color: 'blue'
}
}
},
},
},
props: {
// hideMove: true,
hideCopy: true,
},
dependencies: ['sourceType', 'color'] dependencies: ['sourceType', 'color']
}, },
dictionary: { dictionary: {
...@@ -1120,28 +1073,6 @@ const selectWidgets = [ ...@@ -1120,28 +1073,6 @@ const selectWidgets = [
hidden: '{{formData.sourceType !== "手动输入"}}', hidden: '{{formData.sourceType !== "手动输入"}}',
default: [{ value: '选项一' }], default: [{ value: '选项一' }],
widget: 'SimpleList', widget: 'SimpleList',
items: {
type: 'object',
properties: {
value: {
title: '',
type: 'string',
displayType: 'row',
labelWidth: 10,
default: '',
props: {
style: {
width: '200px',
color: 'blue'
}
}
},
},
},
props: {
// hideMove: true,
hideCopy: true,
},
dependencies: ['sourceType', 'color'] dependencies: ['sourceType', 'color']
}, },
dictionary: { dictionary: {
...@@ -1351,14 +1282,14 @@ const selectWidgets = [ ...@@ -1351,14 +1282,14 @@ const selectWidgets = [
fieldParent: { fieldParent: {
title: '父字段名', title: '父字段名',
type: 'string', type: 'string',
required: true, // required: true,
widget: 'FieldNames', widget: 'FieldNames',
dependencies: ['$id'], dependencies: ['$id'],
}, },
dictionary: { dictionary: {
title: '数据字典', title: '数据字典',
name: '数据字典', name: '数据字典',
required: true, // required: true,
type: 'string', type: 'string',
widget: 'Dictionary', widget: 'Dictionary',
}, },
...@@ -1756,14 +1687,14 @@ const businessWidgets = [ ...@@ -1756,14 +1687,14 @@ const businessWidgets = [
name: '台账名称', name: '台账名称',
type: 'string', type: 'string',
widget: 'AccountName', widget: 'AccountName',
required: true, // required: true,
}, },
fieldshine: { fieldshine: {
title: '映射字段', title: '映射字段',
name: '映射字段', name: '映射字段',
type: 'array', type: 'array',
widget: 'Fieldshine', widget: 'Fieldshine',
required: true, // required: true,
dependencies: ['accountName', '$id'], dependencies: ['accountName', '$id'],
default: [], default: [],
description: '多字段映射仅支持单选', description: '多字段映射仅支持单选',
...@@ -2061,7 +1992,6 @@ const fileWidgets = [ ...@@ -2061,7 +1992,6 @@ const fileWidgets = [
fileType: { fileType: {
title: '文件类型', title: '文件类型',
type: 'string', type: 'string',
required: true,
widget: 'select', widget: 'select',
enum: ['全部', '图片', '文档', '音频', '视频'], enum: ['全部', '图片', '文档', '音频', '视频'],
enumNames: ['全部', '图片', '文档', '音频', '视频'], enumNames: ['全部', '图片', '文档', '音频', '视频'],
......
...@@ -149,10 +149,10 @@ const FormDesigner = (props, ref) => { ...@@ -149,10 +149,10 @@ const FormDesigner = (props, ref) => {
} }
const preview = () => { const preview = () => {
const errors = designerRef.current.getErrorFields() // const errors = designerRef.current.getErrorFields()
if (errors.length) { // if (errors.length) {
return message.error('请按照提示完善表单内容') // return message.error('请按照提示完善表单内容')
} // }
let json = getJSON(designerRef.current.getValue(), fieldName) let json = getJSON(designerRef.current.getValue(), fieldName)
let verify = getVerify(json) let verify = getVerify(json)
if (verify === true) { if (verify === true) {
...@@ -164,10 +164,10 @@ const FormDesigner = (props, ref) => { ...@@ -164,10 +164,10 @@ const FormDesigner = (props, ref) => {
} }
const submit = async () => { const submit = async () => {
const errors = designerRef.current.getErrorFields() // const errors = designerRef.current.getErrorFields()
if (errors.length) { // if (errors.length) {
return message.error('请按照提示完善表单内容') // return message.error('请按照提示完善表单内容')
} // }
let json = getJSON(designerRef.current.getValue(), fieldName) let json = getJSON(designerRef.current.getValue(), fieldName)
let verify = getVerify(json) let verify = getVerify(json)
if (verify === true) { if (verify === true) {
...@@ -182,10 +182,10 @@ const FormDesigner = (props, ref) => { ...@@ -182,10 +182,10 @@ const FormDesigner = (props, ref) => {
} }
const initLayout = () => { const initLayout = () => {
const errors = designerRef.current.getErrorFields() // const errors = designerRef.current.getErrorFields()
if (errors.length) { // if (errors.length) {
return message.error('请按照提示完善表单内容') // return message.error('请按照提示完善表单内容')
} // }
let json = getJSON(designerRef.current.getValue(), fieldName) let json = getJSON(designerRef.current.getValue(), fieldName)
let verify = getVerify(json) let verify = getVerify(json)
if (verify === true) { if (verify === true) {
...@@ -293,7 +293,7 @@ const FormDesigner = (props, ref) => { ...@@ -293,7 +293,7 @@ const FormDesigner = (props, ref) => {
mapping={{ mapping={{
object: 'Header', object: 'Header',
}} }}
validation={true} // validation={true}
ref={designerRef} ref={designerRef}
extraButtons={extraButtons} extraButtons={extraButtons}
widgets={widgets} widgets={widgets}
......
...@@ -148,7 +148,7 @@ export const getVerify = (json) => { ...@@ -148,7 +148,7 @@ export const getVerify = (json) => {
let child = properties[v]?.properties let child = properties[v]?.properties
if (isObject(child)) { if (isObject(child)) {
for (let s in child) { for (let s in child) {
const { widget, sourceType, options, dictionary, tableName, fieldName } = child[s] const { widget, sourceType, options, dictionary, tableName, fieldName, fieldParent, accountName, fieldshine } = child[s]
if (['ComboBox', 'RadioButton', 'CheckBox'].includes(widget)) { if (['ComboBox', 'RadioButton', 'CheckBox'].includes(widget)) {
if (sourceType === '手动输入' && !options.length) { if (sourceType === '手动输入' && !options.length) {
return message.error(`字段【${s}】配置,选项值必填!`) return message.error(`字段【${s}】配置,选项值必填!`)
...@@ -165,6 +165,16 @@ export const getVerify = (json) => { ...@@ -165,6 +165,16 @@ export const getVerify = (json) => {
return message.error(`字段【${s}】配置,台账名称与映射字段必填!`) return message.error(`字段【${s}】配置,台账名称与映射字段必填!`)
} }
} }
if (['RelevanceSelect'].includes(widget)) {
if (!fieldParent || !dictionary) {
return message.error(`字段【${s}】配置,父字段名与数据字典必填!`)
}
}
if (['AccountSelector'].includes(widget)) {
if (!accountName || !fieldshine) {
return message.error(`字段【${s}】配置,台账名称与映射字段必填!`)
}
}
} }
} }
} }
......
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