فهرست منبع

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

wangziqian 4 سال پیش
والد
کامیت
a988bc67b8

+ 0 - 1
src/views/projectManage/taskList/components/reportList.vue

@@ -336,7 +336,6 @@ export default {
     },
 
     async dailyReportGetByTaskIdV2(e) {
-      alert()
       e ? this.dailyDataStatus = false : ''
       const indexPage = { taskId: this.taskId, bizId: localStorage.getItem('bizId'), curIndex: this.dailyPages.curIndex, pageSize: this.dailyPages.pageSize }
       const res = await dailyReportGetByTaskIdV2(indexPage)

+ 15 - 15
src/views/reportManagement/ReleaseReport/components/iconDisplay.vue

@@ -69,11 +69,11 @@ export default {
           }
         }
       },
+      deep: true,
       immediate: true
     },
     releaseType: {
       handler(newV) {
-        console.log(newV)
         this.types = newV
       },
       immediate: true
@@ -94,9 +94,9 @@ export default {
           title: { text: '新增缺陷趋势图', x: 'center', textStyle: { fontSize: 14, fontStyle: 'normal', fontWeight: 'normal' }},
           tooltip: { axisPointer: { type: 'shadow' }},
           grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true },
-          xAxis: [{ type: 'category', data: res.bugDisByDate.xAxis ? res.bugDisByDate.xAxis : ['未知', '未知', '未知', '未知', '未知', '未知', '未知'], axisTick: { alignWithLabel: true }}],
+          xAxis: [{ type: 'category', data: res.bugDisByDate.xAxis ? res.bugDisByDate.xAxis : ['未知'], axisTick: { alignWithLabel: true }}],
           yAxis: [{ type: 'value', axisLine: { show: false }, axisTick: { show: false }, splitLine: { show: true, lineStyle: { type: 'dashed' }}}],
-          series: res.bugDisByDate.yAxis[0].data <= 0 ? [{ name: '直接访问', type: 'line', smooth: true, data: [0, 0, 0, 0, 0, 0, 0] }] : data
+          series: res.bugDisByDate.yAxis[0].data <= 0 ? [{ name: '直接访问', type: 'line', smooth: true, data: [0] }] : data
         })
       }, 200)
 
@@ -111,9 +111,9 @@ export default {
           title: { text: '缺陷责任人分布', x: 'center', textStyle: { fontSize: 14, fontStyle: 'normal', fontWeight: 'normal' }},
           tooltip: { axisPointer: { type: 'shadow' }},
           grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true },
-          xAxis: [{ type: 'category', data: res.bugDisByMember.xAxis[0] ? res.bugDisByMember.xAxis : ['未知', '未知', '未知', '未知'], axisTick: { alignWithLabel: true }}],
+          xAxis: [{ type: 'category', data: res.bugDisByMember.xAxis[0] ? res.bugDisByMember.xAxis : ['未知'], axisTick: { alignWithLabel: true }}],
           yAxis: [{ type: 'value', axisLine: { show: false }, axisTick: { show: false }, splitLine: { show: true, lineStyle: { type: 'dashed' }}}],
-          series: res.bugDisByMember.yAxis[0].data <= 0 ? [{ name: '无数据', type: 'bar', barWidth: '20px', data: [0, 0, 0, 0] }] : lineShow
+          series: res.bugDisByMember.yAxis[0].data <= 0 ? [{ name: '无数据', type: 'bar', barWidth: '20px', data: [0] }] : lineShow
         })
       }, 200)
       const barShow = res.bugDisByPri.yAxis.map(item => ({
@@ -158,9 +158,9 @@ export default {
               title: { text: '新增缺陷趋势图', x: 'center', textStyle: { fontSize: 14, fontStyle: 'normal', fontWeight: 'normal' }},
               tooltip: { axisPointer: { type: 'shadow' }},
               grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true },
-              xAxis: [{ type: 'category', data: res6.data.xaxis === null ? ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期七'] : res6.data.xaxis, axisTick: { alignWithLabel: true }}],
+              xAxis: [{ type: 'category', data: res6.data.xaxis === null ? ['未知'] : res6.data.xaxis, axisTick: { alignWithLabel: true }}],
               yAxis: [{ type: 'value', axisLine: { show: false }, axisTick: { show: false }, splitLine: { show: true, lineStyle: { type: 'dashed' }}}],
-              series: res6.data.yaxis[0].data <= 0 ? [{ name: '直接访问', type: 'line', smooth: true, data: [0, 0, 0, 0, 0, 0, 0] }] : data
+              series: res6.data.yaxis[0].data <= 0 ? [{ name: '直接访问', type: 'line', smooth: true, data: [0] }] : data
 
             })
           }, 200)
@@ -178,9 +178,9 @@ export default {
               title: { text: '缺陷责任人分布', x: 'center', textStyle: { fontSize: 14, fontStyle: 'normal', fontWeight: 'normal' }},
               tooltip: { axisPointer: { type: 'shadow' }},
               grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true },
-              xAxis: [{ type: 'category', data: res2.data.xaxis[0] ? res2.data.xaxis : ['P0', 'P1', 'P2', 'P3'], axisTick: { alignWithLabel: true }}],
+              xAxis: [{ type: 'category', data: res2.data.xaxis[0] ? res2.data.xaxis : ['未知'], axisTick: { alignWithLabel: true }}],
               yAxis: [{ type: 'value', axisLine: { show: false }, axisTick: { show: false }, splitLine: { show: true, lineStyle: { type: 'dashed' }}}],
-              series: res2.data.yaxis[0].data <= 0 ? [{ name: '无数据', type: 'bar', barWidth: '20px', data: [0, 0, 0, 0] }] : data
+              series: res2.data.yaxis[0].data <= 0 ? [{ name: '无数据', type: 'bar', barWidth: '20px', data: [0] }] : data
             })
           }, 200)
         }
