fix: 终端UDM数据勾选导出和勾选删除
This commit is contained in:
@@ -111,9 +111,9 @@ export function batchAuth(data: Record<string, any>) {
|
|||||||
* @param data 鉴权对象
|
* @param data 鉴权对象
|
||||||
* @returns object
|
* @returns object
|
||||||
*/
|
*/
|
||||||
export function delAuth(neId: string, data: Record<string, any>) {
|
export function delAuth(neId: string, imsi: string) {
|
||||||
return request({
|
return request({
|
||||||
url: `/ne/udm/auth/${neId}/${data.imsi}`,
|
url: `/ne/udm/auth/${neId}/${imsi}`,
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -475,6 +475,8 @@ export default {
|
|||||||
neType: 'UDM Object',
|
neType: 'UDM Object',
|
||||||
export: 'Export',
|
export: 'Export',
|
||||||
exportConfirm: 'Are you sure to export all authentication user data?',
|
exportConfirm: 'Are you sure to export all authentication user data?',
|
||||||
|
checkExport : 'Check Export',
|
||||||
|
checkExportConfirm: 'Confirm exporting the checked authenticated user data?',
|
||||||
import: 'Import',
|
import: 'Import',
|
||||||
loadDataConfirm: 'Are you sure you want to reload the data?',
|
loadDataConfirm: 'Are you sure you want to reload the data?',
|
||||||
loadData: 'Load Data',
|
loadData: 'Load Data',
|
||||||
@@ -484,6 +486,7 @@ export default {
|
|||||||
batchDelText: 'Batch Delete',
|
batchDelText: 'Batch Delete',
|
||||||
numAdd: 'Number of releases',
|
numAdd: 'Number of releases',
|
||||||
numDel: 'Number of deleted',
|
numDel: 'Number of deleted',
|
||||||
|
checkDel: 'Check Delete',
|
||||||
imsiTip: 'IMSI=MCC+MNC+MSIN',
|
imsiTip: 'IMSI=MCC+MNC+MSIN',
|
||||||
imsiTip1: 'MCC=Mobile Country Code, consisting of three digits.',
|
imsiTip1: 'MCC=Mobile Country Code, consisting of three digits.',
|
||||||
imsiTip2: 'MNC = Mobile Network Number, consisting of two digits',
|
imsiTip2: 'MNC = Mobile Network Number, consisting of two digits',
|
||||||
@@ -492,19 +495,22 @@ export default {
|
|||||||
algoIndexTip: 'Algorithm index, between 0 and 15',
|
algoIndexTip: 'Algorithm index, between 0 and 15',
|
||||||
kiTip: 'User signing key information, the maximum length of 32',
|
kiTip: 'User signing key information, the maximum length of 32',
|
||||||
opcTip: 'The authentication key, OPC, is calculated from Ki and OP, OP is the root key of the operator, ki is the authentication key, and the maximum length is 32.',
|
opcTip: 'The authentication key, OPC, is calculated from Ki and OP, OP is the root key of the operator, ki is the authentication key, and the maximum length is 32.',
|
||||||
delSure:'Are you sure you want to delete the user with IMSI number: {imsi}?',
|
delSure:'Are you sure you want to delete the user with IMSI number: {imsi} ?',
|
||||||
},
|
},
|
||||||
sub: {
|
sub: {
|
||||||
subInfo:' Subscription Info',
|
subInfo:' Subscription Info',
|
||||||
neType: 'UDM Object',
|
neType: 'UDM Object',
|
||||||
export: 'Export',
|
export: 'Export',
|
||||||
exportConfirm: 'Are you sure to export all signed user data?',
|
exportConfirm: 'Are you sure to export all signed user data?',
|
||||||
|
checkExport : 'Check Export',
|
||||||
|
checkExportConfirm: 'Are you sure to export the data of the checked subscribers?',
|
||||||
import: 'Import',
|
import: 'Import',
|
||||||
loadDataConfirm: 'Are you sure you want to reload the data?',
|
loadDataConfirm: 'Are you sure you want to reload the data?',
|
||||||
loadData: 'Load Data',
|
loadData: 'Load Data',
|
||||||
loadDataTip: 'Successfully fetched load data: {num} entries, the system is internally updating the data. You can click reset to refresh the data list after the loading is finished, please don it repeat click to get update!!!!',
|
loadDataTip: 'Successfully fetched load data: {num} entries, the system is internally updating the data. You can click reset to refresh the data list after the loading is finished, please don it repeat click to get update!!!!',
|
||||||
numAdd: 'Number of releases',
|
numAdd: 'Number of releases',
|
||||||
numDel: 'Number of deleted',
|
numDel: 'Number of deleted',
|
||||||
|
checkDel: 'Check Delete',
|
||||||
batchAddText: 'Batch Add',
|
batchAddText: 'Batch Add',
|
||||||
batchDelText: 'Batch Delete',
|
batchDelText: 'Batch Delete',
|
||||||
enable:'Enable',
|
enable:'Enable',
|
||||||
|
|||||||
@@ -463,8 +463,8 @@ export default {
|
|||||||
requireEnum: "{display} 不是合理的枚举值",
|
requireEnum: "{display} 不是合理的枚举值",
|
||||||
requireBool: "{display} 不是合理的布尔类型的值",
|
requireBool: "{display} 不是合理的布尔类型的值",
|
||||||
editOkTip: "确认更新该{num}属性值吗?",
|
editOkTip: "确认更新该{num}属性值吗?",
|
||||||
updateItemTip: "确认更新Index为 【{num}】 的数据项?",
|
updateItemTip: "确认更新Index为 【{num}】 的数据项?",
|
||||||
delItemTip: "确认删除Index为 【{num}】 的数据项?",
|
delItemTip: "确认删除Index为 【{num}】 的数据项?",
|
||||||
arrayMore: "展开",
|
arrayMore: "展开",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -474,9 +474,11 @@ export default {
|
|||||||
neTypePlease: '查询网元类型',
|
neTypePlease: '查询网元类型',
|
||||||
neType: 'UDM网元对象',
|
neType: 'UDM网元对象',
|
||||||
export: '导出',
|
export: '导出',
|
||||||
exportConfirm: '确认导出全部鉴权用户数据吗?',
|
exportConfirm: '确认导出全部鉴权用户数据吗?',
|
||||||
|
checkExport : '勾选导出',
|
||||||
|
checkExportConfirm: '确认导出已勾选的鉴权用户数据吗?',
|
||||||
import: '导入',
|
import: '导入',
|
||||||
loadDataConfirm: '确认要重新加载数据吗?',
|
loadDataConfirm: '确认要重新加载数据吗?',
|
||||||
loadData: '加载数据',
|
loadData: '加载数据',
|
||||||
loadDataTip: '成功获取加载数据:{num}条,系统内部正在进行数据更新。加载结束后可点击重置刷新数据列表,请勿重复点击获取更新!!!',
|
loadDataTip: '成功获取加载数据:{num}条,系统内部正在进行数据更新。加载结束后可点击重置刷新数据列表,请勿重复点击获取更新!!!',
|
||||||
startIMSI: '起始IMSI',
|
startIMSI: '起始IMSI',
|
||||||
@@ -484,6 +486,7 @@ export default {
|
|||||||
batchDelText: '批量删除',
|
batchDelText: '批量删除',
|
||||||
numAdd: '放号个数',
|
numAdd: '放号个数',
|
||||||
numDel:'删除个数',
|
numDel:'删除个数',
|
||||||
|
checkDel:'勾选删除',
|
||||||
imsiTip: 'IMSI=MCC+MNC+MSIN',
|
imsiTip: 'IMSI=MCC+MNC+MSIN',
|
||||||
imsiTip1: 'MCC=移动国家号码, 由三位数字组成',
|
imsiTip1: 'MCC=移动国家号码, 由三位数字组成',
|
||||||
imsiTip2: 'MNC=移动网络号,由两位数字组成',
|
imsiTip2: 'MNC=移动网络号,由两位数字组成',
|
||||||
@@ -498,13 +501,16 @@ export default {
|
|||||||
subInfo:'签约信息',
|
subInfo:'签约信息',
|
||||||
neType: 'UDM网元类型',
|
neType: 'UDM网元类型',
|
||||||
export: '导出',
|
export: '导出',
|
||||||
exportConfirm: '确认导出全部签约用户数据吗?',
|
exportConfirm: '确认导出全部签约用户数据吗?',
|
||||||
|
checkExport : '勾选导出',
|
||||||
|
checkExportConfirm: '确认导出已勾选的签约用户数据吗?',
|
||||||
import: '导入',
|
import: '导入',
|
||||||
loadDataConfirm: '确认要重新加载数据吗?',
|
loadDataConfirm: '确认要重新加载数据吗?',
|
||||||
loadData: '加载数据',
|
loadData: '加载数据',
|
||||||
loadDataTip: '成功获取加载数据:{num}条,系统内部正在进行数据更新。加载结束后可点击重置刷新数据列表,请勿重复点击获取更新!!!',
|
loadDataTip: '成功获取加载数据:{num}条,系统内部正在进行数据更新。加载结束后可点击重置刷新数据列表,请勿重复点击获取更新!!!',
|
||||||
numAdd: '放号个数',
|
numAdd: '放号个数',
|
||||||
numDel: '删除个数',
|
numDel: '删除个数',
|
||||||
|
checkDel:'勾选删除',
|
||||||
batchAddText: '批量新增',
|
batchAddText: '批量新增',
|
||||||
batchDelText: '批量删除',
|
batchDelText: '批量删除',
|
||||||
enable:'开启',
|
enable:'开启',
|
||||||
|
|||||||
@@ -70,6 +70,8 @@ type TabeStateType = {
|
|||||||
seached: boolean;
|
seached: boolean;
|
||||||
/**记录数据 */
|
/**记录数据 */
|
||||||
data: object[];
|
data: object[];
|
||||||
|
/**勾选记录 */
|
||||||
|
selectedRowKeys: (string | number)[];
|
||||||
};
|
};
|
||||||
|
|
||||||
/**表格状态 */
|
/**表格状态 */
|
||||||
@@ -79,6 +81,7 @@ let tableState: TabeStateType = reactive({
|
|||||||
striped: false,
|
striped: false,
|
||||||
seached: true,
|
seached: true,
|
||||||
data: [],
|
data: [],
|
||||||
|
selectedRowKeys: [],
|
||||||
});
|
});
|
||||||
|
|
||||||
/**表格字段列 */
|
/**表格字段列 */
|
||||||
@@ -180,6 +183,11 @@ function fnTableChange(pagination: any, filters: any, sorter: any, extra: any) {
|
|||||||
fnGetList(1);
|
fnGetList(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**表格多选 */
|
||||||
|
function fnTableSelectedRowKeys(keys: (string | number)[]) {
|
||||||
|
tableState.selectedRowKeys = keys;
|
||||||
|
}
|
||||||
|
|
||||||
/**对话框对象信息状态类型 */
|
/**对话框对象信息状态类型 */
|
||||||
type ModalStateType = {
|
type ModalStateType = {
|
||||||
/**新增框或修改框是否显示 */
|
/**新增框或修改框是否显示 */
|
||||||
@@ -482,36 +490,79 @@ function fnModalCancel() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* UDM鉴权用户删除
|
* UDM鉴权用户删除
|
||||||
* @param row 网元编号ID
|
* @param imsi 编号imsi
|
||||||
*/
|
*/
|
||||||
function fnRecordDelete(row: Record<string, any>) {
|
function fnRecordDelete(imsi: string) {
|
||||||
|
const neID = queryParams.neId;
|
||||||
|
if (!neID) return;
|
||||||
|
let imsiMsg = imsi;
|
||||||
|
if (imsi === '0') {
|
||||||
|
imsiMsg = `${tableState.selectedRowKeys[0]}... ${t(
|
||||||
|
'views.neUser.auth.numDel'
|
||||||
|
)} ${tableState.selectedRowKeys.length}`;
|
||||||
|
imsi = tableState.selectedRowKeys.join(',');
|
||||||
|
}
|
||||||
|
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: t('common.tipTitle'),
|
title: t('common.tipTitle'),
|
||||||
content: t('views.neUser.auth.delSure', { imsi: row.imsi }),
|
content: t('views.neUser.auth.delSure', { imsi: imsiMsg }),
|
||||||
onOk() {
|
onOk() {
|
||||||
const key = 'delNotice';
|
modalState.loadDataLoading = true;
|
||||||
message.loading({ content: t('common.loading'), key });
|
const hide = message.loading({ content: t('common.loading') });
|
||||||
const neID = queryParams.neId || '-';
|
delAuth(neID, imsi)
|
||||||
delAuth(neID, row).then(res => {
|
.then(res => {
|
||||||
if (res.code === RESULT_CODE_SUCCESS) {
|
if (res.code === RESULT_CODE_SUCCESS) {
|
||||||
message.success({
|
const msgContent = t('common.msgSuccess', {
|
||||||
content: t('common.msgSuccess', { msg: t('common.deleteText') }),
|
msg: t('common.deleteText'),
|
||||||
key,
|
});
|
||||||
duration: 2,
|
message.success({
|
||||||
});
|
content: `${msgContent} : ${imsiMsg}`,
|
||||||
|
duration: 3,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
message.error({
|
||||||
|
content: `${res.msg}`,
|
||||||
|
duration: 3,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hide();
|
||||||
fnGetList();
|
fnGetList();
|
||||||
} else {
|
modalState.loadDataLoading = false;
|
||||||
message.error({
|
});
|
||||||
content: `${res.msg}`,
|
|
||||||
key: key,
|
|
||||||
duration: 2,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UDM鉴权用户导出
|
||||||
|
*/
|
||||||
|
function fnRecordExport(type: string = 'txt') {
|
||||||
|
const selectLen = tableState.selectedRowKeys.length;
|
||||||
|
if (selectLen <= 0) return;
|
||||||
|
const rows: Record<string, any>[] = tableState.data.filter(
|
||||||
|
(row: Record<string, any>) =>
|
||||||
|
tableState.selectedRowKeys.indexOf(row.imsi) >= 0
|
||||||
|
);
|
||||||
|
|
||||||
|
let content = '';
|
||||||
|
if (type == 'txt') {
|
||||||
|
for (const row of rows) {
|
||||||
|
content += `${row.imsi},${row.ki},${row.algoIndex},${row.amf},${row.opc}\r\n`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (type == 'csv') {
|
||||||
|
content = `IMSI,ki,Algo Index,AMF,OPC\r\n`;
|
||||||
|
for (const row of rows) {
|
||||||
|
content += `${row.imsi},${row.ki},${row.algoIndex},${row.amf},${row.opc}\r\n`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const blob = new Blob([content], { type: 'text/plain;charset=utf-8' });
|
||||||
|
saveAs(blob, `UDMAuth_${Date.now()}.${type}`);
|
||||||
|
}
|
||||||
|
|
||||||
/**列表导出 */
|
/**列表导出 */
|
||||||
function fnExportList(type: string) {
|
function fnExportList(type: string) {
|
||||||
const neID = queryParams.neId;
|
const neID = queryParams.neId;
|
||||||
@@ -583,6 +634,10 @@ function fnGetList(pageNum?: number) {
|
|||||||
}
|
}
|
||||||
listAuth(toRaw(queryParams)).then(res => {
|
listAuth(toRaw(queryParams)).then(res => {
|
||||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
|
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
|
||||||
|
// 取消勾选
|
||||||
|
if (tableState.selectedRowKeys.length > 0) {
|
||||||
|
tableState.selectedRowKeys = [];
|
||||||
|
}
|
||||||
tablePagination.total = res.total;
|
tablePagination.total = res.total;
|
||||||
tableState.data = res.rows;
|
tableState.data = res.rows;
|
||||||
}
|
}
|
||||||
@@ -742,6 +797,18 @@ onMounted(() => {
|
|||||||
</template>
|
</template>
|
||||||
{{ t('views.neUser.auth.batchAddText') }}
|
{{ t('views.neUser.auth.batchAddText') }}
|
||||||
</a-button>
|
</a-button>
|
||||||
|
|
||||||
|
<a-button
|
||||||
|
type="default"
|
||||||
|
danger
|
||||||
|
:disabled="tableState.selectedRowKeys.length <= 0"
|
||||||
|
:loading="modalState.loadDataLoading"
|
||||||
|
@click.prevent="fnRecordDelete('0')"
|
||||||
|
>
|
||||||
|
<template #icon><DeleteOutlined /></template>
|
||||||
|
{{ t('views.neUser.auth.checkDel') }}
|
||||||
|
</a-button>
|
||||||
|
|
||||||
<a-button
|
<a-button
|
||||||
type="primary"
|
type="primary"
|
||||||
danger
|
danger
|
||||||
@@ -753,6 +820,7 @@ onMounted(() => {
|
|||||||
</template>
|
</template>
|
||||||
{{ t('views.neUser.auth.batchDelText') }}
|
{{ t('views.neUser.auth.batchDelText') }}
|
||||||
</a-button>
|
</a-button>
|
||||||
|
|
||||||
<a-popconfirm
|
<a-popconfirm
|
||||||
:title="t('views.neUser.auth.loadDataConfirm')"
|
:title="t('views.neUser.auth.loadDataConfirm')"
|
||||||
:ok-text="t('common.ok')"
|
:ok-text="t('common.ok')"
|
||||||
@@ -778,6 +846,7 @@ onMounted(() => {
|
|||||||
|
|
||||||
<a-popconfirm
|
<a-popconfirm
|
||||||
:title="t('views.neUser.auth.exportConfirm')"
|
:title="t('views.neUser.auth.exportConfirm')"
|
||||||
|
placement="topRight"
|
||||||
ok-text="TXT"
|
ok-text="TXT"
|
||||||
ok-type="default"
|
ok-type="default"
|
||||||
@confirm="fnExportList('txt')"
|
@confirm="fnExportList('txt')"
|
||||||
@@ -790,6 +859,26 @@ onMounted(() => {
|
|||||||
{{ t('views.neUser.auth.export') }}
|
{{ t('views.neUser.auth.export') }}
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-popconfirm>
|
</a-popconfirm>
|
||||||
|
|
||||||
|
<a-popconfirm
|
||||||
|
:title="t('views.neUser.auth.checkExportConfirm')"
|
||||||
|
placement="topRight"
|
||||||
|
ok-text="TXT"
|
||||||
|
ok-type="default"
|
||||||
|
@confirm="fnRecordExport('txt')"
|
||||||
|
:show-cancel="false"
|
||||||
|
cancel-text="CSV"
|
||||||
|
@cancel="fnRecordExport('csv')"
|
||||||
|
:disabled="tableState.selectedRowKeys.length <= 0"
|
||||||
|
>
|
||||||
|
<a-button
|
||||||
|
type="default"
|
||||||
|
:disabled="tableState.selectedRowKeys.length <= 0"
|
||||||
|
>
|
||||||
|
<template #icon><ExportOutlined /></template>
|
||||||
|
{{ t('views.neUser.auth.checkExport') }}
|
||||||
|
</a-button>
|
||||||
|
</a-popconfirm>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -864,6 +953,11 @@ onMounted(() => {
|
|||||||
:scroll="{ y: 'calc(100vh - 480px)' }"
|
:scroll="{ y: 'calc(100vh - 480px)' }"
|
||||||
@change="fnTableChange"
|
@change="fnTableChange"
|
||||||
@resizeColumn="(w:number, col:any) => (col.width = w)"
|
@resizeColumn="(w:number, col:any) => (col.width = w)"
|
||||||
|
:row-selection="{
|
||||||
|
type: 'checkbox',
|
||||||
|
selectedRowKeys: tableState.selectedRowKeys,
|
||||||
|
onChange: fnTableSelectedRowKeys,
|
||||||
|
}"
|
||||||
>
|
>
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
<template v-if="column.key === 'imsi'">
|
<template v-if="column.key === 'imsi'">
|
||||||
@@ -881,7 +975,10 @@ onMounted(() => {
|
|||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
<a-tooltip>
|
<a-tooltip>
|
||||||
<template #title>{{ t('common.deleteText') }}</template>
|
<template #title>{{ t('common.deleteText') }}</template>
|
||||||
<a-button type="link" @click.prevent="fnRecordDelete(record)">
|
<a-button
|
||||||
|
type="link"
|
||||||
|
@click.prevent="fnRecordDelete(record.imsi)"
|
||||||
|
>
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<DeleteOutlined />
|
<DeleteOutlined />
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -73,6 +73,8 @@ type TabeStateType = {
|
|||||||
seached: boolean;
|
seached: boolean;
|
||||||
/**记录数据 */
|
/**记录数据 */
|
||||||
data: object[];
|
data: object[];
|
||||||
|
/**勾选记录 */
|
||||||
|
selectedRowKeys: (string | number)[];
|
||||||
};
|
};
|
||||||
|
|
||||||
/**表格状态 */
|
/**表格状态 */
|
||||||
@@ -82,6 +84,7 @@ let tableState: TabeStateType = reactive({
|
|||||||
striped: false,
|
striped: false,
|
||||||
seached: true,
|
seached: true,
|
||||||
data: [],
|
data: [],
|
||||||
|
selectedRowKeys: [],
|
||||||
});
|
});
|
||||||
|
|
||||||
/**表格字段列 */
|
/**表格字段列 */
|
||||||
@@ -218,6 +221,11 @@ function fnTableChange(pagination: any, filters: any, sorter: any, extra: any) {
|
|||||||
fnGetList(1);
|
fnGetList(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**表格多选 */
|
||||||
|
function fnTableSelectedRowKeys(keys: (string | number)[]) {
|
||||||
|
tableState.selectedRowKeys = keys;
|
||||||
|
}
|
||||||
|
|
||||||
/**对话框对象信息状态类型 */
|
/**对话框对象信息状态类型 */
|
||||||
type ModalStateType = {
|
type ModalStateType = {
|
||||||
/**详情框是否显示 */
|
/**详情框是否显示 */
|
||||||
@@ -711,37 +719,100 @@ function fnBatchDelModalCancel() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* UDM签约用户删除
|
* UDM签约用户删除
|
||||||
* @param imsi 网元编号ID
|
* @param imsi 编号imsi
|
||||||
*/
|
*/
|
||||||
function fnRecordDelete(imsi: string) {
|
function fnRecordDelete(imsi: string) {
|
||||||
const neID = queryParams.neId;
|
const neID = queryParams.neId;
|
||||||
if (!neID) return;
|
if (!neID) return;
|
||||||
|
let imsiMsg = imsi;
|
||||||
|
if (imsi === '0') {
|
||||||
|
imsiMsg = `${tableState.selectedRowKeys[0]}... ${t(
|
||||||
|
'views.neUser.sub.numDel'
|
||||||
|
)} ${tableState.selectedRowKeys.length}`;
|
||||||
|
imsi = tableState.selectedRowKeys.join(',');
|
||||||
|
}
|
||||||
|
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: t('common.tipTitle'),
|
title: t('common.tipTitle'),
|
||||||
content: t('views.neUser.auth.delSure', { imsi: imsi }),
|
content: t('views.neUser.auth.delSure', { imsi: imsiMsg }),
|
||||||
onOk() {
|
onOk() {
|
||||||
const key = 'delSub';
|
modalState.loadDataLoading = true;
|
||||||
message.loading({ content: t('common.loading'), key });
|
const hide = message.loading({ content: t('common.loading') });
|
||||||
delSub(neID, imsi).then(res => {
|
delSub(neID, imsi)
|
||||||
if (res.code === RESULT_CODE_SUCCESS) {
|
.then(res => {
|
||||||
message.success({
|
if (res.code === RESULT_CODE_SUCCESS) {
|
||||||
content: t('common.msgSuccess', { msg: t('common.deleteText') }),
|
const msgContent = t('common.msgSuccess', {
|
||||||
key,
|
msg: t('common.deleteText'),
|
||||||
duration: 2,
|
});
|
||||||
});
|
message.success({
|
||||||
|
content: `${msgContent} : ${imsiMsg}`,
|
||||||
|
duration: 3,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
message.error({
|
||||||
|
content: `${res.msg}`,
|
||||||
|
duration: 3,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hide();
|
||||||
fnGetList();
|
fnGetList();
|
||||||
} else {
|
modalState.loadDataLoading = false;
|
||||||
message.error({
|
});
|
||||||
content: `${res.msg}`,
|
|
||||||
key: key,
|
|
||||||
duration: 2,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UDM签约用户导出
|
||||||
|
*/
|
||||||
|
function fnRecordExport(type: string = 'txt') {
|
||||||
|
const selectLen = tableState.selectedRowKeys.length;
|
||||||
|
if (selectLen <= 0) return;
|
||||||
|
const rows: Record<string, any>[] = tableState.data.filter(
|
||||||
|
(row: Record<string, any>) =>
|
||||||
|
tableState.selectedRowKeys.indexOf(row.imsi) >= 0
|
||||||
|
);
|
||||||
|
|
||||||
|
let content = '';
|
||||||
|
if (type == 'txt') {
|
||||||
|
for (const row of rows) {
|
||||||
|
debugger;
|
||||||
|
const epsDat = [
|
||||||
|
row.epsFlag,
|
||||||
|
row.epsOdb,
|
||||||
|
row.hplmnOdb,
|
||||||
|
row.ard,
|
||||||
|
row.epstpl,
|
||||||
|
row.contextId,
|
||||||
|
row.apnContext,
|
||||||
|
row.staticIp,
|
||||||
|
].join(',');
|
||||||
|
content += `${row.imsi},${row.msisdn},${row.ambr},${row.nssai},${row.arfb},${row.sar},${row.rat},${row.cn},${row.smfSel},${row.smData},${epsDat}\r\n`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (type == 'csv') {
|
||||||
|
content = `imsi,msisdn,ambr,nssai,arfb,sar,rat,cn,smf_sel,sm_dat,eps_dat\r\n`;
|
||||||
|
for (const row of rows) {
|
||||||
|
const epsDat = [
|
||||||
|
row.epsFlag,
|
||||||
|
row.epsOdb,
|
||||||
|
row.hplmnOdb,
|
||||||
|
row.ard,
|
||||||
|
row.epstpl,
|
||||||
|
row.contextId,
|
||||||
|
row.apnContext,
|
||||||
|
row.staticIp,
|
||||||
|
].join(',');
|
||||||
|
content += `${row.imsi},${row.msisdn},${row.ambr},${row.nssai},${row.arfb},${row.sar},${row.rat},${row.cn},${row.smfSel},${row.smData},${epsDat}\r\n`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const blob = new Blob([content], { type: 'text/plain;charset=utf-8' });
|
||||||
|
saveAs(blob, `UDMSub_${Date.now()}.${type}`);
|
||||||
|
}
|
||||||
|
|
||||||
/**列表导出 */
|
/**列表导出 */
|
||||||
function fnExportList(type: string) {
|
function fnExportList(type: string) {
|
||||||
const neID = queryParams.neId;
|
const neID = queryParams.neId;
|
||||||
@@ -813,6 +884,10 @@ function fnGetList(pageNum?: number) {
|
|||||||
}
|
}
|
||||||
listSub(toRaw(queryParams)).then(res => {
|
listSub(toRaw(queryParams)).then(res => {
|
||||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
|
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
|
||||||
|
// 取消勾选
|
||||||
|
if (tableState.selectedRowKeys.length > 0) {
|
||||||
|
tableState.selectedRowKeys = [];
|
||||||
|
}
|
||||||
tablePagination.total = res.total;
|
tablePagination.total = res.total;
|
||||||
tableState.data = res.rows;
|
tableState.data = res.rows;
|
||||||
}
|
}
|
||||||
@@ -977,6 +1052,18 @@ onMounted(() => {
|
|||||||
</template>
|
</template>
|
||||||
{{ t('views.neUser.auth.batchAddText') }}
|
{{ t('views.neUser.auth.batchAddText') }}
|
||||||
</a-button>
|
</a-button>
|
||||||
|
|
||||||
|
<a-button
|
||||||
|
type="default"
|
||||||
|
danger
|
||||||
|
:disabled="tableState.selectedRowKeys.length <= 0"
|
||||||
|
:loading="modalState.loadDataLoading"
|
||||||
|
@click.prevent="fnRecordDelete('0')"
|
||||||
|
>
|
||||||
|
<template #icon><DeleteOutlined /></template>
|
||||||
|
{{ t('views.neUser.sub.checkDel') }}
|
||||||
|
</a-button>
|
||||||
|
|
||||||
<a-button
|
<a-button
|
||||||
type="primary"
|
type="primary"
|
||||||
danger
|
danger
|
||||||
@@ -988,6 +1075,7 @@ onMounted(() => {
|
|||||||
</template>
|
</template>
|
||||||
{{ t('views.neUser.auth.batchDelText') }}
|
{{ t('views.neUser.auth.batchDelText') }}
|
||||||
</a-button>
|
</a-button>
|
||||||
|
|
||||||
<a-popconfirm
|
<a-popconfirm
|
||||||
:title="t('views.neUser.sub.loadDataConfirm')"
|
:title="t('views.neUser.sub.loadDataConfirm')"
|
||||||
:ok-text="t('common.ok')"
|
:ok-text="t('common.ok')"
|
||||||
@@ -1017,6 +1105,7 @@ onMounted(() => {
|
|||||||
|
|
||||||
<a-popconfirm
|
<a-popconfirm
|
||||||
:title="t('views.neUser.sub.exportConfirm')"
|
:title="t('views.neUser.sub.exportConfirm')"
|
||||||
|
placement="topRight"
|
||||||
ok-text="TXT"
|
ok-text="TXT"
|
||||||
ok-type="default"
|
ok-type="default"
|
||||||
@confirm="fnExportList('txt')"
|
@confirm="fnExportList('txt')"
|
||||||
@@ -1031,6 +1120,26 @@ onMounted(() => {
|
|||||||
{{ t('views.neUser.sub.export') }}
|
{{ t('views.neUser.sub.export') }}
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-popconfirm>
|
</a-popconfirm>
|
||||||
|
|
||||||
|
<a-popconfirm
|
||||||
|
:title="t('views.neUser.sub.checkExportConfirm')"
|
||||||
|
placement="topRight"
|
||||||
|
ok-text="TXT"
|
||||||
|
ok-type="default"
|
||||||
|
@confirm="fnRecordExport('txt')"
|
||||||
|
:show-cancel="false"
|
||||||
|
cancel-text="CSV"
|
||||||
|
@cancel="fnRecordExport('csv')"
|
||||||
|
:disabled="tableState.selectedRowKeys.length <= 0"
|
||||||
|
>
|
||||||
|
<a-button
|
||||||
|
type="default"
|
||||||
|
:disabled="tableState.selectedRowKeys.length <= 0"
|
||||||
|
>
|
||||||
|
<template #icon><ExportOutlined /></template>
|
||||||
|
{{ t('views.neUser.sub.checkExport') }}
|
||||||
|
</a-button>
|
||||||
|
</a-popconfirm>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -1105,6 +1214,11 @@ onMounted(() => {
|
|||||||
:scroll="{ y: 'calc(100vh - 480px)' }"
|
:scroll="{ y: 'calc(100vh - 480px)' }"
|
||||||
@change="fnTableChange"
|
@change="fnTableChange"
|
||||||
@resizeColumn="(w:number, col:any) => (col.width = w)"
|
@resizeColumn="(w:number, col:any) => (col.width = w)"
|
||||||
|
:row-selection="{
|
||||||
|
type: 'checkbox',
|
||||||
|
selectedRowKeys: tableState.selectedRowKeys,
|
||||||
|
onChange: fnTableSelectedRowKeys,
|
||||||
|
}"
|
||||||
>
|
>
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
<template v-if="column.key === 'imsi'">
|
<template v-if="column.key === 'imsi'">
|
||||||
|
|||||||
Reference in New Issue
Block a user