feat: 修改bug

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

@ -155,7 +155,6 @@ onUpdated(() => {
}) })
onBeforeMount(async () => { onBeforeMount(async () => {
console.log(888)
// const list = await featchList() // const list = await featchList()
// listData.value = list // 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) if (rect.right > x && rect.bottom > y && rect.left < x + w && rect.top < y + h)
index === -1 && selectIds.value.push(item.dataset.id!) index === -1 && selectIds.value.push(item.dataset.id!)
else index !== -1 && selectIds.value.splice(index, 1) 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) { function isSelected(pictureId: number) {
@ -217,8 +237,16 @@ function moveHandler(e: MouseEvent) {
function upHandler(event: MouseEvent) { function upHandler(event: MouseEvent) {
if (!selectionBox) if (!selectionBox)
return 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' selectionBox.style.display = 'none'
start = null start = null
} }
@ -274,7 +302,6 @@ async function showModal() {
} }
async function onChange(val) { async function onChange(val) {
console.log("val------------------------", val);
sortObj = { sortObj = {
// orderbyname: val, // orderbyname: val,
orderByUptime: val orderByUptime: val
@ -285,7 +312,6 @@ async function onChange(val) {
} }
async function onChangeView(val) { async function onChangeView(val) {
console.log("val------------------------", val);
sortObj = { sortObj = {
// orderbyname: val, // orderbyname: val,
orderBySimilarity: val orderBySimilarity: val
@ -345,9 +371,18 @@ const showActions = computed(() => {
function onCheckChange(checked: any, item: any) { function onCheckChange(checked: any, item: any) {
item.checked = checked item.checked = checked
const index = selectedApproveItems.value.indexOf(item); const index = selectedApproveItems.value.indexOf(item);
const picIndex = selectIds.value.indexOf(item.pictureId);
if (index === -1 && checked) selectedApproveItems.value.push(item); if (index === -1 && checked) {
else selectedApproveItems.value.splice(index, 1); 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() { function rejectHandler() {

Loading…
Cancel
Save