import{ad as p,d as q,h as g,Y as x,r as n,o as f,f as c,w as a,b as o,H as U,a2 as P,l as F,E as w}from"./index.e3896b23.js";const I=u=>p.get("/data-governance/quality-config-category/"+u),h=u=>u.id?p.put("/data-governance/quality-config-category",u):p.post("/data-governance/quality-config-category",u),H=()=>p.get("/data-governance/quality-config-category/list-tree"),K=u=>p.delete("/data-governance/quality-config-category/"+u),R=F("\u53D6\u6D88"),T=F("\u786E\u5B9A"),L=q({__name:"category-add-or-update",emits:["refreshDataList"],setup(u,{expose:b,emit:E}){const d=g(!1),m=g(),e=x({parentId:"",parentPath:"",path:"",name:"",type:0,orderNo:0,note:""}),V=(r,t,s)=>{d.value=!0,e.id="",m.value&&m.value.resetFields(),e.parentId=t,e.parentPath=s,r&&C(r)},C=r=>{I(r).then(t=>{Object.assign(e,t.data)})},A=g({name:[{required:!0,message:"\u5FC5\u586B\u9879\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],type:[{required:!0,message:"\u5FC5\u586B\u9879\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],orderNo:[{required:!0,message:"\u5FC5\u586B\u9879\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),_=()=>{m.value.validate(r=>{if(!r)return!1;e.type=e.parentId==0?0:e.type,h(e).then(()=>{w.success({message:"\u64CD\u4F5C\u6210\u529F",duration:500,onClose:()=>{d.value=!1,E("refreshDataList")}})})})};return b({init:V}),(r,t)=>{const s=n("el-input"),i=n("el-form-item"),y=n("el-option"),D=n("el-select"),B=n("el-input-number"),k=n("el-form"),v=n("el-button"),N=n("el-dialog");return f(),c(N,{modelValue:d.value,"onUpdate:modelValue":t[8]||(t[8]=l=>d.value=l),title:e.id?"\u4FEE\u6539":"\u65B0\u589E","close-on-click-modal":!1},{footer:a(()=>[o(v,{onClick:t[6]||(t[6]=l=>d.value=!1)},{default:a(()=>[R]),_:1}),o(v,{type:"primary",onClick:t[7]||(t[7]=l=>_())},{default:a(()=>[T]),_:1})]),default:a(()=>[o(k,{ref_key:"dataFormRef",ref:m,model:e,rules:A.value,"label-width":"100px",onKeyup:t[5]||(t[5]=P(l=>_(),["enter"]))},{default:a(()=>[o(i,{label:"\u7236\u7EA7\u76EE\u5F55",prop:"parentPath"},{default:a(()=>[o(s,{disabled:"",modelValue:e.parentPath,"onUpdate:modelValue":t[0]||(t[0]=l=>e.parentPath=l),placeholder:""},null,8,["modelValue"])]),_:1}),o(i,{label:"\u540D\u79F0",prop:"name"},{default:a(()=>[o(s,{modelValue:e.name,"onUpdate:modelValue":t[1]||(t[1]=l=>e.name=l),placeholder:"\u540D\u79F0"},null,8,["modelValue"])]),_:1}),e.parentId!=0?(f(),c(i,{key:0,label:"\u7C7B\u578B",prop:"type"},{default:a(()=>[o(D,{modelValue:e.type,"onUpdate:modelValue":t[2]||(t[2]=l=>e.type=l),placeholder:"\u7C7B\u578B",disabled:!!e.id},{default:a(()=>[(f(),c(y,{key:0,label:"\u666E\u901A\u76EE\u5F55",value:0})),(f(),c(y,{key:1,label:"\u89C4\u5219\u914D\u7F6E\u76EE\u5F55",value:1}))]),_:1},8,["modelValue","disabled"])]),_:1})):U("",!0),o(i,{label:"\u5E8F\u53F7",prop:"orderNo"},{default:a(()=>[o(B,{modelValue:e.orderNo,"onUpdate:modelValue":t[3]||(t[3]=l=>e.orderNo=l),max:9999,placeholder:"\u5E8F\u53F7"},null,8,["modelValue"])]),_:1}),o(i,{label:"\u63CF\u8FF0",prop:"note"},{default:a(()=>[o(s,{type:"textarea",modelValue:e.note,"onUpdate:modelValue":t[4]||(t[4]=l=>e.note=l)},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["modelValue","title"])}}});export{L as _,K as d,H as l};
