IDCDatasync-vue/dist22-04-07/js/chunk-340b6102.e7c58963.js
2025-01-15 20:19:34 +08:00

1 line
5.5 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-340b6102"],{"63c8":function(t,e,a){"use strict";a.r(e);var r=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("a-card",{attrs:{bordered:!1}},[a("div",{staticStyle:{height:"700px",overflow:"hidden auto"}},[a("div",{ref:"myChartTree",staticStyle:{width:"780px",height:"700px",float:"left"},attrs:{id:"echart"}}),a("div",{ref:"myChart",staticStyle:{width:"700px",height:"700px",float:"left"},attrs:{id:"echart"}}),a("div",{ref:"myChartDay",staticStyle:{width:"250px",height:"700px",float:"left"},attrs:{id:"echart"}})])])},i=[],o=a("d579"),d=a("0fea"),n={name:"dbTimeStatistics2",components:{JEllipsis:o["default"],VNodes:{functional:!0,render:function(t,e){return e.props.vnodes}}},data:function(){return{queryLoading:!0,idcDataSourceId:"",sourceUserId:"",idcDataSourceTableId:"",tableName:"",years:[],datacalendar:[],url:{yearData:"/sys/statistics/yearData",dayData:"/sys/statistics/dayData"}}},computed:{},created:function(){var t=this;this.$nextTick((function(){t.drawChart()}))},methods:{drawChart:function(){var t=this,e=this.$echarts.init(this.$refs.myChartTree),a=this.$echarts.init(this.$refs.myChart),r=this.$echarts.init(this.$refs.myChartDay),i={};Object(d["c"])("/idc/dataTarget/queryTreeData2").then((function(o){i=o,i.children.forEach((function(t,e){0!=e&&(t.collapsed=!0)}));var d={gradientColor:["#fff","#fff","#3CB371"],tooltip:{trigger:"item",triggerOn:"mousemove"},series:[{type:"tree",data:[i],top:"1%",left:"12%",bottom:"1%",right:"25%",symbolSize:14,itemStyle:{color:"#00deff",borderColor:"#00deff",borderWidth:2},label:{position:"left",verticalAlign:"middle",align:"right",fontSize:14,color:"#fff"},leaves:{label:{position:"right",verticalAlign:"middle",align:"left",fontSize:14,color:"#fff"}}}]};e.setOption(d);var n=t;e.on("click","series",(function(t){if(1==t.data.codeIndex)n.idcDataSourceId=t.data.id;else if(2==t.data.codeIndex){n.idcDataSourceId=t.data.pid,n.sourceUserId=t.data.id,n.idcDataSourceTableId=null,n.tableName=null;var o=20*t.data.children.length>700?20*t.data.children.length:700;e.resize({height:o}),a.resize({height:o}),r.resize({height:o}),n.getdataYearTable()}else if(3==t.data.codeIndex)return n.idcDataSourceTableId=t.data.id,n.tableName=t.data.name,void n.getdataYearTable();n.forEachChildren(i,t),d.series[0].data=[i],e.setOption(d)}))}))},drawCalendarChart:function(t){var e=this,a=this.$echarts.init(this.$refs.myChartDay);this.queryLoading=!0,t.year.length>7?this.queryLoading=!1:(a.showLoading({text:"数据统计中...",textColor:"#00deff",maskColor:"transparent"}),Object(d["c"])(this.url.dayData,t).then((function(r){if(a.hideLoading(),r.success){e.queryLoading=!1,e.datacalendar=[],e.getVirtulData(t.year,r.result);var i={gradientColor:["#fff","#fff","#3CB371"],title:{top:5,left:"center",text:t.tableName,textStyle:{color:"#ccc"}},tooltip:{position:"top",formatter:function(t){return t.data[1]>0?t.data[0]+",有数据,"+t.data[1]+"条":t.data[2]>0?t.data[0]+",有数据":t.data[0]+",无数据"}},calendar:[{left:"17%",cellSize:[20,"auto"],top:90,bottom:40,orient:"vertical",range:t.year,dayLabel:{margin:5,nameMap:"cn",color:"#00deff"},monthLabel:{nameMap:"cn",color:"#00deff"},itemStyle:{borderWidth:1,borderColor:"#00deff"},splitLine:{lineStyle:{width:2,color:"#112834"}}}],visualMap:{min:0,max:1,show:!1,calculable:!0,orient:"horizontal",left:"center",bottom:"15%"},series:[{type:"heatmap",coordinateSystem:"calendar",calendarIndex:0,data:e.datacalendar}]};a.setOption(i)}})))},getVirtulData:function(t,e){for(var a=+this.$echarts.number.parseDate(t+"-01-01"),r=+this.$echarts.number.parseDate(+t+1+"-01-01"),i=864e5,o=a;o<r;o+=i){for(var d=this.$echarts.format.formatTime("yyyy-MM-dd",o),n=0,l=0;l<e.length;l++)if(e[l][0]==d){n=e[l][2];break}this.datacalendar.push([d,n])}},getdataYearTable:function(){var t=this;if(this.years.length<1)for(var e=0;e<32;e++){var a=1996+e+"";this.years.push(a)}var r={targetId:this.idcDataSourceId,owner:this.sourceUserId,tableName:this.tableName};this.queryLoading=!0,Object(d["c"])(this.url.yearData,r).then((function(e){e.success&&(t.queryLoading=!1,t.drawYearChart(e.result.tables,e.result.data))}))},drawYearChart:function(t,e){var a=this.$echarts.init(this.$refs.myChart),r={gradientColor:["#fff","#fff","#3CB371"],title:{top:5,left:"35%",text:"数据同步结果统计",textStyle:{color:"#ccc"}},tooltip:{position:"top",formatter:function(t){return t.data[1]>0?t.data[0]+",有数据,"+t.data[1]+"条":t.data[2]>0?t.data[0]+",有数据":t.data[0]+",无数据"}},xAxis:{type:"category",data:this.years,axisLabel:{color:"#00deff",rotate:310},interval:1,axisLine:{lineStyle:{type:"solid",color:"#00deff"}}},yAxis:{type:"category",data:t,inverse:!0,axisLabel:{color:"#00deff"},axisLine:{lineStyle:{type:"solid",color:"#00deff"}}},grid:{left:"20%",right:"5%",top:60},visualMap:{min:0,max:1,show:!1,calculable:!0,orient:"horizontal",left:"center",bottom:"15%"},series:[{name:"Punch Card",type:"heatmap",data:e,itemStyle:{borderColor:"#112834"}}]};a.clear(),a.setOption(r);var i=this;a.on("click","series",(function(t){var e=t.value;if(!0!==i.queryLoading){var a={year:e[0],tableName:e[1],targetId:i.idcDataSourceId,owner:i.sourceUserId};i.drawCalendarChart(a)}}))},forEachChildren:function(t,e){var a=this;t.children.forEach((function(t){t.codeIndex==e.data.codeIndex?t.name==e.data.name?t.collapsed=!1:t.collapsed=!0:t.codeIndex<e.data.codeIndex&&t.children&&a.forEachChildren(t,e)}))}}},l=n,s=(a("e982"),a("2877")),c=Object(s["a"])(l,r,i,!1,null,"a6dfd436",null);e["default"]=c.exports},9495:function(t,e,a){},e982:function(t,e,a){"use strict";a("9495")}}]);