diff --git a/src/views/platform/article/add.vue b/src/views/platform/article/add.vue index 3e3bfb1..84f3869 100644 --- a/src/views/platform/article/add.vue +++ b/src/views/platform/article/add.vue @@ -65,7 +65,8 @@ 取消 - + 保存 @@ -103,6 +104,7 @@ export default { } return { loading: false, + isAdd: this.$route.path==='/platform/article/add', form:{ labelName: '', moduleName: '', @@ -141,7 +143,7 @@ export default { }, created(){ const { moduleName, labelName, id } = this.$route.query; - if(moduleName && labelName && this.$route.path == '/platform/article/edit') { + if(moduleName && labelName && !this.isAdd) { this.getArticleDetailById(id); } }, @@ -236,7 +238,7 @@ export default { if (valid) { // let res = await this.$http.post('/api/article/add', this.articleForm); // if(res.code == 200){ - this.$message.success('文章添加成功!'); + this.$message.success(`文章${this.isAdd?'添加':'编辑'}成功!`); this.cancel(); // } }else{ diff --git a/src/views/platform/article/index.vue b/src/views/platform/article/index.vue index f4b43cb..a7ca0b1 100644 --- a/src/views/platform/article/index.vue +++ b/src/views/platform/article/index.vue @@ -16,7 +16,7 @@ class="filter-item" @keyup.enter.native="crud.toQuery"/> + icon="el-icon-plus" @click="toAddArticle" v-if="checkPer(permission.add)"> 新增{{ crud.title }} @@ -44,8 +44,8 @@