Commit 826fa9a4 authored by 田翔's avatar 田翔

fix: 存储ID

parent 61517eb4
{ {
"name": "panda-xform", "name": "panda-xform",
"version": "5.3.7", "version": "5.3.8",
"description": "5.3.7 通过ID获取部门名称", "description": "5.3.8 存储ID",
"keywords": [ "keywords": [
"panda-xform" "panda-xform"
], ],
......
...@@ -32,6 +32,7 @@ const TextInput = (props) => { ...@@ -32,6 +32,7 @@ const TextInput = (props) => {
const preview = sessionStorage.getItem('FormRender') const preview = sessionStorage.getItem('FormRender')
const userInfo = preview === 'preview' ? initUserInfo : window?.globalConfig?.userInfo || initUserInfo const userInfo = preview === 'preview' ? initUserInfo : window?.globalConfig?.userInfo || initUserInfo
const { value, onChange, schema, addons } = props const { value, onChange, schema, addons } = props
const [showValue, setShowValue] = useState(value)
const { title, disabled, placeholder, presetValue, addonBefore, addonAfter, maxLength, rules, uniqueVerify, tableName, fieldName, isStoreID, textDefalut } = schema const { title, disabled, placeholder, presetValue, addonBefore, addonAfter, maxLength, rules, uniqueVerify, tableName, fieldName, isStoreID, textDefalut } = schema
const handleChange = (e) => { const handleChange = (e) => {
...@@ -45,7 +46,7 @@ const TextInput = (props) => { ...@@ -45,7 +46,7 @@ const TextInput = (props) => {
const { code, data } = await getUserName(userID) const { code, data } = await getUserName(userID)
if (code === 0) { if (code === 0) {
if (Array.isArray(data) && data.length > 0) { if (Array.isArray(data) && data.length > 0) {
onChange(data[0]) setShowValue(data[0])
} }
} }
} }
...@@ -54,7 +55,7 @@ const TextInput = (props) => { ...@@ -54,7 +55,7 @@ const TextInput = (props) => {
const { code, data } = await getGroupName(groupIds) const { code, data } = await getGroupName(groupIds)
if (code === 0) { if (code === 0) {
if (Array.isArray(data) && data.length > 0) { if (Array.isArray(data) && data.length > 0) {
onChange(data[0]) setShowValue(data[0])
} }
} }
} }
...@@ -85,6 +86,7 @@ const TextInput = (props) => { ...@@ -85,6 +86,7 @@ const TextInput = (props) => {
} else { } else {
onChange(valueNext || '') onChange(valueNext || '')
} }
setShowValue(valueNext)
if (isStoreID && valueNext) { if (isStoreID && valueNext) {
if (textDefalut === '【本人姓名】') { if (textDefalut === '【本人姓名】') {
getUserInfo(valueNext) getUserInfo(valueNext)
...@@ -121,7 +123,7 @@ const TextInput = (props) => { ...@@ -121,7 +123,7 @@ const TextInput = (props) => {
<Input <Input
style={{ color: loaclPaths.includes(presetValue) ? 'blue' : '' }} style={{ color: loaclPaths.includes(presetValue) ? 'blue' : '' }}
disabled={disabled} disabled={disabled}
value={value} value={showValue}
maxLength={maxLength} maxLength={maxLength}
placeholder={disabled ? (placeholder || '') : (placeholder || '请输入内容')} placeholder={disabled ? (placeholder || '') : (placeholder || '请输入内容')}
onChange={handleChange} onChange={handleChange}
......
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