Commit 4ff1d261 by zhongmh

'修改样式'

parents a5e5d64a 757258cf
......@@ -2,6 +2,7 @@ package cn.yunmaozj.controller;
import cn.yunmaozj.common.SystemFile;
import cn.yunmaozj.security.Developer;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -16,6 +17,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
......@@ -63,17 +65,30 @@ public class IndexController {
html.append("<tr>");
//项目名字
html.append("<td>").append("<button type=\"button\" class=\"btn btn-link\" url='/").append(file.getName()).append("/index.html'>").append(file.getName()).append("</button>").append("</td>");
//项目时间
html.append("<tr>");
//项目时间
html.append("<td>").append(DateFormatUtils.format(file.lastModified(), "yyyy-MM-dd HH:mm:ss")).append("</td>");
//是有有删除标记
if (isRole) {
html.append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\'")
.append("/del/").append(file.getName()).append("'>").append("delete").append("</a>");
html.append("<td>").append("<button type=\"button\" class=\"btn btn-danger\" url='/del/").append(file.getName()).append("'>删除</button>").append("</td>");
}
html.append("</li>");
html.append("<tr>");
}
}
html.append("</ul>");
html.append("</tbody>");
html.append("</table>");
html.append("</body>");
html.append("<script type=\"text/javascript\" src=\"/jquery-3.4.1.min.js\" ></script>");
html.append("<script>");
html.append("$(\".btn-danger\").click(function(){\n" +
"\t\t\tvar url = $(this).attr(\"url\");\n" +
"\t\t\twindow.location=url;\n" +
"\t\t})\n" +
"\t\t$(\".btn-link\").click(function(){\n" +
"\t\t\tvar url = $(this).attr(\"url\");\n" +
"\t\t\twindow.location=url;\n" +
"\t\t})");
html.append("</script>");
html.append("</html>");
return html.toString();
}
......
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 sign in to comment