浏览代码

创建任务时定向发布增加获取接包人员、更多热门项目中可以通过领域类型筛选、我的众测的导出任务通过变量控制

郭超 4 年之前
父节点
当前提交
9c80680c14

+ 9 - 6
src/components/Mine.vue

@@ -132,10 +132,10 @@
         </el-tab-pane>
       </el-tabs>
 
-      <el-button type="primary" size='mini' class="input-task-btn" @click="showImportTaskModal = true">导入任务</el-button>
+      <el-button v-if="canImportTask" type="primary" size='mini' class="input-task-btn" @click="showImportTaskModule = true">导入任务</el-button>
       <el-dialog
         title="上传任务资源包"
-        :visible.sync="showImportTaskModal"
+        :visible.sync="showImportTaskModule"
         width="500"
       >
         <el-upload
@@ -153,8 +153,8 @@
           <div class="el-upload__tip" slot="tip">只能上传Json文件,且不超过100MB</div>
         </el-upload>
 <!--        <span slot="footer" class="dialog-footer">-->
-<!--        <el-button @click="showImportTaskModal = false">取 消</el-button>-->
-<!--        <el-button type="primary" @click="showImportTaskModal = false">确 定</el-button>-->
+<!--        <el-button @click="showImportTaskModule = false">取 消</el-button>-->
+<!--        <el-button type="primary" @click="showImportTaskModule = false">确 定</el-button>-->
 <!--        </span>-->
       </el-dialog>
 
@@ -186,7 +186,8 @@
     data() {
       return {
         statisticData: {},
-        showImportTaskModal:false,
+        canImportTask:false,
+        showImportTaskModule: false,
         loading: false,
         unFinishedTaskList: [],
         finishedTaskList: [],
@@ -264,6 +265,8 @@
           if (res.acceptableProjects != null && res.acceptableProjects.length > 0) {
             this.acceptableProjects = res.acceptableProjects
           }
+          this.canImportTask = res.canImportTask == null ? false : res.canImportTask;
+          console.log(this.canImportTask);
           // if (res.userVO != null && res.userVO.length > 0) {
           //   this.user = res.userVO
           // }
@@ -295,7 +298,7 @@
           this.hideLoading()
           notify('success', '导入任务成功')
           this.taskJson.push(res.data)
-          this.showImportTaskModal = false;
+          this.showImportTaskModule = false;
           this.loadData()
         }).catch((error) => {
           this.hideLoading()

+ 11 - 11
src/components/report/ProjectReportCreate.vue

@@ -197,17 +197,17 @@
     },
     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
+      // 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
     },
     loadData () {
     },

+ 3 - 2
src/components/task/Task.vue

@@ -65,7 +65,7 @@
                       name="type"
                       v-for="(item,index) in institutionArray"
                       :key="index"
-                    >{{item.evaluationAgencyName}}
+                    >{{item.name}}
                     </el-radio>
                   </el-radio-group>
                 </el-tab-pane>
