Prechádzať zdrojové kódy

Merge branch 'dev-online' into 'PrivateReleaseOfXC'

Dev online

See merge request crowd-2019/crowd-test-service-front!203
郭超 4 rokov pred
rodič
commit
5c37b075ce

BIN
dist.zip


+ 40 - 35
src/components/Mine.vue

@@ -10,7 +10,7 @@
         <div class="project-statistics-card-title">已完成任务数</div>
         <div class="project-statistics-card-number">{{ statisticData.finishedTaskCount || 0 }}</div>
       </el-card>
-      <el-card shadow="hover" v-if="showCreateData" class="project-statistics-card">
+      <el-card shadow="hover" class="project-statistics-card">
         <div class="project-statistics-card-title">我的项目数</div>
         <div class="project-statistics-card-number">{{ statisticData.myProjectCount || 0 }}</div>
       </el-card>
@@ -27,9 +27,9 @@
       <el-tabs value="myProject" @tab-click="handleTabClick" v-loading="loading" style="width: 90%;margin-left: 5%">
         <el-tab-pane name="unFinishedTask">
           <span slot="label">
-            <el-badge v-if="unfinishedTaskNoticeCount>0" :value="unfinishedTaskNoticeCount" class="item"
+            <el-badge v-if="unfinishedTaskNoticeCount>0 && showAcceptData" :value="unfinishedTaskNoticeCount" class="item"
                       style="height:auto; margin-top: 10px;margin-bottom: 25px; font-size: 16px;">未完成任务</el-badge>
-             <el-badge v-if="unfinishedTaskNoticeCount==null || unfinishedTaskNoticeCount == 0" class="item"
+             <el-badge v-if="(unfinishedTaskNoticeCount==null || unfinishedTaskNoticeCount == 0) && showAcceptData" class="item"
                        style="margin-top: 10px;margin-bottom: 25px; font-size: 16px;">未完成任务</el-badge>
           </span>
           <el-row v-if="unFinishedTaskList != null && unFinishedTaskList.length != 0" type="flex" align="middle"
@@ -49,7 +49,7 @@
         </el-tab-pane>
         <el-tab-pane name="finishedTask">
           <span slot="label">
-            <el-badge class="item" style="margin-top: 10px;margin-bottom: 25px; font-size: 16px;">已完成任务</el-badge>
+            <el-badge v-if="showAcceptData" class="item" style="margin-top: 10px;margin-bottom: 25px; font-size: 16px;">已完成任务</el-badge>
           </span>
           <el-row v-if="finishedTaskList != null && finishedTaskList.length != 0" type="flex" align="middle"
                   justify="center" style="font-size: 14px;">
@@ -90,9 +90,9 @@
         </el-tab-pane>
         <el-tab-pane name="handlingProject">
           <span slot="label">
-            <el-badge v-if="processProjectNoticeCount>0" :value="processProjectNoticeCount" class="item"
+            <el-badge v-if="processProjectNoticeCount>0 && showCreateData" :value="processProjectNoticeCount" class="item"
                       style="margin-top: 10px;margin-bottom: 25px; font-size: 16px;">处理中项目</el-badge>
-            <el-badge v-if="processProjectNoticeCount==null || processProjectNoticeCount==0" class="item"
+            <el-badge v-if="(processProjectNoticeCount==null || processProjectNoticeCount==0) && showCreateData" class="item"
                       style="margin-top: 10px;margin-bottom: 25px; font-size: 16px;">处理中项目</el-badge>
           </span>
           <el-row v-if="handlingProjects != null && handlingProjects.length != 0" type="flex" align="middle"
@@ -111,9 +111,9 @@
         </el-tab-pane>
         <el-tab-pane name="acceptableProject">
           <span slot="label">
-            <el-badge v-if="acceptableProjectNoticeCount>0" :value="acceptableProjectNoticeCount" class="item"
+            <el-badge v-if="acceptableProjectNoticeCount>0 && showCreateData" :value="acceptableProjectNoticeCount" class="item"
                       style="margin-top: 10px;margin-bottom: 25px; font-size: 16px;">可接收项目</el-badge>
-            <el-badge v-if="acceptableProjectNoticeCount==null || acceptableProjectNoticeCount==0" class="item"
+            <el-badge v-if="(acceptableProjectNoticeCount==null || acceptableProjectNoticeCount==0) && showCreateData" class="item"
                       style="margin-top: 10px;margin-bottom: 25px; font-size: 16px;">可接收项目</el-badge>
           </span>
           <el-row v-if="acceptableProjects != null && acceptableProjects.length != 0" type="flex" align="middle"
@@ -216,6 +216,8 @@
           }
         },
         isLogin: false,
+        agency: false,
+        part: false,
         showCreateData: false,
         showAcceptData: false,
         taskJson:[]
@@ -224,8 +226,8 @@
     mounted() {
       this.$nextTick(() => {
         this.init();
-        this.checkCreateProjectAuth();
-        this.checkAcceptTaskAuth()
+        // this.checkCreateProjectAuth();
+        // this.checkAcceptTaskAuth()
       })
     },
     methods: {
@@ -266,7 +268,9 @@
             this.acceptableProjects = res.acceptableProjects
           }
           this.canImportTask = res.canImportTask == null ? false : res.canImportTask;
-          console.log(this.canImportTask);
+          this.showCreateData = res.part;
+          this.showAcceptData = res.agency;
+          console.log(res);
           // if (res.userVO != null && res.userVO.length > 0) {
           //   this.user = res.userVO
           // }
@@ -403,30 +407,31 @@
         }
         console.log(event)
       },
-      //检查是否有发包权限
-      checkCreateProjectAuth() {
-        if (this.isLogin) {
-          Http.get(Apis.USER.IS_PART.replace('{userId}', this.user.userVO.id)).then((res) => {
-            if (res) {
-              this.showCreateData = true;
-            }
-          }).catch((error) => {
-            // notify('error', error)
-          })
-        }
-      },
-      //检查是否有接包权限
-      checkAcceptTaskAuth() {
-        if (this.isLogin) {
-          Http.get(Apis.USER.IS_AGENCY.replace('{userId}', this.user.userVO.id)).then((res) => {
-            if (res) {
-              this.showAcceptData = true;
-            }
-          }).catch((error) => {
-            // notify('error', error)
-          })
-        }
-      },
+
+      ////检查是否有发包权限
+      // checkCreateProjectAuth() {
+      //   if (this.isLogin) {
+      //     Http.get(Apis.USER.IS_PART.replace('{userId}', this.user.userVO.id)).then((res) => {
+      //       if (res) {
+      //         this.showCreateData = true;
+      //       }
+      //     }).catch((error) => {
+      //       // notify('error', error)
+      //     })
+      //   }
+      // },
+      // //检查是否有接包权限
+      // checkAcceptTaskAuth() {
+      //   if (this.isLogin) {
+      //     Http.get(Apis.USER.IS_AGENCY.replace('{userId}', this.user.userVO.id)).then((res) => {
+      //       if (res) {
+      //         this.showAcceptData = true;
+      //       }
+      //     }).catch((error) => {
+      //       // notify('error', error)
+      //     })
+      //   }
+      // },
     },
     created: function() {
 

+ 68 - 157
src/components/project/Project.vue

@@ -50,9 +50,11 @@
             <!--            <el-form-item v-if="!isModifyMode" size="small" label="状态" prop="status">-->
             <!--              <span v-if="!isModifyMode">{{project.statusVO?project.statusVO.text:''}}</span>-->
             <!--            </el-form-item>-->
-            <el-form-item size="small" label="区域管理员" prop="institution" v-if="project.institution">
-              <span v-if="!isModifyMode">{{project.institution}}</span>
+            <el-form-item size="small" label="区域管理员" prop="regionManagerName"
+                          v-if="!isModifyMode && project.regionManagerName">
+              <span>{{project.regionManagerName}}</span>
             </el-form-item>
+
             <el-form-item label="需求描述">
               <el-input style="width: 400px" autosize v-if="isModifyMode" type="textarea"
                         v-model="project.desc"></el-input>
@@ -67,7 +69,7 @@
             <el-form-item label="领域类型" prop="field">
               <el-radio-group v-if="isModifyMode" v-model="project.field">
                 <span v-for="(item,index) in fields" :key="index">
-              <el-radio :label="item.name" style="margin: 3px">{{ item.name }}&nbsp;&nbsp;&nbsp;&nbsp;</el-radio>
+              <el-radio :label="item.name">{{ item.name }}&nbsp;&nbsp;&nbsp;&nbsp;</el-radio>
             </span>
               </el-radio-group>
               <span
@@ -80,7 +82,7 @@
             <el-form-item label="应用类型" prop="platform">
               <el-radio-group v-if="isModifyMode" v-model="project.platform">
                 <span v-for="(item,index) in platforms" :key="index">
-              <el-radio :label="item.name" style="margin: 3px">{{ item.name }}&nbsp;&nbsp;&nbsp;&nbsp;</el-radio>
+              <el-radio :label="item.name">{{ item.name }}&nbsp;&nbsp;&nbsp;&nbsp;</el-radio>
             </span>
               </el-radio-group>
               <span
@@ -89,6 +91,7 @@
               >
               {{project.platform}}</span>
             </el-form-item>
+
             <el-form-item label="测试类型" prop="type">
               <el-checkbox-group v-if="isModifyMode" v-model="project.type">
             <span v-for="(item,index) in serviceType" :key="index">
@@ -111,13 +114,23 @@
               </div>
               <el-tabs :tab-position="tabPosition" v-model="project.resource" style="max-height: 200px;"
                        v-if="isModifyMode">
+
+                <!--                <el-tab-pane :label="resourceType[0]" :name="0">-->
+                <!--                  <el-radio-group v-model="project.institution">-->
+                <!--                    <span v-for="(item,index) in institutionArray" :key="index">-->
+                <!--                      <el-radio :label="item.id" name="type" style="margin: 3px">{{ item.name }}&nbsp;&nbsp;&nbsp;&nbsp;</el-radio>-->
+                <!--                    </span>-->
+                <!--                  </el-radio-group>-->
+                <!--                </el-tab-pane>-->
+
                 <el-tab-pane :label="resourceType[0]" :name="0">
                   <el-radio-group v-model="project.institution">
-                    <el-radio :label="item" name="type" v-for="(item,index) in institutionArray" :key="index">
+                    <el-radio v-for="(item,index) in institutionArray" :label="item.id" name="type" :key="index">
                       {{item.name}}
                     </el-radio>
                   </el-radio-group>
                 </el-tab-pane>
+
                 <el-tab-pane :label="resourceType[1]" :name="1">
                   <provincecity
                     ref="addFormProvince"
@@ -151,7 +164,7 @@
                   <em>点击上传</em>
                 </div>
               </el-upload>
-              <span >
+              <span>
             <a :href="project.requireDocUrl" v-if="project.requireDocUrl!=null && project.requireDocUrl!=''"><el-link
               :underline="false" type="primary"><i
               class="el-icon-document"></i>下载文档</el-link></a>
@@ -179,12 +192,12 @@
                   <em>点击上传</em>
                 </div>
               </el-upload>
-              <span v-if="!isModifyMode">
-            <a v-if="project.fileUrl!=null && project.fileUrl!=''" :href="project.fileUrl"><el-link :underline="false"
-                                                                                                    type="primary"><i
-              class="el-icon-document"></i>下载文件</el-link></a>
-            <i v-if="project.fileUrl==null || project.fileUrl==''" class="el-icon-document">暂无文件</i>
-          </span>
+              <span>
+                <a v-if="project.fileUrl!=null && project.fileUrl!=''" :href="project.fileUrl"><el-link :underline="false"
+                                                                                                        type="primary"><i
+                  class="el-icon-document"></i>下载文件</el-link></a>
+                <i v-if="project.fileUrl==null || project.fileUrl==''" class="el-icon-document">暂无文件</i>
+              </span>
             </el-form-item>
             <el-form-item label="委托单位" prop="entrustUnit" v-if="project.entrustUnit">
               <el-input style="width: 400px" autosize v-if="isModifyMode" type="textarea"
@@ -211,19 +224,12 @@
             </el-form-item>
             <el-form-item v-if="!isModifyMode">
 
-              <el-button v-if="projectOperationControl.confirmFinish" type="success" size="mini" @click="endProject()">
-                结束项目
-              </el-button>
-              <el-button v-if="projectOperationControl.finish" type="primary" size="mini"
-                         @click="submitProjectRequest()">
-                提交项目
+              <el-button v-if="projectOperationControl.reject" type="danger" size="mini" @click="rejectProject()">
+                拒绝项目
               </el-button>
               <el-button v-if="projectOperationControl.receive" type="primary" size="mini" @click="receiveProject()">
                 接收项目
               </el-button>
-              <el-button v-if="projectOperationControl.reject" type="danger" size="mini" @click="rejectProject()">
-                拒绝项目
-              </el-button>
               <el-button v-if="projectOperationControl.update" type="primary" size="mini" @click="modifyForm()">
                 修改项目
               </el-button>
@@ -233,6 +239,13 @@
               <el-button v-if="projectOperationControl.uploadReport" type="primary" size="mini" @click="createReport()">
                 上传报告
               </el-button>
+              <el-button v-if="projectOperationControl.finish" type="primary" size="mini"
+                         @click="submitProjectRequest()">
+                提交项目
+              </el-button>
+              <el-button v-if="projectOperationControl.confirmFinish" type="success" size="mini" @click="endProject()">
+                结束项目
+              </el-button>
             </el-form-item>
           </el-form>
 
@@ -260,7 +273,7 @@
             <template slot-scope="scope">
               <div v-if="scope.row.resource=='1'">{{scope.row.location.provinceCode}}/{{scope.row.location.cityCode}}
               </div>
-              <div v-if="scope.row.resource=='0'">{{scope.row.institution}}</div>
+              <div v-if="scope.row.resource=='0'">{{scope.row.agencyName}}</div>
               <div v-if="scope.row.resource=='2'">{{resourceType[scope.row.resource]}}</div>
             </template>
           </el-table-column>
@@ -376,6 +389,8 @@
           resource: '',
           location: '',
           institution: {},
+          regionManagerId: 0,
+          regionManagerName: '',
           contactName: '',
           contactPhone: '',
           doc: [],
@@ -386,7 +401,7 @@
           price: '',
           datetime: '',
           usage: '',
-          status: ''
+          status: '',
         },
         task: [],
         progress: [],
