reedliuqing_i 5 jaren geleden
bovenliggende
commit
6ddc2c0ff7
8 gewijzigde bestanden met toevoegingen van 296 en 37 verwijderingen
  1. 3 2
      package.json
  2. 13 0
      src/api/user.js
  3. 64 1
      src/api/workbench.js
  4. 3 1
      src/apiConfig/api.js
  5. 6 8
      src/router/index.js
  6. 13 25
      src/utils/request.js
  7. 179 0
      src/views/workbench/person/index.vue
  8. 15 0
      src/views/workbench/team/index.vue

+ 3 - 2
package.json

@@ -16,8 +16,9 @@
   },
   "dependencies": {
     "@didi/omega-tracker": "^2.2.8",
-    "@fullcalendar/core": "^4.3.1",
-    "@fullcalendar/daygrid": "^4.3.0",
+    "@fullcalendar/core": "^4.4.0",
+    "@fullcalendar/daygrid": "^4.4.0",
+    "@fullcalendar/vue": "^4.4.0",
     "animate.css": "^3.7.2",
     "axios": "0.18.0",
     "dayjs": "^1.8.17",

+ 13 - 0
src/api/user.js

@@ -7,3 +7,16 @@ export function getUserInfo() {
     method: 'get'
   })
 }
+
+export function getAccountInfos(data) {
+  return request({
+    url: requestIp + '/sso/account-infos',
+    method: 'get',
+    params: data
+  })
+}
+
+export default {
+  getUserInfo,
+  getAccountInfos
+}

+ 64 - 1
src/api/workbench.js

@@ -1,7 +1,70 @@
 import request from '@/utils/request'
-import { mockUrl } from '@/apiConfig/api'
+import { mockUrl, workbenchUrl } from '@/apiConfig/api'
 // ================================== Interface ======================================
 
