优化页签功能&支持全屏按钮操作
This commit is contained in:
@@ -65,7 +65,7 @@ public abstract class AbstractQuartzJob implements Job
|
|||||||
* 执行后
|
* 执行后
|
||||||
*
|
*
|
||||||
* @param context 工作执行上下文对象
|
* @param context 工作执行上下文对象
|
||||||
* @param sysScheduleJob 系统计划任务
|
* @param sysJob 系统计划任务
|
||||||
*/
|
*/
|
||||||
protected void after(JobExecutionContext context, SysJob sysJob, Exception e)
|
protected void after(JobExecutionContext context, SysJob sysJob, Exception e)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
<!-- 文件路径: @/layout/components/Navbar.vue (假设的原路径) -->
|
|
||||||
<template>
|
<template>
|
||||||
<div class="navbar" :class="'nav' + navType">
|
<div class="navbar" :class="'nav' + navType">
|
||||||
<hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
|
<hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const tagAndTagSpacing = 4 // tagAndTagSpacing
|
const tagAndTagSpacing = 4
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ScrollPane',
|
name: 'ScrollPane',
|
||||||
@@ -26,13 +26,20 @@ export default {
|
|||||||
this.scrollWrapper.removeEventListener('scroll', this.emitScroll)
|
this.scrollWrapper.removeEventListener('scroll', this.emitScroll)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
smoothScrollTo(target) {
|
||||||
|
const $scrollWrapper = this.scrollWrapper
|
||||||
|
$scrollWrapper.scrollTo({ left: target, behavior: 'smooth' })
|
||||||
|
setTimeout(() => this.$emit('updateArrows'), 350)
|
||||||
|
},
|
||||||
handleScroll(e) {
|
handleScroll(e) {
|
||||||
const eventDelta = e.wheelDelta || -e.deltaY * 40
|
const eventDelta = e.wheelDelta || -e.deltaY * 40
|
||||||
const $scrollWrapper = this.scrollWrapper
|
const $scrollWrapper = this.scrollWrapper
|
||||||
$scrollWrapper.scrollLeft = $scrollWrapper.scrollLeft + eventDelta / 4
|
$scrollWrapper.scrollLeft = $scrollWrapper.scrollLeft + eventDelta / 4
|
||||||
|
this.$emit('updateArrows')
|
||||||
},
|
},
|
||||||
emitScroll() {
|
emitScroll() {
|
||||||
this.$emit('scroll')
|
this.$emit('scroll')
|
||||||
|
this.$emit('updateArrows')
|
||||||
},
|
},
|
||||||
moveToTarget(currentTag) {
|
moveToTarget(currentTag) {
|
||||||
const $container = this.$refs.scrollContainer.$el
|
const $container = this.$refs.scrollContainer.$el
|
||||||
@@ -43,34 +50,56 @@ export default {
|
|||||||
let firstTag = null
|
let firstTag = null
|
||||||
let lastTag = null
|
let lastTag = null
|
||||||
|
|
||||||
// find first tag and last tag
|
|
||||||
if (tagList.length > 0) {
|
if (tagList.length > 0) {
|
||||||
firstTag = tagList[0]
|
firstTag = tagList[0]
|
||||||
lastTag = tagList[tagList.length - 1]
|
lastTag = tagList[tagList.length - 1]
|
||||||
}
|
}
|
||||||
|
|
||||||
if (firstTag === currentTag) {
|
if (firstTag === currentTag) {
|
||||||
$scrollWrapper.scrollLeft = 0
|
this.smoothScrollTo(0)
|
||||||
} else if (lastTag === currentTag) {
|
} else if (lastTag === currentTag) {
|
||||||
$scrollWrapper.scrollLeft = $scrollWrapper.scrollWidth - $containerWidth
|
this.smoothScrollTo($scrollWrapper.scrollWidth - $containerWidth)
|
||||||
} else {
|
} else {
|
||||||
// find preTag and nextTag
|
|
||||||
const currentIndex = tagList.findIndex(item => item === currentTag)
|
const currentIndex = tagList.findIndex(item => item === currentTag)
|
||||||
const prevTag = tagList[currentIndex - 1]
|
const prevTag = tagList[currentIndex - 1]
|
||||||
const nextTag = tagList[currentIndex + 1]
|
const nextTag = tagList[currentIndex + 1]
|
||||||
|
|
||||||
// the tag's offsetLeft after of nextTag
|
|
||||||
const afterNextTagOffsetLeft = nextTag.$el.offsetLeft + nextTag.$el.offsetWidth + tagAndTagSpacing
|
const afterNextTagOffsetLeft = nextTag.$el.offsetLeft + nextTag.$el.offsetWidth + tagAndTagSpacing
|
||||||
|
|
||||||
// the tag's offsetLeft before of prevTag
|
|
||||||
const beforePrevTagOffsetLeft = prevTag.$el.offsetLeft - tagAndTagSpacing
|
const beforePrevTagOffsetLeft = prevTag.$el.offsetLeft - tagAndTagSpacing
|
||||||
|
|
||||||
if (afterNextTagOffsetLeft > $scrollWrapper.scrollLeft + $containerWidth) {
|
if (afterNextTagOffsetLeft > $scrollWrapper.scrollLeft + $containerWidth) {
|
||||||
$scrollWrapper.scrollLeft = afterNextTagOffsetLeft - $containerWidth
|
this.smoothScrollTo(afterNextTagOffsetLeft - $containerWidth)
|
||||||
} else if (beforePrevTagOffsetLeft < $scrollWrapper.scrollLeft) {
|
} else if (beforePrevTagOffsetLeft < $scrollWrapper.scrollLeft) {
|
||||||
$scrollWrapper.scrollLeft = beforePrevTagOffsetLeft
|
this.smoothScrollTo(beforePrevTagOffsetLeft)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
// 向左滚动固定距离
|
||||||
|
scrollLeft() {
|
||||||
|
const $scrollWrapper = this.scrollWrapper
|
||||||
|
this.smoothScrollTo(Math.max(0, $scrollWrapper.scrollLeft - 200))
|
||||||
|
},
|
||||||
|
// 向右滚动固定距离
|
||||||
|
scrollRight() {
|
||||||
|
const $scrollWrapper = this.scrollWrapper
|
||||||
|
const maxScroll = $scrollWrapper.scrollWidth - $scrollWrapper.clientWidth
|
||||||
|
this.smoothScrollTo(Math.min(maxScroll, $scrollWrapper.scrollLeft + 200))
|
||||||
|
},
|
||||||
|
// 直接平滑滚动到最左端
|
||||||
|
scrollToStart() {
|
||||||
|
this.smoothScrollTo(0)
|
||||||
|
},
|
||||||
|
// 直接平滑滚动到最右端
|
||||||
|
scrollToEnd() {
|
||||||
|
const $scrollWrapper = this.scrollWrapper
|
||||||
|
this.smoothScrollTo($scrollWrapper.scrollWidth - $scrollWrapper.clientWidth)
|
||||||
|
},
|
||||||
|
// 获取是否可以继续向左/右滚动
|
||||||
|
getScrollState() {
|
||||||
|
const $scrollWrapper = this.scrollWrapper
|
||||||
|
return {
|
||||||
|
canLeft: $scrollWrapper.scrollLeft > 0,
|
||||||
|
canRight: $scrollWrapper.scrollLeft < $scrollWrapper.scrollWidth - $scrollWrapper.clientWidth - 1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -87,7 +116,9 @@ export default {
|
|||||||
bottom: 0px;
|
bottom: 0px;
|
||||||
}
|
}
|
||||||
.el-scrollbar__wrap {
|
.el-scrollbar__wrap {
|
||||||
height: 49px;
|
height: 34px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="tags-view-container" class="tags-view-container">
|
<div id="tags-view-container" class="tags-view-container">
|
||||||
<scroll-pane ref="scrollPane" class="tags-view-wrapper" @scroll="handleScroll">
|
<!-- 左切换箭头 -->
|
||||||
|
<span class="tags-nav-btn tags-nav-btn--left" :class="{ disabled: !canScrollLeft }" @click="scrollLeft">
|
||||||
|
<i class="el-icon-arrow-left" />
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<!-- 标签滚动区 -->
|
||||||
|
<scroll-pane ref="scrollPane" class="tags-view-wrapper" @scroll="handleScroll" @updateArrows="updateArrowState">
|
||||||
<router-link
|
<router-link
|
||||||
v-for="tag in visitedViews"
|
v-for="tag in visitedViews"
|
||||||
ref="tag"
|
ref="tag"
|
||||||
@@ -10,15 +16,42 @@
|
|||||||
tag="span"
|
tag="span"
|
||||||
class="tags-view-item"
|
class="tags-view-item"
|
||||||
:style="activeStyle(tag)"
|
:style="activeStyle(tag)"
|
||||||
@click.middle.native="!isAffix(tag)?closeSelectedTag(tag):''"
|
@click.middle.native="!isAffix(tag) ? closeSelectedTag(tag) : ''"
|
||||||
@contextmenu.prevent.native="openMenu(tag,$event)"
|
@contextmenu.prevent.native="openMenu(tag, $event)"
|
||||||
>
|
>
|
||||||
<svg-icon v-if="tagsIcon && tag.meta && tag.meta.icon && tag.meta.icon !== '#'" :icon-class="tag.meta.icon" />
|
<svg-icon v-if="tagsIcon && tag.meta && tag.meta.icon && tag.meta.icon !== '#'" :icon-class="tag.meta.icon" />
|
||||||
{{ tag.title }}
|
{{ tag.title }}
|
||||||
<span v-if="!isAffix(tag)" class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)" />
|
<span v-if="!isAffix(tag)" class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)" />
|
||||||
</router-link>
|
</router-link>
|
||||||
</scroll-pane>
|
</scroll-pane>
|
||||||
<ul v-show="visible" :style="{left:left+'px',top:top+'px'}" class="contextmenu">
|
|
||||||
|
<!-- 右切换箭头 -->
|
||||||
|
<span class="tags-nav-btn tags-nav-btn--right" :class="{ disabled: !canScrollRight }" @click="scrollRight">
|
||||||
|
<i class="el-icon-arrow-right" />
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<!-- 下拉操作菜单 -->
|
||||||
|
<el-dropdown class="tags-action-dropdown" trigger="click" placement="bottom-end" @command="handleDropdownCommand">
|
||||||
|
<span class="tags-action-btn">
|
||||||
|
<i class="el-icon-arrow-down" />
|
||||||
|
</span>
|
||||||
|
<el-dropdown-menu slot="dropdown" class="tags-dropdown-menu">
|
||||||
|
<el-dropdown-item command="refresh" icon="el-icon-refresh-right">刷新页面</el-dropdown-item>
|
||||||
|
<el-dropdown-item v-if="!isAffix(selectedDropdownTag)" command="close" icon="el-icon-close">关闭当前</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="closeOthers" icon="el-icon-circle-close">关闭其他</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="closeLeft" :disabled="isFirstView()" icon="el-icon-back">关闭左侧</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="closeRight" :disabled="isLastView()" icon="el-icon-right">关闭右侧</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="closeAll" icon="el-icon-circle-close" divided>全部关闭</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</el-dropdown>
|
||||||
|
|
||||||
|
<!-- 全屏按钮 -->
|
||||||
|
<span class="tags-action-btn tags-fullscreen-btn" :title="isFullscreen ? '退出全屏' : '全屏'" @click="toggleFullscreen">
|
||||||
|
<i :class="isFullscreen ? 'el-icon-aim' : 'el-icon-full-screen'" />
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<!-- 右键上下文菜单 -->
|
||||||
|
<ul v-show="visible" :style="{ left: left + 'px', top: top + 'px' }" class="contextmenu">
|
||||||
<li @click="refreshSelectedTag(selectedTag)"><i class="el-icon-refresh-right"></i> 刷新页面</li>
|
<li @click="refreshSelectedTag(selectedTag)"><i class="el-icon-refresh-right"></i> 刷新页面</li>
|
||||||
<li v-if="!isAffix(selectedTag)" @click="closeSelectedTag(selectedTag)"><i class="el-icon-close"></i> 关闭当前</li>
|
<li v-if="!isAffix(selectedTag)" @click="closeSelectedTag(selectedTag)"><i class="el-icon-close"></i> 关闭当前</li>
|
||||||
<li @click="closeOthersTags"><i class="el-icon-circle-close"></i> 关闭其他</li>
|
<li @click="closeOthersTags"><i class="el-icon-circle-close"></i> 关闭其他</li>
|
||||||
@@ -41,7 +74,10 @@ export default {
|
|||||||
top: 0,
|
top: 0,
|
||||||
left: 0,
|
left: 0,
|
||||||
selectedTag: {},
|
selectedTag: {},
|
||||||
affixTags: []
|
affixTags: [],
|
||||||
|
canScrollLeft: false,
|
||||||
|
canScrollRight: false,
|
||||||
|
isFullscreen: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -56,6 +92,9 @@ export default {
|
|||||||
},
|
},
|
||||||
tagsIcon() {
|
tagsIcon() {
|
||||||
return this.$store.state.settings.tagsIcon
|
return this.$store.state.settings.tagsIcon
|
||||||
|
},
|
||||||
|
selectedDropdownTag() {
|
||||||
|
return this.visitedViews.find(v => this.isActive(v)) || {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@@ -69,11 +108,22 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
document.body.removeEventListener('click', this.closeMenu)
|
document.body.removeEventListener('click', this.closeMenu)
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
visitedViews() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.updateArrowState()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.initTags()
|
this.initTags()
|
||||||
this.addTags()
|
this.addTags()
|
||||||
|
window.addEventListener('resize', this.updateArrowState)
|
||||||
|
document.addEventListener('fullscreenchange', this.onFullscreenChange)
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
window.removeEventListener('resize', this.updateArrowState)
|
||||||
|
document.removeEventListener('fullscreenchange', this.onFullscreenChange)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
isActive(route) {
|
isActive(route) {
|
||||||
@@ -87,18 +137,20 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
isAffix(tag) {
|
isAffix(tag) {
|
||||||
return tag.meta && tag.meta.affix
|
return tag && tag.meta && tag.meta.affix
|
||||||
},
|
},
|
||||||
isFirstView() {
|
isFirstView() {
|
||||||
try {
|
try {
|
||||||
return this.selectedTag.fullPath === '/index' || this.selectedTag.fullPath === this.visitedViews[1].fullPath
|
const tag = this.selectedTag && this.selectedTag.fullPath ? this.selectedTag : this.selectedDropdownTag
|
||||||
|
return tag.fullPath === '/index' || tag.fullPath === this.visitedViews[1].fullPath
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isLastView() {
|
isLastView() {
|
||||||
try {
|
try {
|
||||||
return this.selectedTag.fullPath === this.visitedViews[this.visitedViews.length - 1].fullPath
|
const tag = this.selectedTag && this.selectedTag.fullPath ? this.selectedTag : this.selectedDropdownTag
|
||||||
|
return tag.fullPath === this.visitedViews[this.visitedViews.length - 1].fullPath
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@@ -127,7 +179,6 @@ export default {
|
|||||||
initTags() {
|
initTags() {
|
||||||
const affixTags = this.affixTags = this.filterAffixTags(this.routes)
|
const affixTags = this.affixTags = this.filterAffixTags(this.routes)
|
||||||
for (const tag of affixTags) {
|
for (const tag of affixTags) {
|
||||||
// Must have tag name
|
|
||||||
if (tag.name) {
|
if (tag.name) {
|
||||||
this.$store.dispatch('tagsView/addVisitedView', tag)
|
this.$store.dispatch('tagsView/addVisitedView', tag)
|
||||||
}
|
}
|
||||||
@@ -145,7 +196,6 @@ export default {
|
|||||||
for (const tag of tags) {
|
for (const tag of tags) {
|
||||||
if (tag.to.path === this.$route.path) {
|
if (tag.to.path === this.$route.path) {
|
||||||
this.$refs.scrollPane.moveToTarget(tag)
|
this.$refs.scrollPane.moveToTarget(tag)
|
||||||
// when query is different then update
|
|
||||||
if (tag.to.fullPath !== this.$route.fullPath) {
|
if (tag.to.fullPath !== this.$route.fullPath) {
|
||||||
this.$store.dispatch('tagsView/updateVisitedView', this.$route)
|
this.$store.dispatch('tagsView/updateVisitedView', this.$route)
|
||||||
}
|
}
|
||||||
@@ -154,6 +204,57 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
scrollLeft() {
|
||||||
|
if (!this.canScrollLeft) return
|
||||||
|
this.$refs.scrollPane.scrollToStart()
|
||||||
|
},
|
||||||
|
scrollRight() {
|
||||||
|
if (!this.canScrollRight) return
|
||||||
|
this.$refs.scrollPane.scrollToEnd()
|
||||||
|
},
|
||||||
|
updateArrowState() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if (this.$refs.scrollPane) {
|
||||||
|
const state = this.$refs.scrollPane.getScrollState()
|
||||||
|
this.canScrollLeft = state.canLeft
|
||||||
|
this.canScrollRight = state.canRight
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
toggleFullscreen() {
|
||||||
|
if (!document.fullscreenElement) {
|
||||||
|
document.documentElement.requestFullscreen()
|
||||||
|
} else {
|
||||||
|
document.exitFullscreen()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onFullscreenChange() {
|
||||||
|
this.isFullscreen = !!document.fullscreenElement
|
||||||
|
},
|
||||||
|
handleDropdownCommand(command) {
|
||||||
|
const tag = this.selectedDropdownTag
|
||||||
|
this.selectedTag = tag
|
||||||
|
switch (command) {
|
||||||
|
case 'refresh':
|
||||||
|
this.refreshSelectedTag(tag)
|
||||||
|
break
|
||||||
|
case 'close':
|
||||||
|
this.closeSelectedTag(tag)
|
||||||
|
break
|
||||||
|
case 'closeOthers':
|
||||||
|
this.closeOthersTags()
|
||||||
|
break
|
||||||
|
case 'closeLeft':
|
||||||
|
this.closeLeftTags()
|
||||||
|
break
|
||||||
|
case 'closeRight':
|
||||||
|
this.closeRightTags()
|
||||||
|
break
|
||||||
|
case 'closeAll':
|
||||||
|
this.closeAllTags(tag)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
},
|
||||||
refreshSelectedTag(view) {
|
refreshSelectedTag(view) {
|
||||||
this.$tab.refreshPage(view)
|
this.$tab.refreshPage(view)
|
||||||
if (this.$route.meta.link) {
|
if (this.$route.meta.link) {
|
||||||
@@ -182,7 +283,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
closeOthersTags() {
|
closeOthersTags() {
|
||||||
this.$router.push(this.selectedTag.fullPath).catch(()=>{})
|
this.$router.push(this.selectedTag.fullPath).catch(() => {})
|
||||||
this.$tab.closeOtherPage(this.selectedTag).then(() => {
|
this.$tab.closeOtherPage(this.selectedTag).then(() => {
|
||||||
this.moveToCurrentTag()
|
this.moveToCurrentTag()
|
||||||
})
|
})
|
||||||
@@ -200,10 +301,7 @@ export default {
|
|||||||
if (latestView) {
|
if (latestView) {
|
||||||
this.$router.push(latestView.fullPath)
|
this.$router.push(latestView.fullPath)
|
||||||
} else {
|
} else {
|
||||||
// now the default is to redirect to the home page if there is no tags-view,
|
if (view && view.name === 'Dashboard') {
|
||||||
// you can adjust it according to your needs.
|
|
||||||
if (view.name === 'Dashboard') {
|
|
||||||
// to reload home page
|
|
||||||
this.$router.replace({ path: '/redirect' + view.fullPath })
|
this.$router.replace({ path: '/redirect' + view.fullPath })
|
||||||
} else {
|
} else {
|
||||||
this.$router.push('/')
|
this.$router.push('/')
|
||||||
@@ -211,18 +309,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
openMenu(tag, e) {
|
openMenu(tag, e) {
|
||||||
const menuMinWidth = 105
|
this.left = e.clientX
|
||||||
const offsetLeft = this.$el.getBoundingClientRect().left // container margin left
|
|
||||||
const offsetWidth = this.$el.offsetWidth // container width
|
|
||||||
const maxLeft = offsetWidth - menuMinWidth // left boundary
|
|
||||||
const left = e.clientX - offsetLeft + 15 // 15: margin right
|
|
||||||
|
|
||||||
if (left > maxLeft) {
|
|
||||||
this.left = maxLeft
|
|
||||||
} else {
|
|
||||||
this.left = left
|
|
||||||
}
|
|
||||||
|
|
||||||
this.top = e.clientY
|
this.top = e.clientY
|
||||||
this.visible = true
|
this.visible = true
|
||||||
this.selectedTag = tag
|
this.selectedTag = tag
|
||||||
@@ -232,6 +319,7 @@ export default {
|
|||||||
},
|
},
|
||||||
handleScroll() {
|
handleScroll() {
|
||||||
this.closeMenu()
|
this.closeMenu()
|
||||||
|
this.updateArrowState()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -243,8 +331,52 @@ export default {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border-bottom: 1px solid #d8dce5;
|
border-bottom: 1px solid #d8dce5;
|
||||||
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .12), 0 0 3px 0 rgba(0, 0, 0, .04);
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
$btn-width: 28px;
|
||||||
|
$btn-color: #71717a;
|
||||||
|
$btn-hover-bg: #f0f2f5;
|
||||||
|
$btn-hover-color: #303133;
|
||||||
|
$btn-disabled-color: #c0c4cc;
|
||||||
|
$divider: 1px solid #d8dce5;
|
||||||
|
|
||||||
|
.tags-nav-btn {
|
||||||
|
flex-shrink: 0;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: $btn-width;
|
||||||
|
height: 34px;
|
||||||
|
cursor: pointer;
|
||||||
|
color: $btn-color;
|
||||||
|
font-size: 13px;
|
||||||
|
user-select: none;
|
||||||
|
transition: background 0.15s, color 0.15s;
|
||||||
|
|
||||||
|
&:hover:not(.disabled) {
|
||||||
|
background: $btn-hover-bg;
|
||||||
|
color: $btn-hover-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.disabled {
|
||||||
|
color: $btn-disabled-color;
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
&--left {
|
||||||
|
border-right: $divider;
|
||||||
|
}
|
||||||
|
|
||||||
|
&--right {
|
||||||
|
border-left: $divider;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.tags-view-wrapper {
|
.tags-view-wrapper {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
|
||||||
.tags-view-item {
|
.tags-view-item {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
position: relative;
|
position: relative;
|
||||||
@@ -257,9 +389,9 @@ export default {
|
|||||||
padding: 0 8px;
|
padding: 0 8px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
margin-top: 4px;
|
|
||||||
&:first-of-type {
|
&:first-of-type {
|
||||||
margin-left: 15px;
|
margin-left: 6px;
|
||||||
}
|
}
|
||||||
&:last-of-type {
|
&:last-of-type {
|
||||||
margin-right: 15px;
|
margin-right: 15px;
|
||||||
@@ -286,11 +418,40 @@ export default {
|
|||||||
content: none !important;
|
content: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tags-action-dropdown {
|
||||||
|
flex-shrink: 0;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tags-action-btn {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: $btn-width;
|
||||||
|
height: 34px;
|
||||||
|
cursor: pointer;
|
||||||
|
color: $btn-color;
|
||||||
|
font-size: 13px;
|
||||||
|
border-left: $divider;
|
||||||
|
user-select: none;
|
||||||
|
transition: background 0.15s, color 0.15s;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: $btn-hover-bg;
|
||||||
|
color: $btn-hover-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.tags-fullscreen-btn {
|
||||||
|
border-left: $divider;
|
||||||
|
}
|
||||||
|
|
||||||
.contextmenu {
|
.contextmenu {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
z-index: 3000;
|
z-index: 3000;
|
||||||
position: absolute;
|
position: fixed;
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
padding: 5px 0;
|
padding: 5px 0;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
@@ -298,6 +459,7 @@ export default {
|
|||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #333;
|
color: #333;
|
||||||
box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, .3);
|
box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, .3);
|
||||||
|
|
||||||
li {
|
li {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 7px 16px;
|
padding: 7px 16px;
|
||||||
@@ -311,7 +473,6 @@ export default {
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
//reset element css of el-icon-close
|
|
||||||
.tags-view-wrapper {
|
.tags-view-wrapper {
|
||||||
.tags-view-item {
|
.tags-view-item {
|
||||||
.el-icon-close {
|
.el-icon-close {
|
||||||
|
|||||||
Reference in New Issue
Block a user