You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

164 lines
4.0 KiB

1 year ago
<template>
<div style="padding:20px 0">
<el-row :gutter="20" class='elrows'>
<el-col :span="24">
<PanelGroup :totaldata="list"></PanelGroup>
</el-col>
<el-col :span="12" class="chartSize">
<div style="padding:10px;color:#b3241d;font-size:18px">月度上传档案统计</div>
<myecharts :width="'100%'" :height="'300px'" :data="overall_month_data"></myecharts>
</el-col>
<el-col :span="12" class="chartSize">
<div style="padding:10px;color:#b3241d;font-size:18px">组织档案统计</div>
<myecharts :width="'100%'" :height="'300px'" :data="overall_originze_data"></myecharts>
</el-col>
</el-row>
</div>
</template>
<script>
import myecharts from '@/components/myecharts';
import PanelGroup from './components/PanelGroup';
1 year ago
import {
home
1 year ago
} from "@/api/home"
import {
index
} from "@/api/system/baseForm.js"
1 year ago
export default {
components: {
myecharts,
PanelGroup
},
data() {
return {
1 year ago
list: {
recordsTotal: 0,
organizesTotal: 0,
1 year ago
areasTotal: 0,
dateTotal:0
},
nowDate:'',
1 year ago
overall_month_data: {},
overall_originze_data: {}
}
},
watch: {
},
created() {
1 year ago
this.listHome()
1 year ago
this.init()
this.getList()
1 year ago
},
mounted() {
},
1 year ago
methods: {
async getList() {
this.nowDate = this.$moment().format("YYYY-MM-DD")
1 year ago
this.startDate = this.$moment('1900-01-01').format("YYYY-MM-DD")
console.log("this.nowDate",this.nowDate,this.startDate)
1 year ago
const res = await index({
page_size: 9999,
page: 1,
table_name: 'records',
is_auth: 1,
catalogs_id: '',
filter:[{
key:'end_date',
op:'range',
1 year ago
value:[this.startDate,this.nowDate]
1 year ago
},{
key:'status',
op:'eq',
value:0
}]
})
this.list.dateTotal = res.total
},
1 year ago
async listHome() {
1 year ago
const res = await home()
this.list.recordsTotal = res?.recordsTotal
this.list.organizesTotal = res?.organizesTotal
this.list.areasTotal = res?.areasTotal
1 year ago
let xMonth = []
let dMonth = []
res.list.map(item => {
xMonth.push(item.month)
dMonth.push(item.count)
})
this.overall_month_data.x = xMonth
this.overall_month_data.list[0].data = dMonth
let oData = []
res.organizesList.map(o => {
oData.push({
value: o.total,
name: o.name
})
})
this.overall_originze_data.list[0].data = oData
},
1 year ago
init() {
this.overall_month_data = {
xShow: true,
yShow: true,
1 year ago
rotate: 20,
1 year ago
// formatter:function(params){
// return that.chartFomatter(params)
// },
1 year ago
xAxis: {
axisLabel: {
show: true,
rotate: 35, //35度角倾斜显示
},
},
x: [],
1 year ago
list: [{
name: "上传数",
1 year ago
data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
1 year ago
type: 'bar',
barGap: '0%',
}]
}
this.overall_originze_data = {
trigger: 'item',
xShow: false,
yShow: false,
list: [{
1 year ago
name: '档案数',
1 year ago
type: 'pie',
radius: '80%',
// center:['20%','20%'],
1 year ago
data: [],
1 year ago
label: {
show: false,
position: 'center'
},
}]
}
}
},
}
</script>
<style lang="scss" scoped>
.elrows {
// margin: 0 !important;
.el-col {
padding: 10px !important
}
.chartSize {
1 year ago
width: calc(50% - 20px) !important;
margin: 10px !important;
1 year ago
background: #fff;
}
}
4 years ago
</style>