|
|
@@ -1,12 +1,115 @@
|
|
|
<template>
|
|
|
- <div class="container"> dddd </div>
|
|
|
+ <div class="container">
|
|
|
+ <a-card class="general-card" title="">
|
|
|
+ <a-table
|
|
|
+ :loading="loading"
|
|
|
+ :pagination="pagination"
|
|
|
+ :columns="(cloneColumns as TableColumnData[])"
|
|
|
+ :data="renderData"
|
|
|
+ :bordered="false"
|
|
|
+ :size="size"
|
|
|
+ >
|
|
|
+ <template #index="{ rowIndex }">
|
|
|
+ {{
|
|
|
+ rowIndex + 1 + (pagination.pageIndex - 1) * pagination.personNumber
|
|
|
+ }}
|
|
|
+ </template>
|
|
|
+ <template #picture="{ record }">
|
|
|
+ <a-image width="200" :src="record.picture" />
|
|
|
+ </template>
|
|
|
+ </a-table>
|
|
|
+ </a-card>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
-<script lang="ts" name="FaceList" setup></script>
|
|
|
+<script lang="ts" name="FaceListPage" setup>
|
|
|
+ import { computed, ref, reactive, watch, nextTick } from 'vue';
|
|
|
+ import type { TableColumnData } from '@arco-design/web-vue/es/table/interface';
|
|
|
+ import { useI18n } from 'vue-i18n';
|
|
|
+ import useLoading from '@/hooks/loading';
|
|
|
+ import { Pagination } from '@/types/global';
|
|
|
+ import type { RecordParams } from '@/api/record';
|
|
|
+ import { queryFaceList } from '@/api/face';
|
|
|
+ import type { DataList } from '@/api/face';
|
|
|
+
|
|
|
+ type SizeProps = 'mini' | 'small' | 'medium' | 'large';
|
|
|
+ type Column = TableColumnData & { checked?: true };
|
|
|
+
|
|
|
+ const { loading, setLoading } = useLoading(true);
|
|
|
+ const { t } = useI18n();
|
|
|
+ const renderData = ref<DataList[]>([] as DataList[]);
|
|
|
+ const cloneColumns = ref<Column[]>([
|
|
|
+ {
|
|
|
+ title: t('faceList.columns.index'),
|
|
|
+ dataIndex: 'index',
|
|
|
+ ellipsis: true,
|
|
|
+ tooltip: true,
|
|
|
+ width: 60,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: t('faceList.columns.picture'),
|
|
|
+ dataIndex: 'picture',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: t('faceList.columns.name'),
|
|
|
+ dataIndex: 'name',
|
|
|
+ ellipsis: true,
|
|
|
+ tooltip: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: t('faceList.columns.nameCh'),
|
|
|
+ dataIndex: 'nameCh',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: t('faceList.columns.company'),
|
|
|
+ dataIndex: 'company',
|
|
|
+ ellipsis: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: t('faceList.columns.Position'),
|
|
|
+ dataIndex: 'Position',
|
|
|
+ ellipsis: true,
|
|
|
+ tooltip: { position: 'left' },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: t('faceList.columns.company'),
|
|
|
+ dataIndex: 'company',
|
|
|
+ ellipsis: true,
|
|
|
+ },
|
|
|
+ ]);
|
|
|
+
|
|
|
+ const size = ref<SizeProps>('medium');
|
|
|
+
|
|
|
+ const basePagination: Pagination = {
|
|
|
+ pageIndex: 1,
|
|
|
+ personNumber: 20,
|
|
|
+ };
|
|
|
+ const pagination = reactive({
|
|
|
+ ...basePagination,
|
|
|
+ });
|
|
|
+ const fetchData = async (
|
|
|
+ params: RecordParams = { pageIndex: 1, personNumber: 20 }
|
|
|
+ ) => {
|
|
|
+ setLoading(true);
|
|
|
+ try {
|
|
|
+ queryFaceList(params).then((res) => {
|
|
|
+ console.log('res', res);
|
|
|
+ renderData.value = res.data;
|
|
|
+ pagination.pageIndex = params.pageIndex;
|
|
|
+ pagination.personNumber = res.total;
|
|
|
+ });
|
|
|
+ } catch (err) {
|
|
|
+ // you can report use errorHandler or other
|
|
|
+ } finally {
|
|
|
+ setLoading(false);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ fetchData();
|
|
|
+</script>
|
|
|
|
|
|
<style scoped lang="less">
|
|
|
.container {
|
|
|
- padding: 0 10px 20px;
|
|
|
+ padding: 10px;
|
|
|
|
|
|
:deep(.arco-list-content) {
|
|
|
overflow-x: hidden;
|
|
|
@@ -15,5 +118,9 @@
|
|
|
:deep(.arco-card-meta-title) {
|
|
|
font-size: 14px;
|
|
|
}
|
|
|
+
|
|
|
+ .general-card {
|
|
|
+ padding-top: 10px;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|