| 1 |
- var C=(w,g,r)=>new Promise((x,c)=>{var v=o=>{try{d(r.next(o))}catch(_){c(_)}},f=o=>{try{d(r.throw(o))}catch(_){c(_)}},d=o=>o.done?x(o.value):Promise.resolve(o.value).then(v,f);d((r=r.apply(w,g)).next())});import{_ as z}from"./componentMap-090b9009.js";import{u as H}from"./useForm-2d0613b7.js";import"./FormItem.vue_vue_type_script_lang-d3f182d4.js";import{P as N}from"./ImportModal.vue_vue_type_style_index_0_scoped_a59c69fa_lang-153d3ad5.js";import"./index-74ee4d87.js";import{l as k}from"./index-971488e0.js";import{aj as T,m as G,_ as Z}from"./index.js";import{g as q}from"./treatApi-05804f33.js";import{u as I,_ as P}from"./useTable-15009f7a.js";import{l as E,B as A,a5 as b,a6 as R}from"./antd-d98832c6.js";import J from"./pie-b0d09d82.js";import{d as Q,f as u,o as U,Y as W,Z as X,_ as y,l as s,u as e,a7 as p,F as K}from"./vue-8fccce23.js";import"./index-7b00e5b4.js";import"./index-a7810134.js";import"./useFormItem-9c6d112e.js";import"./uuid-31b8b5a4.js";import"./useSortable-7338e303.js";import"./download-fac9a150.js";import"./copyTextToClipboard-ba2fd847.js";import"./TextEditor-e80f27f2.js";import"./onMountedOrActivated-cb072c10.js";import"./useWindowSizeFn-e2b93e2a.js";import"./useForm-bca35dcc.js";import"./componentMap-4cfd6e0f.js";import"./sortable.esm-4ae27e0b.js";import"./useECharts-60f43adb.js";const tt=[{title:"并发症类型",dataIndex:"type",align:"left"},{title:"数量",dataIndex:"sum",align:"left"},{title:"占比",dataIndex:"proportion",align:"left"}],at=[{field:"types",component:"RadioButtonGroup",componentProps:{options:[{label:"日",value:"day"},{label:"月",value:"month"}]},defaultValue:"day"},{field:"patrolTime",component:"RangePicker",componentProps:{format:"YYYY-MM-DD",valueFormat:"YYYY-MM-DD"},defaultValue:[E().add(-3,"month"),E()],colProps:{span:16}}],et={class:"flex items-center xt-form"},ot={class:"flex"},lt={class:"mb-4"},st=Q({__name:"index",setup(w){const g=u("通路并发症"),r=u({}),x=u([]),c=u([]),v=u([]),f=u([]),d=u("day");let o=[{title:"透析日期",dataIndex:"dateList",align:"left",width:120},{title:"合计",dataIndex:"totalCount",align:"left",width:100}];const[_,{getFieldsValue:D}]=H({schemas:at,autoSubmitOnEnter:!0,size:"large",rowProps:{gutter:16}}),[Y,{setTableData:S}]=I({showIndexColumn:!1,bordered:!0,striped:!1,pagination:!1,maxHeight:300,showSummary:!0,summaryFunc:$,dataSource:x.value,columns:tt}),[V,{setTableData:B,setColumns:M}]=I({showIndexColumn:!1,bordered:!0,striped:!1,pagination:!1,maxHeight:400,dataSource:c.value,columns:o});U(()=>C(this,null,function*(){f.value=yield k({dictCode:"va_comp"}),F()}));function j(){return C(this,null,function*(){v.value=D().patrolTime||[],d.value=D().types||"",F()})}function F(){return C(this,null,function*(){const i={time:v.value,type:d.value!=""?d.value:void 0},t=yield q(i),m=[],l={};t.forEach(n=>{Object.keys(n).forEach(a=>{l[a]?l[a]=l[a]+=n[a]:l[a]=n[a]})}),yield L(l),M(o),c.value=t,B(t),Object.keys(l).forEach(n=>{let a={};a={type:T(f.value,n,"label"),sum:l[n]},a&&(a!=null&&a.type)&&m.push(a)}),x.value=m,yield S(m);const h={content:[],description:g.value};m.forEach(n=>{h.content.push({name:n.type,value:n.sum})}),r.value=h})}function L(i){o=[{title:"透析日期",dataIndex:"dateList",align:"left",width:120},{title:"合计",dataIndex:"totalCount",align:"left",width:100}],Object.keys(i).forEach(t=>{t!="dateList"&&t!="totalCount"&&o.push({title:T(f.value,t,"label"),dataIndex:t,align:"left",width:130})})}function O(){console.log("下载按钮")}function $(i){console.log(i);let t=0,m=0;return i.forEach(l=>{t+=l.sum}),i.forEach(l=>{const h=parseFloat(l.sum/t*100).toFixed(2);l.proportion=h+"%",m+=parseFloat(parseFloat(h).toFixed(2))}),[{type:"合计",sum:t,proportion:m+"%"}]}return(i,t)=>(W(),X(K,null,[y("div",et,[y("div",ot,[s(e(z),{onRegister:e(_),onFieldValueChange:j,style:{width:"400px"},class:"mr-2"},null,8,["onRegister"])]),s(e(A),{type:"default",onClick:O,style:{height:"38px","margin-top":"-8px"}},{default:p(()=>[s(G,{icon:"icon-xt-download-download_default|iconfont",size:14})]),_:1})]),y("div",lt,[s(e(N),{title:g.value},null,8,["title"])]),s(e(R),{style:{"max-height":"400px"}},{default:p(()=>[s(e(b),{span:16},{default:p(()=>[s(J,{data:r.value},null,8,["data"])]),_:1}),s(e(b),{span:8},{default:p(()=>[s(e(P),{onRegister:e(Y)},null,8,["onRegister"])]),_:1})]),_:1}),s(e(R),{style:{"max-height":"200px"}},{default:p(()=>[s(e(b),{span:24},{default:p(()=>[s(e(P),{onRegister:e(V)},null,8,["onRegister"])]),_:1})]),_:1})],64))}});const Vt=Z(st,[["__scopeId","data-v-b8d654d7"]]);export{Vt as default};
|