ソースを参照

修改任务仪表盘部分功能

linyk 2 年 前
コミット
3d0475f52e

+ 3 - 1
src/App.vue

@@ -6,7 +6,9 @@
     <div class="container-wrapper">
       <slot>
         <div class="main-container">
-          <router-view/>
+          <keep-alive>
+            <router-view/>
+          </keep-alive>
         </div>
       </slot>
     </div>

+ 4 - 7
src/components/project/TaskSearch.vue

@@ -25,11 +25,11 @@ export default {
     }
   },
   props: {
-    selectedProjectCode: {
+    firstSelectedTaskCode: {
       type: String,
       default: ''
     },
-    firstSelectedTaskCode: {
+    selectedProjectCode: {
       type: String,
       default: ''
     },
@@ -66,16 +66,13 @@ export default {
       this.searchTasks = this.tasks
     },
     getSimpleTaskDatas (projectCode) {
-      console.log(projectCode)
       Http.get(Api.TASK.GET_SIMPLE_DATAS_BY_PROJECT.replace('{projectCode}', projectCode)).then((res) => {
         this.tasks = res.data
         this.searchTasks = res.data
-        if (!this.firstSelectedTaskCode) {
+        this.selectedTaskData = this.searchTasks.find(task => task.code === this.selectedTaskCode)
+        if (!this.selectedTaskData) {
           this.selectedTaskData = this.tasks[0]
           this.selectedTaskCode = this.selectedTaskData.code
-        } else {
-          this.firstSelectedTaskCode = ''
-          this.selectedTaskData = this.searchTasks.find(task => task.code === this.selectedTaskCode)
         }
       }).catch((error) => {
         notify('error', '获取任务列表数据失败:系统异常')

+ 6 - 3
src/components/task/Task.vue

@@ -232,7 +232,7 @@
               <el-button v-if="taskOperationControl.testCaseExam" type="primary" size="mini" @click="toTestCasesExam()">
                 众测审核
               </el-button>
-              <el-button v-if="taskOperationControl.taskDemonstrate" type="success" size="mini" @click="gotoDataboard()">
+              <el-button v-if="taskOperationControl.testCaseExam" type="success" size="mini" @click="gotoTaskStatistics()">
                 任务面板
               </el-button>
               <!--<div class="btn btn-small btn-info"-->
@@ -464,8 +464,11 @@ export default {
   },
   methods: {
     //跳转到任务对应的数据面板
-    gotoDataboard(){
-      window.open(this.task.endPoint.token)
+    gotoTaskStatistics () {
+      this.$router.push({
+        name: 'TaskStatisticsPage',
+        params: {projectCode: this.projectId, taskCode: this.taskId}
+      })
     },
     //根据短链接获取生成databoard
     getTaskDataBoard(){

+ 0 - 131
src/pages/Statistics/TaskStatistics_bak.vue

@@ -1,131 +0,0 @@
-<template>
-  <div>
-    <el-row :gutter="24">
-      <el-col :span="5">
-        <el-card>
-          <p slot="header">参与人数</p>
-          <div>
-            <p><span class="card-big-font">11</span></p>
-            <!--          <p style="font-size: 14px;padding-top: 10px;">-->
-            <!--            总销售量-->
-            <!--            <span class="card-span-color"><span>2,029台</span><el-icon type="md-trending-up" /></span>-->
-            <!--          </p>-->
-          </div>
-        </el-card>
-      </el-col>
-      <el-col :span="5">
-        <el-card>
-          <p slot="header">用例数量</p>
-          <div>
-            <p><span class="card-big-font">400</span></p>
-          </div>
-        </el-card>
-      </el-col>
-      <el-col :span="5">
-        <el-card>
-          <p slot="header">缺陷数量</p>
-          <div>
-            <p><span class="card-big-font">310</span></p>
-          </div>
-        </el-card>
-      </el-col>
-      <el-col :span="5">
-        <el-card>
-          <p slot="header">覆盖率评估</p>
-          <div>
-            <p><span class="card-big-font">54.63 %</span></p>
-          </div>
-        </el-card>
-      </el-col>
-      <el-col :span="4">
-        <el-card>
-          <p slot="header">完成度评估</p>
-          <div>
-            <p><span class="card-big-font">100 %</span></p>
-          </div>
-        </el-card>
-      </el-col>
-    </el-row>
-    <el-row :gutter="24" style="margin-top: 10px;">
-      <el-col :span="5">
-        <el-card>
-          <p slot="header">任务基本信息</p>
-          <div>
-            <el-form label-position="right" label-width="100px">
-              <el-form-item label="任务编号:">
-                TASK11111111
-              </el-form-item>
-              <el-form-item label="任务名称:">
-                基于鲲鹏生态的表达能力评测系统众测-GNCS
-              </el-form-item>
-              <el-form-item label="所属项目:">
-                PROJ11111111
-              </el-form-item>
-              <el-form-item label="所属公司:">
-                XXXXXXXXXXXXXXXXXXXXXXX公司
-              </el-form-item>
-              <el-form-item label="开始时间:">
-                2022-04-13
-              </el-form-item>
-              <el-form-item label="结束时间:">
-                2022-06-15
-              </el-form-item>
-              <el-form-item label="任务状态:">
-                执行中
-              </el-form-item>
-            </el-form>
-          </div>
-        </el-card>
-      </el-col>
-      <el-col :span="14">
-        <el-card>
-        </el-card>
-      </el-col>
-      <el-col :span="5">
-        <el-card>
-        </el-card>
-      </el-col>
-    </el-row>
-  </div>
-</template>
-
-<script>
-export default {
-  name: 'TaskStatistics'
-}
-</script>
-
-<style scoped>
-  .card-big-font {
-    font-size: 36px;
-    color: #666;
-    line-height: 36px;
-    padding: 5px 0 10px;
-    text-overflow: ellipsis;
-    word-break: break-all;
-    white-space: nowrap;
-    margin-bottom: 5px;
-  }
-
-  .card-span-color {
-    position: absolute;
-    right: 15px;
-  }
-</style>
-<style>
-  .el-card__header {
-    padding-top: 2px;
-    padding-bottom: 2px;
-  }
-  .el-card__body {
-    padding-top: 3px;
-    padding-bottom: 3px;
-  }
-  .el-row {
-    margin-left: 0px!important;
-    margin-right: 0px!important;;
-  }
-  label {
-    font-weight: 700;
-  }
-</style>

+ 1 - 0
src/router/index.js

@@ -507,6 +507,7 @@ export default new Router({
       component: resolve => require(['@/pages/login/login.vue'], resolve)
     },
     {
+      name: 'TaskStatisticsPage',
       path: '/taskstatistics/:projectCode/:taskCode',
       component: resolve => require(['@/pages/Statistics/TaskStatistics.vue'], resolve)
     },