Files
qhmes/web-dist/js/GraphreportAutoChart-D38hOtH0.js
2026-06-16 18:19:57 +08:00

2 lines
7.3 KiB
Java

var L=Object.defineProperty,W=Object.defineProperties;var j=Object.getOwnPropertyDescriptors;var w=Object.getOwnPropertySymbols;var Q=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable;var E=(t,o,e)=>o in t?L(t,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[o]=e,g=(t,o)=>{for(var e in o||(o={}))Q.call(o,e)&&E(t,e,o[e]);if(w)for(var e of w(o))X.call(o,e)&&E(t,e,o[e]);return t},A=(t,o)=>W(t,j(o));var v=(t,o,e)=>new Promise((u,l)=>{var p=s=>{try{a(e.next(s))}catch(i){l(i)}},n=s=>{try{a(e.throw(s))}catch(i){l(i)}},a=s=>s.done?u(s.value):Promise.resolve(s.value).then(p,n);a((e=e.apply(t,o)).next())});import{aG as Z,r as ee,aP as te,cH as N,au as re,aH as oe}from"./index-X7Y8jykP.js";import ae from"./ErrorTip-BTY2OfD5.js";import ie from"./ChartAutoRender-BSmg2Jhu.js";import{B as ne}from"./BasicForm-ClUSoD_-.js";import"./helper-DcLcf4v6.js";import{u as se}from"./useForm-D61zovon.js";import{onMountedOrActivated as me}from"./onMountedOrActivated-DhSdLlqP.js";import{g as pe,a as le}from"./graphreport.api-BW5tsy84.js";import{m as ce}from"./dayjs-jnKD3YGS.js";import{n as O,i as b,e as ue,h as fe,r as C,b as F,c as de,a2 as he,C as k,z as y,f as x,A as B,K as _,y as T,F as ge,H as ve}from"./vue-vendor-DNhG1Cve.js";import ye from"./index-DklMb9Qc.js";import{C as Ce}from"./index-BwqG9R3y.js";import"./emoji-mart-vue-fast-R0uJEDq-.js";import"./ChartTabsRender-ClzWAewK.js";import"./useChartRender-Ctx-lg-5.js";import"./usePrintJS-Bi_9y7xu.js";import"./print-CBZdh_NG.js";import"./download-CygB1orH.js";import"./base64Conver-24EVOS6V.js";import"./JDictSelectUtil-DwVTEDM5.js";import"./index-Cq6YxX27.js";import"./Bar-DCEyn2jh.js";import"./useECharts-BKJWOWs-.js";import"./useTimeout-D5AmIBZw.js";import"./useEventListener-BRXjwk7A.js";import"./useBreakpoint-DXhPW7nV.js";import"./breakpointEnum-BhAg6bcX.js";import"./echarts-O0zoDaFZ.js";import"./Pie-BfX96_-a.js";import"./BarMulti--ZxpkIeN.js";import"./LineMulti-0TfPtS_j.js";import"./Group-DBzJABA_.js";import"./Checkbox-Dbxs4we4.js";import"./RadioButton-DRBix2Fq.js";import"./index-CuWaQdlK.js";import"./index-DO7ZhK45.js";import"./index-DsixALRt.js";import"./index-DTjkSGYl.js";import"./eagerComputed-BTlOruLW.js";import"./fromPairs-Dx9PT-t0.js";import"./useMaxLevel-DE205ncc.js";import"./index-DSsDi_fL.js";import"./Group-UHkub2tu.js";import"./index-BuONesFs.js";import"./index-CfNJyBRj.js";import"./dropdown-jkliuVyN.js";import"./index-DfHu-LAS.js";import"./index-C7ckZv9Z.js";import"./DirectoryTree-nk_YTTIy.js";import"./FolderOpenOutlined-SzIPA7z0.js";import"./index-Cl-8Hzo4.js";import"./scrollTo-D49dA-9c.js";import"./operationUnit-vCu2co3e.js";import"./index-M9QP6cvf.js";import"./Skeleton-CimgOdM7.js";import"./ChartSingleRender-D_yG-oyt.js";import"./ChartDoubleRender-CxRSy9VF.js";import"./index-BzChaRPg.js";import"./useAppInject-DPZGPcR3.js";import"./BasicForm.vue_vue_type_style_index_0_lang-B29PWQy0.js";import"./index-ByCwbQDV.js";import"./index-Upeu4GGa.js";import"./index-C4wWpZeQ.js";import"./useScrollTo-0FPEw5-K.js";import"./useIntersectionObserver-BGOgyKyu.js";import"./index-saD4h7VJ.js";import"./uniqBy--vsL0WVB.js";import"./index-BDvqZ5j4.js";import"./BasicModal-xH56XuRZ.js";import"./ModalHeader-Sr8KwhJJ.js";import"./useWindowSizeFn-C-0M9_Ul.js";import"./index-aCD42OrZ.js";import"./quarterOfYear-BU2sPnff.js";import"./index-J2mOtM3w.js";import"./UpOutlined-B1UMbtrP.js";function Fe(t,o){function e(){return v(this,null,function*(){let{head:u,items:l,dictOptions:p}=t.value;if(u.dataType==="sql"){let n=[];return l.forEach(a=>{if(a.searchFlag!=="Y")return;let s=a.searchMode==="group",i={},c=[];a.dictCode&&p[a.dictCode]?(i.component="Select",i.componentProps={options:p[a.dictCode]}):["Integer","Long"].includes(a.fieldType)?(i.component="InputNumber",s&&(i.render=Y(c,a,ye))):a.fieldType==="Date"?(i.component="DatePicker",i.componentProps={format:"YYYY-MM-DD"},s&&(i.render=Y(c,a,ce))):(i.component="Input",s&&(i.render=Y(c,a,Z))),n=n.concat(g({label:a.fieldTxt,field:a.fieldName,component:"Input",itemProps:{class:{"range-query":s}}},i)).concat(c)}),o.value=n.length>0,yield O(),n}else return o.value=!1,null})}return{parseFormSchemas:e}}function Y(t,o,e){let{fieldTxt:u,fieldName:l}=o,p=l+"_end";return t.push({label:"",field:p,component:"Input",show:!1}),function({model:n}){return[b(e,{value:n[l],"onUpdate:value":a=>n[l]=a,placeholder:"请输入开始"+u,format:"YYYY-MM-DD"}),b("span",{class:"range-span"},"~"),b(e,{value:n[p],"onUpdate:value":a=>n[p]=a,placeholder:"请输入结束"+u,format:"YYYY-MM-DD"})]}}const _e=ue({name:"GraphreportAutoChart",components:{BasicForm:ne,ErrorTip:ae,ChartAutoRender:ie,Card:Ce},props:{},setup(){he("setErrorTip",G);const t=ee.currentRoute,o=C(!1),e=C(),u=C(null),l=F({resultIsEmpty:!1}),p=C(),n=F({}),a=F({}),s=F({}),i=M(n,""),c=M(a),$=M(s,{}),P=C(!1),R={xs:24,sm:12,md:12,lg:8,xl:8,xxl:6},[q,S]=se({schemas:[],compact:!0,labelWidth:120,autoSubmitOnEnter:!0,rowProps:{gutter:8},baseColProps:g({},R),labelCol:{xs:24,sm:8,md:6,lg:8,xl:6,xxl:6},wrapperCol:{},showAdvancedButton:!0,autoAdvancedCol:3,actionColOptions:A(g({},R),{style:{textAlign:"left"}}),resetFunc:V,submitFunc:z});me(()=>{e.value=t.value.params.code}),fe(e,()=>{c.value=null,D()},{immediate:!0});function G(r){u.value=r}function D(){return v(this,null,function*(){if(o.value=!0,!e.value)return o.value=!1,!1;let r={id:e.value,params:i.value};if(c.value==null){c.value={};try{let f=yield pe({headId:r.id});if(f&&f.length>0)for(let d of f)c.value["self_"+d.paramName]=t.value.query[d.paramName]?t.value.query[d.paramName]:""}catch(f){return}}try{let f=yield le(g(g({},r),c.value)),{head:d,data:m,items:h,dictOptions:I}=f;m&&m.length===0?l.resultIsEmpty=!0:(l.resultIsEmpty=!1,p.value={head:d,data:m,items:h,dictOptions:I},U())}finally{o.value=!1}})}function M(r,f){return de({get(){return r[e.value]==null&&(r[e.value]=f),r[e.value]},set:d=>r[e.value]=d})}const{parseFormSchemas:H}=Fe(p,P);function U(){return v(this,null,function*(){let r=yield H();r&&r.length>0&&O(()=>{S.resetSchema(r)})})}function V(){return v(this,null,function*(){i.value="",D()})}function z(){return v(this,null,function*(){const r=yield S.validate();let{items:f}=p.value,d=[];for(let m of f){if(m.searchFlag!=="Y")continue;let h=null;if(m.searchMode||(m.searchMode="single"),m.searchMode==="single")h=r[m.fieldName];else{let I=r[m.fieldName],K=r[`${m.fieldName}_end`];h=[I,K]}m.fieldType==="Date"&&(h=J(h)),h!=null&&(h[0]!=null||h[1]!=null)&&d.push({value:h,fieldTxt:m.fieldTxt,fieldName:m.fieldName,fieldType:m.fieldType,searchMode:m.searchMode})}i.value=encodeURIComponent(JSON.stringify(d)),D()})}function J(r){if(r)if(te(r))r[0]&&(r[0]=N(r[0])),r[1]&&(r[1]=N(r[1]));else return N(r);return r}return{loading:o,errors:l,errorTip:u,chartsData:p,showSearchField:P,searchFormModal:$,registerSearchForm:q}}}),Te={class:"p-2"};function De(t,o,e,u,l,p){const n=_("ErrorTip"),a=_("BasicForm"),s=_("Card"),i=_("ChartAutoRender"),c=oe;return y(),k("div",Te,[x(c,{spinning:t.loading},{default:B(()=>[t.errorTip?(y(),T(n,{key:0,tip:t.errorTip},null,8,["tip"])):(y(),k(ge,{key:1},[t.showSearchField?(y(),T(s,{key:0},{default:B(()=>[x(a,{onRegister:t.registerSearchForm,model:t.searchFormModal},null,8,["onRegister","model"])]),_:1})):ve("",!0),t.errors.resultIsEmpty?(y(),T(n,{key:1,tip:"没有查询到任何数据"})):(y(),T(i,{key:2,chartsData:t.chartsData},null,8,["chartsData"]))],64))]),_:1},8,["spinning"])])}const Jt=re(_e,[["render",De],["__scopeId","data-v-f88c6858"]]);export{Jt as default};