+// 获取用户团队列表
+export function queryTeamInfoList(data) {
+  return request({
+    url: workbenchUrl + '/team/queryTeamInfoList',
+    method: 'post',
+    data
+  })
+}
+
+// 角色信息枚举类
+export function showTeamAndMemberEnum(data) {
+  return request({
+    url: workbenchUrl + '/config/showTeamAndMemberEnum',
+    method: 'get',
+    data
+  })
+}
+
+// 获取当月用户日程信息
+export function queryWorkListByTime(data) {
+  return request({
+    url: workbenchUrl + '/workbench/personal/queryWorkListByTime',
+    method: 'post',
+    data
+  })
+}
+
+// 获取当月用户日程信息
+export function queryWorkList(data) {
+  return request({
+    url: workbenchUrl + '/workbench/personal/queryWorkList',
+    method: 'post',
+    data
+  })
+}
+
+// 获取个人空闲日程列表
+export function queryIdleList(data) {
+  return request({
+    url: workbenchUrl + '/workbench/personal/queryIdleList',
+    method: 'post',
+    data
+  })
+}
+
+// 获取团队用户日程信息
+export function queryTeamWorkList(data) {
+  return request({
+    url: workbenchUrl + '/workbench/personal/queryTeamWorkList',
+    method: 'post',
+    data
+  })
+}
+
+export default {
+  queryTeamInfoList,
+  showTeamAndMemberEnum,
+  queryWorkListByTime,
+  queryWorkList,
+  queryIdleList,
+  queryTeamWorkList
+}
+
 // 创建文件夹
 export function personalworkstationQueryBackLog(data) {
   return request({

+ 3 - 1
src/apiConfig/api.js

@@ -19,4 +19,6 @@ export const task_Url = projectManagementUrl // 任务
 
 export const Presentation = projectManagementUrl // 报告模块
 
-export const envWebUrl = requestIp + '/env-web' //环境web
+export const envWebUrl = requestIp + '/env-web' //环境web
+
+export const workbenchUrl = projectManagementUrl //工作台

+ 6 - 8
src/router/index.js

@@ -59,30 +59,28 @@ export const constantRoutes = [{
   name: '首页',
   hidden: true
 },
-
 {
-  path: '/Platform/Workbench',
+  path: '/Platform/workbench',
   name: '工作台',
   component: Layout,
-  redirect: '/Platform/Workbench/PersonalWorkbench',
+  redirect: '/Platform/workbench/person',
   meta: { title: '工作台', icon: '工作台' },
   children: [{
-    path: 'PersonalWorkbench',
+    path: 'person',
     name: '个人工作台',
     component: () =>
-          import('@/views/Platform/Workbench/PersonalWorkbench'),
+          import('@/views/workbench/person/index.vue'),
     meta: { title: '个人工作台' }
   },
   {
-    path: 'TeamWorkbench',
+    path: 'team',
     name: '团队工作台',
     component: () =>
-          import('@/views/Platform/Workbench/TeamWorkbench'),
+          import('@/views/workbench/team/index.vue'),
     meta: { title: '团队工作台' }
   }
   ]
 },
-
 {
   path: '/Platform/projectManage',
   name: '项目管理',

+ 13 - 25
src/utils/request.js

@@ -48,32 +48,20 @@ service.interceptors.response.use(
    */
   response => {
     const res = response.data
+    if (typeof res.code !== 'undefined' && res.code !== 200 && res.code !== 0) {
+      Message({
+        message: res.msg || 'Error',
+        type: 'error',
+        duration: 5 * 1000
+      })
+    } else if (typeof res.retCode !== 'undefined' && res.retCode !== 0) {
+      Message({
+        message: res.retMsg || 'Error',
+        type: 'error',
+        duration: 5 * 1000
+      })
+    }
     return res
-    // if the custom code is not 20000, it is judged as an error.
-    // if (res.code !== 200) {
-    //   // Message({
-    //   //   message: res.message || 'Error',
-    //   //   type: 'error',
-    //   //   duration: 5 * 1000
-    //   // })
-
-    //   // 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;
-    //   if (res.code === 50008 || res.code === 50012 || res.code === 50014) {
-    //     // to re-login
-    //     MessageBox.confirm('You have been logged out, you can cancel to stay on this page, or log in again', 'Confirm logout', {
-    //       confirmButtonText: 'Re-Login',
-    //       cancelButtonText: 'Cancel',
-    //       type: 'warning'
-    //     }).then(() => {
-    //       store.dispatch('user/resetToken').then(() => {
-    //         location.reload()
-    //       })
-    //     })
-    //   }
-    //   return Promise.reject(new Error(res.message || 'Error'))
-    // } else {
-    //   return res
-    // }
   },
   error => {
     console.log('err' + error) // for debug

+ 179 - 0
src/views/workbench/person/index.vue

@@ -0,0 +1,179 @@
+<template>
+  <el-container direction="vertical" class="workbench_penson">
+    <el-main class="layout_main header" style="padding: 20px 30px">
+      <div class="realname">{{ realname }}</div>
+      <div v-for="(item,index) in teamInfo" v-show="index < 2 || teamInfoShow" :key="index" class="teamInfo">
+        {{ item.teamName + '的' + getUserRoleInTeam(username,item) }}
+      </div>
+      <div v-if="teamInfo.length>2 && !teamInfoShow" style="margin-top: 20px" class="more" @click.native="teamInfoShow = true">更多</div>
+    </el-main>
+    <el-container style="margin-top: 20px" class="middle">
+      <el-aside width="32.2%" style="margin-right: 1.7%" class="layout_aside">
+        <div class="module_title">
+          <div class="module_title__sign" />
+          <div class="module_title__caption">我的日程</div>
+        </div>
+        <FullCalendar default-view="dayGridMonth" :plugins="calendarPlugins" />
+      </el-aside>
+      <el-aside width="32.2%" style="margin-right: 1.7%" class="layout_aside">
+        <div class="module_title">
+          <div class="module_title__sign" />
+          <div class="module_title__caption">我的数据</div>
+        </div>
+      </el-aside>
+      <el-aside width="32.2%" class="layout_aside">
+        <div class="module_title">
+          <div class="module_title__sign" />
+          <div class="module_title__caption">提醒</div>
+        </div>
+      </el-aside>
+    </el-container>
+    <el-main>
+      <FullCalendar
+        ref="fullCalendar"
+        default-view="dayGridMonth"
+        :plugins="calendarPlugins"
+        :weekends="false"
+        :events="[
+          { title: 'event 1', date: '2020-03-05' },
+          { title: 'event 2', date: '2020-03-07' }
+        ]"
+      />
+    </el-main>
+  </el-container>
+</template>
+
+<script>
+import FullCalendar from '@fullcalendar/vue'
+import dayGridPlugin from '@fullcalendar/daygrid'
+import workbenchApi from '@/api/workbench.js'
+
+export default {
+  components: {
+    FullCalendar
+  },
+  data() {
+    return {
+      calendarPlugins: [dayGridPlugin],
+      teamInfoShow: false,
+      teamAndMemberEnum: {},
+      teamAndMemberMap: {},
+      teamInfo: [],
+      userInfo: {},
+      username: localStorage.getItem('username'),
+      realname: localStorage.getItem('realname'),
+      accountInfo: {}
+    }
+  },
+  created() {
+    this.init()
+  },
+  methods: {
+    init() {
+      this.showTeamAndMemberEnum()
+      this.queryTeamInfoList(this.username)
+      const calendarApi = this.$refs.fullCalendar.getApi()
+      console.log(calendarApi)
+    },
+    // 获取角色信息枚举类
+    showTeamAndMemberEnum() {
+      workbenchApi.showTeamAndMemberEnum()
+        .then(res => {
+          this.teamAndMemberEnum = res.data
+          if (this.teamAndMemberEnum) {
+            for (const i in this.teamAndMemberEnum) {
+              this.teamAndMemberMap[i] = {}
+              if (this.teamAndMemberEnum[i]) {
+                for (const j in this.teamAndMemberEnum[i]) {
+                  this.teamAndMemberMap[i][this.teamAndMemberEnum[i][j].code] = this.teamAndMemberEnum[i][j].msg
+                }
+              }
+            }
+          }
+          console.log(this.teamAndMemberMap)
+        })
+    },
+    // 获取用户团队列表
+    queryTeamInfoList(username) {
+      const data = { 'memberIDAP': username, 'curIndex': 1, 'pageSize': 2 }
+      workbenchApi.queryTeamInfoList(data)
+        .then(res => {
+          if (res.data) {
+            this.teamInfo = res.data.list
+          }
+        })
+    },
+    getUserRoleInTeam(username, teamInfoItem) {
+      const data = []
+      for (const i in teamInfoItem.teamAttribute) {
+        data.push(this.teamAndMemberMap.teamRoleEnum[teamInfoItem.teamAttribute[i]])
+      }
+      return data.join('、')
+    }
+  }
+}
+</script>
+
+<style scoped>
+.header .realname {
+  font-size:22px;
+  font-weight:500;
+  color:rgba(51,59,74,1);
+  line-height:35px;
+  margin-bottom: 20px;
+}
+.header .teamInfo {
+  font-size:14px;
+  font-weight:400;
+  color:rgba(51,51,51,1);
+  line-height:20px;
+}
+.header .more {
+  font-weight:400;
+  color:rgba(155,155,155,1);
+}
+</style>
+
+// 布局
+<style scoped>
+.workbench_penson {
+  background-color: #F2F3F6;
+  padding: 1%;
+}
+.workbench_penson .layout_main,.layout_aside {
+  border-radius: 8px;
+  background-color: #ffffff;
+}
+.middle .layout_aside{
+  padding: 20px 30px;
+}
+</style>
+
+// 公共部分
+<style scoped>
+.module_title{
+  display:flex;
+  align-items: center;
+  margin-bottom: 20px
+}
+.module_title__sign {
+  width:4px;
+  height:15px;
+  background:#409EFF;
+  border-radius:1px;
+}
+.module_title__caption{
+  width:83px;
+  height:18px;
+  font-size:16px;
+  font-family:MicrosoftYaHei;
+  color:rgba(51,59,74,1);
+  margin-left:6px;
+  font-weight: 500;
+}
+</style>
+
+<style lang='scss'>
+@import '~@fullcalendar/core/main.css';
+@import '~@fullcalendar/daygrid/main.css';
+</style>

+ 15 - 0
src/views/workbench/team/index.vue

@@ -0,0 +1,15 @@
+<template>
+  <el-containr>
+    123
+  </el-containr>
+</template>
+
+<script>
+export default {
+
+}
+</script>
+
+<style>
+
+</style>