Commit 1193ac74 authored by 李苏's avatar 李苏 💬

ERP 定制图标 layout调整

parent 12237578
public/favicon.png

442 KB | W: | H:

public/favicon.png

177 KB | W: | H:

public/favicon.png
public/favicon.png
public/favicon.png
public/favicon.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/logo/logo.png

442 KB | W: | H:

src/assets/logo/logo.png

177 KB | W: | H:

src/assets/logo/logo.png
src/assets/logo/logo.png
src/assets/logo/logo.png
src/assets/logo/logo.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -53,9 +53,9 @@ ...@@ -53,9 +53,9 @@
<i class="el-icon-caret-bottom" /> <i class="el-icon-caret-bottom" />
</div> </div>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<router-link to="/user/profile"> <!--<router-link to="/user/profile">-->
<el-dropdown-item>个人中心</el-dropdown-item> <!--<el-dropdown-item>个人中心</el-dropdown-item>-->
</router-link> <!--</router-link>-->
<span @click="showItem"> <span @click="showItem">
<el-dropdown-item>修改密码</el-dropdown-item> <el-dropdown-item>修改密码</el-dropdown-item>
</span> </span>
......
<template> <template>
<div id="tags-view-container" class="tags-view-container"> <div id="tags-view-container" class="tags-view-container" style="position: relative;">
<scroll-pane ref="scrollPane" class="tags-view-wrapper" @scroll="handleScroll"> <!-- 过长切换-->
<router-link <div v-show="moveShow" class="moveLeft">
v-for="tag in visitedViews" <i @click="moveLeft" class="fa fa-chevron-circle-left" aria-hidden="true" /></i>
ref="tag" </div>
:key="tag.path" <div v-show="moveShow" class="moveRight">
:class="isActive(tag)?'active':''" <i @click="moveRight" class="fa fa-chevron-circle-right" aria-hidden="true" /></i>
:to="{ path: tag.path, query: tag.query, fullPath: tag.fullPath }" </div>
tag="span" <scroll-pane id='scrollPane' ref="scrollPane" class="tags-view-wrapper" @scroll="handleScroll">
class="tags-view-item" <router-link v-for="tag in visitedViews" ref="tag" :key="tag.path" :class="isActive(tag)?'active':''"
:style="activeStyle(tag)" :to="{ path: tag.path, query: tag.query, fullPath: tag.fullPath }" tag="span" class="tags-view-item"
@click.middle.native="!isAffix(tag)?closeSelectedTag(tag):''" :style="activeStyle(tag)" @click.middle.native="!isAffix(tag)?closeSelectedTag(tag):''"
@contextmenu.prevent.native="openMenu(tag,$event)" @contextmenu.prevent.native="openMenu(tag,$event)">
>
{{ 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>
...@@ -29,13 +28,16 @@ ...@@ -29,13 +28,16 @@
</template> </template>
<script> <script>
import ScrollPane from './ScrollPane' import ScrollPane from './ScrollPane'
import path from 'path' import path from 'path'
export default { export default {
components: { ScrollPane }, components: {
ScrollPane
},
data() { data() {
return { return {
moveShow:false,
visible: false, visible: false,
top: 0, top: 0,
left: 0, left: 0,
...@@ -44,6 +46,7 @@ export default { ...@@ -44,6 +46,7 @@ export default {
} }
}, },
computed: { computed: {
/* 宽度*/
visitedViews() { visitedViews() {
return this.$store.state.tagsView.visitedViews return this.$store.state.tagsView.visitedViews
}, },
...@@ -70,8 +73,41 @@ export default { ...@@ -70,8 +73,41 @@ export default {
mounted() { mounted() {
this.initTags() this.initTags()
this.addTags() this.addTags()
/* 监听*/
},
updated() {
let spans=$('#scrollPane').find('.el-scrollbar__view>span')
let allWidth=$('.navbar').width()
let width=0
spans.each((inex,item)=>{
width=width+$(item).width()+5+16
})
if(width>allWidth){
this.moveShow=true
}else{
this.moveShow=false
}
}, },
methods: { methods: {
moveLeft(){
const element =this.$refs.scrollPane.$el
const event = new WheelEvent('wheel', {
deltaY: -200, // 设置滚动值
bubbles: true,
cancelable: true
});
element.dispatchEvent(event);
},
moveRight(){
const element =this.$refs.scrollPane.$el
const event = new WheelEvent('wheel', {
deltaY: 200, // 设置滚动值
bubbles: true,
cancelable: true
});
element.dispatchEvent(event);
},
isActive(route) { isActive(route) {
return route.path === this.$route.path return route.path === this.$route.path
}, },
...@@ -108,7 +144,9 @@ export default { ...@@ -108,7 +144,9 @@ export default {
fullPath: tagPath, fullPath: tagPath,
path: tagPath, path: tagPath,
name: route.name, name: route.name,
meta: { ...route.meta } meta: {
...route.meta
}
}) })
} }
if (route.children) { if (route.children) {
...@@ -130,7 +168,9 @@ export default { ...@@ -130,7 +168,9 @@ export default {
} }
}, },
addTags() { addTags() {
const { name } = this.$route const {
name
} = this.$route
if (name) { if (name) {
this.$store.dispatch('tagsView/addView', this.$route) this.$store.dispatch('tagsView/addView', this.$route)
} }
...@@ -155,7 +195,9 @@ export default { ...@@ -155,7 +195,9 @@ export default {
this.$tab.refreshPage(view); this.$tab.refreshPage(view);
}, },
closeSelectedTag(view) { closeSelectedTag(view) {
this.$tab.closePage(view).then(({ visitedViews }) => { this.$tab.closePage(view).then(({
visitedViews
}) => {
if (this.isActive(view)) { if (this.isActive(view)) {
this.toLastView(visitedViews, view) this.toLastView(visitedViews, view)
} }
...@@ -176,13 +218,15 @@ export default { ...@@ -176,13 +218,15 @@ export default {
}) })
}, },
closeOthersTags() { closeOthersTags() {
this.$router.push(this.selectedTag).catch(()=>{}); this.$router.push(this.selectedTag).catch(() => {});
this.$tab.closeOtherPage(this.selectedTag).then(() => { this.$tab.closeOtherPage(this.selectedTag).then(() => {
this.moveToCurrentTag() this.moveToCurrentTag()
}) })
}, },
closeAllTags(view) { closeAllTags(view) {
this.$tab.closeAllPage().then(({ visitedViews }) => { this.$tab.closeAllPage().then(({
visitedViews
}) => {
if (this.affixTags.some(tag => tag.path === this.$route.path)) { if (this.affixTags.some(tag => tag.path === this.$route.path)) {
return return
} }
...@@ -198,7 +242,9 @@ export default { ...@@ -198,7 +242,9 @@ export default {
// you can adjust it according to your needs. // you can adjust it according to your needs.
if (view.name === 'Dashboard') { if (view.name === 'Dashboard') {
// to reload home page // 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('/')
} }
...@@ -228,16 +274,44 @@ export default { ...@@ -228,16 +274,44 @@ export default {
this.closeMenu() this.closeMenu()
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.tags-view-container { .moveLeft{
display: none;
}
.moveRight{
display: none;
}
.tags-view-container:hover{
.moveLeft {
display: block;
line-height: 34px;
color: #666;
position: absolute;
left: 0;
cursor: pointer;
z-index: 9999;
}
.moveRight {
display: block;
line-height: 34px;
color: #666;
position: absolute;
right: 0;
cursor: pointer;
z-index: 9999;
}
}
.tags-view-container {
height: 34px; height: 34px;
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); box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .12), 0 0 3px 0 rgba(0, 0, 0, .04);
.tags-view-wrapper { .tags-view-wrapper {
.tags-view-item { .tags-view-item {
display: inline-block; display: inline-block;
...@@ -252,16 +326,20 @@ export default { ...@@ -252,16 +326,20 @@ export default {
font-size: 12px; font-size: 12px;
margin-left: 5px; margin-left: 5px;
margin-top: 4px; margin-top: 4px;
&:first-of-type { &:first-of-type {
margin-left: 15px; margin-left: 15px;
} }
&:last-of-type { &:last-of-type {
margin-right: 15px; margin-right: 15px;
} }
&.active { &.active {
background-color: #42b983; background-color: #42b983;
color: #fff; color: #fff;
border-color: #42b983; border-color: #42b983;
&::before { &::before {
content: ''; content: '';
background: #fff; background: #fff;
...@@ -275,6 +353,7 @@ export default { ...@@ -275,6 +353,7 @@ export default {
} }
} }
} }
.contextmenu { .contextmenu {
margin: 0; margin: 0;
background: #fff; background: #fff;
...@@ -287,21 +366,23 @@ export default { ...@@ -287,21 +366,23 @@ 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;
cursor: pointer; cursor: pointer;
&:hover { &:hover {
background: #eee; background: #eee;
} }
} }
} }
} }
</style> </style>
<style lang="scss"> <style lang="scss">
//reset element css of el-icon-close //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 {
width: 16px; width: 16px;
...@@ -311,16 +392,18 @@ export default { ...@@ -311,16 +392,18 @@ export default {
text-align: center; text-align: center;
transition: all .3s cubic-bezier(.645, .045, .355, 1); transition: all .3s cubic-bezier(.645, .045, .355, 1);
transform-origin: 100% 50%; transform-origin: 100% 50%;
&:before { &:before {
transform: scale(.6); transform: scale(.6);
display: inline-block; display: inline-block;
vertical-align: -3px; vertical-align: -3px;
} }
&:hover { &:hover {
background-color: #b4bccc; background-color: #b4bccc;
color: #fff; color: #fff;
} }
} }
} }
} }
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment