浏览代码

Merge branch 'Dev' into 'Test'

Dev

See merge request crowd-2019/crowd-test-service-front!4
薛晓波 6 年之前
父节点
当前提交
ced71a4128
共有 3 个文件被更改,包括 271 次插入40 次删除
  1. 139 40
      src/components/cheat/ProjectAdd.vue
  2. 0 0
      tool4deploy/Dockerfile
  3. 132 0
      tool4deploy/nginx.conf

+ 139 - 40
src/components/cheat/ProjectAdd.vue

@@ -165,7 +165,7 @@
               <!--</div>-->
             </el-form-item>
             <el-form-item v-if="isModifyMode">
-              <div class="btn btn-primary btn-info" @click="submitByFile()">确认提交</div>
+              <div class="btn btn-primary btn-info" @click="ensureSubmitExcel()">确认提交</div>
             </el-form-item>
           </el-form>
           <el-dialog
@@ -176,40 +176,40 @@
             center>
         <span>
           <el-table
-            :data="tableData"
+            :data="projectList"
             style="width: auto">
       <el-table-column
-        prop="date"
+        prop="projectDetails.name"
         label="项目名称">
       </el-table-column>
-      <el-table-column
-        prop="name"
-        label="项目测试平台">
-      </el-table-column>
-      <el-table-column
-        prop="address"
-        label="项目联系人">
-      </el-table-column>
             <el-table-column
-              prop="address"
+              prop="projectDetails.platform"
+              label="项目测试平台">
+            </el-table-column>
+            <el-table-column
+              prop="projectDetails.contactName"
+              label="项目联系人">
+            </el-table-column>
+            <el-table-column
+              prop="projectDetails.contactPhone"
               label="联系方式">
-      </el-table-column>
+            </el-table-column>
             <el-table-column
-              prop="address"
+              prop="projectDetails.type"
               label="项目测试类型">
-      </el-table-column>
+            </el-table-column>
             <el-table-column
-              prop="address"
+              prop="projectDetails.desc"
               label="项目需求描述">
-      </el-table-column>
+            </el-table-column>
             <el-table-column
-              prop="address"
+              prop="projectDetails.desc"
               label="测试报告内容">
-      </el-table-column>
+            </el-table-column>
             <el-table-column
-              prop="address"
+              prop="projectDetails.desc"
               label="测试报告结论">
-      </el-table-column>
+            </el-table-column>
     </el-table>
         </span>
             <span slot="footer" class="dialog-footer">
@@ -259,7 +259,104 @@ export default {
         price: '',
         datetime: ''
       },
-      projectList: [],
+      projectList: [
+        {
+          'projectDetails': {
+            'id': 'PROJECT-2019081319025',
+            'name': '网易云测试',
+            'contactName': '孙加辉',
+            'contactPhone': '13628972489',
+            'type': [
+              1
+            ],
+            'platform': [
+              1,
+              0
+            ],
+            'desc': '无',
+            'doc': '',
+            'file': '',
+            'resource': 1,
+            'location': {
+              'provinceCode': '江苏',
+              'cityCode': '南京'
+            },
+            'institution': 1,
+            'datetime': '2019-08-13T11:14:08.192+0000',
+            'price': 30000.0,
+            'budget': 30000.0,
+            'usage': null
+          },
+          'taskList': [
+            {
+              'id': 'TASK-LDSM-2019081319013',
+              'projectId': 'PROJECT-2019081319025',
+              'title': '网易云测试-安全漏洞扫描',
+              'description': null,
+              'quotePrice': 30000.0,
+              'fixedPrice': 30000.0,
+              'resource': 0,
+              'location': {
+                'provinceCode': '江苏',
+                'cityCode': '南京'
+              },
+              'institution': 1,
+              'serviceType': 1,
+              'status': 5,
+              'datetime': '2019-08-13T11:14:08.192+0000'
+            }
+          ],
+          'reportList': null
+        },
+        {
+          'projectDetails': {
+            'id': 'PROJECT-2019081319026',
+            'name': '网易测试',
+            'contactName': '孙加辉',
+            'contactPhone': '0797-8877663',
+            'type': [
+              4,
+              3
+            ],
+            'platform': [
+              2
+            ],
+            'desc': '无',
+            'doc': '',
+            'file': '',
+            'resource': 1,
+            'location': {
+              'provinceCode': '江苏',
+              'cityCode': '南京'
+            },
+            'institution': 1,
+            'datetime': '2019-08-13T11:14:08.194+0000',
+            'price': 30000.0,
+            'budget': 30000.0,
+            'usage': null
+          },
+          'taskList': [
+            {
+              'id': 'TASK-GNCS-2019081319006',
+              'projectId': 'PROJECT-2019081319026',
+              'title': '网易测试-功能测试',
+              'description': null,
+              'quotePrice': 30000.0,
+              'fixedPrice': 30000.0,
+              'resource': 0,
+              'location': {
+                'provinceCode': '江苏',
+                'cityCode': '南京'
+              },
+              'institution': 1,
+              'serviceType': 4,
+              'status': 5,
+              'datetime': '2019-08-13T11:14:08.194+0000'
+            }
+          ],
+          'reportList': null
+        }
+      ],
       excelFile: {},
       rules: {
         // name: [
@@ -354,22 +451,6 @@ export default {
         notify('error', error.data.msg)
       })
     },
