dedsudiyu 3 ヶ月 前
コミット
535bd43179
共有8 個のファイルを変更した568 個の追加471 個の削除を含む
  1. 4 4
      .env.production
  2. 2 2
      package-lock.json
  3. 8 0
      src/api/login.js
  4. 2 2
      src/main.js
  5. 16 0
      src/store/modules/user.js
  6. 19 2
      src/views/courtyardManage/courtyardHome.vue
  7. 38 10
      src/views/headerComponent.vue
  8. 479 451
      src/views/login.vue

+ 4 - 4
.env.production

@@ -15,10 +15,10 @@ VUE_APP_RENEWAL_ENCODING = ''
 # VUE_APP_BASE_API = 'lasfl.sxau.edu.cn/api'
 
 # 1.8外网地址
-VUE_APP_BASE_API = 'lab.zjznai.com/labTest'
+# VUE_APP_BASE_API = 'lab.zjznai.com/labTest'
 
 # 1.88外网地址
-# VUE_APP_BASE_API = 'lab.zjznai.com/appTest'
+VUE_APP_BASE_API = 'lab.zjznai.com/appTest'
 
 # 43外网地址
 # VUE_APP_BASE_API = 'lab.zjznai.com/labapp'
@@ -32,10 +32,10 @@ VUE_APP_BASE_API = 'lab.zjznai.com/labTest'
 # VUE_APP_BASE_LOCAL_API = 'lasfl.sxau.edu.cn/api'
 
 # 1.8内网地址
-VUE_APP_BASE_LOCAL_API = '192.168.1.8/api'
+# VUE_APP_BASE_LOCAL_API = '192.168.1.8/api'
 
 # 1.88内网地址
-# VUE_APP_BASE_LOCAL_API = '192.168.1.88/labSystem'
+VUE_APP_BASE_LOCAL_API = '192.168.1.88/labSystem'
 
 # 43内网地址
 # VUE_APP_BASE_LOCAL_API = '192.168.1.43/api'

+ 2 - 2
package-lock.json

@@ -2134,7 +2134,7 @@
     },
     "@vue/devtools-api": {
       "version": "6.6.4",
-      "resolved": "https://mirrors.huaweicloud.com/repository/npm/@vue/devtools-api/-/devtools-api-6.6.4.tgz",
+      "resolved": "https://registry.npmmirror.com/@vue/devtools-api/-/devtools-api-6.6.4.tgz",
       "integrity": "sha512-sGhTPMuXqZ1rVOk32RylztWkfXTRhuS7vgAKv0zjqk8gbsHkJ7xfFf+jbySxt7tWObEJwyKaHMikV/WGDiQm8g=="
     },
     "@vue/vue-loader-v15": {
@@ -10414,7 +10414,7 @@
     },
     "vuex": {
       "version": "4.1.0",
-      "resolved": "https://mirrors.huaweicloud.com/repository/npm/vuex/-/vuex-4.1.0.tgz",
+      "resolved": "https://registry.npmmirror.com/vuex/-/vuex-4.1.0.tgz",
       "integrity": "sha512-hmV6UerDrPcgbSy9ORAtNXDr9M4wlNP4pEFKye4ujJF8oqgFFuxDCdOLS3eNoRTtq5O3hoBDh9Doj1bQMYHRbQ==",
       "requires": {
         "@vue/devtools-api": "^6.0.0-beta.11"

+ 8 - 0
src/api/login.js

@@ -53,3 +53,11 @@ export function getInfo() {
         method: 'get'
     })
 }
+//获取学院token
+export function authGetAllToken(query) {
+  return request({
+    url: '/auth/getAllToken',
+    method: 'get',
+    params: query
+  })
+}

+ 2 - 2
src/main.js

@@ -1,5 +1,6 @@
 import Vue from 'vue'
 import App from './App.vue'
+import store from './store'
 import axios from 'axios'
 import routes from './router';
 import '@/assets/styles/index.scss'
@@ -45,9 +46,8 @@ Vue.prototype.msgInfo = function (msg) {
 const router = new VueRouter({
   routes
 });
-
-
 new Vue({
   router,
+  store,
   render: h => h(App),
 }).$mount('#app')

+ 16 - 0
src/store/modules/user.js

@@ -11,6 +11,8 @@ const user = {
     roles: [],
     permissions: [],
     messageNum:0,
+    deptList:[],
+    checkDeptIndex:0,
   },
 
   mutations: {
@@ -34,6 +36,12 @@ const user = {
     },
     SET_MESSAGE_NUM: (state, num) => {
       state.messageNum = num
+    },
+    SET_DEPT_LIST: (state, deptList) => {
+      state.deptList = deptList
+    },
+    SET_CHECK_DEPT_INDEX: (state, index) => {
+      state.checkDeptIndex = index
     }
   },
 
@@ -64,6 +72,14 @@ const user = {
       commit('SET_PERMISSIONS', [])
       removeToken()
     },
+    setCheckIndex({ commit }, index){
+      console.log('SET_CHECK_DEPT_INDEX')
+      commit('SET_CHECK_DEPT_INDEX', index)
+    },
+    setDept({ commit }, list){
+      console.log('SET_DEPT_LIST')
+      commit('SET_DEPT_LIST', list)
+    },
   }
 }
 

