Commit 3dde264a authored by Wallen姚文辉's avatar Wallen姚文辉

需求加优化

parent 6245377e
<!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.233aa2e8.js"></script><script defer="defer" src="/js/app.b314569f.js"></script><link href="/css/chunk-vendors.187ae3e6.css" rel="stylesheet"><link href="/css/app.1eedf6d0.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> <!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.233aa2e8.js"></script><script defer="defer" src="/js/app.3aa9c243.js"></script><link href="/css/chunk-vendors.187ae3e6.css" rel="stylesheet"><link href="/css/app.1eedf6d0.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 \ No newline at end of file
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -2,8 +2,9 @@ ...@@ -2,8 +2,9 @@
<PageHeader :title="title"> <PageHeader :title="title">
<template #action> <template #action>
<div style="text-align: left;"> <div style="text-align: left;">
<Select v-model="ReC.project" style="width:200px" placeholder="项目" @on-change="getiterations"> <Select filterable v-model="ReC.project" style="width:200px" placeholder="项目"
<Option v-for="item in projects" :value="item.key" :key="item.key">{{ @on-change="getiterations">
<Option v-for="item in projects" :value="item.id" :key="item.id">{{
item.name }}</Option> item.name }}</Option>
</Select> </Select>
<Select v-model="ReC.iteration" style="width:200px;margin-left: 10px;" placeholder="迭代" <Select v-model="ReC.iteration" style="width:200px;margin-left: 10px;" placeholder="迭代"
...@@ -440,6 +441,8 @@ export default { ...@@ -440,6 +441,8 @@ export default {
methods: { methods: {
breforesend() { breforesend() {
if (!this.report) return this.$Message.error("请先完善报告信息") if (!this.report) return this.$Message.error("请先完善报告信息")
if (this.fugailu < 100) return this.$Message.error("用例覆盖率不足100%(每个需求必须关联测试用例)")
this.edit = false;
this.getallEmail(); this.getallEmail();
this.modlShow = true; this.modlShow = true;
}, },
...@@ -488,26 +491,20 @@ export default { ...@@ -488,26 +491,20 @@ export default {
}, },
async send() { async send() {
if (!this.report) return if (!this.report) return
this.edit = false
const html = document.getElementById("reportBox").innerHTML const html = document.getElementById("reportBox").innerHTML
var stylestart = '<head><style type="text/css">' var stylestart = '<head><style type="text/css">'
var styleend = '</style></head>' var styleend = '</style></head>'
const cssBlock = document.styleSheets const cssBlock = document.styleSheets
for (var i of cssBlock) { for (var i of cssBlock) {
for (var j of i.rules) { for (var j of i.rules) {
if (!j.selectorText) continue
if (j.selectorText == ".ivu-table") { if (j.selectorText == ".ivu-table") {
stylestart = stylestart + ".ivu-table {width: inherit;max-width: 100%;overflow: hidden;color: rgb(81, 90, 110);font-size: 14px;background-color: rgb(255, 255, 255);box-sizing: border-box;}" stylestart = stylestart + ".ivu-table {width: inherit;max-width: 100%;overflow: hidden;color: rgb(81, 90, 110);font-size: 14px;background-color: rgb(255, 255, 255);box-sizing: border-box;}"
} }
else { stylestart = stylestart + j.cssText } else if (j.selectorText.includes("ivu-btn") || j.selectorText.includes("ivu-typography") || j.selectorText.includes("ivu-table") || j.selectorText.includes("body")) { stylestart = stylestart + j.cssText }
} }
} }
const c = (stylestart + styleend + html).replace(/style="width(.*?)"/gm, 'style="width:100%"') const c = (stylestart + styleend + html).replace(/style="width(.*?)"/gm, 'style="width:100%"')
// const info = '<div style="display:flex"><div id="c1" style="width: 50%;height: 300px;"></div><div id="c2" style="width: 50%;height: 300px;"></div></div><div style="display:flex"><div id="c3" style="width: 50%;height: 300px;"></div><div id="c4" style="width: 50%;height: 300px;"></div></div>'
// const cjs1 = `var chartDom1 = document.getElementById('c1');var myChart1 = echarts.init(chartDom1);myChart1.setOption(${JSON.stringify(this.bug_create_column)});`
// const cjs2 = `var chartDom2 = document.getElementById('c2');var myChart2 = echarts.init(chartDom2);myChart2.setOption(${JSON.stringify(this.bug_p_column)});`
// const cjs3 = `var chartDom3 = document.getElementById('c3');var myChart3 = echarts.init(chartDom3);myChart3.setOption(${JSON.stringify(this.case_s_column)});`
// const cjs4 = `var chartDom4 = document.getElementById('c4');var myChart4 = echarts.init(chartDom4);myChart4.setOption(${JSON.stringify(this.bug_user_column)});`
// const result = c + info + '<' + 'script type="text/javascript" src="https://cdn.staticfile.org/echarts/5.5.0/echarts.min.js"></' + 'script>' + "<" + 'script type="text/javascript">' + cjs1 + cjs2 + cjs3 + cjs4 + "<" + "/script>"
var htmlDom = document.getElementById("biao") var htmlDom = document.getElementById("biao")
html2canvas(htmlDom, { html2canvas(htmlDom, {
useCORS: true, useCORS: true,
...@@ -521,7 +518,6 @@ export default { ...@@ -521,7 +518,6 @@ export default {
const m = `<img src='${canvas.toDataURL("image/png")}'/>` const m = `<img src='${canvas.toDataURL("image/png")}'/>`
const result = c + m const result = c + m
const sub = this.info.project + "-" + this.info.sprint + "测试报告" const sub = this.info.project + "-" + this.info.sprint + "测试报告"
console.info(result)
this.$request("post", "/tool/testport/sendport", { to: this.sendto, subject: sub, contents: result }, this, () => { this.closeShow() }) this.$request("post", "/tool/testport/sendport", { to: this.sendto, subject: sub, contents: result }, this, () => { this.closeShow() })
}); });
}, },
......
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