@@ -506,24 +521,6 @@
       institutionArray(val) {
         this.institutionArray = val
       },
-      // 'project.institution' () {
-      //   if (this.project.institution) {
-      //     //this.$refs.addFormProvince.resetProviceCity()
-      //     this.project.location = {provinceCode: '', cityCode: ''}
-      //   }
-      // },
-      // 'project.location' () {
-      //   if (this.project.location.provinceCode || this.project.location.cityCode) {
-      //     this.project.institution = ''
-      //   }
-      // },
-      // 'project.resource' () {
-      //   if (this.project.resource == '2') {
-      //     //this.$refs.addFormProvince.resetProviceCity()
-      //     this.project.institution = ''
-      //     this.project.location = {provinceCode: '', cityCode: ''}
-      //   }
-      // },
       deep: true
     },
     methods: {
@@ -547,10 +544,7 @@
       },
       init() {
         this.projectId = this.$route.params.projectId
-        this.setServiceType()
-        this.setFields()
-        this.setPlatformType()
-        this.setInstitutions()
+        // this.setInstitutions()
         this.setUserInfo()
         this.loadData()
         //this.reformDate(123)
@@ -620,7 +614,7 @@
               desc: this.project.desc,
               resource: this.project.resource,
               location: getProvinceNameByProvinceCode(this.project.location.provinceCode, this.project.location.cityCode),
-              institution: this.project.institution == null ? null : this.project.institution.id,
+              institution: this.project.institution == null ? null : this.project.institution,
               contactName: this.project.contactName,
               contactPhone: this.project.contactPhone,
               doc: this.project.requireDocUrl,
@@ -630,32 +624,13 @@
               datetime: this.project.datetime,
               usage: this.project.usage,
             }
-            console.log(newProject);
+            // console.log(newProject);
             Http.put(Apis.PROJECT.UPDATE_PROJECT.replace('{projectId}', this.projectId), newProject).then((res) => {
-              console.log(res)
-              this.projectId = res.projectDetails.id
-              this.project.name = res.projectDetails.name
-              this.project.contactName = res.projectDetails.contactName
-              this.project.contactPhone = res.projectDetails.contactPhone
-              this.project.type = res.projectDetails.type
-              this.project.platform = res.projectDetails.platform
-              this.project.valuationStandard = res.projectDetails.valuationStandard
-              this.project.entrustUnit = res.projectDetails.entrustUnit
-              this.project.field = res.projectDetails.field
-              this.project.desc = res.projectDetails.desc
-              this.project.doc = []
-              this.project.file = []
+              // console.log(res)
               this.project.resource = res.projectDetails.resource
               this.project.location = getProvinceCodeByProvinceName(res.projectDetails.location.provinceCode, res.projectDetails.location.cityCode)
-              this.project.institution = res.projectDetails.institution
               this.project.datetime = new Date(res.projectDetails.datetime)
-              this.project.price = res.projectDetails.price
-              this.project.budget = res.projectDetails.budget
-              this.project.usage = res.projectDetails.usage
-              this.project.fileUrl = res.projectDetails.file
-              this.project.requireDocUrl = res.projectDetails.doc
-              this.task = res.taskList
-              this.reportList = res.reportList
+              this.changeValue(res);
               this.isModifyMode = false
               this.hideLoading()
               notify('success', '项目修改成功')
@@ -670,6 +645,15 @@
           }
         })
       },
+      changeValue(res) {
+        this.project = res.projectDetails
+        this.projectId = res.projectDetails.id
+        this.project.fileUrl = res.projectDetails.file
+        this.project.requireDocUrl = res.projectDetails.doc
+        this.task = res.taskList
+        this.reportList = res.reportList
+        this.projectOperationControl = res.projectOperationControl
+      },
       //重置表单
       resetForm(formName) {
         this.$refs[formName].resetFields()
@@ -694,11 +678,14 @@
       //进入修改项目页面
       modifyForm() {
         this.isModifyMode = true
+        this.setServiceType()
+        this.setFields()
+        this.setPlatformType()
         // this.project.type = []
         // this.project.platform = ''
         // this.project.field = ''
         // console.log(this.project.doc)
-        //this.setInstitutions()
+        this.setInstitutions()
         //获得update 信息
         //this.loadData()
       },
@@ -710,7 +697,6 @@
           type: 'success'
         }).then(() => {
           this.showLoading()
-          console.log('接收项目')
           receiveProjectRequest(this.projectId, this.user.userVO.id, this.receiveProjectSuccess, this.receiveProjectFail)
         }).catch(() => {
         })
