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