Ver código fonte

before merge

wjj 4 anos atrás
pai
commit
c126e5400c

+ 11 - 11
config/dev.env.js

@@ -3,18 +3,18 @@
 const merge = require('webpack-merge')
 const prodEnv = require('./prod.env')
 
-// module.exports = {
-//   NODE_ENV: '"development"',
-//   ENV_CONFIG: "'dev'",
-//   API_ROOT: '"//crowd.dev.mooctest.net"',
-//   LOGIN_URL: '"http://user.mooctest.net:8081/page/login?redirect=http%3a%2f%2fcrowd.dev.mooctest.net%2f%23%2fhome"',
-//   REGISTER_URL: '"http://user.mooctest.net:8081/page/register"'
-// }
-
 module.exports = {
   NODE_ENV: '"development"',
   ENV_CONFIG: "'dev'",
-  API_ROOT: '"//127.0.0.1"',
-  LOGIN_URL: '"http://127.0.0.1:8081/page/login?redirect=http%3a%2f%2fcrowd.dev.mooctest.net%2f%23%2fhome"',
-  REGISTER_URL: '"http://127.0.0.1:8081/page/register"'
+  API_ROOT: '"//crowd.dev.mooctest.net"',
+  LOGIN_URL: '"http://user.mooctest.net:8081/page/login?redirect=http%3a%2f%2fcrowd.dev.mooctest.net%2f%23%2fhome"',
+  REGISTER_URL: '"http://user.mooctest.net:8081/page/register"'
 }
+
+// module.exports = {
+//   NODE_ENV: '"development"',
+//   ENV_CONFIG: "'dev'",
+//   API_ROOT: '"//127.0.0.1"',
+//   LOGIN_URL: '"http://127.0.0.1:8081/page/login?redirect=http%3a%2f%2fcrowd.dev.mooctest.net%2f%23%2fhome"',
+//   REGISTER_URL: '"http://127.0.0.1:8081/page/register"'
+// }

BIN
src/assets/image/police.png


+ 293 - 274
src/components/Mine.vue

@@ -4,26 +4,26 @@
     <div class="project-statistics">
       <el-card shadow="hover" v-if="showAcceptData" class="project-statistics-card">
         <div class="project-statistics-card-title">未完成任务数</div>
-        <div class="project-statistics-card-number">{{statisticData.unfinishedTaskCount || 0}}</div>
+        <div class="project-statistics-card-number">{{ statisticData.unfinishedTaskCount || 0 }}</div>
       </el-card>
       <el-card shadow="hover" v-if="showAcceptData" class="project-statistics-card">
         <div class="project-statistics-card-title">已完成任务数</div>
-        <div class="project-statistics-card-number">{{statisticData.finishedTaskCount || 0}}</div>
+        <div class="project-statistics-card-number">{{ statisticData.finishedTaskCount || 0 }}</div>
       </el-card>
       <el-card shadow="hover" v-if="showCreateData" class="project-statistics-card">
         <div class="project-statistics-card-title">我的项目数</div>
-        <div class="project-statistics-card-number">{{statisticData.myProjectCount || 0}}</div>
+        <div class="project-statistics-card-number">{{ statisticData.myProjectCount || 0 }}</div>
       </el-card>
       <el-card shadow="hover" v-if="showCreateData" class="project-statistics-card">
         <div class="project-statistics-card-title">处理中项目数</div>
-        <div class="project-statistics-card-number">{{statisticData.handlingProjectCount || 0}}</div>
+        <div class="project-statistics-card-number">{{ statisticData.handlingProjectCount || 0 }}</div>
       </el-card>
       <el-card shadow="hover" v-if="showCreateData" class="project-statistics-card">
         <div class="project-statistics-card-title">可接收项目数</div>
-        <div class="project-statistics-card-number">{{statisticData.acceptableProjectCount || 0}}</div>
+        <div class="project-statistics-card-number">{{ statisticData.acceptableProjectCount || 0 }}</div>
       </el-card>
     </div>
