Browse Source

首页echarts

master
xuhuajiao 1 year ago
parent
commit
1835c2986c
  1. 8
      src/views/archiveUtilize/archiveEditing/index.vue
  2. 197
      src/views/components/echarts/catePie.vue
  3. 44
      src/views/components/echarts/lendAcross.vue
  4. 239
      src/views/components/echarts/serverProgress.vue
  5. 374
      src/views/components/echarts/serverProgress2.vue
  6. 40
      src/views/components/echarts/typePie.vue
  7. 316
      src/views/home copy.vue
  8. 345
      src/views/home.vue
  9. 1
      src/views/system/archiveStatistics/mixins/statistics.js

8
src/views/archiveUtilize/archiveEditing/index.vue

@ -17,19 +17,19 @@
<el-button class="filter-item filter-refresh" size="mini" type="warning" icon="el-icon-refresh-left" @click="resetQuery()">重置</el-button>
<el-checkbox v-model="participants" style="line-height: 32px; padding-left: 10px;" @change="changeMy">我参与得编研</el-checkbox>
</div>
<crudOperation :permission="permission">
<crudOperation>
<template v-slot:left>
<el-button v-permission="permission.add" size="mini" @click="toAdd(1,null)">
<el-button size="mini" @click="toAdd(1,null)">
<i class="iconfont icon-xinzeng" />
新增
</el-button>
<el-button v-permission="permission.edit" size="mini" :disabled="crud.selections.length === 0" @click="toAdd(2,crud.selections[0])">
<el-button size="mini" :disabled="crud.selections.length === 0" @click="toAdd(2,crud.selections[0])">
<i class="iconfont icon-bianji" />
编辑
</el-button>
</template>
<template v-slot:right>
<el-button v-permission="permission.del" size="mini" :loading="crud.delAllLoading" :disabled="crud.selections.length === 0" @click="toDelete(crud.selections)">
<el-button size="mini" :loading="crud.delAllLoading" :disabled="crud.selections.length === 0" @click="toDelete(crud.selections)">
<i class="iconfont icon-shanchu" />
删除
</el-button>

197
src/views/components/echarts/catePie.vue

