import{d as T,u as q,a0 as x,r as s,b as B,P as J,a,o as K,g as L,B as l,k as e,I as U,O as p,J as W,Q as j,K as F,L as G,V as H,S as O,W as P,Z as Q}from"./index-CHTXMeh8.js";import{_ as Z}from"./ContentWrap.vue_vue_type_script_setup_true_lang-BjvrLlUT.js";import{u as z}from"./tagsView-C8yDzF3Q.js";import{_ as A}from"./BasicInfoForm.vue_vue_type_script_setup_true_lang-DkbEHNXC.js";import{_ as D}from"./ColumInfoForm.vue_vue_type_script_setup_true_lang-Hx7-rKu0.js";import{_ as M}from"./GenerateInfoForm.vue_vue_type_script_setup_true_lang-DE1b4pGp.js";import{g as N,u as X}from"./index-v_JlZttQ.js";import"./el-card-Bdk9qx7q.js";import"./formRules-KRws1Ke5.js";import"./dict.type-DwbQoim0.js";import"./el-dropdown-item-CeWj3-13.js";import"./el-tree-select-DhIHMmfG.js";import"./tree-BBZY150N.js";import"./index-DTm78JRf.js";const Y=T({name:"InfraCodegenEditTable",__name:"EditTable",setup($){const{t:_}=W(),b=j(),{push:y,currentRoute:g}=q(),{query:v}=x(),{delView:I}=z(),n=s(!1),r=s("colum"),f=s(),k=s(),i=s(),t=s({table:{},columns:[]}),w=async()=>{var o,u;if(a(t)){await((o=a(f))==null?void 0:o.validate()),await((u=a(i))==null?void 0:u.validate());try{await X(t.value),b.success(_("common.updateSuccess")),c()}catch{}}},c=()=>{I(a(g)),y("/infra/codegen")};return B(()=>{(async()=>{const o=v.id;if(o){n.value=!0;try{t.value=await N(o)}finally{n.value=!1}}})()}),(o,u)=>{const m=F,R=G,d=H,V=O,h=P,C=Z,E=Q;return J((K(),L(C,null,{default:l(()=>[e(R,{modelValue:a(r),"onUpdate:modelValue":u[0]||(u[0]=S=>U(r)?r.value=S:null)},{default:l(()=>[e(m,{label:"\u57FA\u672C\u4FE1\u606F",name:"basicInfo"},{default:l(()=>[e(a(A),{ref_key:"basicInfoRef",ref:f,table:a(t).table},null,8,["table"])]),_:1}),e(m,{label:"\u5B57\u6BB5\u4FE1\u606F",name:"colum"},{default:l(()=>[e(a(D),{ref_key:"columInfoRef",ref:k,columns:a(t).columns},null,8,["columns"])]),_:1}),e(m,{label:"\u751F\u6210\u4FE1\u606F",name:"generateInfo"},{default:l(()=>[e(a(M),{ref_key:"generateInfoRef",ref:i,table:a(t).table,columns:a(t).columns},null,8,["table","columns"])]),_:1})]),_:1},8,["modelValue"]),e(h,null,{default:l(()=>[e(V,{style:{float:"right"}},{default:l(()=>[e(d,{loading:a(n),type:"primary",onClick:w},{default:l(()=>[p("\u4FDD\u5B58")]),_:1},8,["loading"]),e(d,{onClick:c},{default:l(()=>[p("\u8FD4\u56DE")]),_:1})]),_:1})]),_:1})]),_:1})),[[E,a(n)]])}}});export{Y as default};