界面新增租户限制
This commit is contained in:
@@ -5,6 +5,7 @@ import { message, Modal } from 'ant-design-vue/lib';
|
||||
import { SizeType } from 'ant-design-vue/lib/config-provider';
|
||||
import { MenuInfo } from 'ant-design-vue/lib/menu/src/interface';
|
||||
import { ColumnsType } from 'ant-design-vue/lib/table';
|
||||
import TableColumnsDnd from '@/components/TableColumnsDnd/index.vue';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
import {
|
||||
RESULT_CODE_ERROR,
|
||||
@@ -14,6 +15,7 @@ import useDictStore from '@/store/modules/dict';
|
||||
import { listAMFDataUE, delAMFDataUE } from '@/api/neData/amf';
|
||||
import { OptionsType, WS } from '@/plugins/ws-websocket';
|
||||
import PQueue from 'p-queue';
|
||||
import useUserStore from '@/store/modules/user';
|
||||
const { t } = useI18n();
|
||||
const { getDict } = useDictStore();
|
||||
const ws = new WS();
|
||||
@@ -40,6 +42,7 @@ let queryParams = reactive({
|
||||
neId: '001',
|
||||
eventType: 'auth-result',
|
||||
imsi: '',
|
||||
tenantName: '',
|
||||
sortField: 'timestamp',
|
||||
sortOrder: 'desc',
|
||||
/**当前页数 */
|
||||
@@ -54,6 +57,7 @@ function fnQueryReset() {
|
||||
queryParams = Object.assign(queryParams, {
|
||||
eventType: 'auth-result',
|
||||
imsi: '',
|
||||
tenantName: '',
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
});
|
||||
@@ -95,6 +99,9 @@ let tableState: TabeStateType = reactive({
|
||||
selectedRowKeys: [],
|
||||
});
|
||||
|
||||
/**表格字段列排序 */
|
||||
let tableColumnsDnd = ref<ColumnsType>([]);
|
||||
|
||||
/**表格字段列 */
|
||||
let tableColumns: ColumnsType = [
|
||||
{
|
||||
@@ -134,6 +141,13 @@ let tableColumns: ColumnsType = [
|
||||
align: 'left',
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
title: t('views.dashboard.cdr.tenantName'),
|
||||
dataIndex: 'tenantName',
|
||||
align: 'center',
|
||||
key: 'tenantName',
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
title: t('common.operate'),
|
||||
key: 'id',
|
||||
@@ -364,6 +378,16 @@ onMounted(() => {
|
||||
})
|
||||
.finally(() => {
|
||||
// 获取列表数据
|
||||
if (useUserStore().roles.includes('tenant')) {
|
||||
const operateColumnIndex = tableColumns.findIndex(
|
||||
column => column.key === 'tenantName'
|
||||
);
|
||||
|
||||
if (operateColumnIndex !== -1) {
|
||||
tableColumns.splice(operateColumnIndex, 1);
|
||||
}
|
||||
}
|
||||
|
||||
fnGetList();
|
||||
});
|
||||
});
|
||||
@@ -408,6 +432,17 @@ onBeforeUnmount(() => {
|
||||
></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :xs="24" v-roles:has="['administrator']">
|
||||
<a-form-item
|
||||
:label="t('views.neUser.sub.tenantName')"
|
||||
name="tenantName "
|
||||
>
|
||||
<a-input
|
||||
allow-clear
|
||||
v-model:value="queryParams.tenantName"
|
||||
></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
<a-form-item>
|
||||
<a-space :size="8">
|
||||
@@ -441,7 +476,11 @@ onBeforeUnmount(() => {
|
||||
cancel-text="No"
|
||||
@confirm="fnRealTime()"
|
||||
>
|
||||
<a-button type="primary" :danger="realTimeData">
|
||||
<a-button
|
||||
type="primary"
|
||||
:danger="realTimeData"
|
||||
v-roles:has="['administrator']"
|
||||
>
|
||||
<template #icon><FundOutlined /> </template>
|
||||
{{
|
||||
!realTimeData
|
||||
@@ -457,6 +496,7 @@ onBeforeUnmount(() => {
|
||||
:disabled="tableState.selectedRowKeys.length <= 0"
|
||||
:loading="modalState.confirmLoading"
|
||||
@click.prevent="fnRecordDelete('0')"
|
||||
v-roles:has="['administrator']"
|
||||
>
|
||||
<template #icon><DeleteOutlined /></template>
|
||||
{{ t('common.deleteText') }}
|
||||
@@ -482,6 +522,11 @@ onBeforeUnmount(() => {
|
||||
<template #icon><ReloadOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<TableColumnsDnd
|
||||
cache-id="udmSubData"
|
||||
:columns="tableColumns"
|
||||
v-model:columns-dnd="tableColumnsDnd"
|
||||
></TableColumnsDnd>
|
||||
<a-tooltip>
|
||||
<template #title>{{ t('common.sizeText') }}</template>
|
||||
<a-dropdown trigger="click" placement="bottomRight">
|
||||
@@ -513,7 +558,7 @@ onBeforeUnmount(() => {
|
||||
<a-table
|
||||
class="table"
|
||||
row-key="id"
|
||||
:columns="tableColumns"
|
||||
:columns="tableColumnsDnd"
|
||||
:loading="tableState.loading"
|
||||
:data-source="tableState.data"
|
||||
:size="tableState.size"
|
||||
@@ -577,6 +622,7 @@ onBeforeUnmount(() => {
|
||||
<a-button
|
||||
type="link"
|
||||
@click.prevent="fnRecordDelete(record.id)"
|
||||
v-roles:has="['administrator']"
|
||||
>
|
||||
<template #icon>
|
||||
<DeleteOutlined />
|
||||
|
||||
Reference in New Issue
Block a user