Commit 3b787f93 authored by 田翔's avatar 田翔

fix: 默认第一个站点bug修复

parent dae8b742
{ {
"name": "panda-xform", "name": "panda-xform",
"version": "4.7.1", "version": "4.7.2",
"description": "4.7.1 关联选择支持清空", "description": "4.7.2 默认第一个站点bug修复",
"keywords": [ "keywords": [
"panda-xform" "panda-xform"
], ],
......
...@@ -82,9 +82,10 @@ const ComboBox = (props) => { ...@@ -82,9 +82,10 @@ const ComboBox = (props) => {
const { code, data, msg } = await getStationIDListByUserID(userID, !isMySite) const { code, data, msg } = await getStationIDListByUserID(userID, !isMySite)
if (code === 0) { if (code === 0) {
if (Array.isArray(data)) { if (Array.isArray(data)) {
setSite(data.map(v => ({ stationID: v.stationID + '', stationName: v.stationName }))) let values = data.map(v => ({ stationID: v.stationID + '', stationName: v.stationName }))
setSite(values)
if (!value && !presetValue) { if (!value && !presetValue) {
onChange(data[0][isStoreID ? 'stationID' : 'stationName']) onChange(values[0][isStoreID ? 'stationID' : 'stationName'])
} }
} else { } else {
setSite([]) setSite([])
......
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