revt: 回退网元软件包类型支持adb,mf,rtproxy

This commit is contained in:
TsMask
2024-05-27 18:49:41 +08:00
parent 939a235a87
commit e00229e5ff
6 changed files with 44 additions and 56 deletions

View File

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