From d4aa1efbf1ea97bde52387517df16b72b2b0a744 Mon Sep 17 00:00:00 2001 From: odboy Date: Mon, 9 Dec 2024 21:03:19 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=88=A0=E9=99=A4=E7=8E=AF=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/config/configAppEnv.js | 8 +++ src/views/config-center/index.vue | 91 ++++++++++++++++++++++--------- 2 files changed, 73 insertions(+), 26 deletions(-) diff --git a/src/api/config/configAppEnv.js b/src/api/config/configAppEnv.js index 9009d95..1962018 100644 --- a/src/api/config/configAppEnv.js +++ b/src/api/config/configAppEnv.js @@ -15,3 +15,11 @@ export function create(data) { data: data }) } + +export function remove(data) { + return request({ + url: 'kenaito-config/env/remove', + method: 'post', + data: data + }) +} diff --git a/src/views/config-center/index.vue b/src/views/config-center/index.vue index 11f215a..41716e0 100644 --- a/src/views/config-center/index.vue +++ b/src/views/config-center/index.vue @@ -62,14 +62,41 @@ - - 当前应用: - + + + + {{ currentRow.appName }} 未选中应用 - - 选择环境: - + + + - - - 新增环境 - - - 上传配置 - - + + @@ -416,6 +425,28 @@ export default { }) }, // ok + onDeleteEnv() { + const _this = this + if (_this.currentEnvCode === undefined || _this.currentEnvCode === null || _this.currentEnvCode === '') { + MessageUtil.error(_this, '请选择应用和环境后,再试') + return + } + MessageBoxUtil.deleteMessageConfirm(_this, '是否删除当前环境?', () => { + configAppEnvService.remove({ + appId: _this.currentRow.id, + envCode: _this.currentEnvCode + }).then(res => { + MessageUtil.success(_this, '操作成功') + configAppEnvService.queryList({ appId: _this.currentRow.id }).then(res => { + _this.envCodeDataSource = res || [] + }) + _this.envConfigFileDataSource = [] + _this.currentEnvCode = '' + }).catch(e => { + }) + }, null) + }, + // ok onAddEnv() { const _this = this const currentRow = _this.currentRow @@ -485,6 +516,14 @@ export default { if (valid) { _this.uploadForm.loading = true _this.$refs.uploadClient.submit() + setTimeout(() => { + configFileService.queryList({ + appId: _this.currentRow.id, + envCode: _this.currentEnvCode + }).then(res => { + _this.envConfigFileDataSource = res || [] + }) + }, 2000) MessageUtil.success(_this, '上传成功') this.uploadForm.visible = false } else {