소스 검색

修复首件的填报bug

ZaiZai 2 년 전
부모
커밋
595a1e80e5
1개의 변경된 파일15개의 추가작업 그리고 10개의 파일을 삭제
  1. 15 10
      src/views/other/first-item.vue

+ 15 - 10
src/views/other/first-item.vue

@@ -505,17 +505,22 @@ const tableFileColumn = ref([
 ]);
 const tableFileData = ref([]);
 const tableDelButton = (index) => {
-    window?.$messageBox?.alert('确定删除该文件吗?', '删除提醒', {
-        type: 'warning',
-        showCancelButton: true,
-        confirmButtonText: '确定删除',
-        cancelButtonText: '取消',
-        callback: (action) => {
-            if (action === 'confirm') {
-                tableFileData.value.splice(index, 1)
+    const arr = tableFileData.value
+    if (arr.length > 1) {
+        window?.$messageBox?.alert('确定删除该文件吗?', '删除提醒', {
+            type: 'warning',
+            showCancelButton: true,
+            confirmButtonText: '确定删除',
+            cancelButtonText: '取消',
+            callback: (action) => {
+                if (action === 'confirm') {
+                    tableFileData.value.splice(index, 1)
+                }
             }
-        }
-    })
+        })
+    } else {
+        window?.$message?.warning('至少保留一个文件')
+    }
 }
 
 //填报数据保存