import{u as $}from"./useHandleData-64cc6aad-1782572373740v=1.0.0.js";import{u as F,a as M}from"./useProjectSettingRule-7c1f5740-1782572373740v=1.0.0.js";import{b as O,c as U,e as q}from"./eventProjectAndTypeApi-0c7a84fc-1782572373740v=1.0.0.js";import z from"./ProjectTypeTableListAddDialog-9341f5f3-1782572373740v=1.0.0.js";import{u as J,a as w,C as b,_ as G}from"./index-f6f689f9-1782572373740v=1.0.0.js";import{E as g}from"./eleVendor-48a7d3b8-1782572373740v=1.0.0.js";import{y as C,i as K,c as y,r as T,m as Q,al as P,z as c,I as d,J as a,R as I,u as o,k,O as j,M as f}from"./vendor-866bb149-1782572373740v=1.0.0.js";import"./eventGroupAndTermApi-31c30359-1782572373740v=1.0.0.js";const W=C({name:"ProjectTableList"}),X=C({...W,emits:["submit"],setup(Y,{emit:L}){const E=K("pageType"),m=y(()=>E!=="detail");J();const x=w(),s=T(!1),v=F(),{tableColumns:A,columns:h,dataCallBack:ee,paramCallBack:te}=M(),i=T(!1),D=y(()=>v.eventProjectTypeOptions),u=y(()=>x.query.id),_={eventId:"",eventProjectTypeId:"",name:"",isAcross:1,eventProjectTypeIds:"",eventProjectTypeIdsList:[],eventProjectTypeLimitNum:null},n=T({}),N=()=>{n.value=b(_),s.value=!0},B=t=>{let e=b(_);e.name=t.name,e.isAcross=t.isAcross,e.eventProjectTypeIdsList=t.eventProjectTypeIds.length>0?t.eventProjectTypeIds.split(","):[],e.eventProjectTypeLimitNum=t.eventProjectTypeLimitNum==0?null:t.eventProjectTypeLimitNum,e.eventProjectTypeId=t.eventProjectTypeId,n.value=e,s.value=!0},H=async t=>{let e="\u5220\u9664\u5F53\u524D\u6570\u636E";await $(O,{id:t.eventProjectTypeId},e),v.getEventProjectTypeListData(u.value)},S=L,R=async t=>{i.value=!0;try{t.eventId=u.value;let e=t.eventProjectTypeId?U:q,r=t.eventProjectTypeId?"\u7F16\u8F91\u6210\u529F":"\u65B0\u589E\u6210\u529F",p=await e(t);p.code==0?(g({type:"success",message:`${r}!`}),s.value=!1,v.getEventProjectTypeListData(u.value),S("submit",t)):g({type:"error",message:p.msg}),i.value=!1}catch{i.value=!1}};return Q(async()=>{}),(t,e)=>{const r=P("el-button"),p=P("HZProTable"),V=P("HZPageLayout");return c(),d(V,{title:"",isCard:!1},{pagination:a(()=>e[6]||(e[6]=[])),dialog:a(()=>[I(z,{visible:o(s),"onUpdate:visible":e[0]||(e[0]=l=>k(s)?s.value=l:null),title:`${o(n).eventProjectTypeId?"\u7F16\u8F91":"\u65B0\u589E"}\u9879\u76EE\u7C7B\u578B`,value:o(n),"onUpdate:value":e[1]||(e[1]=l=>k(n)?n.value=l:null),eventId:o(u),onSubmit:R},null,8,["visible","title","value","eventId"])]),default:a(()=>[I(p,{columns:o(A),data:o(D),isFlex:!1,loading:o(i),showColSet:!1},{tableHeader:a(()=>e[2]||(e[2]=[])),toolButton:a(()=>[o(m)?(c(),d(r,{key:0,type:"primary",onClick:N},{default:a(()=>e[3]||(e[3]=[j(" \u65B0\u589E\u9879\u76EE\u7C7B\u578B ",-1)])),_:1,__:[3]})):f("v-if",!0)]),operation:a(l=>[o(m)?(c(),d(r,{key:0,type:"primary",link:"",onClick:Z=>B(l.row)},{default:a(()=>e[4]||(e[4]=[j("\u7F16\u8F91",-1)])),_:2,__:[4]},1032,["onClick"])):f("v-if",!0),o(m)?(c(),d(r,{key:1,type:"danger",link:"",onClick:Z=>H(l.row)},{default:a(()=>e[5]||(e[5]=[j("\u5220\u9664",-1)])),_:2,__:[5]},1032,["onClick"])):f("v-if",!0)]),_:1},8,["columns","data","loading"])]),_:1})}}});const pe=G(X,[["__scopeId","data-v-ce88be4a"]]);export{pe as default};
