import{d as q,G as Y,D as F,A as H,b as A,r as c,o as J,c as n,e as p,I as V,i as a,g as m,h as e,u as _,k as v,j as N,f as x,x as K}from"./index.5bb861d3.js";import{E as Q}from"./index.ad11f307.js";import{l as W,b as X}from"./projectCollectionEnter.fafd4e13.js";import{g as y,a as Z}from"./getIsShowRegionTree.e814bad7.js";const ee={class:"px-20 pt-10 pb-20 w-full"},ae={class:"flex"},te={class:"flex justify-between items-center"},le=["onClick"],oe=["onClick"],ne=["onClick"],re=q({name:"projectCollection"}),me=Object.assign(re,{setup(se){const G=Y(F.userStore).userInfo,{proxy:I}=K(),O=H(),r=A({projectName:void 0,buildOrg:void 0}),d=c(),w=c(0),T=A([{label:"\u5E8F\u53F7",type:"index",width:"60"},{label:"\u9879\u76EE\u7F16\u53F7",key:"baseProjId",prop:"baseProjId"},{label:"\u9879\u76EE\u540D\u79F0",key:"baseProjName",prop:"baseProjName"},{label:"\u5EFA\u8BBE\u5355\u4F4D",key:"baseBuildDeprt",prop:"baseBuildDeprt"},{label:"\u884C\u653F\u533A\u5212",key:"baseAreaName",prop:"baseAreaName"},{label:"\u9884\u7B97\u5E74\u5EA6",key:"baseProjSetYear",prop:"baseProjSetYear",width:"80"},{label:"\u64CD\u4F5C",slot:"action",width:"160",fixed:"right"}]),C=c([]),f=c(),D=l=>{f.value=l.regionLevel===3?l.regionCode:void 0,d.value.pageParams.pageNumber=1,u()},s=c("1"),M=l=>{s.value=l,k()},u=async(l=d.value.pageParams)=>{const o=await W(s.value,{...l,...r,regionCode:f.value});C.value=o.data.records,w.value=o.data.total},S=()=>{u()},k=()=>{r.projectName=void 0,r.buildOrg=void 0,d.value.pageParams.pageNumber=1,d.value.pageParams.pageSize=10,u()},$=l=>{I.$messageBox.confirm("\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u9879\u5417?","\u63D0\u793A\uFF01",{type:"warning"}).then(async()=>{await X(s.value,s.value==="1"?l.baseProjId:l.draftId),I.$message.success("\u5220\u9664\u6210\u529F\uFF01"),await u()})};return J(()=>{y(["SUPER_ADMIN","REGION_MANAGER"])||(f.value=G.value.regionCode,u(d.value.pageParams))}),(l,o)=>{const i=n("el-col"),j=n("el-input"),b=n("el-form-item"),g=n("el-button"),P=n("el-row"),B=n("el-form"),h=n("el-card"),E=n("el-tab-pane"),U=n("el-tabs"),z=n("table-list"),L=n("el-container");return p(),V(L,{class:"overflow-y-auto"},{default:a(()=>[m("div",ee,[e(P,null,{default:a(()=>[_(y)(["SUPER_ADMIN","REGION_MANAGER"])?(p(),V(i,{key:0,span:4,class:"pr-16"},{default:a(()=>[e(Q,{params:_(Z)({SUPER_ADMIN:!1,REGION_MANAGER:!1}),onGetTree:D},null,8,["params"])]),_:1})):v("",!0),e(i,{span:_(y)(["SUPER_ADMIN","REGION_MANAGER"])?20:24},{default:a(()=>[e(h,{class:"w-full search"},{default:a(()=>[e(B,{model:r,size:"small","label-suffix":":"},{default:a(()=>[e(P,{gutter:16},{default:a(()=>[e(i,{span:8},{default:a(()=>[e(b,{label:"\u9879\u76EE\u540D\u79F0"},{default:a(()=>[e(j,{modelValue:r.projectName,"onUpdate:modelValue":o[0]||(o[0]=t=>r.projectName=t),placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1}),e(i,{span:8},{default:a(()=>[e(b,{label:"\u9879\u76EE\u5355\u4F4D"},{default:a(()=>[e(j,{modelValue:r.buildOrg,"onUpdate:modelValue":o[1]||(o[1]=t=>r.buildOrg=t),placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1}),e(i,{span:8},{default:a(()=>[e(b,{class:"btn"},{default:a(()=>[m("div",ae,[e(g,{type:"primary",onClick:S},{default:a(()=>[N("\u67E5\u8BE2")]),_:1}),e(g,{onClick:k},{default:a(()=>[N("\u91CD\u7F6E")]),_:1})])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),e(h,{class:"w-full mt-8 tab-card"},{header:a(()=>[m("div",te,[e(U,{modelValue:s.value,"onUpdate:modelValue":o[2]||(o[2]=t=>s.value=t),onTabChange:M},{default:a(()=>[e(E,{label:"\u5F52\u96C6\u5217\u8868",name:"1"}),e(E,{label:"\u8349\u7A3F\u7BB1",name:"2"})]),_:1},8,["modelValue"]),m("div",null,[e(g,{type:"primary",size:"small",icon:"Plus",onClick:o[3]||(o[3]=t=>_(O).push({name:"projectCollectionEnter"}))},{default:a(()=>[N("\u5F55\u5165\u9879\u76EE")]),_:1})])])]),default:a(()=>[e(z,{ref_key:"tableListRef",ref:d,column:T,data:C.value,total:w.value,onGetTableData:u},{action:a(({scope:t})=>[m("a",{onClick:R=>l.$router.push({name:"projectCollectionDetail",query:{id:t.row.baseProjId,draftId:t.row.draftId,type:s.value}})},"\u67E5\u770B",8,le),t.row.canOperation?(p(),x("a",{key:0,onClick:R=>l.$router.push({name:"projectCollectionEnter",query:{id:t.row.baseProjId,draftId:t.row.draftId,type:s.value}})},"\u7F16\u8F91",8,oe)):v("",!0),t.row.canOperation?(p(),x("a",{key:1,class:"text-danger",onClick:R=>$(t.row)},"\u5220\u9664",8,ne)):v("",!0)]),_:1},8,["column","data","total"])]),_:1})]),_:1},8,["span"])]),_:1})])]),_:1})}}});export{me as default};
