提交 ee1e9fb3 authored 作者: pengxiaohui's avatar pengxiaohui

增加按钮权限控制

上级 f9bcc5c8
......@@ -51,7 +51,7 @@
<h5>
{{ drawTitle }}
<el-button
v-if="drawFormOptions.type !== 'create'"
v-if="drawFormOptions.type !== 'create' && hasDelete"
type="primary"
@click="drawFormOptions.type = 'edit'"
size="mini"
......
......@@ -62,7 +62,7 @@
<h5>
{{ drawTitle }}
<el-button
v-if="drawFormOptions.type !== 'create'"
v-if="drawFormOptions.type !== 'create' && hasDelete"
type="primary"
@click="drawFormOptions.type = 'edit'"
size="mini"
......
......@@ -43,7 +43,7 @@
<h5>
{{ drawTitle }}
<el-button
v-if="drawFormOptions.type !== 'create'"
v-if="drawFormOptions.type !== 'create' && hasDelete"
type="primary"
@click="drawFormOptions.type = 'edit'"
size="mini"
......
......@@ -17,6 +17,7 @@
active-text="启用"
inactive-text="停用"
@change="statusChange(row)"
:disabled="!hasCreate"
></el-switch>
</template>
</table-list>
......@@ -25,7 +26,7 @@
<h5>
{{ drawerTitle }}
<el-button
v-if="drawerType !== 'create'"
v-if="drawerType !== 'create' && hasCreate"
type="primary"
@click="drawerType = 'edit'"
size="mini"
......
......@@ -22,7 +22,7 @@
</template>
<!-- 发布状态 -->
<template v-slot:status="{ row }">
<el-switch v-model="row.status" :active-value="0" :inactive-value="1" active-text="启用" inactive-text="停用" @change="statusChange(row)"></el-switch>
<el-switch v-model="row.status" :active-value="0" :inactive-value="1" active-text="启用" inactive-text="停用" @change="statusChange(row)" :disabled="!hasCreate"></el-switch>
</template>
<!-- 操作 -->
<template v-slot:tools="{ row }">
......@@ -240,12 +240,13 @@ export default {
{ prop: 'create_user', label: '创建人', minWidth: '80px', slots: 'table-creator' },
{ prop: 'created_at', label: '创建时间', minWidth: '150px' },
{ prop: 'status', label: '状态', slots: 'status', minWidth: '140px', fixed: 'right' },
{ prop: 'x', label: '操作', slots: 'tools', minWidth: '200px', fixed: 'right' }
{ prop: 'x', label: '操作', slots: 'tools', minWidth: '200px', fixed: 'right', visible: this.hasCreate }
]
}
}
},
created() {
// console.log(this.hasCreate)
this.fetchProjectList()
this.fetchRoleList()
},
......@@ -334,6 +335,7 @@ export default {
this.dialogType = 'phone'
},
handleDetails(val) {
if (this.hasCreate) {
const form = this.form
form.sso_id = val.sso_id
form.role_id = val.roles[0] ? val.roles[0].id : ''
......@@ -342,6 +344,7 @@ export default {
console.log(val)
this.drawerVisible = true
this.drawerType = 'details'
}
},
statusChange(val) {
this.fetchUpdateStaff({
......
......@@ -23,6 +23,7 @@
active-text="启用"
inactive-text="停用"
@change="statusChange(row)"
:disabled="!hasCreate"
></el-switch>
</template>
<template #footer>
......@@ -55,6 +56,7 @@
active-text="启用"
inactive-text="停用"
@change="statusChange(row)"
:disabled="!hasCreate"
></el-switch>
</template>
<template #footer>
......@@ -245,6 +247,7 @@ export default {
this.dialogVisible = true
},
handleDetails(val) {
if (this.hasCreate) {
this.dialogType = 'edit'
this.dialogVisible = true
this.selectedId = val.id
......@@ -252,6 +255,7 @@ export default {
name: val.name,
category: val.category
}
}
},
handleDialogClose() {
this.dialogVisible = false
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论