| | |
| | | import offset from "@/assets/js/offset"; |
| | | import { comparedList, testCompareReport } from "@/apis"; |
| | | import { mapGetters } from "vuex"; |
| | | import { toFixed } from "@/assets/js/util"; |
| | | // 保留三位小数 |
| | | const BIT = 3; |
| | | |
| | | export default { |
| | | name: "", |
| | | |
| | |
| | | this.fileData.data2 = data2; |
| | | this.fileData.data3 = data3; |
| | | const { |
| | | chainResCoeK5, |
| | | resBadCoeK4, |
| | | resGoodCoeK3, |
| | | volHighCoeK2, |
| | | volLowCoeK1, |
| | | vol2HighCoeK2, |
| | | vol2LowCoeK1, |
| | | vol12HighCoeK2, |
| | | vol12LowCoeK1, |
| | | } = this.params; |
| | | const { battRes, battVol } = data3.fileParamBase; |
| | | this.marks.resChart[0].y = resGoodCoeK3 * battRes; |
| | | this.marks.resChart[1].y = resBadCoeK4 * battRes; |
| | | this.marks.resChart[0].y = toFixed( |
| | | (resGoodCoeK3 * battRes) / 100, |
| | | BIT |
| | | ); |
| | | this.marks.resChart[1].y = toFixed( |
| | | (resBadCoeK4 * battRes) / 100, |
| | | BIT |
| | | ); |
| | | |
| | | this.marks.volChart[0].y = volHighCoeK2 * battVol; |
| | | this.marks.volChart[1].y = volLowCoeK1 * battVol; |
| | | |
| | | this.initChart(); |
| | | if (2 == battVol) { |
| | | this.marks.volChart[0].y = toFixed(vol2HighCoeK2, BIT); |
| | | this.marks.volChart[1].y = toFixed(vol2LowCoeK1, BIT); |
| | | } else if (12 == battVol) { |
| | | this.marks.volChart[0].y = toFixed(vol12HighCoeK2, BIT); |
| | | this.marks.volChart[1].y = toFixed(vol12LowCoeK1, BIT); |
| | | } else { |
| | | this.marks.volChart = []; |
| | | } |
| | | this.$nextTick(() => { |
| | | this.initChart(); |
| | | }); |
| | | } else { |
| | | this.$message.error("文件解析失败"); |
| | | } |
| | |
| | | ); |
| | | |
| | | this.$bus.$on("export", this.exportReport); |
| | | this.$bus.$on("paramsUpdated", () => { |
| | | this.refreshPage(true); |
| | | }); |
| | | }, |
| | | removeListener() { |
| | | document.removeEventListener("fullscreenchange", this.fullScreenListener); |
| | |
| | | return this.$refs[ref][0]; |
| | | } |
| | | }, |
| | | activeFN() { |
| | | this.$nextTick(() => { |
| | | this.resize(); |
| | | }); |
| | | }, |
| | | refreshPage(force) { |
| | | if (!force && (this._isDestroyed || this._directInactive)) { |
| | | return false; |
| | | } |
| | | this.comparedList(); |
| | | }, |
| | | exportReport() { |
| | | // console.log(this, 'export') |
| | | if (this._directInactive) { |
| | | if (this._isDestroyed || this._directInactive) { |
| | | return false; |
| | | } |
| | | const { |
| | |
| | | fileId, |
| | | fileId2, |
| | | }; |
| | | testCompareReport(params, {resPic, volPic}).then((res) => { |
| | | testCompareReport(params, { resPic, volPic }).then((res) => { |
| | | let { headers, data, status } = res; |
| | | if (200 == status && data) { |
| | | let url = window.URL.createObjectURL(data); |