Эх сурвалжийг харах

Merge branch 'wangzi_dev' of git.xiaojukeji.com:jacklijiajia/thoth-frontend into http_test

PrinceLee 5 жил өмнө
parent
commit
42b7961d0e

+ 7 - 0
src/api/projectViewDetails.js

@@ -71,3 +71,10 @@ export function sortForTask(id, data) {
     data
   })
 }
+// 获取项目详情页获取统计数据
+export function getProjectSumData(id) {
+  return request({
+    url: TeamManagement + `/project/getProjectSumData?id=` + id,
+    method: 'get'
+  })
+}

+ 62 - 0
src/api/workSchedule.js

@@ -2,6 +2,68 @@
 import request from '@/utils/request'
 import { TeamManagement } from '@/apiConfig/api'
 
+// 获取用户团队列表
+export function queryTeamInfoList(data) {
+  return request({
+    url: TeamManagement + `/team/queryTeamInfoList`,
+    method: 'post',
+    data
+  })
+}
+
+// 角色信息枚举类
+export function showTeamAndMemberEnum(data) {
+  return request({
+    url: TeamManagement + '/config/showTeamAndMemberEnum',
+    method: 'get',
+    data
+  })
+}
+
+// 获取用户日程信息
+export function queryWorkList(data) {
+  return request({
+    url: TeamManagement + '/workbench/personal/queryWorkList',
+    method: 'post',
+    data
+  })
+}
+
+// 获取个人空闲日程列表
+export function queryIdleList(data) {
+  return request({
+    url: TeamManagement + '/workbench/personal/queryIdleList',
+    method: 'post',
+    data
+  })
+}
+
+// 删除个人日程
+export function deleteSelfSchedule(id) {
+  return request({
+    url: TeamManagement + '/selfSchedule/delete?id=' + id,
+    method: 'post'
+  })
+}
+
+// 获取指定时间段用户日程信息
+export function queryWorkListByTime(data) {
+  return request({
+    url: TeamManagement + '/workbench/personal/queryWorkListByTime',
+    method: 'post',
+    data
+  })
+}
+
+// 更新个人日程
+export function updateSelfSchedule(data) {
+  return request({
+    url: TeamManagement + '/selfSchedule/update',
+    method: 'post',
+    data
+  })
+}
+
 // 获取团队用户空闲信息
 export function queryTeamIdleList(data) {
   return request({

+ 1 - 0
src/components/chart/normalEchart.vue

@@ -25,6 +25,7 @@ export default {
   watch: {
     option: {
       handler(newValue, oldValue) {
+        console.log(newValue)
         const myChart = echarts.init(document.getElementById(this.chartId))
         myChart.clear()
         this.drawLine()

+ 2 - 1
src/views/projectManage/projectList/components/bugsList.vue

@@ -199,7 +199,8 @@ export default {
       const params = {
         bizId: Number(localStorage.getItem('bizId')),
         pageSize: this.pageSize,
-        curIndex: this.curIndex
+        curIndex: this.curIndex,
+        projectId: this.$route.query.id
       }
       const res = await bugList(params)
       if (res.code === 200) {

+ 43 - 24
src/views/projectManage/projectList/components/dataStatistics.vue

@@ -4,39 +4,39 @@
       <div class="data-num">
         <div class="data-add blue" @click="need_open = true" />
         <div class="data-detail">
-          <b>{{ inputValue.requirementCount }}</b>
+          <b v-if="requireData">{{ requireData.total }}</b>
           <span>需求数量</span>
         </div>
       </div>
       <div class="data-line" />
       <div class="data-chart">
-        <normal-echart v-if="value" :chart-id="'chartFirst'" :option="echartsOption1" />
+        <normal-echart :chart-id="'chartFirst'" :option="echartsOption1" />
       </div>
     </article>
     <article>
       <div class="data-num">
         <div class="data-add green" @click="reated_task()" />
         <div class="data-detail">
-          <b>{{ inputValue.taskCount }}</b>
+          <b v-if="taskData">{{ taskData.total }}</b>
           <span>任务数量</span>
         </div>
       </div>
       <div class="data-line" />
       <div class="data-chart">
-        <normal-echart v-if="value" :chart-id="'chartFirst'" :option="echartsOption1" />
+        <normal-echart :chart-id="'chartSecond'" :option="echartsOption2" />
       </div>
     </article>
     <article>
       <div class="data-num">
         <div class="data-add red" @click="created_bug()" />
         <div class="data-detail">
-          <b>{{ inputValue.bugCount }}</b>
+          <b v-if="bugData">{{ bugData.total }}</b>
           <span>缺陷数量</span>
         </div>
       </div>
       <div class="data-line" />
       <div class="data-chart">
-        <normal-echart v-if="value" :chart-id="'chartFirst'" :option="echartsOption1" />
+        <normal-echart :chart-id="'chartThird'" :option="echartsOption3" />
       </div>
     </article>
     <requirement-create
@@ -56,6 +56,7 @@ import normalEchart from '@/components/chart/normalEchart'
 import RequirementCreate from '@/views/projectManage/requirement/list/create'
 import openDialog from '@/views/projectManage/dialog_vue'
 import createdBug from '@/views/projectManage/bugList/file/createdBug'
+import { getProjectSumData } from '@/api/projectViewDetails'
 export default {
   components: {
     normalEchart,
@@ -63,34 +64,53 @@ export default {
     openDialog,
     createdBug
   },
-  props: {
-    value: {
-      type: Object,
-      default: () => null,
-      required: false
-    }
-  },
   data() {
     return {
-      inputValue: '',
       edit: false,
       need_open: false, // 新建需求
       dataChart1: false,
       echartsOption1: {},
+      echartsOption2: {},
+      echartsOption3: {},
       requirement: {},
       task_open: false, // 新建任务
-      bug_open: false// 新建缺陷
+      bug_open: false, // 新建缺陷
+      requireData: null, // 需求数据
+      taskData: null, // 任务数据
+      bugData: null // 缺陷数据
     }
   },
-  watch: {
-    value: {
-      handler(newV, oldV) {
-        this.inputValue = newV
-      },
-      immediate: true
-    }
+  created() {
+    this.getProjectSumData()
   },
   methods: {
+    async getProjectSumData() { // 获取数据
+      const res = await getProjectSumData(this.$route.query.id)
+      if (res.code === 200) {
+        console.log(res.data)
+        this.requireData = res.data.requireData
+        this.taskData = res.data.taskData
+        this.bugData = res.data.bugData
+        this.setDataChart(this.requireData.detail, 'echartsOption1')
+        this.setDataChart(this.taskData.detail, 'echartsOption2')
+        this.setDataChart(this.bugData.detail, 'echartsOption3')
+      }
+    },
+    setDataChart(data, obj) {
+      this[obj] = {
+        color: ['#3AA1FF'],
+        tooltip: { trigger: 'axis', axisPointer: { type: 'line' }}, // 默认为直线,可选为:'line' | 'shadow'
+        grid: { left: '15%', right: '15%', top: '15%', bottom: '10%', containLabel: true },
+        xAxis: [{ type: 'category', data: data.xaxis, axisTick: { alignWithLabel: true }}],
+        yAxis: [{ type: 'value', axisLine: { show: false }, splitLine: { lineStyle: { type: 'dashed' }}}],
+        series: [
+          {
+            name: data.yaxis[0].name, type: 'bar', barWidth: '20px', data: data.yaxis[0].data || [],
+            itemStyle: { normal: { label: { show: true, formatter: '{c}', position: 'top' }}}
+          }
+        ]
+      }
+    },
     initRequirementCreateDialog() {
       this.requirement.belongingProject = this.$route.query.id // 这里传入项目id
       this.requirement.bizId = localStorage.getItem('bizId') // 这里传入业务线id
@@ -113,8 +133,7 @@ export default {
       })
     },
     change() {
-      this.$emit('update:valuesList', this.inputValue)
-      this.$emit('change', this.inputValue)
+      this.$emit('change')
     }
   }
 }

+ 1 - 1
src/views/projectManage/projectList/projectViewDetails.vue

@@ -138,7 +138,7 @@
       <!-- 统计 -->
       <el-container v-show="activeName === '5'" class="is-vertical">
         <section class="main-section">
-          <data-statistics :value="form_query" @change="get_list" />
+          <data-statistics @change="get_list" />
         </section>
       </el-container>
       <!-- 统计 -->

+ 0 - 0
src/views/workbench/person/components/calender.vue


+ 165 - 312
src/views/workbench/person/index.vue

@@ -17,39 +17,36 @@
         </div>
       </el-header>
       <!-- 顶部导航栏 -->
+      <!-- 工作台简介 -->
       <el-container v-show="activeName === '1'" class="is-vertical">
         <section class="main-section">
           <div class="el-main-title">
-            <div class="title-left-name">{{ realname }}</div>
+            <div class="title-name">{{ realname }}</div>
           </div>
           <div v-if="teamInfo" class="detail-info">
-            <div v-for="(item,index) in teamInfo" :key="index" class="teamInfo">
-              <div class="team_name">
-                <div style="display: inline-block">{{ item.teamName + '的' + getUserRoleInTeam(username,item) }}</div>
-                <div style="display: inline-block" @mouseover="chirdrenClass = index" @mouseout="chirdrenClass = -1">
-                  <div style="display: inline-block;width: 10px;background-color: #409eff;" />
-                  <div :style="chirdrenClass === index? {display:'block'}:{display: 'none'}" class="team_content">
-                    <div style="color: rgba(155, 155, 155, 1)">团队名称</div>
+            <div v-for="(item,index) in teamInfo" :key="'teamInfo'+index">
+              <div class="team-contain">
+                <div class="inline" @mouseover="chirdrenClass = index" @mouseout="chirdrenClass = -1">
+                  {{ item.teamName + '的' + getUserRoleInTeam(username,item) }}
+                </div>
+                <div class="inline">
+                  <div :class="[chirdrenClass === index? 'visible':'hidden']" class="team-content">
+                    <div class="color-grey">团队名称</div>
                     <div>{{ item.teamName }}</div>
-                    <div style="color: rgba(155, 155, 155, 1)">我的角色</div>
+                    <div class="color-grey">我的角色</div>
                     <div>{{ getUserRoleInTeam(username,item) }}</div>
-                    <div style="color: rgba(155, 155, 155, 1)">团队成员</div>
+                    <div class="color-grey">团队成员</div>
                     <div>{{ getTeamMember(item) }}</div>
                   </div>
                 </div>
               </div>
             </div>
-            <div style="margin-top: 5px;" class="more" @click="teamInfoDialogVisible = true">更多</div>
+            <div class="more" @click="teamInfoDialogVisible = true">更多</div>
           </div>
         </section>
       </el-container>
-      <el-container style="margin-top: 10px" class="middle">
-        <div class="module_title">
-          <div class="module_title__sign" />
-          <div class="module_title__caption">我的日程</div>
-        </div>
-        <MyFullCalendar :events="calendarEvents" @dateClick="dateClick" @expand="calendarDialogVisible = true" @change="queryWorkListByTime" @select="select" @eventDrop="eventDrop" />
-      </el-container>
+      <!-- 工作台简介 -->
+      <!-- 工作台简介展开弹框 -->
       <el-dialog
         class="workbench_fullscreen_dialog"
         :visible.sync="teamInfoDialogVisible"
@@ -95,6 +92,14 @@
           </el-table>
         </div>
       </el-dialog>
+      <!-- 工作台简介展开弹框 -->
+      <!-- 日程 -->
+      <el-container>
+        <section class="main-section">
+          <MyFullCalendar :events="calendarEvents" @dateClick="dateClick" @expand="calendarDialogVisible = true" @change="queryWorkListByTime" @select="select" @eventDrop="updateSelfSchedule" />
+        </section>
+      </el-container>
+      <!-- 日程 -->
       <el-dialog
         class="workbench_fullscreen_dialog"
         :visible.sync="calendarDialogVisible"
@@ -104,136 +109,11 @@
       >
         <el-tabs v-model="tabsActiveName" style="margin-right: 20px;" @tab-click="handleTabsClick">
           <el-tab-pane label="日历视图" name="1" style="padding: 31px 146px">
-            <MyFullCalendar :events="calendarEvents" type="big" @dateClick="dateClick" @change="queryWorkListByTime" @select="select" @eventDrop="eventDrop" />
-          </el-tab-pane>
-          <el-tab-pane label="列表视图" name="2" style="padding: 31px 146px">
-            <div>
-              <div class="list-view-header">
-                <button
-                  style="border-radius: 4px 0 0  4px;"
-                  :class="busyClassName"
-                  @click="busyClassName = 'selected';idleClassName='idle'"
-                >忙碌</button>
-                <button
-                  :class="idleClassName"
-                  style="margin-left: -4px;border-left: none;border-radius: 0 4px 4px 0;"
-                  @click="busyClassName = 'busy';idleClassName='selected';queryIdleList()"
-                >空闲</button>
-                <div v-if="idleClassName === 'selected'" style="display: inline-block">
-                  <div style="display: inline-block;margin-left: 20px">选择时间:</div>
-                  <el-date-picker
-                    v-if="idleClassName === 'selected'"
-                    v-model="timeSelectVal"
-                    type="daterange"
-                    range-separator="-"
-                    start-placeholder="开始日期"
-                    end-placeholder="结束日期"
-                    :picker-options="pickerOptions"
-                    :clearable="false"
-                    @change="queryIdleList()"
-                  />
-                </div>
-                <div v-else style="display: inline-block">
-                  <el-select
-                    v-model="selfScheduleForm.status"
-                    style="margin-left: 20px"
-                    @change="queryWorkList()"
-                  >
-                    <el-option
-                      v-for="item in selfScheduleStatusEnum"
-                      :key="item.code"
-                      :label="item.name"
-                      :value="item.code"
-                    />
-                  </el-select>
-                  <el-checkbox
-                    v-model="selfScheduleForm.myOrigin[0]"
-                    style="margin: 0 20px"
-                    :true-label="1"
-                    :false-label="0"
-                    @change="queryWorkList()"
-                  >任务排期</el-checkbox>
-                  <el-checkbox
-                    v-model="selfScheduleForm.myOrigin[1]"
-                    :true-label="1"
-                    :false-label="0"
-                    @change="queryWorkList()"
-                  >个人日程</el-checkbox>
-                </div>
-              </div>
-            </div>
-            <el-table
-              v-show="busyClassName === 'selected'"
-              border
-              :data="selfScheduleBusyTableData"
-              style="width: 100%;font-size: 14px; color:#333B4A;margin-top: 20px"
-              :header-cell-style="{color:'#333B4A',fontSize: '16px',fontWeight:500,background:'rgba(240,242,244,1)'}"
-            >
-              <el-table-column prop="name" label="日程名称" align="center" min-width="138">
-                <template v-slot="scope">
-                  {{ getName(scope) }}
-                </template>
-              </el-table-column>
-              <el-table-column prop="startTime" label="日期" align="center" min-width="232">
-                <template v-slot="scope">
-                  {{ scope.row.startTime + ' ~ ' + scope.row.endTime }}
-                </template>
-              </el-table-column>
-              <el-table-column prop="originName" label="来源" align="center" min-width="126" />
-              <el-table-column prop="bizName" label="业务线" align="center" min-width="119" />
-              <el-table-column label="使用/工作日/全部" align="center" min-width="181">
-                <template v-slot="scope">
-                  {{ scope.row.needDays + '/' + scope.row.legalDays + '/' + scope.row.allDays }}
-                </template>
-              </el-table-column>
-              <el-table-column label="是否同步团队日程" align="center" min-width="156">
-                <template v-slot="scope">
-                  {{ scope.row.syncTeam? '是':'否' }}
-                </template>
-              </el-table-column>
-              <el-table-column label="操作" min-width="156" align="center">
-                <template v-slot="scope">
-                  <div v-if="scope.row.originName === '个人日程'">
-                    <el-button size="small" @click="openUpdateSelfScheduleDialog(scope.row)">编辑</el-button>
-                    <el-button size="small" @click="openDeleteSelfScheduleDialog(scope.row)">删除</el-button>
-                  </div>
-                </template>
-              </el-table-column>
-            </el-table>
-            <el-table
-              v-show="busyClassName !== 'selected'"
-              border
-              :data="selfScheduleIdleTableData"
-              style="width: 100%;font-size: 14px; color:#333B4A;margin-top: 20px"
-              :header-cell-style="{color:'#333B4A',fontSize: '16px',fontWeight:500,background:'rgba(240,242,244,1)',textAlign: 'center'}"
-            >
-              <el-table-column prop="name" label="日程名称" align="center" min-width="30" />
-              <el-table-column prop="startTime" label="日期" align="center" min-width="30">
-                <template v-slot="scope">
-                  {{ scope.row.startTime + ' ~ ' + scope.row.endTime }}
-                </template>
-              </el-table-column>
-              <el-table-column label="使用/工作日/全部" align="center" min-width="30">
-                <template v-slot="scope">
-                  <div>{{ scope.row.needDays + '/' + scope.row.legalDays + '/' + scope.row.allDays }}</div>
-                </template>
-              </el-table-column>
-            </el-table>
-            <div align="right">
-              <el-pagination
-                background
-                layout="total, prev, pager, next, jumper"
-                :current-page="selfScheduleForm.curIndex"
-                :page-size="selfScheduleForm.pageSize"
-                :page-sizes="[15,30,45,selfScheduleListTotal]"
-                :total="selfScheduleListTotal"
-                @size-change="handleSizeChange"
-                @current-change="handleCurrentChange"
-              />
-            </div>
+            <MyFullCalendar :events="calendarEvents" type="big" @dateClick="dateClick" @change="queryWorkListByTime" @select="select" @eventDrop="updateSelfSchedule" />
           </el-tab-pane>
         </el-tabs>
       </el-dialog>
+      <!-- 日程操作弹框 -->
       <calendar-dialog
         :title="'编辑日程'"
         :visible="updateSelfScheduleDialog.visible"
@@ -254,16 +134,26 @@
         @cancel="deleteSelfScheduleDialog.visible = false"
         @confirm="deleteSelfSchedule();queryWorkListByTime(calendarView)"
       />
+      <!-- 日程操作弹框 -->
     </el-container>
   </div>
 </template>
 
 <script>
-import workbenchApi from '@/api/workbench.js'
+const _ = require('lodash')
 import MyFullCalendar from './myFullCalendar'
-import dayjs from 'dayjs'
+import moment from 'moment'
 import CalendarDialog from './calendarFormDialog'
 import DeleteDialog from '@/components/dialog/delete.vue'
+import {
+  queryTeamInfoList,
+  showTeamAndMemberEnum,
+  updateSelfSchedule,
+  queryWorkListByTime,
+  queryWorkList,
+  queryIdleList,
+  deleteSelfSchedule
+} from '@/api/workSchedule.js'
 
 export default {
   components: {
@@ -283,42 +173,46 @@ export default {
         { title: 'Event Now', start: new Date(), end: new Date().setDate(16) }
       ],
       deleteDialogVisible: false,
-      createSelfScheduleDialog: {
+      createSelfScheduleDialog: { // 新建日程
         visible: false,
         data: null
       },
-      updateSelfScheduleDialog: {
+      updateSelfScheduleDialog: { // 更新日程
         visible: false,
         data: null
       },
-      deleteSelfScheduleDialog: {
+      deleteSelfScheduleDialog: { // 删除日程
         visible: false,
         data: null
       },
-      selfScheduleStatusEnum: [
+      selfScheduleStatusEnum: [ // 日程状态列表
         { name: '进行中', code: 0 },
         { name: '未开始', code: 1 },
         { name: '过去的', code: 2 }
       ],
       selfScheduleListTotal: 10,
       selfScheduleForm: {
-        status: 0,
-        myOrigin: [1, 1],
-        origin: [0, 1],
-        syncTeam: 1,
-        curIndex: 1,
-        pageSize: 5
+        searchScheduleInfo: {
+          status: 0,
+          origin: [0, 1]
+        },
+        teamSearchInfo: { bizId: localStorage.getItem('bizId') || null },
+        pageInfoDO: {
+          curIndex: 1,
+          pageSize: 10
+        },
+        syncTeam: 1
       },
       selfScheduleBusyTableData: [],
       selfScheduleIdleTableData: [],
       busyClassName: 'selected',
       idleClassName: 'idle',
-      timeSelectVal: [new Date(), dayjs(new Date()).add(29, 'day')],
+      timeSelectVal: [new Date(), moment(new Date()).add(29, 'day')],
       tabsActiveName: '1',
       teamInfoShow: false,
       teamAndMemberEnum: {},
       teamAndMemberMap: {},
-      teamInfo: null,
+      teamInfo: null, // 团队信息数据
       userInfo: {},
       username: localStorage.getItem('username'),
       realname: localStorage.getItem('realname'),
@@ -331,40 +225,33 @@ export default {
     }
   },
   created() {
-    this.init()
+    this.showTeamAndMemberEnum()
+    this.queryWorkList()
   },
   mounted() {
     this.$store.state.data.status = false
   },
   methods: {
-    init() {
-      this.showTeamAndMemberEnum()
-        .then(res => {
-          this.queryTeamInfoList(0)
-        })
-      this.queryWorkList()
-    },
     getName(scope) {
       const type = scope.row.origin ? '日程' : '任务'
-      let ret = ''
-      ret = '【' + type + '】' + scope.row.name
+      let ret = '【' + type + '】' + scope.row.name
       if (scope.row.type) {
         ret = ret + '-' + scope.row.type
-      }
-      if (scope.row.desc) {
+      } else if (scope.row.desc) {
         ret = ret + '-' + scope.row.desc
       }
       return ret
     },
-    eventDrop(info) {
+    async updateSelfSchedule(info) { // 更新日程
       const form = {
         id: info.event.id,
         startTime: info.event.start,
         endTime: info.event.end
       }
-      workbenchApi.updateSelfSchedule(form)
+      await updateSelfSchedule(form)
     },
     dateClick(arg) {
+      console.log(arg)
       // this.createSelfScheduleDialog.data = arg
       // this.createSelfScheduleDialog.visible = true
     },
@@ -372,9 +259,9 @@ export default {
 
     },
     openUpdateSelfScheduleDialog(val) {
-      const form = JSON.parse(JSON.stringify(val))
-      form.startTime = dayjs(form.startTime).toDate()
-      form.endTime = dayjs(form.endTime).toDate()
+      const form = _.cloneDeep(val)
+      form.startTime = moment(form.startTime).toDate()
+      form.endTime = moment(form.endTime).toDate()
       form.time = [form.startTime, form.endTime]
       if (form.bizId !== null) {
         form.isJoin = 1
@@ -384,7 +271,7 @@ export default {
       this.updateSelfScheduleDialog.data = form
       this.updateSelfScheduleDialog.visible = true
     },
-    openDeleteSelfScheduleDialog(val) {
+    openDeleteSelfScheduleDialog(val) { // 关闭删除日程弹框
       this.deleteSelfScheduleDialog.data = val
       this.deleteSelfScheduleDialog.visible = true
     },
@@ -392,89 +279,57 @@ export default {
       this.createSelfScheduleDialog.data = selectionInfo
       this.createSelfScheduleDialog.visible = true
     },
-    // 删除日程
-    deleteSelfSchedule() {
-      workbenchApi.deleteSelfSchedule(this.deleteSelfScheduleDialog.data.id)
-        .then(res => {
-          if (res.code === 200) {
-            this.deleteSelfScheduleDialog.visible = false
-            this.queryWorkList()
-          }
-        })
+    async deleteSelfSchedule() { // 删除日程
+      const res = await deleteSelfSchedule(this.deleteSelfScheduleDialog.data.id)
+      if (res.code === 200) {
+        this.deleteSelfScheduleDialog.visible = false
+        this.queryWorkList()
+      }
     },
-    // 获取个人空闲日程列表
-    queryIdleList() {
-      workbenchApi
-        .queryIdleList({
-          timeInfo: {
-            startTime: dayjs(this.timeSelectVal[0]).format('YYYY.MM.DD'),
-            endTime: dayjs(this.timeSelectVal[1]).format('YYYY.MM.DD')
-          },
-          curIndex: this.selfScheduleForm.curIndex,
-          pageSize: this.selfScheduleForm.pageSize
-        })
-        .then(res => {
-          this.selfScheduleIdleTableData = res.data.list
-          console.log(this.selfScheduleIdleTableData)
-          this.selfScheduleListTotal = res.data.total
-        })
+    async queryIdleList() { // 获取个人空闲日程列表
+      const params = {
+        timeInfo: {
+          startTime: moment(this.timeSelectVal[0]).format('YYYY.MM.DD'),
+          endTime: moment(this.timeSelectVal[1]).format('YYYY.MM.DD')
+        },
+        pageInfoDO: this.selfScheduleForm.pageInfoDO
+      }
+      const res = await queryIdleList(params)
+      if (res.code === 200) {
+        this.selfScheduleIdleTableData = res.data.list
+        this.selfScheduleListTotal = res.data.total
+      }
     },
-    // 获取个人工作日程列表
-    queryWorkList() {
-      if (this.selfScheduleForm.myOrigin[0] && this.selfScheduleForm.myOrigin[1]) {
-        this.selfScheduleForm.origin = [0, 1]
-      } else if (this.selfScheduleForm.myOrigin[0]) {
-        this.selfScheduleForm.origin = [0]
-      } else if (this.selfScheduleForm.myOrigin[1]) {
-        this.selfScheduleForm.origin = [1]
+    async queryWorkList() { // 获取用户日程信息列表
+      const res = await queryWorkList(this.selfScheduleForm)
+      if (res.code === 200) {
+        this.selfScheduleBusyTableData = res.data.list
+        this.selfScheduleListTotal = res.data.total
       }
-      workbenchApi.queryWorkList(this.selfScheduleForm).then(res => {
-        if (res.code === 200) {
-          this.selfScheduleBusyTableData = res.data.list
-          this.selfScheduleListTotal = res.data.total
-        }
-      })
     },
-    queryWorkListByTime(view) {
+    async queryWorkListByTime(view) { // 获取指定时间段用户日程信息
+      console.log('queryWorkListByTime:', view)
       this.calendarView = view
-      const startTime = dayjs(view.activeStart).subtract(1, 'month').format('YYYY.MM.DD')
-      const endTime = dayjs(view.activeEnd).add(1, 'month').format('YYYY.MM.DD')
-      workbenchApi.queryWorkListByTime({ startTime: startTime, endTime: endTime }).then(res => {
-        if (res.code === 200) {
-          this.calendarEvents = []
-          for (const i in res.data) {
-            const item = {
-              id: res.data[i].id,
-              title: res.data[i].name,
-              start: dayjs(res.data[i].startTime).toDate(),
-              end: dayjs(res.data[i].endTime).toDate()
-            }
-            this.calendarEvents.push(item)
-          }
-        }
-      })
-    },
-    handleSizeChange(val) {
-      this.selfScheduleForm.pageSize = val
-      if (this.busyClassName === 'selected') {
-        this.queryWorkList()
-      } else {
-        this.queryIdleList()
+      const params = {
+        startTime: moment(view.activeStart).subtract(1, 'month').format('YYYY.MM.DD'),
+        endTime: moment(view.activeEnd).add(1, 'month').format('YYYY.MM.DD'),
+        teamSearchInfo: { bizId: localStorage.getItem('bizId') || null },
+        searchScheduleInfo: { origin: [0, 1] }
       }
-    },
-    handleCurrentChange(val) {
-      this.selfScheduleForm.curIndex = val
-      if (this.busyClassName === 'selected') {
-        this.queryWorkList()
-      } else {
-        this.queryIdleList()
+      const res = await queryWorkListByTime(params)
+      if (res.code === 200) {
+        this.calendarEvents = res.data.map(item => ({
+          id: item.id,
+          title: item.name,
+          start: moment(item.startTime).toDate(),
+          end: moment(item.endTime).toDate()
+        }))
       }
     },
-    // 标签页切换
-    handleTabsClick() {},
-    // 获取角色信息枚举类
-    showTeamAndMemberEnum() {
-      return workbenchApi.showTeamAndMemberEnum().then(res => {
+    handleTabsClick() {}, // 标签页切换
+    async showTeamAndMemberEnum() { // 获取角色信息枚举类
+      const res = await showTeamAndMemberEnum()
+      if (res.code === 200) {
         this.teamAndMemberEnum = res.data
         if (this.teamAndMemberEnum) {
           for (const i in this.teamAndMemberEnum) {
@@ -488,42 +343,48 @@ export default {
             }
           }
         }
-        return res
-      })
-    },
-    // 获取用户团队列表
-    queryTeamInfoList(type) {
-      const data = { type: type, 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]]
-        )
+        this.queryTeamInfoList()
       }
-      return data.join('、')
     },
-    getTeamMember(teamInfoItem) {
-      const data = []
-      for (const i in teamInfoItem.teamLeaderRelateInfoResponseList) {
-        data.push(teamInfoItem.teamLeaderRelateInfoResponseList[i].memberName + ' Leader')
-      }
-      for (const i in teamInfoItem.teamMemberRelateInfoResponseList) {
-        data.push(teamInfoItem.teamMemberRelateInfoResponseList[i].memberName)
+    async queryTeamInfoList(type) { // 获取用户团队列表
+      const data = { memberIDAP: this.username, curIndex: 1, pageSize: 2 }
+      const res = await queryTeamInfoList(data)
+      if (res.code === 200 && res.data) {
+        this.teamInfo = res.data.list
       }
-      return data.join('、')
+    },
+    getUserRoleInTeam(username, teamInfoItem) { // 人员角色处理
+      const newArr = teamInfoItem.teamAttribute.map(
+        item => this.teamAndMemberMap.teamRoleEnum[item]
+      )
+      return newArr.join('、')
+    },
+    getTeamMember(teamInfoItem) { // 团队成员处理
+      const newArr1 = teamInfoItem.teamLeaderRelateInfoResponseList.map(
+        item => item.memberName + ' Leader'
+      )
+      const newArr2 = teamInfoItem.teamMemberRelateInfoResponseList.map(
+        item => item.memberName
+      )
+      return [...newArr1, ...newArr2].join('、')
     }
   }
 }
 </script>
 <style scoped lang="scss">
 @import '@/styles/detail-pages.scss';
+.color-grey {
+  color: rgba(155, 155, 155, 1)
+}
+.inline {
+  display: inline-block;
+}
+.visible {
+  display: block;
+}
+.hidden {
+  display: none;
+}
 @include hide-open-header;
 .bg-person {
   @include bg-project;
@@ -541,45 +402,37 @@ export default {
 }
 .main-section {
   @include main-section;
+  .title-name {
+    font-size:20px;
+    font-family:PingFangSC-Medium;
+    color:rgba(51,59,74,1);
+  }
   .detail-info {
-    padding: 0 34px;
+    padding: 0 30px 20px 30px;
+    .team-content {
+      z-index: 2;
+      border-radius: 4px;
+      border: 1px solid rgba(155, 155, 155, 1);
+      padding: 10px 20px 20px 20px;
+      background: #ffffff;
+      position: absolute;
+    }
+    .team-content div {
+      margin-top: 10px;
+    }
+    .more {
+      margin-top: 20px;
+      font-size: 14px;
+      font-weight: 400;
+      color: rgba(155, 155, 155, 1);
+      cursor: pointer;
+      display: inline-block;
+    }
   }
 }
 </style>
 
 <style scoped>
-.team_content {
-  z-index: 2;
-  border-radius: 4px;
-  border: 1px solid rgba(155, 155, 155, 1);
-  padding: 10px 20px 20px 20px;
-  background: #ffffff;
-  display: none;
-  position: absolute;
-}
-.team_content div {
-  margin-top: 10px;
-}
-.header .realname {
-  font-size: 22px;
-  font-weight: 500;
-  color: rgba(51, 59, 74, 1);
-  line-height: 35px;
-  margin-bottom: 10px;
-}
-.header .teamInfo {
-  font-size: 14px;
-  font-weight: 400;
-  color: rgba(51, 51, 51, 1);
-  line-height: 20px;
-}
-.header .more {
-  font-size: 14px;
-  font-weight: 400;
-  color: rgba(155, 155, 155, 1);
-  cursor: pointer;
-  display: inline-block;
-}
 .list-view-header button {
   background-color: #fff;
   color: #6f7c93;

+ 1 - 0
src/views/workbench/person/myFullCalendar.vue

@@ -220,6 +220,7 @@ export default {
       // })
     },
     eventClick(info) {
+      this.$emit('eventClick', info)
       // alert('Event: ' + info.event.title)
       info.el.style.borderColor = 'red'
       info.el.style.backgroundColor = 'red'