import{ad as f,d as E,h as p,Y as k,r,o as B,f as N,w as a,b as u,a2 as U,l as b,E as A}from"./index.e3896b23.js";const L=n=>f.get("/data-integrate/layer/"+n),T=n=>n.id?f.put("/data-integrate/layer",n):f.post("/data-integrate/layer",n),w=b("\u53D6\u6D88"),P=b("\u786E\u5B9A"),$=E({__name:"add-or-update",emits:["refreshDataList"],setup(n,{expose:c,emit:V}){const d=p(!1),i=p(),l=k({name:"",cnName:"",note:"",tablePrefix:"",createTime:""}),v=o=>{d.value=!0,l.id="",i.value&&i.value.resetFields(),o&&D(o)},D=o=>{L(o).then(e=>{Object.assign(l,e.data)})},C=p({}),_=()=>{i.value.validate(o=>{if(!o)return!1;T(l).then(()=>{A.success({message:"\u64CD\u4F5C\u6210\u529F",duration:500,onClose:()=>{d.value=!1,V("refreshDataList")}})})})};return c({init:v}),(o,e)=>{const m=r("el-input"),s=r("el-form-item"),y=r("el-date-picker"),g=r("el-form"),F=r("el-button"),x=r("el-dialog");return B(),N(x,{modelValue:d.value,"onUpdate:modelValue":e[8]||(e[8]=t=>d.value=t),title:l.id?"\u4FEE\u6539":"\u65B0\u589E","close-on-click-modal":!1},{footer:a(()=>[u(F,{onClick:e[6]||(e[6]=t=>d.value=!1)},{default:a(()=>[w]),_:1}),u(F,{type:"primary",onClick:e[7]||(e[7]=t=>_())},{default:a(()=>[P]),_:1})]),default:a(()=>[u(g,{ref_key:"dataFormRef",ref:i,model:l,rules:C.value,"label-width":"100px",onKeyup:e[5]||(e[5]=U(t=>_(),["enter"]))},{default:a(()=>[u(s,{label:"\u5206\u5C42\u82F1\u6587\u540D\u79F0",prop:"name"},{default:a(()=>[u(m,{modelValue:l.name,"onUpdate:modelValue":e[0]||(e[0]=t=>l.name=t),placeholder:"\u5206\u5C42\u82F1\u6587\u540D\u79F0",disabled:!0},null,8,["modelValue"])]),_:1}),u(s,{label:"\u5206\u5C42\u4E2D\u6587\u540D\u79F0",prop:"cnName"},{default:a(()=>[u(m,{modelValue:l.cnName,"onUpdate:modelValue":e[1]||(e[1]=t=>l.cnName=t),placeholder:"\u5206\u5C42\u4E2D\u6587\u540D\u79F0",disabled:!0},null,8,["modelValue"])]),_:1}),u(s,{label:"\u5206\u5C42\u63CF\u8FF0",prop:"note"},{default:a(()=>[u(m,{type:"textarea",modelValue:l.note,"onUpdate:modelValue":e[2]||(e[2]=t=>l.note=t)},null,8,["modelValue"])]),_:1}),u(s,{label:"\u8868\u540D\u524D\u7F00",prop:"tablePrefix"},{default:a(()=>[u(m,{modelValue:l.tablePrefix,"onUpdate:modelValue":e[3]||(e[3]=t=>l.tablePrefix=t),placeholder:"\u8868\u540D\u524D\u7F00",disabled:!0},null,8,["modelValue"])]),_:1}),u(s,{label:"\u521B\u5EFA\u65F6\u95F4",prop:"createTime"},{default:a(()=>[u(y,{type:"datetime",placeholder:"\u521B\u5EFA\u65F6\u95F4",modelValue:l.createTime,"onUpdate:modelValue":e[4]||(e[4]=t=>l.createTime=t),disabled:!0},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["modelValue","title"])}}});export{$ as _};
