Commit daf6d641 authored by 田翔's avatar 田翔

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

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