import{ad as f,d as D,h as E,Y as T,r as d,o as U,f as x,w as o,b as t,a2 as L,l as y,E as k}from"./index.e3896b23.js";const q=n=>f.get("/data-governance/metamodel-property/"+n),N=n=>n.id?f.put("/data-governance/metamodel-property",n):f.post("/data-governance/metamodel-property",n),w=y("\u53D6\u6D88"),P=y("\u786E\u5B9A"),$=D({__name:"property-add-or-update",emits:["refreshDataList"],setup(n,{expose:F,emit:V}){const p=E(!1),s=E(),u=T({name:"",code:"",dataType:"",inputType:"",dataLength:10,orderNo:0,nullable:"",comment:""}),A=(r,e)=>{p.value=!0,u.id="",s.value&&s.value.resetFields(),u.metamodelId=e,r&&c(r)},c=r=>{q(r).then(e=>{Object.assign(u,e.data)})},v=E({name:[{required:!0,message:"\u5FC5\u586B\u9879\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],code:[{required:!0,message:"\u5FC5\u586B\u9879\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],dataType:[{required:!0,message:"\u5FC5\u586B\u9879\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],inputType:[{required:!0,message:"\u5FC5\u586B\u9879\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],dataLength:[{required:!0,message:"\u5FC5\u586B\u9879\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],nullable:[{required:!0,message:"\u5FC5\u586B\u9879\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),g=()=>{s.value.validate(r=>{if(!r)return!1;N(u).then(()=>{k.success({message:"\u64CD\u4F5C\u6210\u529F",duration:500,onClose:()=>{p.value=!1,V("refreshDataList")}})})})};return F({init:A}),(r,e)=>{const m=d("el-input"),a=d("el-form-item"),i=d("fast-select"),_=d("el-input-number"),B=d("el-form"),b=d("el-button"),C=d("el-dialog");return U(),x(C,{modelValue:p.value,"onUpdate:modelValue":e[11]||(e[11]=l=>p.value=l),title:u.id?"\u4FEE\u6539":"\u65B0\u589E","close-on-click-modal":!1},{footer:o(()=>[t(b,{onClick:e[9]||(e[9]=l=>p.value=!1)},{default:o(()=>[w]),_:1}),t(b,{type:"primary",onClick:e[10]||(e[10]=l=>g())},{default:o(()=>[P]),_:1})]),default:o(()=>[t(B,{ref_key:"dataFormRef",ref:s,model:u,rules:v.value,"label-width":"100px",onKeyup:e[8]||(e[8]=L(l=>g(),["enter"]))},{default:o(()=>[t(a,{label:"\u5C5E\u6027\u540D\u79F0",prop:"name"},{default:o(()=>[t(m,{modelValue:u.name,"onUpdate:modelValue":e[0]||(e[0]=l=>u.name=l),placeholder:"\u5C5E\u6027\u540D\u79F0"},null,8,["modelValue"])]),_:1}),t(a,{label:"\u5C5E\u6027\u4EE3\u7801",prop:"code"},{default:o(()=>[t(m,{modelValue:u.code,"onUpdate:modelValue":e[1]||(e[1]=l=>u.code=l),placeholder:"\u5C5E\u6027\u4EE3\u7801"},null,8,["modelValue"])]),_:1}),t(a,{label:"\u6570\u636E\u7C7B\u578B",prop:"dataType"},{default:o(()=>[t(i,{modelValue:u.dataType,"onUpdate:modelValue":e[2]||(e[2]=l=>u.dataType=l),"dict-type":"model_property_data_type",placeholder:"\u8BF7\u9009\u62E9",clearable:""},null,8,["modelValue"])]),_:1}),t(a,{label:"\u8F93\u5165\u63A7\u4EF6",prop:"inputType"},{default:o(()=>[t(i,{modelValue:u.inputType,"onUpdate:modelValue":e[3]||(e[3]=l=>u.inputType=l),"dict-type":"model_property_input_type",placeholder:"\u8BF7\u9009\u62E9",clearable:""},null,8,["modelValue"])]),_:1}),t(a,{label:"\u6570\u636E\u957F\u5EA6",prop:"dataLength"},{default:o(()=>[t(_,{modelValue:u.dataLength,"onUpdate:modelValue":e[4]||(e[4]=l=>u.dataLength=l),max:9999,placeholder:"\u6570\u636E\u957F\u5EA6"},null,8,["modelValue"])]),_:1}),t(a,{label:"\u5141\u8BB8\u4E3A\u7A7A",prop:"nullable"},{default:o(()=>[t(i,{modelValue:u.nullable,"onUpdate:modelValue":e[5]||(e[5]=l=>u.nullable=l),"dict-type":"yes_or_no",placeholder:"\u8BF7\u9009\u62E9",clearable:""},null,8,["modelValue"])]),_:1}),t(a,{label:"\u5E8F\u53F7",prop:"orderNo"},{default:o(()=>[t(_,{modelValue:u.orderNo,"onUpdate:modelValue":e[6]||(e[6]=l=>u.orderNo=l),max:9999,placeholder:"\u6570\u636E\u957F\u5EA6"},null,8,["modelValue"])]),_:1}),t(a,{label:"\u8BF4\u660E",prop:"comment"},{default:o(()=>[t(m,{type:"textarea",rows:3,modelValue:u.comment,"onUpdate:modelValue":e[7]||(e[7]=l=>u.comment=l),placeholder:"\u8BF4\u660E"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["modelValue","title"])}}});export{$ as _};
