fix: 软件版本管理上传版本号截取
This commit is contained in:
@@ -64,8 +64,8 @@ type TabeStateType = {
|
||||
/**表格状态 */
|
||||
let tableState: TabeStateType = reactive({
|
||||
loading: false,
|
||||
size: 'middle',
|
||||
seached: true,
|
||||
size: 'small',
|
||||
seached: false,
|
||||
data: [],
|
||||
selectedRowKeys: [],
|
||||
});
|
||||
@@ -185,7 +185,7 @@ let fileModalState: FileStateType = reactive({
|
||||
neId: undefined,
|
||||
},
|
||||
backFrom: {
|
||||
ne:undefined,
|
||||
ne: undefined,
|
||||
neType: undefined,
|
||||
neId: undefined,
|
||||
version: '',
|
||||
@@ -646,9 +646,14 @@ function fnBeforeUploadFile(file: FileType) {
|
||||
return false;
|
||||
}
|
||||
// 根据给定的软件名取版本号 ims-r2.2312.x-ub22.deb
|
||||
const nameArr = fileName.split('.');
|
||||
if (nameArr.length > 3) {
|
||||
modalState.from.version = nameArr[1];
|
||||
const regex = /r\d+\.\d+(\.\d+)?/;
|
||||
const matches = fileName.match(regex);
|
||||
if (matches) {
|
||||
modalState.from.version = matches[0];
|
||||
}
|
||||
const neTypeIndex = fileName.indexOf('-');
|
||||
if (neTypeIndex !== -1) {
|
||||
modalState.from.neType = fileName.substring(0, neTypeIndex).toUpperCase();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -761,14 +766,14 @@ onMounted(() => {
|
||||
<template #icon><UploadOutlined /></template>
|
||||
{{ t('common.uploadText') }}
|
||||
</a-button>
|
||||
<a-button type="default" @click.prevent="fnModalVisibleByBack()">
|
||||
<template #icon> <UndoOutlined /></template>
|
||||
{{ t('views.configManage.softwareManage.backBtn') }}
|
||||
</a-button>
|
||||
<a-button type="dashed" @click.prevent="fnModalVisibleByHistory()">
|
||||
<template #icon><HistoryOutlined /></template>
|
||||
{{ t('views.configManage.softwareManage.historyBtn') }}
|
||||
</a-button>
|
||||
<a-button type="dashed" @click.prevent="fnModalVisibleByBack()">
|
||||
<template #icon> <UndoOutlined /></template>
|
||||
{{ t('views.configManage.softwareManage.backBtn') }}
|
||||
</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
|
||||
@@ -776,11 +781,15 @@ onMounted(() => {
|
||||
<template #extra>
|
||||
<a-space :size="8" align="center">
|
||||
<a-tooltip>
|
||||
<template #title>{{ t('common.searchBarText') }}</template>
|
||||
<template #title>{{
|
||||
tableState.seached
|
||||
? t('common.switch.show')
|
||||
: t('common.switch.hide')
|
||||
}}</template>
|
||||
<a-switch
|
||||
v-model:checked="tableState.seached"
|
||||
:checked-children="t('common.switch.show')"
|
||||
:un-checked-children="t('common.switch.hide')"
|
||||
:checked-children="t('common.searchBarText')"
|
||||
:un-checked-children="t('common.searchBarText')"
|
||||
size="small"
|
||||
/>
|
||||
</a-tooltip>
|
||||
@@ -853,7 +862,7 @@ onMounted(() => {
|
||||
<template #icon><ThunderboltOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip>
|
||||
<a-tooltip placement="left">
|
||||
<template #title>{{ t('common.moreText') }}</template>
|
||||
<a-dropdown
|
||||
placement="bottomRight"
|
||||
@@ -885,7 +894,7 @@ onMounted(() => {
|
||||
</a-card>
|
||||
|
||||
<!-- 上传框 -->
|
||||
<a-modal
|
||||
<DraggableModal
|
||||
width="800px"
|
||||
:keyboard="false"
|
||||
:mask-closable="false"
|
||||
@@ -978,7 +987,7 @@ onMounted(() => {
|
||||
</a-upload>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
</DraggableModal>
|
||||
|
||||
<!-- 上传激活历史 -->
|
||||
<SoftwareHistory
|
||||
|
||||
Reference in New Issue
Block a user