fix: UE-PCF页面提示信息调整

This commit is contained in:
TsMask
2024-03-07 16:58:41 +08:00
parent a69e8c89f8
commit 7e28df210d
2 changed files with 61 additions and 30 deletions

View File

@@ -138,12 +138,18 @@ export async function batchUpdateRule(data: Record<string, any>) {
data: data,
});
// 解析数据
if (result.code === RESULT_CODE_SUCCESS && result.data?.status) {
return {
code: RESULT_CODE_ERROR,
msg: result.data?.cause,
data: result.data,
};
if (result.code === RESULT_CODE_SUCCESS) {
if (result.data?.status) {
return {
code: RESULT_CODE_ERROR,
msg: result.data?.cause,
data: result.data,
};
}
if (result.data?.data) {
result.data = result.data.data;
return result;
}
}
return result;
}
@@ -182,12 +188,18 @@ export async function batchAddRule(data: Record<string, any>) {
data: data,
});
// 解析数据
if (result.code === RESULT_CODE_SUCCESS && result.data?.status) {
return {
code: RESULT_CODE_ERROR,
msg: result.data?.cause,
data: result.data,
};
if (result.code === RESULT_CODE_SUCCESS) {
if (result.data?.status) {
return {
code: RESULT_CODE_ERROR,
msg: result.data?.cause,
data: result.data,
};
}
if (result.data?.data) {
result.data = result.data.data;
return result;
}
}
return result;
}

View File

@@ -76,62 +76,62 @@ let tableColumns: ColumnsType = [
title: 'IMSI',
dataIndex: 'imsi',
sorter: (a: any, b: any) => Number(a.imsi) - Number(b.imsi),
align: 'center',
align: 'left',
width: 150,
},
{
title: 'MSISDN',
dataIndex: 'msisdn',
sorter: (a: any, b: any) => Number(a.msisdn) - Number(b.msisdn),
align: 'center',
align: 'left',
width: 150,
},
{
title: 'SAR',
dataIndex: 'sar',
align: 'center',
width: 80,
align: 'left',
width: 50,
},
{
title: 'RFSP',
dataIndex: 'rfsp',
align: 'center',
align: 'left',
width: 50,
},
{
title: 'QOS Video',
dataIndex: 'qosVideo',
align: 'center',
align: 'left',
width: 100,
},
{
title: 'QOS Audio',
dataIndex: 'qosAudio',
align: 'center',
align: 'left',
width: 100,
},
{
title: 'PCC Rules',
dataIndex: 'pccRules',
align: 'center',
align: 'left',
width: 120,
},
{
title: 'SESS Rules',
dataIndex: 'sessRules',
align: 'center',
align: 'left',
width: 120,
},
{
title: 'HDR Enrich',
dataIndex: 'hdrEnrich',
align: 'center',
align: 'left',
width: 100,
},
{
title: 'UE Policy',
dataIndex: 'uePolicy',
align: 'center',
align: 'left',
width: 100,
},
{
@@ -288,10 +288,28 @@ function fnModalOk() {
result
.then((res: any) => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: t('common.msgSuccess', { msg: modalState.title }),
duration: 3,
});
if (modalState.isBatch) {
let okTip = '';
if (modalState.type === 'add') {
okTip = res.data;
}
if (modalState.type === 'update') {
okTip = res.data;
}
if (modalState.type === 'delete') {
okTip = t('common.msgSuccess', { msg: modalState.title });
}
message.success({
content: okTip,
duration: 5,
});
} else {
message.success({
content: t('common.msgSuccess', { msg: modalState.title }),
duration: 3,
});
}
fnModalCancel();
fnGetList();
} else {
@@ -360,7 +378,7 @@ function fnRecordDelete(row: Record<string, any>) {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: t('common.msgSuccess', {
msg: row.imsi + t('common.deleteText'),
msg: `${t('common.deleteText')} ${row.imsi}`,
}),
key,
duration: 2,
@@ -472,8 +490,9 @@ function fnModalUploadImportUpload(file: File) {
return res;
})
.then(res => {
if (res.code === RESULT_CODE_SUCCESS && res.data?.filePath) {
uploadImportState.msg = t('views.neUser.pcf.uploadFileOk');
if (res.code === RESULT_CODE_SUCCESS && res.data?.data) {
uploadImportState.msg = res.data?.data;
// uploadImportState.msg = t('views.neUser.pcf.uploadFileOk');
} else if (res.code === RESULT_CODE_SUCCESS && res.data?.detail) {
uploadImportState.msg = res.data?.detail;
} else {