Commit a6fc85d5 authored by Wallen姚文辉's avatar Wallen姚文辉

修改默认抄送人有时不显示的问题

parent 5b5f1d55
This diff is collapsed.
......@@ -17,12 +17,14 @@
"filesaver": "^0.0.13",
"html2canvas": "^1.4.1",
"screenfull": "^6.0.2",
"socket.io-client": "^4.7.5",
"three": "^0.121.0",
"vanta": "^0.5.24",
"view-ui-plus": "^1.3.16",
"vue": "^3.2.13",
"vue-echarts": "^6.7.2",
"vue-router": "^4.0.3",
"vue-socket.io": "^3.0.10",
"vuex": "^4.0.0"
},
"devDependencies": {
......
......@@ -14,15 +14,20 @@ import TestReport from '@/views/tool/TestReport';
import Echarts from "vue-echarts";
import 'echarts';
import ViewUIPlus from 'view-ui-plus';
import VueSocketio from 'vue-socket.io'
import SocketIo from 'socket.io-client'
const app = createApp(App).use(store)
import 'view-ui-plus/dist/styles/viewuiplus.css'
const socket = new VueSocketio({ connection: SocketIo('ws://127.0.0.1') })
axios.defaults.withCredentials = true
axios.defaults.baseURL = '/api'
app.config.globalProperties.$http = axios
app.config.globalProperties.$socket = socket
app.component('v-chart', Echarts)
......@@ -147,6 +152,7 @@ app.config.globalProperties.elePro = function (menu_id) {
app.config.globalProperties.$routers = routers
app.provide("$http", axios);
app.provide("$socket", socket);
app.provide("$request", request);
app.provide("$getElements", getElements);
app.use(ViewUIPlus).use(router).mount('#app')
......@@ -590,9 +590,10 @@ export default {
},
defaultcc: {
handler(value) {
value.forEach(element => {
if (!this.sendcc.includes(element.address)) this.sendcc.push(element.address)
});
// value.forEach(element => {
// if (!this.sendcc.includes(element.address)) this.sendcc.push(element.address)
// });
this.sendcc = value.map(ele => { return ele.address })
}, deep: true
},
bug: {
......
......@@ -14,14 +14,30 @@
<Option v-for="item in projects" :value="item.id" :key="item.id">{{
item.name }}</Option>
</Select>
<Button type="primary" @click="run" style="margin-left: 10px;">上传</Button>
<Button type="primary" @click="upload()" style="margin-left: 10px;">上传</Button>
</div>
<div v-if="running" style="margin-top: 10px;">
<!-- <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>
<Col span="16">
<Steps :current="item.step" :status="item.stepstatus">
<Step title="上传文件" content="文件上传至服务器"></Step>
<Step title="添加用例" content="添加用例集及测试用例"></Step>
<Step title="关联用例" content="用例关联story,用例名需要包含stroy的key"></Step>
</Steps>
</Col>
</Row>
<Page :total="total" :page-size="pageinfo.page_size" v-model="pageinfo.page_num"
@on-change="getuploadhistory()" show-total style="margin-top: 20px;" />
</div>
</div>
</template>
......@@ -34,12 +50,19 @@ export default {
page_id: 21,
title: "上传用例",
file: null,
file_name: null,
// file_name: null,
project: null,
projects: [],
running: false,
step: null,
stepStatus: null,
uploadhistory: [],
runupload: [],
total: 0,
pageinfo: {
page_size: 10,
page_num: 1
}
// running: false,
// step: null,
// stepStatus: null,
}
},
methods: {
......@@ -48,62 +71,62 @@ export default {
else {
this.file = file;
this.file_name = null;
this.running = false;
this.clearProcess();
}
return false;
},
upload(next, params) {
this.step = 0
this.stepStatus = "process"
upload() {
const formData = new FormData();
formData.append('file', this.file);
this.$http.post('/upload', formData, {
formData.append("project", this.project);
formData.append("projectName", this.projects[this.projects.findIndex(ele => { return ele.id == this.project })].name);
this.$http.post('/tool/testcase/upload', formData, {
headers: {
'Content-Type': 'multipart/form-data'
}
}).then(response => {
console.info(response.data)
this.file_name = response.data.data.filename
console.info(this.file_name)
this.stepStatus = "finish"
next(params);
}).catch(error => {
this.stepStatus = "error"
}).then(() => {
this.getuploadhistory()
}).catch(() => {
this.$Message.error("上传文件失败")
this.getuploadhistory()
})
}, getprojects() {
this.$request('get', 'tool/testport/getproject', null, this, (data) => { this.projects = data.data })
},
makecase(next) {
this.step = 1
this.stepStatus = "process"
console.info(this.project)
this.$request('post', 'tool/testcase/uploadcase', { project: this.project, file_name: this.file_name }, this, () => {
this.stepStatus = "finish"
next();
}, () => { this.stepStatus = "error" })
},
relevancycase() {
this.step = 2
this.stepStatus = "process"
this.$request('post', 'tool/testcase/relevancycase/' + this.project, null, this, () => {
this.stepStatus = "finish",
this.step = 3
}, () => { this.stepStatus = "error" })
},
run() {
this.clearProcess();
this.running = true
this.upload(this.makecase, this.relevancycase)
// this.upload(() => { }, () => { })
getprojects() {
this.$request('get', '/tool/testport/getproject', null, this, (data) => { this.projects = data.data })
},
clearProcess() {
this.step = null;
this.stepStatus = null
getuploadhistory() {
this.$request('get', '/tool/testcase/uploadhistory', this.pageinfo, this, (data) => { this.uploadhistory = data.data.rows; this.total = data.data.total })
}
},
created() {
this.getprojects()
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)
},
destroyed() {
this.$socket.io.off('infoupdate')
},
watch: {
uploadhistory: {
handler(value) {
console.info(value)
const a = []
value.forEach(ele => {
ele.status == 0 && a.push(ele.id)
})
this.runupload = a
}
},
runupload(newvalue, oldvalue) {
newvalue.forEach(ele => {
if (!oldvalue.includes(ele)) this.$socket.io.emit("join", ele)
})
oldvalue.forEach(ele => {
if (!oldvalue.includes(ele)) this.$socket.io.emit("leave", ele)
})
}
}
};
</script>
......
......@@ -19,7 +19,18 @@ module.exports = defineConfig({
pathRewrite: {
'/api': ''
}
}
},
// '/socket.io': {
// target: 'http://localhost:8080', // target host
// changeOrigin: true, // needed for virtual hosted sites
// logLevel: 'debug'
// },
// '/sockjs-node': {
// target: 'http://localhost:8080',
// ws: false,
// changeOrigin: true
// }
}
}
})
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