From ba26bc38fd5ed521ce09ca29d88ebaa2c08c5325 Mon Sep 17 00:00:00 2001 From: lion <120344285@qq.com> Date: Mon, 11 Nov 2024 15:47:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- .env.production | 2 +- .env.staging | 2 +- src/App.vue | 2 +- src/api/home/index.js | 2 +- src/components/myecharts/index.vue | 2 +- src/components/viewFile/viewFile.vue | 6 +- src/layout/components/AppMain.vue | 3 +- src/layout/components/Navbar.vue | 8 +- src/layout/components/Sidebar/SidebarItem.vue | 2 +- src/layout/index.vue | 194 +++++++++--------- src/store/modules/user.js | 30 ++- src/views/catalog/components/addCatalog.vue | 2 +- src/views/dashboard/components/BarChart.vue | 6 +- src/views/dashboard/components/PanelGroup.vue | 82 ++------ src/views/dashboard/index.vue | 64 ++++-- src/views/organize/components/addArea.vue | 64 +++++- src/views/record/components/addRecord.vue | 50 ++--- src/views/record/components/showRecord.vue | 3 +- src/views/record/index.vue | 14 +- vue.config.js | 2 +- 21 files changed, 304 insertions(+), 238 deletions(-) diff --git a/.env.development b/.env.development index f115395..6981df2 100644 --- a/.env.development +++ b/.env.development @@ -4,4 +4,4 @@ ENV='development' # base api VUE_APP_BASE_API=http://sstt-dangan.ali251.langye.net VUE_APP_UPLOAD_API=http://sstt-dangan.ali251.langye.net/api/admin/upload-file -#VUE_APP_PREVIEW_API=https://view.langye.net/preview/onlinePreview +VUE_APP_PREVIEW_API=https://view.langye.net/preview/onlinePreview diff --git a/.env.production b/.env.production index 5477c6d..34edf29 100644 --- a/.env.production +++ b/.env.production @@ -4,4 +4,4 @@ ENV = 'production' # base api VUE_APP_BASE_API = http://sstt-dangan.ali251.langye.net VUE_APP_UPLOAD_API =http://sstt-dangan.ali251.langye.net/api/admin/upload-file -#VUE_APP_PREVIEW_API=https://view.langye.net/preview/onlinePreview +VUE_APP_PREVIEW_API=https://view.langye.net/preview/onlinePreview diff --git a/.env.staging b/.env.staging index 36e4bfe..e62d129 100644 --- a/.env.staging +++ b/.env.staging @@ -6,4 +6,4 @@ ENV = 'staging' # base api VUE_APP_BASE_API=http://sstt-dangan.ali251.langye.net VUE_APP_UPLOAD_API=http://sstt-dangan.ali251.langye.net/api/admin/upload-file -#VUE_APP_PREVIEW_API=https://view.langye.net/preview/onlinePreview +VUE_APP_PREVIEW_API=https://view.langye.net/preview/onlinePreview diff --git a/src/App.vue b/src/App.vue index ec9032c..5eec2e0 100644 --- a/src/App.vue +++ b/src/App.vue @@ -6,6 +6,6 @@ diff --git a/src/api/home/index.js b/src/api/home/index.js index 016ae23..0544a72 100644 --- a/src/api/home/index.js +++ b/src/api/home/index.js @@ -3,7 +3,7 @@ import request from "@/utils/request"; export function home(params){ return request({ method:'get', - url:'/api/admin/chart/home', + url:'/api/chart', params }) } diff --git a/src/components/myecharts/index.vue b/src/components/myecharts/index.vue index c91843d..c6cf66d 100644 --- a/src/components/myecharts/index.vue +++ b/src/components/myecharts/index.vue @@ -38,7 +38,7 @@ type: Array, default: () => { return [ - "#5470c6", + "#b3241d", "#91cc75", "#fac858", "#ee6666", diff --git a/src/components/viewFile/viewFile.vue b/src/components/viewFile/viewFile.vue index 700aefd..bfc462e 100644 --- a/src/components/viewFile/viewFile.vue +++ b/src/components/viewFile/viewFile.vue @@ -1,14 +1,14 @@ - diff --git a/src/layout/index.vue b/src/layout/index.vue index db22a7b..cd17a2e 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -1,93 +1,103 @@ - - - - - diff --git a/src/store/modules/user.js b/src/store/modules/user.js index bd0cacb..abd8518 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -42,6 +42,15 @@ const mutations = { }, SET_LOGINID: (state, login_id) => { state.login_id = login_id + }, + SET_AREAID: (state, area_id) => { + state.area_id = area_id + }, + SET_AUTHTYPE: (state, auth_type) => { + state.auth_type = auth_type + }, + SET_ISADMIN: (state, is_admin) => { + state.is_admin = is_admin }, } @@ -85,12 +94,23 @@ const actions = { reject('身份验证失败请重新登录') } response["roles"] = ["admin"]; - response["login_id"] = response['id']; + response["login_id"] = response['id']; + response["area_id"] = response["area"]?response["area"]["id"]:'' + response["auth_type"] = response["area"]?response["area"]["auth_type"]:0 + + for(var k of response["role"]){ + if(k.name==='系统管理员'){ + response["is_admin"] = true + } + } const { roles, name, avatar, - login_id, + login_id, + area_id, + auth_type, + is_admin } = response @@ -98,7 +118,11 @@ const actions = { commit('SET_ROLES', roles) commit('SET_NAME', name) commit('SET_AVATAR', avatar) - commit('SET_LOGINID', login_id) + commit('SET_LOGINID', login_id) + commit('SET_AREAID', area_id) + commit('SET_AUTHTYPE', auth_type) + commit('SET_ISADMIN', is_admin) + resolve(response) }).catch(error => { reject(error) diff --git a/src/views/catalog/components/addCatalog.vue b/src/views/catalog/components/addCatalog.vue index 3b20be1..2578fc0 100644 --- a/src/views/catalog/components/addCatalog.vue +++ b/src/views/catalog/components/addCatalog.vue @@ -94,7 +94,7 @@ sort_type: 'ASC', sort_name: 'sort', table_name: 'catalogs', - is_auth: 1 + // is_auth: 1 }) if (res.data.length > 0) { this.catalogList = this.base.buildTree(res.data) diff --git a/src/views/dashboard/components/BarChart.vue b/src/views/dashboard/components/BarChart.vue index 199f14c..213b573 100644 --- a/src/views/dashboard/components/BarChart.vue +++ b/src/views/dashboard/components/BarChart.vue @@ -77,7 +77,7 @@ bottom: 26, //右边的距离 handleColor: '#EFEFEF', //h滑动图标的颜色 handleStyle: { - borderColor: '#409EFF', + borderColor: '#b3241d', borderWidth: '1', shadowBlur: 2, background: '#EFEFEF', @@ -87,11 +87,11 @@ //给颜色设置渐变色 前面4个参数,给第一个设置1,第四个设置0 ,就是水平渐变 //给第一个设置0,第四个设置1,就是垂直渐变 offset: 0, - color: '#409EFF' + color: '#b3241d' }, { offset: 1, - color: '#409EFF' + color: '#b3241d' } ]), backgroundColor: '#EFEFEF', //两边未选中的滑动条区域的颜色 diff --git a/src/views/dashboard/components/PanelGroup.vue b/src/views/dashboard/components/PanelGroup.vue index 2adbc2a..3689a0b 100644 --- a/src/views/dashboard/components/PanelGroup.vue +++ b/src/views/dashboard/components/PanelGroup.vue @@ -10,19 +10,10 @@
总数
-
- {{totaldata.record_total?totaldata.record_total:0}} +
+
-
@@ -31,26 +22,16 @@
组织统计 - +
总数
-
- {{totaldata.originze_total?totaldata.originze_total:0}} +
+
-
@@ -58,54 +39,19 @@
区域统计 - +
总数
-
- {{totaldata.area_total?totaldata.area_total:0}} +
+
-
- -
@@ -121,9 +67,9 @@ totaldata: { type: Object, default: { - record_total:0, - originze_total:0, - area_total:0 + recordsTotal:0, + organizesTotal:0, + areasTotal:0 } } }, diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index bc4d107..e2cf316 100644 --- a/src/views/dashboard/index.vue +++ b/src/views/dashboard/index.vue @@ -22,6 +22,9 @@