浏览代码

树统计

CzRger 2 周之前
父节点
当前提交
b250f907cc
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      src/views/study/subject/question/index.vue

+ 3 - 3
src/views/study/subject/question/index.vue

@@ -188,10 +188,10 @@ const initTree = () => {
     level: 1,
   })
     .then(({ data }: any) => {
-      const deep = (arr, parent = []) => {
+      const deep = (arr, parent: any = []) => {
         return arr.map((v) => {
-          v.total = 0
-          v.totalMake = 0
+          v.total = v.size || 0
+          v.totalMake = v.questionSize || 0
           if (v.children?.length > 0) {
             v.children = deep(v.children, [...parent, v])
           } else {