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
32 KiB
1 line
32 KiB
|
2 weeks ago
|
import{n as e,st as t}from"./axios-CiYFffbI.js";import{I as n,N as r,P as i,V as a,Y as o,_ as s,d as c,f as l,i as u,it as d,kt as f,l as p,nt as m,p as h,u as g,ut as ee,v as _,y as te,z as v}from"./runtime-core.esm-bundler-CnFWH3R5.js";import{a as y,n as b,o as x}from"./index-Gnb5WhSJ.js";import{t as ne}from"./RichEditorField-BUxs_xgc.js";import{t as re}from"./listTable-DXuZ0yk8.js";function S(e,t){return function(){return e()?window.confirm(t):!0}}function ie(e,t=`当前有未保存改动,确定要离开吗?`){function n(t){e()&&(t.preventDefault(),t.returnValue=``)}y((n,r,i)=>{if(!e()){i();return}i(window.confirm(t))}),r(()=>{window.addEventListener(`beforeunload`,n)}),i(()=>{window.removeEventListener(`beforeunload`,n)})}var ae=[`src`],oe={key:1},se={key:1,style:{color:`var(--color-text-3)`}},ce={style:{"margin-top":`8px`,width:`100%`,display:`flex`,"flex-wrap":`wrap`,gap:`8px`}},le={key:0,style:{color:`#86909c`}},ue={class:`activity-cover-carousel-wrap`},de={class:`activity-cover-carousel-row__col`},fe=[`src`],pe={class:`activity-cover-carousel-row__col`},me={style:{display:`flex`,"flex-direction":`column`,"align-items":`flex-start`,width:`100%`}},he={style:{width:`100%`,"margin-bottom":`8px`}},ge={class:`activity-gallery-grid`},_e=[`src`,`onClick`],ve=[`src`,`onClick`],ye=[`src`],be=[`src`],xe={key:0,class:`booking-settings`},Se={style:{"margin-top":`16px`,"text-align":`right`}},C=x(te({__name:`ActivityList`,setup(i){let te=d([]),y=d([]),x=d(null),C=d(!1),Ce=d(!1),w=d(!1),T=m({current:1,pageSize:10,total:0}),E=m({keyword:``,venue_id:void 0,is_active:`all`,schedule_status:`all`,audit_status:`all`}),D=d(null),O=d(``),k=d(!1),A=d(!0),j=d(null),we=d(``),Te={maxHeight:`70vh`,overflow:`auto`},Ee=d(0),De=d(!1),Oe=d(`image`),M=d(``),N=d(!1),P=d(!1),F=d(!1),I=d(null),L=d(`both`),R=d(1),z=d(1),B=d([]);function ke(){return`bk-${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function V(e){if(!e)return``;let t=new Date(String(e));return Number.isNaN(t.getTime())?String(e).slice(0,10):new Intl.DateTimeFormat(`en-CA`,{timeZone:`Asia/Shanghai`,year:`numeric`,month:`2-digit`,day:`2-digit`}).format(t)}let Ae=p(()=>B.value.reduce((e,t)=>e+(Number(t.day_quota)||0),0)),je=p(()=>{let e=I.value;return e?.venue_id?y.value.find(t=>t.id===e.venue_id)?.appointment_type===`team_only`:!1}),H=m({venue_id:void 0,reservation_type:`online`,location:``,specific_time:``,offline_reservation_method:``,external_url:``,title:``,start_at:``,end_at:``,detail_html:``,cover_image:``,gallery_media:[],tags:[],sort:0,summary:``,is_active:!0}),U=d(``),Me=p(()=>Q(H.start_at||``,H.end_at||``));function W(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 G(e){let t=new FormData;t.append(`file`,e);let{data:n}=await b.post(`/upload`,t);return W(n?.url,n?.path)}function K(){Ee.value+=1}function Ne(e,t){t&&(Oe.value=e,M.value=t,De.value=!0)}function Pe(){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 G(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 q(){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 G(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 Fe={modules:{toolbar:{container:[[{header:[1,2,3,!1]}],[`bold`,`italic`,`underline`,`strike`],[{color:[]},{background:[]}],[{list:`ordered`},{list:`bullet`}],[{align:[]}],[`link`,`image`,`video`],[`clean`]],handlers:{image:Pe,video:q}}},placeholder:`请输入活动详情内容`};function
|