-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
table新增分页插件。 考勤统计新增两个tab
- Loading branch information
Showing
67 changed files
with
11,386 additions
and
290 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
<template> | ||
<transition :name="transitionName"> | ||
<div class="back-to-ceiling" @click="backToTop" v-show="visible" :style="customStyle"> | ||
<svg width="16" height="16" viewBox="0 0 17 17" xmlns="http://www.w3.org/2000/svg" class="Icon Icon--backToTopArrow" aria-hidden="true" style="height: 16px; width: 16px;"> | ||
<title>回到顶部</title> | ||
<g> | ||
<path d="M12.036 15.59c0 .55-.453.995-.997.995H5.032c-.55 0-.997-.445-.997-.996V8.584H1.03c-1.1 0-1.36-.633-.578-1.416L7.33.29c.39-.39 1.026-.385 1.412 0l6.878 6.88c.782.78.523 1.415-.58 1.415h-3.004v7.004z" fill-rule="evenodd"></path> | ||
</g> | ||
</svg> | ||
</div> | ||
</transition> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'BackToTop', | ||
props: { | ||
visibilityHeight: { | ||
type: Number, | ||
default: 400 | ||
}, | ||
backPosition: { | ||
type: Number, | ||
default: 0 | ||
}, | ||
customStyle: { | ||
type: Object, | ||
default:function() { | ||
return { | ||
right: '50px', | ||
bottom: '50px', | ||
width: '40px', | ||
height: '40px', | ||
'border-radius': '4px', | ||
'line-height': '45px', | ||
background: '#e7eaf1' | ||
} | ||
} | ||
}, | ||
transitionName: { | ||
type: String, | ||
default: 'fade' | ||
} | ||
}, | ||
data() { | ||
return { | ||
visible: false, | ||
interval: null | ||
} | ||
}, | ||
mounted() { | ||
window.addEventListener('scroll', this.handleScroll) | ||
}, | ||
beforeDestroy() { | ||
window.removeEventListener('scroll', this.handleScroll) | ||
if (this.interval) { | ||
clearInterval(this.interval) | ||
} | ||
}, | ||
methods: { | ||
handleScroll() { | ||
this.visible = window.pageYOffset > this.visibilityHeight | ||
}, | ||
backToTop() { | ||
const start = window.pageYOffset | ||
let i = 0 | ||
this.interval = setInterval(() => { | ||
const next = Math.floor(this.easeInOutQuad(10 * i, start, -start, 500)) | ||
if (next <= this.backPosition) { | ||
window.scrollTo(0, this.backPosition) | ||
clearInterval(this.interval) | ||
} else { | ||
window.scrollTo(0, next) | ||
} | ||
i++ | ||
}, 16.7) | ||
}, | ||
easeInOutQuad(t, b, c, d) { | ||
if ((t /= d / 2) < 1) return c / 2 * t * t + b | ||
return -c / 2 * (--t * (t - 2) - 1) + b | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
.back-to-ceiling { | ||
position: fixed; | ||
display: inline-block; | ||
text-align: center; | ||
cursor: pointer; | ||
} | ||
.back-to-ceiling:hover { | ||
background: #d5dbe7; | ||
} | ||
.fade-enter-active, | ||
.fade-leave-active { | ||
transition: opacity .5s; | ||
} | ||
.fade-enter, | ||
.fade-leave-to { | ||
opacity: 0 | ||
} | ||
.back-to-ceiling .Icon { | ||
fill: #9aaabf; | ||
background: none; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<template> | ||
<el-breadcrumb class="app-breadcrumb" separator="/"> | ||
<transition-group name="breadcrumb"> | ||
<el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path" v-if='item.meta.title'> | ||
<span v-if='item.redirect==="noredirect"||index==levelList.length-1' class="no-redirect">{{generateTitle(item.meta.title)}}</span> | ||
<router-link v-else :to="item.redirect||item.path">{{generateTitle(item.meta.title)}}</router-link> | ||
</el-breadcrumb-item> | ||
</transition-group> | ||
</el-breadcrumb> | ||
</template> | ||
|
||
<script> | ||
import { generateTitle } from '@/utils/i18n' | ||
export default { | ||
created() { | ||
this.getBreadcrumb() | ||
}, | ||
data() { | ||
return { | ||
levelList: null | ||
} | ||
}, | ||
watch: { | ||
$route() { | ||
this.getBreadcrumb() | ||
} | ||
}, | ||
methods: { | ||
generateTitle, | ||
getBreadcrumb() { | ||
let matched = this.$route.matched.filter(item => item.name) | ||
const first = matched[0] | ||
if (first && first.name !== 'dashboard') { | ||
matched = [{ path: '/dashboard', meta: { title: 'dashboard' }}].concat(matched) | ||
} | ||
this.levelList = matched | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style rel="stylesheet/scss" lang="scss" scoped> | ||
.app-breadcrumb.el-breadcrumb { | ||
display: inline-block; | ||
font-size: 14px; | ||
line-height: 50px; | ||
margin-left: 10px; | ||
.no-redirect { | ||
color: #97a8be; | ||
cursor: text; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
<template> | ||
<div :class="className" :id="id" :style="{height:height,width:width}"></div> | ||
</template> | ||
|
||
<script> | ||
import echarts from 'echarts' | ||
export default { | ||
props: { | ||
className: { | ||
type: String, | ||
default: 'chart' | ||
}, | ||
id: { | ||
type: String, | ||
default: 'chart' | ||
}, | ||
width: { | ||
type: String, | ||
default: '200px' | ||
}, | ||
height: { | ||
type: String, | ||
default: '200px' | ||
} | ||
}, | ||
data() { | ||
return { | ||
chart: null | ||
} | ||
}, | ||
mounted() { | ||
this.initChart() | ||
}, | ||
beforeDestroy() { | ||
if (!this.chart) { | ||
return | ||
} | ||
this.chart.dispose() | ||
this.chart = null | ||
}, | ||
methods: { | ||
initChart() { | ||
this.chart = echarts.init(document.getElementById(this.id)) | ||
const xAxisData = [] | ||
const data = [] | ||
const data2 = [] | ||
for (let i = 0; i < 50; i++) { | ||
xAxisData.push(i) | ||
data.push((Math.sin(i / 5) * (i / 5 - 10) + i / 6) * 5) | ||
data2.push((Math.sin(i / 5) * (i / 5 + 10) + i / 6) * 3) | ||
} | ||
this.chart.setOption( | ||
{ | ||
backgroundColor: '#08263a', | ||
xAxis: [{ | ||
show: false, | ||
data: xAxisData | ||
}, { | ||
show: false, | ||
data: xAxisData | ||
}], | ||
visualMap: { | ||
show: false, | ||
min: 0, | ||
max: 50, | ||
dimension: 0, | ||
inRange: { | ||
color: ['#4a657a', '#308e92', '#b1cfa5', '#f5d69f', '#f5898b', '#ef5055'] | ||
} | ||
}, | ||
yAxis: { | ||
axisLine: { | ||
show: false | ||
}, | ||
axisLabel: { | ||
textStyle: { | ||
color: '#4a657a' | ||
} | ||
}, | ||
splitLine: { | ||
show: true, | ||
lineStyle: { | ||
color: '#08263f' | ||
} | ||
}, | ||
axisTick: { | ||
show: false | ||
} | ||
}, | ||
series: [{ | ||
name: 'back', | ||
type: 'bar', | ||
data: data2, | ||
z: 1, | ||
itemStyle: { | ||
normal: { | ||
opacity: 0.4, | ||
barBorderRadius: 5, | ||
shadowBlur: 3, | ||
shadowColor: '#111' | ||
} | ||
} | ||
}, { | ||
name: 'Simulate Shadow', | ||
type: 'line', | ||
data, | ||
z: 2, | ||
showSymbol: false, | ||
animationDelay: 0, | ||
animationEasing: 'linear', | ||
animationDuration: 1200, | ||
lineStyle: { | ||
normal: { | ||
color: 'transparent' | ||
} | ||
}, | ||
areaStyle: { | ||
normal: { | ||
color: '#08263a', | ||
shadowBlur: 50, | ||
shadowColor: '#000' | ||
} | ||
} | ||
}, { | ||
name: 'front', | ||
type: 'bar', | ||
data, | ||
xAxisIndex: 1, | ||
z: 3, | ||
itemStyle: { | ||
normal: { | ||
barBorderRadius: 5 | ||
} | ||
} | ||
}], | ||
animationEasing: 'elasticOut', | ||
animationEasingUpdate: 'elasticOut', | ||
animationDelay(idx) { | ||
return idx * 20 | ||
}, | ||
animationDelayUpdate(idx) { | ||
return idx * 20 | ||
} | ||
}) | ||
} | ||
} | ||
} | ||
</script> |
Oops, something went wrong.