顶部项目列表联动中间表格刷新
This commit is contained in:
@ -103,6 +103,7 @@
|
||||
import { addContractor, delContractor, getContractor, listContractor, updateContractor } from '@/api/project/contractor';
|
||||
import { ContractorForm, ContractorQuery, ContractorVO } from '@/api/project/contractor/types';
|
||||
import ContractorFileDialog from '@/views/project/contractor/component/ContractorFileDialog.vue';
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
|
||||
@ -117,7 +118,20 @@ const total = ref(0);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const contractorFormRef = ref<ElFormInstance>();
|
||||
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
//监听项目改变
|
||||
// watch(
|
||||
// () => currentProject.value,
|
||||
// (newId, oldId) => {
|
||||
// /* ... */
|
||||
// queryParams.value.projectId=newId.id
|
||||
// // getList()
|
||||
|
||||
// }
|
||||
// )
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
@ -145,6 +159,7 @@ const data = reactive<PageData<ContractorForm, ContractorQuery>>({
|
||||
principalPhone: undefined,
|
||||
custodian: undefined,
|
||||
custodianPhone: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
|
Reference in New Issue
Block a user