瀏覽代碼

划分树引用元素表处理。

ZaiZai 2 年之前
父節點
當前提交
228305fcb5
共有 1 個文件被更改,包括 9 次插入13 次删除
  1. 9 13
      src/views/data-fill/division.vue

+ 9 - 13
src/views/data-fill/division.vue

@@ -994,7 +994,7 @@ const addingFormTreeProps = {
 const addingFormTreeLoadNode = async (node, resolve) => {
     if (node.level === 0) {
         const resData = await tabTypeLazyTree()
-        resolve(resData)
+        resolve(resData?.data)
     } else {
         resolve([])
     }
@@ -1015,7 +1015,7 @@ const querySearchTree = async (key, resolve) => {
     if(key) {
         const primaryKeyId = addingFormTreeItem.value?.primaryKeyId ?? ''
         const resData = await tabTypeLazyTree(primaryKeyId, key)
-        resolve(resData)
+        resolve(resData?.data)
     } else{
         resolve([])
     }
@@ -1054,7 +1054,7 @@ const getDialogTableData = async () => {
     const searchTitle = searchTreeTitle.value ?? ''
     //获取数据
     const resData = await tabTypeLazyTree(primaryKeyId, searchTitle, true, true)
-    const records = getArrValue(resData?.records)
+    const records = getArrValue(resData?.data)
     //处理返回的数据
     dialogTableData.value = records
     if (records.length > 0) {
@@ -1071,7 +1071,7 @@ const dialogTableSelection = (rows) => {
 }
 
 //获取数据
-const tabTypeLazyTree = async (parentId = '12345678910', titleName = '', search = false, table = false) => {
+const tabTypeLazyTree = async (parentId = '12345678910', titleName = '', search = false) => {
     let obj = {}, searchObj = {}
     if(parentId) obj.parentId = parentId
     if(titleName) obj.titleName = titleName
@@ -1083,15 +1083,11 @@ const tabTypeLazyTree = async (parentId = '12345678910', titleName = '', search
         ...obj,
         ...searchObj
     })
-    if (table) {
-        return data
-    } else {
-        const resData = getArrValue(data)
-        resData.forEach(item => {
-            item.isLeaf = true
-        })
-        return resData
-    }
+    const records = getArrValue(data?.records)
+    records.forEach(item => {
+        item.isLeaf = true
+    })
+    return {data: records, total: data?.total}
 }
 
 //保存