fix: 网元软件包类型支持adb,mf,rtproxy

This commit is contained in:
TsMask
2024-05-27 17:08:56 +08:00
parent 38cb406687
commit 9f2b80718e
6 changed files with 75 additions and 59 deletions

View File

@@ -694,6 +694,8 @@ export default {
uploadBatch: "Update Softwares", uploadBatch: "Update Softwares",
uploadBatchMax: "Multiple packages can be uploaded, with up to {txt} selected at the same time.", uploadBatchMax: "Multiple packages can be uploaded, with up to {txt} selected at the same time.",
uploadFileName: "Parses file names in the format of: amf-r2.240x.xx-xxx", uploadFileName: "Parses file names in the format of: amf-r2.240x.xx-xxx",
type: 'Software Type',
typePlease: 'Please select the software type',
name: "File Name", name: "File Name",
path: "Software File", path: "Software File",
pathPlease: "Please upload the software package file", pathPlease: "Please upload the software package file",
@@ -769,7 +771,7 @@ export default {
configAddTip: 'Is it added as new network element information and continue?', configAddTip: 'Is it added as new network element information and continue?',
configUpdateTitle: 'Update Tips', configUpdateTitle: 'Update Tips',
configUpdateTip: 'Does it update to the already existing network element information and continue?', configUpdateTip: 'Does it update to the already existing network element information and continue?',
configStepNext: 'Confirm that you want to proceed to the next step for the Net Element software installation?', configStepNext: 'Confirm that you want to proceed to the next step for the Network Element software installation?',
installTitle: "Network Element Installation", installTitle: "Network Element Installation",
installDesc: "Installation to Service Terminal", installDesc: "Installation to Service Terminal",
installConfirmTip: 'Are you sure you want to install package [{name}]?', installConfirmTip: 'Are you sure you want to install package [{name}]?',
@@ -786,6 +788,7 @@ export default {
licenseResultTitleOk: 'Successful Activation', licenseResultTitleOk: 'Successful Activation',
licenseUpload: 'License', licenseUpload: 'License',
licenseEnd: 'Finish', licenseEnd: 'Finish',
licenseEndTip: "Confirmed to end the installation?",
licenseCheack: 'Waiting for network element validation', licenseCheack: 'Waiting for network element validation',
licenseTip1: '1. Click [License] to get the license activation code, and then contact the network element vendor for activation.', licenseTip1: '1. Click [License] to get the license activation code, and then contact the network element vendor for activation.',
licenseTip2: '2. Clicking [Finish] will end the installation process.', licenseTip2: '2. Clicking [Finish] will end the installation process.',

View File

@@ -694,6 +694,8 @@ export default {
uploadBatch: "上传软件包", uploadBatch: "上传软件包",
uploadBatchMax: "可上传多个软件包,最多同时选择{txt}个。", uploadBatchMax: "可上传多个软件包,最多同时选择{txt}个。",
uploadFileName: "解析文件名称格式如: amf-r2.240x.xx-xxx", uploadFileName: "解析文件名称格式如: amf-r2.240x.xx-xxx",
type: '软件类型',
typePlease: '请选择软件包类型',
name: "文件名", name: "文件名",
path: "软件文件", path: "软件文件",
pathPlease: "请上传软件包文件", pathPlease: "请上传软件包文件",
@@ -786,6 +788,7 @@ export default {
licenseResultTitleOk: '成功激活', licenseResultTitleOk: '成功激活',
licenseUpload: '许可证', licenseUpload: '许可证',
licenseEnd: '结束', licenseEnd: '结束',
licenseEndTip: "确认要结束安装吗?",
licenseCheack: '等待网元验证', licenseCheack: '等待网元验证',
licenseTip1: '1. 点击【许可证】可获取许可激活码,随后联系网元厂商进行激活', licenseTip1: '1. 点击【许可证】可获取许可激活码,随后联系网元厂商进行激活',
licenseTip2: '2. 点击【结束】将结束安装过程', licenseTip2: '2. 点击【结束】将结束安装过程',

View File

@@ -29,10 +29,10 @@ let tableColumns: ColumnsType = [
width: 50, width: 50,
}, },
{ {
title: t('views.ne.common.neType'), title: t('views.ne.neSoftware.type'),
dataIndex: 'neType', dataIndex: 'type',
align: 'left', align: 'left',
width: 100, width: 120,
}, },
{ {
title: t('views.ne.neSoftware.version'), title: t('views.ne.neSoftware.version'),
@@ -275,7 +275,7 @@ function fnStepPrev() {
function fnStepNext() { function fnStepNext() {
Modal.confirm({ Modal.confirm({
title: t('common.tipTitle'), title: t('common.tipTitle'),
content: t('views.ne.neQuickSetup.neInfoSoftwareInstallStepNext'), content: t('views.ne.neQuickSetup.installStepNext'),
onOk() { onOk() {
fnToStepName('NeInfoSoftwareLicense'); fnToStepName('NeInfoSoftwareLicense');
}, },
@@ -285,7 +285,7 @@ function fnStepNext() {
onMounted(() => { onMounted(() => {
const { neType, neId } = stepState.neInfo; const { neType, neId } = stepState.neInfo;
if (neId) { if (neId) {
tableState.queryParams.neType = neType; tableState.queryParams.type = neType;
state.from.neType = neType; state.from.neType = neType;
state.from.neId = neId; state.from.neId = neId;
fnGetList(1); fnGetList(1);

View File

@@ -34,7 +34,7 @@ type ModalStateType = {
/**表单数据 */ /**表单数据 */
from: { from: {
id: string; id: string;
neType: string; type: string;
name: string; name: string;
path: string; path: string;
version: string; version: string;
@@ -52,7 +52,7 @@ let modalState: ModalStateType = reactive({
title: '软件包文件', title: '软件包文件',
from: { from: {
id: '', id: '',
neType: '', type: '',
name: '', name: '',
path: '', path: '',
version: '', version: '',
@@ -66,12 +66,12 @@ let modalState: ModalStateType = reactive({
const modalStateFrom = Form.useForm( const modalStateFrom = Form.useForm(
modalState.from, modalState.from,
reactive({ reactive({
neType: [ type: [
{ {
required: true, required: true,
min: 1, min: 1,
max: 32, max: 32,
message: t('views.ne.common.neTypePlease'), message: t('views.ne.neSoftware.typePlease'),
}, },
], ],
version: [ version: [
@@ -160,9 +160,9 @@ function fnBeforeUploadFile(file: FileType) {
if (matches) { if (matches) {
modalState.from.version = matches[0]; modalState.from.version = matches[0];
} }
const neTypeIndex = fileName.indexOf('-'); const typeIndex = fileName.indexOf('-');
if (neTypeIndex !== -1) { if (typeIndex !== -1) {
modalState.from.neType = fileName.substring(0, neTypeIndex).toUpperCase(); modalState.from.type = fileName.substring(0, typeIndex).toUpperCase();
} }
return true; return true;
} }
@@ -235,7 +235,7 @@ onMounted(() => {});
<template> <template>
<a-modal <a-modal
width="500px" width="550px"
:keyboard="false" :keyboard="false"
:mask-closable="false" :mask-closable="false"
:visible="modalState.visibleByEdit" :visible="modalState.visibleByEdit"
@@ -253,6 +253,7 @@ onMounted(() => {});
> >
<a-form-item <a-form-item
:label="t('views.ne.neSoftware.path')" :label="t('views.ne.neSoftware.path')"
:help="t('views.ne.neSoftware.uploadFileName')"
name="file" name="file"
v-bind="modalStateFrom.validateInfos.path" v-bind="modalStateFrom.validateInfos.path"
v-if="modalState.from.id === ''" v-if="modalState.from.id === ''"
@@ -282,13 +283,17 @@ onMounted(() => {});
</a-form-item> </a-form-item>
<a-form-item <a-form-item
:label="t('views.ne.common.neType')" :label="t('views.ne.neSoftware.type')"
name="neType" name="type"
v-bind="modalStateFrom.validateInfos.neType" v-bind="modalStateFrom.validateInfos.type"
> >
<a-auto-complete <a-auto-complete
v-model:value="modalState.from.neType" v-model:value="modalState.from.type"
:options="NE_TYPE_LIST.map(v => ({ value: v }))" :options="
['MF', 'RTPROXY', 'ADB']
.concat(NE_TYPE_LIST)
.map(v => ({ value: v }))
"
:disabled="modalState.from.id !== ''" :disabled="modalState.from.id !== ''"
> >
<a-input <a-input

View File

@@ -15,8 +15,8 @@ const props = defineProps({
type: Boolean, type: Boolean,
default: false, default: false,
}, },
/**网元类型,指定上传 */ /**软件类型,指定上传 */
neType: { type: {
type: String, type: String,
}, },
}); });
@@ -29,7 +29,7 @@ type ModalStateType = {
title: string; title: string;
/**表单数据 */ /**表单数据 */
from: { from: {
neType: string; type: string;
name: string; name: string;
path: string; path: string;
status: 'done' | 'uploading' | 'error'; status: 'done' | 'uploading' | 'error';
@@ -88,7 +88,7 @@ function fnModalOk() {
rows.push(info); rows.push(info);
} else { } else {
message.error({ message.error({
content: `${info.neType} ${res.msg}`, content: `${info.type} ${res.msg}`,
duration: 3, duration: 3,
}); });
} }
@@ -131,13 +131,13 @@ function fnBeforeUploadFile(file: FileType) {
return Upload.LIST_IGNORE; return Upload.LIST_IGNORE;
} }
// 取网元类型判断是否支持 // 取文件包类型判断是否支持
let neType = ''; let softwareType = '';
const neTypeIndex = fileName.indexOf('-'); const typeIndex = fileName.indexOf('-');
if (neTypeIndex !== -1) { if (typeIndex !== -1) {
neType = fileName.substring(0, neTypeIndex).toUpperCase(); softwareType = fileName.substring(0, typeIndex).toUpperCase();
} }
if (!NE_TYPE_LIST.includes(neType)) { if (!['MF', 'RTPROXY', 'ADB'].concat(NE_TYPE_LIST).includes(softwareType)) {
notification.warning({ notification.warning({
message: fileName, message: fileName,
description: t('views.ne.neSoftware.fileCheckType'), description: t('views.ne.neSoftware.fileCheckType'),
@@ -157,10 +157,18 @@ function fnBeforeUploadFile(file: FileType) {
return Upload.LIST_IGNORE; return Upload.LIST_IGNORE;
} }
// 单网元上传 // 单网元上传
if (!props.neType) { if (props.type && props.type !== softwareType) {
notification.warning({
message: fileName,
description: t('views.ne.neSoftware.fileTypeNotEq', {
txt: props.type,
}),
});
return Upload.LIST_IGNORE;
} else {
// 多文件上传时检查是否有同类型网元包 // 多文件上传时检查是否有同类型网元包
const hasItem = modalState.from.find(item => item.neType === neType); const hasItem = modalState.from.find(item => item.type === softwareType);
if (hasItem) { if (hasItem) {
notification.warning({ notification.warning({
message: fileName, message: fileName,
@@ -168,21 +176,11 @@ function fnBeforeUploadFile(file: FileType) {
}); });
return Upload.LIST_IGNORE; return Upload.LIST_IGNORE;
} }
} else {
if (props.neType !== neType) {
notification.warning({
message: fileName,
description: t('views.ne.neSoftware.fileTypeNotEq', {
txt: props.neType,
}),
});
return Upload.LIST_IGNORE;
}
} }
modalState.from.push({ modalState.from.push({
name: fileName, name: fileName,
neType: neType, type: softwareType,
version: version, version: version,
uid: file.uid, uid: file.uid,
status: 'uploading', status: 'uploading',
@@ -251,10 +249,10 @@ onMounted(() => {});
:label-col="{ span: 6 }" :label-col="{ span: 6 }"
:labelWrap="true" :labelWrap="true"
> >
<template v-if="props.neType"> <template v-if="props.type">
<a-form-item :label="t('views.ne.common.neType')" name="neType"> <a-form-item :label="t('views.ne.neSoftware.type')" name="type">
<a-tag color="processing"> <a-tag color="processing">
{{ props.neType }} {{ props.type }}
</a-tag> </a-tag>
</a-form-item> </a-form-item>
@@ -324,21 +322,21 @@ onMounted(() => {});
<p :key="item.uid" v-for="item in modalState.from"> <p :key="item.uid" v-for="item in modalState.from">
<template v-if="item.status === 'done'"> <template v-if="item.status === 'done'">
<a-alert <a-alert
:message="`${item.neType}-${item.version}`" :message="`${item.type}-${item.version}`"
type="success" type="success"
show-icon show-icon
/> />
</template> </template>
<template v-if="item.status === 'uploading'"> <template v-if="item.status === 'uploading'">
<a-alert <a-alert
:message="`${item.neType}-${item.version}`" :message="`${item.type}-${item.version}`"
type="info" type="info"
show-icon show-icon
/> />
</template> </template>
<template v-if="item.status === 'error'"> <template v-if="item.status === 'error'">
<a-alert <a-alert
:message="`${item.neType}-${item.version}`" :message="`${item.type}-${item.version}`"
type="error" type="error"
show-icon show-icon
/> />

View File

@@ -28,7 +28,7 @@ let neOtions = ref<Record<string, any>[]>([]);
/**查询参数 */ /**查询参数 */
let queryParams = reactive({ let queryParams = reactive({
/**网元类型 */ /**网元类型 */
neType: undefined, type: undefined,
/**包名称 */ /**包名称 */
name: '', name: '',
/**包版本 */ /**包版本 */
@@ -42,7 +42,7 @@ let queryParams = reactive({
/**查询参数重置 */ /**查询参数重置 */
function fnQueryReset() { function fnQueryReset() {
queryParams = Object.assign(queryParams, { queryParams = Object.assign(queryParams, {
neType: undefined, type: undefined,
name: '', name: '',
version: '', version: '',
pageNum: 1, pageNum: 1,
@@ -85,10 +85,10 @@ let tableColumns = ref<TableColumnsType>([
width: 100, width: 100,
}, },
{ {
title: t('views.ne.common.neType'), title: t('views.ne.neSoftware.type'),
dataIndex: 'neType', dataIndex: 'type',
align: 'left', align: 'left',
width: 100, width: 120,
}, },
{ {
title: t('views.ne.neSoftware.version'), title: t('views.ne.neSoftware.version'),
@@ -285,7 +285,7 @@ function fnRecordDelete(id: string) {
function fnDownloadFile(row: Record<string, any>) { function fnDownloadFile(row: Record<string, any>) {
Modal.confirm({ Modal.confirm({
title: t('common.tipTitle'), title: t('common.tipTitle'),
content: t('views.ne.neSoftware.downTip', {txt: row.name}), content: t('views.ne.neSoftware.downTip', { txt: row.name }),
onOk() { onOk() {
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
downloadFile(row.path) downloadFile(row.path)
@@ -356,10 +356,14 @@ 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="t('views.ne.common.neType')" name="neType "> <a-form-item :label="t('views.ne.neSoftware.type')" name="type ">
<a-auto-complete <a-auto-complete
v-model:value="queryParams.neType" v-model:value="queryParams.type"
:options="NE_TYPE_LIST.map(v => ({ value: v }))" :options="
['MF', 'RTPROXY', 'ADB']
.concat(NE_TYPE_LIST)
.map(v => ({ value: v }))
"
allow-clear allow-clear
:placeholder="t('common.inputPlease')" :placeholder="t('common.inputPlease')"
/> />
@@ -375,7 +379,10 @@ onMounted(() => {
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="6" :md="12" :xs="24"> <a-col :lg="6" :md="12" :xs="24">
<a-form-item :label="t('views.ne.neSoftware.version')" name="version"> <a-form-item
:label="t('views.ne.neSoftware.version')"
name="version"
>
<a-input <a-input
v-model:value="queryParams.version" v-model:value="queryParams.version"
allow-clear allow-clear