新增基站信息 数据隔离

This commit is contained in:
lai
2024-06-18 16:58:11 +08:00
parent a26301af1e
commit 92fe93b4dc

View File

@@ -9,6 +9,9 @@ import useI18n from '@/hooks/useI18n';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import useNeInfoStore from '@/store/modules/neinfo';
import { useRoute } from 'vue-router';
import { ColumnsType } from 'ant-design-vue/lib/table';
import TableColumnsDnd from '@/components/TableColumnsDnd/index.vue';
import useUserStore from '@/store/modules/user';
const neInfoStore = useNeInfoStore();
const route = useRoute();
const { t } = useI18n();
@@ -24,6 +27,8 @@ let queryParams = reactive({
neType: ['', ''],
/**GNB_ID */
id: '',
/** 租户名称*/
tenantName: '',
/**当前页数 */
pageNum: 1,
/**每页条数 */
@@ -35,6 +40,7 @@ function fnQueryReset() {
queryParams = Object.assign(queryParams, {
neId: '',
id: '',
tenantName: '',
pageNum: 1,
pageSize: 20,
});
@@ -67,7 +73,7 @@ let tableState: TabeStateType = reactive({
});
/**表格字段列 */
let tableColumns = ref<TableColumnsType>([
let tableColumns: ColumnsType = [
{
title: 'Radio ID',
dataIndex: 'id',
@@ -89,12 +95,22 @@ let tableColumns = ref<TableColumnsType>([
minWidth: 150,
maxWidth: 400,
},
{
title: 'Tenant Name',
dataIndex: 'tenantName',
align: 'center',
key: 'tenantName',
width: 150,
},
{
title: 'Radio Address',
dataIndex: 'address',
align: 'left',
},
]);
];
/**表格字段列排序 */
let tableColumnsDnd = ref<ColumnsType>([]);
/**表格分页器参数 */
let tablePagination = reactive({
@@ -160,7 +176,8 @@ function fnGetList(pageNum?: number) {
tableState.loading = false;
fnGetList(queryParams.pageNum - 1);
}
} else {//AMF返回404是代表没找到这个数据 GNB_NOT_FOUND
} else {
//AMF返回404是代表没找到这个数据 GNB_NOT_FOUND
tablePagination.total = 0;
tableState.data = [];
}
@@ -209,6 +226,14 @@ onMounted(() => {
}
})
.finally(() => {
if (useUserStore().roles.includes('tenant')) {
const operateColumnIndex = tableColumns.findIndex(
(column: any) => column.key === 'tenantName'
);
if (operateColumnIndex !== -1) {
tableColumns.splice(operateColumnIndex, 1);
}
}
// 获取列表数据
fnGetList();
});
@@ -240,6 +265,23 @@ onMounted(() => {
<a-input v-model:value="queryParams.id" allow-clear></a-input>
</a-form-item>
</a-col>
<a-col
:lg="6"
:md="12"
:xs="24"
:gutter="16"
v-roles:has="['administrator']"
>
<a-form-item
:label="t('views.neUser.sub.tenantName')"
name="tenantName "
>
<a-input
v-model:value="queryParams.tenantName"
allow-clear
></a-input>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :xs="24">
<a-form-item>
<a-space :size="8">
@@ -280,6 +322,11 @@ onMounted(() => {
<template #icon><ReloadOutlined /></template>
</a-button>
</a-tooltip>
<TableColumnsDnd
cache-id="udmSubData"
:columns="tableColumns"
v-model:columns-dnd="tableColumnsDnd"
></TableColumnsDnd>
<a-tooltip placement="topRight">
<template #title>{{ t('common.sizeText') }}</template>
<a-dropdown placement="bottomRight" trigger="click">
@@ -311,7 +358,7 @@ onMounted(() => {
<a-table
class="table"
row-key="id"
:columns="tableColumns"
:columns="tableColumnsDnd"
:loading="tableState.loading"
:data-source="tableState.data"
:size="tableState.size"