邹方成 2a89a1ab9d
Some checks failed
Build docker and publish / linux (1.24.5) (push) Failing after 39s
feat(admin): 更新前端资源文件及修复相关功能
refactor(service): 修改banner和guild删除逻辑为软删除
fix(service): 修复删除操作使用软删除而非物理删除

build: 添加SQLite测试仓库实现
docs: 新增奖励管理字段拆分和批量抽奖UI改造文档

ci: 更新CI忽略文件
style: 清理无用资源文件
2025-11-19 01:35:55 +08:00

2 lines
1.3 KiB
JavaScript

import{a as e,o as t,U as n,b as o,bz as s}from"./index-CZ0Lvzl5.js";const a=(a,u,i,l)=>{const v={offsetX:0,offsetY:0},m=e(!1),f=(e,t)=>{if(a.value){const{offsetX:n,offsetY:o}=v,u=a.value.getBoundingClientRect(),i=u.left,m=u.top,f=u.width,d=u.height,r=document.documentElement.clientWidth,c=document.documentElement.clientHeight,E=-i+n,h=-m+o,L=r-i-f+n,X=c-m-(d<c?d:0)+o;(null==l?void 0:l.value)||(e=Math.min(Math.max(e,E),L),t=Math.min(Math.max(t,h),X)),v.offsetX=e,v.offsetY=t,a.value.style.transform=`translate(${s(e)}, ${s(t)})`}},d=e=>{const t=e.clientX,n=e.clientY,{offsetX:o,offsetY:s}=v,a=e=>{m.value||(m.value=!0);const a=o+e.clientX-t,u=s+e.clientY-n;f(a,u)},u=()=>{m.value=!1,document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",u)};document.addEventListener("mousemove",a),document.addEventListener("mouseup",u)},r=()=>{u.value&&a.value&&(u.value.removeEventListener("mousedown",d),window.removeEventListener("resize",c))},c=()=>{const{offsetX:e,offsetY:t}=v;f(e,t)};return t(()=>{n(()=>{i.value?u.value&&a.value&&(u.value.addEventListener("mousedown",d),window.addEventListener("resize",c)):r()})}),o(()=>{r()}),{isDragging:m,resetPosition:()=>{v.offsetX=0,v.offsetY=0,a.value&&(a.value.style.transform="")},updatePosition:c}};export{a as u};