2 lines
5.1 KiB
JavaScript
2 lines
5.1 KiB
JavaScript
var Y=Object.defineProperty,q=Object.defineProperties;var H=Object.getOwnPropertyDescriptors;var K=Object.getOwnPropertySymbols;var J=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable;var L=(t,e,a)=>e in t?Y(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,y=(t,e)=>{for(var a in e||(e={}))J.call(e,a)&&L(t,a,e[a]);if(K)for(var a of K(e))Q.call(e,a)&&L(t,a,e[a]);return t},E=(t,e)=>q(t,H(e));var k=(t,e,a)=>new Promise((f,d)=>{var v=s=>{try{p(a.next(s))}catch(i){d(i)}},b=s=>{try{p(a.throw(s))}catch(i){d(i)}},p=s=>s.done?f(s.value):Promise.resolve(s.value).then(v,b);p((a=a.apply(t,e)).next())});import{a as W,e3 as M,v as m,w as X,f as _,T as Z,K as tt,bd as et,L as at,k as C,aG as I,o as B,h as j,n as D,z as V,i as c,t as ot,F as st,aJ as nt,j as it,bm as lt,aH as rt,eA as ct,eB as dt}from"./index.c32990f8.js";import{T as pt,a as ut}from"./index.ec7e65df.js";import{t as mt,v as ft}from"./other.dd0bab57.js";import{u as bt}from"./useECharts.1f074a8e.js";import{u as ht}from"./visualization.8430e20b.js";import{a as vt}from"./colors.d19e85ff.js";import{_ as gt}from"./model-close-icon.706a0490.js";import"./index.b9570ac8.js";import"./useRefs.e81244b6.js";import"./PlusOutlined.36faec12.js";const yt=[{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}],_t=W({name:"CModal",components:{[M.name]:M,Tabs:pt,TabPane:ut},props:{visible:{type:Boolean},parentId:{type:[String,Number]},name:{type:[String]}},setup(t,{attrs:e}){const a=m(!1),f=m(!1),d=m(null),v=m(t.name),b=m(null),{setOptions:p}=bt(b),s=m("top"),i=m(0),n=ht(),r=X({tabs:[],list:[]}),F=_(()=>t.name),A=_(()=>r.tabs[i.value]),P=_(()=>{var o;return(o=yt.find(l=>l.name==t.name))==null?void 0:o.id}),O=()=>{T()};function z(){const{is_end:o,id:l,name:u}=A.value;o==0&&(v.value=u,d.value=l,f.value=!0)}function T(){return k(this,null,function*(){var u,g,x;const o=yield mt({year:n.getYear,base_id:n.getAddresId,category_id:P.value,crop_id:(x=(g=(u=A.value)==null?void 0:u.id)!=null?g:t.parentId)!=null?x:null}),l=[];for(const w in o)if(Object.prototype.hasOwnProperty.call(o,w)){const h=o[w];l.push({name:h.name,list:Object.keys(h.list).map(S=>h.list[S]),axis:Object.keys(h.list).map(S=>S)})}r.list=l,$()})}function $(){var u;const o={legendData:[],series:[]},l=vt;r.list.forEach(({name:g,list:x},w)=>{const h=l[w%l.length];o.legendData.push(g),o.series.push({name:g,data:x,type:"bar",itemStyle:{color:h.itemColor}})}),p({grid:{left:"2%",right:"2%",top:"10%",bottom:"2%",containLabel:!0},legend:{show:!0,data:o.legendData,top:"0%",right:"0",textStyle:{color:"#ffffff"}},tooltip:{trigger:"axis",axisPointer:{lineStyle:{width:1,color:"#019680"}}},xAxis:{type:"category",data:(u=r.list[0])==null?void 0:u.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:o.series})}function N(){return k(this,null,function*(){const o=yield ft({parent_id:t.parentId,crop_type:2,category_id:P.value,type:t.parentId?"all":"top"});r.tabs=[{name:"\u5168\u90E8",id:null}].concat(o),i.value=0,T()})}const R=_(()=>E(y(y({},e),C(t)),{visible:C(a)})),G=_(()=>E(y({},e),{visible:C(f),parentId:C(d)})),U=()=>document.body.querySelector(".cmodal");return Z(()=>{a.value=!!t.visible}),tt(()=>C(a),o=>{o&&N()}),E(y({childPname:v,childParentId:d,title:F,getContainer:U},et(r)),{chartRef:b,mode:s,tabChange:O,activeKey:i,getBindValue:R,modelVisible1:f,getChildBindValue:G,chartClick:z})}}),Ct=t=>(ct("data-v-d7bdb33e"),t=t(),dt(),t),xt={class:"cmodal"},wt=Ct(()=>c("img",{class:"w-22px h-22px inline text-0",src:gt,alt:"",srcset:""},null,-1)),Et={class:"relative -mt-6px h-30px flex items-center"},It={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"},St={class:"bg-[#1D2D35] mt-14px p-10px"},kt={class:"h-full flex flex-col w-full"},Bt={class:"px-10px"};function Dt(t,e,a,f,d,v){const b=I("tab-pane"),p=I("tabs"),s=I("CModal",!0),i=I("a-modal");return B(),j("div",xt,[D(i,rt(t.getBindValue,{bodyStyle:{background:"#233741",color:"#fff"},width:800,getContainer:t.getContainer}),{closeIcon:V(()=>[wt]),default:V(()=>[c("div",null,[c("div",Et,[c("div",It,ot(t.title),1)]),c("div",St,[c("div",kt,[c("div",Bt,[D(p,{size:"small",class:"mytabs",activeKey:t.activeKey,"onUpdate:activeKey":e[0]||(e[0]=n=>t.activeKey=n),"tab-position":t.mode,tabBarGutter:10,tabBarStyle:{color:"#fff",margin:0},onChange:t.tabChange},{default:V(()=>[(B(!0),j(st,null,nt(t.tabs,(n,r)=>(B(),it(b,{key:r,tab:n.name},null,8,["tab"]))),128))]),_:1},8,["activeKey","tab-position","onChange"])]),c("div",{onClick:e[1]||(e[1]=lt((...n)=>t.chartClick&&t.chartClick(...n),["prevent","stop"])),class:"h-400px w-full",ref:"chartRef"},null,512)])])]),D(s,{footer:null,visible:t.modelVisible1,"onUpdate:visible":e[2]||(e[2]=n=>t.modelVisible1=n),parentId:t.childParentId,name:t.childPname},null,8,["visible","parentId","name"])]),_:1},16,["getContainer"])])}var $t=at(_t,[["render",Dt],["__scopeId","data-v-d7bdb33e"]]);export{$t as default};
|