Commit 51a1aac9 authored by 田翔's avatar 田翔

fix: 手写签名增加必填,关联表单中的本人信息修复

parent 5298441f
{ {
"name": "panda-xform", "name": "panda-xform",
"version": "5.4.4", "version": "5.4.5",
"description": "5.4.4 关联表单增加必填", "description": "5.4.5 手写签名增加必填,关联表单中的本人信息修复",
"keywords": [ "keywords": [
"panda-xform" "panda-xform"
], ],
......
...@@ -2688,6 +2688,13 @@ const advancedWidgets = [ ...@@ -2688,6 +2688,13 @@ const advancedWidgets = [
type: 'string', type: 'string',
widget: 'htmlInput', widget: 'htmlInput',
}, },
required: {
title: '必填',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '33%',
},
disabled: { disabled: {
title: '只读', title: '只读',
type: 'boolean', type: 'boolean',
......
...@@ -13,7 +13,7 @@ const BaseForm = (props, ref) => { ...@@ -13,7 +13,7 @@ const BaseForm = (props, ref) => {
} }
)) ))
const { schemaForm, config, formState, disabled } = props const { schemaForm, config, formState, disabledFields, disabled } = props
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext) const { getPrefixCls } = useContext(ConfigProvider.ConfigContext)
const prefixCls = getPrefixCls('pandaXform') const prefixCls = getPrefixCls('pandaXform')
const pandaXform = getPrefixCls() const pandaXform = getPrefixCls()
...@@ -41,6 +41,7 @@ const BaseForm = (props, ref) => { ...@@ -41,6 +41,7 @@ const BaseForm = (props, ref) => {
if (isObject(parent)) { if (isObject(parent)) {
for (let v in parent) { for (let v in parent) {
let child = parent[v]?.properties let child = parent[v]?.properties
let hidden = true
let childObj = {} let childObj = {}
if (isObject(child)) { if (isObject(child)) {
for (let s in child) { for (let s in child) {
...@@ -51,11 +52,32 @@ const BaseForm = (props, ref) => { ...@@ -51,11 +52,32 @@ const BaseForm = (props, ref) => {
value = v.fieldValue value = v.fieldValue
} }
}) })
//只读情况下,去掉必填校验
let disabledField = child[s].disabled let disabledField = child[s].disabled
let required = child[s].required
if (disabledFields && !disabledFields.includes(s) && !disabledField) {
disabledField = true
}
if (disabled) { if (disabled) {
disabledField = true disabledField = true
} }
childObj[s] = { ...child[s], presetValue: value || child[s].presetValue, disabled: disabledField } if (disabledField) {
required = false
}
//分组中有一个显示就将分组设置显示
if (!child[s].hidden) {
hidden = false
}
if (child[s].isDoing) {
array.push(s)
}
childObj[s] = {
...child[s],
presetValue: disabledField ? (value || '') : (value || child[s].presetValue),
textDefalut: child[s].presetValue,
disabled: disabledField,
required,
}
} }
} }
} }
......
...@@ -5,7 +5,7 @@ import styles from './index.less' ...@@ -5,7 +5,7 @@ import styles from './index.less'
function formatMoney(number, places, symbol, thousand, decimal) { function formatMoney(number, places, symbol, thousand, decimal) {
number = number || 0; number = number || 0;
places = !isNaN(places = Math.abs(places)) ? places : 2; places = !isNaN(places = Math.abs(places)) ? places : 2;
symbol = symbol !== undefined ? symbol : "$"; symbol = symbol !== undefined ? symbol : "";
thousand = thousand || ","; thousand = thousand || ",";
decimal = decimal || "."; decimal = decimal || ".";
var negative = number < 0 ? "-" : "", var negative = number < 0 ? "-" : "",
......
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