小店通

4.19e6fe4461c783fba772.js 11KB

12
  1. webpackJsonp([4],{"1yLE":function(t,e,n){var i=n("uSC2");i(i.S,"Number",{isInteger:n("D44a")})},"4Xi4":function(t,e,n){t.exports={default:n("6OVK"),__esModule:!0}},"6OVK":function(t,e,n){n("1yLE"),t.exports=n("DH3n").Number.isInteger},D44a:function(t,e,n){var i=n("VII3"),s=Math.floor;t.exports=function(t){return!i(t)&&isFinite(t)&&s(t)===t}},vX6V:function(t,e,n){"use strict";var i=n("4Xi4"),s=n.n(i),a={name:"timeSelect",props:["checktime"],data:function(){return{tableHeader:["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23"],weekDate:{1:"星期一",2:"星期二",3:"星期三",4:"星期四",5:"星期五",6:"星期六",7:"星期日"},rowUnit:[],timeContent:[],timeSection:[],timeStr:[],beginDay:0,beginTime:0,downEvent:!1,kuangObj:{width:0,height:0,top:0,left:0,bottom:0,right:0,oldLeft:0,oldTop:0,flag:!1},py:"",px:"",back:"#31676f",h:"",w:"",top:"",left:"",len:0}},created:function(){this.init(),this.timeContent=this.checktime,this.timeContent.length>0&&this.initSelect()},mounted:function(){},methods:{init:function(){for(var t=0;t<7;t++){for(var e=[],n=0;n<24;n++)e.push({class:null,timeData:n});this.rowUnit.push(e),this.timeContent.push({arr:[]}),this.timeSection.push([]),this.timeStr.push("")}this.initSelect()},initSelect:function(){var t=this;this.timeContent.forEach(function(e,n){e.hasOwnProperty("arr")&&e.arr.length>0&&e.arr.forEach(function(e){t.rowUnit[n][e].class="ui-selected"})})},handleMouseDown:function(t,e){this.downEvent=!0,this.beginDay=e,this.beginTime=t},dian:function(t){this.px=t.pageX,this.py=t.pageY},yi:function(t){if(""!=this.px&&""!=this.py){var e=this.px,n=this.py;this.left=t.pageX,this.top=t.pageY,this.h=this.top-this.py,this.w=this.left-this.px;var i=-this.h,s=-this.w;this.len=1,this.back="#31676f",this.h<0&&this.w>=0?(this.h=i,this.left=e):this.h>=0&&this.w<0?(this.w=s,this.top=n):this.h<0&&this.w<0?(this.h=i,this.w=s):(this.left=this.px,this.top=this.py),this.w<0&&(this.w=0-this.w),this.h<0&&(this.h=0-this.h)}},li:function(){this.px="",this.py="",this.h="",this.w="",this.top="",this.left="",this.len=0,this.back=""},handleMouseUp:function(t,e){var n=this,i=this.beginTime,s=i<=t?i:t,a=Math.abs(i-t),r=s+a,o=this.beginDay<=e?this.beginDay:e,l=Math.abs(this.beginDay-e),c=o+l;if(this.downEvent){if(function(){for(var t=o;t<c+1;t++)for(var e=s;e<r+1;e++)if(null==n.rowUnit[t][e].class)return!0;return!1}())for(var u=o;u<c+1;u++)for(var h=s;h<r+1;h++)null==this.rowUnit[u][h].class&&(this.rowUnit[u][h].class="ui-selected",this.timeContent[u].arr.push(this.rowUnit[u][h].timeData));else for(var p=o;p<c+1;p++)for(var f=s;f<r+1;f++)if("ui-selected"==this.rowUnit[p][f].class){this.rowUnit[p][f].class=null;for(var d=this.rowUnit[p][f].timeData,m="",v=0;v<this.timeContent[p].arr.length;v++)d==this.timeContent[p].arr[v]&&(m=v);this.timeContent[p].arr.splice(m,1)}this.filterTime(o,c)}this.downEvent=!1;var _=[];this.rowUnit.forEach(function(t,e){_[e]=[],t.forEach(function(t,n){"ui-selected"==t.class?_[e][n]=1:_[e][n]=0})}),this.$emit("saveTime",_)},filterTime:function(t,e){var n=this;function i(t){return s()(t)?(t<10?"0"+t:t.toString())+":00":(Math.floor(t)<10?"0"+Math.floor(t):Math.floor(t).toString())+":00"}for(var a=function(t){var e,s,a=[];(e=n.timeContent[t].arr.sort(function(t,e){return t-e}),s=[],e.forEach(function(t,e){var n=s[s.length-1];e&&t%1==0&&t-n[n.length-1]==1?n.push(t):s.push([t])}),s).forEach(function(t){var e=[];e.push(t[0]),e.push(t[t.length-1]+1),a.push(e)}),n.timeStr[t]=function(t){var e="";return t.forEach(function(t,n){var s="";s=0==n?i(t[0])+"~"+i(t[1]):" , "+i(t[0])+"~"+i(t[1]),e+=s}),e}(a),n.timeSection[t]=a},r=t;r<e+1;r++)a(r)},clear:function(){this.rowUnit.forEach(function(t){t.forEach(function(t){t.class=null})}),this.timeContent.forEach(function(t){t.arr=[]}),this.timeSection.forEach(function(t){t.length=0}),this.timeStr.length=0;for(var t=0;t<7;t++)this.timeStr.push("")}}},r={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"byted-weektime",on:{mousedown:t.dian,mousemove:t.yi,mouseup:t.li}},[n("div",{staticClass:"calendar"},[n("table",{ref:"timeCheck",staticClass:"calendar-table",staticStyle:{width:"610px"}},[n("thead",{staticClass:"calendar-head"},[t._m(0),t._v(" "),n("tr",t._l(t.tableHeader,function(e,i){return n("td",{key:i},[t._v(t._s(e))])}),0)]),t._v(" "),n("tbody",{attrs:{id:"tableBody"}},[n("div",{style:{width:t.kuangObj.width+"px",height:t.kuangObj.height+"px",top:t.kuangObj.top+"px",left:t.kuangObj.left+"px",bottom:t.kuangObj.bottom+"px",right:t.kuangObj.right+"px"},attrs:{id:"kuang"}}),t._v(" "),n("tr",[n("td",[t._v("星期一")]),t._v(" "),t._l(t.rowUnit[0],function(e,i){return n("td",{key:i,staticClass:"calendar-atom-time",class:e.class,on:{mousedown:function(e){return e.preventDefault(),t.handleMouseDown(i,0)},mouseup:function(e){return e.preventDefault(),t.handleMouseUp(i,0)}}})})],2),t._v(" "),n("tr",[n("td",[t._v("星期二")]),t._v(" "),t._l(t.rowUnit[1],function(e,i){return n("td",{key:i,staticClass:"calendar-atom-time",class:e.class,on:{mousedown:function(e){return e.preventDefault(),t.handleMouseDown(i,1)},mouseup:function(e){return e.preventDefault(),t.handleMouseUp(i,1)}}})})],2),t._v(" "),n("tr",[n("td",[t._v("星期三")]),t._v(" "),t._l(t.rowUnit[2],function(e,i){return n("td",{key:i,staticClass:"calendar-atom-time",class:e.class,on:{mousedown:function(e){return e.preventDefault(),t.handleMouseDown(i,2)},mouseup:function(e){return e.preventDefault(),t.handleMouseUp(i,2)}}})})],2),t._v(" "),n("tr",[n("td",[t._v("星期四")]),t._v(" "),t._l(t.rowUnit[3],function(e,i){return n("td",{key:i,staticClass:"calendar-atom-time",class:e.class,on:{mousedown:function(e){return e.preventDefault(),t.handleMouseDown(i,3)},mouseup:function(e){return e.preventDefault(),t.handleMouseUp(i,3)}}})})],2),t._v(" "),n("tr",[n("td",[t._v("星期五")]),t._v(" "),t._l(t.rowUnit[4],function(e,i){return n("td",{key:i,staticClass:"calendar-atom-time",class:e.class,on:{mousedown:function(e){return e.preventDefault(),t.handleMouseDown(i,4)},mouseup:function(e){return e.preventDefault(),t.handleMouseUp(i,4)}}})})],2),t._v(" "),n("tr",[n("td",[t._v("星期六")]),t._v(" "),t._l(t.rowUnit[5],function(e,i){return n("td",{key:i,staticClass:"calendar-atom-time",class:e.class,on:{mousedown:function(e){return e.preventDefault(),t.handleMouseDown(i,5)},mouseup:function(e){return e.preventDefault(),t.handleMouseUp(i,5)}}})})],2),t._v(" "),n("tr",[n("td",[t._v("星期日")]),t._v(" "),t._l(t.rowUnit[6],function(e,i){return n("td",{key:i,staticClass:"calendar-atom-time",class:e.class,on:{mousedown:function(e){return e.preventDefault(),t.handleMouseDown(i,6)},mouseup:function(e){return e.preventDefault(),t.handleMouseUp(i,6)}}})})],2),t._v(" "),n("tr",[n("td",{staticClass:"td-table-tip",attrs:{colspan:"49"}},[n("div",{staticClass:"clearfix"},[n("span",{staticClass:"pull-left tip-text"},[t._v("请用鼠标点选时间段")]),t._v(" "),n("a",{staticClass:"pull-right",on:{click:t.clear}},[t._v("清空")])])])]),t._v(" "),n("tr",[n("td",{staticClass:"timeContent",attrs:{colspan:"25"}},t._l(t.timeStr,function(e,i){return n("div",{directives:[{name:"show",rawName:"v-show",value:e.length,expression:"item.length"}],key:i,staticClass:"timeItem"},[n("span",[t._v(t._s(t.weekDate[i+1])+":")]),t._v(" "),n("strong",[n("span",[t._v(t._s(e))])])])}),0)])])])]),t._v(" "),n("div",{style:{backgroundColor:t.back,height:t.h+"px",width:t.w+"px",position:"absolute",left:t.left+"px",top:t.top+"px",opacity:.2,border:t.len+"px dashed #000",zIndex:-1},attrs:{id:"container"}})])},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("th",{staticClass:"week-td",attrs:{rowspan:"2"}},[this._v("星期/时间")]),this._v(" "),e("th",{attrs:{colspan:"12"}},[this._v("上午")]),this._v(" "),e("th",{attrs:{colspan:"12"}},[this._v("下午")])])}]};var o=n("C7Lr")(a,r,!1,function(t){n("z4/I")},"data-v-dbd4fa0e",null);e.a=o.exports},xMXC:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n("lC5x"),s=n.n(i),a=n("J0Oq"),r=n.n(a),o=n("a3Yh"),l=n.n(o),c={data:function(){var t;return t={commnentList:[1,2,4,5],data:{new_expose_tag:[]},rules:{new_expose_tag:[{type:"array",required:!0,message:"请输入推荐理由",trigger:"blur"}]},timeRange:["2021-03-25",""]},l()(t,"data",{description:""}),l()(t,"pickerOptions",{disabledDate:function(t){return t.getTime()<Date.now()}}),l()(t,"arr",[0,0,0,1,2,4,6,7,8,5]),l()(t,"schedule_type",1),l()(t,"lastArr",[]),l()(t,"checktime",[{arr:[]},{arr:[]},{arr:[]},{arr:[]},{arr:[]},{arr:[]},{arr:[]}]),t},components:{datetime:n("vX6V").a},created:function(){this.lastArr=[],console.log(this.checktime)},methods:{getTime:function(t){console.log(t)},test:function(){var t=this;return r()(s.a.mark(function e(){return s.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.$refs.test.validate();case 2:e.sent;case 3:case"end":return e.stop()}},e,t)}))()},add:function(){this.data.description=(this.data.description?this.data.description:"")+"21312312",console.log(this.data.description)},getSame:function(){var t=this;console.log(this.arr),this.arr.length>3?(this.lastArr.push(this.arr.splice(0,3)),this.getSame()):(this.lastArr.push(this.arr),this.lastArr.forEach(function(e,n){t.checktime.push({arr:[]}),e.forEach(function(e,i){1==e&&t.checktime[n].arr.push(n+1)})}))},saveTime:function(t){console.log(t)}}},u={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[1==t.schedule_type?n("datetime",{attrs:{checktime:t.checktime},on:{getTime:t.getTime,saveTime:t.saveTime}}):t._e(),t._v(" "),n("el-date-picker",{attrs:{type:"daterange","picker-options":t.pickerOptions,"range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期","value-format":"yyyy-MM-dd",align:"right"},model:{value:t.timeRange,callback:function(e){t.timeRange=e},expression:"timeRange"}}),t._v(" "),n("el-form",{ref:"test",attrs:{model:t.data,rules:t.rules}},[n("el-form-item",{staticClass:"inputBox",attrs:{prop:"new_expose_tag",label:"推荐理由","label-position":"right","label-width":"140px"}},[n("div",{staticClass:"rightInput"},[n("el-select",{attrs:{slot:"prepend",multiple:"",max:2,placeholder:"请选择"},slot:"prepend",model:{value:t.data.new_expose_tag,callback:function(e){t.$set(t.data,"new_expose_tag",e)},expression:"data.new_expose_tag"}},t._l(t.commnentList,function(t){return n("el-option",{key:t,attrs:{label:t,value:t}})}),1)],1)])],1),t._v(" "),n("button",{on:{click:t.test}},[t._v("测试")])],1)},staticRenderFns:[]},h=n("C7Lr")(c,u,!1,null,null,null);e.default=h.exports},"z4/I":function(t,e){}});
  2. //# sourceMappingURL=4.19e6fe4461c783fba772.js.map