Selaa lähdekoodia

复制本表删除本表按钮加载状态

duy 2 vuotta sitten
vanhempi
commit
7ef530577e
1 muutettua tiedostoa jossa 9 lisäystä ja 4 poistoa
  1. 9 4
      src/views/tentative/detect/components/ListItem.vue

+ 9 - 4
src/views/tentative/detect/components/ListItem.vue

@@ -8,10 +8,10 @@
                             <div class="text-lg truncate item-title">{{item.nodeName}}</div>
                             <div class="hc-extra-text-box">
                                 <HcTooltip keys="wbs_del_table" v-if="item['isCopyTab'] === 1">
-                                    <el-button type="danger" plain :disabled="item['isBussShow'] === 2" @click.stop="delClick(item,index)">删除本表</el-button>
+                                    <el-button type="danger" plain :disabled="item['isBussShow'] === 2" @click.stop="delClick(item,index)" :loading="delClickLoading">删除本表</el-button>
                                 </HcTooltip>
                                 <HcTooltip keys="wbs_copy_table">
-                                    <el-button type="primary" plain :disabled="item['isBussShow'] === 2" @click.stop="copyClick(item,index)">复制本表</el-button>
+                                    <el-button type="primary" plain :disabled="item['isBussShow'] === 2" @click.stop="copyClick(item,index)" :loading="copyClickLoading">复制本表</el-button>
                                 </HcTooltip>
                                 <HcTooltip keys="wbs_hide_table">
                                     <el-button type="primary" plain @click.stop="hideClick(item,index)">
@@ -659,12 +659,13 @@ const getBussPdfInfo = async ({pKeyId}, showTip = true) => {
         window?.$message?.warning('pkeyId为空')
     }
 }
-
+const delClickLoading=ref(false)
 //删除本表
 const delClick = async ({pKeyId}) => {
     const pkeyIds = getValString(pKeyId)
     if (pkeyIds) {
         const { id } = baseData.value
+        delClickLoading.value=true
         const {error, code} = await dataApi.removeBussTabInfo({
             // id: id,
             pKeyId: pkeyIds
@@ -672,12 +673,14 @@ const delClick = async ({pKeyId}) => {
         if (!error && code === 200) {
             window?.$message?.success('操作成功')
             renewData()
+            delClickLoading.value=false
         }
     } else {
         window?.$message?.warning('pkeyId为空')
+         delClickLoading.value=false
     }
 }
-
+const copyClickLoading=ref(false)
 //复制本表
 const copyClick = async (item,index) => {
     const pkeyIds = getValString(item.pKeyId)
@@ -707,6 +710,7 @@ const copyClick = async (item,index) => {
 
 const copeBussTab = async (pkeyIds) => {
     const { id,contractId } = baseData.value
+    copyClickLoading.value=true
     const {error, code} = await dataApi.copyBussTab({
         id: id,
         pKeyId: pkeyIds,
@@ -717,6 +721,7 @@ const copeBussTab = async (pkeyIds) => {
         renewData()
         chageOrinData()
     }
+     copyClickLoading.value=false
 }
 
 //隐藏本表