完善权限控制

This commit is contained in:
zyn
2023-10-27 11:04:50 +08:00
parent 9a2d40b4fe
commit e719773fea
9 changed files with 93 additions and 279 deletions
@@ -91,11 +91,13 @@
ref="selection"
:data="data"
tooltip-effect="dark"
style="width:100%;"
style="width:100%;height: calc(100% - 57px)"
height="string"
border
class="drag-table"
@sort-change="sortChange"
:header-cell-style="{background: '#e8e8e8', color: '#333333', fontSize: '16px', fontWeight: 'bold', height: '48px'}"
:header-cell-style="{background: '#e8e8e8', color: '#333333', fontSize: '16px', fontWeight: 'bold', height: '48px', padding: 0}"
:cell-style="{padding: 0}"
@selection-change="selectionChange"
>
<el-table-column
@@ -132,13 +134,14 @@
>
</el-table-column>
<el-table-column
v-if="isPermission('4930216cff743a9e8235bcc71ec54b34,0cfab6ab180c2d080a8ba9ef8b8449f8') > 0"
prop="action"
label="操作"
align="center"
>
<template slot-scope="scope">
<a class="table-jump" style="color: #2d8cf0" @click="openDrawer('edit', scope.row)">编辑</a>
<a class="table-jump" style="color: #f56c6c;margin-left: 10px" @click="onDelete(scope.row.id)">删除</a>
<a class="table-jump" v-btn-permission="'4930216cff743a9e8235bcc71ec54b34'" style="color: #2d8cf0" @click="openDrawer('edit', scope.row)">编辑</a>
<a class="table-jump" v-btn-permission="'0cfab6ab180c2d080a8ba9ef8b8449f8'" style="color: #f56c6c;margin-left: 10px" @click="onDelete(scope.row.id)">删除</a>
</template>
</el-table-column>
</el-table>
@@ -161,6 +164,7 @@ import AdvancedSearch from './components/advancedSearch'
import editDrawer from "./components/editDrawer";
import ImportZip from '@/components/hzwlComponents/importZip'
import ExportDialog from '@/components/hzwlComponents/exportDialog'
import store from "@/store";
export default {
name: "policyTopics",
@@ -209,6 +213,21 @@ export default {
this.getData()
},
methods: {
isPermission (value) {
let hasCount = 0
let set =new Set( value.split(","))
let menuList = store.getters.getMenuList
if (menuList === '') {
return hasCount
} else {
menuList.map((menu) => {
if ( set.has(menu.id)|| value === undefined || value === '') {
hasCount++
}
})
}
return hasCount
},
async getData () {
this.searchForm.pageSize = this.searchForm.pageSize || this.$store.getters.userInfo.configContent
this.searchForm.page = this.searchForm.page || 1