Merge remote-tracking branch 'origin/master' into master
This commit is contained in:
commit
13a3820570
|
@ -1 +1 @@
|
||||||
Subproject commit bb494fc68a2367359c9048fa7250c7618de4afb6
|
Subproject commit 57d6f78efa4b0300be188e8b024511ceef0873ed
|
|
@ -46,10 +46,9 @@ import MsScenarioResults from "./components/ScenarioResults";
|
||||||
import MsContainer from "@/business/components/common/components/MsContainer";
|
import MsContainer from "@/business/components/common/components/MsContainer";
|
||||||
import MsMainContainer from "@/business/components/common/components/MsMainContainer";
|
import MsMainContainer from "@/business/components/common/components/MsMainContainer";
|
||||||
import MsApiReportExport from "./ApiReportExport";
|
import MsApiReportExport from "./ApiReportExport";
|
||||||
import {exportPdf} from "@/common/js/utils";
|
|
||||||
import html2canvas from "html2canvas";
|
|
||||||
import MsApiReportViewHeader from "./ApiReportViewHeader";
|
import MsApiReportViewHeader from "./ApiReportViewHeader";
|
||||||
import {RequestFactory} from "../test/model/ScenarioModel";
|
import {RequestFactory} from "../test/model/ScenarioModel";
|
||||||
|
import {windowPrint} from "../../../../common/js/utils";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "MsApiReportViewDetail",
|
name: "MsApiReportViewDetail",
|
||||||
|
@ -154,23 +153,16 @@ export default {
|
||||||
this.scenarioName = requestResult.scenarioName;
|
this.scenarioName = requestResult.scenarioName;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleExport(name) {
|
handleExport() {
|
||||||
this.loading = true;
|
|
||||||
this.reportExportVisible = true;
|
this.reportExportVisible = true;
|
||||||
let reset = this.exportReportReset;
|
let reset = this.exportReportReset;
|
||||||
|
this.$nextTick(() => {
|
||||||
this.$nextTick(function () {
|
windowPrint('apiTestReport', 0.57);
|
||||||
html2canvas(document.getElementById('apiTestReport'), {
|
reset();
|
||||||
// scale: 2,
|
|
||||||
}).then(function (canvas) {
|
|
||||||
exportPdf(name, [canvas]);
|
|
||||||
reset();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
exportReportReset() {
|
exportReportReset() {
|
||||||
this.reportExportVisible = false;
|
this.$router.go(0);
|
||||||
this.loading = false;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -9,9 +9,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="report-right">
|
<div class="report-right">
|
||||||
<div class="test">
|
<img class="logo" src="@/assets/logo-MeterSphere.png">
|
||||||
<img class="logo" src="@/assets/logo-MeterSphere.png">
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -272,7 +272,7 @@ export default {
|
||||||
|
|
||||||
this.$nextTick(function () {
|
this.$nextTick(function () {
|
||||||
html2canvas(document.getElementById('performanceReportExport'), {
|
html2canvas(document.getElementById('performanceReportExport'), {
|
||||||
// scale: 2
|
scale: 2
|
||||||
}).then(function (canvas) {
|
}).then(function (canvas) {
|
||||||
exportPdf(name, [canvas]);
|
exportPdf(name, [canvas]);
|
||||||
reset();
|
reset();
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
:tip="$t('commons.search_by_name_or_id')"
|
:tip="$t('commons.search_by_name_or_id')"
|
||||||
:create-tip="$t('test_track.case.create')" @create="testCaseCreate">
|
:create-tip="$t('test_track.case.create')" @create="testCaseCreate">
|
||||||
<template v-slot:title>
|
<template v-slot:title>
|
||||||
<node-breadcrumb class="table-title" :nodes="selectParentNodes" @refresh="showAll"/>
|
<node-breadcrumb class="table-title" :nodes="selectParentNodes" @refresh="refresh"/>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:button>
|
<template v-slot:button>
|
||||||
<ms-table-button :is-tester-permission="true" icon="el-icon-download"
|
<ms-table-button :is-tester-permission="true" icon="el-icon-download"
|
||||||
|
@ -292,6 +292,8 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initTableData() {
|
initTableData() {
|
||||||
|
this.condition.planId = "";
|
||||||
|
this.condition.nodeIds = [];
|
||||||
if (this.planId) {
|
if (this.planId) {
|
||||||
// param.planId = this.planId;
|
// param.planId = this.planId;
|
||||||
this.condition.planId = this.planId;
|
this.condition.planId = this.planId;
|
||||||
|
@ -377,10 +379,6 @@ export default {
|
||||||
this.selectRows.clear();
|
this.selectRows.clear();
|
||||||
this.$emit('refresh');
|
this.$emit('refresh');
|
||||||
},
|
},
|
||||||
showAll() {
|
|
||||||
this.condition = {components: TEST_CASE_CONFIGS};
|
|
||||||
this.getData();
|
|
||||||
},
|
|
||||||
showDetail(row, event, column) {
|
showDetail(row, event, column) {
|
||||||
this.$emit('testCaseDetail', row);
|
this.$emit('testCaseDetail', row);
|
||||||
},
|
},
|
||||||
|
|
|
@ -215,6 +215,16 @@
|
||||||
item.checked = false;
|
item.checked = false;
|
||||||
});
|
});
|
||||||
flag ? this.testCases = tableData : this.testCases = this.testCases.concat(tableData);
|
flag ? this.testCases = tableData : this.testCases = this.testCases.concat(tableData);
|
||||||
|
// 去重处理
|
||||||
|
let hash = {}
|
||||||
|
this.testCases = this.testCases.reduce((item, next) => {
|
||||||
|
if (!hash[next.id]) {
|
||||||
|
hash[next.id] = true
|
||||||
|
item.push(next)
|
||||||
|
}
|
||||||
|
return item
|
||||||
|
}, [])
|
||||||
|
|
||||||
this.lineStatus = tableData.length === 50 && this.testCases.length < this.total;
|
this.lineStatus = tableData.length === 50 && this.testCases.length < this.total;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -211,7 +211,7 @@
|
||||||
|
|
||||||
this.$nextTick(function () {
|
this.$nextTick(function () {
|
||||||
html2canvas(document.getElementById('testCaseReportExport'), {
|
html2canvas(document.getElementById('testCaseReportExport'), {
|
||||||
// scale: 2
|
scale: 2
|
||||||
}).then(function(canvas) {
|
}).then(function(canvas) {
|
||||||
exportPdf(name, [canvas]);
|
exportPdf(name, [canvas]);
|
||||||
reset();
|
reset();
|
||||||
|
@ -225,7 +225,7 @@
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>cd
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
||||||
|
|
|
@ -219,6 +219,15 @@
|
||||||
item.checked = false;
|
item.checked = false;
|
||||||
});
|
});
|
||||||
flag ? this.testReviews = tableData : this.testReviews = this.testReviews.concat(tableData);
|
flag ? this.testReviews = tableData : this.testReviews = this.testReviews.concat(tableData);
|
||||||
|
// 去重处理
|
||||||
|
let hash = {}
|
||||||
|
this.testReviews = this.testReviews.reduce((item, next) => {
|
||||||
|
if (!hash[next.id]) {
|
||||||
|
hash[next.id] = true
|
||||||
|
item.push(next)
|
||||||
|
}
|
||||||
|
return item
|
||||||
|
}, [])
|
||||||
this.lineStatus = tableData.length === 50 && this.testReviews.length < this.total;
|
this.lineStatus = tableData.length === 50 && this.testReviews.length < this.total;
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 8a972a198775b3783ed6e4cef27197e53d1ebdc8
|
Subproject commit 71d57ae5d7f8bb5c93a29504ac6f2300dc189ce9
|
|
@ -259,3 +259,17 @@ export function exportPdf(name, canvasList) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function windowPrint(id, zoom) {
|
||||||
|
//根据div标签ID拿到div中的局部内容
|
||||||
|
let bdhtml=window.document.body.innerHTML;
|
||||||
|
let el = document.getElementById(id);
|
||||||
|
var jubuData = el.innerHTML;
|
||||||
|
document.getElementsByTagName('body')[0].style.zoom=zoom;
|
||||||
|
//把获取的 局部div内容赋给body标签, 相当于重置了 body里的内容
|
||||||
|
window.document.body.innerHTML= jubuData;
|
||||||
|
//调用打印功能
|
||||||
|
window.print();
|
||||||
|
window.document.body.innerHTML=bdhtml;//重新给页面内容赋值;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue