import{g as j,h as q,i as F}from"./indicatorTemplate.dbd53ead.js";import{d as O,r as s,L as P,N as G,c as i,e as I,f as S,h as l,i as o,g as c,j as v,F as U,x as z}from"./index.5bb861d3.js";const A={style:{"text-align":"right"}},E=["onClick"],H=["onClick"],J=O({name:"menuDialog"}),Q=Object.assign(J,{props:{visible:{type:Boolean,default:!1,required:!0},data:Object},emits:["close"],setup(p,{emit:x}){const{proxy:d}=z(),C=p,$=x,V=[{label:"\u5E8F\u53F7",type:"index",width:"60"},{label:"\u6807\u7B7E\u540D\u79F0",key:"name",prop:"name"},{label:"\u6D89\u53CA\u9879\u76EE\u6307\u6807",key:"relatedNum",prop:"relatedNum"},{label:"\u64CD\u4F5C",slot:"action",width:"160",fixed:"right"}],_=s([]),g=s(0),b=s(),m=async(t=b.value.pageParams)=>{const e=await j({...t});g.value=e.data.total,_.value=e.data.records},f=s(""),y=(t,e)=>{t===0?(f.value="\u65B0\u589E\u6807\u7B7E",n.value={}):(f.value="\u7F16\u8F91\u6807\u7B7E",n.value={...e}),r.value=!0},D=t=>{d.$messageBox.confirm("\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6807\u7B7E\u5417?","\u63D0\u793A\uFF01",{type:"warning"}).then(async()=>{await q(t.id),d.$message.success("\u5220\u9664\u6210\u529F\uFF01"),await m()})},k=s(),n=s(),r=s(!1),N=async t=>{!t||await t.validate(async e=>{if(e){const u={...n.value};await F(u),d.$message.success("\u7F16\u8F91\u6210\u529F\uFF01"),r.value=!1,m()}})};return P(()=>C.visible,async t=>{t&&(await G(),m())}),(t,e)=>{const u=i("el-button"),B=i("table-list"),w=i("el-dialog"),T=i("el-input"),L=i("el-form-item"),R=i("el-form");return I(),S(U,null,[l(w,{"model-value":p.visible,title:"\u9879\u76EE\u6307\u6807\u6807\u7B7E\u7BA1\u7406",width:"600px","destroy-on-close":"","close-on-click-modal":!1,onClose:e[1]||(e[1]=a=>$("close"))},{default:o(()=>[c("p",A,[l(u,{class:"mb-8",icon:"Plus",type:"primary",onClick:e[0]||(e[0]=a=>y(0))},{default:o(()=>[v("\u65B0\u589E\u6807\u7B7E")]),_:1})]),l(B,{ref_key:"tableListRef",ref:b,column:V,data:_.value,total:g.value,onGetTableData:m},{action:o(({scope:a})=>[c("a",{onClick:h=>y(1,a.row)},"\u7F16\u8F91",8,E),c("a",{class:"text-danger",onClick:h=>D(a.row)},"\u5220\u9664",8,H)]),_:1},8,["data","total"])]),_:1},8,["model-value"]),l(w,{"model-value":r.value,width:"400px",title:f.value,onClose:e[5]||(e[5]=a=>r.value=!1)},{footer:o(()=>[l(u,{type:"primary",onClick:e[3]||(e[3]=a=>N(k.value))},{default:o(()=>[v(" \u63D0\u4EA4 ")]),_:1}),l(u,{onClick:e[4]||(e[4]=a=>r.value=!1)},{default:o(()=>[v(" \u5173\u95ED ")]),_:1})]),default:o(()=>[l(R,{ref_key:"formRef",ref:k,model:n.value},{default:o(()=>[l(L,{label:"\u6807\u7B7E\u540D\u79F0",rules:[{required:!0,message:"\u8BF7\u8F93\u5165"}],prop:"name"},{default:o(()=>[l(T,{modelValue:n.value.name,"onUpdate:modelValue":e[2]||(e[2]=a=>n.value.name=a)},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["model-value","title"])],64)}}});export{Q as default};
