---新增备份管理中新增备份说明
This commit is contained in:
@@ -79,3 +79,17 @@ export async function downloadNeBackup(data: Record<string, any>) {
|
||||
timeout: 180_000,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改备份说明
|
||||
* @param menuId 网元ID
|
||||
* @returns object
|
||||
*/
|
||||
export async function updateBackInfo(data:Record<string,any>){
|
||||
return request({
|
||||
url: `/api/rest/databaseManagement/v1/omc_db/ne_backup?WHERE=id=${data.id}`,
|
||||
method: 'put',
|
||||
data: { data: { comment: data.backupInfo } },
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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',
|
||||
@@ -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<string, any>) {
|
||||
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.from.backupInfo = row.comment;
|
||||
modalState.from.id = row.id;
|
||||
modalState.title = '编辑备份文件';
|
||||
modalState.visibleByEdit = true;
|
||||
} else {
|
||||
message.error(`获取配置信息失败`, 2);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**对话框内表单属性和校验规则 */
|
||||
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(() => {
|
||||
<template #icon><DeleteOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip>
|
||||
<template #title>{{ t('common.editText') }}</template>
|
||||
<a-button
|
||||
type="link"
|
||||
@click.prevent="fnModalVisibleByEdit(record)"
|
||||
>
|
||||
<template #icon><FormOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
@@ -466,16 +475,16 @@ onMounted(() => {
|
||||
>
|
||||
<a-form name="modalStateFrom" layout="horizontal">
|
||||
<a-form-item
|
||||
label="自动备份任务备份时间(小时)"
|
||||
name="autoBackupTime"
|
||||
v-bind="modalStateFrom.validateInfos.autoBackupTime"
|
||||
label="备注说明"
|
||||
name="backupInfo"
|
||||
v-bind="modalStateFrom.validateInfos.backupInfo"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="modalState.from.autoBackupTime"
|
||||
allow-clear
|
||||
placeholder="备份任务执行单位是小时"
|
||||
>
|
||||
</a-input>
|
||||
<a-textarea
|
||||
v-model:value="modalState.from.backupInfo"
|
||||
:auto-size="{ minRows: 2, maxRows: 6 }"
|
||||
:maxlength="250"
|
||||
:show-count="true"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
|
||||
@@ -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: '',
|
||||
|
||||
Reference in New Issue
Block a user