5.49d9f21e16f136fa71c7.js 7.68 KB
Newer Older
李明杰's avatar
李明杰 committed
1
webpackJsonp([5],{"6NKR":function(e,s,t){"use strict";Object.defineProperty(s,"__esModule",{value:!0});var r=t("PJh5"),i=t.n(r),a=t("VkeE"),o=t("6d20"),n={name:"seriesTime",data:function(){return{seriesForm:{seriesSelectModel:"",charSelectModel:"",seriesGetYear_start:"",seriesGetYear_end:"",seriesGetMonth_start:"",seriesGetMonth_end:""},seriesGetDay:[],seriesGetHour_start:"",seriesGetHour_end:"",read:!0,ruleSeriesForm:{seriesSelectModel:[{required:!0,trigger:"change",message:"请选择类型"}],charSelectModel:[{required:!0,trigger:"change",message:"请选择图表类型"}],seriesGetYear_start:[{required:!0,type:"date",trigger:"change",message:"请输入开始年份"}],seriesGetYear_end:[{required:!0,type:"date",trigger:"change",message:"请输入结束年份"}],seriesGetMonth_start:[{required:!0,type:"date",trigger:"change",message:"请输入开始月份"}],seriesGetMonth_end:[{required:!0,type:"date",trigger:"change",message:"请输入结束月份"}]},timeList:[],charList:[],seriesImg:"",seriesIndex:4,yearOptions:{disabledDate:function(e){var s=(new Date).getFullYear();return e<i()("2018-12-21","YYYY").toDate()||new Date(e.valueOf()).getFullYear()>=s+1}},monthOptions:{disabledDate:function(e){return e<i()("2018-12-21","YYYY-MM").toDate()||e.valueOf()>Date.now()}},dayOptions:{disabledDate:function(e){return e<i()("2018-12-21","YYYY-MM-DD").toDate()||e.valueOf()>Date.now()}},hourOptions:{disabledDate:function(e){return e<i()("2018-12-21 01:00:00","YYYY-MM-DD HH:mm:ss").toDate()||e.valueOf()>Date.now()}},dataPram:{},isBtnLoading:!1,isImgLoading:!0}},mounted:function(){var e=this;this.$api.post(a.l).then(function(s){e.timeList=s.data.time_type,e.charList=s.data.graph_type,e.seriesImg=s.data.image_path,e.seriesForm.charSelectModel=s.data.graph_type[0].value,e.seriesForm.seriesSelectModel=s.data.time_type[0].value;var t=s.data.time.split("/"),r=i()(t[0],"YYYY-MM-DD HH:mm").toDate(),a=i()(t[1],"YYYY-MM-DD HH:mm").toDate();e.seriesGetHour_start=r,e.seriesGetHour_end=a,e.isImgLoading=!1}).catch(function(s){e.isImgLoading=!0})},filters:{chartChange:function(e){return o.a[e]},timesChange:function(e){return o.e[e]}},methods:{sHourChange:function(e){this.seriesGetHour_start=e,this.seriesGetHour_end=i()(e,"YYYY-MM-DD HH:mm:ss").add(1,"days").toDate(),console.log("sHourChange:",this.seriesGetHour_end)},changeUserSelect:function(){return"year"===this.seriesForm.seriesSelectModel?this.seriesIndex=1:"month"===this.seriesForm.seriesSelectModel?this.seriesIndex=2:"day"===this.seriesForm.seriesSelectModel?this.seriesIndex=3:"hour"===this.seriesForm.seriesSelectModel?this.seriesIndex=4:void 0},returnData:function(){var e=i()(this.seriesForm.seriesGetYear_start).format("YYYY"),s=i()(this.seriesForm.seriesGetYear_end).format("YYYY"),t=i()(this.seriesForm.seriesGetMonth_start).format("YYYY-MM"),r=i()(this.seriesForm.seriesGetMonth_end).format("YYYY-MM");return"year"===this.seriesForm.seriesSelectModel&&s>=e?{time_type:this.seriesForm.seriesSelectModel,time:e+"/"+s,graph_type:this.seriesForm.charSelectModel}:"month"===this.seriesForm.seriesSelectModel&&s>=e?{time_type:this.seriesForm.seriesSelectModel,time:t+"/"+r,graph_type:this.seriesForm.charSelectModel}:"day"===this.seriesForm.seriesSelectModel?{time_type:this.seriesForm.seriesSelectModel,time:i()(this.seriesGetDay[0]).format("YYYY-MM-DD")+"/"+i()(this.seriesGetDay[1]).format("YYYY-MM-DD"),graph_type:this.seriesForm.charSelectModel}:"hour"===this.seriesForm.seriesSelectModel?{time_type:this.seriesForm.seriesSelectModel,time:i()(this.seriesGetHour_start).format("YYYY-MM-DD HH:mm:ss")+"/"+i()(this.seriesGetHour_end).format("YYYY-MM-DD HH:mm:ss"),graph_type:this.seriesForm.charSelectModel}:void 0},handleSeriesSubmit:function(){var e=this;this.$refs.seriesForm.validate(function(s){s&&!1===e.isBtnLoading&&(e.isBtnLoading=!0,e.isImgLoading=!0,e.$api.post(a.m,e.returnData()).then(function(s){e.seriesImg=s.data.time_image+"?t="+(new Date).getTime(),200===s.status&&(e.isBtnLoading=!1,e.isImgLoading=!1)}).catch(function(s){e.isBtnLoading=!0,e.isImgLoading=!0}))})}}},d={render:function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",[t("Row",{staticStyle:{"margin-top":"10px"},attrs:{gutter:20}},[t("i-col",{attrs:{span:"24",md:24,lg:24}},[t("Card",{attrs:{shadow:""}},[t("i-form",{ref:"seriesForm",attrs:{inline:"",model:e.seriesForm,rules:e.ruleSeriesForm}},[t("Form-item",{attrs:{prop:"time_type"}},[t("i-select",{staticStyle:{width:"100px"},attrs:{clearable:""},on:{"on-change":e.changeUserSelect},model:{value:e.seriesForm.seriesSelectModel,callback:function(s){e.$set(e.seriesForm,"seriesSelectModel",s)},expression:"seriesForm.seriesSelectModel"}},e._l(e.timeList,function(s){return t("i-option",{key:s.index,attrs:{value:s.value}},[e._v(e._s(e._f("timesChange")(s.value)))])}),1)],1),e._v(" "),t("Form-item",{attrs:{prop:"time"}},[t("div",{directives:[{name:"show",rawName:"v-show",value:1===e.seriesIndex,expression:"seriesIndex === 1"}]},[t("Date-picker",{staticStyle:{width:"130px"},attrs:{options:e.yearOptions,type:"year",placeholder:"请选择开始年份"},model:{value:e.seriesForm.seriesGetYear_start,callback:function(s){e.$set(e.seriesForm,"seriesGetYear_start",s)},expression:"seriesForm.seriesGetYear_start"}}),e._v(" "),t("span",[e._v("-")]),e._v(" "),t("Date-picker",{staticStyle:{width:"130px"},attrs:{options:e.yearOptions,type:"year",placeholder:"请选择结束年份"},model:{value:e.seriesForm.seriesGetYear_end,callback:function(s){e.$set(e.seriesForm,"seriesGetYear_end",s)},expression:"seriesForm.seriesGetYear_end"}})],1),e._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:2===e.seriesIndex,expression:"seriesIndex === 2"}]},[t("Date-picker",{staticStyle:{width:"130px"},attrs:{options:e.monthOptions,type:"month",placeholder:"请选择开始月份"},model:{value:e.seriesForm.seriesGetMonth_start,callback:function(s){e.$set(e.seriesForm,"seriesGetMonth_start",s)},expression:"seriesForm.seriesGetMonth_start"}}),e._v(" -\n              "),t("Date-picker",{staticStyle:{width:"130px"},attrs:{options:e.monthOptions,type:"month",placeholder:"请选择结束月份"},model:{value:e.seriesForm.seriesGetMonth_end,callback:function(s){e.$set(e.seriesForm,"seriesGetMonth_end",s)},expression:"seriesForm.seriesGetMonth_end"}})],1),e._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:3===e.seriesIndex,expression:"seriesIndex === 3"}]},[t("Date-picker",{staticStyle:{width:"300px"},attrs:{options:e.dayOptions,confirm:"",type:"daterange",format:"yyyy-MM-dd",placeholder:"请选择日期"},model:{value:e.seriesGetDay,callback:function(s){e.seriesGetDay=s},expression:"seriesGetDay"}})],1),e._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:4===e.seriesIndex,expression:"seriesIndex === 4"}]},[t("Date-picker",{attrs:{options:e.hourOptions,type:"datetime",format:"yyyy-MM-dd HH:mm:ss",placeholder:"请选择开始时间"},on:{"on-change":e.sHourChange},model:{value:e.seriesGetHour_start,callback:function(s){e.seriesGetHour_start=s},expression:"seriesGetHour_start"}}),e._v(" "),t("span",[e._v("-")]),e._v(" "),t("Date-picker",{attrs:{options:e.hourOptions,readonly:e.read,type:"datetime",format:"yyyy-MM-dd HH:mm:ss",placeholder:"请选择结束时间"},model:{value:e.seriesGetHour_end,callback:function(s){e.seriesGetHour_end=s},expression:"seriesGetHour_end"}})],1)]),e._v(" "),t("Form-item",[t("i-button",{attrs:{loading:e.isBtnLoading,type:"primary"},on:{click:function(s){return e.handleSeriesSubmit("seriesForm")}}},[e._v("确定")])],1)],1),e._v(" "),t("div",{staticClass:"img-div"},[t("viewer",[t("img",{attrs:{src:e.seriesImg}})]),e._v(" "),e.isImgLoading?t("Spin",{attrs:{fix:""}},[e._v("加载中...")]):e._e()],1)],1)],1)],1)],1)},staticRenderFns:[]};var m=t("VU/8")(n,d,!1,function(e){t("IHwx")},"data-v-3408eb7d",null);s.default=m.exports},IHwx:function(e,s){}});