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

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