// 消息接收人设置 Vue.component("message-receivers-box", { props: ["v-node-cluster-id"], mounted: function () { let that = this Tea.action("/clusters/cluster/settings/message/selectedReceivers") .params({ clusterId: this.clusterId }) .post() .success(function (resp) { that.receivers = resp.data.receivers }) }, data: function () { let clusterId = this.vNodeClusterId if (clusterId == null) { clusterId = 0 } return { clusterId: clusterId, receivers: [] } }, methods: { addReceiver: function () { let that = this let recipientIdStrings = [] let groupIdStrings = [] this.receivers.forEach(function (v) { if (v.type == "recipient") { recipientIdStrings.push(v.id.toString()) } else if (v.type == "group") { groupIdStrings.push(v.id.toString()) } }) teaweb.popup("/clusters/cluster/settings/message/selectReceiverPopup?recipientIds=" + recipientIdStrings.join(",") + "&groupIds=" + groupIdStrings.join(","), { callback: function (resp) { that.receivers.push(resp.data) } }) }, removeReceiver: function (index) { this.receivers.$remove(index) } }, template: `
分组:{{receiver.name}} ({{receiver.subName}})  
` })