Skip to content

Commit 5c012e1

Browse files
committed
添加控制面板数据
1 parent 5d508aa commit 5c012e1

File tree

14 files changed

+420
-43
lines changed

14 files changed

+420
-43
lines changed

.eslintrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ module.exports = {
2626
}
2727
],
2828
globals: {
29-
defineProps: 'readonly'
29+
defineProps: 'readonly',
30+
defineEmits: 'readonly'
3031
}
3132
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
},
99
"dependencies": {
1010
"axios": "^0.24.0",
11+
"echarts": "^5.2.2",
1112
"element-plus": "^1.2.0-beta.6",
1213
"js-cookie": "^3.0.1",
1314
"nprogress": "^0.2.0",

src/App.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ const test = () => {
3232
.el-sub-menu {
3333
.el-menu {
3434
background: v-bind(subMenuBg);
35+
.el-menu-item.is-active {
36+
background: v-bind(subMenuHover);
37+
}
3538
li:hover {
3639
background: v-bind(subMenuHover);
3740
}

src/assets/iconfont/iconfont.scss

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
@font-face {
22
font-family: "iconfont"; /* Project id 3001982 */
3-
src: url('//at.alicdn.com/t/font_3001982_lj1qbspdq4m.woff2?t=1640593771185') format('woff2'),
4-
url('//at.alicdn.com/t/font_3001982_lj1qbspdq4m.woff?t=1640593771185') format('woff'),
5-
url('//at.alicdn.com/t/font_3001982_lj1qbspdq4m.ttf?t=1640593771185') format('truetype');
3+
src: url('//at.alicdn.com/t/font_3001982_h7w46xo0a5b.woff2?t=1640829544328') format('woff2'),
4+
url('//at.alicdn.com/t/font_3001982_h7w46xo0a5b.woff?t=1640829544328') format('woff'),
5+
url('//at.alicdn.com/t/font_3001982_h7w46xo0a5b.ttf?t=1640829544328') format('truetype');
66
}
77

88
.iconfont {
@@ -13,6 +13,50 @@
1313
-moz-osx-font-smoothing: grayscale;
1414
}
1515

16+
.icon-caret-up:before {
17+
content: "\e8ed";
18+
}
19+
20+
.icon-ip:before {
21+
content: "\e64f";
22+
}
23+
24+
.icon-reloadtime:before {
25+
content: "\e789";
26+
}
27+
28+
.icon-adduser:before {
29+
content: "\e7b1";
30+
}
31+
32+
.icon-barchart:before {
33+
content: "\e7b3";
34+
}
35+
36+
.icon-file-text-fill:before {
37+
content: "\e858";
38+
}
39+
40+
.icon-eye-fill:before {
41+
content: "\e869";
42+
}
43+
44+
.icon-guanliyuan:before {
45+
content: "\e600";
46+
}
47+
48+
.icon-home:before {
49+
content: "\e7c6";
50+
}
51+
52+
.icon-delete:before {
53+
content: "\e7c3";
54+
}
55+
56+
.icon-home-fill:before {
57+
content: "\e867";
58+
}
59+
1660
.icon-caret-down:before {
1761
content: "\e8ec";
1862
}

src/components/Hamburger/Index.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@
33
* @Author: hutu
44
* @Date: 2021-12-22 14:53:31
55
* @LastEditors: hutu
6-
* @LastEditTime: 2021-12-22 16:00:57
6+
* @LastEditTime: 2021-12-30 08:46:09
77
-->
88
<template>
99
<div class="hamburger" @click="emitMenuCollapse">
1010
<el-icon class="iconfont" :class="props.collapse ? 'icon-indent' : 'icon-outdent'"></el-icon>
1111
</div>
1212
</template>
1313
<script lang="ts" setup>
14-
import { defineEmits } from 'vue'
1514
const props = defineProps<{
1615
collapse: boolean
1716
}>()
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!--
2+
* @Description: 头部搜索
3+
* @Author: hutu
4+
* @Date: 2021-12-22 15:59:15
5+
* @LastEditors: hutu
6+
* @LastEditTime: 2021-12-30 08:48:03
7+
-->
8+
<template>
9+
<el-tooltip class="item" effect="dark" :content="props.title" placement="bottom">
10+
<div class="header-icon">
11+
<el-icon class="iconfont" :class="props.icon"></el-icon>
12+
</div>
13+
</el-tooltip>
14+
</template>
15+
<script lang="ts" setup>
16+
const props = defineProps<{
17+
title: string
18+
icon: string
19+
}>()
20+
</script>
21+
<style lang="scss">
22+
.header-icon {
23+
@extend .app-icon-hover;
24+
}
25+
</style>

src/components/HeaderSetting/Index.vue

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<!--
2+
* @Description: echarts图表
3+
* @Author: hutu
4+
* @Date: 2021-12-30 10:32:19
5+
* @LastEditors: hutu
6+
* @LastEditTime: 2021-12-30 14:44:25
7+
-->
8+
<template>
9+
<div class="init-echarts">
10+
<div class="title">{{ prop.data.title }}</div>
11+
<div :id="prop.data.id" :style="{ width: prop.data.width, height: prop.data.height }"></div>
12+
</div>
13+
</template>
14+
<script lang="ts" setup>
15+
import { onMounted } from 'vue'
16+
import { IEchartsOption } from '@/interface'
17+
import * as echarts from 'echarts/core'
18+
import { BarChart, LineChart, PieChart } from 'echarts/charts'
19+
import { TitleComponent, TooltipComponent, GridComponent, LegendComponent } from 'echarts/components'
20+
import { LabelLayout, UniversalTransition } from 'echarts/features'
21+
import { CanvasRenderer } from 'echarts/renderers'
22+
echarts.use([BarChart, LineChart, PieChart, TitleComponent, TooltipComponent, GridComponent, LegendComponent, LabelLayout, UniversalTransition, CanvasRenderer])
23+
interface IData {
24+
id: string
25+
title: string
26+
width: string
27+
height: string
28+
}
29+
const prop = defineProps<{
30+
option: IEchartsOption
31+
data: IData
32+
}>()
33+
const init = () => {
34+
const myChart = echarts.init(document.getElementById(prop.data.id) as HTMLElement)
35+
myChart.setOption(prop.option)
36+
window.onresize = function () {
37+
myChart.resize()
38+
}
39+
}
40+
onMounted(() => {
41+
init()
42+
})
43+
</script>
44+
<style lang="scss">
45+
.init-echarts {
46+
background: #fff;
47+
padding: 20px;
48+
.title {
49+
font-size: 16px;
50+
font-weight: bold;
51+
}
52+
}
53+
</style>

src/components/Screenfull/Index.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
* @Author: hutu
44
* @Date: 2021-12-22 15:24:13
55
* @LastEditors: hutu
6-
* @LastEditTime: 2021-12-27 09:53:16
6+
* @LastEditTime: 2021-12-30 08:55:20
77
-->
88
<template>
9-
<div class="screenfull" @click="handleScreenfull">
10-
<el-tooltip class="item" effect="dark" :content="state.isScreenfull ? '退出全屏' : '全屏'" placement="bottom">
9+
<el-tooltip class="item" effect="dark" :content="state.isScreenfull ? '退出全屏' : '全屏'" placement="bottom">
10+
<div class="screenfull" @click="handleScreenfull">
1111
<el-icon class="iconfont icon-fullscreen" :class="state.isScreenfull ? 'icon-fullscreen-exit' : 'icon-fullscreen'"></el-icon>
12-
</el-tooltip>
13-
</div>
12+
</div>
13+
</el-tooltip>
1414
</template>
1515
<script lang="ts" setup>
1616
import screenfull from 'screenfull'

src/interface/index.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { RouteRecordRaw } from 'vue-router'
21
/**
32
* 用户信息
43
*/
@@ -29,6 +28,7 @@ export interface IAsyncRoutes {
2928
/**
3029
* 路由权限[vuex]
3130
*/
31+
import { RouteRecordRaw } from 'vue-router'
3232
export interface IPermission {
3333
accessRoutes: RouteRecordRaw[] //模拟异步路由
3434
menuCollapse: boolean //折叠菜单
@@ -50,3 +50,14 @@ export interface IThemeStyles {
5050
subMenuBg: string //子菜单栏背景颜色
5151
subMenuHover: string //子菜单栏悬浮颜色
5252
}
53+
/**
54+
* 引入echarts
55+
*/
56+
// 引入 echarts 核心模块,核心模块提供了 echarts 使用必须要的接口。
57+
import * as echarts from 'echarts/core'
58+
// 引入图表,图表后缀都为 Chart
59+
import { BarSeriesOption, LineSeriesOption, PieSeriesOption } from 'echarts/charts'
60+
// 引入提示框,标题,直角坐标系,组件后缀都为 Component
61+
import { TitleComponentOption, TooltipComponentOption, GridComponentOption } from 'echarts/components'
62+
// 通过 ComposeOption 来组合出一个只有必须组件和图表的 Option 类型
63+
export type IEchartsOption = echarts.ComposeOption<BarSeriesOption | LineSeriesOption | PieSeriesOption | TitleComponentOption | TooltipComponentOption | GridComponentOption>

0 commit comments

Comments
 (0)