import{d as O,u as U,p as l,o as H,i as S,a as q,z as W,m as n,k as o,e as a,K as G,L as J,a4 as Q,v as p,l as X,D as Y}from"./index-deffec86.js";import{I as Z}from"./IndexPagePro-904e4e7b.js";import{_ as ee}from"./index.vue_vue_type_script_setup_true_name_ProTable_lang-de39478e.js";import{_ as ae}from"./index.vue_vue_type_script_setup_true_name_SearchForm_lang-692eb4fd.js";import{T as te}from"./index-0e777de8.js";import se from"./AuditDialog-e13c8782.js";import ne from"./TableTopStatus-f120a6d5.js";import{u as le}from"./useTable-823c55eb.js";import{u as oe}from"./useHandleData-9c720574.js";import{n as re,o as T}from"./activity-c9a7a2d3.js";import{g as ie,i as ue}from"./common-8a6acaa7.js";import{u as pe}from"./useMatchActivity-eaf6c5c6.js";import"./sortable.esm-441d9e5f.js";import"./AuditProgress-a527d7ab.js";import"./useFormEdit-3c660b22.js";import"./tabs-96386b59.js";import"./plan-2fedc155.js";import"./tagManage-2aab0a1e.js";const Ae=O({__name:"sync",setup(ce){const z=U(),P=l(!0),f=l(null),i=l(!1),x=l([]),B=l(null),v=l([]),b=l([]),c=l(""),m=l(""),d=l(!0),{columns:A,tableColumns:R,dataCallBack:V,paramCallBack:D}=pe([{prop:"sync_check_status",label:"\u540C\u6B65\u5BA1\u6838\u72B6\u6001",tag:!0,isFilterEnum:!0,width:150,enum:[{label:"\u5F85\u5BA1\u6838",value:"1",tagType:"warning"},{label:"\u5BA1\u6838\u901A\u8FC7",value:"2",tagType:"success"},{label:"\u9A73\u56DE",value:"3",tagType:"danger"}]}],!0,200),{tableData:L,pageable:u,baseParam:F,searchParam:_,handleSizeChange:$,handleCurrentChange:I,getTableList:C,search:h,reset:k}=le(re,{},V,D),j=async()=>{const t=f.value.selectedList.map(e=>e.plan_id);if(!t.length){Y({message:"\u8BF7\u5148\u9009\u62E9\u9700\u8981\u5BA1\u6838\u7684\u8D5B\u4E8B\u6D3B\u52A8\u8BA1\u5212",type:"warning"});return}d.value=!0,m.value=t.join(","),i.value=!0},K=t=>{_.value.company_area_id=t,h()},E=async()=>{var r;let t=await ie({});v.value=t.data;let e=(r=t==null?void 0:t.data[0])==null?void 0:r.company_area_id;b.value=[e],c.value=String(e)},y=l({all:{label:"\u5168\u90E8",value:12,type:"primary"},checking:{label:"\u5BA1\u6838\u4E2D",value:12,type:"warning"},pass:{label:"\u901A\u8FC7",value:12,type:"success"},reject:{label:"\u9A73\u56DE",value:12,type:"danger"},draft:{label:"\u8349\u7A3F",value:12,type:"info"}}),M=async()=>{const{data:t}=await ue({type:2});Object.keys(y.value).forEach(e=>y.value[e].value=t[e])},g=async(t,e)=>{switch(e){case 1:z.push({name:"matchActivityDetail",query:{activity_id:t.activity_id}});break;case 2:await oe(T,{activity_ids:t.activity_id,status:2},"\u901A\u8FC7");break;case 3:d.value=!1,m.value=t.activity_id,i.value=!0;break}C()};return H(async()=>{await E(),F.value.company_area_id=c.value,await C(),M()}),(t,e)=>{const r=S("el-button"),N=S("el-pagination");return q(),W(Z,{filterWidth:280},{treeCard:n(()=>[o(te,{ref_key:"TreeFilterRef",ref:B,title:"\u533A\u57DF",data:a(v),defaultValue:a(c),expandKeys:a(b),onChange:K},null,8,["data","defaultValue","expandKeys"])]),searchForm:n(()=>[G(o(ae,{"search-param":a(_),columns:a(A),search:a(h),reset:a(k)},null,8,["search-param","columns","search","reset"]),[[J,a(P)]])]),pagination:n(()=>[o(N,{"current-page":a(u).page,"onUpdate:currentPage":e[0]||(e[0]=s=>a(u).page=s),"page-size":a(u).size,"onUpdate:pageSize":e[1]||(e[1]=s=>a(u).size=s),"page-sizes":[10,20,50,100],background:"",layout:"total, sizes, prev, pager, next",total:a(u).count,onSizeChange:a($),onCurrentChange:a(I)},null,8,["current-page","page-size","total","onSizeChange","onCurrentChange"])]),dialog:n(()=>[o(se,{visible:a(i),"onUpdate:visible":e[2]||(e[2]=s=>Q(i)?i.value=s:null),progressList:a(x),planIds:a(m),passStatus:2,noPassStatus:3,isShowPassBtn:a(d),isShowProgress:!1,api:a(T),onClose:e[3]||(e[3]=s=>i.value=!1),onReset:a(k)},null,8,["visible","progressList","planIds","isShowPassBtn","api","onReset"])]),default:n(()=>[o(ee,{ref_key:"proTableRef",ref:f,columns:a(R),data:a(L)},{tableHeader:n(()=>[o(ne,{options:a(y)},null,8,["options"])]),toolButton:n(()=>[o(r,{type:"primary",onClick:j},{default:n(()=>e[4]||(e[4]=[p("\u6279\u91CF\u5BA1\u6838")])),_:1}),X(' <el-button type="primary">\u5BFC\u51FA</el-button> ')]),operation:n(s=>[o(r,{type:"primary",link:"",onClick:w=>g(s.row,1)},{default:n(()=>e[5]||(e[5]=[p("\u67E5\u770B")])),_:2},1032,["onClick"]),o(r,{disabled:s.row.sync_check_status==2,type:"primary",link:"",onClick:w=>g(s.row,2)},{default:n(()=>e[6]||(e[6]=[p(" \u901A\u8FC7 ")])),_:2},1032,["disabled","onClick"]),o(r,{type:"primary",disabled:s.row.sync_check_status==2,link:"",onClick:w=>g(s.row,3)},{default:n(()=>e[7]||(e[7]=[p(" \u9A73\u56DE ")])),_:2},1032,["disabled","onClick"])]),_:1},8,["columns","data"])]),_:1})}}});export{Ae as default};
