fix : 屏蔽话务语音配置的批量删除, 修复所有页面按钮权限
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="jsx">
|
||||
import { shallowRef } from 'vue';
|
||||
import {reactive, shallowRef} from 'vue';
|
||||
import fvSelect from '@/fvcomponents/fvSelect/index.vue'
|
||||
import {ElMessage, ElMessageBox} from "element-plus";
|
||||
import {addConfig, delConfig, editConfig, getConfigDetails} from "@/api/phone-traffic-config";
|
||||
@@ -131,12 +131,17 @@ const searchConfig = reactive([
|
||||
component: shallowRef(fvSelect),
|
||||
}
|
||||
])
|
||||
const auths = reactive({
|
||||
add: ['extra:config:add'],
|
||||
edit: ['extra:config:edit'],
|
||||
delete: ['extra:config:del'],
|
||||
})
|
||||
const phoneTrafficTableConfig = reactive({
|
||||
columns: [
|
||||
{
|
||||
type: 'selection',
|
||||
prop: 'selection'
|
||||
},
|
||||
// {
|
||||
// type: 'selection',
|
||||
// prop: 'selection'
|
||||
// },
|
||||
{
|
||||
prop: 'index',
|
||||
type: 'index',
|
||||
@@ -191,15 +196,15 @@ const phoneTrafficTableConfig = 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
|
||||
>
|
||||
@@ -217,8 +222,8 @@ const phoneTrafficTableConfig = reactive({
|
||||
extraConfigType:extraConfigType.value
|
||||
},
|
||||
btns: [
|
||||
{name: '新增', key: 'add',type:'primary'},
|
||||
{name: '删除', key: 'delete', type: 'danger'},
|
||||
{name: '新增', key: 'add',type:'primary',auth: auths.add},
|
||||
// {name: '删除', key: 'delete', type: 'danger'},
|
||||
]
|
||||
})
|
||||
const searchPhoneTraffic = (val) => {
|
||||
@@ -261,9 +266,8 @@ const handleEdit = (row) => {
|
||||
dialogType.value = "edit";
|
||||
}
|
||||
const getDetail = (row) => {
|
||||
getConfigDetails(row.configId,extraConfigType.value).then(res => {
|
||||
getConfigDetails(row.configId).then(res => {
|
||||
if (res.code === 1000) {
|
||||
ElMessage.success(res.msg)
|
||||
res.data.configType=''+res.data.configType
|
||||
nextTick(() => {
|
||||
formDialogRef.value.getFormInstance().setValues(res.data)
|
||||
@@ -271,6 +275,7 @@ const getDetail = (row) => {
|
||||
formDialogRef.value.getFormInstance().clearValidate()
|
||||
})
|
||||
} else {
|
||||
ElMessage.success(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -283,7 +288,7 @@ const selectionChange = (selection) => {
|
||||
}
|
||||
}
|
||||
const deleteContactMethod = (configId) => {
|
||||
delConfig(configId,extraConfigType.value).then(res => {
|
||||
delConfig(configId).then(res => {
|
||||
if (res.code === 1000) {
|
||||
ElMessage.success(res.msg)
|
||||
tableIns.value.refresh()
|
||||
|
||||
Reference in New Issue
Block a user