Эх сурвалжийг харах

表单回显功能“查看详情“按“钮loading问题

duy 4 өдөр өмнө
parent
commit
299bd6bb45

+ 6 - 4
src/views/manager/wbsinfo/element.vue

@@ -53,7 +53,7 @@
               </template>
               <template slot-scope="{type,size,row}" slot="menu">
                 <el-button :size="size" :type="type" @click="getDetail(row)"
-                  :loading="detailBtnLoading">查看详情</el-button>
+                  :loading="loadingRowId === row.id">查看详情</el-button>
                 <!-- <el-button  :size="size" :type="type" @click="distribution(row)">分配节点</el-button> -->
                 <el-button :size="size" :type="type" @click="handleEditFormula(row)">公式配置</el-button>
                 <el-button :size="size" :type="type" @click="editElement(row)">编辑元素</el-button>
@@ -547,8 +547,9 @@ export default {
       sort: [],
       searchinput: '',
       eTypeVal: '',
+      // 查看详情 ========= start
       detailVisible: false,
-      detailBtnLoading: false,
+      loadingRowId: null,
       detailTablePage: [],//详情数据
       detailTableData: {},
       detailTableLoading: false,
@@ -557,6 +558,7 @@ export default {
         pageIndex: 1,
         pageSize: 20,
       },
+      // 查看详情 ========= end
     }
   },
   computed: {
@@ -596,10 +598,10 @@ export default {
 
     },
     async getDetail(row) {
-      this.detailBtnLoading = true;
+      this.loadingRowId = row.id;
       const { data } = await getElementDetail({ id: row.id });
       this.detailTableData = data.data;
-      this.detailBtnLoading = false;
+      this.loadingRowId = null;
       this.detailVisible = true
       await this.listTablePage();
     },