Skip to content

Commit

Permalink
Issue echarts随着窗口缩放自适应
Browse files Browse the repository at this point in the history
  • Loading branch information
enilu committed Apr 28, 2020
1 parent eb4761e commit 11551bd
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
7 changes: 6 additions & 1 deletion docs/other/changeLog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# change log

## latest

## 1.5
[gitee](https://gitee.com/enilu/web-flash/releases/1.5)
[github](https://github.com/enilu/web-flash/releases/tag/1.5)
### Issues
- Issue 压缩svg图标文件
- Issue 完善权限管理
Expand All @@ -12,11 +15,13 @@
- Issue BaseRepository封装根据sql查询数据返回Map或List方法
- Issue BaseRepository封装根据sql查询返回指定对象(列表)方法
- Change BaseRepository 去掉根据sql查询返回Object数组的方法
- Issue echarts随着窗口缩放自适应

### Fixes
- Fix 业务日志中如果获取不到字段值对应的中文名称则返回字段名本身,代替之前的null
- Fix 超级管理员判断错误
- Fix SearchFilter构建查询条件中的问题 bug
- Fix 更新缓存的时候连带更新常量工具类中使用的本地(TimeCacheMap)缓存

## 1.4
[gitee](https://gitee.com/enilu/web-flash/releases/1.4)
Expand Down
1 change: 1 addition & 0 deletions flash-vue-admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"dependencies": {
"axios": "0.18.0",
"element-ui": "2.11.0",
"element-resize-detector": "^1.2.1",
"js-cookie": "2.2.0",
"normalize.css": "7.0.0",
"nprogress": "0.2.0",
Expand Down
14 changes: 13 additions & 1 deletion flash-vue-admin/src/views/dashboard/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import 'echarts/lib/component/visualMap'
import 'echarts/lib/component/dataset'
import 'echarts/map/js/world'
import 'zrender/lib/svg/svg'

import elementResizeDetectorMaker from "element-resize-detector"
export default {

name: 'dashboard',
Expand Down Expand Up @@ -174,6 +174,18 @@ export default {
created() {
this.fetchData()
},
mounted(){
//绑定echart图表跟随窗口大小自动缩放
let that = this
let erd = elementResizeDetectorMaker()
erd.listenTo(document.getElementById("dashboard"),(element)=>{
that.$nextTick(()=>{
that.$refs.lineChart.resize()
that.$refs.barChart.resize()
that.$refs.pieChart.resize()
})
})
},
methods: {
fetchData() {
this.listLoading = true
Expand Down
8 changes: 4 additions & 4 deletions flash-vue-admin/src/views/dashboard/index.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="dashboard-container">
<div class="dashboard-container" id="dashboard">
<div class="dashboard-text">欢迎光临:{{name}} </div>

<el-row :gutter="20">
Expand Down Expand Up @@ -54,7 +54,7 @@
<el-row>
<el-col :span="24">
<div class="chart section">
<v-chart :options="lineData"/>
<v-chart :options="lineData" ref="lineChart"/>
</div>
</el-col>
</el-row>
Expand Down Expand Up @@ -87,13 +87,13 @@
</el-col>

<el-col :span="12">
<v-chart :options="barData" class="chart section"/>
<v-chart :options="barData" class="chart section" ref="barChart"/>
</el-col>
</el-row>

<el-row :gutter="20" >
<el-col :span="12">
<v-chart :options="pieData" class="chart section"/>
<v-chart :options="pieData" class="chart section" ref="pieChart"/>
</el-col>
<el-col :span="12">
<el-table :data="tableData" class="section">
Expand Down

0 comments on commit 11551bd

Please sign in to comment.