feat: 软件管理

This commit is contained in:
TsMask
2023-10-07 15:35:40 +08:00
parent ee2a5290b1
commit aab98b016f
5 changed files with 416 additions and 149 deletions

View File

@@ -1,4 +1,8 @@
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import {
RESULT_CODE_ERROR,
RESULT_CODE_SUCCESS,
RESULT_MSG_ERROR,
} from '@/constants/result-constants';
import { request } from '@/plugins/http-fetch'; import { request } from '@/plugins/http-fetch';
import { parseObjLineToHump } from '@/utils/parse-utils'; import { parseObjLineToHump } from '@/utils/parse-utils';
@@ -95,6 +99,75 @@ export function uploadNeSoftware(data: FormData) {
}); });
} }
/**
* 下发文件
* @param data 数据对象
* @returns object
*/
export async function sendNeSoftware(data: Record<string, any>) {
const result = await request({
url: `/systemManagement/v1/${data.neType}/software/${data.version}/${data.neId}`,
method: 'post',
});
// 解析数据
if (result.code === RESULT_CODE_SUCCESS && result.data.data) {
let rows = result.data.data.affectedRows;
if (rows) {
delete result.data;
return result;
} else {
return { code: RESULT_CODE_ERROR, msg: RESULT_MSG_ERROR };
}
}
return result;
}
/**
* 激活文件
* @param data 数据对象
* @returns object
*/
export async function runNeSoftware(data: Record<string, any>) {
const result = await request({
url: `/systemManagement/v1/${data.neType}/software/${data.version}/${data.neId}`,
method: 'put',
});
// 解析数据
if (result.code === RESULT_CODE_SUCCESS && result.data.data) {
let rows = result.data.data.affectedRows;
if (rows) {
delete result.data;
return result;
} else {
return { code: RESULT_CODE_ERROR, msg: RESULT_MSG_ERROR };
}
}
return result;
}
/**
* 回退文件
* @param data 数据对象
* @returns object
*/
export async function backNeSoftware(data: Record<string, any>) {
const result = await request({
url: `/systemManagement/v1/${data.neType}/software/${data.version}/${data.neId}`,
method: 'patch',
});
// 解析数据
if (result.code === RESULT_CODE_SUCCESS && result.data.data) {
let rows = result.data.data.affectedRows;
if (rows) {
delete result.data;
return result;
} else {
return { code: RESULT_CODE_ERROR, msg: RESULT_MSG_ERROR };
}
}
return result;
}
/** /**
* 查询版本列表 * 查询版本列表
* @param query 查询参数 * @param query 查询参数
@@ -102,7 +175,7 @@ export function uploadNeSoftware(data: FormData) {
*/ */
export async function listNeVersion(query: Record<string, any>) { export async function listNeVersion(query: Record<string, any>) {
let totalSQL = 'select count(id) as total from ne_version '; let totalSQL = 'select count(id) as total from ne_version ';
let rowsSQL = ' select * from ne_version '; let rowsSQL = 'select * from ne_version ';
// 查询 // 查询
let querySQL = 'where 1=1'; let querySQL = 'where 1=1';

View File

@@ -22,6 +22,8 @@ export default {
editText: 'Edit', editText: 'Edit',
deleteText: 'Delete', deleteText: 'Delete',
downloadText: 'Download', downloadText: 'Download',
uploadText: 'Upload',
moreText: 'More',
searchBarText: 'Search bar', searchBarText: 'Search bar',
reloadText: 'Refresh', reloadText: 'Refresh',
sizeText: 'Density', sizeText: 'Density',
@@ -110,16 +112,32 @@ export default {
createAt: 'CreateAt', createAt: 'CreateAt',
}, },
softwareManage: { softwareManage: {
uploadBtn: '上传', sendBtn: 'Distribute',
downBtn: '下发', runBtn: 'Activation',
actBtn: '激活', backBtn: 'Back',
historyBtn: '网元版本历史', historyBtn: 'Distribution Record',
neTypePlease: '查询网元类型', neTypePlease: 'Select network element type',
neType: 'Type', neType: 'Type',
fileName: 'FileName', fileName: 'FileName',
version: 'Version', version: 'Version',
softwareLoadTime: '软件加载时间', versionPlease: 'Version number cannot be empty',
description: '功能描述', updateTime: 'Uploaded',
description: 'Description',
deleteTip: 'Are you sure to delete the data item with record number [{num}]?',
updateComment: 'software documentation',
updateCommentPlease: 'Please enter the software description',
updateFile: 'Software Files',
updateFilePlease: 'Please upload the updated software file',
verifyFile: 'Verify File',
selectFile: 'SELECT FILE',
sendTitle: 'Distribute software version',
sendContent: 'Are you sure to send the data item file with the number [{num}] to the corresponding network element?',
runTitle: 'Activate software version',
runContent: 'Confirm that the software version with the number [{num}] has been issued for activation on the corresponding network element?',
backTitle: 'Fallback software version',
backContent: 'Confirm that the software version with the number [{num}] has been issued for the corresponding network element rollback?',
neId: 'Corresponding network element',
neIdPlease: 'Please select the corresponding network element',
}, },
}, },
neUser: { neUser: {

View File

@@ -22,6 +22,8 @@ export default {
editText: '编辑', editText: '编辑',
deleteText: '删除', deleteText: '删除',
downloadText: '下载', downloadText: '下载',
uploadText: '上传',
moreText: '更多',
searchBarText: '搜索栏', searchBarText: '搜索栏',
reloadText: '刷新', reloadText: '刷新',
sizeText: '密度', sizeText: '密度',
@@ -110,16 +112,32 @@ export default {
createAt: '创建时间', createAt: '创建时间',
}, },
softwareManage: { softwareManage: {
uploadBtn: '上传', sendBtn: '下发',
downBtn: '下发', runBtn: '激活',
actBtn: '激活', backBtn: '回退',
historyBtn: '网元版本历史', historyBtn: '下发记录',
neTypePlease: '查询网元类型', neTypePlease: '选择网元类型',
neType: '网元类型', neType: '网元类型',
fileName: '文件名', fileName: '文件名',
version: '版本', version: '版本',
softwareLoadTime: '软件加载时间', versionPlease: '版本号不能为空',
updateTime: '上传时间',
description: '功能描述', description: '功能描述',
deleteTip: '确认删除记录编号为 【{num}】 的数据项?',
updateComment: '软件说明',
updateCommentPlease: '请输入软件说明',
updateFile: '软件文件',
updateFilePlease: '请上传更新软件文件',
verifyFile: '校验文件',
selectFile: '选择文件',
sendTitle: '下发软件版本',
sendContent: '确认下发编号为【{num}】的数据项文件到对应网元?',
runTitle: '激活软件版本',
runContent: '确认在对应网元激活已下发编号为【{num}】的软件版本?',
backTitle: '回退软件版本',
backContent: '确认在对应网元回退已下发编号为【{num}】的软件版本?',
neId: '对应网元',
neIdPlease: '请选择对应网元',
}, },
}, },
neUser: { neUser: {

View File

@@ -1,11 +1,11 @@
<script setup lang="ts"> <script setup lang="ts">
import { reactive, toRaw, watch, ref } from 'vue'; import { reactive, toRaw, watch, ref } from 'vue';
import { message } from 'ant-design-vue/lib';
import { SizeType } from 'ant-design-vue/lib/config-provider'; import { SizeType } from 'ant-design-vue/lib/config-provider';
import { ColumnsType } from 'ant-design-vue/lib/table'; import { ColumnsType } from 'ant-design-vue/lib/table';
import { listNeVersion } from '@/api/configManage/softwareManage'; import { listNeVersion } from '@/api/configManage/softwareManage';
import { parseDateToStr } from '@/utils/date-utils'; import { parseDateToStr } from '@/utils/date-utils';
import useDictStore from '@/store/modules/dict'; import useDictStore from '@/store/modules/dict';
import useNeInfoStore from '@/store/modules/neinfo';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import useI18n from '@/hooks/useI18n'; import useI18n from '@/hooks/useI18n';
const { t } = useI18n(); const { t } = useI18n();
@@ -159,11 +159,6 @@ let tablePagination = reactive({
}, },
}); });
/**表格多选 */
function fnTableSelectedRowKeys(keys: (string | number)[]) {
tableState.selectedRowKeys = keys;
}
/**查询角色未授权用户列表 */ /**查询角色未授权用户列表 */
function fnGetList() { function fnGetList() {
if (tableState.loading) return; if (tableState.loading) return;
@@ -175,10 +170,6 @@ function fnGetList() {
queryParams.endTime = queryRangePicker.value[1]; queryParams.endTime = queryRangePicker.value[1];
listNeVersion(toRaw(queryParams)).then(res => { listNeVersion(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
// 取消勾选
if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = [];
}
tablePagination.total = res.total; tablePagination.total = res.total;
tableState.data = res.rows; tableState.data = res.rows;
} }
@@ -186,20 +177,8 @@ function fnGetList() {
}); });
} }
/**弹框确认按钮事件 */
function fnModalOk() {
const userIds = tableState.selectedRowKeys;
if (userIds.length <= 0) {
message.error(`请选择要分配的用户`, 2);
return;
}
emit('update:visible', false);
emit('ok', userIds);
}
/**弹框取消按钮事件 */ /**弹框取消按钮事件 */
function fnModalCancel() { function fnModalCancel() {
emit('update:visible', false);
emit('cancel'); emit('cancel');
} }
@@ -231,8 +210,8 @@ watch(
:visible="props.visible" :visible="props.visible"
:keyboard="false" :keyboard="false"
:mask-closable="false" :mask-closable="false"
@ok="fnModalOk"
@cancel="fnModalCancel" @cancel="fnModalCancel"
:footer="null"
> >
<!-- 表格搜索栏 --> <!-- 表格搜索栏 -->
<a-form <a-form
@@ -243,13 +222,16 @@ watch(
> >
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item label="网元类型" name="neType"> <a-form-item
<a-input :label="t('views.configManage.softwareManage.neType')"
name="neType"
>
<a-auto-complete
v-model:value="queryParams.neType" v-model:value="queryParams.neType"
:options="useNeInfoStore().getNeSelectOtions"
allow-clear allow-clear
:maxlength="30" :placeholder="t('views.configManage.softwareManage.neTypePlease')"
placeholder="查询网元类型" />
></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
@@ -299,19 +281,9 @@ watch(
:loading="tableState.loading" :loading="tableState.loading"
:data-source="tableState.data" :data-source="tableState.data"
:size="tableState.size" :size="tableState.size"
:scroll="{ scrollToFirstRowOnChange: true, y: 400, x: true }" :scroll="{ y: 400, x: true }"
:pagination="tablePagination" :pagination="tablePagination"
:row-selection="{
type: 'checkbox',
selectedRowKeys: tableState.selectedRowKeys,
onChange: fnTableSelectedRowKeys,
}"
> >
<!-- <template #bodyCell="{ column, record }">
<template v-if="column.key === 'status'">
<DictTag :options="dict.sysNormalDisable" :value="record.status" />
</template>
</template> -->
</a-table> </a-table>
</a-modal> </a-modal>
</template> </template>

View File

@@ -15,6 +15,9 @@ import {
delNeSoftware, delNeSoftware,
downloadNeSoftware, downloadNeSoftware,
uploadNeSoftware, uploadNeSoftware,
sendNeSoftware,
runNeSoftware,
backNeSoftware,
} from '@/api/configManage/softwareManage'; } from '@/api/configManage/softwareManage';
import { saveAs } from 'file-saver'; import { saveAs } from 'file-saver';
import useI18n from '@/hooks/useI18n'; import useI18n from '@/hooks/useI18n';
@@ -95,7 +98,7 @@ let tableColumns: ColumnsType = [
align: 'center', align: 'center',
}, },
{ {
title: t('views.configManage.softwareManage.softwareLoadTime'), title: t('views.configManage.softwareManage.updateTime'),
dataIndex: 'updateTime', dataIndex: 'updateTime',
align: 'center', align: 'center',
customRender(opt) { customRender(opt) {
@@ -148,60 +151,156 @@ function fnTableSize({ key }: MenuInfo) {
tableState.size = key as SizeType; tableState.size = key as SizeType;
} }
/**信息文件下发 */ /**文件对话框对象信息状态类型 */
function fnSendFile(row: Record<string, any>) { type FileStateType = {
Modal.confirm({ /**是否下发或激活框 */
title: '提示', visible: boolean;
content: `确认下发编号为【${row.id}】的数据项文件BBBB?`, /**框类型 */
onOk() { visibleType: string;
const key = 'downloadNeSoftware'; /**标题 */
message.loading({ content: t('common.loading'), key }); title: string;
downloadNeSoftware(toRaw(row)).then(res => { /**提示内容 */
if (res.code === RESULT_CODE_SUCCESS) { content: string;
message.success({ /**网元参数 */
content: `已完成下载`, neOtions: Record<string, any>[];
key, /**表单数据 */
duration: 2, from: Record<string, any>;
}); /**确定按钮 loading */
saveAs(res.data, `user_${Date.now()}.xlsx`); confirmLoading: boolean;
} else { };
message.error({
content: `${res.msg}`, /**文件对话框对象信息状态类型 */
key, let fileModalState: FileStateType = reactive({
duration: 2, visible: false,
}); visibleType: 'send',
} title: '下发激活回退',
}); content: '',
}, neOtions: [],
}); from: {
neId: undefined,
},
confirmLoading: false,
});
/**对话框内表单属性和校验规则 */
const fileModalStateFrom = Form.useForm(
fileModalState.from,
reactive({
neId: [
{
required: true,
message: t('views.configManage.softwareManage.neIdPlease'),
},
],
})
);
/**
* 文件对话框弹出显示为 下发或激活
*/
function fnFileModalVisible(type: string | number, row: Record<string, any>) {
if (type === 'send') {
fileModalState.title = t('views.configManage.softwareManage.sendTitle');
fileModalState.content = t(
'views.configManage.softwareManage.sendContent',
{ num: row.id }
);
}
if (type === 'run') {
fileModalState.title = t('views.configManage.softwareManage.runTitle');
fileModalState.content = t('views.configManage.softwareManage.runContent', {
num: row.id,
});
}
if (type === 'back') {
fileModalState.title = t('views.configManage.softwareManage.backTitle');
fileModalState.content = t(
'views.configManage.softwareManage.backContent',
{ num: row.id }
);
}
if (!fileModalState.content) {
return;
}
fileModalState.from = Object.assign(fileModalState.from, row);
// 过滤网元类型
const neType = row.neType;
let arr: Record<string, any>[] = [];
for (const item of useNeInfoStore().getNeSelectOtions) {
if (item.value === neType && Array.isArray(item.children)) {
arr = item.children.concat();
if (arr.length > 0) {
fileModalState.from.neId = arr[0].neId;
}
break;
}
}
fileModalState.neOtions = arr;
fileModalState.visible = true;
fileModalState.visibleType = type as string;
} }
/**信息文件下发 */ /**
function fnRunFile(row: Record<string, any>) { * 文件对话框弹出确认执行函数
Modal.confirm({ * 进行表达规则校验
title: '提示', */
content: `确认激活 【${row.id}】 的数据项文件?`, function fnFileModalOk() {
onOk() { fileModalStateFrom
const key = 'downloadNeSoftware'; .validate()
message.loading({ content: t('common.loading'), key }); .then(e => {
downloadNeSoftware(toRaw(row)).then(res => { const from = toRaw(fileModalState.from);
if (res.code === RESULT_CODE_SUCCESS) { const type = fileModalState.visibleType;
message.success({ let fnType = null;
content: `已完成下载`, console.log(type, from);
key, if (type === 'send') {
duration: 2, fnType = sendNeSoftware(from);
}); }
saveAs(res.data, `user_${Date.now()}.xlsx`); if (type === 'run') {
} else { fnType = runNeSoftware(from);
message.error({ }
content: `${res.msg}`, if (type === 'back') {
key, fnType = backNeSoftware(from);
duration: 2, }
}); if (fnType === null) {
} return;
}); }
}, // 发送请求
}); fileModalState.confirmLoading = true;
const hide = message.loading({ content: t('common.loading') });
fnType
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: t('common.msgSuccess', { msg: fileModalState.title }),
duration: 3,
});
fnFileModalCancel();
} else {
message.error({
content: `${fileModalState.title} ${res.msg}`,
duration: 3,
});
}
})
.finally(() => {
hide();
fileModalState.confirmLoading = false;
});
})
.catch(e => {
message.error(t('common.errorFields', { num: e.errorFields.length }), 3);
});
}
/**
* 文件对话框弹出关闭执行函数
* 进行表达规则校验
*/
function fnFileModalCancel() {
fileModalState.visible = false;
fileModalState.visibleType = 'send';
fileModalStateFrom.resetFields();
} }
/**信息文件下载 */ /**信息文件下载 */
@@ -233,20 +332,20 @@ function fnDownloadFile(row: Record<string, any>) {
} }
/** /**
* 备份信息删除 * 信息删除
* @param row 记录编号ID * @param row 记录编号ID
*/ */
function fnRecordDelete(row: Record<string, any>) { function fnRecordDelete(row: Record<string, any>) {
Modal.confirm({ Modal.confirm({
title: '提示', title: t('commont.tipTitle'),
content: `确认删除记录编号为 【${row.id}】 的数据项?`, content: t('views.configManage.softwareManage.deleteTip', { num: row.id }),
onOk() { onOk() {
const key = 'delNeSoftware'; const key = 'delNeSoftware';
message.loading({ content: t('common.loading'), key }); message.loading({ content: t('common.loading'), key });
delNeSoftware(toRaw(row)).then(res => { delNeSoftware(toRaw(row)).then(res => {
if (res.code === 200) { if (res.code === RESULT_CODE_SUCCESS) {
message.success({ message.success({
content: `删除成功`, content: t('common.msgSuccess', { msg: row.id }),
key, key,
duration: 2, duration: 2,
}); });
@@ -300,7 +399,7 @@ let modalState: ModalStateType = reactive({
visibleByHistory: false, visibleByHistory: false,
title: '任务设置', title: '任务设置',
from: { from: {
neType: '', neType: undefined,
version: '', version: '',
comment: '', comment: '',
file: undefined, file: undefined,
@@ -316,7 +415,7 @@ let modalState: ModalStateType = reactive({
* @param noticeId 网元id, 不传为新增 * @param noticeId 网元id, 不传为新增
*/ */
function fnModalVisibleByEdit() { function fnModalVisibleByEdit() {
modalState.title = t('views.configManage.softwareManage.uploadBtn'); modalState.title = t('common.uploadText');
modalState.visibleByEdit = true; modalState.visibleByEdit = true;
} }
@@ -324,12 +423,33 @@ function fnModalVisibleByEdit() {
const modalStateFrom = Form.useForm( const modalStateFrom = Form.useForm(
modalState.from, modalState.from,
reactive({ reactive({
neType: [{ required: true, message: '网元类型不能为空' }], neType: [
version: [{ required: true, message: '版本号不能为空' }], {
comment: [{ required: true, message: '软件说明不能为空' }], required: true,
file: [{ required: true, message: '软件文件不能为空' }], message: t('views.configManage.softwareManage.neTypePlease'),
},
],
version: [
{
required: true,
message: t('views.configManage.softwareManage.versionPlease'),
},
],
comment: [
{
required: true,
message: t('views.configManage.softwareManage.updateCommentPlease'),
},
],
file: [
{
required: true,
message: t('views.configManage.softwareManage.updateFilePlease'),
},
],
}) })
); );
/** /**
* 对话框弹出确认执行函数 * 对话框弹出确认执行函数
* 进行表达规则校验 * 进行表达规则校验
@@ -379,6 +499,7 @@ function fnModalOk() {
*/ */
function fnModalCancel() { function fnModalCancel() {
modalState.visibleByEdit = false; modalState.visibleByEdit = false;
modalState.visibleByHistory = false;
modalStateFrom.resetFields(); modalStateFrom.resetFields();
} }
@@ -514,7 +635,7 @@ onMounted(() => {
<a-space :size="8" align="center"> <a-space :size="8" align="center">
<a-button type="primary" @click.prevent="fnModalVisibleByEdit()"> <a-button type="primary" @click.prevent="fnModalVisibleByEdit()">
<template #icon><UploadOutlined /></template> <template #icon><UploadOutlined /></template>
{{ t('views.configManage.softwareManage.uploadBtn') }} {{ t('common.uploadText') }}
</a-button> </a-button>
<a-button type="dashed" @click.prevent="fnModalVisibleByHistory()"> <a-button type="dashed" @click.prevent="fnModalVisibleByHistory()">
<template #icon><HistoryOutlined /></template> <template #icon><HistoryOutlined /></template>
@@ -582,22 +703,6 @@ onMounted(() => {
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'id'"> <template v-if="column.key === 'id'">
<a-space :size="8" align="center"> <a-space :size="8" align="center">
<a-tooltip>
<template #title>{{
t('views.configManage.softwareManage.downBtn')
}}</template>
<a-button type="link" @click.prevent="fnSendFile(record)">
<template #icon><SendOutlined /></template>
</a-button>
</a-tooltip>
<a-tooltip>
<template #title>{{
t('views.configManage.softwareManage.actBtn')
}}</template>
<a-button type="link" @click.prevent="fnRunFile(record)">
<template #icon><ThunderboltOutlined /></template>
</a-button>
</a-tooltip>
<a-tooltip> <a-tooltip>
<template #title>{{ t('common.downloadText') }}</template> <template #title>{{ t('common.downloadText') }}</template>
<a-button type="link" @click.prevent="fnDownloadFile(record)"> <a-button type="link" @click.prevent="fnDownloadFile(record)">
@@ -610,6 +715,35 @@ onMounted(() => {
<template #icon><DeleteOutlined /></template> <template #icon><DeleteOutlined /></template>
</a-button> </a-button>
</a-tooltip> </a-tooltip>
<a-tooltip>
<template #title>{{ t('common.moreText') }}</template>
<a-dropdown
placement="bottomRight"
:trigger="['hover', 'click']"
>
<a-button type="link">
<template #icon><EllipsisOutlined /> </template>
</a-button>
<template #overlay>
<a-menu
@click="({ key }) => fnFileModalVisible(key, record)"
>
<a-menu-item key="send">
<SendOutlined />
{{ t('views.configManage.softwareManage.sendBtn') }}
</a-menu-item>
<a-menu-item key="run">
<ThunderboltOutlined />
{{ t('views.configManage.softwareManage.runBtn') }}
</a-menu-item>
<a-menu-item key="back">
<UndoOutlined />
{{ t('views.configManage.softwareManage.backBtn') }}
</a-menu-item>
</a-menu>
</template>
</a-dropdown>
</a-tooltip>
</a-space> </a-space>
</template> </template>
</template> </template>
@@ -633,30 +767,30 @@ onMounted(() => {
:label-col="{ span: 4 }" :label-col="{ span: 4 }"
> >
<a-form-item <a-form-item
label="网元类型" :label="t('views.configManage.softwareManage.neType')"
name="neType" name="neType"
v-bind="modalStateFrom.validateInfos.neType" v-bind="modalStateFrom.validateInfos.neType"
> >
<a-select <a-select
v-model:value="modalState.from.neType" v-model:value="modalState.from.neType"
placeholder="网元类型"
:options="useNeInfoStore().getNeSelectOtions" :options="useNeInfoStore().getNeSelectOtions"
:placeholder="t('views.configManage.softwareManage.neTypePlease')"
> >
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
label="版本号" :label="t('views.configManage.softwareManage.version')"
name="version" name="version"
v-bind="modalStateFrom.validateInfos.version" v-bind="modalStateFrom.validateInfos.version"
> >
<a-input <a-input
v-model:value="modalState.from.version" v-model:value="modalState.from.version"
allow-clear allow-clear
placeholder="请输入版本号" :placeholder="t('views.configManage.softwareManage.versionPlease')"
></a-input> ></a-input>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
label="软件说明" :label="t('views.configManage.softwareManage.updateComment')"
name="comment" name="comment"
v-bind="modalStateFrom.validateInfos.comment" v-bind="modalStateFrom.validateInfos.comment"
> >
@@ -665,11 +799,13 @@ onMounted(() => {
:auto-size="{ minRows: 4, maxRows: 6 }" :auto-size="{ minRows: 4, maxRows: 6 }"
:maxlength="200" :maxlength="200"
:show-count="true" :show-count="true"
placeholder="请输入软件说明" :placeholder="
t('views.configManage.softwareManage.updateCommentPlease')
"
/> />
</a-form-item> </a-form-item>
<a-form-item <a-form-item
label="软件文件" :label="t('views.configManage.softwareManage.updateFile')"
name="file" name="file"
v-bind="modalStateFrom.validateInfos.file" v-bind="modalStateFrom.validateInfos.file"
> >
@@ -684,11 +820,14 @@ onMounted(() => {
:custom-request="fnUploadFile" :custom-request="fnUploadFile"
> >
<a-button type="default" :loading="modalState.confirmLoading"> <a-button type="default" :loading="modalState.confirmLoading">
选择文件 {{ t('views.configManage.softwareManage.selectFile') }}
</a-button> </a-button>
</a-upload> </a-upload>
</a-form-item> </a-form-item>
<a-form-item label="校验文件" name="cms"> <a-form-item
:label="t('views.configManage.softwareManage.verifyFile')"
name="cms"
>
<a-upload <a-upload
name="cms" name="cms"
v-model:file-list="modalState.from.cmsList" v-model:file-list="modalState.from.cmsList"
@@ -700,19 +839,51 @@ onMounted(() => {
:custom-request="fnUploadCms" :custom-request="fnUploadCms"
> >
<a-button type="default" :loading="modalState.confirmLoading"> <a-button type="default" :loading="modalState.confirmLoading">
选择文件 {{ t('views.configManage.softwareManage.selectFile') }}
</a-button> </a-button>
</a-upload> </a-upload>
</a-form-item> </a-form-item>
</a-form> </a-form>
</a-modal> </a-modal>
<!-- 分配用户选择框 --> <!-- 上传激活历史 -->
<SoftwareHistory <SoftwareHistory
title="查询网元版本信息" :title="t('views.configManage.softwareManage.historyBtn')"
v-model:visible="modalState.visibleByHistory" v-model:visible="modalState.visibleByHistory"
@ok="fnModalOk" @cancel="fnModalCancel"
/> />
<!-- 文件框 下发激活回退 -->
<a-modal
width="600px"
:keyboard="false"
:mask-closable="false"
:visible="fileModalState.visible"
:title="fileModalState.title"
:confirm-loading="fileModalState.confirmLoading"
@ok="fnFileModalOk"
@cancel="fnFileModalCancel"
>
<a-form name="fileModalState" layout="horizontal">
<a-form-item name="content">
<QuestionCircleOutlined class="file-model__icon" />
<span class="file-model__tip">
{{ fileModalState.content }}
</span>
</a-form-item>
<a-form-item
:label="t('views.configManage.softwareManage.neId')"
name="neId"
v-bind="fileModalStateFrom.validateInfos.neId"
>
<a-select
v-model:value="fileModalState.from.neId"
:options="fileModalState.neOtions"
:placeholder="t('views.configManage.softwareManage.neIdPlease')"
/>
</a-form-item>
</a-form>
</a-modal>
</PageContainer> </PageContainer>
</template> </template>
@@ -720,4 +891,19 @@ onMounted(() => {
.table :deep(.ant-pagination) { .table :deep(.ant-pagination) {
padding: 0 24px; padding: 0 24px;
} }
.file-model {
&__icon {
color: var(--ant-warning-color);
margin-right: 16px;
font-size: 22px;
}
&__tip {
overflow: hidden;
color: #000000d9;
font-weight: 500;
font-size: 16px;
line-height: 1.4;
}
}
</style> </style>