fix: code style

This commit is contained in:
dylanmay
2025-11-06 23:24:05 +08:00
parent 007bb2dd26
commit 33c6ccf654

View File

@@ -54,19 +54,19 @@ const messageBoxVisible = ref(false);
const messageBoxUserId = ref(0); const messageBoxUserId = ref(0);
/** 侦听accountId */ /** 侦听accountId */
const onAccountChanged = (id: number) => { function onAccountChanged(id: number) {
queryParams.accountId = id; queryParams.accountId = id;
queryParams.pageNo = 1; queryParams.pageNo = 1;
handleQuery(); handleQuery();
}; }
/** 查询列表 */ /** 查询列表 */
const handleQuery = () => { function handleQuery() {
queryParams.pageNo = 1; queryParams.pageNo = 1;
getList(); getList();
}; }
const getList = async () => { async function getList() {
try { try {
loading.value = true; loading.value = true;
const data = await getMessagePage(queryParams); const data = await getMessagePage(queryParams);
@@ -75,29 +75,34 @@ const getList = async () => {
} finally { } finally {
loading.value = false; loading.value = false;
} }
}; }
/** 重置按钮操作 */ /** 重置按钮操作 */
const resetQuery = async () => { async function resetQuery() {
// 暂存 accountId并在 reset 后恢复 // 暂存 accountId并在 reset 后恢复
const accountId = queryParams.accountId; const accountId = queryParams.accountId;
queryFormRef.value?.resetFields(); queryFormRef.value?.resetFields();
queryParams.accountId = accountId; queryParams.accountId = accountId;
handleQuery(); handleQuery();
}; }
/** 打开消息发送窗口 */ /** 打开消息发送窗口 */
const handleSend = async (userId: number) => { async function handleSend(userId: number) {
messageBoxUserId.value = userId; messageBoxUserId.value = userId;
messageBoxVisible.value = true; messageBoxVisible.value = true;
}; }
/** 分页改变事件 */ /** 分页改变事件 */
const handlePageChange = (page: number, pageSize: number) => { function handlePageChange(page: number, pageSize: number) {
queryParams.pageNo = page; queryParams.pageNo = page;
queryParams.pageSize = pageSize; queryParams.pageSize = pageSize;
getList(); getList();
}; }
/** 显示总条数 */
function showTotal(total: number) {
return `${total}`;
}
</script> </script>
<template> <template>
@@ -170,7 +175,7 @@ const handlePageChange = (page: number, pageSize: number) => {
:total="total" :total="total"
show-size-changer show-size-changer
show-quick-jumper show-quick-jumper
:show-total="(total: number) => `${total}`" :show-total="showTotal"
@change="handlePageChange" @change="handlePageChange"
/> />
</div> </div>