|
@@ -126,11 +126,8 @@
|
|
>
|
|
>
|
|
<span>
|
|
<span>
|
|
<!-- <iframe :src="'http://192.168.5.177:8080'+scope.row.parentDirName" target="_blank">阅读</iframe> -->
|
|
<!-- <iframe :src="'http://192.168.5.177:8080'+scope.row.parentDirName" target="_blank">阅读</iframe> -->
|
|
- <a
|
|
|
|
- :href="'http://192.168.2.250:8089' + scope.row.parentDirName"
|
|
|
|
- target="_blank"
|
|
|
|
- >阅读</a
|
|
|
|
- >
|
|
|
|
|
|
+ <!-- :href="'http://192.168.2.250:8089' + scope.row.parentDirName" -->
|
|
|
|
+ <a target="_blank">阅读</a>
|
|
</span>
|
|
</span>
|
|
</el-button>
|
|
</el-button>
|
|
<el-button
|
|
<el-button
|
|
@@ -139,11 +136,7 @@
|
|
@click="handleupLoad(scope.row)"
|
|
@click="handleupLoad(scope.row)"
|
|
>
|
|
>
|
|
<span class="chakan1">
|
|
<span class="chakan1">
|
|
- <a
|
|
|
|
- :href="'http://192.168.2.250:8089' + scope.row.parentDirName"
|
|
|
|
- download
|
|
|
|
- >下载</a
|
|
|
|
- >
|
|
|
|
|
|
+ <a :href="downurl + scope.row.parentDirName" download>下载</a>
|
|
</span>
|
|
</span>
|
|
</el-button>
|
|
</el-button>
|
|
<el-button size="dels" type="text" @click="handledels(scope.row)">
|
|
<el-button size="dels" type="text" @click="handledels(scope.row)">
|
|
@@ -487,11 +480,75 @@
|
|
<el-button @click="cancel" size="" class="aa1"> 取 消</el-button>
|
|
<el-button @click="cancel" size="" class="aa1"> 取 消</el-button>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
+ <!-- 添加预览doc文件弹框 -->
|
|
|
|
+ <el-dialog
|
|
|
|
+ style="color: pink"
|
|
|
|
+ :title="title3"
|
|
|
|
+ :visible.sync="open33"
|
|
|
|
+ width="850px"
|
|
|
|
+ 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 :theme="'default'" type="submit" :title="'上一页'" @click.native="prePage"> 上一页</el-button>
|
|
|
|
+ <div style="margin-left:10px;margin-right:10px">{{pageNum}}/{{pageTotalNum}} </div>
|
|
|
|
+ <el-button :theme="'default'" 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>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import axios from "axios";
|
|
|
|
+import PDF from "vue-pdf";
|
|
|
|
+const docx = require("docx-preview");
|
|
|
|
+window.JSZip = require("jszip");
|
|
import {
|
|
import {
|
|
// 获取文件列表接口
|
|
// 获取文件列表接口
|
|
listFileinfo,
|
|
listFileinfo,
|
|
@@ -614,6 +671,19 @@ export default {
|
|
addbtn: true,
|
|
addbtn: true,
|
|
// 虚拟字段
|
|
// 虚拟字段
|
|
fid: "",
|
|
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,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
|
|
|
|
@@ -631,7 +701,58 @@ export default {
|
|
$(".app-wrapper").addClass("hideSidebar");
|
|
$(".app-wrapper").addClass("hideSidebar");
|
|
$(".sidebar-logo-container").removeClass("collapse");
|
|
$(".sidebar-logo-container").removeClass("collapse");
|
|
},
|
|
},
|
|
|
|
+ components: {
|
|
|
|
+ PDF,
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
|
|
+ /**
|
|
|
|
+ * 预览PDF
|
|
|
|
+ */
|
|
|
|
+ previewPDF(row, index) {
|
|
|
|
+ this.previewDialog = true;
|
|
|
|
+ console.log("", row, index);
|
|
|
|
+ },
|
|
|
|
+ // 上一页函数,
|
|
|
|
+ prePage() {
|
|
|
|
+ var page = this.pageNum;
|
|
|
|
+ page = page > 1 ? page - 1 : this.pageTotalNum;
|
|
|
|
+ this.pageNum = page;
|
|
|
|
+ },
|
|
|
|
+ // 下一页函数
|
|
|
|
+ nextPage() {
|
|
|
|
+ var page = this.pageNum;
|
|
|
|
+ page = page < this.pageTotalNum ? page + 1 : 1;
|
|
|
|
+ this.pageNum = page;
|
|
|
|
+ },
|
|
|
|
+ // 页面顺时针翻转90度。
|
|
|
|
+ clock() {
|
|
|
|
+ this.pageRotate += 90;
|
|
|
|
+ },
|
|
|
|
+ // 页面逆时针翻转90度。
|
|
|
|
+ counterClock() {
|
|
|
|
+ this.pageRotate -= 90;
|
|
|
|
+ },
|
|
|
|
+ // 页面加载回调函数,其中e为当前页数
|
|
|
|
+ pageLoaded(e) {
|
|
|
|
+ this.curPageNum = e;
|
|
|
|
+ },
|
|
|
|
+ // 错误时回调函数。
|
|
|
|
+ pdfError(error) {
|
|
|
|
+ console.error(error);
|
|
|
|
+ },
|
|
|
|
+ // 打印全部
|
|
|
|
+ pdfPrintAll() {
|
|
|
|
+ /**
|
|
|
|
+ * 打印界面字符乱码是因为你pdf中使用了自定义字体导致的,谷歌浏览器打印的时候预览界面真的变成了真·方块字 ,解决方案如下:
|
|
|
|
+ * 用文章最后的pdfjsWrapper.js在替换掉node_modules/vue-pdf/src/pdfjsWrapper.js
|
|
|
|
+ */
|
|
|
|
+ console.log("打印");
|
|
|
|
+ this.$refs.pdf.print();
|
|
|
|
+ },
|
|
|
|
+ // 预览弹框
|
|
|
|
+ submitForm3() {
|
|
|
|
+ this.open33 = false;
|
|
|
|
+ },
|
|
RankList() {
|
|
RankList() {
|
|
rankList().then((res) => {
|
|
rankList().then((res) => {
|
|
this.Ranking = res.data;
|
|
this.Ranking = res.data;
|
|
@@ -799,7 +920,7 @@ export default {
|
|
|
|
|
|
// })
|
|
// })
|
|
|
|
|
|
- console.log(this.fileinfoList);
|
|
|
|
|
|
+ // console.log(this.fileinfoList);
|
|
this.total = response.total;
|
|
this.total = response.total;
|
|
this.loading = false;
|
|
this.loading = false;
|
|
});
|
|
});
|
|
@@ -1009,8 +1130,24 @@ export default {
|
|
},
|
|
},
|
|
// 阅读按钮操作
|
|
// 阅读按钮操作
|
|
ViewRead(row) {
|
|
ViewRead(row) {
|
|
- // console.log(row.id)
|
|
|
|
- // console.log(row)
|
|
|
|
|
|
+ console.log(row);
|
|
|
|
+ if (row.parentDirId == ".docx" || row.parentDirId == ".doc") {
|
|
|
|
+ this.open33 = true;
|
|
|
|
+ axios({
|
|
|
|
+ method: "get",
|
|
|
|
+ responseType: "blob", // 设置响应文件格式
|
|
|
|
+ url: process.env.VUE_APP_BASE_API + row.parentDirName,
|
|
|
|
+ }).then(({ data }) => {
|
|
|
|
+ // console.log(11)
|
|
|
|
+ console.log(data);
|
|
|
|
+ $(".docx").attr("id", "printArea");
|
|
|
|
+ // console.log($(".docx"));
|
|
|
|
+ docx.renderAsync(data, this.$refs.file); // 渲染到页面预览
|
|
|
|
+ });
|
|
|
|
+ } else if(row.parentDirId =='.pdf'){
|
|
|
|
+ this.previewDialog = true;
|
|
|
|
+ this.pdfurl=process.env.VUE_APP_BASE_API + row.parentDirName
|
|
|
|
+ }
|
|
row.common = "1";
|
|
row.common = "1";
|
|
updateFileinfo(row).then((res) => {
|
|
updateFileinfo(row).then((res) => {
|
|
this.getList();
|
|
this.getList();
|
|
@@ -1018,7 +1155,6 @@ export default {
|
|
this.Ranking = res.data;
|
|
this.Ranking = res.data;
|
|
});
|
|
});
|
|
});
|
|
});
|
|
- // console.log(this.fileinfoList);
|
|
|
|
// window.open("www.baidu.com","_self");
|
|
// window.open("www.baidu.com","_self");
|
|
},
|
|
},
|
|
// 下载按钮操作
|
|
// 下载按钮操作
|
|
@@ -1028,6 +1164,25 @@ export default {
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
<style scoped>
|
|
|
|
+/* ::v-deep .el-dialog__body{
|
|
|
|
+ overflow: auto !important;
|
|
|
|
+ height: 600px !important;
|
|
|
|
+} */
|
|
|
|
+/* doc文件样式修改 */
|
|
|
|
+::v-deep .docx{
|
|
|
|
+ padding: 0 !important;
|
|
|
|
+}
|
|
|
|
+::v-deep .docx-wrapper>section.docx{
|
|
|
|
+ /* padding: 0 !important; */
|
|
|
|
+ margin-bottom: 0px !important;
|
|
|
|
+ box-shadow: none;
|
|
|
|
+}
|
|
|
|
+/* 预览弹框背景去除 */
|
|
|
|
+::v-deep .docx-wrapper {
|
|
|
|
+ padding: 0 !important;
|
|
|
|
+ background: none !important;
|
|
|
|
+}
|
|
|
|
+
|
|
::v-deep .vue-treeselect__placeholder {
|
|
::v-deep .vue-treeselect__placeholder {
|
|
color: #bdbdbd4f !important;
|
|
color: #bdbdbd4f !important;
|
|
}
|
|
}
|
|
@@ -1456,11 +1611,15 @@ body,
|
|
::v-deep input:-moz-placeholder {
|
|
::v-deep input:-moz-placeholder {
|
|
color: #bdbdbd4f !important;
|
|
color: #bdbdbd4f !important;
|
|
}
|
|
}
|
|
-.aa1{
|
|
|
|
|
|
+.aa1 {
|
|
background-color: #1263aa !important;
|
|
background-color: #1263aa !important;
|
|
color: #fff !important;
|
|
color: #fff !important;
|
|
}
|
|
}
|
|
-::v-deep .el-dialog__footer .dialog-footer .el-button--btn{
|
|
|
|
|
|
+::v-deep .el-dialog__footer .dialog-footer .el-button--btn {
|
|
padding-top: 00px !important;
|
|
padding-top: 00px !important;
|
|
}
|
|
}
|
|
|
|
+.userAgree{
|
|
|
|
+ height: 600px;
|
|
|
|
+ overflow: auto;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|