mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-12-09 07:20:26 +08:00
实现发送消息到媒介
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
{$layout}
|
||||
{$template "/left_menu"}
|
||||
|
||||
<div class="right-box">
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<csrf-token></csrf-token>
|
||||
<input type="hidden" name="clusterId" :value="clusterId"/>
|
||||
|
||||
<table class="ui table selectable definition">
|
||||
<tr>
|
||||
<td class="title">消息接收人</td>
|
||||
<td>
|
||||
<message-receivers-box :v-node-cluster-id="clusterId"></message-receivers-box>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyReloadSuccess("保存成功")
|
||||
})
|
||||
@@ -0,0 +1,36 @@
|
||||
{$layout "layout_popup"}
|
||||
|
||||
<h3>选择接收人</h3>
|
||||
|
||||
|
||||
<form class="ui form">
|
||||
<table class="ui table definition">
|
||||
<tr>
|
||||
<td class="title">选择接收人</td>
|
||||
<td>
|
||||
<div v-if="recipients.length == 0">
|
||||
<span class="disabled">暂时没有接收人。</span>
|
||||
</div>
|
||||
<div v-else>
|
||||
<a class="ui label small basic" :class="{blue: selectedRecipient != null && recipient.id == selectedRecipient.id}" v-for="recipient in recipients" @click.prevent="selectRecipient(recipient)">
|
||||
{{recipient.name}} <span class="small grey">({{recipient.instanceName}})</span>
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>选择接收人分组</td>
|
||||
<td>
|
||||
<div v-if="groups.length == 0">
|
||||
<span class="disabled">暂时没有接收人分组。</span>
|
||||
</div>
|
||||
<div v-else>
|
||||
<a class="ui label small basic" :class="{blue: selectedGroup != null && group.id == selectedGroup.id}" v-for="group in groups" @click.prevent="selectGroup(group)">
|
||||
分组:{{group.name}}
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<button type="button" class="ui button primary" @click.prevent="confirm">确定</button>
|
||||
</form>
|
||||
@@ -0,0 +1,40 @@
|
||||
Tea.context(function () {
|
||||
this.selectedRecipient = null
|
||||
this.selectedGroup = null
|
||||
|
||||
|
||||
this.selectRecipient = function (recipient) {
|
||||
this.selectedRecipient = recipient
|
||||
this.selectedGroup = null
|
||||
}
|
||||
|
||||
this.selectGroup = function (group) {
|
||||
this.selectedRecipient = null
|
||||
this.selectedGroup = group
|
||||
}
|
||||
|
||||
this.confirm = function () {
|
||||
if (this.selectedRecipient != null) {
|
||||
NotifyPopup({
|
||||
code: 200,
|
||||
data: {
|
||||
id: this.selectedRecipient.id,
|
||||
name: this.selectedRecipient.name,
|
||||
subName: this.selectedRecipient.instanceName,
|
||||
type: "recipient"
|
||||
}
|
||||
})
|
||||
} else if (this.selectedGroup != null) {
|
||||
NotifyPopup({
|
||||
code: 200,
|
||||
data: {
|
||||
id: this.selectedGroup.id,
|
||||
name: this.selectedGroup.name,
|
||||
type: "group"
|
||||
}
|
||||
})
|
||||
} else {
|
||||
teaweb.closePopup()
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user