Files
aiot-platform-ui/apps/web-antd/dist/js/index-CfFzpVJk.js

2 lines
8.6 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var y=(a,t,e)=>new Promise((C,f)=>{var x=o=>{try{u(e.next(o))}catch(i){f(i)}},b=o=>{try{u(e.throw(o))}catch(i){f(i)}},u=o=>o.done?C(o.value):Promise.resolve(o.value).then(x,b);u((e=e.apply(a,t)).next())});import{aq as L,bF as Y,ar as k,$ as A,av as B}from"./bootstrap-DsjPfOC_.js";import"./vxe-table-C9eY8pUC.js";import{g as F}from"./index-DC7CUIeC.js";import{g as _}from"./index-0DmMEJMD.js";import{d8 as I,m as N,b9 as w,cS as v,di as T,dj as U,v as $,ab as P,b2 as g,bJ as D,j as d,u as s,ad as O,I as V,bb as R}from"../jse/index-index-CO0ZsLf2.js";import{_ as E}from"./content-wrap.vue_vue_type_script_setup_true_lang-BpjRsiVS.js";import{u as j,_ as q}from"./use-echarts-DBBPKzKQ.js";import{_ as W}from"./page.vue_vue_type_script_setup_true_lang-BL-xU9lB.js";import{u as G}from"./use-vxe-grid-z_YbcgDZ.js";import"./dict-tag.vue_vue_type_script_setup_true_lang-BZwqGgTH.js";function X(a){return L.get("/crm/statistics-performance/get-contract-price-performance",{params:a})}function Z(a){return L.get("/crm/statistics-performance/get-receivable-price-performance",{params:a})}function H(a){return L.get("/crm/statistics-performance/get-contract-count-performance",{params:a})}function J(a,t){switch(a){case"ContractCountPerformance":return{grid:{left:20,right:20,bottom:20,containLabel:!0},legend:{},series:[{name:"当月合同数量(个)",type:"line",data:t.map(e=>e.currentMonthCount)},{name:"上月合同数量(个)",type:"line",data:t.map(e=>e.lastMonthCount)},{name:"去年同月合同数量(个)",type:"line",data:t.map(e=>e.lastYearCount)},{name:"环比增长率(%",type:"line",yAxisIndex:1,data:t.map(e=>e.lastMonthCount===0?"NULL":((e.currentMonthCount-e.lastMonthCount)/e.lastMonthCount*100).toFixed(2))},{name:"同比增长率(%",type:"line",yAxisIndex:1,data:t.map(e=>e.lastYearCount===0?"NULL":((e.currentMonthCount-e.lastYearCount)/e.lastYearCount*100).toFixed(2))}],toolbox:{feature:{dataZoom:{xAxisIndex:!1},brush:{type:["lineX","clear"]},saveAsImage:{show:!0,name:"客户总量分析"}}},tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},yAxis:[{type:"value",name:"数量(个)",axisTick:{show:!1},axisLabel:{color:"#BDBDBD",formatter:"{value}"},axisLine:{lineStyle:{color:"#BDBDBD"}},splitLine:{show:!0,lineStyle:{color:"#e6e6e6"}}},{type:"value",name:"",axisTick:{alignWithLabel:!0,lineStyle:{width:0}},axisLabel:{color:"#BDBDBD",formatter:"{value}%"},axisLine:{lineStyle:{color:"#BDBDBD"}},splitLine:{show:!0,lineStyle:{color:"#e6e6e6"}}}],xAxis:{type:"category",name:"日期",data:t.map(e=>e.time)}};case"ContractPricePerformance":return{grid:{left:20,right:20,bottom:20,containLabel:!0},legend:{},series:[{name:"当月合同金额(元)",type:"line",data:t.map(e=>e.currentMonthCount)},{name:"上月合同金额(元)",type:"line",data:t.map(e=>e.lastMonthCount)},{name:"去年同月合同金额(元)",type:"line",data:t.map(e=>e.lastYearCount)},{name:"环比增长率(%",type:"line",yAxisIndex:1,data:t.map(e=>e.lastMonthCount===0?"NULL":((e.currentMonthCount-e.lastMonthCount)/e.lastMonthCount*100).toFixed(2))},{name:"同比增长率(%",type:"line",yAxisIndex:1,data:t.map(e=>e.lastYearCount===0?"NULL":((e.currentMonthCount-e.lastYearCount)/e.lastYearCount*100).toFixed(2))}],toolbox:{feature:{dataZoom:{xAxisIndex:!1},brush:{type:["lineX","clear"]},saveAsImage:{show:!0,name:"客户总量分析"}}},tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},yAxis:[{type:"value",name:"金额(元)",axisTick:{show:!1},axisLabel:{color:"#BDBDBD",formatter:"{value}"},axisLine:{lineStyle:{color:"#BDBDBD"}},splitLine:{show:!0,lineStyle:{color:"#e6e6e6"}}},{type:"value",name:"",axisTick:{alignWithLabel:!0,lineStyle:{width:0}},axisLabel:{color:"#BDBDBD",formatter:"{value}%"},axisLine:{lineStyle:{color:"#BDBDBD"}},splitLine:{show:!0,lineStyle:{color:"#e6e6e6"}}}],xAxis:{type:"category",name:"日期",data:t.map(e=>e.time)}};case"ReceivablePricePerformance":return{grid:{left:20,right:20,bottom:20,containLabel:!0},legend:{},series:[{name:"当月回款金额(元)",type:"line",data:t.map(e=>e.currentMonthCount)},{name:"上月回款金额(元)",type:"line",data:t.map(e=>e.lastMonthCount)},{name:"去年同月回款金额(元)",type:"line",data:t.map(e=>e.lastYearCount)},{name:"环比增长率(%",type:"line",yAxisIndex:1,data:t.map(e=>e.lastMonthCount===0?"NULL":((e.currentMonthCount-e.lastMonthCount)/e.lastMonthCount*100).toFixed(2))},{name:"同比增长率(%",type:"line",yAxisIndex:1,data:t.map(e=>e.lastYearCount===0?"NULL":((e.currentMonthCount-e.lastYearCount)/e.lastYearCount*100).toFixed(2))}],toolbox:{feature:{dataZoom:{xAxisIndex:!1},brush:{type:["lineX","clear"]},saveAsImage:{show:!0,name:"客户总量分析"}}},tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},yAxis:[{type:"value",name:"金额(元)",axisTick:{show:!1},axisLabel:{color:"#BDBDBD",formatter:"{value}"},axisLine:{lineStyle:{color:"#BDBDBD"}},splitLine:{show:!0,lineStyle:{color:"#e6e6e6"}}},{type:"value",name:"",axisTick:{alignWithLabel:!0,lineStyle:{width:0}},axisLabel:{color:"#BDBDBD",formatter:"{value}%"},axisLine:{lineStyle:{color:"#BDBDBD"}},splitLine:{show:!0,lineStyle:{color:"#e6e6e6"}}}],xAxis:{type:"category",name:"日期",data:t.map(e=>e.time)}};default:return{}}}const K=Y(),Q=[{tab:"员工合同数量统计",key:"ContractCountPerformance"},{tab:"员工合同金额统计",key:"ContractPricePerformance"},{tab:"员工回款金额统计",key:"ReceivablePricePerformance"}];function z(){var a;return[{fieldName:"time",label:"选择年份",component:"DatePicker",componentProps:{picker:"year",format:"YYYY",valueFormat:"YYYY",placeholder:"请选择年份"},defaultValue:new Date().getFullYear().toString()},{fieldName:"deptId",label:"归属部门",component:"ApiTreeSelect",componentProps:{api:()=>y(null,null,function*(){const t=yield F();return I(t)}),labelField:"name",valueField:"id",childrenField:"children",treeDefaultExpandAll:!0,placeholder:"请选择归属部门"},defaultValue:(a=K.userInfo)==null?void 0:a.deptId},{fieldName:"userId",label:"员工",component:"ApiSelect",componentProps:{api:_,labelField:"nickname",valueField:"id",placeholder:"请选择员工",allowClear:!0}}]}const me=N({__name:"index",setup(a){const t=w("ContractCountPerformance"),e=w(),{renderEcharts:C}=j(e),[f,x]=k({commonConfig:{componentProps:{class:"w-full"}},schema:z(),showCollapseButton:!0,submitButtonOptions:{content:A("common.query")},wrapperClass:"grid-cols-1 md:grid-cols-2",handleSubmit:()=>y(null,null,function*(){yield o(t.value)})}),[b,u]=G({gridOptions:{columns:[],height:"auto",keepSource:!0,pagerConfig:{enabled:!1},proxyConfig:{enabled:!1},rowConfig:{keyField:"id",isHover:!0},toolbarConfig:{enabled:!1}}});function o(i){return y(this,null,function*(){t.value=i;const r=yield x.getValues(),c=Number.parseInt(r.time);r.times=[],r.times[0]=v(T(new Date(c,0,1))),r.times[1]=v(U(new Date(c,11,31)));let p=[];const h=[];let l=[];switch(i){case"ContractCountPerformance":{l=[{title:"当月合同数量统计(个)"},{title:"上月合同数量统计(个)"},{title:"去年当月合同数量统计(个)"},{title:"环比增长率(%"},{title:"同比增长率(%"}],p=yield H(r);break}case"ContractPricePerformance":{l=[{title:"当月合同金额统计(元)"},{title:"上月合同金额统计(元)"},{title:"去年当月合同金额统计(元)"},{title:"环比增长率(%"},{title:"同比增长率(%"}],p=yield X(r);break}case"ReceivablePricePerformance":{l=[{title:"当月回款金额统计(元)"},{title:"上月回款金额统计(元)"},{title:"去年当月回款金额统计(元)"},{title:"环比增长率(%"},{title:"同比增长率(%"}],p=yield Z(r);break}}const M={title:"日期",field:"title",minWidth:200,align:"left"};h.splice(0),h.push(M),p.forEach((n,m)=>{const S={title:n.time,field:`field${m}`};h.push(S),l[0][`field${m}`]=n.currentMonthCount,l[1][`field${m}`]=n.lastMonthCount,l[2][`field${m}`]=n.lastYearCount,l[3][`field${m}`]=n.lastMonthCount===0?"NULL":((n.currentMonthCount-n.lastMonthCount)/n.lastMonthCount*100).toFixed(2),l[4][`field${m}`]=n.lastYearCount===0?"NULL":((n.currentMonthCount-n.lastYearCount)/n.lastYearCount*100).toFixed(2)}),yield C(J(i,p),!0),yield u.grid.reloadColumn(h),yield u.grid.reloadData(l)})}return $(()=>{o(t.value)}),(i,r)=>(g(),P(s(W),{"auto-content-height":""},{default:D(()=>[d(s(E),null,{default:D(()=>[d(s(f)),d(s(B),{"active-key":t.value,"onUpdate:activeKey":r[0]||(r[0]=c=>t.value=c),class:"w-full",onChange:o},{default:D(()=>[(g(!0),O(V,null,R(s(Q),c=>(g(),P(s(B).TabPane,{key:c.key,tab:c.tab,"force-render":!0},null,8,["tab"]))),128))]),_:1},8,["active-key"]),d(s(q),{class:"mb-20 h-full w-full",ref_key:"chartRef",ref:e},null,512),d(s(b),{class:"min-h-[400px]"})]),_:1})]),_:1}))}});export{me as default};