wupengfei
10 小时以前 f94468cc4f52ca3a68817592e4ff92f815c835c7
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
<template>
  <InfiniteLoading
    scrollViewClassName="common-page-infinite-scroll-list"
    v-bind="infiniteLoadingProps"
  >
    <template #renderItem="{ item }">
      <ChooseServerCard
        :avatar="item.avatar"
        :name="item.name"
        :gender="item.gender"
        :age="item.age"
        :isReal="item.isReal"
        :personalIdentityContent="item.personalIdentityContent"
        :educationalBackgroundContent="item.educationalBackgroundContent"
        :taskCount="item.taskCount"
        :workExperience="item.workExperience"
      >
        <template #actions>
          <nut-button type="primary" plain>查看详情</nut-button>
          <nut-button type="primary" @click="handleChoose(item)">选择</nut-button>
        </template>
      </ChooseServerCard>
    </template>
  </InfiniteLoading>
</template>
 
<script setup lang="ts">
import Taro from '@tarojs/taro';
import * as standardServiceServices from '@12333/services/apiV2/standardService';
import { useInfiniteLoading } from '@12333/hooks';
import { EnumPagedListOrder } from '@12333/constants';
import { useEvent, useEventChannel } from 'senin-mini/hooks';
import { SelectEnterpriseEmployeeEvent } from '../utils';
 
defineOptions({
  name: 'InnerPage',
});
 
const route = Taro.useRouter();
const id = route.params?.id ?? '';
 
const eventChannel = useEventChannel();
 
const { infiniteLoadingProps } = useInfiniteLoading(
  ({ pageParam }) => {
    let params: API.GetStandardServiceServersQuery = {
      pageModel: {
        rows: 20,
        page: pageParam,
        // orderInput: [{ property: 'id', order: EnumPagedListOrder.Desc }],
      },
      supplierEnterpriseId: id,
    };
 
    return standardServiceServices.getStandardServiceServers(params, {
      showLoading: false,
    });
  },
  {
    queryKey: ['standardServiceServices/getStandardServiceServers', id],
  }
);
 
function handleChoose(item: API.GetStandardServiceServersQueryResultItem) {
  eventChannel.emit('onSelectEnterpriseEmployee', {
    enterpriseEmployeeId: item.id,
    supplierEnterpriseId: id,
    enterpriseEmployeeName: item.name,
  } as SelectEnterpriseEmployeeEvent);
  Taro.navigateBack({ delta: 2 });
}
</script>