Commit 27323fad authored by 田翔's avatar 田翔

fix: 站点选择器回显问题

parent 727db353
{ {
"name": "panda-xform", "name": "panda-xform",
"version": "2.6.1", "version": "2.6.2",
"description": "2.6.1: 人员选择器分组形态BUG修复", "description": "2.6.2: 站点选择器回显问题",
"keywords": [ "keywords": [
"panda-xform" "panda-xform"
], ],
......
...@@ -96,20 +96,30 @@ const ComboBox = (props) => { ...@@ -96,20 +96,30 @@ const ComboBox = (props) => {
} }
} }
if (sourceType === '站点') { if (sourceType === '站点') {
const { code, data, msg } = await getStationIDListByUserID(userID, !isMySite) getStation()
if (code === 0) {
if (Array.isArray(data)) {
setSite(data)
} else {
setSite([])
}
} else {
message.error(msg)
}
} }
} }
} }
const getStation = async () => {
const { code, data, msg } = await getStationIDListByUserID(userID, !isMySite)
if (code === 0) {
if (Array.isArray(data)) {
setSite(data)
} else {
setSite([])
}
} else {
message.error(msg)
}
}
useEffect(async () => {
if (sourceType === '站点' && isStoreID) {
getStation()
}
}, [])
return ( return (
<Select <Select
onFocus={onFocus} onFocus={onFocus}
......
...@@ -60,14 +60,16 @@ const HiddenCondition = (props) => { ...@@ -60,14 +60,16 @@ const HiddenCondition = (props) => {
if (rule) { if (rule) {
const { code, data } = await getFormFieldHideDtos({ formula: rule }) const { code, data } = await getFormFieldHideDtos({ formula: rule })
if (data) { if (data) {
addons.setValue('hiddenRules', data)
onChange(rule) onChange(rule)
setVisible(false) addons.setValue('hiddenRules', data)
} else { } else {
addons.setValue('hiddenRules', []) return message.error('校验不通过!')
message.error('校验不通过!')
} }
} else {
onChange('')
addons.setValue('hiddenRules', [])
} }
setVisible(false)
} }
const onCancel = () => { const onCancel = () => {
......
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