From f315950d784e1c3044240dd1e36d1928ef8ea4b7 Mon Sep 17 00:00:00 2001 From: sc Date: Wed, 28 Apr 2021 16:44:41 +0800 Subject: [PATCH] UP --- public/json/user.json | 8 ++ src/api/index.js | 15 +++- src/components/scEcharts/index.vue | 1 + src/layout/components/head.vue | 5 +- src/layout/components/tags.vue | 11 +++ src/router/index.js | 10 ++- src/style/style.less | 12 +++ src/views/home/components/C1.vue | 42 ++++------- src/views/home/index.vue | 4 +- src/views/login.vue | 2 +- src/views/other/cmd.vue | 7 +- src/views/template/list.vue | 2 +- src/views/userCenter/index.vue | 115 +++++++++++++++++++++++++++++ src/views/vab/chart.vue | 62 ++++++++++++++++ 14 files changed, 259 insertions(+), 37 deletions(-) create mode 100644 src/views/userCenter/index.vue create mode 100644 src/views/vab/chart.vue diff --git a/public/json/user.json b/public/json/user.json index de967c5d..e5cf06e9 100644 --- a/public/json/user.json +++ b/public/json/user.json @@ -20,6 +20,14 @@ "title": "拖拽排序" }, "component": "vab/drag" + }, + { + "path": "/template/chart", + "name": "chart", + "meta": { + "title": "图表 Echarts" + }, + "component": "vab/chart" } ] }, diff --git a/src/api/index.js b/src/api/index.js index 5cb2466d..e535ea2a 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -1,11 +1,22 @@ import config from "@/config"; import http from "@/utils/request"; +/** + * 所有接口集合 + * 每个接口对象需含有以下字段 + * @url 接口的URL地址 + * @name 接口名称 + * @get|post 返回请求接口的函数 + */ const api = { user: { - info: async function(){ - return await http.get(`${config.apiUrl}/json/user.json`); + info: { + url: `${config.apiUrl}/json/user.json`, + name: "登录获取用户菜单和权限", + get: async function(){ + return await http.get(this.url); + } } } } diff --git a/src/components/scEcharts/index.vue b/src/components/scEcharts/index.vue index b707b6bb..4e211196 100644 --- a/src/components/scEcharts/index.vue +++ b/src/components/scEcharts/index.vue @@ -8,6 +8,7 @@ echarts.registerTheme('T', T); export default { + ...echarts, name: "scEcharts", props: { height: { type: String, default: "100%" }, diff --git a/src/layout/components/head.vue b/src/layout/components/head.vue index 23e67ea2..aebd052a 100644 --- a/src/layout/components/head.vue +++ b/src/layout/components/head.vue @@ -53,7 +53,7 @@ @@ -193,6 +194,16 @@ } var element = document.getElementById('adminui-main') this.$TOOL.screen(element) + }, + //新窗口打开 + openWindow(){ + var nowTag = this.contextMenuItem; + var url = nowTag.href || '/'; + if(!nowTag.meta.affix){ + this.closeSelectedTag(nowTag) + } + window.open(url); + this.contextMenuVisible = false } } } diff --git a/src/router/index.js b/src/router/index.js index 27ca832b..4bf3d088 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -27,7 +27,15 @@ const routes = [{ title: "控制台", affix: true }, - component: () => import(/* webpackChunkName: "home" */ '@/views/home/index'), + component: () => import(/* webpackChunkName: "home" */ '@/views/home'), + }, + { + name: "userCenter", + path: "/usercenter", + meta: { + title: "个人信息" + }, + component: () => import(/* webpackChunkName: "usercenter" */ '@/views/userCenter'), } ] } diff --git a/src/style/style.less b/src/style/style.less index 4e2ae8b0..36d0fe6f 100644 --- a/src/style/style.less +++ b/src/style/style.less @@ -73,6 +73,18 @@ a,button,input,textarea{-webkit-tap-highlight-color:rgba(0,0,0,0);box-sizing: bo .adminui-main {position: absolute;top:85px;left:0px;right:0px;bottom:0px;overflow: auto;background-color: #f6f8f9;} +/* USERCENTER */ +.user-info {padding:20px 40px;} +.user-info-top {text-align: center;} +.user-info-top h2 {margin-top:10px;font-size: 24px;} +.user-info-top p {color: #999;margin-top:5px;} +.user-info-top button {margin-top:10px;} +.user-info-main {padding:20px 0;} +.user-info-main li {list-style-type:none;line-height: 2;font-size: 14px;} +.user-info-main li i {margin-right: 10px;} +.user-info-bottom {border-top: 1px solid #e6e6e6;} +.user-info-bottom h2 {font-size: 14px;margin:15px 0;} + .el-menu {border: none!important;} .el-menu-item.is-active {background: #ecf5ff;} .el-menu .el-menu-item a {color: inherit;text-decoration: none;display: block;width:100%;height:100%;position: absolute;top:0px;left:0px;} diff --git a/src/views/home/components/C1.vue b/src/views/home/components/C1.vue index 41c208b4..6fb22c30 100644 --- a/src/views/home/components/C1.vue +++ b/src/views/home/components/C1.vue @@ -28,10 +28,6 @@ tooltip: { trigger: 'axis' }, - legend: { - data: ['支出', '收入'], - right: 13, - }, xAxis: { boundaryGap: false, data: ['周一', '周二', '周三', '周四', '周五', '周六'], @@ -43,39 +39,29 @@ "show": false } }], - series: [{ - name: '支出', - type: 'line', - symbolSize: 6, - smooth: true, - lineStyle: { - normal: { - shadowColor: 'rgba(0,0,0,0.2)', - shadowBlur: 15, - shadowOffsetY: 20 - } - }, - 'areaStyle': { - 'opacity': 0.2 - }, - data: [35, 10, 36, 5, 5, 20], - }, + series: [ { name: '收入', type: 'line', symbolSize: 6, smooth: true, lineStyle: { - normal: { - shadowColor: 'rgba(0,0,0,0.2)', - shadowBlur: 15, - shadowOffsetY: 20 - } + width: 8, + shadowColor: 'rgba(0,0,0,0.2)', + shadowBlur: 15, + shadowOffsetY: 15, + color: new scEcharts.graphic.LinearGradient(0, 0, 0, 1, [{ + offset: 0, + color: '#409EFF' + }, { + offset: 1, + color: '#36CE9E' + }]) }, 'areaStyle': { - 'opacity': 0.2 + 'opacity': 0 }, - data: [15, 15, -25, 20, 20, 8], + data: [15, 15, 35, 5, 35, 15], }, ], }; diff --git a/src/views/home/index.vue b/src/views/home/index.vue index 36ae07c7..edc85cc2 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -59,10 +59,10 @@ return {} }, mounted(){ - + }, methods: { - + } } diff --git a/src/views/login.vue b/src/views/login.vue index 9e727388..037f690a 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -99,7 +99,7 @@ }) }, login: async function() { - var userInfo = await this.$API.user.info(); + var userInfo = await this.$API.user.info.get(); this.$TOOL.data.set("user", userInfo.data); this.$router.replace({ path: '/' diff --git a/src/views/other/cmd.vue b/src/views/other/cmd.vue index 48cb2bc0..208fe342 100644 --- a/src/views/other/cmd.vue +++ b/src/views/other/cmd.vue @@ -17,6 +17,9 @@
{{json.config}}
+ +
{{json.api}}
+
@@ -32,7 +35,8 @@ json: { user: null, grid: null, - config: null + config: null, + api: null, } } }, @@ -40,6 +44,7 @@ this.json.user = this.$TOOL.data.get("user"); this.json.grid = this.$TOOL.data.get("grid")||'null'; this.json.config = this.$CONFIG; + this.json.api = this.$API; }, methods: { clear_all(){ diff --git a/src/views/template/list.vue b/src/views/template/list.vue index a6bb7717..3c395c80 100644 --- a/src/views/template/list.vue +++ b/src/views/template/list.vue @@ -90,7 +90,7 @@ Show }, async created() { - var userInfo = await this.$API.user.info(); + var userInfo = await this.$API.user.info.get(); var _this = this; setTimeout(function() { _this.tableData = userInfo.data.menuList; diff --git a/src/views/userCenter/index.vue b/src/views/userCenter/index.vue new file mode 100644 index 00000000..1dba0c8c --- /dev/null +++ b/src/views/userCenter/index.vue @@ -0,0 +1,115 @@ + + + + + diff --git a/src/views/vab/chart.vue b/src/views/vab/chart.vue new file mode 100644 index 00000000..b165f032 --- /dev/null +++ b/src/views/vab/chart.vue @@ -0,0 +1,62 @@ + + + + +