From c81bf2132d6d3b7246075c6faa1382365d5f17e2 Mon Sep 17 00:00:00 2001 From: zouyu <2723363702@qq.com> Date: 星期六, 26 八月 2023 15:28:41 +0800 Subject: [PATCH] modified: package.json modified: src/api/standardLibrary.js new file: src/components/experiment/checkTheReport/index.vue modified: src/layout/components/Navbar.vue modified: src/main.js modified: src/router/index.js modified: src/views/chart/work/index.vue modified: src/views/experiment/checkTheReport/index.vue modified: src/views/standardLibrary/index.vue --- src/views/experiment/checkTheReport/index.vue | 48 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 46 insertions(+), 2 deletions(-) diff --git a/src/views/experiment/checkTheReport/index.vue b/src/views/experiment/checkTheReport/index.vue index a127c10..9fad471 100644 --- a/src/views/experiment/checkTheReport/index.vue +++ b/src/views/experiment/checkTheReport/index.vue @@ -51,6 +51,18 @@ > </div> </div> + <el-dialog + top="10vh" + title="鎶ュ憡棰勮" + :visible.sync="dialogVisible" + width="60%"> + <span slot="footer" class="dialog-footer"> + <el-button type="primary" size="small" @click="printFun()">鎵撳嵃</el-button> + </span> + <div class="printStyle"> + <preview id="printDiv"></preview> + </div> + </el-dialog> <div class="table-box"> <el-table ref="reportTable" @@ -143,10 +155,9 @@ <el-button type="text" size="small" - @click="handleClick(scope.row)" + @click="previewFun(scope.row)" >棰勮</el-button > - <el-button type="text" size="small">鎵撳嵃</el-button> </template> </el-table-column> </el-table> @@ -169,6 +180,8 @@ <script> import { selectAllReport } from "@/api/experiment/checkTheReport"; +import Preview from "@/components/experiment/checkTheReport/index.vue"; +import PrintJS from 'print-js' export default { data() { return { @@ -183,12 +196,33 @@ total: 0, pageSize: 10, checked: true, + dialogVisible: false, }; }, created() { this.getData(); }, + mounted(){ + // this.dialogVisible = true; + }, + components:{ + Preview + }, methods: { + //棰勮鎸夐挳 + previewFun(){ + this.dialogVisible = true; + }, + //鎵撳嵃鎸夐挳 + printFun(){ + PrintJS({ + printable: "printDiv", + type: "html", + // header: "鍘熸潗鏂欐娴嬫姤鍛�", + targetStyles: ["*"], + ignoreElements: ["no-ignore"], + }); + }, // 鐘舵�佹寜閽� handleRadioChange() { this.getData(); @@ -227,6 +261,7 @@ }; const { data } = await selectAllReport(params); this.reportTable = data.row; + console.log(data.row); this.total = data.total; }, }, @@ -280,5 +315,14 @@ margin: 10px 0; } } + .printStyle{ + overflow: scroll; + height:600px; + .el-button{ + position: absolute; + top: 10vh; + left: 90%; + } + } } </style> -- Gitblit v1.9.3