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