useOpen-35ece9f2.js 1.8 KB

1
  1. import{_ as e}from"./index-d78b51f5.js";import{d as t,n as a,l,s,o,c as d,a as i,a8 as n,w as u,e as r,b as c,t as m,x as f,y as p,a4 as v,r as w,_ as y,I as h}from"./index-ed560906.js";const _={class:"flex justify-between w-full"},x=["id"],g={class:"flex w-12 justify-end"},b={class:"dialog-footer"},k=y(t({__name:"index",props:{modelValue:{type:Boolean,default:!1,require:!0},showFooter:{type:Boolean,default:!1},width:{type:String,required:!1,default:""},title:{type:String,default:""}},emits:["update:modelValue"],setup(t,{emit:y}){const h=t,k=a(!1);l((()=>k.value?"arrows-pointing-in":"arrows-pointing-out"));const V=()=>{y("update:modelValue",!1)},j=()=>{y("update:modelValue",!1)},C=a("");s((()=>{C.value=h.width?h.width:$()}));const $=()=>{const e=window.document.body.clientWidth;return e<=726?"100%":e>726&&e<1440?"60%":"650px"};return(a,l)=>{const s=e,y=w("el-button"),h=w("el-dialog");return o(),d("div",null,[i(h,v({"model-value":t.modelValue,"show-close":!1,fullscreen:k.value},a.$attrs,{width:C.value,close:V,"before-close":j,draggable:""}),n({header:u((({titleId:e,titleClass:a})=>[r("div",_,[r("div",null,[r("h4",{id:e,class:f(a)},m(t.title),11,x)]),r("div",g,[i(s,{name:"x-mark",className:"hover:cursor-pointer w-5 h-5",onClick:V})])])])),default:u((()=>[p(a.$slots,"default",{},void 0,!0)])),_:2},[t.showFooter?{name:"footer",fn:u((()=>[r("span",b,[i(y,{onClick:V},{default:u((()=>[c(m(a.$t("system.cancel")),1)])),_:1}),i(y,{type:"primary",onClick:V},{default:u((()=>[c(m(a.$t("system.confirm")),1)])),_:1})])])),key:"0"}:void 0]),1040,["model-value","fullscreen","width"])])}}}),[["__scopeId","data-v-21105f75"]]);function V(){const e=a(!1),t=a(null),l=a("");return{open:(a=null)=>{l.value=h(a?"system.edit":"system.add"),t.value=a,e.value=!0},close:t=>{e.value=!1,t()},title:l,visible:e,id:t}}export{k as _,V as u};