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