This commit is contained in:
unknown
2026-02-04 20:27:13 +08:00
commit 3b042d1dad
9410 changed files with 1488147 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
{$layout "layout_popup"}
<h3>修改分类</h3>
<form class="ui form" data-tea-action="$" data-tea-success="success">
<csrf-token></csrf-token>
<input type="hidden" name="categoryId" :value="category.id"/>
<table class="ui table definition selectable">
<tr>
<td>分类名称 *</td>
<td>
<input name="name" maxlength="100" ref="focus" v-model="category.name"/>
</td>
</tr>
<tr>
<td colspan="2"><more-options-indicator></more-options-indicator></td>
</tr>
<tbody v-show="moreOptionsVisible">
<tr>
<td>启用</td>
<td>
<checkbox name="isOn" v-model="category.isOn"></checkbox>
</td>
</tr>
</tbody>
</table>
<submit-btn></submit-btn>
</form>

View File

@@ -0,0 +1,18 @@
{$layout "layout_popup"}
<h3>添加分类</h3>
<form class="ui form" data-tea-action="$" data-tea-success="success">
<csrf-token></csrf-token>
<table class="ui table definition selectable">
<tr>
<td>分类名称 *</td>
<td>
<input name="name" maxlength="100" ref="focus"/>
</td>
</tr>
</table>
<submit-btn></submit-btn>
</form>

View File

@@ -0,0 +1,29 @@
{$layout}
<first-menu>
<menu-item @click.prevent="createCategory">[添加分类]</menu-item>
</first-menu>
<not-found-box v-if="categories.length == 0">暂时还没有分类。</not-found-box>
<table class="ui table selectable celled" v-if="categories.length > 0">
<thead>
<tr>
<th>分类名</th>
<th class="width10">状态</th>
<th class="two op">操作</th>
</tr>
</thead>
<tr v-for="category in categories">
<td>
<a href="" @click.prevent="updateCategory(category.id)">{{category.name}} <i class="icon expand small"></i></a>
</td>
<td>
<label-on :v-is-on="category.isOn"></label-on>
</td>
<td>
<a href="" @click.prevent="updateCategory(category.id)">修改</a> &nbsp;
<a href="" @click.prevent="deleteCategory(category.id)">删除</a>
</td>
</tr>
</table>

View File

@@ -0,0 +1,30 @@
Tea.context(function () {
this.createCategory = function () {
teaweb.popup("/tickets/categories/createPopup", {
callback: function () {
teaweb.successRefresh("保存成功")
}
})
}
this.updateCategory = function (categoryId) {
teaweb.popup("/tickets/categories/category/updatePopup?categoryId=" + categoryId, {
callback: function () {
teaweb.successRefresh("保存成功")
}
})
}
this.deleteCategory = function (categoryId) {
let that = this
teaweb.confirm("确定要删除此分类吗?", function () {
that.$post("/tickets/categories/category/delete")
.params({
categoryId: categoryId
})
.success(function () {
teaweb.reload()
})
})
}
})

View File

@@ -0,0 +1,68 @@
{$layout}
<first-menu>
<menu-item href="/tickets?status=none" code="none">进行中({{countNewTickets}})</menu-item>
<menu-item href="/tickets?status=solved" code="solved">已解决</menu-item>
<menu-item href="/tickets?status=closed" code="closed">已关闭</menu-item>
</first-menu>
<div class="margin"></div>
<form class="ui form" action="/tickets">
<div class="ui fields inline">
<div class="ui field">
<user-selector :v-user-id="userId" :data-url="'/tickets/users/options'"></user-selector>
</div>
<div class="ui field">
<button class="ui button" type="submit">搜索</button>
&nbsp;
<a :href="'/tickets?status=' + status" v-if="userId > 0">[清除条件]</a>
</div>
</div>
</form>
<not-found-box v-if="tickets.length == 0">暂时还没有工单。</not-found-box>
<table class="ui table selectable celled" v-if="tickets.length > 0">
<thead>
<tr>
<th>工单标题</th>
<th class="three wide">用户</th>
<th class="three wide">最后操作时间</th>
<th class="three wide">最后操作人</th>
<th class="two wide">分类</th>
<th class="width6">状态</th>
<th class="one op">操作</th>
</tr>
</thead>
<tr v-for="ticket in tickets">
<td>
<a :href="'/tickets/ticket?ticketId=' + ticket.id + '&fromURL=' + currentURL">{{ticket.subject}}</a>
</td>
<td>
<span v-if="ticket.user != null"><user-link :v-user="ticket.user"></user-link></span>
<span v-else class="disabled">已删除</span>
</td>
<td>{{ticket.lastLogTime}}</td>
<td>
<span v-if="ticket.latestLog != null && ticket.latestLog.admin != null">
<i class="icon user secret"></i> {{ticket.latestLog.admin.fullname}}<span class="grey small">{{ticket.latestLog.admin.username}}</span>
</span>
<span v-else>
<span v-if="ticket.user != null"><user-link :v-user="ticket.user"></user-link></span>
<span v-else class="disabled">已删除</span>
</span>
</td>
<td>
<span v-if="ticket.category != null">{{ticket.category.name}}</span>
<span v-else class="disabled">-</span>
</td>
<td>
<span :class="{olive: ticket.status == 'none', green: ticket.status == 'solved', red: ticket.status == 'closed'}">{{ticket.statusName}}</span>
</td>
<td>
<a :href="'/tickets/ticket?ticketId=' + ticket.id+ '&fromURL=' + currentURL">详情</a>
</td>
</tr>
</table>
<page-box></page-box>

View File

@@ -0,0 +1,28 @@
{$layout "layout_popup"}
<h3>工单回复</h3>
<form class="ui form" data-tea-success="success" data-tea-action="$">
<csrf-token></csrf-token>
<input type="hidden" name="ticketId" :value="ticketId"/>
<table class="ui table definition selectable">
<tr>
<td class="title">回复内容</td>
<td>
<textarea rows="6" name="comment" ref="focus"></textarea>
</td>
</tr>
<tr>
<td>状态</td>
<td>
<select name="status" class="ui dropdown auto-width">
<option value="">[状态]</option>
<option v-for="status in statusList" :value="status.code">{{status.name}}</option>
</select>
</td>
</tr>
</table>
<submit-btn></submit-btn>
</form>

View File

@@ -0,0 +1,4 @@
.log-header {
font-weight: normal !important;
}
/*# sourceMappingURL=index.css.map */

View File

@@ -0,0 +1 @@
{"version":3,"sources":["index.less"],"names":[],"mappings":"AAAA;EACC,8BAAA","file":"index.css"}

View File

@@ -0,0 +1,80 @@
{$layout}
<first-menu>
<menu-item v-if="fromURL.length > 0" :href="fromURL">工单列表</menu-item>
<menu-item v-if="fromURL.length == 0" :href="'/tickets?status=' + ticket.status">工单列表</menu-item>
</first-menu>
<table class="ui table definition selectable">
<tr>
<td class="title">工单标题</td>
<td>{{ticket.subject}}</td>
</tr>
<tr>
<td>工单内容</td>
<td>
<div v-html="ticket.body"></div>
</td>
</tr>
<tr>
<td>用户</td>
<td>
<span v-if="ticket.user != null"><user-link :v-user="ticket.user"></user-link></span>
<span v-else class="disabled">已删除</span>
</td>
</tr>
<tr>
<td>最后操作时间</td>
<td>
{{ticket.lastLogTime}}
</td>
</tr>
<tr>
<td>分类</td>
<td>
<span v-if="ticket.category != null">{{ticket.category.name}}</span>
<span v-else class="disabled">-</span>
</td>
</tr>
<tr>
<td>状态</td>
<td>
<span :class="{olive: ticket.status == 'none', green: ticket.status == 'solved', red: ticket.status == 'closed'}">{{ticket.statusName}}</span>
</td>
</tr>
<tr>
<td>操作</td>
<td>
<a href="" @click.prevent="reply(ticket.id)">[回复]</a>
</td>
</tr>
</table>
<h4>工单回复</h4>
<p class="comment" v-if="logs.length == 0">暂时还没有回复。</p>
<table class="ui table selectable" v-if="logs.length > 0" v-for="log in logs">
<thead>
<tr>
<th class="log-header">
<span v-if="log.admin != null">
<i class="icon user secret"></i> {{log.admin.fullname}}<span class="grey small">{{log.admin.username}}</span>
</span>
<span v-if="log.user != null">
<user-link :v-user="log.user"></user-link>
</span>
@ {{log.createdTime}}
&nbsp; | &nbsp; <span v-if="log.statusName.length > 0" :class="{olive: log.status == 'none', green: log.status == 'solved', red: log.status == 'closed'}">{{log.statusName}}</span>
</th>
</tr>
<tr>
<td>
<div v-html="log.comment" v-if="log.comment.length > 0"></div>
<span class="disabled" v-else>没有内容</span>
</td>
</tr>
</thead>
</table>
<page-box></page-box>

View File

@@ -0,0 +1,9 @@
Tea.context(function () {
this.reply = function (ticketId) {
teaweb.popup("/tickets/ticket/createLogPopup?ticketId=" + ticketId, {
callback: function () {
teaweb.successRefresh("保存成功")
}
})
}
})

View File

@@ -0,0 +1,3 @@
.log-header {
font-weight: normal !important;
}