瀏覽代碼

文件名修改

PrinceLee 5 年之前
父節點
當前提交
60aa9bc057

+ 20 - 0
src/api/workSchedule.js

@@ -0,0 +1,20 @@
+// 个人工作台和团队工作台
+import request from '@/utils/request'
+import { TeamManagement } from '@/apiConfig/api'
+
+// 获取团队用户空闲信息
+export function queryTeamIdleList(data) {
+  return request({
+    url: TeamManagement + `/workbench/team/queryTeamIdleList`,
+    method: 'post',
+    data
+  })
+}
+// 获取团队用户忙碌信息
+export function queryTeamWorkList(data) {
+  return request({
+    url: TeamManagement + `/workbench/team/queryTeamWorkList`,
+    method: 'post',
+    data
+  })
+}

+ 0 - 0
src/views/projectManage/projectList/component/bugsList.vue → src/views/projectManage/projectList/components/bugsList.vue


+ 0 - 0
src/views/projectManage/projectList/component/dataStatistics.vue → src/views/projectManage/projectList/components/dataStatistics.vue


+ 0 - 0
src/views/projectManage/projectList/component/mileStone.vue → src/views/projectManage/projectList/components/mileStone.vue


+ 0 - 0
src/views/projectManage/projectList/component/modifyProject.vue → src/views/projectManage/projectList/components/modifyProject.vue


+ 0 - 0
src/views/projectManage/projectList/component/modifySchedule.vue → src/views/projectManage/projectList/components/modifySchedule.vue


+ 0 - 0
src/views/projectManage/projectList/component/needsList.vue → src/views/projectManage/projectList/components/needsList.vue


+ 0 - 0
src/views/projectManage/projectList/component/scheduleList.vue → src/views/projectManage/projectList/components/scheduleList.vue


+ 0 - 0
src/views/projectManage/projectList/component/taskList.vue → src/views/projectManage/projectList/components/taskList.vue


+ 7 - 13
src/views/projectManage/projectList/projectViewDetails.vue

@@ -22,7 +22,7 @@
           </el-dropdown>
         </div>
         <div class="top-tabs">
-          <el-tabs v-model="activeName" @tab-click="tabsChange">
+          <el-tabs v-model="activeName">
             <el-tab-pane label="概览" name="1" />
             <el-tab-pane label="需求" name="2" />
             <el-tab-pane label="任务" name="3" />
@@ -186,12 +186,12 @@ import {
 } from '@/api/projectIndex'
 import searchPeople from '@/components/select/searchPeople'
 import textArea from '@/components/input/textArea'
-import mileStone from './component/mileStone'
-import dataStatistics from './component/dataStatistics'
-import tasksList from './component/taskList'
-import needsList from './component/needsList'
-import bugsList from './component/bugsList'
-import modifyProject from './component/modifyProject'
+import mileStone from './components/mileStone'
+import dataStatistics from './components/dataStatistics'
+import tasksList from './components/taskList'
+import needsList from './components/needsList'
+import bugsList from './components/bugsList'
+import modifyProject from './components/modifyProject'
 import openDialog from '@/views/projectManage/dialog_vue'
 import Utils from '../../../util.js'
 import RequirementCreate from '@/views/projectManage/requirement/list/create'