@@ -211,18 +211,18 @@ export default {
             title: { text: '新增缺陷趋势图', x: 'center', textStyle: { fontSize: 14, fontStyle: 'normal', fontWeight: 'normal' }},
             tooltip: { axisPointer: { type: 'shadow' }},
             grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true },
-            xAxis: [{ type: 'category', data: ['未知', '未知', '未知', '未知', '未知', '未知', '未知'], axisTick: { alignWithLabel: true }}],
+            xAxis: [{ type: 'category', data: ['未知'], axisTick: { alignWithLabel: true }}],
             yAxis: [{ type: 'value', axisLine: { show: false }, axisTick: { show: false }, splitLine: { show: true, lineStyle: { type: 'dashed' }}}],
-            series: [{ name: '直接访问', type: 'line', smooth: true, data: [0, 0, 0, 0, 0, 0, 0] }]
+            series: [{ name: '直接访问', type: 'line', smooth: true, data: [0] }]
           })
           echarts.init(document.getElementById('lineShow')).setOption({
             color: ['#409EFF'],
             title: { text: '缺陷责任人分布', x: 'center', textStyle: { fontSize: 14, fontStyle: 'normal', fontWeight: 'normal' }},
             tooltip: { axisPointer: { type: 'shadow' }},
             grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true },
-            xAxis: [{ type: 'category', data: ['未知', '未知', '未知', '未知'], axisTick: { alignWithLabel: true }}],
+            xAxis: [{ type: 'category', data: ['未知'], axisTick: { alignWithLabel: true }}],
             yAxis: [{ type: 'value', axisLine: { show: false }, axisTick: { show: false }, splitLine: { show: true, lineStyle: { type: 'dashed' }}}],
-            series: [{ name: '无数据', type: 'bar', barWidth: '20px', data: [0, 0, 0, 0] }]
+            series: [{ name: '无数据', type: 'bar', barWidth: '20px', data: [0] }]
           })
           echarts.init(document.getElementById('barShow')).setOption({
             backgroundColor: '#FFF',
@@ -230,9 +230,9 @@ export default {
             title: { text: '缺陷等级分布', x: 'center', textStyle: { fontSize: 14, fontStyle: 'normal', fontWeight: 'normal' }},
             tooltip: { axisPointer: { type: 'shadow' }},
             grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true },
-            xAxis: [{ type: 'category', data: ['未知', '未知', '未知', '未知'], axisTick: { alignWithLabel: true }}],
+            xAxis: [{ type: 'category', data: ['未知'], axisTick: { alignWithLabel: true }}],
             yAxis: [{ type: 'value', axisLine: { show: false }, axisTick: { show: false }, splitLine: { show: true, lineStyle: { type: 'dashed' }}}],
-            series: [{ name: '无数据', type: 'bar', barWidth: '20px', data: [0, 0, 0, 0] }]
+            series: [{ name: '无数据', type: 'bar', barWidth: '20px', data: [0] }]
           })
         }, 200)
       }

+ 125 - 24
src/views/reportManagement/ReleaseReport/newReleaeTemplate.vue

@@ -6,7 +6,28 @@
     element-loading-text="数据上传中,请稍后"
     element-loading-spinner="el-icon-loading"
   >
+
     <el-form ref="fromCreateData" :model="from">
+
+      <div style=" margin-bottom: 10px;">
+        <span style="color: #f56b6c">*</span>
+        <span class="backStyle"> 关联任务</span>
+      </div>
+
+      <el-select v-model="from.taskIds" filterable remote reserve-keyword placeholder="🔍 请输入任务名称或ID" :remote-method="remoteMethod" style="width: 30%" size="small" @change="colseSelect">
+        <el-option v-for="item in tasksOptions" :key="item.id" :label="item.name" :value="item.id" @click.native="tasksChange(item)">
+          <div class="Layout_space_between"><span>{{ item.name }}</span></div>
+        </el-option>
+      </el-select>
+
+      <div v-if="selectTask" class="taskError">关联任务不能为空</div>
+
+      <div v-for="(item, index) in tasksDetailList" :key="index" class="Layout_space_between report-taskList">
+        <span>{{ item.taskIdSting }}</span>
+        <span>{{ item.name }}</span>
+        <i class="el-icon-circle-close didi-hover" @click="delete_task(item)" />
+      </div>
+
       <el-form-item v-if="releaseType" label="模版名称" prop="moduleName" :rules="[{ required: true, message: '模版名称不能为空', trigger: 'change'}]"><br>
         <el-input v-model="from.moduleName" size="small" style="width:100%;" placeholder="请输入模版名称(不可与现有模版重名)" />
       </el-form-item>
