feat: 开站网元安装步骤进度的显示
This commit is contained in:
334
src/views/system/quick-start/components/NeInfoConfigPara5G.vue
Normal file
334
src/views/system/quick-start/components/NeInfoConfigPara5G.vue
Normal file
@@ -0,0 +1,334 @@
|
||||
<script setup lang="ts">
|
||||
import { Modal, message } from 'ant-design-vue/lib';
|
||||
import { onMounted, reactive, toRaw } from 'vue';
|
||||
import { fnToStepName } from '../hooks/useStep';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
import { savePara5GFile } from '@/api/ne/neInfo';
|
||||
const { t } = useI18n();
|
||||
|
||||
/**对象信息信息状态类型 */
|
||||
type StateType = {
|
||||
/**保存选择同步到网元窗 */
|
||||
visible: boolean;
|
||||
/**网元选择 */
|
||||
neSelectOtions: any[];
|
||||
/**同步到网元 */
|
||||
sync: boolean;
|
||||
syncNe: string[];
|
||||
syncMsg: string;
|
||||
/**表单数据 */
|
||||
from: Record<string, any>;
|
||||
/**确定按钮 loading */
|
||||
confirmLoading: boolean;
|
||||
};
|
||||
|
||||
/**对象信息状态 */
|
||||
let state: StateType = reactive({
|
||||
visible: false,
|
||||
neSelectOtions: [],
|
||||
sync: false,
|
||||
syncNe: [],
|
||||
syncMsg: '',
|
||||
from: {
|
||||
basic: {
|
||||
dnn_data: 'internet',
|
||||
dnn_ims: 'ims',
|
||||
oamEnable: true,
|
||||
plmnId: {
|
||||
mcc: '001',
|
||||
mnc: '01',
|
||||
},
|
||||
snmpEnable: false,
|
||||
snssai: {
|
||||
sd: '000001',
|
||||
sst: '1',
|
||||
},
|
||||
tac: 4388,
|
||||
},
|
||||
external: {
|
||||
amfn2_ip: '192.168.8.120',
|
||||
ue_pool: '10.2.1.0/24',
|
||||
upfn3_gw: '192.168.1.1',
|
||||
upfn3_ip: '192.168.8.190/24',
|
||||
upfn6_gw: '192.168.1.1',
|
||||
upfn6_ip: '192.168.8.191/24',
|
||||
},
|
||||
},
|
||||
confirmLoading: false,
|
||||
});
|
||||
|
||||
/**保存信息 */
|
||||
function fnSave() {
|
||||
if (state.confirmLoading) return;
|
||||
state.confirmLoading = true;
|
||||
savePara5GFile({
|
||||
fileType: 'yaml',
|
||||
content: toRaw(state.from),
|
||||
syncNe: state.sync ? state.syncNe : [],
|
||||
})
|
||||
.then(res => {
|
||||
if (state.sync) {
|
||||
state.syncMsg = res.msg;
|
||||
} else {
|
||||
message.success('Save Success');
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
state.confirmLoading = false;
|
||||
});
|
||||
}
|
||||
|
||||
/**返回上一步 */
|
||||
function fnStepPrev() {
|
||||
Modal.confirm({
|
||||
title: t('common.tipTitle'),
|
||||
content: '确认要放弃当前变更返回上一步吗?',
|
||||
onOk() {
|
||||
fnToStepName('NeInfoConfig');
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**下一步操作 */
|
||||
function fnStepNext(stepName: 'NeInfoSoftwareInstall') {
|
||||
if (stepName === 'NeInfoSoftwareInstall') {
|
||||
Modal.confirm({
|
||||
title: t('common.tipTitle'),
|
||||
content: '确认要下一步进行各网元安装吗?',
|
||||
onOk() {
|
||||
fnToStepName('NeInfoSoftwareInstall');
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="ne">
|
||||
<a-form
|
||||
name="para5GFileeFrom"
|
||||
layout="horizontal"
|
||||
:label-col="{ span: 6 }"
|
||||
:label-wrap="true"
|
||||
>
|
||||
<a-divider orientation="left">Basic Data </a-divider>
|
||||
<a-row :gutter="16">
|
||||
<a-col :lg="24" :md="24" :xs="24">
|
||||
<a-form-item
|
||||
label="oamEnable"
|
||||
name="oamEnable"
|
||||
:label-col="{ span: 3 }"
|
||||
:label-wrap="true"
|
||||
>
|
||||
<a-switch
|
||||
:checked-children="t('common.switch.open')"
|
||||
:un-checked-children="t('common.switch.shut')"
|
||||
v-model:checked="state.from.basic.oamEnable"
|
||||
></a-switch>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="24" :md="24" :xs="24">
|
||||
<a-form-item
|
||||
label="snmpEnable"
|
||||
name="snmpEnable"
|
||||
:label-col="{ span: 3 }"
|
||||
:label-wrap="true"
|
||||
>
|
||||
<a-switch
|
||||
:checked-children="t('common.switch.open')"
|
||||
:un-checked-children="t('common.switch.shut')"
|
||||
v-model:checked="state.from.basic.snmpEnable"
|
||||
></a-switch>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item label="dnn_data" name="dnn_data">
|
||||
<a-input
|
||||
v-model:value="state.from.basic.dnn_data"
|
||||
allow-clear
|
||||
:placeholder="t('common.inputPlease')"
|
||||
:maxlength="50"
|
||||
>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item label="dnn_ims" name="dnn_ims">
|
||||
<a-input
|
||||
v-model:value="state.from.basic.dnn_ims"
|
||||
allow-clear
|
||||
:placeholder="t('common.inputPlease')"
|
||||
:maxlength="50"
|
||||
>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item label="snssai.sd" name="snssai.sd">
|
||||
<a-input
|
||||
v-model:value="state.from.basic.snssai.sd"
|
||||
allow-clear
|
||||
:placeholder="t('common.inputPlease')"
|
||||
:maxlength="50"
|
||||
>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item label="snssai.sst" name="snssai.sst">
|
||||
<a-input
|
||||
v-model:value="state.from.basic.snssai.sst"
|
||||
allow-clear
|
||||
:placeholder="t('common.inputPlease')"
|
||||
:maxlength="50"
|
||||
>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item label="plmnId.mcc" name="plmnId.mcc">
|
||||
<a-input
|
||||
v-model:value="state.from.basic.plmnId.mcc"
|
||||
allow-clear
|
||||
:placeholder="t('common.inputPlease')"
|
||||
:maxlength="50"
|
||||
>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item label="plmnId.mnc" name="plmnId.mnc">
|
||||
<a-input
|
||||
v-model:value="state.from.basic.plmnId.mnc"
|
||||
allow-clear
|
||||
:placeholder="t('common.inputPlease')"
|
||||
:maxlength="50"
|
||||
>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :lg="24" :md="24" :xs="24">
|
||||
<a-form-item
|
||||
label="tac"
|
||||
name="tac"
|
||||
:label-col="{ span: 3 }"
|
||||
:label-wrap="true"
|
||||
>
|
||||
<a-input-number
|
||||
v-model:value="state.from.basic.tac"
|
||||
:min="1"
|
||||
:max="65535"
|
||||
placeholder="1-65535"
|
||||
></a-input-number>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-divider orientation="left">External Data </a-divider>
|
||||
<a-row :gutter="16">
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item label="amfn2_ip" name="amfn2_ip">
|
||||
<a-input
|
||||
v-model:value="state.from.external.amfn2_ip"
|
||||
allow-clear
|
||||
:placeholder="t('common.inputPlease')"
|
||||
:maxlength="50"
|
||||
>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item label="ue_pool" name="ue_pool">
|
||||
<a-input
|
||||
v-model:value="state.from.external.ue_pool"
|
||||
allow-clear
|
||||
:placeholder="t('common.inputPlease')"
|
||||
:maxlength="50"
|
||||
>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item label="upfn3_gw" name="upfn3_gw">
|
||||
<a-input
|
||||
v-model:value="state.from.external.upfn3_gw"
|
||||
allow-clear
|
||||
:placeholder="t('common.inputPlease')"
|
||||
:maxlength="50"
|
||||
>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item label="upfn3_ip" name="upfn3_ip">
|
||||
<a-input
|
||||
v-model:value="state.from.external.upfn3_ip"
|
||||
allow-clear
|
||||
:placeholder="t('common.inputPlease')"
|
||||
:maxlength="50"
|
||||
>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item label="upfn6_gw" name="upfn6_gw">
|
||||
<a-input
|
||||
v-model:value="state.from.external.upfn6_gw"
|
||||
allow-clear
|
||||
:placeholder="t('common.inputPlease')"
|
||||
:maxlength="50"
|
||||
>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item label="upfn6_ip" name="upfn6_ip">
|
||||
<a-input
|
||||
v-model:value="state.from.external.upfn6_ip"
|
||||
allow-clear
|
||||
:placeholder="t('common.inputPlease')"
|
||||
:maxlength="50"
|
||||
>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
|
||||
<div class="ne-oper">
|
||||
<a-space direction="horizontal" :size="18">
|
||||
<a-button @click="fnStepPrev()"> 上一步 </a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
:loading="state.confirmLoading"
|
||||
@click="fnSave()"
|
||||
>
|
||||
保存信息
|
||||
</a-button>
|
||||
<a-button type="dashed" @click="fnStepNext('NeInfoSoftwareInstall')">
|
||||
下一步
|
||||
</a-button>
|
||||
</a-space>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.ne {
|
||||
padding-top: 12px;
|
||||
height: 78vh;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
|
||||
& > form {
|
||||
height: 90%;
|
||||
}
|
||||
&-oper {
|
||||
padding-top: 24px;
|
||||
text-align: end;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user