travel/service/public/static/js/chunk-2681d490.faf4ff19.js

1 line
10 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2681d490"],{"09f4":function(t,e,i){"use strict";i.d(e,"a",(function(){return l})),Math.easeInOutQuad=function(t,e,i,a){return t/=a/2,t<1?i/2*t*t+e:(t--,-i/2*(t*(t-2)-1)+e)};var a=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,i){var l=o(),s=t-l,r=20,c=0;e="undefined"===typeof e?500:e;var u=function(){c+=r;var t=Math.easeInOutQuad(c,l,s,e);n(t),c<e?a(u):i&&"function"===typeof i&&i()};u()}},2953:function(t,e,i){"use strict";i.r(e);var a=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"app-container"},[i("div",{staticClass:"filter-container"},[i("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"}}),i("el-button",{staticClass:"filter-item",attrs:{type:"primary",icon:"el-icon-search"},on:{click:t.getList}},[t._v(" 搜索 ")]),i("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),i("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":""}},[i("el-table-column",{attrs:{align:"center",label:"操作",width:"200"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-edit"},on:{click:function(i){return t.handleCreate(e.row)}}},[t._v(" 修改 ")]),e.row.status?i("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-date"},on:{click:function(i){return t.onWork(e.row)}}},[t._v(" 排班 ")]):t._e()]}}])}),i("el-table-column",{attrs:{align:"center",label:"ID",width:"80",prop:"id"}}),i("el-table-column",{attrs:{align:"center",label:"用户名",width:"160",prop:"username"}}),i("el-table-column",{attrs:{align:"center",label:"姓名",width:"160",prop:"name"}}),i("el-table-column",{attrs:{align:"center",label:"手机",width:"160",prop:"mobile"}}),i("el-table-column",{attrs:{"class-name":"status-col",label:"状态",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[i("el-switch",{attrs:{"active-text":"启用","active-value":1,"inactive-value":0,"inactive-text":"禁用"},on:{change:function(e){return t.setStatus(a)}},model:{value:a.status,callback:function(e){t.$set(a,"status",e)},expression:"row.status"}})]}}])}),i("el-table-column",{attrs:{width:"180px",align:"center",label:"创建时间"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("span",[t._v(t._s(t._f("parseTime")(e.row.create_time,"{y}-{m}-{d} {h}:{i}")))])]}}])}),i("el-table-column",{attrs:{width:"180px",align:"center",label:"修改时间"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("span",[t._v(t._s(t._f("parseTime")(e.row.update_time,"{y}-{m}-{d} {h}:{i}")))])]}}])})],1),i("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}}),i("el-dialog",{attrs:{title:"修改管理员",visible:t.dialogVisible},on:{"update:visible":function(e){t.dialogVisible=e}}},[i("el-form",{attrs:{"label-width":"120px",model:t.item}},[i("el-form-item",{attrs:{label:"用户名"}},[i("el-input",{attrs:{name:"username",placeholder:"管理员的用户名"},model:{value:t.item.username,callback:function(e){t.$set(t.item,"username",e)},expression:"item.username"}})],1),i("el-form-item",{attrs:{label:"姓名"}},[i("el-input",{attrs:{name:"name",placeholder:"管理员的姓名"},model:{value:t.item.name,callback:function(e){t.$set(t.item,"name",e)},expression:"item.name"}})],1),i("el-form-item",{attrs:{label:"手机"}},[i("el-input",{attrs:{name:"name",placeholder:"发送短时的时候会用到这个手机"},model:{value:t.item.mobile,callback:function(e){t.$set(t.item,"mobile",e)},expression:"item.mobile"}})],1),i("el-form-item",{attrs:{label:"密码"}},[i("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),i("el-form-item",{attrs:{label:"是否分配"}},[i("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),i("el-form-item",{attrs:{label:"是否主播"}},[i("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),i("el-form-item",{attrs:{label:"是否加盟商"}},[i("el-switch",{attrs:{"active-text":"加盟商","active-value":1,"inactive-text":"","inactive-value":0},model:{value:t.item.is_franchisee,callback:function(e){t.$set(t.item,"is_franchisee",e)},expression:"item.is_franchisee"}})],1),i("el-form-item",{attrs:{label:"产品ID"}},[i("el-input",{attrs:{type:"textarea"},model:{value:t.item.product_ids,callback:function(e){t.$set(t.item,"product_ids",e)},expression:"item.product_ids"}}),i("el-label",{staticStyle:{color:"red","font-size":"11px"}},[t._v("多个用英文逗号隔开,例如: 384731,2328")])],1)],1),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.onSave(t.item)}}},[t._v("保 存")])],1)],1),i("el-dialog",{attrs:{title:"添加排班",visible:t.dialogWork},on:{"update:visible":function(e){t.dialogWork=e}}},[i("el-form",{attrs:{"label-width":"120px",model:t.from}},[i("el-form-item",{attrs:{label:"上班日期"}},[i("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),i("el-form-item",{attrs:{label:"上班时间段"}},[i("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),i("el-form-item",{attrs:{label:"渠道"}},[i("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,a,n){return i("el-checkbox",{key:n,attrs:{label:a}},[t._v(t._s(e))])})),1)],1)],1),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.onWork()}}},[t._v("保 存")])],1)],1)],1)},n=[],o=i("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=i("2877"),c=Object(r["a"])(s,a,n,!1,null,null,null);e["default"]=c.exports},"2cbf":function(t,e,i){"use strict";i("73e0")},"333d":function(t,e,i){"use strict";var a=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"pagination-container",class:{hidden:t.hidden}},[i("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=(i("a9e3"),i("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=(i("2cbf"),i("2877")),c=Object(r["a"])(s,a,n,!1,null,"6af373ef",null);e["a"]=c.exports},"73e0":function(t,e,i){}}]);