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
30 KiB
1 line
30 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 ne}from"./index-BbRh5og5.js";import{t as re}from"./RichEditorField-BDaNNZIi.js";import{t as ie}from"./listTable-Djel28e5.js";function ae(e,t){return function(){return e()?window.confirm(t):!0}}function oe(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 se=[`src`],ce={key:1},le={style:{"margin-top":`8px`,width:`100%`,"overflow-x":`auto`,"white-space":`nowrap`}},ue={key:0,style:{color:`#86909c`}},de=[`src`],fe={style:{display:`flex`,"flex-direction":`column`,"align-items":`flex-start`,width:`100%`}},pe={style:{width:`100%`,"margin-bottom":`8px`}},me={style:{display:`grid`,"grid-template-columns":`repeat(3, 180px)`,gap:`12px`,width:`100%`}},he=[`src`,`onClick`],ge=[`src`,`onClick`],_e=[`src`],ve=[`src`],ye={style:{display:`flex`,gap:`12px`}},be={style:{width:`280px`,height:`520px`,overflow:`auto`,border:`1px solid #e5e6eb`,padding:`8px`}},xe={key:0,class:`booking-settings`},Se={style:{"margin-top":`16px`,"text-align":`right`}},C=1200,Ce=800,w=S(te({__name:`ActivityList`,setup(a){let te=f([]),b=f([]),S=f(null),w=f(!1),we=f(!1),T=f(!1),E=f(!1),D=f(!1),O=f(``),k=f([]),Te=f(null),A=h({current:1,pageSize:10,total:0}),j=h({keyword:``,venue_id:void 0,is_active:`all`}),M=f(!0),N=f(null),P=f(``),Ee={maxHeight:`70vh`,overflow:`auto`},De=f(0),Oe=f(!1),ke=f(`image`),F=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 je(){return`bk-${Date.now()}-${Math.random().toString(36).slice(2,9)}`}let Me=m(()=>H.value.reduce((e,t)=>e+(Number(t.day_quota)||0),0)),U=null,W=null,G=f(null),K={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 Ne(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 X(e){let t=new FormData;t.append(`file`,e);let{data:n}=await x.post(`/upload`,t);return Ne(n?.url,n?.path)}function Pe(){De.value+=1}function Fe(e,t){t&&(ke.value=e,F.value=t,Oe.value=!0)}async function Ie(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 Le(){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 X(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 Z(){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 X(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?.message??`视频上传失败`)}},n.click()}let Re={modules:{toolbar:{container:[[{head
|