Procházet zdrojové kódy

Merge branch 'PrivateReleaseOfXC' of http://git.mooctest.com/crowd-2019/crowd-test-service-front into PrivateReleaseOfXC

wjj před 4 roky
rodič
revize
2c6d426566

+ 6 - 6
src/components/authen/AuthenticationManage.vue

@@ -77,7 +77,7 @@
           <el-form-item label="身份证正面照:" v-if="authInfoDetail.type == 'personal'">
             <span>
               <el-image
-                style="width: 100px;"
+                style="width: 400px;"
                 :src="authInfoDetail.idCardPositivePhoto"
                 fit="scale-down"></el-image>
             </span>
@@ -85,7 +85,7 @@
           <el-form-item label="身份证反面照:" v-if="authInfoDetail.type == 'personal'">
             <span>
               <el-image
-                style="width: 100px;"
+                style="width: 400px;"
                 :src="authInfoDetail.idCardBackPhoto"
                 fit="scale-down"></el-image>
             </span>
@@ -132,7 +132,7 @@
           <el-form-item label="营业执照:" v-if="authInfoDetail.type == 'agency'">
             <span>
               <el-image
-                style="width: 100px;"
+                style="width: 400px;"
                 :src="authInfoDetail.businessLicensePhoto"
                 fit="scale-down"></el-image>
             </span>
@@ -144,7 +144,7 @@
           <el-form-item label="企业Logo:" v-if="authInfoDetail.type == 'agency'">
             <span>
               <el-image
-                style="width: 100px;"
+                style="width: 400px;"
                 :src="authInfoDetail.agencyPhoto"
                 fit="scale-down"></el-image>
             </span>
@@ -161,7 +161,7 @@
           <el-form-item label="法人身份证正面照:" v-if="authInfoDetail.type == 'agency'">
             <span>
               <el-image
-                style="width: 100px;"
+                style="width: 400px;"
                 :src="authInfoDetail.idCardPositivePhoto"
                 fit="scale-down"></el-image>
             </span>
@@ -169,7 +169,7 @@
           <el-form-item label="法人身份证反面照:" v-if="authInfoDetail.type == 'agency'">
             <span>
               <el-image
-                style="width: 100px;"
+                style="width: 400px;"
                 :src="authInfoDetail.idCardBackPhoto"
                 fit="scale-down"></el-image>
             </span>

+ 1 - 1
src/components/task/Task.vue

@@ -863,7 +863,7 @@ export default {
         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) => {
+      Http.upload(Apis.FILE.THREEPAGE_FILE.replace('{userId}', this.user.userVO.id), formData, config).then((res) => {
         notify('success', '上传成功')
         this.task.endPoint.threePageUrl = res.data
         this.task.endPoint.threePageUrl = res.data;

+ 18 - 5
src/components/task/TaskCreate.vue

@@ -104,8 +104,8 @@
             :before-remove="beforeRemove"
             :limit="1"
             :on-exceed="handleExceed"
-            :before-upload="beforeFileUpload"
-            :http-request="uploadThreePageDoc"
+            :before-upload="beforeThreePageUpload"
+            :http-request="uploadThreePageFile"
             :file-list="task.threePageList"
           >
             <i class="el-icon-upload"></i>
@@ -451,20 +451,33 @@ export default {
         notify('error', '上传失败:' + error.data)
       })
     },
+
+    beforeThreePageUpload(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'
+      if (!(isEXCEL || isXLS || isXLSX)) {
+        this.$message.error('上传文件只能是 XLS、XLSX 格式!')
+      }
+      return isEXCEL || isXLS || isXLSX
+    },
     //todo:上传测试大纲
-    uploadThreePageDoc(param) {
+    uploadThreePageFile(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) => {
+      Http.upload(Apis.FILE.THREEPAGE_FILE.replace('{userId}', this.user.userVO.id), formData, config).then((res) => {
         notify('success', '上传成功')
         this.task.endPoint.threePageUrl = res.data;
         this.$refs.task.validateField('endPoint.threePageUrl');
       }).catch((error) => {
-        notify('error', '上传失败:' + error.data)
+        notify('error', '上传失败:' + error)
       })
     },
     setServiceType() {

+ 1 - 0
src/js/api.js

@@ -41,6 +41,7 @@ export default {
   },
   FILE: {
     REQUIREMENT_FILE: '/api/files/requirementfile/{userId}/',
+    THREEPAGE_FILE: '/api/files/threePageFile/{userId}/',
     APK: '/api/files/apk/{userId}/',
     UPLOAD_REPORT_FILE: '/api/files/report/{userId}/',
     UPLOAD_EXCEL: '',