perf: 网元公共参数合并到网元快速安装,移除相关多语言翻译
This commit is contained in:
@@ -1,34 +1,27 @@
|
||||
<script lang="ts" setup>
|
||||
import { PageContainer } from 'antdv-pro-layout';
|
||||
import { defineAsyncComponent, watch, shallowRef, onMounted } from 'vue';
|
||||
import { stepState, fnRestStepState } from './hooks/useStep';
|
||||
import Para5GForm from './components/Para5GForm.vue';
|
||||
import { stepState, useStep } from './hooks/useStep';
|
||||
import { usePara5G } from './hooks/usePara5G';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
import { ref } from 'vue';
|
||||
const { t } = useI18n();
|
||||
|
||||
// 异步加载组件
|
||||
const Start = defineAsyncComponent(() => import('./components/Start.vue'));
|
||||
const { currentComponent } = useStep(t);
|
||||
const { state, fnReloadData, fnSaveData } = usePara5G(t);
|
||||
|
||||
// 当前组件
|
||||
const currentComponent = shallowRef(Start);
|
||||
|
||||
watch(
|
||||
() => stepState.stepName,
|
||||
v => {
|
||||
const loadComponent = defineAsyncComponent(
|
||||
() => import(`./components/${v}.vue`)
|
||||
);
|
||||
currentComponent.value = loadComponent;
|
||||
}
|
||||
);
|
||||
|
||||
onMounted(() => {
|
||||
fnRestStepState(t);
|
||||
});
|
||||
const installNE = ref(false);
|
||||
/**公共参数保存前下一步进行网元安装 */
|
||||
function fnNext() {
|
||||
fnSaveData().then(() => {
|
||||
installNE.value = !installNE.value;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<PageContainer>
|
||||
<a-card :bordered="false">
|
||||
<a-card :bordered="false" v-if="installNE">
|
||||
<!-- 插槽-卡片左侧 -->
|
||||
<template #title>
|
||||
<!-- 步骤进度 -->
|
||||
@@ -46,6 +39,30 @@ onMounted(() => {
|
||||
<!-- 步骤页面 -->
|
||||
<component :is="currentComponent" />
|
||||
</a-card>
|
||||
<a-card :bordered="false" v-else>
|
||||
<!-- 公共参数表单 -->
|
||||
<Para5GForm v-model:data="state.from" :ne="state.hasNE"></Para5GForm>
|
||||
|
||||
<div style="padding: 24px 12px 0; text-align: end">
|
||||
<a-space :size="8" align="center">
|
||||
<a-button
|
||||
type="primary"
|
||||
:loading="state.confirmLoading"
|
||||
@click="fnNext()"
|
||||
>
|
||||
{{ t('views.ne.neQuickSetup.stepNext') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
type="default"
|
||||
:disabled="state.confirmLoading"
|
||||
@click.prevent="fnReloadData()"
|
||||
>
|
||||
<template #icon><ReloadOutlined /></template>
|
||||
{{ t('views.ne.neQuickSetup.reloadPara5G') }}
|
||||
</a-button>
|
||||
</a-space>
|
||||
</div>
|
||||
</a-card>
|
||||
</PageContainer>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user