2 lines
11 KiB
JavaScript
Vendored
2 lines
11 KiB
JavaScript
Vendored
"use strict";(self["webpackChunkerp"]=self["webpackChunkerp"]||[]).push([[850],{1043:function(t,e,n){n.r(e),n.d(e,{default:function(){return p}});var a=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(n){return e("div",{key:n.id},[n.children?e("el-submenu",{attrs:{index:"/"+n.code}},[e("template",{slot:"title"},[e("span",[t._v(t._s(n.name))])]),t._l(n.children,(function(n){return e("el-menu-item",{key:n.id,attrs:{index:"/"+n.code}},[t._v(" "+t._s(n.name)+" ")])}))],2):e("el-menu-item",{attrs:{index:"/"+n.code}},[e("span",[t._v(t._s(n.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(n,a){return e("el-breadcrumb-item",{key:a},[t._v(t._s(n.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(n){return e("div",{staticClass:"item"},[e("div",{staticClass:"title",class:n.status?"":"notread"},[e("div",{staticClass:"tit"},[t._v(t._s(n.title))]),n.status?e("span",[t._v("已读")]):e("span",{staticClass:"not",on:{click:function(e){return t.markRead(n)}}},[t._v("标为已读")])]),e("div",{staticClass:"info"},[n.content?e("div",{staticClass:"tit",domProps:{innerHTML:t._s(n.content.replace(/\n/g,"<br/>"))}}):t._e(),e("div",{staticClass:"time"},[t._v(t._s(n.created_at))])])])})),0!=t.msgList.length||t.loading?t._e():e("div",[e("el-empty",{attrs:{description:"暂无消息"}})],1)],2),e("div",{staticClass:"bottom"},[e("div",["0"==t.curTopTab?e("el-button",{attrs:{icon:"el-icon-finished",disabled:!t.msgList.length},on:{click:function(e){return t.markHasRead()}}},[t._v("标记全部已读")]):t._e()],1),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)},r=[],i=(n(560),n(3695)),s=n(8430);function o(){return(0,s.Z)({url:"/api/menus",method:"get"})}var u=n(2900),l={mounted(){o().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=[],n={};for(var a=0;a<this.levelData.length;a++)n[this.levelData[a].name]||(e.push(this.levelData[a]),n[this.levelData[a].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,i.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 n=this.levelData[t].name;if(this.onindex=t,this.levelData.splice(this.onindex,1),e===this.head){var a,r;for(let t=0;t<this.levelData.length;t++)a=this.levelData[t].path,r=this.levelData[t].name;this.levelData.length&&r!==n&&this.$router.push({path:a})}},getNoReadNum(){let t={page:1,status:0};(0,u.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,u.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,u.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()},markHasRead(){let t=[];this.msgList.forEach((e=>{t.push(e.id)})),(0,u.Vb)({ids:t}).then((t=>{this.page=1,this.getMsgList(),this.getNoReadNum()}))}}},c=l,h=n(1001),d=(0,h.Z)(c,a,r,!1,null,"5d94a0ff",null),p=d.exports},2900:function(t,e,n){n.d(e,{A0:function(){return c},AX:function(){return u},Lh:function(){return i},RF:function(){return s},Uy:function(){return r},Vb:function(){return h},f7:function(){return o},nO:function(){return l}});var a=n(8430);function r(){return(0,a.Z)({url:"/api/roles",method:"get"})}function i(t){return(0,a.Z)({url:"/api/users",method:"get",params:t})}function s(t){return(0,a.Z)({url:"/api/users",method:"post",data:t})}function o(t){return(0,a.Z)({url:`/api/users/${t}`,method:"get"})}function u(t,e){return(0,a.Z)({url:`/api/users/${t}`,method:"patch",data:e})}function l(t){return(0,a.Z)({url:"/api/website_message",method:"get",params:t})}function c(t,e){return(0,a.Z)({url:`/api/website_message/${t}`,method:"patch",data:e})}function h(t){return(0,a.Z)({url:"/api/website_message/batchRead",method:"post",data:t})}},4328:function(t,e,n){var a=n(5290),r=n(7578),i=n(6310),s=function(t){return function(e,n,s){var o,u=a(e),l=i(u),c=r(s,l);if(t&&n!==n){while(l>c)if(o=u[c++],o!==o)return!0}else for(;l>c;c++)if((t||c in u)&&u[c]===n)return t||c||0;return!t&&-1}};t.exports={includes:s(!0),indexOf:s(!1)}},5649:function(t,e,n){var a=n(7697),r=n(2297),i=TypeError,s=Object.getOwnPropertyDescriptor,o=a&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();t.exports=o?function(t,e){if(r(t)&&!s(t,"length").writable)throw new i("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e}},8758:function(t,e,n){var a=n(6812),r=n(9152),i=n(2474),s=n(2560);t.exports=function(t,e,n){for(var o=r(e),u=s.f,l=i.f,c=0;c<o.length;c++){var h=o[c];a(t,h)||n&&a(n,h)||u(t,h,l(e,h))}}},5565:function(t){var e=TypeError,n=9007199254740991;t.exports=function(t){if(t>n)throw e("Maximum allowed index exceeded");return t}},2739:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},9989:function(t,e,n){var a=n(9037),r=n(2474).f,i=n(5773),s=n(1880),o=n(5014),u=n(8758),l=n(5266);t.exports=function(t,e){var n,c,h,d,p,f,g=t.target,m=t.global,v=t.stat;if(c=m?a:v?a[g]||o(g,{}):a[g]&&a[g].prototype,c)for(h in e){if(p=e[h],t.dontCallGetSet?(f=r(c,h),d=f&&f.value):d=c[h],n=l(m?h:g+(v?".":"#")+h,t.forced),!n&&void 0!==d){if(typeof p==typeof d)continue;u(p,d)}(t.sham||d&&d.sham)&&i(p,"sham",!0),s(c,h,p,t)}}},4413:function(t,e,n){var a=n(8844),r=n(3689),i=n(6648),s=Object,o=a("".split);t.exports=r((function(){return!s("z").propertyIsEnumerable(0)}))?function(t){return"String"===i(t)?o(t,""):s(t)}:s},2297:function(t,e,n){var a=n(6648);t.exports=Array.isArray||function(t){return"Array"===a(t)}},5266:function(t,e,n){var a=n(3689),r=n(9985),i=/#|\.prototype\./,s=function(t,e){var n=u[o(t)];return n===c||n!==l&&(r(e)?a(e):!!e)},o=s.normalize=function(t){return String(t).replace(i,".").toLowerCase()},u=s.data={},l=s.NATIVE="N",c=s.POLYFILL="P";t.exports=s},6310:function(t,e,n){var a=n(3126);t.exports=function(t){return a(t.length)}},8828:function(t){var e=Math.ceil,n=Math.floor;t.exports=Math.trunc||function(t){var a=+t;return(a>0?n:e)(a)}},2474:function(t,e,n){var a=n(7697),r=n(2615),i=n(9556),s=n(5684),o=n(5290),u=n(8360),l=n(6812),c=n(8506),h=Object.getOwnPropertyDescriptor;e.f=a?h:function(t,e){if(t=o(t),e=u(e),c)try{return h(t,e)}catch(n){}if(l(t,e))return s(!r(i.f,t,e),t[e])}},2741:function(t,e,n){var a=n(4948),r=n(2739),i=r.concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return a(t,i)}},7518:function(t,e){e.f=Object.getOwnPropertySymbols},4948:function(t,e,n){var a=n(8844),r=n(6812),i=n(5290),s=n(4328).indexOf,o=n(7248),u=a([].push);t.exports=function(t,e){var n,a=i(t),l=0,c=[];for(n in a)!r(o,n)&&r(a,n)&&u(c,n);while(e.length>l)r(a,n=e[l++])&&(~s(c,n)||u(c,n));return c}},9556:function(t,e){var n={}.propertyIsEnumerable,a=Object.getOwnPropertyDescriptor,r=a&&!n.call({1:2},1);e.f=r?function(t){var e=a(this,t);return!!e&&e.enumerable}:n},9152:function(t,e,n){var a=n(6058),r=n(8844),i=n(2741),s=n(7518),o=n(5027),u=r([].concat);t.exports=a("Reflect","ownKeys")||function(t){var e=i.f(o(t)),n=s.f;return n?u(e,n(t)):e}},7578:function(t,e,n){var a=n(8700),r=Math.max,i=Math.min;t.exports=function(t,e){var n=a(t);return n<0?r(n+e,0):i(n,e)}},5290:function(t,e,n){var a=n(4413),r=n(4684);t.exports=function(t){return a(r(t))}},8700:function(t,e,n){var a=n(8828);t.exports=function(t){var e=+t;return e!==e||0===e?0:a(e)}},3126:function(t,e,n){var a=n(8700),r=Math.min;t.exports=function(t){var e=a(t);return e>0?r(e,9007199254740991):0}},560:function(t,e,n){var a=n(9989),r=n(690),i=n(6310),s=n(5649),o=n(5565),u=n(3689),l=u((function(){return 4294967297!==[].push.call({length:4294967296},1)})),c=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}},h=l||!c();a({target:"Array",proto:!0,arity:1,forced:h},{push:function(t){var e=r(this),n=i(e),a=arguments.length;o(n+a);for(var u=0;u<a;u++)e[n]=arguments[u],n++;return s(e,n),n}})}}]);
|
|
//# sourceMappingURL=850.3d04d1d4.js.map
|