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

复制粘贴不允许重复命名

PrinceLee 5 жил өмнө
parent
commit
516483e0e7

+ 12 - 1
src/views/projectManage/bugList/details/index.vue

@@ -1214,7 +1214,7 @@ export default {
       }
     },
     async confirmUpload() {
-      if (this.imageName === null) {
+      if (this.imageName === null || this.imageName.replace(/\s+/g, '') === '') {
         this.$message({
           showClose: true,
           message: '请输入图片名称',
@@ -1222,6 +1222,17 @@ export default {
         })
         return false
       }
+      const isExist = this.fileList.every(item => {
+        return this.imageName === item.name
+      })
+      if (isExist) {
+        this.$message({
+          showClose: true,
+          message: '图片名称重复',
+          type: 'error'
+        })
+        return false
+      }
       this.showCopyFile = false
       const res = await this.updateFile(window.uploadFiles[0])
       const data = res.data

+ 12 - 1
src/views/projectManage/bugList/file/createdBug.vue

@@ -480,7 +480,7 @@ export default {
       }
     },
     async confirmUpload() {
-      if (this.imageName === null) {
+      if (this.imageName === null || this.imageName.replace(/\s+/g, '') === '') {
         this.$message({
           showClose: true,
           message: '请输入图片名称',
@@ -488,6 +488,17 @@ export default {
         })
         return false
       }
+      const isExist = this.fileList.every(item => {
+        return this.imageName === item.name
+      })
+      if (isExist) {
+        this.$message({
+          showClose: true,
+          message: '图片名称重复',
+          type: 'error'
+        })
+        return false
+      }
       this.showCopyFile = false
       const res = await this.updateFile(window.uploadFiles[0])
       const data = res.data

+ 0 - 2
src/views/projectManage/taskList/taskViewDetails.vue

@@ -658,8 +658,6 @@ export default {
           this.task_form.stageString === '正常' ? this.bgStyle = '#69B3FF' : ''
           this.task_form.stageString === '延期' ? this.bgStyle = '#FF8952' : ''
           this.task_form.stageString === '已延期' ? this.bgStyle = '#F56C6C' : ''
-        } else {
-          this.$message({ message: res.msg, type: 'error', offset: 150 })
         }
       })
       commentList({ type: 3, joinId: this.taskId[1] }).then(res => {