import{d as M,u as N,p as l,o as U,i as w,a as H,z as j,m as s,k as r,e,K as q,L as O,a4 as W,v as p,l as G,D as J}from"./index-deffec86.js";import{I as Q}from"./IndexPagePro-904e4e7b.js";import{_ as X}from"./index.vue_vue_type_script_setup_true_name_ProTable_lang-de39478e.js";import{_ as Y}from"./index.vue_vue_type_script_setup_true_name_SearchForm_lang-692eb4fd.js";import{T as Z}from"./index-0e777de8.js";import ee from"./TableTopStatus-f120a6d5.js";import ae from"./AuditDialog-e13c8782.js";import{u as te}from"./useTable-823c55eb.js";import{u as se}from"./useHandleData-9c720574.js";import{e as ne,f as S}from"./plan-2fedc155.js";import{g as le}from"./common-8a6acaa7.js";import{u as re}from"./useMatchActivityPlan-b5b1e489.js";import"./sortable.esm-441d9e5f.js";import"./AuditProgress-a527d7ab.js";import"./useFormEdit-3c660b22.js";import"./tabs-96386b59.js";import"./tagManage-2aab0a1e.js";const Pe=M({__name:"sync",setup(oe){const{columns:T,tableColumns:P,dataCallBack:z}=re([{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=N(),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){J({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:ie,searchParam:f,handleSizeChange:F,handleCurrentChange:$,getTableList:y,search:v,reset:b}=te(ne,{},z),A=l(null),I=t=>{f.value.company_area_id=t,v()},C=l([]),_=l([]),h=l(""),K=async()=>{var o;let t=await le({});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:"matchActivityPlanEdit",query:{type:2,id:t.plan_id,isSync:1}});return;case 2:await se(S,{plan_ids:t.plan_id,status:2},"\u901A\u8FC7");break;case 3:c.value=!1,m.value=t.activity_id,i.value=!0;break}y()};return U(async()=>{await K(),y()}),(t,a)=>{const o=w("el-button"),E=w("el-pagination");return H(),j(Q,{filterWidth:280},{treeCard:s(()=>[r(Z,{ref_key:"TreeFilterRef",ref:A,title:"\u533A\u57DF",data:e(C),defaultValue:e(h),expandKeys:e(_),onChange:I},null,8,["data","defaultValue","expandKeys"])]),searchForm:s(()=>[q(r(Y,{"search-param":e(f),columns:e(T),search:e(v),reset:e(b)},null,8,["search-param","columns","search","reset"]),[[O,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(F),onCurrentChange:e($)},null,8,["current-page","page-size","total","onSizeChange","onCurrentChange"])]),dialog:s(()=>[r(ae,{visible:e(i),"onUpdate:visible":a[2]||(a[2]=n=>W(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(X,{ref_key:"proTableRef",ref:g,columns:e(P),data:e(D)},{tableHeader:s(()=>[r(ee,{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}),G(' <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};
