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

2 weeks 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,h as d,i as f,it as p,kt as m,l as h,nt as g,p as _,u as v,ut as ee,v as y,y as te,z as b}from"./runtime-core.esm-bundler-CnFWH3R5.js";import{n as x}from"./http-LCi9aT1G.js";import{a as S,c as C,s as w}from"./index-DtDFIu4i.js";import{t as ne}from"./RichEditorField-DVnrTI6h.js";import{t as re}from"./listTableRowIndex-ConJ8Gia.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=``)}w((n,r,i)=>{if(!e()){i();return}i(window.confirm(t))}),r(()=>{window.addEventListener(`beforeunload`,n)}),a(()=>{window.removeEventListener(`beforeunload`,n)})}var oe={style:{color:`#f53f3f`}},se={style:{color:`#f53f3f`}},ce={style:{color:`#f53f3f`}},le={style:{color:`#f53f3f`}},ue={style:{color:`#f53f3f`}},de={style:{color:`#f53f3f`}},fe={style:{color:`#f53f3f`}},pe={class:`activity-form-tags`},me={class:`activity-form-tags__line`},he={class:`activity-form-tags__chips`},ge={key:0,class:`activity-form-tags__empty`},_e={key:1,style:{color:`var(--color-text-3)`}},ve={style:{"margin-left":`8px`,color:`var(--color-text-3)`}},ye={class:`activity-address-coord-row`},be={style:{color:`#f53f3f`}},xe={class:`activity-cover-carousel-wrap`},Se={class:`activity-cover-carousel-row__col`},Ce=[`src`],we={class:`activity-cover-carousel-row__col`},Te={style:{display:`flex`,"flex-direction":`column`,"align-items":`flex-start`,width:`100%`}},Ee={style:{width:`100%`,"margin-bottom":`8px`}},De={class:`activity-gallery-grid`},Oe=[`src`,`onClick`],ke=[`src`,`onClick`],Ae=[`src`],je=[`src`],Me={style:{display:`flex`,gap:`12px`}},Ne={style:{width:`280px`,height:`520px`,overflow:`auto`,border:`1px solid #e5e6eb`,padding:`8px`}},Pe=1420,T=C(te({__name:`ActivityList`,setup(a){let te=p([]),C=p([]),w=p(null),T=p(!1),Fe=p(!1),E=p(!1),D=g({current:1,pageSize:10,total:0}),O=g({keyword:``,venue_id:void 0,reservation_type:void 0,is_active:void 0,schedule_status:void 0,audit_status:void 0}),k=p(null),A=p(``),j=p(!1),Ie=p(!0),M=p(null),N=p(``),Le={maxHeight:`70vh`,overflow:`auto`},Re=p(0),ze=p(!1),Be=p(`image`),P=p(``),F=p(!1),I=p(!1),L=p(``),R=p([]),Ve=p(null),z=null,B=null,V=p(null),H={lat:31.299379,lng:120.585315},He=S();function U(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)}function Ue(e){let t=e.start_at?U(String(e.start_at)):``,n=e.end_at?U(String(e.end_at)):``;return!t&&!n?`-`:t&&n?t===n?t:`${t}${n}`:t||n||`-`}let W=g({venue_id:void 0,reservation_type:`phone`,ticket_note:`free`,location:``,lat:void 0,lng:void 0,specific_time:``,offline_reservation_method:``,external_url:``,title:``,contact_name:``,contact_phone:``,start_at:``,end_at:``,detail_html:``,cover_image:``,gallery_media:[],tags:[],sort:0,summary:``,is_active:!0}),G=p(``),K=g({title:``,venue_id:``,start_at:``,end_at:``,reservation_type:``,ticket_note:``,offline_reservation_method:``,external_url:``,location:``,cover_image:``,gallery_media:``,detail_html:``,contact_name:``,contact_phone:``}),We=h({get(){if(W.start_at&&W.end_at)return[W.start_at,W.end_at]},set(e){Array.isArray(e)&&e.length>=2&&e[0]&&e[1]?(W.start_at=String(e[0]),W.end_at=String(e[1])):(W.start_at=``,W.end_at=``)}}),Ge=h(()=>it(W.start_at||``,W.end_at||``));function Ke(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 q(e){let t=new FormData;t.append(`file`,e);let{data:n}=await x.post(`/upload`,t);return Ke(n?.url,n?.path)}function J(){Re.value+=1}function qe(e,t){t&&(Be.value=e,P.value=t,ze.value=!0)}function Je(){let t=this.quill,n=document.createElement(`input`);n.type=`file`,n.accept=`image/*`