@@ -718,9 +704,7 @@
       receiveProjectSuccess(res) {
         this.hideLoading()
         notify('success', '项目接收成功!')
-        this.projectOperationControl = res.projectOperationControl
-        this.project.status = res.projectDetails.status
-        this.project.institution = res.projectDetails.institution
+        this.changeValue(res);
       },
       receiveProjectFail(error) {
         this.hideLoading()
@@ -742,12 +726,19 @@
       rejectProjectSuccess(res) {
         this.hideLoading()
         notify('success', '拒绝项目成功')
+        this.changeValue(res);
       },
       rejectProjectFail(error) {
         this.hideLoading()
         notify('error', '拒绝项目失败:' + error.data)
       },
       //提交项目
+      submitProjectRequestSuccess(res) {
+        this.hideLoading()
+        notify('success', '项目提交成功!')
+        this.loadData()
+        this.changeValue(res);
+      },
       submitProjectRequest() {
         this.$confirm('确认提交项目?', '提示', {
           confirmButtonText: '确认提交',
@@ -759,14 +750,6 @@
         }).catch(() => {
         })
       },
-      submitProjectRequestSuccess(res) {
-        this.hideLoading()
-        notify('success', '项目提交成功!')
-        this.loadData()
-        this.projectOperationControl = res.projectOperationControl
-        this.project.status = res.projectDetails.status
-        this.project.institution = res.projectDetails.institution
-      },
       submitProjectRequestFail(error) {
         this.hideLoading()
         notify('error', '提交项目失败:' + error.data)
@@ -788,9 +771,7 @@
         this.hideLoading()
         notify('success', '项目提交成功!')
         this.loadData()
-        this.projectOperationControl = res.projectOperationControl
-        this.project.status = res.projectDetails.status
-        this.project.institution = res.projectDetails.institution
+        this.changeValue(res);
       },
       endProjectFail(error) {
         this.hideLoading()
@@ -867,32 +848,15 @@
       handleReject(index, id) {
         console.log('拒绝')
       },
-      loadData() {//PROJ--2019073114009
+      loadData() {
         this.showLoading()
         Http.get(Apis.PROJECT.GET_PROJECT.replace('{projectId}', this.projectId)).then((res) => {
-          console.log(res)
-          console.log(typeof res.projectDetails.field)
-          this.projectId = res.projectDetails.id
-          this.project.name = res.projectDetails.name
-          this.project.contactName = res.projectDetails.contactName
-          this.project.contactPhone = res.projectDetails.contactPhone
-          this.project.type = res.projectDetails.type
-          this.project.platform = res.projectDetails.platform
-          this.project.valuationStandard = res.projectDetails.valuationStandard
-          this.project.entrustUnit = res.projectDetails.entrustUnit
-          this.project.field = res.projectDetails.field
-          console.log(res.projectDetails.field)
-          console.log(this.project.field)
           this.project.desc = res.projectDetails.desc
           this.project.doc = []
           this.project.file = []
           this.project.resource = res.projectDetails.resource
           this.project.location = getProvinceCodeByProvinceName(res.projectDetails.location.provinceCode, res.projectDetails.location.cityCode)
-          this.project.institution = res.projectDetails.institution
           this.project.datetime = new Date(res.projectDetails.datetime)
-          this.project.price = res.projectDetails.price
-          this.project.budget = res.projectDetails.budget
-          this.project.usage = res.projectDetails.usage
           this.project.fileUrl = res.projectDetails.file
           this.project.requireDocUrl = res.projectDetails.doc
           this.project.userId = res.projectDetails.userId
@@ -900,9 +864,8 @@
           this.project.statusVO = res.projectDetails.statusVO
           this.task = res.taskList
           this.reportList = res.reportList
-          this.projectOperationControl = res.projectOperationControl
           this.progress = res.progress
-          console.log(this.project)
+          this.changeValue(res);
           this.hideLoading()
           this.handleShowTaskListOrNot()
           for (var i = 0; i < this.progress.length; i++) {
@@ -936,7 +899,7 @@
         this.$message.warning(
           `当前限制选择 1 个文件,本次选择了 ${
             files.length
-            } 个文件,共选择了 ${files.length + fileList.length} 个文件`
+          } 个文件,共选择了 ${files.length + fileList.length} 个文件`
         )
       },
       beforeRemove(file, fileList) {
@@ -1061,55 +1024,3 @@
     width: 400px;
   }
 </style>
-
-
-<!--<div class="create-body" v-if="!isModifyMode">-->
-<!--<div class="title h2">分析需求</div>-->
-<!--<div class="task-list">-->
-<!--<el-table :data="analyseDemandList" style="width: 100%" max-height="400">-->
-<!--<el-table-column prop="institution" label="承接单位" title="承接单位"></el-table-column>-->
-<!--<el-table-column prop="feasibilityReport" sortable label="可行性分析报告">-->
-<!--<template slot-scope="scope">-->
-<!--<span v-if="!scope.row.feasibilityReport.url">暂无文件</span>-->
-<!--<a-->
-<!--:href="scope.row.feasibilityReport.url"-->
-<!--v-if="scope.row.feasibilityReport.url"-->
-<!--target="_blank"-->
-<!--&gt;-->
-<!--<i class="fa fa-file-text-o"></i>-->
-<!--{{scope.row.feasibilityReport.name}}-->
-<!--</a>-->
-<!--</template>-->
-<!--</el-table-column>-->
-<!--<el-table-column prop="priceAuditReport" sortable label="可行性分析报告">-->
-<!--<template slot-scope="scope">-->
-<!--<span v-if="!scope.row.priceAuditReport.url">暂无文件</span>-->
-<!--<a-->
-<!--:href="scope.row.priceAuditReport.url"-->
-<!--v-if="scope.row.priceAuditReport.url"-->
-<!--target="_blank"-->
-<!--&gt;-->
-<!--<i class="fa fa-file-text-o"></i>-->
-<!--{{scope.row.priceAuditReport.name}}-->
-<!--</a>-->
-<!--</template>-->
-<!--</el-table-column>-->
-
-<!--<el-table-column align="right" label="操作">-->
-<!--<template slot-scope="scope">-->
-<!--<div-->
-<!--class="btn btn-small btn-info"-->
-<!--@click="handleAccept(scope.$index, scope.row.id)"-->
-<!--&gt;接受-->
-<!--</div>-->
-<!--<div-->
-<!--class="btn btn-small btn-danger"-->
-<!--@click="handleReject(scope.$index, scope.row.id)"-->
-<!--&gt;拒绝-->
-<!--</div>-->
-<!--</template>-->
-<!--</el-table-column>-->
-<!--</el-table>-->
-<!--</div>-->
-<!--</div>-->
-

+ 1 - 1
src/components/report/ProjectReport.vue

@@ -48,7 +48,7 @@
             <div class="el-upload__tip" slot="tip">请上传报告文件</div>
           </el-upload>
           <div v-if="!isModifyMode">
-            <span v-if="report.fileUrl==null">暂无文件</span>
+            <span v-if="report.fileUrl==null"><i class="el-icon-document"></i>暂无文件</span>
             <a :href="report.fileUrl" v-if="report.fileUrl!=null">
               <el-link :underline="false" type="primary"><i class="el-icon-document"></i>下载文档</el-link>
             </a>

+ 3 - 3
src/components/report/ReportList.vue

@@ -12,9 +12,9 @@
       </el-table-column>
       <el-table-column prop="file" sortable label="报告文件">
         <template slot-scope="scope">
-          <span v-if="scope.row.content==null || scope.row.content==''">暂无文件</span>
-          <a :href="scope.row.file" v-if="scope.row.content!=null" target="_blank"><i
-            class="fa fa-file-text-o"></i> {{scope.row.content}}</a>
+          <span v-if="scope.row.file==null || scope.row.file==''"><i class="el-icon-document"></i>暂无文件</span>
+          <a :href="scope.row.file" v-else target="_blank"><el-link :underline="false" type="primary"><i
+            class="el-icon-document"></i>下载文档</el-link></a>
         </template>
       </el-table-column>
       <el-table-column align="right" label="操作">

+ 1 - 1
src/components/report/TaskReport.vue

@@ -46,7 +46,7 @@
             <div class="el-upload__tip" slot="tip">请上传报告文件</div>
           </el-upload>
           <div v-if="!isModifyMode">
-            <span v-if="report.fileUrl==null">暂无文件</span>
+            <span v-if="report.fileUrl==null"><i class="el-icon-document"></i>暂无文件</span>
             <a :href="report.fileUrl" v-if="report.fileUrl!=null">
               <el-link :underline="false" type="primary"><i class="el-icon-document"></i>下载文档</el-link>
             </a>

+ 281 - 166
src/components/task/Task.vue

@@ -9,20 +9,22 @@
                    style="margin:0 0 0 80px;">
             <el-form-item label="任务名称" prop="title" style="width: 700px;">
               <el-input size="small" v-if="isModifyMode" v-model="task.title"></el-input>
-              <span v-if="!isModifyMode">{{task.title}}</span>
-              <el-tag v-if="!isModifyMode" :type="task.statusVO&&task.statusVO.style">{{task.statusVO ?
-                task.statusVO.text:''}}
+              <span v-if="!isModifyMode">{{ task.title }}</span>
+              <el-tag v-if="!isModifyMode" :type="task.statusVO&&task.statusVO.style">{{
+                  task.statusVO ?
+                    task.statusVO.text : ''
+                }}
               </el-tag>
             </el-form-item>
             <el-form-item label="任务描述" prop="description" style="width: 700px;">
               <el-input autosize v-if="isModifyMode" type="textarea" v-model="task.description"></el-input>
-              <span v-if="!isModifyMode">{{task.description ? task.description : '暂无'}}</span>
+              <span v-if="!isModifyMode">{{ task.description ? task.description : '暂无' }}</span>
             </el-form-item>
             <el-form-item label="任务报价" prop="quotePrice" style="width: 700px;">
               <el-input size="small" type="number" v-if="isModifyMode" v-model="task.quotePrice">
                 <template slot="append">¥</template>
               </el-input>
-              <span v-if="!isModifyMode">¥{{task.quotePrice}}</span>
+              <span v-if="!isModifyMode">¥{{ task.quotePrice }}</span>
             </el-form-item>
             <!--<el-form-item type="number" label="任务定价" prop="fixedPrice">-->
             <!--<el-input v-if="isModifyMode" v-model="task.fixedPrice">-->
@@ -33,61 +35,55 @@
             <el-form-item label="测试类型" prop="serviceType">
               <el-radio-group v-if="isModifyMode" v-model="task.serviceType" @change="handleTestTypeChange">
                 <span v-for="(item,index) in serviceType" :key="index">
-                  <el-radio :label="item.code" name="serviceType">{{item.name}}</el-radio>
+                  <el-radio :label="item.name" name="serviceType">{{ item.name }}</el-radio>
                 </span>
               </el-radio-group>
-              <span class="badge" v-if="!isModifyMode">{{serviceName}}</span>
+              <span class="badge" v-if="!isModifyMode">{{ task.serviceType }}</span>
             </el-form-item>
 
-            <el-form-item label="服务序列号" prop="endPoint" style="width: 700px;"
-                          v-if="showBD&&task.endPoint&&currType.type===1"
-            >
-              <el-input v-if="isModifyMode" v-model="task.endPoint.serverCode" label="examId"></el-input>
-              <span v-if="!isModifyMode&&showBD">{{task.endPoint.serverCode}}</span>
+            <el-form-item label="协同模式" prop="collaborativeType" style="width:700px;" v-if="currType.type==1">
+              <el-radio-group v-model="task.endPoint.collaborativeType" v-if="isModifyMode">
+                <el-radio :label="0">协同</el-radio>
+                <el-radio :label="1">非协同</el-radio>
+              </el-radio-group>
+              <span v-if="!isModifyMode">{{ task.endPoint.collaborativeType ? '非协同' : '协同' }}</span>
             </el-form-item>
 
-            <el-form-item label="任务可见性" prop="resource" style="width: 700px;">
+            <el-form-item label="任务可见性" prop="resource">
               <div v-if="!isModifyMode">
                 <!--<div v-if="task.resource=='1'">{{updateLocation(task.location)}}</div>-->
                 <div v-if="task.resource==0">定向</div>
-                <div v-if="task.resource==2">{{resourceType[task.resource]}}</div>
+                <div v-if="task.resource==2">{{ resourceType[task.resource] }}</div>
               </div>
               <el-tabs
                 :tab-position="tabPosition"
                 v-model="task.resource"
-                style="max-height: 200px;"
                 v-if="isModifyMode"
               >
-                <el-tab-pane :label="resourceType[0]" name="0">
+                <el-tab-pane v-if="currType.type==0" :label="resourceType[0]" name="0">
                   <el-radio-group v-model="task.institution" @change="handleTestTypeChange">
-                    <el-radio
-                      :label="item"
-                      name="type"
-                      v-for="(item,index) in institutionArray"
-                      :key="index"
-                    >{{item.name}}
+                    <el-radio v-for="(item,index) in institutionArray" :label="item.userId" name="type" :key="index">
+                      {{item.name}}
                     </el-radio>
                   </el-radio-group>
                 </el-tab-pane>
-                <!--<el-tab-pane :label="resourceType[1]" name="1">-->
-                <!--<provincecity-->
-                <!--ref="addFormProvince"-->
-                <!--@selectChange="locationChange"-->
-                <!--:provinceCode="task.location == null ||task.location.provinceCode==null?'3200':task.location.provinceCode"-->
-                <!--:cityCode="task.location == null ||task.location.cityCode==null?'3201':task.location.cityCode"-->
-                <!--&gt;</provincecity>-->
-                <!--</el-tab-pane>-->
                 <el-tab-pane :label="resourceType[2]" name="2"></el-tab-pane>
               </el-tabs>
             </el-form-item>
+
+            <el-form-item v-if="!isModifyMode && task.resource==0 && showBD" label="接包人员/机构" prop="agencyName" style="width: 700px;">
+              <span>{{task.agencyName}}</span>
+            </el-form-item>
+
             <el-form-item label="领取人数" prop="contactPhone" v-if="isModifyMode&&task.resource !== '0' && currType.type===0">
               <el-input-number v-model="task.participantCount" :min="1" :max="1000" label="领取人数"></el-input-number>
             </el-form-item>
-            <el-form-item label="领取人数" prop="contactPhone" v-if="isModifyMode&&task.resource !== '0' && currType.type===1">
+            <el-form-item label="领取人数" prop="contactPhone"
+                          v-if="isModifyMode&&task.resource !== '0' && currType.type===1">
               <el-input-number v-model="task.participantCount" :min="2" :max="1000" label="领取人数"></el-input-number>
             </el-form-item>
             <el-form-item label="领取人数" prop="quotePrice" v-if="!isModifyMode">
-              {{task.acceptedCount }}/{{ task.participantCount}}
+              {{ task.acceptedCount }}/{{ task.participantCount }}
             </el-form-item>
             <el-form-item label="需求文档" prop="doc">
               <el-upload
@@ -121,6 +117,43 @@
             </span>
             </el-form-item>
 
+            <el-form-item label="测试大纲" prop="threePageUrl" class="three-page-upload" v-if="currType.type==1">
+              <el-upload
+                style="width: 400px"
+                v-if="isModifyMode"
+                drag
+                class="upload-demo"
+                action=""
+                :on-remove="handleRemove"
+                :before-remove="beforeRemove"
+                :limit="1"
+                :on-exceed="handleExceed"
+                :http-request="uploadThreePage"
+                :file-list="task.threePageList"
+              >
+                <i class="el-icon-upload"></i>
+                <div class="el-upload__text">
+                  将文件拖到此处,或
+                  <em>点击上传</em>
+                </div>
+              </el-upload>
+              <span>
+<!--              <span v-if="task.endPoint.threePageUrl == null || task.endPoint.threePageUrl == ''">-->
+<!--                <i class="el-icon-document"></i>暂无文件-->
+<!--              </span>-->
+                <span v-if="task.endPoint.threePageUrl != null && task.endPoint.threePageUrl != ''">
+                  <a :href="task.endPoint.threePageUrl"><el-link :underline="false" type="primary"><i
+                    class="el-icon-document"></i>下载文档</el-link></a>
+                </span>
+
+            </span>
+              <span> <a href="http://mooctest-site.oss-cn-shanghai.aliyuncs.com/excel-template.xlsx"><i class="el-icon-document"></i>示例下载</a></span>
+            </el-form-item>
+
+            <el-form-item v-if="!isModifyMode && task.resource==2 && needAcceptedPWD && showBD" label="任务接收码" prop="agencyName" style="width: 700px;">
+              <span>{{task.acceptedPassword}}</span>
+            </el-form-item>
+
             <el-form-item label="任务截止时间" prop="datetime">
               <div class="block" v-if="isModifyMode">
                 <el-date-picker
@@ -132,7 +165,7 @@
                   :picker-options="pickerOptions"
                 ></el-date-picker>
               </div>
-              <span v-if="!isModifyMode">{{dateFormat(new Date(task.datetime),'yyyy-MM-dd HH:mm:ss')}}</span>
+              <span v-if="!isModifyMode">{{ dateFormat(new Date(task.datetime), 'yyyy-MM-dd HH:mm:ss') }}</span>
             </el-form-item>
             <el-form-item v-if="isModifyMode">
               <div class="btn btn-small btn-info" @click="updateTask()">确认修改</div>
@@ -140,46 +173,12 @@
               <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: 800px">
-                <template slot="append">
-                  <el-button @click="getTaskDataBoard()">确定</el-button>
-                </template>
-              </el-input>
-            </el-form-item>
-
-            <el-form-item v-if="shortLink && !editShortLink" label="任务面板链接" props="shortLink">
-              {{shortLink}}
-              <i class="el-icon-edit" @click="editShortLink = true" v-if="taskOperationControl.confirmFinish"/>
-            </el-form-item>
-
             <el-form-item v-if="!isModifyMode">
               <el-button size="mini" @click="toProject()">项目详情</el-button>
-              <el-popover
-                placement="top-start"
-                title="确认结束?"
-                width="200"
-                trigger="hover"
-                content="测评机构已提交结束申请,请确认是否结束该任务">
-                <el-button v-if="taskOperationControl.confirmFinish" type="success" size="mini" slot="reference"
-                           @click="endTask()">确认结束
-                </el-button>
-              </el-popover>
 
               <el-popover
-                placement="top-start"
-                title="确认提交?"
-                width="200"
-                trigger="hover"
-                content="提交任务后不可更改,等待区域管理员验收">
-                <el-button v-if="taskOperationControl.finish" type="primary" size="mini" slot="reference"
-                           @click="submitTaskRequest()">提交任务
-                </el-button>
-              </el-popover>
-
-              <el-popover
-                placement="top-start"
-                title="确认拒绝?"
+                placement="top-start"r
+               title="确认拒绝?"
                 width="200"
                 trigger="hover"
                 content="拒绝后不可再接收此任务,且该任务对您不可见">
@@ -195,45 +194,60 @@
                 trigger="hover"
                 content="接收任务后请认真完成!">
                 <el-button v-if="taskOperationControl.receive" type="primary" size="mini" slot="reference"
-                           @click="receiveTask()">接收任务
+                           @click="showTaskCodeModal = !showTaskCodeModal">接收任务
                 </el-button>
               </el-popover>
 
-              <el-button v-if="taskOperationControl.writeReport" type="primary" size="mini" @click="gotoWriteReport()">填写报告
-              </el-button>
-
               <el-button v-if="taskOperationControl.update" type="primary" size="mini" @click="modifyForm()">修改任务
               </el-button>
 
-              <el-button v-if="featureTaskRecommend && taskOperationControl.taskRecommend" type="primary" size="mini" @click="recommendTask()">任务推荐
+              <el-button v-if="taskOperationControl.writeReport" type="primary" size="mini" @click="gotoWriteReport()">
+                填写报告
               </el-button>
 
-
-<!--              <el-button v-if="taskOperationControl.exportTask && task.exportUrl != null && task.exportUrl != ''" type="primary" size="mini">-->
-<!--                <a :href="task.exportUrl" style="color:white">导出任务</a>-->
-<!--              </el-button>-->
-              <el-button v-if="taskOperationControl.exportTask" type="primary" size="mini" @click="toExportTask()">
-                导出任务
+              <el-button v-if="featureTaskRecommend && taskOperationControl.taskRecommend" type="primary" size="mini"
+                         @click="recommendTask()">任务推荐
               </el-button>
 
+              <el-button v-if="taskOperationControl.exportTask" type="primary" size="mini" @click="toExportTask()">导出任务</el-button>
+
               <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 v-if="taskOperationControl.forkTask" type="primary" size="mini"
+                         @click="showTaskForkModal = !showTaskForkModal">
+                fork任务
+              </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()">确认结束-->
-              <!--</div>-->
-              <!--<div class="btn btn-small btn-info" v-if="!taskOperationControl.finish" @click="submitTaskRequest()">提交任务-->
-              <!--</div>-->
-              <!--<div class="btn btn-small btn-info" v-if="!taskOperationControl.receive" @click="receiveTask()">接收任务</div>-->
-              <!--<div class="btn btn-small btn-danger" v-if="!taskOperationControl.reject" @click="rejectTask()">拒绝任务</div>-->
-              <!--<div class="btn btn-small btn-info" v-if="taskOperationControl.update" @click="modifyForm()">修改任务</div>-->
-              <!--<div class="btn btn-small btn-info" v-if="!taskOperationControl.uploadReport" @click="toCreateReport()">上传报告-->
-              <!--</div>-->
+
+              <el-popover
+                placement="top-start"
+                title="确认提交?"
+                width="200"
+                trigger="hover"
+                content="提交任务后不可更改,等待区域管理员验收">
+                <el-button v-if="taskOperationControl.finish" type="primary" size="mini" slot="reference"
+                           @click="submitTaskRequest()">提交任务
+                </el-button>
+              </el-popover>
+
+              <el-popover
+                placement="top-start"
+                title="确认结束?"
+                width="200"
+                trigger="hover"
+                content="测评机构已提交结束申请,请确认是否结束该任务">
+                <el-button v-if="taskOperationControl.confirmFinish" type="success" size="mini" slot="reference"
+                           @click="endTask()">确认结束
+                </el-button>
+              </el-popover>
+
             </el-form-item>
           </el-form>
         </el-col>
@@ -249,8 +263,8 @@
         <el-collapse-item v-for="(item,index) in acceptedUserList" :key="item.id">
           <template slot="title">
             <el-row style="width: 100%;font-size: 16px">
-              <el-col :span="6">{{item.userVO.userName}}</el-col>
-              <el-col :span="6">{{item.userVO.email}}</el-col>
+              <el-col :span="6">{{ item.userVO.userName }}</el-col>
+              <el-col :span="6">{{ item.userVO.email }}</el-col>
               <el-col :span="6">
                 <el-tag type="success" v-if="item.crowdReportVOS">已提交报告</el-tag>
                 <el-tag type="info" v-if="!item.crowdReportVOS">未提交报告</el-tag>
@@ -267,6 +281,22 @@
       <!--      <report-list v-if="isAgency" v-bind:reports="reportList" v-bind:taskId="taskId" v-bind:projectId="projectId"/>-->
       <!--      <report-list v-bind:reports="reportList" v-bind:taskId="taskId" v-bind:projectId="projectId"/>-->
     </div>
+
+    <el-dialog title="请输入任务接收码" :visible.sync="showTaskCodeModal">
+      <el-input v-model="taskValidCode" autocomplete="off" placeholder="请输入任务接收码"></el-input>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="showTaskCodeModal = false;taskValidCode = ''">取 消</el-button>
+        <el-button type="primary" @click="handleTaskCodeValid()">确 定</el-button>
+      </div>
+    </el-dialog>
+
+    <el-dialog title="Fork任务?" :visible.sync="showTaskForkModal">
+      <div>确定基于该任务Fork新任务?</div>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="showTaskForkModal = false;">取 消</el-button>
+        <el-button type="primary" @click="handleForkTask()">确 定</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -294,7 +324,9 @@ import {
   storageGet,
   submitTaskRequest,
   updateTask,
-  getTaskWordCloud
+  getTaskWordCloud,
+  getTaskWordCloudByDescription,
+  refreshToken
 } from '@/js/index'
 import {AxiosInstance as axios} from "axios";
 
@@ -307,15 +339,20 @@ export default {
   },
   data() {
     return {
-      featureTaskRecommend:CONFIG.feature_task_recommend,
+      showTaskCodeModal: false,
+      showTaskForkModal: false,
+      taskValidCode:'',
+      featureTaskRecommend: CONFIG.feature_task_recommend,
       taskRecommendUrl: CONFIG.task_recommend_url,
+      needAcceptedPWD: CONFIG.feature_task_acceptedPWD,
       currType: {},
       user: {},
-      serviceName:'',
+      serviceName: '',
       showBD: true,
       rolesPermissions: {},
       loading: false,
-      isModifyMode: false,      institutionArray: [],
+      isModifyMode: false,
+      institutionArray: [],
       tabPosition: 'top',
       resourceType: ResourceType,
       serviceType: [],
@@ -330,20 +367,23 @@ export default {
         writeReport: false,
         taskDemonstrate: false,
         taskRecommend: false,
-        exportTask: false
+        exportTask: false,
+        forkTask: false,
       },
       crowdReportUrl: '',
       exportTaskUrl: '',
-      wordCloud:[],
+      wordCloud: [],
       task: {
         agencyId: '',
+        agencyName: '',
+        acceptedPassword: '',
         status: '',
         name: '',
         desc: '',
         serviceType: '',
         resource: '',
         location: {},
-        institution: {},
+        institution: 0,
         datetime: '',
         quotePrice: '',
         fixedPrice: '',
@@ -354,9 +394,12 @@ export default {
         title: '',
         description: '',
         endPoint: {
-          serverCode: '',
-          token: ''
-        }
+          collaborativeType:0,
+          token: '',
+          threePageUrl:''
+        },
+        writeReportUrl:'',
+        threePageList: []
       },
       reportList: [],
       pickerOptions: {
@@ -411,7 +454,7 @@ export default {
           {required: true},
           {
             validator: (rule, value, callback) => {
-              if (value == 0 && this.task.institution.id == null) {
+              if (value == 0 && this.task.institution == 0) {
                 callback(new Error('定向发布至少要选择一个测评机构'))
               } else {
                 callback()
@@ -427,14 +470,14 @@ export default {
               } else {
                 callback()
               }
-            }, trigger: ['change','blur']
+            }, trigger: ['change', 'blur']
           },
         ],
         datetime: [{required: true, message: '截止时间不可为空', trigger: 'blur'}],
       },
       acceptedUserList: [],
-      shortLink:'',
-      editShortLink:false,
+      shortLink: '',
+      editShortLink: false,
     }
   },
   watch: {
@@ -452,42 +495,65 @@ export default {
     })
   },
   methods: {
+    handleTaskCodeValid(){
+      let str1 = this.projectId;
+      let str2 = this.task.code;
+      let str = str1.substring(str1.length-2) + str2.substring(str2.length-2);
+      if(str === this.taskValidCode){
+        //接收码正确,可以正确接收任务
+        this.receiveTask();
+        this.showTaskCodeModal = false;
+      }else{
+        // 提示接收码错误
+        notify('error', '接收码错误')
+      }
+    },
+    handleForkTask(){
+      //跳转到taskFork
+      this.$router.push({
+        name: 'TaskCreate',
+        params: this.task
+      })
+      this.showTaskForkModal = false;
+    },
     //跳转到任务对应的数据面板
-    gotoDataboard(){
+    gotoDataboard() {
       window.open(this.task.endPoint.token)
     },
     //根据短链接获取生成databoard
-    getTaskDataBoard(){
+    getTaskDataBoard() {
       this.showLoading()
-      Http.put(`/api/project/${this.projectId}/task/${this.taskId}/addToken`,{"token":this.shortLink}).then((res)=>{
+      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 != ''){
+        if (this.shortLink != '') {
           this.editShortLink = false;
         }
         this.hideLoading()
       })
     },
-    getServiceByCode(code){
+    getServiceByCode(code) {
       let serviceName = this.serviceType.filter((item) => {
         return item.code === code;
       });
-      return serviceName&&serviceName[0]&&serviceName[0]['name']
+      return serviceName && serviceName[0] && serviceName[0]['name']
     },
 
     handleTestTypeChange(val) {
       let type = this.serviceType.filter((item) => {
-        return item.code === val;
+        return item.name === val;
       });
+      // console.log(type,val)
       this.currType = type[0] ? type[0] : {};
       if (this.currType.type === 0) {
         this.$refs.task.clearValidate('endPoint');
+      } else {
+        this.task.resource = '2'
       }
     },
     init() {
-      console.log("this.featureTaskRecommend " + this.featureTaskRecommend);
-      console.log("this.taskRecommendUrl " + this.taskRecommendUrl);
+      console.log(CONFIG)
       this.taskId = this.$route.params.taskId
       this.projectId = this.$route.params.projectId
       this.setUserInfo()
@@ -495,12 +561,19 @@ export default {
       //this.loadData(this.projectId, this.taskId)
       this.getTaskDetail()
       this.getWordCloud()
-      this.setInstitutions()
+      // this.setInstitutions()
     },
 
     //北斗测试报告填写跳转
     gotoWriteReport() {
-      window.open(this.crowdReportUrl, '_blank');
+      //重开一个界面去进行报告填写
+      window.open(this.task.writeReportUrl, '_blank');
+      //更换token
+      refreshToken(this.projectId,this.taskId,this.refreshSuccess);
+    },
+
+    refreshSuccess(res) {
+      this.task.writeReportUrl = res.data;
     },
 
     //跳转至项目详情页面
@@ -513,7 +586,9 @@ export default {
 
     //切换至可编辑页面
     modifyForm() {
-      // this.task.serviceType = ''
+      // this.task.serviceType = '
+      this.setServiceType()
+      this.setInstitutions();
       this.isModifyMode = true
     },
     //切换至不可编辑页面
@@ -529,7 +604,7 @@ export default {
       this.task.type = ''
       this.task.resource = '2' //如果是广场不用管Location和institution ,定向看institution,区域看location
       this.task.location = {provinceCode: '', cityCode: ''}
-      this.task.institution = ''
+      this.task.institution = 0
       this.task.datetime = ''
       this.task.participantCount = 1
       // this.task.endPointVO.caseId = ''
@@ -576,22 +651,30 @@ export default {
     },
 
     //获取词云
-    getWordCloud(){
+    getWordCloud() {
       getTaskWordCloud(this.projectId, this.taskId, this.getTaskCloudSuccess, this.getTaskCloudFail)
     },
-    getTaskCloudSuccess(words){
+
+    //获取词云
+    getWordCloudByDescription() {
+      getTaskWordCloudByDescription(this.projectId, this.taskId, this.task.description, this.getTaskCloudSuccess, this.getTaskCloudFail)
+    },
+
+    getTaskCloudSuccess(words) {
       this.wordCloud = words.data;
     },
-    getTaskCloudFail(err){
-      notify('error',err)
+    getTaskCloudFail(err) {
+      notify('error', err)
     },
 
     //获取任务详情成功时回调函数
     getTaskDetailSuccess(res) {
       this.hideLoading()
       // console.log(res)
+      this.task = res.crowdTaskVO
       this.taskId = res.crowdTaskVO.id
       this.projectId = res.crowdTaskVO.projectId
+      this.task.code = res.crowdTaskVO.code
       this.task.title = res.crowdTaskVO.title
       this.task.description = res.crowdTaskVO.description
       this.task.serviceType = res.crowdTaskVO.serviceType
@@ -600,6 +683,8 @@ export default {
       this.task.institution = res.crowdTaskVO.institution
       this.task.datetime = new Date(res.crowdTaskVO.datetime)
       this.task.quotePrice = res.crowdTaskVO.quotePrice
+      this.task.agencyName = res.crowdTaskVO.agencyName
+      this.task.acceptedPassword = res.crowdTaskVO.acceptedPassword
       this.task.acceptedCount = res.crowdTaskVO.acceptedCount
       this.task.participantCount = res.crowdTaskVO.participantCount
       this.task.fixedPrice = res.crowdTaskVO.fixedPrice
@@ -609,23 +694,24 @@ export default {
       this.task.exportUrl = res.crowdTaskVO.exportUrl
       this.task.status = res.crowdTaskVO.status
       this.task.statusVO = res.crowdTaskVO.statusVO
-      this.task.endPoint = res.crowdTaskVO.endPointVO ? res.crowdTaskVO.endPointVO : {
-        serverCode: '',
-      }
+      this.task.writeReportUrl = res.crowdTaskVO.writeReportUrl
+      this.task.endPoint = res.crowdTaskVO.endPointVO ? res.crowdTaskVO.endPointVO : {}
       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);
-      if(res.crowdTaskVO.endPointVO){
-        if(res.crowdTaskVO.endPointVO.token){
+      this.handleTestTypeChange(res.crowdTaskVO.serviceType);
+      // this.serviceName = this.getServiceByCode(res.crowdTaskVO.serviceType);
+      if (res.crowdTaskVO.endPointVO) {
+        if (res.crowdTaskVO.endPointVO.token) {
           this.shortLink = res.crowdTaskVO.endPointVO.token;
           this.editShortLink = false
-        }else{
+        } else {
           this.editShortLink = true
         }
       }
+      // this.wordCloud = res.wordCloudList;
       // console.log(res.crowdTaskVO.endPointVO.token)
       // console.log(this.editShortLink)
       // console.log(this.isModifyMode)
@@ -676,10 +762,10 @@ export default {
           const newTask = {
             name: this.task.title,
             desc: this.task.description,
-            type: this.task.serviceType,
+            type: this.serviceType.filter(type => type.name === this.task.serviceType)[0].code,
             resource: this.task.resource,
             location: this.task.location == null ? {} : getProvinceNameByProvinceCode(this.task.location.provinceCode, this.task.location.cityCode),
-            institution: this.task.institution ? this.task.institution.id : null,
+            institution: this.task.institution ? this.task.institution : null,
             datetime: this.task.datetime,
             quotePrice: this.task.quotePrice,
             fixedPrice: this.task.fixedPrice,
@@ -698,8 +784,11 @@ export default {
     //更新任务信息成功时回调函数
     updateTaskSuccess(res) {
       this.cancelMode()
+      this.task = res.crowdTaskVO
+      this.taskOperationControl = res.taskOperationControl
       this.taskId = res.crowdTaskVO.id
       this.projectId = res.crowdTaskVO.projectId
+      this.task.projectId = res.crowdTaskVO.projectId
       this.task.title = res.crowdTaskVO.title
       this.task.description = res.crowdTaskVO.description
       this.task.serviceType = res.crowdTaskVO.serviceType
@@ -714,8 +803,8 @@ export default {
       this.task.fixedPrice = res.crowdTaskVO.fixedPrice
       // this.task.endPointVO = res.crowdTaskVO.endPointVO
       this.task.doc = []
-      this.task.requireDocUrl = res.crowdTaskVO.requirementFile,
-        this.task.participantCount = res.crowdTaskVO.participantCount
+      this.task.requireDocUrl = res.crowdTaskVO.requirementFile
+      this.task.participantCount = res.crowdTaskVO.participantCount
       this.task.endPoint = res.crowdTaskVO.endPointVO ? res.crowdTaskVO.endPointVO : {
         serverCode: '',
       }
@@ -725,8 +814,9 @@ export default {
       this.acceptedUserList = res.acceptedUserList
       this.handleTestTypeChange(res.crowdTaskVO.serviceType);
       this.serviceName = this.getServiceByCode(res.crowdTaskVO.serviceType)
-      this.getWordCloud()
+      this.getWordCloudByDescription()
       this.hideLoading()
+
       notify('success', '修改成功')
     },
     //更新任务信息失败时回调函数
@@ -744,23 +834,34 @@ export default {
       formData.append('file', param.file)
       Http.upload(Apis.FILE.REQUIREMENT_FILE.replace('{userId}', this.user.userVO.id), formData, config).then((res) => {
         notify('success', '上传成功')
-        this.uploadRequireDocSuccess(res)
+        // console.log(res)
+        this.task.requireDocUrl = res.data
       }).catch((error) => {
-        notify('error', '上传失败:' + error.data)
+        // notify('error', '上传失败:' + error.data)
         this.uploadRequireDocFail(error)
       })
     },
-    //上传任务需求文档成功时回调函数
-    uploadRequireDocSuccess(res) {
-      this.hideLoading()
-      console.log('上传成功')
-      this.task.requireDocUrl = res.data
-      console.log(res.data)
+    //上传测试大纲
+    uploadThreePage(param) {
+      const formData = new FormData()
+      let config = {
+        //添加请求头
+        headers: {'Content-Type': 'multipart/form-data'},
+      }
+      formData.append('file', param.file)
+      Http.upload(Apis.FILE.REQUIREMENT_FILE.replace('{userId}', this.user.userVO.id), formData, config).then((res) => {
+        notify('success', '上传成功')
+        this.task.endPoint.threePageUrl = res.data
+        console.log("this.task.endPoint.threePageUrl " + this.task.endPoint.threePageUrl)
+      }).catch((error) => {
+        // notify('error', '上传失败:' + error.data)
+        this.uploadRequireDocFail(error)
+      })
     },
     //上传任务需求文档失败时回调函数
     uploadRequireDocFail(error) {
       this.hideLoading()
-      notify('error', '任务需求文档上传失败:' + error.data)
+      // notify('error', '任务需求文档上传失败:' + error.data)
     },
     //文档上传前响应函数
 
@@ -795,12 +896,14 @@ export default {
     //接收任务成功时的回调函数
     receiveTaskSuccess(res) {
       this.hideLoading()
-      this.getTaskDetail();
+      // this.getTaskDetail();
       notify('success', '接收任务成功')
+      this.getTaskDetailSuccess(res);
       // console.log(res)
-      this.taskOperationControl = res.taskOperationControl
-      this.task.status = res.crowdTaskVO.status
-      this.task.institution = res.crowdTaskVO.institution
+      // this.taskOperationControl = res.taskOperationControl
+      // this.task.status = res.crowdTaskVO.status
+      // this.task.institution = res.crowdTaskVO.institution
+      // this.task = res.crowdTaskVO
     },
     //接收任务失败时的回调函数
     receiveTaskFail(error) {
@@ -809,7 +912,7 @@ export default {
     },
 
     // 任务推荐
-    recommendTask(){
+    recommendTask() {
       let task = {
         "title": this.task.title,
         "description": this.task.description,
@@ -820,7 +923,7 @@ export default {
         "createTime": this.task.createTime,
         "datetime": this.task.datetime
       };
-      Http.post('/recommendationtest/query',task).then((res)=>{
+      Http.post('/recommendationtest/query', task).then((res) => {
         window.open(this.taskRecommendUrl, "_blank");
       })
     },
@@ -868,12 +971,13 @@ export default {
     //提交结束任务申请成功时的回调函数
     submitTaskRequestSuccess(res) {
       this.hideLoading()
-      console.log(res)
-      this.taskOperationControl = res.taskOperationControl
-      this.task.status = res.crowdTaskVO.status
-      this.task.institution = res.crowdTaskVO.institution
+      // this.task = res.crowdTaskVO
+      // this.taskOperationControl = res.taskOperationControl
+      // this.task.status = res.crowdTaskVO.status
+      // this.task.institution = res.crowdTaskVO.institution
       notify('success', '提交任务成功,等待区域管理员审核')
-      this.getTaskDetail();
+      this.getTaskDetailSuccess(res);
+      // this.getTaskDetail();
     },
     //提交结束任务申请失败时的回调函数
     submitTaskRequestFail(error) {
@@ -887,7 +991,7 @@ export default {
         cancelButtonText: '取消',
         type: 'success'
       }).then(() => {
-        this.getTaskDetail()
+        // this.getTaskDetail()
         this.showLoading()
         ensureEndTask(this.projectId, this.taskId, this.endTaskSuccess, this.endTaskFail)
       }).catch(() => {
@@ -896,12 +1000,13 @@ export default {
     },
     //结束任务成功时的回调函数
     endTaskSuccess(res) {
-      this.hideLoading()
-      this.taskOperationControl = res.taskOperationControl
-      this.task.status = res.crowdTaskVO.status
-      this.task.institution = res.crowdTaskVO.institution
+      // this.taskOperationControl = res.taskOperationControl
+      // this.task.status = res.crowdTaskVO.status
+      // this.task.institution = res.crowdTaskVO.institution
       notify('success', '结束任务成功!')
-      this.getTaskDetail();
+      this.getTaskDetailSuccess(res);
+      this.hideLoading()
+      // this.getTaskDetail();
     },
     //结束任务失败时的回调函数
     endTaskFail(error) {
@@ -909,11 +1014,11 @@ export default {
       notify('error', '结束任务失败:' + error.data)
     },
     // 导出任务
-    toExportTask(){
+    toExportTask() {
       exportTask(this.projectId, this.taskId, this.exportTaskSuccess, this.exportTaskFail);
     },
     // 导出任务成功时的回调函数
-    exportTaskSuccess(res){
+    exportTaskSuccess(res) {
       this.hideLoading()
       console.log(res.data)
       this.exportTaskUrl = res.data;
@@ -921,7 +1026,7 @@ export default {
       notify('success', '任务导出成功!')
     },
     // 导出任务失败时的回调函数
-    exportTaskFail(error){
+    exportTaskFail(error) {
       this.hideLoading()
       notify('error', '导出任务失败:' + error.data)
     },
@@ -995,3 +1100,13 @@ export default {
   padding-bottom: 0 !important;
 }
 </style>
+<style lang="scss">
+.three-page-upload {
+  label {
+    &:before{
+      content:'* ';
+      color:red
+    }
+  }
+}
+</style>

+ 402 - 327
src/components/task/TaskCreate.vue

@@ -22,28 +22,29 @@
         <el-form-item label="测试类型" prop="type">
           <el-radio-group v-model="task.type" @change="handleTestTypeChange">
             <span v-for="(item,index) in serviceType" :key="index">
-              <el-radio :label="item.code" name="type">{{item.name}}</el-radio>
+              <el-radio :label="item.code" name="type">{{ item.name }}</el-radio>
             </span>
           </el-radio-group>
         </el-form-item>
 
 
-        <el-form-item label="服务序列号" prop="endPoint" style="width:700px;" v-if="currType.type==1"
-                      >
-          <el-input v-model="task.endPoint.serverCode" label="serverCode"></el-input>
+        <el-form-item label="协同模式" prop="collaborativeType" style="width:700px;" v-if="currType.type==1">
+          <el-radio-group v-model="task.endPoint.collaborativeType">
+            <el-radio :label="0">协同</el-radio>
+            <el-radio :label="1">非协同</el-radio>
+          </el-radio-group>
         </el-form-item>
 
-
-        <el-form-item label="任务可见性" prop="resource" style="width:1000px;" v-if="currType.type==0">
-          <el-tabs :tab-position="tabPosition" v-model="task.resource" style="width: 800px">
-            <el-tab-pane :label="resourceType[0]" name="0">
+        <el-form-item label="任务可见性" prop="resource" style="width:1000px;">
+          <el-tabs :tab-position="tabPosition" v-model="task.resource">
+            <el-tab-pane v-if="currType.type==0" :label="resourceType[0]" name="0">
               <el-radio-group v-model="task.institution">
                 <el-radio
                   :label="item"
                   name="type"
                   v-for="item,index in institutionArray"
                   :key="index"
-                >{{item.name}}
+                >{{ item.name }}
                 </el-radio>
               </el-radio-group>
             </el-tab-pane>
@@ -59,14 +60,6 @@
           </el-tabs>
         </el-form-item>
 
-        <el-form-item label="任务可见性" prop="resource" style="width:700px;"
-                      v-if="currType.type ==1"
-                      required>
-          <el-tabs :tab-position="tabPosition" v-model="task.resource" value='2' style="width: 800px">
-            <el-tab-pane :label="resourceType[2]" name="2"></el-tab-pane>
-          </el-tabs>
-        </el-form-item>
-
         <el-form-item label="领取人数" prop="contactPhone" v-if="task.resource !== '0' && currType.type===0">
           <el-input-number v-model="task.participantCount" :min="1" :max="1000" label="领取人数"></el-input-number>
         </el-form-item>
@@ -92,8 +85,43 @@
               将文件拖到此处,或
               <em>点击上传</em>
             </div>
+
+          </el-upload>
+          <span v-if="task.requireDocUrl != null && task.requireDocUrl != ''">
+                <a :href="task.requireDocUrl"><el-link :underline="false" type="primary"><i
+                  class="el-icon-document"></i>下载文档</el-link></a>
+              </span>
+        </el-form-item>
+
+        <el-form-item label="测试大纲" prop="threePages" v-if="currType.type==1"
+                      class="three-page-upload">
+          <el-upload
+            drag
+            style="width: 400px"
+            class="upload-demo"
+            action=""
+            :on-remove="handleRemove"
+            :before-remove="beforeRemove"
+            :limit="1"
+            :on-exceed="handleExceed"
+            :before-upload="beforeFileUpload"
+            :http-request="uploadThreePageDoc"
+            :file-list="task.threePageList"
+          >
+            <i class="el-icon-upload"></i>
+            <div class="el-upload__text">
+              将文件拖到此处,或
+              <em>点击上传</em>
+            </div>
+
           </el-upload>
+          <span v-if="task.endPoint.threePageUrl != null && task.endPoint.threePageUrl != ''">
+            <a :href="task.endPoint.threePageUrl"><el-link :underline="false" type="primary"><i
+              class="el-icon-document"></i>下载文档</el-link></a>
+          </span>
+          <span> <a href="http://mooctest-site.oss-cn-shanghai.aliyuncs.com/excel-template.xlsx"><i class="el-icon-document"></i>示例下载</a></span>
         </el-form-item>
+
         <el-form-item size="small" label="任务截止时间" prop="datetime">
           <div class="block">
             <el-date-picker
@@ -116,338 +144,385 @@
 </template>
 
 <script>
-  import provincecity from '@/components/commons/ProvinceCity'
-  import provinceCityJSON from '@/constants/provinceCity.json'
-  import Http from '@/js/http.js'
-  import Apis from '@/js/api.js'
-  import ResourceType from '@/constants/enum/resource-type.js'
-  import {notify} from '@/constants/index'
-  import {getAllAgencies,getAllAgencyAndTestUser, getAllServiceTypes, getProvinceNameByProvinceCode, storageGet} from '@/js/index'
+import provincecity from '@/components/commons/ProvinceCity'
+import provinceCityJSON from '@/constants/provinceCity.json'
+import Http from '@/js/http.js'
+import Apis from '@/js/api.js'
+import ResourceType from '@/constants/enum/resource-type.js'
+import {notify} from '@/constants/index'
+import {
+  getAllAgencies,
+  getAllAgencyAndTestUser,
+  getAllServiceTypes,
+  getProvinceNameByProvinceCode,
+  storageGet
+} from '@/js/index'
 
-  export default {
-    name: 'Task',
-    components: {
-      provincecity
-    },
-    data() {
-      return {
-        currType: {},
-        user: {},
-        projectId: 0,
-        institutionArray: [],
-        tabPosition: 'top',
-        resourceType: ResourceType,
-        loading: false,
-        serviceType: [],
-        task: {
-          name: '',
-          desc: '',
-          type: '',
-          resource: '', //如果是广场不用管Location和institution ,定向看institution,区域看location
-          // location: {provinceCode: '3200', cityCode: '3201'},
-          institution: '',
-          datetime: '',
-          quotePrice: '',
-          fixedPrice: '',
-          doc: [],
-          requireDocUrl: '',
-          participantCount: 1,
-          endPoint: {
-            serverCode: '',
-          }
+export default {
+  name: 'Task',
+  components: {
+    provincecity
+  },
+  data() {
+    return {
+      currType: {},
+      user: {},
+      projectId: 0,
+      institutionArray: [],
+      tabPosition: 'top',
+      resourceType: ResourceType,
+      loading: false,
+      serviceType: [],
+      task: {
+        name: '',
+        desc: '',
+        type: '',
+        resource: '', //如果是广场不用管Location和institution ,定向看institution,区域看location
+        // location: {provinceCode: '3200', cityCode: '3201'},
+        institution: '',
+        datetime: '',
+        quotePrice: '',
+        fixedPrice: '',
+        doc: [],
+        requireDocUrl: '',
+        participantCount: 1,
+        endPoint: {
+          collaborativeType: 0, //0-协同(默认) 1-非协同
+          threePageUrl: ''
         },
-        pickerOptions: {
-          shortcuts: [
-            {
-              text: '今天',
-              onClick(picker) {
-                picker.$emit('pick', new Date())
+        threePageList: []
+      },
+      pickerOptions: {
+        shortcuts: [
+          {
+            text: '今天',
+            onClick(picker) {
+              picker.$emit('pick', new Date())
+            }
+          },
+          {
+            text: '昨天',
+            onClick(picker) {
+              const date = new Date()
+              date.setTime(date.getTime() - 3600 * 1000 * 24)
+              picker.$emit('pick', date)
+            }
+          },
+          {
+            text: '一周前',
+            onClick(picker) {
+              const date = new Date()
+              date.setTime(date.getTime() - 3600 * 1000 * 24 * 7)
+              picker.$emit('pick', date)
+            }
+          }
+        ]
+      },
+      rules: {
+        name: [
+          {required: true, message: '请输入任务名称', trigger: 'blur'},
+          {min: 5, max: 50, message: '任务名称长度在 5 到 50 个字符', trigger: 'blur'}
+        ],
+        type: [
+          {required: true, message: '测试类型不可为空'},
+        ],
+        desc: [{required: true, message: '请填写描述', trigger: 'blur'}],
+
+        threePages: [
+          {
+            validator: (rule, value, callback) => {
+              if (this.currType.type === 1 && this.task.endPoint.threePageUrl === '') {
+                callback(new Error('请上传测试大纲'))
+              } else {
+                callback()
               }
-            },
-            {
-              text: '昨天',
-              onClick(picker) {
-                const date = new Date()
-                date.setTime(date.getTime() - 3600 * 1000 * 24)
-                picker.$emit('pick', date)
+            }, trigger: 'change'
+          }
+        ],
+        //price: [{required: true, message: '请填写价格', trigger: 'blur'}],
+        quotePrice: [
+          {required: true, message: '预算不可为空', trigger: 'blur'},
+          {
+            validator: (rule, value, callback) => {
+              if (parseInt(value) < 0) {
+                callback(new Error('请输入不小于0的数'))
+              } else {
+                callback()
               }
-            },
-            {
-              text: '一周前',
-              onClick(picker) {
-                const date = new Date()
-                date.setTime(date.getTime() - 3600 * 1000 * 24 * 7)
-                picker.$emit('pick', date)
+            }, trigger: 'blur'
+          },
+        ],
+        resource: [
+          {required: true},
+          {
+            validator: (rule, value, callback) => {
+              if (value == 0 && this.task.institution.id == null) {
+                callback(new Error('定向发布至少要选择一个测评机构'))
+              } else {
+                callback()
               }
-            }
-          ]
-        },
-        rules: {
-          name: [
-            {required: true, message: '请输入任务名称', trigger: 'blur'},
-            {min: 5, max: 50, message: '任务名称长度在 5 到 50 个字符', trigger: 'blur'}
-          ],
-          type: [
-            {required: true, message: '测试类型不可为空'},
-          ],
-          desc: [{required: true, message: '请填写描述', trigger: 'blur'}],
-          //price: [{required: true, message: '请填写价格', trigger: 'blur'}],
-          quotePrice: [
-            {required: true, message: '预算不可为空', trigger: 'blur'},
-            {
-              validator: (rule, value, callback) => {
-                if (parseInt(value) < 0) {
-                  callback(new Error('请输入不小于0的数'))
-                } else {
-                  callback()
-                }
-              }, trigger: 'blur'
-            },
-          ],
-          resource: [
-            {required: true},
-            {
-              validator: (rule, value, callback) => {
-                if (value == 0 && this.task.institution.id == null) {
-                  callback(new Error('定向发布至少要选择一个测评机构'))
-                } else {
-                  callback()
-                }
-              }, trigger: 'change'
-            },
-          ],
-          endPoint: [
-            {
-              validator: (rule, value, callback) => {
-                if (this.currType.type === 1 && this.task.endPoint.serverCode === '') {
-                  callback(new Error('请填写对应得服务序列号'))
-                } else {
-                  callback()
-                }
-              }, trigger: ['change','blur']
-            },
-          ],
-          datetime: [{required: true, message: '截止时间不可为空', trigger: 'blur'}],
-        }
+            }, trigger: 'change'
+          },
+        ],
+
+        datetime: [{required: true, message: '截止时间不可为空', trigger: 'blur'}],
       }
+    }
+  },
+  watch: {
+    serviceType(val) {
+      this.serviceType = val
     },
-    watch: {
-      serviceType(val) {
-        this.serviceType = val
-      },
-      institution(val) {
-        this.institution = val
-      },
-      // 'task.institution' () {
-      //   if (this.task.institution) {
-      //     this.$refs.addFormProvince.resetProviceCity()
-      //     this.task.location = {provinceCode: '', cityCode: ''}
-      //   }
-      // },
-      // 'task.location' () {
-      //   if (this.task.location.provinceCode || this.task.location.cityCode) {
-      //     this.task.institution = ''
-      //   }
-      // },
-      // 'task.resource' () {
-      //   if (this.task.resource == '广场') {
-      //     this.$refs.addFormProvince.resetProviceCity()
-      //     this.task.institution = ''
-      //     this.task.location = {provinceCode: '', cityCode: ''}
-      //   }
-      // },
-      deep: true
+    institution(val) {
+      this.institution = val
     },
-    mounted() {
-      this.$nextTick(() => {
-        this.init()
-      })
+    // 'task.institution' () {
+    //   if (this.task.institution) {
+    //     this.$refs.addFormProvince.resetProviceCity()
+    //     this.task.location = {provinceCode: '', cityCode: ''}
+    //   }
+    // },
+    // 'task.location' () {
+    //   if (this.task.location.provinceCode || this.task.location.cityCode) {
+    //     this.task.institution = ''
+    //   }
+    // },
+    // 'task.resource' () {
+    //   if (this.task.resource == '广场') {
+    //     this.$refs.addFormProvince.resetProviceCity()
+    //     this.task.institution = ''
+    //     this.task.location = {provinceCode: '', cityCode: ''}
+    //   }
+    // },
+    deep: true
+  },
+  mounted() {
+    this.$nextTick(() => {
+      this.init()
+    })
+  },
+  methods: {
+    handleTestTypeChange(val) {
+      let type = this.serviceType.filter((item) => {
+        return item.code === val;
+      });
+      this.currType = type[0] ? type[0] : {};
+      if (this.currType.type === 0) {
+        this.$refs.task.clearValidate('endPoint');
+      } else {
+        this.task.resource = '2'
+      }
     },
-    methods: {
-      handleTestTypeChange(val) {
-        let type = this.serviceType.filter((item) => {
-          return item.code === val;
-        });
-        this.currType = type[0] ? type[0] : {};
-        if (this.currType.type === 0) {
-          this.$refs.task.clearValidate('endPoint');
-        }else{
-          this.task.resource = '2'
-        }
-      },
-      init() {
-        this.projectId = this.$route.params.projectId
-        this.setServiceType()
-        this.setInstitutions()
-        this.setUserInfo()
-      },
-      updateLocation(location) {
-        var provinceName = ''
-        var cityName = ''
-        for (var item of provinceCityJSON.provinces) {
-          if (item.code === location.provinceCode) {
-            provinceName = item.name
-            for (var city of item.cities) {
-              if (city.code === location.cityCode) {
-                cityName = city.name
-                break
-              }
+    init() {
+      this.projectId = this.$route.params.projectId
+      this.$route.params.code && this.initTask()
+      this.setServiceType()
+      this.setInstitutions()
+      this.setUserInfo()
+    },
+    initTask() {
+      const defaultTask = this.$route.params;
+      console.log(this.$route.params);
+      this.task.name = defaultTask.title;
+      this.task.desc = defaultTask.description;
+      this.task.type = defaultTask.serviceType;
+      this.task.resource = defaultTask.resource;
+      this.task.institution = defaultTask.institution;
+      this.task.datetime = defaultTask.datetime;
+      this.task.quotePrice = defaultTask.quotePrice;
+      this.task.fixedPrice = defaultTask.fixedPrice;
+      this.task.requireDocUrl = defaultTask.requireDocUrl;
+      this.task.doc = defaultTask.requireDocUrl;
+      this.task.participantCount = defaultTask.participantCount;
+      this.task.endPoint = defaultTask.endPoint;
+    },
+    updateLocation(location) {
+      var provinceName = ''
+      var cityName = ''
+      for (var item of provinceCityJSON.provinces) {
+        if (item.code === location.provinceCode) {
+          provinceName = item.name
+          for (var city of item.cities) {
+            if (city.code === location.cityCode) {
+              cityName = city.name
+              break
             }
           }
         }
-        return provinceName + ' / ' + cityName
-      },
-      submitForm(formName) {
-        this.$refs['task'].validate(valid => {
-          if (valid) {
-            this.showLoading()
-            const newTask = {
-              name: this.task.name,
-              desc: this.task.desc,
-              type: this.task.type,
-              resource: this.task.resource,
-              // location: this.task.resource == '0' ? getProvinceNameByProvinceCode(this.task.location.provinceCode, this.task.location.cityCode):null,
-              institution: this.task.resource == '0' ? this.task.institution.id : null,
-              datetime: this.task.datetime,
-              quotePrice: this.task.quotePrice,
-              fixedPrice: this.task.fixedPrice,
-              requirementFile: this.task.requireDocUrl,
-              participantCount: this.task.participantCount,
-              endPoint: this.task.endPoint
-            }
-            Http.post(Apis.TASK.CREATE_TASK.replace('{projectId}', this.projectId), newTask).then((res) => {
-              console.log(res)
-              this.hideLoading()
-              this.createTaskSuccess(res.crowdTaskVO.id)
-            }).catch((error) => {
-              console.log(error)
-              this.hideLoading()
-              notify('error', error.data)
-            })
-          } else {
-            notify('error', '表单填写有误!')
-            return false
+      }
+      return provinceName + ' / ' + cityName
+    },
+    submitForm(formName) {
+      this.$refs['task'].validate(valid => {
+        if (valid) {
+          this.showLoading()
+          const newTask = {
+            name: this.task.name,
+            desc: this.task.desc,
+            type: this.task.type,
+            resource: this.task.resource,
+            // location: this.task.resource == '0' ? getProvinceNameByProvinceCode(this.task.location.provinceCode, this.task.location.cityCode):null,
+            institution: this.task.resource == '0' ? this.task.institution.id : null,
+            datetime: this.task.datetime,
+            quotePrice: this.task.quotePrice,
+            fixedPrice: this.task.fixedPrice,
+            requirementFile: this.task.requireDocUrl,
+            participantCount: this.task.participantCount,
+            endPoint: this.task.endPoint
           }
-        })
-      },
-      resetForm(formName) {
-        this.$refs.addFormProvince.resetProviceCity()
-        this.$refs[formName].resetFields()
-        this.task.name = ''
-        this.task.desc = ''
-        this.task.type = ''
-        this.task.resource = '广场'; //如果是广场不用管Location和institution ,定向看institution,区域看location
-        (this.task.location = {provinceCode: '', cityCode: ''}),
-          (this.task.institution = '')
-        this.task.datetime = '',
-          this.task.participantCount = 1
-      },
-      locationChange(provinceId, cityId) {
-        if (provinceId || cityId) {
-          this.task.location = {provinceCode: provinceId, cityCode: cityId}
-        }
-      },
-      cancelCreate() {
-        if (window.history.length <= 1) {
-          this.$router.push({path: '/'})
-          return false
+          Http.post(Apis.TASK.CREATE_TASK.replace('{projectId}', this.projectId), newTask).then((res) => {
+            this.hideLoading()
+            this.createTaskSuccess(res.crowdTaskVO.id)
+          }).catch((error) => {
+            console.log(error)
+            this.hideLoading()
+            notify('error', error.data)
+          })
         } else {
-          this.$router.go(-1)
-        }
-      },
-      handleRemove(file, fileList) {
-        console.log(file, fileList)
-      },
-      handleExceed(files, fileList) {
-        this.$message.warning(
-          `当前限制选择 1 个文件,本次选择了 ${
-            files.length
-            } 个文件,共选择了 ${files.length + fileList.length} 个文件`
-        )
-      },
-      beforeRemove(file, fileList) {
-        //return this.$confirm(`确定移除 ${file.name}?`)
-      },
-      beforeFileUpload(file) {
-        console.log(file)
-        // const isPDF = file.type === 'application/pdf'
-        // const isDOC = file.type === 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
-        // const isEXCEL = file.type === 'application/vnd.ms-excel'
-        // const isXLS = file.type === 'application/x-xls'
-        // const isTXT = file.type === 'text/plain'
-        // const isXLSX = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
-        // //console.log(file)
-        // if (!(isDOC || isEXCEL || isPDF || isTXT || isXLS || isXLSX)) {
-        //   this.$message.error('上传文件只能是 PDF 、 DOC 、DOCX 、XLS、TXT、XLSX 格式!')
-        // }
-        // return isDOC || isEXCEL || isPDF || isTXT || isXLS || isXLSX
-      },
-      uploadRequireDoc(param) {
-        this.showLoading()
-        const formData = new FormData()
-        let config = {
-          //添加请求头
-          headers: {'Content-Type': 'multipart/form-data'},
+          notify('error', '表单填写有误!')
+          return false
         }
-        formData.append('file', param.file)
-        Http.upload(Apis.FILE.REQUIREMENT_FILE.replace('{userId}', this.user.userVO.id), formData, config).then((res) => {
-          this.hideLoading()
-          notify('success', '上传成功')
-          this.task.requireDocUrl = res.data
-          console.log(res.data)
-        }).catch((error) => {
-          this.hideLoading()
-          notify('error', '上传失败:' + error.data)
-        })
-      },
-      setServiceType() {
-        getAllServiceTypes().then((res) => {
-          this.serviceType = res
-        })
-      },
-      setInstitutions() {
-        getAllAgencyAndTestUser().then((res) => {
-          this.institutionArray = res
-          console.log(this.institutionArray)
-        }).catch((error) => {
-          notify('error', '测评机构加载失败')
-        })
-      },
-      setUserInfo() {
-        this.user = storageGet('user')
-      },
-      createTaskSuccess(taskId) {
-        this.$alert('任务创建成功', '创建成功', {
-          confirmButtonText: '确定',
-          callback: action => {
-            this.$router.push({
-              name: 'Task',
-              params: {projectId: this.projectId, taskId: taskId}
-            })
-          }
-        })
-      },
-      showLoading() {
-        this.loading = true
-      },
-      hideLoading() {
-        this.loading = false
+      })
+    },
+    resetForm(formName) {
+      this.$refs.addFormProvince.resetProviceCity()
+      this.$refs[formName].resetFields()
+      this.task.name = ''
+      this.task.desc = ''
+      this.task.type = ''
+      this.task.resource = '广场'; //如果是广场不用管Location和institution ,定向看institution,区域看location
+      (this.task.location = {provinceCode: '', cityCode: ''}),
+        (this.task.institution = '')
+      this.task.datetime = '',
+        this.task.participantCount = 1
+    },
+    locationChange(provinceId, cityId) {
+      if (provinceId || cityId) {
+        this.task.location = {provinceCode: provinceId, cityCode: cityId}
       }
+    },
+    cancelCreate() {
+      if (window.history.length <= 1) {
+        this.$router.push({path: '/'})
+        return false
+      } else {
+        this.$router.go(-1)
+      }
+    },
+    handleRemove(file, fileList) {
+      console.log(file, fileList)
+    },
+    handleExceed(files, fileList) {
+      this.$message.warning(
+        `当前限制选择 1 个文件,本次选择了 ${
+          files.length
+        } 个文件,共选择了 ${files.length + fileList.length} 个文件`
+      )
+    },
+    beforeRemove(file, fileList) {
+      //return this.$confirm(`确定移除 ${file.name}?`)
+    },
+    beforeFileUpload(file) {
+      console.log(file)
+      // const isPDF = file.type === 'application/pdf'
+      // const isDOC = file.type === 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
+      // const isEXCEL = file.type === 'application/vnd.ms-excel'
+      // const isXLS = file.type === 'application/x-xls'
+      // const isTXT = file.type === 'text/plain'
+      // const isXLSX = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
+      // //console.log(file)
+      // if (!(isDOC || isEXCEL || isPDF || isTXT || isXLS || isXLSX)) {
+      //   this.$message.error('上传文件只能是 PDF 、 DOC 、DOCX 、XLS、TXT、XLSX 格式!')
+      // }
+      // return isDOC || isEXCEL || isPDF || isTXT || isXLS || isXLSX
+    },
+    uploadRequireDoc(param) {
+      const formData = new FormData()
+      let config = {
+        //添加请求头
+        headers: {'Content-Type': 'multipart/form-data'},
+      }
+      formData.append('file', param.file)
+      Http.upload(Apis.FILE.REQUIREMENT_FILE.replace('{userId}', this.user.userVO.id), formData, config).then((res) => {
+        notify('success', '上传成功')
+        this.task.requireDocUrl = res.data
+      }).catch((error) => {
+        notify('error', '上传失败:' + error.data)
+      })
+    },
+    //todo:上传测试大纲
+    uploadThreePageDoc(param) {
+      const formData = new FormData()
+      let config = {
+        //添加请求头
+        headers: {'Content-Type': 'multipart/form-data'},
+      }
+      formData.append('file', param.file)
+      Http.upload(Apis.FILE.REQUIREMENT_FILE.replace('{userId}', this.user.userVO.id), formData, config).then((res) => {
+        notify('success', '上传成功')
+        this.task.endPoint.threePageUrl = res.data
+      }).catch((error) => {
+        notify('error', '上传失败:' + error.data)
+      })
+    },
+    setServiceType() {
+      getAllServiceTypes().then((res) => {
+        this.serviceType = res
+      })
+    },
+    setInstitutions() {
+      getAllAgencyAndTestUser().then((res) => {
+        this.institutionArray = res
+      }).catch((error) => {
+        notify('error', '测评机构加载失败')
+      })
+    },
+    setUserInfo() {
+      this.user = storageGet('user')
+    },
+    createTaskSuccess(taskId) {
+      this.$alert('任务创建成功', '创建成功', {
+        confirmButtonText: '确定',
+        callback: action => {
+          this.$router.push({
+            name: 'Task',
+            params: {projectId: this.projectId, taskId: taskId}
+          })
+        }
+      })
+    },
+    showLoading() {
+      this.loading = true
+    },
+    hideLoading() {
+      this.loading = false
     }
   }
+}
 </script>
 
 <style lang="scss" scoped>
-  .el-radio {
-    margin: 10px 20px 10px 0;
-  }
+.el-radio {
+  margin: 10px 20px 10px 0;
+}
 
-  .el-input {
-    width: 400px;
-  }
+.el-input {
+  width: 400px;
+}
 
-  .el-form-item /deep/ .el-tabs__content {
-    /*max-height: 120px !important;*/
-    overflow: auto;
+.el-form-item /deep/ .el-tabs__content {
+  /*max-height: 120px !important;*/
+  overflow: auto;
+}
+
+</style>
+<style lang="scss">
+.three-page-upload {
+  label {
+    &:before{
+      content:'* ';
+      color:red
+    }
   }
+}
 </style>

+ 1 - 1
src/constants/index.js

@@ -49,6 +49,6 @@ export const notify = (type, msg, title) => {
     title: title,
     message: msg,
     type: type,
-    duration: 3000
+    duration: 2000
   })
 }

+ 3 - 1
src/js/api.js

@@ -25,7 +25,9 @@ export default {
     END_TASK: '/api/project/{projectId}/task/{taskId}/status/finished',
     EXPORT_TASK: '/api/project/{projectId}/task/{taskId}/export',
     MORE_HOT_TASK: '/api/square/hotTasks/list',
-    GET_TASK_CLOUD:'/api/project/{projectId}/task/{taskId}/word'
+    GET_TASK_CLOUD:'/api/project/{projectId}/task/{taskId}/word',
+    GET_TASK_CLOUD_By_DESCRIPTION:'/api/project/{projectId}/task/{taskId}/word/{taskDescription}',
+    REFRESH_TOKEN:'/api/project/{projectCode}/task/{taskCode}/writerReportUrl'
   },
   REPORT: {
     GET_TASK_REPORT: '/api/project/{projectId}/task/{taskId}/report/{reportId}/',

+ 6 - 3
src/js/index.js

@@ -41,7 +41,9 @@ import {
   rejectTask,
   submitTaskRequest,
   updateTask,
-  getTaskWordCloud
+  getTaskWordCloud,
+  getTaskWordCloudByDescription,
+  refreshToken
 } from './taskService'
 import {
   createProjectReport,
@@ -158,7 +160,9 @@ export {
   submitTaskRequest,
   //区域管理员修改任务
   updateTask,
-  getTaskWordCloud
+  getTaskWordCloud,
+  getTaskWordCloudByDescription,
+  refreshToken
 }
 export {
   /*******************************************************************************/
@@ -206,7 +210,6 @@ export {
   //TODO 目前使用本地数据 需要修改 获取所有测评能力
   getAllAbilities,
   //TODO 可以使用 需要重构 获取所有测评机构
-  getAllAgencies,
   getAllAgencyAndTestUser,
   //TODO 目前使用本地数据 需要修改 获取所有测评能力 获取所有测评资源类型
   getAllAgencyResourceTypes,

+ 0 - 3
src/js/projectService.js

@@ -26,11 +26,8 @@ export const deleteProject = (projectId, deleteProjectSuccess, deleteProjectFail
 
 //区域管理员提出接收项目申请
 export const receiveProjectRequest = (projectId, userId, receiveProjectSuccess, receiveProjectFail) => {
-  console.log('调用')
   Http.put(Apis.PROJECT.ACCEPT_PROJECT.replace('{projectId}', projectId).replace('{userId}', userId), {}).then((res) => {
-    console.log(res)
     receiveProjectSuccess(res)
-
   }).catch((error) => {
     console.log(error)
     receiveProjectFail(error)

+ 16 - 0
src/js/taskService.js

@@ -32,6 +32,15 @@ export const getTaskWordCloud = (projectId, taskId,getSuccess) => {
   })
 }
 
+//查看词云
+export const getTaskWordCloudByDescription = (projectId, taskId, taskDescription, getSuccess) => {
+  Http.get(Apis.TASK.GET_TASK_CLOUD_By_DESCRIPTION.replace('{projectId}', projectId).replace('{taskId}', taskId).replace('{taskDescription}', taskDescription), {}).then((res)=>{
+    getSuccess(res)
+  }).catch(err=>{
+    console.log(err)
+  })
+}
+
 //删除任务
 export const deleteTask = (projectId, taskId, deleteTaskSuccess, deleteTaskFail) => {
   Http.put(Apis.TASK.DELETE_TASK.replace('{projectId}', projectId).replace('taskId', taskId), {}).then((res) => {
@@ -85,3 +94,10 @@ export const exportTask = (projectId, taskId, exportTaskSuccess, exportTaskFail)
     exportTaskFail(error)
   })
 }
+
+//更新token
+export const refreshToken = (projectId, taskId,refreshSuccess) => {
+  Http.get(Apis.TASK.REFRESH_TOKEN.replace('{projectCode}', projectId).replace('{taskCode}', taskId), {}).then(res=>{
+    refreshSuccess(res)
+  })
+}

+ 92 - 68
src/pages/Square/PopularProject.vue

@@ -1,59 +1,76 @@
 <template>
   <div class="popular-card">
-  <el-card>
-    <div slot="header" class="popular-header">
-      <img src="../../assets/img/popular-project.png" alt="popular-project" class="popular-header-img"/>
-      <span class="popular-header-title">热门项目</span>
-      <el-button style="float: right; padding: 3px 0;line-height: 25px" type="text" @click="goToMore()">>></el-button>
-    </div>
-    <div v-if="!hotCrowdTestProjectVOs.length" style="text-align: center;padding: 5px 0"><span>暂无项目</span></div>
-    <div class="popular-list" v-else>
-      <el-row class="popular-list-item" v-for="item in hotCrowdTestProjectVOs" :key="item.id">
-        <el-col :span="19">
-          <img :src="logo_background" alt="logo-project" class="pull-left project-logo-img">
-          <div style="margin-left: 55px; cursor: pointer;"  @click="goToProjectDetail(item.code)">
-            <div class="list-item-title">
-              {{item.name}}
+    <el-card>
+      <div slot="header" class="popular-header">
+        <img src="../../assets/img/popular-project.png" alt="popular-project" class="popular-header-img"/>
+        <span class="popular-header-title">热门项目</span>
+        <el-button style="float: right; padding: 3px 0;line-height: 25px" type="text" @click="goToMore()">>></el-button>
+      </div>
+      <div v-if="!hotCrowdTestProjectVOs" style="text-align: center;padding: 5px 0"><span>暂无项目</span></div>
+      <div class="popular-list" v-else>
+        <el-row class="popular-list-item" v-for="item in hotCrowdTestProjectVOs" :key="item.id">
+          <el-col :span="19">
+            <img :src="logo_background" alt="logo-project" class="pull-left project-logo-img">
+            <div style="margin-left: 55px; cursor: pointer;" @click="goToProjectDetail(item.code)">
+              <div class="list-item-title">
+                {{item.name}}
+              </div>
+              <div class="list-item-info">
+                {{item.description}}
+              </div>
             </div>
-            <div class="list-item-info">
-              {{item.description}}
+          </el-col>
+          <el-col :span="5">
+            <div class="project-people-number">
+              <span v-if="item.joinCount > 10000">{{item.joinCount > 10000 ? Math.floor(item.joinCount/10000) + 'w+' : item.joinCount}}人</span>
+              <span v-else>{{item.joinCount > 1000 ? Math.floor(item.joinCount/1000) + 'k+' : item.joinCount}}人</span>
             </div>
-          </div>
-        </el-col>
-        <el-col :span="5">
-          <div class="project-people-number">
-            <span v-if="item.joinCount > 10000">{{item.joinCount > 10000 ? Math.floor(item.joinCount/10000) + 'w+' : item.joinCount}}人</span>
-            <span v-else>{{item.joinCount > 1000 ? Math.floor(item.joinCount/1000) + 'k+' : item.joinCount}}人</span>
-          </div>
-        </el-col>
-      </el-row>
-    </div>
-  </el-card>
+          </el-col>
+        </el-row>
+      </div>
+    </el-card>
   </div>
 </template>
 
 <script>
   import {CONFIG} from '../../config/index'
+  import {storageGet} from '@/js/index.js'
+  import {notify} from "../../constants";
+
   export default {
     name: 'PopularProject',
-    props:['hotCrowdTestProjectVOs'],
-    data(){
-      return{
-        logo_background:CONFIG.logo_background,
-        logo_transparent:CONFIG.logo_transparent
+    props: ['hotCrowdTestProjectVOs'],
+    data() {
+      return {
+        logo_background: CONFIG.logo_background,
+        logo_transparent: CONFIG.logo_transparent,
+        isLogin: false,
+        user: {}
       }
     },
-    methods:{
-        goToMore(){
-            console.log("goToMoreProject");
-            this.$router.push({
-                name: 'PopularProjectAndTaskList',
-                params: {type: "project"}
-            })
-        },
-        goToProjectDetail (id) {
-            this.$router.push({name: 'Project', params: {projectId: id}})
+    methods: {
+      onload() {
+        if (storageGet('user') != null) {
+          this.isLogin = true;
+        }
+      },
+      goToMore() {
+        if (storageGet('user') == null) {
+          notify('warning', '请登录后访问');
+          return;
+        }
+        this.$router.push({
+          name: 'PopularProjectAndTaskList',
+          params: {type: "project"}
+        })
+      },
+      goToProjectDetail(id) {
+        if (storageGet('user') == null) {
+          notify('warning', '请登录后访问');
+          return;
         }
+        this.$router.push({name: 'Project', params: {projectId: id}})
+      },
     }
   }
 </script>
@@ -64,61 +81,69 @@
   .popular-card {
     margin-bottom: 15px;
   }
-  .popular-header .el-card__header{
-    border-bottom: 2px solid rgba(0,117,203,1) !important;
+
+  .popular-header .el-card__header {
+    border-bottom: 2px solid rgba(0, 117, 203, 1) !important;
   }
 
-  .popular-card .el-card__body{
+  .popular-card .el-card__body {
     padding: 0 !important;
   }
+
   .popular-header {
     height: 15px;
-    vertical-align:middle;
+    vertical-align: middle;
   }
+
   .popular-header-title {
     display: inline-block;
     line-height: 20px;
-    vertical-align:middle;
+    vertical-align: middle;
   }
+
   .popular-header-img {
     height: 25px;
     width: 25px;
-    vertical-align:middle;
+    vertical-align: middle;
   }
 
   .popular-list {
     .popular-list-item {
       padding: 10px 10px;
       border-bottom: 1px solid #ccc !important;
-      .list-item-title{
-        font-size:14px;
-        font-family:Source Han Sans CN;
-        font-weight:400;
-        color:rgba(0,0,0,1);
+
+      .list-item-title {
+        font-size: 14px;
+        font-family: Source Han Sans CN;
+        font-weight: 400;
+        color: rgba(0, 0, 0, 1);
         overflow: hidden;
-        text-overflow:ellipsis; //溢出用省略号显示
-        white-space:nowrap; //溢出不换行
+        text-overflow: ellipsis; //溢出用省略号显示
+        white-space: nowrap; //溢出不换行
       }
-      .list-item-info{
-        font-size:14px;
-        font-family:Adobe Heiti Std;
-        font-weight:normal;
-        color:rgba(153,153,153,1);
-        overflow:hidden; //超出的文本隐藏
-        text-overflow:ellipsis; //溢出用省略号显示
-        white-space:nowrap; //溢出不换行
+
+      .list-item-info {
+        font-size: 14px;
+        font-family: Adobe Heiti Std;
+        font-weight: normal;
+        color: rgba(153, 153, 153, 1);
+        overflow: hidden; //超出的文本隐藏
+        text-overflow: ellipsis; //溢出用省略号显示
+        white-space: nowrap; //溢出不换行
       }
+
       .project-logo-img {
         width: 44px;
         height: 44px;
         display: inline-block;
         margin: 2px 0;
       }
+
       .project-people-number {
-        font-size:16px;
-        font-family:Roboto;
-        font-weight:400;
-        color:$--color-primary;
+        font-size: 16px;
+        font-family: Roboto;
+        font-weight: 400;
+        color: $--color-primary;
         line-height: 48px;
       }
     }
@@ -126,5 +151,4 @@
   }
 
 
-
 </style>

+ 34 - 19
src/pages/Square/PopularTask.vue

@@ -3,15 +3,15 @@
     <div slot="header" class="popular-header">
       <img src="../../assets/img/popularTask.png" alt="popular-project" class="popular-header-img"/>
       <span class="popular-header-title">热门任务</span>
-      <el-button style="float: right; padding: 3px 0" type="text" class="pull-right"  @click="goToMore()">>></el-button>
+      <el-button style="float: right; padding: 3px 0" type="text" class="pull-right" @click="goToMore()">>></el-button>
     </div>
-    <div v-if="!hotCrowdTaskVOs.length" style="text-align: center;padding: 5px 0"><span>暂无任务</span></div>
+    <div v-if="!hotCrowdTaskVOs" style="text-align: center;padding: 5px 0"><span>暂无任务</span></div>
     <div class="popular-list" v-else>
       <el-row class="popular-list-item" v-for="item in hotCrowdTaskVOs" :key="item.id">
         <el-col :span="19">
           <img :src="logo_transparent" alt="logo-project" class="pull-left project-logo-img">
-          <div style="margin-left: 55px; cursor: pointer;"  @click="goToTaskDetail(item.projectId,item.code)">
-            <div class="list-item-title" >
+          <div style="margin-left: 55px; cursor: pointer;" @click="goToTaskDetail(item.projectId,item.code)">
+            <div class="list-item-title">
               {{item.title}}
             </div>
             <div class="list-item-info">
@@ -31,26 +31,41 @@
 
 <script>
   import {CONFIG} from "../../config";
+  import {storageGet} from '@/js/index.js'
+  import {notify} from "../../constants";
 
   export default {
     name: 'PopularTask',
-    props:['hotCrowdTaskVOs'],
-    data(){
-      return{
-        logo_transparent:CONFIG.logo_transparent
+    props: ['hotCrowdTaskVOs'],
+    data() {
+      return {
+        logo_transparent: CONFIG.logo_transparent
       }
     },
-      methods:{
-          goToMore(){
-              this.$router.push({
-                  name: 'PopularProjectAndTaskList',
-                  params: {type: "task"}
-              })
-          },
-          goToTaskDetail (projectId, id) {
-              this.$router.push({name: 'Task', params: {projectId: projectId, taskId: id}})
-          },
-      }
+    methods: {
+      onload() {
+        if (storageGet('user') != null) {
+          this.isLogin = true;
+        }
+      },
+      goToMore() {
+        if (storageGet('user') == null) {
+          notify('warning', '请登录后访问');
+          return;
+        }
+        this.$router.push({
+          name: 'PopularProjectAndTaskList',
+          params: {type: "task"}
+        })
+      },
+      goToTaskDetail(projectId, id) {
+        if (storageGet('user') == null) {
+          notify('warning', '请登录后访问');
+          return;
+        }
+        this.$router.push({name: 'Task', params: {projectId: projectId, taskId: id}})
+      },
+    }
   }
 </script>
 

+ 2 - 9
src/pages/Square/SquareCard.vue

@@ -79,19 +79,12 @@
       goToProjectDetail(id) {
         if (!this.isLogin) {
           notify('warning', '请登录后访问');
+        }else if (this.isLogin) {
+          this.$router.push({name: 'Project', params: {projectId: id}})
         }
-        // else if (this.isLogin) {
-        //   Http.get(Apis.USER.IS_PART.replace('{userId}', this.user.id)).then((res) => {
-        //     this.$router.push({name: 'Project', params: {projectId: id}})
-        //   }).catch((error) => {
-        //     notify('error', error.data)
-        //   })
-        // }
-        this.$router.push({name: 'Project', params: {projectId: id}})
       },
       goToTaskDetail(projectId, taskId) {
         if (!this.isLogin) {
-          console.log("请登录后访问");
           notify('warning', '请登录后访问');
         } else if (this.isLogin) {
           Http.get(Apis.USER.IS_AGENCY.replace('{userId}', this.user.id)).then((res) => {

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

@@ -18,7 +18,8 @@
           </el-col>
           <el-col :span="3">
             <div @click="gotoDetail(item)">
-              <span style="font-size: 14px">查看详情</span>
+              <span style="font-size: 14px" v-if="item.linkUrl.indexOf('var') != -1 || item.linkUrl.indexOf('aliyuncs.com') != -1">点击下载</span>
+              <span style="font-size: 14px" v-else>查看详情</span>
               <i class="el-icon-arrow-right get-info-btn"></i>
             </div>
           </el-col>