Commit daf6d641 authored by 田翔's avatar 田翔

fix: 详情状态下只读取值,不读取配置

parent d2218b1b
{
"name": "panda-xform",
"version": "5.0.5",
"description": "5.0.5 提示语修改",
"version": "5.0.6",
"description": "5.0.6 详情状态下只读取值不读取配置",
"keywords": [
"panda-xform"
],
......
......@@ -23,7 +23,7 @@ const XRender = (props, ref) => {
}
))
const { schemaValues, disabledFields, disabled, codes, print } = props
const { schemaValues, disabledFields, disabled, codes } = props
window.pandaXform = { codes }
const { formJson, values } = schemaValues
......@@ -69,8 +69,8 @@ const XRender = (props, ref) => {
}
childObj[s] = {
...child[s],
presetValue: value || child[s].presetValue,
textInputDefalut: child[s].presetValue,
presetValue: disabled ? (value || '') : (value || child[s].presetValue),
textDefalut: disabled ? '' : child[s].presetValue,
disabled: disabledField,
required
}
......
......@@ -26,7 +26,7 @@ const TextInput = (props) => {
const preview = sessionStorage.getItem('FormRender')
const userInfo = preview === 'preview' ? { fullName: '【本人姓名】', depart: { name: '【本人部门】' } } : window?.globalConfig?.userInfo || { fullName: '【本人姓名】', depart: { name: '【本人部门】' } }
const { value, onChange, schema, addons } = props
const { title, disabled, placeholder, presetValue, addonBefore, addonAfter, maxLength, rules, uniqueVerify, tableName, fieldName, isStoreID, textInputDefalut } = schema
const { title, disabled, placeholder, presetValue, addonBefore, addonAfter, maxLength, rules, uniqueVerify, tableName, fieldName, isStoreID, textDefalut } = schema
const handleChange = (e) => {
if (addons) {
......@@ -36,15 +36,15 @@ const TextInput = (props) => {
const valueShow = useMemo(() => {
if (isStoreID) {
if (textInputDefalut === '【本人姓名】') {
if (textDefalut === '【本人姓名】') {
return userInfo.fullName
}
if (textInputDefalut === '【本人部门】') {
if (textDefalut === '【本人部门】') {
return userInfo.depart.name
}
}
return value
}, [textInputDefalut, value, isStoreID])
}, [textDefalut, value, isStoreID])
useEffect(() => {
let paths = ['【本人姓名】', '【本人部门】']
......
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