Bläddra i källkod

去除标题重复校验

zizhong.wang 4 år sedan
förälder
incheckning
9c884357ee
1 ändrade filer med 19 tillägg och 20 borttagningar
  1. 19 20
      src/views/notification/editPage/editPage.vue

+ 19 - 20
src/views/notification/editPage/editPage.vue

@@ -6,7 +6,6 @@
         <input
           type="text"
           v-model="contentParam.title"
-          @focus="hideTip"
           @blur="checkName"
         />
         <p v-show="tipFlag" style="margin-left: 88px; color: red">
@@ -245,33 +244,33 @@ export default {
           console.log(err);
         });
     },
-    // 名字不重复,隐藏提示
-    hideTip: function () {
-      this.tipText = "资料名称不能重复,请重新输入";
-      this.tipFlag = false;
-    },
-    // 检查名字是否重复 失去焦点判断
+    // // 名字不重复,隐藏提示
+    // hideTip: function () {
+    //   this.tipText = "资料名称不能重复,请重新输入";
+    //   this.tipFlag = false;
+    // },
     checkName: function () {
-     console.log(this.contentParam.area)
+    // console.log(this.contentParam.area)
       // 去前后空格
-      this.contentParam.title = this.contentParam.title.replace(
-        /(^\s*)|(\s*$)/g,
-        ""
-      );
-      let include = this.allDataNameList.indexOf(this.contentParam.title);
+      // this.contentParam.title = this.contentParam.title.replace(
+      //   /(^\s*)|(\s*$)/g,
+      //   ""
+      // );
+    //  let include = this.allDataNameList.indexOf(this.contentParam.title);
       if (!this.contentParam.title) {
-        this.tipText = "资料名不能为空";
+        this.tipText = "标题不能为空";
         this.tipFlag = true;
         return;
-      } else if (include >= 0 && !this.noticeId) {
-        this.tipText = "资料名称不能重复,请重新输入";
-        this.tipFlag = true;
-        return;
-      }
+      } 
+      // else if (include >= 0 && !this.noticeId) {
+      //   this.tipText = "资料名称不能重复,请重新输入";
+      //   this.tipFlag = true;
+      //   return;
+      // }
     },
   },
   mounted() {
-    this.getDataList();
+  //  this.getDataList();
     this.contentParam = JSON.parse(localStorage.getItem('nowPageEdit'));
     this.noticeId = this.contentParam.id;
     if (this.contentParam.files) {