From 8165bacace3786583c1654997bec04988a287a88 Mon Sep 17 00:00:00 2001 From: lai <371757574@qq.com> Date: Mon, 6 Nov 2023 16:49:23 +0800 Subject: [PATCH] =?UTF-8?q?---=E6=96=B0=E5=A2=9E=E5=A4=87=E4=BB=BD?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E4=B8=AD=E6=96=B0=E5=A2=9E=E5=A4=87=E4=BB=BD?= =?UTF-8?q?=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/configManage/backupManage.ts | 14 ++++ src/views/configManage/backupManage/index.vue | 69 +++++++++++-------- src/views/index.vue | 2 +- 3 files changed, 54 insertions(+), 31 deletions(-) diff --git a/src/api/configManage/backupManage.ts b/src/api/configManage/backupManage.ts index 2f24563e..b172d64f 100644 --- a/src/api/configManage/backupManage.ts +++ b/src/api/configManage/backupManage.ts @@ -79,3 +79,17 @@ export async function downloadNeBackup(data: Record) { timeout: 180_000, }); } + + +/** + * 修改备份说明 + * @param menuId 网元ID + * @returns object + */ +export async function updateBackInfo(data:Record){ + return request({ + url: `/api/rest/databaseManagement/v1/omc_db/ne_backup?WHERE=id=${data.id}`, + method: 'put', + data: { data: { comment: data.backupInfo } }, + }); +} diff --git a/src/views/configManage/backupManage/index.vue b/src/views/configManage/backupManage/index.vue index 9e241580..027b989b 100644 --- a/src/views/configManage/backupManage/index.vue +++ b/src/views/configManage/backupManage/index.vue @@ -14,7 +14,8 @@ import { } from '@/api/configManage/backupManage'; import { saveAs } from 'file-saver'; import useI18n from '@/hooks/useI18n'; -import { getConfigInfo, updateConfig } from '@/api/configManage/config'; +import {updateConfig } from '@/api/configManage/config'; +import {updateBackInfo } from '@/api/configManage/backupManage'; import useNeInfoStore from '@/store/modules/neinfo'; const { t } = useI18n(); @@ -89,6 +90,12 @@ let tableColumns: ColumnsType = [ align: 'center', width: 3, }, + { + title: '备份说明', + dataIndex: 'comment', + align: 'center', + width: 3, + }, { title: t('views.configManage.backupManage.createAt'), dataIndex: 'createTime', @@ -204,7 +211,7 @@ function fnRecordDelete(row: Record) { function fnGetList(pageNum?: number) { if (tableState.loading) return; tableState.loading = true; - if(pageNum){ + if (pageNum) { queryParams.pageNum = pageNum; } listNeBackup(toRaw(queryParams)).then(res => { @@ -237,8 +244,8 @@ let modalState: ModalStateType = reactive({ visibleByEdit: false, title: '任务设置', from: { - configTag: '', - autoBackupTime: '', + id:0, + backupInfo: '', }, confirmLoading: false, }); @@ -247,29 +254,19 @@ let modalState: ModalStateType = reactive({ * 对话框弹出显示为 新增或者修改 * @param noticeId 网元id, 不传为新增 */ -function fnModalVisibleByEdit() { +function fnModalVisibleByEdit(row: Record) { if (modalState.confirmLoading) return; - const hide = message.loading('正在打开...', 0); - modalState.confirmLoading = true; - getConfigInfo('NfConfigSet').then(res => { - modalState.confirmLoading = false; - hide(); - if (res.code === RESULT_CODE_SUCCESS) { - modalState.from.configTag = res.data.configTag; - modalState.from.autoBackupTime = res.data.value; - modalState.title = t('views.configManage.backupManage.setBackupTask'); - modalState.visibleByEdit = true; - } else { - message.error(`获取配置信息失败`, 2); - } - }); + modalState.from.backupInfo = row.comment; + modalState.from.id = row.id; + modalState.title = '编辑备份文件'; + modalState.visibleByEdit = true; } /**对话框内表单属性和校验规则 */ const modalStateFrom = Form.useForm( modalState.from, reactive({ - autoBackupTime: [{ required: true, message: '备份时间不能为空' }], + backupInfo: [{ required: true, message: '备份说明不能为空' }], }) ); /** @@ -283,7 +280,7 @@ function fnModalOk() { modalState.confirmLoading = true; const from = toRaw(modalState.from); const hide = message.loading({ content: t('common.loading') }); - updateConfig(from.configTag, { value: from.autoBackupTime }) + updateBackInfo(from) .then(res => { if (res.code === RESULT_CODE_SUCCESS) { message.success({ @@ -292,11 +289,14 @@ function fnModalOk() { }); modalState.visibleByEdit = false; modalStateFrom.resetFields(); + fnGetList(); } else { message.error({ content: `${res.msg}`, duration: 3, }); + fnGetList(); + } }) .finally(() => { @@ -447,6 +447,15 @@ onMounted(() => { + + + + + + @@ -466,16 +475,16 @@ onMounted(() => { > - - + diff --git a/src/views/index.vue b/src/views/index.vue index e5205209..4fb21421 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -83,7 +83,7 @@ let tableState: TabeStateType = reactive({ /**表格状态 */ let nfInfo: any = reactive({ obj: 'OMC', - version: 'V2.7.1', + version: '2.2311.7', status: '正常', number: '', outTimeDate: '',