feat: remove console

This commit is contained in:
zhengkunwang223 2025-08-28 18:56:31 +08:00
parent acbb151b15
commit ac2700f965

View file

@ -272,43 +272,20 @@ const getContent = async (pre: boolean) => {
if (logs.value.length == 0) {
logs.value = newLogs;
console.log('首次加载');
} else {
// if (end.value) {
// console.log('');
// if (pre) {
// console.log('' + newLogs.length + '');
// } else {
// console.log('' + newLogs.length + '');
// }
// logs.value = pre ? [...newLogs, ...logs.value] : [...lastLogs.value, ...newLogs];
// } else {
// console.log('');
// if (pre) {
// console.log('' + newLogs.length + '');
// } else {
// console.log('' + newLogs.length + '');
// }
// logs.value = pre ? [...newLogs, ...logs.value] : [...lastLogs.value, ...newLogs];
// }
// pre
if (pre) {
logs.value = [...newLogs, ...logs.value];
} else {
if (end.value) {
console.log('lastLogs 拼接');
logs.value = [...lastLogs.value, ...newLogs];
} else {
logs.value = [...logs.value, ...newLogs];
}
}
}
console.log(logs.value.length);
nextTick(() => {
if (logContainer.value) {
if (pre) {
console.log(logs.value[0]);
if (readReq.page > 1) {
const addedLines = newLogs.length;
const newScrollPosition = lastScrollTop.value + (addedLines * logHeight) / 3;
@ -326,7 +303,6 @@ const getContent = async (pre: boolean) => {
logCount.value = logs.value.length;
end.value = res.data.end;
console.log('end=' + end.value);
emit('update:hasContent', logs.value.length > 0);
if (readReq.latest) {
readReq.page = res.data.total;
@ -339,7 +315,6 @@ const getContent = async (pre: boolean) => {
}
}
if (logs.value && logs.value.length > 3000) {
console.log('日志过长,进行裁剪');
if (pre) {
logs.value.splice(logs.value.length - readReq.pageSize, readReq.pageSize);
if (maxPage.value > 1) {