| | |
| | | :pagination="paginationProp" |
| | | > |
| | | <template #header> |
| | | <div class="flex justify-end space-x-2" |
| | | ><slot name="header"></slot> |
| | | <div class="flex justify-end space-x-2"> |
| | | <slot name="header"> </slot> |
| | | <Tooltip> |
| | | <template #title> |
| | | <div class="w-50">每行显示数量</div |
| | | ><Slider |
| | | <div class="w-50">每行显示数量</div> |
| | | <Slider |
| | | id="slider" |
| | | v-bind="sliderProp" |
| | | v-model:value="grid" |
| | | @change="sliderChange" |
| | | /></template> |
| | | <Button><TableOutlined /></Button> |
| | | /> |
| | | </template> |
| | | <a-button><TableOutlined /></a-button> |
| | | </Tooltip> |
| | | <Tooltip @click="fetch"> |
| | | <template #title>刷新</template> |
| | | <Button><RedoOutlined /></Button> |
| | | <a-button><RedoOutlined /></a-button> |
| | | </Tooltip> |
| | | </div> |
| | | </template> |
| | |
| | | </div> |
| | | </template> |
| | | <template #actions> |
| | | <!-- <SettingOutlined key="setting" />--> |
| | | <EditOutlined key="edit" /> |
| | | <EditOutlined /> |
| | | <Dropdown |
| | | :trigger="['hover']" |
| | | :dropMenuList="[ |
| | |
| | | text: '删除', |
| | | event: '1', |
| | | popConfirm: { |
| | | title: '是否确认删除?', |
| | | placement: 'left', |
| | | title: '是否确认删除', |
| | | confirm: handleDelete.bind(null, item.id), |
| | | }, |
| | | }, |
| | | ]" |
| | | popconfirm |
| | | > |
| | | <EllipsisOutlined key="ellipsis" /> |
| | | <EllipsisOutlined /> |
| | | </Dropdown> |
| | | </template> |
| | | |
| | | <CardMeta> |
| | | <template #title> |
| | | <TypographyText :content="item.name" :ellipsis="{ tooltip: item.address }" /> |
| | | <TypographyParagraph :content="item.name" :ellipsis="{ tooltip: item.address }" /> |
| | | </template> |
| | | <template #avatar> |
| | | <Avatar :src="item.avatar" /> |
| | |
| | | TableOutlined, |
| | | } from '@ant-design/icons-vue'; |
| | | import { List, Card, Image, Typography, Tooltip, Slider, Avatar } from 'ant-design-vue'; |
| | | import { Dropdown } from '/@/components/Dropdown'; |
| | | import { BasicForm, useForm } from '/@/components/Form'; |
| | | import { propTypes } from '/@/utils/propTypes'; |
| | | import { Button } from '/@/components/Button'; |
| | | import { isFunction } from '/@/utils/is'; |
| | | import { Dropdown } from '@/components/Dropdown'; |
| | | import { BasicForm, useForm } from '@/components/Form'; |
| | | import { propTypes } from '@/utils/propTypes'; |
| | | import { isFunction } from '@/utils/is'; |
| | | import { useSlider, grid } from './data'; |
| | | |
| | | const ListItem = List.Item; |
| | | const CardMeta = Card.Meta; |
| | | const TypographyText = Typography.Text; |
| | | const TypographyParagraph = Typography.Paragraph; |
| | | // 获取slider属性 |
| | | const sliderProp = computed(() => useSlider(4)); |
| | | // 组件接收参数 |
| | |
| | | pageSize, |
| | | current: page, |
| | | total, |
| | | showTotal: (total) => `总 ${total} 条`, |
| | | showTotal: (total: number) => `总 ${total} 条`, |
| | | onChange: pageChange, |
| | | onShowSizeChange: pageSizeChange, |
| | | }); |
| | | |
| | | function pageChange(p, pz) { |
| | | function pageChange(p: number, pz: number) { |
| | | page.value = p; |
| | | pageSize.value = pz; |
| | | fetch(); |
| | | } |
| | | function pageSizeChange(_current, size) { |
| | | function pageSizeChange(_current, size: number) { |
| | | pageSize.value = size; |
| | | fetch(); |
| | | } |
| | | |
| | | async function handleDelete(id) { |
| | | async function handleDelete(id: number) { |
| | | emit('delete', id); |
| | | } |
| | | </script> |