Commit fd30c8f7 authored by 田翔's avatar 田翔

fix: 取消表单设计器校验

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