Browse Source

Merge branch 'master' into 'feature-2.0'

Master

See merge request crowd-2019/crowd-test-service-front!147
郭超 4 years ago
parent
commit
7269d75351

+ 0 - 14
src/components/report/ReportList.vue

@@ -1,20 +1,6 @@
 <template>
   <div class="report-container">
-    <!-- <el-row :gutter="2" v-for="report,index in reportList" :key="index">
-      <el-col :span="6">
-        <span>{{report.name}}</span>
-      </el-col>
-      <el-col :span="10">
-        <span>{{report.file}}</span>
-      </el-col>
-    </el-row>-->
-
     <el-table :showHeader="true" :data="reportList" style="width: 100%">
-<!--      <el-table-column-->
-<!--        prop="userName"-->
-<!--        label="提交用户"-->
-<!--      >-->
-<!--      </el-table-column>-->
       <el-table-column
         prop="name"
         label="报告名称"

+ 24 - 0
src/components/task/Task.vue

@@ -137,6 +137,20 @@
           <!--<div class="btn btn-small" @click="resetForm()">重置</div>-->
           <div class="btn btn-small" @click="cancelMode()">取消</div>
         </el-form-item>
+
+        <el-form-item v-if="editShortLink && task.endPoint.serverCode && taskOperationControl.confirmFinish" label="报告短链接" props="shortLink">
+          <el-input v-model="shortLink" placeholder="请输入短链接生成任务报告" style="width: 400px">
+            <template slot="append">
+              <el-button onClick="getTaskDataBoard()">点击生成</el-button>
+            </template>
+          </el-input>
+        </el-form-item>
+
+        <el-form-item v-if="!editShortLink && task.endPoint.serverCode && taskOperationControl.confirmFinish">
+          {{task.endPointVO&&task.endPointVO.token}}
+          <i class="el-icon-edit" @click="this.editShortLink = !this.editShortLink"/>
+        </el-form-item>
+
         <el-form-item v-if="!isModifyMode">
           <el-button size="mini" @click="toProject()">项目详情</el-button>
           <el-popover
@@ -380,6 +394,8 @@
           datetime: [{required: true, message: '截止时间不可为空', trigger: 'blur'}],
         },
         acceptedUserList: [],
