From 97bb4db1eb32a2deaf5b060d8592af359350ea37 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Tue, 30 Apr 2024 20:07:21 +0800 Subject: [PATCH] =?UTF-8?q?pref:=20=E9=87=8D=E6=9E=84=E7=BD=91=E5=85=83?= =?UTF-8?q?=E5=AE=89=E8=A3=85=E9=A1=B5=E9=9D=A2=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ne/neQuickSetup/hooks/useStep.ts | 134 ++++++++++++++------ src/views/ne/neQuickSetup/index.vue | 139 ++++----------------- 2 files changed, 120 insertions(+), 153 deletions(-) diff --git a/src/views/ne/neQuickSetup/hooks/useStep.ts b/src/views/ne/neQuickSetup/hooks/useStep.ts index 8316afdf..4d6a7f12 100644 --- a/src/views/ne/neQuickSetup/hooks/useStep.ts +++ b/src/views/ne/neQuickSetup/hooks/useStep.ts @@ -2,65 +2,123 @@ import { reactive } from 'vue'; /**步骤信息状态类型 */ type StepStateType = { - /**当前选中 */ + /**步骤名称 */ + stepName: string; + /**安装网元步骤信息 */ + steps: any[]; + /**安装网元步骤当前选中 */ current: number; - /**步骤项 */ - steps: { - title: string; - description: string; - }[]; - /**步骤下一步 */ - stepNext: boolean; - /**步骤信息状态 */ - states: any[]; + /**连接主机 */ + neHost: Record; + /**网元信息 */ + neInfo: Record; }; /**步骤信息状态 */ export const stepState: StepStateType = reactive({ - current: 0, + stepName: 'Start', steps: [ { - title: '环境检查', - description: '服务器检查,触发免密脚本', + title: '服务器环境', + description: '服务端与网元服务', }, { - title: '网元信息', - description: '记录下所安装网元基础信息', + title: '配置网元信息', + description: '网元信息设置', }, { - title: '网元安装', - description: '安装包上传执行安装启动服务等待10秒停止服务', + title: '网元软件安装', + description: '软件安装到服务端', }, { - title: '网元配置', - description: '修改网元的配置文件', - }, - { - title: '网元激活', - description: '获取激活码和上传授权文件,启动验证激活码', - }, - { - title: '完成安装', - description: '获取网元服务状态', + title: '网元授权激活', + description: '网元服务授权激活', }, ], - stepNext: false, - states: [], + current: 0, + neHost: {}, + neInfo: {}, }); /**步骤信息状态复位 */ export function fnRestStepState() { + stepState.stepName = 'Start'; stepState.current = 0; - stepState.stepNext = false; - stepState.states = []; + stepState.neHost = {}; + stepState.neInfo = {}; } -export function fnStepNext() { - stepState.current++; - stepState.stepNext = false; +/**跳转步骤组件 */ +export function fnToStepName(stepName: string) { + stepState.current = [ + 'Start', + 'NeInfoConfig', + 'NeInfoSoftwareInstall', + 'NeInfoSoftwareLicense', + ].indexOf(stepName); + + stepState.stepName = stepName; } -export function fnStepPrev() { - stepState.current--; - stepState.stepNext = true; -} +// import { reactive } from 'vue'; + +// /**步骤信息状态类型 */ +// type StepStateType = { +// /**当前选中 */ +// current: number; +// /**步骤项 */ +// steps: { +// title: string; +// description: string; +// }[]; +// /**步骤下一步 */ +// stepNext: boolean; +// /**步骤信息状态 */ +// states: any[]; +// }; + +// /**步骤信息状态 */ +// export const stepState: StepStateType = reactive({ +// current: 0, +// steps: [ +// { +// title: '网元信息', +// description: '网元基础信息', +// }, +// { +// title: '网元安装', +// description: '执行安装启动服务等待10秒停止服务', +// }, +// { +// title: '网元配置', +// description: '修改网元的配置文件', +// }, +// { +// title: '网元激活', +// description: '获取激活码和上传授权文件', +// }, +// { +// title: '完成安装', +// description: '获取网元服务状态', +// }, +// ], +// stepNext: false, +// states: [], +// }); + +// /**步骤信息状态复位 */ +// export function fnRestStepState() { +// stepState.current = 0; +// stepState.stepNext = false; +// stepState.states = []; +// } + +// export function fnStepNext() { +// stepState.current++; +// stepState.stepNext = false; +// } + +// export function fnStepPrev() { +// stepState.current--; +// stepState.stepNext = true; +// } diff --git a/src/views/ne/neQuickSetup/index.vue b/src/views/ne/neQuickSetup/index.vue index 232d34d8..023fbdea 100644 --- a/src/views/ne/neQuickSetup/index.vue +++ b/src/views/ne/neQuickSetup/index.vue @@ -1,134 +1,49 @@ - +