(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-661354ea"],{1198:function(e,t,i){},1257:function(e,t,i){"use strict";i.r(t);var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"app-container"},[i("el-row",{staticStyle:{"margin-top":"20px"}},[i("el-col",{staticStyle:{height:"45px","text-align":"left"},attrs:{span:17}},[i("span",{staticStyle:{"margin-left":"50px"}},[e._v("电台名称:")]),i("el-input",{staticStyle:{width:"170px","margin-left":"20px"},attrs:{placeholder:"请输入电台名称",size:"mini"},model:{value:e.filterValue,callback:function(t){e.filterValue=t},expression:"filterValue"}}),i("el-button",{staticStyle:{"margin-left":"20px"},attrs:{type:"primary",icon:"el-icon-search",size:"mini"},on:{click:e.handleSearch}},[e._v("查询")]),i("el-button",{attrs:{type:"info",icon:"el-icon-delete",size:"mini"},on:{click:e.handleClear}},[e._v("清空查询")])],1),i("el-col",{attrs:{span:3}},[i("el-button",{attrs:{type:"danger",plain:"",icon:"el-icon-delete",size:"mini"},on:{click:e.deleteData}},[e._v("批量删除")])],1),i("el-col",{staticClass:"dropActions",attrs:{span:4}},[i("drop-down",{attrs:{dropOption:e.dropOptions},on:{handleAct:e.dropActions}})],1),i("el-col",{staticClass:"Device",attrs:{span:24}},[i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],key:e.key,attrs:{data:e.tableData,height:e.tableH,stripe:"",size:"small"},on:{"selection-change":e.handleSelectionChange}},[i("el-table-column",{attrs:{type:"selection",width:"35"}}),i("el-table-column",{attrs:{fixed:"",prop:"name",label:"电台",width:"300"}}),i("el-table-column",{attrs:{prop:"frequency",label:"频率",width:"80"}}),i("el-table-column",{attrs:{prop:"area",label:"地区",width:"80"}}),i("el-table-column",{attrs:{label:"运行时段"},scopedSlots:e._u([{key:"default",fn:function(t){return e._l(t.row.runtime,(function(t,n){return i("span",{key:n},[t.length>0?i("el-tag",{attrs:{size:"small"}},[e._v(" "+e._s(e.PraseWeekday(n))+" "),i("el-tag",{attrs:{type:"warning",size:"mini"}},[e._v(e._s(e.PraseHour(t)))])],1):e._e()],1)}))}}])}),i("el-table-column",{attrs:{fixed:"right",label:"操作",width:"60"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-button",{attrs:{type:"text",size:"small"},on:{click:function(i){return e.edit(t.$index)}}},[e._v("编辑")])]}}])})],1)],1),i("el-col",{attrs:{span:3}}),i("white-list-edit",{ref:"edit",attrs:{data:e.tableData[e.selectd_index]},on:{save:e.getData}})],1)],1)},a=[],r=(i("159b"),i("b0c0"),i("99af"),function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("el-form",{attrs:{inline:!0,size:"mini"}},[e._l(e.filter,(function(t,n){return i("el-form-item",{key:n,attrs:{label:t.text}},["radioGroup"==t.type?i("el-radio-group",{style:"width:"+t.width+";",model:{value:e.returnValue[n],callback:function(t){e.$set(e.returnValue,n,t)},expression:"returnValue[key]"}},e._l(t.options,(function(t,n){return i("el-radio-button",{key:n,attrs:{label:t.id}},[e._v(e._s(t.name))])})),1):"input"==t.type?i("el-input",{style:"width:"+t.width+";",attrs:{placeholder:t.placeholder},model:{value:e.returnValue[n],callback:function(t){e.$set(e.returnValue,n,t)},expression:"returnValue[key]"}}):"autocomplete"==t.type?i("el-autocomplete",{style:"width:"+t.width+";",attrs:{placeholder:t.placeholder,"fetch-suggestions":e.querySearchAsync,"trigger-on-focus":!0},model:{value:e.returnValue[n],callback:function(t){e.$set(e.returnValue,n,t)},expression:"returnValue[key]"}}):"date"==t.type||"datetime"==t.type||"month"==t.type||"year"==t.type?i("el-date-picker",{style:"width:"+t.width+";",attrs:{format:"date"==t.type?"yyyy-MM-dd":"datetime"==t.type?"yyyy-MM-dd HH:mm:ss":"month"==t.type?"yyyy-MM":"yyyy",type:t.type,placeholder:t.placeholder},on:{change:function(i){return e.pickerChange(t,n,e.returnValue[n])}},model:{value:e.returnValue[n],callback:function(t){e.$set(e.returnValue,n,t)},expression:"returnValue[key]"}}):"daterange"==t.type||"datetimerange"==t.type?i("el-date-picker",{style:"width:"+t.width+";",attrs:{type:t.type,"range-separator":"-","start-placeholder":"开始日期","end-placeholder":"结束日期",placeholder:t.placeholder},on:{change:function(i){return e.pickerRangeChange(t,n,e.returnValue[n])}},model:{value:e.returnValue[n],callback:function(t){e.$set(e.returnValue,n,t)},expression:"returnValue[key]"}}):"select"==t.type?i("el-select",{style:"width:"+t.width+";",attrs:{clearable:"",multiple:t.multiple,"collapse-tags":t.multiple,placeholder:t.placeholder},model:{value:e.returnValue[n],callback:function(t){e.$set(e.returnValue,n,t)},expression:"returnValue[key]"}},e._l(t.options,(function(e,t){return i("el-option",{key:t,attrs:{label:e.name,value:e.id}})})),1):e._e()],1)})),i("el-form-item",[i("el-button",{attrs:{type:"primary",icon:"el-icon-search"},on:{click:e.handleSearch}},[e._v("查询")]),i("el-button",{attrs:{type:"info",icon:"el-icon-delete"},on:{click:e.handleClear}},[e._v("清空查询")])],1)],2)}),s=[],o=i("53ca"),l=(i("4de4"),{data:function(){return{returnValue:{}}},watch:{},props:["filter"],created:function(){this.handleSearch()},methods:{pickerChange:function(e,t,i){switch(e.type){case"date":this.returnValue[t]=this.format(i,"yyyy-MM-dd");break;case"month":this.returnValue[t]=this.format(i,"yyyy-MM");break;case"year":this.returnValue[t]=this.format(i,"yyyy");break;case"datetime":this.returnValue[t]=this.format(i,"yyyy-MM-dd hh:mm:ss");break}},pickerRangeChange:function(e,t,i){switch(e.type){case"daterange":for(var n in i)this.returnValue[t][n]=this.format(i[n],"yyyy-MM-dd");break;case"datetimerange":for(var a in i)this.returnValue[t][a]=this.format(i[a],"yyyy-MM-dd hh:mm:ss");break}},handleSearch:function(){var e=[];for(var t in console.log(this.returnValue),this.returnValue)if("undefined"!=typeof this.filter[t]){var i=this.returnValue[t];""!=i&&i!=[]&&e.push({type:this.filter[t].sql_type,name:t,value:this.returnValue[t]})}this.$emit("handleSearch",e)},handleClear:function(){var e=[];for(var t in this.returnValue)"undefined"!=typeof this.filter[t]&&("object"==Object(o["a"])(this.returnValue[t])?this.returnValue[t]=[]:"undefined"!=typeof this.filter[t].default?(this.returnValue[t]=this.filter[t].default,e.push({type:this.filter[t].sql_type,name:t,value:this.returnValue[t]})):this.returnValue[t]="");this.$emit("handleSearch",e)}}}),c=l,u=i("2877"),h=Object(u["a"])(c,r,s,!1,null,null,null),d=h.exports,p=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("el-dropdown",{on:{command:e.handleCommand}},[i("span",{staticClass:"el-dropdown-link"},[e._v(" 其他操作"),i("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),i("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},e._l(e.dropOption,(function(t,n){return i("el-dropdown-item",{key:n,attrs:{command:t,value:t}},[e._v(e._s(t.item))])})),1)],1)},f=[],m={data:function(){return{}},mounted:function(){},watch:{},props:["dropOption"],methods:{handleCommand:function(e){this.$emit("handleAct",e)}}},y=m,g=Object(u["a"])(y,p,f,!1,null,null,null),v=g.exports,w=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("el-dialog",{attrs:{title:e.title,visible:e.visible,width:"60%",top:"3vh"},on:{"update:visible":function(t){e.visible=t}}},[i("el-form",{attrs:{"label-position":"right","label-width":"80px",size:"mini"}},[i("el-form-item",{attrs:{label:"电台"}},[i("el-input",{attrs:{"auto-complete":"off"},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),i("el-form-item",{attrs:{label:"频率"}},[i("el-slider",{attrs:{"show-input":"",min:540,max:1600,step:9},model:{value:e.form.frequency,callback:function(t){e.$set(e.form,"frequency",t)},expression:"form.frequency"}})],1),i("el-form-item",{attrs:{label:"地区"}},[i("el-select",{attrs:{filterable:"",placeholder:"请选择"},model:{value:e.form.area,callback:function(t){e.$set(e.form,"area",t)},expression:"form.area"}},e._l(e.areas,(function(e,t){return i("el-option",{key:t,attrs:{label:e,value:e}})})),1)],1),i("el-form-item",{attrs:{label:"时间段"}},[i("week-time",{attrs:{weekTimes:"object"==typeof e.form.runtime?e.form.runtime:{}},on:{change:e.weekTimeChange}})],1)],1),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{size:"mini"},on:{click:function(t){e.visible=!1}}},[e._v("取 消")]),i("el-button",{attrs:{type:"primary",size:"mini"},on:{click:e.save}},[e._v("保存")])],1)],1)},b=[],_=(i("a9e3"),i("d10d")),x=i.n(_),k={props:["data"],watch:{data:{handler:function(e,t){""!=this.data&&null!=this.data?(this.title="编辑白名单",this.form=JSON.parse(JSON.stringify(this.data)),this.form.frequency=Number(this.form.frequency)):(this.title="新增白名单",this.form={})},deep:!0}},components:{"week-time":x.a},mounted:function(){},methods:{weekTimeChange:function(e,t){this.form.runtime=e},save:function(){var e=this;this.visible=!1,this.form.id?this.$getJSON("http://wiibox.xicp.io:8484/dataservice/getNoTokenData?bid=update_white_freq",this.form).then((function(t){e.$message.success("修改成功")})):(this.form.runtime=JSON.stringify(this.form.runtime),this.form.id="",this.form.status="应用中",this.form.bid="update_white_freq",this.$getJSON("http://wiibox.xicp.io:8484/dataservice/getNoTokenData",this.form).then((function(t){e.$message.success("新增成功")}))),this.$emit("getData")},show:function(){this.visible=!0},addTime:function(e){e.timespan.push({value:[new Date,new Date]})},addDay:function(){this.form.runtime.push({weekday:"周一",timespan:[{value:[new Date,new Date]}]})}},data:function(){return{title:"新增白名单",areas:["全市","闵行","嘉定","浦东","松江","奉贤","宝山","金山","青浦","崇明"],visible:!1,form:{name:"",frequency:"",runtime:[],area:"",status:"",id:""}}}},S=k,C=(i("26dd6"),Object(u["a"])(S,w,b,!1,null,"4995fe5e",null)),D=C.exports,q=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticStyle:{width:"100%","margin-bottom":"10px"},attrs:{data:e.data,height:"400",border:"",stripe:"",size:"mini"}},[i("el-table-column",{attrs:{type:"index",label:"#"}}),i("el-table-column",{attrs:{prop:"frequency",label:"频率",sortable:"",width:"80","class-name":"custom-column"}}),i("el-table-column",{attrs:{prop:"name",label:"名称",sortable:"",width:"300","class-name":"custom-column"}}),i("el-table-column",{attrs:{prop:"area",label:"地区",align:"center","class-name":"custom-column"}}),i("el-table-column",{attrs:{label:"录音",align:"center","class-name":"custom-column"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-switch",{ref:t.row.id,attrs:{"active-value":1,"inactive-value":0,width:35,disabled:""},model:{value:t.row.is_recording,callback:function(i){e.$set(t.row,"is_recording",i)},expression:"scope.row.is_recording"}})]}}])})],1),i("Pagination",{ref:"pagination",attrs:{totalCountOrURL:"Terminal/cnt_WhiteListOfTask",params:e.queryParams},on:{change:e.handlePageChange}})],1)},O=[],V=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("el-pagination",{staticStyle:{"text-align":"center"},attrs:{"current-page":e.page,"page-sizes":e.size_list,"page-size":e.size,background:"","pager-count":e.pagerCount,layout:"total, sizes, prev, pager, next, jumper",total:e.total},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}})},T=[],$={data:function(){return{size_list:[10,20,30,40],total:0,page:1,size:10,pagerCount:5}},created:function(){this.getTotalsize()},props:["totalCountOrURL","params"],watch:{totalCountOrURL:function(){this.getTotalsize()},params:function(){this.getTotalsize()}},methods:{getTotalsize:function(){var e=this;if("number"==typeof this.totalCountOrURL)this.total=this.totalCountOrURL;else{for(var t in this.params)if(!this.params[t])return;this.$getJSON(this.totalCountOrURL,this.params).then((function(t){e.total=t.data[0].count,e.$emit("totalCount",e.total)}))}},handleSizeChange:function(e){this.size=e,this.page>Math.ceil(this.total/this.size)&&(this.page=Math.ceil(this.total/this.size)),this.$emit("change",{page:this.page,size:this.size})},handleCurrentChange:function(e){this.page=e,this.$emit("change",{page:this.page,size:this.size})}}},z=$,P=Object(u["a"])(z,V,T,!1,null,null,null),M=P.exports,L={props:["whiteListIdArr"],components:{Pagination:M},mounted:function(){this.getData()},watch:{whiteListIdArr:function(){this.getData()}},data:function(){return{data:[],queryParams:{page:1,size:10},loading:!1}},methods:{handlePageChange:function(e){this.queryParams.page=e.page,this.queryParams.size=e.size,this.getData()},getData:function(){if(this.whiteListIdArr){this.loading=!0;var e=[];for(var t in this.whiteListIdArr)e.push(t);this.queryParams.options=[{type:"6",name:"id",value:e}]}else this.data=[]}}},N=L,j=Object(u["a"])(N,q,O,!1,null,"649eb883",null),E=j.exports,R={Device:{address:{type:"input",text:"地址",multiple:!1,sql_type:"8",width:"140px",placeholder:"请输入地址"},log_id:{type:"input",text:"逻辑编号",multiple:!1,sql_type:"8",width:"140px",placeholder:"请输入逻辑编号"},phy_id:{type:"input",text:"物理编号",multiple:!1,sql_type:"8",width:"140px",placeholder:"请输入物理编号"}},Cycle:{detail:{type:"input",text:"任务说明",multiple:!1,sql_type:"8",width:"140px",placeholder:"请输入说明"}},TaskRecord:{task_type:{type:"select",text:"任务类型",width:"150px",sql_type:"1",placeholder:"请选择",options:[{name:"周期任务",id:"周期任务"},{name:"即时任务",id:"即时任务"}]},task_id:{type:"input",text:"任务号",width:"150px",sql_type:"8",placeholder:"请输入任务号"},start_time:{sql_type:"4",type:"daterange",text:"执行时间",width:"300px"}},RadioRecord:{result:{type:"select",sql_type:"1",text:"电台类型",width:"120px",placeholder:"请选择",options:[{name:"合法电台",id:"1"},{name:"区域非法",id:"2"},{name:"时间非法",id:"3"},{name:"频率非法",id:"4"},{name:"内容非法",id:"5"}]},frequency:{type:"input",text:"频率",sql_type:"8",width:"120px",placeholder:"请输入频率"},upload_day:{type:"daterange",text:"上传时间",width:"300px",sql_type:"4"}},WhiteList:{name:{type:"input",sql_type:"8",text:"电台名称",width:"170px",placeholder:"请输入电台名称",options:null}},Keyword:{name:{type:"input",sql_type:"8",text:"关键词",width:"170px",placeholder:"请输入关键词",options:null}},roleMembers:{role_key:{type:"select",sql_type:"1",text:"用户权限",width:"170px",placeholder:"请选择",options:null},user_name:{type:"input",sql_type:"8",text:"用户名称",width:"170px",placeholder:"请输入用户名称"}},systemLog:{log_type:{type:"select",sql_type:"1",text:"日志类型",width:"150px",placeholder:"请选择",options:[{name:"响应日志",id:"响应日志"},{name:"错误日志",id:"错误日志"},{name:"登入登出",id:"登入登出"}]},create_day:{type:"date",sql_type:"1",text:"记录日期",width:"150px",placeholder:"请选择日期"},response_status:{type:"select",sql_type:"1",text:"响应状态",width:"150px",options:[{name:"200",id:"200"},{name:"201",id:"201"},{name:"400",id:"400"},{name:"403",id:"403"},{name:"404",id:"404"},{name:"500",id:"500"},{name:"503",id:"503"},{name:"505",id:"505"}]},logDes:{type:"input",sql_type:"8",text:"描述查询",width:"150px",placeholder:"请描述关键词"}},version:{version_name:{type:"input",sql_type:"8",text:"版本号",width:"170px",placeholder:"请输入版本号",options:null}},InforRelease:{type:{type:"radioGroup",sql_type:"1",width:"200px",placeholder:"请选择",options:[{name:"通知短信",id:"SMS"},{name:"邮件通知",id:"EMAIL"}]},send_day:{type:"date",sql_type:"1",text:"发送日期",width:"150px",placeholder:"请选择"}},ReportExport:{user_name:{type:"input",sql_type:"8",text:"姓名",width:"170px",placeholder:"请输入用户名",options:null}},frequencyAddress:{frequency:{type:"input",sql_type:"8",text:"广播频率",width:"170px",placeholder:"请输入频率"}},manageDay:{send_day:{type:"date",sql_type:"1",text:"发送日期",width:"150px",placeholder:"请选择"}},dictionary:{prarm_id:{type:"input",sql_type:"8",text:"参数ID",width:"150px",placeholder:"请选择"}}},A=R,X={components:{Search:d,WhiteListEdit:D,DropDown:v,WhiteListOfTask:E},data:function(){return{filterValue:"",key:!1,allData:[],tableData:[],tableH:null,otherAct:[{item:"编辑",id:"",type:"text"}],dropOptions:[{item:"新增电台白名单",id:1}],filter:A.WhiteList,queryParams:{page:1,size:10},loading:!1,selectdList:[],selectd_index:"",whiteListVisible:!1,whitelist:null}},mounted:function(){this.tableH=window.innerHeight-125+"px",this.getData()},methods:{handleClear:function(){this.filterValue="",this.getData()},handleSearch:function(){var e=this,t=[];this.allData.forEach((function(i){i.name==e.filterValue&&t.push(i)})),this.tableData=t,this.tableData.forEach((function(e){e.runtime=JSON.parse(e.runtime)})),this.key=!this.key},handleSelectionChange:function(e){for(var t=[],i=0;i<e.length;i++){var n=e[i];t.push(n.id)}this.selectdList=t},parseFreqRange:function(e){return 1==e.length?"".concat(e[0]):"".concat(e[0],"-").concat(e[1])},deleteData:function(){var e=this;this.selectdList&&this.selectdList.length>0?this.$confirm("".concat(this.selectdList.length,"条白名单将被删除,是否继续?"),"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){e.$getJSON("http://wiibox.xicp.io:8484/dataservice/getNoTokenData",{bid:"delete_white_freq",ids:JSON.stringify(e.selectdList)}).then((function(t){e.getData(),e.$message.success("删除成功")}))})).catch((function(){})):this.$message.error("尚未选择!")},showWhiteList:function(e){this.whitelist=e,this.whiteListVisible=!0},handlePageChange:function(e){this.queryParams.page=e.page,this.queryParams.size=e.size,this.getData()},handleTotal:function(e){},getData:function(){var e=this;this.loading=!0,this.tableData=[],this.$getJSON("http://wiibox.xicp.io:8484/dataservice/getNoTokenData?bid=getWhiteFreqs").then((function(t){e.allData=JSON.parse(JSON.stringify(t.data.data)),e.tableData=JSON.parse(JSON.stringify(e.allData)),e.tableData.forEach((function(e){e.runtime=JSON.parse(e.runtime)})),e.key=!e.key,e.loading=!1}))},SearchFilter:function(e){this.queryParams.options=e,this.queryParams.page=1,this.getData()},dropActions:function(e){switch(e.id){case 1:this.selectd_index="",this.$refs["edit"].show();break}},edit:function(e){this.selectd_index=e,this.$refs["edit"].show()},PraseWeekday:function(e){switch(1*e){case 1:return"周一";case 2:return"周二";case 3:return"周三";case 4:return"周四";case 5:return"周五";case 6:return"周六";case 7:return"周日"}},PraseHour:function(e){for(var t="",i=0;i<e.length;i++){var n=e[i];0==i?t+=n:i==e.length-1?t+="~".concat(n):n+1<e[i+1]&&(t+="~".concat(n," ").concat(n))}return t},updata:function(e){for(var t in e)this.data[this.selectd_index][t]=e[t]}}},W=X,Y=Object(u["a"])(W,n,a,!1,null,null,null);t["default"]=Y.exports},"26dd6":function(e,t,i){"use strict";i("1198")},"4de4":function(e,t,i){"use strict";var n=i("23e7"),a=i("b727").filter,r=i("1dde"),s=r("filter");n({target:"Array",proto:!0,forced:!s},{filter:function(e){return a(this,e,arguments.length>1?arguments[1]:void 0)}})},d10d:function(e,t,i){!function(t,i){e.exports=i()}("undefined"!=typeof self&&self,(function(){return function(e){function t(n){if(i[n])return i[n].exports;var a=i[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var i={};return t.m=e,t.c=i,t.d=function(e,i,n){t.o(e,i)||Object.defineProperty(e,i,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/",t(t.s=1)}([function(e,t,i){"use strict";var n=i(9);t.a={name:"weekTime",props:{weekTimes:{type:Object,default:function(){return{}}},locale:{type:Object,default:function(){return{}}}},data:function(){return{weekdays:["星期一","星期二","星期三","星期四","星期五","星期六","星期日"],drawing:!1,selecting:!0,startX:-1,startY:-1,preX:-1,preY:-1,currentX:-1,currentY:-1,selected:{1:[],2:[],3:[],4:[],5:[],6:[],7:[]},selectedText:""}},watch:{weekTimes:function(){this.initData()}},created:function(){this.initData()},mounted:function(){this.emitWeekTimes()},methods:{initData:function(){if(this.weekTimes&&this.weekTimes instanceof Object)for(var e=1;e<=7;e++){var t=Array.isArray(this.weekTimes[e]);this.selected[e]=t?[].concat(this.weekTimes[e]):[]}},selectWeekday:function(e){if(24!==this.selected[e].length){for(var t=[],i=0;i<24;i++)t.push(i);this.selected[e]=t}else this.selected[e].splice(0,this.selected[e].length);this.emitWeekTimes()},selectDayPeriod:function(e,t){if(t){for(var i=!0,n=e;n<=t;n++)if(!this.isSelectedDayPeriod(n)){i=!1;break}if(i)for(var a=1;a<=7;a++)for(var r=e;r<=t;r++)this.deleteHour(a,r);else for(var s=1;s<=7;s++)for(var o=e;o<=t;o++)this.selectHour(s,o)}else if(this.isSelectedDayPeriod(e))for(var l=1;l<=7;l++)this.deleteHour(l,e);else for(var c=1;c<=7;c++)this.selectHour(c,e);this.emitWeekTimes()},isSelectedDayPeriod:function(e){for(var t=1;t<=7;t++)if(!this.isSelected(t,e))return!1;return!0},isSelected:function(e,t){return this.selected[e].indexOf(t)>-1},selectByMousedown:function(e,t,i){0===i.button&&(this.selecting=!this.isSelected(e,t),this.drawing=!0,this.startX=e,this.startY=t,this.preX=e,this.preY=t)},selectByMouseOver:function(e,t){if(this.drawing){for(var i=e>this.startX?this.startX:e,n=t>this.startY?this.startY:t,a=e>this.startX?e:this.startX,r=t>this.startY?t:this.startY,s=i;s<=a;s++)for(var o=n;o<=r;o++)this.selecting?this.selectHour(s,o):this.deleteHour(s,o);this.checkSelectedValid(e,t)}},checkSelectedValid:function(e,t){for(var i=this,n=[],a=[],r=e>this.startX?this.startX:e,s=t>this.startY?this.startY:t,o=e>this.startX?e:this.startX,l=t>this.startY?t:this.startY,c=r;c<=o;c++)for(var u=s;u<=l;u++)n.push(c+","+u);for(var h=this.preX>this.startX?this.startX:this.preX,d=this.preY>this.startY?this.startY:this.preY,p=this.preX>this.startX?this.preX:this.startX,f=this.preY>this.startY?this.preY:this.startY,m=h;m<=p;m++)for(var y=d;y<=f;y++)a.push(m+","+y);a.forEach((function(e){if(-1===n.indexOf(e)){var t=e.split(",");i.selecting?i.deleteHour(+t[0],+t[1]):i.selectHour(+t[0],+t[1])}}))},selectByMouseout:function(e,t){this.preX=e,this.preY=t},selectByMouseup:function(e,t){this.drawing&&(this.selecting?this.selectHour(e,t):this.deleteHour(e,t),this.drawing=!1,this.emitWeekTimes())},mouseLeave:function(){this.drawing&&this.emitWeekTimes(),this.drawing=!1},selectHour:function(e,t){this.isSelected(e,t)||this.selected[e].push(t)},deleteHour:function(e,t){var i=this.selected[e].indexOf(t);i>-1&&this.selected[e].splice(i,1)},selectAll:function(){for(var e=[],t=0;t<=23;t++)e.push(t);for(var i=1;i<=7;i++)this.selected[i]=[].concat(e);this.emitWeekTimes()},clear:function(){for(var e=1;e<8;e++)this.selected[e]=[];this.emitWeekTimes()},emitWeekTimes:function(){for(var e=1;e<=7;e++)this.selected[e].sort((function(e,t){return e-t}));this.selectedText=this.getWeekTimeString(this.selected),this.$emit("change",this.selected,this.selectedText)},getWeekTimeString:function(e){var t=Object.keys(e),i=t.every((function(t){return 24===e[t].length})),n=t.every((function(t){return 0===e[t].length}));if(i)return"全天";if(n)return"全不选";var a=this.hoursPretreatment(e);return this.weekdayPretreatment(a)},hoursPretreatment:function(e){var t=Object.keys(e),i=[];return t.forEach((function(t){var a=n.a.numberArrayGroup(e[t]),r=[];a.forEach((function(e){if(e.length>1){var t=e[0]+" ~ "+e[e.length-1]+"时";r.push(t)}else r.push(e.join("")+"时")})),i.push(r.join(","))})),i},weekdayPretreatment:function(e){var t=[],i=["星期一","星期二","星期三","星期四","星期五","星期六","星期日"];return n.a.getEqualValueIndex(e).forEach((function(a){var r=n.a.numberArrayGroup(a),s=[];r.forEach((function(e){if(e.length>1){var t=i[e[0]]+" ~ "+i[e[e.length-1]];s.push(t)}else s.push(i[e[0]])})),e[a[0]].length>0&&t.push(s.join(",")+": "+e[a[0]])})),t.join("; ")}}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(2);"undefined"!=typeof window&&window.Vue&&window.Vue.component("vue-week-time",n.a),t.default=n.a},function(e,t,i){"use strict";function n(e){i(3)}var a=i(0),r=i(10),s=i(8),o=n,l=s(a.a,r.a,!1,o,null,null);t.a=l.exports},function(e,t,i){var n=i(4);"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals),i(6)("0558ba1b",n,!0,{})},function(e,t,i){t=e.exports=i(5)(!1),t.push([e.i,".week-time{display:flex;font-size:13px}.week-time table{border-collapse:collapse}.week-time table td,.week-time table th{border:1px solid #ccc;word-break:keep-all;text-align:center}.week-time table tbody tr{height:36px}.week-time table th{font-weight:400}.week-time table.left{width:56px;flex-grow:0;flex-shrink:0;cursor:pointer}.week-time table.left thead tr{height:28px}.week-time table.left td,.week-time table.left th{border-right:none;min-width:45px;white-space:nowrap;word-break:keep-all}.week-time table.left td:hover,.week-time table.left th:hover{background-color:#f2f2f2}.week-time table.right thead tr{height:28px;cursor:pointer}.week-time table.right thead tr.hour th{width:22px;min-width:19px;white-space:nowrap}.week-time table.right thead tr td:hover,.week-time table.right thead tr th:hover{background-color:#f2f2f2}.week-time .selected{background-color:#3482cb}",""])},function(e,t){function i(e,t){var i=e[1]||"",a=e[3];if(!a)return i;if(t&&"function"==typeof btoa){var r=n(a);return[i].concat(a.sources.map((function(e){return"/*# sourceURL="+a.sourceRoot+e+" */"}))).concat([r]).join("\n")}return[i].join("\n")}function n(e){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"}e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=i(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n})).join("")},t.i=function(e,i){"string"==typeof e&&(e=[[null,e,""]]);for(var n={},a=0;a<this.length;a++){var r=this[a][0];"number"==typeof r&&(n[r]=!0)}for(a=0;a<e.length;a++){var s=e[a];"number"==typeof s[0]&&n[s[0]]||(i&&!s[2]?s[2]=i:i&&(s[2]="("+s[2]+") and ("+i+")"),t.push(s))}},t}},function(e,t,i){function n(e){for(var t=0;t<e.length;t++){var i=e[t],n=u[i.id];if(n){n.refs++;for(var a=0;a<n.parts.length;a++)n.parts[a](i.parts[a]);for(;a<i.parts.length;a++)n.parts.push(r(i.parts[a]));n.parts.length>i.parts.length&&(n.parts.length=i.parts.length)}else{var s=[];for(a=0;a<i.parts.length;a++)s.push(r(i.parts[a]));u[i.id]={id:i.id,refs:1,parts:s}}}}function a(){var e=document.createElement("style");return e.type="text/css",h.appendChild(e),e}function r(e){var t,i,n=document.querySelector("style["+g+'~="'+e.id+'"]');if(n){if(f)return m;n.parentNode.removeChild(n)}if(v){var r=p++;n=d||(d=a()),t=s.bind(null,n,r,!1),i=s.bind(null,n,r,!0)}else n=a(),t=o.bind(null,n),i=function(){n.parentNode.removeChild(n)};return t(e),function(n){if(n){if(n.css===e.css&&n.media===e.media&&n.sourceMap===e.sourceMap)return;t(e=n)}else i()}}function s(e,t,i,n){var a=i?"":n.css;if(e.styleSheet)e.styleSheet.cssText=w(t,a);else{var r=document.createTextNode(a),s=e.childNodes;s[t]&&e.removeChild(s[t]),s.length?e.insertBefore(r,s[t]):e.appendChild(r)}}function o(e,t){var i=t.css,n=t.media,a=t.sourceMap;if(n&&e.setAttribute("media",n),y.ssrId&&e.setAttribute(g,t.id),a&&(i+="\n/*# sourceURL="+a.sources[0]+" */",i+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),e.styleSheet)e.styleSheet.cssText=i;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(i))}}var l="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!l)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var c=i(7),u={},h=l&&(document.head||document.getElementsByTagName("head")[0]),d=null,p=0,f=!1,m=function(){},y=null,g="data-vue-ssr-id",v="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());e.exports=function(e,t,i,a){f=i,y=a||{};var r=c(e,t);return n(r),function(t){for(var i=[],a=0;a<r.length;a++){var s=r[a],o=u[s.id];o.refs--,i.push(o)}t?(r=c(e,t),n(r)):r=[];for(a=0;a<i.length;a++){o=i[a];if(0===o.refs){for(var l=0;l<o.parts.length;l++)o.parts[l]();delete u[o.id]}}}};var w=function(){var e=[];return function(t,i){return e[t]=i,e.filter(Boolean).join("\n")}}()},function(e,t){e.exports=function(e,t){for(var i=[],n={},a=0;a<t.length;a++){var r=t[a],s=r[0],o=r[1],l=r[2],c=r[3],u={id:e+":"+a,css:o,media:l,sourceMap:c};n[s]?n[s].parts.push(u):i.push(n[s]={id:s,parts:[u]})}return i}},function(e,t){e.exports=function(e,t,i,n,a,r){var s,o=e=e||{},l=typeof e.default;"object"!==l&&"function"!==l||(s=e,o=e.default);var c,u="function"==typeof o?o.options:o;if(t&&(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0),i&&(u.functional=!0),a&&(u._scopeId=a),r?(c=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),n&&n.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(r)},u._ssrRegister=c):n&&(c=n),c){var h=u.functional,d=h?u.render:u.beforeCreate;h?(u._injectStyles=c,u.render=function(e,t){return c.call(t),d(e,t)}):u.beforeCreate=d?[].concat(d,c):[c]}return{esModule:s,exports:o,options:u}}},function(e,t,i){"use strict";t.a={numberArrayGroup:function(e){var t=[],i=void 0,n=void 0;return e.forEach((function(e){if(i===e)return n.push(i),void i++;n=[e],i=e+1,t.push(n)})),t},getEqualValueIndex:function(e){for(var t=[],i=new Array(e.length),n=e.length,a=0;a<n;a++){for(var r=[],s=a;s<n;s++)e[a]!==e[s]||i[s]||(r.push(s),i[s]=!0);r.length>0&&t.push(r)}return t}}},function(e,t,i){"use strict";var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"week-time"},[i("table",{staticClass:"left"},[i("thead",[i("tr",[i("th",{on:{click:e.selectAll}},[e._v(e._s(e.locale[7]||"全选"))])]),e._v(" "),i("tr",[i("th",{on:{click:e.clear}},[e._v(e._s(e.locale[8]||"清空"))])])]),e._v(" "),i("tbody",e._l(e.weekdays,(function(t,n){return i("tr",[i("td",{on:{click:function(t){e.selectWeekday(n+1)}}},[e._v(e._s(e.locale[n]||t))])])})))]),e._v(" "),i("table",{staticClass:"right"},[i("thead",[i("tr",[i("th",{attrs:{colspan:"7"},on:{click:function(t){e.selectDayPeriod(0,6)}}},[e._v(e._s(e.locale[9]||"凌晨时段"))]),e._v(" "),i("th",{attrs:{colspan:"4"},on:{click:function(t){e.selectDayPeriod(7,10)}}},[e._v(e._s(e.locale[10]||"上午时段"))]),e._v(" "),i("th",{attrs:{colspan:"4"},on:{click:function(t){e.selectDayPeriod(11,14)}}},[e._v(e._s(e.locale[11]||"中午时段"))]),e._v(" "),i("th",{attrs:{colspan:"4"},on:{click:function(t){e.selectDayPeriod(15,18)}}},[e._v(e._s(e.locale[12]||"下午时段"))]),e._v(" "),i("th",{attrs:{colspan:"5"},on:{click:function(t){e.selectDayPeriod(19,23)}}},[e._v(e._s(e.locale[13]||"夜晚时段"))])]),e._v(" "),i("tr",{staticClass:"hour"},e._l(24,(function(t){return i("th",{on:{click:function(i){e.selectDayPeriod(t-1)}}},[e._v(e._s(t-1))])})))]),e._v(" "),i("tbody",{on:{mouseleave:e.mouseLeave}},e._l(7,(function(t){return i("tr",{key:t},e._l(24,(function(n){return i("td",{key:n,class:{selected:e.selected[t].indexOf(n-1)>-1},on:{dragstart:function(e){e.stopPropagation(),e.preventDefault()},mousedown:function(i){i.stopPropagation(),e.selectByMousedown(t,n-1,i)},mouseover:function(i){i.stopPropagation(),e.selectByMouseOver(t,n-1)},mouseout:function(i){i.stopPropagation(),e.selectByMouseout(t,n-1)},mouseup:function(i){i.stopPropagation(),e.selectByMouseup(t,n-1)}}})})))})))])])},a=[],r={render:n,staticRenderFns:a};t.a=r}])}))}}]);
|