@@ -283,6 +283,7 @@ import {
   ensureEndTask,
   exportTask,
   getAllAgencies,
+  getAllAgencyAndTestUser,
   getAllServiceTypes,
   getFormalTimeFromDate,
   getProvinceCodeByProvinceName,
@@ -562,7 +563,7 @@ export default {
     },
     //加载所有的测评机构
     setInstitutions() {
-      getAllAgencies().then((res) => {
+      getAllAgencyAndTestUser().then((res) => {
         this.institutionArray = res
       }).catch((error) => {
         notify('error', '获取机构列表失败')

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

@@ -34,7 +34,7 @@
         </el-form-item>
 
 
-        <el-form-item label="任务可见性" prop="resource" style="width:700px;" v-if="currType.type==0">
+        <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-radio-group v-model="task.institution">
@@ -43,7 +43,7 @@
                   name="type"
                   v-for="item,index in institutionArray"
                   :key="index"
-                >{{item.evaluationAgencyName}}
+                >{{item.name}}
                 </el-radio>
               </el-radio-group>
             </el-tab-pane>
@@ -122,7 +122,7 @@
   import Apis from '@/js/api.js'
   import ResourceType from '@/constants/enum/resource-type.js'
   import {notify} from '@/constants/index'
-  import {getAllAgencies, getAllServiceTypes, getProvinceNameByProvinceCode, storageGet} from '@/js/index'
+  import {getAllAgencies,getAllAgencyAndTestUser, getAllServiceTypes, getProvinceNameByProvinceCode, storageGet} from '@/js/index'
 
   export default {
     name: 'Task',
@@ -370,17 +370,17 @@
       },
       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
+        // 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()
@@ -406,7 +406,7 @@
         })
       },
       setInstitutions() {
-        getAllAgencies().then((res) => {
+        getAllAgencyAndTestUser().then((res) => {
           this.institutionArray = res
           console.log(this.institutionArray)
         }).catch((error) => {

+ 1 - 0
src/js/api.js

@@ -99,6 +99,7 @@ export default {
   GENERAL: {
     GET_ALL_INSTITUTIONS: '/api/regionalManager',
     GET_ALL_AGENCIES: '/api/agency/list',
+    GET_ALL_AGENCIES_AND_TEST_USER: '/api/agencyAndTestUser/list',
     GET_ALL_ApplicationType: '/api/list/application',
     GET_ALL_TestType: '/api/list/type',
     GET_ALL_Filed: '/api/list/filed',

+ 5 - 0
src/js/generalService.js

@@ -75,6 +75,11 @@ export const getAllAgencies = () => {
   return Http.get(Apis.GENERAL.GET_ALL_AGENCIES)
 }
 
+//获取所有测评机构和测试人员
+export const getAllAgencyAndTestUser = () => {
+  return Http.get(Apis.GENERAL.GET_ALL_AGENCIES_AND_TEST_USER)
+}
+
 //通过代码获取省、市名称
 export const getProvinceNameByProvinceCode = (provinceCode, cityCode) => {
   for (var i = 0; i < ProvinceJson.provinces.length; i++) {

+ 2 - 0
src/js/index.js

@@ -57,6 +57,7 @@ import {beforeUploadFile, beforeUploadImage, checkFileType, uploadFile, uploadIm
 import {
   getAllAbilities,
   getAllAgencies,
+  getAllAgencyAndTestUser,
   getAllAgencyResourceTypes,
   getAllInstitutions,
   getAllFields,
@@ -206,6 +207,7 @@ export {
   getAllAbilities,
   //TODO 可以使用 需要重构 获取所有测评机构
   getAllAgencies,
+  getAllAgencyAndTestUser,
   //TODO 目前使用本地数据 需要修改 获取所有测评能力 获取所有测评资源类型
   getAllAgencyResourceTypes,
   //TODO 可以使用 需要重构 获取所有区域管理员

+ 0 - 2
src/pages/DetailPage/TestTypeDetail.vue

@@ -29,8 +29,6 @@
         })
       },
       goToTask(testType){
-        console.log(testType)
-        //type=1 表示是从测试类型跳转过去的
         this.$router.push({path:'/square',query:{type:testType}})
       }
     },

+ 3 - 1
src/pages/Homepage/HomepagePrivate.vue

@@ -207,7 +207,9 @@
 
         for (let i = 0; i < this.homeTabArr.menuArr2.length; i++) {
           if (this.currTab === this.homeTabArr.menuArr2[i].code) {
-            this.$router.push('/field/detail');
+            // this.$router.push('/field/detail');
+            this.$router.push({name: 'PopularProjectAndTaskList', params: {fieldCode: this.homeTabArr.menuArr2[i].code}})
+
           }
         }
         this.$router.push(this.homeTabArr.menuArr1[Number(tab.index)] && this.homeTabArr.menuArr1[Number(tab.index)].linkTo);

+ 2 - 2
src/pages/Homepage/LoginCard.vue

@@ -5,7 +5,7 @@
            class="pull-left welcome-img">
       <div style="margin-left: 46px">
         <div class="welcome-title">
-          hi,欢迎使用{{ logoTitle }}
+          {{ login_title }}
         </div>
         <div class="welcome-content">
           {{ login_description }}
@@ -34,7 +34,7 @@ export default {
   name: "LoginCard",
   data() {
     return {
-      logoTitle: CONFIG.logoTitle,
+      login_title: CONFIG.login_title,
       logo_background: CONFIG.logo_background,
       isLogin: false,
       user: {},

+ 1 - 1
src/pages/Homepage/RankingCard.vue

@@ -15,7 +15,7 @@
     <el-col :span="8">
       <div class="ranking-card ranking-card3"
            onclick="window.open('http://139.224.0.118:8200/#/list?field=BASESF&code=ANTIVIRUS')">
-        <div class="wrap-mask">防病毒软件排行榜</div>
+        <div class="wrap-mask">安全软件软件排行榜</div>
       </div>
     </el-col>
   </el-row>

+ 9 - 3
src/pages/Homepage/TestMenu.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="test-menu-wrapper">
     <div class="test-menu-item-wrapper">
-      <div class="test-menu-item" v-for="(item,index) in testTypeList" :key="item.code" v-if="index<8"  @click="geToDetail">
+      <div class="test-menu-item" v-for="(item,index) in testTypeList" :key="item.code" v-if="index<8"  @click="goToTask(item.code)">
         <img src="../../assets/img/testType.png" alt="testType" class="test-menu-item-img">
         {{item.name}}
       </div>
@@ -22,8 +22,12 @@
       }
     },
     methods:{
-        geToDetail(){
-            this.$router.push("/test/type/detail");
+        // geToDetail(){
+        //     this.$router.push("/test/type/detail");
+        // }
+
+        goToTask(testType){
+          this.$router.push({path:'/square',query:{type:testType}})
         }
     },
   }
@@ -43,6 +47,7 @@
       width: 100%;
       justify-content: space-between;
       .test-menu-item {
+        cursor: pointer;
         font-size: 14px;
         font-family:Source Han Sans CN;
         font-weight:400;
@@ -63,6 +68,7 @@
     .more-test-wrapper {
       display: block;
       .more-test {
+        cursor: pointer;
         width: 20px;
         height: 20px;
         background: $--color-primary;

+ 25 - 8
src/pages/Square/PopularProjectAndTaskList.vue

@@ -53,7 +53,7 @@
         </el-tab-pane>
 
         <el-tab-pane name="myProject" v-if="currTab == 'task'">
-          <span v-if="projectAndTaskArr == null || projectAndTaskArr.length == 0"> 暂无项目 </span>
+          <span v-if="projectAndTaskArr == null || projectAndTaskArr.length == 0"> 暂无任务 </span>
           <el-row v-if="projectAndTaskArr != null && projectAndTaskArr.length != 0" type="flex" align="middle"
                   justify="center"
                   style="font-size: 14px;">
@@ -130,7 +130,8 @@
         projectAndTaskArr: [],
         activePage: 1,
         totalElements: 0,
-        type: ''
+        type: '',
+        fieldCode: '',
       }
     },
     components: {
@@ -148,15 +149,22 @@
         if (storageGet('user') != null) {
           this.isLogin = true;
         }
-        this.type = this.$route.params.type;
-        if (this.type === "project") {
-          this.currTab = 'project';
-          this.searchType = 'project';
+        this.fieldCode = this.$route.params.fieldCode;
+        if(this.fieldCode != null && this.fieldCode != ''){
+          console.log("this.fieldCode " + this.fieldCode);
           this.getHotProject();
-        } else {
+          return;
+        }
+
+        this.type = this.$route.params.type;
+        if (this.type === "task") {
           this.currTab = 'task';
           this.searchType = 'task';
           this.getHotTask();
+        } else  {
+          this.currTab = 'project';
+          this.searchType = 'project';
+          this.getHotProject();
         }
         this.hideLoading();
       },
@@ -165,10 +173,19 @@
       },
       getHotProject() {
         this.showLoading();
+        this.currTab = 'project';
+        this.searchType = 'project';
         let params = {
           "keyword": this.searchVal,//搜索关键字
           "activePage": this.activePage,//指定页面
-          "columnFilters": []
+          "columnFilters": [
+            {
+              "field": "fieldCode",
+              "type": "fieldCode",
+              "enums": "",
+              "value": this.fieldCode
+            }
+          ]
         };
         Http.post(Apis.PROJECT.MORE_HOT_PROJECT, params).then((res) => {
           console.log(res.data);

+ 11 - 9
src/pages/Square/Square2.0.vue

@@ -144,20 +144,20 @@
         }
 
         // 从首页项目搜索框跳转过来
-        this.currTab = this.$route.params.currTab;
+        // this.currTab = this.$route.params.currTab;
         if(this.currTab === "project"){
-            this.searchVal = this.$route.params.searchVal;
-            this.searchType = this.$route.params.searchType;
-            this.getHotData();
-            this.handleTabClickSearch();
+          this.searchVal = this.$route.params.searchVal;
+          this.searchType = this.$route.params.searchType;
+          this.getHotData();
+          this.handleTabClickSearch();
         }
 
         // 正常点击众测广场跳转过来
         else{
-            this.searchVal = this.$route.params.searchVal;
-            this.searchType = 'project';
-            this.currTab = "squareHome"
-            this.getData();
+          this.searchVal = this.$route.params.searchVal;
+          this.searchType = 'project';
+          this.currTab = "squareHome"
+          this.getData();
         }
       },
 
@@ -179,9 +179,11 @@
       },
 
       getTestTask(type) {
+        this.searchType = 'task';
         Http.get(`/api/square/task/${type}`).then((res)=>{
           this.projectAndTaskArr = res.data.crowdTestTaskVOS;
         })
+        this.getHotData();
       },
 
       checkLogin() {