engineering/public/admin/assets/index.9492d03b.js
2024-03-04 15:04:21 +08:00

2 lines
2.0 KiB
JavaScript

import{w as y,F as g}from"./element-plus.258bf9e7.js";import{d as k,r as C,E as S,n as T,o as r,c as b,a as f,I as p,V as w,a9 as E,M as a,T as s,U as d,L as m,S as v}from"./@vue.ab566ce7.js";import{_ as V}from"./index.ec401e3b.js";const $=k({props:{title:{type:String,default:""},content:{type:String,default:""},confirmButtonText:{type:[String,Boolean],default:"\u786E\u5B9A"},cancelButtonText:{type:[String,Boolean],default:"\u53D6\u6D88"},width:{type:String,default:"400px"},disabled:{type:Boolean,default:!1},async:{type:Boolean,default:!1},clickModalClose:{type:Boolean,default:!1},center:{type:Boolean,default:!1},customClass:{type:String,default:""},showFootBtn:{type:Boolean,default:!0}},emits:["confirm","cancel","close","open"],setup(e,{emit:o}){const t=C(!1),u=n=>{o(n),(!e.async||n==="cancel")&&i()},i=()=>{t.value=!1,T(()=>{o("close")})},c=()=>{e.disabled||(o("open"),t.value=!0)};return S("visible",t),{visible:t,handleEvent:u,close:i,open:c}}});const h={class:"dialog"},_={class:"dialog-footer"};function D(e,o,t,u,i,c){const n=y,B=g;return r(),b("div",h,[f("div",{class:"dialog__trigger",onClick:o[0]||(o[0]=(...l)=>e.open&&e.open(...l))},[p(e.$slots,"trigger",{},void 0,!0)]),w(B,{modelValue:e.visible,"onUpdate:modelValue":o[3]||(o[3]=l=>e.visible=l),"custom-class":e.customClass,center:e.center,"append-to-body":!0,width:e.width,"close-on-click-modal":e.clickModalClose,onClosed:e.close},E({default:a(()=>[p(e.$slots,"default",{},()=>[s(d(e.content),1)],!0)]),_:2},[e.title?{name:"header",fn:a(()=>[s(d(e.title),1)])}:void 0,e.showFootBtn?{name:"footer",fn:a(()=>[f("div",_,[e.cancelButtonText?(r(),m(n,{key:0,onClick:o[1]||(o[1]=l=>e.handleEvent("cancel"))},{default:a(()=>[s(d(e.cancelButtonText),1)]),_:1})):v("",!0),e.confirmButtonText?(r(),m(n,{key:1,type:"primary",onClick:o[2]||(o[2]=l=>e.handleEvent("confirm"))},{default:a(()=>[s(d(e.confirmButtonText),1)]),_:1})):v("",!0)])])}:void 0]),1032,["modelValue","custom-class","center","width","close-on-click-modal","onClosed"])])}const I=V($,[["render",D],["__scopeId","data-v-7f00633a"]]);export{I as P};