erp/public/dist/js/171.6ac83b25.js

2 lines
6.1 KiB
JavaScript
Vendored

"use strict";(self["webpackChunkerp"]=self["webpackChunkerp"]||[]).push([[171],{3389:function(t,e,a){a.r(e),a.d(e,{default:function(){return m}});var s=function(){var t=this,e=t._self._c;return e("div",[e("el-container",[e("el-container",[e("el-aside",{class:t.show?"aside-show":"aside-hide"},[e("el-menu",{attrs:{router:"","background-color":"#282c34","unique-opened":!0,"text-color":"#fff","default-active":t.$route.path,"default-openeds":t.openeds}},t._l(t.menu,(function(a){return e("div",{key:a.id},[a.children?e("el-submenu",{attrs:{index:"/"+a.code}},[e("template",{slot:"title"},[e("span",[t._v(t._s(a.name))])]),t._l(a.children,(function(a){return e("el-menu-item",{key:a.id,attrs:{index:"/"+a.code}},[t._v(" "+t._s(a.name)+" ")])}))],2):e("el-menu-item",{attrs:{index:"/"+a.code}},[e("span",[t._v(t._s(a.name))])])],1)})),0)],1),e("el-main",[e("div",{staticClass:"head"},[e("ul",[e("li",[e("div",{staticClass:"add",on:{click:t.add}},[t.show?e("i",{staticClass:"el-icon-s-unfold"}):e("i",{staticClass:"el-icon-s-fold"})]),e("div",{staticClass:"right"},[e("el-breadcrumb",{attrs:{"separator-class":"el-icon-arrow-right"}},t._l(t.titie,(function(a,s){return e("el-breadcrumb-item",{key:s},[t._v(t._s(a.name))])})),1)],1)]),e("li",[e("div",{staticClass:"msg",on:{click:t.openMessage}},[e("el-badge",{attrs:{hidden:0==t.noReadNum,value:t.noReadNum,max:99}},[e("i",{staticClass:"el-icon-message"})])],1),e("div",{staticStyle:{"margin-right":"10px"}},[t._v(t._s(t.usernmae))]),e("div",{staticClass:"token",on:{click:t.hanleLogout}},[t._v("登出")])])])]),e("div",{staticClass:"box-card"},[e("router-view")],1)])],1)],1),e("el-dialog",{attrs:{visible:t.showMsg,title:"站内信",width:"1100px","custom-class":"vanmsgbox"},on:{"update:visible":function(e){t.showMsg=e},close:function(e){t.showMsg=!1}}},[e("div",{staticClass:"msgbox"},[e("el-tabs",{attrs:{type:"border-card"},on:{"tab-click":t.handleTabClick},model:{value:t.curTopTab,callback:function(e){t.curTopTab=e},expression:"curTopTab"}},[e("el-tab-pane",{attrs:{name:"0"},scopedSlots:t._u([{key:"label",fn:function(){return[e("span",[t._v("未读消息")]),0!==t.noReadNum?e("span",{staticClass:"numtag"},[t._v(t._s(t.noReadNum))]):t._e()]},proxy:!0}])}),e("el-tab-pane",{attrs:{label:"已读消息",name:"1"}})],1),e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"listbox"},[t._l(t.msgList,(function(a){return e("div",{staticClass:"item"},[e("div",{staticClass:"title",class:a.status?"":"notread"},[e("div",{staticClass:"tit"},[t._v(t._s(a.title))]),a.status?e("span",[t._v("已读")]):e("span",{staticClass:"not",on:{click:function(e){return t.markRead(a)}}},[t._v("标为已读")])]),e("div",{staticClass:"info"},[a.content?e("div",{staticClass:"tit",domProps:{innerHTML:t._s(a.content.replace(/\n/g,"<br/>"))}}):t._e(),e("div",{staticClass:"time"},[t._v(t._s(a.created_at))])])])})),0!=t.msgList.length||t.loading?t._e():e("div",[e("el-empty",{attrs:{description:"暂无消息"}})],1)],2),e("div",{staticClass:"bottom"},[e("el-pagination",{attrs:{"current-page":t.page,"page-sizes":[10,20,50,100],"page-size":t.pageSize,layout:"prev, pager, next, sizes, total",total:t.total},on:{"current-change":t.handleCurrentChange,"size-change":t.handleSizeChange}})],1)],1)])],1)},i=[],n=(a(560),a(3695)),o=a(8430);function l(){return(0,o.Z)({url:"/api/menus",method:"get"})}var r=a(2900),u={mounted(){l().then((t=>{this.menu=t.data.data})),this.usernmae=localStorage.getItem("userName"),this.getNoReadNum()},data(){return{menu:[],show:!1,levelData:[],titie:[],head:"",onindex:0,openeds:["GOODS_MANAGE"],usernmae:"",noReadNum:0,total:0,msgList:[],page:1,pageSize:10,showMsg:!1,curTopTab:"2",loading:!1}},watch:{$route:{handler:function(t){this.titie=t.matched,this.head=t.name,this.levelData.push({name:t.name,path:t.path});const e=[],a={};for(var s=0;s<this.levelData.length;s++)a[this.levelData[s].name]||(e.push(this.levelData[s]),a[this.levelData[s].name]=!0);this.levelData=e},deep:!0,immediate:!0}},methods:{next(){this.hanletop()},hanletop(){document.getElementById("bottom").scrollIntoView({behavior:"smooth"})},hanlebottom(){document.getElementById("top").scrollIntoView({behavior:"smooth"})},hanleLogout(){(0,n.gy)(),localStorage.removeItem("token"),localStorage.removeItem("userName"),this.$router.push({path:"/Login"})},handlerclick(t){this.$route.path!==t&&this.$router.push({path:t})},add(){this.show=!this.show},hanblDelete(t,e){var a=this.levelData[t].name;if(this.onindex=t,this.levelData.splice(this.onindex,1),e===this.head){var s,i;for(let t=0;t<this.levelData.length;t++)s=this.levelData[t].path,i=this.levelData[t].name;this.levelData.length&&i!==a&&this.$router.push({path:s})}},getNoReadNum(){let t={page:1,status:0};(0,r.nO)(t).then((t=>{this.noReadNum=t.data.meta.total}))},openMessage(){this.curTopTab="0",this.showMsg=!0,this.page=1,this.getMsgList()},getMsgList(){this.loading=!0;let t={page:this.page,per_page:this.pageSize,status:"2"==this.curTopTab?"":this.curTopTab};(0,r.nO)(t).then((t=>{this.msgList=t.data.data,this.total=t.data.meta.total,this.loading=!1})).catch((()=>{this.loading=!1}))},handleTabClick(){this.page=1,this.getMsgList()},markRead(t){(0,r.A0)(t.id,{status:1}).then((e=>{t.status=1,this.getNoReadNum()}))},handleCurrentChange(t){this.page=t,this.getMsgList()},handleSizeChange(t){this.page=1,this.pageSize=t,this.getMsgList()}}},h=u,d=a(1001),c=(0,d.Z)(h,s,i,!1,null,"323fd9eb",null),m=c.exports},2900:function(t,e,a){a.d(e,{A0:function(){return h},AX:function(){return r},Lh:function(){return n},RF:function(){return o},Uy:function(){return i},f7:function(){return l},nO:function(){return u}});var s=a(8430);function i(){return(0,s.Z)({url:"/api/roles",method:"get"})}function n(t){return(0,s.Z)({url:"/api/users",method:"get",params:t})}function o(t){return(0,s.Z)({url:"/api/users",method:"post",data:t})}function l(t){return(0,s.Z)({url:`/api/users/${t}`,method:"get"})}function r(t,e){return(0,s.Z)({url:`/api/users/${t}`,method:"patch",data:e})}function u(t){return(0,s.Z)({url:"/api/website_message",method:"get",params:t})}function h(t,e){return(0,s.Z)({url:`/api/website_message/${t}`,method:"patch",data:e})}}}]);
//# sourceMappingURL=171.6ac83b25.js.map