|
@@ -483,7 +483,13 @@ export default {
|
|
|
if (isTreeSelect) {
|
|
|
if (cur.conditions && cur.conditions.length) return
|
|
|
getAPIData(cur, config.propsUrl, config.ApiParams, componentList, 'search', config.apiProps).then((res) => {
|
|
|
- this.$set(cur, 'options', res)
|
|
|
+ try {
|
|
|
+ let data = res.filter((i) => i[cur.__config__.apiProps.idKey] || i[cur.__config__.apiProps.pidKey])
|
|
|
+ let treeData = g.T.toTree(data, cur.props.props.children, cur.__config__.apiProps.idKey, cur.__config__.apiProps.pidKey)
|
|
|
+ this.$set(cur, 'options', treeData)
|
|
|
+ } catch {
|
|
|
+ this.$set(cur, 'options', res)
|
|
|
+ }
|
|
|
})
|
|
|
} else {
|
|
|
getAPIData(cur.__slot__, config.propsUrl, config.ApiParams, componentList, 'search', config.apiProps).then((res) => {
|