hml 5 hónapja
szülő
commit
6d172505ea

+ 7 - 1
src/views/basic/dynamicModel/list/Search.vue

@@ -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) => {

+ 1 - 1
src/views/basic/dynamicModel/list/index.vue

@@ -1979,7 +1979,7 @@ export default {
               function: find.config.jnpfKey === 'numInput' ? 'between' : 'like',
               values: oldItem.values
             }
-            if (this.treeFilter.find((i) => i.cubeColumnId === item.cubeColumnId)) {
+            if (this.treeFilter?.find((i) => i.cubeColumnId === item.cubeColumnId)) {
               subParamsObj.function = item.function
             }
             subTableQueryParams.push(subParamsObj)