Browse Source

Merge branch 'Test' into 'master'

Test

See merge request crowd-2019/crowd-test-service-front!150
郭超 4 years ago
parent
commit
b70c92c5ed

+ 15 - 4
build/webpack.prod.conf.js

@@ -33,20 +33,31 @@ const webpackConfig = merge(baseWebpackConfig, {
       'process.env': env
     }),
     new UglifyJsPlugin({
+      // uglifyOptions: {
+      //   compress: {
+      //     warnings: false
+      //   }
+      // },
+      // sourceMap: config.build.productionSourceMap,
+      // parallel: true
+      parallel: 4,
       uglifyOptions: {
+        output: {
+          comments: false,
+          beautify: false,
+        },
         compress: {
           warnings: false
-        }
+        },
       },
-      sourceMap: config.build.productionSourceMap,
-      parallel: true
+      cache: true,
     }),
     // extract css into its own file
     new ExtractTextPlugin({
       filename: utils.assetsPath('css/[name].[contenthash].css'),
       // Setting the following option to `false` will not extract CSS from codesplit chunks.
       // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack.
-      // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, 
+      // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`,
       // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110
       allChunks: true,
     }),

+ 34 - 12
src/components/task/Task.vue

@@ -138,17 +138,17 @@
           <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">
+        <el-form-item v-if="editShortLink && task.endPoint.serverCode && taskOperationControl.confirmFinish" label="任务面板链接" props="shortLink">
+          <el-input v-model="shortLink" placeholder="请输入短链接生成任务报告" style="width: 800px">
             <template slot="append">
-              <el-button onClick="getTaskDataBoard()">点击生成</el-button>
+              <el-button @click="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 v-if="(!editShortLink) && shortLink" label="任务面板链接" props="shortLink">
+          {{shortLink}}
+          <i class="el-icon-edit" @click="editShortLink = !editShortLink"/>
         </el-form-item>
 
         <el-form-item v-if="!isModifyMode">
@@ -205,6 +205,9 @@
           <el-button v-if="taskOperationControl.uploadReport" type="primary" size="mini" @click="toCreateReport()">
             上传报告
           </el-button>
+          <el-button v-if="taskOperationControl.taskDemonstrate" type="success" size="mini" @click="gotoDataboard()">
+            任务面板
+          </el-button>
           <!--<div class="btn btn-small btn-info"-->
           <!--v-if="taskOperationControl.confirmFinish"-->
           <!--@click="endTask()">确认结束-->
@@ -317,6 +320,7 @@
           description: '',
           endPoint: {
             serverCode: '',
+            token: ''
           }
         },
         reportList: [],
@@ -395,7 +399,7 @@
         },
         acceptedUserList: [],
         shortLink:'',
-        editShortLink:true
+        editShortLink:true,
       }
     },
     watch: {
@@ -431,11 +435,21 @@
       })
     },
     methods: {
+      //跳转到任务对应的数据面板
+      gotoDataboard(){
+        window.open(this.task.endPoint.token)
+      },
       //根据短链接获取生成databoard
       getTaskDataBoard(){
-        Http.get(`/api/project/${this.projectId}/task/${this.taskId}/addToken/${this.shortLink}`).then((res)=>{
-          console.log(res);
-
+        this.showLoading()
+        Http.put(`/api/project/${this.projectId}/task/${this.taskId}/addToken`,{"token":this.shortLink}).then((res)=>{
+          this.taskOperationControl = res.taskOperationControl;
+          this.task.endPoint = res.crowdTaskVO.endPointVO;
+          this.shortLink = res.crowdTaskVO.endPointVO.token;
+          if(this.shortLink != ''){
+            this.editShortLink = false;
+          }
+          this.hideLoading()
         })
       },
       getServiceByCode(code){
@@ -543,6 +557,7 @@
       //获取任务详情成功时回调函数
       getTaskDetailSuccess(res) {
         this.hideLoading()
+        // console.log(res)
         this.taskId = res.crowdTaskVO.id
         this.projectId = res.crowdTaskVO.projectId
         this.task.title = res.crowdTaskVO.title
@@ -564,13 +579,20 @@
         this.task.endPoint = res.crowdTaskVO.endPointVO ? res.crowdTaskVO.endPointVO : {
           serverCode: '',
         }
-        this.taskOperationControl = res.taskOperationControl
+        this.taskOperationControl = res.taskOperationControl;
         this.acceptedUserList = res.acceptedUserList;
         this.crowdReportUrl = res.crowdTaskVO.writeReportUrl;
         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
+        if(res.crowdTaskVO.endPointVO){
+          if(res.crowdTaskVO.endPointVO.token){
+            this.shortLink = res.crowdTaskVO.endPointVO.token
+          }
+        }
+        // console.log(res.crowdTaskVO.endPointVO.token)
+        // console.log(this.editShortLink)
+        // console.log(this.isModifyMode)
       },
       //获取任务详情失败时回调函数
       getTaskDetailFail(error) {

+ 1 - 1
src/pages/HomepageSearch/ExpertList.vue

@@ -164,7 +164,7 @@
         let url = '/api/common/index/page';
         let params = {
           "keyword": this.searchVal,
-          "activePage": 1,
+          "activePage": this.activePage,
           "columnFilters": [
             {
               "field": "type",

+ 3 - 3
src/pages/Technology/CrowdCase.vue

@@ -6,8 +6,8 @@
           <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>
+<!--              <el-tag :type="item.statusVO&&item.statusVO.style" size="medium" class="case-status">{{item.statusVO&&item.statusVO.text}}</el-tag>-->
+              <el-tag size="medium" class="case-status">{{item.serviceType}}</el-tag>
             </div>
             <div class="technology-info">
               任务描述:{{item.description}}
@@ -41,7 +41,7 @@
     props:['caseList'],
     methods:{
       gotoDetail(item){
-        // item.chineseBrief ? window.open(item.chineseBrief) : null
+        window.open(item.endPointVO.token)
       }
     }
   }

+ 13 - 2
src/pages/Technology/Technology2.0.vue

@@ -34,7 +34,7 @@
       <div>
       </div>
     </div>
-    <div class="container" style="margin: 15px auto">
+    <div class="container" style="margin: 15px auto" v-loading="loading">
       <el-row>
         <el-col :span="18" class="project-task">
           <CrowdTool
@@ -144,6 +144,15 @@
           })
         }
       },
+
+      //显示页面加载画面
+      showLoading() {
+        this.loading = true
+      },
+      //隐藏页面加载画面
+      hideLoading() {
+        this.loading = false
+      },
       gotoHome(){
         this.$router.push('/home');
       },
@@ -162,6 +171,7 @@
         })
       },
       loadTechnologyArticles(index){
+        this.showLoading()
         let url = '/api/technical/articles';
         this.activePage = index;
         let params = {
@@ -181,7 +191,8 @@
           .then(res=>{
             let { technicalArticlesPage , publicationsPage ,toolVOPage,taskVOS} = res.data;
             this.techArticleList = technicalArticlesPage || publicationsPage || toolVOPage || taskVOS;
-            console.log(res.data)
+            // console.log(res.data)
+            this.hideLoading()
           //   if(res.data.technicalArticlesPage){
           //     this.techArticleList = res.data.technicalArticlesPage;
           //   }else if(res.data.publicationsPage){