GroupCat-3bad56a0.js 2.9 KB

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