feat: 开站网元安装步骤进度的显示

This commit is contained in:
TsMask
2024-04-28 10:23:14 +08:00
parent efb98ac577
commit 957868cc27
10 changed files with 566 additions and 188 deletions

View File

@@ -1,15 +1,71 @@
<script setup lang="ts">
import { guideDone } from '@/api';
import { stepState, fnStepNext, fnStepPrev } from '../hooks/useStep';
import { stepState, fnToStepName } from '../hooks/useStep';
import { message, Form, Modal } from 'ant-design-vue/lib';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { removeToken } from '@/plugins/auth-token';
import { useRouter } from 'vue-router';
import useAppStore from '@/store/modules/app';
import useI18n from '@/hooks/useI18n';
import { onMounted, ref } from 'vue';
const { t } = useI18n();
const router = useRouter();
// 信息列表
const infoList = ref<Record<string, any>[]>([]);
/**获取列表 */
function fnGetList() {
if (!stepState.setupNE) {
infoList.value.push({
type: 'error',
title: '未进行安装配置网元',
description: '系统将会默认初始网元信息,可自行修改信息',
});
return;
}
infoList.value.push({
type: 'warning',
title: '已经进行网元安装配置',
description: '如有部分异常网元请进入系统后可自行配置',
});
// listAllNeInfo({
// bandStatus: true,
// }).then(res => {
// if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
// for (const item of res.data) {
// const online = item.serverState.online;
// let description = 'Service Config Error';
// if (online) {
// description = `The License SN:${item.serverState.sn} and Expire:${item.serverState.expire}`;
// }
// infoList.value.push({
// type: online ? 'success' : 'warning',
// title: `${item.neType} ${item.neId}`,
// description,
// });
// }
// }
// });
}
/**返回上一步 */
function fnStepPrev() {
Modal.confirm({
title: t('common.tipTitle'),
content: '确认要返回上一步吗?',
onOk() {
let stepName = 'NeInfoSoftwareLicense';
if (!stepState.setupNE) {
stepName = 'SystemConfig';
}
fnToStepName(stepName);
},
});
}
/**引导完成 */
function fnGuideDone() {
guideDone()
@@ -23,17 +79,55 @@ function fnGuideDone() {
router.push({ name: 'Login' });
});
}
onMounted(() => {
fnGetList();
});
</script>
<template>
<div>
<div>结束</div>
<p>安装网元会有网元信息-授权有效期</p>
=======提示
<p>未配置相关网元请进入系统后根据情况单独安装网元</p>
<a-result
status="success"
title="完成配置"
sub-title="请进入系统后根据情况进行更多相关配置"
>
<template #extra>
<a-space direction="vertical" style="width: 40%">
<a-button block type="primary" @click="fnGuideDone()">
开始使用
</a-button>
<a-button block type="default" @click="fnStepPrev()">
返回上一步
</a-button>
</a-space>
</template>
<a-button type="primary" @click="fnGuideDone()"> 开始使用 </a-button>
</div>
<div class="result-content">
<a-spin
tip="Loading..."
style="width: 100%"
:spinning="infoList.length == 0"
>
<a-alert
v-for="s in infoList"
:key="s.title"
:message="s.title"
:description="s.description"
:type="s.type"
show-icon
/>
</a-spin>
</div>
</a-result>
</template>
<style lang="less" scoped></style>
<style lang="less" scoped>
.result-content {
max-height: 42vh;
overflow-y: auto;
overflow-x: hidden;
}
.ant-alert {
margin-bottom: 16px;
}
</style>