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

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

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