feat:BA UE部分按钮权限分配

This commit is contained in:
zhongzm
2025-08-29 16:18:26 +08:00
parent 3aa6822a72
commit 3389fbad53
6 changed files with 59 additions and 29 deletions

View File

@@ -728,7 +728,7 @@ onMounted(() => {
<a-col :lg="6" :md="12" :xs="24"> <a-col :lg="6" :md="12" :xs="24">
<a-form-item> <a-form-item>
<a-space :size="8"> <a-space :size="8">
<a-button type="primary" @click.prevent="fnGetList()"> <a-button type="primary" @click.prevent="fnGetList()" v-perms:has="['nedata:basestation:search']">
<template #icon><SearchOutlined /></template> <template #icon><SearchOutlined /></template>
{{ t('common.search') }} {{ t('common.search') }}
</a-button> </a-button>
@@ -747,7 +747,7 @@ onMounted(() => {
<!-- 插槽-卡片左侧侧 --> <!-- 插槽-卡片左侧侧 -->
<template #title> <template #title>
<a-space :size="8" align="center"> <a-space :size="8" align="center">
<a-button type="primary" @click.prevent="fnModalVisibleByEdit()"> <a-button type="primary" @click.prevent="fnModalVisibleByEdit()" v-perms:has="['nedata:basestation:add']">
<template #icon> <template #icon>
<PlusOutlined /> <PlusOutlined />
</template> </template>
@@ -758,6 +758,7 @@ onMounted(() => {
:disabled="tableState.selectedRowKeys.length != 1" :disabled="tableState.selectedRowKeys.length != 1"
:loading="modalState.confirmLoading" :loading="modalState.confirmLoading"
@click.prevent="fnModalVisibleByEdit('0')" @click.prevent="fnModalVisibleByEdit('0')"
v-perms:has="['nedata:basestation:edit']"
> >
<template #icon><FormOutlined /></template> <template #icon><FormOutlined /></template>
{{ t('common.editText') }} {{ t('common.editText') }}
@@ -768,19 +769,20 @@ onMounted(() => {
:disabled="tableState.selectedRowKeys.length <= 0" :disabled="tableState.selectedRowKeys.length <= 0"
:loading="modalState.confirmLoading" :loading="modalState.confirmLoading"
@click.prevent="fnRecordDelete('0')" @click.prevent="fnRecordDelete('0')"
v-perms:has="['nedata:basestation:delete']"
> >
<template #icon><DeleteOutlined /></template> <template #icon><DeleteOutlined /></template>
{{ t('common.deleteText') }} {{ t('common.deleteText') }}
</a-button> </a-button>
<a-button type="dashed" @click.prevent="fnModalImportOpen()"> <a-button type="dashed" @click.prevent="fnModalImportOpen()" v-perms:has="['nedata:basestation:import']">
<template #icon><ImportOutlined /></template> <template #icon><ImportOutlined /></template>
{{ t('common.import') }} {{ t('common.import') }}
</a-button> </a-button>
<a-button type="dashed" @click.prevent="fnExportList()"> <a-button type="dashed" @click.prevent="fnExportList()" v-perms:has="['nedata:basestation:export']">
<template #icon><ExportOutlined /></template> <template #icon><ExportOutlined /></template>
{{ t('common.export') }} {{ t('common.export') }}
</a-button> </a-button>
<a-button type="default" @click.prevent="fnHistoryView()"> <a-button type="default" @click.prevent="fnHistoryView()" v-perms:has="['nedata:basestation:history']">
<template #icon><ContainerOutlined /></template> <template #icon><ContainerOutlined /></template>
{{ t('views.neData.baseStation.history') }} {{ t('views.neData.baseStation.history') }}
</a-button> </a-button>

View File

@@ -812,7 +812,7 @@ onMounted(() => {
<a-col :lg="6" :md="12" :xs="24"> <a-col :lg="6" :md="12" :xs="24">
<a-form-item> <a-form-item>
<a-space :size="8"> <a-space :size="8">
<a-button type="primary" @click.prevent="fnGetList(1)"> <a-button type="primary" @click.prevent="fnGetList(1)" >
<template #icon> <template #icon>
<SearchOutlined /> <SearchOutlined />
</template> </template>
@@ -835,7 +835,7 @@ onMounted(() => {
<!-- 插槽-卡片左侧侧 --> <!-- 插槽-卡片左侧侧 -->
<template #title> <template #title>
<a-flex wrap="wrap" gap="small"> <a-flex wrap="wrap" gap="small">
<a-button type="primary" @click.prevent="fnModalVisibleByEdit()"> <a-button type="primary" @click.prevent="fnModalVisibleByEdit()" v-perms:has="['neUser:auth:add']">
<template #icon> <template #icon>
<PlusOutlined /> <PlusOutlined />
</template> </template>
@@ -847,6 +847,7 @@ onMounted(() => {
danger danger
ghost ghost
@click.prevent="fnModalVisibleByBatch()" @click.prevent="fnModalVisibleByBatch()"
v-perms:has="['neUser:auth:delete']"
> >
<template #icon> <template #icon>
<DeleteOutlined /> <DeleteOutlined />
@@ -872,7 +873,7 @@ onMounted(() => {
</a-button> </a-button>
</a-popconfirm> </a-popconfirm>
<a-button type="dashed" @click.prevent="fnModalUploadImportOpen"> <a-button type="dashed" @click.prevent="fnModalUploadImportOpen" v-perms:has="['neUser:auth:import']">
<template #icon><ImportOutlined /></template> <template #icon><ImportOutlined /></template>
{{ t('views.neUser.auth.import') }} {{ t('views.neUser.auth.import') }}
</a-button> </a-button>
@@ -896,6 +897,7 @@ onMounted(() => {
:disabled="tableState.selectedRowKeys.length <= 0" :disabled="tableState.selectedRowKeys.length <= 0"
:loading="modalState.loadDataLoading" :loading="modalState.loadDataLoading"
@click.prevent="fnRecordDelete('0')" @click.prevent="fnRecordDelete('0')"
v-perms:has="['neUser:auth:delete']"
> >
<template #icon><DeleteOutlined /></template> <template #icon><DeleteOutlined /></template>
{{ t('views.neUser.auth.checkDel') }} {{ t('views.neUser.auth.checkDel') }}
@@ -995,6 +997,7 @@ onMounted(() => {
<a-button <a-button
type="link" type="link"
@click.prevent="fnModalVisibleByEdit(record)" @click.prevent="fnModalVisibleByEdit(record)"
v-perms:has="['neUser:auth:edit']"
> >
<template #icon> <template #icon>
<FormOutlined /> <FormOutlined />
@@ -1006,6 +1009,7 @@ onMounted(() => {
<a-button <a-button
type="link" type="link"
@click.prevent="fnRecordDelete(record.imsi)" @click.prevent="fnRecordDelete(record.imsi)"
v-perms:has="['neUser:auth:delete']"
> >
<template #icon> <template #icon>
<DeleteOutlined /> <DeleteOutlined />

View File

@@ -921,7 +921,7 @@ onMounted(() => {
<a-col :lg="6" :md="12" :xs="24"> <a-col :lg="6" :md="12" :xs="24">
<a-form-item> <a-form-item>
<a-space :size="8"> <a-space :size="8">
<a-button type="primary" @click.prevent="fnGetList(1)"> <a-button type="primary" @click.prevent="fnGetList(1)" >
<template #icon> <template #icon>
<SearchOutlined /> <SearchOutlined />
</template> </template>
@@ -944,7 +944,7 @@ onMounted(() => {
<!-- 插槽-卡片左侧侧 --> <!-- 插槽-卡片左侧侧 -->
<template #title> <template #title>
<a-flex wrap="wrap" gap="small"> <a-flex wrap="wrap" gap="small">
<a-button type="primary" @click.prevent="fnModalVisibleByEdit()"> <a-button type="primary" @click.prevent="fnModalVisibleByEdit()" v-perms:has="['neUser:imsUDM:add']">
<template #icon> <template #icon>
<PlusOutlined /> <PlusOutlined />
</template> </template>
@@ -956,6 +956,7 @@ onMounted(() => {
danger danger
ghost ghost
@click.prevent="fnModalVisibleByBatch()" @click.prevent="fnModalVisibleByBatch()"
v-perms:has="['neUser:imsUDM:delete']"
> >
<template #icon> <template #icon>
<DeleteOutlined /> <DeleteOutlined />
@@ -981,7 +982,7 @@ onMounted(() => {
</a-button> </a-button>
</a-popconfirm> </a-popconfirm>
<a-button type="dashed" @click.prevent="fnModalUploadImportOpen"> <a-button type="dashed" @click.prevent="fnModalUploadImportOpen" v-perms:has="['neUser:imsUDM:import']">
<template #icon><ImportOutlined /></template> <template #icon><ImportOutlined /></template>
{{ t('views.neUser.auth.import') }} {{ t('views.neUser.auth.import') }}
</a-button> </a-button>
@@ -993,7 +994,7 @@ onMounted(() => {
ok-type="default" ok-type="default"
@confirm="fnExportList('txt')" @confirm="fnExportList('txt')"
> >
<a-button type="dashed"> <a-button type="dashed" v-perms:has="['neUser:imsUDM:export']">
<template #icon><ExportOutlined /></template> <template #icon><ExportOutlined /></template>
{{ t('views.neUser.auth.export') }} {{ t('views.neUser.auth.export') }}
</a-button> </a-button>
@@ -1005,6 +1006,7 @@ onMounted(() => {
:disabled="tableState.selectedRowKeys.length <= 0" :disabled="tableState.selectedRowKeys.length <= 0"
:loading="modalState.loadDataLoading" :loading="modalState.loadDataLoading"
@click.prevent="fnRecordDelete('0')" @click.prevent="fnRecordDelete('0')"
v-perms:has="['neUser:imsUDM:delete']"
> >
<template #icon><DeleteOutlined /></template> <template #icon><DeleteOutlined /></template>
{{ t('views.neUser.auth.checkDel') }} {{ t('views.neUser.auth.checkDel') }}
@@ -1021,6 +1023,7 @@ onMounted(() => {
<a-button <a-button
type="default" type="default"
:disabled="tableState.selectedRowKeys.length <= 0" :disabled="tableState.selectedRowKeys.length <= 0"
v-perms:has="['neUser:imsUDM:export']"
> >
<template #icon><ExportOutlined /></template> <template #icon><ExportOutlined /></template>
{{ t('views.neUser.auth.checkExport') }} {{ t('views.neUser.auth.checkExport') }}
@@ -1105,6 +1108,7 @@ onMounted(() => {
<a-button <a-button
type="link" type="link"
@click.prevent="fnRecordDelete(record.id)" @click.prevent="fnRecordDelete(record.id)"
v-perms:has="['neUser:imsUDM:delete']"
> >
<template #icon> <template #icon>
<DeleteOutlined /> <DeleteOutlined />

View File

@@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { reactive, ref, onMounted, toRaw } from 'vue'; import { reactive, ref, onMounted, toRaw, computed } from 'vue';
import { PageContainer } from 'antdv-pro-layout'; import { PageContainer } from 'antdv-pro-layout';
import { ProModal } from 'antdv-pro-modal'; import { ProModal } from 'antdv-pro-modal';
import { message, Modal, Form, TableColumnsType } from 'ant-design-vue/es'; import { message, Modal, Form, TableColumnsType } from 'ant-design-vue/es';
@@ -24,8 +24,16 @@ import useI18n from '@/hooks/useI18n';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { saveAs } from 'file-saver'; import { saveAs } from 'file-saver';
import { uploadFileToNE } from '@/api/tool/file'; import { uploadFileToNE } from '@/api/tool/file';
import { hasPermissions } from '@/plugins/auth-user';
const { t } = useI18n(); const { t } = useI18n();
// 计算是否至少拥有一个批量操作权限
const hasAnyBatchPermission = computed(() => {
return hasPermissions(['neUser:pcf:add']) ||
hasPermissions(['neUser:pcf:edit']) ||
hasPermissions(['neUser:pcf:delete']);
});
/**网元参数 */ /**网元参数 */
let neOtions = ref<Record<string, any>[]>([]); let neOtions = ref<Record<string, any>[]>([]);
@@ -727,7 +735,7 @@ onMounted(() => {
<a-col :lg="6" :md="12" :xs="24"> <a-col :lg="6" :md="12" :xs="24">
<a-form-item> <a-form-item>
<a-space :size="8"> <a-space :size="8">
<a-button type="primary" @click.prevent="fnGetList()"> <a-button type="primary" @click.prevent="fnGetList()" >
<template #icon> <template #icon>
<SearchOutlined /> <SearchOutlined />
</template> </template>
@@ -750,7 +758,7 @@ onMounted(() => {
<!-- 插槽-卡片左侧侧 --> <!-- 插槽-卡片左侧侧 -->
<template #title> <template #title>
<a-space :size="8" align="center"> <a-space :size="8" align="center">
<a-button type="primary" @click.prevent="fnModalVisibleByEdit()"> <a-button type="primary" @click.prevent="fnModalVisibleByEdit()" v-perms:has="['neUser:pcf:add']">
<template #icon> <template #icon>
<PlusOutlined /> <PlusOutlined />
</template> </template>
@@ -763,27 +771,28 @@ onMounted(() => {
:disabled="tableState.selectedRowKeys.length <= 0" :disabled="tableState.selectedRowKeys.length <= 0"
:loading="modalState.confirmLoading" :loading="modalState.confirmLoading"
@click.prevent="fnRecordDelete('0')" @click.prevent="fnRecordDelete('0')"
v-perms:has="['neUser:pcf:delete']"
> >
<template #icon><DeleteOutlined /></template> <template #icon><DeleteOutlined /></template>
{{ t('views.neUser.pcf.checkDel') }} {{ t('views.neUser.pcf.checkDel') }}
</a-button> </a-button>
<a-dropdown trigger="click"> <a-dropdown trigger="click" v-if="hasAnyBatchPermission">
<a-button> <a-button>
{{ t('views.neUser.pcf.batchOper') }} {{ t('views.neUser.pcf.batchOper') }}
<DownOutlined /> <DownOutlined />
</a-button> </a-button>
<template #overlay> <template #overlay>
<a-menu @click="({ key }:any) => fnModalVisibleByBatch(key)"> <a-menu @click="({ key }:any) => fnModalVisibleByBatch(key)">
<a-menu-item key="add"> <a-menu-item key="add" v-if="hasPermissions(['neUser:pcf:add'])">
<PlusOutlined /> <PlusOutlined />
{{ t('views.neUser.pcf.batchAddText') }} {{ t('views.neUser.pcf.batchAddText') }}
</a-menu-item> </a-menu-item>
<a-menu-item key="update"> <a-menu-item key="update" v-if="hasPermissions(['neUser:pcf:edit'])">
<FormOutlined /> <FormOutlined />
{{ t('views.neUser.pcf.batchUpdateText') }} {{ t('views.neUser.pcf.batchUpdateText') }}
</a-menu-item> </a-menu-item>
<a-menu-item key="delete"> <a-menu-item key="delete" v-if="hasPermissions(['neUser:pcf:delete'])">
<DeleteOutlined /> <DeleteOutlined />
{{ t('views.neUser.pcf.batchDelText') }} {{ t('views.neUser.pcf.batchDelText') }}
</a-menu-item> </a-menu-item>
@@ -791,7 +800,7 @@ onMounted(() => {
</template> </template>
</a-dropdown> </a-dropdown>
<a-button type="dashed" @click.prevent="fnModalUploadImportOpen"> <a-button type="dashed" @click.prevent="fnModalUploadImportOpen" v-perms:has="['neUser:pcf:import']">
<template #icon><ImportOutlined /></template> <template #icon><ImportOutlined /></template>
{{ t('views.neUser.pcf.import') }} {{ t('views.neUser.pcf.import') }}
</a-button> </a-button>
@@ -802,7 +811,7 @@ onMounted(() => {
ok-type="default" ok-type="default"
@confirm="fnExportList('txt')" @confirm="fnExportList('txt')"
> >
<a-button type="dashed"> <a-button type="dashed" v-perms:has="['neUser:pcf:export']">
<template #icon><ExportOutlined /></template> <template #icon><ExportOutlined /></template>
{{ t('views.neUser.pcf.export') }} {{ t('views.neUser.pcf.export') }}
</a-button> </a-button>
@@ -891,6 +900,7 @@ onMounted(() => {
<a-button <a-button
type="link" type="link"
@click.prevent="fnModalVisibleByEdit(record)" @click.prevent="fnModalVisibleByEdit(record)"
v-perms:has="['neUser:pcf:edit']"
> >
<template #icon> <template #icon>
<FormOutlined /> <FormOutlined />
@@ -902,6 +912,7 @@ onMounted(() => {
<a-button <a-button
type="link" type="link"
@click.prevent="fnRecordDelete(record.imsi)" @click.prevent="fnRecordDelete(record.imsi)"
v-perms:has="['neUser:pcf:delete']"
> >
<template #icon> <template #icon>
<DeleteOutlined /> <DeleteOutlined />

View File

@@ -1300,7 +1300,7 @@ onMounted(() => {
<a-col :lg="6" :md="12" :xs="24"> <a-col :lg="6" :md="12" :xs="24">
<a-form-item> <a-form-item>
<a-space :size="8"> <a-space :size="8">
<a-button type="primary" @click.prevent="fnGetList(1)"> <a-button type="primary" @click.prevent="fnGetList(1)" >
<template #icon> <template #icon>
<SearchOutlined /> <SearchOutlined />
</template> </template>
@@ -1323,7 +1323,7 @@ onMounted(() => {
<!-- 插槽-卡片左侧侧 --> <!-- 插槽-卡片左侧侧 -->
<template #title> <template #title>
<a-flex wrap="wrap" gap="small"> <a-flex wrap="wrap" gap="small">
<a-button type="primary" @click.prevent="fnModalVisibleByEdit()"> <a-button type="primary" @click.prevent="fnModalVisibleByEdit()" v-perms:has="['neUser:sub:add']">
<template #icon> <template #icon>
<PlusOutlined /> <PlusOutlined />
</template> </template>
@@ -1335,6 +1335,7 @@ onMounted(() => {
danger danger
ghost ghost
@click.prevent="fnModalVisibleByBatch()" @click.prevent="fnModalVisibleByBatch()"
v-perms:has="['neUser:sub:delete']"
> >
<template #icon> <template #icon>
<DeleteOutlined /> <DeleteOutlined />
@@ -1362,7 +1363,7 @@ onMounted(() => {
</a-button> </a-button>
</a-popconfirm> </a-popconfirm>
<a-button type="dashed" @click.prevent="fnModalUploadImportOpen"> <a-button type="dashed" @click.prevent="fnModalUploadImportOpen" v-perms:has="['neUser:sub:import']">
<template #icon> <template #icon>
<ImportOutlined /> <ImportOutlined />
</template> </template>
@@ -1376,7 +1377,7 @@ onMounted(() => {
ok-type="default" ok-type="default"
@confirm="fnExportList('txt')" @confirm="fnExportList('txt')"
> >
<a-button type="dashed"> <a-button type="dashed" v-perms:has="['neUser:auth:export']">
<template #icon> <template #icon>
<ExportOutlined /> <ExportOutlined />
</template> </template>
@@ -1390,6 +1391,7 @@ onMounted(() => {
:disabled="tableState.selectedRowKeys.length <= 0" :disabled="tableState.selectedRowKeys.length <= 0"
:loading="modalState.loadDataLoading" :loading="modalState.loadDataLoading"
@click.prevent="fnRecordDelete('0')" @click.prevent="fnRecordDelete('0')"
v-perms:has="['neUser:sub:delete']"
> >
<template #icon> <template #icon>
<DeleteOutlined /> <DeleteOutlined />
@@ -1408,6 +1410,7 @@ onMounted(() => {
<a-button <a-button
type="default" type="default"
:disabled="tableState.selectedRowKeys.length <= 0" :disabled="tableState.selectedRowKeys.length <= 0"
v-perms:has="['neUser:sub:export']"
> >
<template #icon> <template #icon>
<ExportOutlined /> <ExportOutlined />
@@ -1513,6 +1516,7 @@ onMounted(() => {
<a-button <a-button
type="link" type="link"
@click.prevent="fnModalVisibleByEdit(record.imsi)" @click.prevent="fnModalVisibleByEdit(record.imsi)"
v-perms:has="['neUser:sub:edit']"
> >
<template #icon> <template #icon>
<FormOutlined /> <FormOutlined />
@@ -1524,6 +1528,7 @@ onMounted(() => {
<a-button <a-button
type="link" type="link"
@click.prevent="fnRecordDelete(record.imsi)" @click.prevent="fnRecordDelete(record.imsi)"
v-perms:has="['neUser:aub:delete']"
> >
<template #icon> <template #icon>
<DeleteOutlined /> <DeleteOutlined />

View File

@@ -737,7 +737,7 @@ onMounted(() => {
<a-col :lg="6" :md="12" :xs="24"> <a-col :lg="6" :md="12" :xs="24">
<a-form-item> <a-form-item>
<a-space :size="8"> <a-space :size="8">
<a-button type="primary" @click.prevent="fnGetList(1)"> <a-button type="primary" @click.prevent="fnGetList(1)" >
<template #icon> <template #icon>
<SearchOutlined /> <SearchOutlined />
</template> </template>
@@ -760,7 +760,7 @@ onMounted(() => {
<!-- 插槽-卡片左侧侧 --> <!-- 插槽-卡片左侧侧 -->
<template #title> <template #title>
<a-flex wrap="wrap" gap="small"> <a-flex wrap="wrap" gap="small">
<a-button type="primary" @click.prevent="fnModalVisibleByEdit()"> <a-button type="primary" @click.prevent="fnModalVisibleByEdit()" v-perms:has="['neUser:voip:add']">
<template #icon> <template #icon>
<PlusOutlined /> <PlusOutlined />
</template> </template>
@@ -772,6 +772,7 @@ onMounted(() => {
danger danger
ghost ghost
@click.prevent="fnModalVisibleByBatch()" @click.prevent="fnModalVisibleByBatch()"
v-perms:has="['neUser:voip:delete']"
> >
<template #icon> <template #icon>
<DeleteOutlined /> <DeleteOutlined />
@@ -797,7 +798,7 @@ onMounted(() => {
</a-button> </a-button>
</a-popconfirm> </a-popconfirm>
<a-button type="dashed" @click.prevent="fnModalUploadImportOpen"> <a-button type="dashed" @click.prevent="fnModalUploadImportOpen" v-perms:has="['neUser:voip:import']">
<template #icon><ImportOutlined /></template> <template #icon><ImportOutlined /></template>
{{ t('views.neUser.auth.import') }} {{ t('views.neUser.auth.import') }}
</a-button> </a-button>
@@ -809,7 +810,7 @@ onMounted(() => {
ok-type="default" ok-type="default"
@confirm="fnExportList('txt')" @confirm="fnExportList('txt')"
> >
<a-button type="dashed"> <a-button type="dashed" v-perms:has="['neUser:voip:export']">
<template #icon><ExportOutlined /></template> <template #icon><ExportOutlined /></template>
{{ t('views.neUser.auth.export') }} {{ t('views.neUser.auth.export') }}
</a-button> </a-button>
@@ -821,6 +822,7 @@ onMounted(() => {
:disabled="tableState.selectedRowKeys.length <= 0" :disabled="tableState.selectedRowKeys.length <= 0"
:loading="modalState.loadDataLoading" :loading="modalState.loadDataLoading"
@click.prevent="fnRecordDelete('0')" @click.prevent="fnRecordDelete('0')"
v-perms:has="['neUser:voip:delete']"
> >
<template #icon><DeleteOutlined /></template> <template #icon><DeleteOutlined /></template>
{{ t('views.neUser.auth.checkDel') }} {{ t('views.neUser.auth.checkDel') }}
@@ -837,6 +839,7 @@ onMounted(() => {
<a-button <a-button
type="default" type="default"
:disabled="tableState.selectedRowKeys.length <= 0" :disabled="tableState.selectedRowKeys.length <= 0"
v-perms:has="['neUser:voip:export']"
> >
<template #icon><ExportOutlined /></template> <template #icon><ExportOutlined /></template>
{{ t('views.neUser.auth.checkExport') }} {{ t('views.neUser.auth.checkExport') }}
@@ -921,6 +924,7 @@ onMounted(() => {
<a-button <a-button
type="link" type="link"
@click.prevent="fnRecordDelete(record.userName)" @click.prevent="fnRecordDelete(record.userName)"
v-perms:has="['neUser:voip:delete']"
> >
<template #icon> <template #icon>
<DeleteOutlined /> <DeleteOutlined />