From f57b2bccfbf56c9342f8bd9c0e9bbeecb023e5cd Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Tue, 17 Oct 2023 16:38:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=BD=91=E5=85=83=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E6=9B=B4=E5=A4=9A=E6=93=8D=E4=BD=9C=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/configManage/neManage/index.vue | 219 +++++++++++++--------- 1 file changed, 129 insertions(+), 90 deletions(-) diff --git a/src/views/configManage/neManage/index.vue b/src/views/configManage/neManage/index.vue index a463db14..de397a19 100644 --- a/src/views/configManage/neManage/index.vue +++ b/src/views/configManage/neManage/index.vue @@ -334,102 +334,143 @@ function fnRecordDelete(row: Record) { } /** - * 文件对话框弹出显示为 导出导入重启停止启动 + * 网元导出配置 + * @param row 网元编号ID */ -function fnFileModalVisible(type: string | number, row: Record) { +function fnRecordExport(row: Record) { + Modal.confirm({ + title: '提示', + content: `确认导出网元编号为 【${row.id}】 的配置信息?`, + onOk() { + const key = 'exportSet'; + message.loading({ content: '请稍等...', key }); + exportSet(row).then(res => { + if (res.code === RESULT_CODE_SUCCESS) { + message.success({ + content: `导出成功`, + key, + duration: 2, + }); + } else { + message.error({ + content: `${res.msg}`, + key: key, + duration: 2, + }); + } + }); + }, + }); +} + +/** + * 网元重启 + * @param row 网元编号ID + */ +function fnRecordRestart(row: Record) { + Modal.confirm({ + title: '提示', + content: `确认重启网元编号为 【${row.id}】 的网元?`, + onOk() { + const key = 'restartNf'; + message.loading({ content: '请稍等...', key }); + restartNf(row).then(res => { + if (res.code === RESULT_CODE_SUCCESS) { + message.success({ + content: `重启执行成功`, + key, + duration: 2, + }); + } else { + message.error({ + content: `${res.msg}`, + key: key, + duration: 2, + }); + } + }); + }, + }); +} + +/** + * 网元启动 + * @param row 网元编号ID + */ +function fnRecordStart(row: Record) { + Modal.confirm({ + title: '提示', + content: `确认启动网元编号为 【${row.id}】 的网元?`, + onOk() { + const key = 'startNf'; + message.loading({ content: '请稍等...', key }); + startNf(row).then(res => { + if (res.code === RESULT_CODE_SUCCESS) { + message.success({ + content: `启动执行成功`, + key, + duration: 2, + }); + } else { + message.error({ + content: `${res.msg}`, + key: key, + duration: 2, + }); + } + }); + }, + }); +} + +/** + * 网元停止 + * @param row 网元编号ID + */ +function fnRecordStop(row: Record) { + Modal.confirm({ + title: '提示', + content: `确认停止网元编号为 【${row.id}】 的网元?`, + onOk() { + const key = 'stopNf'; + message.loading({ content: '请稍等...', key }); + stopNf(row).then(res => { + if (res.code === RESULT_CODE_SUCCESS) { + message.success({ + content: `停止执行成功`, + key, + duration: 2, + }); + } else { + message.error({ + content: `${res.msg}`, + key: key, + duration: 2, + }); + } + }); + }, + }); +} + +/** + * 记录多项选择 + */ +function fnRecordMore(type: string | number, row: Record) { if (type === 'export') { - const key = 'export'; - console.log(toRaw(row)); - message.loading({ content: '请稍等...', key }); - tableState.loading = true; - exportSet(row).then(res => { - if (res.code === RESULT_CODE_SUCCESS) { - message.success({ - content: `导出成功`, - key, - duration: 2, - }); - // fnGetList(); - } else { - message.error({ - content: `${res.msg}`, - key: key, - duration: 2, - }); - } - tableState.loading = false; - }); + fnRecordExport(row); } if (type === 'start') { - const key = 'start'; - console.log(toRaw(row)); - message.loading({ content: '请稍等...', key }); - tableState.loading = true; - startNf(row).then(res => { - if (res.code === RESULT_CODE_SUCCESS) { - message.success({ - content: `启动成功`, - key, - duration: 2, - }); - // fnGetList(); - } else { - message.error({ - content: `${res.msg}`, - key: key, - duration: 2, - }); - } - tableState.loading = false; - }); + fnRecordStart(row); } if (type === 'restart') { - const key = 'restart'; - console.log(toRaw(row)); - message.loading({ content: '请稍等...', key }); - tableState.loading = true; - restartNf(row).then(res => { - if (res.code === RESULT_CODE_SUCCESS) { - message.success({ - content: `重启成功`, - key, - duration: 2, - }); - // fnGetList(); - } else { - message.error({ - content: `${res.msg}`, - key: key, - duration: 2, - }); - } - tableState.loading = false; - }); + fnRecordRestart(row); } + if (type === 'stop') { - const key = 'stop'; - console.log(toRaw(row)); - message.loading({ content: '请稍等...', key }); - tableState.loading = true; - stopNf(row).then(res => { - if (res.code === RESULT_CODE_SUCCESS) { - message.success({ - content: `重启成功`, - key, - duration: 2, - }); - // fnGetList(); - } else { - message.error({ - content: `${res.msg}`, - key: key, - duration: 2, - }); - } - tableState.loading = false; - }); + fnRecordStop(row); } } @@ -588,9 +629,7 @@ onMounted(() => {