/** * 由 Fantastic-admin 提供技术支持 * Powered by Fantastic-admin * Gitee https://gitee.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin */ import{g as C,c as E,u as M}from"./dbTypeApi-9a9f20e4.js";import{aU as U}from"./index-5cddd228.js";import{j as h,r as f,J as z,o as I,a3 as r,ad as R,k as b,l as y,E as a,y as l,C as g,z as q,u as o}from"./runtime-core.esm-bundler-5fc1c360.js";import{b as T}from"./route-block-83d24a4e.js";import"./menu-2c9c5182.js";import"./settings-be8974ad.js";import"./pinia-7162f4ce.js";import"./_MapCache-1b613190.js";import"./vue-router-8a13d09b.js";import"./index-c228ae8f.js";import"./iframe-10768394.js";import"./runtime-dom.esm-bundler-e65f1c43.js";const N=h({__name:"DBType",emits:["success"],setup(j,{expose:_,emit:n}){const d=f(),D=f({dbTypeTitle:[{required:!0,message:"请输入标题",trigger:"blur"}],dbTypeDesc:[{required:!1,message:"请输入描述",trigger:"blur"}]}),e=z({title:"",dialogVisible:!1,loading:!1,formData:{dbTypeId:0,dbTypeTitle:"",dbTypeDesc:""},actionType:1});I(()=>{});const V=async i=>{e.loading=!0;const{data:t}=await C(i);e.loading=!1,e.formData=t};function v(){d.value&&d.value.validate(async i=>{i&&(e.actionType===1?(await E(e.formData),e.dialogVisible=!1,n("success")):(await M(e.formData),e.dialogVisible=!1,n("success")),U.success({message:"保存成功",center:!0}))})}function w(){e.dialogVisible=!1}function p(){e.formData={dbTypeId:0,dbTypeTitle:"",dbTypeDesc:""}}return _({showAddModel(){p(),e.title="新增",e.actionType=1,e.dialogVisible=!0},showEditModel(i){p(),e.title="编辑",e.actionType=2,e.dialogVisible=!0,V(i)}}),(i,t)=>{const m=r("el-input"),u=r("el-form-item"),k=r("el-form"),c=r("el-button"),x=r("el-dialog"),B=R("loading");return b(),y("div",null,[a(x,{modelValue:o(e).dialogVisible,"onUpdate:modelValue":t[2]||(t[2]=s=>o(e).dialogVisible=s),title:o(e).title,width:"600px","close-on-click-modal":!1,"append-to-body":"","destroy-on-close":""},{footer:l(()=>[a(c,{size:"large",onClick:w},{default:l(()=>[g(" 取消 ")]),_:1}),a(c,{type:"primary",size:"large",onClick:v},{default:l(()=>[g(" 保存 ")]),_:1})]),default:l(()=>[q((b(),y("div",null,[a(k,{ref_key:"formRef",ref:d,model:o(e).formData,rules:o(D),"label-width":"120px","label-suffix":":"},{default:l(()=>[a(u,{label:"分类名称",prop:"dbTypeTitle"},{default:l(()=>[a(m,{modelValue:o(e).formData.dbTypeTitle,"onUpdate:modelValue":t[0]||(t[0]=s=>o(e).formData.dbTypeTitle=s),placeholder:"请输入标题"},null,8,["modelValue"])]),_:1}),a(u,{label:"简要说明",prop:"dbTypeDesc"},{default:l(()=>[a(m,{modelValue:o(e).formData.dbTypeDesc,"onUpdate:modelValue":t[1]||(t[1]=s=>o(e).formData.dbTypeDesc=s),type:"textarea",rows:"10",placeholder:"请输入简要说明"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])])),[[B,o(e).loading]])]),_:1},8,["modelValue","title"])])}}});typeof T=="function"&&T(N);export{N as default};