|
@@ -271,8 +271,16 @@
|
|
|
label="操作"
|
|
|
align="center"
|
|
|
class-name="small-padding fixed-width"
|
|
|
+ width="250px"
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ size="btk"
|
|
|
+ type="text"
|
|
|
+ @click="handlelook(scope.row)"
|
|
|
+ v-hasPermi="['PrintsLog:printlog:edit']"
|
|
|
+ >查看</el-button
|
|
|
+ >
|
|
|
<el-button
|
|
|
size="btk"
|
|
|
type="text"
|
|
@@ -576,6 +584,120 @@
|
|
|
>
|
|
|
<div ref="file" v-html="tableau" style="width:100%;"></div>
|
|
|
</el-dialog> -->
|
|
|
+ <!-- 添加预览doc文件弹框 -->
|
|
|
+ <el-dialog
|
|
|
+ style="color: pink"
|
|
|
+ :title="title3"
|
|
|
+ :visible.sync="open33"
|
|
|
+ width="1100px"
|
|
|
+ append-to-body
|
|
|
+ id="fileinfodocx"
|
|
|
+ class="el-dialog__header"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ >
|
|
|
+ <div ref="file"></div>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitForm3">关 闭</el-button>
|
|
|
+ <!-- <el-button @click="open33 = false" size="" class="aa1">
|
|
|
+ 取 消</el-button
|
|
|
+ > -->
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ <!-- 预览PDF文件弹框 -->
|
|
|
+ <el-dialog
|
|
|
+ :title="title3"
|
|
|
+ :visible.sync="previewDialog"
|
|
|
+ width="850px"
|
|
|
+ append-to-body
|
|
|
+ id="fileinfopdf"
|
|
|
+ class="el-dialog__header"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ >
|
|
|
+ <template>
|
|
|
+ <!-- <div style="margin-bottom:20px"> -->
|
|
|
+ <div style="display: flex">
|
|
|
+ <el-button
|
|
|
+ :class="gopage == true ? 'bg' : ''"
|
|
|
+ class="gopage"
|
|
|
+ :theme="'default'"
|
|
|
+ type="submit"
|
|
|
+ :title="'上一页'"
|
|
|
+ @click.native="prePage"
|
|
|
+ >
|
|
|
+ 上一页</el-button
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ style="
|
|
|
+ width: 50px;
|
|
|
+ height: 28px;
|
|
|
+ background: #f4f4f4;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 28px;
|
|
|
+ "
|
|
|
+ >
|
|
|
+ {{ pageNum }}/{{ pageTotalNum }}
|
|
|
+ </div>
|
|
|
+ <el-button
|
|
|
+ :class="gopage == false ? 'bg' : ''"
|
|
|
+ :theme="'default'"
|
|
|
+ class="downpage"
|
|
|
+ type="submit"
|
|
|
+ :title="'下一页'"
|
|
|
+ @click.native="nextPage"
|
|
|
+ >
|
|
|
+ 下一页</el-button
|
|
|
+ >
|
|
|
+ <!-- <el-button :theme="'default'" type="submit" :title="'顺时针旋转'" @click.native="clock" > 顺时针旋转</el-button>
|
|
|
+ <el-button :theme="'default'" type="submit" :title="'逆时针旋转'" @click.native="counterClock" > 逆时针旋转</el-button>
|
|
|
+ <el-button :theme="'default'" type="submit" :title="'打印'" @click.native="pdfPrintAll"> 打印</el-button> -->
|
|
|
+ </div>
|
|
|
+ <PDF
|
|
|
+ ref="pdf"
|
|
|
+ :src="pdfurl"
|
|
|
+ :page="pageNum"
|
|
|
+ :rotate="pageRotate"
|
|
|
+ @progress="loadedRatio = $event"
|
|
|
+ @page-loaded="pageLoaded($event)"
|
|
|
+ @num-pages="pageTotalNum = $event"
|
|
|
+ @error="pdfError($event)"
|
|
|
+ @link-clicked="page = $event"
|
|
|
+ ></PDF>
|
|
|
+ <!-- </div> -->
|
|
|
+ <!-- <div class="el-dialog__footer"> -->
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="previewDialog = false"
|
|
|
+ >关 闭</el-button
|
|
|
+ >
|
|
|
+ <!-- <el-button @click="previewDialog = false" size="" class="aa1"
|
|
|
+ >取 消</el-button
|
|
|
+ > -->
|
|
|
+ </div>
|
|
|
+ <!-- </div> -->
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ :title="title3"
|
|
|
+ :visible.sync="open44"
|
|
|
+ width="1100px"
|
|
|
+ append-to-body
|
|
|
+ id="fileinfopdf"
|
|
|
+ class="el-dialog__header"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ >
|
|
|
+ <template>
|
|
|
+ <div class="home">
|
|
|
+ <div v-html="tableau"></div>
|
|
|
+ </div>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="open44 = false"
|
|
|
+ >关 闭</el-button
|
|
|
+ >
|
|
|
+ <!-- <el-button @click="open44 = false" size="" class="aa1"
|
|
|
+ >取 消</el-button
|
|
|
+ > -->
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -594,10 +716,10 @@ import {
|
|
|
import { getToken } from "@/utils/auth";
|
|
|
import Cookies from "js-cookie";
|
|
|
import axios from "axios";
|
|
|
-const XLSX = require("xlsx");
|
|
|
+var XLSX = require("xlsx");
|
|
|
const docx = require("docx-preview");
|
|
|
window.JSZip = require("jszip");
|
|
|
-
|
|
|
+import PDF from "vue-pdf";
|
|
|
export default {
|
|
|
name: "Manage",
|
|
|
dicts: ["level", "print_room"],
|
|
@@ -607,7 +729,7 @@ export default {
|
|
|
// 数量限制
|
|
|
limit: {
|
|
|
type: Number,
|
|
|
- default: 5,
|
|
|
+ default: 10,
|
|
|
},
|
|
|
// 大小限制(MB)
|
|
|
fileSize: {
|
|
@@ -625,6 +747,9 @@ export default {
|
|
|
default: true,
|
|
|
},
|
|
|
},
|
|
|
+ components: {
|
|
|
+ PDF,
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
// 遮罩层
|
|
@@ -706,6 +831,25 @@ export default {
|
|
|
tableau: null,
|
|
|
yaoqiuflg: false,
|
|
|
roles: "",
|
|
|
+ // 虚拟字段
|
|
|
+ fid: "",
|
|
|
+ open33: false,
|
|
|
+ title3: "预览文件",
|
|
|
+ // 下载文件路径
|
|
|
+ downurl: process.env.VUE_APP_BASE_API,
|
|
|
+ // pdf文件
|
|
|
+ previewDialog: false,
|
|
|
+ pdfurl: "",
|
|
|
+ pageNum: 1,
|
|
|
+ pageTotalNum: 1,
|
|
|
+ pageRotate: 0,
|
|
|
+ // 加载进度
|
|
|
+ loadedRatio: 0,
|
|
|
+ curPageNum: 0,
|
|
|
+ gopage: true,
|
|
|
+ // excel表格
|
|
|
+ tableau: null,
|
|
|
+ open44: false,
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -957,6 +1101,7 @@ export default {
|
|
|
this.dyform.printRoom = row.printRoom;
|
|
|
this.dyform.type = row.type;
|
|
|
// this.dyform.isReturn = row.isReturn + "";
|
|
|
+ console.log(this.dyform)
|
|
|
if (row.isPrintColor == 1) {
|
|
|
this.yaoqiu = "彩打";
|
|
|
this.yaoqiuflg = true;
|
|
@@ -974,6 +1119,44 @@ export default {
|
|
|
}
|
|
|
this.getrylist();
|
|
|
},
|
|
|
+ // 查看按钮预览
|
|
|
+ handlelook(row) {
|
|
|
+ console.log(row);
|
|
|
+ if (row.type == "docx" || row.type == "doc") {
|
|
|
+ console.log(11);
|
|
|
+ this.open33 = true;
|
|
|
+ axios({
|
|
|
+ method: "get",
|
|
|
+ responseType: "blob", // 设置响应文件格式
|
|
|
+ url: row.file,
|
|
|
+ }).then(({ data }) => {
|
|
|
+ console.log(data);
|
|
|
+ $(".docx").attr("id", "printArea");
|
|
|
+ // console.log($(".docx"));
|
|
|
+ docx.renderAsync(data, this.$refs.file); // 渲染到页面预览
|
|
|
+ });
|
|
|
+ } else if (row.type == "pdf") {
|
|
|
+ this.previewDialog = true;
|
|
|
+ this.pdfurl = row.file;
|
|
|
+ } else if (row.type == "xlsx") {
|
|
|
+ axios
|
|
|
+ .get(row.file, {
|
|
|
+ responseType: "arraybuffer", // 设置响应体类型为arraybuffer
|
|
|
+ })
|
|
|
+ .then(({ data }) => {
|
|
|
+ console.log(data);
|
|
|
+
|
|
|
+ let workbook = XLSX.read(new Uint8Array(data), { type: "array" }); // 解析数据
|
|
|
+ this.open44 = true;
|
|
|
+ var worksheet = workbook.Sheets[workbook.SheetNames[0]]; // workbook.SheetNames 下存的是该文件每个工作表名字,这里取出第一个工作表
|
|
|
+ this.tableau = XLSX.utils.sheet_to_html(worksheet); // 渲染
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 预览弹框
|
|
|
+ submitForm3() {
|
|
|
+ this.open33 = false;
|
|
|
+ },
|
|
|
//获取人员
|
|
|
getrylist() {
|
|
|
listPeople().then((res) => {
|
|
@@ -1207,4 +1390,60 @@ export default {
|
|
|
::v-deep .el-input__inner {
|
|
|
border: 1px solid white !important;
|
|
|
}
|
|
|
+/* 预览弹框背景去除 */
|
|
|
+::v-deep .docx-wrapper {
|
|
|
+ padding: 0 !important;
|
|
|
+ background: none !important;
|
|
|
+}
|
|
|
+/* excel表格样式 */
|
|
|
+::v-deep .home table tr td{
|
|
|
+ text-align: right;
|
|
|
+ height: 20px;
|
|
|
+ min-width: 60px;
|
|
|
+ text-align: center;
|
|
|
+ /* margin-left: -5px ; */
|
|
|
+ /* width: 70px !important; */
|
|
|
+ border-right:1px solid black;
|
|
|
+ border-bottom: 1px solid black !important;
|
|
|
+}
|
|
|
+::v-deep .home table{
|
|
|
+ width: 100%;
|
|
|
+ border-spacing:0px !important;
|
|
|
+ border-top: 1px solid black;
|
|
|
+ border-left: 1px solid black;
|
|
|
+ /* border-collapse: collapse !important;
|
|
|
+ border-color:#b6ff00 !important; */
|
|
|
+}
|
|
|
+::v-deep .docx-wrapper table tr td{
|
|
|
+ border-bottom: 1px solid black !important;
|
|
|
+}
|
|
|
+::v-deep .docx{
|
|
|
+ width: 100% !important;
|
|
|
+}
|
|
|
+/* 文件关闭小叉号 */
|
|
|
+::v-deep .el-dialog__headerbtn .el-dialog__close{
|
|
|
+ color: #ccc !important;
|
|
|
+}
|
|
|
+/* 上一页样式 */
|
|
|
+.gopage {
|
|
|
+ width: 60px;
|
|
|
+ height: 28px;
|
|
|
+ background: #f4f4f4;
|
|
|
+ color:#60627d;
|
|
|
+ border-radius: 14px 0px 0px 14px;
|
|
|
+ padding: 6px 9px;
|
|
|
+}
|
|
|
+/* 下一页样式 */
|
|
|
+.downpage {
|
|
|
+ width: 60px;
|
|
|
+ height: 28px;
|
|
|
+ background: #f4f4f4;
|
|
|
+ border-radius: 0px 14px 14px 0px;
|
|
|
+ padding: 6px 9px;
|
|
|
+}
|
|
|
+.bg{
|
|
|
+ background: #1D96FF;
|
|
|
+ color: white;
|
|
|
+}
|
|
|
+
|
|
|
</style>
|