Commit f56cf599 by linjinhong

分拣配置修改

parent e2f049d1
......@@ -467,11 +467,14 @@ export function updateSortingApi(data: IsortingInfo) {
data,
)
}
export function deleteSortingApi(ids: string) {
export function deleteSortingApi(params: {
ids: string
type: string | number
}) {
return axios.get<never, BaseRespData<never>>(
'logistics/sortingConfig/delete',
{
params: { ids },
params,
},
)
}
......
......@@ -19,4 +19,5 @@ export interface IsortingInfo {
sortingArea: number | null
sortingAreaName?: string | null
serviceCode: string | null
}
\ No newline at end of file
type?: string | number
}
......@@ -37,11 +37,19 @@ export default function useImagePreview() {
}
}
const mouseoverImg = (ev: MouseEvent, url: string) => {
const mouseoverImg = (
ev: MouseEvent,
url: string,
newWitdh?: string,
newBorder?: boolean,
positionBOOTTOM?: boolean,
) => {
ev.preventDefault()
if (show.value === true) return
img.src = url
img.style.backgroundColor = '#eee'
if (newBorder) img.style.border = '1px solid #eee'
if (newWitdh) img.style.width = newWitdh
const cW = document.body.clientWidth
const cH = document.body.clientHeight
const cX = ev.clientX
......@@ -55,6 +63,31 @@ export default function useImagePreview() {
div.style.left = x + 'px'
div.style.top = y + 'px'
div.style.display = 'block'
if (positionBOOTTOM) {
// 获取图片实际尺寸
const imgWidth = img.clientWidth
const imgHeight = img.clientHeight
// 计算新位置(鼠标正下方)
let x = cX / 2
let y = cY + 150 // 20px 垂直偏移
// 边界检测
if (x + imgWidth > cW) {
x = cW - imgWidth - 10
}
if (x < 0) {
x = 10
}
if (y + imgHeight > cH) {
y = cY - imgHeight - 20
}
if (y < 0) {
y = 10
}
div.style.left = x + 'px'
div.style.top = y + 'px'
}
show.value = true
currentTarget = ev.currentTarget as HTMLElement
window.addEventListener('mousemove', mousemoveHandler)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment