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,