mirror of https://github.com/halo-dev/halo-admin
pref: attachments preview image styles (#374)
parent
b59dd62157
commit
d3eb288327
|
@ -15,17 +15,22 @@
|
||||||
<a-divider />
|
<a-divider />
|
||||||
<a-row type="flex" align="middle">
|
<a-row type="flex" align="middle">
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-spin :spinning="loading">
|
<a-spin :spinning="loading" class="attachments-group">
|
||||||
<a-empty v-if="attachments.length === 0" />
|
<a-empty v-if="attachments.length === 0" />
|
||||||
<div
|
<div
|
||||||
v-else
|
v-else
|
||||||
class="attach-item"
|
class="attach-item attachments-group-item"
|
||||||
v-for="(item, index) in attachments"
|
v-for="(item, index) in attachments"
|
||||||
:key="index"
|
:key="index"
|
||||||
@click="handleSelectAttachment(item)"
|
@click="handleSelectAttachment(item)"
|
||||||
>
|
>
|
||||||
<span v-show="!handleJudgeMediaType(item)">当前格式不支持预览</span>
|
<span v-if="!handleJudgeMediaType(item)" class="attachments-group-item-type">{{ item.suffix }}</span>
|
||||||
<img :src="item.thumbPath" v-show="handleJudgeMediaType(item)" loading="lazy" />
|
<span
|
||||||
|
v-else
|
||||||
|
class="attachments-group-item-img"
|
||||||
|
:style="`background-image:url(${item.thumbPath})`"
|
||||||
|
loading="lazy"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</a-spin>
|
</a-spin>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
|
|
@ -814,6 +814,25 @@ body {
|
||||||
top: 0;
|
top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 附件图片样式
|
||||||
|
.attachments-group {
|
||||||
|
&-item {
|
||||||
|
padding: 0;
|
||||||
|
height: 140px;
|
||||||
|
&-img {
|
||||||
|
display: block;
|
||||||
|
height: 100%;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: 100%;
|
||||||
|
background-position: center;
|
||||||
|
}
|
||||||
|
.attachments-group &-type {
|
||||||
|
font-size: 38px;
|
||||||
|
text-transform: capitalize;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.ant-affix {
|
.ant-affix {
|
||||||
z-index: 1000 !important;
|
z-index: 1000 !important;
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,6 +71,7 @@
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-list
|
<a-list
|
||||||
|
class="attachments-group"
|
||||||
:grid="{ gutter: 12, xs: 2, sm: 2, md: 4, lg: 6, xl: 6, xxl: 6 }"
|
:grid="{ gutter: 12, xs: 2, sm: 2, md: 4, lg: 6, xl: 6, xxl: 6 }"
|
||||||
:dataSource="formattedDatas"
|
:dataSource="formattedDatas"
|
||||||
:loading="listLoading"
|
:loading="listLoading"
|
||||||
|
@ -82,9 +83,14 @@
|
||||||
@click="handleShowDetailDrawer(item)"
|
@click="handleShowDetailDrawer(item)"
|
||||||
@contextmenu.prevent="handleContextMenu($event, item)"
|
@contextmenu.prevent="handleContextMenu($event, item)"
|
||||||
>
|
>
|
||||||
<div class="attach-thumb">
|
<div class="attach-thumb attachments-group-item">
|
||||||
<span v-show="!handleJudgeMediaType(item)">当前格式不支持预览</span>
|
<span v-if="!handleJudgeMediaType(item)" class="attachments-group-item-type">{{ item.suffix }}</span>
|
||||||
<img :src="item.thumbPath" v-show="handleJudgeMediaType(item)" loading="lazy" />
|
<span
|
||||||
|
v-else
|
||||||
|
class="attachments-group-item-img"
|
||||||
|
:style="`background-image:url(${item.thumbPath})`"
|
||||||
|
loading="lazy"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<a-card-meta class="p-3">
|
<a-card-meta class="p-3">
|
||||||
<ellipsis :length="isMobile() ? 12 : 16" tooltip slot="description">{{ item.name }}</ellipsis>
|
<ellipsis :length="isMobile() ? 12 : 16" tooltip slot="description">{{ item.name }}</ellipsis>
|
||||||
|
|
|
@ -15,18 +15,23 @@
|
||||||
<a-divider />
|
<a-divider />
|
||||||
<a-row type="flex" align="middle">
|
<a-row type="flex" align="middle">
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-spin :spinning="loading">
|
<a-spin :spinning="loading" class="attachments-group">
|
||||||
<a-empty v-if="formattedDatas.length === 0" />
|
<a-empty v-if="formattedDatas.length === 0" />
|
||||||
<div
|
<div
|
||||||
v-else
|
v-else
|
||||||
class="attach-item"
|
class="attach-item attachments-group-item"
|
||||||
v-for="(item, index) in formattedDatas"
|
v-for="(item, index) in formattedDatas"
|
||||||
:key="index"
|
:key="index"
|
||||||
@click="handleShowDetailDrawer(item)"
|
@click="handleShowDetailDrawer(item)"
|
||||||
@contextmenu.prevent="handleContextMenu($event, item)"
|
@contextmenu.prevent="handleContextMenu($event, item)"
|
||||||
>
|
>
|
||||||
<span v-show="!handleJudgeMediaType(item)">当前格式不支持预览</span>
|
<span v-if="!handleJudgeMediaType(item)" class="attachments-group-item-type">{{ item.suffix }}</span>
|
||||||
<img :src="item.thumbPath" v-show="handleJudgeMediaType(item)" loading="lazy" />
|
<span
|
||||||
|
v-else
|
||||||
|
class="attachments-group-item-img"
|
||||||
|
:style="`background-image:url(${item.thumbPath})`"
|
||||||
|
loading="lazy"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</a-spin>
|
</a-spin>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
|
Loading…
Reference in New Issue