Commit 94ef59c1 authored by Wallen姚文辉's avatar Wallen姚文辉

修改上传用例为异步执行

parent 3bd08681
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>yinhe_test</title><script defer="defer" src="/js/chunk-vendors.5670e6ea.js"></script><script defer="defer" src="/js/app.3394e61e.js"></script><link href="/css/chunk-vendors.187ae3e6.css" rel="stylesheet"><link href="/css/app.3954dbdf.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but yinhe_test doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
\ No newline at end of file
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>yinhe_test</title><script defer="defer" src="/js/chunk-vendors.5670e6ea.js"></script><script defer="defer" src="/js/app.f45a3349.js"></script><link href="/css/chunk-vendors.187ae3e6.css" rel="stylesheet"><link href="/css/app.3954dbdf.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but yinhe_test doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -16,20 +16,15 @@
</Select>
<Button type="primary" @click="upload()" style="margin-left: 10px;">上传</Button>
</div>
<!-- <div v-if="running" style="margin-top: 10px;">
<Steps :current="step" :status="stepStatus">
<Step title="上传文件" content="文件上传至服务器"></Step>
<Step title="添加用例" content="添加用例集及测试用例"></Step>
<Step title="关联用例" content="用例关联story,用例名需要包含stroy的key"></Step>
</Steps>
</div> -->
<div style="margin-top: 10px;">
<Row v-for="item in uploadhistory">
<Col span="8">{{ item.filename + "(" + item.project + ")" + (item.case_count ? ("- " + item.case_count +
"条") : "") }}
<Col span="8" offset="1">{{ item.filename + "(" + item.project + ")" + (item.case_count
? (" -- " + item.case_count +
"条") : "") }}
</Col>
<Col span="16">
<Steps :current="item.step" :status="item.stepstatus">
<Col span="12">
<Steps :current="item.step"
:status="item.stepstatus == 0 ? 'process' : item.stepstatus == 2 ? 'finish' : 'error'">
<Step title="上传文件" content="文件上传至服务器"></Step>
<Step title="添加用例" content="添加用例集及测试用例"></Step>
<Step title="关联用例" content="用例关联story,用例名需要包含stroy的key"></Step>
......@@ -50,7 +45,6 @@ export default {
page_id: 21,
title: "上传用例",
file: null,
// file_name: null,
project: null,
projects: [],
uploadhistory: [],
......@@ -60,9 +54,6 @@ export default {
page_size: 10,
page_num: 1
}
// running: false,
// step: null,
// stepStatus: null,
}
},
methods: {
......@@ -76,6 +67,8 @@ export default {
},
upload() {
const formData = new FormData();
if (!this.file) return this.$Message.error("请上传xmind用例文件");
if (!this.project) return this.$Message.error("请选择项目");
formData.append('file', this.file);
formData.append("project", this.project);
formData.append("projectName", this.projects[this.projects.findIndex(ele => { return ele.id == this.project })].name);
......@@ -100,13 +93,11 @@ export default {
created() {
this.getprojects();
this.getuploadhistory();
this.$socket.io.emit("join", 1)
this.$socket.io.on('infoupdate', () => { console.info("数据更新了"); this.getuploadhistory() })
this.$socket.io.on('www', () => { console.info("cao") })
console.info(this.$socket)
this.$socket.emitter.addListener('infoupdate', () => { this.getuploadhistory() }, this)
},
destroyed() {
this.$socket.io.off('infoupdate')
this.$socket.emitter.removeListener('infoupdate', this)
},
watch: {
uploadhistory: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment