顶部列表联动中间表格刷新
This commit is contained in:
@ -21,7 +21,7 @@ import { useUserStore } from '@/store/modules/user';
|
||||
|
||||
const userStore = useUserStore();
|
||||
const projects = computed(() => [
|
||||
{ id: '', name: '全部工程项目' }, // 添加空选项
|
||||
// { id: '', name: '全部工程项目' }, // 添加空选项
|
||||
...userStore.projects
|
||||
]);
|
||||
|
||||
@ -37,17 +37,11 @@ watch(
|
||||
);
|
||||
|
||||
const handleSelect = (projectId: string) => {
|
||||
const oldId = userStore.getSelectedProjectFromStorage()
|
||||
console.log(projectId,oldId.id);
|
||||
|
||||
if (projectId!=oldId.id) {
|
||||
location.reload()
|
||||
}
|
||||
const selectedProject = projects.value.find((p) => p.id === projectId);
|
||||
if (selectedProject) {
|
||||
userStore.setSelectedProject(selectedProject);
|
||||
location.reload()
|
||||
}
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
|
@ -136,7 +136,6 @@ export const useUserStore = defineStore('user', () => {
|
||||
setAvatar,
|
||||
setProjects,
|
||||
setSelectedProject,
|
||||
getSelectedProjectFromStorage,
|
||||
projects,
|
||||
selectedProject
|
||||
};
|
||||
|
@ -172,6 +172,7 @@ const { queryParams, form, rules } = toRefs(data);
|
||||
/** 查询分包单位列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
|
||||
const res = await listContractor(queryParams.value);
|
||||
contractorList.value = res.rows;
|
||||
total.value = res.total;
|
||||
|
Reference in New Issue
Block a user