首页新增 搜索 定位页码 定义显示多少内容

pull/219/head
gaoxiongzaq 2023-08-22 10:16:02 +08:00
parent 779c7c77b7
commit 6f53b41baf
5 changed files with 140 additions and 60 deletions

View File

@ -158,8 +158,14 @@ delete.captcha= ${KK_DELETE_CAPTCHA:false}
delete.password = ${KK_DELETE_PASSWORD:123456} delete.password = ${KK_DELETE_PASSWORD:123456}
# OFFICECADTIFF # OFFICECADTIFF
delete.source.file = ${KK_DELETE_SOURCE_FILE:true} delete.source.file = ${KK_DELETE_SOURCE_FILE:true}
#
home.pagenumber = ${DEFAULT_HOME_PAGENUMBER:1}
#
home.pagination = ${DEFAULT_HOME_PAGINATION:true}
#
home.pagesize = ${DEFAULT_HOME_PAGSIZE:15}
#
home.search = ${DEFAULT_HOME_SEARCH:true}
#Tif #Tif
#Tiftifjsjpgjpgpdfpdf便 #Tiftifjsjpgjpgpdfpdf便

View File

@ -61,6 +61,10 @@ public class ConfigConstants {
private static Boolean officeDocumentOpenPasswords; private static Boolean officeDocumentOpenPasswords;
private static String cadTimeout; private static String cadTimeout;
private static int cadThread; private static int cadThread;
private static String homePpageNumber;
private static String homePagination;
private static String homePageSize;
private static String homeSearch;
public static final String DEFAULT_CACHE_ENABLED = "true"; public static final String DEFAULT_CACHE_ENABLED = "true";
public static final String DEFAULT_TXT_TYPE = "txt,html,htm,asp,jsp,xml,json,properties,md,gitignore,log,java,py,c,cpp,sql,sh,bat,m,bas,prg,cmd,xbrl"; public static final String DEFAULT_TXT_TYPE = "txt,html,htm,asp,jsp,xml,json,properties,md,gitignore,log,java,py,c,cpp,sql,sh,bat,m,bas,prg,cmd,xbrl";
@ -91,11 +95,8 @@ public class ConfigConstants {
public static final String DEFAULT_OFFICE_TYPE_WEB = "web"; public static final String DEFAULT_OFFICE_TYPE_WEB = "web";
public static final String DEFAULT_DELETE_SOURCE_FILE = "true"; public static final String DEFAULT_DELETE_SOURCE_FILE = "true";
public static final String DEFAULT_DELETE_CAPTCHA = "false"; public static final String DEFAULT_DELETE_CAPTCHA = "false";
public static final String DEFAULT_CAD_TIMEOUT = "90"; public static final String DEFAULT_CAD_TIMEOUT = "90";
public static final String DEFAULT_CAD_THREAD = "5"; public static final String DEFAULT_CAD_THREAD = "5";
public static final String DEFAULT_OFFICE_PAQERANQE = "false"; public static final String DEFAULT_OFFICE_PAQERANQE = "false";
public static final String DEFAULT_OFFICE_WATERMARK = "false"; public static final String DEFAULT_OFFICE_WATERMARK = "false";
public static final String DEFAULT_OFFICE_QUALITY = "80"; public static final String DEFAULT_OFFICE_QUALITY = "80";
@ -103,7 +104,10 @@ public class ConfigConstants {
public static final String DEFAULT_OFFICE_EXPORTBOOKMARKS = "true"; public static final String DEFAULT_OFFICE_EXPORTBOOKMARKS = "true";
public static final String DEFAULT_OFFICE_EXPORTNOTES = "true"; public static final String DEFAULT_OFFICE_EXPORTNOTES = "true";
public static final String DEFAULT_OFFICE_EOCUMENTOPENPASSWORDS = "true"; public static final String DEFAULT_OFFICE_EOCUMENTOPENPASSWORDS = "true";
public static final String DEFAULT_HOME_PAGENUMBER = "1";
public static final String DEFAULT_HOME_PAGINATION = "true";
public static final String DEFAULT_HOME_PAGSIZE = "15";
public static final String DEFAULT_HOME_SEARCH = "true";
public static Boolean isCacheEnabled() { public static Boolean isCacheEnabled() {
return cacheEnabled; return cacheEnabled;
} }
@ -407,16 +411,6 @@ public class ConfigConstants {
ConfigConstants.tifPreviewType = tifPreviewType; ConfigConstants.tifPreviewType = tifPreviewType;
} }
public static String getBeian() {
return beian;
}
@Value("${beian:default}")
public void setBeian(String beian) {
setBeianValue(beian);
}
public static void setBeianValue(String beian) {
ConfigConstants.beian = beian;
}
public static String[] getProhibit() { public static String[] getProhibit() {
return prohibit; return prohibit;
} }
@ -627,4 +621,64 @@ public class ConfigConstants {
ConfigConstants.officeDocumentOpenPasswords = officeDocumentOpenPasswords; ConfigConstants.officeDocumentOpenPasswords = officeDocumentOpenPasswords;
} }
/**
*
*/
public static String getBeian() {
return beian;
}
@Value("${beian:default}")
public void setBeian(String beian) {
setBeianValue(beian);
}
public static void setBeianValue(String beian) {
ConfigConstants.beian = beian;
}
public static String gethomePpageNumber() {
return homePpageNumber;
}
@Value("${home.pagenumber:1}")
public void sethomePpageNumber(String homePpageNumber) {
sethomePpageNumberValue(homePpageNumber);
}
public static void sethomePpageNumberValue(String homePpageNumber) {
ConfigConstants.homePpageNumber = homePpageNumber;
}
public static String gethomePagination() {
return homePagination;
}
@Value("${home.pagination:true}")
public void sethomePagination(String homePagination) {
sethomePaginationValue(homePagination);
}
public static void sethomePaginationValue(String homePagination) {
ConfigConstants.homePagination = homePagination;
}
public static String gethomePageSize() {
return homePageSize;
}
@Value("${home.pagesize:15}")
public void sethomePagesize(String homePageSize) {
sethomePageSizeValue(homePageSize);
}
public static void sethomePageSizeValue(String homePageSize) {
ConfigConstants.homePageSize = homePageSize;
}
public static String gethomeSearch() {
return homeSearch;
}
@Value("${home.search:1}")
public void sethomeSearch(String homeSearch) {
sethomeSearchValue(homeSearch);
}
public static void sethomeSearchValue(String homeSearch) {
ConfigConstants.homeSearch = homeSearch;
}
} }