@@ -275,12 +275,6 @@ export default {
     this.$store.state.data.bizId = false
   },
   methods: {
-    tabsChange() { // 顶部tab切换
-
-    },
-    changeDetail(e) { // 成员选择
-      console.log(e)
-    },
     async changeArea(e) { // area修改
       const projectInfo = this.form_query
       const res = await projectUpdate({ projectInfo, user: this.user })

+ 113 - 0
src/views/workbench/ganttOptions/teamGantt.js

@@ -0,0 +1,113 @@
+const options = {
+  locale: {
+    name: 'zh_cn',
+    weekdays: ['周天', '周一', '周二', '周三', '周四', '周五', '周六'],
+    months: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月']
+  },
+  maxRows: 100,
+  maxHeight: 460,
+  title: {
+    label: 'Your project title as html (link or whatever...)',
+    html: false
+  },
+  row: {
+    height: 24
+  },
+  calendar: {
+    hour: {
+      display: true
+    }
+  },
+  chart: {
+    progress: {
+      bar: false
+    },
+    expander: {
+      display: true
+    }
+  },
+  taskList: {
+    expander: {
+      straight: false
+    },
+    columns: [
+      {
+        id: 1,
+        label: '团队成员',
+        value: 'user',
+        width: 80,
+        style: {
+          'task-list-header-label': {
+            'text-align': 'center',
+            width: '100%'
+          },
+          'task-list-item-value-container': {
+            'font-weight': '500'
+          }
+        }
+      },
+      {
+        id: 2,
+        label: '任务名称',
+        value: 'labelName',
+        width: 180,
+        expander: true,
+        style: {
+          'task-list-header-label': {
+            'text-align': 'center',
+            width: '100%'
+          }
+        }
+      },
+      {
+        id: 3,
+        label: '开始时间',
+        value: 'startDate',
+        width: 90,
+        style: {
+          'task-list-header-label': {
+            'text-align': 'center',
+            width: '100%'
+          },
+          'task-list-item-value-container': {
+            'text-align': 'center',
+            width: '100%'
+          }
+        }
+      },
+      {
+        id: 4,
+        label: '结束时间',
+        value: 'endDate',
+        width: 90,
+        style: {
+          'task-list-header-label': {
+            'text-align': 'center',
+            width: '100%'
+          },
+          'task-list-item-value-container': {
+            'text-align': 'center',
+            width: '100%'
+          }
+        }
+      },
+      {
+        id: 5,
+        label: '使用/工作日/全部',
+        value: 'needLegalAllDays',
+        width: 130,
+        style: {
+          'task-list-header-label': {
+            'text-align': 'center',
+            width: '100%'
+          },
+          'task-list-item-value-container': {
+            'text-align': 'center',
+            width: '100%'
+          }
+        }
+      }
+    ]
+  }
+} // 甘特图配置
+export default options

+ 1 - 41
src/views/workbench/person/index.vue

@@ -40,37 +40,7 @@
         </div>
         <MyFullCalendar :events="calendarEvents" @dateClick="dateClick" @expand="calendarDialogVisible = true" @change="queryWorkListByTime" @select="select" @eventDrop="eventDrop" />
       </el-aside>
-      <el-aside width="32.8%" style="margin-right: 10px" class="layout_aside">
-        <div class="module_title">
-          <div class="module_title__sign" />
-          <div class="module_title__caption">我的数据</div>
-        </div>
-        <div style="color: #9B9B9B;line-height: 300px;text-align: center">
-          敬请期待...
-        </div>
-      </el-aside>
-      <el-aside width="32.9%" 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 class="layout_main" style="margin-top: 10px">
-      <el-tabs v-model="activeName">
-        <el-tab-pane label="缺陷" name="first">
-          <div style="margin: 10px 0 10px 0">
-            <div :class="myHandleTab" style="display: inline-block;font-size: 14px; cursor: pointer;" @click="myHandleTab = 'bug_tab_select';myCreateTab = 'my_create';selectBugList(2)">待我处理</div>
-            <div :class="myCreateTab" style="display: inline-block;font-size: 14px;margin-left: 20px; cursor: pointer;" @click="myHandleTab = 'my_handle';myCreateTab = 'bug_tab_select';selectBugList(1)">我提报的</div>
-          </div>
-          <bug-list ref="bugList" type="list" />
-        </el-tab-pane>
-        <el-tab-pane label="项目" name="second" />
-        <el-tab-pane label="需求" name="third" />
-        <el-tab-pane label="任务" name="fourth" />
-        <el-tab-pane label="报告" name="firth" />
-      </el-tabs>
-    </el-main>
     <el-dialog
       class="workbench_fullscreen_dialog"
       :visible.sync="teamInfoDialogVisible"
@@ -279,7 +249,6 @@
 </template>
 
 <script>
-import BugList from '@/views/projectManage/bugList/bugindex.vue'
 import workbenchApi from '@/api/workbench.js'
 import MyFullCalendar from './myFullCalendar'
 import dayjs from 'dayjs'
@@ -290,17 +259,13 @@ export default {
   components: {
     MyFullCalendar,
     CalendarDialog,
-    DeleteDialog,
-    BugList
+    DeleteDialog
   },
   data() {
     return {
       calendarView: null,
       chirdrenClass: -1,
       myTeamTableData: [],
-      myCreateTab: 'my_create',
-      myHandleTab: 'bug_tab_select',
-      activeName: 'first',
       teamInfoDialogVisible: false,
       calendarEvents: [
         // initial event data
@@ -380,11 +345,6 @@ export default {
       }
       return ret
     },
-    // type: 1 我提报的 2 待我处理
-    selectBugList(type) {
-      const pageSize = 10
-      this.$refs.bugList.getBugSelfList(type, pageSize)
-    },
     eventDrop(info) {
       const form = {
         id: info.event.id,

+ 35 - 165
src/views/workbench/team/index.vue

@@ -30,12 +30,6 @@
         </el-select>
       </div>
     </el-main>
-    <el-main class="layout_main" style="margin-top: 10px">
-      <div class="module_title">
-        <div class="module_title__sign" />
-        <div class="module_title__caption">团队数据</div>
-      </div>
-    </el-main>
     <el-main class="layout_main" style="margin-top: 10px">
       <div class="module_title">
         <div class="module_title__sign" />
@@ -89,9 +83,11 @@
 <script>
 import workbenchApi from '@/api/workbench.js'
 import { settingGetBizList } from '@/api/defectManage'
+import { queryTeamIdleList, queryTeamWorkList } from '@/api/workSchedule'
 import GanttElastic from 'gantt-elastic'
 import GanttHeader from 'gantt-elastic-header'
-import dayjs from 'dayjs'
+import moment from 'moment'
+import teamGanttOptions from '@/views/workbench/ganttOptions/teamGantt'
 
 export default {
   components: {
@@ -100,131 +96,16 @@ export default {
   },
   data() {
     return {
-      timeSelectVal: [new Date(), dayjs(new Date()).add(29, 'day')],
+      timeSelectVal: [new Date(), moment(new Date()).add(29, 'day')],
       pickerOptions: {
         disabledDate(time) {
           return time.getTime() < Date.now() - 24 * 60 * 60 * 1000
         }
       },
       tasks: [], // 甘特图任务
-      options: {
-        locale: {
-          name: 'zh_cn',
-          weekdays: ['周天', '周一', '周二', '周三', '周四', '周五', '周六'],
-          months: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月']
-        },
-        maxRows: 100,
-        maxHeight: 460,
-        title: {
-          label: 'Your project title as html (link or whatever...)',
-          html: false
-        },
-        row: {
-          height: 24
-        },
-        calendar: {
-          hour: {
-            display: true
-          }
-        },
-        chart: {
-          progress: {
-            bar: false
-          },
-          expander: {
-            display: true
-          }
-        },
-        taskList: {
-          expander: {
-            straight: false
-          },
-          columns: [
-            {
-              id: 1,
-              label: '团队成员',
-              value: 'user',
-              width: 80,
-              style: {
-                'task-list-header-label': {
-                  'text-align': 'center',
-                  width: '100%'
-                },
-                'task-list-item-value-container': {
-                  'font-weight': '500'
-                }
-              }
-            },
-            {
-              id: 2,
-              label: '任务名称',
-              value: 'labelName',
-              width: 180,
-              expander: true,
-              style: {
-                'task-list-header-label': {
-                  'text-align': 'center',
-                  width: '100%'
-                }
-              }
-            },
-            {
-              id: 3,
-              label: '开始时间',
-              value: 'startDate',
-              width: 90,
-              style: {
-                'task-list-header-label': {
-                  'text-align': 'center',
-                  width: '100%'
-                },
-                'task-list-item-value-container': {
-                  'text-align': 'center',
-                  width: '100%'
-                }
-              }
-            },
-            {
-              id: 4,
-              label: '结束时间',
-              value: 'endDate',
-              width: 90,
-              style: {
-                'task-list-header-label': {
-                  'text-align': 'center',
-                  width: '100%'
-                },
-                'task-list-item-value-container': {
-                  'text-align': 'center',
-                  width: '100%'
-                }
-              }
-            },
-            {
-              id: 5,
-              label: '使用/工作日/全部',
-              value: 'needLegalAllDays',
-              width: 130,
-              style: {
-                'task-list-header-label': {
-                  'text-align': 'center',
-                  width: '100%'
-                },
-                'task-list-item-value-container': {
-                  'text-align': 'center',
-                  width: '100%'
-                }
-              }
-            }
-          ]
-        }
-      }, // 甘特图配置
-      ganttHeaderStyle: {
-      },
-      colorList: ['rgba(255,82,0,0.5)', 'rgba(227,131,247,0.5)', 'rgba(68,190,255,0.5)', 'rgba(122,221,13,0.5)', 'rgba(245,108,108,0.5)'],
+      options: teamGanttOptions,
       radio1: '忙碌',
       radio2: '今天',
-      radio2TF: true,
       radio3: '日',
       searchForm: {
         teamId: null,
@@ -239,7 +120,6 @@ export default {
         businesslines: []
       },
       username: localStorage.getItem('username'),
-      teamWorkList: [],
       ganttShow: false
     }
   },
@@ -261,18 +141,9 @@ export default {
     radioChange(val) {
       if (val === '忙碌') {
         this.queryTeamWorkList()
-          .then(res => {
-            this.changeDateLength('日')
-            this.changeDateLength(this.radio3)
-          })
       } else if (val === '空闲') {
         this.queryTeamIdleList()
-          .then(res => {
-            this.changeDateLength('日')
-            this.changeDateLength(this.radio3)
-          })
-      }
-      if (val === '今天') {
+      } else if (val === '今天') {
         this.$refs.ganttHeader.recenterPosition()
       }
       this.changeDateLength(val)
@@ -280,11 +151,9 @@ export default {
     changeDateLength(val) {
       if (val === '月') {
         this.$refs.ganttHeader.scale = 21
-      }
-      if (val === '周') {
+      } else if (val === '周') {
         this.$refs.ganttHeader.scale = 19
-      }
-      if (val === '日') {
+      } else if (val === '日') {
         this.$refs.ganttHeader.scale = 17
       }
     },
@@ -311,27 +180,28 @@ export default {
         }
       })
     },
-    queryTeamWorkList() {
-      return workbenchApi.queryTeamWorkList(this.searchForm)
-        .then(res => {
-          if (res.data) {
-            this.createTasks(res, '忙碌')
-          }
-          return res
-        })
+    async queryTeamWorkList() { // 获取忙碌日程
+      const params = {
+        teamSearchInfo: this.searchForm,
+        searchScheduleInfo: { origin: [1] }
+      }
+      const res = await queryTeamWorkList(params)
+      if (res.code === 200 && res.data) {
+        this.createTasks(res, '忙碌')
+        this.changeDateLength(this.radio3)
+      }
     },
-    queryTeamIdleList() {
-      this.idleSearchForm.startTime = dayjs(this.timeSelectVal[0]).format('YYYY.MM.DD')
-      this.idleSearchForm.endTime = dayjs(this.timeSelectVal[1]).format('YYYY.MM.DD')
-      return workbenchApi.queryTeamIdleList({
+    async queryTeamIdleList() { // 获取空闲日程
+      this.idleSearchForm.startTime = moment(this.timeSelectVal[0]).format('YYYY.MM.DD')
+      this.idleSearchForm.endTime = moment(this.timeSelectVal[1]).format('YYYY.MM.DD')
+      const res = await queryTeamIdleList({
         timeInfo: this.idleSearchForm,
-        teamWorkQueryInfo: this.searchForm
-      }).then(res => {
-        if (res.data) {
-          this.createTasks(res, '空闲')
-        }
-        return res
+        teamSearchInfo: this.searchForm
       })
+      if (res.code === 200 && res.data) {
+        this.createTasks(res, '空闲')
+        this.changeDateLength(this.radio3)
+      }
     },
     createTasks(res, mode) {
       const today = new Date()
@@ -355,10 +225,10 @@ export default {
           collapsed: true,
           progress: 0,
           needLegalAllDays: res.data[i].workNum.needDays + '/' + res.data[i].workNum.legalDays + '/' + res.data[i].workNum.allDays,
-          start: res.data[i].workNum.startTime ? dayjs(res.data[i].workNum.startTime).toDate().getTime() : today.getTime(),
-          duration: res.data[i].workNum.endTime ? dayjs(res.data[i].workNum.endTime).toDate().getTime() - dayjs(res.data[i].workNum.startTime).toDate().getTime() : 0,
-          startDate: res.data[i].workNum.startTime ? dayjs(res.data[i].workNum.startTime).format('YYYY-MM-DD') : '',
-          endDate: res.data[i].workNum.endTime ? dayjs(res.data[i].workNum.endTime).format('YYYY-MM-DD') : '',
+          start: res.data[i].workNum.startTime ? moment(res.data[i].workNum.startTime).toDate().getTime() : today.getTime(),
+          duration: res.data[i].workNum.endTime ? moment(res.data[i].workNum.endTime).toDate().getTime() - moment(res.data[i].workNum.startTime).toDate().getTime() : 0,
+          startDate: res.data[i].workNum.startTime ? moment(res.data[i].workNum.startTime).format('YYYY-MM-DD') : '',
+          endDate: res.data[i].workNum.endTime ? moment(res.data[i].workNum.endTime).format('YYYY-MM-DD') : '',
           type: 'task',
           style: {
             base: {
@@ -384,10 +254,10 @@ export default {
             user: parentItem.user,
             progress: 0,
             needLegalAllDays: res.data[i].workData[j].needDays + '/' + res.data[i].workData[j].legalDays + '/' + res.data[i].workData[j].allDays,
-            start: dayjs(res.data[i].workData[j].startTime).toDate().getTime(),
-            duration: dayjs(res.data[i].workData[j].endTime).toDate().getTime() - dayjs(res.data[i].workData[j].startTime).toDate().getTime(),
-            startDate: dayjs(res.data[i].workData[j].startTime).format('YYYY-MM-DD'),
-            endDate: dayjs(res.data[i].workData[j].endTime).format('YYYY-MM-DD'),
+            start: moment(res.data[i].workData[j].startTime).toDate().getTime(),
+            duration: moment(res.data[i].workData[j].endTime).toDate().getTime() - moment(res.data[i].workData[j].startTime).toDate().getTime(),
+            startDate: moment(res.data[i].workData[j].startTime).format('YYYY-MM-DD'),
+            endDate: moment(res.data[i].workData[j].endTime).format('YYYY-MM-DD'),
             type: 'task',
             style: {
               base: {