1.4.5.2
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
{$layout "layout_popup"}
|
||||
|
||||
<h3>创建分组</h3>
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<csrf-token></csrf-token>
|
||||
<table class="ui table selectable definition">
|
||||
<tr>
|
||||
<td class="title">分组名称 *</td>
|
||||
<td>
|
||||
<input type="text" name="name" maxlength="100" ref="focus"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
@@ -0,0 +1,22 @@
|
||||
{$layout "layout_popup"}
|
||||
|
||||
<h3>修改分组</h3>
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<csrf-token></csrf-token>
|
||||
<input type="hidden" name="groupId" :value="group.id"/>
|
||||
<table class="ui table selectable definition">
|
||||
<tr>
|
||||
<td class="title">分组名称 *</td>
|
||||
<td>
|
||||
<input type="text" name="name" maxlength="100" ref="focus" v-model="group.name"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>启用</td>
|
||||
<td>
|
||||
<checkbox name="isOn" v-model="group.isOn"></checkbox>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
31
EdgeUser/web/views/@default/ns/domains/groups/index.html
Normal file
31
EdgeUser/web/views/@default/ns/domains/groups/index.html
Normal file
@@ -0,0 +1,31 @@
|
||||
{$layout}
|
||||
|
||||
<first-menu>
|
||||
<menu-item href="/ns/domains/groups" active="true">分组列表</menu-item>
|
||||
<span class="item disabled">|</span>
|
||||
<menu-item @click.prevent="createGroup">[创建分组]</menu-item>
|
||||
</first-menu>
|
||||
|
||||
<not-found-box v-if="groups.length == 0">暂时还没有分组。</not-found-box>
|
||||
|
||||
<table class="ui table selectable celled" v-if="groups.length > 0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>分组名称</th>
|
||||
<th class="width6">状态</th>
|
||||
<th class="two op">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr v-for="group in groups">
|
||||
<td>
|
||||
<a href="" @click.prevent="updateGroup(group.id)">{{group.name}} <i class="icon expand small"></i></a>
|
||||
</td>
|
||||
<td>
|
||||
<label-on :v-is-on="group.isOn"></label-on>
|
||||
</td>
|
||||
<td>
|
||||
<a href="" @click.prevent="updateGroup(group.id)">修改</a>
|
||||
<a href="" @click.prevent="deleteGroup(group.id)">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
30
EdgeUser/web/views/@default/ns/domains/groups/index.js
Normal file
30
EdgeUser/web/views/@default/ns/domains/groups/index.js
Normal file
@@ -0,0 +1,30 @@
|
||||
Tea.context(function () {
|
||||
this.createGroup = function () {
|
||||
teaweb.popup("/ns/domains/groups/createPopup", {
|
||||
callback: function () {
|
||||
teaweb.successRefresh("保存成功")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
this.updateGroup = function (groupId) {
|
||||
teaweb.popup("/ns/domains/groups/group/updatePopup?groupId=" + groupId, {
|
||||
callback: function () {
|
||||
teaweb.successRefresh("保存成功")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
this.deleteGroup = function (groupId) {
|
||||
let that = this
|
||||
teaweb.confirm("确定要删除此分组吗?", function () {
|
||||
that.$post("/ns/domains/groups/group/delete")
|
||||
.params({
|
||||
groupId: groupId
|
||||
})
|
||||
.success(function () {
|
||||
teaweb.successRefresh("删除成功")
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user