View File

@ -73,6 +73,10 @@ public class ConfigRefreshComponent {
boolean officeDocumentOpenPasswords; boolean officeDocumentOpenPasswords;
String cadTimeout; String cadTimeout;
int cadThread; int cadThread;
String homePpageNumber;
String homePagination;
String homePageSize;
String homeSearch;
while (true) { while (true) {
FileReader fileReader = new FileReader(configFilePath); FileReader fileReader = new FileReader(configFilePath);
BufferedReader bufferedReader = new BufferedReader(fileReader); BufferedReader bufferedReader = new BufferedReader(fileReader);
@ -115,6 +119,10 @@ public class ConfigRefreshComponent {
officeExportNotes = Boolean.parseBoolean(properties.getProperty("office.exportnotes", ConfigConstants.DEFAULT_OFFICE_EXPORTNOTES)); officeExportNotes = Boolean.parseBoolean(properties.getProperty("office.exportnotes", ConfigConstants.DEFAULT_OFFICE_EXPORTNOTES));
officeDocumentOpenPasswords = Boolean.parseBoolean(properties.getProperty("office.documentopenpasswords", ConfigConstants.DEFAULT_OFFICE_EOCUMENTOPENPASSWORDS)); officeDocumentOpenPasswords = Boolean.parseBoolean(properties.getProperty("office.documentopenpasswords", ConfigConstants.DEFAULT_OFFICE_EOCUMENTOPENPASSWORDS));
cadTimeout = properties.getProperty("cad.timeout", ConfigConstants.DEFAULT_CAD_TIMEOUT); cadTimeout = properties.getProperty("cad.timeout", ConfigConstants.DEFAULT_CAD_TIMEOUT);
homePpageNumber = properties.getProperty("home.pagenumber", ConfigConstants.DEFAULT_HOME_PAGENUMBER);
homePagination = properties.getProperty("home.pagination", ConfigConstants.DEFAULT_HOME_PAGINATION);
homePageSize = properties.getProperty("home.pagesize", ConfigConstants.DEFAULT_HOME_PAGSIZE);
homeSearch = properties.getProperty("home.search", ConfigConstants.DEFAULT_HOME_SEARCH);
cadThread = Integer.parseInt(properties.getProperty("cad.thread", ConfigConstants.DEFAULT_CAD_THREAD)); cadThread = Integer.parseInt(properties.getProperty("cad.thread", ConfigConstants.DEFAULT_CAD_THREAD));
prohibitArray = prohibit.split(","); prohibitArray = prohibit.split(",");
@ -154,6 +162,10 @@ public class ConfigRefreshComponent {
ConfigConstants.setDeleteCaptchaValue(deleteCaptcha); ConfigConstants.setDeleteCaptchaValue(deleteCaptcha);
ConfigConstants.setCadTimeoutValue(cadTimeout); ConfigConstants.setCadTimeoutValue(cadTimeout);
ConfigConstants.setCadThreadValue(cadThread); ConfigConstants.setCadThreadValue(cadThread);
ConfigConstants.sethomePpageNumberValue(homePpageNumber);
ConfigConstants.sethomePaginationValue(homePagination);
ConfigConstants.sethomePageSizeValue(homePageSize);
ConfigConstants.sethomeSearchValue(homeSearch);
setWatermarkConfig(properties); setWatermarkConfig(properties);
bufferedReader.close(); bufferedReader.close();
fileReader.close(); fileReader.close();

View File

@ -44,6 +44,10 @@ public class AttributeSetFilter implements Filter {
request.setAttribute("beian", ConfigConstants.getBeian()); request.setAttribute("beian", ConfigConstants.getBeian());
request.setAttribute("size", ConfigConstants.maxSize()); request.setAttribute("size", ConfigConstants.maxSize());
request.setAttribute("deleteCaptcha", ConfigConstants.getDeleteCaptcha()); request.setAttribute("deleteCaptcha", ConfigConstants.getDeleteCaptcha());
request.setAttribute("homePpageNumber", ConfigConstants.gethomePpageNumber());
request.setAttribute("homePagination", ConfigConstants.gethomePagination());
request.setAttribute("homePageSize", ConfigConstants.gethomePageSize());
request.setAttribute("homeSearch", ConfigConstants.gethomeSearch());
} }
/** /**

View File

@ -21,40 +21,44 @@
.alert { .alert {
width: 50%; width: 50%;
} }
</style> #size{
<#-- CSS --> float:left;
<#if deleteCaptcha >
<style>
.code{
position: fixed;
width: 300px;
height: 200px;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
background-color: #F0FFF0;
text-align: center;
padding: 20px;
z-index: 100002;
}
.close{
margin-top: 20px;
}
.code-input{
border: 1px solid #ccc;
border-radius: 3px;
width: 110px;
height: 40px;
}
.code-input:focus{
border-color: #66afe9;
outline: 0;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)
}
}
</style> </style>
</#if> <#-- CSS -->
<#if deleteCaptcha >
<style>
.code{
position: fixed;
width: 300px;
height: 200px;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
background-color: #F0FFF0;
text-align: center;
padding: 20px;
z-index: 100002;
}
.close{
margin-top: 20px;
}
.code-input{
border: 1px solid #ccc;
border-radius: 3px;
width: 110px;
height: 40px;
}
.code-input:focus{
border-color: #66afe9;
outline: 0;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)
}
</style>
</#if>
</head> </head>
<body> <body>
@ -155,16 +159,11 @@
</div> </div>
<div class="panel-body"> <div class="panel-body">
<#if fileUploadDisable == false> <#if fileUploadDisable == false>
<div style="padding: 10px" > <form enctype="multipart/form-data" id="fileUpload">
<form enctype="multipart/form-data" id="fileUpload"> <input type="file" id="size" name="file"/> <input class="btn btn-success" type="button" id="btnSubmit" value=" 上 传 "/>
<input type="file" id="size" name="file"/> </form>
<input type="button" id="btnSubmit" value=" 上 传 "/>
</form>
</div>
</#if> </#if>
<div> <table id="table" data-pagination="true"></table>
<table id="table" data-pagination="true"></table>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -201,7 +200,7 @@
<script> <script>
<#if deleteCaptcha > <#if deleteCaptcha >
function deleteFile(fileName) { function deleteFile(fileName) {
var codename =`<div class="code"><h4>!</h4><div><img id="verImg" width="130px" height="48px" src="/deleteFile/captcha"></div><form><input type="type" oninput="if(value.length>5)value=value.slice(0,5);" class="code-input" id="_code" placeholder="请输入验证码"><button id="deleteFile1" type="button" class="btn btn-success"></button></form><button id="close" type="button"class="btn btn-danger"></button></div>`; var codename =`<div class="code"><h4>!</h4><div><img id="verImg" width="130px" height="48px" src="/deleteFile/captcha"></div><form><input type="type" oninput="if(value.length>5)value=value.slice(0,5);" class="code-input" id="_code" placeholder="请输入验证码"><button id="deleteFile1" type="button" class="btn btn-success"></button></form><button id="close" type="button" class="btn btn-danger"></button></div>`;
$('#codeContent').html(codename); $('#codeContent').html(codename);
var code = document.querySelector('.code'); var code = document.querySelector('.code');
var closeBtn = document.getElementById("close"); var closeBtn = document.getElementById("close");
@ -214,7 +213,7 @@
function deleteFile1(){ function deleteFile1(){
var password = $("#_code").val(); var password = $("#_code").val();
$.ajax({ $.ajax({
url: '${baseUrl}deleteFile?fileName=' + fileName +'&password='+password, url: '${baseUrl}deleteFile?fileName=' + fileName +'&password='+password,
success: function (data) { success: function (data) {
if ("删除文件失败,密码错误!" === data.msg) { if ("删除文件失败,密码错误!" === data.msg) {
alert(data.msg); alert(data.msg);
@ -324,6 +323,11 @@
$(function () { $(function () {
$('#table').bootstrapTable({ $('#table').bootstrapTable({
url: 'listFiles', url: 'listFiles',
pageNumber: ${homePpageNumber},//初始化加载第一页
pageSize:${homePageSize}, //初始化单页记录数
pagination: ${homePagination}, //是否分页
pageList: [5, 10, 20, 30, 50, 100, 200, 500],
search: ${homeSearch}, //显示查询框
columns: [{ columns: [{
field: 'fileName', field: 'fileName',
title: '' title: ''
@ -335,7 +339,7 @@
// 每个data添加一列用来操作 // 每个data添加一列用来操作
$(data).each(function (index, item) { $(data).each(function (index, item) {
item.action = "<a class='btn btn-success' target='_blank' href='${baseUrl}onlinePreview?url=" + encodeURIComponent(Base64.encode('${baseUrl}' + item.fileName)) + "'>预览</a>" + item.action = "<a class='btn btn-success' target='_blank' href='${baseUrl}onlinePreview?url=" + encodeURIComponent(Base64.encode('${baseUrl}' + item.fileName)) + "'>预览</a>" +
"<a class='btn btn-danger' style='margin-left:10px;' href='javascript:void(0);' onclick='deleteFile(\"" + encodeURIComponent(Base64.encode('${baseUrl}' + item.fileName)) + "\")'>删除</a>"; "<a class='btn btn-danger' style='margin-left:10px;' href='javascript:void(0);' onclick='deleteFile(\"" + encodeURIComponent(Base64.encode('${baseUrl}' + item.fileName)) + "\")'>删除</a>";
}); });
return data; return data;
}).on('post-body.bs.table', function (e, data) { }).on('post-body.bs.table', function (e, data) {