Showing
1 changed file
with
16 additions
and
8 deletions
| 1 | <script setup lang="ts"> | 1 | <script setup lang="ts"> |
| 2 | - import { Button, List, Tooltip } from 'ant-design-vue'; | 2 | + import { Button, List, Space, Tooltip } from 'ant-design-vue'; |
| 3 | import { PageWrapper } from '/@/components/Page'; | 3 | import { PageWrapper } from '/@/components/Page'; |
| 4 | import { BasicForm, useForm } from '/@/components/Form'; | 4 | import { BasicForm, useForm } from '/@/components/Form'; |
| 5 | import { PermissionEnum, formSchemas } from './config'; | 5 | import { PermissionEnum, formSchemas } from './config'; |
| @@ -19,6 +19,7 @@ | @@ -19,6 +19,7 @@ | ||
| 19 | import { RunTaskModal } from './components/RunTaskModal'; | 19 | import { RunTaskModal } from './components/RunTaskModal'; |
| 20 | import { DetailDrawer } from './components/DetailDrawer'; | 20 | import { DetailDrawer } from './components/DetailDrawer'; |
| 21 | import { useDrawer } from '/@/components/Drawer'; | 21 | import { useDrawer } from '/@/components/Drawer'; |
| 22 | + import { CardLayoutButton } from '/@/components/Widget'; | ||
| 22 | 23 | ||
| 23 | const [registerModal, { openModal }] = useModal(); | 24 | const [registerModal, { openModal }] = useModal(); |
| 24 | const [registerDrawer, { openDrawer }] = useDrawer(); | 25 | const [registerDrawer, { openDrawer }] = useDrawer(); |
| @@ -41,12 +42,14 @@ | @@ -41,12 +42,14 @@ | ||
| 41 | getDataSource(); | 42 | getDataSource(); |
| 42 | }; | 43 | }; |
| 43 | 44 | ||
| 45 | + const colNumber = ref(5); | ||
| 44 | const pagination = reactive({ | 46 | const pagination = reactive({ |
| 45 | current: 1, | 47 | current: 1, |
| 46 | - pageSize: 10, | ||
| 47 | total: 0, | 48 | total: 0, |
| 49 | + pageSize: unref(colNumber) * 2, | ||
| 48 | showQuickJumper: true, | 50 | showQuickJumper: true, |
| 49 | size: 'small', | 51 | size: 'small', |
| 52 | + showSizeChanger: false, | ||
| 50 | showTotal: (total: number) => `共 ${total} 条数据`, | 53 | showTotal: (total: number) => `共 ${total} 条数据`, |
| 51 | onChange: paginationChange, | 54 | onChange: paginationChange, |
| 52 | onShowSizeChange: paginationChange, | 55 | onShowSizeChange: paginationChange, |
| @@ -58,13 +61,15 @@ | @@ -58,13 +61,15 @@ | ||
| 58 | try { | 61 | try { |
| 59 | loading.value = true; | 62 | loading.value = true; |
| 60 | const params = getFieldsValue(); | 63 | const params = getFieldsValue(); |
| 64 | + const pageSize = unref(colNumber) * 2; | ||
| 61 | const { items, total } = await getTaskCenterList({ | 65 | const { items, total } = await getTaskCenterList({ |
| 62 | page: pagination.current, | 66 | page: pagination.current, |
| 63 | - pageSize: pagination.pageSize, | 67 | + pageSize, |
| 64 | ...params, | 68 | ...params, |
| 65 | }); | 69 | }); |
| 66 | dataSource.value = items; | 70 | dataSource.value = items; |
| 67 | pagination.total = total; | 71 | pagination.total = total; |
| 72 | + pagination.pageSize = pageSize; | ||
| 68 | } catch (error) { | 73 | } catch (error) { |
| 69 | throw error; | 74 | throw error; |
| 70 | } finally { | 75 | } finally { |
| @@ -148,11 +153,14 @@ | @@ -148,11 +153,14 @@ | ||
| 148 | <div> | 153 | <div> |
| 149 | <span class="text-lg font-medium">任务列表</span> | 154 | <span class="text-lg font-medium">任务列表</span> |
| 150 | </div> | 155 | </div> |
| 151 | - <Tooltip v-if="dataSource.length" title="刷新"> | ||
| 152 | - <Button type="primary" @click="getDataSource"> | ||
| 153 | - <ReloadOutlined :spin="loading" /> | ||
| 154 | - </Button> | ||
| 155 | - </Tooltip> | 156 | + <Space> |
| 157 | + <CardLayoutButton v-model:value="colNumber" @change="reload" /> | ||
| 158 | + <Tooltip v-if="dataSource.length" title="刷新"> | ||
| 159 | + <Button type="primary" @click="getDataSource"> | ||
| 160 | + <ReloadOutlined :spin="loading" /> | ||
| 161 | + </Button> | ||
| 162 | + </Tooltip> | ||
| 163 | + </Space> | ||
| 156 | </section> | 164 | </section> |
| 157 | </template> | 165 | </template> |
| 158 | <template #renderItem="{ item }"> | 166 | <template #renderItem="{ item }"> |