|
@@ -43,19 +43,19 @@
|
|
|
position: absolute;
|
|
|
top: 5%;
|
|
|
right: 5%;
|
|
|
- width: 20%;
|
|
|
+ width: 15%;
|
|
|
z-index: 9999;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: flex-end;
|
|
|
}
|
|
|
|
|
|
- .back_list>div {
|
|
|
+ .back_list > div {
|
|
|
font-size: 18px;
|
|
|
width: 50%;
|
|
|
text-align: center;
|
|
|
border-radius: 5px;
|
|
|
- padding: 1% 0;
|
|
|
+ padding: 5% 0;
|
|
|
}
|
|
|
|
|
|
.back_list .back {
|
|
@@ -93,7 +93,7 @@
|
|
|
margin-top: 1%;
|
|
|
}
|
|
|
|
|
|
- .file_item>img {
|
|
|
+ .file_item > img {
|
|
|
width: 50%;
|
|
|
}
|
|
|
|
|
@@ -121,7 +121,7 @@
|
|
|
width: 0;
|
|
|
}
|
|
|
|
|
|
- .show>img {
|
|
|
+ .show > img {
|
|
|
position: relative;
|
|
|
top: 50%;
|
|
|
transform: translateY(-50%);
|
|
@@ -130,7 +130,7 @@
|
|
|
margin-right: 2%;
|
|
|
}
|
|
|
|
|
|
- .show>video {
|
|
|
+ .show > video {
|
|
|
position: relative;
|
|
|
top: 50%;
|
|
|
transform: translateY(-50%);
|
|
@@ -204,7 +204,7 @@
|
|
|
background-color: rgba(4, 108, 183, 0.25);
|
|
|
}
|
|
|
|
|
|
- .ass_shrink>img {
|
|
|
+ .ass_shrink > img {
|
|
|
width: 60%;
|
|
|
}
|
|
|
</style>
|
|
@@ -225,7 +225,7 @@
|
|
|
</ul>
|
|
|
<!-- 收缩文件分类 -->
|
|
|
<div class="ass_shrink" style="display: none;">
|
|
|
- <img src="/${data.websiteInfo.rootPath }/public/img/bottom.png" style="transform: rotate(90deg);" />
|
|
|
+ <img src="/${data.websiteInfo.rootPath }/public/img/bottom.png" style="transform: rotate(90deg);"/>
|
|
|
</div>
|
|
|
<!-- 返回和文件列表 -->
|
|
|
<div class="back_list">
|
|
@@ -240,7 +240,7 @@
|
|
|
</div>
|
|
|
<!-- 显示 -->
|
|
|
<div class="show">
|
|
|
- <img src="/${data.websiteInfo.rootPath }/public/img/a1.png" style="display: none;" />
|
|
|
+ <img src="/${data.websiteInfo.rootPath }/public/img/a1.png" style="display: none;"/>
|
|
|
<video controls="controls" style="display: none;">
|
|
|
<source src="" type="video/mp4"></source>
|
|
|
</video>
|
|
@@ -248,15 +248,17 @@
|
|
|
<div id="pdfDiv"></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
-<script src="/${data.websiteInfo.rootPath }/public/js/jquery-3.5.1.min.js" type="text/javascript" charset="utf-8"></script>
|
|
|
+<script src="/${data.websiteInfo.rootPath }/public/js/jquery-3.5.1.min.js" type="text/javascript"
|
|
|
+ charset="utf-8"></script>
|
|
|
<script src="/${data.websiteInfo.rootPath }/public/pdfjs/build/pdf.js" type="text/javascript" charset="utf-8"></script>
|
|
|
+<script src="/${data.websiteInfo.rootPath }/public/js/constant.js" type="text/javascript" charset="utf-8"></script>
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
- $(".back_list").on("click", ".back", function() {
|
|
|
+ $(".back_list").on("click", ".back", function () {
|
|
|
location.href = "/${data.websiteInfo.rootPath }/dhl/hdgn/list.html"
|
|
|
})
|
|
|
|
|
|
- $(".file_list").on("click", ".file_item", function() {
|
|
|
+ $(".file_list").on("click", ".file_item", function () {
|
|
|
$(".box").css("display", "none")
|
|
|
$(".show").css("display", "flex")
|
|
|
$(".wj_list").css("display", "block")
|
|
@@ -271,30 +273,35 @@
|
|
|
}
|
|
|
// 获取点击的自定义属性
|
|
|
var fileIden = $(this).attr("data-iden")
|
|
|
- console.log(fileIden)
|
|
|
+ // console.log(fileIden)
|
|
|
if (fileIden == "img" || fileIden == "video") {
|
|
|
var src = $(this).attr("data-src")
|
|
|
+ src = src.replace("http://localhost", SERVER_IP)
|
|
|
$(".show").find(fileIden).siblings().css("display", "none")
|
|
|
$(".show").find(fileIden).css("display", "block").attr("src", src)
|
|
|
} else {
|
|
|
$(".show").find(".show_pdf").siblings().css("display", "none")
|
|
|
$(".show").find(".show_pdf").css("display", "block")
|
|
|
var filePath = $(".file_list").find(".file_active").attr("data-src");
|
|
|
- console.log(filePath)
|
|
|
+ filePath = filePath.replace("http://localhost", SERVER_IP)
|
|
|
+ // 渲染pdf之前先清空前面的内容
|
|
|
+ $("#pdfDiv").html("")
|
|
|
initPdf(filePath);
|
|
|
}
|
|
|
})
|
|
|
|
|
|
- $(".back_list").on("click", ".wj_list", function() {
|
|
|
- // $(this).css("display", "none")
|
|
|
+
|
|
|
+ $(".back_list").on("click", ".wj_list", function () {
|
|
|
+ $(this).css("display", "none")
|
|
|
// $(".show").css("display", "none")
|
|
|
// $(".box").css("display", "block")
|
|
|
- location.href = "/${data.websiteInfo.rootPath }/dhl/hdgn/wjll/list.html"
|
|
|
+ <#--location.href = "/${data.websiteInfo.rootPath }/dhl/hdgn/wjll/list.html"-->
|
|
|
+ hideFile();
|
|
|
})
|
|
|
|
|
|
// 文件分类
|
|
|
var idenNum = 1
|
|
|
- $("body").on("click", ".ass_shrink", function() {
|
|
|
+ $("body").on("click", ".ass_shrink", function () {
|
|
|
if (idenNum == 0) {
|
|
|
// 收起
|
|
|
$(".file_ass").css("left", "-15%")
|
|
@@ -311,8 +318,9 @@
|
|
|
})
|
|
|
|
|
|
// 点击文件分类并加载相应文件库
|
|
|
- $(".file_ass").on("click", ".ass_item", function() {
|
|
|
- // 点击后先返回页面
|
|
|
+ $(".file_ass").on("click", ".ass_item", function () {
|
|
|
+ // 点击分类先隐藏打开中的文件内容
|
|
|
+ hideFile();
|
|
|
$(this).addClass("ass_active").siblings("li").removeClass("ass_active")
|
|
|
var iden = $(this).attr("data-iden")
|
|
|
if (iden === "xswj") {
|
|
@@ -324,8 +332,24 @@
|
|
|
}
|
|
|
})
|
|
|
|
|
|
- // 默认展示第一个文件分类
|
|
|
- $("#firstShow").click();
|
|
|
+ defaultShowFileList();
|
|
|
+
|
|
|
+ // 默认展示文件分类
|
|
|
+ function defaultShowFileList() {
|
|
|
+ // 通过sessionStorage判断当前页面是否为临时文件上传成功后跳转
|
|
|
+ if (sessionStorage.getItem("LOOK_FILE") === "YES") {
|
|
|
+ console.log("将点击临时文件列表!")
|
|
|
+ $(".file_ass").find(".ass_item").each(function () {
|
|
|
+ if ("lswj" === $(this).attr("data-iden")) {
|
|
|
+ $(this).click();
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ } else {
|
|
|
+ $("#firstShow").click();
|
|
|
+ }
|
|
|
+ sessionStorage.setItem("LOOK_FILE", "NO")
|
|
|
+ }
|
|
|
|
|
|
// 展示pdf
|
|
|
function initPdf(url) {
|
|
@@ -333,11 +357,11 @@
|
|
|
'/fzzd/public/pdfjs/build/pdf.worker.js';
|
|
|
var loadingTask = pdfjsLib.getDocument(url);
|
|
|
var pdfDiv = document.getElementById('pdfDiv');
|
|
|
- loadingTask.promise.then(function(pdf) {
|
|
|
- for (var i = 1; i<= pdf.numPages; i++) {
|
|
|
- pdf.getPage(i).then(function(page) {
|
|
|
+ loadingTask.promise.then(function (pdf) {
|
|
|
+ for (var i = 1; i <= pdf.numPages; i++) {
|
|
|
+ pdf.getPage(i).then(function (page) {
|
|
|
var scale = 1.5;
|
|
|
- var viewport = page.getViewport({ scale: scale, });
|
|
|
+ var viewport = page.getViewport({scale: scale,});
|
|
|
// Support HiDPI-screens.
|
|
|
var outputScale = window.devicePixelRatio || 1;
|
|
|
|
|
@@ -347,7 +371,7 @@
|
|
|
canvas.width = Math.floor(viewport.width * outputScale);
|
|
|
canvas.height = Math.floor(viewport.height * outputScale);
|
|
|
canvas.style.width = Math.floor(viewport.width) + "px";
|
|
|
- canvas.style.height = Math.floor(viewport.height) + "px";
|
|
|
+ canvas.style.height = Math.floor(viewport.height) + "px";
|
|
|
|
|
|
var transform = outputScale !== 1
|
|
|
? [outputScale, 0, 0, outputScale, 0, 0]
|
|
@@ -363,6 +387,22 @@
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+ // 隐藏文件
|
|
|
+ function hideFile() {
|
|
|
+ // 隐藏文件列表标签
|
|
|
+ $(".wj_list").css("display", "none")
|
|
|
+ // 隐藏打开中的文件
|
|
|
+ var fileIden = $(".file_list").find(".file_active ").attr("data-iden")
|
|
|
+ console.log(fileIden)
|
|
|
+ if (fileIden == "img" || fileIden == "video") {
|
|
|
+ $(".show").find(fileIden).css("display", "none")
|
|
|
+ } else {
|
|
|
+ $(".show").find(".show_pdf").css("display", "none")
|
|
|
+ }
|
|
|
+ // 显示文件列表
|
|
|
+ $(".file_list").css("display", "")
|
|
|
+ }
|
|
|
</script>
|
|
|
</body>
|
|
|
|