From 85ae7dc5eaf05906c2eece482d6c1bac83959972 Mon Sep 17 00:00:00 2001
From: TsMask <340112800@qq.com>
Date: Fri, 17 May 2024 15:18:01 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20=E7=BD=91=E5=85=83=E6=8E=88=E6=9D=83?=
=?UTF-8?q?=E5=A4=9A=E8=AF=AD=E8=A8=80=E7=BF=BB=E8=AF=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/i18n/locales/en-US.ts | 24 ++++++
src/i18n/locales/zh-CN.ts | 24 ++++++
.../ne/neLicense/components/EditModal.vue | 76 +++++++++----------
src/views/ne/neLicense/index.vue | 67 ++++++++--------
.../components/NeInfoSoftwareLicense.vue | 2 -
5 files changed, 120 insertions(+), 73 deletions(-)
diff --git a/src/i18n/locales/en-US.ts b/src/i18n/locales/en-US.ts
index e6324976..2429917e 100644
--- a/src/i18n/locales/en-US.ts
+++ b/src/i18n/locales/en-US.ts
@@ -53,9 +53,13 @@ export default {
fold: 'Fold',
},
rowId: 'ID',
+ createTime: 'Create Time',
+ updateTime: 'Update Time',
operate: 'Operation',
operateOk: 'Operation Successful!',
operateErr: 'Operation Failed!',
+ copyText: "Copy",
+ copyOk: 'Copy Successful!',
units: {
second: 'Second',
minute: 'Minute',
@@ -576,6 +580,13 @@ export default {
},
},
ne: {
+ common: {
+ neType: 'NE Type',
+ neId: 'NE ID',
+ serialNum: 'Serial Num',
+ expiryDate: 'Expiry Date',
+ remark: 'Remark',
+ },
neInfo: {
version: "Version",
serialNum: 'Serial Number',
@@ -642,6 +653,19 @@ export default {
rollbackTipEmpty: "There is currently no rollback available",
rollbackTipEqual: 'The current version is the same as the previous version',
},
+ neLicense: {
+ status: "License Status",
+ change: "Change License",
+ reload: "Refresh Info",
+ reloadTip: "Confirmed to refresh the [{txt}] license information?",
+ reloadBatch: "Batch Refresh",
+ reloadBatchTip: "Do you do an information refresh on checked records?",
+ updateTtile: "Update License",
+ downCodeTop: "Confirmed to save the license activation code to a file?",
+ activationRequestCode: "License Activation Code",
+ licensePath: "License File",
+ licensePathTip: "Please upload license file",
+ },
},
neUser: {
auth: {
diff --git a/src/i18n/locales/zh-CN.ts b/src/i18n/locales/zh-CN.ts
index 73c2fa3a..4901ca0d 100644
--- a/src/i18n/locales/zh-CN.ts
+++ b/src/i18n/locales/zh-CN.ts
@@ -53,9 +53,13 @@ export default {
fold: '折叠',
},
rowId: '编号',
+ createTime: '创建时间',
+ updateTime: '更新时间',
operate: '操作',
operateOk: '操作成功!',
operateErr: '操作失败!',
+ copyText: "复制",
+ copyOk: '复制成功!',
units: {
second: '秒',
minute: '分钟',
@@ -576,6 +580,13 @@ export default {
},
},
ne: {
+ common: {
+ neType: '网元类型',
+ neId: '网元内部标识',
+ serialNum: '序列号',
+ expiryDate: '许可证到期时间',
+ remark: '备注',
+ },
neInfo: {
version: "网元版本",
serialNum: '序列号',
@@ -642,6 +653,19 @@ export default {
rollbackTipEmpty: "目前没有可用的回滚",
rollbackTipEqual: '当前版本与之前版本相同',
},
+ neLicense: {
+ status: "许可证状态",
+ change: "变更许可证",
+ reload: "刷新信息",
+ reloadTip: "确认要刷新【{txt}】许可证信息吗?",
+ reloadBatch: "批量刷新",
+ reloadBatchTip: "对勾选的记录进行信息刷新吗?",
+ updateTtile: "更新许可证",
+ downCodeTop: "确认要将许可激活码保存到文件吗?",
+ activationRequestCode: "许可激活码",
+ licensePath: "许可证文件",
+ licensePathTip: "请上传许可证文件",
+ },
},
neUser: {
auth: {
diff --git a/src/views/ne/neLicense/components/EditModal.vue b/src/views/ne/neLicense/components/EditModal.vue
index d695025e..c3c71bc6 100644
--- a/src/views/ne/neLicense/components/EditModal.vue
+++ b/src/views/ne/neLicense/components/EditModal.vue
@@ -80,22 +80,10 @@ let modalState: ModalStateType = reactive({
const modalStateFrom = Form.useForm(
modalState.from,
reactive({
- neType: [
- {
- required: true,
- message: 'Please input NE Type',
- },
- ],
- neId: [
- {
- required: true,
- message: 'Please input NE ID',
- },
- ],
licensePath: [
{
required: true,
- message: 'Please upload file',
+ message: t('views.ne.neLicense.licensePathTip'),
},
],
})
@@ -155,12 +143,14 @@ function fnModalCancel() {
function fnBeforeUploadFile(file: FileType) {
if (modalState.confirmLoading) return false;
if (!file.name.endsWith('.ini')) {
- message.error('只支持上传文件格式 .ini', 3);
+ const msg = `${t('components.UploadModal.onlyAllow')} .ini`;
+ message.error(msg, 3);
return Upload.LIST_IGNORE;
}
- const isLt2M = file.size / 1024 / 1024 < 2;
- if (!isLt2M) {
- message.error('文件必须小于2MB', 3);
+ const isLt3M = file.size / 1024 / 1024 < 3;
+ if (!isLt3M) {
+ const msg = `${t('components.UploadModal.allowFilter')} 3MB`;
+ message.error(msg, 3);
return Upload.LIST_IGNORE;
}
return true;
@@ -200,7 +190,7 @@ function fnCopyCode() {
const code = modalState.from.activationRequestCode;
if (!code) return;
copy(code).then(() => {
- message.success('copy success', 3);
+ message.success(t('common.copyOk'), 3);
});
}
@@ -210,7 +200,7 @@ function fnDownCode() {
if (!activationRequestCode) return;
Modal.confirm({
title: t('common.tipTitle'),
- content: 'Confirm to download the Code as a file for saving?',
+ content: t('views.ne.neLicense.downCodeTop'),
onOk() {
const blob = new Blob([activationRequestCode], {
type: 'text/plain',
@@ -231,7 +221,7 @@ function fnModalVisibleById(id: string) {
if (res.code === RESULT_CODE_SUCCESS) {
Object.assign(modalState.from, res.data);
modalState.from.licensePath = '';
- modalState.title = 'Update License';
+ modalState.title = t('views.ne.neLicense.updateTtile');
modalState.visibleByEdit = true;
} else {
message.error(res.msg, 3);
@@ -255,7 +245,7 @@ function fnModalVisibleByTypeAndId(neType: string, neId: string) {
if (res.code === RESULT_CODE_SUCCESS) {
Object.assign(modalState.from, res.data);
modalState.from.licensePath = '';
- modalState.title = 'Update License';
+ modalState.title = t('views.ne.neLicense.updateTtile');
modalState.visibleByEdit = true;
} else {
message.error(res.msg, 3);
@@ -303,23 +293,29 @@ onMounted(() => {});
:label-col="{ span: 6 }"
:labelWrap="true"
>
-
-
-
-
-
-
+
+
+
+ {{ modalState.from.neType }}
+
+
+
+
+ {{ modalState.from.neId }}
+
+
+
@@ -329,12 +325,12 @@ onMounted(() => {});
:disabled="true"
style="width: calc(100% - 64px)"
/>
-
+
-
+
@@ -343,7 +339,7 @@ onMounted(() => {});
@@ -376,7 +372,7 @@ onMounted(() => {});
-
+
([
width: 100,
},
{
- title: 'neType',
+ title: t('views.ne.common.neType'),
dataIndex: 'neType',
align: 'left',
width: 100,
},
{
- title: 'neId',
+ title: t('views.ne.common.neId'),
dataIndex: 'neId',
align: 'left',
width: 100,
},
{
- title: 'status',
+ title: t('views.ne.neLicense.status'),
dataIndex: 'status',
key: 'status',
align: 'left',
- width: 100,
+ width: 120,
},
{
- title: 'serialNum',
+ title: t('views.ne.common.serialNum'),
dataIndex: 'serialNum',
align: 'left',
width: 100,
},
{
- title: 'expiryDate',
+ title: t('views.ne.common.expiryDate'),
dataIndex: 'expiryDate',
align: 'left',
- width: 100,
+ width: 120,
},
{
- title: 'remark',
+ title: t('views.ne.common.remark'),
dataIndex: 'remark',
key: 'remark',
align: 'left',
width: 150,
resizable: true,
minWidth: 100,
- maxWidth: 200,
+ maxWidth: 300,
},
{
- title: 'updateTime',
+ title: t('common.updateTime'),
dataIndex: 'updateTime',
align: 'center',
customRender(opt) {
@@ -249,12 +249,14 @@ function fnModalCancel() {
modalState.licenseId = '';
}
-/**刷新网元授权信息 */
-function fnRecordRefresh(row: Record) {
+/**刷新网元授权状态 */
+function fnRecordState(row: Record) {
if (modalState.confirmLoading) return;
Modal.confirm({
title: t('common.tipTitle'),
- content: 'Refresh Ne License info?',
+ content: t('views.ne.neLicense.reloadTip', {
+ txt: `${row.neType} ${row.neId}`,
+ }),
onOk() {
modalState.confirmLoading = true;
const hide = message.loading(t('common.loading'), 0);
@@ -270,9 +272,7 @@ function fnRecordRefresh(row: Record) {
);
} else {
row.status = '0';
- row.serialNum = '-';
- row.expiryDate = '-';
- message.success(
+ message.warning(
`${row.neType} ${row.neId} ${dictStatus.value[0].label}`,
3
);
@@ -286,12 +286,12 @@ function fnRecordRefresh(row: Record) {
});
}
-/**勾选刷新网元状态 */
-function fnRecordState() {
+/**刷新网元授权状态 勾选 */
+function fnRecordStateBatch() {
if (modalState.confirmLoading) return;
Modal.confirm({
title: t('common.tipTitle'),
- content: `check refresh license state?`,
+ content: t('views.ne.neLicense.reloadBatchTip'),
onOk: async () => {
modalState.confirmLoading = true;
const hide = message.loading(t('common.loading'), 0);
@@ -309,6 +309,8 @@ function fnRecordState() {
row.status = '1';
row.serialNum = res.data.sn;
row.expiryDate = res.data.expire;
+ } else {
+ row.status = '0';
}
tableState.selectedRowKeys = [];
}
@@ -355,7 +357,7 @@ onMounted(() => {
-
+
{
-
+
{
-
+
@@ -408,10 +413,10 @@ onMounted(() => {
type="default"
:disabled="tableState.selectedRowKeys.length <= 0"
:loading="modalState.confirmLoading"
- @click.prevent="fnRecordState()"
+ @click.prevent="fnRecordStateBatch()"
>
- Refresh Status
+ {{ t('views.ne.neLicense.reloadBatch') }}
@@ -503,7 +508,7 @@ onMounted(() => {
- Change License
+ {{ t('views.ne.neLicense.change') }}
{
- Refresh Info
-
+ {{ t('views.ne.neLicense.reload') }}
+
diff --git a/src/views/system/quick-start/components/NeInfoSoftwareLicense.vue b/src/views/system/quick-start/components/NeInfoSoftwareLicense.vue
index 5abad3da..a493ee3b 100644
--- a/src/views/system/quick-start/components/NeInfoSoftwareLicense.vue
+++ b/src/views/system/quick-start/components/NeInfoSoftwareLicense.vue
@@ -136,8 +136,6 @@ function fnRecordState() {
row.expiryDate = res.data.expire;
} else {
row.status = '0';
- row.serialNum = '-';
- row.expiryDate = '-';
}
}
message.success(t('common.operateOk'), 3);