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