* tif图片预览,根据反馈的意见,已经全部修改
parent
d424de5e9a
commit
91f3348a2f
|
@ -14,7 +14,7 @@ public class FileAttribute {
|
||||||
private String url;
|
private String url;
|
||||||
private String fileKey;
|
private String fileKey;
|
||||||
private String officePreviewType = ConfigConstants.getOfficePreviewType();
|
private String officePreviewType = ConfigConstants.getOfficePreviewType();
|
||||||
private String previewType;
|
private String tifPreviewType;
|
||||||
|
|
||||||
public FileAttribute() {
|
public FileAttribute() {
|
||||||
}
|
}
|
||||||
|
@ -34,13 +34,13 @@ public class FileAttribute {
|
||||||
this.officePreviewType = officePreviewType;
|
this.officePreviewType = officePreviewType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public FileAttribute(FileType type, String suffix, String name, String url, String officePreviewType, String previewType) {
|
public FileAttribute(FileType type, String suffix, String name, String url, String officePreviewType, String tifPreviewType) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.suffix = suffix;
|
this.suffix = suffix;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.url = url;
|
this.url = url;
|
||||||
this.officePreviewType = officePreviewType;
|
this.officePreviewType = officePreviewType;
|
||||||
this.previewType = previewType;
|
this.tifPreviewType = tifPreviewType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFileKey() {
|
public String getFileKey() {
|
||||||
|
@ -91,12 +91,12 @@ public class FileAttribute {
|
||||||
this.url = url;
|
this.url = url;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPreviewType() {
|
public String getTifPreviewType() {
|
||||||
return previewType;
|
return tifPreviewType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPreviewType(String previewType) {
|
public void setTifPreviewType(String previewType) {
|
||||||
this.previewType = previewType;
|
this.tifPreviewType = previewType;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -285,9 +285,9 @@ public class FileHandlerService {
|
||||||
attribute.setFileKey(fileKey);
|
attribute.setFileKey(fileKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
String previewType = req.getParameter("previewType");
|
String tifPreviewType = req.getParameter("tifPreviewType");
|
||||||
if (StringUtils.hasText(previewType)) {
|
if (StringUtils.hasText(tifPreviewType)) {
|
||||||
attribute.setPreviewType(previewType);
|
attribute.setTifPreviewType(tifPreviewType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return attribute;
|
return attribute;
|
||||||
|
|
|
@ -40,9 +40,9 @@ public class TiffFilePreviewImpl implements FilePreview {
|
||||||
@Override
|
@Override
|
||||||
public String filePreviewHandle(String url, Model model, FileAttribute fileAttribute) {
|
public String filePreviewHandle(String url, Model model, FileAttribute fileAttribute) {
|
||||||
String tifPreviewType = ConfigConstants.getTifPreviewType();
|
String tifPreviewType = ConfigConstants.getTifPreviewType();
|
||||||
String previewType = fileAttribute.getPreviewType();
|
String tifOnLinePreviewType = fileAttribute.getTifPreviewType();
|
||||||
if (StringUtils.hasText(previewType)) {
|
if (StringUtils.hasText(tifOnLinePreviewType)) {
|
||||||
tifPreviewType = previewType;
|
tifPreviewType = tifOnLinePreviewType;
|
||||||
}
|
}
|
||||||
|
|
||||||
if("tif".equalsIgnoreCase(tifPreviewType)){
|
if("tif".equalsIgnoreCase(tifPreviewType)){
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function goForImage() {
|
function goForImage() {
|
||||||
var url = window.location.href + "&previewType=jpg"
|
var url = window.location.href + "&tifPreviewType=jpg"
|
||||||
if (url.indexOf("officePreviewType=pdf") != -1) {
|
if (url.indexOf("officePreviewType=pdf") != -1) {
|
||||||
url = url.replace("officePreviewType=pdf", "officePreviewType=image");
|
url = url.replace("officePreviewType=pdf", "officePreviewType=image");
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue