Commit db2b66d4 by keith

update code

parent 9541c36a
Showing with 317 additions and 49 deletions
......@@ -47,8 +47,8 @@ func (c *BaseController) GetAdminAuthInfo() *models.Auths {
var authsRepository = services.GetAuthsRepositoryInstance()
auth := authsRepository.GetAdminAuthInfo(token)
if auth == nil {
logs.Warn("GetAdminAuthInfo fun error------------登录已失效!")
c.JSON(configs.ResponseFail, "登录已失效!", nil)
logs.Warn("GetAdminAuthInfo fun error------------用户效验失败!")
c.JSON(configs.ResponseFail, "用户效验失败!", nil)
}
return auth
}
......@@ -59,7 +59,7 @@ func (c *BaseController) GetUserInfo() *models.User {
var userRepository = services.GetUserRepositoryInstance()
user := userRepository.GetUserWithToken(token)
if user == nil {
logs.Warn("GetUserInfo get current user info error------------登录已失效!")
logs.Warn("GetUserInfo get current user info error------------用户效验失败!")
}
return user
}
......@@ -172,11 +172,10 @@ func (c *ContactController) Transfer() {
tk := time.NewTimer(1 * time.Second)
select {
case <-tk.C:
usersID := []int64{admin.ID, transferDto.UserAccount}
// ContactRepository instance
contactRepository := services.GetContactRepositoryInstance()
_, err := contactRepository.UpdateIsSessionEnd(usersID, 1)
_, err := contactRepository.UpdateIsSessionEnd(transferDto.UserAccount)
if err != nil {
logs.Info(err)
......
......@@ -267,7 +267,11 @@ func (c *PublicController) Robot() {
// get user
user := c.GetUserInfo()
if user == nil {
c.JSON(configs.ResponseFail, "fail!", "")
// GetAdminAuthInfo
auth := c.GetAdminAuthInfo()
if auth == nil {
c.JSON(configs.ResponseFail, "fail,!", nil)
}
}
// request body
......
......@@ -190,3 +190,20 @@ func (c *WorkOrderController) CloseWorkOrder() {
c.JSON(configs.ResponseSucess, "工单已关闭!", rows)
}
// GetWorkOrders get workorders
func (c *WorkOrderController) GetWorkOrders() {
request := models.WorkOrderPaginationDto{}
if err := json.Unmarshal(c.Ctx.Input.RequestBody, &request); err != nil {
c.JSON(configs.ResponseFail, "参数有误,请检查!", nil)
}
res, err := c.WorkOrderRepository.GetWorkOrders(request)
if err != nil {
c.JSON(configs.ResponseFail, "查询失败!", &res)
}
c.JSON(configs.ResponseSucess, "查询成功", &res)
}
......@@ -5,12 +5,14 @@ import (
"github.com/astaxie/beego"
"github.com/astaxie/beego/logs"
"github.com/astaxie/beego/toolbox"
_ "github.com/go-sql-driver/mysql"
"kefu_server/controllers"
"kefu_server/db"
"kefu_server/grpcs"
_ "kefu_server/routers"
"kefu_server/task"
)
// Initialization log
......@@ -38,9 +40,9 @@ func main() {
initLog()
// init task
// task.Run()
// toolbox.StartTask()
// defer toolbox.StopTask()
task.Run()
toolbox.StartTask()
defer toolbox.StopTask()
/// Static file configuration
beego.SetStaticPath("/", "public/client")
......
package models
// WorkOrderPaginationDto struct
type WorkOrderPaginationDto struct {
PageSize int `json:"page_size"`
PageOn int `json:"page_on"`
Total int64 `json:"total"`
Tid int64 `json:"tid"`
Status int `json:"status"`
List interface{} `json:"list"`
}
File mode changed
body{min-width:240px;overflow:hidden;height:100vh;background-color:#f3f3f3}.mint-header.is-fixed{height:50px!important;background:linear-gradient(90deg,#26a2ff,#736cde)}.mint-header.is-fixed .mint-header-title{font-size:15px}.mint-header,.mint-tabbar{min-width:240px;z-index:999999999!important}.mint-header .is-right img{width:25px}.mint-header .mint-button .mintui{font-size:23px!important}.mini-im-loading{display:-ms-flexbox;display:flex;width:100%;position:fixed;height:100vh;top:0;left:0;z-index:9;right:0;background-color:#fff!important;margin:auto;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.mini-im-loading.pc-mini-im-loading{width:360px!important;height:360px!important;top:-48px;bottom:0;margin:auto!important}.workorder-create-picker .picker-item{font-size:15px}
\ No newline at end of file
.no-data[data-v-27b64799]{text-align:center;padding-top:50px}.no-data img[data-v-27b64799]{width:50px;height:50px}.no-data div[data-v-27b64799]{color:#666;font-size:14px}.list[data-v-27b64799]{padding-top:50px}.list.hide-header[data-v-27b64799]{padding-top:0}.list li[data-v-27b64799]{padding:10px 20px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAEMklEQVR4Xu2dbXbaMBBFFVZWnyysYWEcJRtzetzQpglftuaJ8jSXv8jD6M3Vk4SFeSq8UivwlLr3dL4AQHIIAAAAkiuQvPs4AAAkVyB593EAAEiuQPLu4wAAkFyB5N3HAQDAR4Fa67tDttM02Qwsm0SXwgOAHn8A0GtacIAOouIAfUTFATroigN0EPWKA7x2+ri1YX98bwgAa6Xb2O7CIvB1mqZpYyhJ81prLaUAgETNFUEAYIVIG5tI1gC11mUULKPhf7wezgHuIcI8z/vn5+eX6GcBQEDBS1NAIOTqSwHgUyocYDU2pw1xgIB4OMBRPNYAAYoaL3WZAtR79JMtVynlEaeA7v22AECV5J9B4rINLGW5HTBJIKi1/iylnKz2Vdp2XQOokrwFQKOLqi4750oyAA6Hw8tut1sg+PJSaTsCAKpCKuPIAMAB/imLy3kApoBj0VQ2dWMKUI5cVSwcYFESAOI8MQUwBbALiI8j3wg4gG/tJJkDgERG3yAA4Fs7SeYAIJHRNwgA+NZOkjkASGT0DQIAvrWTZA4AEhl9gwCAb+0kmQOAREbfIADgWztJ5gAgkdE3CAD41k6SOQBIZPQNkhKAS532LePvzJtOCaUE4NJJWAD4VEB12uohTwXjAJ+FTukAAAAAZ8/BMQXkmgLO/eLGmYF9y8/FUk4BzlVW5w4AakXN4gGAWcHU6QKAWlGzeABgVjB1ugCgVtQsHgCYFUydLgCoFTWLBwBmBVOnCwBqRc3iAYBZwdTppgTg2OnlCSM3b1fvdrv3a+2W988VZbnm0nvqIh7jvXEvYKWy3A5OfjuYE0GDALA84XKapv3Kgf+3GQAMAkDruTUAGAQAHOCL9+U7FdwKALuAQRygdQrYumYYuX3K7wFGLujWvgHAVsUGaw8AgxV0a3esAWhdBG4VaeT21gCwCIyjaQ0ADgAATV8Fx2UbJ4K1AzAFxEEEgLiG1hGsAWANEGfPGoBRp4DjfwZvqu48z28tf/duDcCoDtDy93WtgwEANo2z+zQGgG86X/r38Fbq71PG9k8BAAA4e9L4GlKtg8F6CmjtdPvYvM+VOAAO0PT8onS/Cxh1F3Afn/n4FOspAADiqABAXEPrCABgXb548tYAjLoLiJd1fQQAWK/VkC2tAWARGGfSGgCmgOQA4AAAwJnAIAPWUwAOEKw+3wTGBXSPYO0ALALj+F15XpJker35FK41Xch2IGSNJqo21g7AGiCOgTUATAHJAcABAECyUInL6BvBegrAAeLgWe8CAKAfAKr1VddtYCnlNS4BEUopJ4dQXQCgep0UAIBOwrqEBQCXSnXKEwA6CWsUVrLF7r0INNLTK9VHdAAvBQfItuWnZt+7LXGAAbRM2wUASFv6j44DAAAkVyB593EAAEiuQPLu4wAAkFyB5N3HAQAguQLJu48DJAfgF+1bWNtJgJDcAAAAAElFTkSuQmCC) 10px no-repeat;background-size:25px;padding-left:40px;padding-right:70px;border-bottom:1px solid #ddd;position:relative;height:40px}.list li .title[data-v-27b64799]{font-size:15px;color:#333;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.list li .type[data-v-27b64799]{font-size:13px;color:#666}.list li .date[data-v-27b64799]{margin-left:10px;font-size:13px;color:#999}.list li i[data-v-27b64799]{font-style:normal;font-size:13px;position:absolute;right:10px;top:0;height:20px;bottom:0;margin:auto 0}
\ No newline at end of file
.content[data-v-43d71195]{padding:50px 10px}.content .field-line[data-v-43d71195]{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;box-sizing:border-box;height:45px;border-bottom:1px solid #ddd;-ms-flex-line-pack:center;align-content:center;-ms-flex-align:center;align-items:center;font-size:14px;color:#333}.content .field-line span[data-v-43d71195]:first-child{width:35px}.content .field-line input[data-v-43d71195]{-ms-flex-positive:1;flex-grow:1;padding-left:10px;height:100%;background:none;border:0;color:#333;font-size:14px;border-radius:0}.content .field-line.algin-left[data-v-43d71195]{-ms-flex-line-pack:left;align-content:left;-ms-flex-align:left;align-items:left}.content .field-line.arrow-right[data-v-43d71195]{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAFDUlEQVR4Xu2dMU8UQRTH32wBvR/AxmhjJZVS3R4tsdCY2NoabY100IDGUo2x0s7EaGFDtzubkPAdaCz8AFjRkRuzATwCd3sz+24nb+b9aXkw8/7/3755M7MchvClWgGjOnskTwBAOQQAAAAoV0B5+qgAAEC5AsrTRwUAAMoVUJ4+KgAAUK6A8vRRAQCAcgWUp48KAACUK6A8fVQAACBbgaZpPhPRfefcbefccVEUvyeTyZvxeLwve+ZpzE5sBTg4OLhzenp6NE/GyWSys7GxsZ2GzHJnKRYAa60lolGXdICAD5ZIAKy1T4nom096gMBHpfkxIgGo6/qjMea5b2qAwFep63FSAfhpjHkUkhYgCFFrGisSAGvtCyJ6H5oSIAhVjGS+FFpV1VpRFIdEtBqaEiAIU0xkBWhTaJpm1zm3FZbOWTQg8FdNLABtCtba70T0xD+daSQg8FNNNABcCIhouyzLHT8pdEaJB4ALASpBN9hJAAAIhqtOyQAACIaBICkAuBCgJ0jkJHAR69gdLFLI//vJVYCL1DgQoBIIPwr25ZcDAXYHZyonWwFQCXwfk0y2gV1poBL0hyH5CrCMSqB5OcgGAO4WUSsEWQHAhUDj7iA7ALgQaKsEWQIACPybwmwBAAR+EGQNABcCDT1B9gBwIci9J1ABACCYvxyoAQAQzIZAFQCAIJP3Afz62/lRuDvI5DqYAwIHgpx2B+qWgMvQcCDIZXegGgD0BBm8EMJZBnCVDAD+88NZDlLuCdQvAdp7AgBwZQ3hVIIUG0MAMKOJ0AQBAJjTRWqBAAB0bCM0QAAAFuwjORCksDsAAB4HCRwIpDeGAMADAO6JYfuZh6PR6JPnUFHDAECA3IxKcHRycvJgc3Pzb8BwUUIBQKDMfSGQuhQAgEAA+i4HAKCH0FJ/pGcVEPmJZagAgZT1NL8d5VlZll8Dhxs8HAAESNzXfGPMn5WVlXvr6+vHAcNFCQUAnjL3Nf/8178sy/KD51BRwwCAh9wc86U2fxdpA4ABj4Klm9+mDgBwGeRRAxWGcMp+CpdAWAIGevJTMh9LwAwItDz5qABLNj+Fhm9W0UMTeK4K58lP1XwsAcrNBwDM/0uUWsOHJeCKAlrL/mUZ1PYAMP8MA5UAwPxpDVAHAMf8HNb8q32AKgBg/vU2UA0AMH/22bcKADjmp3zI43OHlz0AML8bg6wBgPmLa0C2AMD8xeZnew7AMT/HrV4XCtlVAI75uTd82d8FwHy/sp/lXQDMDzc/mx4A5vczPwsAYH5/85MHAObzzE8aAJjPNz9ZAGD+csxPEgCYvzzzkwMA5i/X/KQAgPnLNz8ZAGD+MOYnAQDMH8588QDA/GHNFw1A0zS7zrmtPhJovNXro5NYAKqqWiuK4pCIVkMTg/lhiol8H8Ba+5qI9sJSIYL5oYoJ/cugpml+OecehqQD80PUmsaKrAB1Xb81xrzyTQnm+yp1PU4qAI+NMT980oL5PirNjxEJQDtda60lolFXejCfZ77YXUA7sbqu2x7gizHmxqw0YT7ffNEAtJOrqupWURTvjDF3nXM3jTHHzrnfzrm98Xi8vxwJdP8WsUuAblviZQ8A4mktciQAINKWeJMCAPG0FjkSABBpS7xJAYB4WoscCQCItCXepABAPK1FjgQARNoSb1IAIJ7WIkcCACJtiTcpABBPa5EjAQCRtsSbFACIp7XIkQCASFviTQoAxNNa5Ej/AAxh3J+K76XOAAAAAElFTkSuQmCC) 100% no-repeat;background-size:18px;padding-right:25px}.content .field-line.file[data-v-43d71195]{position:relative;overflow:hidden;margin-top:20px;border-top:1px solid #ddd}.content .field-line.file .ed[data-v-43d71195]{color:#8bc34a}.content .field-line.file input[data-v-43d71195]{font-size:100px;opacity:0;position:absolute;top:0;right:0}.content .field-line.textarea[data-v-43d71195]{-ms-flex-align:start;align-items:start;-ms-flex-line-pack:start;align-content:start;border-bottom:0;padding-top:10px;height:100px}.content .field-line.textarea textarea[data-v-43d71195]{-ms-flex-positive:1;flex-grow:1;border:0;height:100%;resize:none;color:#333;font-size:14px;padding:3px 10px;background-color:rgba(0,0,0,.03);border-radius:3px}.content .tip[data-v-43d71195]{font-size:11px;color:#ff9800}.content.hide-header[data-v-43d71195]{padding-top:0}.content .sub-btn[data-v-43d71195]{display:block;width:100%;height:45px;color:#fff;margin-top:30px;line-height:45px;text-align:center;border-radius:3px;border:none;font-size:14px;background:linear-gradient(90deg,#26a2ff,#736cde);-ms-flex-negative:0;flex-shrink:0}.content .sub-btn[data-v-43d71195]:active{opacity:.8}.types-sheet[data-v-43d71195]{width:100vw;height:100vh;position:fixed;top:0;left:0;right:0;bottom:0;margin:auto;background-color:rgba(0,0,0,.5)}.types-sheet .picker-box[data-v-43d71195]{height:250px;width:100vw;position:absolute;bottom:0;left:0;right:0;margin:0 auto;background-color:#fff}.types-sheet .title[data-v-43d71195]{height:35px;border-bottom:1px solid #f3f3f3;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;padding:0 10px;box-sizing:border-box;-ms-flex-line-pack:center;align-content:center;-ms-flex-align:center;align-items:center}.types-sheet .title span[data-v-43d71195]{font-size:14px;color:#333}.types-sheet .title .sub-btn[data-v-43d71195]{display:block;width:55px;height:30px;color:#26a2ff;line-height:30px;text-align:right;font-size:14px;font-weight:900}.types-sheet .title .sub-btn[data-v-43d71195]:active{opacity:.8}
\ No newline at end of file
.container[data-v-1d2064aa]{height:100vh;overflow:hidden;overflow-y:auto}.content[data-v-1d2064aa]{padding-top:50px;padding-bottom:90px}.content .no-data[data-v-1d2064aa]{color:#666;font-size:14px}.content .workorder-close[data-v-1d2064aa]{text-align:center;color:#666;font-size:14px;padding:10px}.content.hide-header[data-v-1d2064aa]{padding-top:0}.content .head[data-v-1d2064aa]{margin:0 10px;padding:10px 0;border-bottom:1px solid hsla(0,0%,62%,.13)}.content .head .con[data-v-1d2064aa]{font-size:15px;color:#333;display:-ms-flexbox;display:flex;margin-bottom:8px}.content .head .con span[data-v-1d2064aa]{-ms-flex-flow:1;flex-flow:1}.content .head .con span[data-v-1d2064aa]:first-child{-ms-flex-flow:0;flex-flow:0;-ms-flex-negative:0;flex-shrink:0;width:45px}.content .head .con i[data-v-1d2064aa]{font-style:normal}.content .comments[data-v-1d2064aa]{padding:10px}.content .comments .item[data-v-1d2064aa]{display:-ms-flexbox;display:flex}.content .comments .item .avatar[data-v-1d2064aa]{padding-top:10px;border-bottom:1px solid hsla(0,0%,62%,.13)}.content .comments .item .avatar img[data-v-1d2064aa]{width:30px;height:30px;border-radius:100px;display:block}.content .comments .item .right[data-v-1d2064aa]{padding:10px 5px;-ms-flex-positive:1;flex-grow:1;border-bottom:1px solid hsla(0,0%,62%,.13)}.content .comments .item .right .nickname[data-v-1d2064aa]{font-size:15px;color:#333}.content .comments .item .right .detail[data-v-1d2064aa]{font-size:15px;color:#333;margin-top:5px}.content .comments .item .right .date[data-v-1d2064aa]{color:#999;font-size:14px;margin-top:5px}.content .comments .item:last-child .avatar[data-v-1d2064aa],.content .comments .item:last-child .right[data-v-1d2064aa]{border-bottom:0}.content .file-view[data-v-1d2064aa]{position:fixed;bottom:80px;left:0;right:0;padding:5px 10px;margin:0 auto;font-size:13px;color:#8bc34a}.content .file-view span[data-v-1d2064aa]{display:-ms-flexbox;display:flex;-ms-flex-line-pack:center;align-content:center;-ms-flex-align:center;align-items:center}.content .file-view span img[data-v-1d2064aa]{width:20px;height:20px}.content .file-view span i[data-v-1d2064aa]{font-style:normal;margin-left:5px}.content .input-form[data-v-1d2064aa]{position:fixed;bottom:0;left:0;right:0;margin:0 auto;width:100%;height:80px;background-color:#fff;border-top:1px solid hsla(0,0%,62%,.13);display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;padding:0 10px;box-sizing:border-box;-ms-flex-line-pack:center;align-content:center;-ms-flex-align:center;align-items:center}.content .input-form textarea[data-v-1d2064aa]{height:45px;-ms-flex-positive:1;flex-grow:1;border-radius:0;border:0;color:#333;font-size:14px;resize:none}.content .input-form .icon-btn[data-v-1d2064aa]{background:url(../img/upload.76668586.png) 50% no-repeat;background-size:30px;width:55px;height:55px;overflow:hidden}.content .input-form .icon-btn input[data-v-1d2064aa]{display:block;width:100%;height:100%;font-size:100px;opacity:0}.content .input-form .sub-btn[data-v-1d2064aa]{display:block;width:55px;height:30px;color:#fff;line-height:30px;text-align:center;border-radius:3px;border:none;font-size:14px;background:linear-gradient(90deg,#26a2ff,#736cde);-ms-flex-negative:0;flex-shrink:0}.content .input-form .sub-btn[data-v-1d2064aa]:active{opacity:.8}
\ No newline at end of file
No preview for this file type

8.64 KB | W: | H:

8.64 KB | W: | H:

public/client/img/expression.73c98a16.png
public/client/img/expression.73c98a16.png
public/client/img/expression.73c98a16.png
public/client/img/expression.73c98a16.png
  • 2-up
  • Swipe
  • Onion skin

5.59 KB | W: | H:

5.59 KB | W: | H:

public/client/img/photo_btn.c337b681.png
public/client/img/photo_btn.c337b681.png
public/client/img/photo_btn.c337b681.png
public/client/img/photo_btn.c337b681.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -18,9 +18,15 @@
fieldset, img { border:0; }
button, input, select, textarea { font-size:100%; outline: none;}
table { border-collapse:collapse; border-spacing:0; }
*{
-webkit-overflow-scrolling: touch!important;
-webkit-appearance: none!important;
-webkit-tap-highlight-color:rgba(0,0,0,0)!important;
outline:none!important;
}
input{
border:0;
outline: none;
outline: none !important;
}
html{
overflow: hidden;
......@@ -37,4 +43,4 @@
top:0 !important;
min-height: inherit!important;
left:0 !important; right:0 !important; bottom:0 !important; margin: auto !important;
}</style><link href=css/app.603f54ac.css rel=preload as=style><link href=css/chunk-vendors.5cea36ab.css rel=preload as=style><link href=js/app.eab418bf.js rel=preload as=script><link href=js/chunk-vendors.765f5c3b.js rel=preload as=script><link href=css/chunk-vendors.5cea36ab.css rel=stylesheet><link href=css/app.603f54ac.css rel=stylesheet></head><body><noscript><strong>We're sorry but m doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=js/chunk-vendors.765f5c3b.js></script><script src=js/app.eab418bf.js></script></body></html>
\ No newline at end of file
}</style><link href=css/chunk-5e6009ff.86cb9867.css rel=prefetch><link href=css/chunk-612d9b40.3daa63d4.css rel=prefetch><link href=css/chunk-6c9c88aa.4206eba5.css rel=prefetch><link href=css/chunk-c5fee4c4.d04a186e.css rel=prefetch><link href=js/chunk-5e6009ff.d7088d94.js rel=prefetch><link href=js/chunk-612d9b40.13a3a9bb.js rel=prefetch><link href=js/chunk-6c9c88aa.d765f1fb.js rel=prefetch><link href=js/chunk-c5fee4c4.1073caa4.js rel=prefetch><link href=css/app.19de1655.css rel=preload as=style><link href=css/chunk-vendors.5cea36ab.css rel=preload as=style><link href=js/app.0aa8e568.js rel=preload as=script><link href=js/chunk-vendors.a823ad66.js rel=preload as=script><link href=css/chunk-vendors.5cea36ab.css rel=stylesheet><link href=css/app.19de1655.css rel=stylesheet></head><body><noscript><strong>We're sorry but m doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=js/chunk-vendors.a823ad66.js></script><script src=js/app.0aa8e568.js></script></body></html>
\ No newline at end of file
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-612d9b40"],{"5fa5":function(t,e,A){},"7d02":function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAEMklEQVR4Xu2dbXbaMBBFFVZWnyysYWEcJRtzetzQpglftuaJ8jSXv8jD6M3Vk4SFeSq8UivwlLr3dL4AQHIIAAAAkiuQvPs4AAAkVyB593EAAEiuQPLu4wAAkFyB5N3HAQDAR4Fa67tDttM02Qwsm0SXwgOAHn8A0GtacIAOouIAfUTFATroigN0EPWKA7x2+ri1YX98bwgAa6Xb2O7CIvB1mqZpYyhJ81prLaUAgETNFUEAYIVIG5tI1gC11mUULKPhf7wezgHuIcI8z/vn5+eX6GcBQEDBS1NAIOTqSwHgUyocYDU2pw1xgIB4OMBRPNYAAYoaL3WZAtR79JMtVynlEaeA7v22AECV5J9B4rINLGW5HTBJIKi1/iylnKz2Vdp2XQOokrwFQKOLqi4750oyAA6Hw8tut1sg+PJSaTsCAKpCKuPIAMAB/imLy3kApoBj0VQ2dWMKUI5cVSwcYFESAOI8MQUwBbALiI8j3wg4gG/tJJkDgERG3yAA4Fs7SeYAIJHRNwgA+NZOkjkASGT0DQIAvrWTZA4AEhl9gwCAb+0kmQOAREbfIADgWztJ5gAgkdE3CAD41k6SOQBIZPQNkhKAS532LePvzJtOCaUE4NJJWAD4VEB12uohTwXjAJ+FTukAAAAAZ8/BMQXkmgLO/eLGmYF9y8/FUk4BzlVW5w4AakXN4gGAWcHU6QKAWlGzeABgVjB1ugCgVtQsHgCYFUydLgCoFTWLBwBmBVOnCwBqRc3iAYBZwdTppgTg2OnlCSM3b1fvdrv3a+2W988VZbnm0nvqIh7jvXEvYKWy3A5OfjuYE0GDALA84XKapv3Kgf+3GQAMAkDruTUAGAQAHOCL9+U7FdwKALuAQRygdQrYumYYuX3K7wFGLujWvgHAVsUGaw8AgxV0a3esAWhdBG4VaeT21gCwCIyjaQ0ADgAATV8Fx2UbJ4K1AzAFxEEEgLiG1hGsAWANEGfPGoBRp4DjfwZvqu48z28tf/duDcCoDtDy93WtgwEANo2z+zQGgG86X/r38Fbq71PG9k8BAAA4e9L4GlKtg8F6CmjtdPvYvM+VOAAO0PT8onS/Cxh1F3Afn/n4FOspAADiqABAXEPrCABgXb548tYAjLoLiJd1fQQAWK/VkC2tAWARGGfSGgCmgOQA4AAAwJnAIAPWUwAOEKw+3wTGBXSPYO0ALALj+F15XpJker35FK41Xch2IGSNJqo21g7AGiCOgTUATAHJAcABAECyUInL6BvBegrAAeLgWe8CAKAfAKr1VddtYCnlNS4BEUopJ4dQXQCgep0UAIBOwrqEBQCXSnXKEwA6CWsUVrLF7r0INNLTK9VHdAAvBQfItuWnZt+7LXGAAbRM2wUASFv6j44DAAAkVyB593EAAEiuQPLu4wAAkFyB5N3HAQAguQLJu48DJAfgF+1bWNtJgJDcAAAAAElFTkSuQmCC"},ba17:function(t,e,A){"use strict";var r=A("5fa5"),o=A.n(r);o.a},fb09:function(t,e,A){"use strict";A.r(e);var r=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"container"},[t.isShowHeader?r("mt-header",{attrs:{fixed:"",title:"我的工单"}},[r("div",{attrs:{slot:"left"},slot:"left"},[r("mt-button",{attrs:{icon:"back"},on:{click:function(e){return t.$router.go(-1)}}})],1),r("mt-button",{attrs:{slot:"right"},on:{click:function(e){return t.$router.push("/workorder/create")}},slot:"right"},[r("span",[t._v("创建工单")])])],1):t._e(),r("div",{staticClass:"list",class:{"hide-header":!t.isShowHeader}},[t.workorders.length<=0?r("div",{staticClass:"no-data"},[r("img",{attrs:{src:A("7d02"),alt:""}}),r("div",[t._v("您还没有发布过工单~")])]):r("ul",[t._l(t.workorders,(function(e,A){return[r("li",{key:A,on:{click:function(A){return t.$router.push("/workorder/detail/"+e.id)}}},[r("div",{staticClass:"title"},[t._v(t._s(e.title))]),r("div",[r("span",{staticClass:"type"},[t._v(t._s(t.getTypeName(e.tid)))]),r("span",{staticClass:"date"},[t._v(t._s(t.$formatDate(e.create_at)))])]),1==e.status?r("i",{staticStyle:{color:"#8bc34a"}},[t._v("已回复")]):t._e(),3==e.status?r("i",{staticStyle:{color:"#ccc"}},[t._v("已结束")]):t._e(),0==e.status?r("i",{staticStyle:{color:"#FF9800"}},[t._v("待处理")]):t._e(),2==e.status?r("i",{staticStyle:{color:"#FF9800"}},[t._v("待回复")]):t._e()])]}))],2)])],1)},o=[],n=(A("8e6e"),A("ac6a"),A("456d"),A("bd86")),s=A("2f62");function a(t,e){var A=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),A.push.apply(A,r)}return A}function i(t){for(var e=1;e<arguments.length;e++){var A=null!=arguments[e]?arguments[e]:{};e%2?a(Object(A),!0).forEach((function(e){Object(n["a"])(t,e,A[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(A)):a(Object(A)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(A,e))}))}return t}var c={name:"workorder",components:{},data:function(){return{}},created:function(){document.title="我的工单"},computed:i({},Object(s["b"])(["isShowHeader","workorders","workorderTypes"])),mounted:function(){this.$store.dispatch("onGetWorkorderTypes"),this.$store.dispatch("onGetWorkorders")},methods:{getTypeName:function(t){try{return this.workorderTypes.filter((function(e){return e.id==t}))[0].title}catch(e){return console.log(e),""}}}},u=c,d=(A("ba17"),A("2877")),g=Object(d["a"])(u,r,o,!1,null,"27b64799",null);e["default"]=g.exports}}]);
//# sourceMappingURL=chunk-612d9b40.13a3a9bb.js.map
\ No newline at end of file
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-6c9c88aa"],{"0673":function(e,t,s){},a481:function(e,t,s){"use strict";var r=s("cb7c"),i=s("4bf8"),a=s("9def"),n=s("4588"),o=s("0390"),c=s("5f1b"),l=Math.max,u=Math.min,p=Math.floor,d=/\$([$&`']|\d\d?|<[^>]*>)/g,v=/\$([$&`']|\d\d?)/g,f=function(e){return void 0===e?e:String(e)};s("214f")("replace",2,(function(e,t,s,h){return[function(r,i){var a=e(this),n=void 0==r?void 0:r[t];return void 0!==n?n.call(r,a,i):s.call(String(a),r,i)},function(e,t){var i=h(s,e,this,t);if(i.done)return i.value;var p=r(e),d=String(this),v="function"===typeof t;v||(t=String(t));var m=p.global;if(m){var b=p.unicode;p.lastIndex=0}var w=[];while(1){var k=c(p,d);if(null===k)break;if(w.push(k),!m)break;var y=String(k[0]);""===y&&(p.lastIndex=o(d,a(p.lastIndex),b))}for(var O="",T=0,j=0;j<w.length;j++){k=w[j];for(var q=String(k[0]),x=l(u(n(k.index),d.length),0),S=[],_=1;_<k.length;_++)S.push(f(k[_]));var P=k.groups;if(v){var C=[q].concat(S,x,d);void 0!==P&&C.push(P);var $=String(t.apply(void 0,C))}else $=g(q,d,x,S,P,t);x>=T&&(O+=d.slice(T,x)+$,T=x+q.length)}return O+d.slice(T)}];function g(e,t,r,a,n,o){var c=r+e.length,l=a.length,u=v;return void 0!==n&&(n=i(n),u=d),s.call(o,u,(function(s,i){var o;switch(i.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,r);case"'":return t.slice(c);case"<":o=n[i.slice(1,-1)];break;default:var u=+i;if(0===u)return s;if(u>l){var d=p(u/10);return 0===d?s:d<=l?void 0===a[d-1]?i.charAt(1):a[d-1]+i.charAt(1):s}o=a[u-1]}return void 0===o?"":o}))}}))},ede1:function(e,t,s){"use strict";s.r(t);var r=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"container"},[e.isShowHeader?s("mt-header",{attrs:{fixed:"",title:"创建工单"}},[s("div",{attrs:{slot:"left"},slot:"left"},[s("mt-button",{attrs:{icon:"back"},on:{click:function(t){return e.$router.go(-1)}}})],1)]):e._e(),s("div",{staticClass:"content",class:{"hide-header":!e.isShowHeader}},[s("div",{staticClass:"field-line arrow-right",on:{click:function(t){e.isShowTypesPicker=!0}}},[s("span",[e._v("类型:")]),s("span",[e._v(e._s(e.selectTyped||"选择工单分类"))])]),s("div",{staticClass:"field-line algin-left"},[s("span",[e._v("标题:")]),s("input",{directives:[{name:"model",rawName:"v-model",value:e.request.title,expression:"request.title"}],attrs:{type:"text",placeholder:"请输入工单标题~"},domProps:{value:e.request.title},on:{input:function(t){t.target.composing||e.$set(e.request,"title",t.target.value)}}})]),s("div",{staticClass:"field-line algin-left"},[s("span",[e._v("手机:")]),s("input",{directives:[{name:"model",rawName:"v-model",value:e.request.phone,expression:"request.phone"}],attrs:{type:"number",placeholder:"请输入您的手机~"},domProps:{value:e.request.phone},on:{input:function(t){t.target.composing||e.$set(e.request,"phone",t.target.value)}}})]),s("div",{staticClass:"tip"},[e._v("必填,预留手机号方便客服联系到您~")]),s("div",{staticClass:"field-line algin-left"},[s("span",[e._v("邮箱:")]),s("input",{directives:[{name:"model",rawName:"v-model",value:e.request.email,expression:"request.email"}],attrs:{type:"email",placeholder:"请输入您的电子邮箱~"},domProps:{value:e.request.email},on:{input:function(t){t.target.composing||e.$set(e.request,"email",t.target.value)}}})]),s("div",{staticClass:"tip"},[e._v("非必填,预留邮箱后若工单回复后会通过邮箱通知您~")]),s("div",{staticClass:"field-line textarea"},[s("span",[e._v("内容:")]),s("textarea",{directives:[{name:"model",rawName:"v-model",value:e.request.content,expression:"request.content"}],attrs:{placeholder:"请输入您的工单内容~"},domProps:{value:e.request.content},on:{input:function(t){t.target.composing||e.$set(e.request,"content",t.target.value)}}})]),s("div",{staticClass:"field-line arrow-right file"},[s("span",[e._v("附件:")]),s("span",{class:{ed:""!=e.source}},[e._v(e._s(e.source?"已上传附件,重新上传可替换~":"上传附件"))]),s("input",{attrs:{type:"file"},on:{change:e.uploadFile}})]),s("span",{staticClass:"sub-btn",on:{click:function(t){return e.submit()}}},[e._v("提交")])]),e.isShowTypesPicker?s("div",{staticClass:"types-sheet"},[s("div",{staticClass:"picker-box"},[s("div",{staticClass:"title"},[s("span",[e._v("选择工单类型")]),s("span",{staticClass:"sub-btn",on:{click:function(t){e.isShowTypesPicker=!1}}},[e._v("确定")])]),s("mt-picker",{attrs:{slots:e.types},on:{change:e.onValuesChange}})],1)]):e._e()],1)},i=[],a=(s("8e6e"),s("ac6a"),s("456d"),s("a481"),s("bd86")),n=s("2f62"),o=s("76a0"),c=s("bc3a"),l=s.n(c);function u(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,r)}return s}function p(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?u(Object(s),!0).forEach((function(t){Object(a["a"])(e,t,s[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):u(Object(s)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))}))}return e}var d={name:"workorder_create",components:{},data:function(){return{isSubmit:!1,request:{tid:0,title:"",content:"",phone:"",email:""},selectTyped:"",source:"",isShowTypesPicker:!1}},computed:p({},Object(n["b"])(["isShowHeader","workorders","userInfo","workorderTypes","uploadToken","workorderTypes"]),{types:function(){for(var e=[],t=[{flex:1,values:[],className:"workorder-create-picker",textAlign:"center"}],s=0;s<this.workorderTypes.length;s++)e.push(this.workorderTypes[s].title);return t[0].values=e,t}}),mounted:function(){},methods:{onValuesChange:function(e,t){this.selectTyped=t[0];for(var s=0;s<this.workorderTypes.length;s++)if(t[0]==this.workorderTypes[s].title){this.request.tid=this.workorderTypes[s].id;break}console.log(e)},uploadFile:function(e){var t=e.target,s=t.files[0];this.isShowUploadLoading=!0;var r=this;this.$uploadFile({file:s,mode:this.uploadToken.mode,percent:function(){},success:function(e){var t;r.isShowUploadLoading=!1;var s=r.uploadToken.host+"/"+e,i=e.substr(e.lastIndexOf(".")+1);-1!="jpg,jpeg,png,JPG,JPEG,PNG".indexOf(i)?t="<br><img style='max-width:60%' preview='1' src='"+s+"' />":(t="<br><img style='width:20px;height:30px;top:3px; right:3px;position: relative;' preview='1' src='http://qiniu.cmp520.com/fj.png' />",t+="<a target='_blank' href='"+s+"'>下载附件</a>"),r.source=t,Object(o["Toast"])({message:"上传成功~"})},fail:function(e){r.isShowUploadLoading=!1,e.response&&e.response.data&&Object(o["Toast"])({message:e.response.data.message})}})},submit:function(){var e=this;0!=this.request.tid?""!=this.request.title.trim()?""!=this.request.content.trim()?this.isSubmit||(this.isSubmit=!0,this.request.content+=this.source,l.a.post("/public/workorder/create",this.request).then((function(t){e.isSubmit=!1,Object(o["Toast"])({message:"工单创建成功~"}),setTimeout((function(){return e.$router.replace("/workorder/detail/"+t.data.data)}),500)})).catch((function(t){e.isSubmit=!1,Object(o["Toast"])({message:t.response.data.message}),console.log(t)}))):Object(o["Toast"])({message:"工单内容不能为空!"}):Object(o["Toast"])({message:"工单标题不能为空!"}):Object(o["Toast"])({message:"请选择工单类型!"})}}},v=d,f=(s("fb2c"),s("2877")),h=Object(f["a"])(v,r,i,!1,null,"43d71195",null);t["default"]=h.exports},fb2c:function(e,t,s){"use strict";var r=s("0673"),i=s.n(r);i.a}}]);
//# sourceMappingURL=chunk-6c9c88aa.d765f1fb.js.map
\ No newline at end of file
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-c5fee4c4"],{"0d1c":function(t,e,o){},"269c":function(t,e,o){t.exports=o.p+"img/fujian1.083cd8b7.png"},4033:function(t,e,o){"use strict";o.r(e);var s=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"container"},[t.isShowHeader?s("mt-header",{attrs:{fixed:"",title:"工单详细"}},[s("div",{attrs:{slot:"left"},slot:"left"},[s("mt-button",{attrs:{icon:"back"},on:{click:function(e){return t.$router.go(-1)}}})],1),3!=t.workorder.status?s("mt-button",{attrs:{slot:"right"},on:{click:function(e){return t.close()}},slot:"right"},[s("span",[t._v("关闭工单")])]):s("mt-button",{attrs:{slot:"right"},on:{click:function(e){return t.del()}},slot:"right"},[s("span",[t._v("删除")])])],1):t._e(),s("div",{staticClass:"content",class:{"hide-header":!t.isShowHeader}},[s("div",{staticClass:"head"},[s("div",{staticClass:"con"},[s("span",[t._v("标题:")]),s("span",[t._v(t._s(t.workorder.title))])]),s("div",{staticClass:"con"},[s("span",[t._v("内容:")]),s("span",{domProps:{innerHTML:t._s(t.workorder.content)}})]),s("div",{staticClass:"con"},[s("span",[t._v("电话:")]),s("span",[t._v(t._s(t.workorder.phone||"未预留电话号码"))])]),s("div",{staticClass:"con"},[s("span",[t._v("邮箱:")]),s("span",[t._v(t._s(t.workorder.email||"未预留邮箱"))])]),s("div",{staticClass:"con"},[s("span",[t._v("时间:")]),s("span",[t._v(t._s(t.$formatDate(t.workorder.create_at)))])]),s("div",{staticClass:"con"},[s("span",[t._v("状态:")]),s("span",[1==t.workorder.status?s("i",{staticStyle:{color:"#8bc34a"}},[t._v("已回复")]):t._e(),3==t.workorder.status?s("i",{staticStyle:{color:"#ccc"}},[t._v("已结束")]):t._e(),0==t.workorder.status?s("i",{staticStyle:{color:"#FF9800"}},[t._v("待处理")]):t._e(),2==t.workorder.status?s("i",{staticStyle:{color:"#FF9800"}},[t._v("待回复")]):t._e()])])]),s("div",{staticClass:"comments"},[t.comments.length<=0?s("div",{staticClass:"no-data"},[t._v("暂无回复内容,请您耐心等待~")]):t._l(t.comments,(function(e,o){return[s("div",{key:o,staticClass:"item"},[s("div",{staticClass:"avatar"},["0"==e.aid?s("img",{attrs:{src:t.userInfo.avatar||"http://qiniu.cmp520.com/avatar_degault_3.png",alt:""}}):s("img",{attrs:{src:e.avatar||"http://qiniu.cmp520.com/avatar_degault_3.png",alt:""}})]),s("div",{staticClass:"right"},["0"==e.aid?s("div",{staticClass:"nickname"},[t._v("我")]):s("div",{staticClass:"nickname"},[t._v(t._s(e.nickname))]),s("div",{staticClass:"detail",domProps:{innerHTML:t._s(e.content)}}),s("div",{staticClass:"date"},[t._v(t._s(t.$formatDate(e.create_at)))])])])]})),3==t.workorder.status?s("div",{staticClass:"workorder-close"},[t._v("工单已结束~")]):t._e()],2),""!=t.request.source||t.isShowUploadLoading?s("div",{staticClass:"file-view"},[t.isShowUploadLoading?s("span",[s("img",{attrs:{src:o("cf1c"),alt:""}}),s("i",[t._v("上传中~")])]):s("span",[s("img",{attrs:{src:o("269c"),alt:""}}),s("i",[t._v("你已成功添加附件,重新上传可替换~")])])]):t._e(),3!=t.workorder.status?s("div",{staticClass:"input-form"},[s("textarea",{directives:[{name:"model",rawName:"v-model",value:t.request.content,expression:"request.content"}],attrs:{placeholder:"请输入内容~"},domProps:{value:t.request.content},on:{blur:function(e){return t.inputBlur()},input:function(e){e.target.composing||t.$set(t.request,"content",e.target.value)}}}),s("span",{staticClass:"icon-btn"},[s("input",{attrs:{type:"file",onclick:"this.value = null"},on:{change:t.uploadFile}})]),s("span",{staticClass:"sub-btn",on:{click:function(e){return t.reply()}}},[t._v("提交")])]):t._e()])],1)},r=[],a=(o("8e6e"),o("ac6a"),o("456d"),o("bd86")),n=o("2f62"),i=o("76a0"),c=o("bc3a"),l=o.n(c);function u(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.push.apply(o,s)}return o}function d(t){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?u(Object(o),!0).forEach((function(e){Object(a["a"])(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):u(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}var A={name:"workorder_detail",components:{},data:function(){return{isShowUploadLoading:!1,isSubmit:!1,workorder:{},comments:[],fileType:"",request:{source:"",content:""}}},computed:d({},Object(n["b"])(["isShowHeader","workorders","userInfo","workorderTypes","uploadToken"])),created:function(){var t=this;document.title="工单详细";var e=this.$route.params.id;this.$store.commit("updateState",{isShowPageLoading:!0}),l.a.all([this.getWorkOrder(e),this.getComments(e)]).then(l.a.spread((function(){t.$store.commit("updateState",{isShowPageLoading:!1})})))},methods:{getWorkOrder:function(t){var e=this;return l.a.get("/public/workorder/"+t).then((function(t){e.workorder=t.data.data,setTimeout((function(){return e.$previewRefresh()}),200)})).catch((function(t){console.log(t)}))},getComments:function(t){var e=this;return l.a.get("/public/workorder/comments/"+t).then((function(t){null!=t.data.data&&(e.comments=t.data.data,setTimeout((function(){return e.$previewRefresh()}),200))})).catch((function(t){console.log(t)}))},reply:function(){var t=this,e=this.request.content+this.request.source;if(""!=e.trim()){if(!this.isSubmit){this.isSubmit=!0;var o=this.workorder.id;l.a.post("/public/workorder/reply",{wid:o,content:e}).then((function(e){t.isSubmit=!1,console.log(e),t.getComments(o),t.request={source:"",content:""},document.querySelector(".container").scrollTop=1e4})).catch((function(e){t.isSubmit=!1,console.log(e),Object(i["Toast"])({message:"提交失败~"})}))}}else Object(i["Toast"])({message:"请输入内容~"})},inputBlur:function(){setTimeout((function(){document.body.scrollTo=0,window.scrollTo(0,0)}),100)},uploadFile:function(t){var e=t.target,o=e.files[0];this.isShowUploadLoading=!0;var s=this;this.$uploadFile({file:o,mode:this.uploadToken.mode,percent:function(){},success:function(t){var e;s.isShowUploadLoading=!1;var o=s.uploadToken.host+"/"+t,r=t.substr(t.lastIndexOf(".")+1);-1!="jpg,jpeg,png,JPG,JPEG,PNG".indexOf(r)?e="<br><img style='max-width:60%' preview='1' src='"+o+"' />":(e="<br><img style='width:20px;height:30px;top:3px; right:3px;position: relative;' preview='1' src='http://qiniu.cmp520.com/fj.png' />",e+="<a target='_blank' href='"+o+"'>下载附件</a>"),s.request.source=e,Object(i["Toast"])({message:"上传成功~"})},fail:function(t){s.isShowUploadLoading=!1,t.response&&t.response.data&&Object(i["Toast"])({message:t.response.data.message})}})},close:function(){var t=this,e=this.workorder.id;i["MessageBox"].confirm("您确定关闭该工单吗?").then((function(){l.a.put("/public/workorder/close/"+e).then((function(o){console.log(o),Object(i["Toast"])({message:"工单已关闭~"}),t.getWorkOrder(e)})).catch((function(t){Object(i["Toast"])({message:"工单关闭失败~"}),console.log(t)}))}))},del:function(){var t=this,e=this.workorder.id;i["MessageBox"].confirm("您确定删除该工单吗?").then((function(){l.a.delete("/public/workorder/"+e).then((function(e){console.log(e),Object(i["Toast"])({message:"工单已删除~"}),setTimeout((function(){return t.$router.go(-1)}))})).catch((function(t){Object(i["Toast"])({message:"工单关闭失败~"}),console.log(t)}))}))}}},p=A,g=(o("550d"),o("2877")),m=Object(g["a"])(p,s,r,!1,null,"1d2064aa",null);e["default"]=m.exports},"550d":function(t,e,o){"use strict";var s=o("0d1c"),r=o.n(s);r.a},cf1c:function(t,e){t.exports="data:image/gif;base64,R0lGODlhEAAQAKIGAMLY8YSx5HOm4Mjc88/g9Ofw+v///wAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQFCgAGACwAAAAAEAAQAAADMGi6RbUwGjKIXCAA016PgRBElAVlG/RdLOO0X9nK61W39qvqiwz5Ls/rRqrggsdkAgAh+QQFCgAGACwCAAAABwAFAAADD2hqELAmiFBIYY4MAutdCQAh+QQFCgAGACwGAAAABwAFAAADD1hU1kaDOKMYCGAGEeYFCQAh+QQFCgAGACwKAAIABQAHAAADEFhUZjSkKdZqBQG0IELDQAIAIfkEBQoABgAsCgAGAAUABwAAAxBoVlRKgyjmlAIBqCDCzUoCACH5BAUKAAYALAYACgAHAAUAAAMPaGpFtYYMAgJgLogA610JACH5BAUKAAYALAIACgAHAAUAAAMPCAHWFiI4o1ghZZJB5i0JACH5BAUKAAYALAAABgAFAAcAAAMQCAFmIaEp1motpDQySMNFAgA7"}}]);
//# sourceMappingURL=chunk-c5fee4c4.1073caa4.js.map
\ No newline at end of file
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
File mode changed
......@@ -169,6 +169,7 @@ func init() {
beego.NSRouter("/type/:id", &controllers.WorkOrderController{}, "get:GetWorkType"),
beego.NSRouter("/types", &controllers.WorkOrderController{}, "get:GetWorkTypes"),
beego.NSRouter("/close", &controllers.WorkOrderController{}, "post:CloseWorkOrder"),
beego.NSRouter("/list", &controllers.WorkOrderController{}, "post:GetWorkOrders"),
),
)
beego.AddNamespace(ns)
......
......@@ -12,7 +12,7 @@ import (
type ContactRepositoryInterface interface {
GetContact(id int64) *models.Contact
GetContacts(uid int64) ([]models.ContactDto, error)
UpdateIsSessionEnd(usersID []int64, isSessionEnd int) (int64, error)
UpdateIsSessionEnd(uid int64) (int64, error)
Update(id int64, params *orm.Params) (int64, error)
Delete(id int64, uid int64) (int64, error)
DeleteAll(uid int64) (int64, error)
......@@ -85,8 +85,8 @@ func (r *ContactRepository) GetContactWithIds(ids ...int64) (*models.Contact, er
}
// UpdateIsSessionEnd update
func (r *ContactRepository) UpdateIsSessionEnd(usersID []int64, isSessionEnd int) (int64, error) {
res, err := r.o.Raw("UPDATE contact SET is_session_end = 1 WHERE to_account IN(?,?) AND from_account IN(?,?)", usersID, usersID).Exec()
func (r *ContactRepository) UpdateIsSessionEnd(uid int64) (int64, error) {
res, err := r.o.Raw("UPDATE contact SET is_session_end = 1 WHERE from_account = ?", uid).Exec()
rows, _ := res.RowsAffected()
if err != nil {
logs.Warn(" UpdateIsSessionEnd update------------", err)
......
......@@ -33,9 +33,9 @@ func GetUserRepositoryInstance() *UserRepository {
return instance
}
// CheckUsersLoginTimeOutAndSetOffline Check if user login timeout
func (r *UserRepository) CheckUsersLoginTimeOutAndSetOffline(lastMessageUnixTimer int64) int64 {
count, err := r.q.Filter("online__in", 1, 2).Filter("last_activity__lte", lastMessageUnixTimer).Update(orm.Params{
// CheckUsersLoginTimeOutAndSetOffline Check if user login timeout
func (r *UserRepository) CheckUsersLoginTimeOutAndSetOffline(userOffLineUnixTimer int64) int64 {
count, err := r.q.Filter("online__in", 1, 2).Filter("last_activity__lte", userOffLineUnixTimer).Update(orm.Params{
"online": 0,
"remote_addr": "",
"token": "",
......
......@@ -2,6 +2,7 @@ package services
import (
"kefu_server/models"
"strconv"
"time"
"github.com/astaxie/beego/logs"
......@@ -10,6 +11,7 @@ import (
// WorkOrderRepositoryInterface interface
type WorkOrderRepositoryInterface interface {
GetWorkOrders(request models.WorkOrderPaginationDto) (models.WorkOrderPaginationDto, error)
GetWorkOrder(id int64) (models.WorkOrder, error)
GetUserWorkOrders(uid int64) ([]models.WorkOrder, error)
Update(id int64, params *orm.Params) (int64, error)
......@@ -70,6 +72,35 @@ func (r *WorkOrderRepository) GetWorkOrder(id int64) (models.WorkOrder, error) {
return workOrder, err
}
// GetWorkOrders get WorkOrders
func (r *WorkOrderRepository) GetWorkOrders(request models.WorkOrderPaginationDto) (models.WorkOrderPaginationDto, error) {
statusSQL := ""
if request.Status >= 0 {
statusSQL = " AND `status` = " + strconv.Itoa(request.Status) + " "
}
tidSQL := ""
if request.Tid != 0 {
tidSQL = " ADN `t_i_d` = " + strconv.FormatInt(request.Tid, 10) + " "
}
if request.PageSize == 0 {
request.PageSize = 10
}
if request.PageOn == 0 {
request.PageOn = 1
}
var maps []orm.Params
SQL := "SELECT *,t_i_d AS tid,c_i_d AS cid FROM (SELECT w.*,u.nickname FROM work_order w LEFT JOIN (SELECT id, nickname FROM `user`) u ON w.uid = u.id) w WHERE `delete` = 0 " + statusSQL + tidSQL + " ORDER BY id,create_at,update_at DESC"
_, err := r.o.Raw(SQL+" LIMIT ? OFFSET ?", request.PageSize, (request.PageOn-1)*request.PageSize).Values(&maps)
if err != nil {
logs.Warn("GetWorkOrders get WorkOrders------------", err)
request.List = []int{}
}
total, _ := r.o.Raw(SQL).Values(&maps)
request.List = maps
request.Total = total
return request, err
}
// Delete delete WorkOrder
func (r *WorkOrderRepository) Delete(id int64) (int64, error) {
row, err := r.q.Filter("id", id).Update(orm.Params{
......
......@@ -14,7 +14,7 @@ import (
func appTask() {
// Task scheduling (will be executed once every 5 minute)
checkOnLineTk := toolbox.NewTask("checkOnLine", "0 */5 * * * *", func() error {
checkOnLineTk := toolbox.NewTask("checkOnLine", "0 */1 * * * *", func() error {
// timers
userOffLineUnixTimer := time.Now().Unix() - (60 * 10) // User's last activity time T out online status rule
......@@ -22,7 +22,7 @@ func appTask() {
lastMessageUnixTimer := time.Now().Unix() - (60 * 8) // Determine if the user will not use it for a certain period of time and force them to go offline
// user
userOfflineCount := services.GetUserRepositoryInstance().CheckUsersLoginTimeOutAndSetOffline(lastMessageUnixTimer)
userOfflineCount := services.GetUserRepositoryInstance().CheckUsersLoginTimeOutAndSetOffline(userOffLineUnixTimer)
logs.Info("清理登录超时user", userOfflineCount, "个被强制下线")
// admin
......@@ -39,6 +39,9 @@ func appTask() {
logs.Info("清理会话超时用户,有", len(contacts), "个被结束对话")
for _, contact := range contacts {
// set end is session end
services.GetContactRepositoryInstance().UpdateIsSessionEnd(contact.FromAccount)
// Does not handle customer service
if admin := services.GetAdminRepositoryInstance().GetAdmin(contact.FromAccount); admin != nil {
continue
......@@ -61,9 +64,10 @@ func appTask() {
var messageString string
messageString = utils.InterfaceToString(message)
utils.PushMessage(contact.FromAccount, messageString)
utils.MessageInto(message)
// Send a reminder message to customer service
message.FromAccount = contact.FromAccount
message.FromAccount = robot.ID
message.ToAccount = contact.ToAccount
message.Payload = "用户长时间无应答,会话结束"
if _lastBackAdmin == nil {
......
......@@ -23,7 +23,15 @@
<span slot="title">工作台</span>
</div>
</el-badge>
</el-menu-item>
</el-menu-item>
<el-menu-item index="/workorder">
<el-badge :hidden="$store.getters.readCount == 0" :value="$store.getters.readCount" :max="99" style="width: 100%;">
<div>
<i class="el-icon-tickets"></i>
<span slot="title">工单系统</span>
</div>
</el-badge>
</el-menu-item>
<el-menu-item index="/knowledge">
<i class="el-icon-reading"></i>
<span slot="title">知识库</span>
......@@ -89,6 +97,9 @@ export default {
case "/customer":
title = "客服管理"
break
case "/workorder":
title = "工单管理"
break
case "/users":
title = "用户管理"
break
......
......@@ -14,7 +14,7 @@ moment.locale("zh-cn", momentLocal)
import axios from 'axios'
axios.defaults.baseURL = '/v1'
axios.defaults.baseURL = '/api'
// 添加请求拦截器
axios.interceptors.request.use((config) => {
......
......@@ -45,6 +45,10 @@ export default new Router({
path: 'chat_record',
component: () => import('./views/record/index.vue')
},
{
path: 'workorder',
component: () => import('./views/workorder/index.vue')
}
]
},
{
......
......@@ -17,7 +17,6 @@
<div class="mini-im-chat-message-box" :class="{'self': item.from_account != seviceCurrentUser.id}" v-for="(item, index) in messages" :key="index">
<!-- 用户信息 -->
<template v-if="item.biz_type == 'text' || item.biz_type == 'photo' || item.biz_type == 'knowledge' || item.biz_type == 'knowledge_list'">
......
<template>
<div>
<div class="me-head">
<span>
<i class="el-icon-tickets"></i>
<span slot="title">工单系统</span>
</span>
<el-button size="mini">设置</el-button>
</div>
<el-divider />
<el-table :data="tableData.list" style="width: 100%" v-loading="loading">
<el-table-column type="index" :index="indexMethod" width="60"></el-table-column>
<el-table-column prop="nickname" label="用户"></el-table-column>
<el-table-column prop="title" label="工单标题"></el-table-column>
<el-table-column prop="status" label="当前状态">
<template slot-scope="scope">
<el-tag type="warning" v-if="scope.row.status == 0">待处理</el-tag>
<el-tag type="warning" v-if="scope.row.status == 1">待回复</el-tag>
<el-tag type="success" v-if="scope.row.status == 2">已回复</el-tag>
<el-tag type="info" v-if="scope.row.status == 3">已结束</el-tag>
</template>
</el-table-column>
<el-table-column prop="create_at" label="创建时间">
<template slot-scope="scope">{{$formatUnixDate(scope.row.create_at, "YYYY/MM/DD")}}</template>
</el-table-column>
<el-table-column prop="operating" align="center" width="150" label="操作">
<template>
<el-button size="mini">查 看</el-button>
</template>
</el-table-column>
</el-table>
<el-row type="flex" style="margin-top: 20px;" justify="space-between">
<span style="color:#666;font-size: 14px;">共找到{{tableData.total}}条数据</span>
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
layout="sizes, prev, pager, next"
:current-page="tableData.page_on"
:page-sizes="[5, 10, 15, 20]"
:total="tableData.total"
></el-pagination>
</el-row>
</div>
</template>
<script>
import axios from "axios";
export default {
name: 'workorder-index',
data(){
return {
loading: true,
tableData: {
list: [],
page_on: 1,
page_size: 10,
total: 0,
status: -1,
tid: 0,
},
}
},
created() {
setTimeout(() => {
this.getWorkorderList();
}, 500);
},
methods: {
// 行号
indexMethod(index) {
return (
(this.tableData.page_on - 1) * this.tableData.page_size + index + 1
);
},
// 获取数据
getWorkorderList(index) {
if (index) this.tableData.page_on = index;
const { page_on, page_size, tid, status } = this.tableData;
axios
.post("/workorder/list", { page_on, page_size, tid, status })
.then(response => {
this.loading = false;
this.tableData = response.data.data;
})
.catch(error => {
this.loading = false;
this.$message.error(error.response.data.message);
});
},
// 改变每页条数
handleSizeChange(val) {
this.tableData.page_size = val;
this.getKnowledgeList();
},
// 分页
handleCurrentChange(val) {
this.tableData.page_on = val;
this.getKnowledgeList();
},
}
}
</script>
<style scoped lang="stylus">
.me-head {
height: 30px;
display: flex;
align-items: center;
font-size: 20px;
justify-content: space-between;
color: #666;
i {
margin-right: 5px;
}
}
</style>
......@@ -10,7 +10,7 @@
</mt-button>
</mt-header>
<div class="list" :class="{'hide-header': !isShowHeader}">
<div class="no-data" v-if="workorders.lenght <= 0">
<div class="no-data" v-if="workorders.length <= 0">
<img src="../assets/workorder.png" alt="">
<div>您还没有发布过工单~</div>
</div>
......@@ -79,7 +79,7 @@ export default {
}
div{
color #666
font-size 12px
font-size 14px
}
}
.list{
......
......@@ -31,8 +31,8 @@
</div>
<div class="field-line arrow-right file">
<span>附件:</span>
<span>{{file || '上传附件'}}</span>
<input type="file" />
<span :class="{'ed': source != ''}">{{source ? '已上传附件,重新上传可替换~' : '上传附件'}}</span>
<input type="file" @change="uploadFile" />
</div>
<span class="sub-btn" @click="submit()">提交</span>
</div>
......@@ -69,7 +69,7 @@ export default {
"email": ""
},
selectTyped: "",
file: "",
source: "",
isShowTypesPicker: false
};
},
......@@ -113,6 +113,44 @@ export default {
}
console.log(_)
},
uploadFile(e) {
var fileDom = e.target;
var file = fileDom.files[0];
this.isShowUploadLoading = true;
const self = this;
this.$uploadFile({
file,
mode: this.uploadToken.mode,
// 七牛才会执行
percent() {},
success(src) {
self.isShowUploadLoading = false;
var html
var fullPath = self.uploadToken.host + "/" + src;
var fileType = src.substr(src.lastIndexOf(".") + 1);
if ("jpg,jpeg,png,JPG,JPEG,PNG".indexOf(fileType) != -1) {
html = "<br><img style='max-width:60%' preview='1' src='" + fullPath + "' />"
}else{
html = "<br><img style='width:20px;height:30px;top:3px; right:3px;position: relative;' preview='1' src='http://qiniu.cmp520.com/fj.png' />"
html += "<a target='_blank' href='"+fullPath+"'>下载附件</a>"
}
self.source = html
Toast({
message: "上传成功~"
});
},
fail(e) {
self.isShowUploadLoading = false;
if (e.response && e.response.data) {
Toast({
message: e.response.data.message
});
return;
}
}
});
},
submit(){
if(this.request.tid == 0){
Toast({
......@@ -134,6 +172,7 @@ export default {
}
if(this.isSubmit) return
this.isSubmit = true
this.request.content += this.source
axios
.post("/public/workorder/create", this.request)
.then(response => {
......@@ -194,6 +233,9 @@ export default {
overflow hidden
margin-top 20px
border-top 1px solid #ddd
.ed{
color #8bc34a
}
input{
font-size 100px
opacity 0
......
......@@ -58,14 +58,14 @@
<div class="right">
<div class="nickname" v-if="item.aid == '0'"></div>
<div class="nickname" v-else>{{item.nickname}}</div>
<div class="detail" v-html="commentView(item.content)"></div>
<div class="detail" v-html="item.content"></div>
<div class="date">{{$formatDate(item.create_at)}}</div>
</div>
</div>
</template>
<div class="workorder-close" v-if="workorder.status == 3">工单已结束~</div>
</div>
<div class="file-view" v-if="request.file != '' || isShowUploadLoading">
<div class="file-view" v-if="request.source != '' || isShowUploadLoading">
<span v-if="isShowUploadLoading">
<img src="./../assets/loading.gif" alt />
<i>上传中~</i>
......@@ -100,7 +100,7 @@ export default {
comments: [],
fileType: "",
request: {
file: "",
source: "",
content: ""
}
};
......@@ -125,24 +125,12 @@ export default {
);
},
methods: {
commentView(comment) {
var res = comment.match(/\[file=(.*)\]/);
if (res == null) return comment;
var fileType = res[1].substr(res[1].lastIndexOf(".") + 1);
if ("jpg,jpeg,png,JPG,JPEG,PNG".indexOf(fileType) != -1) {
comment = comment.replace(
res[0],
"<br><img style='max-width:60%' preview='1' src='" + res[1] + "' />"
);
this.$previewRefresh();
}
return comment;
},
getWorkOrder(id) {
return axios
.get("/public/workorder/" + id)
.then(response => {
this.workorder = response.data.data;
setTimeout(()=>this.$previewRefresh(), 200)
})
.catch(error => {
console.log(error);
......@@ -154,13 +142,14 @@ export default {
.then(response => {
if (response.data.data == null) return;
this.comments = response.data.data;
setTimeout(()=>this.$previewRefresh(), 200)
})
.catch(error => {
console.log(error);
});
},
reply() {
const content = this.request.content + this.request.file;
const content = this.request.content + this.request.source;
if (content.trim() == "") {
Toast({
message: "请输入内容~"
......@@ -177,9 +166,10 @@ export default {
console.log(response);
this.getComments(wid);
this.request = {
file: "",
source: "",
content: ""
};
document.querySelector(".container").scrollTop = 10000
})
.catch(error => {
this.isSubmit = false
......@@ -206,9 +196,21 @@ export default {
// 七牛才会执行
percent() {},
success(src) {
self.request.file =
"[file=" + self.uploadToken.host + "/" + src + "]";
self.isShowUploadLoading = false;
var html
var fullPath = self.uploadToken.host + "/" + src;
var fileType = src.substr(src.lastIndexOf(".") + 1);
if ("jpg,jpeg,png,JPG,JPEG,PNG".indexOf(fileType) != -1) {
html = "<br><img style='max-width:60%' preview='1' src='" + fullPath + "' />"
}else{
html = "<br><img style='width:20px;height:30px;top:3px; right:3px;position: relative;' preview='1' src='http://qiniu.cmp520.com/fj.png' />"
html += "<a target='_blank' href='"+fullPath+"'>下载附件</a>"
}
self.request.source = html
Toast({
message: "上传成功~"
});
},
fail(e) {
self.isShowUploadLoading = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment