webpackJsonp([6],{SwKW:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=a("PJh5"),n=a.n(i),o=a("VkeE"),m=a("6d20"),d={name:"domain",data:function(){return{domainForm:{domainSelect:"",domainChartSelect:""},domainGetInitTime:[],ruleDomainForm:{domainSelected:[{required:!0,trigger:"change",message:"请选择类型"}],domainChartSelected:[{required:!0,trigger:"change",message:"请选择图表类型"}],domainGetDates:[{required:!0,type:"date",trigger:"change",message:"请选择日期和时间"}]},selectTime:"",getDatesOptions:{disabledDate:function(t){return t<n()("2018-12-21 01:00:00","YYYY-MM-DD HH:mm:ss").toDate()||t.valueOf()>Date.now()}},data_type:[],graph_type:[],chartList:[],loading1:!1,loading2:!1,domainImage:"",isBtnLoading:!1,isImgLoading:!0}},mounted:function(){var t=this;this.$api.post(o.e).then(function(e){t.domainImage=e.data.image,t.data_type=e.data.data_type,t.graph_type=e.data.graph_type,t.domainImage=e.data.image_path,t.domainForm.domainSelect=e.data.data_type[2].value,t.domainForm.domainChartSelect=e.data.graph_type[0].value;var a=e.data.time.split("/"),i=n()(a[0],"YYYY-MM-DD HH:mm:ss").toDate(),o=n()(a[1],"YYYY-MM-DD HH:mm:ss").toDate();t.domainGetInitTime=[i,o],t.isImgLoading=!1}).catch(function(e){t.isImgLoading=!0})},filters:{kindsChange:function(t){return m.c[t]},chartChange:function(t){return m.a[t]}},methods:{handleSubmit:function(){var t=this;this.$refs.domainForm.validate(function(e){if(e){if(!1===t.isBtnLoading){t.isBtnLoading=!0,t.isImgLoading=!0;var a={time:n()(t.domainGetInitTime[0]).format("YYYY-MM-DD HH:mm:ss")+"/"+n()(t.domainGetInitTime[1]).format("YYYY-MM-DD HH:mm:ss"),data_type:t.domainForm.domainSelect,graph_type:t.domainForm.domainChartSelect};t.$api.post(o.f,a).then(function(e){console.log("domain",e.data),t.domainImage=e.data.domain_image+"?t="+(new Date).getTime(),200===e.status&&(t.isBtnLoading=!1,t.isImgLoading=!1)}).catch(function(e){console.log(e),t.isBtnLoading=!1,t.isImgLoading=!0})}t.$Message.success("Success")}else t.$Message.error("failed")})},imgBig:function(){console.log("1111"),console.log("imgWidth:",document.getElementsByTagName("img")[0].width);var t=document.getElementsByTagName("img")[0],e=t.length;console.log("imgLen:",e);for(var a=0;a<e;a++)t.width<600&&(t[a].width=2*t[a].width)}}},r={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("Row",{staticStyle:{"margin-top":"10px"},attrs:{gutter:20}},[a("i-col",{attrs:{span:"24",md:24,lg:24}},[a("Card",{attrs:{shadow:""}},[a("i-form",{ref:"domainForm",attrs:{inline:"",model:t.domainForm,rules:t.ruleDomainForm}},[a("Form-item",{attrs:{prop:"data_type"}},[a("i-select",{staticStyle:{width:"120px"},attrs:{clearable:""},model:{value:t.domainForm.domainSelect,callback:function(e){t.$set(t.domainForm,"domainSelect",e)},expression:"domainForm.domainSelect"}},t._l(t.data_type,function(e){return a("i-option",{key:e.index,attrs:{value:e.value}},[t._v(t._s(t._f("kindsChange")(e.value))+"\n              ")])}),1)],1),t._v(" "),a("Form-item",{attrs:{prop:"graph_type"}},[a("i-select",{staticStyle:{width:"100px"},attrs:{clearable:""},model:{value:t.domainForm.domainChartSelect,callback:function(e){t.$set(t.domainForm,"domainChartSelect",e)},expression:"domainForm.domainChartSelect"}},t._l(t.graph_type,function(e){return a("i-option",{key:e.index,attrs:{value:e.value}},[t._v(t._s(t._f("chartChange")(e.value))+"\n              ")])}),1)],1),t._v(" "),a("Form-item",{attrs:{prop:"time"}},[a("Date-picker",{staticStyle:{width:"300px"},attrs:{confirm:"",options:t.getDatesOptions,type:"datetimerange",format:"yyyy-MM-dd HH:mm:ss",placeholder:"请选择开始时间和结束时间"},model:{value:t.domainGetInitTime,callback:function(e){t.domainGetInitTime=e},expression:"domainGetInitTime"}})],1),t._v(" "),a("Form-item",[a("i-button",{attrs:{type:"primary",loading:t.isBtnLoading},on:{click:t.handleSubmit}},[t._v("确定")])],1)],1),t._v(" "),a("div",{staticClass:"img-div loading"},[a("viewer",[a("img",{attrs:{src:t.domainImage},on:{click:t.imgBig}})]),t._v(" "),t.isImgLoading?a("Spin",{attrs:{fix:""}},[t._v("加载中...")]):t._e()],1)],1)],1)],1)],1)},staticRenderFns:[]};var s=a("VU/8")(d,r,!1,function(t){a("dDHT")},"data-v-0e6c7106",null);e.default=s.exports},dDHT:function(t,e){}});