mirror of https://github.com/halo-dev/halo-admin
refactor: attachment list layout (#580)
* refactor: attachment list layout Signed-off-by: Ryan Wang <i@ryanc.cc> * chore: revert pnpm-locl.yaml Signed-off-by: Ryan Wang <i@ryanc.cc>pull/584/head
parent
ee09e4bf12
commit
b85a89bb41
|
@ -53,6 +53,7 @@
|
||||||
"@ant-design/colors": "3.2.2",
|
"@ant-design/colors": "3.2.2",
|
||||||
"@babel/core": "^7.17.9",
|
"@babel/core": "^7.17.9",
|
||||||
"@babel/eslint-parser": "^7.17.0",
|
"@babel/eslint-parser": "^7.17.0",
|
||||||
|
"@tailwindcss/aspect-ratio": "^0.4.0",
|
||||||
"@vue/cli-plugin-babel": "~5.0.4",
|
"@vue/cli-plugin-babel": "~5.0.4",
|
||||||
"@vue/cli-plugin-eslint": "~5.0.4",
|
"@vue/cli-plugin-eslint": "~5.0.4",
|
||||||
"@vue/cli-plugin-router": "~5.0.4",
|
"@vue/cli-plugin-router": "~5.0.4",
|
||||||
|
|
|
@ -9,6 +9,7 @@ specifiers:
|
||||||
'@codemirror/lang-java': ^0.19.1
|
'@codemirror/lang-java': ^0.19.1
|
||||||
'@halo-dev/admin-api': ^1.0.0
|
'@halo-dev/admin-api': ^1.0.0
|
||||||
'@halo-dev/editor': ^3.0.4
|
'@halo-dev/editor': ^3.0.4
|
||||||
|
'@tailwindcss/aspect-ratio': ^0.4.0
|
||||||
'@vue/cli-plugin-babel': ~5.0.4
|
'@vue/cli-plugin-babel': ~5.0.4
|
||||||
'@vue/cli-plugin-eslint': ~5.0.4
|
'@vue/cli-plugin-eslint': ~5.0.4
|
||||||
'@vue/cli-plugin-router': ~5.0.4
|
'@vue/cli-plugin-router': ~5.0.4
|
||||||
|
@ -85,6 +86,7 @@ devDependencies:
|
||||||
'@ant-design/colors': 3.2.2
|
'@ant-design/colors': 3.2.2
|
||||||
'@babel/core': 7.17.9
|
'@babel/core': 7.17.9
|
||||||
'@babel/eslint-parser': 7.17.0_@babel+core@7.17.9+eslint@7.32.0
|
'@babel/eslint-parser': 7.17.0_@babel+core@7.17.9+eslint@7.32.0
|
||||||
|
'@tailwindcss/aspect-ratio': 0.4.0_tailwindcss@3.0.23
|
||||||
'@vue/cli-plugin-babel': 5.0.4_1a7ab14a3c0306b5654c447f15269443
|
'@vue/cli-plugin-babel': 5.0.4_1a7ab14a3c0306b5654c447f15269443
|
||||||
'@vue/cli-plugin-eslint': 5.0.4_6084a5b0c7b00dd6f5be6d9e72604c89
|
'@vue/cli-plugin-eslint': 5.0.4_6084a5b0c7b00dd6f5be6d9e72604c89
|
||||||
'@vue/cli-plugin-router': 5.0.4_@vue+cli-service@5.0.4
|
'@vue/cli-plugin-router': 5.0.4_@vue+cli-service@5.0.4
|
||||||
|
@ -446,6 +448,8 @@ packages:
|
||||||
resolution: {integrity: sha512-vqUSBLP8dQHFPdPi9bc5GK9vRkYHJ49fsZdtoJ8EQ8ibpwk5rPKfvNIwChB0KVXcIjcepEBBd2VHC5r9Gy8ueg==}
|
resolution: {integrity: sha512-vqUSBLP8dQHFPdPi9bc5GK9vRkYHJ49fsZdtoJ8EQ8ibpwk5rPKfvNIwChB0KVXcIjcepEBBd2VHC5r9Gy8ueg==}
|
||||||
engines: {node: '>=6.0.0'}
|
engines: {node: '>=6.0.0'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
dependencies:
|
||||||
|
'@babel/types': 7.17.0
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/7.16.7_@babel+core@7.17.9:
|
/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/7.16.7_@babel+core@7.17.9:
|
||||||
|
@ -1824,6 +1828,14 @@ packages:
|
||||||
meaw: 5.0.0
|
meaw: 5.0.0
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
|
/@tailwindcss/aspect-ratio/0.4.0_tailwindcss@3.0.23:
|
||||||
|
resolution: {integrity: sha512-WJu0I4PpqNPuutpaA9zDUq2JXR+lorZ7PbLcKNLmb6GL9/HLfC7w3CRsMhJF4BbYd/lkY6CfXOvkYpuGnZfkpQ==}
|
||||||
|
peerDependencies:
|
||||||
|
tailwindcss: '>=2.0.0 || >=3.0.0 || >=3.0.0-alpha.1'
|
||||||
|
dependencies:
|
||||||
|
tailwindcss: 3.0.23
|
||||||
|
dev: true
|
||||||
|
|
||||||
/@trysound/sax/0.2.0:
|
/@trysound/sax/0.2.0:
|
||||||
resolution: {integrity: sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==}
|
resolution: {integrity: sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==}
|
||||||
engines: {node: '>=10.13.0'}
|
engines: {node: '>=10.13.0'}
|
||||||
|
@ -5202,7 +5214,7 @@ packages:
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/image-size/0.5.5:
|
/image-size/0.5.5:
|
||||||
resolution: {integrity: sha1-Cd/Uq50g4p6xw+gLiZA3jfnjy5w=}
|
resolution: {integrity: sha512-6TDAlDPZxUFCv+fuOkIoXT/V/f3Qbq8e37p+YOiYrUv3v9cc3/6x78VdfPgFVaB9dZYeLUfKgHRebpkm/oP2VQ==}
|
||||||
engines: {node: '>=0.10.0'}
|
engines: {node: '>=0.10.0'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<a-modal v-model="modalVisible" :afterClose="onAfterClose" :title="title" :width="1024" destroyOnClose>
|
<a-modal v-model="modalVisible" :afterClose="onAfterClose" :title="title" :width="1280" destroyOnClose>
|
||||||
<div class="table-page-search-wrapper">
|
<div class="table-page-search-wrapper">
|
||||||
<a-form layout="inline">
|
<a-form layout="inline">
|
||||||
<a-row :gutter="24">
|
<a-row :gutter="24">
|
||||||
|
@ -48,63 +48,64 @@
|
||||||
</a-form>
|
</a-form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mb-0 table-operator">
|
<div class="table-operator mb-0">
|
||||||
<a-button icon="cloud-upload" type="primary" @click="upload.visible = true">上传</a-button>
|
<a-button icon="cloud-upload" type="primary" @click="upload.visible = true">上传</a-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<a-divider />
|
<a-divider />
|
||||||
|
|
||||||
<a-list
|
<a-spin :spinning="list.loading">
|
||||||
:dataSource="list.data"
|
<div
|
||||||
:grid="{ gutter: 6, xs: 2, sm: 2, md: 4, lg: 6, xl: 6, xxl: 6 }"
|
class="grid grid-cols-2 gap-x-2 gap-y-3 sm:grid-cols-3 md:grid-cols-6 xl:grid-cols-8 2xl:grid-cols-10"
|
||||||
:loading="list.loading"
|
role="list"
|
||||||
class="attachments-group"
|
>
|
||||||
>
|
<div
|
||||||
<template #renderItem="item, index">
|
v-for="(attachment, index) in list.data"
|
||||||
<a-list-item
|
|
||||||
@mouseenter="$set(item, 'hover', true)"
|
|
||||||
@mouseleave="$set(item, 'hover', false)"
|
|
||||||
:key="index"
|
:key="index"
|
||||||
@click="handleItemClick(item)"
|
:class="`${isItemSelect(attachment) ? 'border-blue-600' : 'border-slate-200'}`"
|
||||||
|
class="relative cursor-pointer overflow-hidden rounded-sm border-solid bg-white transition-all hover:shadow-sm"
|
||||||
|
@click="handleItemClick(attachment)"
|
||||||
|
@mouseenter="$set(attachment, 'hover', true)"
|
||||||
|
@mouseleave="$set(attachment, 'hover', false)"
|
||||||
>
|
>
|
||||||
<div :class="`${isItemSelect(item) ? 'border-blue-600' : 'border-slate-200'}`" class="border border-solid">
|
<div class="group aspect-w-10 aspect-h-7 block w-full overflow-hidden bg-white">
|
||||||
<div class="attach-thumb attachments-group-item">
|
<img
|
||||||
<span v-if="!isImage(item)" class="attachments-group-item-type">{{ item.suffix }}</span>
|
v-if="isImage(attachment)"
|
||||||
<span
|
:alt="attachment.name"
|
||||||
v-else
|
:src="attachment.thumbPath"
|
||||||
:style="{ backgroundImage: `url('${item.thumbPath}')` }"
|
class="pointer-events-none overflow-hidden object-cover transition-opacity group-hover:opacity-70"
|
||||||
class="attachments-group-item-img"
|
loading="lazy"
|
||||||
loading="lazy"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<a-card-meta class="p-2 cursor-pointer">
|
|
||||||
<template #description>
|
|
||||||
<a-tooltip :title="item.name">
|
|
||||||
<div class="truncate">{{ item.name }}</div>
|
|
||||||
</a-tooltip>
|
|
||||||
</template>
|
|
||||||
</a-card-meta>
|
|
||||||
<a-icon
|
|
||||||
v-show="isItemSelect(item) && !item.hover"
|
|
||||||
type="check-circle"
|
|
||||||
theme="twoTone"
|
|
||||||
class="absolute top-1 right-2 font-bold cursor-pointer transition-all"
|
|
||||||
:style="{ fontSize: '18px', color: 'rgb(37 99 235)' }"
|
|
||||||
/>
|
|
||||||
<a-icon
|
|
||||||
v-show="item.hover"
|
|
||||||
type="profile"
|
|
||||||
theme="twoTone"
|
|
||||||
class="absolute top-1 right-2 font-bold cursor-pointer transition-all"
|
|
||||||
@click.stop="handleOpenDetail(item)"
|
|
||||||
:style="{ fontSize: '18px' }"
|
|
||||||
/>
|
/>
|
||||||
|
<span v-else class="flex items-center justify-center text-2xl text-gray-600">
|
||||||
|
{{ attachment.suffix }}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</a-list-item>
|
<a-tooltip :title="attachment.name">
|
||||||
</template>
|
<span class="block truncate p-1.5 text-xs font-medium text-gray-500">
|
||||||
</a-list>
|
{{ attachment.name }}
|
||||||
|
</span>
|
||||||
|
</a-tooltip>
|
||||||
|
|
||||||
<div class="flex justify-between">
|
<a-icon
|
||||||
|
v-show="isItemSelect(attachment) && !attachment.hover"
|
||||||
|
:style="{ fontSize: '20px', color: 'rgb(37 99 235)' }"
|
||||||
|
class="absolute top-1 right-1 cursor-pointer font-bold transition-all"
|
||||||
|
theme="twoTone"
|
||||||
|
type="check-circle"
|
||||||
|
/>
|
||||||
|
<a-icon
|
||||||
|
v-show="attachment.hover"
|
||||||
|
:style="{ fontSize: '20px' }"
|
||||||
|
class="absolute top-1 right-1 cursor-pointer font-bold transition-all"
|
||||||
|
theme="twoTone"
|
||||||
|
type="profile"
|
||||||
|
@click.stop="handleOpenDetail(attachment)"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</a-spin>
|
||||||
|
|
||||||
|
<div class="mt-4 flex justify-between">
|
||||||
<a-popover placement="right" title="预览" trigger="click">
|
<a-popover placement="right" title="预览" trigger="click">
|
||||||
<template slot="content">
|
<template slot="content">
|
||||||
<a-tabs v-if="list.selected.length" default-active-key="markdown" tab-position="left">
|
<a-tabs v-if="list.selected.length" default-active-key="markdown" tab-position="left">
|
||||||
|
@ -122,7 +123,7 @@
|
||||||
<div v-else class="text-slate-400">未选择附件</div>
|
<div v-else class="text-slate-400">未选择附件</div>
|
||||||
</template>
|
</template>
|
||||||
<a-tooltip placement="top" title="点击预览">
|
<a-tooltip placement="top" title="点击预览">
|
||||||
<div class="self-center text-slate-400 select-none cursor-pointer hover:text-blue-400 transition-all">
|
<div class="cursor-pointer select-none self-center text-slate-400 transition-all hover:text-blue-400">
|
||||||
已选择 {{ list.selected.length }} 项
|
已选择 {{ list.selected.length }} 项
|
||||||
</div>
|
</div>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
|
@ -132,7 +133,7 @@
|
||||||
<a-pagination
|
<a-pagination
|
||||||
:current="pagination.page"
|
:current="pagination.page"
|
||||||
:defaultPageSize="pagination.size"
|
:defaultPageSize="pagination.size"
|
||||||
:pageSizeOptions="['12', '18', '24', '30', '36', '42']"
|
:pageSizeOptions="['40', '50', '100', '150', '200']"
|
||||||
:total="pagination.total"
|
:total="pagination.total"
|
||||||
class="pagination !mt-0"
|
class="pagination !mt-0"
|
||||||
showLessItems
|
showLessItems
|
||||||
|
@ -143,9 +144,9 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<template slot="footer">
|
<template #footer>
|
||||||
<a-button @click="modalVisible = false">取消</a-button>
|
<a-button @click="modalVisible = false">取消</a-button>
|
||||||
<a-button type="primary" :disabled="!list.selected.length" @click="handleConfirm">确定</a-button>
|
<a-button :disabled="!list.selected.length" type="primary" @click="handleConfirm">确定</a-button>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<AttachmentUploadModal :visible.sync="upload.visible" @close="handleSearch" />
|
<AttachmentUploadModal :visible.sync="upload.visible" @close="handleSearch" />
|
||||||
|
@ -154,7 +155,7 @@
|
||||||
<template #extraFooter>
|
<template #extraFooter>
|
||||||
<a-button :disabled="selectPreviousButtonDisabled" @click="handleSelectPrevious">上一项</a-button>
|
<a-button :disabled="selectPreviousButtonDisabled" @click="handleSelectPrevious">上一项</a-button>
|
||||||
<a-button :disabled="selectNextButtonDisabled" @click="handleSelectNext">下一项</a-button>
|
<a-button :disabled="selectNextButtonDisabled" @click="handleSelectNext">下一项</a-button>
|
||||||
<a-button @click="handleItemClick(list.current)" type="primary">
|
<a-button type="primary" @click="handleItemClick(list.current)">
|
||||||
{{ list.selected.findIndex(item => item.id === list.current.id) > -1 ? '取消选择' : '选择' }}
|
{{ list.selected.findIndex(item => item.id === list.current.id) > -1 ? '取消选择' : '选择' }}
|
||||||
</a-button>
|
</a-button>
|
||||||
</template>
|
</template>
|
||||||
|
@ -191,7 +192,7 @@ export default {
|
||||||
loading: false,
|
loading: false,
|
||||||
params: {
|
params: {
|
||||||
page: 0,
|
page: 0,
|
||||||
size: 12,
|
size: 40,
|
||||||
keyword: undefined,
|
keyword: undefined,
|
||||||
mediaType: undefined,
|
mediaType: undefined,
|
||||||
attachmentType: undefined
|
attachmentType: undefined
|
||||||
|
@ -356,7 +357,7 @@ export default {
|
||||||
handleResetParam() {
|
handleResetParam() {
|
||||||
this.list.params = {
|
this.list.params = {
|
||||||
page: 0,
|
page: 0,
|
||||||
size: 12,
|
size: 40,
|
||||||
keyword: undefined,
|
keyword: undefined,
|
||||||
mediaType: undefined,
|
mediaType: undefined,
|
||||||
attachmentType: undefined
|
attachmentType: undefined
|
||||||
|
|
|
@ -648,44 +648,6 @@ body {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.attach-item {
|
|
||||||
width: 50%;
|
|
||||||
padding-bottom: 28%;
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.attach-thumb,
|
|
||||||
.photo-thumb {
|
|
||||||
width: 100%;
|
|
||||||
padding-bottom: 56%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.attach-item,
|
|
||||||
.attach-thumb,
|
|
||||||
.photo-thumb {
|
|
||||||
margin: 0 auto;
|
|
||||||
position: relative;
|
|
||||||
overflow: hidden;
|
|
||||||
cursor: pointer;
|
|
||||||
|
|
||||||
img,
|
|
||||||
span {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
span {
|
|
||||||
display: flex;
|
|
||||||
font-size: 12px;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
color: #9b9ea0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.analysis-card-container {
|
.analysis-card-container {
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
@ -741,21 +703,6 @@ body {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.select-attachment-checkbox {
|
|
||||||
display: block;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
z-index: 10;
|
|
||||||
|
|
||||||
.ant-checkbox {
|
|
||||||
margin-left: 4px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.ant-list-item {
|
.ant-list-item {
|
||||||
.ant-list-item-main,
|
.ant-list-item-main,
|
||||||
.ant-list-item-meta-content,
|
.ant-list-item-meta-content,
|
||||||
|
@ -798,28 +745,6 @@ body {
|
||||||
top: 0;
|
top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 附件图片样式
|
|
||||||
.attachments-group,
|
|
||||||
.photos-group {
|
|
||||||
&-item {
|
|
||||||
padding: 0;
|
|
||||||
height: 130px;
|
|
||||||
|
|
||||||
&-img {
|
|
||||||
display: block;
|
|
||||||
height: 100%;
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
background-size: cover;
|
|
||||||
background-position: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.attachments-group &-type {
|
|
||||||
font-size: 38px;
|
|
||||||
text-transform: capitalize;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.ant-affix {
|
.ant-affix {
|
||||||
z-index: 1000 !important;
|
z-index: 1000 !important;
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
</a-row>
|
</a-row>
|
||||||
</a-form>
|
</a-form>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-0 table-operator">
|
<div class="table-operator mb-0">
|
||||||
<a-button icon="cloud-upload" type="primary" @click="upload.visible = true">上传</a-button>
|
<a-button icon="cloud-upload" type="primary" @click="upload.visible = true">上传</a-button>
|
||||||
<a-button v-show="list.selected.length" icon="check-circle" type="primary" @click="handleSelectAll">
|
<a-button v-show="list.selected.length" icon="check-circle" type="primary" @click="handleSelectAll">
|
||||||
全选
|
全选
|
||||||
|
@ -63,67 +63,65 @@
|
||||||
</a-card>
|
</a-card>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-list
|
<a-spin :spinning="list.loading">
|
||||||
:dataSource="list.data"
|
<div
|
||||||
:grid="{ gutter: 6, xs: 2, sm: 2, md: 4, lg: 6, xl: 6, xxl: 6 }"
|
class="grid grid-cols-2 gap-x-2 gap-y-3 sm:grid-cols-3 md:grid-cols-6 xl:grid-cols-8 2xl:grid-cols-10"
|
||||||
:loading="list.loading"
|
role="list"
|
||||||
class="attachments-group"
|
>
|
||||||
>
|
<div
|
||||||
<template #renderItem="item, index">
|
v-for="(attachment, index) in list.data"
|
||||||
<a-list-item
|
|
||||||
:key="index"
|
:key="index"
|
||||||
@click="handleItemClick(item)"
|
:class="`${isItemSelect(attachment) ? 'border-blue-600' : 'border-white'}`"
|
||||||
@mouseenter="$set(item, 'hover', true)"
|
class="relative cursor-pointer overflow-hidden rounded-sm border-solid bg-white transition-all hover:shadow-sm"
|
||||||
@mouseleave="$set(item, 'hover', false)"
|
@click="handleItemClick(attachment)"
|
||||||
@contextmenu.prevent="handleContextMenu($event, item)"
|
@mouseenter="$set(attachment, 'hover', true)"
|
||||||
|
@mouseleave="$set(attachment, 'hover', false)"
|
||||||
|
@contextmenu.prevent="handleContextMenu($event, attachment)"
|
||||||
>
|
>
|
||||||
<div
|
<div class="group aspect-w-10 aspect-h-7 block w-full overflow-hidden bg-white">
|
||||||
:class="`${isItemSelect(item) ? 'border-blue-600' : 'border-slate-200'}`"
|
<img
|
||||||
class="border border-solid"
|
v-if="isImage(attachment)"
|
||||||
>
|
:alt="attachment.name"
|
||||||
<div class="attach-thumb attachments-group-item">
|
:src="attachment.thumbPath"
|
||||||
<span v-if="!isImage(item)" class="attachments-group-item-type">{{ item.suffix }}</span>
|
class="pointer-events-none overflow-hidden object-cover transition-opacity group-hover:opacity-70"
|
||||||
<span
|
loading="lazy"
|
||||||
v-else
|
|
||||||
:style="{ backgroundImage: `url('${item.thumbPath}')` }"
|
|
||||||
class="attachments-group-item-img"
|
|
||||||
loading="lazy"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<a-card-meta class="p-2 cursor-pointer">
|
|
||||||
<template #description>
|
|
||||||
<a-tooltip :title="item.name">
|
|
||||||
<div class="truncate">{{ item.name }}</div>
|
|
||||||
</a-tooltip>
|
|
||||||
</template>
|
|
||||||
</a-card-meta>
|
|
||||||
<a-icon
|
|
||||||
v-show="!isItemSelect(item) && item.hover"
|
|
||||||
:style="{ fontSize: '18px', color: 'rgb(37 99 235)' }"
|
|
||||||
class="absolute top-1 right-2 font-bold cursor-pointer transition-all"
|
|
||||||
theme="twoTone"
|
|
||||||
type="plus-circle"
|
|
||||||
@click.stop="handleSelect(item)"
|
|
||||||
/>
|
|
||||||
<a-icon
|
|
||||||
v-show="isItemSelect(item)"
|
|
||||||
:style="{ fontSize: '18px', color: 'rgb(37 99 235)' }"
|
|
||||||
class="absolute top-1 right-2 font-bold cursor-pointer transition-all"
|
|
||||||
theme="twoTone"
|
|
||||||
type="check-circle"
|
|
||||||
/>
|
|
||||||
<a-icon
|
|
||||||
v-show="item.hover && list.selected.length > 0"
|
|
||||||
:style="{ fontSize: '18px' }"
|
|
||||||
class="absolute top-1 left-2 font-bold cursor-pointer transition-all"
|
|
||||||
theme="twoTone"
|
|
||||||
type="profile"
|
|
||||||
@click.stop="handleOpenDetail(item)"
|
|
||||||
/>
|
/>
|
||||||
|
<span v-else class="flex items-center justify-center text-2xl text-gray-600">
|
||||||
|
{{ attachment.suffix }}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</a-list-item>
|
<a-tooltip :title="attachment.name">
|
||||||
</template>
|
<span class="block truncate p-1.5 text-xs font-medium text-gray-500">
|
||||||
</a-list>
|
{{ attachment.name }}
|
||||||
|
</span>
|
||||||
|
</a-tooltip>
|
||||||
|
|
||||||
|
<a-icon
|
||||||
|
v-show="!isItemSelect(attachment) && attachment.hover"
|
||||||
|
:style="{ fontSize: '20px', color: 'rgb(37 99 235)' }"
|
||||||
|
class="absolute top-1 right-1 cursor-pointer font-bold transition-all"
|
||||||
|
theme="twoTone"
|
||||||
|
type="plus-circle"
|
||||||
|
@click.stop="handleSelect(attachment)"
|
||||||
|
/>
|
||||||
|
<a-icon
|
||||||
|
v-show="isItemSelect(attachment)"
|
||||||
|
:style="{ fontSize: '20px', color: 'rgb(37 99 235)' }"
|
||||||
|
class="absolute top-1 right-1 cursor-pointer font-bold transition-all"
|
||||||
|
theme="twoTone"
|
||||||
|
type="check-circle"
|
||||||
|
/>
|
||||||
|
<a-icon
|
||||||
|
v-show="attachment.hover && list.selected.length > 0"
|
||||||
|
:style="{ fontSize: '20px' }"
|
||||||
|
class="absolute top-1 left-1 cursor-pointer font-bold transition-all"
|
||||||
|
theme="twoTone"
|
||||||
|
type="profile"
|
||||||
|
@click.stop="handleOpenDetail(attachment)"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</a-spin>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
|
|
||||||
|
@ -131,7 +129,7 @@
|
||||||
<a-pagination
|
<a-pagination
|
||||||
:current="pagination.page"
|
:current="pagination.page"
|
||||||
:defaultPageSize="pagination.size"
|
:defaultPageSize="pagination.size"
|
||||||
:pageSizeOptions="['18', '36', '54', '72', '90', '108']"
|
:pageSizeOptions="['50', '100', '150', '200']"
|
||||||
:total="pagination.total"
|
:total="pagination.total"
|
||||||
class="pagination"
|
class="pagination"
|
||||||
showLessItems
|
showLessItems
|
||||||
|
@ -183,7 +181,7 @@ export default {
|
||||||
hasPrevious: false,
|
hasPrevious: false,
|
||||||
params: {
|
params: {
|
||||||
page: 0,
|
page: 0,
|
||||||
size: 18,
|
size: 50,
|
||||||
keyword: undefined,
|
keyword: undefined,
|
||||||
mediaType: undefined,
|
mediaType: undefined,
|
||||||
attachmentType: undefined
|
attachmentType: undefined
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
</a-row>
|
</a-row>
|
||||||
</a-form>
|
</a-form>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-0 table-operator">
|
<div class="table-operator mb-0">
|
||||||
<a-dropdown>
|
<a-dropdown>
|
||||||
<template #overlay>
|
<template #overlay>
|
||||||
<a-menu>
|
<a-menu>
|
||||||
|
@ -58,60 +58,55 @@
|
||||||
</a-card>
|
</a-card>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-list
|
<a-spin :spinning="list.loading">
|
||||||
:dataSource="list.data"
|
<div
|
||||||
:grid="{ gutter: 6, xs: 2, sm: 2, md: 4, lg: 6, xl: 6, xxl: 6 }"
|
class="grid grid-cols-2 gap-x-2 gap-y-3 sm:grid-cols-3 md:grid-cols-6 xl:grid-cols-8 2xl:grid-cols-10"
|
||||||
:loading="list.loading"
|
role="list"
|
||||||
class="photos-group"
|
>
|
||||||
>
|
<div
|
||||||
<template #renderItem="item, index">
|
v-for="(photo, index) in list.data"
|
||||||
<a-list-item
|
|
||||||
:key="index"
|
:key="index"
|
||||||
@click="handleItemClick(item)"
|
:class="`${isItemSelect(photo) ? 'border-blue-600' : 'border-white'}`"
|
||||||
@mouseenter="$set(item, 'hover', true)"
|
class="relative cursor-pointer overflow-hidden rounded-sm border-solid bg-white transition-all hover:shadow-sm"
|
||||||
@mouseleave="$set(item, 'hover', false)"
|
@click="handleItemClick(photo)"
|
||||||
|
@mouseenter="$set(photo, 'hover', true)"
|
||||||
|
@mouseleave="$set(photo, 'hover', false)"
|
||||||
>
|
>
|
||||||
<div
|
<div class="group aspect-w-10 aspect-h-7 block w-full overflow-hidden bg-white">
|
||||||
:class="`${isItemSelect(item) ? 'border-blue-600' : 'border-slate-200'}`"
|
<img
|
||||||
class="border border-solid"
|
:alt="photo.name"
|
||||||
>
|
:src="photo.thumbnail"
|
||||||
<div class="photo-thumb photos-group-item">
|
class="pointer-events-none overflow-hidden object-cover transition-opacity group-hover:opacity-70"
|
||||||
<span
|
loading="lazy"
|
||||||
:style="{ backgroundImage: `url('${item.thumbnail}')` }"
|
|
||||||
class="photos-group-item-img"
|
|
||||||
loading="lazy"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<a-card-meta class="p-2 cursor-pointer">
|
|
||||||
<template #description>
|
|
||||||
<a-tooltip :title="item.name">
|
|
||||||
<div class="truncate">
|
|
||||||
<span class="mr-1">{{ item.name }}</span>
|
|
||||||
<span v-if="item.team" class="text-gray-500 text-xs">#{{ item.team }}</span>
|
|
||||||
</div>
|
|
||||||
</a-tooltip>
|
|
||||||
</template>
|
|
||||||
</a-card-meta>
|
|
||||||
|
|
||||||
<a-icon
|
|
||||||
v-show="!isItemSelect(item) && item.hover"
|
|
||||||
:style="{ fontSize: '18px', color: 'rgb(37 99 235)' }"
|
|
||||||
class="absolute top-1 right-2 font-bold cursor-pointer transition-all"
|
|
||||||
theme="twoTone"
|
|
||||||
type="plus-circle"
|
|
||||||
@click.stop="handleSelect(item)"
|
|
||||||
/>
|
|
||||||
<a-icon
|
|
||||||
v-show="isItemSelect(item)"
|
|
||||||
:style="{ fontSize: '18px', color: 'rgb(37 99 235)' }"
|
|
||||||
class="absolute top-1 right-2 font-bold cursor-pointer transition-all"
|
|
||||||
theme="twoTone"
|
|
||||||
type="check-circle"
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</a-list-item>
|
<a-tooltip :title="photo.name">
|
||||||
</template>
|
<div class="block truncate p-1.5 text-xs font-medium text-gray-500">
|
||||||
</a-list>
|
<span class="mr-1">
|
||||||
|
{{ photo.name }}
|
||||||
|
</span>
|
||||||
|
<span v-if="photo.team">#{{ photo.team }}</span>
|
||||||
|
</div>
|
||||||
|
</a-tooltip>
|
||||||
|
|
||||||
|
<a-icon
|
||||||
|
v-show="!isItemSelect(photo) && photo.hover"
|
||||||
|
:style="{ fontSize: '20px', color: 'rgb(37 99 235)' }"
|
||||||
|
class="absolute top-1 right-1 cursor-pointer font-bold transition-all"
|
||||||
|
theme="twoTone"
|
||||||
|
type="plus-circle"
|
||||||
|
@click.stop="handleSelect(photo)"
|
||||||
|
/>
|
||||||
|
<a-icon
|
||||||
|
v-show="isItemSelect(photo)"
|
||||||
|
:style="{ fontSize: '20px', color: 'rgb(37 99 235)' }"
|
||||||
|
class="absolute top-1 right-1 cursor-pointer font-bold transition-all"
|
||||||
|
theme="twoTone"
|
||||||
|
type="check-circle"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</a-spin>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
|
|
||||||
|
@ -119,8 +114,9 @@
|
||||||
<a-pagination
|
<a-pagination
|
||||||
:current="pagination.page"
|
:current="pagination.page"
|
||||||
:defaultPageSize="pagination.size"
|
:defaultPageSize="pagination.size"
|
||||||
:pageSizeOptions="['18', '36', '54', '72', '90', '108']"
|
:pageSizeOptions="['50', '100', '150', '200']"
|
||||||
:total="pagination.total"
|
:total="pagination.total"
|
||||||
|
class="pagination"
|
||||||
showLessItems
|
showLessItems
|
||||||
showSizeChanger
|
showSizeChanger
|
||||||
@change="handlePageChange"
|
@change="handlePageChange"
|
||||||
|
@ -203,7 +199,7 @@ export default {
|
||||||
loading: false,
|
loading: false,
|
||||||
params: {
|
params: {
|
||||||
page: 0,
|
page: 0,
|
||||||
size: 18,
|
size: 50,
|
||||||
sort: ['createTime,desc', 'id,asc'],
|
sort: ['createTime,desc', 'id,asc'],
|
||||||
keyword: null,
|
keyword: null,
|
||||||
team: undefined
|
team: undefined
|
||||||
|
|
|
@ -6,5 +6,5 @@ module.exports = {
|
||||||
corePlugins: {
|
corePlugins: {
|
||||||
preflight: false
|
preflight: false
|
||||||
},
|
},
|
||||||
plugins: []
|
plugins: [require('@tailwindcss/aspect-ratio')]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue