From 2b228e0fecde8d3007b36ba6e856d52a9438cb7d Mon Sep 17 00:00:00 2001 From: Dong Xia Date: Tue, 21 Feb 2023 08:16:40 +0000 Subject: [PATCH] =?UTF-8?q?=E5=8D=95/=E5=A4=9A=E4=B8=AA=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E8=BD=AF=E4=BB=B6=E6=BA=90=E9=85=8D=E7=BD=AE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Dong Xia --- src/pages/repository/source/index.vue | 68 +++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/src/pages/repository/source/index.vue b/src/pages/repository/source/index.vue index e99eaf2..4b1ca68 100644 --- a/src/pages/repository/source/index.vue +++ b/src/pages/repository/source/index.vue @@ -367,6 +367,74 @@ export default { this.selectPlan.annotation = row.annotation this.selectPlan.sourceList = this.analysisData(row.sourceList) }, + batchSet(row) { + this.selectPlan.planName = row.planName + this.selectPlan.sourceList = this.analysisData(row.sourceList) + this.nodeSelectVisible = true + }, + handleSetPlan() { + this.confirmLoading = true + this.$refs.nodeSelect.handleSubmit().then(() => { + this.$notification.success({ message: '配置软件源成功' }) + this.nodeSelectVisible = false + }).catch((err) => { + if (err === 'validate') return + this.resultList = err + this.resultTitle = '节点软件源配置结果' + this.step = '配置' + this.okText = '回滚' + this.resultListVisible = true + }).finally(() => { + this.confirmLoading = false + }) + }, + handleResultOk() { + this.rollbackList = this.$refs.resultList.selecList + if (this.step === '配置' && this.rollbackList.length > 0) { + let list = [] + this.rollbackList.forEach(item => { + list.push(item.nodeId) + }) + this.$confirm({ + title: '系统提示', + content: '确定回滚所选节点的软件源配置?', + okText: '确定', + cancelText: '取消', + keyboard: false, + onOk: () => { + const params = { + nodeIds: list, + data: '', + interface: 'RollbackSourceList' + } + batchProcessing(params).then(res => { + this.resultList = res + this.resultListVisible = true + this.nodeSelectVisible = false + this.okText = '确定' + this.step = '回滚' + this.resultTitle = '节点软件源回滚结果' + for (let item of res) { + if (item.code === 200) { + this.$notification.success({ message: item.msg }) + } else { + this.$notification.error({ message: item.msg }) + } + } + }).catch((error) => { + this.$notification.error({ message: error || '软件源回滚失败' }) + }) + }, + onCancel: () => { + this.nodeSelectVisible = false + } + }) + } else if (this.step === '配置' && this.rollbackList.length === 0) { + this.$notification.error({ message: '请选择需要回滚的节点' }) + } else { + this.resultListVisible = false + } + } } } \ No newline at end of file -- Gitee