|
@@ -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>
|