-    submitByFile () {
-      const formData = new FormData()
-      let config = {
-        //添加请求头
-        headers: {'Content-Type': 'multipart/form-data'},
-      }
-      formData.append('file', this.excelFile)
-      this.showDialog()
-      // Http.upload(Apis.PROJECT.ADD_PROJECT_BY_EXCEL, formData, config).then((res) => {
-      //   console.log(res)
-      //   this.projectList = res.data
-      //   notify('success', '项目添加成功')
-      // }).catch(error => {
-      //   notify('error', error)
-      // })
-    },
     // cancelModify () {
     //   this.isModifyMode = false
     // },
@@ -390,7 +471,20 @@ export default {
 
     },
     uploadProjectCreateExcelFile (param) {
-      this.excelFile = param.file
+      const formData = new FormData()
+      let config = {
+        //添加请求头
+        headers: {'Content-Type': 'multipart/form-data'},
+      }
+      formData.append('file', param.file)
+      Http.upload(Apis.PROJECT.ADD_PROJECT_BY_EXCEL, formData, config).then((res) => {
+        console.log(res)
+        this.projectList = res.data
+        this.showDialog()
+        //notify('success', '项目添加成功')
+      }).catch(error => {
+        notify('error', error)
+      })
     },
     uploadRequireDoc (param) {
       const formData = new FormData()
@@ -434,7 +528,12 @@ export default {
         })
     },
     ensureSubmitExcel () {
-
+      notify('success', '添加成功')
+      // Http.post('',this.projectList).then((res)=>{
+      //
+      // }).catch((error)=>{
+      //
+      // })
     },
     showDialog () {
       this.dialogVisible = true

+ 0 - 0
tool4deploy/Dockerfile


+ 132 - 0
tool4deploy/nginx.conf

@@ -0,0 +1,132 @@
+#user  nobody;
+worker_processes  1;
+
+#error_log  logs/error.log;
+#error_log  logs/error.log  notice;
+#error_log  logs/error.log  info;
+
+#pid        logs/nginx.pid;
+
+
+events {
+    worker_connections  1024;
+}
+
+
+http {
+    include       mime.types;
+    default_type  application/octet-stream;
+
+    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
+    #                  '$status $body_bytes_sent "$http_referer" '
+    #                  '"$http_user_agent" "$http_x_forwarded_for"';
+
+    #access_log  logs/access.log  main;
+    server_names_hash_bucket_size 64;
+    sendfile        on;
+    #tcp_nopush     on;
+
+    #keepalive_timeout  0;
+    keepalive_timeout  65;
+    
+    #gzip  on;
+	
+	server {
+		
+		listen		80;
+		server_name crowd.test.mooctest.net;
+		
+		location / {
+			proxy_pass http://localhost:5757;
+		}
+
+		location /api {
+			proxy_pass http://localhost:8080;
+		}
+	}
+
+
+
+    server {
+        listen       80;
+        server_name  localhost;
+
+        #charset koi8-r;
+
+        #access_log  logs/host.access.log  main;
+
+        location / {
+            root   html;
+            index  index.html index.htm;
+        }
+
+        #error_page  404              /404.html;
+
+        # redirect server error pages to the static page /50x.html
+        #
+        error_page   500 502 503 504  /50x.html;
+        location = /50x.html {
+            root   html;
+        }
+
+        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
+        #
+        #location ~ \.php$ {
+        #    proxy_pass   http://127.0.0.1;
+        #}
+
+        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
+        #
+        #location ~ \.php$ {
+        #    root           html;
+        #    fastcgi_pass   127.0.0.1:9000;
+        #    fastcgi_index  index.php;
+        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
+        #    include        fastcgi_params;
+        #}
+
+        # deny access to .htaccess files, if Apache's document root
+        # concurs with nginx's one
+        #
+        #location ~ /\.ht {
+        #    deny  all;
+        #}
+    }
+
+
+    # another virtual host using mix of IP-, name-, and port-based configuration
+    #
+    #server {
+    #    listen       8000;
+    #    listen       somename:8080;
+    #    server_name  somename  alias  another.alias;
+
+    #    location / {
+    #        root   html;
+    #        index  index.html index.htm;
+    #    }
+    #}
+
+
+    # HTTPS server
+    #
+    #server {
+    #    listen       443 ssl;
+    #    server_name  localhost;
+
+    #    ssl_certificate      cert.pem;
+    #    ssl_certificate_key  cert.key;
+
+    #    ssl_session_cache    shared:SSL:1m;
+    #    ssl_session_timeout  5m;
+
+    #    ssl_ciphers  HIGH:!aNULL:!MD5;
+    #    ssl_prefer_server_ciphers  on;
+
+    #    location / {
+    #        root   html;
+    #        index  index.html index.htm;
+    #    }
+    #}
+
+}