修复:工作人员列表切换后自动加载数据

监听工作人员类型变化,切换安装、配送和运维菜单时自动重置搜索及页码并重新查询;补充资源、搜索和人员关联回归检查,同时更新中文需求说明与操作日志。
This commit is contained in:
czl231
2026-08-11 22:38:20 +08:00
parent 95d0f7dc54
commit a37b147f5f
7 changed files with 74 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
<!--
功能展示标准资源列表并将新建详情和编辑入口导航到独立页面
版本v2.2.0
版本v2.2.1
-->
<template>
<a-card :title="listTitle" :bordered="false">
@@ -470,8 +470,9 @@ onMounted(async () => {
});
onBeforeUnmount(avatarLoader.reset);
watch(
() => props.definition.resource,
[() => props.definition.resource, () => staffType.value],
async () => {
// 同一工作人员资源切换角色菜单时,复位旧查询并主动加载当前角色数据。
await resetSearchState();
await Promise.all([
relations.preload(displayFields.value),

View File

@@ -1,6 +1,6 @@
/**
* 功能描述:管理标准资源列表的可搜索字段、关键字状态和 URL 查询参数。
* 版本v1.0.0
* 版本v1.0.1
*/
import { computed, reactive, type Ref } from 'vue';
import { useRoute, useRouter } from 'vue-router';
@@ -73,7 +73,7 @@ export function useResourceListSearch(
async function resetSearchState() {
page.value = 1;
filters.keyword = '';
if (route.query.keyword) await syncQuery();
if (route.query.keyword || route.query.page) await syncQuery();
}
return {