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 P,O as p,J as W,Q as j,K as F,L as G,V as N,S as O,W as Q,Z as U}from"./index-BP6bNRoi.js";import{_ as Z}from"./ContentWrap.vue_vue_type_script_setup_true_lang-CR_2gECF.js";import{u as z}from"./tagsView-DQpvPGX0.js";import{_ as A}from"./BasicInfoForm.vue_vue_type_script_setup_true_lang-LnkutEsP.js";import{_ as D}from"./ColumInfoForm.vue_vue_type_script_setup_true_lang-Duc7fGcF.js";import{_ as H}from"./GenerateInfoForm.vue_vue_type_script_setup_true_lang-7ItbqkoW.js";import{g as M,u as X}from"./index-BtTbjW0J.js";import"./el-card-bU92WWV4.js";import"./formRules-9V-NAySD.js";import"./dict.type-FYuZ3DI6.js";import"./el-dropdown-item-BW-wC9MJ.js";import"./el-tree-select-pYALMRc9.js";import"./tree-BBZY150N.js";import"./index-Abw9tEaW.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 M(o)}finally{n.value=!1}}})()}),(o,u)=>{const m=F,R=G,d=N,V=O,h=Q,C=Z,E=U;return J((K(),L(C,null,{default:l(()=>[e(R,{modelValue:a(r),"onUpdate:modelValue":u[0]||(u[0]=S=>P(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(H),{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};