文章编辑添加权限限制
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 class="el-icon-refresh-left" size="larger" type="info" @click="cancel">
|
||||||
取消
|
取消
|
||||||
</el-button>
|
</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>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
@ -103,6 +104,7 @@ export default {
|
|||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
loading: false,
|
loading: false,
|
||||||
|
isAdd: this.$route.path==='/platform/article/add',
|
||||||
form:{
|
form:{
|
||||||
labelName: '',
|
labelName: '',
|
||||||
moduleName: '',
|
moduleName: '',
|
||||||
@ -141,7 +143,7 @@ export default {
|
|||||||
},
|
},
|
||||||
created(){
|
created(){
|
||||||
const { moduleName, labelName, id } = this.$route.query;
|
const { moduleName, labelName, id } = this.$route.query;
|
||||||
if(moduleName && labelName && this.$route.path == '/platform/article/edit') {
|
if(moduleName && labelName && !this.isAdd) {
|
||||||
this.getArticleDetailById(id);
|
this.getArticleDetailById(id);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -236,7 +238,7 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
// let res = await this.$http.post('/api/article/add', this.articleForm);
|
// let res = await this.$http.post('/api/article/add', this.articleForm);
|
||||||
// if(res.code == 200){
|
// if(res.code == 200){
|
||||||
this.$message.success('文章添加成功!');
|
this.$message.success(`文章${this.isAdd?'添加':'编辑'}成功!`);
|
||||||
this.cancel();
|
this.cancel();
|
||||||
// }
|
// }
|
||||||
}else{
|
}else{
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
class="filter-item" @keyup.enter.native="crud.toQuery"/>
|
class="filter-item" @keyup.enter.native="crud.toQuery"/>
|
||||||
<rrOperation />
|
<rrOperation />
|
||||||
<el-button v-permission="permission.add" class="filter-item" size="mini" type="primary"
|
<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 }}
|
新增{{ crud.title }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
@ -44,8 +44,8 @@
|
|||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button size="small" type="text" @click="toShowDetail(scope.row)">查看详情</el-button>
|
<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="toPreview(scope.row)">预览</el-button>
|
||||||
<el-button size="small" type="text" @click="toEditArticle(scope.row)">修改</el-button>
|
<el-button size="small" v-if="checkPer(permission.edit)" 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.del)" type="text" @click="deleteArticle(scope.row.id)">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
Loading…
Reference in New Issue
Block a user