-    <div class="mine-body" style="text-align: center;">
+    <div class="mine-body" style="text-align: center;position: relative">
       <el-tabs value="myProject" @tab-click="handleTabClick" v-loading="loading" style="width: 90%;margin-left: 5%">
         <el-tab-pane name="unFinishedTask">
           <span slot="label">
@@ -59,8 +59,6 @@
           <task-item v-if="finishedTaskList != null || finishedTaskList.length > 0"
                      v-for="(item,index2) in finishedTaskList" :key="index2" :task="item"/>
         </el-tab-pane>
-
-
         <el-tab-pane name="myProject">
 
           <span slot="label">
@@ -123,307 +121,328 @@
                         v-for="(item,index) in acceptableProjects" :key="index" :projectItem="item"/>
         </el-tab-pane>
       </el-tabs>
-      <el-button @click="handleInputTask">导入任务</el-button>
+
+      <el-button type="primary" size='mini' class="input-task-btn" @click="showInputTaskModal = true">导入任务</el-button>
+      <el-dialog
+        title="提示"
+        :visible.sync="showInputTaskModal"
+        width="500"
+      >s
+        <span>这是一段信息</span>
+        <span slot="footer" class="dialog-footer">
+        <el-button @click="showInputTaskModal = false">取 消</el-button>
+        <el-button type="primary" @click="showInputTaskModal = false">确 定</el-button>
+  </span>
+      </el-dialog>
+
     </div>
   </div>
 </template>
 
 <script>
-  import TaskItem from '@/components/commons/TaskItem'
-  import ProjectItem from '@/components/commons/ProjectItem'
-  import Http from '@/js/http.js'
-  import Apis from '@/js/api.js'
-  import {notify} from '@/constants/index'
-  import {defaultValue, storageGet} from '@/js/index'
-  import echarts from 'echarts'
+import TaskItem from '@/components/commons/TaskItem'
+import ProjectItem from '@/components/commons/ProjectItem'
+import Http from '@/js/http.js'
+import Apis from '@/js/api.js'
+import {notify} from '@/constants/index'
+import {defaultValue, storageGet} from '@/js/index'
+import echarts from 'echarts'
 
