tubiao.js 10.6 KB
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/tubiao/tubiao"],{2166:function(e,t,a){"use strict";a.r(t);var n=a("593d"),r=a.n(n);for(var i in n)"default"!==i&&function(e){a.d(t,e,(function(){return n[e]}))}(i);t["default"]=r.a},4834:function(e,t,a){"use strict";a.r(t);var n=a("588e"),r=a("5120");for(var i in r)"default"!==i&&function(e){a.d(t,e,(function(){return r[e]}))}(i);a("b52b");var o,s=a("f0c5"),l=Object(s["a"])(r["default"],n["b"],n["c"],!1,null,null,null,!1,n["a"],o);t["default"]=l.exports},"4e90":function(e,t,a){"use strict";var n=a("d869"),r=a.n(n);r.a},5120:function(e,t,a){"use strict";a.r(t);var n=a("9a68"),r=a.n(n);for(var i in n)"default"!==i&&function(e){a.d(t,e,(function(){return n[e]}))}(i);t["default"]=r.a},"588e":function(e,t,a){"use strict";var n,r=function(){var e=this,t=e.$createElement;e._self._c},i=[];a.d(t,"b",(function(){return r})),a.d(t,"c",(function(){return i})),a.d(t,"a",(function(){return n}))},"593d":function(e,t,a){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a={onLaunch:function(){console.log("App Launch")},onShow:function(){console.log("App Show")},onHide:function(){console.log("App Hide")},post:function(t,a,n){var r=this,i=new Promise((function(i,o){var s=e.getStorageSync("token"),l={token:s||""};e.request({url:r.globalData.baseUrl+t,data:a,method:n,header:l,success:function(e){200==e.statusCode?i(e):o(e.data)},fail:function(e){console.log(e),o("网络出错"),wx.hideNavigationBarLoading()},complete:function(e){}})}));return i},globalData:{userInfo:null,baseUrl:"https://www.bjzha.net/api/"}};t.default=a}).call(this,a("543d")["default"])},"59df":function(e,t,a){"use strict";a.r(t);var n=a("2166");for(var r in n)"default"!==r&&function(e){a.d(t,e,(function(){return n[e]}))}(r);a("4e90");var i,o,s,l,u=a("f0c5"),c=Object(u["a"])(n["default"],i,o,!1,null,null,null,!1,s,l);t["default"]=c.exports},"802f":function(e,t,a){"use strict";(function(e){a("bdbd"),a("921b");n(a("66fd"));var t=n(a("4834"));function n(e){return e&&e.__esModule?e:{default:e}}e(t.default)}).call(this,a("543d")["createPage"])},"9a68":function(e,t,a){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;o(a("59df"));var n,r=o(a("b5cf")),i=a("0dee");function o(e){return e&&e.__esModule?e:{default:e}}function s(e){if("undefined"===typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=l(e))){var t=0,a=function(){};return{s:a,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,r,i=!0,o=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){o=!0,r=e},f:function(){try{i||null==n.return||n.return()}finally{if(o)throw r}}}}function l(e,t){if(e){if("string"===typeof e)return u(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(a):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?u(e,t):void 0}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=new Array(t);a<t;a++)n[a]=e[a];return n}var c=null,d=null,f=null,h={data:function(){return{cWidth:"",cHeight:"",pixelRatio:1,textarea:"",ordinatearr:[],montharr:[],monthmin:"",monthmax:"",monthnum:"",quartermax:"",quartermin:"",quarternum:"",yearnum:"",yearmax:"",yearmin:"",yeararr:[],ordinateyeararr:[]}},onLoad:function(){n=this,this.cWidth=e.upx2px(750),this.cHeight=e.upx2px(500),this.getServerDatamonth(),this.getServerData(),this.getServerDatayear()},methods:{getServerDatamonth:function(){var t=this,a=e.getStorageSync("userid");console.log(a),e.request({url:"http://39.105.61.115:1912/api/project/Get_RptDataaudit?fuserid="+a+"&type=month",data:{},success:function(e){console.log(e);var a=new Date,r=a.getMonth()+1,i=[];if(console.log(r),1==r||3==r||5==r||7==r||8==r||10==r||12==r)for(var o=1;o<=31;o++)o<10?i.push("0"+o):i.push(o);else if(28==r)for(o=1;o<=28;o++)o<10?i.push("0"+o):i.push(o);else if(29==r)for(o=1;o<=29;o++)o<10?i.push("0"+o):i.push(o);else for(o=1;o<=30;o++)o<10?i.push("0"+o):i.push(o);t.ordinatearr=i;var l,u=e.data,c=s(u);try{for(c.s();!(l=c.n()).done;){var d=l.value;d.data=d.data.split("-"),d.value=d.data[2]}}catch(y){c.e(y)}finally{c.f()}console.log(u.length);var f=[];for(o=0;o<t.ordinatearr.length;o++){f[o]=0;for(var h=0;h<u.length;h++)u[h].value==t.ordinatearr[o]&&(console.log(u[h].value),f[o]=u[h].count)}console.log(f);var g=Math.max.apply(this,f),p=Math.min.apply(this,f);if(0==p)var m=Number(g-p);else m=Number(g-p)+1;t.monthnum=m,t.monthnum>=20&&(t.monthnum=8),t.monthmax=g,t.monthmin=p,t.montharr=f;var v={categories:[],series:[]};d={categories:t.ordinatearr,series:[{name:"本月",data:t.montharr}]};v.categories=d.categories,v.series=d.series,n.textarea=JSON.stringify(d),n.showLineA("canvasLineA",v)},fail:function(){n.tips="网络错误,小程序端请检查合法域名"}})},getServerData:function(){var t=this,a=e.getStorageSync("userid");console.log(a),e.request({url:"http://39.105.61.115:1912/api/project/Get_RptDataaudit?fuserid=13240379243&type=quarter",data:{},success:function(e){console.log("本季度",e);var a=new Date,r=a.getMonth()+1,i=[];console.log(r);var o,l=s(e.data);try{for(l.s();!(o=l.n()).done;){var u=o.value;i.push(u.data)}}catch(y){l.e(y)}finally{l.f()}t.ordinatearr=i;var c,d=[],f=e.data,h=s(f);try{for(h.s();!(c=h.n()).done;){u=c.value;d.push(u.count)}}catch(y){h.e(y)}finally{h.f()}var g=Math.max.apply(this,d),p=Math.min.apply(this,d);if(0==p)var m=Number(g-p);else m=Number(g-p)+1;t.quarternum=m,t.quarternum>=20&&(t.quarternum=8),console.log("00998877",t.quarternum),console.log(p),t.quartermax=g,t.quartermin=p,t.montharr=d;var v={categories:[],series:[]};u={categories:t.ordinatearr,series:[{name:"本季度",data:t.montharr}]};v.categories=u.categories,v.series=u.series,n.textarea=JSON.stringify(u),n.showLineB("canvasLineB",v)},fail:function(){n.tips="网络错误,小程序端请检查合法域名"}})},getServerDatayear:function(){var t=this,a=e.getStorageSync("userid");e.request({url:"http://39.105.61.115:1912/api/project/Get_RptDataaudit?fuserid="+a+"&type=year",data:{},success:function(e){console.log("本年",e);for(var a=[],r=1;r<=12;r++)r<10?a.push("0"+r):a.push(r);t.ordinateyeararr=a;var i,o=e.data,l=s(o);try{for(l.s();!(i=l.n()).done;){var u=i.value;u.data=u.data.split("-"),u.value=u.data[1]}}catch(m){l.e(m)}finally{l.f()}var c=[];for(r=0;r<t.ordinateyeararr.length;r++){c[r]=0;for(var d=0;d<o.length;d++)o[d].value==t.ordinateyeararr[r]&&(console.log(o[d].value),c[r]=o[d].count)}console.log("年度",c);var f=Math.max.apply(this,c),h=Math.min.apply(this,c),g="";g=0==h?Number(f-h):Number(f-h)+1,console.log("0998766",g),t.yearnum=g,t.yearnum>=20&&(t.yearnum=8),console.log(f),console.log(h),t.yearmax=f,t.yearmin=h,t.yeararr=c;var p={categories:[],series:[]};u={categories:t.ordinateyeararr,series:[{name:"本年",data:t.yeararr}]};p.categories=u.categories,p.series=u.series,n.textarea=JSON.stringify(u),n.showLineC("canvasLineC",p)},fail:function(){n.tips="网络错误,小程序端请检查合法域名"}})},showLineA:function(e,t){var a=this;c=new r.default({$this:n,canvasId:e,type:"line",fontSize:11,padding:[15,15,0,15],legend:{show:!0,padding:5,lineHeight:11,margin:15},dataLabel:!0,dataPointShape:!0,dataPointShapeType:"hollow",background:"#FFFFFF",pixelRatio:n.pixelRatio,categories:t.categories,series:t.series,animation:!0,enableScroll:!0,xAxis:{disableGrid:!1,type:"grid",gridType:"dash",itemCount:4,scrollShow:!0,scrollAlign:"left"},yAxis:{gridType:"dash",splitNumber:a.monthnum,min:a.monthmin,max:a.monthmax,format:function(e){return e.toFixed(0)}},width:n.cWidth*n.pixelRatio,height:n.cHeight*n.pixelRatio,extra:{line:{type:"straight"}}})},touchLineA:function(e){c.scrollStart(e)},moveLineA:function(e){c.scroll(e)},touchEndLineA:function(e){c.scrollEnd(e),c.touchLegend(e),c.showToolTip(e,{format:function(e,t){return t+" "+e.name+":"+e.data}})},changeDataF:function(){if((0,i.isJSON)(n.textarea)){var t=JSON.parse(n.textarea);c.updateData({series:t.series,categories:t.categories,scrollPosition:"right",animation:!1})}else e.showToast({title:"数据格式错误",image:"../../../static/images/alert-warning.png"})},showLineB:function(e,t){var a=this;d=new r.default({$this:n,canvasId:e,type:"line",fontSize:11,padding:[15,15,0,15],legend:{show:!0,padding:5,lineHeight:11,margin:15},dataLabel:!0,dataPointShape:!0,dataPointShapeType:"hollow",background:"#FFFFFF",pixelRatio:n.pixelRatio,categories:t.categories,series:t.series,animation:!0,enableScroll:!0,xAxis:{disableGrid:!1,type:"grid",gridType:"dash",itemCount:4,scrollShow:!0,scrollAlign:"left"},yAxis:{gridType:"dash",splitNumber:a.quarternum,min:a.quartermin,max:a.quartermax,format:function(e){return e.toFixed(0)}},width:n.cWidth*n.pixelRatio,height:n.cHeight*n.pixelRatio,extra:{line:{type:"straight"}}})},touchLineB:function(e){d.scrollStart(e)},moveLineB:function(e){d.scroll(e)},touchEndLineB:function(e){d.scrollEnd(e),d.touchLegend(e),d.showToolTip(e,{format:function(e,t){return t+" "+e.name+":"+e.data}})},changeDataH:function(){if((0,i.isJSON)(n.textarea)){var t=JSON.parse(n.textarea);d.updateData({series:t.series,categories:t.categories,scrollPosition:"right",animation:!1})}else e.showToast({title:"数据格式错误",image:"../../../static/images/alert-warning.png"})},showLineC:function(e,t){var a=this;f=new r.default({$this:n,canvasId:e,type:"line",fontSize:11,padding:[15,15,0,15],legend:{show:!0,padding:5,lineHeight:11,margin:15},dataLabel:!0,dataPointShape:!0,dataPointShapeType:"hollow",background:"#FFFFFF",pixelRatio:n.pixelRatio,categories:t.categories,series:t.series,animation:!0,enableScroll:!0,xAxis:{disableGrid:!1,type:"grid",gridType:"dash",itemCount:6,scrollShow:!0,scrollAlign:"left"},yAxis:{gridType:"dash",splitNumber:a.yearnum,min:a.yearmin,max:a.yearmax,format:function(e){return e.toFixed(0)}},width:n.cWidth*n.pixelRatio,height:n.cHeight*n.pixelRatio,extra:{line:{type:"straight"}}})},touchLineC:function(e){f.scrollStart(e)},moveLineC:function(e){f.scroll(e)},touchEndLineC:function(e){f.scrollEnd(e),f.touchLegend(e),f.showToolTip(e,{format:function(e,t){return t+" "+e.name+":"+e.data}})},changeDatak:function(){if((0,i.isJSON)(n.textarea)){var t=JSON.parse(n.textarea);f.updateData({series:t.series,categories:t.categories,scrollPosition:"right",animation:!1})}else e.showToast({title:"数据格式错误",image:"../../../static/images/alert-warning.png"})}}};t.default=h}).call(this,a("543d")["default"])},b52b:function(e,t,a){"use strict";var n=a("dd33"),r=a.n(n);r.a},d869:function(e,t,a){},dd33:function(e,t,a){}},[["802f","common/runtime","common/vendor"]]]);