1 |
- import{d as D,u as b,cB as V,o as t,c as m,w as v,a as B,e as n,S as C,k as d,X as g,t as h,l as L,r as k,Y as S,a0 as M}from"./index.6c36cb53.js";import{M as E}from"./index.a696a3d7.js";const N={class:"my-2 d-flex align-center"},j={key:0},q={key:1,class:""},x=D({__name:"MessageBoxDialog",props:{options:{}},setup(o,{expose:u}){const a=b(!1),{isShow:i,showDialog:l,confirm:f,cancel:w}=a,p=Object.assign(V,{question:{icon:"class:iconfont info",color:"rgb(47,144,207)"},none:void 0});let r=[{name:"\u786E\u5B9A",fun:()=>{},primary:!0},{name:"\u53D6\u6D88",fun:()=>l(!1)}];const I={escape:()=>{if(o.options.cancelId){const e=r[o.options.cancelId];e.fun.apply(e)}else l(!1),w()},enter:()=>{if(o.options.defaultId){const e=r[o.options.defaultId];e.fun.apply(e)}}};return o.options.buttons&&(r=o.options.buttons.map((e,s)=>({name:e,fun:()=>{f(s),l(!1)},primary:o.options.defaultId===s}))),u({useDialog:a}),(e,s)=>(t(),m(E,{title:e.options.title,modelValue:n(i),"onUpdate:modelValue":s[0]||(s[0]=c=>L(i)?i.value=c:null),footerBtnList:n(r),keys:I,"max-width":"620",width:"auto"},{default:v(()=>{var c,y;return[B("div",N,[e.options.type&&n(p)[e.options.type]?(t(),m(C,{key:0,size:36,icon:(c=n(p)[e.options.type])==null?void 0:c.icon,class:"mr-2",color:(y=n(p)[e.options.type])==null?void 0:y.color},null,8,["icon","color"])):d("",!0),B("div",null,[e.options.message?(t(),g("p",j,h(e.options.message),1)):d("",!0),e.options.detail?(t(),g("p",q,h(e.options.detail),1)):d("",!0)])])]}),_:1},8,["title","modelValue","footerBtnList"]))}}),R=D({__name:"index",setup(o){const u=k([]),a=k([]);return(i,l)=>(t(!0),g(M,null,S(u.value,f=>(t(),m(x,{ref_for:!0,ref_key:"dialogs",ref:a,options:f},null,8,["options"]))),256))}});export{R as default};
|