Merge branch 'v2-dev' into v2-dev-template

This commit is contained in:
xiaojunnuo
2025-06-21 17:11:15 +08:00
38 changed files with 213 additions and 87 deletions
@@ -54,7 +54,9 @@ onMounted(async () => {
async function addItem() {
const email = newEmail.value;
//验证邮箱格式
if (!/^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/.test(newEmail.value)) {
const regExp =
/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/;
if (!regExp.test(email)) {
notification.error({
message: "请填写正确的邮箱地址",
});
@@ -119,6 +119,31 @@ export default {
logs: [],
});
}
async function scrollBottom(node: any, force = false) {
let el = document.querySelector(`.pi-task-view-logs.id-${node.node.id}`);
if (!el) {
return;
}
//判断当前是否在底部
let isBottom = true;
if (el) {
isBottom = el.scrollHeight - el.scrollTop - el.clientHeight < 5;
}
if (force) {
isBottom = true;
}
await nextTick();
el = document.querySelector(`.pi-task-view-logs.id-${node.node.id}`);
//如果在底部则滚动到底部
if (isBottom && el) {
el?.scrollTo({
top: el.scrollHeight,
behavior: "smooth",
});
}
}
for (let node of nodes) {
if (currentHistory?.value?.logs != null) {
node.logs = computed(() => {
@@ -146,30 +171,12 @@ export default {
return node.logs.value.length;
},
async () => {
let el = document.querySelector(`.pi-task-view-logs.id-${node.node.id}`);
if (!el) {
return;
}
//判断当前是否在底部
let isBottom = true;
if (el) {
isBottom = el.scrollHeight - el.scrollTop - el.clientHeight < 5;
console.log("isBottom", isBottom, el.scrollHeight, el.scrollTop, el.clientHeight);
}
await nextTick();
el = document.querySelector(`.pi-task-view-logs.id-${node.node.id}`);
//如果在底部则滚动到底部
if (isBottom && el) {
el?.scrollTo({
top: el.scrollHeight,
behavior: "smooth",
});
}
},
{
immediate: true,
await scrollBottom(node);
}
);
nextTick(() => {
scrollBottom(node, true);
});
}
}
@@ -178,8 +185,6 @@ export default {
}
detail.value = { nodes };
console.log("nodes", nodes);
};
const taskViewClose = () => {
@@ -50,7 +50,7 @@ loadProducts();
const orderModalRef = ref<any>(null);
async function doOrder(req: any) {
await orderModalRef.value.open({
...req
...req,
});
}
@@ -17,7 +17,7 @@ const props = withDefaults(
{
modelValue: 0,
edit: false,
fontSize: 14
fontSize: 14,
}
);
@@ -26,7 +26,7 @@ const style = computed(() => {
return {};
}
return {
fontSize: props.fontSize + "px"
fontSize: props.fontSize + "px",
};
});