Commit 2fcef0eb by liuyang

Merge branch 'dev' of http://git.pseer.com:8800/platform/hg-smart into dev-ly

parents ee7ef098 a1e09350
...@@ -14,6 +14,7 @@ import com.baosight.iplat4j.core.ioc.spring.PlatApplicationContext; ...@@ -14,6 +14,7 @@ import com.baosight.iplat4j.core.ioc.spring.PlatApplicationContext;
import com.baosight.iplat4j.eu.dm.util.PlatFileUploader; import com.baosight.iplat4j.eu.dm.util.PlatFileUploader;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import java.net.URLEncoder;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -133,7 +134,8 @@ public class Iplat4jUtils { ...@@ -133,7 +134,8 @@ public class Iplat4jUtils {
} }
String chgName = dbDm02Map.get("chgName").toString(); String chgName = dbDm02Map.get("chgName").toString();
String realPath = dbDm02Map.get("realPath").toString(); String realPath = dbDm02Map.get("realPath").toString();
return S3Constant.RESOURCE + "/" + OSConstant.FILE_DOWNLOAD + "/" + realPath + chgName; return S3Constant.RESOURCE + "/" + OSConstant.FILE_DOWNLOAD + "/" + realPath
+ URLEncoder.encode(chgName, "UTF-8");
} }
} }
...@@ -145,8 +147,8 @@ public class Iplat4jUtils { ...@@ -145,8 +147,8 @@ public class Iplat4jUtils {
* @return * @return
*/ */
public static String compressFile(List<String> docIds, String zipName) throws Exception { public static String compressFile(List<String> docIds, String zipName) throws Exception {
String zipFolderPath = OSConstant.ZIP_DIR + OSConstant.SEPARATOR + DateUtils.shortDate() String mainFolderPath = OSConstant.ZIP_DIR + OSConstant.SEPARATOR + DateUtils.shortDate();
+ OSConstant.SEPARATOR + zipName; String zipFolderPath = mainFolderPath + OSConstant.SEPARATOR + zipName;
FileUtils.createDirs(zipFolderPath); FileUtils.createDirs(zipFolderPath);
String zipFilePath = zipFolderPath + ".zip"; String zipFilePath = zipFolderPath + ".zip";
if (CommonConstant.FileLocation.S3.equalsIgnoreCase(S3Constant.FILE_LOCATION)) { if (CommonConstant.FileLocation.S3.equalsIgnoreCase(S3Constant.FILE_LOCATION)) {
...@@ -171,8 +173,10 @@ public class Iplat4jUtils { ...@@ -171,8 +173,10 @@ public class Iplat4jUtils {
// 压缩完删除本地文件 // 压缩完删除本地文件
FileUtils.deleteFiles(zipFolderPath); FileUtils.deleteFiles(zipFolderPath);
// 替换成HTTP地址 // 替换成HTTP地址
return S3Constant.RESOURCE + "/" + OSConstant.FILE_DOWNLOAD + zipFilePath.replace(OSConstant.DOC_ROOT_DIR, "") return S3Constant.RESOURCE + "/" + OSConstant.FILE_DOWNLOAD
.replace(OSConstant.SEPARATOR, "/"); + mainFolderPath.replace(OSConstant.DOC_ROOT_DIR, "")
.replace(OSConstant.SEPARATOR, "/") + "/"
+ URLEncoder.encode(zipName, "UTF-8") + ".zip";
} }
} }
...@@ -7,7 +7,7 @@ package com.baosight.hggp.hg.sc.enums; ...@@ -7,7 +7,7 @@ package com.baosight.hggp.hg.sc.enums;
public enum ProjectSourceEnum { public enum ProjectSourceEnum {
ENGINEERING("engineering", "工程设计图"), ENGINEERING("engineering", "工程设计图"),
FOREIGN("foreign", "外来涉密图"), FOREIGN("foreign", "生产制造图"),
SPARE("spare", "备件制造图"), SPARE("spare", "备件制造图"),
OTHER("other", "其他"), OTHER("other", "其他"),
; ;
......
...@@ -320,8 +320,8 @@ $(function () { ...@@ -320,8 +320,8 @@ $(function () {
if (e.button !== 2) { if (e.button !== 2) {
return return
} }
if ("工程设计图" === e.target.textContent || "外来涉密图" === e.target.textContent if ("engineering" === e.target.title || "foreign" === e.target.title
|| "备件制造图" === e.target.textContent || "其他" === e.target.textContent) { || "spare" === e.target.title || "other" === e.target.title) {
$("#isAdd").css('display', 'none'); $("#isAdd").css('display', 'none');
$("#isDel").css('display', 'none'); $("#isDel").css('display', 'none');
$("#isEdit").css('display', 'none'); $("#isEdit").css('display', 'none');
......
...@@ -66,17 +66,18 @@ function previewFile(url, docType) { ...@@ -66,17 +66,18 @@ function previewFile(url, docType) {
previewExcel(url); previewExcel(url);
} else if (isWord(docType)) { } else if (isWord(docType)) {
previewDocx(url); previewDocx(url);
} else if (true) {
previewOnline(url);
} else if (isText(docType)) {
previewText(url);
} else if (isImage(docType)) {
previewImage(url);
} else if (isFrame(docType)) {
previewFrame(url);
} else { } else {
otherDownload(false, docId); previewOnline(url);
} }
// else if (isText(docType)) {
// previewText(url);
// } else if (isImage(docType)) {
// previewImage(url);
// } else if (isFrame(docType)) {
// previewFrame(url);
// } else {
// otherDownload(false, docId);
// }
} }
/** /**
...@@ -95,7 +96,7 @@ function hideHtml() { ...@@ -95,7 +96,7 @@ function hideHtml() {
/** /**
* 是否文本 * 是否文本
* *
* @param fileName * @param docType
* @returns {boolean} * @returns {boolean}
*/ */
function isText(docType) { function isText(docType) {
...@@ -132,7 +133,7 @@ function previewText(docId) { ...@@ -132,7 +133,7 @@ function previewText(docId) {
/** /**
* 是否文本 * 是否文本
* *
* @param fileName * @param docType
* @returns {boolean} * @returns {boolean}
*/ */
function isXml(docType) { function isXml(docType) {
...@@ -161,7 +162,7 @@ function previewXml(url) { ...@@ -161,7 +162,7 @@ function previewXml(url) {
/** /**
* 是否excel * 是否excel
* *
* @param fileName * @param docType
* @returns {boolean} * @returns {boolean}
*/ */
function isExcel(docType) { function isExcel(docType) {
...@@ -210,7 +211,7 @@ function previewExcel(url) { ...@@ -210,7 +211,7 @@ function previewExcel(url) {
/** /**
* 是否WORD * 是否WORD
* *
* @param fileName * @param docType
* @returns {boolean} * @returns {boolean}
*/ */
function isWord(docType) { function isWord(docType) {
...@@ -241,7 +242,7 @@ function previewDocx(url) { ...@@ -241,7 +242,7 @@ function previewDocx(url) {
/** /**
* 判断是否是图片 * 判断是否是图片
* *
* @param fileName * @param docType
* @returns {boolean} * @returns {boolean}
*/ */
function isImage(docType) { function isImage(docType) {
...@@ -263,12 +264,12 @@ function previewImage(docId) { ...@@ -263,12 +264,12 @@ function previewImage(docId) {
} }
/** /**
* 判断是否frame预览 * PDF预览
* *
* @param fileName * @param docType
* @returns {boolean} * @returns {boolean}
*/ */
function isFrame(docType) { function isPdf(docType) {
if (isBlank(docType)) { if (isBlank(docType)) {
return false; return false;
} }
...@@ -279,11 +280,13 @@ function isFrame(docType) { ...@@ -279,11 +280,13 @@ function isFrame(docType) {
/** /**
* frame预览 * frame预览
* *
* @param docId * @param url
*/ */
function previewFrame(docId) { function previewFrame(url) {
// 替换地址中的file-download为file-preview
url = url.replace("file-download", "file-preview");
$("#previewFrame").css('display', ''); $("#previewFrame").css('display', '');
$("#previewFrame").attr("src", downloadHref(docId, true)); $("#previewFrame").attr("src", url);
} }
/** /**
...@@ -363,6 +366,17 @@ let bigImage = null; ...@@ -363,6 +366,17 @@ let bigImage = null;
window.onload = function () { window.onload = function () {
// 监听iframe // 监听iframe
// iframeLoad(); // iframeLoad();
// 禁用鼠标右键
document.addEventListener('contextmenu', event => event.preventDefault());
document.addEventListener('copy', event => event.preventDefault());
// 图片预览初始化
// imageShowInit();
};
/**
* 图片预览初始化
*/
function imageShowInit(){
imageOuterDiv = document.querySelector("#imageOuterDiv"); imageOuterDiv = document.querySelector("#imageOuterDiv");
realImage = document.querySelector("#image"); realImage = document.querySelector("#image");
bigImage = document.querySelector("#bigImage"); bigImage = document.querySelector("#bigImage");
...@@ -383,7 +397,7 @@ window.onload = function () { ...@@ -383,7 +397,7 @@ window.onload = function () {
// 拖转事件调用 // 拖转事件调用
imgDrag(); imgDrag();
}); });
}; }
/** /**
* 点击图片放大 * 点击图片放大
......
...@@ -671,10 +671,6 @@ function loadChange(grid,e,field) { ...@@ -671,10 +671,6 @@ function loadChange(grid,e,field) {
* @param url 文件URL * @param url 文件URL
*/ */
let previewFile = function (url) { let previewFile = function (url) {
// let hostname = window.location.hostname;
// let domain = hostname === "localhost" ? "http://129.211.46.84:8085" : window.location.origin;
// let url = domain + IPLATUI.CONTEXT_PATH + '/file/download/preview/' + docId
// + "?fullfilename=";
// Base64转码 // Base64转码
let urlEncode; let urlEncode;
try { try {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment