You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
31 KiB
1 line
31 KiB
|
3 days ago
|
import{n as e,st as t}from"./axios-CiYFffbI.js";import{I as n,N as r,O as i,P as a,V as o,Y as s,_ as c,d as l,f as u,i as d,it as f,kt as p,l as m,nt as h,p as g,u as _,ut as ee,v,y as te,z as y}from"./runtime-core.esm-bundler-CnFWH3R5.js";import{a as b,n as x,o as S,s as C}from"./index-DCZGO169.js";import{t as ne}from"./RichEditorField-C8vGpP_T.js";import{t as re}from"./listTable-Djel28e5.js";function ie(e,t){return function(){return e()?window.confirm(t):!0}}function ae(e,t=`当前有未保存改动,确定要离开吗?`){function n(t){e()&&(t.preventDefault(),t.returnValue=``)}b((n,r,i)=>{if(!e()){i();return}i(window.confirm(t))}),r(()=>{window.addEventListener(`beforeunload`,n)}),a(()=>{window.removeEventListener(`beforeunload`,n)})}var oe=[`src`],se={key:1},ce={style:{"margin-top":`8px`,width:`100%`,"overflow-x":`auto`,"white-space":`nowrap`}},le={key:0,style:{color:`#86909c`}},ue=[`src`],de={style:{display:`flex`,"flex-direction":`column`,"align-items":`flex-start`,width:`100%`}},fe={style:{width:`100%`,"margin-bottom":`8px`}},pe={style:{display:`grid`,"grid-template-columns":`repeat(3, 180px)`,gap:`12px`,width:`100%`}},me=[`src`,`onClick`],he=[`src`,`onClick`],ge=[`src`],_e=[`src`],ve={style:{display:`flex`,gap:`12px`}},ye={style:{width:`280px`,height:`520px`,overflow:`auto`,border:`1px solid #e5e6eb`,padding:`8px`}},be={key:0,class:`booking-settings`},xe={style:{"margin-top":`16px`,"text-align":`right`}},Se=1200,w=800,T=S(te({__name:`ActivityList`,setup(a){let te=f([]),b=f([]),S=f(null),T=f(!1),Ce=f(!1),E=f(!1),D=f(!1),O=f(!1),k=f(``),A=f([]),we=f(null),j=h({current:1,pageSize:10,total:0}),M=h({keyword:``,venue_id:void 0,is_active:`all`,include_deleted:!1,only_deleted:!1}),N=f(!0),P=f(null),F=f(``),Te={maxHeight:`70vh`,overflow:`auto`},Ee=f(0),De=f(!1),Oe=f(`image`),ke=f(``),I=f(!1),L=f(!1),Ae=f(!1),R=f(null),z=f(`both`),B=f(1),V=f(1),H=f([]);function U(){return`bk-${Date.now()}-${Math.random().toString(36).slice(2,9)}`}let je=m(()=>H.value.reduce((e,t)=>e+(Number(t.day_quota)||0),0)),W=null,G=null,K=f(null),Me={lat:31.299379,lng:120.585315},q=h({venue_id:void 0,title:``,start_at:``,end_at:``,address:``,lat:void 0,lng:void 0,detail_html:``,cover_image:``,gallery_media:[],tags:[],reservation_notice:``,open_time:``,sort:0,summary:``,is_active:!0}),J=f(``);function Y(e){if(e==null||e===``)return;let t=typeof e==`number`?e:parseFloat(String(e).trim());return Number.isFinite(t)?t:void 0}function X(e,t){let n=String(e||``).trim();if(n)return/^https?:\/\//i.test(n)?n:n.startsWith(`/`)?`${window.location.origin}${n}`:`${window.location.origin}/${n}`;let r=String(t||``).trim();if(!r)return``;let i=r.replace(/^\/+/,``);return`${window.location.origin}/storage/${i}`}async function Z(e){let t=new FormData;t.append(`file`,e);let{data:n}=await x.post(`/upload`,t,{headers:{"Content-Type":`multipart/form-data`}});return X(n?.url,n?.path)}function Ne(){Ee.value+=1}function Pe(e,t){t&&(Oe.value=e,ke.value=t,De.value=!0)}async function Fe(t,n,r,i){if(!t.type.startsWith(`image/`))return!0;let a=await new Promise((e,n)=>{let r=new FileReader;r.onload=()=>{let t=new Image;t.onload=()=>e({width:t.width,height:t.height}),t.onerror=()=>n(Error(`图片解析失败`)),t.src=String(r.result||``)},r.onerror=()=>n(Error(`图片读取失败`)),r.readAsDataURL(t)});return a.width>n||a.height>r?(e.warning(`${i}尺寸不能超过 ${n}x${r},当前为 ${a.width}x${a.height}`),!1):!0}function Ie(){let t=this.quill,n=document.createElement(`input`);n.type=`file`,n.accept=`image/*`,n.onchange=async()=>{let r=n.files?.[0];if(r)try{let e=await Z(r),n=t.getSelection(!0)?.index??Math.max(0,t.getLength()-1);t.insertEmbed(n,`image`,e,`user`),t.setSelection(n+1,0)}catch(t){e.error(t?.response?.data?.message??`图片上传失败`)}},n.click()}function Le(){let t=this.quill,n=document.createElement(`input`);n.type=`file`,n.accept=`video/*`,n.onchange=async()=>{let r=n.files?.[0];if(r)try{let e=await Z(r),n=t.getSelection(!0)?.index??Math.max(0,t.getLength()-1);t.insertEmbed(n,`video`,e,`user`),t.setSelection(n+1,0)}catch(t){e.error(t?.response?.data?.me
|