| | |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="6"></el-col> |
| | | <el-col :span="6"> |
| | | <el-col :span="12" class="topBtns"> |
| | | <div class="grid-content topInfo"> |
| | | <div style="margin-right: 20px"><el-button type="primary" plain>查询历史</el-button></div> |
| | | <div><el-button type="primary" @click="dialogChartsVisible = true">查看统计图表</el-button></div> |
| | |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-row> |
| | | <el-dialog v-model="dialogChartsVisible" title="Shipping address"> |
| | | <el-dialog v-model="dialogChartsVisible" title="统计图表"> |
| | | <el-row> |
| | | <div class="grid-content"> |
| | | <div>日期查询:</div> |
| | |
| | | </div> |
| | | </div> |
| | | </el-row> |
| | | <div id="main" style="width: 600px;height:400px;"></div> |
| | | <div ref="myChart" style="width: 100%;height:400px;"></div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, defineComponent, ref } from 'vue'; |
| | | import { toRefs, reactive, defineComponent, ref, onMounted } from 'vue'; |
| | | import { storeToRefs } from 'pinia'; |
| | | import { initBackEndControlRoutes } from '/@/router/backEnd'; |
| | | import {useUserInfo} from "/@/stores/userInfo"; |
| | |
| | | import { TooltipComponent, TooltipComponentOption, GridComponent, GridComponentOption, LegendComponent, LegendComponentOption } from 'echarts/components'; |
| | | import { BarChart, BarSeriesOption } from 'echarts/charts'; |
| | | import { CanvasRenderer } from 'echarts/renderers'; |
| | | echarts.use([ |
| | | TooltipComponent, |
| | | GridComponent, |
| | | LegendComponent, |
| | | BarChart, |
| | | CanvasRenderer |
| | | ]); |
| | | let global: any = { |
| | | homeChartOne: null, |
| | | homeChartTwo: null, |
| | |
| | | const state = reactive<stateType>({ |
| | | homeOne:[{id:1,name:'基础数据权限管理系统'},{id:2,name:'双重预防系统'},{id:3,name:'系统2'},{id:4,name:'系统3'},{id:5,name:'系统4'}], |
| | | }); |
| | | const myChart = ref<HTMLElement>() |
| | | const myCharts = ref<any>() |
| | | setTimeout(()=>{ |
| | | type EChartsOption = echarts.ComposeOption< |
| | | | TooltipComponentOption |
| | | | GridComponentOption |
| | | | LegendComponentOption |
| | | | BarSeriesOption |
| | | >; |
| | | myCharts.value = echarts.init(myChart.value!); |
| | | const option: EChartsOption = { |
| | | tooltip: { |
| | | trigger: 'axis', |
| | | axisPointer: { |
| | | // Use axis to trigger tooltip |
| | | type: 'shadow' // 'shadow' as default; can also be 'line' or 'shadow' |
| | | } |
| | | }, |
| | | legend: {}, |
| | | grid: { |
| | | left: '3%', |
| | | right: '3%', |
| | | bottom: '3%', |
| | | containLabel: true |
| | | }, |
| | | xAxis: { |
| | | type: 'value' |
| | | }, |
| | | yAxis: { |
| | | type: 'category', |
| | | data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] |
| | | }, |
| | | series: [ |
| | | { |
| | | name: 'Direct', |
| | | type: 'bar', |
| | | stack: 'total', |
| | | label: { |
| | | show: true |
| | | }, |
| | | emphasis: { |
| | | focus: 'series' |
| | | }, |
| | | data: [320, 302, 301, 334, 390, 330, 320] |
| | | }, |
| | | { |
| | | name: 'Mail Ad', |
| | | type: 'bar', |
| | | stack: 'total', |
| | | label: { |
| | | show: true |
| | | }, |
| | | emphasis: { |
| | | focus: 'series' |
| | | }, |
| | | data: [120, 132, 101, 134, 90, 230, 210] |
| | | }, |
| | | { |
| | | name: 'Affiliate Ad', |
| | | type: 'bar', |
| | | stack: 'total', |
| | | label: { |
| | | show: true |
| | | }, |
| | | emphasis: { |
| | | focus: 'series' |
| | | }, |
| | | data: [220, 182, 191, 234, 290, 330, 310] |
| | | }, |
| | | { |
| | | name: 'Video Ad', |
| | | type: 'bar', |
| | | stack: 'total', |
| | | label: { |
| | | show: true |
| | | }, |
| | | emphasis: { |
| | | focus: 'series' |
| | | }, |
| | | data: [150, 212, 201, 154, 190, 330, 410] |
| | | }, |
| | | { |
| | | name: 'Search Engine', |
| | | type: 'bar', |
| | | stack: 'total', |
| | | label: { |
| | | show: true |
| | | }, |
| | | emphasis: { |
| | | focus: 'series' |
| | | }, |
| | | data: [820, 832, 901, 934, 1290, 1330, 1320] |
| | | } |
| | | ] |
| | | }; |
| | | |
| | | option && myCharts.value.setOption(option); |
| | | },2000) |
| | | // 分布图 |
| | | echarts.use([ |
| | | TooltipComponent, |
| | | GridComponent, |
| | | LegendComponent, |
| | | BarChart, |
| | | CanvasRenderer |
| | | ]); |
| | | // onMounted(()=>{ |
| | | // setTimeout(() => { |
| | | // drawChart() |
| | | // },1000) |
| | | // }); |
| | | |
| | | type EChartsOption = echarts.ComposeOption< |
| | | | TooltipComponentOption |
| | | | GridComponentOption |
| | | | LegendComponentOption |
| | | | BarSeriesOption |
| | | >; |
| | | |
| | | const chartDom = document.getElementById('main')!; |
| | | const myChart = echarts.init(chartDom); |
| | | const option: EChartsOption = { |
| | | tooltip: { |
| | | trigger: 'axis', |
| | | axisPointer: { |
| | | // Use axis to trigger tooltip |
| | | type: 'shadow' // 'shadow' as default; can also be 'line' or 'shadow' |
| | | } |
| | | }, |
| | | legend: {}, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | containLabel: true |
| | | }, |
| | | xAxis: { |
| | | type: 'value' |
| | | }, |
| | | yAxis: { |
| | | type: 'category', |
| | | data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] |
| | | }, |
| | | series: [ |
| | | { |
| | | name: 'Direct', |
| | | type: 'bar', |
| | | stack: 'total', |
| | | label: { |
| | | show: true |
| | | }, |
| | | emphasis: { |
| | | focus: 'series' |
| | | }, |
| | | data: [320, 302, 301, 334, 390, 330, 320] |
| | | }, |
| | | { |
| | | name: 'Mail Ad', |
| | | type: 'bar', |
| | | stack: 'total', |
| | | label: { |
| | | show: true |
| | | }, |
| | | emphasis: { |
| | | focus: 'series' |
| | | }, |
| | | data: [120, 132, 101, 134, 90, 230, 210] |
| | | }, |
| | | { |
| | | name: 'Affiliate Ad', |
| | | type: 'bar', |
| | | stack: 'total', |
| | | label: { |
| | | show: true |
| | | }, |
| | | emphasis: { |
| | | focus: 'series' |
| | | }, |
| | | data: [220, 182, 191, 234, 290, 330, 310] |
| | | }, |
| | | { |
| | | name: 'Video Ad', |
| | | type: 'bar', |
| | | stack: 'total', |
| | | label: { |
| | | show: true |
| | | }, |
| | | emphasis: { |
| | | focus: 'series' |
| | | }, |
| | | data: [150, 212, 201, 154, 190, 330, 410] |
| | | }, |
| | | { |
| | | name: 'Search Engine', |
| | | type: 'bar', |
| | | stack: 'total', |
| | | label: { |
| | | show: true |
| | | }, |
| | | emphasis: { |
| | | focus: 'series' |
| | | }, |
| | | data: [820, 832, 901, 934, 1290, 1330, 1320] |
| | | } |
| | | ] |
| | | }; |
| | | |
| | | option && myChart.setOption(option); |
| | | |
| | | // 折线图 |
| | | const renderMenu = async (value: string) => { |
| | |
| | | departmentName, |
| | | departmentOptions, |
| | | props, |
| | | myChart, |
| | | handleChange, |
| | | ...toRefs(state), |
| | | }; |
| | |
| | | .home-container { |
| | | overflow: hidden; |
| | | padding: 20px 40px; |
| | | .el-row{ |
| | | margin-bottom: 20px; |
| | | } |
| | | .el-row:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | .el-col{ |
| | | display: flex; |
| | | align-items: center; |
| | | margin: 40px 0; |
| | | } |
| | | .grid-content{ |
| | | display: flex; |
| | | align-items: center; |
| | | min-height: 36px; |
| | | } |
| | | |
| | | .topInfo{ |
| | |
| | | flex: 1; |
| | | } |
| | | } |
| | | .topBtns{ |
| | | display: flex; |
| | | justify-content: right; |
| | | } |
| | | .el-button--text { |
| | | margin-right: 15px; |
| | | } |