Initial commit
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.cwhelp.component</groupId>
|
||||
<artifactId>thymeleaf</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>组件:thymeleaf</name>
|
||||
|
||||
<parent>
|
||||
<groupId>com.cwhelp</groupId>
|
||||
<artifactId>component</artifactId>
|
||||
<version>2.0.1</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.cwhelp</groupId>
|
||||
<artifactId>common</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.cwhelp.modules</groupId>
|
||||
<artifactId>system</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!--thymeleaf视图模板框架-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-thymeleaf</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.cwhelp.component.thymeleaf;
|
||||
|
||||
import com.cwhelp.component.thymeleaf.attribute.SelectDictAttrProcessor;
|
||||
import com.cwhelp.component.thymeleaf.attribute.SelectListAttrProcessor;
|
||||
import org.thymeleaf.dialect.AbstractProcessorDialect;
|
||||
import org.thymeleaf.dialect.IExpressionObjectDialect;
|
||||
import org.thymeleaf.expression.IExpressionObjectFactory;
|
||||
import org.thymeleaf.processor.IProcessor;
|
||||
import org.thymeleaf.standard.StandardDialect;
|
||||
import org.thymeleaf.templatemode.TemplateMode;
|
||||
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author yan.y
|
||||
*/
|
||||
public class TimoDialect extends AbstractProcessorDialect implements IExpressionObjectDialect {
|
||||
|
||||
private static final String NAME = "TimoDialect";
|
||||
private static final String PREFIX = "mo";
|
||||
private IExpressionObjectFactory expressionObjectFactory = null;
|
||||
|
||||
public TimoDialect() {
|
||||
super(NAME, PREFIX, StandardDialect.PROCESSOR_PRECEDENCE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<IProcessor> getProcessors(String dialectPrefix) {
|
||||
LinkedHashSet processors = new LinkedHashSet();
|
||||
processors.add(new SelectDictAttrProcessor(TemplateMode.HTML, dialectPrefix));
|
||||
processors.add(new SelectListAttrProcessor(TemplateMode.HTML, dialectPrefix));
|
||||
return processors;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IExpressionObjectFactory getExpressionObjectFactory() {
|
||||
if (this.expressionObjectFactory == null) {
|
||||
this.expressionObjectFactory = new TimoExpressionObjectFactory();
|
||||
}
|
||||
return this.expressionObjectFactory;
|
||||
}
|
||||
}
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
package com.cwhelp.component.thymeleaf;
|
||||
|
||||
import com.cwhelp.component.thymeleaf.utility.DictUtil;
|
||||
import com.cwhelp.component.thymeleaf.utility.LogUtil;
|
||||
import com.cwhelp.component.thymeleaf.utility.PageUtil;
|
||||
import org.thymeleaf.context.IExpressionContext;
|
||||
import org.thymeleaf.expression.IExpressionObjectFactory;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author yan.y
|
||||
*/
|
||||
public class TimoExpressionObjectFactory implements IExpressionObjectFactory {
|
||||
|
||||
public static final String PAGE_UTIL_NAME = "pageUtil";
|
||||
public static final PageUtil PAGE_UTIL_OBJECT = new PageUtil();
|
||||
public static final String DICT_UTIL_NAME = "dicts";
|
||||
public static final DictUtil DICT_UTIL_OBJECT = new DictUtil();
|
||||
public static final String LOG_UTIL_NAME = "logs";
|
||||
public static final LogUtil LOG_UTIL_OBJECT = new LogUtil();
|
||||
|
||||
@Override
|
||||
public Set<String> getAllExpressionObjectNames() {
|
||||
Set<String> names = Collections.unmodifiableSet(new LinkedHashSet<String>(Arrays.asList(
|
||||
PAGE_UTIL_NAME,
|
||||
DICT_UTIL_NAME,
|
||||
LOG_UTIL_NAME
|
||||
)));
|
||||
return names;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object buildObject(IExpressionContext context, String expressionObjectName) {
|
||||
if(PAGE_UTIL_NAME.equals(expressionObjectName)){
|
||||
return PAGE_UTIL_OBJECT;
|
||||
}
|
||||
if(DICT_UTIL_NAME.equals(expressionObjectName)){
|
||||
return DICT_UTIL_OBJECT;
|
||||
}
|
||||
if(LOG_UTIL_NAME.equals(expressionObjectName)){
|
||||
return LOG_UTIL_OBJECT;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCacheable(String expressionObjectName) {
|
||||
return expressionObjectName != null;
|
||||
}
|
||||
}
|
||||
+120
@@ -0,0 +1,120 @@
|
||||
package com.cwhelp.component.thymeleaf.attribute;
|
||||
|
||||
import com.cwhelp.component.thymeleaf.utility.DictUtil;
|
||||
import org.thymeleaf.IEngineConfiguration;
|
||||
import org.thymeleaf.context.ITemplateContext;
|
||||
import org.thymeleaf.engine.AttributeName;
|
||||
import org.thymeleaf.model.IProcessableElementTag;
|
||||
import org.thymeleaf.postprocessor.IPostProcessor;
|
||||
import org.thymeleaf.processor.element.AbstractAttributeTagProcessor;
|
||||
import org.thymeleaf.processor.element.IElementTagStructureHandler;
|
||||
import org.thymeleaf.standard.expression.*;
|
||||
import org.thymeleaf.templatemode.TemplateMode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 根据字典标识生成下拉列表
|
||||
* @author yan.y
|
||||
*/
|
||||
public class SelectDictAttrProcessor extends AbstractAttributeTagProcessor {
|
||||
|
||||
public static final int PRECEDENCE = 1400;
|
||||
public static final String ATTR_NAME = "dict";
|
||||
public static final String SELECTED_ATTR_NAME= "mo-selected";
|
||||
public static final String EMPTY_ATTR_NAME= "mo-empty";
|
||||
|
||||
public SelectDictAttrProcessor(final TemplateMode templateMode, final String dialectPrefix) {
|
||||
super(templateMode, dialectPrefix, null, false, ATTR_NAME, true, PRECEDENCE, true);
|
||||
}
|
||||
|
||||
public SelectDictAttrProcessor(final TemplateMode templateMode, final String dialectPrefix, String attr_name, int precedence) {
|
||||
super(templateMode, dialectPrefix, null, false, attr_name, true, precedence, true);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void doProcess(
|
||||
final ITemplateContext context,
|
||||
final IProcessableElementTag tag,
|
||||
final AttributeName attributeName,
|
||||
final String attributeValue,
|
||||
final IElementTagStructureHandler structureHandler) {
|
||||
|
||||
// 如果属性值为空或者标签不为select,则不处理
|
||||
String elementName = tag.getElementCompleteName();
|
||||
if(attributeValue.isEmpty() || !elementName.equals("select")) return;
|
||||
|
||||
// 获取列表对象,空则不处理
|
||||
Map<String, String> valueList = DictUtil.value(attributeValue);
|
||||
if(valueList != null && valueList.size() > 0) {
|
||||
doProcess(context, tag, attributeName, attributeValue, structureHandler, valueList);
|
||||
};
|
||||
}
|
||||
|
||||
protected void doProcess(
|
||||
final ITemplateContext context,
|
||||
final IProcessableElementTag tag,
|
||||
final AttributeName attributeName,
|
||||
final String attributeValue,
|
||||
final IElementTagStructureHandler structureHandler,
|
||||
Map<String, String> valueList) {
|
||||
|
||||
// 获取默认选中值
|
||||
String attributeSelectedValue = tag.getAttributeValue(SELECTED_ATTR_NAME);
|
||||
Object selectedValue = null;
|
||||
final IEngineConfiguration configuration = context.getConfiguration();
|
||||
if (attributeSelectedValue != null && !attributeSelectedValue.isEmpty()){
|
||||
final IStandardExpressionParser expressionParser = StandardExpressions.getExpressionParser(configuration);
|
||||
final IStandardExpression expression = expressionParser.parseExpression(context, attributeSelectedValue);
|
||||
final Object expressionResult;
|
||||
if (expression != null && expression instanceof FragmentExpression) {
|
||||
final FragmentExpression.ExecutedFragmentExpression executedFragmentExpression =
|
||||
FragmentExpression.createExecutedFragmentExpression(context, (FragmentExpression) expression);
|
||||
expressionResult =
|
||||
FragmentExpression.resolveExecutedFragmentExpression(context, executedFragmentExpression, true);
|
||||
} else {
|
||||
expressionResult = expression.execute(context, StandardExpressionExecutionContext.NORMAL);
|
||||
}
|
||||
if (expressionResult == NoOpToken.VALUE) {
|
||||
return;
|
||||
}
|
||||
selectedValue = (expressionResult == null ? "" : expressionResult);
|
||||
}
|
||||
|
||||
// 拼装下拉列表选项
|
||||
List<String> keyList = new ArrayList<>();
|
||||
if (selectedValue instanceof List){
|
||||
((List) selectedValue).forEach(item -> keyList.add(String.valueOf(item)));
|
||||
}else {
|
||||
keyList.add(selectedValue == null ? "" : selectedValue.toString());
|
||||
}
|
||||
StringBuilder optionContent = new StringBuilder();
|
||||
valueList.forEach((key, val) -> {
|
||||
optionContent.append("<option value = '").append(key);
|
||||
if(keyList.contains(String.valueOf(key))){
|
||||
optionContent.append("' ").append("selected='selected");
|
||||
}
|
||||
optionContent.append("'>").append(val).append("</option>");
|
||||
});
|
||||
|
||||
// 判断是添加空值选项
|
||||
String attributeEmptyValue = tag.getAttributeValue(EMPTY_ATTR_NAME);
|
||||
if(attributeEmptyValue != null){
|
||||
String emptyStr = "<option value=''>" + attributeEmptyValue + "</option>";
|
||||
optionContent.insert(0, emptyStr);
|
||||
}
|
||||
|
||||
// 返回新的HTML节点
|
||||
final Set<IPostProcessor> postProcessors = configuration.getPostProcessors(getTemplateMode());
|
||||
if (postProcessors.isEmpty()) {
|
||||
structureHandler.removeAttribute(SELECTED_ATTR_NAME);
|
||||
structureHandler.removeAttribute(EMPTY_ATTR_NAME);
|
||||
structureHandler.setBody(optionContent, false);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+86
@@ -0,0 +1,86 @@
|
||||
package com.cwhelp.component.thymeleaf.attribute;
|
||||
|
||||
import org.thymeleaf.IEngineConfiguration;
|
||||
import org.thymeleaf.context.ITemplateContext;
|
||||
import org.thymeleaf.engine.AttributeName;
|
||||
import org.thymeleaf.model.IProcessableElementTag;
|
||||
import org.thymeleaf.processor.element.IElementTagStructureHandler;
|
||||
import org.thymeleaf.standard.expression.*;
|
||||
import org.thymeleaf.templatemode.TemplateMode;
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 自定义下拉列表生成标签
|
||||
* @author yan.y
|
||||
*/
|
||||
public class SelectListAttrProcessor extends SelectDictAttrProcessor {
|
||||
|
||||
public static final int PRECEDENCE = 1400;
|
||||
public static final String ATTR_NAME = "list";
|
||||
|
||||
public SelectListAttrProcessor(final TemplateMode templateMode, final String dialectPrefix) {
|
||||
super(templateMode, dialectPrefix, ATTR_NAME, PRECEDENCE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doProcess(
|
||||
final ITemplateContext context,
|
||||
final IProcessableElementTag tag,
|
||||
final AttributeName attributeName,
|
||||
final String attributeValue,
|
||||
final IElementTagStructureHandler structureHandler) {
|
||||
|
||||
// 如果属性值为空或者标签不为select。则不处理
|
||||
String elementName = tag.getElementCompleteName();
|
||||
if (attributeValue.isEmpty() || !elementName.equals("select")) return;
|
||||
|
||||
// 获取列表对象
|
||||
final IEngineConfiguration configuration = context.getConfiguration();
|
||||
final IStandardExpressionParser expressionParser = StandardExpressions.getExpressionParser(configuration);
|
||||
final IStandardExpression expression = expressionParser.parseExpression(context, attributeValue);
|
||||
Object expressionResult;
|
||||
if (expression != null && expression instanceof FragmentExpression) {
|
||||
final FragmentExpression.ExecutedFragmentExpression executedFragmentExpression =
|
||||
FragmentExpression.createExecutedFragmentExpression(context, (FragmentExpression) expression);
|
||||
expressionResult =
|
||||
FragmentExpression.resolveExecutedFragmentExpression(context, executedFragmentExpression, true);
|
||||
} else {
|
||||
expressionResult = expression.execute(context, StandardExpressionExecutionContext.RESTRICTED);
|
||||
if (expressionResult == NoOpToken.VALUE) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 转换列表对象
|
||||
Map<String, String> valueList = new LinkedHashMap<>();
|
||||
if(expressionResult.getClass().isArray()){
|
||||
// 转换数组
|
||||
int length = Array.getLength(expressionResult);
|
||||
for (int i = 0; i < length; i++) {
|
||||
String value = String.valueOf(Array.get(expressionResult, i));
|
||||
valueList.put(value, value);
|
||||
}
|
||||
}else if(expressionResult instanceof Collection){
|
||||
// 装换Collection集合
|
||||
Collection list = (Collection) expressionResult;
|
||||
list.forEach(item -> {
|
||||
valueList.put(String.valueOf(item), String.valueOf(item));
|
||||
});
|
||||
}else if(expressionResult instanceof Map){
|
||||
// 装换Map集合
|
||||
Map list = (Map) expressionResult;
|
||||
list.forEach((key, item) -> {
|
||||
valueList.put(String.valueOf(key), String.valueOf(item));
|
||||
});
|
||||
}
|
||||
|
||||
if (valueList.size() > 0) {
|
||||
doProcess(context, tag, attributeName, attributeValue, structureHandler, valueList);
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.cwhelp.component.thymeleaf.config;
|
||||
|
||||
import com.cwhelp.component.thymeleaf.TimoDialect;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* @author yan.y
|
||||
*/
|
||||
@Configuration
|
||||
public class ThymeleafConfig {
|
||||
|
||||
/**
|
||||
* 配置自定义的CusDialect,用于整合thymeleaf模板
|
||||
*/
|
||||
@Bean
|
||||
public TimoDialect getTimoDialect(){
|
||||
return new TimoDialect();
|
||||
}
|
||||
}
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
package com.cwhelp.component.thymeleaf.utility;
|
||||
|
||||
import com.cwhelp.common.utils.EhCacheUtil;
|
||||
import com.cwhelp.modules.system.domain.Dict;
|
||||
import com.cwhelp.modules.system.service.DictService;
|
||||
import com.cwhelp.common.utils.SpringContextUtil;
|
||||
import net.sf.ehcache.Cache;
|
||||
import net.sf.ehcache.Element;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 字典提取工具对象
|
||||
* @author yan.y
|
||||
*/
|
||||
public class DictUtil {
|
||||
|
||||
private static Cache dictCache = EhCacheUtil.getDictCache();
|
||||
|
||||
/**
|
||||
* 获取字典值集合
|
||||
* @param label 字典标识
|
||||
*/
|
||||
public static Map<String, String> value(String label){
|
||||
Map<String, String> value = null;
|
||||
Element dictEle = dictCache.get(label);
|
||||
if(dictEle != null){
|
||||
value = (Map<String, String>) dictEle.getObjectValue();
|
||||
}else {
|
||||
DictService dictService = SpringContextUtil.getBean(DictService.class);
|
||||
Dict dict = dictService.getByNameOk(label);
|
||||
if(dict != null){
|
||||
String dictValue = dict.getValue();
|
||||
String[] outerSplit = dictValue.split(",");
|
||||
value = new LinkedHashMap<>();
|
||||
for (String osp : outerSplit) {
|
||||
String[] split = osp.split(":");
|
||||
if(split.length > 1){
|
||||
value.put(split[0], split[1]);
|
||||
}
|
||||
}
|
||||
dictCache.put(new Element(dict.getName(), value));
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据选项编码获取选项值
|
||||
* @param label 字典标识
|
||||
* @param code 选项编码
|
||||
*/
|
||||
public static String keyValue(String label, String code){
|
||||
Map<String, String> list = DictUtil.value(label);
|
||||
if(list != null){
|
||||
return list.get(code);
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 封装数据状态字典
|
||||
* @param status 状态
|
||||
*/
|
||||
public static String dataStatus(Byte status){
|
||||
String label = "DATA_STATUS";
|
||||
return DictUtil.keyValue(label, String.valueOf(status));
|
||||
}
|
||||
|
||||
/**
|
||||
* 清除缓存中指定的数据
|
||||
* @param label 字典标识
|
||||
*/
|
||||
public static void clearCache(String label){
|
||||
Element dictEle = dictCache.get(label);
|
||||
if (dictEle != null){
|
||||
dictCache.remove(label);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.cwhelp.component.thymeleaf.utility;
|
||||
|
||||
import com.cwhelp.common.utils.EntityBeanUtil;
|
||||
import com.cwhelp.common.utils.SpringContextUtil;
|
||||
import com.cwhelp.modules.system.domain.ActionLog;
|
||||
import com.cwhelp.modules.system.service.ActionLogService;
|
||||
|
||||
import javax.persistence.Table;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author yan.y
|
||||
*/
|
||||
public class LogUtil {
|
||||
|
||||
/**
|
||||
* 获取实体对象的日志
|
||||
* @param entity 实体对象
|
||||
*/
|
||||
public List<ActionLog> entityList(Object entity){
|
||||
ActionLogService actionLogService = SpringContextUtil.getBean(ActionLogService.class);
|
||||
Table table = entity.getClass().getAnnotation(Table.class);
|
||||
String tableName = table.name();
|
||||
try {
|
||||
Object object = EntityBeanUtil.getField(entity, "id");
|
||||
Long entityId = Long.valueOf(String.valueOf(object));
|
||||
return actionLogService.getDataLogList(tableName, entityId);
|
||||
} catch (InvocationTargetException | IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
package com.cwhelp.component.thymeleaf.utility;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 分类显示辅助工具对象
|
||||
* @author yan.y
|
||||
*/
|
||||
public class PageUtil {
|
||||
|
||||
private String paramHref;
|
||||
|
||||
public boolean pageInit(Page page, HttpServletRequest request){
|
||||
if (page.getTotalElements() > page.getSize() && page.getNumberOfElements() != 0){
|
||||
|
||||
// 获取分页参数地址
|
||||
String servletPath = request.getServletPath();
|
||||
StringBuffer param = new StringBuffer(servletPath + "?");
|
||||
Enumeration em = request.getParameterNames();
|
||||
while (em.hasMoreElements()) {
|
||||
String name = (String) em.nextElement();
|
||||
if(!name.equals("page")){
|
||||
String value = request.getParameter(name);
|
||||
param.append(name + "=" + value + "&");
|
||||
}
|
||||
}
|
||||
this.paramHref = param.toString();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public List<String> pageCode(Page page){
|
||||
int number = page.getNumber()+1;
|
||||
int totalPages = page.getTotalPages();
|
||||
int start = 0;
|
||||
int length = 7;
|
||||
int half = length % 2 == 0 ? length / 2 : length / 2 + 1;
|
||||
List<String> codeList = new ArrayList<>();
|
||||
|
||||
if(totalPages > length && number > half){
|
||||
start = number - half;
|
||||
}
|
||||
if(totalPages > length && number > totalPages - half){
|
||||
start = totalPages - length;
|
||||
}
|
||||
for (int i=1; i <= (totalPages > length ? length : totalPages); i++){
|
||||
codeList.add(String.valueOf( i + start));
|
||||
}
|
||||
if(totalPages > length && number > half){
|
||||
codeList.set(0, "1");
|
||||
codeList.set(1, "…");
|
||||
}
|
||||
if(totalPages > length && number < totalPages - (half-1)){
|
||||
codeList.set(length-2, "…");
|
||||
codeList.set(length-1, String.valueOf(totalPages));
|
||||
}
|
||||
return codeList;
|
||||
}
|
||||
|
||||
public String pageActive(Page page, String pageCode, String className){
|
||||
int number = page.getNumber();
|
||||
if(!pageCode.equals("…")){
|
||||
if(number == Integer.valueOf(pageCode) - 1){
|
||||
return " "+className;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public boolean isPrevious(Page page){
|
||||
return page.getNumber() != 0;
|
||||
}
|
||||
|
||||
public boolean isNext(Page page){
|
||||
return page.getNumber() != page.getTotalPages() - 1;
|
||||
}
|
||||
|
||||
public boolean isCode(String pageCode){
|
||||
return pageCode.equals("…");
|
||||
}
|
||||
|
||||
public String pageHref(String pageCode){
|
||||
return paramHref + "page=" + pageCode;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
|
||||
~ Licensed to the Apache Software Foundation (ASF) under one
|
||||
~ or more contributor license agreements. See the NOTICE file
|
||||
~ distributed with this work for additional information
|
||||
~ regarding copyright ownership. The ASF licenses this file
|
||||
~ to you under the Apache License, Version 2.0 (the
|
||||
~ "License"); you may not use this file except in compliance
|
||||
~ with the License. You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing,
|
||||
~ software distributed under the License is distributed on an
|
||||
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
~ KIND, either express or implied. See the License for the
|
||||
~ specific language governing permissions and limitations
|
||||
~ under the License.
|
||||
-->
|
||||
<dialect
|
||||
xmlns="http://www.thymeleaf.org/extras/dialect"
|
||||
prefix="mo"
|
||||
namespace-uri="https://gitee.com/aun/Timo"
|
||||
class="com.cwhelp.component.thymeleaf.TimoDialect">
|
||||
|
||||
<!-- 自定义属性标签 -->
|
||||
<attribute-processor name="list"
|
||||
class="com.cwhelp.component.thymeleaf.attribute.SelectListAttrProcessor">
|
||||
<documentation><![CDATA[
|
||||
自定义下拉列表生成标签,值可以为数组和集合!
|
||||
mo-selected属性:默认选择的值
|
||||
mo-empty属性:添加无值下拉选项,值为显示内容
|
||||
]]></documentation>
|
||||
</attribute-processor>
|
||||
<attribute-processor name="dict"
|
||||
class="com.cwhelp.component.thymeleaf.attribute.SelectDictAttrProcessor">
|
||||
<documentation><![CDATA[
|
||||
根据字典标识生成下拉列表,值可以为数组和集合!
|
||||
mo-selected属性:默认选择的值
|
||||
mo-empty属性:添加无值下拉选项,值为显示内容
|
||||
]]></documentation>
|
||||
</attribute-processor>
|
||||
|
||||
<!-- 自定义对象工具 -->
|
||||
<expression-object name="pageUtil" class="com.cwhelp.component.thymeleaf.utility.PageUtil"/>
|
||||
<expression-object name="dicts" class="com.cwhelp.component.thymeleaf.utility.DictUtil"/>
|
||||
|
||||
|
||||
</dialect>
|
||||
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -0,0 +1,124 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="Spring" name="Spring">
|
||||
<configuration />
|
||||
</facet>
|
||||
<facet type="web" name="Web">
|
||||
<configuration>
|
||||
<webroots />
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
||||
<output url="file://$MODULE_DIR$/target/classes" />
|
||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="common" />
|
||||
<orderEntry type="module" module-name="system" />
|
||||
<orderEntry type="module" module-name="excel" />
|
||||
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml:4.0.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.poi:poi:4.0.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml-schemas:4.0.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.xmlbeans:xmlbeans:3.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-compress:1.18" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.virtuald:curvesapi:1.04" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-thymeleaf:2.1.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.1.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.1.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.11.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.11.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.26" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.annotation:javax.annotation-api:1.3.2" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.yaml:snakeyaml:1.23" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.thymeleaf:thymeleaf-spring5:3.0.11.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.thymeleaf:thymeleaf:3.0.11.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.attoparser:attoparser:2.0.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.unbescape:unbescape:1.1.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.thymeleaf.extras:thymeleaf-extras-java8time:3.0.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.1.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.1.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.9.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.9.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.9.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.9.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.1.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.17" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:9.0.17" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.17" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.hibernate.validator:hibernate-validator:6.0.16.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.validation:validation-api:2.0.1.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.3.2.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.4.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.1.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.1.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.1.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.1.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.1.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.1.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-jpa:2.1.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-aop:2.1.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.1.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.2.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.1.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.transaction:javax.transaction-api:1.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.xml.bind:jaxb-api:2.3.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.activation:javax.activation-api:1.2.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.hibernate:hibernate-core:5.3.9.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.persistence:javax.persistence-api:2.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.javassist:javassist:3.23.1-GA" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.9.12" level="project" />
|
||||
<orderEntry type="library" name="Maven: antlr:antlr:2.7.7" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jboss:jandex:2.0.5.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.dom4j:dom4j:2.1.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.hibernate.common:hibernate-commons-annotations:5.0.4.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-jpa:2.1.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-commons:2.1.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-orm:5.1.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.1.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-aspects:5.1.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-configuration-processor:2.1.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-cache:2.1.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.1.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.springframework.boot:spring-boot-devtools:2.1.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.1.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.1.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:2.1.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test:2.1.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test-autoconfigure:2.1.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: com.jayway.jsonpath:json-path:2.4.0" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:json-smart:2.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:accessors-smart:1.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.ow2.asm:asm:5.0.4" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.assertj:assertj-core:3.11.1" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:2.23.4" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy-agent:1.9.12" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:2.6" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-library:1.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.5.0" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: com.vaadin.external.google:android-json:0.0.20131108.vaadin1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.1.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.1.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:5.1.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.xmlunit:xmlunit-core:2.6.2" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: mysql:mysql-connector-java:5.1.46" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.projectlombok:lombok:1.18.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.sf.ehcache:ehcache:2.10.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.26" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jsoup:jsoup:1.11.3" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
Reference in New Issue
Block a user