|
@@ -1,863 +0,0 @@
|
|
|
-<template>
|
|
|
- <div @click="display = false">
|
|
|
- <el-container style="background-color: #F2F3F6;">
|
|
|
- <el-header style="margin: 15px 1%;" class="layout_header">
|
|
|
- <div>
|
|
|
- <el-tooltip :disabled="requirement.name && requirement.name.length > 19 ? false : true" effect="dark" :content="requirement.name" placement="bottom">
|
|
|
- <span style="font-size:20px;font-family:MicrosoftYaHei;color:rgba(51,51,51,1);">{{ '需求:' + requirement.name | ellipsis }}</span>
|
|
|
- </el-tooltip>
|
|
|
- <el-dropdown
|
|
|
- placement="bottom"
|
|
|
- @command="updateRequirementStatus"
|
|
|
- >
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- class="el-dropdown-link drop_down"
|
|
|
- style="cursor: pointer;margin-left: 15px;"
|
|
|
- >
|
|
|
- <span class="el-dropdown-link">{{ getStatusName() }}</span>
|
|
|
- <i class="el-icon-arrow-down el-icon--right" />
|
|
|
- </el-button>
|
|
|
- <el-dropdown-menu slot="dropdown">
|
|
|
- <el-dropdown-item
|
|
|
- v-for="(item,index) in searchInfo.requirementStatus"
|
|
|
- :key="index"
|
|
|
- :command="item"
|
|
|
- >{{ item.msg }}</el-dropdown-item>
|
|
|
- </el-dropdown-menu>
|
|
|
- </el-dropdown>
|
|
|
- <div style="display: inline-block;float: right">
|
|
|
- <span style="line-height: normal;display: inline-flex;vertical-align: middle; cursor: pointer; color: #6F7C93;" @click.stop="setChild(), display = true"><img style="width: 24px; display: inline-block;" :src="image_url"><span style="margin-left: 10px;">{{ num }}</span></span>
|
|
|
- <el-button size="mini" style="margin-left: 10px" @click="deleteRequirement">删除需求</el-button>
|
|
|
- <el-button type="primary" size="mini" @click="createTask">新建任务</el-button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </el-header>
|
|
|
- <el-container>
|
|
|
- <el-aside width="52%" style="margin: 0% 1% 1% 1%;" class="layout_aside">
|
|
|
- <div style="display:flex;align-items: center;">
|
|
|
- <div style="width:4px;height:17px;background:#409EFF;border-radius:1px;" />
|
|
|
- <div style="width:83px;height:20px;font-size:18px;font-family:MicrosoftYaHei;color:rgba(51,59,74,1);margin-left:6px">数据统计</div>
|
|
|
- </div>
|
|
|
- <div v-loading="loading.task || loading.bug" class="div_statistics" style="margin: 2%">
|
|
|
- <el-container style="border-bottom: 1px solid #D8D8D8">
|
|
|
- <el-aside width="30%" style="border-right: 1px solid #d8d8d8">
|
|
|
- <div style="width:100%;text-align: center;">
|
|
|
- <div style="font-size: 16px;margin-top: 26px">任务数量</div>
|
|
|
- <div style="font-size: 72px">{{ statistics.task.totalCount }}</div>
|
|
|
- <div
|
|
|
- style="font-size: 14px;color: rgba(245,108,108,1);margin-bottom: 16px"
|
|
|
- >{{ '已延期'+statistics.task.delayCount+'个' }}</div>
|
|
|
- </div>
|
|
|
- </el-aside>
|
|
|
- <el-aside width="70%">
|
|
|
- <requirement-chart
|
|
|
- :chart-id="'taskCount'"
|
|
|
- :option="taskOption"
|
|
|
- style="position: relative;bottom: 30px"
|
|
|
- />
|
|
|
- </el-aside>
|
|
|
- </el-container>
|
|
|
- <el-container>
|
|
|
- <el-aside width="30%" style="border-right: 1px solid #d8d8d8">
|
|
|
- <div style="width:100%;text-align: center;">
|
|
|
- <div style="font-size: 16px;margin-top: 26px">bug数量</div>
|
|
|
- <div style="font-size: 72px">{{ statistics.bug.totalCount }}</div>
|
|
|
- <div
|
|
|
- style="font-size: 14px;color: rgba(245,108,108,1);margin-bottom: 16px"
|
|
|
- >{{ '以后修复'+statistics.bug.fixInFutureCount+'个' }}</div>
|
|
|
- </div>
|
|
|
- </el-aside>
|
|
|
- <el-aside width="70%">
|
|
|
- <requirement-chart
|
|
|
- :chart-id="'bugCount'"
|
|
|
- :option="bugOption"
|
|
|
- style="position: relative;bottom: 30px"
|
|
|
- />
|
|
|
- </el-aside>
|
|
|
- </el-container>
|
|
|
- </div>
|
|
|
- </el-aside>
|
|
|
- <el-aside width="45%" style="margin: 0% 1% 1% 0;" class="layout_aside special-button">
|
|
|
- <div style="display:flex;align-items: center;">
|
|
|
- <div style="width:4px;height:17px;background:#409EFF;border-radius:1px;" />
|
|
|
- <div style="width:83px;height:20px;font-size:18px;font-family:MicrosoftYaHei;color:rgba(51,59,74,1);margin-left:6px">基础信息</div>
|
|
|
- </div>
|
|
|
- <div style="text-align: right;">
|
|
|
- <el-button
|
|
|
- type="info"
|
|
|
- plain
|
|
|
- size="mini"
|
|
|
- @click="updateDialogVisible = true"
|
|
|
- >修改</el-button>
|
|
|
- </div>
|
|
|
- <div
|
|
|
- style="font-size: 14px;color: #666666"
|
|
|
- class="div_requirment_info"
|
|
|
- >
|
|
|
- <el-row>
|
|
|
- <el-col :span="6">归属的项目:</el-col>
|
|
|
- <el-col :span="18">
|
|
|
- <div
|
|
|
- style="display: inline-block;color: #409EFF;cursor: pointer;"
|
|
|
- @click="jumpTaskDetal(requirement.belongingProject)"
|
|
|
- >{{ requirement.belongingProjectName }}</div>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="6">业务线:</el-col>
|
|
|
- <el-col :span="18">{{ requirement.bizName }}</el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="6">优先级:</el-col>
|
|
|
- <el-col :span="18">{{ requirement.priorityName }}</el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="6">需求来源:</el-col>
|
|
|
- <el-col :span="18">{{ requirement.sourceTypeName }}</el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="6">PM:</el-col>
|
|
|
- <el-col :span="18">{{ getPmName() }}</el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="6">PRD链接:</el-col>
|
|
|
- <el-col :span="18">
|
|
|
- <el-link type="primary" :href="requirement.mrdUrl">{{ requirement.mrdUrl }}</el-link>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="6">是否跟版:</el-col>
|
|
|
- <el-col :span="18">{{ requirement.dependOnRelease? '是':'否' }}</el-col>
|
|
|
- </el-row>
|
|
|
- <el-row v-if="requirement.dependOnRelease">
|
|
|
- <el-col :span="6">涉及的客户端:</el-col>
|
|
|
- <el-col :span="18">{{ getAppClientName() }}</el-col>
|
|
|
- </el-row>
|
|
|
- </div>
|
|
|
- </el-aside>
|
|
|
- </el-container>
|
|
|
- <el-main id="requirement_details" style="margin: 0 1%;padding: 0" class="layout_main">
|
|
|
- <div style="display:flex;align-items: center;margin: 2% 0 0 2%;">
|
|
|
- <div style="width:4px;height:17px;background:#409EFF;border-radius:1px;" />
|
|
|
- <div style="width:83px;height:20px;font-size:18px;font-family:MicrosoftYaHei;color:rgba(51,59,74,1);margin-left:6px">任务</div>
|
|
|
- </div>
|
|
|
- <el-radio-group v-model="radio" size="mini" style="float: right;margin: 0 1% 1% 0">
|
|
|
- <el-radio-button label="列表" />
|
|
|
- <el-radio-button label="甘特图" />
|
|
|
- </el-radio-group>
|
|
|
- <br>
|
|
|
- <el-table
|
|
|
- v-if="radio === '列表'"
|
|
|
- v-loading="loading.table"
|
|
|
- :data="tableData"
|
|
|
- style="width: 100%;"
|
|
|
- highlight-current-row
|
|
|
- :header-cell-style="{ background: '#6AB4FF', color: '#FFFFFF',textAlign: 'center'}"
|
|
|
- :cell-style="{'font-size':'14px','font-family':'MicrosoftYaHei'}"
|
|
|
- >
|
|
|
- <el-table-column prop="name" label="任务名" min-width="20%" align="center">
|
|
|
- <template v-slot="scope">
|
|
|
- <div style="cursor: pointer;" @click="getToTaskDetails(scope.row.id)">{{ scope.row.name }}</div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="beginTime" label="排期" min-width="15%" align="center">
|
|
|
- <template
|
|
|
- v-slot="scope"
|
|
|
- >{{ getSchedule(scope.row) }}</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="statusString" label="状态" min-width="10%" align="center">
|
|
|
- <template v-slot="scope">
|
|
|
- <div style="color: #FF9500">{{ scope.row.statusString }}</div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="stageString" label="任务健康状态" min-width="12%" align="center">
|
|
|
- <template v-slot="scope">
|
|
|
- <div class="double-line">{{ scope.row.stageString }}</div>
|
|
|
- <div class="double-line-tow">{{ scope.row.lateMsg }}</div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="rate" label="任务进展" min-width="15%" align="left">
|
|
|
- <template v-slot="scope">
|
|
|
- <el-progress :percentage="Number(scope.row.rate?scope.row.rate.substring(0,4).replace(/%/g,''):0)" />
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="rdObject" label="开发负责人" min-width="10%" align="center">
|
|
|
- <template v-slot="scope">{{ scope.row.rdObject?scope.row.rdObject.name:'空' }}</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="qaObject" label="测试负责人" min-width="10%" align="center">
|
|
|
- <template v-slot="scope">{{ scope.row.qaObject?scope.row.qaObject.name:'空' }}</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="rdList" label="开发" min-width="10%" align="center">
|
|
|
- <template v-slot="scope">{{ getQaOrRdNameList(scope.row.rdList) }}</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="qaList" label="测试" min-width="10%" align="center">
|
|
|
- <template v-slot="scope">{{ getQaOrRdNameList(scope.row.qaList) }}</template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <gantt v-if="radio === '甘特图' && ganttTableData" :versions="ganttVersions" :table-data="ganttTableData" :string-type="'任务'" />
|
|
|
- <div style="margin:0 2%;padding: 2% 0;border-bottom: 1px solid #D8D8D8;font-size: 14px;color: #333333">排期汇总:{{ getScheduleCollect() }}</div>
|
|
|
- <el-row style="margin: 2%;font-size: 14px;color: #333333">
|
|
|
- <el-col :span="8">
|
|
|
- <div v-for="(item,index) in task.preOnlineVersion" :key="index" style="margin-bottom:10px"> <span :style="{visibility: index===0?'visible ':'hidden'}">预期上线版本:</span>{{ item }}</div>
|
|
|
- </el-col>
|
|
|
- <!-- <el-col :span="16">
|
|
|
- <div v-for="(item,index) in task.preOnlineVersion" :key="index" style="margin-bottom:10px"> <span :style="{visibility: index===0?'visible ':'hidden'}">实际上线版本:</span>{{ item }}</div>
|
|
|
- </el-col> -->
|
|
|
- </el-row>
|
|
|
- </el-main>
|
|
|
- <el-main style="margin: 1%;padding: 2% !important;" class="layout_main requirement_details_layout_main">
|
|
|
- <div style="display:flex;align-items: center;margin-bottom:20px">
|
|
|
- <div style="width:4px;height:17px;background:#409EFF;border-radius:1px;" />
|
|
|
- <div style="width:83px;height:20px;font-size:18px;font-family:MicrosoftYaHei;color:rgba(51,59,74,1);margin-left:6px">评论</div>
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <div v-for="(item,index) in comments" :key="index" class="animated bounceInRight">
|
|
|
- <div
|
|
|
- style="font-size:14px;color:#333B4A;display: inline-block;"
|
|
|
- >{{ item.commentInfo.name }}</div>
|
|
|
- <div
|
|
|
- style="margin-left:20px;display: inline-block;color: #9B9B9B;font-size:12px"
|
|
|
- >{{ item.commentInfo.gmtCreater }}</div>
|
|
|
- <p
|
|
|
- style="font-size:14px;color:#333B4A;margin-top: 10px;white-space: pre-line;"
|
|
|
- >{{ item.commentInfo.content }}</p>
|
|
|
- <br>
|
|
|
- </div>
|
|
|
- <el-input
|
|
|
- v-model="commentContent"
|
|
|
- type="textarea"
|
|
|
- placeholder="请输入评论内容"
|
|
|
- maxlength="300"
|
|
|
- show-word-limit
|
|
|
- :autosize="{ minRows: 3, maxRows: 5}"
|
|
|
- style="margin-bottom: 2%"
|
|
|
- />
|
|
|
- <el-button type="primary" size="small" style="float: right" @click="addComment">发表评论</el-button>
|
|
|
- </div>
|
|
|
- </el-main>
|
|
|
- <requirement-update
|
|
|
- title="编辑需求"
|
|
|
- :data="requirement"
|
|
|
- :visible="updateDialogVisible"
|
|
|
- @cancel="updateDialogVisible=false"
|
|
|
- @confirm="getRequirementById();updateDialogVisible=false"
|
|
|
- />
|
|
|
- <task-create v-if="createTaskDialogVisible" ref="task_createdUpdata" />
|
|
|
- <drawer
|
|
|
- ref="drawer"
|
|
|
- title="需求成员"
|
|
|
- center
|
|
|
- :display.sync="display"
|
|
|
- width="28%"
|
|
|
- :delete="requirement"
|
|
|
- :types="false"
|
|
|
- :inner="true"
|
|
|
- :mask="false"
|
|
|
- @childValInput="childVal"
|
|
|
- @click.stop
|
|
|
- />
|
|
|
- </el-container>
|
|
|
- </div>
|
|
|
-</template>
|
|
|
-
|
|
|
-<script>
|
|
|
-import {
|
|
|
- getRequirementById,
|
|
|
- showRequirementEnum,
|
|
|
- getTaskStatusMapInfo,
|
|
|
- getBugStatusMapInfo,
|
|
|
- getTaskByRequireId,
|
|
|
- deleteRequirement,
|
|
|
- updateRequirementStatus,
|
|
|
- getCommentList,
|
|
|
- addComment
|
|
|
-} from '@/api/requirement.js'
|
|
|
-import Utils from '../../../../util.js'
|
|
|
-import { listByVersionTypeWithTime } from '@/api/version.js'
|
|
|
-import RequirementChart from '@/components/chart/index.vue'
|
|
|
-import RequirementUpdate from '@/views/projectManage/requirement/list/create.vue'
|
|
|
-import Gantt from '@/views/gantta/gantta'
|
|
|
-import dateUtil from '@/utils/dateUtil.js'
|
|
|
-import TaskCreate from '@/views/projectManage/dialog_vue'
|
|
|
-import drawer from '@/views/projectManage/Drawer'
|
|
|
-import image_url from '@/assets/home_images/home_u.png'
|
|
|
-
|
|
|
-export default {
|
|
|
- components: {
|
|
|
- RequirementChart,
|
|
|
- RequirementUpdate,
|
|
|
- Gantt,
|
|
|
- TaskCreate,
|
|
|
- drawer
|
|
|
- },
|
|
|
- filters: {
|
|
|
- ellipsis(value) {
|
|
|
- if (!value) return ''
|
|
|
- if (value.length > 20) {
|
|
|
- return value.slice(0, 20) + '...'
|
|
|
- }
|
|
|
- return value
|
|
|
- }
|
|
|
- },
|
|
|
- props: {
|
|
|
- id: {
|
|
|
- type: String,
|
|
|
- default: '0'
|
|
|
- }
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- num: '',
|
|
|
- image_url: image_url,
|
|
|
- display: false,
|
|
|
- createTaskDialogVisible: false,
|
|
|
- ganttVersions: {},
|
|
|
- ganttTableData: null,
|
|
|
- loading: {
|
|
|
- table: true,
|
|
|
- info: true,
|
|
|
- task: true,
|
|
|
- bug: true
|
|
|
- },
|
|
|
- radio: '列表',
|
|
|
- updateDialogVisible: false,
|
|
|
- tableData: null,
|
|
|
- statistics: {
|
|
|
- task: {
|
|
|
- totalCount: 0,
|
|
|
- delayCount: 0
|
|
|
- },
|
|
|
- bug: {
|
|
|
- totalCount: 0,
|
|
|
- fixInFutureCount: 0
|
|
|
- }
|
|
|
- },
|
|
|
- belongingProject: { msg: '不存在' },
|
|
|
- status: {},
|
|
|
- requirement: {
|
|
|
- name: ''
|
|
|
- },
|
|
|
- projectOb: {},
|
|
|
- bizTypeOb: {},
|
|
|
- appClientOb: {},
|
|
|
- requirementStatusOb: {},
|
|
|
- searchInfo: {
|
|
|
- belongingProject: [],
|
|
|
- sourceType: [],
|
|
|
- bizType: [],
|
|
|
- priority: [],
|
|
|
- requirementStatus: []
|
|
|
- },
|
|
|
- taskOption: {
|
|
|
- color: ['#69B3FF'],
|
|
|
- title: {
|
|
|
- show: false
|
|
|
- },
|
|
|
- tooltip: {
|
|
|
- trigger: 'axis',
|
|
|
- axisPointer: {
|
|
|
- // 坐标轴指示器,坐标轴触发有效
|
|
|
- type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
|
|
|
- }
|
|
|
- },
|
|
|
- grid: {
|
|
|
- left: '3%',
|
|
|
- right: '4%',
|
|
|
- bottom: '0%',
|
|
|
- containLabel: true
|
|
|
- },
|
|
|
- xAxis: [
|
|
|
- {
|
|
|
- type: 'category',
|
|
|
- data: ['未开始', '开发中', '测试中', '已上线'],
|
|
|
- axisTick: {
|
|
|
- alignWithLabel: true,
|
|
|
- show: false
|
|
|
- },
|
|
|
- axisLine: {
|
|
|
- show: true,
|
|
|
- lineStyle: {
|
|
|
- type: 'dashed'
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- ],
|
|
|
- yAxis: [
|
|
|
- {
|
|
|
- type: 'value',
|
|
|
- axisTick: {
|
|
|
- show: false
|
|
|
- },
|
|
|
- axisLine: {
|
|
|
- show: false
|
|
|
- },
|
|
|
- axisLabel: {
|
|
|
- show: false
|
|
|
- },
|
|
|
- splitLine: {
|
|
|
- show: false
|
|
|
- }
|
|
|
- }
|
|
|
- ],
|
|
|
- series: [
|
|
|
- {
|
|
|
- type: 'bar',
|
|
|
- barWidth: '60%',
|
|
|
- label: {
|
|
|
- show: true,
|
|
|
- position: 'inside',
|
|
|
- formatter: function(params) {
|
|
|
- // 如果值大于0 正常显示,否则不显示
|
|
|
- if (params.value > 0) {
|
|
|
- return params.value
|
|
|
- } else {
|
|
|
- return ''
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- data: []
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
- bugOption: {
|
|
|
- color: ['#69B3FF'],
|
|
|
- title: {
|
|
|
- show: false
|
|
|
- },
|
|
|
- tooltip: {
|
|
|
- trigger: 'axis',
|
|
|
- axisPointer: {
|
|
|
- // 坐标轴指示器,坐标轴触发有效
|
|
|
- type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
|
|
|
- }
|
|
|
- },
|
|
|
- grid: {
|
|
|
- left: '3%',
|
|
|
- right: '4%',
|
|
|
- bottom: '0%',
|
|
|
- containLabel: true
|
|
|
- },
|
|
|
- xAxis: [
|
|
|
- {
|
|
|
- type: 'category',
|
|
|
- data: ['待开发', '开发中', '待测试', '已完成', 'Reopen'],
|
|
|
- axisTick: {
|
|
|
- alignWithLabel: true,
|
|
|
- show: false
|
|
|
- },
|
|
|
- axisLine: {
|
|
|
- show: true,
|
|
|
- lineStyle: {
|
|
|
- type: 'dashed'
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- ],
|
|
|
- yAxis: [
|
|
|
- {
|
|
|
- type: 'value',
|
|
|
- axisTick: {
|
|
|
- show: false
|
|
|
- },
|
|
|
- axisLine: {
|
|
|
- show: false
|
|
|
- },
|
|
|
- axisLabel: {
|
|
|
- show: false
|
|
|
- },
|
|
|
- splitLine: {
|
|
|
- show: false
|
|
|
- }
|
|
|
- }
|
|
|
- ],
|
|
|
- series: [
|
|
|
- {
|
|
|
- type: 'bar',
|
|
|
- barWidth: '60%',
|
|
|
- label: {
|
|
|
- show: true,
|
|
|
- position: 'inside',
|
|
|
- formatter: function(params) {
|
|
|
- // 如果值大于0 正常显示,否则不显示
|
|
|
- if (params.value > 0) {
|
|
|
- return params.value
|
|
|
- } else {
|
|
|
- return ''
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- data: []
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
- comments: [],
|
|
|
- commentContent: null,
|
|
|
- task: {
|
|
|
- reqStartTime: null,
|
|
|
- reqEndTime: null,
|
|
|
- preOnlineVersion: []
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- created() {
|
|
|
- this.$store.state.data.status = true
|
|
|
- this.$store.state.data.bizId = true
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- this.showRequirementEnum().then(res => {
|
|
|
- this.getRequirementById()
|
|
|
- })
|
|
|
- this.getTaskStatusMapInfo()
|
|
|
- this.getBugStatusMapInfo()
|
|
|
- this.getCommentList()
|
|
|
- },
|
|
|
- destroyed() {
|
|
|
- this.$store.state.data.status = false
|
|
|
- this.$store.state.data.bizId = false
|
|
|
- },
|
|
|
- methods: {
|
|
|
- childVal(val) {
|
|
|
- this.num = val
|
|
|
- },
|
|
|
- getScheduleCollect() {
|
|
|
- if (this.task && this.task.reqStartTime && this.task.reqEndTime) {
|
|
|
- return this.task.reqStartTime.substring(0, 10).replace(/-/, '年').replace(/-/, '月') + '日' + ' ~ ' + this.task.reqEndTime.substring(0, 10).replace(/-/, '年').replace(/-/, '月') + '日'
|
|
|
- }
|
|
|
- return ''
|
|
|
- },
|
|
|
- getSchedule(row) {
|
|
|
- if (row.beginTime && row.endTime) {
|
|
|
- return row.beginTime.substring(2, 10).replace(/-/g, '/') + ' ~ ' + row.endTime.substring(2, 10).replace(/-/g, '/')
|
|
|
- }
|
|
|
- return '无'
|
|
|
- },
|
|
|
- getCommentList() {
|
|
|
- getCommentList({ type: 4, joinId: this.id }).then(res => {
|
|
|
- this.comments = res.data
|
|
|
- this.commentContent = ''
|
|
|
- })
|
|
|
- },
|
|
|
- addComment() {
|
|
|
- if (!this.commentContent) {
|
|
|
- this.$message.warning('评论不能为空')
|
|
|
- return
|
|
|
- }
|
|
|
- addComment({
|
|
|
- commentInfo: { joinId: this.id, type: 4, content: this.commentContent },
|
|
|
- user: { ename: localStorage.getItem('username') }
|
|
|
- }).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.getCommentList()
|
|
|
- } else {
|
|
|
- this.$message.warning(res.msg)
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- getStatusName() {
|
|
|
- return this.requirementStatusOb[this.requirement.status]
|
|
|
- },
|
|
|
- jumpTaskDetal(id) {
|
|
|
- this.$router.push({ name: '项目详情', query: { id: id }})
|
|
|
- },
|
|
|
- getRequirementById() {
|
|
|
- this.loading.info = true
|
|
|
- return getRequirementById({
|
|
|
- id: this.id
|
|
|
- }).then(res => {
|
|
|
- if (res.data.bizId !== Number(localStorage.getItem('bizId'))) {
|
|
|
- Utils.$emit('demo', res.data.bizId)
|
|
|
- }
|
|
|
- this.requirement = res.data
|
|
|
- this.loading.info = false
|
|
|
- this.getTaskByRequireId()
|
|
|
- })
|
|
|
- },
|
|
|
- getTaskStatusMapInfo() {
|
|
|
- getTaskStatusMapInfo({
|
|
|
- requireId: this.id
|
|
|
- }).then(res => {
|
|
|
- const name = []
|
|
|
- const data = []
|
|
|
- for (const i in res.data.statusInfoList) {
|
|
|
- name.push(res.data.statusInfoList[i].statusString)
|
|
|
- data.push(res.data.statusInfoList[i].count)
|
|
|
- }
|
|
|
- this.statistics.task = res.data
|
|
|
- this.taskOption.xAxis[0].data = name
|
|
|
- this.taskOption.series[0].data = data
|
|
|
- this.taskOption = JSON.parse(JSON.stringify(this.taskOption))
|
|
|
- this.loading.task = false
|
|
|
- })
|
|
|
- },
|
|
|
- getBugStatusMapInfo() {
|
|
|
- getBugStatusMapInfo({
|
|
|
- requireId: this.id
|
|
|
- }).then(res => {
|
|
|
- const name = []
|
|
|
- const data = []
|
|
|
- for (const i in res.data.statusInfoList) {
|
|
|
- name.push(res.data.statusInfoList[i].statusString)
|
|
|
- data.push(res.data.statusInfoList[i].count)
|
|
|
- }
|
|
|
- this.statistics.bug = res.data
|
|
|
- this.bugOption.xAxis[0].data = name
|
|
|
- this.bugOption.series[0].data = data
|
|
|
- this.bugOption = JSON.parse(JSON.stringify(this.bugOption))
|
|
|
- this.loading.bug = false
|
|
|
- })
|
|
|
- },
|
|
|
- getTaskByRequireId() {
|
|
|
- getTaskByRequireId({
|
|
|
- id: this.id
|
|
|
- }).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- if (res.data) {
|
|
|
- this.task = res.data
|
|
|
- this.tableData = res.data.taskDetails
|
|
|
- if (res.data.reqStartTime && res.data.reqEndTime) {
|
|
|
- for (const i in this.requirement.referredClientType) {
|
|
|
- this.listByVersionTypeWithTime({
|
|
|
- type: this.requirement.referredClientType[i],
|
|
|
- startTime: this.tableData.reqStartTime,
|
|
|
- endTime: this.tableData.reqEndTime
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- this.ganttTableData = this.parseGanttTableData(this.tableData)
|
|
|
- }
|
|
|
- this.loading.table = false
|
|
|
- } else {
|
|
|
- this.$message.warning(res.msg)
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- listByVersionTypeWithTime(data) {
|
|
|
- listByVersionTypeWithTime(data)
|
|
|
- .then(res => {
|
|
|
- if (res.data) {
|
|
|
- for (const i in res.data) {
|
|
|
- const startStr = res.data[i].startTime.substring(0, 10)
|
|
|
- const endStr = res.data[i].endTime.substring(0, 10)
|
|
|
- const startDate = new Date(startStr)
|
|
|
- const endDate = new Date(endStr)
|
|
|
- const length = (endDate.getTime() - startDate.getTime()) / (24 * 60 * 60 * 1000)
|
|
|
- for (let j = 0; j <= length; j++) {
|
|
|
- const dateStr = dateUtil.dateAddDays(startStr, j)
|
|
|
- const name = this.appClientOb[data.type] + res.data[i].version + res.data[i].name
|
|
|
- if (typeof this.ganttVersions[dateStr] === 'undefined') {
|
|
|
- this.ganttVersions[dateStr] = name
|
|
|
- } else if (this.ganttVersions[dateStr].indexOf(name) < 0) {
|
|
|
- this.ganttVersions[dateStr] = this.ganttVersions[dateStr] + '\n' + name
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- parseGanttTableData(data) {
|
|
|
- const arr = []
|
|
|
- for (const i in data) {
|
|
|
- if (!(data[i].beginTime && data[i].endTime)) {
|
|
|
- continue
|
|
|
- }
|
|
|
- const task = {
|
|
|
- task: {
|
|
|
- description: data[i].name
|
|
|
- },
|
|
|
- schedules: []
|
|
|
- }
|
|
|
- const schedule = {
|
|
|
- taskId: null,
|
|
|
- taskName: null,
|
|
|
- event: null,
|
|
|
- schedule: null,
|
|
|
- startDate: null,
|
|
|
- length: null,
|
|
|
- owners: []
|
|
|
- }
|
|
|
- schedule.taskId = data[i].id
|
|
|
- schedule.taskName = data[i].name
|
|
|
- const startStr = data[i].beginTime.substring(0, 10)
|
|
|
- const endStr = data[i].endTime.substring(0, 10)
|
|
|
- const startDate = new Date(data[i].beginTime.substring(0, 10))
|
|
|
- const endDate = new Date(data[i].endTime.substring(0, 10))
|
|
|
- schedule.startDate = startStr
|
|
|
- schedule.schedule = startStr.replace(/-/g, '.') + ' - ' + endStr.replace(/-/g, '.')
|
|
|
- schedule.length = (endDate.getTime() - startDate.getTime()) / (24 * 60 * 60 * 1000) + 1
|
|
|
- for (const j in data[i].rdList) {
|
|
|
- schedule.owners.push(data[i].rdList[j].name)
|
|
|
- }
|
|
|
- for (const j in data[i].qaList) {
|
|
|
- schedule.owners.push(data[i].qaList[j].name)
|
|
|
- }
|
|
|
- task.schedules.push(schedule)
|
|
|
- arr.push(task)
|
|
|
- }
|
|
|
- return arr
|
|
|
- },
|
|
|
- setChild() {
|
|
|
- this.$refs.drawer.getRoleList()
|
|
|
- },
|
|
|
- getPmName() {
|
|
|
- const names = []
|
|
|
- for (const i in this.requirement.pm) {
|
|
|
- names.push(this.requirement.pm[i].name)
|
|
|
- }
|
|
|
- return names.join(',')
|
|
|
- },
|
|
|
- getAppClientName() {
|
|
|
- const names = []
|
|
|
- for (const i in this.requirement.referredClientType) {
|
|
|
- names.push(this.appClientOb[this.requirement.referredClientType[i]])
|
|
|
- }
|
|
|
- return names.join('\n')
|
|
|
- },
|
|
|
- showRequirementEnum() {
|
|
|
- return showRequirementEnum().then(res => {
|
|
|
- this.searchInfo = res.data
|
|
|
- for (const i in this.searchInfo.belongingProject) {
|
|
|
- this.projectOb[
|
|
|
- this.searchInfo.belongingProject[i].code
|
|
|
- ] = this.searchInfo.belongingProject[i].msg
|
|
|
- }
|
|
|
- for (const i in this.searchInfo.bizType) {
|
|
|
- this.bizTypeOb[
|
|
|
- this.searchInfo.bizType[i].code
|
|
|
- ] = this.searchInfo.bizType[i].msg
|
|
|
- }
|
|
|
- for (const i in this.searchInfo.appClient) {
|
|
|
- this.appClientOb[
|
|
|
- this.searchInfo.appClient[i].code
|
|
|
- ] = this.searchInfo.appClient[i].msg
|
|
|
- }
|
|
|
- for (const i in this.searchInfo.requirementStatus) {
|
|
|
- this.requirementStatusOb[
|
|
|
- this.searchInfo.requirementStatus[i].code
|
|
|
- ] = this.searchInfo.requirementStatus[i].msg
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- deleteRequirement() {
|
|
|
- const user = localStorage.getItem('username')
|
|
|
- this.$confirm('此操作将永久删除该需求, 是否继续?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- iconClass: 'el-icon-warning-outline',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- deleteRequirement({
|
|
|
- id: this.id,
|
|
|
- modifier: user
|
|
|
- }).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.$router.push({ name: '需求' })
|
|
|
- } else {
|
|
|
- this.$message.warning(res.msg)
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
- .catch(() => {})
|
|
|
- },
|
|
|
- createTask() {
|
|
|
- this.createTaskDialogVisible = true
|
|
|
- this.$nextTick(() => { this.$refs.task_createdUpdata.init(4, this.id) })
|
|
|
- },
|
|
|
- updateRequirementStatus(status) {
|
|
|
- const modifier = localStorage.getItem('username')
|
|
|
- updateRequirementStatus({ id: this.id, status: status.code, modifier: modifier }).then(
|
|
|
- res => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.requirement.status = status.code
|
|
|
- this.getStatusName()
|
|
|
- } else {
|
|
|
- this.$message.warning(res.msg)
|
|
|
- }
|
|
|
- }
|
|
|
- )
|
|
|
- },
|
|
|
- getQaOrRdNameList(list) {
|
|
|
- const arr = []
|
|
|
- for (const i in list) {
|
|
|
- arr.push(list[i].name)
|
|
|
- }
|
|
|
- return arr.join(',')
|
|
|
- },
|
|
|
- getToTaskDetails(id) {
|
|
|
- const { href } = this.$router.resolve({ name: '任务详情', query: { id: id }})
|
|
|
- window.open(href, '_blank')
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-</script>
|
|
|
-
|
|
|
-<style scoped>
|
|
|
-.div_requirment_info .el-row .el-col {
|
|
|
- margin: 10px 0;
|
|
|
-}
|
|
|
-.double-line {
|
|
|
- font-size: 17px;
|
|
|
- text-align: center;
|
|
|
-}
|
|
|
-.double-line-tow {
|
|
|
- text-align: center;
|
|
|
- font-size: 12px;
|
|
|
- font-weight: 400;
|
|
|
- opacity: 0.7;
|
|
|
-}
|
|
|
-.layout_header,
|
|
|
-.layout_aside,
|
|
|
-.layout_main {
|
|
|
- border-radius: 4px;
|
|
|
- background-color: #ffffff;
|
|
|
-}
|
|
|
-.div_statistics > .el-container {
|
|
|
- margin: 0;
|
|
|
-}
|
|
|
-.layout_aside,
|
|
|
-.layout_main {
|
|
|
- padding: 2%;
|
|
|
-}
|
|
|
-.layout_header {
|
|
|
- line-height: 60px;
|
|
|
-}
|
|
|
-.requirement_info::before {
|
|
|
- height: 0px;
|
|
|
-}
|
|
|
-</style>
|
|
|
-
|
|
|
-<style>
|
|
|
-.layout_header .el-button--info.is-plain:hover {
|
|
|
- background: #3f9eff !important;
|
|
|
- border-color: #3f9eff !important;
|
|
|
-}
|
|
|
-.layout_header .el-button--info.is-plain:focus {
|
|
|
- background-color: white;
|
|
|
- color: #606266;
|
|
|
- border-color: #d3d4d6;
|
|
|
-}
|
|
|
-
|
|
|
-.special-button .el-button--info.is-plain {
|
|
|
- background: white !important;
|
|
|
-}
|
|
|
-.special-button .el-button--info.is-plain:focus{
|
|
|
- background-color: white;
|
|
|
- color: #606266;
|
|
|
- border-color: #d3d4d6;
|
|
|
-}
|
|
|
-
|
|
|
-.el-message-box__status::before {
|
|
|
- color: red;
|
|
|
-}
|
|
|
-
|
|
|
-.el-dropdown-menu__item:not(.is-disabled):hover {
|
|
|
- background-color: #f6f7fa;
|
|
|
- color: #606266;
|
|
|
-}
|
|
|
-
|
|
|
-.requirement_details_layout_main .el-table__body tr:hover td {
|
|
|
- color: #409eff;
|
|
|
- background: #eef0f5;
|
|
|
-} /*hover时字体, 背景颜色*/
|
|
|
-</style>
|