"use strict";const t=require("../../utils/util.js"),i=require("../../common/vendor.js"),e=require("../../common/assets.js"),a=require("../../uni_modules/lime-echart/static/echarts.min.js"),s={name:"cwsj-view",data:()=>({profitabilityIndicatorIndex:0,profitIndicatorIndex:0,cashFlowIndicatorIndex:0,option1:{legend:{show:!0,data:["货币资金","同比(右)"]},grid:{left:"2%",right:"2%",top:"5%",bottom:"30%"},xAxis:{type:"category",data:[],axisLabel:{rotate:45,fontSize:10}},yAxis:[{type:"value",name:"(%)",position:"left",alignTicks:!0,axisLine:{onZero:!1}},{type:"value",name:"(%)",position:"right",alignTicks:!0,axisLine:{onZero:!1}}],dataZoom:[{type:"slider"}],series:[{type:"bar",name:"ROE",data:[],yAxisIndex:0},{type:"line",name:"同比",data:[],yAxisIndex:1}]},option2:{legend:{show:!0,data:["经营现金流","同比(右)"]},grid:{left:"2%",right:"2%",top:"5%",bottom:"30%"},xAxis:{type:"category",data:[],axisLabel:{fontSize:10,rotate:45}},yAxis:[{type:"value",name:"(亿)",position:"left",alignTicks:!0,axisLine:{onZero:!1}},{type:"value",name:"(%)",position:"right",alignTicks:!0,axisLine:{onZero:!1}}],dataZoom:[{type:"slider"}],series:[{type:"bar",name:"经营现金流",data:[],yAxisIndex:0},{type:"line",name:"同比",data:[],yAxisIndex:1}]},option3:{legend:{show:!0,data:["净利润","同比(右)"]},grid:{left:"2%",right:"2%",top:"5%",bottom:"30%"},xAxis:{type:"category",data:[],axisLabel:{rotate:45,fontSize:10}},yAxis:[{type:"value",name:"(亿)",position:"left",alignTicks:!0,axisLine:{onZero:!1}},{type:"value",name:"(%)",position:"right",alignTicks:!0,axisLine:{onZero:!1}}],dataZoom:[{type:"slider"}],series:[{type:"bar",name:"净利润",data:[],yAxisIndex:0},{type:"line",name:"同比",data:[],yAxisIndex:1}]},getNumStr:t.getNumStr,accDiv:t.accDiv,accSub:t.accSub,accMul:t.accMul}),props:{financialBalanceList:Array,cashFlowList:Array,incomeStatementList:Array},watch:{financialBalanceList(i){let e=[],a=[];for(let s of i)e.push(s.report_type),s.assets.current_assets.cash?a.push(t.accDiv(s.assets.current_assets.cash,1e8).toFixed(2)):a.push(0);this.option1.xAxis.data=e,this.option1.series[0].data=a,this.profitabilityInit()},cashFlowList(i){let e=[],a=[];for(let s of i)e.push(s.report_type),s.operating_activities.net_flow?a.push(t.accDiv(s.operating_activities.net_flow,1e8).toFixed(2)):a.push(0);this.option2.xAxis.data=e,this.option2.series[0].data=a,this.cashFlowInit()},incomeStatementList(i){let e=[],a=[];for(let s of i)e.push(s.report_type),s.profit.net_profit?a.push(t.accDiv(s.profit.net_profit,1e9).toFixed(2)):data1.push(0);this.option3.xAxis.data=e,this.option3.series[0].data=a,this.incomeStatementInit()}},methods:{async profitabilityInit(){(await this.$refs.chartRef1.init(a)).setOption(this.option1)},async cashFlowInit(){(await this.$refs.chartRef2.init(a)).setOption(this.option2)},async incomeStatementInit(){(await this.$refs.chartRef3.init(a)).setOption(this.option3)},caculateOperatingFlowRatio(){let i=this.cashFlowList[0].operating_activities.net_flow,e=this.cashFlowList[4].operating_activities.net_flow;return t.accMul(t.accDiv(t.accSub(i,e),e),100).toFixed(2)},caculateNetIncreaseRatio(){let i=this.cashFlowList[0].cash_changes.net_increase,e=this.cashFlowList[4].cash_changes.net_increase;return t.accMul(t.accDiv(t.accSub(i,e),e),100).toFixed(2)},getLastYearPeriod(t){t[0].period.split("-")[0]},clickCashFlowIndicatorItem(i){if(this.cashFlowIndicatorIndex!=i){this.cashFlowIndicatorIndex=i;let e=[];if(0==i)for(let i of this.cashFlowList)i.operating_activities.net_flow?e.push(t.accDiv(i.operating_activities.net_flow,1e8).toFixed(2)):e.push(0);else if(1==i)for(let i of this.cashFlowList)i.financing_activities.net_flow?e.push(t.accDiv(i.financing_activities.net_flow,1e8).toFixed(2)):e.push(0);else if(2==i)for(let i of this.cashFlowList)i.investment_activities.net_flow?e.push(t.accDiv(i.investment_activities.net_flow,1e8).toFixed(2)):e.push(0);this.option2.series[0].data=e,this.cashFlowInit()}},clickProfitIndicatorItem(t){this.profitIndicatorIndex!=t&&(this.profitIndicatorIndex=t)}}};if(!Array){i.resolveComponent("l-echart")()}Math;const n=i._export_sfc(s,[["render",function(t,a,s,n,o,c){return i.e({a:e._imports_0$8,b:e._imports_1$2,c:i.f(["货币资金","所有者权益","关键指标"],((t,e,a)=>({a:i.t(t),b:i.n("item flexCenter "+(o.cashFlowIndicatorIndex==e?"select":"")),c:e}))),d:e._imports_2$14,e:e._imports_3$13,f:i.sr("chartRef1","63ca7cac-0"),g:s.financialBalanceList.length>0},s.financialBalanceList.length>0?{h:i.t(o.getNumStr(s.financialBalanceList[0].assets.total)),i:i.t(o.getNumStr(s.financialBalanceList[0].liabilities.total)),j:i.t(o.getNumStr(s.financialBalanceList[0].equity.total)),k:i.t(o.getNumStr(s.financialBalanceList[0].assets.current_assets.cash)),l:i.t(o.getNumStr(s.financialBalanceList[0].equity.capital_reserve)),m:i.t(o.getNumStr(s.financialBalanceList[0].equity.surplus_reserve)),n:i.t(o.getNumStr(s.financialBalanceList[0].equity.undistributed_profit))}:{},{o:e._imports_0$8,p:e._imports_1$2,q:i.f(["经营现金流","筹资现金流","投资现金流"],((t,e,a)=>({a:i.t(t),b:i.n("item flexCenter "+(o.cashFlowIndicatorIndex==e?"select":"")),c:e,d:i.o((t=>c.clickCashFlowIndicatorItem(e)),e)}))),r:e._imports_2$14,s:e._imports_3$13,t:i.sr("chartRef2","63ca7cac-1"),v:s.cashFlowList.length>0},s.cashFlowList.length>0?{w:i.t(o.getNumStr(s.cashFlowList[0].operating_activities.net_flow)),x:i.t(c.caculateOperatingFlowRatio()),y:i.t(o.getNumStr(s.cashFlowList[0].investment_activities.net_flow)),z:i.t(o.getNumStr(s.cashFlowList[0].financing_activities.net_flow)),A:i.t(o.getNumStr(s.cashFlowList[0].cash_changes.net_increase)),B:i.t(c.caculateNetIncreaseRatio())}:{},{C:e._imports_0$8,D:e._imports_1$2,E:i.f(["净利润","营业收入","期间费用"],((t,e,a)=>({a:i.t(t),b:i.n("item flexCenter "+(o.profitIndicatorIndex==e?"select":"")),c:e,d:i.o((t=>c.clickProfitIndicatorItem(e)),e)}))),F:e._imports_2$14,G:e._imports_3$13,H:e._imports_2$14,I:e._imports_3$13,J:i.sr("chartRef3","63ca7cac-2"),K:s.incomeStatementList.length>0},s.incomeStatementList.length>0?{L:i.t(o.getNumStr(s.incomeStatementList[0].comprehensive_income.total_comprehensive_income)),M:i.t(o.getNumStr(s.incomeStatementList[0].revenue.total_operating_revenue)),N:i.t(o.getNumStr(s.incomeStatementList[0].profit.operating_profit))}:{})}]]);wx.createComponent(n);