From a6e491a772b161e28541e9b88d9b18ac33851c67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=BF=94=E5=AE=87-=E6=97=85=E7=AE=A1=E5=AE=B6?= <153298343@qq.com> Date: Thu, 23 Feb 2023 07:36:17 +0800 Subject: [PATCH] up --- src/api/user.js | 12 ++- src/store/modules/user.js | 34 +++++- src/styles/sidebar.scss | 4 +- src/styles/variables.scss | 6 +- src/views/dashboard/components/Map.vue | 12 +-- src/views/dashboard/index.vue | 8 +- src/views/login/index.vue | 29 ++++- tes/map/china.js | 46 ++++++++ tes/map/echarts.min.js | 22 ++++ tes/new_file.html | 103 ++++++++++++++++++ tes/new_file1.html | 144 +++++++++++++++++++++++++ 11 files changed, 399 insertions(+), 21 deletions(-) create mode 100644 tes/map/china.js create mode 100644 tes/map/echarts.min.js create mode 100644 tes/new_file.html create mode 100644 tes/new_file1.html diff --git a/src/api/user.js b/src/api/user.js index e12d073..ecb1476 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -8,6 +8,16 @@ export function login(data) { }) } +export function loginOss(data) { + return request({ + url: '/api/admin/auth/oss-login', + method: 'post', + data + }) +} + + + export function getInfo(token) { return request({ url: '/api/admin/auth/me', @@ -29,4 +39,4 @@ export function getAuthMenu(token) { method: 'get', params: { token } }) -} \ No newline at end of file +} diff --git a/src/store/modules/user.js b/src/store/modules/user.js index c288974..f9a2ae9 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -1,7 +1,8 @@ import { login, logout, - getInfo + getInfo, + loginOss } from '@/api/user' import { getToken, @@ -41,7 +42,36 @@ const mutations = { } } -const actions = { +const actions = { + + loginskip({ + commit + }, userInfo) { + const { + oss_token, + tp + } = userInfo + + return new Promise((resolve, reject) => { + loginOss({ + oss_token: oss_token, + tp: tp + }).then(response => { + + //console.log(response) + + const { + data + } = response; + console.log(response.access_token) + commit('SET_TOKEN', response.access_token) + setToken(response.access_token) + resolve() + }).catch(error => { + reject(error) + }) + }) + }, // user login login({ commit diff --git a/src/styles/sidebar.scss b/src/styles/sidebar.scss index 953c9a4..d917998 100644 --- a/src/styles/sidebar.scss +++ b/src/styles/sidebar.scss @@ -11,7 +11,7 @@ transition: width 0.28s; width: $sideBarWidth !important; //background-color: $menuBg; - background: linear-gradient(180deg, #0082ca, #0785cf); + background: linear-gradient(180deg, #fff, #fff); box-shadow: 1px 1px 15px 0px rgba(17, 76, 157, 0.2); height: 100%; position: fixed; @@ -229,7 +229,7 @@ >.el-menu--popup { max-height: 100vh; overflow-y: auto; - background: #0082ca !important; + background: #fff !important; &::-webkit-scrollbar-track-piece { background: #d3dce6; diff --git a/src/styles/variables.scss b/src/styles/variables.scss index a45d105..42f81b8 100644 --- a/src/styles/variables.scss +++ b/src/styles/variables.scss @@ -1,7 +1,7 @@ // sidebar -$menuText:#ffffff; -$menuActiveText:#ffffff; -$subMenuActiveText:#ffffff; //https://github.com/ElemeFE/element/issues/12951 +$menuText:#0082ca; +$menuActiveText:#0082ca; +$subMenuActiveText:#0082ca; //https://github.com/ElemeFE/element/issues/12951 $menuBg:rgb(255, 255, 255,0);//#304156 $menuHover:rgba(242, 242, 242, .4); diff --git a/src/views/dashboard/components/Map.vue b/src/views/dashboard/components/Map.vue index a40e4b6..becf3a4 100644 --- a/src/views/dashboard/components/Map.vue +++ b/src/views/dashboard/components/Map.vue @@ -71,17 +71,16 @@ this.setOptions(this.chartData); }, setOptions(chartdata) { - echarts.registerMap('CHINA', geoJson); - let statusArr=this.statusArr; + echarts.registerMap('CHINA', geoJson); + let statusArr = this.statusArr; // 绘制图表 this.chart.setOption({ - backgroundColor: "#c3e2ee", - zoom: 5, + backgroundColor: "#020c49", tooltip: { trigger: "item", formatter: function(val) { - return "省份:"+val.name+"
当前进度: " + statusArr[val.data.itemStyle.status]; // + return "省份:" + val.name + "
当前进度: " + statusArr[val.data.itemStyle.status]; // }, }, toolbox: { @@ -98,7 +97,8 @@ }, }, series: [{ - type: "map", + type: "map", + zoom:1.15, map: "CHINA", //这里需要注意呀, // 是否开启鼠标缩放和平移漫游 默认不开启 itemStyle: { diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index ed6ffbc..7d79d15 100644 --- a/src/views/dashboard/index.vue +++ b/src/views/dashboard/index.vue @@ -48,10 +48,10 @@ orderArr: [], chartData: {}, colorArr: { - "1": "#dbebf8", - "2": "#89badf", - "3": "#a1c7e6", - "4": "#559acf" + "1": "#8297a3", + "2": "#3191cb", + "3": "#f26200", + "4": "#35a973" } } }, diff --git a/src/views/login/index.vue b/src/views/login/index.vue index d50357a..2e1887a 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -1,5 +1,5 @@