---新增备份管理中新增备份说明
This commit is contained in:
@@ -79,3 +79,17 @@ export async function downloadNeBackup(data: Record<string, any>) {
|
|||||||
timeout: 180_000,
|
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';
|
} from '@/api/configManage/backupManage';
|
||||||
import { saveAs } from 'file-saver';
|
import { saveAs } from 'file-saver';
|
||||||
import useI18n from '@/hooks/useI18n';
|
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';
|
import useNeInfoStore from '@/store/modules/neinfo';
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
@@ -89,6 +90,12 @@ let tableColumns: ColumnsType = [
|
|||||||
align: 'center',
|
align: 'center',
|
||||||
width: 3,
|
width: 3,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '备份说明',
|
||||||
|
dataIndex: 'comment',
|
||||||
|
align: 'center',
|
||||||
|
width: 3,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: t('views.configManage.backupManage.createAt'),
|
title: t('views.configManage.backupManage.createAt'),
|
||||||
dataIndex: 'createTime',
|
dataIndex: 'createTime',
|
||||||
@@ -237,8 +244,8 @@ let modalState: ModalStateType = reactive({
|
|||||||
visibleByEdit: false,
|
visibleByEdit: false,
|
||||||
title: '任务设置',
|
title: '任务设置',
|
||||||
from: {
|
from: {
|
||||||
configTag: '',
|
id:0,
|
||||||
autoBackupTime: '',
|
backupInfo: '',
|
||||||
},
|
},
|
||||||
confirmLoading: false,
|
confirmLoading: false,
|
||||||
});
|
});
|
||||||
@@ -247,29 +254,19 @@ let modalState: ModalStateType = reactive({
|
|||||||
* 对话框弹出显示为 新增或者修改
|
* 对话框弹出显示为 新增或者修改
|
||||||
* @param noticeId 网元id, 不传为新增
|
* @param noticeId 网元id, 不传为新增
|
||||||
*/
|
*/
|
||||||
function fnModalVisibleByEdit() {
|
function fnModalVisibleByEdit(row: Record<string, any>) {
|
||||||
if (modalState.confirmLoading) return;
|
if (modalState.confirmLoading) return;
|
||||||
const hide = message.loading('正在打开...', 0);
|
modalState.from.backupInfo = row.comment;
|
||||||
modalState.confirmLoading = true;
|
modalState.from.id = row.id;
|
||||||
getConfigInfo('NfConfigSet').then(res => {
|
modalState.title = '编辑备份文件';
|
||||||
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;
|
modalState.visibleByEdit = true;
|
||||||
} else {
|
|
||||||
message.error(`获取配置信息失败`, 2);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**对话框内表单属性和校验规则 */
|
/**对话框内表单属性和校验规则 */
|
||||||
const modalStateFrom = Form.useForm(
|
const modalStateFrom = Form.useForm(
|
||||||
modalState.from,
|
modalState.from,
|
||||||
reactive({
|
reactive({
|
||||||
autoBackupTime: [{ required: true, message: '备份时间不能为空' }],
|
backupInfo: [{ required: true, message: '备份说明不能为空' }],
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
/**
|
/**
|
||||||
@@ -283,7 +280,7 @@ function fnModalOk() {
|
|||||||
modalState.confirmLoading = true;
|
modalState.confirmLoading = true;
|
||||||
const from = toRaw(modalState.from);
|
const from = toRaw(modalState.from);
|
||||||
const hide = message.loading({ content: t('common.loading') });
|
const hide = message.loading({ content: t('common.loading') });
|
||||||
updateConfig(from.configTag, { value: from.autoBackupTime })
|
updateBackInfo(from)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.code === RESULT_CODE_SUCCESS) {
|
if (res.code === RESULT_CODE_SUCCESS) {
|
||||||
message.success({
|
message.success({
|
||||||
@@ -292,11 +289,14 @@ function fnModalOk() {
|
|||||||
});
|
});
|
||||||
modalState.visibleByEdit = false;
|
modalState.visibleByEdit = false;
|
||||||
modalStateFrom.resetFields();
|
modalStateFrom.resetFields();
|
||||||
|
fnGetList();
|
||||||
} else {
|
} else {
|
||||||
message.error({
|
message.error({
|
||||||
content: `${res.msg}`,
|
content: `${res.msg}`,
|
||||||
duration: 3,
|
duration: 3,
|
||||||
});
|
});
|
||||||
|
fnGetList();
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
@@ -447,6 +447,15 @@ onMounted(() => {
|
|||||||
<template #icon><DeleteOutlined /></template>
|
<template #icon><DeleteOutlined /></template>
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-tooltip>
|
</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>
|
</a-space>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
@@ -466,16 +475,16 @@ onMounted(() => {
|
|||||||
>
|
>
|
||||||
<a-form name="modalStateFrom" layout="horizontal">
|
<a-form name="modalStateFrom" layout="horizontal">
|
||||||
<a-form-item
|
<a-form-item
|
||||||
label="自动备份任务备份时间(小时)"
|
label="备注说明"
|
||||||
name="autoBackupTime"
|
name="backupInfo"
|
||||||
v-bind="modalStateFrom.validateInfos.autoBackupTime"
|
v-bind="modalStateFrom.validateInfos.backupInfo"
|
||||||
>
|
>
|
||||||
<a-input
|
<a-textarea
|
||||||
v-model:value="modalState.from.autoBackupTime"
|
v-model:value="modalState.from.backupInfo"
|
||||||
allow-clear
|
:auto-size="{ minRows: 2, maxRows: 6 }"
|
||||||
placeholder="备份任务执行单位是小时"
|
:maxlength="250"
|
||||||
>
|
:show-count="true"
|
||||||
</a-input>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-form>
|
</a-form>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ let tableState: TabeStateType = reactive({
|
|||||||
/**表格状态 */
|
/**表格状态 */
|
||||||
let nfInfo: any = reactive({
|
let nfInfo: any = reactive({
|
||||||
obj: 'OMC',
|
obj: 'OMC',
|
||||||
version: 'V2.7.1',
|
version: '2.2311.7',
|
||||||
status: '正常',
|
status: '正常',
|
||||||
number: '',
|
number: '',
|
||||||
outTimeDate: '',
|
outTimeDate: '',
|
||||||
|
|||||||
Reference in New Issue
Block a user