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

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

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