Merge branch 'update' into develop
This commit is contained in:
@@ -68,6 +68,7 @@ export default {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-right: 8px;
|
||||
}
|
||||
.file{
|
||||
width: 80px;
|
||||
|
||||
@@ -1,143 +0,0 @@
|
||||
<template>
|
||||
<div class="dashbord-line-box">
|
||||
<div class="dashbord-line-title">Gva 仓库commit 记录</div>
|
||||
<div
|
||||
ref="echart"
|
||||
class="dashbord-line"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import echarts from 'echarts'
|
||||
import 'echarts/theme/macarons'
|
||||
|
||||
var dataAxis = []
|
||||
for (var i = 1; i < 21; i++) {
|
||||
dataAxis.push(`${i}号`)
|
||||
}
|
||||
var data = [
|
||||
220,
|
||||
182,
|
||||
191,
|
||||
234,
|
||||
290,
|
||||
330,
|
||||
310,
|
||||
123,
|
||||
442,
|
||||
321,
|
||||
90,
|
||||
149,
|
||||
210,
|
||||
122,
|
||||
133,
|
||||
334,
|
||||
198,
|
||||
123,
|
||||
125,
|
||||
220,
|
||||
]
|
||||
var yMax = 500
|
||||
var dataShadow = []
|
||||
|
||||
// eslint-disable-next-line no-redeclare
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
dataShadow.push(yMax)
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'Line',
|
||||
data() {
|
||||
return {
|
||||
chart: null,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.initChart()
|
||||
})
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (!this.chart) {
|
||||
return
|
||||
}
|
||||
this.chart.dispose()
|
||||
this.chart = null
|
||||
},
|
||||
methods: {
|
||||
initChart() {
|
||||
this.chart = echarts.init(this.$refs.echart, 'macarons')
|
||||
this.setOptions()
|
||||
},
|
||||
setOptions() {
|
||||
this.chart.setOption({
|
||||
xAxis: {
|
||||
data: dataAxis,
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
axisLine: {
|
||||
show: false,
|
||||
},
|
||||
z: 10,
|
||||
},
|
||||
yAxis: {
|
||||
axisLine: {
|
||||
show: false,
|
||||
},
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
axisLabel: {
|
||||
textStyle: {
|
||||
color: '#999',
|
||||
},
|
||||
},
|
||||
},
|
||||
dataZoom: [
|
||||
{
|
||||
type: 'inside',
|
||||
},
|
||||
],
|
||||
series: [
|
||||
{
|
||||
type: 'bar',
|
||||
itemStyle: {
|
||||
borderRadius: [5, 5, 0, 0],
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: '#83bff6' },
|
||||
{ offset: 0.5, color: '#188df0' },
|
||||
{ offset: 1, color: '#188df0' },
|
||||
]),
|
||||
},
|
||||
emphasis: {
|
||||
itemStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: '#2378f7' },
|
||||
{ offset: 0.7, color: '#2378f7' },
|
||||
{ offset: 1, color: '#83bff6' },
|
||||
]),
|
||||
},
|
||||
},
|
||||
data: data,
|
||||
},
|
||||
],
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.dashbord-line-box {
|
||||
padding: 20px;
|
||||
.dashbord-line {
|
||||
background-color: #fff;
|
||||
height: 360px;
|
||||
width: calc(100% - 40px);
|
||||
}
|
||||
.dashbord-line-title {
|
||||
color: rgb(56, 137, 206);
|
||||
font-size: 18px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,54 +0,0 @@
|
||||
<template>
|
||||
<div class="commit-table">
|
||||
<div class="commit-table-title">Gva 仓库commit 记录</div>
|
||||
<el-table v-loading="loading" :data="dataTimeline" style="width: 100%">
|
||||
<el-table-column prop="from" show-overflow-tooltip label="日期" width="180" />
|
||||
<el-table-column prop="title" show-overflow-tooltip label="推送者" width="120" />
|
||||
<el-table-column prop="message" show-overflow-tooltip label="commit 信息" />
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { Commits } from '@/api/github'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
dataTimeline: [],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.loadCommits()
|
||||
},
|
||||
methods: {
|
||||
loadCommits() {
|
||||
Commits(0).then(({ data }) => {
|
||||
this.loading = false
|
||||
data.forEach((element, index) => {
|
||||
if (element.commit.message && index < 6) {
|
||||
this.dataTimeline.push({
|
||||
from: new Date(element.commit.author.date),
|
||||
title: element.commit.author.name,
|
||||
showDayAndMonth: true,
|
||||
message: element.commit.message,
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.commit-table{
|
||||
padding: 20px;
|
||||
background-color: #fff;
|
||||
height: 400px;
|
||||
&-title{
|
||||
color: rgb(56,137,206);
|
||||
font-size: 18px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -2,7 +2,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-upload
|
||||
class="image-uploader"
|
||||
:action="`${path}/fileUploadAndDownload/upload`"
|
||||
:headers="{ 'x-token': token }"
|
||||
:show-file-list="false"
|
||||
@@ -10,8 +9,7 @@
|
||||
:before-upload="beforeImageUpload"
|
||||
:multiple="false"
|
||||
>
|
||||
<img v-if="imageUrl" :src="showImageUrl" class="image">
|
||||
<i v-else class="el-icon-plus image-uploader-icon" />
|
||||
<el-button size="mini" type="primary">压缩上传</el-button>
|
||||
</el-upload>
|
||||
</div>
|
||||
</template>
|
||||
@@ -53,6 +51,13 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
beforeImageUpload(file) {
|
||||
const isJPG = file.type === 'image/jpeg'
|
||||
const isPng = file.type === 'image/png'
|
||||
if (!isJPG && !isPng) {
|
||||
this.$message.error('上传头像图片只能是 jpg或png 格式!')
|
||||
return false
|
||||
}
|
||||
|
||||
const isRightSize = file.size / 1024 < this.fileSize
|
||||
if (!isRightSize) {
|
||||
// 压缩
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<div
|
||||
class="warning-bar"
|
||||
>
|
||||
<el-icon>
|
||||
<warning-filled />
|
||||
</el-icon>
|
||||
<span>
|
||||
{{ title }}
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { WarningFilled } from '@element-plus/icons'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
[WarningFilled.name]: WarningFilled
|
||||
},
|
||||
props: {
|
||||
title: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.warning-bar{
|
||||
background-color: #FFF5ED;
|
||||
font-size: 14px;
|
||||
padding: 6px 14px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-radius: 2px;
|
||||
.el-icon{
|
||||
font-size: 18px;
|
||||
color: #ED6A0C;
|
||||
}
|
||||
margin-bottom: 12px;
|
||||
span{
|
||||
line-height: 22px;
|
||||
color:#F67207;
|
||||
margin-left: 8px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user