+        shortLink:'',
+        editShortLink:true
       }
     },
     watch: {
@@ -415,6 +431,13 @@
       })
     },
     methods: {
+      //根据短链接获取生成databoard
+      getTaskDataBoard(){
+        Http.get(`/api/project/${this.projectId}/task/${this.taskId}/addToken/${this.shortLink}`).then((res)=>{
+          console.log(res);
+
+        })
+      },
       getServiceByCode(code){
         let serviceName = this.serviceType.filter((item) => {
           return item.code === code;
@@ -547,6 +570,7 @@
         this.handleFormatReport(this.acceptedUserList);
         this.handleTestTypeChange(res.crowdTaskVO.serviceType);
         this.serviceName = this.getServiceByCode(res.crowdTaskVO.serviceType);
+        this.shortLink = res.crowdTaskVO.endPointVO && res.crowdTaskVO.endPointVO.token
       },
       //获取任务详情失败时回调函数
       getTaskDetailFail(error) {

+ 1 - 1
src/pages/Statistics/StatisticsReport.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="statistics-container container">
-    <el-card shadow="hover" class="project-statistics-card" v-for="item in agencyList">
+    <el-card shadow="hover" class="project-statistics-card" v-for="item in agencyList" :key="item.id">
       <div class="project-statistics-card-title">{{Object.keys(item)[0]}}</div>
       <div class="project-statistics-card-number">{{item[Object.keys(item)[0]]}}</div>
     </el-card>

+ 91 - 0
src/pages/Technology/CrowdCase.vue

@@ -0,0 +1,91 @@
+<template>
+  <div class="technology-card">
+    <div class="card-wrapper" v-if="caseList&&caseList.length">
+      <el-card  v-for="item in caseList" :key="item.id"  style="margin-bottom: 15px">
+        <el-row>
+          <el-col :span="21">
+            <div class="technology-title">
+              {{item.title}}
+              <el-tag :type="item.statusVO&&item.statusVO.style" size="medium" class="case-status">{{item.statusVO&&item.statusVO.text}}</el-tag>
+              <el-tag :type="item.fullStatusVO&&item.fullStatusVO.style" size="medium" class="case-status">{{item.fullStatusVO&&item.fullStatusVO.text}}</el-tag>
+            </div>
+            <div class="technology-info">
+              任务描述:{{item.description}}
+            </div>
+            <div class="technology-info">
+              发布时间:{{$moment(item.createTime).format('YYYY-MM-DD HH:mm:ss')}}
+            </div>
+            <div class="technology-info">
+              截至时间:{{$moment(item.dateTime).format('YYYY-MM-DD HH:mm:ss')}}
+            </div>
+          </el-col>
+
+          <el-col :span="3">
+            <div @click="gotoDetail(item)">
+              <span style="font-size: 14px">查看详情</span>
+              <i class="el-icon-arrow-right get-info-btn"></i>
+            </div>
+          </el-col>
+        </el-row>
+      </el-card>
+    </div>
+    <div v-else>
+      暂无内容
+    </div>
+  </div>
+</template>
+
+<script>
+  export default {
+    name: 'CrowdTool',
+    props:['caseList'],
+    methods:{
+      gotoDetail(item){
+        // item.chineseBrief ? window.open(item.chineseBrief) : null
+      }
+    }
+  }
+</script>
+
+<style scoped lang="less">
+  .technology-card {
+    .card-wrapper {
+      .technology-img {
+        width: 100%;
+        height: 130px;
+      }
+      .technology-title{
+        font-size:22px;
+        font-family:Source Han Sans CN;
+        font-weight:500;
+        color:rgba(0,0,0,1);
+        line-height: 30px;
+        .case-status {
+          line-height: 30px;
+          margin-left: 10px;
+        }
+      }
+      .technology-info {
+        font-size:16px;
+        font-family:Source Han Sans CN;
+        font-weight:400;
+        color:rgba(0,0,0,1);
+        margin: 10px 0
+      }
+    }
+    .get-info-btn {
+      display: inline-block;
+      color: white;
+      background-color: #0076cb;
+      border-radius: 50%;
+      width: 18px;
+      height: 18px;
+      margin-left: 5px;
+      font-size: 16px;
+
+      i {
+        margin: 1px;
+      }
+    }
+  }
+</style>

+ 99 - 0
src/pages/Technology/CrowdTool.vue

@@ -0,0 +1,99 @@
+<template>
+  <div class="technology-card">
+    <div class="card-wrapper" v-if="toolList&&toolList.length">
+      <el-card v-for="item in toolList" :key="item.id" style="margin-bottom: 15px">
+        <el-row>
+          <el-col :span="6">
+            <img :src="item.photoUrl" alt="tool-img" class="pull-left technology-img">
+          </el-col>
+          <el-col :span="15" class="technology-detail">
+            <div class="technology-title">
+              {{item.name}}
+            </div>
+            <div class="technology-info">
+              <div>简介:{{item.description}}</div>
+              <div>开发:{{item.owner}}</div>
+            </div>
+          </el-col>
+          <el-col :span="3">
+            <div @click="gotoDetail(item)">
+              <span style="font-size: 14px">查看详情</span>
+              <i class="el-icon-arrow-right get-info-btn"></i>
+            </div>
+          </el-col>
+        </el-row>
+      </el-card>
+    </div>
+    <div v-else>
+      暂无内容
+    </div>
+  </div>
+</template>
+
+<script>
+  import Http from '@/js/http.js'
+
+  export default {
+    name: 'CrowdTool',
+    props: ['toolList'],
+    methods: {
+      gotoDetail(item) {
+        window.open(item.linkUrl);
+      }
+    }
+  }
+</script>
+
+<style scoped lang="less">
+  .technology-card {
+    .card-wrapper {
+      .technology-img {
+        width: 100%;
+        height: 130px;
+      }
+
+      .technology-detail {
+        padding-left: 15px;
+        height: 130px;
+        display: flex;
+        flex-direction: column;
+        justify-content: space-between;
+
+        .technology-title {
+          cursor: pointer;
+          font-size: 22px;
+          font-family: Source Han Sans CN;
+          font-weight: 500;
+          color: rgba(0, 0, 0, 1);
+        }
+
+        .technology-info {
+          font-size: 16px;
+          font-family: Source Han Sans CN;
+          font-weight: 400;
+          color: rgba(0, 0, 0, 1);
+          div {
+            white-space: nowrap;
+            overflow: hidden;
+            text-overflow: ellipsis;
+          }
+        }
+      }
+
+      .get-info-btn {
+        display: inline-block;
+        color: white;
+        background-color: #0076cb;
+        border-radius: 50%;
+        width: 18px;
+        height: 18px;
+        margin-left: 5px;
+        font-size: 16px;
+
+        i {
+          margin: 1px;
+        }
+      }
+    }
+  }
+</style>

+ 43 - 21
src/pages/Technology/Technology2.0.vue

@@ -12,12 +12,12 @@
         <el-col :span="12">
           <div class="search-nav">
             <div id="search-block " class="">
-                <el-tabs v-model="searchType" type="card" @tab-click="handleTypeClick">
-                  <el-tab-pane v-for="item in searchTypeArr" :label="item.label" :name="item.value" :key="item.value"></el-tab-pane>
-                </el-tabs>
-                <el-input placeholder="请输入内容" v-model="searchVal" class="input-with-select">
-                  <el-button class="search-button" slot="append"  type="primary" @click="loadTechnologyArticles(1)">搜索</el-button>
-                </el-input>
+              <el-tabs v-model="searchType" type="card" @tab-click="handleTypeClick">
+                <el-tab-pane v-for="item in searchTypeArr" :label="item.label" :name="item.value" :key="item.value"></el-tab-pane>
+              </el-tabs>
+              <el-input placeholder="请输入内容" v-model="searchVal" class="input-with-select">
+                <el-button class="search-button" slot="append"  type="primary" @click="loadTechnologyArticles(1)">搜索</el-button>
+              </el-input>
             </div>
           </div>
         </el-col>
@@ -37,6 +37,12 @@
     <div class="container" style="margin: 15px auto">
       <el-row>
         <el-col :span="18" class="project-task">
+          <CrowdTool
+            :toolList = techArticleList.content v-if="searchType=='2'">
+          </CrowdTool>
+          <CrowdCase
+            :caseList = techArticleList.content v-if="searchType=='3'" @refreshList="loadTechnologyArticles(activePage)">
+          </CrowdCase>
           <TechnologyCard
             :techArticleList = techArticleList.content v-if="searchType=='0'" @refreshList="loadTechnologyArticles(activePage)">
           </TechnologyCard>
@@ -66,6 +72,8 @@
   import SearchBar from '../../components/commons/SearchBar'
   import TechnologyCard from './TechnologyCard'
   import TechnologyMG from './TechnologyMG'
+  import CrowdCase from './CrowdCase'
+  import CrowdTool from './CrowdTool'
   import HotActicle from './HotActicle'
   import PopularProject from '../Square/PopularProject'
   import {storageGet} from '@/js/index.js'
@@ -78,16 +86,28 @@
       TechnologyCard,
       TechnologyMG,
       PopularProject,
-      HotActicle
+      HotActicle,
+      CrowdCase,
+      CrowdTool
     },
     data(){
       return {
         loading: false,
         isLogin: false,
         searchVal: '',
-        searchType:'',
+        searchType:'2',
         searchTypeArr:[
           {
+            "name": "众测工具",
+            "value": "2",
+            "label":'工具'
+          },
+          {
+            "name": "众测案例",
+            "value": "3",
+            "label":'案例'
+          },
+          {
             "name": "技术文章",
             "value": "0",
             "label":'文章'
@@ -115,7 +135,6 @@
       },
       checkCreateProjectAuth() {
         if (!this.isLogin) {
-          console.log("请登录后访问");
           notify('warning', '请登录后访问');
         } else if (this.isLogin) {
           Http.get(Apis.USER.IS_PART.replace('{userId}', this.user.id)).then((res) => {
@@ -143,8 +162,6 @@
         })
       },
       loadTechnologyArticles(index){
-        // let url=`/api/technical/articles?searchCondition={"keyword":"${this.keyword}","activePage":${this.activePage}}`;
-        // Http.get(encodeURI(url))
         let url = '/api/technical/articles';
         this.activePage = index;
         let params = {
@@ -157,18 +174,23 @@
               "enums": this.searchTypeArr,
               "value": this.searchType//展示技术文章value为0
             }
-          ]
-        }
+          ],
+          "sortType":(this.searchType === '2' ||  this.searchType === '3' ) ? 'id' : 'publicTime'
+        };
         Http.post(url,params)
           .then(res=>{
-            if(res.data.technicalArticlesPage){
-              this.techArticleList = res.data.technicalArticlesPage;
-              this.searchType = '0';
-            }
-            else if(res.data.publicationsPage){
-              this.techArticleList = res.data.publicationsPage;
-              this.searchType = '1';
-            }
+            let { technicalArticlesPage , publicationsPage ,toolVOPage,taskVOS} = res.data;
+            this.techArticleList = technicalArticlesPage || publicationsPage || toolVOPage || taskVOS;
+            console.log(res.data)
+          //   if(res.data.technicalArticlesPage){
+          //     this.techArticleList = res.data.technicalArticlesPage;
+          //   }else if(res.data.publicationsPage){
+          //     this.techArticleList = res.data.publicationsPage;
+          //   }else if(res.data.toolVOPage){
+          //     this.techArticleList = res.data.toolVOPage;
+          //   } else if(res.data.taskVOS){
+          //     this.techArticleList = res.data.taskVOS
+          //   }
           })
       },
       handlePageChange(index){