import{g as E}from"./tools-DrjFXnFN.js";import{a as U}from"./_js-fast-way-BT1PNT_n.js";import{m as M,a as O,_ as G,b as H}from"./gist-list-BYiOBhxx.js";import{b as u,i as I,aa as i,c as n,x as c,y as d,e as m,A as v,f as g,q as p,F as w,O as S}from"./__vendor-DQKyNF9L.js";import"../js2/index-DTu-QzEG.js";import"./_pinia-D4felSvJ.js";import"./_nprogress-BwII5Wsx.js";import"./_vue-router-6J-a2VIf.js";import"./_hc-vue3-ui-Dz3VIK_0.js";const J={key:0,class:"hc-flex"},Q={class:"relative ml-3 w-[300px]"},W={key:0,class:"hc-flex"},X={class:"ml-6 w-[120px]"},Z={class:"ml-2 w-[100px]"},ee={key:1,class:"hc-flex"},ae={class:"relative ml-3 w-[260px]"},le={class:"ml-6 w-[120px]"},ie={__name:"ledger",setup(te){const s=u("1"),F=u([{key:"1",name:"项目资料"},{key:"2",name:"工作要点"}]),T=({key:t})=>{s.value=t,t==="1"?b():t==="2"&&_()};I(()=>{A()});const V=u([]),A=async()=>{V.value=await E("projectStage",!0),y()},z=u([]),l=u({startYear:"",endYear:"",searchValue:"",projectStage:null,projectType:null,current:1,size:20,total:0}),o=u({targetPlan:"",workFocusStage:null,current:1,size:20,total:0}),b=()=>{l.value.current=1,y()},_=()=>{o.value.current=1,Y()},B=({current:t,size:a})=>{l.value.current=t,l.value.size=a,y()},N=({current:t,size:a})=>{o.value.current=t,o.value.size=a,Y()},P=u(null),f=u([]),h=u(!1),k=u([]),L=u(!1);u([]);const K=u([]),R=t=>{K.value=t},Y=async()=>{f.value=[],h.value=!0;const{error:t,code:a,data:r}=await O.page(o.value);h.value=!1,!t&&a===200?(f.value=U(r.records),o.value.total=r.total||0):(f.value=[],o.value.total=0)},y=async()=>{k.value=[],L.value=!0;const{error:t,code:a,data:r}=await M.page(l.value);h.value=!1,!t&&a===200?(k.value=U(r.records),l.value.total=r.total||0):(k.value=[],l.value.total=0)},$=t=>{console.log(t)};return(t,a)=>{const r=i("hc-date-year"),j=i("hc-search-input"),C=i("el-option"),x=i("el-select"),D=i("hc-pages"),q=i("hc-tab-card");return n(),c(q,{"w-to":"1450",tabs:F.value,"tab-key":s.value,class:"hc-project-ledger-page",onChange:T},{extraToSearch:d(()=>[s.value==="1"?(n(),m("div",J,[v(r,{modelValue:l.value.startYear,"onUpdate:modelValue":a[0]||(a[0]=e=>l.value.startYear=e),end:l.value.endYear,"onUpdate:end":a[1]||(a[1]=e=>l.value.endYear=e)},null,8,["modelValue","end"]),g("div",Q,[v(j,{modelValue:l.value.searchValue,"onUpdate:modelValue":a[2]||(a[2]=e=>l.value.searchValue=e),text:"搜索",color:"#151921",onSearch:b},null,8,["modelValue"])])])):p("",!0)]),extra:d(()=>[s.value==="1"?(n(),m("div",W,[g("div",X,[v(x,{modelValue:l.value.projectStage,"onUpdate:modelValue":a[3]||(a[3]=e=>l.value.projectStage=e),filterable:"",clearable:"",block:"",placeholder:"项目阶段",onChange:b},{default:d(()=>[(n(!0),m(w,null,S(V.value,e=>(n(),c(C,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),g("div",Z,[v(x,{modelValue:l.value.projectType,"onUpdate:modelValue":a[4]||(a[4]=e=>l.value.projectType=e),filterable:"",clearable:"",block:"",placeholder:"项目类型",onChange:b},{default:d(()=>[(n(!0),m(w,null,S(z.value,e=>(n(),c(C,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])])):p("",!0),s.value==="2"?(n(),m("div",ee,[v(r,{modelValue:o.value.startYear,"onUpdate:modelValue":a[5]||(a[5]=e=>o.value.startYear=e),end:o.value.endYear,"onUpdate:end":a[6]||(a[6]=e=>o.value.endYear=e)},null,8,["modelValue","end"]),g("div",ae,[v(j,{modelValue:o.value.targetPlan,"onUpdate:modelValue":a[7]||(a[7]=e=>o.value.targetPlan=e),color:"#151921",text:"搜索",onSearch:_},null,8,["modelValue"])]),g("div",le,[v(x,{modelValue:o.value.workFocusStage,"onUpdate:modelValue":a[8]||(a[8]=e=>o.value.workFocusStage=e),filterable:"",clearable:"",block:"",placeholder:"项目阶段",onChange:_},{default:d(()=>[(n(!0),m(w,null,S(V.value,e=>(n(),c(C,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])])):p("",!0)]),action:d(()=>[s.value==="1"?(n(),c(D,{key:0,pages:l.value,onChange:B},null,8,["pages"])):p("",!0),s.value==="2"?(n(),c(D,{key:1,pages:o.value,onChange:N},null,8,["pages"])):p("",!0)]),default:d(()=>[s.value==="1"?(n(),c(G,{key:0,ref_key:"table1Ref",ref:P,datas:k.value},null,8,["datas"])):p("",!0),s.value==="2"?(n(),c(H,{key:1,datas:f.value,loading:h.value,onTap:$,onCheck:R,onChange:_},null,8,["datas","loading"])):p("",!0)]),_:1},8,["tabs","tab-key"])}}};export{ie as default};