@@ -85,6 +106,7 @@ import '@/styles/PublicStyle/index.scss' // 公共css
 import searchTeam from '@/components/select/searchTeam' // 人员搜索
 import normalArea from '@/components/input/normalArea' // 富文本
 import 'tinymce/plugins/table'// 插入表格插件
+import { taskList } from '@/api/taskIndex'
 import iconDisplay from '@/views/reportManagement/ReleaseReport/components/iconDisplay.vue'
 import { settingAddReportModule, settingUpdateReportModule, settingGetReportModuleById, reportreleaseInitReportRelease, reportreleaseCreate, reportreleaseUpdate, reportreleaseGetReportById } from '@/api/reportTemplate' // 模版添删改查
 import { getContainImgHTMLNode } from '@/utils/handleTinymce' // 富文本本图片转换
@@ -106,6 +128,10 @@ export default {
       taskId: [], // 创建准出的任务
       content: {}, // from
       from: {}, // from-date
+      tasksOptions: [], // 关联任务
+      tasksDetailList: [], // 关联任务
+      selectTask: false,
+      judge: false,
       fromData: {},
       modelID: '',
       releaseType: false, // 新建模版还是新建准出报告
@@ -138,8 +164,11 @@ export default {
     taskIds: {
       handler(newV) {
         if (newV) {
-          this.taskId = newV
-          this.reportreleaseInitReportRelease()
+          newV.map(item => {
+            this.judge = true
+            this.remoteMethod(item)
+          })
+          this.reportreleaseInitReportRelease(newV)
         }
       },
       immediate: true
@@ -150,15 +179,19 @@ export default {
       const res = await reportreleaseGetReportById(val)
       if (res.code === 200) {
         this.$nextTick(() => {
-          this.taskId = res.data.taskIds
+          const taskId = res.data.taskIds
+          taskId.map(item => {
+            this.judge = true
+            this.remoteMethod(item)
+          })
         })
         this.setDefaultData(res.data)
       }
     },
 
-    async reportreleaseInitReportRelease() { // 获取表单数据
+    async reportreleaseInitReportRelease(newV) { // 获取表单数据
       if (!this.releaseType) {
-        const res = await reportreleaseInitReportRelease({ taskIds: this.taskId })
+        const res = await reportreleaseInitReportRelease({ taskIds: newV })
         if (res.code === 200) {
           this.setDefaultData(res.data)
         }
@@ -205,6 +238,43 @@ export default {
       }
     },
 
+    async remoteMethod(query) { // 远程搜索任务
+      const res = await taskList({ bizId: Number(localStorage.getItem('bizId')), name: query })
+      if (res.code === 200) {
+        this.tasksOptions = res.data
+        if (this.judge) {
+          this.tasksDetailList.push(res.data[0])
+          this.taskId.push(res.data[0].id)
+          this.judge = false
+        }
+      }
+    },
+
+    tasksChange(data) { // 任务列表变动
+      const isEx = this.tasksDetailList.find(item => item.id === data.id)
+      if (isEx) {
+        this.$message({ message: '任务已存在', type: 'warning', duration: 1000, offset: 150 })
+        return false
+      }
+      this.tasksDetailList.push(data)
+      this.taskId.push(data.id)
+      this.tasksDetailList.length <= 0 ? this.selectTask = true : this.selectTask = false
+    },
+
+    delete_task(val) { // 删除关联的任务
+      this.tasksDetailList = this.tasksDetailList.filter(item => {
+        return item.id !== val.id
+      })
+      this.taskId = this.taskId.filter(item => {
+        return item !== val.id
+      })
+      this.tasksDetailList.length <= 0 ? this.selectTask = true : this.selectTask = false
+    },
+
+    colseSelect() { // 清空任务名称
+      this.$set(this.from, 'taskIds', null)
+    },
+
     // 创建准出报告
     reportreleaseCreate(val) {
       this.$refs.fromCreateData.validate(async(valid) => {
@@ -225,10 +295,15 @@ export default {
             data.releaseActualTime = this.from.releaseActualTime // 实际准出时间
             if (this.from.releasePlanTime > this.from.releaseActualTime) {
               data.isDelay = 1// 准出是否延期 1 延期,0未延期
-              data.delayReason = this.from.delayReason // 是否延期
             } else {
               data.isDelay = 0
             }
+            if (this.from.delayReason) {
+              data.delayReason = this.from.delayReason // 是否延期
+            } else {
+              this.$message({ type: 'warning', message: '准出原因不能为空' })
+              return false
+            }
             if (this.from.devPlanTimeStart) {
               data.devPlanTimeStart = this.from.devPlanTimeStart[0] // 计划开发开始时间
               data.devPlanTimeEnd = this.from.devPlanTimeStart[1] // 计划开发结束时间
@@ -246,7 +321,11 @@ export default {
               data.testActualTimeEnd = this.from.testActualTimeStart[1] // 实际测试结束时间
             }
             data.testResult = 1 // 测试结果 状态 1通过 2未通过
-            data.taskIds = this.taskId // 关联任务
+            if (this.taskId[0]) {
+              data.taskIds = this.taskId // 关联任务
+            } else {
+              return false
+            }
             data.bizId = this.from.bizId // 业务线
             data.moduleId = this.from.moduleId // 模块id
             data.content = this.fromData.content // 富文本
@@ -266,10 +345,15 @@ export default {
             data.releaseActualTime = this.from.releaseActualTime // 实际准出时间
             if (this.from.releasePlanTime > this.from.releaseActualTime) {
               data.isDelay = 1// 准出是否延期 1 延期,0未延期
-              data.delayReason = this.from.delayReason // 是否延期
             } else {
               data.isDelay = 0
             }
+            if (this.from.delayReason) {
+              data.delayReason = this.from.delayReason // 是否延期
+            } else {
+              this.$message({ type: 'warning', message: '准出原因不能为空' })
+              return false
+            }
             if (this.from.devPlanTimeStart) {
               data.devPlanTimeStart = this.from.devPlanTimeStart[0] // 计划开发开始时间
               data.devPlanTimeEnd = this.from.devPlanTimeStart[1] // 计划开发结束时间
@@ -286,7 +370,11 @@ export default {
               data.testActualTimeStart = this.from.testActualTimeStart[0] // 实际测试开始时间
               data.testActualTimeEnd = this.from.testActualTimeStart[1] // 实际测试结束时间
             }
-            data.taskIds = this.taskId // 关联任务
+            if (this.taskId[0]) {
+              data.taskIds = this.taskId // 关联任务
+            } else {
+              return false
+            }
             data.bizId = localStorage.getItem('bizId') // 业务线
             data.moduleId = this.fromData.id // 模块id
             data.content = this.fromData.content // 富文本
@@ -354,7 +442,7 @@ export default {
     margin: 20px 0;
   }
 
-.report-container {
+  .report-container {
     display: inline-block;
     font-size:14px;
     width: 100%;
@@ -364,14 +452,14 @@ export default {
     color:#666666;
     opacity:1;
     >>> .el-form-item__label {
-    color: #333;
-}
->>> .el-date-editor .el-range-separator {
-    padding: 0 5px;
-    line-height: 26px;
-    width: auto;
-    color: #303133;
-}
+      color: #333;
+    }
+    >>> .el-date-editor .el-range-separator {
+      padding: 0 5px;
+      line-height: 26px;
+      width: auto;
+      color: #303133;
+    }
     .from-name {
       width: 140px !important;
     }
@@ -386,12 +474,25 @@ export default {
       margin-left: 30px;
       color:rgba(126,211,33,1);
     }
-}
-.sodu {
-  color:#C0C4CC;
-  margin-left: 15px;
-}
-
+  }
+  .report-taskList{
+    font-size:14px;
+    font-family:MicrosoftYaHei;
+    line-height:17px;
+    color:rgba(102,102,102,1);
+    margin-top: 10px;
+    opacity:1;
+  }
+  .sodu {
+    color:#C0C4CC;
+    margin-left: 15px;
+  }
+  .taskError {
+    color: #F56C6C;
+    font-size: 12px;
+    line-height: 1;
+    padding-top: 4px;
+  }
   .from-margin {
     margin-bottom:20px;
   }

+ 7 - 5
src/views/reportManagement/ReleaseReport/releaePreview.vue

@@ -2,14 +2,19 @@
   <!-- 预览准出报告 -->
   <div class="parent-style">
     <div class="backStyle"> 邮件列表</div>
-    <div class="Layout_space_between report-margin bottom_mar">
+    <div class="Layout_space_between bottom_mar">
       <div class="div1">收件人</div>
       <searchTeam :value.sync="form.name" :clearable="true" :multiple="true" style="width:100%" />
     </div>
-    <div class="Layout_space_between report-margin">
+    <div class="Layout_space_between report-margin Above">
       <div class="div1">抄送</div>
       <searchTeam :value.sync="form.names" :clearable="true" :multiple="true" style="width:100%" />
     </div>
+    <span class="backStyle"> 关联任务</span>
+    <div v-for="(item, index) in fromCreateData.taskDetailList" :key="index" class="Layout_flex_start report-taskList">
+      <span>{{ item.taskId }}</span>
+      <span>{{ item.name }}</span>
+    </div>
     <div class="backStyle"> 报告预览</div>
     <div id="repot-list">
       <div class="Layout_space_between" style="border-bottom: 0.5px solid #eee;margin-bottom: 15px;">
@@ -189,9 +194,6 @@ export default {
     margin: 20px 0;
      color:#409EFF;
   }
-  .report-margin {
-    margin-left: 20px;
-  }
   .bottom_mar {
     margin-bottom: 10px;
   }

+ 5 - 0
src/views/reportManagement/Testing/TestingPreview.vue

@@ -10,6 +10,11 @@
       <div class="div1">抄送</div>
       <searchTeam :value.sync="form.names" :clearable="true" :multiple="true" style="width:100%" />
     </div>
+    <span class="backStyle"> 关联任务</span>
+    <div v-for="(item, index) in fromCreateData.taskDetailList" :key="index" class="Layout_flex_start report-taskList">
+      <span>{{ item.taskId }}</span>
+      <span>{{ item.name }}</span>
+    </div>
     <div class="backStyle"> 报告预览</div>
     <div id="repot-list">
       <div class="Layout_space_between" style="border-bottom: 0.5px solid #eee;margin-bottom: 15px;">

+ 72 - 1
src/views/reportManagement/Testing/newTestingTemplate.vue

@@ -2,6 +2,26 @@
   <!-- 新建报告模版 -->
   <div class="report-container">
     <el-form ref="fromCreateData" :model="from">
+
+      <div style=" margin-bottom: 10px;">
+        <span style="color: #f56b6c">*</span>
+        <span class="backStyle"> 关联任务</span>
+      </div>
+
+      <el-select v-model="from.taskIds" filterable remote reserve-keyword placeholder="🔍 请输入任务名称或ID" :remote-method="remoteMethod" style="width: 30%" size="small" @change="colseSelect">
+        <el-option v-for="item in tasksOptions" :key="item.id" :label="item.name" :value="item.id" @click.native="tasksChange(item)">
+          <div class="Layout_space_between"><span>{{ item.name }}</span></div>
+        </el-option>
+      </el-select>
+
+      <div v-if="selectTask" class="taskError">关联任务不能为空</div>
+
+      <div v-for="(item, index) in tasksDetailList" :key="index" class="Layout_space_between report-taskList">
+        <span>{{ item.taskIdSting }}</span>
+        <span>{{ item.name }}</span>
+        <i class="el-icon-circle-close didi-hover" @click="delete_task(item)" />
+      </div>
+
       <el-form-item v-if="releaseType" label="模版名称" prop="moduleName" :rules="[{ required: true, message: '模版名称不能为空', trigger: 'change'}]"><br>
         <el-input v-model="from.moduleName" size="small" style="width:100%;" placeholder="请输入模版名称(不可与现有模版重名)" />
       </el-form-item>
@@ -112,6 +132,7 @@ import '@/styles/PublicStyle/index.scss' // 公共css
 import searchTeam from '@/components/select/searchTeam' // 人员搜索
 import normalArea from '@/components/input/normalArea' // 富文本
 import 'tinymce/plugins/table'// 插入表格插件
+import { taskList } from '@/api/taskIndex'
 import { configShowTaskEnum } from '@/api/taskIndex'
 import { settingAddReportModule, settingUpdateReportModule, settingGetReportModuleById, reportdelivertestInitReportRelease, reportdelivertestCreate, reportdelivertestGetRequiresByTaskIds, reportdelivertestUpdate, reportdelivertestGetReportById } from '@/api/reportTemplate' // 模版添删改查
 import { getContainImgHTMLNode } from '@/utils/handleTinymce' // 富文本本图片转换
@@ -131,6 +152,10 @@ export default {
       tpltId: '', // 模版id
       taskId: [], // 创建准出的任务
       fromCreateData: {}, // from
+      tasksOptions: [], // 关联任务
+      tasksDetailList: [], // 关联任务
+      selectTask: false,
+      judge: false,
       from: {
         reportName: ''
       },
@@ -165,8 +190,12 @@ export default {
     },
     taskIds: {
       handler(newV) {
+        console.log(newV, '111111')
         if (newV[0]) {
-          this.taskId = newV
+          newV.map(item => {
+            this.judge = true
+            this.remoteMethod(item)
+          })
           this.reportdelivertestInitReportRelease(newV)
         }
       },
@@ -180,10 +209,15 @@ export default {
     async reportdelivertestGetReportById(val) { // 获取提测报告数据
       const res = await reportdelivertestGetReportById(val)
       if (res.code === 200) {
+        console.log(res.data, '2222')
         const from = res.data
         this.from.id = from.id
         this.$set(this.from, 'reportName', from.reportName) // 报告名称
         this.setFromData(from)
+        res.data.taskIds.map(item => {
+          this.judge = true
+          this.remoteMethod(item)
+        })
       }
     },
 
@@ -232,6 +266,43 @@ export default {
       }
     },
 
+    async remoteMethod(query) { // 远程搜索任务
+      const res = await taskList({ bizId: Number(localStorage.getItem('bizId')), name: query })
+      if (res.code === 200) {
+        this.tasksOptions = res.data
+        if (this.judge) {
+          this.tasksDetailList.push(res.data[0])
+          this.taskId.push(res.data[0].id)
+          this.judge = false
+        }
+      }
+    },
+
+    tasksChange(data) { // 任务列表变动
+      const isEx = this.tasksDetailList.find(item => item.id === data.id)
+      if (isEx) {
+        this.$message({ message: '任务已存在', type: 'warning', duration: 1000, offset: 150 })
+        return false
+      }
+      this.tasksDetailList.push(data)
+      this.taskId.push(data.id)
+      this.tasksDetailList.length <= 0 ? this.selectTask = true : this.selectTask = false
+    },
+
+    delete_task(val) { // 删除关联的任务
+      this.tasksDetailList = this.tasksDetailList.filter(item => {
+        return item.id !== val.id
+      })
+      this.taskId = this.taskId.filter(item => {
+        return item !== val.id
+      })
+      this.tasksDetailList.length <= 0 ? this.selectTask = true : this.selectTask = false
+    },
+
+    colseSelect() { // 清空任务名称
+      this.$set(this.from, 'taskIds', null)
+    },
+
     goRequired(id) {
       this.$router.push({ name: '需求详情', query: { id: id }})
     },

+ 0 - 1
src/views/reportManagement/components/DailyReport.vue

@@ -269,7 +269,6 @@ export default {
 
     sendReport() { // 截图
       this.$refs.dailyPreview.sendReport()
-      this.handleClose()
     },
 
     handleClose() {

+ 9 - 9
src/views/reportManagement/daily/components/iconDisplay.vue

@@ -104,9 +104,9 @@ export default {
           title: { text: '新增缺陷趋势图', x: 'center', textStyle: { fontSize: 14, fontStyle: 'normal', fontWeight: 'normal' }},
           tooltip: { axisPointer: { type: 'shadow' }},
           grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true },
-          xAxis: [{ type: 'category', data: val.bugDisByDate.xAxis ? val.bugDisByDate.xAxis : ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期七'], axisTick: { alignWithLabel: true }}],
+          xAxis: [{ type: 'category', data: val.bugDisByDate.xAxis ? val.bugDisByDate.xAxis : ['未知'], axisTick: { alignWithLabel: true }}],
           yAxis: [{ type: 'value', axisLine: { show: false }, axisTick: { show: false }, splitLine: { show: true, lineStyle: { type: 'dashed' }}}],
-          series: val.bugDisByDate.yAxis[0].data <= 0 ? [{ name: '直接访问', type: 'line', smooth: true, data: [0, 0, 0, 0, 0, 0, 0] }] : data3
+          series: val.bugDisByDate.yAxis[0].data <= 0 ? [{ name: '直接访问', type: 'line', smooth: true, data: [0] }] : data3
 
         })
       }, 200)
@@ -123,9 +123,9 @@ export default {
           title: { text: '缺陷责任人分布', x: 'center', textStyle: { fontSize: 14, fontStyle: 'normal', fontWeight: 'normal' }},
           tooltip: { axisPointer: { type: 'shadow' }},
           grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true },
-          xAxis: [{ type: 'category', data: val.bugDisByMember.xAxis.length <= 0 ? ['无', '无', '无', '无'] : val.bugDisByMember.xAxis, axisTick: { alignWithLabel: true }}],
+          xAxis: [{ type: 'category', data: val.bugDisByMember.xAxis.length <= 0 ? ['未知'] : val.bugDisByMember.xAxis, axisTick: { alignWithLabel: true }}],
           yAxis: [{ type: 'value', axisLine: { show: false }, axisTick: { show: false }, splitLine: { show: true, lineStyle: { type: 'dashed' }}}],
-          series: val.bugDisByMember.yAxis[0].data.length <= 0 ? [{ name: '无数据', type: 'bar', barWidth: '20px', data: [0, 0, 0, 0] }] : data
+          series: val.bugDisByMember.yAxis[0].data.length <= 0 ? [{ name: '无数据', type: 'bar', barWidth: '20px', data: [0] }] : data
         })
       }, 200)
 
@@ -143,7 +143,7 @@ export default {
           grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true },
           xAxis: [{ type: 'category', data: val.bugDisByPri.xAxis, axisTick: { alignWithLabel: true }}],
           yAxis: [{ type: 'value', axisLine: { show: false }, axisTick: { show: false }, splitLine: { show: true, lineStyle: { type: 'dashed' }}}],
-          series: val.bugDisByPri.yAxis[0].data.length <= 0 ? [{ name: '无数据', type: 'bar', barWidth: '20px', data: [0, 0, 0, 0] }] : data1
+          series: val.bugDisByPri.yAxis[0].data.length <= 0 ? [{ name: '无数据', type: 'bar', barWidth: '20px', data: [0] }] : data1
         })
       }, 200)
     },
@@ -179,9 +179,9 @@ export default {
             title: { text: '新增缺陷趋势图', x: 'center', textStyle: { fontSize: 14, fontStyle: 'normal', fontWeight: 'normal' }},
             tooltip: { axisPointer: { type: 'shadow' }},
             grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true },
-            xAxis: [{ type: 'category', data: res6.data.xaxis === null ? ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期七'] : res6.data.xaxis, axisTick: { alignWithLabel: true }}],
+            xAxis: [{ type: 'category', data: res6.data.xaxis === null ? ['未知'] : res6.data.xaxis, axisTick: { alignWithLabel: true }}],
             yAxis: [{ type: 'value', axisLine: { show: false }, axisTick: { show: false }, splitLine: { show: true, lineStyle: { type: 'dashed' }}}],
-            series: res6.data.yaxis[0].data <= 0 ? [{ name: '直接访问', type: 'line', smooth: true, data: [0, 0, 0, 0, 0, 0, 0] }] : data
+            series: res6.data.yaxis[0].data <= 0 ? [{ name: '直接访问', type: 'line', smooth: true, data: [0] }] : data
           })
         }, 200)
       }
@@ -200,9 +200,9 @@ export default {
             title: { text: '缺陷责任人分布', x: 'center', textStyle: { fontSize: 14, fontStyle: 'normal', fontWeight: 'normal' }},
             tooltip: { axisPointer: { type: 'shadow' }},
             grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true },
-            xAxis: [{ type: 'category', data: res2.data.xaxis.length <= 0 ? ['P0', 'P1', 'P2', 'P3'] : res2.data.xaxis, axisTick: { alignWithLabel: true }}],
+            xAxis: [{ type: 'category', data: res2.data.xaxis.length <= 0 ? ['未知'] : res2.data.xaxis, axisTick: { alignWithLabel: true }}],
             yAxis: [{ type: 'value', axisLine: { show: false }, axisTick: { show: false }, splitLine: { show: true, lineStyle: { type: 'dashed' }}}],
-            series: res2.data.yaxis[0].data <= 0 ? [{ name: '无数据', type: 'bar', barWidth: '20px', data: [0, 0, 0, 0] }] : data
+            series: res2.data.yaxis[0].data <= 0 ? [{ name: '无数据', type: 'bar', barWidth: '20px', data: [0] }] : data
           })
         }, 200)
       }

