fix: UDM用户加载全部优化和补充多语言

This commit is contained in:
TsMask
2023-09-23 10:55:26 +08:00
parent 92434e0cd3
commit 08fdeb89f1
4 changed files with 57 additions and 31 deletions

View File

@@ -123,18 +123,28 @@ export default {
}, },
neUser: { neUser: {
auth: { auth: {
neTypePlease: 'Query network element type',
neType: 'UDM Type',
export: 'Export', export: 'Export',
exportConfirm: "Are you sure to export all authentication user data?",
import: 'Import', import: 'Import',
loadDataConfirm: "Are you sure you want to reload the data?",
loadData: "LoadData", loadData: "LoadData",
loadDataTip: 'Successfully obtained updated data: {num} items. The system is updating the data internally. Please do not click repeatedly to obtain updates!!!',
num:'Number allocation', num:'Number allocation',
batchAddText: 'Batch Add', batchAddText: 'Batch Add',
batchDelText: 'Batch Del', batchDelText: 'Batch Del',
}, },
sub:{ sub:{
export: 'Export', neTypePlease: 'Query network element type',
import: 'Import', neType: 'UDM Type',
loadData: "LoadData" export: 'Export',
}, exportConfirm: "Are you sure to export all signed user data?",
import: 'Import',
loadDataConfirm: "Are you sure you want to reload the data?",
loadData: "LoadData",
loadDataTip: 'Successfully obtained updated data: {num} items. The system is updating the data internally. Please do not click repeatedly to obtain updates!!!',
},
base5G: { base5G: {
neTypePlease: 'Query network element type', neTypePlease: 'Query network element type',
neType: 'AMF Type', neType: 'AMF Type',

View File

@@ -123,18 +123,28 @@ export default {
}, },
neUser: { neUser: {
auth: { auth: {
neTypePlease: '查询网元类型',
neType: 'UDM网元类型',
export: '导出', export: '导出',
exportConfirm: "确认导出全部鉴权用户数据吗?",
import: '导入', import: '导入',
loadDataConfirm: "确认要重新加载数据吗?",
loadData: "更新数据", loadData: "更新数据",
loadDataTip: '成功获取更新数据:{num}条,系统内部进行数据更新,请勿重复点击获取更新!!!',
num:'放号数', num:'放号数',
batchAddText: '批量新增', batchAddText: '批量新增',
batchDelText: '批量删除', batchDelText: '批量删除',
}, },
sub:{ sub:{
export: '导出', neTypePlease: '查询网元类型',
import: '导入', neType: 'UDM网元类型',
loadData: "更新数据" export: '导出',
}, exportConfirm: "确认导出全部签约用户数据吗?",
import: '导入',
loadDataConfirm: "确认要重新加载数据吗?",
loadData: "更新数据",
loadDataTip: '成功获取更新数据:{num}条,系统内部进行数据更新,请勿重复点击获取更新!!!',
},
base5G: { base5G: {
neTypePlease: '查询网元类型', neTypePlease: '查询网元类型',
neType: 'AMF网元类型', neType: 'AMF网元类型',

View File

@@ -305,7 +305,7 @@ function fnModalOk() {
.then(e => { .then(e => {
modalState.confirmLoading = true; modalState.confirmLoading = true;
const from = toRaw(modalState.from); const from = toRaw(modalState.from);
from.neId = neID from.neId = neID;
const result = from.id ? updateAuth(from) : addAuth(from); const result = from.id ? updateAuth(from) : addAuth(from);
const hide = message.loading({ content: t('common.loading') }); const hide = message.loading({ content: t('common.loading') });
result result
@@ -461,14 +461,17 @@ function fnLoadData() {
const neID = queryParams.neId; const neID = queryParams.neId;
if (tableState.loading || !neID) return; if (tableState.loading || !neID) return;
modalState.loadDataLoading = true; modalState.loadDataLoading = true;
tableState.loading = true; // 表格loading
loadAuth(neID).then(res => { loadAuth(neID).then(res => {
modalState.loadDataLoading = false; modalState.loadDataLoading = false;
tableState.loading = false; // 表格loading
if (res.code === RESULT_CODE_SUCCESS) { if (res.code === RESULT_CODE_SUCCESS) {
notification.success({ notification.success({
message: '更新数据', message: t('views.neUser.auth.loadData'),
description: `成功获取更新数据:${res.data}条,系统内部进行数据更新,请勿重复点击获取!!!`, description: t('views.neUser.auth.loadDataTip', { num: res.data }),
duration: 10, duration: 10,
}); });
fnQueryReset();
} else { } else {
message.error({ message.error({
content: `获取数据失败`, content: `获取数据失败`,
@@ -575,12 +578,12 @@ onMounted(() => {
<a-form :model="queryParams" name="queryParams" layout="horizontal"> <a-form :model="queryParams" name="queryParams" layout="horizontal">
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :lg="6" :md="12" :xs="24"> <a-col :lg="6" :md="12" :xs="24">
<a-form-item label="UDM网元类型" name="neId "> <a-form-item :label="t('views.neUser.auth.neType')" name="neId ">
<a-select <a-select
v-model:value="queryParams.neId" v-model:value="queryParams.neId"
:options="neOtions" :options="neOtions"
allow-clear allow-clear
placeholder="请选择网元" :placeholder="t('views.neUser.auth.neTypePlease')"
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
@@ -639,9 +642,9 @@ onMounted(() => {
{{ t('views.neUser.auth.batchDelText') }} {{ t('views.neUser.auth.batchDelText') }}
</a-button> </a-button>
<a-popconfirm <a-popconfirm
title="确认要重新加载数据吗?" :title="t('views.neUser.auth.loadDataConfirm')"
ok-text="确认" :ok-text="t('common.ok')"
cancel-text="取消" :cancel-text="t('common.cancel')"
:disabled="modalState.loadDataLoading" :disabled="modalState.loadDataLoading"
@confirm="fnLoadData" @confirm="fnLoadData"
> >
@@ -662,11 +665,11 @@ onMounted(() => {
</a-button> </a-button>
<a-popconfirm <a-popconfirm
title="确认导出全部鉴权用户数据吗?" :title="t('views.neUser.auth.exportConfirm')"
ok-text="txt文件" ok-text="TXT"
ok-type="default" ok-type="default"
@confirm="fnExportList('txt')" @confirm="fnExportList('txt')"
cancel-text="csv文件" cancel-text="CSV"
@cancel="fnExportList('csv')" @cancel="fnExportList('csv')"
> >
<a-button type="dashed"> <a-button type="dashed">

View File

@@ -377,14 +377,17 @@ function fnLoadData() {
const neID = queryParams.neId; const neID = queryParams.neId;
if (tableState.loading || !neID) return; if (tableState.loading || !neID) return;
modalState.loadDataLoading = true; modalState.loadDataLoading = true;
tableState.loading = true; // 表格loading
loadSub(neID).then(res => { loadSub(neID).then(res => {
modalState.loadDataLoading = false; modalState.loadDataLoading = false;
tableState.loading = false; // 表格loading
if (res.code === RESULT_CODE_SUCCESS) { if (res.code === RESULT_CODE_SUCCESS) {
notification.success({ notification.success({
message: '更新数据', message: t('views.neUser.sub.loadData'),
description: `成功获取更新数据:${res.data}条,系统内部进行数据更新,请勿重复点击获取!!!`, description: t('views.neUser.sub.loadDataTip', { num: res.data }),
duration: 10, duration: 10,
}); });
fnQueryReset();
} else { } else {
message.error({ message.error({
content: `获取数据失败`, content: `获取数据失败`,
@@ -491,12 +494,12 @@ onMounted(() => {
<a-form :model="queryParams" name="queryParams" layout="horizontal"> <a-form :model="queryParams" name="queryParams" layout="horizontal">
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :lg="6" :md="12" :xs="24"> <a-col :lg="6" :md="12" :xs="24">
<a-form-item label="UDM网元类型" name="neId "> <a-form-item :label="t('views.neUser.sub.neType')" name="neId ">
<a-select <a-select
v-model:value="queryParams.neId" v-model:value="queryParams.neId"
:options="neOtions" :options="neOtions"
allow-clear allow-clear
placeholder="请选择网元" :placeholder="t('views.neUser.sub.neTypePlease')"
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
@@ -546,9 +549,9 @@ onMounted(() => {
</a-button> </a-button>
<a-popconfirm <a-popconfirm
title="确认要重新加载数据吗?" :title="t('views.neUser.sub.loadDataConfirm')"
ok-text="确认" :ok-text="t('common.ok')"
cancel-text="取消" :cancel-text="t('common.cancel')"
:disabled="modalState.loadDataLoading" :disabled="modalState.loadDataLoading"
@confirm="fnLoadData" @confirm="fnLoadData"
> >
@@ -569,11 +572,11 @@ onMounted(() => {
</a-button> </a-button>
<a-popconfirm <a-popconfirm
title="确认导出全部签约用户数据吗?" :title="t('views.neUser.sub.exportConfirm')"
ok-text="txt文件" ok-text="TXT"
ok-type="default" ok-type="default"
@confirm="fnExportList('txt')" @confirm="fnExportList('txt')"
cancel-text="csv文件" cancel-text="CSV"
@cancel="fnExportList('csv')" @cancel="fnExportList('csv')"
> >
<a-button type="dashed"> <a-button type="dashed">