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