From f0366b0ec357426f17c1f78f507ebc4481cb49e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=B6=E5=90=AF=E9=BE=99?= Date: Tue, 12 Nov 2024 15:03:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=87=AA=E6=9C=8D=E5=8A=A1=E8=BD=AF?= =?UTF-8?q?=E4=BB=B6=E5=AE=89=E8=A3=85=E6=A8=A1=E6=9D=BF=E5=81=9A=E4=B8=8B?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E5=8F=AA=E5=B1=95=E7=A4=BAinternal=E4=B8=BAf?= =?UTF-8?q?alse=E7=9A=84=EF=BC=8C=E5=86=85=E7=BD=AE=E7=9A=84=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E4=B8=8D=E5=B1=95=E7=A4=BA,mq=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../graph/software/components/RabbitMq.vue | 22 +++++++++++-- src/views/tpl/list.vue | 31 ++++++++++--------- 2 files changed, 36 insertions(+), 17 deletions(-) diff --git a/src/views/task/graph/software/components/RabbitMq.vue b/src/views/task/graph/software/components/RabbitMq.vue index ff28c4f..41e872f 100644 --- a/src/views/task/graph/software/components/RabbitMq.vue +++ b/src/views/task/graph/software/components/RabbitMq.vue @@ -76,6 +76,11 @@ + + + + + @@ -166,7 +171,8 @@ export default { configure_priv: '.*', read_priv: '.*', write_priv: '.*', - vhost: '/' + vhost: '/', + is_admin: false } ] } @@ -185,6 +191,17 @@ export default { this.handleCrypto(this.itemData, decrypt) }, methods: { + // 所有用户中只有1个 + switchAdmin(index) { + const currentUser = this.itemData.rabbitmq_users[index] + if (currentUser.is_admin) { + this.itemData.rabbitmq_users.forEach((item, idx) => { + if (index !== idx) { + item.is_admin = false + } + }) + } + }, // 加密解密处理 handleCrypto(itemData, fun = encrypt) { const { rabbitmq_users } = itemData @@ -218,7 +235,8 @@ export default { configure_priv: '.*', read_priv: '.*', write_priv: '.*', - vhost: '/' + vhost: '/', + is_admin: false }) }, getPostData() { diff --git a/src/views/tpl/list.vue b/src/views/tpl/list.vue index a449bcb..4da286d 100644 --- a/src/views/tpl/list.vue +++ b/src/views/tpl/list.vue @@ -54,20 +54,21 @@ export default { searchConfigs: [ { label: '模板名称', value: 'name', type: 'Input' }, { label: '创建', value: 'gmtCreate', type: 'DateRange' }, - { value: 'sceneId', type: 'Const', initValue: '' } + { value: 'sceneId', type: 'Const', initValue: '' }, + { value: 'internal', type: 'Const', initValue: false } ], columns: [ { label: '模板名称', prop: 'name', scopedSlots: { customRender: 'name' } }, { label: '模板状态', prop: 'status', scopedSlots: { customRender: 'status' } }, { label: '作业场景', prop: 'sceneName', scopedSlots: { customRender: 'sceneName' } }, { label: '作业数量', prop: 'taskCount' }, - { - label: '内置模板', - prop: 'internal', - customRender(val) { - return val ? '是' : '否' - } - }, + // { + // label: '内置模板', + // prop: 'internal', + // customRender(val) { + // return val ? '是' : '否' + // } + // }, { label: '创建人', prop: 'creator' }, { label: '最后修改人', prop: 'mender' }, { label: '创建时间', prop: 'gmtCreate', minWidth: '110px' }, @@ -92,7 +93,7 @@ export default { confirmButtonClass: 'el-button--danger', type: 'warning' }).then(() => { - releaseTemplate(data.id).then((data) => { + releaseTemplate(data.id).then(data => { if (data.success) { this.$message({ message: data.message, @@ -109,7 +110,7 @@ export default { confirmButtonClass: 'el-button--danger', type: 'warning' }).then(() => { - recallTemplate(data.id).then((data) => { + recallTemplate(data.id).then(data => { if (data.success) { this.$message({ message: data.message, @@ -123,7 +124,7 @@ export default { getList() { this.loading = true getTemplate(this.params) - .then((data) => { + .then(data => { if (data.success) { this.list = data.data.rows this.total = data.data.total @@ -156,7 +157,7 @@ export default { this.$confirm('您确定要删除该编排模板吗?', '提示', { type: 'warning' }).then(() => { - removeTemplate(id).then((data) => { + removeTemplate(id).then(data => { if (data.success) { this.$message({ message: data.message, @@ -171,7 +172,7 @@ export default { bindImport() { const self = this // 导入 - document.getElementById('btnTaskUpload').onchange = function (event) { + document.getElementById('btnTaskUpload').onchange = function(event) { const data = event.target.files[0] // $('#btnTaskUpload').html($('#btnTaskUpload').html()) document.getElementById('btnTaskUpload').innerHTML = document.getElementById('btnTaskUpload').innerHTML @@ -179,10 +180,10 @@ export default { // 将文件进行转码,转换为text const reader = new FileReader() reader.readAsText(data) - reader.onload = function (f) { + reader.onload = function(f) { try { const data = JSON.parse(this.result) - createTemplate(data).then((data) => { + createTemplate(data).then(data => { if (data.success) { self.$message({ message: data.message,