ref: v3变更,,完成整合,同步v2.2508.4 -250902
This commit is contained in:
@@ -20,14 +20,13 @@ import { uploadFile } from '@/api/tool/file';
|
||||
import { getNeViewFile } from '@/api/tool/neFile';
|
||||
import {
|
||||
addUDMVolteIMS,
|
||||
batchAddUDMVolteIMS,
|
||||
batchDelUDMVolteIMS,
|
||||
delUDMVolteIMS,
|
||||
exportUDMVolteIMS,
|
||||
importUDMVolteIMS,
|
||||
listUDMVolteIMS,
|
||||
resetUDMVolteIMS,
|
||||
} from '@/api/neData/udm_volte_ims';
|
||||
import { currentCoreUid } from '@/hooks/useCoreUid';
|
||||
const { t } = useI18n();
|
||||
const neStore = useNeStore();
|
||||
/**字典数据 */
|
||||
@@ -52,8 +51,10 @@ let neOtions = ref<Record<string, any>[]>([]);
|
||||
|
||||
/**查询参数 */
|
||||
let queryParams = reactive({
|
||||
/**核心网标识 */
|
||||
coreUid: currentCoreUid(),
|
||||
/**网元ID */
|
||||
neId: undefined,
|
||||
neUid: undefined,
|
||||
/**IMSI */
|
||||
imsi: '',
|
||||
/**MSISDN */
|
||||
@@ -286,7 +287,9 @@ function fnModalVisibleByEdit(row?: Record<string, any>) {
|
||||
*/
|
||||
function fnModalOk() {
|
||||
const from = JSON.parse(JSON.stringify(modalState.from));
|
||||
from.neId = queryParams.neId || '-';
|
||||
from.coreUid = queryParams.coreUid || '-';
|
||||
from.neUid = queryParams.neUid || '-';
|
||||
from.neType = 'UDM';
|
||||
|
||||
// 如果是VoIP, 则MSISDN和IMSI相同
|
||||
if (from.tag === '0') {
|
||||
@@ -312,15 +315,10 @@ function fnModalOk() {
|
||||
let result: any = null;
|
||||
if (modalState.isBatch) {
|
||||
if (modalState.type === 'add') {
|
||||
result = batchAddUDMVolteIMS(from, from.num);
|
||||
result = addUDMVolteIMS(from);
|
||||
}
|
||||
if (modalState.type === 'delete') {
|
||||
result = batchDelUDMVolteIMS(
|
||||
from.neId,
|
||||
`${from.imsi}_${from.msisdn}`,
|
||||
from.num,
|
||||
from.tag
|
||||
);
|
||||
result = delUDMVolteIMS(from);
|
||||
}
|
||||
} else {
|
||||
if (modalState.type === 'add') {
|
||||
@@ -386,13 +384,14 @@ function fnModalVisibleByBatch(type: 'delete' | 'add') {
|
||||
|
||||
/**
|
||||
* 记录删除
|
||||
* @param id 记录ID
|
||||
* @param imsi 记录ID
|
||||
*/
|
||||
function fnRecordDelete(id: string) {
|
||||
const neID = queryParams.neId;
|
||||
if (!neID) return;
|
||||
let msg = id;
|
||||
if (id === '0') {
|
||||
function fnRecordDelete(imsi: string) {
|
||||
const neUid = queryParams.neUid;
|
||||
const coreUid = queryParams.coreUid;
|
||||
if (!neUid || !coreUid) return;
|
||||
let msg = imsi;
|
||||
if (imsi === '0') {
|
||||
msg = `${tableState.selectedRowIMSIs[0].imsi}... ${tableState.selectedRowIMSIs.length}`;
|
||||
}
|
||||
|
||||
@@ -402,27 +401,32 @@ function fnRecordDelete(id: string) {
|
||||
onOk() {
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
let reqArr: any[] = [];
|
||||
if (id === '0') {
|
||||
const volteArr = tableState.selectedRowIMSIs
|
||||
.filter(item => item.tag == '1')
|
||||
.map(item => `${item.imsi}_${item.msisdn}`)
|
||||
.join(',');
|
||||
if (volteArr.length > 0) {
|
||||
reqArr.push(delUDMVolteIMS(neID, volteArr, '1'));
|
||||
}
|
||||
const voipArr = tableState.selectedRowIMSIs
|
||||
.filter(item => item.tag == '0')
|
||||
.map(item => `${item.imsi}_${item.msisdn}`)
|
||||
.join(',');
|
||||
if (voipArr.length > 0) {
|
||||
reqArr.push(delUDMVolteIMS(neID, voipArr, '0'));
|
||||
}
|
||||
if (imsi === '0') {
|
||||
tableState.selectedRowIMSIs.forEach(item => {
|
||||
reqArr.push(
|
||||
delUDMVolteIMS({
|
||||
coreUid,
|
||||
neUid,
|
||||
imsi: item.imsi,
|
||||
msisdn: item.msisdn,
|
||||
tag: item.tag,
|
||||
num: 1,
|
||||
})
|
||||
);
|
||||
});
|
||||
} else {
|
||||
const record: any = tableState.data.find((item: any) => item.id === id);
|
||||
const record: any = tableState.data.find((item: any) => item.imsi === imsi);
|
||||
if (record) {
|
||||
reqArr = [
|
||||
delUDMVolteIMS(neID, `${record.imsi}_${record.msisdn}`, record.tag),
|
||||
];
|
||||
reqArr.push(
|
||||
delUDMVolteIMS({
|
||||
coreUid,
|
||||
neUid,
|
||||
imsi: record.imsi,
|
||||
msisdn: record.msisdn,
|
||||
tag: record.tag,
|
||||
num: 1,
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
Promise.all(reqArr)
|
||||
@@ -439,8 +443,9 @@ function fnRecordDelete(id: string) {
|
||||
|
||||
/**列表导出 */
|
||||
function fnExportList(type: string) {
|
||||
const neId = queryParams.neId;
|
||||
if (!neId) return;
|
||||
const neUid = queryParams.neUid;
|
||||
const coreUid = queryParams.coreUid;
|
||||
if (!neUid || !coreUid) return;
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
exportUDMVolteIMS(Object.assign({ type: type }, queryParams))
|
||||
.then(res => {
|
||||
@@ -449,7 +454,7 @@ function fnExportList(type: string) {
|
||||
content: t('common.operateOk'),
|
||||
duration: 2,
|
||||
});
|
||||
saveAs(res.data, `UDM_VOLTE_${neId}_${Date.now()}.${type}`);
|
||||
saveAs(res.data, `UDM_VOLTE_${Date.now()}.${type}`);
|
||||
} else {
|
||||
message.error({
|
||||
content: `${res.msg}`,
|
||||
@@ -488,13 +493,14 @@ function fnGetList(pageNum?: number) {
|
||||
|
||||
/**重新加载数据 */
|
||||
function fnLoadData() {
|
||||
const neId = queryParams.neId;
|
||||
if (tableState.loading || !neId) return;
|
||||
const coreUid = queryParams.coreUid;
|
||||
const neUid = queryParams.neUid;
|
||||
if (tableState.loading || !neUid || !coreUid) return;
|
||||
modalState.loadDataLoading = true;
|
||||
tablePagination.total = 0;
|
||||
tableState.data = [];
|
||||
tableState.loading = true; // 表格loading
|
||||
resetUDMVolteIMS(neId).then(res => {
|
||||
resetUDMVolteIMS(coreUid, neUid).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
const num = res.data;
|
||||
const timerS = Math.ceil(+num / 800) + 3;
|
||||
@@ -563,8 +569,9 @@ function fnModalUploadImportClose() {
|
||||
|
||||
/**对话框表格信息导入上传 */
|
||||
function fnModalUploadImportUpload(file: File) {
|
||||
const neID = queryParams.neId;
|
||||
if (!neID) {
|
||||
const neUid = queryParams.neUid;
|
||||
const coreUid = queryParams.coreUid;
|
||||
if (!neUid || !coreUid) {
|
||||
return Promise.reject('Unknown network element');
|
||||
}
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
@@ -587,7 +594,8 @@ function fnModalUploadImportUpload(file: File) {
|
||||
if (!filePath) return;
|
||||
// 文件导入
|
||||
return importUDMVolteIMS({
|
||||
neId: neID,
|
||||
coreUid: coreUid,
|
||||
neUid: neUid,
|
||||
uploadPath: filePath,
|
||||
});
|
||||
})
|
||||
@@ -611,12 +619,12 @@ function fnModalUploadImportUpload(file: File) {
|
||||
|
||||
/**对话框表格信息导入失败原因 */
|
||||
function fnModalUploadImportFailReason() {
|
||||
const neId = queryParams.neId;
|
||||
if (!neId) return;
|
||||
const neUid = queryParams.neUid;
|
||||
if (!neUid) return;
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
getNeViewFile({
|
||||
neType: 'UDM',
|
||||
neId: neId,
|
||||
neUid: neUid,
|
||||
path: '/tmp',
|
||||
fileName: 'import_imsuser_err_records.txt',
|
||||
})
|
||||
@@ -671,7 +679,7 @@ onMounted(() => {
|
||||
return;
|
||||
}
|
||||
if (neOtions.value.length > 0) {
|
||||
queryParams.neId = neOtions.value[0].value;
|
||||
queryParams.neUid = neOtions.value[0].value;
|
||||
}
|
||||
|
||||
// 获取列表数据
|
||||
@@ -690,9 +698,9 @@ onMounted(() => {
|
||||
<a-form :model="queryParams" name="queryParams" layout="horizontal">
|
||||
<a-row :gutter="16">
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
<a-form-item label="UDM" name="neId ">
|
||||
<a-form-item label="UDM" name="neUid ">
|
||||
<a-select
|
||||
v-model:value="queryParams.neId"
|
||||
v-model:value="queryParams.neUid"
|
||||
:options="neOtions"
|
||||
:placeholder="t('common.selectPlease')"
|
||||
:disabled="modalState.loadDataLoading"
|
||||
@@ -914,7 +922,7 @@ onMounted(() => {
|
||||
<template #title>{{ t('common.deleteText') }}</template>
|
||||
<a-button
|
||||
type="link"
|
||||
@click.prevent="fnRecordDelete(record.id)"
|
||||
@click.prevent="fnRecordDelete(record.imsi)"
|
||||
>
|
||||
<template #icon>
|
||||
<DeleteOutlined />
|
||||
|
||||
Reference in New Issue
Block a user