+ 19 - 2
src/views/courtyardManage/courtyardHome.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="home-page">
     <headerComponent></headerComponent>
-    <div class="left">
+    <div class="left" v-if="showType">
       <div class="left_t">
         <img class="left_t_l" src="@/assets/image/index_icon5.png"/>
         <div class="left_t_l1"></div>
@@ -87,7 +87,7 @@
         <personnelAdmittanceECharts></personnelAdmittanceECharts>
       </div>
     </div>
-    <div class="right">
+    <div class="right" v-if="showType">
       <div class="right_t">
         <!--公共小标题-->
         <div class="small_title">
@@ -147,6 +147,7 @@
     },
     data() {
       return {
+        showType:true,
         circularLogo: localStorage.getItem('circularLogo'),
         deptName: null,
         deptId: null,
@@ -209,6 +210,22 @@
       this.timerPlay()
     },
     methods: {
+      checkDept(){
+        let self = this;
+        if(!this.warningList[0]){
+          this.$set(this,'showType',false);
+          setTimeout(function(){
+            self.$set(self,'showType',true);
+            self.infoFun();
+            self.warningPlanFun();
+            self.workPlanFun();
+            self.laboratoryBigViewSelectTriggerInfo();
+            self.laboratoryBigViewCollegeEventStatistics();
+            self.$set(self,'checkedNum',0);
+          },500);
+        }
+
+      },
       // 定时器
       timerPlay() {
         let self = this

+ 38 - 10
src/views/headerComponent.vue

@@ -20,14 +20,18 @@
       <img class="out-img" @click="openBackManageUrl" src="@/assets/ZDimages/icon_gb@1x.png">
     </div>
     <div class="bottom-max-box">
-      <div :class="index == checkDept?'checkP':'noCheckP'" v-for="(item,index) in deptList" :key="index">
-        <p >{{item.deptName}}</p>
+      <div :class="index == setCheckIndex?'checkP':'noCheckP'"
+           @click="checkIndexButton(index)"
+           v-for="(item,index) in deptList" :key="index">
+        <p >{{item.level == 1 ?'汇总数据':item.name}}</p>
       </div>
     </div>
   </div>
 </template>
 <script>
+  import store from '@/store'
   import { removeToken } from '@/utils/auth'
+  import { setToken } from '@/utils/auth'
   export default {
     name: 'headerComponent',
     data () {
@@ -37,23 +41,45 @@
         timeData1:'',
         timeData2:'',
         timeData3:'',
-        deptList:[
-          {deptName:"汇总数据",deptId:'9999999'},
-          {deptName:"材料与物理学院",deptId:'9999999'},
-          {deptName:"化工学院",deptId:'9999999'},
-          {deptName:"低碳能源与动学院学院学院",deptId:'9999999'},
-        ],
-        checkDept:0,
+        deptList:[],
+        setCheckIndex:0,
+        deptTimer:null,
+
       }
     },
     created(){
 
     },
     mounted(){
+      this.$set(this,'deptList',JSON.parse(localStorage.getItem('deptList')));
+      this.$set(this,'setCheckIndex',parseInt(localStorage.getItem('setCheckIndex')));
       this.updateTime();
-      this.timer = setInterval(this.updateTime, 1000)
+      this.timer = setInterval(this.updateTime, 1000);
+      this.deptTimerFunction();
     },
     methods:{
+      deptTimerFunction(){
+        let self = this
+        clearInterval(this.deptTimer)
+        this.deptTimer = setInterval(function() {
+          if(self.setCheckIndex == 3){
+            self.checkIndexButton(0);
+          }else{
+            self.checkIndexButton((self.setCheckIndex+1));
+          }
+        }, 1000 * 180)
+      },
+      checkIndexButton(index){
+        this.$set(this,'setCheckIndex',index);
+        localStorage.setItem('setCheckIndex', index);
+        if(this.deptList[index].level == 1){
+          localStorage.setItem('deptId','');
+        }else{
+          localStorage.setItem('deptId',this.deptList[index].deptId);
+        }
+        setToken(this.deptList[index].token);
+        this.$parent.checkDept();
+      },
       //跳转后台管理
       openBackManageUrl() {
         this.$confirm('确定注销并退出系统吗?', '提示', {
@@ -102,11 +128,13 @@
     beforeDestroy() {
       //清除定时器
       clearInterval(this.timer);
+      clearInterval(this.deptTimer);
     }
     ,
     destroyed() {
       //清除定时器
       clearInterval(this.timer);
+      clearInterval(this.deptTimer);
     }
   }
 </script>

ファイルの差分が大きいため隠しています
+ 479 - 451
src/views/login.vue