style: 优化样式和布局
This commit is contained in:
parent
7f1c1a2cf4
commit
24bd725f15
@ -53,10 +53,10 @@
|
|||||||
<svg-icon v-if="item.isFolder" icon-class="folder"/>
|
<svg-icon v-if="item.isFolder" icon-class="folder"/>
|
||||||
<div v-else-if="item.contentType && item.contentType.indexOf('video') > -1">
|
<div v-else-if="item.contentType && item.contentType.indexOf('video') > -1">
|
||||||
<div v-if="item.mediaCover === undefined || item.mediaCover === 'true'">
|
<div v-if="item.mediaCover === undefined || item.mediaCover === 'true'">
|
||||||
<div v-if="grid && pc" class="grid-play-icon">
|
<div v-if="grid && pc && !details" class="grid-play-icon">
|
||||||
<svg-icon icon-class="play1"/>
|
<svg-icon icon-class="play1"/>
|
||||||
</div>
|
</div>
|
||||||
<el-image :lazy="lazy" v-if="grid" :style="{'height':details?'110px':(gridWidth-50) + 'px'}" fit="contain"
|
<el-image :lazy="lazy" v-if="grid" :style="{'height': videoImageHeight}" fit="contain"
|
||||||
:src="item.fileId ? (audioCoverUrl+item.fileId) : (audioCoverUrl+item.id)">
|
:src="item.fileId ? (audioCoverUrl+item.fileId) : (audioCoverUrl+item.id)">
|
||||||
<div slot="error" class="image-slot-error">
|
<div slot="error" class="image-slot-error">
|
||||||
<svg-icon icon-class="video"/>
|
<svg-icon icon-class="video"/>
|
||||||
@ -91,7 +91,7 @@
|
|||||||
<svg-icon v-else icon-class="audio"/>
|
<svg-icon v-else icon-class="audio"/>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="(item.contentType && item.contentType.startsWith('image')) || item.showCover">
|
<div v-else-if="(item.contentType && item.contentType.startsWith('image')) || item.showCover">
|
||||||
<el-image v-if="grid || grid === 'details'" :style="{'height':details?'110px':(gridWidth-35) + 'px'}"
|
<el-image v-if="grid || grid === 'details'" :style="imageHeightStyle"
|
||||||
fit="contain" :src="item.fileId ? (imageUrl+item.fileId) : (imageUrl+item.id)" :class="item.showCover ? 'cover' : ''">
|
fit="contain" :src="item.fileId ? (imageUrl+item.fileId) : (imageUrl+item.id)" :class="item.showCover ? 'cover' : ''">
|
||||||
<div slot="error" class="image-slot-error">
|
<div slot="error" class="image-slot-error">
|
||||||
<svg-icon icon-class="image"/>
|
<svg-icon icon-class="image"/>
|
||||||
@ -153,6 +153,24 @@ export default {
|
|||||||
mounted() {
|
mounted() {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
videoImageHeight() {
|
||||||
|
if (this.details) {
|
||||||
|
return "110px"
|
||||||
|
}
|
||||||
|
if (this.item.video && this.item.video.width > this.item.video.height) {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return this.gridWidth - 35 + "px"
|
||||||
|
},
|
||||||
|
imageHeightStyle() {
|
||||||
|
if (this.details) {
|
||||||
|
return "height: 110px;"
|
||||||
|
}
|
||||||
|
if (this.item.w > this.item.h) {
|
||||||
|
return `max-height: ${this.gridWidth - 35}px`
|
||||||
|
}
|
||||||
|
return `height: ${this.gridWidth - 35}px;`
|
||||||
|
},
|
||||||
findIconClass() {
|
findIconClass() {
|
||||||
let suffix = this.item.suffix;
|
let suffix = this.item.suffix;
|
||||||
if (!suffix && this.item.fileName) {
|
if (!suffix && this.item.fileName) {
|
||||||
|
|||||||
@ -89,6 +89,7 @@
|
|||||||
<div class="search-content">
|
<div class="search-content">
|
||||||
<div class="search-class">
|
<div class="search-class">
|
||||||
<el-popover
|
<el-popover
|
||||||
|
popper-class="upload-file"
|
||||||
v-if="showUploadButton"
|
v-if="showUploadButton"
|
||||||
v-show="!(isRootPath && homeHidden)"
|
v-show="!(isRootPath && homeHidden)"
|
||||||
v-model="isShowNewFolder"
|
v-model="isShowNewFolder"
|
||||||
@ -329,10 +330,7 @@
|
|||||||
>
|
>
|
||||||
<div class="popper-arrow"></div>
|
<div class="popper-arrow"></div>
|
||||||
<ul v-for="(item, index) in menus" :key="item.label">
|
<ul v-for="(item, index) in menus" :key="item.label">
|
||||||
<li
|
<li v-if="item.operation === 'unFavorite' || item.operation === 'favorite'"
|
||||||
v-if="
|
|
||||||
item.operation === 'unFavorite' || item.operation === 'favorite'
|
|
||||||
"
|
|
||||||
class="menu-option"
|
class="menu-option"
|
||||||
@click="menusOperations(item.operation, $event)"
|
@click="menusOperations(item.operation, $event)"
|
||||||
@mouseover.prevent.stop="
|
@mouseover.prevent.stop="
|
||||||
@ -342,19 +340,23 @@
|
|||||||
menuFavoriteLeave(index, rowContextData.isFavorite)
|
menuFavoriteLeave(index, rowContextData.isFavorite)
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<label class="menuitem">
|
<div class="menuitem home-contextmenu">
|
||||||
<svg-icon :icon-class="item.iconClass" />
|
<svg-icon :icon-class="item.iconClass" />
|
||||||
<span class="menuitem text">{{ item.label }}</span>
|
<div class="home-contextmenu-title">
|
||||||
</label>
|
<span class="menuitem text">{{ item.label }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li v-else @click="menusOperations(item.operation, $event)">
|
<li v-else @click="menusOperations(item.operation, $event)">
|
||||||
<label class="menuitem">
|
<div class="menuitem home-contextmenu">
|
||||||
<svg-icon :icon-class="item.iconClass" />
|
<svg-icon :icon-class="item.iconClass" />
|
||||||
<span class="menuitem text">{{ item.label }}</span>
|
<div class="home-contextmenu-title">
|
||||||
<span v-if="item.shortcut" style="position: absolute;right: 10px;">
|
<span class="menuitem text">{{ item.label }}</span>
|
||||||
|
<span v-if="item.shortcut">
|
||||||
<kbd v-for="key in item.shortcut" :style="{fontSize: key === '⌘' ? '14px' : '12px'}">{{ key }}</kbd>
|
<kbd v-for="key in item.shortcut" :style="{fontSize: key === '⌘' ? '14px' : '12px'}">{{ key }}</kbd>
|
||||||
</span>
|
</span>
|
||||||
</label>
|
</div>
|
||||||
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</e-vue-contextmenu>
|
</e-vue-contextmenu>
|
||||||
@ -1243,7 +1245,9 @@ export default {
|
|||||||
if (item.isFolder || !this.grid) {
|
if (item.isFolder || !this.grid) {
|
||||||
return filename;
|
return filename;
|
||||||
}
|
}
|
||||||
const singleLine = (item.contentType && item.contentType.startsWith('image')) || item.showCover
|
const verticalImage = item.w && item.h && (item.w / item.h < 1.6)
|
||||||
|
const verticalVideo = item.video && (item.video.width / item.video.height < 1.6)
|
||||||
|
const singleLine = verticalImage || verticalVideo || item.showCover
|
||||||
const gridFilenameLength = singleLine ? 13 : 28
|
const gridFilenameLength = singleLine ? 13 : 28
|
||||||
// 分离文件名和后缀
|
// 分离文件名和后缀
|
||||||
let parts = filename.split('.');
|
let parts = filename.split('.');
|
||||||
@ -2144,8 +2148,8 @@ export default {
|
|||||||
node.firstChild.style.marginRight = '20px'
|
node.firstChild.style.marginRight = '20px'
|
||||||
}
|
}
|
||||||
if (index === 2) {
|
if (index === 2) {
|
||||||
node.style.borderRadius = '0 5px 5px 0'
|
node.style.borderRadius = '0 12px 12px 0'
|
||||||
node.style.borderRight = '1px solid #409eff'
|
node.style.borderRight = 'solid 1px var(--apple-shadow-color)'
|
||||||
node.firstChild.style.height = '44px'
|
node.firstChild.style.height = '44px'
|
||||||
node.firstChild.style.lineHeight = '44px'
|
node.firstChild.style.lineHeight = '44px'
|
||||||
node.firstChild.style.width = '80px'
|
node.firstChild.style.width = '80px'
|
||||||
@ -3286,35 +3290,35 @@ export default {
|
|||||||
if (columnIndex === 0) {
|
if (columnIndex === 0) {
|
||||||
return {
|
return {
|
||||||
backgroundColor: '#e0f3fc !important',
|
backgroundColor: '#e0f3fc !important',
|
||||||
borderRadius: '50px 0 0 50px',
|
borderRadius: '12px 0 0 12px',
|
||||||
borderLeft: '1px solid #409eff',
|
borderLeft: 'solid 1px var(--apple-shadow-color)',
|
||||||
borderTop: '1px solid #409eff',
|
borderTop: 'solid 1px var(--apple-shadow-color)',
|
||||||
borderBottom: '1px solid #409eff',
|
borderBottom: 'solid 1px var(--apple-shadow-color)',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (columnIndex === 3) {
|
if (columnIndex === 3) {
|
||||||
return {
|
return {
|
||||||
backgroundColor: '#e0f3fc !important',
|
backgroundColor: '#e0f3fc !important',
|
||||||
borderRadius: '0 50px 50px 0',
|
borderRadius: '0 12px 12px 0',
|
||||||
borderRight: '1px solid #409eff',
|
borderRight: 'solid 1px var(--apple-shadow-color)',
|
||||||
borderTop: '1px solid #409eff',
|
borderTop: 'solid 1px var(--apple-shadow-color)',
|
||||||
borderBottom: '1px solid #409eff',
|
borderBottom: 'solid 1px var(--apple-shadow-color)',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
backgroundColor: '#e0f3fc !important',
|
backgroundColor: '#e0f3fc !important',
|
||||||
borderTop: '1px solid #409eff',
|
borderTop: 'solid 1px var(--apple-shadow-color)',
|
||||||
borderBottom: '1px solid #409eff',
|
borderBottom: 'solid 1px var(--apple-shadow-color)',
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (columnIndex === 0) {
|
if (columnIndex === 0) {
|
||||||
return {
|
return {
|
||||||
borderRadius: '50px 0 0 50px',
|
borderRadius: '12px 0 0 12px',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (columnIndex === 3) {
|
if (columnIndex === 3) {
|
||||||
return {
|
return {
|
||||||
borderRadius: '0 50px 50px 0',
|
borderRadius: '0 12px 12px 0',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4666,7 +4670,7 @@ export default {
|
|||||||
|
|
||||||
.is-sortable:hover {
|
.is-sortable:hover {
|
||||||
background-color: #e0f3fc;
|
background-color: #e0f3fc;
|
||||||
border-radius: 40px;
|
border-radius: 12px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -23,6 +23,7 @@
|
|||||||
<icon-file
|
<icon-file
|
||||||
v-else
|
v-else
|
||||||
class="drawer-icon-font"
|
class="drawer-icon-font"
|
||||||
|
:lazy="false"
|
||||||
:grid="true"
|
:grid="true"
|
||||||
:details="true"
|
:details="true"
|
||||||
:item="file"
|
:item="file"
|
||||||
@ -80,7 +81,7 @@
|
|||||||
<span> {{ formatSize(file.size) }}</span>
|
<span> {{ formatSize(file.size) }}</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="位置:" class="details-position">
|
<el-form-item label="位置:" class="details-position">
|
||||||
<span><a :href="pathUrl">{{ filepath }}</a></span>
|
<span><a :href="pathUrl" title="跳转至文件所在位置">{{ filepath }}</a></span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="上传时间:">
|
<el-form-item label="上传时间:">
|
||||||
<span>{{ file.uploadDate }}</span>
|
<span>{{ file.uploadDate }}</span>
|
||||||
|
|||||||
@ -445,6 +445,9 @@ $tagMenuBorderRadius: 8px;
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
min-width: 110px;
|
min-width: 110px;
|
||||||
}
|
}
|
||||||
|
.tag-menu {
|
||||||
|
padding: 5px 5px;
|
||||||
|
}
|
||||||
.tag-menu li:hover {
|
.tag-menu li:hover {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border-radius: $tagMenuBorderRadius;
|
border-radius: $tagMenuBorderRadius;
|
||||||
|
|||||||
@ -45,7 +45,6 @@
|
|||||||
padding-inline-start: 0;
|
padding-inline-start: 0;
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
padding: 0 5px;
|
|
||||||
}
|
}
|
||||||
.newFileMenu li {
|
.newFileMenu li {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
@ -63,7 +62,6 @@
|
|||||||
.newFileMenu li > .menuitem {
|
.newFileMenu li > .menuitem {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
line-height: 38px;
|
line-height: 38px;
|
||||||
margin-left: 10%;
|
|
||||||
}
|
}
|
||||||
.newFileMenu li > .menuitem > .text {
|
.newFileMenu li > .menuitem > .text {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
@ -137,6 +135,26 @@
|
|||||||
border: 0 solid rgba(0, 0, 0, 0);
|
border: 0 solid rgba(0, 0, 0, 0);
|
||||||
min-width: 160px;
|
min-width: 160px;
|
||||||
border-radius: $dialogBorderRadius;
|
border-radius: $dialogBorderRadius;
|
||||||
|
padding: 10px 10px;
|
||||||
|
box-shadow: 0 5px 12px #ccc;
|
||||||
|
|
||||||
|
.home-contextmenu {
|
||||||
|
padding: 0 10px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.svg-icon {
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.home-contextmenu-title {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu-triangle-bottom {
|
.menu-triangle-bottom {
|
||||||
|
|||||||
@ -28,10 +28,18 @@ body {
|
|||||||
border-radius: $popperBorderRadius;
|
border-radius: $popperBorderRadius;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-message, .el-notification .el-popover, .el-tooltip__popper, .el-dropdown-menu, .el-select-dropdown, .el-picker-panel, .el-picker-panel__body, .el-picker-panel__sidebar {
|
.el-message, .el-notification, .el-popover, .el-tooltip__popper, .el-dropdown-menu, .el-select-dropdown, .el-picker-panel, .el-picker-panel__body, .el-picker-panel__sidebar {
|
||||||
border-radius: $popperBorderRadius;
|
border-radius: $popperBorderRadius;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.el-popover.el-popper.upload-file {
|
||||||
|
border-radius: 16px;
|
||||||
|
padding: 10px 10px;
|
||||||
|
li {
|
||||||
|
padding: 0 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.v-contextmenu {
|
.v-contextmenu {
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user