useOpen-7c9bd67e.js 1.8 KB

1
  1. import{_ as e}from"./index-a4e8f2e2.js";import{d as t,n as a,l,s,r as o,o as d,c as i,a as n,aw as u,w as r,e as c,b as m,t as f,v as p,y as v,a6 as w,_ as y,I as h}from"./index-8e28b540.js";const _={class:"flex justify-between w-full"},g=["id"],x={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=o("el-button"),h=o("el-dialog");return d(),i("div",null,[n(h,w({"model-value":t.modelValue,"show-close":!1,fullscreen:k.value},a.$attrs,{width:C.value,close:V,"before-close":j,draggable:""}),u({header:r((({titleId:e,titleClass:a})=>[c("div",_,[c("div",null,[c("h4",{id:e,class:p(a)},f(t.title),11,g)]),c("div",x,[n(s,{name:"x-mark",className:"hover:cursor-pointer w-5 h-5",onClick:V})])])])),default:r((()=>[v(a.$slots,"default",{},void 0,!0)])),_:2},[t.showFooter?{name:"footer",fn:r((()=>[c("span",b,[n(y,{onClick:V},{default:r((()=>[m(f(a.$t("system.cancel")),1)])),_:1}),n(y,{type:"primary",onClick:V},{default:r((()=>[m(f(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};