sunjh 6 years ago
parent
commit
454ecbcdf3

+ 3 - 3
src/components/Home.vue

@@ -65,11 +65,11 @@ export default {
     //加载数据
     loadData: function () {
       console.log('loadData')
-      Http.get(Apis.PAGE.HOME_PAGE,{}).then((res) => {
+      Http.get(Apis.PAGE.HOME_PAGE).then((res) => {
         console.log(res)
         this.hotTaskList = res.hotTaskList
-        this.institutionRank = res.institutionRank
-        this.personRank = res.personRank
+        this.institutionRank = res.agencyRank
+        this.personRank = res.userRank
         this.imgList = res.imgList
       })
     },

+ 1 - 1
src/components/Square.vue

@@ -97,7 +97,7 @@ export default {
     loadData() {
       console.log("loadData")
       Http.get(Apis.PAGE.SQUARE_PAGE).then((res) => {
-        this.list = res.taskList
+        this.list = res.crowdTaskVOList
       })
     }
   }

+ 65 - 38
src/components/project/Project.vue

@@ -52,7 +52,7 @@
             v-for="item in project.platform"
           >{{platformType[item]}}</span>
         </el-form-item>
-        <el-form-item label="需求描述" prop="desc">
+        <el-form-item label="需求描述">
           <el-input v-if="isModifyMode" type="textarea" v-model="project.desc"></el-input>
           <span v-if="!isModifyMode">{{project.desc}}</span>
         </el-form-item>
@@ -65,13 +65,13 @@
 
         <el-form-item label="服务类型" prop="type">
           <el-checkbox-group v-if="isModifyMode" v-model="project.type">
-            <el-checkbox label="接口测试" name="type"></el-checkbox>
-            <el-checkbox label="安全漏洞扫描" name="type"></el-checkbox>
-            <el-checkbox label="风险评估服务" name="type"></el-checkbox>
-            <el-checkbox label="源代码安全审计服务" name="type"></el-checkbox>
-            <el-checkbox label="功能测试服务" name="type"></el-checkbox>
-            <el-checkbox label="性能测试" name="type"></el-checkbox>
-            <el-checkbox label="功能和易用性测试" name="type"></el-checkbox>
+            <el-checkbox label="0" name="type">{{serviceType[0]}}</el-checkbox>
+            <el-checkbox label="1" name="type">{{serviceType[1]}}</el-checkbox>
+            <el-checkbox label="2" name="type">{{serviceType[2]}}</el-checkbox>
+            <el-checkbox label="3" name="type">{{serviceType[3]}}</el-checkbox>
+            <el-checkbox label="4" name="type">{{serviceType[4]}}</el-checkbox>
+            <el-checkbox label="5" name="type">{{serviceType[5]}}</el-checkbox>
+            <el-checkbox label="6" name="type">{{serviceType[6]}}</el-checkbox>
           </el-checkbox-group>
           <span v-if="!isModifyMode" class="badge" v-for="item in project.type">{{serviceType[item]}}</span>
         </el-form-item>
@@ -104,7 +104,7 @@
                 <el-radio
                   :label="item"
                   name="type"
-                  v-for="item,index in institutionArray"
+                  v-for="(item,index) in institutionArray"
                   :key="index"
                 ></el-radio>
               </el-radio-group>
@@ -235,8 +235,9 @@
     <div class="create-body" v-if="!isModifyMode">
       <div class="title h2">任务列表</div>
       <div class="task-list">
-        <el-table :showHeader="false" :data="task" style="width: 100%;min-height: 200px" max-height="800px">
-          <el-table-column prop="name" label="任务名称" title="任务名称"></el-table-column>
+        <el-table :showHeader="true" :stripe="true" :data="task" style="width: 100%;min-height: 200px"
+                  max-height="800px">
+          <el-table-column prop="title" label="任务名称" title="任务名称"></el-table-column>
           <el-table-column prop="datetime" sortable label="任务截止时间"></el-table-column>
           <el-table-column prop="resource" label="任务可见性">
             <template slot-scope="scope">
@@ -247,7 +248,7 @@
           </el-table-column>
           <el-table-column prop="type" label="业务类型">
             <template slot-scope="scope">
-              <div class="badge">{{serviceType[scope.row.type]}}</div>
+              <div class="badge">{{serviceType[scope.row.serviceType]}}</div>
             </template>
           </el-table-column>
 
@@ -271,7 +272,7 @@
 
     <div class="create-body" v-if="!isModifyMode">
       <div class="title h2">报告列表</div>
-      <report-list v-bind:reports="project.reportList"/>
+      <report-list v-bind:reports="project.reportList" v-bind:taskId=null v-bind:projectId="projectId"/>
     </div>
   </div>
 </template>
@@ -296,8 +297,8 @@ export default {
   data () {
     var validatePass = (rule, value, callback) => {
       var reg = /^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/
-      if (value.phone) {
-        if (!reg.test(value.phone)) {
+      if (this.project.contactPhone) {
+        if (!reg.test(this.project.contactPhone)) {
           callback(new Error('请检查手机号码'))
         } else {
           callback()
@@ -418,27 +419,47 @@ export default {
       return provinceName + ' / ' + cityName
     },
     init () {
-      this.projectId = +this.$route.params.projectId
+      this.projectId = this.$route.params.projectId
       this.loadData()
       this.project.platform.map(item => {
         this.platformType.push(PlatformType[item])
       })
     },
     submitForm (formName) {
-      this.$refs[formName].validate(valid => {
-        if (valid) {
-          this.isModifyMode = false
-          console.log(this.project)//pro1564487183259
-          Http.put(Apis.PROJECT.UPDATE_PROJECT.replace('{projectId}', this.projectId), this.project).then((res) => {
-            console.log(res)
-            console.log(this.project)
-          })
-          //提交 project
-        } else {
-          console.log('error submit!!')
-          return false
-        }
+      this.isModifyMode = false
+      //PROJ--2019073114009
+      const newProject = {
+        userId: 3,
+        name: this.project.name,
+        type: this.project.type,
+        platform: this.project.platform,
+        desc: this.project.desc,
+        resource: this.project.resource,
+        location: this.project.location,
+        institution: this.project.institution,
+        contactName: this.project.contactName,
+        contactPhone: this.project.contactPhone,
+        doc: 'asd',
+        file: 'asd',
+        budget: this.project.budget,
+        price: this.project.price,
+        datetime: this.project.datetime,
+        usage: this.project.usage,
+      }
+      console.log(newProject)
+      Http.put(Apis.PROJECT.UPDATE_PROJECT.replace('{projectId}', 'PROJ--2019073114009'), newProject).then((res) => {
+        console.log(res)
+        console.log(this.project)
       })
+      // this.$refs[formName].validate(valid => {
+      //   if (valid) {
+      //
+      //     //提交 project
+      //   } else {
+      //     console.log('error submit!!')
+      //     return false
+      //   }
+      // })
     },
     resetForm (formName) {
       this.$refs[formName].resetFields()
@@ -448,10 +469,8 @@ export default {
       this.project.desc = ''
       this.project.doc = ''
       this.project.file = ''
-      this.project.contact = {
-        name: '',
-        phone: ''
-      }
+      this.project.contactName = ''
+      this.project.contactPhone = ''
       this.project.resource = '2'
       this.project.institution = ''
       this.project.datetime = ''
@@ -462,24 +481,32 @@ export default {
     modifyForm () {
       this.isModifyMode = true
       //获得update 信息
-      this.loadData()
+      //this.loadData()
     },
     cancelMode (formName) {
       this.isModifyMode = false
       this.loadData()
 
     },
-    goToTaskDetail (id) {
+    goToTaskDetail (projectId, taskId) {
       this.$router.push({
         name: 'Task',
-        params: {projectId: this.projectId, taskId: id}
+        params: {projectId: projectId, taskId: taskId}
       })
     },
     createTask () {
       this.$router.push({name: 'TaskCreate'})
     },
     createReport () {
-      this.$router.push({name: 'ReportCreate'})
+      this.$router.push({
+        name: 'ReportCreate',
+        params: {
+          scope: 0,
+          dependencyCode: this.projectId,
+          projectId: this.projectId,
+          taskId: null,
+        }
+      })
     },
     handleDelete (index, id) {
       this.task.splice(index, 1)
@@ -502,7 +529,7 @@ export default {
     handleReject (index, id) {
       console.log('拒绝')
     },
-    loadData () {//pro1564487183259
+    loadData () {//PROJ--2019073114009
       Http.get(Apis.PROJECT.GET_PROJECT.replace('{projectId}', this.projectId)).then((res) => {
         console.log(res)
         this.project = res.projectDetails

+ 81 - 60
src/components/report/Report.vue

@@ -8,12 +8,12 @@
         </el-form-item>
         <el-form-item label="报告类型" prop="type">
           <el-radio-group v-if="isModifyMode" v-model="report.type">
-            <el-radio :label="serviceType[0]" name="type">{{ serviceType[0] }}</el-radio>
-            <el-radio :label="serviceType[1]" name="type">{{ serviceType[1] }}</el-radio>
-            <el-radio :label="serviceType[2]" name="type">{{ serviceType[2] }}</el-radio>
-            <el-radio :label="serviceType[3]" name="type">{{ serviceType[3] }}</el-radio>
-            <el-radio :label="serviceType[4]" name="type">{{ serviceType[4] }}</el-radio>
-            <el-radio :label="serviceType[5]" name="type">{{ serviceType[5] }}</el-radio>
+            <el-radio :label="0" name="type">{{ serviceType[0] }}</el-radio>
+            <el-radio :label="1" name="type">{{ serviceType[1] }}</el-radio>
+            <el-radio :label="2" name="type">{{ serviceType[2] }}</el-radio>
+            <el-radio :label="3" name="type">{{ serviceType[3] }}</el-radio>
+            <el-radio :label="4" name="type">{{ serviceType[4] }}</el-radio>
+            <el-radio :label="5" name="type">{{ serviceType[5] }}</el-radio>
           </el-radio-group>
           <span v-if="!isModifyMode" class="badge">{{serviceType[report.type]}}</span>
         </el-form-item>
@@ -24,8 +24,8 @@
                 <span>测试对象</span>
               </el-col>
               <el-col :span="10">
-                <el-input v-if="isModifyMode" type="textarea" v-model="report.abstract.target"></el-input>
-                <span v-if="!isModifyMode">{{report.abstract.target}}</span>
+                <el-input v-if="isModifyMode" type="textarea" v-model="report.target"></el-input>
+                <span v-if="!isModifyMode">{{report.target}}</span>
               </el-col>
             </el-row>
             <el-row :gutter="2">
@@ -33,8 +33,8 @@
                 <span>测试内容</span>
               </el-col>
               <el-col :span="10">
-                <el-input v-if="isModifyMode" type="textarea" v-model="report.abstract.content"></el-input>
-                <span v-if="!isModifyMode">{{report.abstract.content}}</span>
+                <el-input v-if="isModifyMode" type="textarea" v-model="report.content"></el-input>
+                <span v-if="!isModifyMode">{{report.content}}</span>
               </el-col>
             </el-row>
           </div>
@@ -51,7 +51,7 @@
             :limit="1"
             :on-exceed="handleExceed"
             :before-upload="beforeFileUpload"
-            :file-list="report.file"
+            :file-list="[report.file]"
           >
             <i class="el-icon-upload"></i>
             <div class="el-upload__text">
@@ -61,9 +61,9 @@
             <div class="el-upload__tip" slot="tip">请上传报告文件</div>
           </el-upload>
           <div v-if="!isModifyMode">
-            <span v-if="report.file.length==0">暂无文件</span>
-            <a :href="report.file[0].url" v-if="report.file.length>0"><i class="fa fa-file-text-o"></i>
-              {{report.file[0].name}}</a>
+            <span v-if="report.file==null">暂无文件</span>
+            <a :href="report.file" v-if="report.file!=null"><i class="fa fa-file-text-o"></i>
+              {{report.file}}</a>
           </div>
         </el-form-item>
 
@@ -96,27 +96,36 @@ export default {
   data () {
     return {
       reportId: 0,
+      projectId: '',
+      taskId:'',
       isModifyMode: false,
       serviceType: ServiceType,
-      report: {},
+      report: {
+        name: '',
+        type: '',
+        description: '',
+        content:'',
+        file: [],
+        conclusion:''
+      },
       rules: {
-        name: [
-          {required: true, message: '请输入报告名称', trigger: 'blur'}
-          // { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" }
-        ],
-        abstract: [
-          {
-            required: true,
-            message: '请输入摘要信息',
-            trigger: 'change'
-          }
-        ],
-        type: [
-          {required: true, message: '请选择报告类型', trigger: 'change'}
-        ],
-        conclusion: [
-          {required: true, message: '请输入报告结论', trigger: 'blur'}
-        ]
+        // name: [
+        //   {required: true, message: '请输入报告名称', trigger: 'blur'}
+        //   // { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" }
+        // ],
+        // abstract: [
+        //   {
+        //     required: true,
+        //     message: '请输入摘要信息',
+        //     trigger: 'change'
+        //   }
+        // ],
+        // type: [
+        //   {required: true, message: '请选择报告类型', trigger: 'change'}
+        // ],
+        // conclusion: [
+        //   {required: true, message: '请输入报告结论', trigger: 'blur'}
+        // ]
       }
     }
   },
@@ -127,49 +136,52 @@ export default {
   },
   methods: {
     init () {
-      this.reportId = +this.$route.params.reportId
+      this.reportId = this.$route.params.reportId
+      this.projectId = this.$route.params.projectId
+      this.taskId = this.$route.params.taskId
       this.loadData()
     },
     modifyForm () {
       this.isModifyMode = true
     },
     submitForm (formName) {
-      this.$refs[formName].validate(valid => {
-        if (valid) {
-          this.isModifyMode = false
-          Http.put(Apis.REPORT, this.report).then((res) => {
-            console.log(this.report)
-            console.log(res)
-          })
-          //提交 report
-        } else {
-          console.log('error submit!!')
-          return false
-        }
+      const newReport = {
+        name: this.report.name,
+        scope: this.taskId == null ? 0 : 1,
+        type: this.report.type,
+        dependencyCode: this.taskId == null ? this.projectId : this.taskId,
+        target: this.report.target,
+        content: this.report.content,
+        file: '123.pdf',
+        conclusion: this.report.conclusion
+      }
+      console.log(newReport)
+      Http.put(Apis.REPORT.UPDATE_REPORT.replace('{projectId}', this.projectId).replace('{taskId}', this.taskId).replace('{reportId}', this.reportId), newReport).then((res) => {
+        console.log(res)
       })
+      // this.$refs[formName].validate(valid => {
+      //   if (valid) {
+      //     this.isModifyMode = false
+      //
+      //     //提交 report
+      //   } else {
+      //     console.log('error submit!!')
+      //     return false
+      //   }
+      // })
     },
     resetForm (formName) {
       this.$refs[formName].resetFields()
       this.report.name = ''
-      this.report.abstract.target = ''
-      this.report.abstract.content = ''
-      this.report.file = []
+      this.report.target = ''
+      this.report.content = ''
+      this.report.file = ''
       this.report.type = ''
       this.report.conclusion = ''
     },
     cancelCreate () {
       this.isModifyMode = false
       //请求 report
-      this.report = {
-        name: '测试报告1',
-        abstract: {
-          target: '测试对象xxxx',
-          content: '测试内容xxxxx'
-        },
-        file: [{name: 'report5', url: 'report5.excel'}],
-        type: '项目测试方案',
-        conclusion: 'app挺好'
-      }
     },
     handleRemove (file, fileList) {
       console.log(file, fileList)
@@ -195,8 +207,17 @@ export default {
       }
     },
     loadData () {
-      Http.get(Apis.REPORT).then((res) => {
-        this.report = res.report
+      //pro1564487183259
+      //pro1564487183259_task1564487274060
+      //pro1564487183259pro1564487183259_task1564487274060_rep1564488510500
+      console.log('***')
+      console.log(this.projectId)
+      console.log(this.taskId)
+      console.log(this.reportId)
+      console.log('***')
+      Http.get(Apis.REPORT.GET_REPORT.replace('{projectId}', this.projectId).replace('{taskId}', this.taskId).replace('{reportId}', this.reportId)).then((res) => {
+        console.log(res)
+        this.report = res.crowdReportVO
       })
     }
   }

+ 43 - 13
src/components/report/ReportCreate.vue

@@ -82,6 +82,10 @@ export default {
   data () {
     return {
       reportType: ReportType,
+      scope: 0,
+      projectId:'',
+      taskId:'',
+      dependencyCode: '',
       report: {
         name: '',
         abstract: {
@@ -117,22 +121,48 @@ export default {
     }
   },
   mounted () {
+    this.$nextTick(() => {
+      this.init()
+    })
   },
   methods: {
+    init () {
+      this.scope = this.$route.params.scope
+      this.dependencyCode = this.$route.params.dependencyCode
+      this.projectId = this.$route.params.projectId
+      this.taskId = this.$route.params.taskId
+    },
     submitForm (formName) {
-      console.log(this.report)
-      this.$refs[formName].validate(valid => {
-        if (valid) {
-          Http.post(Apis.REPORT, this.report).then((res) => {
-            console.log(this.report)
-            console.log(res)
-          })
-          //提交 report
-        } else {
-          console.log('error submit!!')
-          return false
-        }
-      })
+      const newReport = {
+        name: this.report.name,
+        scope: this.scope,
+        type: this.report.type,
+        dependencyCode: this.dependencyCode,
+        target: this.report.abstract.target,
+        content: this.report.abstract.content,
+        file: '123.pdf',
+        conclusion: this.report.conclusion
+      }
+      console.log(newReport)
+      if (this.taskId == null){
+        Http.post(Apis.REPORT.CREATE_REPORT.replace('{projectId}',this.projectId).replace('{taskId}',this.taskId), newReport).then((res) => {
+          console.log(res)
+        })
+      }else{
+        Http.post(Apis.REPORT.CREATE_REPORT.replace('{projectId}',this.projectId).replace('{taskId}',this.taskId), newReport).then((res) => {
+          console.log(res)
+        })
+      }
+
+      // this.$refs[formName].validate(valid => {
+      //   if (valid) {
+      //
+      //     //提交 report
+      //   } else {
+      //     console.log('error submit!!')
+      //     return false
+      //   }
+      // })
     },
     resetForm (formName) {
       this.$refs[formName].resetFields()

+ 23 - 4
src/components/report/ReportList.vue

@@ -9,7 +9,7 @@
       </el-col>
     </el-row>-->
 
-    <el-table :showHeader="false" :data="reportList" style="width: 100%">
+    <el-table :showHeader="true" :data="reportList" style="width: 100%">
       <el-table-column prop="type" label="报告类型" title="报告类型">
         <template slot-scope="scope">
           <span class="badge">{{serviceType[scope.row.type]}}</span>
@@ -37,17 +37,30 @@ import ServiceType from '../../constants/enum/service-type'
 
 export default {
   name: 'report-list',
-  props: {reports: {}},
+  props: {
+    reports: {},
+    projectId: '',
+    taskId: ''
+  },
   data () {
     return {
       editIndex: -1,
       serviceType: ServiceType,
-      reportList: this.reports
+      reportList: this.reports,
+      pid: this.projectId,
+      tid: this.taskId,
     }
   },
   methods: {
     handleEdit (index, row) {
-      this.$router.push({name: 'Report', params: {reportId: row.id}})
+      this.$router.push({
+        name: 'Report',
+        params: {
+          reportId: row.code,
+          projectId: this.pid,
+          taskId: this.tid
+        }
+      })
       // this.editIndex = index;
     },
     handleDelete (index, row) {
@@ -75,6 +88,12 @@ export default {
   watch: {
     reports () {
       this.reportList = this.reports
+    },
+    projectId () {
+      this.pid = this.projectId
+    },
+    taskId () {
+      this.tid = this.taskId
     }
   }
 }

+ 17 - 11
src/components/task/Task.vue

@@ -93,7 +93,7 @@
     </div>
     <div class="create-body" v-if="!isModifyMode">
       <div class="title h2">报告列表</div>
-      <report-list v-bind:reports="reportList"/>
+      <report-list v-bind:reports="reportList" v-bind:taskId="taskId" v-bind:projectId="projectId"/>
     </div>
   </div>
 </template>
@@ -121,8 +121,8 @@ export default {
       tabPosition: 'top',
       resourceType: ResourceType,
       serviceType: ServiceType,
-      taskId: 0,
-      projectId: 0,
+      taskId: '',
+      projectId: '',
       task: {},
       reportList: [],
       pickerOptions: {
@@ -201,9 +201,9 @@ export default {
   },
   methods: {
     init () {
-      this.taskId = +this.$route.params.taskId
-      this.projectId = +this.$route.params.projectId
-      this.loadData()
+      this.taskId = this.$route.params.taskId
+      this.projectId = this.$route.params.projectId
+      this.loadData(this.projectId,this.taskId)
     },
     updateLocation (location) {
       var provinceName = ''
@@ -253,7 +253,6 @@ export default {
     },
     modifyForm () {
       this.isModifyMode = true
-      this.loadData()
     },
     resetForm (formName) {
       this.$refs.addFormProvince.resetProviceCity()
@@ -283,14 +282,21 @@ export default {
       console.log('申请项目')
     },
     createReport () {
-      this.$router.push({name: 'ReportCreate'})
+      this.$router.push({
+        name: 'ReportCreate',
+        params:{
+          scope: 1,
+          dependencyCode: this.taskId,
+          projectId: this.projectId,
+          taskId: this.taskId,
+        }
+      })
     },
-    loadData () {
+    loadData (projectId,taskId) {
       //replace('{taskId}', this.taskId)
-      Http.get(Apis.TASK.GET_TASK.replace('{projectId}', 'pro1564487183259').replace('{taskId}', 'pro1564487183259_task1564487274060')).then((res) => {
+      Http.get(Apis.TASK.GET_TASK.replace('{projectId}',projectId).replace('{taskId}', taskId)).then((res) => {
         this.task = res.crowdTaskVO
         this.reportList = res.crowdReportVOList
-        console.log(this.task)
       })
     },
 

+ 2 - 2
src/components/task/TaskCreate.vue

@@ -177,7 +177,7 @@ export default {
   },
   methods: {
     init () {
-      this.projectId = +this.$route.params.projectId
+      this.projectId = this.$route.params.projectId
     },
     updateLocation (location) {
       var provinceName = ''
@@ -196,7 +196,7 @@ export default {
       return provinceName + ' / ' + cityName
     },
     submitForm (formName) {
-      Http.post(Apis.TASK.CREATE_TASK.replace('{projectId}', 'pro1564487183259'), this.task).then((res) => {
+      Http.post(Apis.TASK.CREATE_TASK.replace('{projectId}', this.projectId), this.task).then((res) => {
         console.log(res)
       })
       // this.$refs[formName].validate(valid => {

+ 6 - 6
src/js/api.js

@@ -12,15 +12,15 @@ export default {
     DELETE_TASK: '/api/project/{projectId}/task/{taskId}/'
   },
   REPORT: {
-    GET_REPORT: '/api/report/{reportId}/',
-    CREATE_REPORT: '/api/report/',
-    UPDATE_REPORT: '/api/report/{reportId}/',
-    DELETE_REPORT: '/api/report/{reportId}/'
+    GET_REPORT: '/api/project/{projectId}/task/{taskId}/report/{reportId}/',
+    CREATE_REPORT: '/api/project/{projectId}/task/{taskId}/report/',
+    UPDATE_REPORT: '/api/project/{projectId}/task/{taskId}/report/{reportId}/',
+    DELETE_REPORT: '/api/project/{projectId}/task/{taskId}/report/{reportId}/'
   },
   USER: {},
   PAGE: {
-    HOME_PAGE: '/api/page/home/',
-    SQUARE_PAGE: '/api/page/square/',
+    HOME_PAGE: '/api/index/',
+    SQUARE_PAGE: '/api/task/',
     MY_CROWD_TEST_PAGE: '/api/page/myCrowdTest/',
     TASK_DETAIL_PAGE: '/api/page/taskDetail/{taskId}/',
     PROJECT_DETAIL_PAGE: '/api/project/{projectId}/',

+ 2 - 2
src/mock.js

@@ -20,12 +20,12 @@ const updateReportMock = require('./mock/updateReportMock')
 Mock.mock(Apis.PROJECT.CREATE_ANALYSE_DEMAND_SUBMIT, 'post', createAnalyseDemandMock.data)
 Mock.mock(Apis.PROJECT.CREATE_PROJECT_SUBMIT, 'post', createProjectMock.data)
 Mock.mock(Apis.REPORT.CREATE_REPORT_SUBMIT, 'post', createReportMock.data)
-Mock.mock(Apis.TASK.CREATE_TASK_SUBMIT, 'post', createTaskMock.data)
+Mock.mock(Apis.TASK.CREATE_TASK, 'post', createTaskMock.data)
 Mock.mock(Apis.PAGE.HOME_PAGE, 'get', getHomePageMock.data)
 Mock.mock(Apis.PAGE.SQUARE_PAGE, 'get', getSquarePageMock.data)
 Mock.mock(Apis.PAGE.PROJECT_DETAIL_PAGE, 'get', getProjectDetailMock.data)
 Mock.mock(Apis.PAGE.REPORT_DETAIL_PAGE, 'get', getReportDetailMock.data)
-Mock.mock(Apis.PAGE.TASK_DETAIL_PAGE.replace('{taskId}', 0), 'get', getTaskDetailMock.data)
+Mock.mock('/api/project/pro1564487183259/task/pro1564487183259_task1564487274060/', 'get', getTaskDetailMock.data)
 Mock.mock(Apis.PAGE.MY_CROWD_TEST_PAGE, 'get', getMyCrowdTestMock.data)
 Mock.mock(Apis.PROJECT.UPDATE_PROJECT_SUBMIT, 'put', updateProjectMock.data)
 Mock.mock(Apis.REPORT.UPDATE_REPORT_SUBMIT, 'put', updateReportMock.data)

+ 2 - 2
src/mock/getTaskDetailMock.js

@@ -1,7 +1,7 @@
 var Mock = require('mockjs')
 var data = Mock.mock({
   //任务信息
-  'task': {
+  'crowdTaskVO': {
     //任务id
     'id': 1,
     //任务所属项目id
@@ -41,7 +41,7 @@ var data = Mock.mock({
     'datetime': 'Sun Nov 11 2018 23:11:11 GMT+0800 (中国标准时间)'
   },
   // 任务报告列表
-  'reportList': [
+  'crowdReportVOList': [
     {
       //报告id
       'id': 2,