Forráskód Böngészése

修改删除提醒

ZaiZai 1 éve
szülő
commit
d10e6922e2

+ 7 - 10
src/views/other-file/image-view.vue

@@ -451,19 +451,16 @@ const downloadClick = async () => {
 
 //删除文件
 const delLoading = ref(false)
-const delClick = async () => {
+const delClick = () => {
     const rows = tableCheckedKeys.value
     if (rows.length > 0) {
         const ids = arrToId(rows)
-        delMessageV2(async (action, instance, done) => {
-            if (action === 'confirm') {
-                instance.confirmButtonLoading = true
-                removeImageclassifyFile(ids)
-                instance.confirmButtonLoading = false
-                done()
-            } else {
-                done()
-            }
+        HcDelMsg({}, async (instance, resolve) => {
+            instance.confirmButtonLoading = true
+            instance.confirmButtonText = '删除中...'
+            await removeImageclassifyFile(ids)
+            resolve() //关闭弹窗的回调
+            instance.confirmButtonLoading = false
         })
     } else {
         window.$message?.warning('请先勾选需要删除的资料文件')

+ 7 - 10
src/views/other-file/project-scanning.vue

@@ -910,16 +910,13 @@ const batchDel = () => {
     })
     if (result) {
         const ids = arrToId(rows)
-        delMessageV2(async (action, instance, done) => {
-            if (action === 'confirm') {
-                instance.confirmButtonLoading = true
-                removeArchiveFile(ids)
-                instance.confirmButtonLoading = false
-                done()
-            } else {
-                done()
-            }
-    })
+        HcDelMsg({}, async (instance, resolve) => {
+            instance.confirmButtonLoading = true
+            instance.confirmButtonText = '删除中...'
+            await removeArchiveFile(ids)
+            resolve() //关闭弹窗的回调
+            instance.confirmButtonLoading = false
+        })
     } else {
         window.$message?.warning('已上报的文件需要先废除,才能执行删除')
     }

+ 6 - 9
src/views/other/first-item.vue

@@ -633,15 +633,12 @@ const tableFileData = ref([])
 const tableDelButton = (index) => {
     const arr = tableFileData.value
     if (arr.length > 1) {
-        delMessageV2(async (action, instance, done) => {
-            if (action === 'confirm') {
-                instance.confirmButtonLoading = true
-                tableFileData.value.splice(index, 1)
-                instance.confirmButtonLoading = false
-                done()
-            } else {
-                done()
-            }
+        HcDelMsg({}, async (instance, resolve) => {
+            instance.confirmButtonLoading = true
+            instance.confirmButtonText = '删除中...'
+            tableFileData.value.splice(index, 1)
+            resolve() //关闭弹窗的回调
+            instance.confirmButtonLoading = false
         })
     } else {
         window?.$message?.warning('至少保留一个文件')

+ 6 - 9
src/views/other/first-itemcopy.vue

@@ -630,15 +630,12 @@ const tableFileData = ref([])
 const tableDelButton = (index) => {
     const arr = tableFileData.value
     if (arr.length > 1) {
-        delMessageV2(async (action, instance, done) => {
-            if (action === 'confirm') {
-                instance.confirmButtonLoading = true
-                tableFileData.value.splice(index, 1)
-                instance.confirmButtonLoading = false
-                done()
-            } else {
-                done()
-            }
+        HcDelMsg({}, async (instance, resolve) => {
+            instance.confirmButtonLoading = true
+            instance.confirmButtonText = '删除中...'
+            tableFileData.value.splice(index, 1)
+            resolve() //关闭弹窗的回调
+            instance.confirmButtonLoading = false
         })
     } else {
         window?.$message?.warning('至少保留一个文件')

+ 6 - 9
src/views/tasks/message-data.vue

@@ -233,15 +233,12 @@ const tableContent = (row) => {
 const delClick = () => {
     const rows = tableCheckedKeys.value
     if (rows.length > 0) {
-        delMessageV2(async (action, instance, done) => {
-            if (action === 'confirm') {
-                instance.confirmButtonLoading = true
-                removeData(rows)
-                instance.confirmButtonLoading = false
-                done()
-            } else {
-                done()
-            }
+        HcDelMsg({}, async (instance, resolve) => {
+            instance.confirmButtonLoading = true
+            instance.confirmButtonText = '删除中...'
+            await removeData(rows)
+            resolve() //关闭弹窗的回调
+            instance.confirmButtonLoading = false
         })
     } else {
         window.$message?.warning('请先勾选要删除的消息')

+ 7 - 10
src/views/tentative/collect/test.vue

@@ -346,16 +346,13 @@ const delModalClick = () => {
         window.$message.warning('请先选择数据')
         return
     }
-    delMessageV2(async (action, instance, done) => {
-            if (action === 'confirm') {
-                instance.confirmButtonLoading = true
-                  removeContractTreeNode()
-                instance.confirmButtonLoading = false
-                done()
-            } else {
-                done()
-            }
-     })
+    HcDelMsg({}, async (instance, resolve) => {
+        instance.confirmButtonLoading = true
+        instance.confirmButtonText = '删除中...'
+        await removeContractTreeNode()
+        resolve() //关闭弹窗的回调
+        instance.confirmButtonLoading = false
+    })
 }
 const removeContractTreeNode = async () => {
     const loadingInstance = window.$loading.service({

+ 4 - 12
src/views/tentative/detect/outside.vue

@@ -48,7 +48,7 @@
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="tentative_detect_third_del">
-                        <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn color="#e03997" @click="delModalClick">
+                        <el-button v-del-com:[delModalClick] :disabled="tableCheckedKeys.length <= 0" hc-btn color="#e03997">
                             <HcIcon name="delete-bin-2" />
                             <span>删除</span>
                         </el-button>
@@ -641,17 +641,9 @@ const batchCopyFormApi = async (ids) => {
 }
 
 //删除
-const delModalClick = () => {
-    delMessageV2(async (action, instance, done) => {
-        if (action === 'confirm') {
-            instance.confirmButtonLoading = true
-           await tableRemoveData()
-           instance.confirmButtonLoading = false
-           done()
-        } else {
-            done()
-        }
-    })
+const delModalClick = async (_, resolve) => {
+    await tableRemoveData()
+    resolve()
 }
 
 //批量删除

+ 7 - 10
src/views/tentative/detect/test.vue

@@ -546,17 +546,14 @@ const copyDataApi = async (ids) => {
 const delModalClick = () => {
     const rows = tableCheckedKeys.value
     if (rows.length > 0) {
-        delMessageV2(async (action, instance, done) => {
-        if (action === 'confirm') {
+        const ids = arrToId(rows)
+        HcDelMsg({}, async (instance, resolve) => {
             instance.confirmButtonLoading = true
-            const ids = arrToId(rows)
-            removeDataApi(ids)
-           instance.confirmButtonLoading = false
-           done()
-        } else {
-            done()
-        }
-    })
+            instance.confirmButtonText = '删除中...'
+            await removeDataApi(ids)
+            resolve() //关闭弹窗的回调
+            instance.confirmButtonLoading = false
+        })
     } else {
         window.$message?.warning('请先勾选需要删除的记录')
     }

+ 4 - 12
src/views/tentative/detect/third.vue

@@ -48,7 +48,7 @@
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="tentative_detect_third_del">
-                        <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn color="#e03997" @click="delModalClick">
+                        <el-button v-del-com:[delModalClick] :disabled="tableCheckedKeys.length <= 0" hc-btn color="#e03997">
                             <HcIcon name="delete-bin-2" />
                             <span>删除</span>
                         </el-button>
@@ -645,17 +645,9 @@ const batchCopyFormApi = async (ids) => {
 }
 
 //删除
-const delModalClick = () => {
-    delMessageV2(async (action, instance, done) => {
-            if (action === 'confirm') {
-                instance.confirmButtonLoading = true
-                await tableRemoveData()
-                instance.confirmButtonLoading = false
-                done()
-            } else {
-                done()
-            }
-     })
+const delModalClick = async (_, resolve) => {
+    await tableRemoveData()
+    resolve()
 }
 
 //批量删除