Compare commits
22 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1ee1722be5 | ||
|
|
ffad5e5e18 | ||
|
|
768d8a1c47 | ||
|
|
45fde1ef66 | ||
|
|
414bad08d5 | ||
|
|
09ff1c68b0 | ||
|
|
6529dd10b2 | ||
|
|
9ce3eb94fa | ||
|
|
83de9b91c0 | ||
|
|
3f2f00b6f6 | ||
|
|
6beec711b6 | ||
|
|
0352fff7e6 | ||
|
|
9dc99927b3 | ||
|
|
d7d5ef01ed | ||
|
|
53abddef44 | ||
|
|
fe17f43f3a | ||
|
|
4090a655e9 | ||
|
|
a660a8e912 | ||
|
|
22e1a6d7ea | ||
|
|
2abe3348fb | ||
|
|
8d7c499321 | ||
|
|
7ad0379066 |
@@ -43,6 +43,8 @@ JeeSite 是一个低代码开发平台,具有较高的封装度、扩展性,
|
||||
|
||||
大家都在用 Spring,也在学习 Spring 的优点,Spring 提供了较好的扩展性,可又有多少人去修改它的源代码呢,退一步说,大家去修改了 Spring 的源码,反而会对未来升级造成很大困扰,您说不是呢?这样的例子很多,所以不要纠结,我们非常注重这一点,JeeSite 也一样具备强大的扩展性。
|
||||
|
||||
为什么说 JeeSite 比较易于学习?JeeSite 很好的把握了设计的 “度”,避免过度设计的情况。过度设计是在产品设计过程中忽略了产品和用户的实际需求,反而带来了不必要的复杂性,而忽略了系统的学习、开发和维护成本。
|
||||
|
||||
* 至今 JeeSite 平台架构已经非常稳定。
|
||||
* JeeSite 精益求精,用心打磨每一个细节。
|
||||
* JeeSite 是一个专业的平台,是一个让你使用放心的平台。
|
||||
@@ -72,11 +74,12 @@ JeeSite 是一个低代码开发平台,具有较高的封装度、扩展性,
|
||||
|
||||
## 生态系统
|
||||
|
||||
* 分布式微服务系统(Spring Cloud):<https://gitee.com/thinkgem/jeesite4-cloud>
|
||||
* 分布式微服务(Spring Cloud):<https://gitee.com/thinkgem/jeesite4-cloud>
|
||||
* Flowable业务流程引擎(BPM):<http://jeesite.com/docs/bpm/>
|
||||
* JFlow工作流引擎:<https://gitee.com/thinkgem/jeesite4-jflow> :<http://ccflow.org>
|
||||
* Flowable业务流程模块(BPM):<http://jeesite.com/docs/bpm/>
|
||||
* 内容管理模块(CMS):<https://gitee.com/thinkgem/jeesite4-cms>
|
||||
* 内容管理模块(CMS):<https://gitee.com/thinkgem/jeesite4/tree/v5.3/modules/cms>
|
||||
* 手机端移动端:<https://gitee.com/thinkgem/jeesite4-uniapp>
|
||||
* PC客户端程序:<https://gitee.com/thinkgem/jeesite-client>
|
||||
* Vue3分离版本:<https://gitee.com/thinkgem/jeesite-vue>
|
||||
|
||||
## 快速体验
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent</artifactId>
|
||||
<version>4.6.1-SNAPSHOT</version>
|
||||
<version>4.7.0-SNAPSHOT</version>
|
||||
<relativePath>../parent/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -194,11 +194,6 @@
|
||||
<artifactId>poi-ooxml</artifactId>
|
||||
<version>${poi.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml-schemas</artifactId>
|
||||
<version>${poi.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-scratchpad</artifactId>
|
||||
|
||||
@@ -4,11 +4,8 @@
|
||||
*/
|
||||
package com.jeesite.common.io;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
import com.alibaba.fastjson.parser.ParserConfig;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
import org.springframework.boot.env.OriginTrackedMapPropertySource;
|
||||
import org.springframework.boot.env.PropertiesPropertySourceLoader;
|
||||
import org.springframework.boot.env.YamlPropertySourceLoader;
|
||||
@@ -16,8 +13,10 @@ import org.springframework.core.Ordered;
|
||||
import org.springframework.core.env.PropertySource;
|
||||
import org.springframework.core.io.Resource;
|
||||
|
||||
import com.alibaba.fastjson.parser.ParserConfig;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* 配置文件加载(Boot)
|
||||
@@ -40,7 +39,11 @@ public class PropertyLoader implements org.springframework.boot.env.PropertySour
|
||||
List<PropertySource<?>> propertySources = new ArrayList<>();
|
||||
if (!isLoadJeeSitePropertySource) {
|
||||
isLoadJeeSitePropertySource = true;
|
||||
ParserConfig.getGlobalInstance().setSafeMode(true); // 开启 FastJSON 安全模式
|
||||
try {
|
||||
ParserConfig.getGlobalInstance().setSafeMode(true); // 开启 FastJSON 安全模式
|
||||
} catch (Exception ignored) {
|
||||
// 兼容 fastjson2 的调用,不返回异常
|
||||
}
|
||||
Properties properties = PropertiesUtils.getInstance().getProperties();
|
||||
propertySources.add(new OriginTrackedMapPropertySource("jeesite", properties));
|
||||
} else {
|
||||
|
||||
@@ -1,235 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
* No deletion without permission, or be held responsible to law.
|
||||
*/
|
||||
package com.jeesite.common.utils.excel;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.poi.hssf.usermodel.HSSFDateUtil;
|
||||
import org.apache.poi.openxml4j.opc.OPCPackage;
|
||||
import org.apache.poi.xssf.eventusermodel.XSSFReader;
|
||||
import org.apache.poi.xssf.model.SharedStringsTable;
|
||||
import org.apache.poi.xssf.usermodel.XSSFRichTextString;
|
||||
import org.xml.sax.Attributes;
|
||||
import org.xml.sax.InputSource;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.XMLReader;
|
||||
import org.xml.sax.helpers.DefaultHandler;
|
||||
import org.xml.sax.helpers.XMLReaderFactory;
|
||||
|
||||
/**
|
||||
* Excel超大数据读取,抽象Excel2007读取器,excel2007的底层数据结构是xml文件,采用SAX的事件驱动的方法解析
|
||||
* xml,需要继承DefaultHandler,在遇到文件内容时,事件会触发,这种做法可以大大降低 内存的耗费,特别使用于大数据量的文件。
|
||||
* @version 2014-9-2
|
||||
*/
|
||||
public abstract class ExcelReader extends DefaultHandler {
|
||||
|
||||
// 共享字符串表
|
||||
private SharedStringsTable sst;
|
||||
|
||||
// 上一次的内容
|
||||
private String lastContents;
|
||||
private boolean nextIsString;
|
||||
|
||||
private int sheetIndex = -1;
|
||||
private List<String> rowList = new ArrayList<String>();
|
||||
|
||||
// 当前行
|
||||
private int curRow = 0;
|
||||
// 当前列
|
||||
private int curCol = 0;
|
||||
// 日期标志
|
||||
private boolean dateFlag;
|
||||
// 数字标志
|
||||
private boolean numberFlag;
|
||||
|
||||
private boolean isTElement;
|
||||
|
||||
/**
|
||||
* 遍历工作簿中所有的电子表格
|
||||
* @param filename
|
||||
* @throws Exception
|
||||
*/
|
||||
public void process(String filename) throws Exception {
|
||||
OPCPackage pkg = OPCPackage.open(filename);
|
||||
XSSFReader r = new XSSFReader(pkg);
|
||||
SharedStringsTable sst = r.getSharedStringsTable();
|
||||
XMLReader parser = fetchSheetParser(sst);
|
||||
Iterator<InputStream> sheets = r.getSheetsData();
|
||||
while (sheets.hasNext()) {
|
||||
curRow = 0;
|
||||
sheetIndex++;
|
||||
InputStream sheet = sheets.next();
|
||||
InputSource sheetSource = new InputSource(sheet);
|
||||
parser.parse(sheetSource);
|
||||
sheet.close();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 只遍历一个电子表格,其中sheetId为要遍历的sheet索引,从1开始,1-3
|
||||
* @param filename
|
||||
* @param sheetId
|
||||
* @throws Exception
|
||||
*/
|
||||
public void process(String filename, int sheetId) throws Exception {
|
||||
OPCPackage pkg = OPCPackage.open(filename);
|
||||
XSSFReader r = new XSSFReader(pkg);
|
||||
SharedStringsTable sst = r.getSharedStringsTable();
|
||||
XMLReader parser = fetchSheetParser(sst);
|
||||
// 根据 rId# 或 rSheet# 查找sheet
|
||||
InputStream sheet2 = r.getSheet("rId" + sheetId);
|
||||
sheetIndex++;
|
||||
InputSource sheetSource = new InputSource(sheet2);
|
||||
parser.parse(sheetSource);
|
||||
sheet2.close();
|
||||
}
|
||||
|
||||
public XMLReader fetchSheetParser(SharedStringsTable sst)
|
||||
throws SAXException {
|
||||
XMLReader parser = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
|
||||
this.sst = sst;
|
||||
parser.setContentHandler(this);
|
||||
return parser;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startElement(String uri, String localName, String name,
|
||||
Attributes attributes) throws SAXException {
|
||||
|
||||
// System.out.println("startElement: " + localName + ", " + name + ", " + attributes);
|
||||
|
||||
// c => 单元格
|
||||
if ("c".equals(name)) {
|
||||
// 如果下一个元素是 SST 的索引,则将nextIsString标记为true
|
||||
String cellType = attributes.getValue("t");
|
||||
if ("s".equals(cellType)) {
|
||||
nextIsString = true;
|
||||
} else {
|
||||
nextIsString = false;
|
||||
}
|
||||
// 日期格式
|
||||
String cellDateType = attributes.getValue("s");
|
||||
if ("1".equals(cellDateType)) {
|
||||
dateFlag = true;
|
||||
} else {
|
||||
dateFlag = false;
|
||||
}
|
||||
String cellNumberType = attributes.getValue("s");
|
||||
if ("2".equals(cellNumberType)) {
|
||||
numberFlag = true;
|
||||
} else {
|
||||
numberFlag = false;
|
||||
}
|
||||
|
||||
}
|
||||
// 当元素为t时
|
||||
if ("t".equals(name)) {
|
||||
isTElement = true;
|
||||
} else {
|
||||
isTElement = false;
|
||||
}
|
||||
|
||||
// 置空
|
||||
lastContents = "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endElement(String uri, String localName, String name)
|
||||
throws SAXException {
|
||||
|
||||
// System.out.println("endElement: " + localName + ", " + name);
|
||||
|
||||
// 根据SST的索引值的到单元格的真正要存储的字符串
|
||||
// 这时characters()方法可能会被调用多次
|
||||
if (nextIsString) {
|
||||
try {
|
||||
int idx = Integer.parseInt(lastContents);
|
||||
lastContents = new XSSFRichTextString(sst.getEntryAt(idx))
|
||||
.toString();
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
}
|
||||
// t元素也包含字符串
|
||||
if (isTElement) {
|
||||
String value = lastContents.trim();
|
||||
rowList.add(curCol, value);
|
||||
curCol++;
|
||||
isTElement = false;
|
||||
// v => 单元格的值,如果单元格是字符串则v标签的值为该字符串在SST中的索引
|
||||
// 将单元格内容加入rowlist中,在这之前先去掉字符串前后的空白符
|
||||
} else if ("v".equals(name)) {
|
||||
String value = lastContents.trim();
|
||||
value = "".equals(value) ? " " : value;
|
||||
try {
|
||||
// 日期格式处理
|
||||
if (dateFlag) {
|
||||
Date date = HSSFDateUtil.getJavaDate(Double.valueOf(value));
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
|
||||
value = dateFormat.format(date);
|
||||
}
|
||||
// 数字类型处理
|
||||
if (numberFlag) {
|
||||
BigDecimal bd = new BigDecimal(value);
|
||||
value = bd.setScale(3, BigDecimal.ROUND_UP).toString();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// 转换失败仍用读出来的值
|
||||
}
|
||||
rowList.add(curCol, value);
|
||||
curCol++;
|
||||
} else {
|
||||
// 如果标签名称为 row ,这说明已到行尾,调用 optRows() 方法
|
||||
if ("row".equals(name)) {
|
||||
getRows(sheetIndex + 1, curRow, rowList);
|
||||
rowList.clear();
|
||||
curRow++;
|
||||
curCol = 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void characters(char[] ch, int start, int length)
|
||||
throws SAXException {
|
||||
// 得到单元格内容的值
|
||||
lastContents += new String(ch, start, length);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取行数据回调
|
||||
* @param sheetIndex
|
||||
* @param curRow
|
||||
* @param rowList
|
||||
*/
|
||||
public abstract void getRows(int sheetIndex, int curRow, List<String> rowList);
|
||||
|
||||
// /**
|
||||
// * 测试方法
|
||||
// */
|
||||
// public static void main(String[] args) throws Exception {
|
||||
//
|
||||
// String file = "E:/销售数据导入.xlsx";
|
||||
//
|
||||
// ExcelReader reader = new ExcelReader() {
|
||||
// @Override
|
||||
// public void getRows(int sheetIndex, int curRow, List<String> rowList) {
|
||||
//
|
||||
// System.out.println("Sheet:" + sheetIndex + ", Row:" + curRow + ", Data:" +rowList);
|
||||
//
|
||||
// }
|
||||
// };
|
||||
// reader.process(file, 1);
|
||||
//
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -1,343 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
* No deletion without permission, or be held responsible to law.
|
||||
*/
|
||||
package com.jeesite.common.utils.excel;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Writer;
|
||||
import java.util.Calendar;
|
||||
import java.util.Enumeration;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipFile;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
import org.apache.poi.hssf.util.CellReference;
|
||||
import org.apache.poi.ss.usermodel.DateUtil;
|
||||
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
|
||||
/**
|
||||
* Excel超大数据写入,抽象excel2007读入器,先构建.xlsx一张模板,改写模板中的sheet.xml,
|
||||
* 使用这种方法 写入.xlsx文件,不需要太大的内存
|
||||
* @version 2014-9-2
|
||||
*/
|
||||
public abstract class ExcelWriter {
|
||||
|
||||
private SpreadsheetWriter sw;
|
||||
|
||||
/**
|
||||
* 写入电子表格的主要流程
|
||||
*
|
||||
* @param fileName
|
||||
* @throws Exception
|
||||
*/
|
||||
@SuppressWarnings("resource")
|
||||
public void process(String fileName) throws Exception {
|
||||
|
||||
// 建立工作簿和电子表格对象
|
||||
XSSFWorkbook wb = new XSSFWorkbook();
|
||||
XSSFSheet sheet = wb.createSheet("sheet1");
|
||||
|
||||
// 持有电子表格数据的xml文件名 例如 /xl/worksheets/sheet1.xml
|
||||
String sheetRef = sheet.getPackagePart().getPartName().getName();
|
||||
|
||||
// 保存模板
|
||||
FileOutputStream os = new FileOutputStream("template.xlsx");
|
||||
wb.write(os);
|
||||
os.close();
|
||||
|
||||
// 生成xml文件
|
||||
File tmp = File.createTempFile("sheet", ".xml");
|
||||
Writer fw = new FileWriter(tmp);
|
||||
sw = new SpreadsheetWriter(fw);
|
||||
generate();
|
||||
fw.close();
|
||||
|
||||
// 使用产生的数据替换模板
|
||||
File templateFile = new File("template.xlsx");
|
||||
FileOutputStream out = new FileOutputStream(fileName);
|
||||
substitute(templateFile, tmp, sheetRef.substring(1), out);
|
||||
out.close();
|
||||
// 删除文件之前调用一下垃圾回收器,否则无法删除模板文件
|
||||
System.gc();
|
||||
// 删除临时模板文件
|
||||
if (templateFile.isFile() && templateFile.exists()) {
|
||||
templateFile.delete();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 类使用者应该使用此方法进行写操作
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public abstract void generate() throws Exception;
|
||||
|
||||
public void beginSheet() throws IOException {
|
||||
sw.beginSheet();
|
||||
}
|
||||
|
||||
public void insertRow(int rowNum) throws IOException {
|
||||
sw.insertRow(rowNum);
|
||||
}
|
||||
|
||||
public void createCell(int columnIndex, String value) throws IOException {
|
||||
sw.createCell(columnIndex, value, -1);
|
||||
}
|
||||
|
||||
public void createCell(int columnIndex, double value) throws IOException {
|
||||
sw.createCell(columnIndex, value, -1);
|
||||
}
|
||||
|
||||
public void endRow() throws IOException {
|
||||
sw.endRow();
|
||||
}
|
||||
|
||||
public void endSheet() throws IOException {
|
||||
sw.endSheet();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param zipfile the template file
|
||||
* @param tmpfile the XML file with the sheet data
|
||||
* @param entry the name of the sheet entry to substitute, e.g. xl/worksheets/sheet1.xml
|
||||
* @param out the stream to write the result to
|
||||
*/
|
||||
private static void substitute(File zipfile, File tmpfile, String entry,
|
||||
OutputStream out) throws IOException {
|
||||
ZipFile zip = null;
|
||||
ZipOutputStream zos = null;
|
||||
InputStream is = null;
|
||||
try{
|
||||
zip = new ZipFile(zipfile);
|
||||
zos = new ZipOutputStream(out);
|
||||
@SuppressWarnings("unchecked")
|
||||
Enumeration<ZipEntry> en = (Enumeration<ZipEntry>) zip.entries();
|
||||
while (en.hasMoreElements()) {
|
||||
ZipEntry ze = en.nextElement();
|
||||
if (!ze.getName().equals(entry)) {
|
||||
zos.putNextEntry(new ZipEntry(ze.getName()));
|
||||
InputStream is2 = null;
|
||||
try{
|
||||
is2 = zip.getInputStream(ze);
|
||||
copyStream(is2, zos);
|
||||
}finally {
|
||||
if (is2 != null){
|
||||
is2.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
zos.putNextEntry(new ZipEntry(entry));
|
||||
is = new FileInputStream(tmpfile);
|
||||
copyStream(is, zos);
|
||||
}finally {
|
||||
if (is != null){
|
||||
is.close();
|
||||
}
|
||||
if (zos != null){
|
||||
zos.close();
|
||||
}
|
||||
if (zip != null){
|
||||
zip.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void copyStream(InputStream in, OutputStream out)
|
||||
throws IOException {
|
||||
byte[] chunk = new byte[1024];
|
||||
int count;
|
||||
while ((count = in.read(chunk)) >= 0) {
|
||||
out.write(chunk, 0, count);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 在写入器中写入电子表格
|
||||
*
|
||||
*/
|
||||
public static class SpreadsheetWriter {
|
||||
private final Writer _out;
|
||||
private int _rownum;
|
||||
private static String LINE_SEPARATOR = System
|
||||
.getProperty("line.separator");
|
||||
|
||||
public SpreadsheetWriter(Writer out) {
|
||||
_out = out;
|
||||
}
|
||||
|
||||
public void beginSheet() throws IOException {
|
||||
_out.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
|
||||
+ "<worksheet xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\">");
|
||||
_out.write("<sheetData>" + LINE_SEPARATOR);
|
||||
}
|
||||
|
||||
public void endSheet() throws IOException {
|
||||
_out.write("</sheetData>");
|
||||
_out.write("</worksheet>");
|
||||
}
|
||||
|
||||
/**
|
||||
* 插入新行
|
||||
*
|
||||
* @param rownum
|
||||
* 以0开始
|
||||
*/
|
||||
public void insertRow(int rownum) throws IOException {
|
||||
_out.write("<row r=\"" + (rownum + 1) + "\">" + LINE_SEPARATOR);
|
||||
this._rownum = rownum;
|
||||
}
|
||||
|
||||
/**
|
||||
* 插入行结束标志
|
||||
*/
|
||||
public void endRow() throws IOException {
|
||||
_out.write("</row>" + LINE_SEPARATOR);
|
||||
}
|
||||
|
||||
/**
|
||||
* 插入新列
|
||||
*
|
||||
* @param columnIndex
|
||||
* @param value
|
||||
* @param styleIndex
|
||||
* @throws IOException
|
||||
*/
|
||||
public void createCell(int columnIndex, String value, int styleIndex)
|
||||
throws IOException {
|
||||
String ref = new CellReference(_rownum, columnIndex)
|
||||
.formatAsString();
|
||||
_out.write("<c r=\"" + ref + "\" t=\"inlineStr\"");
|
||||
if (styleIndex != -1) {
|
||||
_out.write(" s=\"" + styleIndex + "\"");
|
||||
}
|
||||
_out.write(">");
|
||||
_out.write("<is><t>" + encoderXML(value) + "</t></is>");
|
||||
_out.write("</c>");
|
||||
}
|
||||
|
||||
public void createCell(int columnIndex, String value)
|
||||
throws IOException {
|
||||
createCell(columnIndex, value, -1);
|
||||
}
|
||||
|
||||
public void createCell(int columnIndex, double value, int styleIndex)
|
||||
throws IOException {
|
||||
String ref = new CellReference(_rownum, columnIndex)
|
||||
.formatAsString();
|
||||
_out.write("<c r=\"" + ref + "\" t=\"n\"");
|
||||
if (styleIndex != -1) {
|
||||
_out.write(" s=\"" + styleIndex + "\"");
|
||||
}
|
||||
_out.write(">");
|
||||
_out.write("<v>" + value + "</v>");
|
||||
_out.write("</c>");
|
||||
}
|
||||
|
||||
public void createCell(int columnIndex, double value)
|
||||
throws IOException {
|
||||
createCell(columnIndex, value, -1);
|
||||
}
|
||||
|
||||
public void createCell(int columnIndex, Calendar value, int styleIndex)
|
||||
throws IOException {
|
||||
createCell(columnIndex, DateUtil.getExcelDate(value, false),
|
||||
styleIndex);
|
||||
}
|
||||
}
|
||||
|
||||
// XML Encode
|
||||
private static final String[] xmlCode = new String[256];
|
||||
|
||||
static {
|
||||
// Special characters
|
||||
xmlCode['\''] = "'";
|
||||
xmlCode['\"'] = "\""; // double quote
|
||||
xmlCode['&'] = "&"; // ampersand
|
||||
xmlCode['<'] = "<"; // lower than
|
||||
xmlCode['>'] = ">"; // greater than
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Encode the given text into xml.
|
||||
* </p>
|
||||
*
|
||||
* @param string the text to encode
|
||||
* @return the encoded string
|
||||
*/
|
||||
public static String encoderXML(String string) {
|
||||
if (string == null) {
|
||||
return "";
|
||||
}
|
||||
int n = string.length();
|
||||
char character;
|
||||
String xmlchar;
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
// loop over all the characters of the String.
|
||||
for (int i = 0; i < n; i++) {
|
||||
character = string.charAt(i);
|
||||
// the xmlcode of these characters are added to a StringBuffer
|
||||
// one by one
|
||||
try {
|
||||
xmlchar = xmlCode[character];
|
||||
if (xmlchar == null) {
|
||||
buffer.append(character);
|
||||
} else {
|
||||
buffer.append(xmlCode[character]);
|
||||
}
|
||||
} catch (ArrayIndexOutOfBoundsException aioobe) {
|
||||
buffer.append(character);
|
||||
}
|
||||
}
|
||||
return buffer.toString();
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 测试方法
|
||||
// */
|
||||
// public static void main(String[] args) throws Exception {
|
||||
//
|
||||
// String file = "E:/测试导出数据.xlsx";
|
||||
//
|
||||
// ExcelWriter writer = new ExcelWriter() {
|
||||
// @Override
|
||||
// public void generate() throws Exception {
|
||||
//
|
||||
// // 电子表格开始
|
||||
// this.beginSheet();
|
||||
//
|
||||
// for (int rownum = 0; rownum < 100; rownum++) {
|
||||
// // 插入新行
|
||||
// this.insertRow(rownum);
|
||||
//
|
||||
// // 建立新单元格,索引值从0开始,表示第一列
|
||||
// this.createCell(0, "第 " + rownum + " 行");
|
||||
// this.createCell(1, 34343.123456789);
|
||||
// this.createCell(2, "23.67%");
|
||||
// this.createCell(3, "12:12:23");
|
||||
// this.createCell(4, "2014-10-11 12:12:23");
|
||||
// this.createCell(5, "true");
|
||||
// this.createCell(6, "false");
|
||||
//
|
||||
// // 结束行
|
||||
// this.endRow();
|
||||
// }
|
||||
//
|
||||
// // 电子表格结束
|
||||
// this.endSheet();
|
||||
// }
|
||||
// };
|
||||
// writer.process(file);
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent</artifactId>
|
||||
<version>4.6.1-SNAPSHOT</version>
|
||||
<version>4.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../parent/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@ import com.jeesite.modules.cms.entity.Article;
|
||||
@MyBatisDao
|
||||
public interface ArticleDao extends CrudDao<Article> {
|
||||
|
||||
public long updateExpiredWeight(Article article);
|
||||
long updateExpiredWeight(Article article);
|
||||
|
||||
public long updateHitsAddOne(String id);
|
||||
long updateHitsAddOne(String id);
|
||||
|
||||
}
|
||||
@@ -4,13 +4,6 @@
|
||||
*/
|
||||
package com.jeesite.modules.cms.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.jeesite.common.entity.BaseEntity;
|
||||
import com.jeesite.common.entity.DataEntity;
|
||||
@@ -20,6 +13,11 @@ import com.jeesite.common.mybatis.annotation.Table;
|
||||
import com.jeesite.common.mybatis.mapper.query.QueryType;
|
||||
import com.jeesite.modules.cms.utils.CmsUtils;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 文章表Entity
|
||||
* @author 长春叭哥、ThinkGem
|
||||
@@ -45,7 +43,12 @@ import com.jeesite.modules.cms.utils.CmsUtils;
|
||||
@Column(name = "word_count", attrName = "wordCount", label = "字数", comment = "字数(不包含html)"),
|
||||
@Column(name = "custom_content_view", attrName = "customContentView", label = "自定义内容视图"),
|
||||
@Column(name = "view_config", attrName = "viewConfig", label = "视图配置"),
|
||||
@Column(includeEntity = DataEntity.class),
|
||||
@Column(name="status", attrName="status", label="状态", isUpdate=false),
|
||||
@Column(name="create_by", attrName="createBy", label="创建者", isUpdate=true),
|
||||
@Column(name="create_date", attrName="createDate", label="创建时间", isUpdate=false, isQuery=false),
|
||||
@Column(name="update_by", attrName="updateBy", label="更新者", isUpdate=true),
|
||||
@Column(name="update_date", attrName="updateDate", label="更新时间", isUpdate=true, isQuery=false),
|
||||
@Column(name="remarks", attrName="remarks", label="备注信息", queryType=QueryType.LIKE),
|
||||
@Column(includeEntity = BaseEntity.class),
|
||||
}, joinTable = {
|
||||
@JoinTable(entity = Category.class, alias = "c",
|
||||
@@ -83,12 +86,13 @@ public class Article extends DataEntity<Article> {
|
||||
private Integer wordCount; // 字数(不包含html)
|
||||
private String customContentView; // 自定义内容视图
|
||||
private String viewConfig; // 视图配置
|
||||
|
||||
private ArticleData articleData; //文章副表
|
||||
private Boolean isQueryArticleData; // 是否查询文章内容
|
||||
|
||||
private Date beginDate; // 开始时间
|
||||
private Date endDate; // 结束时间
|
||||
|
||||
private Boolean isQueryArticleData; // 是否查询文章内容
|
||||
|
||||
public Article() {
|
||||
super();
|
||||
//this.weight = 0;
|
||||
@@ -223,8 +227,6 @@ public class Article extends DataEntity<Article> {
|
||||
this.hits = hits;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Integer getHitsPlus() {
|
||||
return hitsPlus;
|
||||
}
|
||||
@@ -275,6 +277,18 @@ public class Article extends DataEntity<Article> {
|
||||
this.articleData = articleData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否查询文章内容
|
||||
* @return
|
||||
*/
|
||||
public Boolean getIsQueryArticleData() {
|
||||
return isQueryArticleData;
|
||||
}
|
||||
|
||||
public void setIsQueryArticleData(Boolean isQueryArticleData) {
|
||||
this.isQueryArticleData = isQueryArticleData;
|
||||
}
|
||||
|
||||
public Date getBeginDate() {
|
||||
return beginDate;
|
||||
}
|
||||
@@ -291,20 +305,6 @@ public class Article extends DataEntity<Article> {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否查询文章内容
|
||||
* @return
|
||||
*/
|
||||
public Boolean getIsQueryArticleData() {
|
||||
return isQueryArticleData;
|
||||
}
|
||||
|
||||
public void setIsQueryArticleData(Boolean isQueryArticleData) {
|
||||
this.isQueryArticleData = isQueryArticleData;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getUrl() {
|
||||
return CmsUtils.getUrlDynamic(this);
|
||||
}
|
||||
|
||||
@@ -4,19 +4,6 @@
|
||||
*/
|
||||
package com.jeesite.modules.cms.service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.jeesite.common.collect.ListUtils;
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.entity.Page;
|
||||
@@ -31,8 +18,19 @@ import com.jeesite.modules.cms.entity.Category;
|
||||
import com.jeesite.modules.cms.utils.CmsUtils;
|
||||
import com.jeesite.modules.file.utils.FileUploadUtils;
|
||||
import com.jeesite.modules.sys.utils.UserUtils;
|
||||
|
||||
import io.netty.util.concurrent.DefaultThreadFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* 文章表Service
|
||||
@@ -81,7 +79,7 @@ public class ArticleService extends CrudService<ArticleDao, Article> {
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @param article 查询条件
|
||||
* @param article.page 分页对象
|
||||
* @param article page 分页对象
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
|
||||
@@ -4,16 +4,18 @@
|
||||
*/
|
||||
package com.jeesite.modules.cms.service;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.beust.jcommander.internal.Lists;
|
||||
import com.jeesite.modules.cms.entity.FileTemplete;
|
||||
import com.jeesite.modules.cms.entity.Site;
|
||||
import com.jeesite.modules.cms.utils.CmsUtils;
|
||||
import com.jeesite.modules.cms.utils.FileTempleteUtils;
|
||||
import com.jeesite.modules.sys.entity.DictData;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 模版文件Service
|
||||
|
||||
@@ -4,14 +4,6 @@
|
||||
*/
|
||||
package com.jeesite.modules.cms.utils;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
|
||||
import org.springframework.ui.Model;
|
||||
|
||||
import com.jeesite.common.cache.CacheUtils;
|
||||
import com.jeesite.common.collect.ListUtils;
|
||||
import com.jeesite.common.config.Global;
|
||||
@@ -26,6 +18,12 @@ import com.jeesite.modules.cms.entity.Site;
|
||||
import com.jeesite.modules.cms.service.ArticleService;
|
||||
import com.jeesite.modules.cms.service.CategoryService;
|
||||
import com.jeesite.modules.cms.service.SiteService;
|
||||
import org.springframework.ui.Model;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* CmsUtils
|
||||
@@ -191,7 +189,7 @@ public class CmsUtils {
|
||||
* @param siteCode 站点编号
|
||||
* @param categoryCode 分类编号
|
||||
* @param number 获取数目
|
||||
* @param param 预留参数,例: key1:'value1', key2:'value2' ...<br>
|
||||
* @param params 预留参数,例: key1:'value1', key2:'value2' ...<br>
|
||||
* posid : 推荐位(1:首页焦点图;2:栏目页文章推荐;)<br>
|
||||
* image : 文章图片(1:有图片的文章)<br>
|
||||
* isQueryArticleData : 是否查询文章详情信息,查询会影响效率<br>
|
||||
|
||||
@@ -4,22 +4,6 @@
|
||||
*/
|
||||
package com.jeesite.modules.cms.web;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.entity.Page;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
@@ -33,6 +17,20 @@ import com.jeesite.modules.cms.service.CategoryService;
|
||||
import com.jeesite.modules.cms.service.FileTempleteService;
|
||||
import com.jeesite.modules.cms.utils.CmsUtils;
|
||||
import com.jeesite.modules.sys.utils.UserUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文章表Controller
|
||||
|
||||
@@ -4,20 +4,6 @@
|
||||
*/
|
||||
package com.jeesite.modules.cms.web;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import com.jeesite.common.collect.ListUtils;
|
||||
import com.jeesite.common.collect.MapUtils;
|
||||
import com.jeesite.common.config.Global;
|
||||
@@ -33,6 +19,20 @@ import com.jeesite.modules.cms.utils.CmsUtils;
|
||||
import com.jeesite.modules.sys.entity.Office;
|
||||
import com.jeesite.modules.sys.utils.DictUtils;
|
||||
import com.jeesite.modules.sys.utils.UserUtils;
|
||||
import org.apache.shiro.authz.annotation.Logical;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 栏目表Controller
|
||||
@@ -252,7 +252,7 @@ public class CategoryController extends BaseController {
|
||||
* @param isShowCode 是否显示编码(true or 1:显示在左侧;2:显示在右侧;false or null:不显示)
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("cms:category:view")
|
||||
@RequiresPermissions(value = {"cms:category:view", "cms:article:view"}, logical = Logical.OR)
|
||||
@RequestMapping(value = "treeData")
|
||||
@ResponseBody
|
||||
public List<Map<String, Object>> treeData(String siteCode, String module, String excludeCode, Boolean isAll, String isShowCode) {
|
||||
|
||||
@@ -4,37 +4,27 @@
|
||||
*/
|
||||
package com.jeesite.modules.cmsfront.web;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import com.jeesite.common.collect.ListUtils;
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.entity.Page;
|
||||
import com.jeesite.common.lang.ObjectUtils;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
import com.jeesite.common.web.BaseController;
|
||||
import com.jeesite.modules.cms.entity.Article;
|
||||
import com.jeesite.modules.cms.entity.ArticleData;
|
||||
import com.jeesite.modules.cms.entity.Category;
|
||||
import com.jeesite.modules.cms.entity.Comment;
|
||||
import com.jeesite.modules.cms.entity.Site;
|
||||
import com.jeesite.modules.cms.entity.*;
|
||||
import com.jeesite.modules.cms.service.ArticleService;
|
||||
import com.jeesite.modules.cms.service.CategoryService;
|
||||
import com.jeesite.modules.cms.service.CommentService;
|
||||
import com.jeesite.modules.cms.utils.CmsUtils;
|
||||
import com.jeesite.modules.sys.utils.ValidCodeUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 网站Controller
|
||||
@@ -310,8 +300,8 @@ public class FrontController extends BaseController {
|
||||
/**
|
||||
* 内容评论
|
||||
*/
|
||||
@RequestMapping(value = "comment", method = RequestMethod.GET)
|
||||
public String comment(Comment comment, String theme, HttpServletRequest request, HttpServletResponse response,
|
||||
@RequestMapping(value = "comment-{theme}", method = RequestMethod.GET)
|
||||
public String comment(Comment comment, @PathVariable String theme, HttpServletRequest request, HttpServletResponse response,
|
||||
Model model) {
|
||||
Page<Comment> page = new Page<Comment>(request, response);
|
||||
Comment c = new Comment();
|
||||
|
||||
@@ -15,4 +15,6 @@
|
||||
4.4.1
|
||||
4.5.0
|
||||
4.6.0
|
||||
4.6.1
|
||||
4.6.1
|
||||
4.6.2
|
||||
4.7.0
|
||||
@@ -2,15 +2,23 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jeesite.modules.cms.dao.ArticleDao">
|
||||
|
||||
<!-- 查询数据
|
||||
<select id="findList" resultType="CmsArticle">
|
||||
<!-- 查询数据 -->
|
||||
<select id="findList" resultType="Article">
|
||||
SELECT ${sqlMap.column.toSql()}
|
||||
<if test="isQueryArticleData">,
|
||||
ad.content AS "articleData.content",
|
||||
ad.relation AS "articleData.relation",
|
||||
ad.is_can_comment AS "articleData.isCanComment"
|
||||
</if>
|
||||
FROM ${sqlMap.table.toSql()}
|
||||
<if test="isQueryArticleData">
|
||||
JOIN ${_prefix}cms_article_data ad ON ad.id = a.id
|
||||
</if>
|
||||
<where>
|
||||
${sqlMap.where.toSql()}
|
||||
</where>
|
||||
ORDER BY ${sqlMap.order.toSql()}
|
||||
</select> -->
|
||||
</select>
|
||||
|
||||
<update id="updateExpiredWeight">
|
||||
update ${_prefix}cms_article SET weight = 0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
body{padding-top:50px;font-size:14px;}
|
||||
body{padding-top:50px;font-size:15px;background:#f7f8f9;}
|
||||
body>.navbar{-webkit-transition:background-color .3s ease-in;transition:background-color .3s ease-in}
|
||||
@media (min-width:768px){
|
||||
body>.navbar-transparent{background-color:transparent}
|
||||
@@ -51,20 +51,34 @@ footer p{clear:left;margin-bottom:0}
|
||||
#banner{margin-bottom:2em;text-align:center}
|
||||
}
|
||||
|
||||
.jumbotron {background:#f1f1f1;margin:48px auto;}
|
||||
.panel-title small .more {padding-top:4px;}
|
||||
.breadcrumb {border-radius:8px;background:transparent;padding:0;margin:2px 15px 21px 15px;}
|
||||
|
||||
.jumbotron {background:#fff;margin:48px auto;border:1px solid #ededed;box-shadow:0 1px 4px 0 rgb(0 0 0 / 5%);border-radius:8px!important;}
|
||||
.jumbotron h1, .jumbotron .h1 {font-size:43px;margin: 0 0 30px;}
|
||||
.jumbotron .btn-sm {font-size:17px;}
|
||||
|
||||
.panel {border-radius:8px}
|
||||
.panel-heading {border-radius:8px 8px 0 0}
|
||||
.panel-footer {border-radius:0 0 8px 8px}
|
||||
.panel-title {font-size:18px;}
|
||||
.panel-title small .more {padding-top:4px;font-size:14px}
|
||||
|
||||
.nav-search {margin-top:9px;}
|
||||
.nav-search .form-control {height:30px;padding:5px;}
|
||||
.nav-search .btn {height:31px;padding:5px 10px;}
|
||||
|
||||
.main {background:#fff;box-shadow:0 1px 4px 0 rgb(0 0 0 / 8%);border-radius:0 0 8px 8px;padding:20px 10px;margin:0 -1px}
|
||||
.main-list {border-radius:8px;}
|
||||
.main-right::before {content:'';border-left:1px solid #e6e6e6;position:absolute;height:100%;left:-20px;}
|
||||
|
||||
.article-list {padding:5px;margin:0;}
|
||||
.article-list li {list-style:none;padding:8px 0;}
|
||||
|
||||
.article-title {color:#555555;font-size:20px;text-align:center;border-bottom:1px solid #ddd;padding:15px 20px 20px 20px;margin-bottom:30px;}
|
||||
.article-info {border-top:1px solid #ddd;padding:10px;margin:25px 0 0;}
|
||||
.article-desc {padding:8px 10px 8px;margin:10px 20px 20px 35px;font-size:13px;}
|
||||
.article-content {padding-top:10px;}
|
||||
.article-view {border-radius:8px;padding:30px 50px;}
|
||||
.article-title {color:#333;font-size:30px;text-align:center;border-bottom:1px solid #ddd;padding:15px 20px 20px 20px;margin-bottom:30px;}
|
||||
.article-info {border-top:1px solid #ddd;padding:10px;margin:30px 0 0;}
|
||||
.article-desc {padding:8px 10px 8px;margin:10px 20px 20px 35px;font-size:14px;}
|
||||
.article-content {padding-top:20px;}
|
||||
|
||||
.pagination {margin:8px 0;display:block;/* text-align:center; */font-size:13px;} /* .pagination .controls a{border:0;} */
|
||||
.pagination>li>a, .pagination>li>span {min-width:37px;text-align:center;padding:6px;border:1px solid #ddd;background:transparent;/* border-radius:3px; */}
|
||||
|
||||
@@ -143,7 +143,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<!--<div class="col-xs-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-4">${text('推荐位')}:</label>
|
||||
<div class="col-sm-8">
|
||||
@@ -162,14 +162,14 @@
|
||||
<#form:select path="state" dictType="sys_status" blankOption="true" class="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>-->
|
||||
<div class="col-xs-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-4" title="${text('可修改发布时间,不填则使用当前时间')}">
|
||||
${text('发布时间')}: <i class="fa icon-question"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:input path="createDate" readonly="true" maxlength="20" class="form-control Wdate"
|
||||
dataFormat="datetime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:false});"/>
|
||||
<#form:input path="createDate" readonly="true" maxlength="20" class="form-control laydate"
|
||||
dataFormat="datetime" data-type="datetime" data-format="yyyy-MM-dd HH:mm"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -208,7 +208,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<#form:extend collapsed="true" />
|
||||
<#form:extend collapsed="true" pathPrefix="articleData"/>
|
||||
<div class="box-footer">
|
||||
<div class="row">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm isQuick">${text('重置')}</button>
|
||||
</div>
|
||||
</#form:form>
|
||||
<table id="dataGrid"></table>
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm isQuick">${text('重置')}</button>
|
||||
</div>
|
||||
</#form:form>
|
||||
<table id="dataGrid"></table>
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm isQuick">${text('重置')}</button>
|
||||
</div>
|
||||
</#form:form>
|
||||
<table id="dataGrid"></table>
|
||||
@@ -129,7 +129,7 @@ $('#dataGrid').dataGrid({
|
||||
}},
|
||||
{header:'${text('操作')}', name:'actions', width:120, formatter: function(val, obj, row, act){
|
||||
var actions = [];
|
||||
//<% if(hasPermi('cms:comment:edit')){ %>
|
||||
<% if(hasPermi('cms:comment:edit')){ %>
|
||||
actions.push('<a href="${ctx}/cms/comment/form?id='+row.id+'" class="btnList" title="${text('编辑文章评论表')}"><i class="fa fa-pencil"></i></a> ');
|
||||
if (row.status == Global.STATUS_NORMAL){
|
||||
actions.push('<a href="${ctx}/cms/comment/disable?id='+row.id+'" class="btnList" title="${text('停用文章评论表')}" data-confirm="${text('确认要停用该文章评论表吗?')}"><i class="glyphicon glyphicon-ban-circle"></i></a> ');
|
||||
@@ -138,7 +138,7 @@ $('#dataGrid').dataGrid({
|
||||
actions.push('<a href="${ctx}/cms/comment/enable?id='+row.id+'" class="btnList" title="${text('启用文章评论表')}" data-confirm="${text('确认要启用该文章评论表吗?')}"><i class="glyphicon glyphicon-ok-circle"></i></a> ');
|
||||
}
|
||||
actions.push('<a href="${ctx}/cms/comment/delete?id='+row.id+'" class="btnList" title="${text('删除文章评论表')}" data-confirm="${text('确认要删除该文章评论表吗?')}"><i class="fa fa-trash-o"></i></a> ');
|
||||
//<% } %>
|
||||
<% } %>
|
||||
return actions.join('');
|
||||
}}
|
||||
],
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm isQuick">${text('重置')}</button>
|
||||
</div>
|
||||
</#form:form>
|
||||
<table id="dataGrid"></table>
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm isQuick">${text('重置')}</button>
|
||||
</div>
|
||||
</#form:form>
|
||||
<table id="dataGrid"></table>
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm isQuick">${text('重置')}</button>
|
||||
</div>
|
||||
</#form:form>
|
||||
<table id="dataGrid"></table>
|
||||
|
||||
@@ -11,5 +11,5 @@
|
||||
<meta content="width=device-width, initial-scale=1, user-scalable=1" name="viewport"/>
|
||||
<title>${(isNotBlank(title!) ? title! + ' - ' : '') + @Global.getConfig('productName')}</title>
|
||||
<script src="${ctxPath}/global.min.js?ctx=${ctx}"></script>
|
||||
<script src="${ctxStatic}/jquery/jquery-1.12.4.min.js"></script>
|
||||
<script src="${ctxStatic}/jquery/jquery-migrate-1.4.1.min.js"></script>
|
||||
<script src="${ctxStatic}/jquery/jquery-3.5.0.min.js"></script>
|
||||
<script src="${ctxStatic}/jquery/jquery-migrate-3.2.0.min.js"></script>
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
href="${ctx}/list-${c.categoryCode}">${c.categoryName}</a></li>
|
||||
</#html:if>
|
||||
</#html:foreach>
|
||||
<li><a href="http://jeesite.com" target="_blank">官方网站</a></li>
|
||||
<li><a href="http://s.jeesite.com" target="_blank">技术服务</a></li>
|
||||
<li id="siteSwitch" class="dropdown">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#" title="站点">子站切换 <span class="caret"></span></a>
|
||||
@@ -36,7 +35,7 @@
|
||||
</ul>
|
||||
</li> -->
|
||||
</ul>
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<ul class="nav navbar-nav navbar-right hidden-xs hidden-sm">
|
||||
<form class="navbar-form navbar-left nav-search" action="${ctx}/search">
|
||||
<div class="form-group">
|
||||
<input type="text" name="q" class="form-control" placeholder="全站搜索...">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<% layout('layouts/default.html', {title: '列表页面', libs: []}){ %>
|
||||
<% include('include/banner.html'){} %>
|
||||
<div class="row">
|
||||
<div class="col-xs-2">
|
||||
<div class="row main main-list">
|
||||
<div class="col-sm-2 col-xs-12 main-left">
|
||||
<h4>栏目列表</h4>
|
||||
<ul class="article-list">
|
||||
<#html:foreach items="${qmark(categoryList! != null, categoryList!, categoryList(site.siteCode, category.parentCode, 50, ''))}" var="category,status">
|
||||
@@ -9,7 +9,7 @@
|
||||
</#html:foreach>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-xs-10">
|
||||
<div class="col-sm-10 col-xs-12 main-right">
|
||||
<h4>${category.categoryName}</h4>
|
||||
<#html:if test="${page! != null && category.moduleType == 'article'}">
|
||||
<ul class="article-list">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<% layout('layouts/default.html', {title: '列表页面', libs: []}){ %>
|
||||
<% include('include/banner.html'){} %>
|
||||
<div class="row">
|
||||
<div class="col-xs-2">
|
||||
<div class="row main main-list">
|
||||
<div class="col-sm-2 col-xs-12 main-left">
|
||||
<h4>栏目列表</h4>
|
||||
<ul class="article-list">
|
||||
<#html:foreach items="${qmark(categoryList! != null, categoryList!, categoryList(site.siteCode, category.parentCode, 50, ''))}" var="category,status">
|
||||
@@ -9,7 +9,7 @@
|
||||
</#html:foreach>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-xs-10">
|
||||
<div class="col-sm-10 col-xs-12 main-right">
|
||||
<h4>${category.categoryName}</h4>
|
||||
<div class="row"><br/>
|
||||
<#html:foreach items="${qmark(categoryList! != null, categoryList!, [])}" var="category,status">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<% layout('layouts/default.html', {title: '站点地图', libs: []}){ %>
|
||||
<style type="text/css">
|
||||
h2 {padding-left:10px;}
|
||||
h2 {padding-left:10px;text-align:center;}
|
||||
h3.title {padding:5px 5px;margin:15px 8px 10px;}
|
||||
dl.map{border:1px solid #ddd;border-top:0;margin:10px 8px 8px;}
|
||||
dl.map dt{border-top:1px solid #ddd;padding:10px 15px;} dl.map dd{margin:20px 30px 30px;}
|
||||
@@ -8,7 +8,7 @@
|
||||
dl.map span:hover{border:1px solid #bbb;background:#f1f1f1;}
|
||||
dl.map span a:hover{text-decoration:none;color:#333;}
|
||||
</style>
|
||||
<div class="row">
|
||||
<div class="row main">
|
||||
<h2>站点地图</h2>
|
||||
<#html:foreach items="${siteList()}" var="site">
|
||||
<h3 class="title breadcrumb">${site.siteName}</h3>
|
||||
|
||||
@@ -37,7 +37,7 @@ $(function(){
|
||||
laydate.render({elem:'#ed', type:'date', format:'yyyy-MM-dd'});
|
||||
});
|
||||
</script>
|
||||
<div class="row">
|
||||
<div class="row main">
|
||||
<form id="searchForm" method="get" class="search">
|
||||
<input type="hidden" id="pageNo" name="pageNo" value="${page.pageNo!}"/>
|
||||
<input type="hidden" id="t" name="t" value="${isNotBlank(t)?t:'article'}"/>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<% layout('layouts/default.html', {title:'文章查看',libs: []}){ %>
|
||||
<% include('include/banner.html'){} %>
|
||||
<div class="row article-view">
|
||||
<div class="row main article-view">
|
||||
<h3 class="article-title">${article.title}</h3>
|
||||
<blockquote class="article-desc">摘要:${article.description}</blockquote>
|
||||
<div class="article-content uparse">${article.articleData.content}</div>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent</artifactId>
|
||||
<version>4.6.1-SNAPSHOT</version>
|
||||
<version>4.7.0-SNAPSHOT</version>
|
||||
<relativePath>../../parent/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -4,19 +4,19 @@
|
||||
*/
|
||||
package com.jeesite.common.shiro.filter;
|
||||
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.jeesite.common.lang.ExceptionUtils;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
import com.jeesite.common.shiro.realm.BaseAuthorizingRealm;
|
||||
import com.jeesite.modules.sys.utils.UserUtils;
|
||||
import org.apache.shiro.authc.AuthenticationException;
|
||||
import org.apache.shiro.authc.AuthenticationToken;
|
||||
import org.apache.shiro.subject.Subject;
|
||||
import org.apache.shiro.web.util.WebUtils;
|
||||
|
||||
import com.jeesite.common.lang.ExceptionUtils;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
import com.jeesite.common.shiro.realm.BaseAuthorizingRealm;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* CAS过滤器
|
||||
@@ -25,12 +25,15 @@ import com.jeesite.common.shiro.realm.BaseAuthorizingRealm;
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public class CasFilter extends org.apache.shiro.cas.CasFilter {
|
||||
|
||||
|
||||
private BaseAuthorizingRealm authorizingRealm;
|
||||
|
||||
/**
|
||||
* 登录成功调用事件
|
||||
*/
|
||||
@Override
|
||||
protected boolean onLoginSuccess(AuthenticationToken token, Subject subject, ServletRequest request, ServletResponse response) throws Exception {
|
||||
authorizingRealm.onLoginSuccess(UserUtils.getLoginInfo(), (HttpServletRequest)request);
|
||||
return FormFilter.onLoginSuccess((HttpServletRequest)request, (HttpServletResponse)response);
|
||||
}
|
||||
|
||||
@@ -66,7 +69,7 @@ public class CasFilter extends org.apache.shiro.cas.CasFilter {
|
||||
}
|
||||
|
||||
public void setAuthorizingRealm(BaseAuthorizingRealm authorizingRealm) {
|
||||
|
||||
this.authorizingRealm = authorizingRealm;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,15 +4,14 @@
|
||||
*/
|
||||
package com.jeesite.common.shiro.filter;
|
||||
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
import org.apache.shiro.web.filter.AccessControlFilter;
|
||||
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.shiro.web.filter.AccessControlFilter;
|
||||
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
|
||||
/**
|
||||
* 内部系统访问过滤器
|
||||
* @author ThinkGem
|
||||
@@ -29,7 +28,7 @@ public class InnerFilter extends AccessControlFilter {
|
||||
"shiro.innerFilterAllowRemoteAddrs", "127.0.0.1"), ",");
|
||||
}
|
||||
if (prefixes != null && request instanceof HttpServletRequest){
|
||||
String ip = ((HttpServletRequest)request).getRemoteAddr();
|
||||
String ip = request.getRemoteAddr();
|
||||
for (String prefix : prefixes){
|
||||
result = StringUtils.startsWithIgnoreCase(ip, StringUtils.trim(prefix));
|
||||
if (result){
|
||||
|
||||
@@ -4,22 +4,6 @@
|
||||
*/
|
||||
package com.jeesite.common.shiro.realm;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.ValidationException;
|
||||
|
||||
import org.apache.shiro.authc.AuthenticationException;
|
||||
import org.apache.shiro.authc.AuthenticationInfo;
|
||||
import org.apache.shiro.authc.AuthenticationToken;
|
||||
import org.apache.shiro.cas.CasToken;
|
||||
import org.jasig.cas.client.authentication.AttributePrincipal;
|
||||
import org.jasig.cas.client.validation.Assertion;
|
||||
import org.jasig.cas.client.validation.Cas20ServiceTicketValidator;
|
||||
import org.jasig.cas.client.validation.TicketValidationException;
|
||||
import org.jasig.cas.client.validation.TicketValidator;
|
||||
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
||||
|
||||
import com.jeesite.common.codec.EncodeUtils;
|
||||
import com.jeesite.common.collect.MapUtils;
|
||||
import com.jeesite.common.lang.ObjectUtils;
|
||||
@@ -35,6 +19,20 @@ import com.jeesite.modules.sys.service.EmpUserService;
|
||||
import com.jeesite.modules.sys.service.UserService;
|
||||
import com.jeesite.modules.sys.utils.LogUtils;
|
||||
import com.jeesite.modules.sys.utils.UserUtils;
|
||||
import org.apache.shiro.authc.AuthenticationException;
|
||||
import org.apache.shiro.authc.AuthenticationInfo;
|
||||
import org.apache.shiro.authc.AuthenticationToken;
|
||||
import org.apache.shiro.cas.CasToken;
|
||||
import org.jasig.cas.client.authentication.AttributePrincipal;
|
||||
import org.jasig.cas.client.validation.Assertion;
|
||||
import org.jasig.cas.client.validation.Cas20ServiceTicketValidator;
|
||||
import org.jasig.cas.client.validation.TicketValidationException;
|
||||
import org.jasig.cas.client.validation.TicketValidator;
|
||||
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.ValidationException;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 系统认证授权实现类
|
||||
@@ -181,20 +179,11 @@ public class CasAuthorizingRealm extends BaseAuthorizingRealm {
|
||||
|
||||
@Override
|
||||
public void onLoginSuccess(LoginInfo loginInfo, HttpServletRequest request) {
|
||||
super.onLoginSuccess(loginInfo, request);
|
||||
|
||||
// 单点登录登出句柄(登录时注入session),在这之前必须获取下授权信息
|
||||
String ticket = loginInfo.getParam("ticket");
|
||||
casOutHandler.recordSession(request, ticket);
|
||||
//System.out.print("__sid: "+request.getSession().getId());
|
||||
//System.out.println(" == "+UserUtils.getSession().getId());
|
||||
|
||||
// 更新登录IP、时间、会话ID等
|
||||
User user = UserUtils.get(loginInfo.getId());
|
||||
getUserService().updateUserLoginInfo(user);
|
||||
|
||||
// 记录用户登录日志
|
||||
LogUtils.saveLog(user, ServletUtils.getRequest(), "系统登录", Log.TYPE_LOGIN_LOGOUT);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -72,6 +72,13 @@ public class EmpUserServiceSupport extends CrudService<EmpUserDao, EmpUser>
|
||||
*/
|
||||
@Override
|
||||
public void addDataScopeFilter(EmpUser empUser, String ctrlPermi) {
|
||||
// String defaultRoleCodes = Global.getConfig(
|
||||
// "sys.user.defaultRoleCodes." + empUser.getCurrentUser().getUserType());
|
||||
// if (StringUtils.isNotBlank(defaultRoleCodes)) {
|
||||
// empUser.getCurrentUser().getRoleList().addAll(Arrays
|
||||
// .stream(StringUtils.split(defaultRoleCodes,','))
|
||||
// .map(roleCode -> RoleUtils.get(roleCode)).collect(Collectors.toList()));
|
||||
// }
|
||||
empUser.getSqlMap().getDataScope().addFilter("dsfOffice",
|
||||
"Office", "e.office_code", "a.create_by", ctrlPermi, "office_user");
|
||||
if (StringUtils.isNotBlank(EmpUtils.getCompany().getCompanyCode())){
|
||||
|
||||
@@ -82,7 +82,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @param ${className} 查询条件
|
||||
* @param ${className}.page 分页对象
|
||||
* @param ${className} page 分页对象
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
|
||||
@@ -88,7 +88,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @param ${className} 查询条件
|
||||
* @param ${className}.page 分页对象
|
||||
* @param ${className} page 分页对象
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
<% } %>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-sm">\${text('查询')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm">\${text('重置')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm isQuick">\${text('重置')}</button>
|
||||
</div>
|
||||
</${'#'}form:form>
|
||||
<% /* 查询表单 end // 此行是为了去除空行 */ %>
|
||||
@@ -61,7 +61,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Query'}Ser
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @param ${className} 查询条件
|
||||
* @param ${className}.page 分页对象
|
||||
* @param ${className} page 分页对象
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
|
||||
@@ -14,6 +14,10 @@ if (isBlank(message)){
|
||||
message = message + '☆ ' + text(e.defaultMessage) + ' (' + e.objectName + ')<br/>';
|
||||
}
|
||||
for (var e in ex.fieldErrors){
|
||||
if (@StringUtils.inString(e.field, 'pageNo', 'pageSize')){
|
||||
message = text('提交的分页参数,超出有效范围');
|
||||
break;
|
||||
}
|
||||
message = message + '☆ ' + text(e.defaultMessage) + ' (' + e.field + ')<br/>';
|
||||
}
|
||||
}else if (type.fullName(ex) == 'javax.validation.ConstraintViolationException'){
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm isQuick">${text('重置')}</button>
|
||||
</div>
|
||||
</#form:form>
|
||||
<table id="dataGrid"></table>
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
<ul class="content-info">
|
||||
<li><i class="fa fa-user"></i> 发送者:${msgInner.sendUserName}</li>
|
||||
<li><i class="fa fa-calendar"></i> 发送时间:${msgInner.sendDate, 'yyyy-MM-dd HH:mm'}</li>
|
||||
<li><i class="fa icon-envelope-letter"></i> 读取时间:${msgInner.sendDate, 'yyyy-MM-dd HH:mm'}</li>
|
||||
<li><i class="fa fa-bookmark-o"></i> 等级:${@DictUtils.getDictLabel('msg_inner_content_level', msgInner.contentLevel, '普通')}</li>
|
||||
<li><i class="fa fa-bookmark-o"></i> 类型:${@DictUtils.getDictLabel('msg_inner_content_type', msgInner.contentType, '其它')}</li>
|
||||
</ul>
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-sm">查询</button>
|
||||
<button type="reset" class="btn btn-default btn-sm">重置</button>
|
||||
<button type="reset" class="btn btn-default btn-sm isQuick">重置</button>
|
||||
</div>
|
||||
</#form:form>
|
||||
<table id="dataGrid"></table>
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm isQuick">${text('重置')}</button>
|
||||
</div>
|
||||
</#form:form>
|
||||
<table id="dataGrid"></table>
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm isQuick">${text('重置')}</button>
|
||||
</div>
|
||||
</#form:form>
|
||||
<table id="dataGrid"></table>
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm isQuick">${text('重置')}</button>
|
||||
</div>
|
||||
</#form:form>
|
||||
<table id="dataGrid"></table>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm isQuick">${text('重置')}</button>
|
||||
</div>
|
||||
</#form:form>
|
||||
<table id="dataGrid"></table>
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm isQuick">${text('重置')}</button>
|
||||
</div>
|
||||
</#form:form>
|
||||
<table id="dataGrid"></table>
|
||||
|
||||
@@ -732,7 +732,9 @@ $(function(){
|
||||
var footerHeight = $('.main-footer').outerHeight() || 0;
|
||||
var windowHeight = $(window).height();
|
||||
$('.content').css('min-height', windowHeight - footerHeight);
|
||||
myChart1.resize(); myChart2.resize(); myChart3.resize();
|
||||
if(myChart1) myChart1.resize();
|
||||
if(myChart2) myChart2.resize();
|
||||
if(myChart3) myChart3.resize();
|
||||
}).resize();
|
||||
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
|
||||
$(window).resize();
|
||||
|
||||
@@ -111,6 +111,7 @@
|
||||
© ${@DateUtils.getYear()} ${@Global.getConfig('productName')} - Powered By <a
|
||||
id="loginKey" data-key="${@Global.getConfig('shiro.loginSubmit.secretKey')}"
|
||||
href="http://jeesite.com" target="_blank">JeeSite ${@Global.getProperty('jeesiteVersion')}</a>
|
||||
- <a href="https://gitee.com/thinkgem/jeesite-client" target="_blank">客户端下载</a>
|
||||
</div>
|
||||
</div>
|
||||
<% } %>
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm isQuick">${text('重置')}</button>
|
||||
</div>
|
||||
</#form:form>
|
||||
<table id="dataGrid"></table>
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
<!-- <div class="form-row"></div> -->
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm isQuick">${text('重置')}</button>
|
||||
<button type="button" class="btn btn-default btn-sm btnFormMore">${text('更多')}<i class="fa fa-angle-double-down"></i></button>
|
||||
</div>
|
||||
<div class="form-more">
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-sm">查询</button>
|
||||
<button type="reset" class="btn btn-default btn-sm">重置</button>
|
||||
<button type="reset" class="btn btn-default btn-sm isQuick">重置</button>
|
||||
</div>
|
||||
</#form:form>
|
||||
<div class="col-xs-10 p0 pr10">
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm isQuick">${text('重置')}</button>
|
||||
</div>
|
||||
</#form:form>
|
||||
<table id="dataGrid"></table>
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm isQuick">${text('重置')}</button>
|
||||
</div>
|
||||
</#form:form>
|
||||
<div class="row">
|
||||
|
||||
@@ -4,7 +4,7 @@ productName: JeeSite Demo
|
||||
companyName: ThinkGem
|
||||
|
||||
# 产品版本、版权年份
|
||||
productVersion: V4.6
|
||||
productVersion: V4.7
|
||||
copyrightYear: 2023
|
||||
|
||||
# 数据库连接
|
||||
|
||||
@@ -6,13 +6,13 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.7.8</version>
|
||||
<version>2.7.12</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent</artifactId>
|
||||
<version>4.6.1-SNAPSHOT</version>
|
||||
<version>4.7.0-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>JeeSite Parent</name>
|
||||
@@ -22,30 +22,34 @@
|
||||
<properties>
|
||||
|
||||
<!-- common version setting -->
|
||||
<commons-io.version>2.11.0</commons-io.version>
|
||||
<commons-io.version>2.13.0</commons-io.version>
|
||||
<commons-text.version>1.10.0</commons-text.version>
|
||||
<commons-beanutils.version>1.9.4</commons-beanutils.version>
|
||||
<commons-email.version>1.5</commons-email.version>
|
||||
<fst.version>2.57</fst.version>
|
||||
<fastjson.version>1.2.83_noneautotype</fastjson.version>
|
||||
<fastjson.version>2.0.33</fastjson.version>
|
||||
<!-- <jackson.version>2.12.6</jackson.version> -->
|
||||
<!-- <activation.version>1.1.1</activation.version> -->
|
||||
<UserAgentUtils.version>1.21</UserAgentUtils.version>
|
||||
<!-- <metadata-extractor.version>2.11.0</metadata-extractor.version> -->
|
||||
<thumbnailator.version>0.4.17</thumbnailator.version>
|
||||
<twelvemonkeys.version>3.8.2</twelvemonkeys.version>
|
||||
<thumbnailator.version>0.4.19</thumbnailator.version>
|
||||
<twelvemonkeys.version>3.9.3</twelvemonkeys.version>
|
||||
<blade-patchca.version>1.1.2</blade-patchca.version>
|
||||
<jmimemagic.version>0.1.5</jmimemagic.version>
|
||||
<zxing.version>3.4.1</zxing.version>
|
||||
<poi.version>4.1.2</poi.version>
|
||||
<zxing.version>3.5.1</zxing.version>
|
||||
<poi.version>5.2.3</poi.version>
|
||||
<pinyin4j.version>2.5.1</pinyin4j.version>
|
||||
<groovy.version>3.0.10</groovy.version>
|
||||
<groovy.version>3.0.17</groovy.version>
|
||||
<joda-time.version>2.10.4</joda-time.version>
|
||||
<logstash-logback.version>7.3</logstash-logback.version>
|
||||
<elasticsearch.version>7.17.8</elasticsearch.version>
|
||||
<lucene.version>8.11.1</lucene.version>
|
||||
|
||||
<!-- framework version setting -->
|
||||
<mybatis.version>3.5.11</mybatis.version>
|
||||
<mybatis.version>3.5.13</mybatis.version>
|
||||
<mybatis-spring.version>2.0.7</mybatis-spring.version>
|
||||
<jsqlparser.version>4.5</jsqlparser.version>
|
||||
<druid.version>1.2.11</druid.version>
|
||||
<jsqlparser.version>4.6</jsqlparser.version>
|
||||
<druid.version>1.2.18</druid.version>
|
||||
<shiro.version>1.11.0</shiro.version>
|
||||
<j2cache.version>2.8.0-release</j2cache.version>
|
||||
<swagger.version>1.6.6</swagger.version>
|
||||
@@ -130,6 +134,9 @@
|
||||
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
|
||||
</manifest>
|
||||
<addMavenDescriptor>false</addMavenDescriptor>
|
||||
<manifestEntries>
|
||||
<Build-Time>${maven.build.timestamp}</Build-Time>
|
||||
</manifestEntries>
|
||||
</archive>
|
||||
</configuration>
|
||||
<executions>
|
||||
@@ -170,6 +177,9 @@
|
||||
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
|
||||
</manifest>
|
||||
<addMavenDescriptor>false</addMavenDescriptor>
|
||||
<manifestEntries>
|
||||
<Build-Time>${maven.build.timestamp}</Build-Time>
|
||||
</manifestEntries>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
2
pom.xml
2
pom.xml
@@ -5,7 +5,7 @@
|
||||
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite</artifactId>
|
||||
<version>4.6.1-SNAPSHOT</version>
|
||||
<version>4.7.0-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>JeeSite</name>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-root</artifactId>
|
||||
<version>4.6.1-SNAPSHOT</version>
|
||||
<version>4.7.0-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>JeeSite Root</name>
|
||||
|
||||
23
web/pom.xml
23
web/pom.xml
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-parent</artifactId>
|
||||
<version>4.6.1-SNAPSHOT</version>
|
||||
<version>4.7.0-SNAPSHOT</version>
|
||||
<relativePath>../parent/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -46,6 +46,20 @@
|
||||
<artifactId>jeesite-module-swagger</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 内容管理模块 -->
|
||||
<dependency>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-module-cms</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 移动端模块 -->
|
||||
<dependency>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-module-app</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 文件管理共享(标准版)
|
||||
<dependency>
|
||||
@@ -61,13 +75,6 @@
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency> -->
|
||||
|
||||
<!-- 内容管理模块
|
||||
<dependency>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-module-cms</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency> -->
|
||||
|
||||
<!-- Spring Boot Tomcat
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
||||
@@ -38,19 +38,25 @@ public class TestDataService extends CrudService<TestDataDao, TestData> {
|
||||
*/
|
||||
@Override
|
||||
public TestData get(TestData testData) {
|
||||
TestData entity = super.get(testData);
|
||||
if (entity != null){
|
||||
TestDataChild testDataChild = new TestDataChild(entity);
|
||||
return super.get(testData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载子表数据
|
||||
*/
|
||||
public TestData loadChildData(TestData testData) {
|
||||
if (testData != null && !testData.getIsNewRecord()){
|
||||
TestDataChild testDataChild = new TestDataChild(testData);
|
||||
testDataChild.setStatus(TestDataChild.STATUS_NORMAL);
|
||||
entity.setTestDataChildList(testDataChildDao.findList(testDataChild));
|
||||
testData.setTestDataChildList(testDataChildDao.findList(testDataChild));
|
||||
}
|
||||
return entity;
|
||||
return testData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @param page 分页对象
|
||||
* @param testData
|
||||
* @param testData page 分页对象
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
|
||||
@@ -4,11 +4,13 @@
|
||||
*/
|
||||
package com.jeesite.modules.test.web;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.entity.Page;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
import com.jeesite.common.web.BaseController;
|
||||
import com.jeesite.modules.test.entity.TestData;
|
||||
import com.jeesite.modules.test.entity.TestDataChild;
|
||||
import com.jeesite.modules.test.service.TestDataService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
@@ -19,12 +21,9 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.entity.Page;
|
||||
import com.jeesite.common.web.BaseController;
|
||||
import com.jeesite.modules.test.entity.TestData;
|
||||
import com.jeesite.modules.test.entity.TestDataChild;
|
||||
import com.jeesite.modules.test.service.TestDataService;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 测试数据Controller
|
||||
@@ -83,9 +82,10 @@ public class TestDataController extends BaseController {
|
||||
*/
|
||||
@RequiresPermissions("test:testData:view")
|
||||
@RequestMapping(value = "form")
|
||||
public String form(TestData testData, Model model) {
|
||||
public String form(TestData testData, String flag, Model model) {
|
||||
testDataService.loadChildData(testData);
|
||||
model.addAttribute("testData", testData);
|
||||
return "modules/test/testDataForm";
|
||||
return "modules/test/testDataForm"+ StringUtils.defaultString(flag, "");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -8,7 +8,7 @@ productName: JeeSite Demo
|
||||
companyName: ThinkGem
|
||||
|
||||
# 产品版本、版权年份
|
||||
productVersion: V4.6
|
||||
productVersion: V4.7
|
||||
copyrightYear: 2023
|
||||
|
||||
# 是否演示模式
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-sm">查询</button>
|
||||
<button type="reset" class="btn btn-default btn-sm">重置</button>
|
||||
<button type="reset" class="btn btn-default btn-sm isQuick">重置</button>
|
||||
</div>
|
||||
</#form:form>
|
||||
<#form:form id="inputForm" model="${testData}" action="${ctx}/test/testData/save" method="post" class="form-horizontal table-form">
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-sm">查询</button>
|
||||
<button type="reset" class="btn btn-default btn-sm">重置</button>
|
||||
<button type="reset" class="btn btn-default btn-sm isQuick">重置</button>
|
||||
</div>
|
||||
</#form:form>
|
||||
<table id="dataGrid"></table>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
data-order-by="${parameter.orderBy!'post_code desc'}">
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm isQuick">${text('重置')}</button>
|
||||
</div>
|
||||
</#form:form>
|
||||
<table id="dataGrid"></table>
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="button" id="search" class="btn btn-primary btn-sm">${text('查询')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm isQuick">${text('重置')}</button>
|
||||
</div>
|
||||
</#form:form>
|
||||
<table id="dataGrid"></table>
|
||||
|
||||
478
web/src/main/resources/views/modules/test/testDataForm2.html
Normal file
478
web/src/main/resources/views/modules/test/testDataForm2.html
Normal file
@@ -0,0 +1,478 @@
|
||||
<% layout('/layouts/default.html', {title: '数据管理', libs: ['validate','fileupload','dataGrid']}){ %>
|
||||
<div class="main-content">
|
||||
<div class="box box-main">
|
||||
<div class="box-header with-border">
|
||||
<div class="box-title">
|
||||
<i class="fa icon-note"></i> ${text(testData.isNewRecord ? '新增数据' : '编辑数据')}
|
||||
</div>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<#form:form id="inputForm" model="${testData}" action="${ctx}/test/testData/save" method="post" class="form-horizontal">
|
||||
<div class="box-body">
|
||||
<div class="form-unit">${text('基本信息')}</div>
|
||||
<#form:hidden path="id"/>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2" title="">
|
||||
<span class="required hide">*</span> ${text('单行文本')}:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-10">
|
||||
<#form:input path="testInput" maxlength="200" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2" title="">
|
||||
<span class="required hide">*</span> ${text('多行文本')}:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-10">
|
||||
<#form:textarea path="testTextarea" rows="4" maxlength="200" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-4" title="">
|
||||
<span class="required hide">*</span> ${text('下拉框')}:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:select path="testSelect" dictType="sys_menu_type" blankOption="true" class="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-4" title="">
|
||||
<span class="required hide">*</span> ${text('下拉多选')}:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:select path="testSelectMultiple" dictType="sys_menu_type" multiple="true" blankOption="true" class="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-4" title="">
|
||||
<span class="required hide">*</span> ${text('单选框')}:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:radio path="testRadio" dictType="sys_menu_type" class="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-4" title="">
|
||||
<span class="required hide">*</span> ${text('复选框')}:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:checkbox path="testCheckbox" dictType="sys_menu_type" class="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-4" title="">
|
||||
<span class="required hide">*</span> ${text('日期选择')}:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:input path="testDate" readonly="true" maxlength="20" class="form-control laydate"
|
||||
dataFormat="date" data-type="date" data-format="yyyy-MM-dd"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-4" title="">
|
||||
<span class="required hide">*</span> ${text('日期时间')}:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:input path="testDatetime" readonly="true" maxlength="20" class="form-control laydate"
|
||||
dataFormat="datetime" data-type="datetime" data-format="yyyy-MM-dd HH:mm"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-4" title="">
|
||||
<span class="required hide">*</span> ${text('用户选择')}:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:treeselect id="testUser" title="${text('用户选择')}"
|
||||
path="testUser.userCode" labelPath="testUser.userName"
|
||||
url="${ctx}/sys/office/treeData?isLoadUser=true"
|
||||
class="" allowClear="true"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-4" title="">
|
||||
<span class="required hide">*</span> ${text('机构选择')}:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:treeselect id="testOffice" title="${text('机构选择')}"
|
||||
path="testOffice.officeCode" labelPath="testOffice.officeName"
|
||||
url="${ctx}/sys/office/treeData"
|
||||
class="" allowClear="true"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-4" title="">
|
||||
<span class="required hide">*</span> ${text('区域选择')}:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:treeselect id="testAreaCode" title="${text('区域选择')}"
|
||||
path="testAreaCode" labelPath="testAreaName"
|
||||
url="${ctx}/sys/area/treeData"
|
||||
class="" allowClear="true"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2" title="">
|
||||
<span class="required hide">*</span> ${text('备注信息')}:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-10">
|
||||
<#form:textarea path="remarks" rows="4" maxlength="500" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2">${text('图片上传')}:</label>
|
||||
<div class="col-sm-10">
|
||||
<#form:fileupload id="uploadImage" bizKey="${testData.id}" bizType="testData_image"
|
||||
uploadType="image" class="" readonly="false" preview="true"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2">${text('附件上传')}:</label>
|
||||
<div class="col-sm-10">
|
||||
<#form:fileupload id="uploadFile" bizKey="${testData.id}" bizType="testData_file"
|
||||
uploadType="all" class="" readonly="false" preview="true"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="form-unit">${text('子表数据')}</h4>
|
||||
<div class="ml10 mr10 table-form">
|
||||
<table id="testDataChildDataGrid"></table>
|
||||
<% if (hasPermi('test:testData:edit')){ %>
|
||||
<a href="#" id="testDataChildDataGridAddRowBtn" class="btn btn-primary btn-sm mt10 mb10"><i class="fa fa-plus"></i> ${text('增行')}</a>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<div class="row">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<% if (hasPermi('test:testData:edit')){ %>
|
||||
<button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i> ${text('保 存')}</button>
|
||||
<% } %>
|
||||
<button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="js.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> ${text('关 闭')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</#form:form>
|
||||
</div>
|
||||
</div>
|
||||
<% } %>
|
||||
<script id="treeselectTpl" type="text/template">//<!--<div>
|
||||
<#form:treeselect id="{{d.id}}" title="{{d.title}}" name="{{d.name}}" value="{{d.value}}"
|
||||
labelName="{{d.labelName}}" labelValue="{{d.labelValue}}" url="{{d.url}}"
|
||||
class="{{d.cssClass}}" btnClass="btn-sm" allowClear="true" readonly="{{d.readonly}}"/>
|
||||
</div>//--></script>
|
||||
<script id="listselectTpl" type="text/template">//<!--<div>
|
||||
<#form:listselect id="{{d.id}}" title="{{d.title}}" name="{{d.name}}" value="{{d.value}}"
|
||||
labelName="{{d.labelName}}" labelValue="{{d.labelValue}}" url="{{d.url}}"
|
||||
class="{{d.cssClass}}" btnClass="btn-sm" allowClear="true" readonly="{{d.readonly}}"
|
||||
itemCode="{{d.itemCode}}" itemName="{{d.itemName}}"/>
|
||||
</div>//--></script>
|
||||
<script id="fileuploadTpl" type="text/template">//<!--<div>
|
||||
<#form:fileupload id="{{d.id}}" bizKey="{{d.bizKey}}" bizType="{{d.bizType}}" uploadType="all"
|
||||
class="{{d.cssClass}}" isMini="true" preview="true" readonly="{{d.readonly}}"/>
|
||||
</div>//--></script>
|
||||
<script>
|
||||
//初始化测试数据子表DataGrid对象
|
||||
$("#testDataChildDataGrid").dataGrid({
|
||||
|
||||
data: ${toJson(testData.testDataChildList)},
|
||||
datatype: "local", // 设置本地数据
|
||||
autoGridHeight: function(){return 'auto'}, // 设置自动高度
|
||||
|
||||
// 设置数据表格列
|
||||
columnModel: [
|
||||
|
||||
{header:'${text("操作")}', name:'actions', width:40, align:"center", formatter: function(val, obj, row, act){
|
||||
var actions = [];
|
||||
if (val == 'new'){
|
||||
actions.push('<a href="#" onclick="js.confirm(\'${text("你确认要删除这条数据吗?")}\', function(){$(\'#testDataChildDataGrid\').dataGrid(\'delRowData\',\''+obj.rowId+'\')});return false;"><i class="fa fa-trash-o"></i></a> ');
|
||||
}else{
|
||||
actions.push('<a href="#" onclick="js.confirm(\'${text("你确认要删除这条数据吗?")}\', function(){$(\'#testDataChildDataGrid\').dataGrid(\'setRowData\',\''+obj.rowId+'\',null,{display:\'none\'});$(\'#'+obj.rowId+'_status\').val(\''+Global.STATUS_DELETE+'\');});return false;"><i class="fa fa-trash-o"></i></a> ');
|
||||
}
|
||||
//actions.push('<a href="#" onclick="$(\'#testDataChildDataGrid\').dataGrid(\'editRow\',\''+obj.rowId+'\',{keys:true,focusField:true});return false;"><i class="fa fa-pencil"></i></a> ');
|
||||
return actions.join('');
|
||||
}, editoptions: {defaultValue: 'new'}},
|
||||
|
||||
{header:'状态', name:'status', editable:true, hidden:true},
|
||||
{header:'主键', name:'id', editable:true, hidden:true},
|
||||
{header:'${text("排序号")}', name:'testSort', width:100, editable:true, edittype:'text', editoptions:{'maxlength':'11', 'class':'form-control digits'}},
|
||||
{header:'${text("父表主键")}', name:'testData.id', editable:true, hidden:true},
|
||||
{header:'${text("单行文本")}', name:'testInput', width:100, editable:true, edittype:'text', editoptions:{'maxlength':'200', 'class':'form-control'}},
|
||||
{header:'${text("多行文本")}', name:'testTextarea', width:100, editable:true, edittype:'textarea', editoptions:{'maxlength':'200', 'class':'form-control', 'rows':'1'}},
|
||||
{header:'${text("下拉框")}', name:'testSelect', width:100,
|
||||
formatter: function(val, obj, row, act){
|
||||
return js.getDictLabel(obj.colModel.editoptions.items, val, '${text("未知")}', true);
|
||||
},
|
||||
unformat: function(val, obj, cell){
|
||||
return val;
|
||||
},
|
||||
editable:true, edittype:'select', editoptions:{'class':'form-control',
|
||||
items: $.merge([{dictLabel:' ',dictValue:''}], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
||||
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
||||
js.select2(element).on("change",function(){$(this).resetValid()});
|
||||
}
|
||||
}
|
||||
},
|
||||
{header:'${text("下拉多选")}', name:'testSelectMultiple', width:90, fixed: true,
|
||||
formatter: function(val, obj, row, act){
|
||||
return js.getDictLabel(obj.colModel.editoptions.items, val, '${text("未知")}', true);
|
||||
},
|
||||
unformat: function(val, obj, cell){
|
||||
return val;
|
||||
},
|
||||
editable:true, edittype:'select', editoptions:{multiple:true, 'class':'form-control',
|
||||
items: $.merge([], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
||||
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
||||
js.select2(element).on("change",function(){$(this).resetValid()});
|
||||
}
|
||||
}
|
||||
},
|
||||
{header:'${text("单选框")}', name:'testRadio', width:135, fixed: true,
|
||||
formatter: function(val, obj, row, act){
|
||||
return js.getDictLabel(obj.colModel.editoptions.items, val, '${text("未知")}', true);
|
||||
},
|
||||
unformat: function(val, obj, cell){
|
||||
return val;
|
||||
},
|
||||
editable:true, edittype:'radio', editoptions:{'class':'form-control icheck',
|
||||
items: $.merge([], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
||||
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
||||
js.iCheck(element).on("ifChanged",function(){$(this).resetValid()});
|
||||
}
|
||||
}
|
||||
},
|
||||
{header:'${text("复选框")}', name:'testCheckbox', width:135, fixed: true,
|
||||
formatter: function(val, obj, row, act){
|
||||
return js.getDictLabel(${@DictUtils.getDictListJson('sys_menu_type')}, val, '${text("未知")}', true);
|
||||
},
|
||||
unformat: function(val, obj, cell){
|
||||
return val;
|
||||
},
|
||||
editable:true, edittype:'checkbox', editoptions:{'class':'form-control icheck',
|
||||
items: $.merge([], ${@DictUtils.getDictListJson('sys_menu_type')}),
|
||||
itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
|
||||
js.iCheck(element).on("ifChanged",function(){$(this).resetValid()});
|
||||
}
|
||||
}
|
||||
},
|
||||
{header:'${text("日期选择")}', name:'testDate', width:120,
|
||||
formatter:'date', formatoptions:{srcformat:'Y-m-d H:i:s',newformat:'Y-m-d'},
|
||||
editable:true, edittype:'text', editoptions:{'class':'form-control laydate', 'readonly':'true',
|
||||
dataInit: function(element){
|
||||
laydate.render({elem:element, type:'date', format:'yyyy-MM-dd', done: function(){
|
||||
// 选择日期后,自动给下一个输入框赋值(联动实例)
|
||||
// $(element).closest('td').next().find('.form-control').val('2020-11-26 10:10');
|
||||
}});
|
||||
}
|
||||
}
|
||||
},
|
||||
{header:'${text("日期时间")}', name:'testDatetime', width:155,
|
||||
formatter:'date', formatoptions:{srcformat:'Y-m-d H:i:s',newformat:'Y-m-d H:i'},
|
||||
editable:true, edittype:'text', editoptions:{'class':'form-control laydate', 'readonly':'true',
|
||||
dataInit: function(element){
|
||||
laydate.render({elem:element, type:'datetime', format:'yyyy-MM-dd HH:mm'});
|
||||
}
|
||||
}
|
||||
},
|
||||
{header:'${text("用户选择")}', name:'testUser', width:100,
|
||||
formatter: function(val, obj, row, act){
|
||||
return js.val(row, 'testUser.userName');
|
||||
},
|
||||
unformat: function(val, obj, cell){
|
||||
return js.val(obj.colModel.data[obj.rowId], 'userCode')
|
||||
+ '|' + js.val(obj.colModel.data[obj.rowId], 'userName');
|
||||
},
|
||||
editable: true, edittype: "custom", editoptions: {
|
||||
custom_element: function(val, editOptions) {
|
||||
return js.template('treeselectTpl', {
|
||||
id: 'user_'+editOptions.id, title: '用户选择',
|
||||
name: 'testUser.userCode', value: val.split('|')[0],
|
||||
labelName: 'testUser.userName', labelValue: val.split('|')[1],
|
||||
url: '${ctx}/sys/office/treeData?isLoadUser=true', cssClass: '', readonly: false
|
||||
});
|
||||
},
|
||||
custom_value: function(element, act){
|
||||
return {userCode: element.find('[type=hidden]').val(),
|
||||
userName: element.find('[type=text]').val()};
|
||||
},
|
||||
dataInit: function(element){
|
||||
// 初始化控件后设置只读模式(实例)
|
||||
// $(element).find('.form-control, .btn').addClass('disabled');
|
||||
}
|
||||
},
|
||||
},
|
||||
{header:'${text("列表选择")}', name:'testUser2', width:100,
|
||||
formatter: function(val, obj, row, act){
|
||||
obj.colModel.data[obj.rowId] = row.testUser;
|
||||
return js.val(row, 'testUser.userName');
|
||||
},
|
||||
unformat: function(val, obj, cell){
|
||||
return js.val(obj.colModel.data[obj.rowId], 'userCode')
|
||||
+ '|' + js.val(obj.colModel.data[obj.rowId], 'userName');
|
||||
},
|
||||
editable: true, edittype: "custom", editoptions: {
|
||||
custom_element: function(val, editOptions) {
|
||||
return js.template('listselectTpl', {
|
||||
id: 'user_'+editOptions.id, title: '用户选择',
|
||||
name: 'testUser2.userCode', value: val.split('|')[0],
|
||||
labelName: 'testUser2.userName', labelValue: val.split('|')[1],
|
||||
url: '${ctx}/sys/empUser/empUserSelect', cssClass: '', readonly: false,
|
||||
itemCode: 'userCode', itemName: 'userName'
|
||||
});
|
||||
},
|
||||
custom_value: function(element, act){
|
||||
return {userCode2: element.find('[type=hidden]').val(),
|
||||
userName2: element.find('[type=text]').val()};
|
||||
}
|
||||
}
|
||||
},
|
||||
{header:'${text("机构选择")}', name:'testOffice', width:100, title:false,
|
||||
formatter: function(val, obj, row, act){
|
||||
return js.val(row, 'testOffice.officeName');
|
||||
},
|
||||
unformat: function(val, obj, cell){
|
||||
return js.val(obj.colModel.data[obj.rowId], 'officeCode')
|
||||
+ '|' + js.val(obj.colModel.data[obj.rowId], 'officeName');
|
||||
},
|
||||
editable: true, edittype: "custom", editoptions: {
|
||||
custom_element: function(val, editOptions) {
|
||||
return js.template('treeselectTpl', {
|
||||
id: 'office_'+editOptions.id, title: '机构选择',
|
||||
name: 'testOffice.officeCode', value: val.split('|')[0],
|
||||
labelName: 'testOffice.officeName', labelValue: val.split('|')[1],
|
||||
url: '${ctx}/sys/office/treeData?officeTypes=1,2', cssClass: '', readonly: false
|
||||
});
|
||||
},
|
||||
custom_value: function(element, act){
|
||||
return {officeCode: element.find('[type=hidden]').val(),
|
||||
officeName: element.find('[type=text]').val()};
|
||||
}
|
||||
}
|
||||
},
|
||||
{header:'${text("区域选择")}', name:'testAreaCode', width:100,
|
||||
formatter: function(val, obj, row, act){
|
||||
obj.colModel.data[obj.rowId] = {
|
||||
testAreaCode: row.testAreaCode,
|
||||
testAreaName: row.testAreaName
|
||||
};
|
||||
return js.val(row, 'testAreaName');
|
||||
},
|
||||
unformat: function(val, obj, cell){
|
||||
return js.val(obj.colModel.data[obj.rowId], 'testAreaCode')
|
||||
+ '|' + js.val(obj.colModel.data[obj.rowId], 'testAreaName');
|
||||
},
|
||||
editable: true, edittype: "custom", editoptions: {
|
||||
custom_element: function(val, editOptions) {
|
||||
return js.template('treeselectTpl', {
|
||||
id: 'area_'+editOptions.id, title: '区域选择',
|
||||
name: 'testAreaCode', value: val.split('|')[0],
|
||||
labelName: 'testAreaName', labelValue: val.split('|')[1],
|
||||
url: '${ctx}/sys/area/treeData', cssClass: '', readonly: false
|
||||
});
|
||||
},
|
||||
custom_value: function(element, act){
|
||||
return {areaCode: element.find('[type=hidden]').val(),
|
||||
areaName: element.find('[type=text]').val()};
|
||||
}
|
||||
}
|
||||
},
|
||||
{header:'${text("文件上传")}', name:'id', width:200, classes:'editable',
|
||||
formatter: function(val, obj, row, act){
|
||||
return '<button type="button" class="btn btn-xs btn-default uploaderFile" data-val="'
|
||||
+(obj.rowId)+'">查看文件</button>';
|
||||
},
|
||||
editable: true, edittype: "custom", editoptions: {
|
||||
custom_element: function(val, editOptions) {
|
||||
log(val, editOptions)
|
||||
return js.template('fileuploadTpl', {
|
||||
id: 'fileupload_'+editOptions.rowId, bizKey: editOptions.rowId,
|
||||
bizType: 'testDataChild_file', cssClass: '', readonly: false
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
onSelectRow: function(id, stat, e) {
|
||||
if (id && e && !$(e.target).hasClass('btn')){
|
||||
$('#testDataChildDataGrid').dataGrid('editRow', id,{keys:true,focusField:true});
|
||||
}
|
||||
},
|
||||
shrinkToFit: false, // 是否按百分比自动调整列宽
|
||||
|
||||
// 编辑表格参数
|
||||
editGrid: true, // 是否是编辑表格
|
||||
editGridInitRowNum: 1, // 编辑表格的初始化新增行数
|
||||
editGridInitAllRowEdit: false, // 是否初始化就编辑所有行(*** 重点 ***)
|
||||
editGridAddRowBtn: $('#testDataChildDataGridAddRowBtn'), // 子表增行按钮
|
||||
editGridAddRowBtnToHeader: true, // 子表增行按钮是否显示到表头上 v4.1.7
|
||||
editGridAddRowInitData: {id: '', status: Global.STATUS_NORMAL}, // 新增行的时候初始化的数据
|
||||
|
||||
// 编辑表格的提交数据参数
|
||||
editGridInputFormListName: 'testDataChildList', // 提交的数据列表名
|
||||
editGridInputFormListAttrs: 'status,id,testSort,testData.id,testInput,testTextarea,testSelect,testSelectMultiple,'
|
||||
+'testRadio,testCheckbox,testDate,testDatetime,testUser.userCode,testUser.userName,testOffice.officeCode,'
|
||||
+'testOffice.officeName,testAreaCode,testAreaName,testDataChild_file,testDataChild_file__del', // 提交数据列表的属性字段
|
||||
|
||||
// 加载成功后执行事件
|
||||
ajaxSuccess: function(data){
|
||||
// $('#jqgh_testDataChildDataGrid_rn').append('<a href="javascript:" onclick="'
|
||||
// + '$(\'#testDataChildDataGridAddRowBtn\').click();">'
|
||||
// + '<i class="fa fa-plus"></i></a>');
|
||||
}
|
||||
});
|
||||
$('#testDataChildDataGrid').on('click', '.uploaderFile', function(){
|
||||
var val = $(this).data('val'); layer.open({ title: '查看文件',
|
||||
content: '文件列表:' + js.template('fileuploadTpl', {
|
||||
id: 'fileupload_'+val, bizKey: val, bizType: 'testDataChild_file', cssClass: '', readonly: true
|
||||
})
|
||||
});
|
||||
});
|
||||
$("#inputForm").validate({
|
||||
submitHandler: function(form){
|
||||
js.ajaxSubmitForm($(form), function(data){
|
||||
js.showMessage(data.message);
|
||||
if(data.result == Global.TRUE){
|
||||
js.closeCurrentTabPage(function(contentWindow){
|
||||
contentWindow.page();
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@@ -47,7 +47,7 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm isQuick">${text('重置')}</button>
|
||||
<button type="button" class="btn btn-default btn-sm btnFormMore">${text('更多')}<i class="fa fa-angle-double-down"></i></button>
|
||||
</div>
|
||||
<div class="form-more">
|
||||
@@ -123,7 +123,7 @@ $('#dataGrid').dataGrid({
|
||||
searchForm: $("#searchForm"),
|
||||
columnModel: [
|
||||
{header:'${text("单行文本")}', name:'testInput', index:'a.test_input', width:250, align:"left", frozen:true, formatter: function(val, obj, row, act){
|
||||
return '<a href="${ctx}/test/testData/form?id='+row.id+'" class="btnList" data-title="${text("编辑数据")}">'+(val||row.id)+'</a>';
|
||||
return '<a href="${ctx}/test/testData/form?id='+row.id+'&flag=2" class="btnList" data-title="${text("编辑数据")}">'+(val||row.id)+'</a>';
|
||||
}, searchoptions: { dataInit: function (element) {
|
||||
$(element).attr('form', 'searchForm').attr('name', 'testInput2');
|
||||
}}},
|
||||
@@ -150,7 +150,7 @@ $('#dataGrid').dataGrid({
|
||||
return js.getDictLabel(${@DictUtils.getDictListJson('sys_search_status')}, val, '${text("未知")}', true);
|
||||
}},
|
||||
{header:'${text("创建时间")}', name:'createDate', index:'a.create_date', firstsortorder:'desc', width:150, align:"center"},
|
||||
{header:'${text("备注信息")}', name:'remarks', index:'a.remarks', width:150, align:"left"},
|
||||
{header:'${text("备注")}', name:'remarks', index:'a.remarks', width:150, align:"left"},
|
||||
{header:'${text("操作")}', name:'actions', width:100, formatter: function(val, obj, row, act){
|
||||
var actions = [];
|
||||
//<% if(hasPermi('test:testData:edit')){ %>
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm isQuick">${text('重置')}</button>
|
||||
</div>
|
||||
</#form:form>
|
||||
<table id="dataGrid"></table>
|
||||
|
||||
Reference in New Issue
Block a user