webpackJsonp([3],{"fKh/":function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=s("VkeE"),i=s("PJh5"),r=s.n(i),n=s("6d20"),o={name:"responsive",data:function(){return{responsiveForm:{resSelect:"",effectSelect:""},getTime1:[],getTime2:[],secondResForm:{resChartSelect:"",secResSelect:""},ruleResponsiveForm:{resSelect:{required:!0,trigger:"change",message:"请输入类型"},resChartSelect:{required:!0,trigger:"change",message:"请输入图表类型"},effectSelect:{required:!0,trigger:"change",message:"请输入时间区段"},responsiveGetDates:{required:!0,trigger:"change",message:"请输入时间"}},ruleSecResForm:{resChartSelect:{required:!0,trigger:"change",message:"请输入图表类型"},secResSelect:{required:!0,trigger:"change",message:"请输入类型"},secResGetDates:{required:!0,trigger:"change",message:"请输入时间"}},responsiveOptions:{disabledDate:function(e){return eDate.now()}},secResOptions:{disabledDate:function(e){return eDate.now()}},firstResList:[],timeAreaList:[],secResList:[],graphList:[],resImg1:"",resImg2:"",isBtnLoading1:!1,isBtnLoading2:!1,isImgLoading1:!0,isImgLoading2:!0}},mounted:function(){var e=this;this.$api.post(a.h).then(function(t){e.isImgLoading1=!1,console.log("res",t.data),e.firstResList=t.data.data_type,e.timeAreaList=t.data.effect_type;var s=t.data.time.split("/"),a=r()(s[0],"YYYY-MM-DD HH:mm:ss").toDate(),i=r()(s[1],"YYYY-MM-DD HH:mm:ss").toDate();e.getTime1=[a,i],e.responsiveForm.resSelect=t.data.data_type[2].value,e.responsiveForm.effectSelect=t.data.effect_type[0].value,e.resImg1=t.data.image_path}).catch(function(t){console.log(t.data),e.isImgLoading1=!0}),this.$api.post(a.j).then(function(t){e.isImgLoading2=!1,e.secResList=t.data.data_type,e.graphList=t.data.graph_type;var s=t.data.time.split("/"),a=r()(s[0],"YYYY-MM-DD HH:mm:ss").toDate(),i=r()(s[1],"YYYY-MM-DD HH:mm:ss").toDate();e.getTime2=[a,i],console.log("second",t.data),e.secondResForm.secResSelect=t.data.data_type[0].value,e.secondResForm.resChartSelect=t.data.graph_type[0].value,e.resImg2=t.data.image_path}).catch(function(t){console.log(t),e.isImgLoading2=!0})},filters:{kindsChange:function(e){return n.c[e]},responseChange:function(e){return n.d[e]},chartsChange:function(e){return n.a[e]},errChange:function(e){return n.b[e]}},methods:{handleResSubmit_one:function(){var e=this;this.$refs.responsiveForm.validate(function(t){if(t&&!1===e.isBtnLoading1){e.isBtnLoading1=!0,e.isImgLoading1=!0;var s={data_type:e.responsiveForm.resSelect,effect_type:e.responsiveForm.effectSelect,time:r()(e.getTime1[0]).format("YYYY-MM-DD HH:mm:ss")+"/"+r()(e.getTime1[1]).format("YYYY-MM-DD HH:mm:ss")};e.$api.post(a.i,s).then(function(t){console.log("responsive",t.data),e.resImg1=t.data.response_image+"?t="+(new Date).getTime(),200===t.status&&(e.isBtnLoading1=!1,e.isImgLoading1=!1)}).catch(function(t){console.log(t),e.isBtnLoading1=!0,e.isImgLoading1=!0})}})},handleResSubmit_second:function(){var e=this;this.$refs.secondResForm.validate(function(t){if(t&&!1===e.isBtnLoading2){e.isBtnLoading2=!0,e.isImgLoading2=!0;var s={data_type:e.secondResForm.secResSelect,graph_type:e.secondResForm.resChartSelect,time:r()(e.getTime2[0]).format("YYYY-MM-DD HH::mm:ss")+"/"+r()(e.getTime2[1]).format("YYYY-MM-DD HH:mm:ss")};e.$api.post(a.k,s).then(function(t){e.resImg2=t.data.test_image+"?t="+(new Date).getTime(),200===t.status&&(e.isBtnLoading2=!1,e.isImgLoading2=!1)}).catch(function(t){console.log(t),e.isBtnLoading2=!0,e.isImgLoading2=!0})}})}}},c={render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("Row",{attrs:{gutter:20}},[s("i-col",{attrs:{span:"24",xs:24,lg:24}},[s("Card",{attrs:{shadow:""}},[s("i-form",{ref:"responsiveForm",attrs:{inline:"",model:e.responsiveForm,rules:e.ruleResponsiveForm}},[s("Form-item",{attrs:{prop:"data_type"}},[s("i-select",{staticStyle:{width:"100px"},attrs:{placeholder:"请选择类型",clearable:""},model:{value:e.responsiveForm.resSelect,callback:function(t){e.$set(e.responsiveForm,"resSelect",t)},expression:"responsiveForm.resSelect"}},e._l(e.firstResList,function(t){return s("i-option",{key:t.index,attrs:{value:t.value}},[e._v(e._s(e._f("kindsChange")(t.value)))])}),1)],1),e._v(" "),s("Form-item",{attrs:{prop:"effect_type"}},[s("i-select",{staticStyle:{width:"120px"},attrs:{placeholder:"请选择时间区",clearable:""},model:{value:e.responsiveForm.effectSelect,callback:function(t){e.$set(e.responsiveForm,"effectSelect",t)},expression:"responsiveForm.effectSelect"}},e._l(e.timeAreaList,function(t){return s("i-option",{key:t.index,attrs:{value:t.value}},[e._v(e._s(e._f("responseChange")(t.value)))])}),1)],1),e._v(" "),s("Form-item",{attrs:{prop:"time"}},[s("Date-picker",{staticStyle:{width:"300px"},attrs:{confirm:"",options:e.responsiveOptions,type:"datetimerange",format:"yyyy-MM-dd HH:mm:ss",placeholder:"请选择开始时间和结束时间"},model:{value:e.getTime1,callback:function(t){e.getTime1=t},expression:"getTime1"}})],1),e._v(" "),s("Form-item",[s("i-button",{attrs:{loading:e.isBtnLoading1,type:"primary"},on:{click:e.handleResSubmit_one}},[e._v("确定")])],1)],1),e._v(" "),s("div",{staticClass:"img-div"},[s("viewer",[s("img",{attrs:{src:e.resImg1}})]),e._v(" "),e.isImgLoading1?s("Spin",{attrs:{fix:""}},[e._v("加载中...")]):e._e()],1)],1)],1)],1),e._v(" "),s("Row",{staticStyle:{"margin-top":"10px"},attrs:{gutter:20}},[s("i-col",[s("Card",{attrs:{shadow:""}},[s("i-form",{ref:"secondResForm",attrs:{inline:"",model:e.secondResForm,rules:e.ruleSecResForm}},[s("Form-item",{attrs:{prop:"graph_type"}},[s("i-select",{staticStyle:{width:"100px"},attrs:{placeholder:"请选择图表类型",clearable:""},model:{value:e.secondResForm.resChartSelect,callback:function(t){e.$set(e.secondResForm,"resChartSelect",t)},expression:"secondResForm.resChartSelect"}},e._l(e.graphList,function(t){return s("i-option",{key:t.index,attrs:{value:t.value}},[e._v(e._s(e._f("chartsChange")(t.value)))])}),1)],1),e._v(" "),s("Form-item",{attrs:{prop:"data_type"}},[s("i-select",{staticStyle:{width:"120px"},attrs:{placeholder:"请选择类型",clearable:""},model:{value:e.secondResForm.secResSelect,callback:function(t){e.$set(e.secondResForm,"secResSelect",t)},expression:"secondResForm.secResSelect"}},e._l(e.secResList,function(t){return s("i-option",{key:t.index,attrs:{value:t.value}},[e._v(e._s(e._f("errChange")(t.value)))])}),1)],1),e._v(" "),s("Form-item",{attrs:{prop:"time"}},[s("Date-picker",{staticStyle:{width:"300px"},attrs:{confirm:"",options:e.secResOptions,type:"datetimerange",format:"yyyy-MM-dd HH:mm:ss",placeholder:"请选择开始时间和结束时间"},model:{value:e.getTime2,callback:function(t){e.getTime2=t},expression:"getTime2"}})],1),e._v(" "),s("Form-item",[s("i-button",{attrs:{loading:e.isBtnLoading2,type:"primary"},on:{click:e.handleResSubmit_second}},[e._v("二次测试按钮")])],1)],1),e._v(" "),s("div",{staticClass:"img-div"},[s("viewer",[s("img",{attrs:{src:e.resImg2}})]),e._v(" "),e.isImgLoading2?s("Spin",{attrs:{fix:""}},[e._v("加载中...")]):e._e()],1)],1)],1)],1)],1)},staticRenderFns:[]};var m=s("VU/8")(o,c,!1,function(e){s("h0gS")},"data-v-9305f30e",null);t.default=m.exports},h0gS:function(e,t){}});