Browse Source

样式修改,准备更新api为token方式获取

wangJJ 4 years ago
parent
commit
bf641b9a6d

+ 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) {

+ 56 - 40
src/pages/Technology/CrowdCase.vue

@@ -1,18 +1,29 @@
 <template>
   <div class="technology-card">
-    <div class="card-wrapper" v-if="true">
-      <el-card  v-for="item in [1,2,3]" :key="item"  style="margin-bottom: 15px">
-        <el-row >
-          <el-col :span="6">
-            <img :src="item.photoUrl" alt="technology-img" class="pull-left technology-img">
-          </el-col>
-          <el-col :span="18" class="technology-detail">
-            <div class="technology-title" @click="gotoDetail(item)">
-              众测知识图谱辅助生成工具
+    <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">
-              <div>简介:xxxxx</div>
-              <div>开发:课题一</div>
+              截至时间:{{$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>
@@ -25,19 +36,13 @@
 </template>
 
 <script>
-  import Http from '@/js/http.js'
-
   export default {
-    name: 'CrowdCase',
-    // props:['caseList'],
+    name: 'CrowdTool',
+    props:['caseList'],
     methods:{
-      // gotoDetail(item){
-      //   //增加访问量
-      //   Http.get(`/api/technical/updateranking/${item.id}`).then(()=>{
-      //     this.$emit('refreshList');
-      //     window.open(item.articlesUrl);
-      //   })
-      // }
+      gotoDetail(item){
+        // item.chineseBrief ? window.open(item.chineseBrief) : null
+      }
     }
   }
 </script>
@@ -49,27 +54,38 @@
         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);
+      .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>

+ 8 - 2
src/pages/Technology/CrowdTool.vue

@@ -1,13 +1,13 @@
 <template>
   <div class="technology-card">
-    <div class="card-wrapper" v-if="true">
+    <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" >
+            <div class="technology-title">
               {{item.name}}
             </div>
             <div class="technology-info">
@@ -72,6 +72,11 @@
           font-family: Source Han Sans CN;
           font-weight: 400;
           color: rgba(0, 0, 0, 1);
+          div {
+            white-space: nowrap;
+            overflow: hidden;
+            text-overflow: ellipsis;
+          }
         }
       }
 
@@ -84,6 +89,7 @@
         height: 18px;
         margin-left: 5px;
         font-size: 16px;
+
         i {
           margin: 1px;
         }

+ 19 - 18
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>
@@ -41,7 +41,7 @@
             :toolList = techArticleList.content v-if="searchType=='2'">
           </CrowdTool>
           <CrowdCase
-            :toolList = techArticleList.content v-if="searchType=='3'" @refreshList="loadTechnologyArticles(activePage)">
+            :caseList = techArticleList.content v-if="searchType=='3'" @refreshList="loadTechnologyArticles(activePage)">
           </CrowdCase>
           <TechnologyCard
             :techArticleList = techArticleList.content v-if="searchType=='0'" @refreshList="loadTechnologyArticles(activePage)">
@@ -175,21 +175,22 @@
               "value": this.searchType//展示技术文章value为0
             }
           ],
-          "sortType":this.searchType === '2' ? 'id' :null
+          "sortType":(this.searchType === '2' ||  this.searchType === '3' ) ? 'id' : 'publicTime'
         };
         Http.post(url,params)
           .then(res=>{
+            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;
-              // this.searchType = '0';
-            }
-            else if(res.data.publicationsPage){
-              this.techArticleList = res.data.publicationsPage;
-              // this.searchType = '1';
-            }else if(res.data.toolVOPage){
-              this.techArticleList = res.data.toolVOPage;
-            }
+          //   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){