New file |
| | |
| | | <template> |
| | | <LoadingLayout> |
| | | <ContentView> |
| | | <ChunkTitle :title="title" /> |
| | | </ContentView> |
| | | <ProTabs |
| | | v-model="queryState.type" |
| | | name="taskUserSubmitCheckHistories-tab" |
| | | :showPaneContent="false" |
| | | class="taskUserSubmitCheckHistories-tabs" |
| | | isTransparent |
| | | title-gutter="8" |
| | | title-scroll |
| | | > |
| | | <ProTabPane :title="`全部`" :pane-key="0"></ProTabPane> |
| | | <ProTabPane |
| | | :title="EnumTaskUserSubmitCheckHistoryTypeText[EnumTaskUserSubmitCheckHistoryType.CheckIn]" |
| | | :pane-key="EnumTaskUserSubmitCheckHistoryType.CheckIn" |
| | | ></ProTabPane> |
| | | <ProTabPane |
| | | :title="EnumTaskUserSubmitCheckHistoryTypeText[EnumTaskUserSubmitCheckHistoryType.CheckOut]" |
| | | :pane-key="EnumTaskUserSubmitCheckHistoryType.CheckOut" |
| | | ></ProTabPane> |
| | | <ProTabPane |
| | | :title=" |
| | | EnumTaskUserSubmitCheckHistoryTypeText[EnumTaskUserSubmitCheckHistoryType.UnCheckIn] |
| | | " |
| | | :pane-key="EnumTaskUserSubmitCheckHistoryType.UnCheckIn" |
| | | ></ProTabPane> |
| | | <ProTabPane |
| | | :title=" |
| | | EnumTaskUserSubmitCheckHistoryTypeText[EnumTaskUserSubmitCheckHistoryType.UnCheckOut] |
| | | " |
| | | :pane-key="EnumTaskUserSubmitCheckHistoryType.UnCheckOut" |
| | | ></ProTabPane> |
| | | </ProTabs> |
| | | <InfiniteLoading |
| | | scrollViewClassName="common-infinite-scroll-list" |
| | | v-bind="infiniteLoadingProps" |
| | | > |
| | | <template #renderItem="{ item }"> |
| | | <TaskCheckHistoryCard |
| | | :avatar="setOSSLink(item.avatar)" |
| | | :name="item.name" |
| | | :gender="item.gender" |
| | | :isReal="item.isReal" |
| | | :contactPhoneNumber="item.contactPhoneNumber" |
| | | :type="item.type" |
| | | :checkTime="item.checkTime" |
| | | /> |
| | | </template> |
| | | </InfiniteLoading> |
| | | </LoadingLayout> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import Taro from '@tarojs/taro'; |
| | | import * as taskCheckReceiveServices from '@12333/services/apiV2/taskCheckReceive'; |
| | | import { useInfiniteLoading } from '@12333/hooks'; |
| | | import TaskCheckHistoryCard from '../components/TaskCheckHistoryCard.vue'; |
| | | import { ProTabs, ProTabPane } from '@12333/components'; |
| | | import { |
| | | EnumTaskUserSubmitCheckHistoryTypeText, |
| | | EnumTaskUserSubmitCheckHistoryTypeColor, |
| | | EnumTaskUserSubmitCheckHistoryType, |
| | | WeekCN, |
| | | } from '@12333/constants'; |
| | | import { Message, setOSSLink } from '@12333/utils'; |
| | | import dayjs from 'dayjs'; |
| | | |
| | | defineOptions({ |
| | | name: 'InnerPage', |
| | | }); |
| | | |
| | | const router = Taro.useRouter(); |
| | | const id = router.params?.id ?? ''; |
| | | const date = router.params?.date ?? ''; |
| | | |
| | | const title = `${dayjs(date).format('YYYY年MM月DD日')} 星期${WeekCN[dayjs(date).day()]}`; |
| | | |
| | | const queryState = reactive({ |
| | | type: 0 as any as EnumTaskUserSubmitCheckHistoryType, |
| | | }); |
| | | |
| | | const { infiniteLoadingProps } = useInfiniteLoading( |
| | | async ({ pageParam }) => { |
| | | let params: API.GetCheckReceiveTaskUserSubmitCheckHistoriesQuery = { |
| | | pageModel: { |
| | | rows: 20, |
| | | page: pageParam, |
| | | }, |
| | | taskInfoId: id, |
| | | date: dayjs(date).format('YYYY-MM-DD'), |
| | | type: queryState.type, |
| | | }; |
| | | |
| | | let res = await taskCheckReceiveServices.getCheckReceiveTaskUserSubmitCheckHistories(params, { |
| | | showLoading: false, |
| | | }); |
| | | return res; |
| | | }, |
| | | { |
| | | queryKey: ['taskCheckReceiveServices/getCheckReceiveTaskUserSubmitCheckHistories', queryState], |
| | | } |
| | | ); |
| | | </script> |