webpackJsonp([20],{TNmO:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={name:"MonitorTitle",props:{imgStyle:{},bgImg:{type:String},hideDate:{type:Boolean,default:!1},hideTime:{type:Boolean,default:!1},editable:{type:Boolean,default:!1},color:{type:String},size:{type:String,default:"1.9rem"}},data:function(){return{openDatePicker:!1,timer:null,time:null,style:{},weather:null}},mounted:function(){var e=this;this.hideTime||(this.timer=setInterval(function(){e.time=e.$moment().format("dddd")+" "+e.$moment().format("LTS")},1e3)),this.style={"font-size":this.size},this.getWeather()},beforeDestroy:function(){clearInterval(this.timer),this.timer=null},computed:{curDate:function(){var e=this.$store.state.curDate;return e?this.$moment(e).format("YYYY-MM-DD"):this.$moment().format("YYYY-MM-DD")},options:function(){var e=this;return{disabledDate:function(t){return e.$moment(t).isAfter(e.$moment())}}}},methods:{openAdmin:function(){window.open("http://211.136.105.193/login")},handleDateChange:function(e){this.$store.commit("SET_CURDATE",e),this.openDatePicker=!1},getWeather:function(){var e=this;this.$ajax.get({url:"https://restapi.amap.com/v3/weather/weatherInfo?city=110101&key=d265f590c2efc5b9816c64f9ad553678"}).then(function(t){e.weather=t.lives[0]})}}},i={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"monitor-title"},[e.weather?n("span",{staticClass:"weather"},[e._v("\n    "+e._s(e.weather.weather)+" "+e._s(e.weather.temperature)+"℃ "+e._s(e.weather.winddirection)+"风"+e._s(e.weather.windpower)+"级 空气湿度:"+e._s(e.weather.humidity)+"%\n  ")]):e._e(),e._v(" "),e.hideDate?e._e():n("span",{staticClass:"moment date",on:{mouseenter:function(t){e.returnopenDatePicker=!0},mouseleave:function(t){e.openDatePicker=!1}}},[n("DatePicker",{staticClass:"date-picker",attrs:{value:e.curDate,options:e.options,open:e.editable&&e.openDatePicker,type:"date"},on:{"on-change":e.handleDateChange}},[n("span",[e._v(e._s(e.curDate))])])],1),e._v(" "),e.hideTime?e._e():n("span",{staticClass:"moment time"},[e._v(e._s(e.time))]),e._v(" "),n("img",{style:e.imgStyle,attrs:{src:e.bgImg,draggable:"false"}}),e._v(" "),n("p",{style:e.style,on:{click:e.openAdmin}},[e._t("default")],2)])},staticRenderFns:[]};var r=n("VU/8")(a,i,!1,function(e){n("Xo4e")},"data-v-0a5a832f",null);t.default=r.exports},Xo4e:function(e,t){}});
//# sourceMappingURL=20.783e458e49d4f1c92bbb.js.map