| | |
| | | <template> |
| | | <div> |
| | | <el-tabs v-model="activeName" type="card"> |
| | | <el-tab-pane v-for="item in ranges" :label="item" :name="item"> </el-tab-pane> |
| | | <el-tab-pane v-for="(item, i) in ranges" :key="i" :label="item" :name="item"> </el-tab-pane> |
| | | </el-tabs> |
| | | <div class="proList"> |
| | | <el-card class="card-style" shadow="hover"> |
| | |
| | | <el-table-column type="index" width="50" /> |
| | | <el-table-column prop="problemname" label="问题"/> |
| | | <el-table-column prop="_time" label="时间" width="250" /> |
| | | <el-table-column prop="操作" label="操作" width="180"> |
| | | <el-table-column label="操作" width="180"> |
| | | <template v-slot="scope"> |
| | | <el-button link type="primary" @click="info(scope.row)">详情</el-button> |
| | | </template> |
| | |
| | | CompProblemAddOrUpd |
| | | }, |
| | | mounted() { |
| | | console.log('subtask', this.subtask); |
| | | |
| | | this.deepCopyPro = useCloned(this.problem).cloned.value; |
| | | this.getRecentPros(); |
| | |
| | | // 计算一年前的日期 |
| | | const oneYearAgo = new Date(today); |
| | | oneYearAgo.setFullYear(today.getFullYear() - 1); |
| | | console.log('today', this.$fm.formatYMDH(today)); |
| | | console.log('threeMonthsAgo', this.$fm.formatYMDH(threeMonthsAgo)); |
| | | console.log('sixMonthsAgo', this.$fm.formatYMDH(sixMonthsAgo)); |
| | | console.log('oneYearAgo', this.$fm.formatYMDH(oneYearAgo)); |
| | | |
| | | return { |
| | | startTime: |
| | | this.activeName === '近三个月' |
| | |
| | | /** |
| | | * 获取近期情况 |
| | | * */ |
| | | getRecentPros() { |
| | | async getRecentPros() { |
| | | this.loading = true; |
| | | this.subtaskCount = 0 |
| | | // 获取子任务列表 |
| | | taskApi.getSubtaskByScene(this.generateQueryParam()).then((subtasks) => { |
| | | await taskApi.getSubtaskByScene(this.generateQueryParam()).then((subtasks) => { |
| | | this.curProList = []; |
| | | if (subtasks) { |
| | | subtasks.forEach((subtask) => { |
| | |
| | | this.getProBySubtask(subtask); |
| | | }); |
| | | } |
| | | |
| | | }); |
| | | // 额外处理 |
| | | console.log('curr', this.curProList); |
| | | this.curProList.sort((o1, o2) => o2.getTime() - o1.getTime()); |
| | | this.loading = false; |
| | | }, |
| | | // 根据子任务获取里面的问题列表 |
| | | getProBySubtask(subtask) { |
| | | async getProBySubtask(subtask) { |
| | | taskApi.getProBySubtask(subtask.stGuid).then((pros) => { |
| | | if (pros) { |
| | | pros.forEach((pro) => { |
| | | if (pro.ptguid == this.deepCopyPro.ptguid) { |
| | | pro._stName = subtask.stName; |
| | | pro._time = this.$fm.formatYM(subtask.stPlanTime) |
| | | pro._time = this.$fm.formatYMD(subtask.stPlanTime) |
| | | this.curProList.push(pro); |
| | | } |
| | | }); |