--引入i18包

This commit is contained in:
lai
2023-11-08 19:38:30 +08:00
parent 7eccfd6877
commit 72a6c78230
18 changed files with 110 additions and 73 deletions

View File

@@ -230,10 +230,12 @@ let modalState: ModalStateType = reactive({
const modalStateFrom = Form.useForm(
modalState.from,
reactive({
imsi: [{ required: true, message: 'IMSI'+t('common.unableNull') }],
amf: [{ required: true, message: 'AMF'+t('common.unableNull') }],
ki: [{ required: true, message: 'KI'+t('common.unableNull') }],
algoIndex: [{ required: true, message: 'algoIndex'+t('common.unableNull') }],
imsi: [{ required: true, message: 'IMSI' + t('common.unableNull') }],
amf: [{ required: true, message: 'AMF' + t('common.unableNull') }],
ki: [{ required: true, message: 'KI' + t('common.unableNull') }],
algoIndex: [
{ required: true, message: 'algoIndex' + t('common.unableNull') },
],
})
);
@@ -241,11 +243,18 @@ const modalStateFrom = Form.useForm(
const modalStateBatchFrom = Form.useForm(
modalState.BatchForm,
reactive({
num: [{ required: true, message: t('views.neUser.auth.num')+t('common.unableNull') }],
imsi: [{ required: true, message: 'IMSI'+t('common.unableNull') }],
amf: [{ required: true, message: 'AMF'+t('common.unableNull') }],
ki: [{ required: true, message: 'KI'+t('common.unableNull') }],
algoIndex: [{ required: true, message: 'algoIndex'+t('common.unableNull') }],
num: [
{
required: true,
message: t('views.neUser.auth.num') + t('common.unableNull'),
},
],
imsi: [{ required: true, message: 'IMSI' + t('common.unableNull') }],
amf: [{ required: true, message: 'AMF' + t('common.unableNull') }],
ki: [{ required: true, message: 'KI' + t('common.unableNull') }],
algoIndex: [
{ required: true, message: 'algoIndex' + t('common.unableNull') },
],
})
);
@@ -253,8 +262,13 @@ const modalStateBatchFrom = Form.useForm(
const modalStateBatchDelFrom = Form.useForm(
modalState.BatchDelForm,
reactive({
num: [{ required: true, message: t('views.neUser.auth.delNum')+t('common.unableNull') }],
imsi: [{ required: true, message: 'IMSI'+t('common.unableNull') }],
num: [
{
required: true,
message: t('views.neUser.auth.delNum') + t('common.unableNull'),
},
],
imsi: [{ required: true, message: 'IMSI' + t('common.unableNull') }],
})
);
@@ -271,7 +285,8 @@ function fnModalVisibleByVive(imsi: string) {
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
modalState.from = Object.assign(modalState.from, res.data);
modalState.title = t('common.viewText') + t('views.neUser.auth.authInfo');
modalState.title =
t('common.viewText') + t('views.neUser.auth.authInfo');
modalState.visibleByView = true;
} else {
message.error(`获取鉴权信息失败`, 2);
@@ -290,7 +305,7 @@ function fnModalVisibleByVive(imsi: string) {
function fnModalVisibleByEdit(row?: Record<string, any>) {
if (!row) {
modalStateFrom.resetFields(); //重置表单
modalState.title = t('common.addText')+t('views.neUser.auth.authInfo');
modalState.title = t('common.addText') + t('views.neUser.auth.authInfo');
modalState.visibleByEdit = true;
} else {
if (modalState.confirmLoading) return;
@@ -301,7 +316,8 @@ function fnModalVisibleByEdit(row?: Record<string, any>) {
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
modalState.from = Object.assign(modalState.from, res.data);
modalState.title = t('common.editText')+t('views.neUser.auth.authInfo');
modalState.title =
t('common.editText') + t('views.neUser.auth.authInfo');
modalState.visibleByEdit = true;
} else {
message.error(`获取鉴权信息失败`, 2);
@@ -321,11 +337,13 @@ function fnModalVisibleByEdit(row?: Record<string, any>) {
function fnModalVisibleByBatch(batchFlag?: number) {
if (batchFlag) {
modalStateBatchFrom.resetFields(); //重置表单
modalState.title = t('views.neUser.auth.batchAddText')+t('views.neUser.auth.authInfo');
modalState.title =
t('views.neUser.auth.batchAddText') + t('views.neUser.auth.authInfo');
modalState.visibleByBatch = true;
} else {
modalStateBatchFrom.resetFields(); //重置表单
modalState.title = t('views.neUser.auth.batchDelText')+t('views.neUser.auth.authInfo');
modalState.title =
t('views.neUser.auth.batchDelText') + t('views.neUser.auth.authInfo');
modalState.visibleByBatchDel = true;
}
}
@@ -494,7 +512,7 @@ function fnModalCancel() {
function fnRecordDelete(row: Record<string, any>) {
Modal.confirm({
title: t('common.tipTitle'),
content: t('views.neUser.auth.delSure',{imsi:row.imsi}),
content: t('views.neUser.auth.delSure', { imsi: row.imsi }),
onOk() {
const key = 'delNotice';
message.loading({ content: t('common.loading'), key });
@@ -502,7 +520,7 @@ function fnRecordDelete(row: Record<string, any>) {
delAuth(neID, row).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: t('common.msgSuccess', { msg: t('common.deleteText') }),
content: t('common.msgSuccess', { msg: t('common.deleteText') }),
key,
duration: 2,
});
@@ -531,7 +549,7 @@ function fnExportList(type: string) {
}).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: t('common.msgSuccess', { msg: t('common.export') }),
content: t('common.msgSuccess', { msg: t('common.export') }),
key,
duration: 2,
});
@@ -668,7 +686,7 @@ onMounted(() => {
}
} else {
message.warning({
content:t('views.neUser.auth.noListData'),
content: t('views.neUser.auth.noListData'),
duration: 2,
});
}
@@ -701,10 +719,7 @@ onMounted(() => {
</a-col>
<a-col :lg="6" :md="12" :xs="24">
<a-form-item label="IMSI" name="imsi">
<a-input
v-model:value="queryParams.imsi"
allow-clear
></a-input>
<a-input v-model:value="queryParams.imsi" allow-clear></a-input>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :xs="24">
@@ -954,11 +969,7 @@ onMounted(() => {
@ok="fnModalOk"
@cancel="fnModalCancel"
>
<a-form
name="modalStateFrom"
layout="horizontal"
:label-col="{ span: 6 }"
>
<a-form name="modalStateFrom" layout="horizontal">
<a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
@@ -974,6 +985,14 @@ onMounted(() => {
</a-input>
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item label="Status" name="status">
<a-select value="1">
<a-select-option value="1">Active</a-select-option>
<a-select-option value="0">Inactive</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24">
@@ -995,10 +1014,7 @@ onMounted(() => {
name="algo"
v-bind="modalStateFrom.validateInfos.algoIndex"
>
<a-input
v-model:value="modalState.from.algoIndex"
allow-clear
>
<a-input v-model:value="modalState.from.algoIndex" allow-clear>
</a-input>
</a-form-item>
</a-col>
@@ -1047,10 +1063,7 @@ onMounted(() => {
@ok="fnBatchModalOk"
@cancel="fnBatchModalCancel"
>
<a-form
name="modalStateBatchFrom"
layout="horizontal"
>
<a-form name="modalStateBatchFrom" layout="horizontal">
<a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
@@ -1058,23 +1071,16 @@ onMounted(() => {
name="imsi"
v-bind="modalStateBatchFrom.validateInfos.imsi"
>
<a-input
v-model:value="modalState.BatchForm.imsi"
allow-clear
>
<a-input v-model:value="modalState.BatchForm.imsi" allow-clear>
</a-input>
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
:label="t('views.neUser.auth.num')"
name="num"
v-bind="modalStateBatchFrom.validateInfos.num"
>
<a-input-number
v-model:value="modalState.BatchForm.num"
style="width: 100%"
></a-input-number>
<a-form-item label="Status" name="status">
<a-select value="1">
<a-select-option value="1">Active</a-select-option>
<a-select-option value="0">Inactive</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
@@ -1114,26 +1120,34 @@ onMounted(() => {
name="ki"
v-bind="modalStateBatchFrom.validateInfos.ki"
>
<a-input
v-model:value="modalState.BatchForm.ki"
allow-clear
>
<a-input v-model:value="modalState.BatchForm.ki" allow-clear>
</a-input>
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
label="OPC"
name="opc"
v-bind="modalStateBatchFrom.validateInfos.opc"
:label="t('views.neUser.auth.num')"
name="num"
v-bind="modalStateBatchFrom.validateInfos.num"
>
<a-input
v-model:value="modalState.BatchForm.opc"
allow-clear
></a-input>
<a-input-number
v-model:value="modalState.BatchForm.num"
style="width: 100%"
></a-input-number>
</a-form-item>
</a-col>
</a-row>
<a-form-item
label="OPC"
name="opc"
v-bind="modalStateBatchFrom.validateInfos.opc"
>
<a-input
v-model:value="modalState.BatchForm.opc"
allow-clear
></a-input>
</a-form-item>
</a-form>
</a-modal>
@@ -1161,14 +1175,11 @@ onMounted(() => {
name="imsi"
v-bind="modalStateBatchDelFrom.validateInfos.imsi"
>
<a-input
v-model:value="modalState.BatchDelForm.imsi"
allow-clear
>
<a-input v-model:value="modalState.BatchDelForm.imsi" allow-clear>
<template #prefix>
<a-tooltip placement="topLeft">
<template #title>
{{t('views.neUser.auth.imsiTip')}}
{{ t('views.neUser.auth.imsiTip') }}
</template>
<InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
</a-tooltip>