文章编辑添加权限限制
This commit is contained in:
parent
db5f4071ec
commit
d27a44d446
@ -65,7 +65,8 @@
|
||||
<el-button class="el-icon-refresh-left" size="larger" type="info" @click="cancel">
|
||||
取消
|
||||
</el-button>
|
||||
<el-button class="el-icon-edit" size="larger" type="primary" @click="onSubmitForm">
|
||||
<el-button v-permission="['admin', `article:${isAdd?'add':'edit'}`]"
|
||||
class="el-icon-edit" size="larger" type="primary" @click="onSubmitForm">
|
||||
保存
|
||||
</el-button>
|
||||
</div>
|
||||
@ -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{
|
||||
|
@ -16,7 +16,7 @@
|
||||
class="filter-item" @keyup.enter.native="crud.toQuery"/>
|
||||
<rrOperation />
|
||||
<el-button v-permission="permission.add" class="filter-item" size="mini" type="primary"
|
||||
icon="el-icon-plus" @click="toAddArticle">
|
||||
icon="el-icon-plus" @click="toAddArticle" v-if="checkPer(permission.add)">
|
||||
新增{{ crud.title }}
|
||||
</el-button>
|
||||
</div>
|
||||
@ -44,8 +44,8 @@
|
||||
<template slot-scope="scope">
|
||||
<el-button size="small" type="text" @click="toShowDetail(scope.row)">查看详情</el-button>
|
||||
<el-button size="small" type="text" @click="toPreview(scope.row)">预览</el-button>
|
||||
<el-button size="small" type="text" @click="toEditArticle(scope.row)">修改</el-button>
|
||||
<el-button size="small" type="text" @click="deleteArticle(scope.row.id)">删除</el-button>
|
||||
<el-button size="small" v-if="checkPer(permission.edit)" type="text" @click="toEditArticle(scope.row)">修改</el-button>
|
||||
<el-button size="small" v-if="checkPer(permission.del)" type="text" @click="deleteArticle(scope.row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
Loading…
Reference in New Issue
Block a user