import{d as O,u as U,p as l,o as H,i as T,a as q,z as W,m as n,k as i,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-2d75b793.js";import ne from"./TableTopStatus-3229c542.js";import{u as le}from"./useTable-823c55eb.js";import{u as ie}from"./useHandleData-9c720574.js";import{n as oe,o as z}from"./activity-c9a7a2d3.js";import{g as re,i as ue}from"./common-8a6acaa7.js";import{u as pe}from"./useMatchActivity-eaf6c5c6.js";import"./sortable.esm-441d9e5f.js";import"./AuditProgress-f54e974b.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 P=U(),x=l(!0),v=l(null),r=l(!1),B=l([]),A=l(null),f=l([]),b=l([]),c=l(""),d=l(""),m=l(!0),{columns:R,tableColumns:V,dataCallBack:D,paramCallBack:L}=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:F,pageable:u,baseParam:_,searchParam:C,handleSizeChange:$,handleCurrentChange:I,getTableList:h,search:k,reset:w}=le(oe,{},D,L),j=async()=>{const t=v.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}m.value=!0,d.value=t.join(","),r.value=!0},K=t=>{C.value.company_area_id=t,k()},M=async()=>{var o;let t=await re({});f.value=t.data;let e=(o=t==null?void 0:t.data[0])==null?void 0:o.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"}}),E=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:P.push({name:"nationMatchActivityDetail",query:{activity_id:t.activity_id}});break;case 2:await ie(z,{activity_ids:t.activity_id,status:2,event_activity_type:2},"\u901A\u8FC7");break;case 3:m.value=!1,d.value=t.activity_id,r.value=!0;break}h()};return H(async()=>{_.value.event_activity_type=2,await M(),_.value.company_area_id=c.value,await h(),E()}),(t,e)=>{const o=T("el-button"),N=T("el-pagination");return q(),W(Z,{filterWidth:280},{treeCard:n(()=>[i(te,{ref_key:"TreeFilterRef",ref:A,title:"\u533A\u57DF",data:a(f),defaultValue:a(c),expandKeys:a(b),onChange:K},null,8,["data","defaultValue","expandKeys"])]),searchForm:n(()=>[G(i(ae,{"search-param":a(C),columns:a(R),search:a(k),reset:a(w)},null,8,["search-param","columns","search","reset"]),[[J,a(x)]])]),pagination:n(()=>[i(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(()=>[i(se,{visible:a(r),"onUpdate:visible":e[2]||(e[2]=s=>Q(r)?r.value=s:null),progressList:a(B),planIds:a(d),passStatus:2,noPassStatus:3,isShowPassBtn:a(m),isShowProgress:!1,api:a(z),onClose:e[3]||(e[3]=s=>r.value=!1),onReset:a(w)},null,8,["visible","progressList","planIds","isShowPassBtn","api","onReset"])]),default:n(()=>[i(ee,{ref_key:"proTableRef",ref:v,columns:a(V),data:a(F)},{tableHeader:n(()=>[i(ne,{options:a(y)},null,8,["options"])]),toolButton:n(()=>[i(o,{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=>[i(o,{type:"primary",link:"",onClick:S=>g(s.row,1)},{default:n(()=>e[5]||(e[5]=[p("\u67E5\u770B")])),_:2},1032,["onClick"]),i(o,{disabled:s.row.sync_check_status==2,type:"primary",link:"",onClick:S=>g(s.row,2)},{default:n(()=>e[6]||(e[6]=[p(" \u901A\u8FC7 ")])),_:2},1032,["disabled","onClick"]),i(o,{type:"primary",disabled:s.row.sync_check_status==2,link:"",onClick:S=>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};
