| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
- <!-- -->
- <template>
- <div>
- <el-container>
- <el-aside width="40%">
- <el-tree
- :style="{'max-height': maxHeight +'px'}"
- style="overflow:auto;"
- class="filter-tree"
- :data="treeData"
- accordion
- :props="defaultProps"
- node-key="id"
- default-expand-all
- ref="tree">
- <div class="custom-tree-node" slot-scope="{ node, data }">
- <span style="float:left;">{{ data.type=='1'? '签到 ':'签退 '}}</span>
- <span style="margin-left: 10px;">{{ data.stTm }}</span>
- <span> - </span>
- <span>{{ data.enTm }}</span>
- </div>
- </el-tree>
- </el-aside>
- <el-main style="width:100%;height:100%;padding:10px;">
- <div style="width:27vw;height:20vh;" ref="lineChart"></div>
- </el-main>
- </el-container>
- </div>
- </template>
- <script>
- //这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
- //例如:import 《组件名称》 from '《组件路径》';
- import echarts from 'echarts'
- import { getSginListsNoPage } from "../../api/meetingAPI.js";
- export default {
- //import引入的组件需要注入到对象中才能使用
- components: {},
- props:['meetingInfoRow'],
- data() {
- //这里存放数据
- return {
- maxHeight:200,
- treeData:[],
- defaultProps: {
- // children: 'children',
- label: 'type'
- },
- };
- },
- //监听属性 类似于data概念
- computed: {},
- //监控data中的数据变化
- watch: {},
- //方法集合
- methods: {
- //获取签到基准数据
- getSginTableData(){
- var _self = this;
- let obj = {
- "meetId":_self.meetingInfoRow.id,
- }
- getSginListsNoPage(obj).then(response => {
- _self.treeData = response.data;
- });
- },
- //绘制图表
- initIncChart:function(){
- var _this = this;
- let chart = echarts.init(this.$refs['lineChart']);
- let option = {
- backgroundColor: '#FFF',
- grid: {
- top: '9%',
- bottom: '19%',
- left: '6%',
- right: '4%'
- },
- tooltip: {
- trigger: 'axis',
- label: {
- show: true
- }
- },
- xAxis: {
- boundaryGap: true, //默认,坐标轴留白策略
- axisLine: {
- show: false
- },
- splitLine: {
- show: false
- },
- axisTick: {
- show: false,
- alignWithLabel: true
- },
- data: ['2:00','2:30','3:00','3:30','4:00']
- },
- yAxis: {
- axisLine: {
- show: false
- },
- splitLine: {
- show: true,
- lineStyle: {
- type: 'dashed',
- color: 'rgba(33,148,246,0.2)'
- }
- },
- axisTick: {
- show: false
- },
- splitArea: {
- show: true,
- areaStyle: {
- color: 'rgb(245,250,254)'
- }
- }
- },
- series: [{
- type: 'line',
- symbol: 'circle',
- symbolSize: 7,
- lineStyle: {
- color: 'rgb(33,148,246)',
- shadowBlur: 12,
- shadowColor: 'rgb(33,148,246,0.9)',
- shadowOffsetX: 1,
- shadowOffsetY: 1
- },
- itemStyle: {
- color: 'rgb(33,148,246)',
- borderWidth: 1,
- borderColor: '#FFF'
- },
- label: {
- show: false,
- distance: 1,
- emphasis: {
- show: true,
- offset: [25, -2],
- color: '#FFF',
- padding: [8, 20, 8, 6],
- height: 36,
- formatter: function(params) {
- var name = params.name;
- var value = params.data;
- var str = name + '\n数据量:' + value;
- return str;
- },
- rich: {
- bg: {
-
- width: 78,
- //height:42,
- color: '#FFF',
- padding: [20, 0, 20, 10]
- },
- br: {
- width: '100%',
- height: '100%'
- }
- }
- }
- },
- data: [2,10,14,20,33]
- }]
- };
- chart.setOption(option);
- },
- },
- //生命周期 - 创建完成(可以访问当前this实例)
- created() {
- },
- //生命周期 - 挂载完成(可以访问DOM元素)
- mounted() {
- this.getSginTableData();
- this.initIncChart();
- },
- beforeCreate() {}, //生命周期 - 创建之前
- beforeMount() {}, //生命周期 - 挂载之前
- beforeUpdate() {}, //生命周期 - 更新之前
- updated() {}, //生命周期 - 更新之后
- beforeDestroy() {}, //生命周期 - 销毁之前
- destroyed() {}, //生命周期 - 销毁完成
- activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
- }
- </script>
- <style scoped>
- </style>
|