Ver Fonte

文章问题修复

natasha há 1 ano atrás
pai
commit
f6dfb92586

+ 7 - 18
src/views/content_manage/newspaper_manage/CreateArticle.vue

@@ -365,6 +365,7 @@ export default {
     handleSaveArticle(formName,flag){
         this.$refs[formName].validate((valid) => {
             if (valid) {
+                this.loading = true
                 let MethodName = '/PaperServer/Manager/ArticleManager/AddArticle'
                 let data = {
                     art_title: this.articleForm.art_title,
@@ -403,6 +404,7 @@ export default {
                 }
                 getLogin(MethodName, data)
                 .then((res) => {
+                    this.loading = false
                     if(res.status===1){
                         if(flag){
                             this.articleId = res.data.art.id
@@ -423,6 +425,8 @@ export default {
                             this.$router.go(-1)
                         }
                     }
+                }).catch(()=>{
+                    this.loading = false
                 })
             } else {
                 return false;
@@ -638,12 +642,7 @@ export default {
             this.newWordObj = obj.originalObj?obj.originalObj:obj
             this.newWordFlag = true
         }else{
-            if(this.id||this.articleId){
-                this.newWordObj = null
-                this.newWordFlag = true
-            }else{
-                this.handleSaveArticle('articleForm','newWord')
-            }
+            this.handleSaveArticle('articleForm','newWord')
         }
     },
     // 添加注释
@@ -652,12 +651,7 @@ export default {
             this.explainObj = obj
             this.explainFlag = true
         }else{
-            if(this.id||this.articleId){
-                this.explainObj = null
-                this.explainFlag = true
-            }else{
-                this.handleSaveArticle('articleForm','explain')
-            }
+            this.handleSaveArticle('articleForm','explain')
         }
     },
     handleAddPhrase(obj){
@@ -665,12 +659,7 @@ export default {
             this.pharseObj = obj
             this.pharseFlag = true
         }else{
-            if(this.id||this.articleId){
-                this.pharseObj = null
-                this.pharseFlag = true
-            }else{
-                this.handleSaveArticle('articleForm','phrase')
-            }
+            this.handleSaveArticle('articleForm','phrase')
         }
     },
     closeDialog(flag){