Commit 1c88d57f by dqjdda

update

parent 01e003d9
import { get, getDictMap } from '@/api/dictDetail'
export default {
data() {
return {
dicts: [], dictMap: {}
}
},
methods: {
async getDict(name) {
return new Promise((resolve, reject) => {
get(name).then(res => {
this.dicts = res.content
resolve(res)
}).catch(err => {
reject(err)
})
})
},
// 多个字典查询时使用逗号拼接, 如:
// 加载多个数据字典,如何调用如下:
// this.getDict('user_status,job_status')
// 在vue中使用加载出来的字典:
// dictMap.[字典名称] 如:dictMap.user_status、 dictMap.job_status
async getDictMap(names) {
// 优先放入到dictMap中,避免页面加载时 undefined
const arr = names.split(',')
for (let i = 0; i < arr.length; i++) {
this.dictMap[arr[i]] = []
}
return new Promise((resolve, reject) => {
getDictMap(names).then(res => {
this.dictMap = res
resolve(res)
}).catch(err => {
reject(err)
})
})
}
}
}
<template> <template>
<div class="dashboard-container"> <div class="dashboard-container">
<div class="dashboard-editor-container"> <div class="dashboard-editor-container">
<el-row :gutter="32">
<el-col :xs="24" :sm="24" :lg="8">
<div class="chart-wrapper">
<radar-chart />
</div>
</el-col>
<el-col :xs="24" :sm="24" :lg="8">
<div class="chart-wrapper">
<pie-chart />
</div>
</el-col>
<el-col :xs="24" :sm="24" :lg="8">
<div class="chart-wrapper">
<bar-chart />
</div>
</el-col>
</el-row>
<el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;"> <el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
<heat-map /> <heat-map />
</el-row> </el-row>
...@@ -89,11 +72,7 @@ ...@@ -89,11 +72,7 @@
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'
import RadarChart from '@/components/Echarts/RadarChart' import RadarChart from '@/components/Echarts/RadarChart'
import PieChart from '@/components/Echarts/PieChart'
import BarChart from '@/components/Echarts/BarChart'
import { count } from '@/api/visits'
import HeatMap from '@/components/Echarts/HeatMap' import HeatMap from '@/components/Echarts/HeatMap'
import Gauge from '@/components/Echarts/Gauge' import Gauge from '@/components/Echarts/Gauge'
import Rich from '@/components/Echarts/Rich' import Rich from '@/components/Echarts/Rich'
...@@ -106,34 +85,21 @@ import Line3D from '@/components/Echarts/Line3D' ...@@ -106,34 +85,21 @@ import Line3D from '@/components/Echarts/Line3D'
import Category from '@/components/Echarts/Category' import Category from '@/components/Echarts/Category'
import Point from '@/components/Echarts/Point' import Point from '@/components/Echarts/Point'
/**
* 记录访问,只有页面刷新或者第一次加载才会记录
*/
count().then(res => {
})
export default { export default {
name: 'Dashboard', name: 'Echarts',
components: { components: {
Point, Point,
Category, Category,
Graph, Graph,
HeatMap, HeatMap,
RadarChart, RadarChart,
PieChart,
Sunburst, Sunburst,
Gauge, Gauge,
Rich, Rich,
ThemeRiver, ThemeRiver,
Sankey, Sankey,
Line3D, Line3D,
Scatter, Scatter
BarChart
},
computed: {
...mapGetters([
'roles'
])
} }
} }
</script> </script>
......
...@@ -22,96 +22,17 @@ ...@@ -22,96 +22,17 @@
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<!-- <el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">-->
<!-- <heat-map/>-->
<!-- </el-row>-->
<!-- <el-row :gutter="32">-->
<!-- <el-col :xs="24" :sm="24" :lg="8">-->
<!-- <div class="chart-wrapper">-->
<!-- <radar-chart/>-->
<!-- </div>-->
<!-- </el-col>-->
<!-- <el-col :xs="24" :sm="24" :lg="8">-->
<!-- <div class="chart-wrapper">-->
<!-- <sunburst/>-->
<!-- </div>-->
<!-- </el-col>-->
<!-- <el-col :xs="24" :sm="24" :lg="8">-->
<!-- <div class="chart-wrapper">-->
<!-- <gauge/>-->
<!-- </div>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- <el-row :gutter="12">-->
<!-- <el-col :span="12">-->
<!-- <div class="chart-wrapper">-->
<!-- <rich/>-->
<!-- </div>-->
<!-- </el-col>-->
<!-- <el-col :span="12">-->
<!-- <div class="chart-wrapper">-->
<!-- <theme-river/>-->
<!-- </div>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- <el-row :gutter="32">-->
<!-- <el-col :xs="24" :sm="24" :lg="8">-->
<!-- <div class="chart-wrapper">-->
<!-- <graph/>-->
<!-- </div>-->
<!-- </el-col>-->
<!-- <el-col :xs="24" :sm="24" :lg="8">-->
<!-- <div class="chart-wrapper">-->
<!-- <sankey/>-->
<!-- </div>-->
<!-- </el-col>-->
<!-- <el-col :xs="24" :sm="24" :lg="8">-->
<!-- <div class="chart-wrapper">-->
<!-- <line3-d/>-->
<!-- </div>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- <el-row :gutter="12">-->
<!-- <el-col :span="12">-->
<!-- <div class="chart-wrapper">-->
<!-- <scatter/>-->
<!-- </div>-->
<!-- </el-col>-->
<!-- <el-col :span="12">-->
<!-- <div class="chart-wrapper">-->
<!-- <point/>-->
<!-- </div>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- <el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">-->
<!-- <div class="chart-wrapper">-->
<!-- <category/>-->
<!-- </div>-->
<!-- </el-row>-->
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'
import PanelGroup from './dashboard/PanelGroup' import PanelGroup from './dashboard/PanelGroup'
import LineChart from './dashboard/LineChart' import LineChart from './dashboard/LineChart'
import RadarChart from '@/components/Echarts/RadarChart' import RadarChart from '@/components/Echarts/RadarChart'
import PieChart from '@/components/Echarts/PieChart' import PieChart from '@/components/Echarts/PieChart'
import BarChart from '@/components/Echarts/BarChart' import BarChart from '@/components/Echarts/BarChart'
import { count } from '@/api/visits' import { count } from '@/api/visits'
// import HeatMap from './dashboard/HeatMap'
// import Funnel from './dashboard/Funnel'
// import Gauge from './dashboard/Gauge'
// import Rich from './dashboard/Rich'
// import ThemeRiver from './dashboard/ThemeRiver'
// import Sunburst from './dashboard/Sunburst'
// import Graph from './dashboard/Graph'
// import Sankey from './dashboard/Sankey'
// import Scatter from './dashboard/Scatter'
// import Line3D from './dashboard/Line3D'
// import Category from './dashboard/Category'
// import Point from './dashboard/Point'
/** /**
* 记录访问,只有页面刷新或者第一次加载才会记录 * 记录访问,只有页面刷新或者第一次加载才会记录
...@@ -122,28 +43,11 @@ count().then(res => { ...@@ -122,28 +43,11 @@ count().then(res => {
export default { export default {
name: 'Dashboard', name: 'Dashboard',
components: { components: {
// Point,
// Category,
// Graph,
// HeatMap,
PanelGroup, PanelGroup,
LineChart, LineChart,
RadarChart, RadarChart,
PieChart, PieChart,
// Funnel,
// Sunburst,
// Gauge,
// Rich,
// ThemeRiver,
// Sankey,
// Line3D,
// Scatter,
BarChart BarChart
},
computed: {
...mapGetters([
'roles'
])
} }
} }
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment