lcny-vue3-antd-admin/dist/assets/CModal.08042801.js

2 lines
6.0 KiB
JavaScript

var ee=Object.defineProperty,te=Object.defineProperties;var ae=Object.getOwnPropertyDescriptors;var K=Object.getOwnPropertySymbols;var oe=Object.prototype.hasOwnProperty,se=Object.prototype.propertyIsEnumerable;var O=(e,a,o)=>a in e?ee(e,a,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[a]=o,E=(e,a)=>{for(var o in a||(a={}))oe.call(a,o)&&O(e,o,a[o]);if(K)for(var o of K(a))se.call(a,o)&&O(e,o,a[o]);return e},I=(e,a)=>te(e,ae(a));var B=(e,a,o)=>new Promise((h,u)=>{var y=n=>{try{d(o.next(n))}catch(m){u(m)}},p=n=>{try{d(o.throw(n))}catch(m){u(m)}},d=n=>n.done?h(n.value):Promise.resolve(n.value).then(y,p);d((o=o.apply(e,a)).next())});import{a as ne,em as z,v as c,w as ie,f as v,ag as le,L as re,bf as ce,q as de,k,ao as ue,aE as N,o as S,h as D,p as V,B as A,i as l,t as j,l as pe,F as me,aH as fe,j as be,bo as ve,aF as he,eD as ge,eE as ye}from"./index.203f4f59.js";import{T as Ce,a as _e}from"./index.6791ddaa.js";import{B as xe,C as Ee}from"./other.d43d2a78.js";import{u as ke}from"./useECharts.f2bf9eb6.js";import{u as we}from"./visualization.0e8abb36.js";import{a as Ie}from"./colors.69d1b0cd.js";import{_ as Ne}from"./model-close-icon.706a0490.js";import"./index.0a5a9dd5.js";import{a as R}from"./add.91bd8d33.js";import"./useRefs.432b35dd.js";import"./PlusOutlined.8a2c9f9f.js";const Se=[{name:"\u519C\u4E1A",id:2},{name:"\u6E14\u4E1A",id:3},{name:"\u755C\u7267\u4E1A",id:4},{name:"\u6797\u4E1A",id:5},{name:"\u5176\u4ED6",id:6}],Be=ne({name:"CModal",components:{[z.name]:z,Tabs:Ce,TabPane:_e},props:{visible:{type:Boolean},parentId:{type:[String,Number]},name:{type:[String]},pName:{type:[String]}},setup(e,{attrs:a}){var $;const o=c(!1),h=c(!1),u=c(null),y=c(e.name),p=c(($=e.pName)!=null?$:e.name),d=c(null),{setOptions:n}=ke(d),m=c("top"),i=c(0),f=c([]),F=we(),g=ie({tabs:[],list:[]}),q=v(()=>e.name),P=v(()=>g.tabs[i.value]),T=v(()=>{var t;return(t=Se.find(s=>s.name==e.name))==null?void 0:t.id}),G=v(()=>{var t,s;return L(R(Number((t=f.value[0])!=null?t:0),Number((s=f.value[3])!=null?s:0)))}),U=v(()=>{var t,s;return L(R(Number((t=f.value[1])!=null?t:0),Number((s=f.value[2])!=null?s:0)))});function L(t){return t.toFixed(2).replace(/\.?0+$/,"")}const Y=()=>{M()};function H(){const{is_end:t,id:s,name:b}=P.value;t==0&&(y.value=b,u.value=s,h.value=!0)}function M(){return B(this,null,function*(){var b,C,w;const t=yield xe({year:F.getYear,base_id:F.getAddresId,category_id:T.value,crop_id:(w=(C=(b=P.value)==null?void 0:b.id)!=null?C:e.parentId)!=null?w:null}),s=[];for(const _ in t)if(Object.prototype.hasOwnProperty.call(t,_)){const r=t[_];s.push({name:`${r.name}(${r.unit})`,list:Object.keys(r.list).map(x=>r.list[x]),axis:Object.keys(r.list).map(x=>x)}),p.value=="\u519C\u4E1A"&&_=="output"&&(f.value=Object.keys(r.list).map(x=>r.list[x]))}g.list=s,Q()})}function Q(){var b;const t={legendData:[],series:[]},s=Ie;g.list.forEach(({name:C,list:w},_)=>{const r=s[_%s.length];t.legendData.push(C),t.series.push({name:C,data:w,type:"bar",barGap:0,label:{show:!0,color:"#fff",position:"top"},itemStyle:{color:r.itemColor}})}),n({grid:{left:"2%",right:"2%",top:"10%",bottom:"2%",containLabel:!0},legend:{show:!0,data:t.legendData,top:"0%",right:"0",textStyle:{color:"#ffffff"}},tooltip:{trigger:"axis",axisPointer:{lineStyle:{width:1,color:"#019680"}}},xAxis:{type:"category",data:(b=g.list[0])==null?void 0:b.axis,axisTick:{show:!1},axisLine:{show:!1},axisLabel:{color:"#fff"}},yAxis:[{type:"value",axisTick:{show:!1},splitLine:{lineStyle:{type:"solid",color:"#8EEEFF",opacity:.3}},axisLabel:{color:"#fff"}}],series:t.series})}function W(){return B(this,null,function*(){const t=yield Ee({parent_id:e.parentId,crop_type:2,category_id:T.value,type:e.parentId?"all":"top"});g.tabs=[].concat(t),i.value=0,M()})}const J=v(()=>I(E(E({},a),k(e)),{visible:k(o),maskClosable:!1})),X=v(()=>I(E({},a),{visible:k(h),parentId:k(u)})),Z=()=>document.body.clientWidth<3e3?document.body:document.body.querySelector(".cmodal");return le(()=>{o.value=!!e.visible}),re(()=>k(o),t=>{var s;t&&(p.value=(s=e.pName)!=null?s:e.name,ue(()=>{W()}))}),I(E({bigCount:G,smallCount:U,ppName:p,childPname:y,childParentId:u,title:q,getContainer:Z},ce(g)),{chartRef:d,mode:m,tabChange:Y,activeKey:i,getBindValue:J,modelVisible1:h,getChildBindValue:X,chartClick:H})}}),De=e=>(ge("data-v-0767713e"),e=e(),ye(),e),Ve={class:"cmodal"},Ae=De(()=>l("img",{class:"w-22px h-22px inline text-0",src:Ne,alt:"",srcset:""},null,-1)),je={class:"relative -mt-6px h-30px flex items-center"},Fe={class:"absolute top-0 left-40px right-40px bg-clip-text text-transparent bg-gradient-to-t from-[#76E9F0] to-[#A7E6EE] text-24px text-center"},Pe={class:"bg-[#1D2D35] mt-14px p-10px"},Te={class:"h-full flex flex-col w-full"},Le={key:0,class:"flex justify-end text-14px text-[#76e9f0]"},Me={class:"mr-10px"},$e={class:"px-10px"};function Ke(e,a,o,h,u,y){const p=N("tab-pane"),d=N("tabs"),n=N("CModal",!0),m=N("a-modal");return S(),D("div",Ve,[V(m,he(e.getBindValue,{bodyStyle:{background:"#233741",color:"#fff"},width:800,getContainer:e.getContainer}),{closeIcon:A(()=>[Ae]),default:A(()=>[l("div",null,[l("div",je,[l("div",Fe,j(e.title),1)]),l("div",Pe,[l("div",Te,[e.ppName=="\u519C\u4E1A"?(S(),D("div",Le,[l("div",Me,"\u5927\u6625:"+j(e.bigCount),1),l("div",null,"\u5C0F\u6625:"+j(e.smallCount),1)])):pe("",!0),l("div",$e,[V(d,{size:"small",class:"mytabs",activeKey:e.activeKey,"onUpdate:activeKey":a[0]||(a[0]=i=>e.activeKey=i),"tab-position":e.mode,tabBarGutter:10,tabBarStyle:{color:"#fff",margin:0},onChange:e.tabChange},{default:A(()=>[(S(!0),D(me,null,fe(e.tabs,(i,f)=>(S(),be(p,{key:f,tab:i.name},null,8,["tab"]))),128))]),_:1},8,["activeKey","tab-position","onChange"])]),l("div",{onClick:a[1]||(a[1]=ve((...i)=>e.chartClick&&e.chartClick(...i),["prevent","stop"])),class:"h-400px w-full",ref:"chartRef"},null,512)])])]),V(n,{footer:null,visible:e.modelVisible1,"onUpdate:visible":a[2]||(a[2]=i=>e.modelVisible1=i),parentId:e.childParentId,name:e.childPname,pName:e.ppName},null,8,["visible","parentId","name","pName"])]),_:1},16,["getContainer"])])}var Ze=de(Be,[["render",Ke],["__scopeId","data-v-0767713e"]]);export{Ze as default};