feat: 修改bug

pull/115/head
raofuzi 1 year ago
parent 11185901c6
commit 390a9e0a21

@ -155,7 +155,6 @@ onUpdated(() => {
})
onBeforeMount(async () => {
console.log(888)
// const list = await featchList()
// listData.value = list
})
@ -191,7 +190,28 @@ function imUpdateSelectIds(x: number, y: number, w: number, h: number) {
if (rect.right > x && rect.bottom > y && rect.left < x + w && rect.top < y + h)
index === -1 && selectIds.value.push(item.dataset.id!)
else index !== -1 && selectIds.value.splice(index, 1)
let tempApproveIndex = -1;
selectedApproveItems.value.map((approveItem, approveIndex) => {
if(approveItem.dataset.id == item.dataset.id) {
tempApproveIndex = approveIndex;
}
})
if (tempApproveIndex === -1 && item.className.indexOf('grid-item-selected') != -1) {
selectedApproveItems.value.push(item)
} else {
selectedApproveItems.value.splice(tempApproveIndex, 1);
}
})
//
listData.value.map(item => {
if(selectIds.value.includes(String(item.pictureId))) {
item.checked = true;
}
});
}
function isSelected(pictureId: number) {
@ -218,7 +238,15 @@ function moveHandler(e: MouseEvent) {
function upHandler(event: MouseEvent) {
if (!selectionBox)
return
if(selectionBox.style.width == "0px") {
selectIds.value = []
selectedApproveItems.value.forEach((item) => (item.checked = false));
selectedApproveItems.value.length = 0;
listData.value.map(item => {
item.checked = false;
});
batch.value = false;
}
selectionBox.style.display = 'none'
start = null
}
@ -274,7 +302,6 @@ async function showModal() {
}
async function onChange(val) {
console.log("val------------------------", val);
sortObj = {
// orderbyname: val,
orderByUptime: val
@ -285,7 +312,6 @@ async function onChange(val) {
}
async function onChangeView(val) {
console.log("val------------------------", val);
sortObj = {
// orderbyname: val,
orderBySimilarity: val
@ -345,9 +371,18 @@ const showActions = computed(() => {
function onCheckChange(checked: any, item: any) {
item.checked = checked
const index = selectedApproveItems.value.indexOf(item);
const picIndex = selectIds.value.indexOf(item.pictureId);
if (index === -1 && checked) selectedApproveItems.value.push(item);
else selectedApproveItems.value.splice(index, 1);
if (index === -1 && checked) {
selectedApproveItems.value.push(item)
} else {
selectedApproveItems.value.splice(index, 1);
}
if (picIndex === -1 && checked) {
selectIds.value.push(item.pictureId);
} else {
selectIds.value.splice(picIndex, 1);
}
}
function rejectHandler() {

Loading…
Cancel
Save