+ 46 - 43
src/views/reportManagement/daily/dailyPreview.vue

@@ -1,26 +1,33 @@
 <template>
   <!-- 预览测试日报 -->
   <div class="parent-style">
-    <div class="backStyle"> 邮件列表</div>
+    <div class="backStyle">邮件列表</div>
     <div class="Layout_space_between report-div">
       <div class="div1">收件人</div>
       <searchTeam :value.sync="form.name" :clearable="true" :multiple="true" style="width:100%" />
     </div>
-    <div class="Layout_space_between report-div">
+    <div class="Layout_space_between report-div" style="margin-bottom: 30px;">
       <div class="div1">抄送</div>
       <searchTeam :value.sync="form.names" :clearable="true" :multiple="true" style="width:100%" />
     </div>
 
-    <div id="repot-list" class="marginTop">
-      <span class="backStyle"> 关联任务</span>
-      <div v-for="(item, index) in fromCreateData.taskDetailList" :key="index" class="Layout_flex_start report-taskList">
-        <span>{{ item.taskId }}</span>
-        <span>{{ item.name }}</span>
-      </div>
+    <span class="backStyle">关联任务</span>
+    <div
+      v-for="(item, index) in fromCreateData.taskDetailList"
+      :key="index"
+      class="Layout_flex_start report-taskList"
+    >
+      <span>{{ item.taskId }}</span>
+      <span>{{ item.name }}</span>
+    </div>
 
