fix : 屏蔽话务语音配置的批量删除, 修复所有页面按钮权限

This commit is contained in:
2024-10-20 18:04:34 +08:00
parent dd31dd627e
commit f01efcc20e
10 changed files with 104 additions and 67 deletions

View File

@@ -13,6 +13,7 @@
import fvSelect from '@/fvcomponents/fvSelect/index.vue'
import {addContact, editContact, getContactDetail, deleteContact} from "@/api/address-book";
import {ElMessage, ElMessageBox} from "element-plus";
import {reactive} from "vue";
const router = useRouter()
const tableIns = ref()
@@ -152,6 +153,11 @@ const searchConfig = reactive([
component: 'el-input',
}
])
const auths = reactive({
add: ['order:contacts:add'],
edit: ['order:contacts:edit'],
delete: ['order:contacts:del'],
})
const addressBookTableConfig = reactive({
columns: [
{
@@ -207,15 +213,15 @@ const addressBookTableConfig = reactive({
showOverflowTooltip: false,
currentRender: ({row, index}) => {
let btn = []
btn.push({label: '编辑', func: () => handleEdit(row), type: 'primary'})
btn.push({label: '删除', func: () => handleSingleDelete(row), type: 'danger'})
btn.push({label: '编辑', prem: auths.edit, func: () => handleEdit(row), type: 'primary'})
btn.push({label: '删除', prem: auths.delete,func: () => handleSingleDelete(row), type: 'danger'})
return (
<div style={{width: '100%'}}>
{
btn.map(item => (
<el-button
type={item.type}
// v-perm={item.prem}
v-perm={item.prem}
onClick={() => item.func()}
link
>
@@ -231,8 +237,8 @@ const addressBookTableConfig = reactive({
api: '/contact/list',
params: {},
btns: [
{name: '新增', key: 'add', type: 'primary'},
{name: '删除', key: 'delete', type: 'danger'},
{name: '新增', key: 'add', type: 'primary' , auth: auths.add},
{name: '删除', key: 'delete', type: 'danger', auth: auths.delete},
]
})
const searchAddressBook = (val) => {