gks 1 year ago
parent
commit
c6d7528e34
1 changed files with 9 additions and 8 deletions
  1. 9 8
      src/views/system/notice/index.vue

+ 9 - 8
src/views/system/notice/index.vue

@@ -372,6 +372,9 @@ export default {
       
       this.$refs["form"].validate((valid) => {
         if (valid) {
+          const pattern = /\"/g;
+          this.form.noticeContent = this.form.noticeContent.replace(pattern, "'");
+          console.log(this.form.noticeContent);
           if (this.form.noticeId != undefined) {
             updateNotice(this.form).then((response) => {
               this.$modal.msgSuccess("修改成功");
@@ -379,14 +382,12 @@ export default {
               this.getList();
             });
           } else {
-            const pattern = /\"/g;
-            this.form.noticeContent = this.form.noticeContent.replace(pattern, "'");
-            console.log(this.form.noticeContent);
-            // addNotice(this.form).then((response) => {
-            //   this.$modal.msgSuccess("新增成功");
-            //   this.open = false;
-            //   this.getList();
-            // });
+            
+            addNotice(this.form).then((response) => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
           }
         }
       });