-  export default {
-    name: 'Mine',
-    components: {TaskItem, ProjectItem},
-    watch: {
-      user(val) {
-        this.user = val
+export default {
+  name: 'Mine',
+  components: {TaskItem, ProjectItem},
+  watch: {
+    user(val) {
+      this.user = val
+    },
+    rolesPermissions(val) {
+      this.rolesPermissions = val
+    },
+    deep: true
+  },
+  data() {
+    return {
+      statisticData: {},
+      showInputTaskModal:false,
+      loading: false,
+      unFinishedTaskList: [],
+      finishedTaskList: [],
+      appliedProjectList: [],
+      myProjects: [],
+      handlingProjects: [],
+      acceptableProjects: [],
+      defaultValue: defaultValue,
+      myProjectNoticeCount: 0,
+      processProjectNoticeCount: 0,
+      acceptableProjectNoticeCount: 0,
+      rolesPermissions: {
+        isRegionManager: false,
+        isIndividualUser: false,
+        isEnterpriseUser: false,
+        isAgency: false,
+        isSystemAdministrator: false
       },
-      rolesPermissions(val) {
-        this.rolesPermissions = val
+      user: {
+        userVO: {
+          id: '',
+          name: '',
+          photo: '',
+          roleList: []
+        }
       },
-      deep: true
+      isLogin: false,
+      showCreateData: false,
+      showAcceptData: false
+    }
+  },
+  mounted() {
+    this.$nextTick(() => {
+      console.log('nexttick')
+      this.init();
+      this.checkCreateProjectAuth();
+      this.checkAcceptTaskAuth()
+    })
+  },
+  methods: {
+    init() {
+      this.setUserInfo()
+      this.setRolesPermissions()
+      this.loadData()
+      // this.setEcharts()
+      // storageGet('user').then((res)=>{
+      //   this.user = res;
+      //   this.setRolesPermissions()
+      //   this.loadData()
+      // })
+
     },
-    data() {
-      return {
-        statisticData: {},
-        loading: false,
-        unFinishedTaskList: [],
-        finishedTaskList: [],
-        appliedProjectList: [],
-        myProjects: [],
-        handlingProjects: [],
-        acceptableProjects: [],
-        defaultValue: defaultValue,
-        myProjectNoticeCount: 0,
-        processProjectNoticeCount: 0,
-        acceptableProjectNoticeCount: 0,
-        rolesPermissions: {
-          isRegionManager: false,
-          isIndividualUser: false,
-          isEnterpriseUser: false,
-          isAgency: false,
-          isSystemAdministrator: false
+    loadData() {
+      this.showLoading()
+      Http.get(Apis.PAGE.MY_CROWD_TEST_PAGE.replace('{userId}', this.user.userVO.id)).then((res) => {
+        this.hideLoading()
+        this.statisticData = res;
+        this.processProjectNoticeCount = res.processProjectNoticeCount == null ? 0 : res.processProjectNoticeCount
+        this.myProjectNoticeCount = res.myProjectNoticeCount == null ? 0 : res.myProjectNoticeCount
+        this.acceptableProjectNoticeCount = res.acceptableProjectNoticeCount == null ? 0 : res.acceptableProjectNoticeCount
+        if (res.unfinishedTasks != null && res.unfinishedTasks.length > 0) {
+          this.unFinishedTaskList = res.unfinishedTasks
+        }
+        if (res.finishedTasks != null && res.finishedTasks.length > 0) {
+          this.finishedTaskList = res.finishedTasks
+        }
+        if (res.myProjects != null && res.myProjects.length > 0) {
+          this.myProjects = res.myProjects
+        }
+        if (res.handlingProjects != null && res.handlingProjects.length > 0) {
+          this.handlingProjects = res.handlingProjects
+        }
+        if (res.acceptableProjects != null && res.acceptableProjects.length > 0) {
+          this.acceptableProjects = res.acceptableProjects
+        }
+        // if (res.userVO != null && res.userVO.length > 0) {
+        //   this.user = res.userVO
+        // }
+      }).catch((error) => {
+        this.hideLoading()
+        notify('error', '加载失败,请稍后重试')
+      })
+    },
+    setUserInfo() {
+      if (storageGet('user') != null) {
+        this.isLogin = true;
+        this.user = storageGet('user')
+      }
+    },
+    setRolesPermissions() {
+      this.rolesPermissions = storageGet('rolesPermissions')
+    },
+    setEcharts() {
+      // 基于准备好的dom,初始化echarts实例
+      let myChart = echarts.init(document.getElementById('myChart'))
+      // 绘制图表
+      var option = {
+        title: {
+          text: ''
         },
-        user: {
-          userVO: {
-            id: '',
-            name: '',
-            photo: '',
-            roleList: []
-          }
+        tooltip: {
+          //trigger: 'axis'
+        },
+        legend: {
+          data: ['接收项目数量', '完成项目数量', '接收任务数量', '完成任务数量', '发布项目数量']
         },
-        isLogin: false,
-        showCreateData: false,
-        showAcceptData: false
+        grid: {
+          left: '5%',
+          right: '8%',
+          bottom: '3%',
+          top: '10%',
+          containLabel: true
+        },
+        toolbox: {
+          feature: {
+            saveAsImage: {
+              title: '保存为图片',
+              name: '我的众测'
+            }
+          },
+          right: '20px'
+        },
+        xAxis: {
+          type: 'category',
+          boundaryGap: false,
+          data: ['2020年1月', '2020年2月', '2020年3月', '2020年4月', '2020年5月', '2020年6月', '2020年7月']
+        },
+        yAxis: {
+          type: 'value'
+        },
+        series: [
+          {
+            name: '接收项目数量',
+            type: 'line',
+            stack: '总量',
+            data: [2, 3, 3, 2, 4, 5, 6]
+          },
+          {
+            name: '完成项目数量',
+            type: 'line',
+            stack: '总量',
+            data: [2, 3, 3, 2, 4, 5, 6]
+          },
+          {
+            name: '接收任务数量',
+            type: 'line',
+            stack: '总量',
+            data: [22, 33, 41, 14, 55, 33, 41]
+          },
+          {
+            name: '完成任务数量',
+            type: 'line',
+            stack: '总量',
+            data: [21, 33, 31, 14, 39, 33, 32]
+          },
+          {
+            name: '发布项目数量',
+            type: 'line',
+            stack: '总量',
+            data: [2, 3, 1, 0, 1, 2, 2]
+          }
+        ]
       }
+      myChart.setOption(option)
     },
-    mounted() {
-      this.$nextTick(() => {
-        console.log('nexttick')
-        this.init();
-        this.checkCreateProjectAuth();
-        this.checkAcceptTaskAuth()
-      })
+    showLoading() {
+      this.loading = true
     },
-    methods: {
-      init() {
-        this.setUserInfo()
-        this.setRolesPermissions()
-        this.loadData()
-        // this.setEcharts()
-        // storageGet('user').then((res)=>{
-        //   this.user = res;
-        //   this.setRolesPermissions()
-        //   this.loadData()
-        // })
-
-      },
-      loadData() {
-        this.showLoading()
-        Http.get(Apis.PAGE.MY_CROWD_TEST_PAGE.replace('{userId}', this.user.userVO.id)).then((res) => {
-          this.hideLoading()
-          this.statisticData = res;
-          this.processProjectNoticeCount = res.processProjectNoticeCount == null ? 0 : res.processProjectNoticeCount
-          this.myProjectNoticeCount = res.myProjectNoticeCount == null ? 0 : res.myProjectNoticeCount
-          this.acceptableProjectNoticeCount = res.acceptableProjectNoticeCount == null ? 0 : res.acceptableProjectNoticeCount
-          if (res.unfinishedTasks != null && res.unfinishedTasks.length > 0) {
-            this.unFinishedTaskList = res.unfinishedTasks
-          }
-          if (res.finishedTasks != null && res.finishedTasks.length > 0) {
-            this.finishedTaskList = res.finishedTasks
-          }
-          if (res.myProjects != null && res.myProjects.length > 0) {
-            this.myProjects = res.myProjects
-          }
-          if (res.handlingProjects != null && res.handlingProjects.length > 0) {
-            this.handlingProjects = res.handlingProjects
+    hideLoading() {
+      this.loading = false
+    },
+    handleTabClick(event) {
+      if (event.name == 'myProject') {
+        //this.myProjectNoticeCount = 0
+      }
+      if (event.name == 'handlingProject') {
+        //this.processProjectNoticeCount = 0
+      }
+      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;
           }
-          if (res.acceptableProjects != null && res.acceptableProjects.length > 0) {
-            this.acceptableProjects = res.acceptableProjects
+        }).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;
           }
-          // if (res.userVO != null && res.userVO.length > 0) {
-          //   this.user = res.userVO
-          // }
         }).catch((error) => {
-          this.hideLoading()
-          notify('error', '加载失败,请稍后重试')
+          // notify('error', error)
         })
-      },
-      handleInputTask(){
-        console.log('input')
-      },
-      setUserInfo() {
-        if (storageGet('user') != null) {
-          this.isLogin = true;
-          this.user = storageGet('user')
-        }
-      },
-      setRolesPermissions() {
-        this.rolesPermissions = storageGet('rolesPermissions')
-      },
-      setEcharts() {
-        // 基于准备好的dom,初始化echarts实例
-        let myChart = echarts.init(document.getElementById('myChart'))
-        // 绘制图表
-        var option = {
-          title: {
-            text: ''
-          },
-          tooltip: {
-            //trigger: 'axis'
-          },
-          legend: {
-            data: ['接收项目数量', '完成项目数量', '接收任务数量', '完成任务数量', '发布项目数量']
-          },
-          grid: {
-            left: '5%',
-            right: '8%',
-            bottom: '3%',
-            top: '10%',
-            containLabel: true
-          },
-          toolbox: {
-            feature: {
-              saveAsImage: {
-                title: '保存为图片',
-                name: '我的众测'
-              }
-            },
-            right: '20px'
-          },
-          xAxis: {
-            type: 'category',
-            boundaryGap: false,
-            data: ['2020年1月', '2020年2月', '2020年3月', '2020年4月', '2020年5月', '2020年6月', '2020年7月']
-          },
-          yAxis: {
-            type: 'value'
-          },
-          series: [
-            {
-              name: '接收项目数量',
-              type: 'line',
-              stack: '总量',
-              data: [2, 3, 3, 2, 4, 5, 6]
-            },
-            {
-              name: '完成项目数量',
-              type: 'line',
-              stack: '总量',
-              data: [2, 3, 3, 2, 4, 5, 6]
-            },
-            {
-              name: '接收任务数量',
-              type: 'line',
-              stack: '总量',
-              data: [22, 33, 41, 14, 55, 33, 41]
-            },
-            {
-              name: '完成任务数量',
-              type: 'line',
-              stack: '总量',
-              data: [21, 33, 31, 14, 39, 33, 32]
-            },
-            {
-              name: '发布项目数量',
-              type: 'line',
-              stack: '总量',
-              data: [2, 3, 1, 0, 1, 2, 2]
-            }
-          ]
-        }
-        myChart.setOption(option)
-      },
-      showLoading() {
-        this.loading = true
-      },
-      hideLoading() {
-        this.loading = false
-      },
-      handleTabClick(event) {
-        if (event.name == 'myProject') {
-          //this.myProjectNoticeCount = 0
-        }
-        if (event.name == 'handlingProject') {
-          //this.processProjectNoticeCount = 0
-        }
-        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)
-          })
-        }
-      },
+      }
     },
-    created: function () {
+  },
+  created: function() {
 
-    },
-  }
+  },
+}
 </script>
 
 <style lang="scss" scoped>
-  .mine-container {
-    padding: 0 80px 40px 80px;
-  }
+.mine-container {
+  padding: 0 80px 40px 80px;
+}
 
-  .mine-top-wrapper {
-    height: 350px;
-    background-color: #fff;
-  }
+.mine-top-wrapper {
+  height: 350px;
+  background-color: #fff;
+}
 
-  [class*="el-col-"] {
-    height: 100%;
-  }
+[class*="el-col-"] {
+  height: 100%;
+}
 
-  .advertise-imgs {
-    height: 100%;
-  }
+.advertise-imgs {
+  height: 100%;
+}
 
-  .advertise-imgs img {
-    width: 100%;
-    height: 100%;
-  }
+.advertise-imgs img {
+  width: 100%;
+  height: 100%;
+}
 
-  .user-banner {
-    text-align: center;
-    display: inline-table;
-    height: 100%;
-    width: 100%;
-    margin-top: 40px;
-  }
+.user-banner {
+  text-align: center;
+  display: inline-table;
+  height: 100%;
+  width: 100%;
+  margin-top: 40px;
+}
 
-  .mine-body {
-    margin-top: 30px;
+.mine-body {
+  margin-top: 30px;
+
+  .input-task-btn {
+    position: absolute;
+    right: 5%;
+    top: 10px
   }
+}
 
-  .project-statistics {
-    margin: 20px 5%;
-    display: flex;
-    .project-statistics-card{
-      justify-content: space-between;
-      flex: 1;
-      margin-right: 10px;
+.project-statistics {
+  margin: 20px 5%;
+  display: flex;
 
-      .project-statistics-card-title {
-        text-align: center;
-        font-size: 16px;
-      }
-      .project-statistics-card-number {
-        margin: 10px auto;
-        text-align: center;
-        font-weight: bolder;
-        font-size: 28px;
-      }
+  .project-statistics-card {
+    justify-content: space-between;
+    flex: 1;
+    margin-right: 10px;
+
+    .project-statistics-card-title {
+      text-align: center;
+      font-size: 16px;
     }
-    .project-statistics-card:last-child{
-      margin-right: 0;
+
+    .project-statistics-card-number {
+      margin: 10px auto;
+      text-align: center;
+      font-weight: bolder;
+      font-size: 28px;
     }
+  }
 
+  .project-statistics-card:last-child {
+    margin-right: 0;
   }
+
+
+}
 </style>
 

+ 5 - 5
src/components/commons/Footer2.0.vue

@@ -1,5 +1,5 @@
 <template>
-  <div :class=" slice_type ? 'footer-nav' : 'footer-nav-online' ">
+  <div class="footer-nav">
     <div class="container">
       <el-row>
         <el-col :span="5" class="nav-logo-block">
@@ -14,6 +14,8 @@
         <el-col :span="19" style="padding-left: 15%">
           <div class="copyright-block pull-left" style="margin: 12px 0">
             版权所有©信息产品及科技服务集成化众测服务平台与应用项目组<br/>
+            <img src="@/assets/image/police.png" style="width: 20px;height: 20px;vertical-align:middle;">
+            <span style="vertical-align: middle;height: 20px;line-height: 20px">粤公网安备 44011602000570号</span><br/>
             <a :href="footer_provider_number_url" style="color: white; font-size: 16px">{{ footer_provider_number }}</a><br/>
             电话:{{ footer_mobile }}  传真:{{ footer_fax }}1<br/>
             电子邮箱:{{ footer_email }}
@@ -30,7 +32,6 @@
 
 <script>
 import {CONFIG} from "../../config";
-import {slice_type} from "../../../tool4deploy/slider-type";
 
 export default {
   name: "Footer2.0",
@@ -40,12 +41,11 @@ export default {
       footer_title_one:CONFIG.footer_title_one,
       footer_title_two:CONFIG.footer_title_two,
       footer_provider_number:CONFIG.footer_provider_number,
-      footer_provider_number_url:CONFIG.footer_provider_number_url,
       footer_mobile:CONFIG.footer_mobile,
       footer_fax:CONFIG.footer_fax,
       footer_email:CONFIG.footer_email,
       footer_QRcode:CONFIG.footer_QRcode,
-      slice_type
+      footer_provider_number_url: CONFIG.footer_provider_number_url
     }
   }
 }
@@ -64,7 +64,7 @@ export default {
   }
   .footer-nav-online{
     height: 120px;
-    background:$--color-footer-background;;
+    background:$__color-primary;
     color: $--color-title-color;
     padding: 30px 0;
     font-size: 14px;

+ 38 - 5
src/components/task/Task.vue

@@ -32,9 +32,9 @@
             <!--</el-form-item>-->
             <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>
-            </span>
+                <span v-for="(item,index) in serviceType" :key="index">
+                  <el-radio :label="item.code" name="serviceType">{{item.name}}</el-radio>
+                </span>
               </el-radio-group>
               <span class="badge" v-if="!isModifyMode">{{serviceName}}</span>
             </el-form-item>
@@ -208,9 +208,18 @@
               <el-button v-if="taskOperationControl.taskRecommend" type="primary" size="mini" @click="recommendTask()">任务推荐
               </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>
+
               <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>
@@ -271,6 +280,7 @@ import Apis from '@/js/api.js'
 import {notify} from '@/constants/index'
 import {
   ensureEndTask,
+  exportTask,
   getAllAgencies,
   getAllServiceTypes,
   getFormalTimeFromDate,
@@ -284,6 +294,7 @@ import {
   updateTask,
   getTaskWordCloud
 } from '@/js/index'
+import {AxiosInstance as axios} from "axios";
 
 export default {
   name: 'Task',
@@ -314,9 +325,11 @@ export default {
         uploadReport: false,
         writeReport: false,
         taskDemonstrate: false,
-        taskRecommend: false
+        taskRecommend: false,
+        exportTask: false
       },
       crowdReportUrl: '',
+      exportTaskUrl: '',
       wordCloud:[],
       task: {
         agencyId: '',
@@ -333,6 +346,7 @@ export default {
         doc: [],
         requireDocUrl: '',
         participantCount: 1,
+        exportUrl: '',
         title: '',
         description: '',
         endPoint: {
@@ -586,6 +600,7 @@ export default {
       this.task.doc = []
       this.task.requireDocUrl = res.crowdTaskVO.requirementFile
       this.task.agencyId = res.crowdTaskVO.agencyId
+      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 : {
@@ -800,7 +815,8 @@ export default {
         "datetime": this.task.datetime
       };
       Http.post('/recommendationtest/query',task).then((res)=>{
-        window.open('http://59.42.10.54:7477/userinformation.html');
+        console.log("recommend")
+        window.open('http://8.134.39.104:7477/userinformation.html');
       })
     },
 
@@ -887,6 +903,23 @@ export default {
       this.hideLoading()
       notify('error', '结束任务失败:' + error.data)
     },
+    // 导出任务
+    toExportTask(){
+      exportTask(this.projectId, this.taskId, this.exportTaskSuccess, this.exportTaskFail);
+    },
+    // 导出任务成功时的回调函数
+    exportTaskSuccess(res){
+      this.hideLoading()
+      console.log(res.data)
+      this.exportTaskUrl = res.data;
+      window.open(this.exportTaskUrl, "_self");
+      notify('success', '任务导出成功!')
+    },
+    // 导出任务失败时的回调函数
+    exportTaskFail(error){
+      this.hideLoading()
+      notify('error', '导出任务失败:' + error.data)
+    },
     //跳转到创建项目报告页面
     toCreateReport() {
       this.$router.push({

+ 5 - 1
src/config/index.js

@@ -133,8 +133,12 @@ export let CONFIG = {};
 export const setConfig = (conf) => {
   CONFIG = conf;
 }
+export const login_url = 'http://user.mooctest.net:8081/page/login?redirect=http%3a%2f%2fcrowd.dev.mooctest.net%2f%23%2fhome'
+export const register_url = 'http://user.mooctest.net:8081/page/register'
 
+// 线上环境
 // export const login_url = 'http://user.cofortest.com:8081/page/login?redirect=http%3a%2f%2fwww.cofortest.com%2f%23%2fhome'
-// export const  register_url = 'http://user.cofortest.com:8081/page/register'
+// export const register_url = 'http://user.cofortest.com:8081/page/register'
+
 // export const login_url = 'http://59.42.10.53/page/login?redirect=http%3a%2f%2fwww.cofortest.com%2f%23%2fhome'
 // export const  register_url = 'http://59.42.10.53/page/register'

+ 1 - 0
src/js/api.js

@@ -23,6 +23,7 @@ export default {
     REJECT_TASK: '/api/project/{projectId}/task/{taskId}/status/reject',
     SUBMIT_TASK: '/api/project/{projectId}/task/{taskId}/status/commit',
     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'
   },

+ 3 - 0
src/js/index.js

@@ -35,6 +35,7 @@ import {
   createTask,
   deleteTask,
   ensureEndTask,
+  exportTask,
   getTask,
   receiveTaskRequest,
   rejectTask,
@@ -144,6 +145,8 @@ export {
   deleteTask,
   //区域管理员确认结束项目
   ensureEndTask,
+  //区域管理员、已接包的测试人员或机构导出测试任务
+  exportTask,
   //查看任务信息
   getTask,
   //测评机构接收任务

+ 9 - 0
src/js/taskService.js

@@ -76,3 +76,12 @@ export const ensureEndTask = (projectId, taskId, endTaskSuccess, endTaskFail) =>
     endTaskFail(error)
   })
 }
+
+//区域管理员、已接包的测试人员或机构导出测试任务
+export const exportTask = (projectId, taskId, exportTaskSuccess, exportTaskFail) => {
+  Http.get(Apis.TASK.EXPORT_TASK.replace('{projectId}', projectId).replace('{taskId}', taskId), {}).then((res) => {
+    exportTaskSuccess(res)
+  }).catch((error) => {
+    exportTaskFail(error)
+  })
+}