wupengfei
2025-03-11 286f1b727856d6b32a8d237f353ae008f3076deb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<template>
  <div class="searchbar-container">
    <BlSearchbar
      v-model.trim="searchValue"
      placeholder="搜索合同名/编号"
      @search="handleSearch"
      @change="handleSearch"
    ></BlSearchbar>
    <ChunkTitle title="合同列表" />
  </div>
 
  <InfiniteLoading
    scrollViewClassName="common-infinite-scroll-list flexJobSign-list"
    v-bind="infiniteLoadingProps"
  >
    <template #renderItem="{ item }">
      <SignCard @click="handleCheck(item)" v-model:checked-id="checkedId" :id="item.id"></SignCard>
    </template>
  </InfiniteLoading>
 
  <PageFooter>
    <PageFooterBtn type="primary">邀请签约</PageFooterBtn>
  </PageFooter>
</template>
 
<script setup lang="ts">
import { useInfiniteLoading } from '@12333/hooks';
import { OrderInputType } from '@12333/constants';
import * as flexWorkerServices from '@12333/services/api/FlexWorker';
import _ from 'lodash';
import { trim } from '@12333/utils';
import { SignCard } from '@12333/components';
 
defineOptions({
  name: 'InnerPage',
});
 
const searchValue = ref('');
const queryState = reactive({
  searchValueTrim: '',
});
 
const checkedId = ref('');
 
const handleSearch = _.debounce(function () {
  queryState.searchValueTrim = trim(searchValue.value);
}, 300);
 
const { infiniteLoadingProps } = useInfiniteLoading(
  ({ pageParam }) => {
    let params: API.GetFlexTaskListInput = {
      pageModel: {
        rows: 20,
        page: pageParam,
        orderInput: [{ property: 'creationTime', order: OrderInputType.Desc }],
      },
    };
 
    return flexWorkerServices.getFlexTaskByArrange(params, {
      showLoading: false,
    });
  },
  {
    queryKey: ['flexWorkerServices/getFlexTaskByArrange'],
  }
);
 
function handleCheck(item: API.OrderInfoDto) {
  checkedId.value = item.id;
}
</script>
 
<style lang="scss">
@import '@/styles/common.scss';
 
.flexJobSign-page-wrapper {
  .searchbar-container {
    padding: 30px 60px;
  }
 
  .chunk-title-wrapper {
    padding: 30px 10px 0;
  }
 
  .flexJobSign-list {
    .infinite-list-inner {
      background-color: #ffffff;
      padding: 0 30px;
      border-radius: 12px;
    }
  }
}
</style>