-      <div class="backStyle marginTop"> 报告预览</div>
-      <div class="Layout_space_between reportName_style" style="border-bottom: 0.5px solid #eee;margin-bottom: 15px; padding-bottom: 10px;">
-        <span class="backStyle report-name"> {{ fromCreateData.reportName }}</span>
+    <div id="repot-list" class="marginTop">
+      <div class="backStyle marginTop">报告预览</div>
+      <div
+        class="Layout_space_between reportName_style"
+        style="border-bottom: 0.5px solid #eee;margin-bottom: 15px; padding-bottom: 10px;"
+      >
+        <span class="backStyle report-name">{{ fromCreateData.reportName }}</span>
         <span>报告人:{{ name }}</span>
       </div>
       <div v-html="fromCreateData.content" />
@@ -88,9 +95,6 @@ export default {
 
     sendReport() {
       if (this.form.name !== undefined) {
-        // const targetDom = document.getElementById('repot-list')
-        // const copyDom = targetDom.cloneNode(true)
-        // document.querySelector('body').appendChild(copyDom)
         setTimeout(() => {
           html2canvas(document.getElementById('repot-list'), { useCORS: true }).then(canvas => {
             const imgData = canvas.toDataURL('image/png', 1)
@@ -98,7 +102,6 @@ export default {
             const postData = { 'reportId': this.daily_Id, 'imgStr': sendImgData, 'url': window.location.href, 'emailUser': this.form.name ? this.form.name.join(',') : null, 'copyTo': this.form.names ? this.form.names.join(',') : null }
             dailyReportSendmail(postData).then(res => {
               res.code === 200 ? this.$message.success('报告发送中,请稍后进行邮件查收!') : this.$message.error('发送测试日报失败,请联系管理员!')
-              // document.querySelector('body').removeChild(copyDom)
               this.$emit('handleClose')
             })
           })
@@ -113,41 +116,41 @@ export default {
 
 <style lang="scss" scoped>
 .parent-style {
-  .report-taskList{
-    font-size:14px;
-    font-family:MicrosoftYaHei;
-    line-height:17px;
-    color:#333;
+  .report-taskList {
+    font-size: 14px;
+    font-family: MicrosoftYaHei;
+    line-height: 17px;
+    color: #333;
     margin: 10px 0 0 0;
-    opacity:1;
+    opacity: 1;
   }
   .report-name {
     font-size: 20px;
     margin-top: 15px;
-    color:#409EFF;
+    color: #409eff;
   }
 }
 .div1 {
-    width: 60px;
-    font-size: 14px;
-    font-family: MicrosoftYaHei;
-    color: rgba(51, 51, 51, 1);
-    line-height: 19px;
+  width: 60px;
+  font-size: 14px;
+  font-family: MicrosoftYaHei;
+  color: rgba(51, 51, 51, 1);
+  line-height: 19px;
+}
+.backStyle {
+  color: #333;
+  font-size: 14px;
+  font-weight: bold;
+}
+.report-div {
+  margin-top: 10px;
+}
+.marginTop {
+  margin-top: 30px;
+}
+.reportName_style {
+  border-bottom: 0.5px solid #eee;
+  margin-bottom: 15px;
+  padding-bottom: 10px;
 }
-  .backStyle {
-    color:#333;
-    font-size: 14px;
-    font-weight: bold;
-  }
-  .report-div {
-    margin-top: 10px;
-  }
-  .marginTop {
-    margin-top: 30px;
-  }
-  .reportName_style {
-    border-bottom: 0.5px solid #eee;
-    margin-bottom: 15px;
-    padding-bottom: 10px;
-  }
 </style>

+ 1 - 1
src/views/reportManagement/daily/dailyTemplate.vue

@@ -19,7 +19,7 @@
         </el-option>
       </el-select>
 
-      <div v-if="selectTask" class="taskError">报告关联任务不能为空</div>
+      <div v-if="selectTask" class="taskError">关联任务不能为空</div>
 
       <div v-for="(item, index) in tasksDetailList" :key="index" class="Layout_space_between report-taskList">
         <span>{{ item.taskIdSting }}</span>

+ 4 - 3
src/views/reportManagement/testPresentation.vue

@@ -18,7 +18,7 @@
           </div>
           <div class="Layout_space_between">
             <el-button v-if="!history" type="primary" size="medium" @click="returnNewest">返回最新</el-button>
-            <el-button v-if="history" type="primary" size="medium" @click="gethistoryData">查看老数据</el-button>
+            <el-button v-if="history" type="text" @click="gethistoryData">查看老数据</el-button>
             <el-button v-if="history" type="primary" size="medium" @click="getQueryData">新建{{ title }}</el-button>
           </div>
         </div>
@@ -224,6 +224,7 @@ export default {
     },
 
     async getList(e) { // 报告list
+      console.log(e, 'sousuo')
       this.loading = true
       this.history = true
       const indexPage = { bizId: localStorage.getItem('bizId'), pageSize: this.pageSize, curIndex: this.curIndex }
@@ -244,7 +245,7 @@ export default {
       }
       if (this.title === '提测报告') {
         const data = { bizId: localStorage.getItem('bizId'), pageSize: this.pageSize, curIndex: this.curIndex }
-        e ? indexPage.name = this.state : ''
+        e ? data.reportName = this.state : ''
         const res = await reportdelivertestList(data)
         if (res.code === 200) {
           this.tableData = res.data.list || []
@@ -472,7 +473,7 @@ export default {
       }
       if (this.title === '提测报告') {
         const data = { bizId: localStorage.getItem('bizId'), pageSize: this.pageSize, curIndex: this.curIndex }
-        e ? indexPage.name = this.state : ''
+        e ? data.name = this.state : ''
         const res = await launchTestList(data)
         if (res.code === 200) {
           this.tableData = res.data