revt: 回退网元软件包类型支持adb,mf,rtproxy
This commit is contained in:
@@ -694,8 +694,6 @@ 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",
|
||||||
|
|||||||
@@ -694,8 +694,6 @@ 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: "请上传软件包文件",
|
||||||
|
|||||||
@@ -29,10 +29,10 @@ let tableColumns: ColumnsType = [
|
|||||||
width: 50,
|
width: 50,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('views.ne.neSoftware.type'),
|
title: t('views.ne.common.neType'),
|
||||||
dataIndex: 'type',
|
dataIndex: 'neType',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
width: 120,
|
width: 100,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('views.ne.neSoftware.version'),
|
title: t('views.ne.neSoftware.version'),
|
||||||
@@ -297,7 +297,7 @@ function fnStepNext() {
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
const { neType, neId } = stepState.neInfo;
|
const { neType, neId } = stepState.neInfo;
|
||||||
if (neId) {
|
if (neId) {
|
||||||
tableState.queryParams.type = neType;
|
tableState.queryParams.neType = neType;
|
||||||
state.from.neType = neType;
|
state.from.neType = neType;
|
||||||
state.from.neId = neId;
|
state.from.neId = neId;
|
||||||
fnGetList(1);
|
fnGetList(1);
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ type ModalStateType = {
|
|||||||
/**表单数据 */
|
/**表单数据 */
|
||||||
from: {
|
from: {
|
||||||
id: string;
|
id: string;
|
||||||
type: string;
|
neType: 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: '',
|
||||||
type: '',
|
neType: '',
|
||||||
name: '',
|
name: '',
|
||||||
path: '',
|
path: '',
|
||||||
version: '',
|
version: '',
|
||||||
@@ -71,7 +71,7 @@ const modalStateFrom = Form.useForm(
|
|||||||
required: true,
|
required: true,
|
||||||
min: 1,
|
min: 1,
|
||||||
max: 32,
|
max: 32,
|
||||||
message: t('views.ne.neSoftware.typePlease'),
|
message: t('views.ne.common.neTypePlease'),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
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 typeIndex = fileName.indexOf('-');
|
const neTypeIndex = fileName.indexOf('-');
|
||||||
if (typeIndex !== -1) {
|
if (neTypeIndex !== -1) {
|
||||||
modalState.from.type = fileName.substring(0, typeIndex).toUpperCase();
|
modalState.from.neType = fileName.substring(0, neTypeIndex).toUpperCase();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -232,7 +232,7 @@ onMounted(() => {});
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<a-modal
|
<a-modal
|
||||||
width="550px"
|
width="500px"
|
||||||
:keyboard="false"
|
:keyboard="false"
|
||||||
:mask-closable="false"
|
:mask-closable="false"
|
||||||
:visible="modalState.visibleByEdit"
|
:visible="modalState.visibleByEdit"
|
||||||
@@ -280,17 +280,13 @@ onMounted(() => {});
|
|||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
<a-form-item
|
<a-form-item
|
||||||
:label="t('views.ne.neSoftware.type')"
|
:label="t('views.ne.common.neType')"
|
||||||
name="type"
|
name="neType"
|
||||||
v-bind="modalStateFrom.validateInfos.type"
|
v-bind="modalStateFrom.validateInfos.neType"
|
||||||
>
|
>
|
||||||
<a-auto-complete
|
<a-auto-complete
|
||||||
v-model:value="modalState.from.type"
|
v-model:value="modalState.from.neType"
|
||||||
:options="
|
:options="NE_TYPE_LIST.map(v => ({ value: v }))"
|
||||||
['MF', 'RTPROXY', 'ADB']
|
|
||||||
.concat(NE_TYPE_LIST)
|
|
||||||
.map(v => ({ value: v }))
|
|
||||||
"
|
|
||||||
:disabled="modalState.from.id !== ''"
|
:disabled="modalState.from.id !== ''"
|
||||||
>
|
>
|
||||||
<a-input
|
<a-input
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ const props = defineProps({
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
/**软件类型,指定上传 */
|
/**网元类型,指定上传 */
|
||||||
type: {
|
neType: {
|
||||||
type: String,
|
type: String,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -29,7 +29,7 @@ type ModalStateType = {
|
|||||||
title: string;
|
title: string;
|
||||||
/**表单数据 */
|
/**表单数据 */
|
||||||
from: {
|
from: {
|
||||||
type: string;
|
neType: 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.type} ${res.msg}`,
|
content: `${info.neType} ${res.msg}`,
|
||||||
duration: 3,
|
duration: 3,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -131,13 +131,13 @@ function fnBeforeUploadFile(file: FileType) {
|
|||||||
return Upload.LIST_IGNORE;
|
return Upload.LIST_IGNORE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 取文件包类型判断是否支持
|
// 取网元类型判断是否支持
|
||||||
let softwareType = '';
|
let neType = '';
|
||||||
const typeIndex = fileName.indexOf('-');
|
const neTypeIndex = fileName.indexOf('-');
|
||||||
if (typeIndex !== -1) {
|
if (neTypeIndex !== -1) {
|
||||||
softwareType = fileName.substring(0, typeIndex).toUpperCase();
|
neType = fileName.substring(0, neTypeIndex).toUpperCase();
|
||||||
}
|
}
|
||||||
if (!['MF', 'RTPROXY', 'ADB'].concat(NE_TYPE_LIST).includes(softwareType)) {
|
if (!NE_TYPE_LIST.includes(neType)) {
|
||||||
notification.warning({
|
notification.warning({
|
||||||
message: fileName,
|
message: fileName,
|
||||||
description: t('views.ne.neSoftware.fileCheckType'),
|
description: t('views.ne.neSoftware.fileCheckType'),
|
||||||
@@ -158,17 +158,17 @@ function fnBeforeUploadFile(file: FileType) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 单网元上传
|
// 单网元上传
|
||||||
if (props.type && props.type !== softwareType) {
|
if (props.neType && props.neType !== neType) {
|
||||||
notification.warning({
|
notification.warning({
|
||||||
message: fileName,
|
message: fileName,
|
||||||
description: t('views.ne.neSoftware.fileTypeNotEq', {
|
description: t('views.ne.neSoftware.fileTypeNotEq', {
|
||||||
txt: props.type,
|
txt: props.neType,
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
return Upload.LIST_IGNORE;
|
return Upload.LIST_IGNORE;
|
||||||
} else {
|
} else {
|
||||||
// 多文件上传时检查是否有同类型网元包
|
// 多文件上传时检查是否有同类型网元包
|
||||||
const hasItem = modalState.from.find(item => item.type === softwareType);
|
const hasItem = modalState.from.find(item => item.neType === neType);
|
||||||
if (hasItem) {
|
if (hasItem) {
|
||||||
notification.warning({
|
notification.warning({
|
||||||
message: fileName,
|
message: fileName,
|
||||||
@@ -180,7 +180,7 @@ function fnBeforeUploadFile(file: FileType) {
|
|||||||
|
|
||||||
modalState.from.push({
|
modalState.from.push({
|
||||||
name: fileName,
|
name: fileName,
|
||||||
type: softwareType,
|
neType: neType,
|
||||||
version: version,
|
version: version,
|
||||||
uid: file.uid,
|
uid: file.uid,
|
||||||
status: 'uploading',
|
status: 'uploading',
|
||||||
@@ -249,10 +249,10 @@ onMounted(() => {});
|
|||||||
:label-col="{ span: 6 }"
|
:label-col="{ span: 6 }"
|
||||||
:labelWrap="true"
|
:labelWrap="true"
|
||||||
>
|
>
|
||||||
<template v-if="props.type">
|
<template v-if="props.neType">
|
||||||
<a-form-item :label="t('views.ne.neSoftware.type')" name="type">
|
<a-form-item :label="t('views.ne.common.neType')" name="type">
|
||||||
<a-tag color="processing">
|
<a-tag color="processing">
|
||||||
{{ props.type }}
|
{{ props.neType }}
|
||||||
</a-tag>
|
</a-tag>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
@@ -322,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.type}-${item.version}`"
|
:message="`${item.neType}-${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.type}-${item.version}`"
|
:message="`${item.neType}-${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.type}-${item.version}`"
|
:message="`${item.neType}-${item.version}`"
|
||||||
type="error"
|
type="error"
|
||||||
show-icon
|
show-icon
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ let neOtions = ref<Record<string, any>[]>([]);
|
|||||||
/**查询参数 */
|
/**查询参数 */
|
||||||
let queryParams = reactive({
|
let queryParams = reactive({
|
||||||
/**网元类型 */
|
/**网元类型 */
|
||||||
type: undefined,
|
neType: undefined,
|
||||||
/**包名称 */
|
/**包名称 */
|
||||||
name: '',
|
name: '',
|
||||||
/**包版本 */
|
/**包版本 */
|
||||||
@@ -42,7 +42,7 @@ let queryParams = reactive({
|
|||||||
/**查询参数重置 */
|
/**查询参数重置 */
|
||||||
function fnQueryReset() {
|
function fnQueryReset() {
|
||||||
queryParams = Object.assign(queryParams, {
|
queryParams = Object.assign(queryParams, {
|
||||||
type: undefined,
|
neType: 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.neSoftware.type'),
|
title: t('views.ne.common.neType'),
|
||||||
dataIndex: 'type',
|
dataIndex: 'neType',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
width: 120,
|
width: 100,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('views.ne.neSoftware.version'),
|
title: t('views.ne.neSoftware.version'),
|
||||||
@@ -356,14 +356,10 @@ 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.neSoftware.type')" name="type ">
|
<a-form-item :label="t('views.ne.common.neType')" name="neType ">
|
||||||
<a-auto-complete
|
<a-auto-complete
|
||||||
v-model:value="queryParams.type"
|
v-model:value="queryParams.neType"
|
||||||
:options="
|
:options="NE_TYPE_LIST.map(v => ({ value: v }))"
|
||||||
['MF', 'RTPROXY', 'ADB']
|
|
||||||
.concat(NE_TYPE_LIST)
|
|
||||||
.map(v => ({ value: v }))
|
|
||||||
"
|
|
||||||
allow-clear
|
allow-clear
|
||||||
:placeholder="t('common.inputPlease')"
|
:placeholder="t('common.inputPlease')"
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user