2 lines
5.0 KiB
JavaScript
2 lines
5.0 KiB
JavaScript
var U=Object.defineProperty,Y=Object.defineProperties;var G=Object.getOwnPropertyDescriptors;var j=Object.getOwnPropertySymbols;var J=Object.prototype.hasOwnProperty,H=Object.prototype.propertyIsEnumerable;var K=(e,t,a)=>t in e?U(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,y=(e,t)=>{for(var a in t||(t={}))J.call(t,a)&&K(e,a,t[a]);if(j)for(var a of j(t))H.call(t,a)&&K(e,a,t[a]);return e},w=(e,t)=>Y(e,G(t));var k=(e,t,a)=>new Promise((f,d)=>{var g=s=>{try{u(a.next(s))}catch(i){d(i)}},b=s=>{try{u(a.throw(s))}catch(i){d(i)}},u=s=>s.done?f(s.value):Promise.resolve(s.value).then(g,b);u((a=a.apply(e,t)).next())});import{Modal as L,Tabs as W,TabPane as X}from"ant-design-vue";import{d as Z,r as m,q as ee,e as _,J as te,E as ae,an as oe,_ as se,j as C,P as I,o as B,f as T,m as D,s as V,h as c,t as ne,F as ie,S as le,i as re,aw as ce,Q as de,cn as ue,co as pe}from"./index.7edff3d4.js";import{t as me,v as fe}from"./other.ed2ccd93.js";import{u as be}from"./useECharts.d100ee71.js";import{u as he}from"./visualization.dd6465e6.js";import{a as ge}from"./colors.d19e85ff.js";import{_ as ve}from"./model-close-icon.706a0490.js";const ye=[{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}],_e=Z({name:"CModal",components:{[L.name]:L,Tabs:W,TabPane:X},props:{visible:{type:Boolean},parentId:{type:[String,Number]},name:{type:[String]}},setup(e,{attrs:t}){const a=m(!1),f=m(!1),d=m(null),g=m(e.name),b=m(null),{setOptions:u}=be(b),s=m("top"),i=m(0),n=he(),r=ee({tabs:[],list:[]}),F=_(()=>e.name),P=_(()=>r.tabs[i.value]),A=_(()=>{var o;return(o=ye.find(l=>l.name==e.name))==null?void 0:o.id}),O=()=>{M()};function $(){const{is_end:o,id:l,name:p}=P.value;o==0&&(g.value=p,d.value=l,f.value=!0)}function M(){return k(this,null,function*(){var p,v,x;const o=yield me({year:n.getYear,base_id:n.getAddresId,category_id:A.value,crop_id:(x=(v=(p=P.value)==null?void 0:p.id)!=null?v:e.parentId)!=null?x:null}),l=[];for(const E in o)if(Object.prototype.hasOwnProperty.call(o,E)){const h=o[E];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,z()})}function z(){var p;const o={legendData:[],series:[]},l=ge;r.list.forEach(({name:v,list:x},E)=>{const h=l[E%l.length];o.legendData.push(v),o.series.push({name:v,data:x,type:"bar",itemStyle:{color:h.itemColor}})}),u({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:(p=r.list[0])==null?void 0:p.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 fe({parent_id:e.parentId,crop_type:2,category_id:A.value,type:e.parentId?"all":"top"});r.tabs=[{name:"\u5168\u90E8",id:null}].concat(o),i.value=0,M()})}const R=_(()=>w(y(y({},t),C(e)),{visible:C(a)})),q=_(()=>w(y({},t),{visible:C(f),parentId:C(d)})),Q=()=>document.body.querySelector(".cmodal");return te(()=>{a.value=!!e.visible}),ae(()=>C(a),o=>{o&&N()}),w(y({childPname:g,childParentId:d,title:F,getContainer:Q},oe(r)),{chartRef:b,mode:s,tabChange:O,activeKey:i,getBindValue:R,modelVisible1:f,getChildBindValue:q,chartClick:$})}}),Ce=e=>(ue("data-v-d8c4eed6"),e=e(),pe(),e),xe={class:"cmodal"},Ee=Ce(()=>c("img",{class:"w-22px h-22px inline text-0",src:ve,alt:"",srcset:""},null,-1)),we={class:"relative -mt-6px h-30px flex items-center"},Ie={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"},Se={class:"bg-[#1D2D35] mt-14px p-10px"},ke={class:"h-full flex flex-col w-full"},Be={class:"px-10px"};function De(e,t,a,f,d,g){const b=I("tab-pane"),u=I("tabs"),s=I("CModal",!0),i=I("a-modal");return B(),T("div",xe,[D(i,de(e.getBindValue,{bodyStyle:{background:"#233741",color:"#fff"},width:800,getContainer:e.getContainer}),{closeIcon:V(()=>[Ee]),default:V(()=>[c("div",null,[c("div",we,[c("div",Ie,ne(e.title),1)]),c("div",Se,[c("div",ke,[c("div",Be,[D(u,{size:"small",class:"mytabs",activeKey:e.activeKey,"onUpdate:activeKey":t[0]||(t[0]=n=>e.activeKey=n),"tab-position":e.mode,tabBarGutter:10,tabBarStyle:{color:"#fff",margin:0},onChange:e.tabChange},{default:V(()=>[(B(!0),T(ie,null,le(e.tabs,(n,r)=>(B(),re(b,{key:r,tab:n.name},null,8,["tab"]))),128))]),_:1},8,["activeKey","tab-position","onChange"])]),c("div",{onClick:t[1]||(t[1]=ce((...n)=>e.chartClick&&e.chartClick(...n),["prevent","stop"])),class:"h-400px w-full",ref:"chartRef"},null,512)])])]),D(s,{footer:null,visible:e.modelVisible1,"onUpdate:visible":t[2]||(t[2]=n=>e.modelVisible1=n),parentId:e.childParentId,name:e.childPname},null,8,["visible","parentId","name"])]),_:1},16,["getContainer"])])}var Fe=se(_e,[["render",De],["__scopeId","data-v-d8c4eed6"]]);export{Fe as default};
|