添加编辑删除权限

master
xy 1 year ago
parent ab9596aa79
commit 083a761628

@ -188,6 +188,7 @@ export default {
mounted() { mounted() {
}, },
render(h) { render(h) {
const _this = this
let { let {
expandRowKeys, expandRowKeys,
size, size,
@ -351,40 +352,42 @@ export default {
{ {
$scopedSlots.btns ? $scopedSlots.btns() : $scopedSlots.btns ? $scopedSlots.btns() :
(<el-table-column (_this.$store.getters.myRoles.find(i => i.name === '查看员') ? '' : (
fixed="right" <el-table-column
label="操作" fixed="right"
width={btnWidth} label="操作"
header-align="center" width={btnWidth}
scopedSlots={{ header-align="center"
default(scope) { scopedSlots={{
return ( default(scope) {
<div> return (
<Poptip <div>
transfer={true} <Poptip
confirm transfer={true}
title="确认要删除吗" confirm
on={{['on-ok']: () => deleteClick(scope.row)}}> title="确认要删除吗"
on={{['on-ok']: () => deleteClick(scope.row)}}>
<i-button
type="error"
size="small"
style="margin-left: 10px;"
ghost>删除
</i-button>
</Poptip>
<i-button <i-button
type="error" type="primary"
size="small" size="small"
style="margin-left: 10px;" style="margin-left: 10px;"
ghost>删除 ghost
onClick={() => editorClick(scope.row)}>编辑
</i-button> </i-button>
</Poptip> </div>
)
<i-button }
type="primary" }}>
size="small" </el-table-column>
style="margin-left: 10px;" ))
ghost
onClick={() => editorClick(scope.row)}>编辑
</i-button>
</div>
)
}
}}>
</el-table-column>)
} }
</el-table>) </el-table>)
: :

@ -6,6 +6,7 @@ const getters = {
name: state => state.user.name, name: state => state.user.name,
roles: state => state.user.roles, roles: state => state.user.roles,
permission_routes: state => state.permission.routes, permission_routes: state => state.permission.routes,
village_codes: state => state.app.villageCodes village_codes: state => state.app.villageCodes,
myRoles: state => state.user.myRoles
} }
export default getters export default getters

@ -126,6 +126,7 @@
> >
<template v-slot:default="scope"> <template v-slot:default="scope">
<Poptip <Poptip
v-if="!$store.getters.myRoles.find(i => i.name === '查看员')"
transfer transfer
confirm confirm
title="确认要删除?" title="确认要删除?"
@ -136,6 +137,7 @@
> >
</Poptip> </Poptip>
<Button <Button
v-if="!$store.getters.myRoles.find(i => i.name === '查看员')"
size="small" size="small"
ghost ghost
type="primary" type="primary"

@ -45,6 +45,7 @@
> >
<template v-slot:default="scope"> <template v-slot:default="scope">
<Button <Button
v-if="!$store.getters.myRoles.find(i => i.name === '查看员')"
type="primary" type="primary"
size="small" size="small"
style="margin-left: 4px" style="margin-left: 4px"
@ -53,6 +54,7 @@
> >
<Poptip <Poptip
v-if="!$store.getters.myRoles.find(i => i.name === '查看员')"
popper-class="pop-confirm" popper-class="pop-confirm"
transfer transfer
confirm confirm
@ -93,7 +95,7 @@
placement="top" placement="top"
> >
<Button <Button
v-if="hasEditorAuth" v-if="hasEditorAuth && !$store.getters.myRoles.find(i => i.name === '查看员')"
type="primary" type="primary"
size="small" size="small"
style="margin-left: 4px;margin-bottom: 8px;" style="margin-left: 4px;margin-bottom: 8px;"

@ -92,6 +92,7 @@
}" }"
>查看</Button> >查看</Button>
<Poptip <Poptip
v-if="!$store.getters.myRoles.find(i => i.name === '查看员')"
transfer transfer
confirm confirm
title="确认要删除?" title="确认要删除?"
@ -102,6 +103,7 @@
> >
</Poptip> </Poptip>
<Button size="small" <Button size="small"
v-if="!$store.getters.myRoles.find(i => i.name === '查看员')"
ghost ghost
type="primary" type="primary"
@click="editor(scope.row)">编辑</Button> @click="editor(scope.row)">编辑</Button>

@ -63,6 +63,7 @@
}" }"
>查看</Button> >查看</Button>
<Poptip <Poptip
v-if="!$store.getters.myRoles.find(i => i.name === '查看员')"
transfer transfer
confirm confirm
title="确认要删除?" title="确认要删除?"
@ -73,6 +74,7 @@
> >
</Poptip> </Poptip>
<Button size="small" <Button size="small"
v-if="!$store.getters.myRoles.find(i => i.name === '查看员')"
ghost ghost
type="primary" type="primary"
@click="editor(scope.row)">编辑</Button> @click="editor(scope.row)">编辑</Button>

@ -191,6 +191,7 @@
<el-table-column label="操作" fixed="right" header-align="center" align="left" width="200"> <el-table-column label="操作" fixed="right" header-align="center" align="left" width="200">
<template v-slot:default="scope"> <template v-slot:default="scope">
<Poptip <Poptip
v-if="!$store.getters.myRoles.find(i => i.name === '查看员')"
transfer transfer
confirm confirm
title="确认要删除?" title="确认要删除?"

@ -68,7 +68,7 @@
</template> </template>
<template v-slot:footer> <template v-slot:footer>
<template v-if="form.id && isDelete"> <template v-if="form.id && isDelete && !$store.getters.myRoles.find(i => i.name === '查看员')">
<Poptip <Poptip
:transfer="true" :transfer="true"
confirm confirm

@ -37,6 +37,7 @@
> >
<template v-slot:default="scope"> <template v-slot:default="scope">
<Poptip <Poptip
v-if="!$store.getters.myRoles.find(i => i.name === '查看员')"
transfer transfer
confirm confirm
title="确认要删除?" title="确认要删除?"
@ -47,6 +48,7 @@
> >
</Poptip> </Poptip>
<Button <Button
v-if="!$store.getters.myRoles.find(i => i.name === '查看员')"
size="small" size="small"
ghost ghost
type="primary" type="primary"

Loading…
Cancel
Save