travel/service/public/static/js/chunk-2681d490.4d9bd73c.js

1 line
9.8 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2681d490"],{"09f4":function(t,e,a){"use strict";a.d(e,"a",(function(){return l})),Math.easeInOutQuad=function(t,e,a,i){return t/=i/2,t<1?a/2*t*t+e:(t--,-a/2*(t*(t-2)-1)+e)};var i=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}}();function n(t){document.documentElement.scrollTop=t,document.body.parentNode.scrollTop=t,document.body.scrollTop=t}function o(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function l(t,e,a){var l=o(),s=t-l,r=20,c=0;e="undefined"===typeof e?500:e;var u=function t(){c+=r;var o=Math.easeInOutQuad(c,l,s,e);n(o),c<e?i(t):a&&"function"===typeof a&&a()};u()}},2953:function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"app-container"},[a("div",{staticClass:"filter-container"},[a("el-input",{staticClass:"filter-item",staticStyle:{width:"200px","margin-right":"10px"},attrs:{placeholder:"用户名"},model:{value:t.listQuery.username,callback:function(e){t.$set(t.listQuery,"username",e)},expression:"listQuery.username"}}),a("el-button",{staticClass:"filter-item",attrs:{type:"primary",icon:"el-icon-search"},on:{click:t.getList}},[t._v(" 搜索 ")]),a("el-button",{staticClass:"filter-item",staticStyle:{"margin-left":"10px"},attrs:{type:"primary",icon:"el-icon-circle-plus"},on:{click:function(e){return t.handleCreate({})}}},[t._v(" 添加 ")])],1),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],staticStyle:{width:"100%"},attrs:{data:t.list,border:"",fit:"","highlight-current-row":""}},[a("el-table-column",{attrs:{align:"center",label:"操作",width:"200"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-edit"},on:{click:function(a){return t.handleCreate(e.row)}}},[t._v(" 修改 ")]),e.row.status?a("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-date"},on:{click:function(a){return t.onWork(e.row)}}},[t._v(" 排班 ")]):t._e()]}}])}),a("el-table-column",{attrs:{align:"center",label:"ID",width:"80",prop:"id"}}),a("el-table-column",{attrs:{align:"center",label:"用户名",width:"160",prop:"username"}}),a("el-table-column",{attrs:{align:"center",label:"姓名",width:"160",prop:"name"}}),a("el-table-column",{attrs:{align:"center",label:"手机",width:"160",prop:"mobile"}}),a("el-table-column",{attrs:{align:"center",label:"头像"},scopedSlots:t._u([{key:"default",fn:function(t){return[a("el-avatar",{attrs:{size:50,src:t.row.avatar}})]}}])}),a("el-table-column",{attrs:{"class-name":"status-col",label:"状态",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){var i=e.row;return[a("el-switch",{attrs:{"active-text":"启用","active-value":1,"inactive-value":0,"inactive-text":"禁用"},on:{change:function(e){return t.setStatus(i)}},model:{value:i.status,callback:function(e){t.$set(i,"status",e)},expression:"row.status"}})]}}])}),a("el-table-column",{attrs:{width:"180px",align:"center",label:"创建时间"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(t._f("parseTime")(e.row.create_time,"{y}-{m}-{d} {h}:{i}")))])]}}])}),a("el-table-column",{attrs:{width:"180px",align:"center",label:"修改时间"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(t._f("parseTime")(e.row.update_time,"{y}-{m}-{d} {h}:{i}")))])]}}])})],1),a("pagination",{directives:[{name:"show",rawName:"v-show",value:t.total>0,expression:"total>0"}],attrs:{total:t.total,page:t.listQuery.page,limit:t.listQuery.limit},on:{"update:page":function(e){return t.$set(t.listQuery,"page",e)},"update:limit":function(e){return t.$set(t.listQuery,"limit",e)},pagination:t.getList}}),a("el-dialog",{attrs:{title:"修改管理员",visible:t.dialogVisible},on:{"update:visible":function(e){t.dialogVisible=e}}},[a("el-form",{attrs:{"label-width":"120px",model:t.item}},[a("el-form-item",{attrs:{label:"用户名"}},[a("el-input",{attrs:{name:"username",placeholder:"管理员的用户名"},model:{value:t.item.username,callback:function(e){t.$set(t.item,"username",e)},expression:"item.username"}})],1),a("el-form-item",{attrs:{label:"姓名"}},[a("el-input",{attrs:{name:"name",placeholder:"管理员的姓名"},model:{value:t.item.name,callback:function(e){t.$set(t.item,"name",e)},expression:"item.name"}})],1),a("el-form-item",{attrs:{label:"手机"}},[a("el-input",{attrs:{name:"name",placeholder:"发送短时的时候会用到这个手机"},model:{value:t.item.mobile,callback:function(e){t.$set(t.item,"mobile",e)},expression:"item.mobile"}})],1),a("el-form-item",{attrs:{label:"密码"}},[a("el-input",{attrs:{type:"password",name:"password",placeholder:"管理员的新密码"},model:{value:t.item.password,callback:function(e){t.$set(t.item,"password",e)},expression:"item.password"}})],1),a("el-form-item",{attrs:{label:"是否分配"}},[a("el-switch",{attrs:{"active-text":"分配","active-value":1,"inactive-text":"不分配","inactive-value":0},model:{value:t.item.is_order,callback:function(e){t.$set(t.item,"is_order",e)},expression:"item.is_order"}})],1),a("el-form-item",{attrs:{label:"是否主播"}},[a("el-switch",{attrs:{"active-text":"主播","active-value":1,"inactive-text":"","inactive-value":0},model:{value:t.item.is_anchor,callback:function(e){t.$set(t.item,"is_anchor",e)},expression:"item.is_anchor"}})],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.onSave(t.item)}}},[t._v("保 存")])],1)],1),a("el-dialog",{attrs:{title:"添加排班",visible:t.dialogWork},on:{"update:visible":function(e){t.dialogWork=e}}},[a("el-form",{attrs:{"label-width":"120px",model:t.from}},[a("el-form-item",{attrs:{label:"上班日期"}},[a("el-date-picker",{staticStyle:{"margin-right":"10px"},attrs:{type:"dates",placeholder:"选择一个或多个日期"},model:{value:t.from.dates,callback:function(e){t.$set(t.from,"dates",e)},expression:"from.dates"}})],1),a("el-form-item",{attrs:{label:"上班时间段"}},[a("el-time-picker",{attrs:{"is-range":"","range-separator":"至","start-placeholder":"开始时间","end-placeholder":"结束时间",placeholder:"选择时间范围"},model:{value:t.from.time,callback:function(e){t.$set(t.from,"time",e)},expression:"from.time"}})],1),a("el-form-item",{attrs:{label:"渠道"}},[a("el-checkbox-group",{model:{value:t.from.oss,callback:function(e){t.$set(t.from,"oss",e)},expression:"from.oss"}},t._l(t.oss,(function(e,i,n){return a("el-checkbox",{key:n,attrs:{label:i}},[t._v(t._s(e))])})),1)],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.onWork()}}},[t._v("保 存")])],1)],1)],1)},n=[],o=a("333d"),l={name:"Adminlist",components:{Pagination:o["a"]},data:function(){return{list:[],oss:[],from:{oss:[]},total:0,listLoading:!0,listQuery:{page:1,limit:20},dialogVisible:!1,dialogWork:!1,item:{}}},created:function(){this.getList()},methods:{getList:function(){var t=this;this.$axios.get("/admin/admin/index",{params:this.listQuery}).then((function(e){t.list=e.data.data,t.total=e.data.total,t.oss=e.ext.oss,console.log(t.oss),t.listLoading=!1})).catch((function(t){}))},setStatus:function(t){var e=this;console.log(t),this.$axios.post("/admin/admin/disabled",t).then((function(t){e.$notify({title:"成功",message:"修改成功",type:"success",duration:2e3})})).catch((function(t){e.$notify({title:"成功",message:"修改失败",type:"error",duration:2e3})}))},handleCreate:function(t){this.dialogVisible=!0,this.item=t},onSave:function(t){var e=this;this.$axios.post("/admin/admin/save",t).then((function(t){e.item={},e.dialogVisible=!1,e.getList()})).catch((function(t){}))},onWork:function(t){var e=this;if(t)return this.item=t,this.from={oss:[]},void(this.dialogWork=!0);this.from.admin_id=this.item.id,this.$axios.post("/admin/work/saves",this.from).then((function(t){e.item={},e.dialogWork=!1})).catch((function(t){}))},setTime:function(t){console.log(t)}}},s=l,r=a("2877"),c=Object(r["a"])(s,i,n,!1,null,null,null);e["default"]=c.exports},"2cbf":function(t,e,a){"use strict";a("73e0")},"333d":function(t,e,a){"use strict";var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"pagination-container",class:{hidden:t.hidden}},[a("el-pagination",t._b({attrs:{background:t.background,"current-page":t.currentPage,"page-size":t.pageSize,layout:t.layout,"page-sizes":t.pageSizes,total:t.total},on:{"update:currentPage":function(e){t.currentPage=e},"update:current-page":function(e){t.currentPage=e},"update:pageSize":function(e){t.pageSize=e},"update:page-size":function(e){t.pageSize=e},"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}},"el-pagination",t.$attrs,!1))],1)},n=[],o=(a("a9e3"),a("09f4")),l={name:"Pagination",props:{total:{required:!0,type:Number},page:{type:Number,default:1},limit:{type:Number,default:20},pageSizes:{type:Array,default:function(){return[10,20,30,50]}},layout:{type:String,default:"total, sizes, prev, pager, next, jumper"},background:{type:Boolean,default:!0},autoScroll:{type:Boolean,default:!0},hidden:{type:Boolean,default:!1}},computed:{currentPage:{get:function(){return this.page},set:function(t){this.$emit("update:page",t)}},pageSize:{get:function(){return this.limit},set:function(t){this.$emit("update:limit",t)}}},methods:{handleSizeChange:function(t){this.$emit("pagination",{page:this.currentPage,limit:t}),this.autoScroll&&Object(o["a"])(0,800)},handleCurrentChange:function(t){this.$emit("pagination",{page:t,limit:this.pageSize}),this.autoScroll&&Object(o["a"])(0,800)}}},s=l,r=(a("2cbf"),a("2877")),c=Object(r["a"])(s,i,n,!1,null,"6af373ef",null);e["a"]=c.exports},"73e0":function(t,e,a){}}]);