diff --git a/src/store/modules/workOrder.ts b/src/store/modules/workOrder.ts index d41c1a1..07b58ef 100644 --- a/src/store/modules/workOrder.ts +++ b/src/store/modules/workOrder.ts @@ -45,10 +45,11 @@ export const useWorkOrderStore = defineStore({ }, async fetchOrderList(pagination, keyword) { const res = await getPackageList(pagination, keyword) - + if (res.data.length > 0) { - this.setOrderList(res.data) - this.setActive(0) + this.packageList.push(...res.data) + if (!this.activeId) + this.setActive(0) } return res diff --git a/src/views/task/aside/TaskList.vue b/src/views/task/aside/TaskList.vue index ca972d6..1a30aec 100644 --- a/src/views/task/aside/TaskList.vue +++ b/src/views/task/aside/TaskList.vue @@ -5,8 +5,6 @@ import ListItem from './ListItem.vue' import { useTaskStore } from '@/store/modules/task' import emitter from '@/utils/mitt' -defineOptions({ name: 'WorkSheetList' }) - const taskStore = useTaskStore() const data = ref([]) const activeId = ref('') diff --git a/src/views/worksheet/aside/Aside.vue b/src/views/worksheet/aside/Aside.vue index a0f4d9a..e088c6e 100644 --- a/src/views/worksheet/aside/Aside.vue +++ b/src/views/worksheet/aside/Aside.vue @@ -1,11 +1,11 @@ diff --git a/src/views/worksheet/content/Content.vue b/src/views/worksheet/content/Content.vue index 0cd3d46..54d6a47 100644 --- a/src/views/worksheet/content/Content.vue +++ b/src/views/worksheet/content/Content.vue @@ -8,6 +8,7 @@ import { useWorkOrder } from '@/store/modules/workOrder' import { clearTF, getPackageTaskList, getTaskDetailInfo, getTaskDetailPictureList, setTF } from '@/api/work/work' import { fieldMap } from '@/config/workorder' import { hideDownload } from '@/utils/image' +import { isEmpty } from '@/utils' const batch = ref(false) const selectItems = ref([]) @@ -184,6 +185,11 @@ function backHandler() { } watch(() => workStore.activeId, async (newValue, oldValue) => { + const taskId = workStore.getActiveId + + if (isEmpty(taskId)) + return + const res = await getPackageTaskList(newValue, packagepagination) const { data } = res taskList.value = data