Browse Source

项目成本默认折叠

yuhan 1 year ago
parent
commit
aa00d6f9d3
1 changed files with 2 additions and 37 deletions
  1. 2 37
      src/views/module_kzks/projectCostList/ProjectCostList.vue

+ 2 - 37
src/views/module_kzks/projectCostList/ProjectCostList.vue

@@ -274,7 +274,7 @@
         // 一键折叠/展开
         expandedRowKeys: [],
         // 是否全部展开
-        isExpanded: true,
+        isExpanded: false,
         // 获取到的对比数据
         duibiList: [],
         // 获取到的材料费对比数据
@@ -562,7 +562,6 @@
     },
     created() {
       this.initColumns();
-      this.loadData()
       this.getSuperFieldList();
     },
     computed: {
@@ -571,36 +570,6 @@
       },
     },
     methods: {
-      loadData(arg) {
-        if(!this.url.list){
-          this.$message.error("请设置url.list属性!")
-          return
-        }
-        //加载数据 若传入参数1则加载第一页的内容
-        if (arg === 1) {
-          this.ipagination.current = 1;
-        }
-        var params = this.getQueryParams();//查询条件
-        this.loading = true;
-        getAction(this.url.list, params).then((res) => {
-          if (res.success) {
-            //update-begin---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
-            this.dataSource = res.result.records||res.result;
-            if(res.result.total)
-            {
-              this.ipagination.total = res.result.total;
-            }else{
-              this.ipagination.total = 0;
-            }
-            //update-end---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
-            this.setDefaultExpand()
-          }else{
-            this.$message.warning(res.message)
-          }
-        }).finally(() => {
-          this.loading = false
-        })
-      },
       initDictConfig(){
       },
       getSuperFieldList(){
@@ -763,14 +732,10 @@
           this.expandedRowKeys = []
         } else {
           // 当前为折叠,全部展开
-          this.setDefaultExpand()
+          this.expandedRowKeys = this.dataSource.map(res => res.id)
         }
         this.isExpanded = !this.isExpanded
       },
-      // 全部展开
-      setDefaultExpand(){
-        this.expandedRowKeys = this.dataSource.map(res => res.id)
-      },
       onExpand (expanded, record) {
         if (expanded) {
           console.log(record.id)