feat: 锁屏添加OMC升级等待

This commit is contained in:
TsMask
2024-01-17 17:29:31 +08:00
parent ce076ef7f8
commit e3a01b8998
5 changed files with 100 additions and 43 deletions

View File

@@ -18,13 +18,12 @@ import {
importFile,
listServerFile,
} from '@/api/configManage/neManage';
import { parseDateToStr } from '@/utils/date-utils';
import { updateNeConfigReload } from '@/api/configManage/configParam';
import useI18n from '@/hooks/useI18n';
import { FileType } from 'ant-design-vue/lib/upload/interface';
import { UploadRequestOption } from 'ant-design-vue/lib/vc-upload/interface';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import useNeInfoStore from '@/store/modules/neinfo';
import { updateNeConfigReload } from '@/api/configManage/configParam';
const { t } = useI18n();
/**表格所需option */
@@ -537,25 +536,26 @@ function fnRecordRestart(row: Record<string, any>) {
oper: t('views.configManage.neManage.restart'),
}),
onOk() {
const key = 'restartNf';
message.loading({ content: t('common.loading'), key });
restartNf(row).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: t('common.msgSuccess', {
msg: t('views.configManage.neManage.restart'),
}),
key,
duration: 2,
});
} else {
message.error({
content: `${res.msg}`,
key: key,
duration: 2,
});
}
});
const hide = message.loading(t('common.loading'), 0);
restartNf(row)
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: t('common.msgSuccess', {
msg: t('views.configManage.neManage.restart'),
}),
duration: 3,
});
} else {
message.error({
content: `${res.msg}`,
duration: 3,
});
}
})
.finally(() => {
hide();
});
},
});
}
@@ -713,7 +713,11 @@ function fnGetList(pageNum?: number) {
}
tablePagination.total = res.total;
tableState.data = res.rows;
if (tablePagination.total <=(queryParams.pageNum - 1) * tablePagination.pageSize &&queryParams.pageNum !== 1) {
if (
tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize &&
queryParams.pageNum !== 1
) {
tableState.loading = false;
fnGetList(queryParams.pageNum - 1);
}

View File

@@ -23,6 +23,8 @@ import useI18n from '@/hooks/useI18n';
import useNeInfoStore from '@/store/modules/neinfo';
import { FileType } from 'ant-design-vue/lib/upload/interface';
import { UploadRequestOption } from 'ant-design-vue/lib/vc-upload/interface';
import useLockedStore from '@/store/modules/locked';
const lockedStore = useLockedStore();
const { t } = useI18n();
/**查询参数 */
@@ -292,6 +294,20 @@ function fnFileModalOk() {
const hide = message.loading(t('common.loading'), 0);
fnType
.then(res => {
// OMC自升级
if (type === 'run' && from.neType === 'OMC') {
if (res.code === RESULT_CODE_SUCCESS) {
fnFileModalCancel();
lockedStore.fnLock('reload', true);
} else {
message.error({
content: `${fileModalState.title} ${res.msg}`,
duration: 3,
});
}
return;
}
// 其他网元
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: t('common.msgSuccess', { msg: fileModalState.title }),
@@ -403,8 +419,12 @@ function fnGetList(pageNum?: number) {
}
tablePagination.total = res.total;
tableState.data = res.rows;
if (tablePagination.total <=(queryParams.pageNum - 1) * tablePagination.pageSize &&queryParams.pageNum !== 1) {
debugger
if (
tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize &&
queryParams.pageNum !== 1
) {
debugger;
tableState.loading = false;
fnGetList(queryParams.pageNum - 1);