@ -1,6 +1,6 @@
<template>
<!-- 档案类 -->
<div id="maincate" :style="{height:height,width:width}" />
<!-- 档案类 -->
<div id="main3" :style="{height:height,width:width}" />
</template>
<script>
@ -8,14 +8,14 @@ import echarts from 'echarts'
import resize from '@/views/dashboard/mixins/resize'
export default {
name: 'CatePie',
name: 'AcrossEcharts',
mixins: [resize],
props: {
cateData: {
type: Array,
addArcivesData: {
type: Object,
require: true,
default: function() {
return []
return {}
}
},
width: {
@ -33,7 +33,7 @@ export default {
}
},
watch: {
'cateData': {
'addArcivesData': {
handler(val) {
setTimeout(() => {
this.drawChart()
@ -45,62 +45,178 @@ export default {
},
mounted() {
this.drawChart()
window.addEventListener('resize', this.__resizeHandler)
},
methods: {
drawChart() {
const chartDom = document.getElementById('maincate')
const chartDom = document.getElementById('main3')
this.chart = echarts.init(chartDom)
let option = null
option = {
tooltip: {
trigger: 'item'
grid: { //
left: '2%',
right: '5%',
bottom: '3%',
top: '15%',
containLabel: true
},
legend: {
bottom: 20,
left: 'center',
icon: 'rect',
itemHeight: 14,
itemWidth: 14,
data: ['案卷', '文件'],
right: 20,
top: 0,
icon: 'circle',
textStyle: {
color: '#fff'
color: '#1D2129'
}
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
label: {
backgroundColor: '#339cff'
}
},
formatter: function(params) {
var res = "<div style='width:100%;height:24px;margin-bottom:5px;padding:0 12px;line-height:24px;'><p>" + echarts.format.formatTime('yyyy年M月', new Date(params[0].name)) + ' </p></div>'
for (var i = 0; i < params.length; i++) {
res += `<div style="color: #fff;font-size: 14px; padding:0 12px;line-height: 24px">
<span style="display:inline-block;margin-right:5px;border-radius:2px;width:10px;height:10px;background-color:${[params[i].color]};"></span>
${params[i].seriesName}
${params[i].data}
</div>`
}
return res
}
},
xAxis: {
type: 'category',
data: this.addArcivesData.addArcivesMonth,
axisLine: {// 线
lineStyle: {
color: '#E5E6EB'
}
},
axisLabel: {// x
show: true,
textStyle: {
color: '#A6ADB6'
},
formatter: function(value) {
return echarts.format.formatTime('M月', new Date(value))
}
}
},
yAxis: {
type: 'value',
min: 0,
max: this.addArcivesData.addArcivesMaxCount,
// splitNumber: 5,
axisLine: {// 线
lineStyle: {
color: '#E5E6EB'
}
},
axisLabel: {// x
show: true,
textStyle: {
color: '#A6ADB6'
}
},
axisTick: { // 线
show: false
},
splitLine: {// 线
lineStyle: {
color: '#E5E6EB',
type: 'dashed'
}
}
},
series: [
{
name: '档案类别',
type: 'pie',
radius: ['20%', '50%'],
center: ['50%', '40%'], //
roseType: 'area',
avoidLabelOverlap: false, //
labelLine: {
name: '案卷',
data: this.addArcivesData.addArcivesNum,
type: 'line',
areaStyle: {
normal: {
length: 15, // 线
length2: 60 // 线
color: {
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0.1,
color: 'rgba(22, 93, 255, 0.64)' // 0%
},
{
offset: 0.5,
color: 'rgba(22, 93, 255, 0.3)' // 0%
},
{
offset: 0.7,
color: 'rgba(22, 93, 255, 0.1)' // 0%
},
{
offset: 0.9,
color: 'rgba(0,0,0, 0.1)' // 100%
}
]
// globalCoord: false // false
}
}
},
itemStyle: {
normal: {
label: {
show: true,
formatter: '{c}' // 线
color: '#165DFF', // 线
lineStyle: {
color: '#165DFF' // 线
}
}
},
// label: {
// show: false,
// position: 'center'
// },
emphasis: {
label: {
show: false
}
},
data: [
{ value: this.cateData[0], name: '案卷', itemStyle: { color: '#1CADAB' }},
{ value: this.cateData[1], name: '文件', itemStyle: { color: '#339CFF' }}
{
name: '文件',
data: this.addArcivesData.addArcivesNumFile,
type: 'line',
areaStyle: {
normal: {
color: {
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0.1,
color: 'rgba(20, 201, 201, 0.64)' // 0%
},
{
offset: 0.5,
color: 'rgba(20, 201, 201, 0.3)' // 0%
},
{
offset: 0.7,
color: 'rgba(20, 201, 201, 0.1)' // 0%
},
{
offset: 0.9,
color: 'rgba(0,0,0, 0.1)' // 100%
}
]
// globalCoord: false // false
}
}
},
itemStyle: {
normal: {
color: '#14C9C9', // 线
lineStyle: {
color: '#14C9C9' // 线
}
}
}
}
]
}
@ -111,5 +227,4 @@ export default {
</script>
<style lang="scss" scoped>
</style>

44
src/views/components/echarts/lendAcross.vue

@ -1,5 +1,5 @@
<template>
<!-- 档案借阅 -->
<!-- 档案统计 -->
<div id="mainlend" :style="{height:height,width:width}" />
</template>
@ -11,10 +11,10 @@ export default {
mixins: [resize],
props: {
lendData: {
type: Array,
type: Object,
require: true,
default: function() {
return []
return {}
}
},
width: {
@ -82,18 +82,42 @@ export default {
type: 'shadow'
}
},
legend: {
icon: 'circle',
right: 20,
top: 0
},
grid: { //
left: '10%',
right: '16%',
left: '8%',
right: '5%',
bottom: '3%',
top: '3%',
top: '10%',
containLabel: true
},
xAxis: {
type: 'value',
boundaryGap: [0, 0.01],
axisLine: {// 线
show: false
},
min: 0,
max: this.lendData.archivesTotalNum,
axisLabel: {//
show: true,
textStyle: {
color: '#A6ADB6'
}
},
axisTick: { // 线
show: false
},
splitLine: {// 线
lineStyle: {
color: '#E5E6EB',
type: 'dashed'
}
}
},
yAxis: {
type: 'category',
offset: 20,
@ -117,13 +141,17 @@ export default {
series: [
{
name: '数量',
barWidth: 15, //
showBackground: true,
backgroundStyle: {
color: '#F7BA1E'
},
barWidth: 11, //
barGap: 25,
type: 'bar',
itemStyle: {
color: '#0348F3'
},
data: this.elendData //
data: this.elendData.otherData //
}
]
}

239
src/views/components/echarts/serverProgress.vue

@ -0,0 +1,239 @@
<template>
<div class="chart-wrapper" style="display: flex; justify-content: space-between; align-items: center; overflow: hidden; margin-top: -20px;">
<div class="progress-class">
<el-progress class="differ" type="circle" stroke-linecap="butt" :percentage="21" :stroke-width="30" :width="200" :format="formatterSame" />
<svg width="100%" height="100%">
<defs>
<linearGradient id="red" x1="1" y1="0" x2="0.3" y2="1">
<stop
offset="0%"
style="stop-color: #14C9C9"
stop-opacity="1"
/>
<stop
offset="100%"
style="stop-color: #82DAAC"
stop-opacity="1"
/>
</linearGradient>
</defs>
</svg>
</div>
<div class="progress-right" style="display: flex; flex-wrap: wrap; align-items: center; flex: 1; height: 100%;">
<div class="progress-right-item">
<div class="progress-right-txt right-txt1">
<p>内存占比</p>
<span>65<i>%</i></span>
</div>
<div class="progress-class2">
<el-progress :show-text="false" type="circle" stroke-linecap="butt" :percentage="65" :stroke-width="20" :width="100" :format="formatterSame" />
<svg width="100%" height="100%">
<defs>
<linearGradient id="yellow" x1="1" y1="0" x2="0.3" y2="1">
<stop
offset="0%"
style="stop-color: #FF973E"
stop-opacity="1"
/>
<stop
offset="100%"
style="stop-color: #F7BA1E"
stop-opacity="1"
/>
</linearGradient>
</defs>
</svg>
</div>
</div>
<div class="progress-right-item">
<div class="progress-right-txt right-txt2">
<p>磁盘占比</p>
<span>38<i>%</i></span>
</div>
<div class="progress-class3">
<el-progress :show-text="false" type="circle" stroke-linecap="butt" :percentage="38" :stroke-width="20" :width="100" :format="formatterSame" />
<svg width="100%" height="100%">
<defs>
<linearGradient id="green" x1="1" y1="0" x2="0.3" y2="1">
<stop
offset="0%"
style="stop-color: #14C9C9"
stop-opacity="1"
/>
<stop
offset="100%"
style="stop-color: #82DAAC"
stop-opacity="1"
/>
</linearGradient>
</defs>
</svg>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'ServerProgress',
mixins: [],
props: {
},
data() {
return {
}
},
watch: {
},
mounted() {
},
methods: {
formatterSame(percentage) {
return percentage
}
}
}
</script>
<style lang="scss" scoped>
.dashboard-editor-container {
padding: 20px;
position: relative;
.chart-wrapper {
height: calc(100% - 55px);
}
}
@media (max-width: 1024px) {
.chart-wrapper {
padding: 8px;
}
}
.progress-right-item{
width:100%;
height: calc(100% / 2);
display: flex;
justify-content: flex-start;
align-items: center;
}
.progress-right-txt{
position: relative;
color: #545B65;
font-size: 14px;
padding-left: 12px;
margin-right: 50px;
span{
display: block;
font-size: 20px;
color: #0C0E1E;
padding-top: 4px;
i{
display: inline-block;
font-size: 12px;
color: #A6ADB6;
}
}
&::before{
position: absolute;
left: 0;
top: 50%;
content: '';
width: 4px;
height: 50px;
background: linear-gradient(180deg, #FF9B3B 0%, #F7BA1E 100%);
border-radius: 100px;
transform: translateY(-50%);
}
&.right-txt1{
&::before{
background: linear-gradient(180deg, #FF9B3B 0%, #F7BA1E 100%);
}
}
&.right-txt2{
&::before{
background: linear-gradient(180deg, #14C9C9 0%, #83DBAD 100%);
}
}
}
.progress-class {
position: relative;
width: 200px;
height: 200px;
margin: 0 100px;
::v-deep svg > path:nth-child(2) {
stroke: url(#red);
}
::v-deep .el-progress-circle{
border-radius: 50%;
// box-shadow: 0 12px 12px #FEF1F3;
box-shadow: 0 6px 8px #D9F6F6;
}
}
.progress-class2{
position: relative;
width: 100px;
height: 100px;
::v-deep svg > path:nth-child(2) {
stroke: url(#yellow);
}
::v-deep .el-progress-circle{
border-radius: 50%;
box-shadow: 0 6px 8px #FFDEC1;
}
}
.progress-class3{
position: relative;
width: 100px;
height: 100px;
::v-deep svg > path:nth-child(2) {
stroke: url(#green);
}
::v-deep .el-progress-circle{
border-radius: 50%;
box-shadow: 0 6px 8px #D9F6F6;
}
}
::v-deep .el-progress__text{
white-space: pre;
}
::v-deep .el-progress-circle__track {
stroke: #F1F2F6;
}
.differ {
::v-deep .el-progress__text {
top: 55%;
font-size: 30px !important;
color: #0C0E1E;
&::before {
content: 'CPU占比';
width: 100%;
position: absolute;
top: -85%;
left: 50%;
font-weight: normal;
font-size: 14px;
color: #545B65;
transform: translateX(-50%);
}
&::after {
content: '%';
width: 100%;
position: absolute;
bottom: 6px;
left: 30px;
font-weight: normal;
font-size: 12px;
color: #DEE0E4;
}
}
}
</style>

374
src/views/components/echarts/serverProgress2.vue

@ -0,0 +1,374 @@
<template>
<div id="main4" :style="{height:height,width:width}" />
</template>
<script>
import echarts from 'echarts'
require('echarts/theme/macarons')
import resize from '@/views/dashboard/mixins/resize'
// const gaugeData = [
// {
// value: 20,
// name: 'Perfect',
// title: {
// offsetCenter: ['0%', '-30%']
// },
// detail: {
// valueAnimation: true,
// offsetCenter: ['0%', '-20%']
// }
// },
// {
// value: 40,
// name: 'Good',
// title: {
// offsetCenter: ['0%', '0%']
// },
// detail: {
// valueAnimation: true,
// offsetCenter: ['0%', '10%']
// }
// },
// {
// value: 60,
// name: 'Commonly',
// title: {
// offsetCenter: ['0%', '30%']
// },
// detail: {
// valueAnimation: true,
// offsetCenter: ['0%', '40%']
// }
// }
// ]
export default {
name: 'AcrossEcharts',
mixins: [resize],
props: {
addArcivesData: {
type: Object,
require: true,
default: function() {
return {}
}
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
default: '100%'
}
},
data() {
return {
chart: null
}
},
watch: {
// 'addArcivesData': {
// handler(val) {
// setTimeout(() => {
// this.drawChart()
// }, 100)
// },
// immediate: true,
// deep: true
// }
},
mounted() {
this.drawChart()
window.addEventListener('resize', this.__resizeHandler)
},
methods: {
drawChart() {
const chartDom = document.getElementById('main4')
this.chart = echarts.init(chartDom, 'macarons')
let option = null
option = {
// title: { //
// text: '80%',
// subtext: '',
// itemGap: 10, //
// textStyle: {
// color: '#000', //
// fontStyle: 'normal', // 'normal','italic','oblique'
// fontWeight: 'bold', // 'normal','bold','bolder','lighter',100 | 200 | 300 | 400...// 'serif' , 'monospace', 'Arial', 'Courier New', 'Microsoft YaHei', ...
// fontSize: 30 //
// },
// subtextStyle: {
// color: '#000', //
// fontStyle: 'normal', // 'normal','italic','oblique'
// fontSize: 18 //
// },
// x: 'center', //
// // y: 'center',
// bottom: 40
// },
tooltip: {
formatter: '{a} <br/>{b} : {c}'
},
series: [
{
name: '业务指标',
type: 'gauge',
startAngle: 90, //
endAngle: 180, //
radius: '100%', //
clockwise: true, //
axisLine: { // 线
show: true,
roundCap: false,
clip: false,
lineStyle: {
width: 20,
color: [[1, '#F1F2F6']]
// color: [[0.3, 'rgb(26,143,255)'], [0.5, 'rgb(23,151,255)'], [0.7, 'rgb(13,213,253)'], [0.8, 'rgb(9,237,253)'], [1, 'rgb(70,100,144)']]
// opacity: 0.6, //
}
},
axisLabel: {
show: false
},
splitLine: { // 线,线
show: false
},
// 线
axisTick: {
show: false
},
// data: [{ value: '80' }],
markPoint: {
show: false,
symbol: 'circle',
symbolSize: 0,
data: [
//
{ value: '', x: 'center', y: 'center', itemStyle: { color: '#000' }}
],
itemStyle: {
normal: {
label: {
show: true,
color: '#000', //
fontSize: 0
}
}
}
},
detail: { // ()
show: true, // , true
offsetCenter: [0, 0], //
color: '#000', // , auto
fontSize: 10, // , 15
formatter: '{value}' //
},
pointer: { //
show: false, // , true
length: '60%', // , 80%
width: 15 // , 8
},
itemStyle: { //
color: '#0066FF', // (auto)
opacity: 1, // 0 1 0
borderWidth: 0, // 线, 0 0
borderType: 'solid', // 线 'solid', 'dashed', 'dotted'
borderColor: '#000', // , "#000" color
// shadowBlur: 10, // () shadowColor,shadowOffsetX, shadowOffsetY
shadowColor: '#000' // color
},
//
progress: {
show: true,
overlap: false, //
roundCap: true, //
clip: false, //
//
itemStyle: {
borderWidth: 10,
shadowColor: '',
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: this.startColor // 0% '#02C77E'
},
{
offset: 1,
color: this.endColor // 100% '#017770'
}
],
global: false // false
}
}
},
data: [
{
value: 21,
name: 'CPU占比',
title: {},
detail: {
// title
offsetCenter: ['0%', '0%'],
color: '#01F8FF',
formatter: '{value}%'
// borderColor: '#01F8FF',
// borderRadius: 20,
// borderWidth: 1,
}
}
]
}
]
}
option && this.chart.setOption(option)
}
}
}
</script>
<style lang="scss" scoped>
.dashboard-editor-container {
padding: 20px;
position: relative;
.chart-wrapper {
height: calc(100% - 55px);
}
}
@media (max-width: 1024px) {
.chart-wrapper {
padding: 8px;
}
}
.progress-right-item{
width:100%;
height: calc(100% / 2);
display: flex;
justify-content: flex-start;
align-items: center;
}
.progress-right-txt{
position: relative;
color: #545B65;
font-size: 14px;
padding-left: 12px;
margin-right: 50px;
span{
display: block;
font-size: 20px;
color: #0C0E1E;
padding-top: 4px;
i{
display: inline-block;
font-size: 12px;
color: #A6ADB6;
}
}
&::before{
position: absolute;
left: 0;
top: 50%;
content: '';
width: 4px;
height: 50px;
background: linear-gradient(180deg, #FF9B3B 0%, #F7BA1E 100%);
border-radius: 100px;
transform: translateY(-50%);
}
&.right-txt1{
&::before{
background: linear-gradient(180deg, #FF9B3B 0%, #F7BA1E 100%);
}
}
&.right-txt2{
&::before{
background: linear-gradient(180deg, #14C9C9 0%, #83DBAD 100%);
}
}
}
.progress-class {
position: relative;
width: 200px;
height: 200px;
margin: 0 100px;
::v-deep svg > path:nth-child(2) {
stroke: url(#red);
}
::v-deep .el-progress-circle{
border-radius: 50%;
// box-shadow: 0 12px 12px #FEF1F3;
box-shadow: 0 6px 8px #D9F6F6;
}
}
.progress-class2{
position: relative;
width: 100px;
height: 100px;
::v-deep svg > path:nth-child(2) {
stroke: url(#yellow);
}
::v-deep .el-progress-circle{
border-radius: 50%;
box-shadow: 0 6px 8px #FFDEC1;
}
}
.progress-class3{
position: relative;
width: 100px;
height: 100px;
::v-deep svg > path:nth-child(2) {
stroke: url(#green);
}
::v-deep .el-progress-circle{
border-radius: 50%;
box-shadow: 0 6px 8px #D9F6F6;
}
}
::v-deep .el-progress__text{
white-space: pre;
}
::v-deep .el-progress-circle__track {
stroke: #F1F2F6;
}
.differ {
::v-deep .el-progress__text {
top: 55%;
font-size: 30px !important;
color: #0C0E1E;
&::before {
content: 'CPU占比';
width: 100%;
position: absolute;
top: -85%;
left: 50%;
font-weight: normal;
font-size: 14px;
color: #545B65;
transform: translateX(-50%);
}
&::after {
content: '%';
width: 100%;
position: absolute;
bottom: 6px;
left: 30px;
font-weight: normal;
font-size: 12px;
color: #DEE0E4;
}
}
}
</style>

40
src/views/components/echarts/typePie.vue

@ -1,5 +1,5 @@
<template>
<!-- 档案类 -->
<!-- 档案 -->
<div id="maintype" :style="{height:height,width:width}" />
</template>
@ -73,37 +73,44 @@ export default {
},
drawChart() {
const chartDom = document.getElementById('maintype')
this.chart = echarts.init(chartDom, 'light')
this.chart = echarts.init(chartDom)
let option = null
option = {
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b} : {c} ({d}%)'
},
legend: {
// orient: 'vertical',
orient: 'vertical',
right: 12,
top: 0,
bottom: 20,
left: 'center',
icon: 'rect',
itemHeight: 14,
itemWidth: 14,
textStyle: {
color: '#fff'
color: '#545B65'
},
formatter: function(name) {
if (!name) return ''
if (name.length > 10) {
name = name.slice(0, 10) + '...'
}
return name
}
},
series: [
{
name: '档案类型',
name: '档案类',
type: 'pie',
radius: ['20%', '60%'],
center: ['50%', '35%'], //
radius: ['30%', '80%'],
center: ['35%', '40%'], //
roseType: 'area',
avoidLabelOverlap: true,
labelLine: {
normal: {
length: 2, // 线
length2: 60 // 线
length: 4, // 线
length2: 40 // 线
}
},
itemStyle: {
@ -111,10 +118,19 @@ export default {
label: {
show: true,
formatter: ' {d}%' // 线
},
borderColor: '#fff',
borderWidth: 4,
color: function(params) {
var colorItem = ['#0348F3', '#14C9C9', '#F8B722', '#722ED1', '#F4647B']
var colorList = []
for (var i = 0; i < option.series[0].data.length; i++) {
colorList.push(colorItem[i % 5])
}
return colorList[params.dataIndex]
}
}
},
emphasis: {
label: {
show: false

316
src/views/home copy.vue

@ -1,316 +0,0 @@
<template>
<div class="dashboard-container">
<div class="dashboard-editor-container">
<panel-group />
<el-row :gutter="20" style="margin-bottom:20px;height: 152px;">
<el-col :xs="24" :sm="24" :lg="16">
<div class="container-left search-area">
<span class="right-top-line" />
<span class="left-bottom-line" />
<!-- <SearchAcrives /> -->
</div>
</el-col>
<el-col :xs="24" :sm="24" :lg="8">
<div class="container-left" style="height: 100%;margin: 0">
<span class="right-top-line" />
<span class="left-bottom-line" />
<h3 class=" table-title">
<p class="title-arrow">
<svg-icon icon-class="a-3Dkufang" class-name="warehouse-svg" />3D库房
</p>
</h3>
<div class="warehouse-tab">
<ul class="warehouse-nav">
<li @click="changeActiveTab(0)">
<span />
<p>全景图</p>
</li>
<li @click="changeActiveTab(1)">
<span />
<p>档案库</p>
</li>
<li @click="changeActiveTab(2)">
<span />
<p>整理室</p>
</li>
<li @click="changeActiveTab(3)">
<span />
<p>阅览室</p>
</li>
</ul>
</div>
</div>
</el-col>
</el-row>
<el-row :gutter="20" style="margin-bottom:20px;height: calc(50vh - 251px);">
<el-col :xs="24" :sm="24" :lg="8">
<!-- 待办事项 -->
<div class="container-wrap">
<span class="right-top-line" />
<span class="left-bottom-line" />
<h3 class="table-title">
<p class="title-arrow">
<svg-icon icon-class="tongzhigonggao" class-name="warehouse-svg" />待办事项
</p>
</h3>
<div style="height: calc(100% - 40px);overflow-y: auto;overflow-x: hidden;">
<ul v-if="waitBorrowerData.length !== 0" class="todo-list">
<li v-for="(item,index) in waitBorrowerData" :key="index">
<el-tooltip class="item" effect="dark" :content="item.title" :enterable="false" placement="top">
<p>{{ item.title }}</p>
</el-tooltip>
<span>{{ item.update_time | parseTime }}</span>
</li>
</ul>
<div v-else class="empty-main" style="height: 100%;">
<svg-icon icon-class="empty" class-name="empty-img" />
<p>暂无数据</p>
</div>
</div>
</div>
</el-col>
<el-col :xs="24" :sm="24" :lg="8">
<!-- 门禁记录 -->
<security-door :height="'calc(100% - 40px)'" />
</el-col>
<el-col :xs="24" :sm="24" :lg="8">
<!-- 报警记录 -->
<warehouse-warning :height="'calc(100% - 40px)'" />
</el-col>
</el-row>
<el-row :gutter="20" style="height: calc(50vh - 251px);">
<el-col :xs="24" :sm="24" :lg="8">
<!-- 档案借阅 -->
<div class="container-wrap">
<span class="right-top-line" />
<span class="left-bottom-line" />
<h3 class="table-title">
<p class="title-arrow">档案借阅</p>
</h3>
<div class="chart-wrapper">
<lend-across :lend-data="lendData" />
</div>
</div>
</el-col>
<el-col :xs="24" :sm="24" :lg="8">
<!-- 档案类别 -->
<div class="container-wrap">
<span class="right-top-line" />
<span class="left-bottom-line" />
<h3 class="table-title">
<p class="title-arrow">档案类别</p>
</h3>
<div class="chart-wrapper">
<cate-pie :cate-data="cateData" />
</div>
</div>
</el-col>
<el-col :xs="24" :sm="24" :lg="8">
<!-- 档案类型 -->
<div class="container-wrap">
<span class="right-top-line" />
<span class="left-bottom-line" />
<h3 class="table-title">
<p class="title-arrow">档案类型</p>
</h3>
<div v-if="typeData.length !== 0" class="chart-wrapper">
<type-pie :type-data="typeData" />
</div>
<div v-else class="empty-main">
<svg-icon icon-class="empty" class-name="empty-img" />
<p>暂无数据</p>
</div>
</div>
</el-col>
</el-row>
</div>
</div>
</template>
<script>
import PanelGroup from './dashboard/PanelGroup'
import lendAcross from '@/views/components/echarts/lendAcross.vue'
import catePie from '@/views/components/echarts/catePie.vue'
import typePie from '@/views/components/echarts/typePie.vue'
import WarehouseWarning from '@/views/components/WarehouseWarning'
import SecurityDoor from '@/views/components/SecurityDoor'
// import SearchAcrives from '@/views/archivesManage/archivesSearch/index'
import { statisticsCrud } from '@/views/system/archiveStatistics/mixins/statistics'
import { FetchWaitBorrower } from '@/api/archivesManage/lendManage'
export default {
name: 'Dashboard',
components: {
WarehouseWarning,
SecurityDoor,
PanelGroup,
lendAcross,
catePie,
typePie
// SearchAcrives
},
mixins: [statisticsCrud],
data() {
return {
waitBorrowerData: []
}
},
created() {
this.getWaitBorrower()
},
methods: {
getWaitBorrower() {
FetchWaitBorrower().then(data => {
if (data) {
this.waitBorrowerData = data
}
})
},
changeActiveTab(id) {
this.$router.push({
name: 'warehouse3D',
params: {
roomId: id
}
})
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.dashboard-editor-container {
padding: 20px;
position: relative;
.chart-wrapper {
height: calc(100% - 40px);
}
}
@media (max-width: 1024px) {
.chart-wrapper {
padding: 8px;
}
}
.warehouse-tab {
.warehouse-nav {
display: flex;
justify-content: space-around;
position: absolute;
bottom: 15px;
z-index: 11;
width: 100%;
padding: 0;
li {
display: flex;
flex-direction: column;
align-items: center;
flex-wrap: nowrap;
align-content: center;
justify-content: center;
height: 90px;
text-align: right;
font-size: 14px;
position: relative;
&:hover {
cursor: pointer;
}
span {
width: 72px;
height: 52px;
margin-bottom: 7px;
}
p {
text-align: left;
}
&:first-child span {
background: url("~@/assets/images/tab_fullview_logo.png") no-repeat;
}
&:nth-child(2) span {
background: url("~@/assets/images/tab_archives_logo.png") no-repeat;
}
&:nth-child(3) span {
background: url("~@/assets/images/tab_collate_logo.png") no-repeat;
}
&:nth-child(4) span {
background: url("~@/assets/images/tab_read_logo.png") no-repeat;
}
}
}
}
.el-col {
height: 100%;
}
.container-left,
.container-right,
.container-wrap,
.el-card,
.header-container-wrap {
min-height: 100%;
}
.warehose-el-table ::v-deep .el-table__header-wrapper {
box-shadow: inset 0px 0px 6px 1px #339cff;
background: none !important;
}
.container-wrap {
min-height: auto;
height: 100%;
}
.todo-list {
padding: 0 20px;
& li {
height: 42px;
line-height: 42px;
margin-bottom: 10px;
font-size: 13px;
color: #ffffff;
background: #02255f;
box-shadow: inset 0px 0px 6px 1px #339cff;
border-radius: 26px;
opacity: 1;
cursor: pointer;
& p {
display: inline-block;
width: calc(100% - 140px);
padding-left: 10px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
word-break: break-all;
}
& span {
float: right;
padding-right: 10px;
}
}
}
::v-deep
.el-table--striped
.el-table__body
tr.el-table__row--striped
td.el-table__cell {
background: #02255f;
}
.search-area {
width: 100%;
height: 100%;
margin: 0;
display: flex;
align-items: center;
justify-content: center;
}
::v-deep .search-main{
padding: 0 62px;
.head-container{
padding: 0;
width: 100% !important;
.search-input {
width: 100% !important;
}
.input-with-select{
width: 100% !important;
}
}
}
</style>

345
src/views/home.vue

@ -13,7 +13,7 @@
<div class="home-flowable" style="height: calc(100% - 54px); overflow-x: hidden;">
<div class="home-tab">
<span :class="{'home-tab-active': flowableTabIndex == 0}">待处理({{ flowableData.length !==0? flowableData.length: 0 }})</span>
<span :class="{'home-tab-active': flowableTabIndex == 1}">更多流程</span>
<span :class="{'home-tab-active': flowableTabIndex == 1}" @click="toMoreProcess">更多流程</span>
</div>
<div class="home-flowable-list" style="height: calc(100% - 45px); overflow-y: auto; overflow-x: hidden;">
<el-table v-if="flowableData.length !== 0" height="calc(100%)" :data="flowableData" stripe style="width: 100%">
@ -40,82 +40,9 @@
<h3 class="home-item-title">
服务器监控
</h3>
<div class="chart-wrapper" style="display: flex; justify-content: space-between; align-items: center; overflow: hidden; margin-top: -20px;">
<div class="progress-class">
<el-progress class="differ" type="circle" stroke-linecap="butt" :percentage="21" :stroke-width="30" :width="200" :format="formatterSame" />
<svg width="100%" height="100%">
<defs>
<linearGradient id="red" x1="1" y1="0" x2="0.3" y2="1">
<stop
offset="0%"
style="stop-color: #14C9C9"
stop-opacity="1"
/>
<stop
offset="100%"
style="stop-color: #82DAAC"
stop-opacity="1"
/>
</linearGradient>
</defs>
</svg>
</div>
<div class="progress-right" style="display: flex; flex-wrap: wrap; align-items: center; flex: 1; height: 100%;">
<div class="progress-right-item">
<div class="progress-right-txt right-txt1">
<p>内存占比</p>
<span>65<i>%</i></span>
</div>
<div class="progress-class2">
<el-progress :show-text="false" type="circle" stroke-linecap="butt" :percentage="65" :stroke-width="20" :width="100" :format="formatterSame" />
<svg width="100%" height="100%">
<defs>
<linearGradient id="yellow" x1="1" y1="0" x2="0.3" y2="1">
<stop
offset="0%"
style="stop-color: #FF973E"
stop-opacity="1"
/>
<stop
offset="100%"
style="stop-color: #F7BA1E"
stop-opacity="1"
/>
</linearGradient>
</defs>
</svg>
</div>
</div>
<div class="progress-right-item">
<div class="progress-right-txt right-txt2">
<p>磁盘占比</p>
<span>38<i>%</i></span>
</div>
<div class="progress-class3">
<el-progress :show-text="false" type="circle" stroke-linecap="butt" :percentage="38" :stroke-width="20" :width="100" :format="formatterSame" />
<svg width="100%" height="100%">
<defs>
<linearGradient id="green" x1="1" y1="0" x2="0.3" y2="1">
<stop
offset="0%"
style="stop-color: #14C9C9"
stop-opacity="1"
/>
<stop
offset="100%"
style="stop-color: #82DAAC"
stop-opacity="1"
/>
</linearGradient>
</defs>
</svg>
</div>
</div>
</div>
</div>
<!-- <div class="chart-wrapper"> -->
<serverProgress />
<!-- </div> -->
</div>
</el-col>
</el-row>
@ -128,31 +55,35 @@
<h3 class="home-item-title">
档案统计
</h3>
<div class="chart-wrapper">
<div v-if="lendData.otherData.length !== 0" class="chart-wrapper">
<lend-across :lend-data="lendData" />
</div>
<div v-else class="empty-main">
<svg-icon icon-class="empty" class-name="empty-img" />
<p>暂无数据</p>
</div>
</div>
</el-col>
<el-col :xs="24" :sm="24" :lg="8">
<!-- 档案类别 -->
<!-- 档案类 -->
<div class="container-wrap">
<span class="right-top-line" />
<span class="left-bottom-line" />
<h3 class="home-item-title">
档案类
档案类
</h3>
<div class="chart-wrapper">
<cate-pie :cate-data="cateData" />
<cate-pie :add-arcives-data="addArcivesData" />
</div>
</div>
</el-col>
<el-col :xs="24" :sm="24" :lg="8">
<!-- 档案类 -->
<!-- 档案 -->
<div class="container-wrap">
<span class="right-top-line" />
<span class="left-bottom-line" />
<h3 class="home-item-title">
档案类
档案
</h3>
<div v-if="typeData.length !== 0" class="chart-wrapper">
<type-pie :type-data="typeData" />
@ -173,6 +104,7 @@ import PanelGroup from './dashboard/PanelGroup'
import lendAcross from '@/views/components/echarts/lendAcross.vue'
import catePie from '@/views/components/echarts/catePie.vue'
import typePie from '@/views/components/echarts/typePie.vue'
import serverProgress from '@/views/components/echarts/serverProgress.vue'
import { FetchMainData } from '@/api/archivesManage/library'
import { mapGetters } from 'vuex'
@ -182,7 +114,8 @@ export default {
PanelGroup,
lendAcross,
catePie,
typePie
typePie,
serverProgress
},
data() {
return {
@ -195,9 +128,20 @@ export default {
archivesTotalNum: 0,
flowableData: [],
flowableTabIndex: 0,
lendData: [],
lendData: {
archivesTotalNum: null,
otherData: []
},
cateData: [],
typeData: []
typeData: [],
addArcivesData: {
addArcivesMaxCount: null,
addArcivesMonth: [],
addArcivesNum: [],
addArcivesNumFile: []
},
echartsTimer: null,
refreshtime: 10000
}
},
computed: {
@ -207,10 +151,31 @@ export default {
},
created() {
this.handleMainData()
// this.get()
},
mounted() {
// const _this = this
// //
// this.echartsTimer = setInterval(() => {
// _this.lendData = {
// archivesTotalNum: null,
// otherData: []
// }
// _this.cateData = []
// _this.typeData = []
// _this.addArcivesData = {
// addArcivesMaxCount: null,
// addArcivesMonth: [],
// addArcivesNum: [],
// addArcivesNumFile: []
// }
// _this.handleMainData()
// }, this.refreshtime)
},
methods: {
formatterSame(percentage) {
return percentage
toMoreProcess() {
this.$router.push({ path: '/user/center?activeIndex=2' })
},
handleMainData() {
const fondsAffiliation = []
@ -226,20 +191,80 @@ export default {
fileNum: data.fileNum
}
this.flowableData = data.flows
this.archivesTotalNum = data.archivesTotalNum
// '', '', '', '', '', '', ''
// "archivesTotalNum": 3, //
// "archivesTagNum": 1, //
// "installNum": 0, //
// "storageNum": 0, //
// "borrowNum": 0, //
// "openNum": 0, //
// "entityNum": 3, //
// "approveNum": 2 //
this.lendData = [
// "archivesTotalNum archivesTagNum installNum storageNum borrowNum openNum entityNum approveNum
//
this.lendData.archivesTotalNum = data.archivesTotalNum
this.lendData.otherData = [
data.archivesTagNum, data.installNum, data.storageNum, data.borrowNum, data.openNum, data.entityNum, data.approveNum
]
//
let maxCount = 0
data.statisNumJSON.archives.forEach(archive => {
if (archive.count > maxCount) {
maxCount = archive.count
}
})
data.statisNumJSON.singles.forEach(single => {
if (single.count > maxCount) {
maxCount = single.count
}
})
this.addArcivesData.addArcivesMaxCount = maxCount
const currentDate = new Date() //
const currentYear = currentDate.getFullYear() //
const currentMonth = currentDate.getMonth() // 0 11 1
let startYear = currentYear - 1 //
let startMonth = currentMonth + 1 // 1
const result = [] //
const xResult = []
while (startYear < currentYear || startMonth <= currentMonth) {
xResult.push(startYear + '/' + startMonth)
result.push({ year: startYear, month: startMonth, archivesCount: 0, singlesCount: 0 })
//
startMonth += 1
if (startMonth > 12) {
startYear += 1
startMonth = 1
}
}
result.forEach(yearMonthObj => {
data.statisNumJSON.archives.forEach(archive => {
if (parseInt(archive.month) === yearMonthObj.month) {
yearMonthObj.archivesCount = archive.count
return
}
})
data.statisNumJSON.singles.forEach(single => {
if (parseInt(single.month) === yearMonthObj.month) {
yearMonthObj.singlesCount = single.count
return
}
})
})
this.addArcivesData.addArcivesMonth = xResult
this.addArcivesData.addArcivesNum = result.map(function(obj) {
return obj.archivesCount
})
this.addArcivesData.addArcivesNumFile = result.map(function(obj) {
return obj.singlesCount
})
//
for (const type in data.typeGroupBy) {
if (data.typeGroupBy.hasOwnProperty(type)) {
this.typeData.push({ name: type, value: data.typeGroupBy[type] })
}
}
})
}
}
@ -326,128 +351,4 @@ export default {
::v-deep .home-flowable-list .el-table__body-wrapper::-webkit-scrollbar-corner {
background-color: #DDE8FB !important;
}
.progress-right-item{
width:100%;
height: calc(100% / 2);
display: flex;
justify-content: flex-start;
align-items: center;
}
.progress-right-txt{
position: relative;
color: #545B65;
font-size: 14px;
padding-left: 12px;
margin-right: 50px;
span{
display: block;
font-size: 20px;
color: #0C0E1E;
padding-top: 4px;
i{
display: inline-block;
font-size: 12px;
color: #A6ADB6;
}
}
&::before{
position: absolute;
left: 0;
top: 50%;
content: '';
width: 4px;
height: 50px;
background: linear-gradient(180deg, #FF9B3B 0%, #F7BA1E 100%);
border-radius: 100px;
transform: translateY(-50%);
}
&.right-txt1{
&::before{
background: linear-gradient(180deg, #FF9B3B 0%, #F7BA1E 100%);
}
}
&.right-txt2{
&::before{
background: linear-gradient(180deg, #14C9C9 0%, #83DBAD 100%);
}
}
}
.progress-class {
position: relative;
width: 200px;
height: 200px;
margin: 0 100px;
::v-deep svg > path:nth-child(2) {
stroke: url(#red);
}
::v-deep .el-progress-circle{
border-radius: 50%;
// box-shadow: 0 12px 12px #FEF1F3;
box-shadow: 0 6px 8px #D9F6F6;
}
}
.progress-class2{
position: relative;
width: 100px;
height: 100px;
::v-deep svg > path:nth-child(2) {
stroke: url(#yellow);
}
::v-deep .el-progress-circle{
border-radius: 50%;
box-shadow: 0 6px 8px #FFDEC1;
}
}
.progress-class3{
position: relative;
width: 100px;
height: 100px;
::v-deep svg > path:nth-child(2) {
stroke: url(#green);
}
::v-deep .el-progress-circle{
border-radius: 50%;
box-shadow: 0 6px 8px #D9F6F6;
}
}
::v-deep .el-progress__text{
white-space: pre;
}
::v-deep .el-progress-circle__track {
stroke: #F1F2F6;
}
.differ {
::v-deep .el-progress__text {
top: 55%;
font-size: 30px !important;
color: #0C0E1E;
&::before {
content: 'CPU占比';
width: 100%;
position: absolute;
top: -85%;
left: 50%;
font-weight: normal;
font-size: 14px;
color: #545B65;
transform: translateX(-50%);
}
&::after {
content: '%';
width: 100%;
position: absolute;
bottom: 6px;
left: 30px;
font-weight: normal;
font-size: 12px;
color: #DEE0E4;
}
}
}
</style>

1
src/views/system/archiveStatistics/mixins/statistics.js

@ -15,7 +15,6 @@ export const statisticsCrud = {
}
},
lendData: [],
serviceData: [],
cateData: [],
typeData: [],
storageData: {

Loading…
Cancel
Save