mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2025-12-08 17:12:28 +08:00
JeecgBoot 2.4.2 积木报表版本发布,基于SpringBoot的低代码平台
This commit is contained in:
@ -10,6 +10,6 @@ WORKDIR /jeecg-boot
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
ADD ./target/jeecg-boot-module-system-2.4.0.jar ./
|
||||
ADD ./target/jeecg-boot-module-system-2.4.2.jar ./
|
||||
|
||||
CMD sleep 60;java -Djava.security.egd=file:/dev/./urandom -jar jeecg-boot-module-system-2.4.0.jar
|
||||
CMD sleep 60;java -Djava.security.egd=file:/dev/./urandom -jar jeecg-boot-module-system-2.4.2.jar
|
||||
@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<artifactId>jeecg-boot-parent</artifactId>
|
||||
<version>2.4.0</version>
|
||||
<version>2.4.2</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@ -34,13 +34,27 @@
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<artifactId>jeecg-system-local-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<artifactId>jeecg-boot-starter-redis</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<artifactId>jeecg-boot-module-demo</artifactId>
|
||||
<version>${jeecgboot.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- 积木报表 -->
|
||||
<dependency>
|
||||
<groupId>com.jimureport</groupId>
|
||||
<artifactId>spring-boot-starter-jimureport</artifactId>
|
||||
<version>1.1.08-beta</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>autopoi-web</artifactId>
|
||||
<groupId>org.jeecgframework</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
@ -49,7 +63,7 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<!--微服务模式下修改为 true,跳过此打包插件,否则微服务模块无法引用-->
|
||||
<!--微服务模式下修改为true,跳过此打包插件,否则微服务模块无法引用-->
|
||||
<skip>false</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
@ -2,13 +2,11 @@ package org.jeecg;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.catalina.Context;
|
||||
import org.apache.catalina.connector.Connector;
|
||||
import org.apache.tomcat.util.scan.StandardJarScanner;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.boot.web.embedded.tomcat.TomcatConnectorCustomizer;
|
||||
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
|
||||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
@ -19,7 +17,7 @@ import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
|
||||
/**
|
||||
* 单体启动类(采用此类启动项目为单体模式)
|
||||
* 单体启动类(采用此类启动为单体模式)
|
||||
*/
|
||||
@Slf4j
|
||||
@SpringBootApplication
|
||||
@ -50,22 +48,16 @@ public class JeecgSystemApplication extends SpringBootServletInitializer {
|
||||
*/
|
||||
@Bean
|
||||
public TomcatServletWebServerFactory tomcatFactory() {
|
||||
|
||||
TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory(){
|
||||
TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory() {
|
||||
@Override
|
||||
protected void postProcessContext(Context context) {
|
||||
((StandardJarScanner) context.getJarScanner()).setScanManifest(false);
|
||||
}
|
||||
};
|
||||
|
||||
factory.addConnectorCustomizers(new TomcatConnectorCustomizer() {
|
||||
@Override
|
||||
public void customize(Connector connector) {
|
||||
connector.setProperty("relaxedPathChars", "\"<>[\\]^`{|}");
|
||||
connector.setProperty("relaxedQueryChars", "\"<>[\\]^`{|}");
|
||||
}
|
||||
factory.addConnectorCustomizers(connector -> {
|
||||
connector.setProperty("relaxedPathChars", "[]{}");
|
||||
connector.setProperty("relaxedQueryChars", "[]{}");
|
||||
});
|
||||
|
||||
return factory;
|
||||
}
|
||||
}
|
||||
@ -1,11 +1,13 @@
|
||||
package org.jeecg.modules.init;
|
||||
package org.jeecg.config.init;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.constant.CacheConstant;
|
||||
import org.jeecg.config.JeecgCloudCondition;
|
||||
import org.jeecg.modules.system.service.ISysGatewayRouteService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.context.event.ApplicationReadyEvent;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.context.annotation.Conditional;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@ -15,6 +17,7 @@ import org.springframework.stereotype.Component;
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
@Conditional(JeecgCloudCondition.class)
|
||||
public class SystemInitListener implements ApplicationListener<ApplicationReadyEvent>, Ordered {
|
||||
|
||||
|
||||
@ -24,7 +27,7 @@ public class SystemInitListener implements ApplicationListener<ApplicationReadyE
|
||||
@Override
|
||||
public void onApplicationEvent(ApplicationReadyEvent applicationReadyEvent) {
|
||||
|
||||
log.info(" 服务已启动,准备初始化路由配置 ###################");
|
||||
log.info(" 服务已启动,初始化路由配置 ###################");
|
||||
if (applicationReadyEvent.getApplicationContext().getDisplayName().indexOf("AnnotationConfigServletWebServerApplicationContext") > -1) {
|
||||
sysGatewayRouteService.addRoute2Redis(CacheConstant.GATEWAY_ROUTES);
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
package org.jeecg.config.jimureport;
|
||||
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.jeecg.common.system.util.JwtUtil;
|
||||
import org.jeecg.common.util.RedisUtil;
|
||||
import org.jeecg.common.util.TokenUtils;
|
||||
import org.jeecg.modules.jmreport.api.JmReportTokenServiceI;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* 自定义积木报表鉴权实现类(如果不进行自定义,则所有请求不做权限控制)
|
||||
* 1.自定义获取登录token
|
||||
* 2.自定义获取登录用户
|
||||
*/
|
||||
@Component
|
||||
class JimuReportTokenService implements JmReportTokenServiceI {
|
||||
@Autowired
|
||||
private ISysBaseAPI sysBaseAPI;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
@Override
|
||||
public String getToken(HttpServletRequest request) {
|
||||
return TokenUtils.getTokenByRequest(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUsername(String token) {
|
||||
return JwtUtil.getUsername(token);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean verifyToken(String token) {
|
||||
return TokenUtils.verifyToken(token, sysBaseAPI, redisUtil);
|
||||
}
|
||||
}
|
||||
@ -482,7 +482,17 @@ public class SystemAPIController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 37根据多个部门编码(逗号分隔),查询返回多个部门信息
|
||||
* 37根据多个用户id(逗号分隔),查询返回多个用户信息
|
||||
* @param usernames
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/queryUsersByIds")
|
||||
List<JSONObject> queryUsersByIds(String ids){
|
||||
return this.sysBaseAPI.queryUsersByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 38根据多个部门编码(逗号分隔),查询返回多个部门信息
|
||||
* @param orgCodes
|
||||
* @return
|
||||
*/
|
||||
@ -490,4 +500,25 @@ public class SystemAPIController {
|
||||
List<JSONObject> queryDepartsByOrgcodes(String orgCodes){
|
||||
return this.sysBaseAPI.queryDepartsByOrgcodes(orgCodes);
|
||||
}
|
||||
|
||||
/**
|
||||
* 39根据多个部门ID(逗号分隔),查询返回多个部门信息
|
||||
* @param orgCodes
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/queryDepartsByIds")
|
||||
List<JSONObject> queryDepartsByIds(String orgCodes){
|
||||
return this.sysBaseAPI.queryDepartsByIds(orgCodes);
|
||||
}
|
||||
|
||||
/**
|
||||
* 40发送邮件消息
|
||||
* @param email
|
||||
* @param title
|
||||
* @param content
|
||||
*/
|
||||
@GetMapping("/sendEmailMsg")
|
||||
public void sendEmailMsg(String email,String title,String content){
|
||||
this.sysBaseAPI.sendEmailMsg(email,title,content);
|
||||
};
|
||||
}
|
||||
|
||||
@ -0,0 +1,29 @@
|
||||
package org.jeecg.modules.message.websocket;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import org.jeecg.boot.starter.redis.listener.JeecgRedisListerer;
|
||||
import org.jeecg.common.base.BaseMap;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 监听消息(采用redis发布订阅方式发送消息)
|
||||
*/
|
||||
@Component
|
||||
public class SocketHandler implements JeecgRedisListerer {
|
||||
|
||||
@Autowired
|
||||
private WebSocket webSocket;
|
||||
|
||||
@Override
|
||||
public void onMessage(BaseMap map) {
|
||||
String userId = map.get("userId");
|
||||
String message = map.get("message");
|
||||
if (ObjectUtil.isNotEmpty(userId)) {
|
||||
webSocket.pushMessage(userId, message);
|
||||
} else {
|
||||
webSocket.pushMessage(message);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -25,7 +25,7 @@ public class TestSocketController {
|
||||
obj.put(WebsocketConst.MSG_CMD, WebsocketConst.CMD_TOPIC);
|
||||
obj.put(WebsocketConst.MSG_ID, "M0001");
|
||||
obj.put(WebsocketConst.MSG_TXT, message);
|
||||
webSocket.sendAllMessage(obj.toJSONString());
|
||||
webSocket.sendMessage(obj.toJSONString());
|
||||
result.setResult("群发!");
|
||||
return result;
|
||||
}
|
||||
@ -40,7 +40,7 @@ public class TestSocketController {
|
||||
obj.put(WebsocketConst.MSG_USER_ID, userId);
|
||||
obj.put(WebsocketConst.MSG_ID, "M0001");
|
||||
obj.put(WebsocketConst.MSG_TXT, message);
|
||||
webSocket.sendOneMessage(userId, obj.toJSONString());
|
||||
webSocket.sendMessage(userId, obj.toJSONString());
|
||||
result.setResult("单发");
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
package org.jeecg.modules.message.websocket;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.websocket.OnClose;
|
||||
import javax.websocket.OnMessage;
|
||||
import javax.websocket.OnOpen;
|
||||
@ -11,6 +13,10 @@ import javax.websocket.Session;
|
||||
import javax.websocket.server.PathParam;
|
||||
import javax.websocket.server.ServerEndpoint;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import org.jeecg.boot.starter.redis.client.JeecgRedisClient;
|
||||
import org.jeecg.boot.starter.redis.listener.JeecgRedisListerer;
|
||||
import org.jeecg.common.base.BaseMap;
|
||||
import org.jeecg.common.constant.WebsocketConst;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@ -27,83 +33,121 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@Slf4j
|
||||
@ServerEndpoint("/websocket/{userId}") //此注解相当于设置访问URL
|
||||
public class WebSocket {
|
||||
|
||||
|
||||
private Session session;
|
||||
|
||||
private static CopyOnWriteArraySet<WebSocket> webSockets =new CopyOnWriteArraySet<>();
|
||||
private static Map<String,Session> sessionPool = new HashMap<String,Session>();
|
||||
|
||||
|
||||
private String userId;
|
||||
|
||||
private static final String REDIS_TOPIC_NAME = "socketHandler";
|
||||
|
||||
@Resource
|
||||
private JeecgRedisClient jeecgRedisClient;
|
||||
|
||||
private static CopyOnWriteArraySet<WebSocket> webSockets = new CopyOnWriteArraySet<>();
|
||||
private static Map<String, Session> sessionPool = new HashMap<String, Session>();
|
||||
|
||||
|
||||
@OnOpen
|
||||
public void onOpen(Session session, @PathParam(value="userId")String userId) {
|
||||
public void onOpen(Session session, @PathParam(value = "userId") String userId) {
|
||||
try {
|
||||
this.session = session;
|
||||
webSockets.add(this);
|
||||
sessionPool.put(userId, session);
|
||||
log.info("【websocket消息】有新的连接,总数为:"+webSockets.size());
|
||||
} catch (Exception e) {
|
||||
}
|
||||
this.session = session;
|
||||
this.userId = userId;
|
||||
webSockets.add(this);
|
||||
sessionPool.put(userId, session);
|
||||
log.info("【websocket消息】有新的连接,总数为:" + webSockets.size());
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@OnClose
|
||||
public void onClose() {
|
||||
try {
|
||||
webSockets.remove(this);
|
||||
log.info("【websocket消息】连接断开,总数为:"+webSockets.size());
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
|
||||
@OnMessage
|
||||
public void onMessage(String message) {
|
||||
//todo 现在有个定时任务刷,应该去掉
|
||||
log.debug("【websocket消息】收到客户端消息:"+message);
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put(WebsocketConst.MSG_CMD, WebsocketConst.CMD_CHECK);//业务类型
|
||||
obj.put(WebsocketConst.MSG_TXT, "心跳响应");//消息内容
|
||||
session.getAsyncRemote().sendText(obj.toJSONString());
|
||||
}
|
||||
|
||||
// 此为广播消息
|
||||
public void sendAllMessage(String message) {
|
||||
log.info("【websocket消息】广播消息:"+message);
|
||||
for(WebSocket webSocket : webSockets) {
|
||||
try {
|
||||
if(webSocket.session.isOpen()) {
|
||||
webSocket.session.getAsyncRemote().sendText(message);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
webSockets.remove(this);
|
||||
sessionPool.remove(this.userId);
|
||||
log.info("【websocket消息】连接断开,总数为:" + webSockets.size());
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
|
||||
// 此为单点消息
|
||||
public void sendOneMessage(String userId, String message) {
|
||||
|
||||
|
||||
/**
|
||||
* 服务端推送消息
|
||||
*
|
||||
* @param userId
|
||||
* @param message
|
||||
*/
|
||||
public void pushMessage(String userId, String message) {
|
||||
Session session = sessionPool.get(userId);
|
||||
if (session != null&&session.isOpen()) {
|
||||
if (session != null && session.isOpen()) {
|
||||
try {
|
||||
log.info("【websocket消息】 单点消息:"+message);
|
||||
log.info("【websocket消息】 单点消息:" + message);
|
||||
session.getAsyncRemote().sendText(message);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 此为单点消息(多人)
|
||||
public void sendMoreMessage(String[] userIds, String message) {
|
||||
for(String userId:userIds) {
|
||||
Session session = sessionPool.get(userId);
|
||||
if (session != null&&session.isOpen()) {
|
||||
try {
|
||||
log.info("【websocket消息】 单点消息:"+message);
|
||||
session.getAsyncRemote().sendText(message);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 服务器端推送消息
|
||||
*/
|
||||
public void pushMessage(String message) {
|
||||
try {
|
||||
webSockets.forEach(ws -> ws.session.getAsyncRemote().sendText(message));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@OnMessage
|
||||
public void onMessage(String message) {
|
||||
//todo 现在有个定时任务刷,应该去掉
|
||||
log.debug("【websocket消息】收到客户端消息:" + message);
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put(WebsocketConst.MSG_CMD, WebsocketConst.CMD_CHECK);//业务类型
|
||||
obj.put(WebsocketConst.MSG_TXT, "心跳响应");//消息内容
|
||||
for (WebSocket webSocket : webSockets) {
|
||||
webSocket.pushMessage(message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 后台发送消息到redis
|
||||
*
|
||||
* @param message
|
||||
*/
|
||||
public void sendMessage(String message) {
|
||||
log.info("【websocket消息】广播消息:" + message);
|
||||
BaseMap baseMap = new BaseMap();
|
||||
baseMap.put("userId", "");
|
||||
baseMap.put("message", message);
|
||||
jeecgRedisClient.sendMessage(REDIS_TOPIC_NAME, baseMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 此为单点消息
|
||||
*
|
||||
* @param userId
|
||||
* @param message
|
||||
*/
|
||||
public void sendMessage(String userId, String message) {
|
||||
BaseMap baseMap = new BaseMap();
|
||||
baseMap.put("userId", userId);
|
||||
baseMap.put("message", message);
|
||||
jeecgRedisClient.sendMessage(REDIS_TOPIC_NAME, baseMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 此为单点消息(多人)
|
||||
*
|
||||
* @param userIds
|
||||
* @param message
|
||||
*/
|
||||
public void sendMessage(String[] userIds, String message) {
|
||||
for (String userId : userIds) {
|
||||
sendMessage(userId, message);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,15 +1,7 @@
|
||||
package org.jeecg.modules.monitor.controller;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.swing.filechooser.FileSystemView;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.modules.monitor.domain.RedisInfo;
|
||||
import org.jeecg.modules.monitor.service.RedisService;
|
||||
@ -18,7 +10,14 @@ import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.swing.filechooser.FileSystemView;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@ -45,6 +44,35 @@ public class ActuatorRedisController {
|
||||
return redisService.getKeysSize();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取redis key数量 for 报表
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@GetMapping("/keysSizeForReport")
|
||||
public Map<String, JSONArray> getKeysSizeReport() throws Exception {
|
||||
return redisService.getMapForReport("1");
|
||||
}
|
||||
/**
|
||||
* 获取redis 内存 for 报表
|
||||
*
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@GetMapping("/memoryForReport")
|
||||
public Map<String, JSONArray> memoryForReport() throws Exception {
|
||||
return redisService.getMapForReport("2");
|
||||
}
|
||||
/**
|
||||
* 获取redis 全部信息 for 报表
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@GetMapping("/infoForReport")
|
||||
public Map<String, JSONArray> infoForReport() throws Exception {
|
||||
return redisService.getMapForReport("3");
|
||||
}
|
||||
|
||||
@GetMapping("/memoryInfo")
|
||||
public Map<String, Object> getMemoryInfo() throws Exception {
|
||||
return redisService.getMemoryInfo();
|
||||
|
||||
@ -4,6 +4,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import org.jeecg.modules.monitor.domain.RedisInfo;
|
||||
import org.jeecg.modules.monitor.exception.RedisConnectException;
|
||||
|
||||
@ -29,5 +30,10 @@ public interface RedisService {
|
||||
* @return Map
|
||||
*/
|
||||
Map<String, Object> getMemoryInfo() throws RedisConnectException;
|
||||
|
||||
/**
|
||||
* 获取 报表需要个redis信息
|
||||
*
|
||||
* @return Map
|
||||
*/
|
||||
Map<String, JSONArray> getMapForReport(String type) throws RedisConnectException ;
|
||||
}
|
||||
|
||||
@ -8,10 +8,15 @@ import java.util.Properties;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.common.collect.Maps;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.monitor.domain.RedisInfo;
|
||||
import org.jeecg.modules.monitor.exception.RedisConnectException;
|
||||
import org.jeecg.modules.monitor.service.RedisService;
|
||||
import org.springframework.cglib.beans.BeanMap;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@ -72,4 +77,46 @@ public class RedisServiceImpl implements RedisService {
|
||||
log.info("--getMemoryInfo--: " + map.toString());
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询redis信息for报表
|
||||
* @param type 1redis key数量 2 占用内存 3redis信息
|
||||
* @return
|
||||
* @throws RedisConnectException
|
||||
*/
|
||||
@Override
|
||||
public Map<String, JSONArray> getMapForReport(String type) throws RedisConnectException {
|
||||
Map<String,JSONArray> mapJson=new HashMap<String, JSONArray> ();
|
||||
JSONArray json = new JSONArray();
|
||||
if("3".equals(type)){
|
||||
List<RedisInfo> redisInfo = getRedisInfo();
|
||||
for(RedisInfo info:redisInfo){
|
||||
Map<String, Object> map= Maps.newHashMap();
|
||||
BeanMap beanMap = BeanMap.create(info);
|
||||
for (Object key : beanMap.keySet()) {
|
||||
map.put(key+"", beanMap.get(key));
|
||||
}
|
||||
json.add(map);
|
||||
}
|
||||
mapJson.put("data",json);
|
||||
return mapJson;
|
||||
}
|
||||
for(int i = 0; i < 5; i++){
|
||||
JSONObject jo = new JSONObject();
|
||||
Map<String, Object> map;
|
||||
if("1".equals(type)){
|
||||
map= getKeysSize();
|
||||
jo.put("value",map.get("dbSize"));
|
||||
}else{
|
||||
map = getMemoryInfo();
|
||||
Integer used_memory = Integer.valueOf(map.get("used_memory").toString());
|
||||
jo.put("value",used_memory/1000);
|
||||
}
|
||||
String create_time = DateUtil.formatTime(DateUtil.date((Long) map.get("create_time")-(4-i)*1000));
|
||||
jo.put("name",create_time);
|
||||
json.add(jo);
|
||||
}
|
||||
mapJson.put("data",json);
|
||||
return mapJson;
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,7 +16,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service("ngAlainService")
|
||||
@Transactional
|
||||
public class NgAlainServiceImpl implements NgAlainService {
|
||||
@Autowired
|
||||
private ISysPermissionService sysPermissionService;
|
||||
|
||||
@ -21,7 +21,10 @@ public class OSSFileServiceImpl extends ServiceImpl<OSSFileMapper, OSSFile> impl
|
||||
OSSFile ossFile = new OSSFile();
|
||||
ossFile.setFileName(fileName);
|
||||
String url = OssBootUtil.upload(multipartFile,"upload/test");
|
||||
ossFile.setUrl(url);
|
||||
//update-begin--Author:scott Date:20201227 for:JT-361【文件预览】阿里云原生域名可以文件预览,自己映射域名kkfileview提示文件下载失败-------------------
|
||||
// 返回阿里云原生域名前缀URL
|
||||
ossFile.setUrl(OssBootUtil.getOriginalUrl(url));
|
||||
//update-end--Author:scott Date:20201227 for:JT-361【文件预览】阿里云原生域名可以文件预览,自己映射域名kkfileview提示文件下载失败-------------------
|
||||
this.save(ossFile);
|
||||
}
|
||||
|
||||
|
||||
@ -96,10 +96,6 @@ public class SysAnnouncementController {
|
||||
}
|
||||
}
|
||||
IPage<SysAnnouncement> pageList = sysAnnouncementService.page(page, queryWrapper);
|
||||
log.info("查询当前页:"+pageList.getCurrent());
|
||||
log.info("查询当前页数量:"+pageList.getSize());
|
||||
log.info("查询结果数量:"+pageList.getRecords().size());
|
||||
log.info("数据总数:"+pageList.getTotal());
|
||||
result.setSuccess(true);
|
||||
result.setResult(pageList);
|
||||
return result;
|
||||
@ -233,7 +229,7 @@ public class SysAnnouncementController {
|
||||
obj.put(WebsocketConst.MSG_CMD, WebsocketConst.CMD_TOPIC);
|
||||
obj.put(WebsocketConst.MSG_ID, sysAnnouncement.getId());
|
||||
obj.put(WebsocketConst.MSG_TXT, sysAnnouncement.getTitile());
|
||||
webSocket.sendAllMessage(obj.toJSONString());
|
||||
webSocket.sendMessage(obj.toJSONString());
|
||||
}else {
|
||||
// 2.插入用户通告阅读标记表记录
|
||||
String userId = sysAnnouncement.getUserIds();
|
||||
@ -244,7 +240,7 @@ public class SysAnnouncementController {
|
||||
obj.put(WebsocketConst.MSG_CMD, WebsocketConst.CMD_USER);
|
||||
obj.put(WebsocketConst.MSG_ID, sysAnnouncement.getId());
|
||||
obj.put(WebsocketConst.MSG_TXT, sysAnnouncement.getTitile());
|
||||
webSocket.sendMoreMessage(userIds, obj.toJSONString());
|
||||
webSocket.sendMessage(userIds, obj.toJSONString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -285,15 +281,14 @@ public class SysAnnouncementController {
|
||||
LoginUser sysUser = (LoginUser)SecurityUtils.getSubject().getPrincipal();
|
||||
String userId = sysUser.getId();
|
||||
// 1.将系统消息补充到用户通告阅读标记表中
|
||||
Collection<String> anntIds = sysAnnouncementSendService.queryByUserId(userId);
|
||||
LambdaQueryWrapper<SysAnnouncement> querySaWrapper = new LambdaQueryWrapper<SysAnnouncement>();
|
||||
querySaWrapper.eq(SysAnnouncement::getMsgType,CommonConstant.MSG_TYPE_ALL); // 全部人员
|
||||
querySaWrapper.eq(SysAnnouncement::getDelFlag,CommonConstant.DEL_FLAG_0.toString()); // 未删除
|
||||
querySaWrapper.eq(SysAnnouncement::getSendStatus, CommonConstant.HAS_SEND); //已发布
|
||||
querySaWrapper.ge(SysAnnouncement::getEndTime, sysUser.getCreateTime()); //新注册用户不看结束通知
|
||||
if(anntIds!=null&&anntIds.size()>0) {
|
||||
querySaWrapper.notIn(SysAnnouncement::getId, anntIds);
|
||||
}
|
||||
//update-begin--Author:liusq Date:20210108 for:[JT-424] 【开源issue】bug处理--------------------
|
||||
querySaWrapper.notInSql(SysAnnouncement::getId,"select annt_id from sys_announcement_send where user_id='"+userId+"'");
|
||||
//update-begin--Author:liusq Date:20210108 for: [JT-424] 【开源issue】bug处理--------------------
|
||||
List<SysAnnouncement> announcements = sysAnnouncementService.list(querySaWrapper);
|
||||
if(announcements.size()>0) {
|
||||
for(int i=0;i<announcements.size();i++) {
|
||||
@ -337,9 +332,10 @@ public class SysAnnouncementController {
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(SysAnnouncement sysAnnouncement,HttpServletRequest request) {
|
||||
// Step.1 组装查询条件
|
||||
QueryWrapper<SysAnnouncement> queryWrapper = QueryGenerator.initQueryWrapper(sysAnnouncement, request.getParameterMap());
|
||||
LambdaQueryWrapper<SysAnnouncement> queryWrapper = new LambdaQueryWrapper<SysAnnouncement>(sysAnnouncement);
|
||||
//Step.2 AutoPoi 导出Excel
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
queryWrapper.eq(SysAnnouncement::getDelFlag,CommonConstant.DEL_FLAG_0);
|
||||
List<SysAnnouncement> pageList = sysAnnouncementService.list(queryWrapper);
|
||||
//导出文件名称
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, "系统通告列表");
|
||||
@ -407,7 +403,7 @@ public class SysAnnouncementController {
|
||||
obj.put(WebsocketConst.MSG_CMD, WebsocketConst.CMD_TOPIC);
|
||||
obj.put(WebsocketConst.MSG_ID, sysAnnouncement.getId());
|
||||
obj.put(WebsocketConst.MSG_TXT, sysAnnouncement.getTitile());
|
||||
webSocket.sendAllMessage(obj.toJSONString());
|
||||
webSocket.sendMessage(obj.toJSONString());
|
||||
}else {
|
||||
// 2.插入用户通告阅读标记表记录
|
||||
String userId = sysAnnouncement.getUserIds();
|
||||
@ -416,14 +412,14 @@ public class SysAnnouncementController {
|
||||
obj.put(WebsocketConst.MSG_CMD, WebsocketConst.CMD_USER);
|
||||
obj.put(WebsocketConst.MSG_ID, sysAnnouncement.getId());
|
||||
obj.put(WebsocketConst.MSG_TXT, sysAnnouncement.getTitile());
|
||||
webSocket.sendMoreMessage(userIds, obj.toJSONString());
|
||||
webSocket.sendMessage(userIds, obj.toJSONString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
obj.put(WebsocketConst.MSG_CMD, WebsocketConst.CMD_TOPIC);
|
||||
obj.put(WebsocketConst.MSG_TXT, "批量设置已读");
|
||||
webSocket.sendAllMessage(obj.toJSONString());
|
||||
webSocket.sendMessage(obj.toJSONString());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -136,10 +136,8 @@ public class SysCategoryController {
|
||||
if(sysCategory==null) {
|
||||
result.error500("未找到对应实体");
|
||||
}else {
|
||||
boolean ok = sysCategoryService.removeById(id);
|
||||
if(ok) {
|
||||
result.success("删除成功!");
|
||||
}
|
||||
this.sysCategoryService.deleteSysCategory(id);
|
||||
result.success("删除成功!");
|
||||
}
|
||||
|
||||
return result;
|
||||
@ -156,7 +154,7 @@ public class SysCategoryController {
|
||||
if(ids==null || "".equals(ids.trim())) {
|
||||
result.error500("参数不识别!");
|
||||
}else {
|
||||
this.sysCategoryService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
this.sysCategoryService.deleteSysCategory(ids);
|
||||
result.success("删除成功!");
|
||||
}
|
||||
return result;
|
||||
@ -461,6 +459,26 @@ public class SysCategoryController {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据父级id批量查询子节点
|
||||
* @param parentIds
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getChildListBatch")
|
||||
public Result getChildListBatch(@RequestParam("parentIds") String parentIds) {
|
||||
try {
|
||||
QueryWrapper<SysCategory> queryWrapper = new QueryWrapper<>();
|
||||
List<String> parentIdList = Arrays.asList(parentIds.split(","));
|
||||
queryWrapper.in("pid", parentIdList);
|
||||
List<SysCategory> list = sysCategoryService.list(queryWrapper);
|
||||
IPage<SysCategory> pageList = new Page<>(1, 10, list.size());
|
||||
pageList.setRecords(list);
|
||||
return Result.OK(pageList);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
return Result.error("批量查询子节点失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -16,13 +16,11 @@ import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.vo.DictModel;
|
||||
import org.jeecg.common.system.vo.DictQuery;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.common.util.FieldPresenceUtil;
|
||||
import org.jeecg.common.util.ImportExcelUtil;
|
||||
import org.jeecg.common.util.SqlInjectionUtil;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.system.entity.SysDict;
|
||||
import org.jeecg.modules.system.entity.SysDictItem;
|
||||
import org.jeecg.modules.system.entity.SysUser;
|
||||
import org.jeecg.modules.system.model.SysDictTree;
|
||||
import org.jeecg.modules.system.model.TreeSelectModel;
|
||||
import org.jeecg.modules.system.service.ISysDictItemService;
|
||||
@ -32,6 +30,7 @@ import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.entity.result.ExcelImportResult;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -41,6 +40,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.*;
|
||||
@ -152,7 +152,7 @@ public class SysDictController {
|
||||
|
||||
result.setSuccess(true);
|
||||
result.setResult(ls);
|
||||
log.info(result.toString());
|
||||
log.debug(result.toString());
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
result.error500("操作失败");
|
||||
@ -202,7 +202,10 @@ public class SysDictController {
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/loadDict/{dictCode}", method = RequestMethod.GET)
|
||||
public Result<List<DictModel>> loadDict(@PathVariable String dictCode,@RequestParam(name="keyword") String keyword, @RequestParam(value = "sign",required = false) String sign,HttpServletRequest request) {
|
||||
public Result<List<DictModel>> loadDict(@PathVariable String dictCode,
|
||||
@RequestParam(name="keyword") String keyword,
|
||||
@RequestParam(value = "sign",required = false) String sign,
|
||||
@RequestParam(value = "pageSize", required = false) Integer pageSize) {
|
||||
log.info(" 加载字典表数据,加载关键字: "+ keyword);
|
||||
Result<List<DictModel>> result = new Result<List<DictModel>>();
|
||||
List<DictModel> ls = null;
|
||||
@ -213,7 +216,11 @@ public class SysDictController {
|
||||
result.error500("字典Code格式不正确!");
|
||||
return result;
|
||||
}
|
||||
ls = sysDictService.queryTableDictItems(params[0],params[1],params[2],keyword);
|
||||
if(pageSize!=null){
|
||||
ls = sysDictService.queryLittleTableDictItems(params[0],params[1],params[2],keyword, pageSize);
|
||||
}else{
|
||||
ls = sysDictService.queryTableDictItems(params[0],params[1],params[2],keyword);
|
||||
}
|
||||
result.setSuccess(true);
|
||||
result.setResult(ls);
|
||||
log.info(result.toString());
|
||||
@ -312,7 +319,7 @@ public class SysDictController {
|
||||
* @param sysDict
|
||||
* @return
|
||||
*/
|
||||
//@RequiresRoles({"admin"})
|
||||
@RequiresRoles({"admin"})
|
||||
@RequestMapping(value = "/add", method = RequestMethod.POST)
|
||||
public Result<SysDict> add(@RequestBody SysDict sysDict) {
|
||||
Result<SysDict> result = new Result<SysDict>();
|
||||
@ -333,7 +340,7 @@ public class SysDictController {
|
||||
* @param sysDict
|
||||
* @return
|
||||
*/
|
||||
//@RequiresRoles({"admin"})
|
||||
@RequiresRoles({"admin"})
|
||||
@RequestMapping(value = "/edit", method = RequestMethod.PUT)
|
||||
public Result<SysDict> edit(@RequestBody SysDict sysDict) {
|
||||
Result<SysDict> result = new Result<SysDict>();
|
||||
@ -355,7 +362,7 @@ public class SysDictController {
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@RequiresRoles({"admin"})
|
||||
@RequiresRoles({"admin"})
|
||||
@RequestMapping(value = "/delete", method = RequestMethod.DELETE)
|
||||
@CacheEvict(value=CacheConstant.SYS_DICT_CACHE, allEntries=true)
|
||||
public Result<SysDict> delete(@RequestParam(name="id",required=true) String id) {
|
||||
@ -374,7 +381,7 @@ public class SysDictController {
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
//@RequiresRoles({"admin"})
|
||||
@RequiresRoles({"admin"})
|
||||
@RequestMapping(value = "/deleteBatch", method = RequestMethod.DELETE)
|
||||
@CacheEvict(value= CacheConstant.SYS_DICT_CACHE, allEntries=true)
|
||||
public Result<SysDict> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
@ -400,10 +407,14 @@ public class SysDictController {
|
||||
Set keys2 = redisTemplate.keys(CacheConstant.SYS_DICT_TABLE_CACHE + "*");
|
||||
Set keys3 = redisTemplate.keys(CacheConstant.SYS_DEPARTS_CACHE + "*");
|
||||
Set keys4 = redisTemplate.keys(CacheConstant.SYS_DEPART_IDS_CACHE + "*");
|
||||
Set keys5 = redisTemplate.keys( "jmreport:cache:dict*");
|
||||
Set keys6 = redisTemplate.keys( "jmreport:cache:dictTable*");
|
||||
redisTemplate.delete(keys);
|
||||
redisTemplate.delete(keys2);
|
||||
redisTemplate.delete(keys3);
|
||||
redisTemplate.delete(keys4);
|
||||
redisTemplate.delete(keys5);
|
||||
redisTemplate.delete(keys6);
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -449,7 +460,7 @@ public class SysDictController {
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
//@RequiresRoles({"admin"})
|
||||
@RequiresRoles({"admin"})
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||
@ -461,12 +472,11 @@ public class SysDictController {
|
||||
params.setHeadRows(2);
|
||||
params.setNeedSave(true);
|
||||
try {
|
||||
//update-begin-author:wangshuai date:20201030 for:导入测试用例
|
||||
boolean aBoolean = FieldPresenceUtil.fieldPresence(file.getInputStream(), SysDictPage.class, params);
|
||||
if(!aBoolean){
|
||||
throw new RuntimeException("导入Excel标题格式不匹配!");
|
||||
//导入Excel格式校验,看匹配的字段文本概率
|
||||
ExcelImportResult t = ExcelImportUtil.importExcelVerify(file.getInputStream(), SysDictPage.class, params);
|
||||
if(t.isVerfiyFail()){
|
||||
throw new RuntimeException("导入Excel校验失败 !");
|
||||
}
|
||||
//update-end-author:wangshuai date:20201030 for:导入测试用例
|
||||
List<SysDictPage> list = ExcelImportUtil.importExcel(file.getInputStream(), SysDictPage.class, params);
|
||||
// 错误信息
|
||||
List<String> errorMessage = new ArrayList<>();
|
||||
|
||||
@ -6,6 +6,9 @@ import java.util.Date;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresRoles;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.constant.CacheConstant;
|
||||
@ -148,5 +151,33 @@ public class SysDictItemController {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 字典值重复校验
|
||||
* @param sysDictItem
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/dictItemCheck", method = RequestMethod.GET)
|
||||
@ApiOperation("字典重复校验接口")
|
||||
public Result<Object> doDictItemCheck(SysDictItem sysDictItem, HttpServletRequest request) {
|
||||
int num = 0;
|
||||
LambdaQueryWrapper<SysDictItem> queryWrapper = new LambdaQueryWrapper<SysDictItem>();
|
||||
queryWrapper.eq(SysDictItem::getItemValue,sysDictItem.getItemValue());
|
||||
queryWrapper.eq(SysDictItem::getDictId,sysDictItem.getDictId());
|
||||
if (StringUtils.isNotBlank(sysDictItem.getId())) {
|
||||
// 编辑页面校验
|
||||
queryWrapper.ne(SysDictItem::getId,sysDictItem.getId());
|
||||
}
|
||||
num = sysDictItemService.count(queryWrapper);
|
||||
if (num == 0) {
|
||||
// 该值可用
|
||||
return Result.ok("该值可用!");
|
||||
} else {
|
||||
// 该值不可用
|
||||
log.info("该值不可用,系统中已存在!");
|
||||
return Result.error("该值不可用,系统中已存在!");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -472,6 +472,7 @@ public class SysPermissionController {
|
||||
json = new JSONObject();
|
||||
json.put("action", permission.getPerms());
|
||||
json.put("status", permission.getStatus());
|
||||
//1显示2禁用
|
||||
json.put("type", permission.getPermsType());
|
||||
json.put("describe", permission.getName());
|
||||
jsonArray.add(json);
|
||||
|
||||
@ -460,7 +460,7 @@ public class SysUserController {
|
||||
successLines++;
|
||||
} catch (Exception e) {
|
||||
errorLines++;
|
||||
String message = e.getMessage();
|
||||
String message = e.getMessage().toLowerCase();
|
||||
int lineNumber = i + 1;
|
||||
// 通过索引名判断出错信息
|
||||
if (message.contains(CommonConstant.SQL_INDEX_UNIQ_SYS_USER_USERNAME)) {
|
||||
@ -1043,10 +1043,10 @@ public class SysUserController {
|
||||
if (oConvertUtils.isEmpty(token)) {
|
||||
username = JwtUtil.getUserNameByToken(request);
|
||||
} else {
|
||||
username = JwtUtil.getUsername(token);
|
||||
username = JwtUtil.getUsername(token);
|
||||
}
|
||||
|
||||
log.info(" ------ 通过令牌获取部分用户信息,当前用户: " + username);
|
||||
log.debug(" ------ 通过令牌获取部分用户信息,当前用户: " + username);
|
||||
|
||||
// 根据用户名查询用户信息
|
||||
SysUser sysUser = sysUserService.getUserByName(username);
|
||||
@ -1056,7 +1056,7 @@ public class SysUserController {
|
||||
map.put("sysUserName", sysUser.getRealname()); // 当前登录用户真实名称
|
||||
map.put("sysOrgCode", sysUser.getOrgCode()); // 当前登录用户部门编号
|
||||
|
||||
log.info(" ------ 通过令牌获取部分用户信息,已获取的用户信息: " + map);
|
||||
log.debug(" ------ 通过令牌获取部分用户信息,已获取的用户信息: " + map);
|
||||
|
||||
return Result.ok(map);
|
||||
} catch (Exception e) {
|
||||
|
||||
@ -1,17 +1,14 @@
|
||||
package org.jeecg.modules.system.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Description: 分类字典
|
||||
|
||||
@ -47,7 +47,7 @@ public class SysDepart implements Serializable {
|
||||
/**描述*/
|
||||
@Excel(name="描述",width=15)
|
||||
private String description;
|
||||
/**机构类别 1组织机构,2岗位*/
|
||||
/**机构类别 1公司,2组织机构,2岗位*/
|
||||
@Excel(name="机构类别",width=15,dicCode="org_category")
|
||||
private String orgCategory;
|
||||
/**机构类型*/
|
||||
|
||||
@ -72,10 +72,10 @@ public class SysGatewayRoute implements Serializable {
|
||||
private Integer retryable;
|
||||
|
||||
/**是否为保留数据:0-否 1-是*/
|
||||
@Excel(name = "是否重试", width = 15)
|
||||
@Excel(name = "保留数据", width = 15)
|
||||
@ApiModelProperty(value = "保留数据")
|
||||
@Dict(dicCode = "yn")
|
||||
private Integer persist;
|
||||
private Integer persistable;
|
||||
|
||||
/**是否在接口文档中展示:0-否 1-是*/
|
||||
@Excel(name = "在接口文档中展示", width = 15)
|
||||
|
||||
@ -3,6 +3,7 @@ package org.jeecg.modules.system.mapper;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.ResultType;
|
||||
@ -74,7 +75,19 @@ public interface SysDictMapper extends BaseMapper<SysDict> {
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
public List<DictModel> queryTableDictItems(@Param("table") String table,@Param("text") String text,@Param("code") String code,@Param("keyword") String keyword);
|
||||
public List<DictModel> queryTableDictItems(@Param("table") String table,@Param("text") String text,@Param("code") String code,@Param("keyword") String keyword);
|
||||
|
||||
|
||||
/**
|
||||
* 通过关键字查询出字典表
|
||||
* @param page
|
||||
* @param table
|
||||
* @param text
|
||||
* @param code
|
||||
* @param keyword
|
||||
* @return
|
||||
*/
|
||||
IPage<DictModel> queryTableDictItems(Page<DictModel> page, @Param("table") String table, @Param("text") String text, @Param("code") String code, @Param("keyword") String keyword);
|
||||
|
||||
/**
|
||||
* 根据表名、显示字段名、存储字段名 查询树
|
||||
|
||||
@ -52,5 +52,11 @@ public interface ISysCategoryService extends IService<SysCategory> {
|
||||
* @return
|
||||
*/
|
||||
public String queryIdByCode(String code);
|
||||
|
||||
/**
|
||||
* 删除节点时同时删除子节点及修改父级节点
|
||||
* @param ids
|
||||
*/
|
||||
void deleteSysCategory(String ids);
|
||||
|
||||
}
|
||||
|
||||
@ -73,7 +73,16 @@ public interface ISysDictService extends IService<SysDict> {
|
||||
*/
|
||||
@Deprecated
|
||||
public List<DictModel> queryTableDictItems(String table, String text, String code,String keyword);
|
||||
|
||||
|
||||
/**
|
||||
* 查询字典表数据 只查询前10条
|
||||
* @param table
|
||||
* @param text
|
||||
* @param code
|
||||
* @param keyword
|
||||
* @return
|
||||
*/
|
||||
public List<DictModel> queryLittleTableDictItems(String table, String text, String code,String keyword, int pageSize);
|
||||
/**
|
||||
* 根据表名、显示字段名、存储字段名 查询树
|
||||
* @param table
|
||||
|
||||
@ -27,6 +27,7 @@ import org.jeecg.common.util.SysAnnmentTypeEnum;
|
||||
import org.jeecg.common.util.YouBianCodeUtil;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.message.entity.SysMessageTemplate;
|
||||
import org.jeecg.modules.message.handle.impl.EmailSendMsgHandle;
|
||||
import org.jeecg.modules.message.service.ISysMessageTemplateService;
|
||||
import org.jeecg.modules.message.websocket.WebSocket;
|
||||
import org.jeecg.modules.system.entity.*;
|
||||
@ -324,7 +325,9 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
||||
if(map!=null) {
|
||||
for (Map.Entry<String, String> entry : map.entrySet()) {
|
||||
String str = "${" + entry.getKey() + "}";
|
||||
title = title.replace(str, entry.getValue());
|
||||
if(oConvertUtils.isNotEmpty(title)){
|
||||
title = title.replace(str, entry.getValue());
|
||||
}
|
||||
content = content.replace(str, entry.getValue());
|
||||
}
|
||||
}
|
||||
@ -360,7 +363,7 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
||||
obj.put(WebsocketConst.MSG_USER_ID, sysUser.getId());
|
||||
obj.put(WebsocketConst.MSG_ID, announcement.getId());
|
||||
obj.put(WebsocketConst.MSG_TXT, announcement.getTitile());
|
||||
webSocket.sendOneMessage(sysUser.getId(), obj.toJSONString());
|
||||
webSocket.sendMessage(sysUser.getId(), obj.toJSONString());
|
||||
}
|
||||
}
|
||||
|
||||
@ -427,7 +430,7 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
||||
obj.put(WebsocketConst.MSG_USER_ID, sysUser.getId());
|
||||
obj.put(WebsocketConst.MSG_ID, announcement.getId());
|
||||
obj.put(WebsocketConst.MSG_TXT, announcement.getTitile());
|
||||
webSocket.sendOneMessage(sysUser.getId(), obj.toJSONString());
|
||||
webSocket.sendMessage(sysUser.getId(), obj.toJSONString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -666,7 +669,7 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
||||
public void sendWebSocketMsg(String[] userIds, String cmd) {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put(WebsocketConst.MSG_CMD, cmd);
|
||||
webSocket.sendMoreMessage(userIds, obj.toJSONString());
|
||||
webSocket.sendMessage(userIds, obj.toJSONString());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -693,7 +696,7 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
||||
obj.put(WebsocketConst.MSG_CMD, WebsocketConst.CMD_SIGN);
|
||||
obj.put(WebsocketConst.MSG_USER_ID,userId);
|
||||
//TODO 目前全部推送,后面修改
|
||||
webSocket.sendAllMessage(obj.toJSONString());
|
||||
webSocket.sendMessage(obj.toJSONString());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -853,6 +856,13 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
||||
return JSON.parseArray(JSON.toJSONString(userMapper.selectList(queryWrapper))).toJavaList(JSONObject.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> queryUsersByIds(String ids) {
|
||||
LambdaQueryWrapper<SysUser> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(SysUser::getId,ids.split(","));
|
||||
return JSON.parseArray(JSON.toJSONString(userMapper.selectList(queryWrapper))).toJavaList(JSONObject.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 37根据多个部门编码(逗号分隔),查询返回多个部门信息
|
||||
* @param usernames
|
||||
@ -865,6 +875,13 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
||||
return JSON.parseArray(JSON.toJSONString(sysDepartService.list(queryWrapper))).toJavaList(JSONObject.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> queryDepartsByIds(String ids) {
|
||||
LambdaQueryWrapper<SysDepart> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(SysDepart::getId,ids.split(","));
|
||||
return JSON.parseArray(JSON.toJSONString(sysDepartService.list(queryWrapper))).toJavaList(JSONObject.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发消息
|
||||
* @param fromUser
|
||||
@ -905,7 +922,7 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
||||
obj.put(WebsocketConst.MSG_USER_ID, sysUser.getId());
|
||||
obj.put(WebsocketConst.MSG_ID, announcement.getId());
|
||||
obj.put(WebsocketConst.MSG_TXT, announcement.getTitile());
|
||||
webSocket.sendOneMessage(sysUser.getId(), obj.toJSONString());
|
||||
webSocket.sendMessage(sysUser.getId(), obj.toJSONString());
|
||||
}
|
||||
}
|
||||
|
||||
@ -957,8 +974,21 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
||||
obj.put(WebsocketConst.MSG_USER_ID, sysUser.getId());
|
||||
obj.put(WebsocketConst.MSG_ID, announcement.getId());
|
||||
obj.put(WebsocketConst.MSG_TXT, announcement.getTitile());
|
||||
webSocket.sendOneMessage(sysUser.getId(), obj.toJSONString());
|
||||
webSocket.sendMessage(sysUser.getId(), obj.toJSONString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送邮件消息
|
||||
* @param email
|
||||
* @param title
|
||||
* @param content
|
||||
*/
|
||||
@Override
|
||||
public void sendEmailMsg(String email, String title, String content) {
|
||||
EmailSendMsgHandle emailHandle=new EmailSendMsgHandle();
|
||||
emailHandle.SendMsg(email, title, content);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,9 +1,12 @@
|
||||
package org.jeecg.modules.system.service.impl;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import org.jeecg.common.constant.FillRuleConstant;
|
||||
import org.jeecg.common.exception.JeecgBootException;
|
||||
import org.jeecg.common.util.FillRuleUtil;
|
||||
@ -17,6 +20,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @Description: 分类字典
|
||||
@ -107,4 +111,97 @@ public class SysCategoryServiceImpl extends ServiceImpl<SysCategoryMapper, SysCa
|
||||
return baseMapper.queryIdByCode(code);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteSysCategory(String ids) {
|
||||
String allIds = this.queryTreeChildIds(ids);
|
||||
String pids = this.queryTreePids(ids);
|
||||
//1.删除时将节点下所有子节点一并删除
|
||||
this.baseMapper.deleteBatchIds(Arrays.asList(allIds.split(",")));
|
||||
//2.将父节点中已经没有下级的节点,修改为没有子节点
|
||||
if(oConvertUtils.isNotEmpty(pids)){
|
||||
LambdaUpdateWrapper<SysCategory> updateWrapper = new UpdateWrapper<SysCategory>()
|
||||
.lambda()
|
||||
.in(SysCategory::getId,Arrays.asList(pids.split(",")))
|
||||
.set(SysCategory::getHasChild,"0");
|
||||
this.update(updateWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询节点下所有子节点
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
private String queryTreeChildIds(String ids) {
|
||||
//获取id数组
|
||||
String[] idArr = ids.split(",");
|
||||
StringBuffer sb = new StringBuffer();
|
||||
for (String pidVal : idArr) {
|
||||
if(pidVal != null){
|
||||
if(!sb.toString().contains(pidVal)){
|
||||
if(sb.toString().length() > 0){
|
||||
sb.append(",");
|
||||
}
|
||||
sb.append(pidVal);
|
||||
this.getTreeChildIds(pidVal,sb);
|
||||
}
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询需修改标识的父节点ids
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
private String queryTreePids(String ids) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
//获取id数组
|
||||
String[] idArr = ids.split(",");
|
||||
for (String id : idArr) {
|
||||
if(id != null){
|
||||
SysCategory category = this.baseMapper.selectById(id);
|
||||
//根据id查询pid值
|
||||
String metaPid = category.getPid();
|
||||
//查询此节点上一级是否还有其他子节点
|
||||
LambdaQueryWrapper<SysCategory> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(SysCategory::getPid,metaPid);
|
||||
queryWrapper.notIn(SysCategory::getId,Arrays.asList(idArr));
|
||||
List<SysCategory> dataList = this.baseMapper.selectList(queryWrapper);
|
||||
if((dataList == null || dataList.size()==0) && !Arrays.asList(idArr).contains(metaPid)
|
||||
&& !sb.toString().contains(metaPid)){
|
||||
//如果当前节点原本有子节点 现在木有了,更新状态
|
||||
sb.append(metaPid).append(",");
|
||||
}
|
||||
}
|
||||
}
|
||||
if(sb.toString().endsWith(",")){
|
||||
sb = sb.deleteCharAt(sb.length() - 1);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归 根据父id获取子节点id
|
||||
* @param pidVal
|
||||
* @param sb
|
||||
* @return
|
||||
*/
|
||||
private StringBuffer getTreeChildIds(String pidVal,StringBuffer sb){
|
||||
LambdaQueryWrapper<SysCategory> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(SysCategory::getPid,pidVal);
|
||||
List<SysCategory> dataList = baseMapper.selectList(queryWrapper);
|
||||
if(dataList != null && dataList.size()>0){
|
||||
for(SysCategory category : dataList) {
|
||||
if(!sb.toString().contains(category.getId())){
|
||||
sb.append(",").append(category.getId());
|
||||
}
|
||||
this.getTreeChildIds(category.getId(), sb);
|
||||
}
|
||||
}
|
||||
return sb;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package org.jeecg.modules.system.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -138,7 +139,9 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Cacheable(value = CacheConstant.SYS_DICT_TABLE_BY_KEYS_CACHE)
|
||||
//update-begin--Author:lvdandan Date:20201204 for:JT-36【online】树形列表bug修改后,还是显示原来值 暂时去掉缓存
|
||||
//@Cacheable(value = CacheConstant.SYS_DICT_TABLE_BY_KEYS_CACHE)
|
||||
//update-end--Author:lvdandan Date:20201204 for:JT-36【online】树形列表bug修改后,还是显示原来值 暂时去掉缓存
|
||||
public List<String> queryTableDictByKeys(String table, String text, String code, String keys) {
|
||||
if(oConvertUtils.isEmpty(keys)){
|
||||
return null;
|
||||
@ -201,6 +204,13 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
||||
return baseMapper.queryTableDictItems(table, text, code, "%"+keyword+"%");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DictModel> queryLittleTableDictItems(String table, String text, String code, String keyword, int pageSize) {
|
||||
Page<DictModel> page = new Page<DictModel>(1, pageSize);
|
||||
IPage<DictModel> pageList = baseMapper.queryTableDictItems(page, table, text, code, "%"+keyword+"%");
|
||||
return pageList.getRecords();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TreeSelectModel> queryTreeList(Map<String, String> query,String table, String text, String code, String pidField,String pid,String hasChildField) {
|
||||
return baseMapper.queryTreeList(query,table, text, code, pidField, pid,hasChildField);
|
||||
|
||||
@ -79,6 +79,8 @@ public class SysThirdAccountServiceImpl extends ServiceImpl<SysThirdAccountMappe
|
||||
user.setSalt(salt);
|
||||
String passwordEncode = PasswordUtil.encrypt(user.getUsername(), "123456", salt);
|
||||
user.setPassword(passwordEncode);
|
||||
user.setRealname(account.getRealname());
|
||||
user.setAvatar(account.getAvatar());
|
||||
String s = this.saveThirdUser(user);
|
||||
//更新用户第三方账户表的userId
|
||||
SysThirdAccount sysThirdAccount = new SysThirdAccount();
|
||||
|
||||
@ -161,7 +161,7 @@ mybatis-plus:
|
||||
# 关闭MP3.0自带的banner
|
||||
banner: false
|
||||
db-config:
|
||||
#主键类型
|
||||
#主键类型 0:"数据库ID自增",1:"该类型为未设置主键类型", 2:"用户输入ID",3:"全局唯一ID (数字类型唯一ID)", 4:"全局唯一ID UUID",5:"字符串全局唯一ID (idWorker 的字符串表示)";
|
||||
id-type: ASSIGN_ID
|
||||
# 默认数据库表下划线命名
|
||||
table-underline: true
|
||||
@ -210,6 +210,8 @@ jeecg :
|
||||
#大屏报表参数设置
|
||||
jmreport:
|
||||
mode: dev
|
||||
#数据字典是否可以全局看到
|
||||
saas: false
|
||||
#是否需要校验token
|
||||
is_verify_token: false
|
||||
#必须校验方法
|
||||
@ -262,17 +264,17 @@ justauth:
|
||||
enabled: true
|
||||
type:
|
||||
GITHUB:
|
||||
client-id: ??
|
||||
client-secret: ??
|
||||
client-id: true
|
||||
client-secret: true
|
||||
redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/github/callback
|
||||
WECHAT_ENTERPRISE:
|
||||
client-id: ??
|
||||
client-secret: ??
|
||||
client-id: true
|
||||
client-secret: true
|
||||
redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/wechat_enterprise/callback
|
||||
agent-id: 1000002
|
||||
DINGTALK:
|
||||
client-id: ??
|
||||
client-secret: ??
|
||||
client-id: true
|
||||
client-secret: true
|
||||
redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/dingtalk/callback
|
||||
WECHAT_OPEN:
|
||||
client-id: ??
|
||||
|
||||
@ -180,7 +180,7 @@ jeecg :
|
||||
#webapp文件路径
|
||||
webapp: /opt/jeecg-boot/webapp
|
||||
shiro:
|
||||
excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/api/getUserInfo
|
||||
excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**
|
||||
#阿里云oss存储配置
|
||||
oss:
|
||||
endpoint: oss-cn-beijing.aliyuncs.com
|
||||
@ -191,7 +191,7 @@ jeecg :
|
||||
# ElasticSearch 设置
|
||||
elasticsearch:
|
||||
cluster-name: jeecg-ES
|
||||
cluster-nodes: 127.0.0.1:9200
|
||||
cluster-nodes: 111.225.222.176:9200
|
||||
check-enabled: true
|
||||
# 表单设计器配置
|
||||
desform:
|
||||
@ -210,6 +210,8 @@ jeecg :
|
||||
#大屏报表参数设置
|
||||
jmreport:
|
||||
mode: prod
|
||||
#数据字典是否可以全局看到
|
||||
saas: false
|
||||
#是否需要校验token
|
||||
is_verify_token: true
|
||||
#必须校验方法
|
||||
@ -217,8 +219,8 @@ jeecg :
|
||||
#Wps在线文档
|
||||
wps:
|
||||
domain: https://wwo.wps.cn/office/
|
||||
appid: ??
|
||||
appsecret: ??
|
||||
appid: true
|
||||
appsecret: true
|
||||
#xxl-job配置
|
||||
xxljob:
|
||||
enabled: false
|
||||
@ -248,7 +250,7 @@ cas:
|
||||
#Mybatis输出sql日志
|
||||
logging:
|
||||
level:
|
||||
org.jeecg.modules.system.mapper : debug
|
||||
org.jeecg.modules.system.mapper : info
|
||||
#enable swagger
|
||||
swagger:
|
||||
enable: false
|
||||
@ -262,21 +264,21 @@ justauth:
|
||||
enabled: true
|
||||
type:
|
||||
GITHUB:
|
||||
client-id: ??
|
||||
client-secret: ??
|
||||
client-id: true
|
||||
client-secret: true
|
||||
redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/github/callback
|
||||
WECHAT_ENTERPRISE:
|
||||
client-id: ??
|
||||
client-secret: ??
|
||||
client-id: true
|
||||
client-secret: true
|
||||
redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/wechat_enterprise/callback
|
||||
agent-id: 1000002
|
||||
DINGTALK:
|
||||
client-id: ??
|
||||
client-secret: ??
|
||||
client-id: true
|
||||
client-secret: true
|
||||
redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/dingtalk/callback
|
||||
WECHAT_OPEN:
|
||||
client-id: ??
|
||||
client-secret: ??
|
||||
client-id: true
|
||||
client-secret: true
|
||||
redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/wechat_open/callback
|
||||
cache:
|
||||
type: default
|
||||
|
||||
@ -210,6 +210,8 @@ jeecg :
|
||||
#大屏报表参数设置
|
||||
jmreport:
|
||||
mode: prod
|
||||
#数据字典是否可以全局看到
|
||||
saas: false
|
||||
#是否需要校验token
|
||||
is_verify_token: false
|
||||
#必须校验方法
|
||||
@ -245,7 +247,7 @@ jeecg :
|
||||
#Mybatis输出sql日志
|
||||
logging:
|
||||
level:
|
||||
org.jeecg.modules.system.mapper : debug
|
||||
org.jeecg.modules.system.mapper : info
|
||||
#cas单点登录
|
||||
cas:
|
||||
prefixUrl: http://cas.example.org:8443/cas
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
spring:
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
application:
|
||||
name: jeecg-system
|
||||
profiles:
|
||||
|
||||
@ -9,6 +9,6 @@ ${AnsiColor.BRIGHT_BLUE}
|
||||
|
||||
|
||||
${AnsiColor.BRIGHT_GREEN}
|
||||
Jeecg Boot Version: 2.4.0
|
||||
Jeecg Boot Version: 2.4.2
|
||||
Spring Boot Version: ${spring-boot.version}${spring-boot.formatted-version}
|
||||
${AnsiColor.BLACK}
|
||||
|
||||
@ -0,0 +1,32 @@
|
||||
<#if po.fieldDbType=='Blob'>
|
||||
private transient java.lang.String ${po.fieldName}String;
|
||||
|
||||
private byte[] ${po.fieldName};
|
||||
|
||||
public byte[] get${po.fieldName?cap_first}(){
|
||||
if(${po.fieldName}String==null){
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return ${po.fieldName}String.getBytes("UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public String get${po.fieldName?cap_first}String(){
|
||||
if(${po.fieldName}==null || ${po.fieldName}.length==0){
|
||||
return "";
|
||||
}
|
||||
try {
|
||||
return new String(${po.fieldName},"UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
<#else>
|
||||
@ApiModelProperty(value = "${po.filedComment}")
|
||||
private ${po.fieldType} ${po.fieldName};
|
||||
</#if>
|
||||
@ -56,6 +56,7 @@
|
||||
|| po.fieldValidType == 'n'
|
||||
|| po.fieldValidType == 'z'
|
||||
|| po.fieldValidType == 'money'
|
||||
|| po.fieldValidType != ''
|
||||
>
|
||||
<#return true>
|
||||
</#if>
|
||||
@ -74,6 +75,15 @@
|
||||
</#if>
|
||||
</#function>
|
||||
|
||||
<#-- ** 如果Blob就显示 String * -->
|
||||
<#function autoStringSuffix po>
|
||||
<#if po.fieldDbType=='Blob'>
|
||||
<#return "'${po.fieldName}String'">
|
||||
<#else>
|
||||
<#return "'${po.fieldName}'">
|
||||
</#if>
|
||||
</#function>
|
||||
|
||||
<#-- ** 高级查询生成 * -->
|
||||
<#function superQueryFieldList po>
|
||||
<#assign superQuery_dictTable="">
|
||||
|
||||
@ -19,10 +19,10 @@
|
||||
</#if>
|
||||
<#-- 唯一校验 -->
|
||||
<#if fieldValidType == 'only'>
|
||||
{ validator: (rule, value, callback) => validateDuplicateValue('${tableName}', '${po.fieldDbName}', value, this.model.id, callback)},
|
||||
{ validator: (rule, value, callback) => validateDuplicateValue(<#if sub?default("")?trim?length gt 1>'${sub.tableName}'<#else>'${tableName}'</#if>, '${po.fieldDbName}', value, this.model.id, callback)},
|
||||
<#-- 6到16位数字 -->
|
||||
<#elseif fieldValidType == 'n6-16'>
|
||||
{ pattern: /\d{6,18}/, message: '请输入6到16位数字!'},
|
||||
{ pattern: /^\d{6,16}$/, message: '请输入6到16位数字!'},
|
||||
<#-- 6到16位任意字符 -->
|
||||
<#elseif fieldValidType == '*6-16'>
|
||||
{ pattern: /^.{6,16}$/, message: '请输入6到16位任意字符!'},
|
||||
@ -31,7 +31,7 @@
|
||||
{ pattern: /^.{6,18}$/, message: '请输入6到18位任意字符!'},
|
||||
<#-- 网址 -->
|
||||
<#elseif fieldValidType == 'url'>
|
||||
{ pattern: /^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/, message: '请输入正确的网址!'},
|
||||
{ pattern: /^((ht|f)tps?):\/\/[\w\-]+(\.[\w\-]+)+([\w\-.,@?^=%&:\/~+#]*[\w\-@?^=%&\/~+#])?$/, message: '请输入正确的网址!'},
|
||||
<#-- 电子邮件 -->
|
||||
<#elseif fieldValidType == 'e'>
|
||||
{ pattern: /^([\w]+\.*)([\w]+)@[\w]+\.\w{3}(\.\w{2}|)$/, message: '请输入正确的电子邮件!'},
|
||||
@ -53,6 +53,9 @@
|
||||
<#-- 金额 -->
|
||||
<#elseif fieldValidType == 'money'>
|
||||
{ pattern: /^(([1-9][0-9]*)|([0]\.\d{0,2}|[1-9][0-9]*\.\d{0,2}))$/, message: '请输入正确的金额!'},
|
||||
<#-- 正则校验 -->
|
||||
<#elseif fieldValidType != '' && fieldValidType != '*'>
|
||||
{ pattern: '${fieldValidType}', message: '不符合校验规则!'},
|
||||
<#-- 无校验 -->
|
||||
<#else>
|
||||
<#t>
|
||||
|
||||
@ -80,37 +80,6 @@ public class ${entityName} implements Serializable {
|
||||
</#if>
|
||||
</#if>-->
|
||||
</#if>
|
||||
<#if po.fieldDbType=='Blob'>
|
||||
private transient java.lang.String ${po.fieldName}String;
|
||||
|
||||
private byte[] ${po.fieldName};
|
||||
|
||||
public byte[] get${po.fieldName?cap_first}(){
|
||||
if(${po.fieldName}String==null){
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return ${po.fieldName}String.getBytes("UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public String get${po.fieldName?cap_first}String(){
|
||||
if(${po.fieldName}==null || ${po.fieldName}.length==0){
|
||||
return "";
|
||||
}
|
||||
try {
|
||||
return new String(${po.fieldName},"UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
<#else>
|
||||
@ApiModelProperty(value = "${po.filedComment}")
|
||||
private ${po.fieldType} ${po.fieldName};
|
||||
</#if>
|
||||
<#include "/common/blob.ftl">
|
||||
</#list>
|
||||
}
|
||||
|
||||
@ -5,21 +5,10 @@
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
<#assign query_field_no=0>
|
||||
<#assign query_field_select=false>
|
||||
<#assign query_field_date=false>
|
||||
<#assign query_flag=false>
|
||||
<#assign list_need_dict=false>
|
||||
<#assign list_need_category=false>
|
||||
<#assign query_field_pca=false>
|
||||
<#assign list_need_pca=false>
|
||||
<#assign query_flag=false>
|
||||
<#assign query_inp=false>
|
||||
<#assign query_popup=false>
|
||||
<#assign query_sel_user=false>
|
||||
<#assign query_sel_dep=false>
|
||||
<#assign query_sel_multi=false>
|
||||
<#assign query_sel_cat=false>
|
||||
<#assign query_sel_search=false>
|
||||
<#assign query_switch=false>
|
||||
<#assign list_need_switch=false>
|
||||
<#assign bpm_flag=false>
|
||||
|
||||
@ -43,36 +32,26 @@
|
||||
<#if query_field_no gt 1> </#if><a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<#if query_field_no gt 1> </#if><a-form-item label="${po.filedComment}">
|
||||
<#if po.classType=='sel_search'>
|
||||
<#assign query_sel_search=true>
|
||||
<#if query_field_no gt 1> </#if><j-search-select-tag placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}" dict="${po.dictTable},${po.dictText},${po.dictField}"/>
|
||||
<#elseif po.classType=='sel_user'>
|
||||
<#assign query_sel_user=true>
|
||||
<#if query_field_no gt 1> </#if><j-select-user-by-dep placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}"/>
|
||||
<#elseif po.classType=='switch'>
|
||||
<#assign query_switch=true>
|
||||
<#if query_field_no gt 1> </#if><j-switch placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}" <#if po.dictField?default("")?trim?length gt 1>:options="${po.dictField}"</#if> query></j-switch>
|
||||
<#elseif po.classType=='sel_depart'>
|
||||
<#assign query_sel_dep=true>
|
||||
<#if query_field_no gt 1> </#if><j-select-depart placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}"/>
|
||||
<#elseif po.classType=='list_multi'>
|
||||
<#assign query_sel_multi=true>
|
||||
<#if query_field_no gt 1> </#if><j-multi-select-tag placeholder="请选择${po.filedComment}" dictCode="${query_field_dictCode?default("")}" v-model="queryParam.${po.fieldName}"/>
|
||||
<#elseif po.classType=='cat_tree'>
|
||||
<#assign query_sel_cat=true>
|
||||
<#if query_field_no gt 1> </#if><j-category-select placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}" pcode="${po.dictField?default("")}"/>
|
||||
<#elseif po.classType=='date'>
|
||||
<#assign query_field_date=true>
|
||||
<#if query_field_no gt 1> </#if><j-date placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}"></j-date>
|
||||
<#elseif po.classType=='datetime'>
|
||||
<#assign query_field_date=true>
|
||||
<#if query_field_no gt 1> </#if><j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}"></j-date>
|
||||
<#elseif po.classType=='pca'>
|
||||
<#assign query_field_pca=true>
|
||||
<#if query_field_no gt 1> </#if><j-area-linkage type="cascader" v-model="queryParam.${po.fieldName}" placeholder="请选择省市区"/>
|
||||
<#elseif po.classType=='popup'>
|
||||
<#if query_field_no gt 1> </#if><j-popup placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}" code="${po.dictTable}" org-fields="${po.dictField}" dest-fields="${po.dictText}" :field="getPopupField('${po.dictText}')"/>
|
||||
<#elseif po.classType=='list' || po.classType=='radio' || po.classType=='checkbox'>
|
||||
<#assign query_field_select=true>
|
||||
<#-- ---------------------------下拉或是单选 判断数据字典是表字典还是普通字典------------------------------- -->
|
||||
<#if po.dictTable?default("")?trim?length gt 1>
|
||||
<#if query_field_no gt 1> </#if><j-dict-select-tag placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}" dictCode="${po.dictTable},${po.dictText},${po.dictField}"/>
|
||||
@ -90,12 +69,10 @@
|
||||
<#if query_field_no gt 1> </#if><a-col :xl="10" :lg="11" :md="12" :sm="24">
|
||||
<#if query_field_no gt 1> </#if><a-form-item label="${po.filedComment}">
|
||||
<#if po.classType=='date'>
|
||||
<#assign query_field_date=true>
|
||||
<#if query_field_no gt 1> </#if><j-date placeholder="请选择开始日期" class="query-group-cust" v-model="queryParam.${po.fieldName}_begin"></j-date>
|
||||
<#if query_field_no gt 1> </#if><span class="query-group-split-cust"></span>
|
||||
<#if query_field_no gt 1> </#if><j-date placeholder="请选择结束日期" class="query-group-cust" v-model="queryParam.${po.fieldName}_end"></j-date>
|
||||
<#elseif po.classType=='datetime'>
|
||||
<#assign query_field_date=true>
|
||||
<#if query_field_no gt 1> </#if><j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" class="query-group-cust" v-model="queryParam.${po.fieldName}_begin"></j-date>
|
||||
<#if query_field_no gt 1> </#if><span class="query-group-split-cust"></span>
|
||||
<#if query_field_no gt 1> </#if><j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择结束时间" class="query-group-cust" v-model="queryParam.${po.fieldName}_end"></j-date>
|
||||
@ -118,9 +95,6 @@
|
||||
<#if po.classType=='pca'>
|
||||
<#assign list_need_pca=true>
|
||||
</#if>
|
||||
<#if po.classType=='switch'>
|
||||
<#assign list_need_switch=true>
|
||||
</#if>
|
||||
</#list>
|
||||
<#-- 结束循环 -->
|
||||
<#t>
|
||||
@ -249,83 +223,21 @@
|
||||
<#if bpm_flag>
|
||||
import { postAction } from '@/api/manage'
|
||||
</#if>
|
||||
<#if query_field_select>
|
||||
import JDictSelectTag from '@/components/dict/JDictSelectTag.vue'
|
||||
</#if>
|
||||
<#if query_field_date>
|
||||
import JDate from '@/components/jeecg/JDate.vue'
|
||||
</#if>
|
||||
<#if list_need_category>
|
||||
import { loadCategoryData } from '@/api/api'
|
||||
</#if>
|
||||
<#if list_need_dict>
|
||||
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
|
||||
</#if>
|
||||
<#if query_field_pca>
|
||||
import JAreaLinkage from '@comp/jeecg/JAreaLinkage'
|
||||
</#if>
|
||||
<#if list_need_pca>
|
||||
import Area from '@/components/_util/Area'
|
||||
</#if>
|
||||
<#if query_inp>
|
||||
import JInput from '@comp/jeecg/JInput'
|
||||
</#if>
|
||||
<#if query_sel_user>
|
||||
import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
|
||||
</#if>
|
||||
<#if query_sel_dep>
|
||||
import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
|
||||
</#if>
|
||||
<#if query_sel_multi>
|
||||
import JMultiSelectTag from '@/components/dict/JMultiSelectTag'
|
||||
</#if>
|
||||
<#if query_sel_cat>
|
||||
import JCategorySelect from '@comp/jeecg/JCategorySelect'
|
||||
</#if>
|
||||
<#if query_sel_search>
|
||||
import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
|
||||
</#if>
|
||||
<#if query_switch>
|
||||
import JSwitch from '@/components/jeecg/JSwitch'
|
||||
</#if>
|
||||
import JSuperQuery from '@/components/jeecg/JSuperQuery.vue'
|
||||
|
||||
export default {
|
||||
name: '${entityName}List',
|
||||
mixins:[JeecgListMixin, mixinDevice],
|
||||
components: {
|
||||
<#if query_field_select>
|
||||
JDictSelectTag,
|
||||
</#if>
|
||||
<#if query_field_date>
|
||||
JDate,
|
||||
</#if>
|
||||
<#if query_field_pca>
|
||||
JAreaLinkage,
|
||||
</#if>
|
||||
<#if query_inp>
|
||||
JInput,
|
||||
</#if>
|
||||
<#if query_sel_user>
|
||||
JSelectUserByDep,
|
||||
</#if>
|
||||
<#if query_sel_dep>
|
||||
JSelectDepart,
|
||||
</#if>
|
||||
<#if query_sel_multi>
|
||||
JMultiSelectTag,
|
||||
</#if>
|
||||
<#if query_sel_cat>
|
||||
JCategorySelect,
|
||||
</#if>
|
||||
<#if query_sel_search>
|
||||
JSearchSelectTag,
|
||||
</#if>
|
||||
<#if query_switch>
|
||||
JSwitch,
|
||||
</#if>
|
||||
${entityName}Modal,
|
||||
JSuperQuery,
|
||||
${entityName}Modal
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
|
||||
@ -5,21 +5,8 @@
|
||||
<j-form-container :disabled="formDisabled">
|
||||
<a-form :form="form" slot="detail">
|
||||
<a-row>
|
||||
<#assign form_date = false>
|
||||
<#assign form_select = false>
|
||||
<#assign form_select_multi = false>
|
||||
<#assign form_select_search = false>
|
||||
<#assign form_popup = false>
|
||||
<#assign form_sel_depart = false>
|
||||
<#assign form_sel_user = false>
|
||||
<#assign form_file = false>
|
||||
<#assign form_image = false>
|
||||
<#assign form_editor = false>
|
||||
<#assign form_cat_tree = false>
|
||||
<#assign form_cat_back = "">
|
||||
<#assign form_pca = false>
|
||||
<#assign form_md = false>
|
||||
<#assign form_switch=false>
|
||||
<#assign form_span = 24>
|
||||
<#if tableVo.fieldRowNum==2>
|
||||
<#assign form_span = 12>
|
||||
@ -39,13 +26,12 @@
|
||||
<a-col :span="${form_span}">
|
||||
<a-form-item label="${po.filedComment}" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<#if po.classType =='date'>
|
||||
<#assign form_date=true>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='datetime'>
|
||||
<#assign form_date=true>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='time'>
|
||||
<j-time placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='popup'>
|
||||
<#assign form_popup=true>
|
||||
<j-popup
|
||||
v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"
|
||||
:trigger-change="true"
|
||||
@ -55,32 +41,24 @@
|
||||
@callback="popupCallback"
|
||||
<#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='sel_depart'>
|
||||
<#assign form_sel_depart=true>
|
||||
<j-select-depart v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" multi <#if po.readonly=='Y'>disabled</#if> />
|
||||
<#elseif po.classType =='switch'>
|
||||
<#assign form_switch=true>
|
||||
<j-switch v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" <#if po.dictField?default("")?trim?length gt 1>:options="${po.dictField}"</#if> <#if po.readonly=='Y'>disabled</#if>></j-switch>
|
||||
<#elseif po.classType =='pca'>
|
||||
<#assign form_pca=true>
|
||||
<j-area-linkage type="cascader" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入省市区" <#if po.readonly=='Y'>disabled</#if> />
|
||||
<#elseif po.classType =='markdown'>
|
||||
<#assign form_md=true>
|
||||
<j-markdown-editor v-decorator="['${po.fieldName}']" id="${po.fieldName}"></j-markdown-editor>
|
||||
<j-markdown-editor v-decorator="[${autoStringSuffix(po)},{initialValue:''}]" id="${po.fieldName}"></j-markdown-editor>
|
||||
<#elseif po.classType =='password'>
|
||||
<a-input-password v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='sel_user'>
|
||||
<#assign form_sel_user = true>
|
||||
<j-select-user-by-dep v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='textarea'>
|
||||
<a-textarea v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" rows="4" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<a-textarea v-decorator="[${autoStringSuffix(po)}${autoWriteRules(po)}]" rows="4" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType=='list' || po.classType=='radio'>
|
||||
<#assign form_select = true>
|
||||
<j-dict-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType=='list_multi' || po.classType=='checkbox'>
|
||||
<#assign form_select_multi = true>
|
||||
<j-multi-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType=='sel_search'>
|
||||
<#assign form_select_search = true>
|
||||
<j-search-select-tag v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" dict="${form_field_dictCode}" <#if po.readonly=='Y'>disabled</#if> />
|
||||
<#elseif po.classType=='cat_tree'>
|
||||
<#assign form_cat_tree = true>
|
||||
@ -91,18 +69,14 @@
|
||||
<#elseif po.fieldDbType=='int' || po.fieldDbType=='double' || po.fieldDbType=='BigDecimal'>
|
||||
<a-input-number v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType=='file'>
|
||||
<#assign form_file = true>
|
||||
<j-upload v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" <#if po.readonly=='Y'>disabled</#if> <#if po.uploadnum??>:number=${po.uploadnum}</#if>></j-upload>
|
||||
<#elseif po.classType=='image'>
|
||||
<#assign form_image = true>
|
||||
<j-image-upload isMultiple <#if po.uploadnum??>:number=${po.uploadnum}</#if> v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" <#if po.readonly=='Y'>disabled</#if>></j-image-upload>
|
||||
<#elseif po.classType=='umeditor'>
|
||||
<#assign form_editor = true>
|
||||
<j-editor v-decorator="['${po.fieldName}',{trigger:'input'}]" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<j-editor v-decorator="[${autoStringSuffix(po)},{trigger:'input'}]" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.fieldDbType=='Blob'>
|
||||
<a-input v-decorator="['${po.fieldName}String'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>></a-input>
|
||||
<a-input v-decorator="[${autoStringSuffix(po)}]" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>></a-input>
|
||||
<#elseif po.classType == 'sel_tree'>
|
||||
<#assign form_tree_select = true>
|
||||
<j-tree-select
|
||||
ref="treeSelect"
|
||||
placeholder="请选择${po.filedComment}"
|
||||
@ -145,90 +119,10 @@
|
||||
import { httpAction, getAction } from '@/api/manage'
|
||||
import pick from 'lodash.pick'
|
||||
import { validateDuplicateValue } from '@/utils/util'
|
||||
import JFormContainer from '@/components/jeecg/JFormContainer'
|
||||
<#if form_date>
|
||||
import JDate from '@/components/jeecg/JDate'
|
||||
</#if>
|
||||
<#if form_file>
|
||||
import JUpload from '@/components/jeecg/JUpload'
|
||||
</#if>
|
||||
<#if form_image>
|
||||
import JImageUpload from '@/components/jeecg/JImageUpload'
|
||||
</#if>
|
||||
<#if form_sel_depart>
|
||||
import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
|
||||
</#if>
|
||||
<#if form_sel_user>
|
||||
import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
|
||||
</#if>
|
||||
<#if form_select>
|
||||
import JDictSelectTag from "@/components/dict/JDictSelectTag"
|
||||
</#if>
|
||||
<#if form_select_multi>
|
||||
import JMultiSelectTag from "@/components/dict/JMultiSelectTag"
|
||||
</#if>
|
||||
<#if form_select_search>
|
||||
import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
|
||||
</#if>
|
||||
<#if form_editor>
|
||||
import JEditor from '@/components/jeecg/JEditor'
|
||||
</#if>
|
||||
<#if form_cat_tree>
|
||||
import JCategorySelect from '@/components/jeecg/JCategorySelect'
|
||||
</#if>
|
||||
<#if form_pca>
|
||||
import JAreaLinkage from '@comp/jeecg/JAreaLinkage'
|
||||
</#if>
|
||||
<#if form_md>
|
||||
import JMarkdownEditor from '@/components/jeecg/JMarkdownEditor/index'
|
||||
</#if>
|
||||
<#if form_switch==true >
|
||||
import JSwitch from '@/components/jeecg/JSwitch'
|
||||
</#if>
|
||||
|
||||
export default {
|
||||
name: '${entityName}Form',
|
||||
components: {
|
||||
JFormContainer,
|
||||
<#if form_date>
|
||||
JDate,
|
||||
</#if>
|
||||
<#if form_file>
|
||||
JUpload,
|
||||
</#if>
|
||||
<#if form_image>
|
||||
JImageUpload,
|
||||
</#if>
|
||||
<#if form_sel_depart>
|
||||
JSelectDepart,
|
||||
</#if>
|
||||
<#if form_sel_user>
|
||||
JSelectUserByDep,
|
||||
</#if>
|
||||
<#if form_select>
|
||||
JDictSelectTag,
|
||||
</#if>
|
||||
<#if form_select_multi>
|
||||
JMultiSelectTag,
|
||||
</#if>
|
||||
<#if form_select_search>
|
||||
JSearchSelectTag,
|
||||
</#if>
|
||||
<#if form_editor>
|
||||
JEditor,
|
||||
</#if>
|
||||
<#if form_pca>
|
||||
JAreaLinkage,
|
||||
</#if>
|
||||
<#if form_cat_tree>
|
||||
JCategorySelect,
|
||||
</#if>
|
||||
<#if form_md>
|
||||
JMarkdownEditor,
|
||||
</#if>
|
||||
<#if form_switch==true >
|
||||
JSwitch,
|
||||
</#if>
|
||||
},
|
||||
props: {
|
||||
//流程表单data
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package ${bussiPackage}.${entityPackage}.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@ -67,37 +68,7 @@ public class ${entityName} implements Serializable {
|
||||
@Dict(${list_field_dictCode?substring(2)})
|
||||
</#if>
|
||||
</#if>
|
||||
<#if po.fieldDbType=='Blob'>
|
||||
private transient java.lang.String ${po.fieldName}String;
|
||||
|
||||
private byte[] ${po.fieldName};
|
||||
|
||||
public byte[] get${po.fieldName?cap_first}(){
|
||||
if(${po.fieldName}String==null){
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return ${po.fieldName}String.getBytes("UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public String get${po.fieldName?cap_first}String(){
|
||||
if(${po.fieldName}==null || ${po.fieldName}.length==0){
|
||||
return "";
|
||||
}
|
||||
try {
|
||||
return new String(${po.fieldName},"UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
<#else>
|
||||
@ApiModelProperty(value = "${po.filedComment}")
|
||||
private ${po.fieldType} ${po.fieldName};
|
||||
</#if>
|
||||
<#-- 大字段转换 -->
|
||||
<#include "/common/blob.ftl">
|
||||
</#list>
|
||||
}
|
||||
|
||||
@ -13,6 +13,7 @@ import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import java.util.Date;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
/**
|
||||
* @Description: ${subTab.ftlDescription}
|
||||
@ -65,8 +66,8 @@ public class ${subTab.entityName} implements Serializable {
|
||||
</#if>
|
||||
</#if>
|
||||
</#if>
|
||||
@ApiModelProperty(value = "${po.filedComment}")
|
||||
private <#if po.fieldType=='java.sql.Blob'>byte[]<#else>${po.fieldType}</#if> ${po.fieldName};
|
||||
<#-- 大字段转换 -->
|
||||
<#include "/common/blob.ftl">
|
||||
</#list>
|
||||
}
|
||||
</#list>
|
||||
@ -68,7 +68,11 @@ public class ${entityName}Page {
|
||||
</#if>
|
||||
</#if>
|
||||
@ApiModelProperty(value = "${po.filedComment}")
|
||||
private <#if po.fieldType=='java.sql.Blob'>byte[]<#else>${po.fieldType}</#if> ${po.fieldName};
|
||||
<#if po.fieldDbType=='Blob'>
|
||||
private java.lang.String ${po.fieldName}String;
|
||||
<#else>
|
||||
private ${po.fieldType} ${po.fieldName};
|
||||
</#if>
|
||||
</#list>
|
||||
|
||||
<#list subTables as sub>
|
||||
|
||||
@ -5,20 +5,10 @@
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
<#assign query_field_no=0>
|
||||
<#assign query_field_select=false>
|
||||
<#assign query_field_date=false>
|
||||
<#assign query_flag=false>
|
||||
<#assign list_need_dict=false>
|
||||
<#assign list_need_category=false>
|
||||
<#assign query_field_pca=false>
|
||||
<#assign list_need_pca=false>
|
||||
<#assign query_flag=false>
|
||||
<#assign query_inp=false>
|
||||
<#assign query_popup=false>
|
||||
<#assign query_sel_user=false>
|
||||
<#assign query_sel_dep=false>
|
||||
<#assign query_sel_multi=false>
|
||||
<#assign query_sel_cat=false>
|
||||
<#assign query_sel_search=false>
|
||||
<#assign bpm_flag=false>
|
||||
|
||||
<#-- 开始循环 -->
|
||||
@ -41,33 +31,24 @@
|
||||
<#if query_field_no gt 1> </#if><a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<#if query_field_no gt 1> </#if><a-form-item label="${po.filedComment}">
|
||||
<#if po.classType=='sel_search'>
|
||||
<#assign query_sel_search=true>
|
||||
<#if query_field_no gt 1> </#if><j-search-select-tag placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}" dict="${po.dictTable},${po.dictText},${po.dictField}"/>
|
||||
<#elseif po.classType=='sel_user'>
|
||||
<#assign query_sel_user=true>
|
||||
<#if query_field_no gt 1> </#if><j-select-user-by-dep placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}"/>
|
||||
<#elseif po.classType=='sel_depart'>
|
||||
<#assign query_sel_dep=true>
|
||||
<#if query_field_no gt 1> </#if><j-select-depart placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}"/>
|
||||
<#elseif po.classType=='list_multi'>
|
||||
<#assign query_sel_multi=true>
|
||||
<#if query_field_no gt 1> </#if><j-multi-select-tag placeholder="请选择${po.filedComment}" dictCode="${query_field_dictCode?default("")}" v-model="queryParam.${po.fieldName}"/>
|
||||
<#elseif po.classType=='cat_tree'>
|
||||
<#assign query_sel_cat=true>
|
||||
<#if query_field_no gt 1> </#if><j-category-select placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}" pcode="${po.dictField?default("")}"/>
|
||||
<#elseif po.classType=='date'>
|
||||
<#assign query_field_date=true>
|
||||
<#if query_field_no gt 1> </#if><j-date placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}"></j-date>
|
||||
<#elseif po.classType=='datetime'>
|
||||
<#assign query_field_date=true>
|
||||
<#if query_field_no gt 1> </#if><j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}"></j-date>
|
||||
<#elseif po.classType=='pca'>
|
||||
<#assign query_field_pca=true>
|
||||
<#if query_field_no gt 1> </#if><j-area-linkage type="cascader" v-model="queryParam.${po.fieldName}" placeholder="请选择省市区"/>
|
||||
<#elseif po.classType=='popup'>
|
||||
<#if query_field_no gt 1> </#if><j-popup placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}" code="${po.dictTable}" org-fields="${po.dictField}" dest-fields="${po.dictText}" :field="getPopupField('${po.dictText}')"/>
|
||||
<#elseif po.classType=='list' || po.classType=='radio' || po.classType=='checkbox'>
|
||||
<#assign query_field_select=true>
|
||||
<#-- ---------------------------下拉或是单选 判断数据字典是表字典还是普通字典------------------------------- -->
|
||||
<#if po.dictTable?default("")?trim?length gt 1>
|
||||
<#if query_field_no gt 1> </#if><j-dict-select-tag placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}" dictCode="${po.dictTable},${po.dictText},${po.dictField}"/>
|
||||
@ -85,12 +66,10 @@
|
||||
<#if query_field_no gt 1> </#if><a-col :xl="10" :lg="11" :md="12" :sm="24">
|
||||
<#if query_field_no gt 1> </#if><a-form-item label="${po.filedComment}">
|
||||
<#if po.classType=='date'>
|
||||
<#assign query_field_date=true>
|
||||
<#if query_field_no gt 1> </#if><j-date placeholder="请选择开始日期" class="query-group-cust" v-model="queryParam.${po.fieldName}_begin"></j-date>
|
||||
<#if query_field_no gt 1> </#if><span class="query-group-split-cust"></span>
|
||||
<#if query_field_no gt 1> </#if><j-date placeholder="请选择结束日期" class="query-group-cust" v-model="queryParam.${po.fieldName}_end"></j-date>
|
||||
<#elseif po.classType=='datetime'>
|
||||
<#assign query_field_date=true>
|
||||
<#if query_field_no gt 1> </#if><j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" class="query-group-cust" v-model="queryParam.${po.fieldName}_begin"></j-date>
|
||||
<#if query_field_no gt 1> </#if><span class="query-group-split-cust"></span>
|
||||
<#if query_field_no gt 1> </#if><j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择结束时间" class="query-group-cust" v-model="queryParam.${po.fieldName}_end"></j-date>
|
||||
@ -234,81 +213,25 @@
|
||||
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import ${entityName}Modal from './modules/${entityName}Modal'
|
||||
<#if query_field_select>
|
||||
import JDictSelectTag from '@/components/dict/JDictSelectTag.vue'
|
||||
</#if>
|
||||
<#if query_field_date>
|
||||
import JDate from '@/components/jeecg/JDate.vue'
|
||||
</#if>
|
||||
<#if list_need_category>
|
||||
import { loadCategoryData } from '@/api/api'
|
||||
</#if>
|
||||
<#if list_need_dict>
|
||||
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
|
||||
</#if>
|
||||
<#if query_field_pca>
|
||||
import JAreaLinkage from '@comp/jeecg/JAreaLinkage'
|
||||
</#if>
|
||||
<#if list_need_pca>
|
||||
import Area from '@/components/_util/Area'
|
||||
</#if>
|
||||
<#if query_inp>
|
||||
import JInput from '@comp/jeecg/JInput'
|
||||
</#if>
|
||||
<#if query_sel_user>
|
||||
import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
|
||||
</#if>
|
||||
<#if query_sel_dep>
|
||||
import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
|
||||
</#if>
|
||||
<#if query_sel_multi>
|
||||
import JMultiSelectTag from '@/components/dict/JMultiSelectTag'
|
||||
</#if>
|
||||
<#if query_sel_cat>
|
||||
import JCategorySelect from '@comp/jeecg/JCategorySelect'
|
||||
</#if>
|
||||
<#if query_sel_search>
|
||||
import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
|
||||
</#if>
|
||||
import '@/assets/less/TableExpand.less'
|
||||
<#if bpm_flag>
|
||||
import { postAction } from '@/api/manage'
|
||||
</#if>
|
||||
import JSuperQuery from '@/components/jeecg/JSuperQuery.vue'
|
||||
|
||||
export default {
|
||||
name: "${entityName}List",
|
||||
mixins:[JeecgListMixin],
|
||||
components: {
|
||||
<#if query_field_select>
|
||||
JDictSelectTag,
|
||||
</#if>
|
||||
<#if query_field_date>
|
||||
JDate,
|
||||
</#if>
|
||||
<#if query_field_pca>
|
||||
JAreaLinkage,
|
||||
</#if>
|
||||
<#if query_inp>
|
||||
JInput,
|
||||
</#if>
|
||||
<#if query_sel_user>
|
||||
JSelectUserByDep,
|
||||
</#if>
|
||||
<#if query_sel_dep>
|
||||
JSelectDepart,
|
||||
</#if>
|
||||
<#if query_sel_multi>
|
||||
JMultiSelectTag,
|
||||
</#if>
|
||||
<#if query_sel_cat>
|
||||
JCategorySelect,
|
||||
</#if>
|
||||
<#if query_sel_search>
|
||||
JSearchSelectTag,
|
||||
</#if>
|
||||
${entityName}Modal,
|
||||
JSuperQuery
|
||||
${entityName}Modal
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
|
||||
@ -5,21 +5,8 @@
|
||||
<!-- 主表单区域 -->
|
||||
<a-form :form="form" slot="detail">
|
||||
<a-row>
|
||||
<#assign form_date = false>
|
||||
<#assign form_select = false>
|
||||
<#assign form_select_multi = false>
|
||||
<#assign form_select_search = false>
|
||||
<#assign form_popup = false>
|
||||
<#assign form_sel_depart = false>
|
||||
<#assign form_sel_user = false>
|
||||
<#assign form_file = false>
|
||||
<#assign form_image = false>
|
||||
<#assign form_editor = false>
|
||||
<#assign form_cat_tree = false>
|
||||
<#assign form_cat_back = "">
|
||||
<#assign form_pca = false>
|
||||
<#assign form_md = false>
|
||||
<#assign form_switch=false>
|
||||
<#assign form_span = 24>
|
||||
<#if tableVo.fieldRowNum==2>
|
||||
<#assign form_span = 12>
|
||||
@ -44,13 +31,12 @@
|
||||
<a-form-item label="${po.filedComment}" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
</#if>
|
||||
<#if po.classType =='date'>
|
||||
<#assign form_date=true>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='datetime'>
|
||||
<#assign form_date=true>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='time'>
|
||||
<j-time placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='popup'>
|
||||
<#assign form_popup=true>
|
||||
<j-popup
|
||||
v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"
|
||||
:trigger-change="true"
|
||||
@ -60,35 +46,27 @@
|
||||
@callback="popupCallback"
|
||||
<#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='sel_depart'>
|
||||
<#assign form_sel_depart=true>
|
||||
<j-select-depart v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" multi <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='switch'>
|
||||
<#assign form_switch=true>
|
||||
<j-switch v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" <#if po.dictField?default("")?trim?length gt 1>:options="${po.dictField}"</#if> <#if po.readonly=='Y'>disabled</#if>></j-switch>
|
||||
<#elseif po.classType =='pca'>
|
||||
<#assign form_pca=true>
|
||||
<j-area-linkage type="cascader" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入省市区" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='markdown'>
|
||||
<#assign form_md=true>
|
||||
<j-markdown-editor v-decorator="['${po.fieldName}']" id="${po.fieldName}"></j-markdown-editor>
|
||||
<j-markdown-editor v-decorator="[${autoStringSuffix(po)},{initialValue:''}]" id="${po.fieldName}"></j-markdown-editor>
|
||||
<#elseif po.classType =='password'>
|
||||
<a-input-password v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='sel_user'>
|
||||
<#assign form_sel_user = true>
|
||||
<j-select-user-by-dep v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='textarea'>
|
||||
<a-textarea v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" rows="4" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<a-textarea v-decorator="[${autoStringSuffix(po)}${autoWriteRules(po)}]" rows="4" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType=='list' || po.classType=='radio'>
|
||||
<#assign form_select = true>
|
||||
<j-dict-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType=='list_multi' || po.classType=='checkbox'>
|
||||
<#assign form_select_multi = true>
|
||||
<j-multi-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType=='sel_search'>
|
||||
<#assign form_select_search = true>
|
||||
<j-search-select-tag v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" dict="${form_field_dictCode}" <#if po.readonly=='Y'>disabled</#if> />
|
||||
<#elseif po.classType=='cat_tree'>
|
||||
<#assign form_cat_tree = true>
|
||||
<#assign form_cat_tree = true>
|
||||
<j-category-select v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" pcode="${po.dictField?default("")}" placeholder="请选择${po.filedComment}" <#if po.dictText?default("")?trim?length gt 1>back="${po.dictText}" @change="handleCategoryChange"</#if> <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#if po.dictText?default("")?trim?length gt 1>
|
||||
<#assign form_cat_back = "${po.dictText}">
|
||||
@ -96,18 +74,14 @@
|
||||
<#elseif po.fieldDbType=='int' || po.fieldDbType=='double' || po.fieldDbType=='BigDecimal'>
|
||||
<a-input-number v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType=='file'>
|
||||
<#assign form_file = true>
|
||||
<j-upload v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" <#if po.readonly=='Y'>disabled</#if> <#if po.uploadnum??>:number=${po.uploadnum}</#if>></j-upload>
|
||||
<#elseif po.classType=='image'>
|
||||
<#assign form_image = true>
|
||||
<j-image-upload isMultiple <#if po.uploadnum??>:number=${po.uploadnum}</#if> v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" <#if po.readonly=='Y'>disabled</#if>></j-image-upload>
|
||||
<#elseif po.classType=='umeditor'>
|
||||
<#assign form_editor = true>
|
||||
<j-editor v-decorator="['${po.fieldName}',{trigger:'input'}]" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<j-editor v-decorator="[${autoStringSuffix(po)},{trigger:'input'}]" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.fieldDbType=='Blob'>
|
||||
<a-input v-decorator="['${po.fieldName}String'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>></a-input>
|
||||
<a-input v-decorator="[${autoStringSuffix(po)}${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>></a-input>
|
||||
<#elseif po.classType == 'sel_tree'>
|
||||
<#assign form_tree_select = true>
|
||||
<j-tree-select
|
||||
ref="treeSelect"
|
||||
placeholder="请选择${po.filedComment}"
|
||||
@ -163,6 +137,7 @@
|
||||
</#if>
|
||||
</#list>
|
||||
</a-tabs>
|
||||
<a-row v-if="showFlowSubmitButton" style="text-align: center;width: 100%;margin-top: 16px;"><a-button @click="handleOk">提 交</a-button></a-row>
|
||||
</a-spin>
|
||||
</template>
|
||||
|
||||
@ -173,101 +148,21 @@
|
||||
import { FormTypes,getRefPromise } from '@/utils/JEditableTableUtil'
|
||||
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
|
||||
import { validateDuplicateValue } from '@/utils/util'
|
||||
import JFormContainer from '@/components/jeecg/JFormContainer'
|
||||
<#list subTables as sub>
|
||||
<#if sub.foreignRelationType =='1'>
|
||||
import ${sub.entityName}Form from './${sub.entityName}Form.vue'
|
||||
</#if>
|
||||
</#list>
|
||||
<#if form_date>
|
||||
import JDate from '@/components/jeecg/JDate'
|
||||
</#if>
|
||||
<#if form_file>
|
||||
import JUpload from '@/components/jeecg/JUpload'
|
||||
</#if>
|
||||
<#if form_image>
|
||||
import JImageUpload from '@/components/jeecg/JImageUpload'
|
||||
</#if>
|
||||
<#if form_sel_depart>
|
||||
import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
|
||||
</#if>
|
||||
<#if form_sel_user>
|
||||
import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
|
||||
</#if>
|
||||
<#if form_select>
|
||||
import JDictSelectTag from "@/components/dict/JDictSelectTag"
|
||||
</#if>
|
||||
<#if form_select_multi>
|
||||
import JMultiSelectTag from "@/components/dict/JMultiSelectTag"
|
||||
</#if>
|
||||
<#if form_select_search>
|
||||
import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
|
||||
</#if>
|
||||
<#if form_editor>
|
||||
import JEditor from '@/components/jeecg/JEditor'
|
||||
</#if>
|
||||
<#if form_cat_tree>
|
||||
import JCategorySelect from '@/components/jeecg/JCategorySelect'
|
||||
</#if>
|
||||
<#if form_pca>
|
||||
import JAreaLinkage from '@comp/jeecg/JAreaLinkage'
|
||||
</#if>
|
||||
<#if form_md>
|
||||
import JMarkdownEditor from '@/components/jeecg/JMarkdownEditor/index'
|
||||
</#if>
|
||||
<#if form_switch==true >
|
||||
import JSwitch from '@/components/jeecg/JSwitch'
|
||||
</#if>
|
||||
|
||||
export default {
|
||||
name: '${entityName}Form',
|
||||
mixins: [JEditableTableMixin],
|
||||
components: {
|
||||
JFormContainer,
|
||||
<#list subTables as sub>
|
||||
<#if sub.foreignRelationType =='1'>
|
||||
${sub.entityName}Form,
|
||||
</#if>
|
||||
</#list>
|
||||
<#if form_date>
|
||||
JDate,
|
||||
</#if>
|
||||
<#if form_file>
|
||||
JUpload,
|
||||
</#if>
|
||||
<#if form_image>
|
||||
JImageUpload,
|
||||
</#if>
|
||||
<#if form_sel_depart>
|
||||
JSelectDepart,
|
||||
</#if>
|
||||
<#if form_sel_user>
|
||||
JSelectUserByDep,
|
||||
</#if>
|
||||
<#if form_select>
|
||||
JDictSelectTag,
|
||||
</#if>
|
||||
<#if form_select_multi>
|
||||
JMultiSelectTag,
|
||||
</#if>
|
||||
<#if form_select_search>
|
||||
JSearchSelectTag,
|
||||
</#if>
|
||||
<#if form_editor>
|
||||
JEditor,
|
||||
</#if>
|
||||
<#if form_pca>
|
||||
JAreaLinkage,
|
||||
</#if>
|
||||
<#if form_cat_tree>
|
||||
JCategorySelect,
|
||||
</#if>
|
||||
<#if form_md>
|
||||
JMarkdownEditor,
|
||||
</#if>
|
||||
<#if form_switch==true >
|
||||
JSwitch,
|
||||
</#if>
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -309,7 +204,7 @@
|
||||
<#if col.filedComment !='外键' >
|
||||
{
|
||||
title: '${col.filedComment}',
|
||||
key: '${col.fieldName}',
|
||||
key: ${autoStringSuffix(col)},
|
||||
<#if col.classType =='date'>
|
||||
type: FormTypes.date,
|
||||
<#if col.readonly=='Y'>
|
||||
|
||||
@ -6,21 +6,8 @@
|
||||
<j-form-container :disabled="disabled">
|
||||
<a-form :form="form" slot="detail">
|
||||
<a-row>
|
||||
<#assign form_date = false>
|
||||
<#assign form_select = false>
|
||||
<#assign form_select_multi = false>
|
||||
<#assign form_select_search = false>
|
||||
<#assign form_popup = false>
|
||||
<#assign form_sel_depart = false>
|
||||
<#assign form_sel_user = false>
|
||||
<#assign form_file = false>
|
||||
<#assign form_image = false>
|
||||
<#assign form_editor = false>
|
||||
<#assign form_cat_tree = false>
|
||||
<#assign form_cat_back = "">
|
||||
<#assign form_pca = false>
|
||||
<#assign form_md = false>
|
||||
<#assign form_switch=false>
|
||||
<#assign form_span = 24>
|
||||
<#if tableVo.fieldRowNum == 2>
|
||||
<#assign form_span = 12>
|
||||
@ -45,13 +32,12 @@
|
||||
<a-form-item label="${po.filedComment}" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
</#if>
|
||||
<#if po.classType =='date'>
|
||||
<#assign form_date=true>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" style="width: 100%"/>
|
||||
<#elseif po.classType =='datetime'>
|
||||
<#assign form_date=true>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"/>
|
||||
<#elseif po.classType =='time'>
|
||||
<j-time placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='popup'>
|
||||
<#assign form_popup=true>
|
||||
<j-popup
|
||||
v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"
|
||||
:trigger-change="true"
|
||||
@ -60,32 +46,24 @@
|
||||
code="${po.dictTable}"
|
||||
@callback="popupCallback"/>
|
||||
<#elseif po.classType =='sel_depart'>
|
||||
<#assign form_sel_depart=true>
|
||||
<j-select-depart v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" multi/>
|
||||
<#elseif po.classType =='switch'>
|
||||
<#assign form_switch=true>
|
||||
<j-switch v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" <#if po.dictField?default("")?trim?length gt 1>:options="${po.dictField}"</#if>></j-switch>
|
||||
<#elseif po.classType =='pca'>
|
||||
<#assign form_pca=true>
|
||||
<j-area-linkage type="cascader" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入省市区"/>
|
||||
<#elseif po.classType =='markdown'>
|
||||
<#assign form_md=true>
|
||||
<j-markdown-editor v-decorator="['${po.fieldName}']" id="${po.fieldName}"></j-markdown-editor>
|
||||
<j-markdown-editor v-decorator="[${autoStringSuffix(po)},{initialValue:''}]" id="${po.fieldName}"></j-markdown-editor>
|
||||
<#elseif po.classType =='password'>
|
||||
<a-input-password v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}"/>
|
||||
<#elseif po.classType =='sel_user'>
|
||||
<#assign form_sel_user = true>
|
||||
<j-select-user-by-dep v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"/>
|
||||
<#elseif po.classType =='textarea'>
|
||||
<a-textarea v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" rows="4" placeholder="请输入${po.filedComment}"/>
|
||||
<a-textarea v-decorator="[${autoStringSuffix(po)}${autoWriteRules(po)}]" rows="4" placeholder="请输入${po.filedComment}"/>
|
||||
<#elseif po.classType=='list' || po.classType=='radio'>
|
||||
<#assign form_select = true>
|
||||
<j-dict-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}"/>
|
||||
<#elseif po.classType=='list_multi' || po.classType=='checkbox'>
|
||||
<#assign form_select_multi = true>
|
||||
<j-multi-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}"/>
|
||||
<#elseif po.classType=='sel_search'>
|
||||
<#assign form_select_search = true>
|
||||
<j-search-select-tag v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" dict="${form_field_dictCode}" />
|
||||
<#elseif po.classType=='cat_tree'>
|
||||
<#assign form_cat_tree = true>
|
||||
@ -96,16 +74,13 @@
|
||||
<#elseif po.fieldDbType=='int' || po.fieldDbType=='double' || po.fieldDbType=='BigDecimal'>
|
||||
<a-input-number v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" style="width: 100%"/>
|
||||
<#elseif po.classType=='file'>
|
||||
<#assign form_file = true>
|
||||
<j-upload v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true"></j-upload>
|
||||
<#elseif po.classType=='image'>
|
||||
<#assign form_image = true>
|
||||
<j-image-upload isMultiple v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"></j-image-upload>
|
||||
<#elseif po.classType=='umeditor'>
|
||||
<#assign form_editor = true>
|
||||
<j-editor v-decorator="['${po.fieldName}',{trigger:'input'}]"/>
|
||||
<j-editor v-decorator="[${autoStringSuffix(po)},{trigger:'input'}]"/>
|
||||
<#elseif po.fieldDbType=='Blob'>
|
||||
<a-input v-decorator="['${po.fieldName}String'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}"></a-input>
|
||||
<a-input v-decorator="[${autoStringSuffix(po)}${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}"></a-input>
|
||||
<#else>
|
||||
<a-input v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}"></a-input>
|
||||
</#if>
|
||||
@ -126,90 +101,10 @@
|
||||
import pick from 'lodash.pick'
|
||||
import { getAction } from '@/api/manage'
|
||||
import { validateDuplicateValue } from '@/utils/util'
|
||||
import JFormContainer from '@/components/jeecg/JFormContainer'
|
||||
<#if form_date>
|
||||
import JDate from '@/components/jeecg/JDate'
|
||||
</#if>
|
||||
<#if form_file>
|
||||
import JUpload from '@/components/jeecg/JUpload'
|
||||
</#if>
|
||||
<#if form_image>
|
||||
import JImageUpload from '@/components/jeecg/JImageUpload'
|
||||
</#if>
|
||||
<#if form_sel_depart>
|
||||
import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
|
||||
</#if>
|
||||
<#if form_sel_user>
|
||||
import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
|
||||
</#if>
|
||||
<#if form_select>
|
||||
import JDictSelectTag from "@/components/dict/JDictSelectTag"
|
||||
</#if>
|
||||
<#if form_select_multi>
|
||||
import JMultiSelectTag from "@/components/dict/JMultiSelectTag"
|
||||
</#if>
|
||||
<#if form_select_search>
|
||||
import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
|
||||
</#if>
|
||||
<#if form_editor>
|
||||
import JEditor from '@/components/jeecg/JEditor'
|
||||
</#if>
|
||||
<#if form_cat_tree>
|
||||
import JCategorySelect from '@/components/jeecg/JCategorySelect'
|
||||
</#if>
|
||||
<#if form_pca>
|
||||
import JAreaLinkage from '@comp/jeecg/JAreaLinkage'
|
||||
</#if>
|
||||
<#if form_md>
|
||||
import JMarkdownEditor from '@/components/jeecg/JMarkdownEditor/index'
|
||||
</#if>
|
||||
<#if form_switch==true >
|
||||
import JSwitch from '@/components/jeecg/JSwitch'
|
||||
</#if>
|
||||
|
||||
export default {
|
||||
name: '${sub.entityName}Form',
|
||||
components: {
|
||||
JFormContainer,
|
||||
<#if form_date>
|
||||
JDate,
|
||||
</#if>
|
||||
<#if form_file>
|
||||
JUpload,
|
||||
</#if>
|
||||
<#if form_image>
|
||||
JImageUpload,
|
||||
</#if>
|
||||
<#if form_sel_depart>
|
||||
JSelectDepart,
|
||||
</#if>
|
||||
<#if form_sel_user>
|
||||
JSelectUserByDep,
|
||||
</#if>
|
||||
<#if form_select>
|
||||
JDictSelectTag,
|
||||
</#if>
|
||||
<#if form_select_multi>
|
||||
JMultiSelectTag,
|
||||
</#if>
|
||||
<#if form_select_search>
|
||||
JSearchSelectTag,
|
||||
</#if>
|
||||
<#if form_editor>
|
||||
JEditor,
|
||||
</#if>
|
||||
<#if form_pca>
|
||||
JAreaLinkage,
|
||||
</#if>
|
||||
<#if form_cat_tree>
|
||||
JCategorySelect,
|
||||
</#if>
|
||||
<#if form_md>
|
||||
JMarkdownEditor,
|
||||
</#if>
|
||||
<#if form_switch==true >
|
||||
JSwitch,
|
||||
</#if>
|
||||
},
|
||||
props:{
|
||||
disabled: {
|
||||
@ -261,7 +156,7 @@
|
||||
edit(record){
|
||||
this.model = Object.assign({}, record)
|
||||
console.log("${sub.entityName}Form-edit",this.model);
|
||||
let fieldval = pick(this.model<#list sub.colums as po><#if po.fieldName !='id'>,'${po.fieldName}'</#if></#list>)
|
||||
let fieldval = pick(this.model<#list sub.colums as po><#if po.fieldName !='id'>,${autoStringSuffix(po)}</#if></#list>)
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(fieldval)
|
||||
})
|
||||
@ -288,7 +183,7 @@
|
||||
return formdata_arr;
|
||||
},
|
||||
popupCallback(row){
|
||||
this.form.setFieldsValue(pick(row<#list sub.colums as po><#if po.fieldName !='id'>,'${po.fieldName}'</#if></#list>))
|
||||
this.form.setFieldsValue(pick(row<#list sub.colums as po><#if po.fieldName !='id'>,${autoStringSuffix(po)}</#if></#list>))
|
||||
},
|
||||
clearFormData(){
|
||||
this.form.resetFields()
|
||||
|
||||
@ -13,6 +13,7 @@ import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
/**
|
||||
* @Description: ${tableVo.ftlDescription}
|
||||
@ -75,7 +76,7 @@ public class ${entityName} implements Serializable {
|
||||
@Dict(${list_field_dictCode?substring(2)})
|
||||
</#if>
|
||||
</#if>
|
||||
@ApiModelProperty(value = "${po.filedComment}")
|
||||
private <#if po.fieldType=='java.sql.Blob'>byte[]<#else>${po.fieldType}</#if> ${po.fieldName};
|
||||
<#-- 大字段转换 -->
|
||||
<#include "/common/blob.ftl">
|
||||
</#list>
|
||||
}
|
||||
|
||||
@ -15,22 +15,10 @@
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
<#assign query_field_no=0>
|
||||
<#assign query_field_select=false>
|
||||
<#assign query_field_date=false>
|
||||
<#assign query_flag=false>
|
||||
<#assign list_need_dict=false>
|
||||
<#assign list_need_category=false>
|
||||
<#assign query_field_pca=false>
|
||||
<#assign list_need_pca=false>
|
||||
<#assign query_flag=false>
|
||||
<#assign query_inp=false>
|
||||
<#assign query_popup=false>
|
||||
<#assign query_sel_user=false>
|
||||
<#assign query_sel_dep=false>
|
||||
<#assign query_sel_multi=false>
|
||||
<#assign query_sel_cat=false>
|
||||
<#assign query_sel_search=false>
|
||||
<#assign query_switch=false>
|
||||
<#assign list_need_switch=false>
|
||||
<#assign bpm_flag=false>
|
||||
|
||||
<#-- 开始循环 -->
|
||||
@ -53,36 +41,26 @@
|
||||
<#if query_field_no gt 1> </#if><a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<#if query_field_no gt 1> </#if><a-form-item label="${po.filedComment}">
|
||||
<#if po.classType=='sel_search'>
|
||||
<#assign query_sel_search=true>
|
||||
<#if query_field_no gt 1> </#if><j-search-select-tag placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}" dict="${po.dictTable},${po.dictText},${po.dictField}"/>
|
||||
<#elseif po.classType=='sel_user'>
|
||||
<#assign query_sel_user=true>
|
||||
<#if query_field_no gt 1> </#if><j-select-user-by-dep placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}"/>
|
||||
<#elseif po.classType=='switch'>
|
||||
<#assign query_switch=true>
|
||||
<#if query_field_no gt 1> </#if><j-switch placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}" <#if po.dictField?default("")?trim?length gt 1>:options="${po.dictField}"</#if> query></j-switch>
|
||||
<#elseif po.classType=='sel_depart'>
|
||||
<#assign query_sel_dep=true>
|
||||
<#if query_field_no gt 1> </#if><j-select-depart placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}"/>
|
||||
<#elseif po.classType=='list_multi'>
|
||||
<#assign query_sel_multi=true>
|
||||
<#if query_field_no gt 1> </#if><j-multi-select-tag placeholder="请选择${po.filedComment}" dictCode="${query_field_dictCode?default("")}" v-model="queryParam.${po.fieldName}"/>
|
||||
<#elseif po.classType=='cat_tree'>
|
||||
<#assign query_sel_cat=true>
|
||||
<#if query_field_no gt 1> </#if><j-category-select placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}" pcode="${po.dictField?default("")}"/>
|
||||
<#elseif po.classType=='date'>
|
||||
<#assign query_field_date=true>
|
||||
<#if query_field_no gt 1> </#if><j-date placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}"></j-date>
|
||||
<#elseif po.classType=='datetime'>
|
||||
<#assign query_field_date=true>
|
||||
<#if query_field_no gt 1> </#if><j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}"></j-date>
|
||||
<#elseif po.classType=='pca'>
|
||||
<#assign query_field_pca=true>
|
||||
<#if query_field_no gt 1> </#if><j-area-linkage type="cascader" v-model="queryParam.${po.fieldName}" placeholder="请选择省市区"/>
|
||||
<#elseif po.classType=='popup'>
|
||||
<#if query_field_no gt 1> </#if><j-popup placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}" code="${po.dictTable}" org-fields="${po.dictField}" dest-fields="${po.dictText}" :field="getPopupField('${po.dictText}')"/>
|
||||
<#elseif po.classType=='list' || po.classType=='radio' || po.classType=='checkbox'>
|
||||
<#assign query_field_select=true>
|
||||
<#-- ---------------------------下拉或是单选 判断数据字典是表字典还是普通字典------------------------------- -->
|
||||
<#if po.dictTable?default("")?trim?length gt 1>
|
||||
<#if query_field_no gt 1> </#if><j-dict-select-tag placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}" dictCode="${po.dictTable},${po.dictText},${po.dictField}"/>
|
||||
@ -100,12 +78,10 @@
|
||||
<#if query_field_no gt 1> </#if><a-col :xl="10" :lg="11" :md="12" :sm="24">
|
||||
<#if query_field_no gt 1> </#if><a-form-item label="${po.filedComment}">
|
||||
<#if po.classType=='date'>
|
||||
<#assign query_field_date=true>
|
||||
<#if query_field_no gt 1> </#if><j-date placeholder="请选择开始日期" class="query-group-cust" v-model="queryParam.${po.fieldName}_begin"></j-date>
|
||||
<#if query_field_no gt 1> </#if><span class="query-group-split-cust"></span>
|
||||
<#if query_field_no gt 1> </#if><j-date placeholder="请选择结束日期" class="query-group-cust" v-model="queryParam.${po.fieldName}_end"></j-date>
|
||||
<#elseif po.classType=='datetime'>
|
||||
<#assign query_field_date=true>
|
||||
<#if query_field_no gt 1> </#if><j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" class="query-group-cust" v-model="queryParam.${po.fieldName}_begin"></j-date>
|
||||
<#if query_field_no gt 1> </#if><span class="query-group-split-cust"></span>
|
||||
<#if query_field_no gt 1> </#if><j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择结束时间" class="query-group-cust" v-model="queryParam.${po.fieldName}_end"></j-date>
|
||||
@ -128,9 +104,6 @@
|
||||
<#if po.classType=='pca'>
|
||||
<#assign list_need_pca=true>
|
||||
</#if>
|
||||
<#if po.classType=='switch'>
|
||||
<#assign list_need_switch=true>
|
||||
</#if>
|
||||
</#list>
|
||||
<#-- 结束循环 -->
|
||||
<#t>
|
||||
@ -243,80 +216,18 @@
|
||||
import ${entityName}Modal from './modules/${entityName}Modal'
|
||||
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
|
||||
import { filterObj } from '@/utils/util';
|
||||
<#if query_field_select>
|
||||
import JDictSelectTag from '@/components/dict/JDictSelectTag.vue'
|
||||
</#if>
|
||||
<#if query_field_date>
|
||||
import JDate from '@/components/jeecg/JDate.vue'
|
||||
</#if>
|
||||
<#if list_need_category>
|
||||
import { loadCategoryData } from '@/api/api'
|
||||
</#if>
|
||||
<#if query_field_pca>
|
||||
import JAreaLinkage from '@comp/jeecg/JAreaLinkage'
|
||||
</#if>
|
||||
<#if list_need_pca>
|
||||
import Area from '@/components/_util/Area'
|
||||
</#if>
|
||||
<#if query_inp>
|
||||
import JInput from '@comp/jeecg/JInput'
|
||||
</#if>
|
||||
<#if query_sel_user>
|
||||
import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
|
||||
</#if>
|
||||
<#if query_sel_dep>
|
||||
import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
|
||||
</#if>
|
||||
<#if query_sel_multi>
|
||||
import JMultiSelectTag from '@/components/dict/JMultiSelectTag'
|
||||
</#if>
|
||||
<#if query_sel_cat>
|
||||
import JCategorySelect from '@comp/jeecg/JCategorySelect'
|
||||
</#if>
|
||||
<#if query_sel_search>
|
||||
import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
|
||||
</#if>
|
||||
<#if query_switch>
|
||||
import JSwitch from '@/components/jeecg/JSwitch'
|
||||
</#if>
|
||||
import JSuperQuery from '@/components/jeecg/JSuperQuery.vue'
|
||||
|
||||
export default {
|
||||
name: "${entityName}List",
|
||||
mixins:[JeecgListMixin],
|
||||
components: {
|
||||
<#if query_field_select>
|
||||
JDictSelectTag,
|
||||
</#if>
|
||||
<#if query_field_date>
|
||||
JDate,
|
||||
</#if>
|
||||
<#if query_field_pca>
|
||||
JAreaLinkage,
|
||||
</#if>
|
||||
<#if query_inp>
|
||||
JInput,
|
||||
</#if>
|
||||
<#if query_sel_user>
|
||||
JSelectUserByDep,
|
||||
</#if>
|
||||
<#if query_sel_dep>
|
||||
JSelectDepart,
|
||||
</#if>
|
||||
<#if query_sel_multi>
|
||||
JMultiSelectTag,
|
||||
</#if>
|
||||
<#if query_sel_cat>
|
||||
JCategorySelect,
|
||||
</#if>
|
||||
<#if query_sel_search>
|
||||
JSearchSelectTag,
|
||||
</#if>
|
||||
<#if query_switch>
|
||||
JSwitch,
|
||||
</#if>
|
||||
${entityName}Modal,
|
||||
JSuperQuery
|
||||
${entityName}Modal
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
@ -349,6 +260,8 @@
|
||||
<#elseif po.classType=='file'>
|
||||
dataIndex: '${po.fieldName}',
|
||||
scopedSlots: {customRender: 'fileSlot'}
|
||||
<#elseif po.fieldDbType=='Blob'>
|
||||
dataIndex: '${po.fieldName}String'
|
||||
<#elseif po.classType=='image'>
|
||||
dataIndex: '${po.fieldName}',
|
||||
scopedSlots: {customRender: 'imgSlot'}
|
||||
|
||||
@ -12,24 +12,9 @@
|
||||
cancelText="关闭">
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
<#assign form_date = false>
|
||||
<#assign form_select = false>
|
||||
<#assign form_select_multi = false>
|
||||
<#assign form_popup = false>
|
||||
<#assign form_sel_depart = false>
|
||||
<#assign form_sel_user = false>
|
||||
<#assign form_file = false>
|
||||
<#assign form_image = false>
|
||||
<#assign form_tree_select = false>
|
||||
<#assign form_switch=false>
|
||||
<#assign pidFieldName = "">
|
||||
<#assign form_select_search = false>
|
||||
<#assign form_cat_tree = false>
|
||||
<#assign form_cat_back = "">
|
||||
<#assign form_pca = false>
|
||||
<#assign form_editor = false>
|
||||
<#assign form_md = false>
|
||||
<#assign form_sel_tree = false>
|
||||
<#list columns as po>
|
||||
<#if po.isShow =='Y'>
|
||||
<#assign form_field_dictCode="">
|
||||
@ -40,7 +25,6 @@
|
||||
</#if>
|
||||
<a-form-item label="${po.filedComment}" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<#if po.fieldDbName == tableVo.extendParams.pidField>
|
||||
<#assign form_tree_select = true>
|
||||
<#assign pidFieldName = po.fieldName>
|
||||
<j-tree-select
|
||||
ref="treeSelect"
|
||||
@ -53,16 +37,14 @@
|
||||
<#if po.readonly=='Y'>disabled</#if>>
|
||||
</j-tree-select>
|
||||
<#elseif po.classType =='date'>
|
||||
<#assign form_date=true>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='datetime'>
|
||||
<#assign form_date=true>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='time'>
|
||||
<j-time placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='switch'>
|
||||
<#assign form_switch=true>
|
||||
<j-switch v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" <#if po.dictField?default("")?trim?length gt 1>:options="${po.dictField}"</#if>></j-switch>
|
||||
<#elseif po.classType =='popup'>
|
||||
<#assign form_popup=true>
|
||||
<j-popup
|
||||
v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"
|
||||
:trigger-change="true"
|
||||
@ -72,29 +54,22 @@
|
||||
@callback="popupCallback"
|
||||
<#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='sel_depart'>
|
||||
<#assign form_sel_depart=true>
|
||||
<j-select-depart v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='sel_user'>
|
||||
<#assign form_sel_user = true>
|
||||
<j-select-user-by-dep v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='textarea'>
|
||||
<a-textarea v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" rows="4" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<a-textarea v-decorator="[${autoStringSuffix(po)}${autoWriteRules(po)}]" rows="4" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType=='list' || po.classType=='radio'>
|
||||
<#assign form_select = true>
|
||||
<j-dict-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType=='list_multi' || po.classType=='checkbox'>
|
||||
<#assign form_select_multi = true>
|
||||
<j-multi-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.fieldDbType=='int' || po.fieldDbType=='double' || po.fieldDbType=='BigDecimal'>
|
||||
<a-input-number v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType=='file'>
|
||||
<#assign form_file = true>
|
||||
<j-upload v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" <#if po.readonly=='Y'>disabled</#if> <#if po.uploadnum??>:number=${po.uploadnum}</#if>></j-upload>
|
||||
<#elseif po.classType=='image'>
|
||||
<#assign form_image = true>
|
||||
<j-image-upload isMultiple <#if po.uploadnum??>:number=${po.uploadnum}</#if> v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" <#if po.readonly=='Y'>disabled</#if>></j-image-upload>
|
||||
<#elseif po.classType=='sel_search'>
|
||||
<#assign form_select_search = true>
|
||||
<j-search-select-tag v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" dict="${form_field_dictCode}" <#if po.readonly=='Y'>disabled</#if> />
|
||||
<#elseif po.classType=='cat_tree'>
|
||||
<#assign form_cat_tree = true>
|
||||
@ -103,16 +78,12 @@
|
||||
<#assign form_cat_back = "${po.dictText}">
|
||||
</#if>
|
||||
<#elseif po.classType =='pca'>
|
||||
<#assign form_pca=true>
|
||||
<j-area-linkage type="cascader" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入省市区" <#if po.readonly=='Y'>disabled</#if> />
|
||||
<j-area-linkage type="cascader" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入省市区" <#if po.readonly=='Y'>disabled</#if> />
|
||||
<#elseif po.classType=='umeditor'>
|
||||
<#assign form_editor = true>
|
||||
<j-editor v-decorator="['${po.fieldName}',{trigger:'input'}]" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<j-editor v-decorator="[${autoStringSuffix(po)},{trigger:'input'}]" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='markdown'>
|
||||
<#assign form_md=true>
|
||||
<j-markdown-editor v-decorator="['${po.fieldName}']" id="${po.fieldName}"></j-markdown-editor>
|
||||
<j-markdown-editor v-decorator="[${autoStringSuffix(po)},{initialValue:''}]" id="${po.fieldName}"></j-markdown-editor>
|
||||
<#elseif po.classType == 'sel_tree'>
|
||||
<#assign form_tree_select = true>
|
||||
<j-tree-select
|
||||
ref="treeSelect"
|
||||
placeholder="请选择${po.filedComment}"
|
||||
@ -151,93 +122,9 @@
|
||||
import { httpAction } from '@/api/manage'
|
||||
import pick from 'lodash.pick'
|
||||
import { validateDuplicateValue } from '@/utils/util'
|
||||
<#if form_date>
|
||||
import JDate from '@/components/jeecg/JDate'
|
||||
</#if>
|
||||
<#if form_file>
|
||||
import JUpload from '@/components/jeecg/JUpload'
|
||||
</#if>
|
||||
<#if form_image>
|
||||
import JImageUpload from '@/components/jeecg/JImageUpload'
|
||||
</#if>
|
||||
<#if form_sel_depart>
|
||||
import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
|
||||
</#if>
|
||||
<#if form_sel_user>
|
||||
import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
|
||||
</#if>
|
||||
<#if form_select>
|
||||
import JDictSelectTag from "@/components/dict/JDictSelectTag"
|
||||
</#if>
|
||||
<#if form_select_multi>
|
||||
import JMultiSelectTag from "@/components/dict/JMultiSelectTag"
|
||||
</#if>
|
||||
<#if form_tree_select>
|
||||
import JTreeSelect from '@/components/jeecg/JTreeSelect'
|
||||
</#if>
|
||||
<#if form_switch==true >
|
||||
import JSwitch from '@/components/jeecg/JSwitch'
|
||||
</#if>
|
||||
<#if form_select_search>
|
||||
import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
|
||||
</#if>
|
||||
<#if form_cat_tree>
|
||||
import JCategorySelect from '@/components/jeecg/JCategorySelect'
|
||||
</#if>
|
||||
<#if form_pca>
|
||||
import JAreaLinkage from '@comp/jeecg/JAreaLinkage'
|
||||
</#if>
|
||||
<#if form_editor>
|
||||
import JEditor from '@/components/jeecg/JEditor'
|
||||
</#if>
|
||||
<#if form_md>
|
||||
import JMarkdownEditor from '@/components/jeecg/JMarkdownEditor/index'
|
||||
</#if>
|
||||
export default {
|
||||
name: "${entityName}Modal",
|
||||
components: {
|
||||
<#if form_date>
|
||||
JDate,
|
||||
</#if>
|
||||
<#if form_file>
|
||||
JUpload,
|
||||
</#if>
|
||||
<#if form_image>
|
||||
JImageUpload,
|
||||
</#if>
|
||||
<#if form_sel_depart>
|
||||
JSelectDepart,
|
||||
</#if>
|
||||
<#if form_sel_user>
|
||||
JSelectUserByDep,
|
||||
</#if>
|
||||
<#if form_select>
|
||||
JDictSelectTag,
|
||||
</#if>
|
||||
<#if form_select_multi>
|
||||
JMultiSelectTag,
|
||||
</#if>
|
||||
<#if form_switch==true >
|
||||
JSwitch,
|
||||
</#if>
|
||||
<#if form_tree_select>
|
||||
JTreeSelect,
|
||||
</#if>
|
||||
<#if form_select_search>
|
||||
JSearchSelectTag,
|
||||
</#if>
|
||||
<#if form_cat_tree>
|
||||
JCategorySelect,
|
||||
</#if>
|
||||
<#if form_pca>
|
||||
JAreaLinkage,
|
||||
</#if>
|
||||
<#if form_editor>
|
||||
JEditor,
|
||||
</#if>
|
||||
<#if form_md>
|
||||
JMarkdownEditor,
|
||||
</#if>
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
@ -277,7 +164,7 @@
|
||||
this.model = Object.assign({}, record);
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model<#list columns as po><#if po.fieldName !='id'>,'${po.fieldName}'</#if></#list>))
|
||||
this.form.setFieldsValue(pick(this.model<#list columns as po><#if po.fieldName !='id'>,${autoStringSuffix(po)}</#if></#list>))
|
||||
})
|
||||
},
|
||||
close () {
|
||||
@ -302,6 +189,11 @@
|
||||
let old_pid = this.model[this.pidField]
|
||||
let formData = Object.assign(this.model, values);
|
||||
let new_pid = this.model[this.pidField]
|
||||
if(this.model.id && this.model.id === new_pid){
|
||||
that.$message.warning("父级节点不能选择自己");
|
||||
that.confirmLoading = false;
|
||||
return;
|
||||
}
|
||||
console.log("表单提交数据",formData)
|
||||
httpAction(httpurl,formData,method).then((res)=>{
|
||||
if(res.success){
|
||||
@ -322,7 +214,7 @@
|
||||
this.close()
|
||||
},
|
||||
popupCallback(row){
|
||||
this.form.setFieldsValue(pick(row<#list columns as po><#if po.fieldName !='id'>,'${po.fieldName}'</#if></#list>))
|
||||
this.form.setFieldsValue(pick(row<#list columns as po><#if po.fieldName !='id'>,${autoStringSuffix(po)}</#if></#list>))
|
||||
},
|
||||
submitSuccess(formData,flag){
|
||||
if(!formData.id){
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package ${bussiPackage}.${entityPackage}.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@ -67,37 +68,6 @@ public class ${entityName} implements Serializable {
|
||||
@Dict(${list_field_dictCode?substring(2)})
|
||||
</#if>
|
||||
</#if>
|
||||
<#if po.fieldDbType=='Blob'>
|
||||
private transient java.lang.String ${po.fieldName}String;
|
||||
|
||||
private byte[] ${po.fieldName};
|
||||
|
||||
public byte[] get${po.fieldName?cap_first}(){
|
||||
if(${po.fieldName}String==null){
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return ${po.fieldName}String.getBytes("UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public String get${po.fieldName?cap_first}String(){
|
||||
if(${po.fieldName}==null || ${po.fieldName}.length==0){
|
||||
return "";
|
||||
}
|
||||
try {
|
||||
return new String(${po.fieldName},"UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
<#else>
|
||||
@ApiModelProperty(value = "${po.filedComment}")
|
||||
private ${po.fieldType} ${po.fieldName};
|
||||
</#if>
|
||||
<#include "/common/blob.ftl">
|
||||
</#list>
|
||||
}
|
||||
|
||||
@ -14,6 +14,7 @@ import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import java.util.Date;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
/**
|
||||
* @Description: ${subTab.ftlDescription}
|
||||
@ -66,8 +67,8 @@ public class ${subTab.entityName} implements Serializable {
|
||||
<#if po.classType =='sel_depart'>
|
||||
@Dict(dicCode = "id",dicText = "depart_name",dictTable = "sys_depart")
|
||||
</#if>
|
||||
@ApiModelProperty(value = "${po.filedComment}")
|
||||
private <#if po.fieldType=='java.sql.Blob'>byte[]<#else>${po.fieldType}</#if> ${po.fieldName};
|
||||
<#-- 大字段转换 -->
|
||||
<#include "/common/blob.ftl">
|
||||
</#list>
|
||||
}
|
||||
</#list>
|
||||
@ -5,20 +5,10 @@
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
<#assign query_field_no=0>
|
||||
<#assign query_field_select=false>
|
||||
<#assign query_field_date=false>
|
||||
<#assign query_flag=false>
|
||||
<#assign list_need_dict=false>
|
||||
<#assign list_need_category=false>
|
||||
<#assign query_field_pca=false>
|
||||
<#assign list_need_pca=false>
|
||||
<#assign query_flag=false>
|
||||
<#assign query_inp=false>
|
||||
<#assign query_popup=false>
|
||||
<#assign query_sel_user=false>
|
||||
<#assign query_sel_dep=false>
|
||||
<#assign query_sel_multi=false>
|
||||
<#assign query_sel_cat=false>
|
||||
<#assign query_sel_search=false>
|
||||
<#-- 开始循环 -->
|
||||
<#list columns as po>
|
||||
<#if po.isQuery=='Y'>
|
||||
@ -36,33 +26,24 @@
|
||||
<#if query_field_no gt 1> </#if><a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<#if query_field_no gt 1> </#if><a-form-item label="${po.filedComment}">
|
||||
<#if po.classType=='sel_search'>
|
||||
<#assign query_sel_search=true>
|
||||
<#if query_field_no gt 1> </#if><j-search-select-tag placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}" dict="${po.dictTable},${po.dictText},${po.dictField}"/>
|
||||
<#elseif po.classType=='sel_user'>
|
||||
<#assign query_sel_user=true>
|
||||
<#if query_field_no gt 1> </#if><j-select-user-by-dep placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}"/>
|
||||
<#elseif po.classType=='sel_depart'>
|
||||
<#assign query_sel_dep=true>
|
||||
<#if query_field_no gt 1> </#if><j-select-depart placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}"/>
|
||||
<#elseif po.classType=='list_multi'>
|
||||
<#assign query_sel_multi=true>
|
||||
<#if query_field_no gt 1> </#if><j-multi-select-tag placeholder="请选择${po.filedComment}" dictCode="${query_field_dictCode?default("")}" v-model="queryParam.${po.fieldName}"/>
|
||||
<#elseif po.classType=='cat_tree'>
|
||||
<#assign query_sel_cat=true>
|
||||
<#if query_field_no gt 1> </#if><j-category-select placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}" pcode="${po.dictField?default("")}"/>
|
||||
<#elseif po.classType=='date'>
|
||||
<#assign query_field_date=true>
|
||||
<#if query_field_no gt 1> </#if><j-date placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}"></j-date>
|
||||
<#elseif po.classType=='datetime'>
|
||||
<#assign query_field_date=true>
|
||||
<#if query_field_no gt 1> </#if><j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}"></j-date>
|
||||
<#elseif po.classType=='pca'>
|
||||
<#assign query_field_pca=true>
|
||||
<#if query_field_no gt 1> </#if><j-area-linkage type="cascader" v-model="queryParam.${po.fieldName}" placeholder="请选择省市区"/>
|
||||
<#elseif po.classType=='popup'>
|
||||
<#if query_field_no gt 1> </#if><j-popup placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}" code="${po.dictTable}" org-fields="${po.dictField}" dest-fields="${po.dictText}" :field="getPopupField('${po.dictText}')"/>
|
||||
<#elseif po.classType=='list' || po.classType=='radio' || po.classType=='checkbox'>
|
||||
<#assign query_field_select=true>
|
||||
<#-- ---------------------------下拉或是单选 判断数据字典是表字典还是普通字典------------------------------- -->
|
||||
<#if po.dictTable?default("")?trim?length gt 1>
|
||||
<#if query_field_no gt 1> </#if><j-dict-select-tag placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}" dictCode="${po.dictTable},${po.dictText},${po.dictField}"/>
|
||||
@ -80,12 +61,10 @@
|
||||
<#if query_field_no gt 1> </#if><a-col :xl="10" :lg="11" :md="12" :sm="24">
|
||||
<#if query_field_no gt 1> </#if><a-form-item label="${po.filedComment}">
|
||||
<#if po.classType=='date'>
|
||||
<#assign query_field_date=true>
|
||||
<#if query_field_no gt 1> </#if><j-date placeholder="请选择开始日期" class="query-group-cust" v-model="queryParam.${po.fieldName}_begin"></j-date>
|
||||
<#if query_field_no gt 1> </#if><span class="query-group-split-cust"></span>
|
||||
<#if query_field_no gt 1> </#if><j-date placeholder="请选择结束日期" class="query-group-cust" v-model="queryParam.${po.fieldName}_end"></j-date>
|
||||
<#elseif po.classType=='datetime'>
|
||||
<#assign query_field_date=true>
|
||||
<#if query_field_no gt 1> </#if><j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" class="query-group-cust" v-model="queryParam.${po.fieldName}_begin"></j-date>
|
||||
<#if query_field_no gt 1> </#if><span class="query-group-split-cust"></span>
|
||||
<#if query_field_no gt 1> </#if><j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择结束时间" class="query-group-cust" v-model="queryParam.${po.fieldName}_end"></j-date>
|
||||
@ -105,9 +84,6 @@
|
||||
<#if po.classType=='cat_tree' && po.dictText?default("")?trim?length == 0>
|
||||
<#assign list_need_category=true>
|
||||
</#if>
|
||||
<#if po.classType=='pca'>
|
||||
<#assign list_need_pca=true>
|
||||
</#if>
|
||||
</#list>
|
||||
<#-- 结束循环 -->
|
||||
<#t>
|
||||
@ -230,81 +206,25 @@
|
||||
<#list subTables as sub>
|
||||
import ${sub.entityName}List from './${sub.entityName}List'
|
||||
</#list>
|
||||
<#if query_field_select>
|
||||
import JDictSelectTag from '@/components/dict/JDictSelectTag.vue'
|
||||
</#if>
|
||||
<#if query_field_date>
|
||||
import JDate from '@/components/jeecg/JDate.vue'
|
||||
</#if>
|
||||
<#if list_need_category>
|
||||
import { loadCategoryData } from '@/api/api'
|
||||
</#if>
|
||||
<#if list_need_dict>
|
||||
import {initDictOptions,filterMultiDictText} from '@/components/dict/JDictSelectUtil'
|
||||
</#if>
|
||||
<#if query_field_pca>
|
||||
import JAreaLinkage from '@comp/jeecg/JAreaLinkage'
|
||||
</#if>
|
||||
<#if list_need_pca>
|
||||
import Area from '@/components/_util/Area'
|
||||
</#if>
|
||||
<#if query_inp>
|
||||
import JInput from '@comp/jeecg/JInput'
|
||||
</#if>
|
||||
<#if query_sel_user>
|
||||
import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
|
||||
</#if>
|
||||
<#if query_sel_dep>
|
||||
import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
|
||||
</#if>
|
||||
<#if query_sel_multi>
|
||||
import JMultiSelectTag from '@/components/dict/JMultiSelectTag'
|
||||
</#if>
|
||||
<#if query_sel_cat>
|
||||
import JCategorySelect from '@comp/jeecg/JCategorySelect'
|
||||
</#if>
|
||||
<#if query_sel_search>
|
||||
import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
|
||||
</#if>
|
||||
import '@/assets/less/TableExpand.less'
|
||||
import JSuperQuery from '@/components/jeecg/JSuperQuery.vue'
|
||||
|
||||
export default {
|
||||
name: "${entityName}List",
|
||||
mixins:[JeecgListMixin],
|
||||
components: {
|
||||
<#if query_field_select>
|
||||
JDictSelectTag,
|
||||
</#if>
|
||||
<#if query_field_date>
|
||||
JDate,
|
||||
</#if>
|
||||
<#if query_field_pca>
|
||||
JAreaLinkage,
|
||||
</#if>
|
||||
<#if query_inp>
|
||||
JInput,
|
||||
</#if>
|
||||
<#if query_sel_user>
|
||||
JSelectUserByDep,
|
||||
</#if>
|
||||
<#if query_sel_dep>
|
||||
JSelectDepart,
|
||||
</#if>
|
||||
<#if query_sel_multi>
|
||||
JMultiSelectTag,
|
||||
</#if>
|
||||
<#if query_sel_cat>
|
||||
JCategorySelect,
|
||||
</#if>
|
||||
<#if query_sel_search>
|
||||
JSearchSelectTag,
|
||||
</#if>
|
||||
<#list subTables as sub>
|
||||
${sub.entityName}List,
|
||||
</#list>
|
||||
${entityName}Modal,
|
||||
JSuperQuery
|
||||
${entityName}Modal
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
|
||||
@ -84,13 +84,11 @@
|
||||
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import ${sub.entityName}Modal from './modules/${sub.entityName}Modal'
|
||||
import JSuperQuery from '@/components/jeecg/JSuperQuery.vue'
|
||||
|
||||
|
||||
export default {
|
||||
name: "${sub.entityName}List",
|
||||
mixins:[JeecgListMixin],
|
||||
components: { ${sub.entityName}Modal,JSuperQuery },
|
||||
components: { ${sub.entityName}Modal },
|
||||
props:{
|
||||
mainId:{
|
||||
type:String,
|
||||
|
||||
@ -12,21 +12,8 @@
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
<a-row>
|
||||
<#assign form_date = false>
|
||||
<#assign form_select = false>
|
||||
<#assign form_select_multi = false>
|
||||
<#assign form_select_search = false>
|
||||
<#assign form_popup = false>
|
||||
<#assign form_sel_depart = false>
|
||||
<#assign form_sel_user = false>
|
||||
<#assign form_file = false>
|
||||
<#assign form_image = false>
|
||||
<#assign form_editor = false>
|
||||
<#assign form_cat_tree = false>
|
||||
<#assign form_cat_back = "">
|
||||
<#assign form_pca = false>
|
||||
<#assign form_md = false>
|
||||
<#assign form_switch=false>
|
||||
<#assign form_span = 24>
|
||||
<#list columns as po>
|
||||
<#if po.isShow =='Y' && po.fieldName != 'id'>
|
||||
@ -39,13 +26,12 @@
|
||||
<a-col :span="${form_span}">
|
||||
<a-form-item label="${po.filedComment}" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<#if po.classType =='date'>
|
||||
<#assign form_date=true>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='datetime'>
|
||||
<#assign form_date=true>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='time'>
|
||||
<j-time placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='popup'>
|
||||
<#assign form_popup=true>
|
||||
<j-popup
|
||||
v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"
|
||||
:trigger-change="true"
|
||||
@ -55,32 +41,24 @@
|
||||
@callback="popupCallback"
|
||||
<#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='sel_depart'>
|
||||
<#assign form_sel_depart=true>
|
||||
<j-select-depart v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" multi <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='switch'>
|
||||
<#assign form_switch=true>
|
||||
<j-switch v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" <#if po.dictField?default("")?trim?length gt 1>:options="${po.dictField}"</#if> <#if po.readonly=='Y'>disabled</#if>></j-switch>
|
||||
<#elseif po.classType =='pca'>
|
||||
<#assign form_pca=true>
|
||||
<j-area-linkage type="cascader" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入省市区" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='markdown'>
|
||||
<#assign form_md=true>
|
||||
<j-markdown-editor v-decorator="['${po.fieldName}']" id="${po.fieldName}"></j-markdown-editor>
|
||||
<j-markdown-editor v-decorator="[${autoStringSuffix(po)},{initialValue:''}]" id="${po.fieldName}"></j-markdown-editor>
|
||||
<#elseif po.classType =='password'>
|
||||
<a-input-password v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='sel_user'>
|
||||
<#assign form_sel_user = true>
|
||||
<j-select-user-by-dep v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='textarea'>
|
||||
<a-textarea v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" rows="4" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<a-textarea v-decorator="[${autoStringSuffix(po)}${autoWriteRules(po)}]" rows="4" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType=='list' || po.classType=='radio'>
|
||||
<#assign form_select = true>
|
||||
<j-dict-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType=='list_multi' || po.classType=='checkbox'>
|
||||
<#assign form_select_multi = true>
|
||||
<j-multi-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType=='sel_search'>
|
||||
<#assign form_select_search = true>
|
||||
<j-search-select-tag v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" dict="${form_field_dictCode}" <#if po.readonly=='Y'>disabled</#if> />
|
||||
<#elseif po.classType=='cat_tree'>
|
||||
<#assign form_cat_tree = true>
|
||||
@ -91,18 +69,14 @@
|
||||
<#elseif po.fieldDbType=='int' || po.fieldDbType=='double' || po.fieldDbType=='BigDecimal'>
|
||||
<a-input-number v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType=='file'>
|
||||
<#assign form_file = true>
|
||||
<j-upload v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" <#if po.readonly=='Y'>disabled</#if> <#if po.uploadnum??>:number=${po.uploadnum}</#if>></j-upload>
|
||||
<#elseif po.classType=='image'>
|
||||
<#assign form_image = true>
|
||||
<j-image-upload isMultiple <#if po.uploadnum??>:number=${po.uploadnum}</#if> v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" <#if po.readonly=='Y'>disabled</#if>></j-image-upload>
|
||||
<#elseif po.classType=='umeditor'>
|
||||
<#assign form_editor = true>
|
||||
<j-editor v-decorator="['${po.fieldName}',{trigger:'input'}]" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<j-editor v-decorator="[${autoStringSuffix(po)},{trigger:'input'}]" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.fieldDbType=='Blob'>
|
||||
<a-input v-decorator="['${po.fieldName}String'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>></a-input>
|
||||
<#elseif po.classType == 'sel_tree'>
|
||||
<#assign form_tree_select = true>
|
||||
<j-tree-select
|
||||
ref="treeSelect"
|
||||
placeholder="请选择${po.filedComment}"
|
||||
@ -142,88 +116,10 @@
|
||||
import { httpAction } from '@/api/manage'
|
||||
import pick from 'lodash.pick'
|
||||
import { validateDuplicateValue } from '@/utils/util'
|
||||
<#if form_date>
|
||||
import JDate from '@/components/jeecg/JDate'
|
||||
</#if>
|
||||
<#if form_file>
|
||||
import JUpload from '@/components/jeecg/JUpload'
|
||||
</#if>
|
||||
<#if form_image>
|
||||
import JImageUpload from '@/components/jeecg/JImageUpload'
|
||||
</#if>
|
||||
<#if form_sel_depart>
|
||||
import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
|
||||
</#if>
|
||||
<#if form_sel_user>
|
||||
import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
|
||||
</#if>
|
||||
<#if form_select>
|
||||
import JDictSelectTag from "@/components/dict/JDictSelectTag"
|
||||
</#if>
|
||||
<#if form_select_multi>
|
||||
import JMultiSelectTag from "@/components/dict/JMultiSelectTag"
|
||||
</#if>
|
||||
<#if form_select_search>
|
||||
import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
|
||||
</#if>
|
||||
<#if form_editor>
|
||||
import JEditor from '@/components/jeecg/JEditor'
|
||||
</#if>
|
||||
<#if form_cat_tree>
|
||||
import JCategorySelect from '@/components/jeecg/JCategorySelect'
|
||||
</#if>
|
||||
<#if form_pca>
|
||||
import JAreaLinkage from '@comp/jeecg/JAreaLinkage'
|
||||
</#if>
|
||||
<#if form_md>
|
||||
import JMarkdownEditor from '@/components/jeecg/JMarkdownEditor/index'
|
||||
</#if>
|
||||
<#if form_switch==true >
|
||||
import JSwitch from '@/components/jeecg/JSwitch'
|
||||
</#if>
|
||||
|
||||
export default {
|
||||
name: "${entityName}Modal",
|
||||
components: {
|
||||
<#if form_date>
|
||||
JDate,
|
||||
</#if>
|
||||
<#if form_file>
|
||||
JUpload,
|
||||
</#if>
|
||||
<#if form_image>
|
||||
JImageUpload,
|
||||
</#if>
|
||||
<#if form_sel_depart>
|
||||
JSelectDepart,
|
||||
</#if>
|
||||
<#if form_sel_user>
|
||||
JSelectUserByDep,
|
||||
</#if>
|
||||
<#if form_select>
|
||||
JDictSelectTag,
|
||||
</#if>
|
||||
<#if form_select_multi>
|
||||
JMultiSelectTag,
|
||||
</#if>
|
||||
<#if form_select_search>
|
||||
JSearchSelectTag,
|
||||
</#if>
|
||||
<#if form_editor>
|
||||
JEditor,
|
||||
</#if>
|
||||
<#if form_pca>
|
||||
JAreaLinkage,
|
||||
</#if>
|
||||
<#if form_cat_tree>
|
||||
JCategorySelect,
|
||||
</#if>
|
||||
<#if form_md>
|
||||
JMarkdownEditor,
|
||||
</#if>
|
||||
<#if form_switch==true >
|
||||
JSwitch,
|
||||
</#if>
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
|
||||
@ -14,21 +14,8 @@
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
<a-row>
|
||||
<#assign form_date = false>
|
||||
<#assign form_select = false>
|
||||
<#assign form_select_multi = false>
|
||||
<#assign form_select_search = false>
|
||||
<#assign form_popup = false>
|
||||
<#assign form_sel_depart = false>
|
||||
<#assign form_sel_user = false>
|
||||
<#assign form_file = false>
|
||||
<#assign form_image = false>
|
||||
<#assign form_editor = false>
|
||||
<#assign form_cat_tree = false>
|
||||
<#assign form_cat_back = "">
|
||||
<#assign form_pca = false>
|
||||
<#assign form_md = false>
|
||||
<#assign form_switch=false>
|
||||
<#assign form_span = 24>
|
||||
<#list sub.originalColumns as po>
|
||||
<#if po.isShow =='Y' && po.fieldName != 'id'>
|
||||
@ -41,13 +28,12 @@
|
||||
<a-col :span="${form_span}">
|
||||
<a-form-item label="${po.filedComment}" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<#if po.classType =='date'>
|
||||
<#assign form_date=true>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='datetime'>
|
||||
<#assign form_date=true>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='time'>
|
||||
<j-time placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='popup'>
|
||||
<#assign form_popup=true>
|
||||
<j-popup
|
||||
v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"
|
||||
:trigger-change="true"
|
||||
@ -57,32 +43,24 @@
|
||||
@callback="popupCallback"
|
||||
<#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='sel_depart'>
|
||||
<#assign form_sel_depart=true>
|
||||
<j-select-depart v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" multi <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='switch'>
|
||||
<#assign form_switch=true>
|
||||
<j-switch v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" <#if po.dictField?default("")?trim?length gt 1>:options="${po.dictField}"</#if> <#if po.readonly=='Y'>disabled</#if>></j-switch>
|
||||
<#elseif po.classType =='pca'>
|
||||
<#assign form_pca=true>
|
||||
<j-area-linkage type="cascader" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入省市区" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='markdown'>
|
||||
<#assign form_md=true>
|
||||
<j-markdown-editor v-decorator="['${po.fieldName}']" id="${po.fieldName}"></j-markdown-editor>
|
||||
<j-markdown-editor v-decorator="[${autoStringSuffix(po)},{initialValue:''}]" id="${po.fieldName}"></j-markdown-editor>
|
||||
<#elseif po.classType =='password'>
|
||||
<a-input-password v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='sel_user'>
|
||||
<#assign form_sel_user = true>
|
||||
<j-select-user-by-dep v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='textarea'>
|
||||
<a-textarea v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" rows="4" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<a-textarea v-decorator="[${autoStringSuffix(po)}${autoWriteRules(po)}]" rows="4" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType=='list' || po.classType=='radio'>
|
||||
<#assign form_select = true>
|
||||
<j-dict-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType=='list_multi' || po.classType=='checkbox'>
|
||||
<#assign form_select_multi = true>
|
||||
<j-multi-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType=='sel_search'>
|
||||
<#assign form_select_search = true>
|
||||
<j-search-select-tag v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" dict="${form_field_dictCode}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType=='cat_tree'>
|
||||
<#assign form_cat_tree = true>
|
||||
@ -93,14 +71,11 @@
|
||||
<#elseif po.fieldDbType=='int' || po.fieldDbType=='double' || po.fieldDbType=='BigDecimal'>
|
||||
<a-input-number v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType=='file'>
|
||||
<#assign form_file = true>
|
||||
<j-upload v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" <#if po.readonly=='Y'>disabled</#if> <#if po.uploadnum??>:number=${po.uploadnum}</#if>></j-upload>
|
||||
<#elseif po.classType=='image'>
|
||||
<#assign form_image = true>
|
||||
<j-image-upload isMultiple <#if po.uploadnum??>:number=${po.uploadnum}</#if> v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" <#if po.readonly=='Y'>disabled</#if>></j-image-upload>
|
||||
<#elseif po.classType=='umeditor'>
|
||||
<#assign form_editor = true>
|
||||
<j-editor v-decorator="['${po.fieldName}',{trigger:'input'}]" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<j-editor v-decorator="[${autoStringSuffix(po)},{trigger:'input'}]" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.fieldDbType=='Blob'>
|
||||
<a-input v-decorator="['${po.fieldName}String'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>></a-input>
|
||||
<#else>
|
||||
@ -126,88 +101,10 @@
|
||||
import { httpAction } from '@/api/manage'
|
||||
import pick from 'lodash.pick'
|
||||
import { validateDuplicateValue } from '@/utils/util'
|
||||
<#if form_date>
|
||||
import JDate from '@/components/jeecg/JDate'
|
||||
</#if>
|
||||
<#if form_file>
|
||||
import JUpload from '@/components/jeecg/JUpload'
|
||||
</#if>
|
||||
<#if form_image>
|
||||
import JImageUpload from '@/components/jeecg/JImageUpload'
|
||||
</#if>
|
||||
<#if form_sel_depart>
|
||||
import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
|
||||
</#if>
|
||||
<#if form_sel_user>
|
||||
import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
|
||||
</#if>
|
||||
<#if form_select>
|
||||
import JDictSelectTag from "@/components/dict/JDictSelectTag"
|
||||
</#if>
|
||||
<#if form_select_multi>
|
||||
import JMultiSelectTag from "@/components/dict/JMultiSelectTag"
|
||||
</#if>
|
||||
<#if form_select_search>
|
||||
import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
|
||||
</#if>
|
||||
<#if form_editor>
|
||||
import JEditor from '@/components/jeecg/JEditor'
|
||||
</#if>
|
||||
<#if form_cat_tree>
|
||||
import JCategorySelect from '@/components/jeecg/JCategorySelect'
|
||||
</#if>
|
||||
<#if form_pca>
|
||||
import JAreaLinkage from '@comp/jeecg/JAreaLinkage'
|
||||
</#if>
|
||||
<#if form_md>
|
||||
import JMarkdownEditor from '@/components/jeecg/JMarkdownEditor/index'
|
||||
</#if>
|
||||
<#if form_switch==true >
|
||||
import JSwitch from '@/components/jeecg/JSwitch'
|
||||
</#if>
|
||||
|
||||
export default {
|
||||
name: "${sub.entityName}Modal",
|
||||
components: {
|
||||
<#if form_date>
|
||||
JDate,
|
||||
</#if>
|
||||
<#if form_file>
|
||||
JUpload,
|
||||
</#if>
|
||||
<#if form_image>
|
||||
JImageUpload,
|
||||
</#if>
|
||||
<#if form_sel_depart>
|
||||
JSelectDepart,
|
||||
</#if>
|
||||
<#if form_sel_user>
|
||||
JSelectUserByDep,
|
||||
</#if>
|
||||
<#if form_select>
|
||||
JDictSelectTag,
|
||||
</#if>
|
||||
<#if form_select_multi>
|
||||
JMultiSelectTag,
|
||||
</#if>
|
||||
<#if form_select_search>
|
||||
JSearchSelectTag,
|
||||
</#if>
|
||||
<#if form_editor>
|
||||
JEditor,
|
||||
</#if>
|
||||
<#if form_pca>
|
||||
JAreaLinkage,
|
||||
</#if>
|
||||
<#if form_cat_tree>
|
||||
JCategorySelect,
|
||||
</#if>
|
||||
<#if form_md>
|
||||
JMarkdownEditor,
|
||||
</#if>
|
||||
<#if form_switch==true >
|
||||
JSwitch,
|
||||
</#if>
|
||||
},
|
||||
props:{
|
||||
mainId:{
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package ${bussiPackage}.${entityPackage}.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@ -67,37 +68,6 @@ public class ${entityName} implements Serializable {
|
||||
@Dict(${list_field_dictCode?substring(2)})
|
||||
</#if>
|
||||
</#if>
|
||||
<#if po.fieldDbType=='Blob'>
|
||||
private transient java.lang.String ${po.fieldName}String;
|
||||
|
||||
private byte[] ${po.fieldName};
|
||||
|
||||
public byte[] get${po.fieldName?cap_first}(){
|
||||
if(${po.fieldName}String==null){
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return ${po.fieldName}String.getBytes("UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public String get${po.fieldName?cap_first}String(){
|
||||
if(${po.fieldName}==null || ${po.fieldName}.length==0){
|
||||
return "";
|
||||
}
|
||||
try {
|
||||
return new String(${po.fieldName},"UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
<#else>
|
||||
@ApiModelProperty(value = "${po.filedComment}")
|
||||
private ${po.fieldType} ${po.fieldName};
|
||||
</#if>
|
||||
<#include "/common/blob.ftl">
|
||||
</#list>
|
||||
}
|
||||
|
||||
@ -14,6 +14,7 @@ import java.util.Date;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
/**
|
||||
* @Description: ${subTab.ftlDescription}
|
||||
@ -69,8 +70,8 @@ public class ${subTab.entityName} implements Serializable {
|
||||
<#if list_field_dictCode?length gt 1>
|
||||
@Dict(${list_field_dictCode?substring(2)})
|
||||
</#if>
|
||||
@ApiModelProperty(value = "${po.filedComment}")
|
||||
private <#if po.fieldType=='java.sql.Blob'>byte[]<#else>${po.fieldType}</#if> ${po.fieldName};
|
||||
<#-- 大字段转换 -->
|
||||
<#include "/common/blob.ftl">
|
||||
</#list>
|
||||
}
|
||||
</#list>
|
||||
@ -68,7 +68,11 @@ public class ${entityName}Page {
|
||||
</#if>
|
||||
</#if>
|
||||
@ApiModelProperty(value = "${po.filedComment}")
|
||||
private <#if po.fieldType=='java.sql.Blob'>byte[]<#else>${po.fieldType}</#if> ${po.fieldName};
|
||||
<#if po.fieldDbType=='Blob'>
|
||||
private java.lang.String ${po.fieldName}String;
|
||||
<#else>
|
||||
private ${po.fieldType} ${po.fieldName};
|
||||
</#if>
|
||||
</#list>
|
||||
|
||||
<#list subTables as sub>
|
||||
|
||||
@ -317,7 +317,6 @@
|
||||
import JCategorySelect from '@comp/jeecg/JCategorySelect'
|
||||
</#if>
|
||||
import '@/assets/less/TableExpand.less'
|
||||
import JSuperQuery from '@/components/jeecg/JSuperQuery.vue'
|
||||
|
||||
export default {
|
||||
name: '${entityName}List',
|
||||
@ -351,7 +350,6 @@
|
||||
<#if query_sel_cat>
|
||||
JCategorySelect,
|
||||
</#if>
|
||||
JSuperQuery
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -377,7 +375,7 @@
|
||||
<#if po.classType == 'date'>
|
||||
dataIndex: '${po.fieldName}',
|
||||
<#elseif po.fieldDbType=='Blob'>
|
||||
dataIndex: '${po.fieldName}String'
|
||||
dataIndex: '${po.fieldName}String'
|
||||
<#elseif po.classType=='umeditor'>
|
||||
dataIndex: '${po.fieldName}',
|
||||
scopedSlots: {customRender: 'htmlSlot'}
|
||||
|
||||
@ -13,21 +13,8 @@
|
||||
<!-- 主表单区域 -->
|
||||
<a-form :form="form">
|
||||
<a-row>
|
||||
<#assign form_date = false>
|
||||
<#assign form_select = false>
|
||||
<#assign form_select_multi = false>
|
||||
<#assign form_select_search = false>
|
||||
<#assign form_popup = false>
|
||||
<#assign form_sel_depart = false>
|
||||
<#assign form_sel_user = false>
|
||||
<#assign form_file = false>
|
||||
<#assign form_image = false>
|
||||
<#assign form_editor = false>
|
||||
<#assign form_cat_tree = false>
|
||||
<#assign form_cat_back = "">
|
||||
<#assign form_pca = false>
|
||||
<#assign form_md = false>
|
||||
<#assign form_switch=false>
|
||||
<#assign form_span = 24>
|
||||
<#list columns as po>
|
||||
<#if po.isShow =='Y' && po.fieldName != 'id'>
|
||||
@ -45,13 +32,12 @@
|
||||
<a-form-item label="${po.filedComment}" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
</#if>
|
||||
<#if po.classType =='date'>
|
||||
<#assign form_date=true>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='datetime'>
|
||||
<#assign form_date=true>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='time'>
|
||||
<j-time placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='popup'>
|
||||
<#assign form_popup=true>
|
||||
<j-popup
|
||||
v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"
|
||||
:trigger-change="true"
|
||||
@ -61,32 +47,24 @@
|
||||
@callback="popupCallback"
|
||||
<#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='sel_depart'>
|
||||
<#assign form_sel_depart=true>
|
||||
<j-select-depart v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" multi <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='switch'>
|
||||
<#assign form_switch=true>
|
||||
<j-switch v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" <#if po.dictField?default("")?trim?length gt 1>:options="${po.dictField}"</#if> <#if po.readonly=='Y'>disabled</#if>></j-switch>
|
||||
<#elseif po.classType =='pca'>
|
||||
<#assign form_pca=true>
|
||||
<j-area-linkage type="cascader" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入省市区" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='markdown'>
|
||||
<#assign form_md=true>
|
||||
<j-markdown-editor v-decorator="['${po.fieldName}']" id="${po.fieldName}"></j-markdown-editor>
|
||||
<j-markdown-editor v-decorator="[${autoStringSuffix(po)},{initialValue:''}]" id="${po.fieldName}"></j-markdown-editor>
|
||||
<#elseif po.classType =='password'>
|
||||
<a-input-password v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='sel_user'>
|
||||
<#assign form_sel_user = true>
|
||||
<j-select-user-by-dep v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='textarea'>
|
||||
<a-textarea v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" rows="4" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<a-textarea v-decorator="[${autoStringSuffix(po)}${autoWriteRules(po)}]" rows="4" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType=='list' || po.classType=='radio'>
|
||||
<#assign form_select = true>
|
||||
<j-dict-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType=='list_multi' || po.classType=='checkbox'>
|
||||
<#assign form_select_multi = true>
|
||||
<j-multi-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType=='sel_search'>
|
||||
<#assign form_select_search = true>
|
||||
<j-search-select-tag v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" dict="${form_field_dictCode}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType=='cat_tree'>
|
||||
<#assign form_cat_tree = true>
|
||||
@ -97,18 +75,12 @@
|
||||
<#elseif po.fieldDbType=='int' || po.fieldDbType=='double' || po.fieldDbType=='BigDecimal'>
|
||||
<a-input-number v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType=='file'>
|
||||
<#assign form_file = true>
|
||||
<j-upload v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" <#if po.readonly=='Y'>disabled</#if> <#if po.uploadnum??>:number=${po.uploadnum}</#if>></j-upload>
|
||||
<#elseif po.classType=='image'>
|
||||
<#assign form_image = true>
|
||||
<j-image-upload isMultiple <#if po.uploadnum??>:number=${po.uploadnum}</#if> v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" <#if po.readonly=='Y'>disabled</#if>></j-image-upload>
|
||||
<#elseif po.classType=='umeditor'>
|
||||
<#assign form_editor = true>
|
||||
<j-editor v-decorator="['${po.fieldName}',{trigger:'input'}]" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.fieldDbType=='Blob'>
|
||||
<a-input v-decorator="['${po.fieldName}String'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>></a-input>
|
||||
<j-editor v-decorator="[${autoStringSuffix(po)},{trigger:'input'}]" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType == 'sel_tree'>
|
||||
<#assign form_tree_select = true>
|
||||
<j-tree-select
|
||||
ref="treeSelect"
|
||||
placeholder="请选择${po.filedComment}"
|
||||
@ -126,7 +98,7 @@
|
||||
<#if po.readonly=='Y'>disabled</#if>>
|
||||
</j-tree-select>
|
||||
<#else>
|
||||
<a-input v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>></a-input>
|
||||
<a-input v-decorator="[${autoStringSuffix(po)}${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>></a-input>
|
||||
</#if>
|
||||
</a-form-item>
|
||||
<#if form_cat_tree && form_cat_back?length gt 1>
|
||||
@ -181,45 +153,6 @@
|
||||
import ${sub.entityName}Form from './${sub.entityName}Form.vue'
|
||||
</#if>
|
||||
</#list>
|
||||
<#if form_date>
|
||||
import JDate from '@/components/jeecg/JDate'
|
||||
</#if>
|
||||
<#if form_file>
|
||||
import JUpload from '@/components/jeecg/JUpload'
|
||||
</#if>
|
||||
<#if form_image>
|
||||
import JImageUpload from '@/components/jeecg/JImageUpload'
|
||||
</#if>
|
||||
<#if form_sel_depart>
|
||||
import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
|
||||
</#if>
|
||||
<#if form_sel_user>
|
||||
import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
|
||||
</#if>
|
||||
<#if form_select>
|
||||
import JDictSelectTag from "@/components/dict/JDictSelectTag"
|
||||
</#if>
|
||||
<#if form_select_multi>
|
||||
import JMultiSelectTag from "@/components/dict/JMultiSelectTag"
|
||||
</#if>
|
||||
<#if form_select_search>
|
||||
import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
|
||||
</#if>
|
||||
<#if form_editor>
|
||||
import JEditor from '@/components/jeecg/JEditor'
|
||||
</#if>
|
||||
<#if form_cat_tree>
|
||||
import JCategorySelect from '@/components/jeecg/JCategorySelect'
|
||||
</#if>
|
||||
<#if form_pca>
|
||||
import JAreaLinkage from '@comp/jeecg/JAreaLinkage'
|
||||
</#if>
|
||||
<#if form_md>
|
||||
import JMarkdownEditor from '@/components/jeecg/JMarkdownEditor/index'
|
||||
</#if>
|
||||
<#if form_switch==true >
|
||||
import JSwitch from '@/components/jeecg/JSwitch'
|
||||
</#if>
|
||||
|
||||
export default {
|
||||
name: '${entityName}Modal',
|
||||
@ -230,45 +163,6 @@
|
||||
${sub.entityName}Form,
|
||||
</#if>
|
||||
</#list>
|
||||
<#if form_date>
|
||||
JDate,
|
||||
</#if>
|
||||
<#if form_file>
|
||||
JUpload,
|
||||
</#if>
|
||||
<#if form_image>
|
||||
JImageUpload,
|
||||
</#if>
|
||||
<#if form_sel_depart>
|
||||
JSelectDepart,
|
||||
</#if>
|
||||
<#if form_sel_user>
|
||||
JSelectUserByDep,
|
||||
</#if>
|
||||
<#if form_select>
|
||||
JDictSelectTag,
|
||||
</#if>
|
||||
<#if form_select_multi>
|
||||
JMultiSelectTag,
|
||||
</#if>
|
||||
<#if form_select_search>
|
||||
JSearchSelectTag,
|
||||
</#if>
|
||||
<#if form_editor>
|
||||
JEditor,
|
||||
</#if>
|
||||
<#if form_pca>
|
||||
JAreaLinkage,
|
||||
</#if>
|
||||
<#if form_cat_tree>
|
||||
JCategorySelect,
|
||||
</#if>
|
||||
<#if form_md>
|
||||
JMarkdownEditor,
|
||||
</#if>
|
||||
<#if form_switch==true >
|
||||
JSwitch,
|
||||
</#if>
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -309,7 +203,7 @@
|
||||
<#if col.filedComment !='外键' >
|
||||
{
|
||||
title: '${col.filedComment}',
|
||||
key: '${col.fieldName}',
|
||||
key: ${autoStringSuffix(col)},
|
||||
<#if col.classType =='date'>
|
||||
type: FormTypes.date,
|
||||
<#if col.readonly=='Y'>
|
||||
@ -485,7 +379,7 @@
|
||||
},
|
||||
/** 调用完edit()方法之后会自动调用此方法 */
|
||||
editAfter() {
|
||||
let fieldval = pick(this.model<#list columns as po><#if po.fieldName !='id'><#if po.fieldDbType=='Blob'>,'${po.fieldName}String'<#else>,'${po.fieldName}'</#if></#if></#list>)
|
||||
let fieldval = pick(this.model<#list columns as po><#if po.fieldName !='id'>,${autoStringSuffix(po)}</#if></#list>)
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(fieldval)
|
||||
<#list subTables as sub><#rt/>
|
||||
@ -525,7 +419,7 @@
|
||||
this.$message.error(msg)
|
||||
},
|
||||
popupCallback(row){
|
||||
this.form.setFieldsValue(pick(row<#list columns as po><#if po.fieldName !='id'><#if po.fieldDbType=='Blob'>,'${po.fieldName}String'<#else>,'${po.fieldName}'</#if></#if></#list>))
|
||||
this.form.setFieldsValue(pick(row<#list columns as po><#if po.fieldName !='id'>,${autoStringSuffix(po)}</#if></#list>))
|
||||
},
|
||||
<#if form_cat_tree>
|
||||
handleCategoryChange(value,backObj){
|
||||
|
||||
@ -6,15 +6,6 @@
|
||||
<div>
|
||||
<a-form :form="form">
|
||||
<a-row>
|
||||
<#assign form_date = false>
|
||||
<#assign form_select = false>
|
||||
<#assign form_select_multi = false>
|
||||
<#assign form_popup = false>
|
||||
<#assign form_sel_depart = false>
|
||||
<#assign form_sel_user = false>
|
||||
<#assign form_file = false>
|
||||
<#assign form_image = false>
|
||||
<#assign form_switch=false>
|
||||
|
||||
<#list sub.colums as po>
|
||||
<#if po.isShow =='Y'>
|
||||
@ -32,13 +23,12 @@
|
||||
<a-form-item label="${po.filedComment}" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
</#if>
|
||||
<#if po.classType =='date'>
|
||||
<#assign form_date=true>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" style="width: 100%"/>
|
||||
<#elseif po.classType =='datetime'>
|
||||
<#assign form_date=true>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"/>
|
||||
<#elseif po.classType =='time'>
|
||||
<j-time placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='popup'>
|
||||
<#assign form_popup=true>
|
||||
<j-popup
|
||||
v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"
|
||||
:trigger-change="true"
|
||||
@ -47,32 +37,25 @@
|
||||
code="${po.dictTable}"
|
||||
@callback="popupCallback"/>
|
||||
<#elseif po.classType =='switch'>
|
||||
<#assign form_switch=true>
|
||||
<j-switch v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" <#if po.dictField?default("")?trim?length gt 1>:options="${po.dictField}"</#if>></j-switch>
|
||||
<#elseif po.classType =='sel_depart'>
|
||||
<#assign form_sel_depart=true>
|
||||
<j-select-depart v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true"/>
|
||||
<#elseif po.classType =='sel_user'>
|
||||
<#assign form_sel_user = true>
|
||||
<j-select-user-by-dep v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true"/>
|
||||
<#elseif po.classType =='textarea'>
|
||||
<a-textarea v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" rows="4" placeholder="请输入${po.filedComment}"/>
|
||||
<a-textarea v-decorator="[${autoStringSuffix(po)}${autoWriteRules(po)}]" rows="4" placeholder="请输入${po.filedComment}"/>
|
||||
<#elseif po.classType=='list' || po.classType=='radio'>
|
||||
<#assign form_select = true>
|
||||
<j-dict-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}"/>
|
||||
<#elseif po.classType=='list_multi' || po.classType=='checkbox'>
|
||||
<#assign form_select_multi = true>
|
||||
<j-multi-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}"/>
|
||||
<#elseif po.fieldDbType=='int' || po.fieldDbType=='double' || po.fieldDbType=='BigDecimal'>
|
||||
<a-input-number v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" style="width: 100%"/>
|
||||
<#elseif po.classType=='file'>
|
||||
<#assign form_file = true>
|
||||
<j-upload v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true"></j-upload>
|
||||
<#elseif po.classType=='image'>
|
||||
<#assign form_image = true>
|
||||
<j-image-upload isMultiple v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"></j-image-upload>
|
||||
<#else>
|
||||
<a-input v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}"></a-input>
|
||||
<a-input v-decorator="[${autoStringSuffix(po)}${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}"></a-input>
|
||||
</#if>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@ -86,58 +69,10 @@
|
||||
import pick from 'lodash.pick'
|
||||
import { getAction } from '@/api/manage'
|
||||
import { validateDuplicateValue } from '@/utils/util'
|
||||
<#if form_date>
|
||||
import JDate from '@/components/jeecg/JDate'
|
||||
</#if>
|
||||
<#if form_file>
|
||||
import JUpload from '@/components/jeecg/JUpload'
|
||||
</#if>
|
||||
<#if form_image>
|
||||
import JImageUpload from '@/components/jeecg/JImageUpload'
|
||||
</#if>
|
||||
<#if form_sel_depart>
|
||||
import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
|
||||
</#if>
|
||||
<#if form_sel_user>
|
||||
import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
|
||||
</#if>
|
||||
<#if form_select>
|
||||
import JDictSelectTag from "@/components/dict/JDictSelectTag"
|
||||
</#if>
|
||||
<#if form_select_multi>
|
||||
import JMultiSelectTag from "@/components/dict/JMultiSelectTag"
|
||||
</#if>
|
||||
<#if form_switch==true >
|
||||
import JSwitch from '@/components/jeecg/JSwitch'
|
||||
</#if>
|
||||
|
||||
export default {
|
||||
name: '${sub.entityName}Form',
|
||||
components: {
|
||||
<#if form_date>
|
||||
JDate,
|
||||
</#if>
|
||||
<#if form_file>
|
||||
JUpload,
|
||||
</#if>
|
||||
<#if form_image>
|
||||
JImageUpload,
|
||||
</#if>
|
||||
<#if form_sel_depart>
|
||||
JSelectDepart,
|
||||
</#if>
|
||||
<#if form_sel_user>
|
||||
JSelectUserByDep,
|
||||
</#if>
|
||||
<#if form_select>
|
||||
JDictSelectTag,
|
||||
</#if>
|
||||
<#if form_select_multi>
|
||||
JMultiSelectTag,
|
||||
</#if>
|
||||
<#if form_switch==true >
|
||||
JSwitch,
|
||||
</#if>
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
@ -182,7 +117,7 @@
|
||||
edit(record){
|
||||
this.model = Object.assign({}, record)
|
||||
console.log("${sub.entityName}Form-edit",this.model);
|
||||
let fieldval = pick(this.model<#list sub.colums as po><#if po.fieldName !='id'>,'${po.fieldName}'</#if></#list>)
|
||||
let fieldval = pick(this.model<#list sub.colums as po><#if po.fieldName !='id'>,${autoStringSuffix(po)}</#if></#list>)
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(fieldval)
|
||||
})
|
||||
@ -209,7 +144,7 @@
|
||||
return formdata_arr;
|
||||
},
|
||||
popupCallback(row){
|
||||
this.form.setFieldsValue(pick(row<#list sub.colums as po><#if po.fieldName !='id'>,'${po.fieldName}'</#if></#list>))
|
||||
this.form.setFieldsValue(pick(row<#list sub.colums as po><#if po.fieldName !='id'>,${autoStringSuffix(po)}</#if></#list>))
|
||||
},
|
||||
clearFormData(){
|
||||
this.form.resetFields()
|
||||
|
||||
@ -68,8 +68,8 @@
|
||||
align: 'center',
|
||||
<#if po.classType == 'date'>
|
||||
dataIndex: '${po.fieldName}',
|
||||
<#elseif po.fieldDbType=='Blob'>
|
||||
dataIndex: '${po.fieldName}String'
|
||||
<#elseif po.fieldDbType=='Blob'>
|
||||
dataIndex: '${po.fieldName}String'
|
||||
<#elseif po.classType=='umeditor'>
|
||||
dataIndex: '${po.fieldName}',
|
||||
scopedSlots: {customRender: 'htmlSlot'}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package ${bussiPackage}.${entityPackage}.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@ -67,37 +68,6 @@ public class ${entityName} implements Serializable {
|
||||
@Dict(${list_field_dictCode?substring(2)})
|
||||
</#if>
|
||||
</#if>
|
||||
<#if po.fieldDbType=='Blob'>
|
||||
private transient java.lang.String ${po.fieldName}String;
|
||||
|
||||
private byte[] ${po.fieldName};
|
||||
|
||||
public byte[] get${po.fieldName?cap_first}(){
|
||||
if(${po.fieldName}String==null){
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return ${po.fieldName}String.getBytes("UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public String get${po.fieldName?cap_first}String(){
|
||||
if(${po.fieldName}==null || ${po.fieldName}.length==0){
|
||||
return "";
|
||||
}
|
||||
try {
|
||||
return new String(${po.fieldName},"UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
<#else>
|
||||
@ApiModelProperty(value = "${po.filedComment}")
|
||||
private ${po.fieldType} ${po.fieldName};
|
||||
</#if>
|
||||
<#include "/common/blob.ftl">
|
||||
</#list>
|
||||
}
|
||||
|
||||
@ -13,6 +13,7 @@ import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import java.util.Date;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
/**
|
||||
* @Description: ${subTab.ftlDescription}
|
||||
@ -65,8 +66,8 @@ public class ${subTab.entityName} implements Serializable {
|
||||
</#if>
|
||||
</#if>
|
||||
</#if>
|
||||
@ApiModelProperty(value = "${po.filedComment}")
|
||||
private <#if po.fieldType=='java.sql.Blob'>byte[]<#else>${po.fieldType}</#if> ${po.fieldName};
|
||||
<#-- 大字段转换 -->
|
||||
<#include "/common/blob.ftl">
|
||||
</#list>
|
||||
}
|
||||
</#list>
|
||||
@ -68,7 +68,11 @@ public class ${entityName}Page {
|
||||
</#if>
|
||||
</#if>
|
||||
@ApiModelProperty(value = "${po.filedComment}")
|
||||
private <#if po.fieldType=='java.sql.Blob'>byte[]<#else>${po.fieldType}</#if> ${po.fieldName};
|
||||
<#if po.fieldDbType=='Blob'>
|
||||
private java.lang.String ${po.fieldName}String;
|
||||
<#else>
|
||||
private ${po.fieldType} ${po.fieldName};
|
||||
</#if>
|
||||
</#list>
|
||||
|
||||
<#list subTables as sub>
|
||||
|
||||
@ -5,20 +5,10 @@
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
<#assign query_field_no=0>
|
||||
<#assign query_field_select=false>
|
||||
<#assign query_field_date=false>
|
||||
<#assign list_need_dict=false>
|
||||
<#assign list_need_category=false>
|
||||
<#assign query_field_pca=false>
|
||||
<#assign list_need_pca=false>
|
||||
<#assign query_flag=false>
|
||||
<#assign query_inp=false>
|
||||
<#assign query_popup=false>
|
||||
<#assign query_sel_user=false>
|
||||
<#assign query_sel_dep=false>
|
||||
<#assign query_sel_multi=false>
|
||||
<#assign query_sel_cat=false>
|
||||
<#assign query_sel_search=false>
|
||||
<#assign bpm_flag=false>
|
||||
|
||||
<#-- 开始循环 -->
|
||||
@ -41,33 +31,24 @@
|
||||
<#if query_field_no gt 1> </#if><a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<#if query_field_no gt 1> </#if><a-form-item label="${po.filedComment}">
|
||||
<#if po.classType=='sel_search'>
|
||||
<#assign query_sel_search=true>
|
||||
<#if query_field_no gt 1> </#if><j-search-select-tag placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}" dict="${po.dictTable},${po.dictText},${po.dictField}"/>
|
||||
<#elseif po.classType=='sel_user'>
|
||||
<#assign query_sel_user=true>
|
||||
<#if query_field_no gt 1> </#if><j-select-user-by-dep placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}"/>
|
||||
<#elseif po.classType=='sel_depart'>
|
||||
<#assign query_sel_dep=true>
|
||||
<#if query_field_no gt 1> </#if><j-select-depart placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}"/>
|
||||
<#elseif po.classType=='list_multi'>
|
||||
<#assign query_sel_multi=true>
|
||||
<#if query_field_no gt 1> </#if><j-multi-select-tag placeholder="请选择${po.filedComment}" dictCode="${query_field_dictCode?default("")}" v-model="queryParam.${po.fieldName}"/>
|
||||
<#elseif po.classType=='cat_tree'>
|
||||
<#assign query_sel_cat=true>
|
||||
<#if query_field_no gt 1> </#if><j-category-select placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}" pcode="${po.dictField?default("")}"/>
|
||||
<#elseif po.classType=='date'>
|
||||
<#assign query_field_date=true>
|
||||
<#if query_field_no gt 1> </#if><j-date placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}"></j-date>
|
||||
<#elseif po.classType=='datetime'>
|
||||
<#assign query_field_date=true>
|
||||
<#if query_field_no gt 1> </#if><j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}"></j-date>
|
||||
<#elseif po.classType=='pca'>
|
||||
<#assign query_field_pca=true>
|
||||
<#if query_field_no gt 1> </#if><j-area-linkage type="cascader" v-model="queryParam.${po.fieldName}" placeholder="请选择省市区"/>
|
||||
<#elseif po.classType=='popup'>
|
||||
<#if query_field_no gt 1> </#if><j-popup placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}" code="${po.dictTable}" org-fields="${po.dictField}" dest-fields="${po.dictText}" :field="getPopupField('${po.dictText}')"/>
|
||||
<#elseif po.classType=='list' || po.classType=='radio' || po.classType=='checkbox'>
|
||||
<#assign query_field_select=true>
|
||||
<#-- ---------------------------下拉或是单选 判断数据字典是表字典还是普通字典------------------------------- -->
|
||||
<#if po.dictTable?default("")?trim?length gt 1>
|
||||
<#if query_field_no gt 1> </#if><j-dict-select-tag placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}" dictCode="${po.dictTable},${po.dictText},${po.dictField}"/>
|
||||
@ -85,12 +66,10 @@
|
||||
<#if query_field_no gt 1> </#if><a-col :xl="10" :lg="11" :md="12" :sm="24">
|
||||
<#if query_field_no gt 1> </#if><a-form-item label="${po.filedComment}">
|
||||
<#if po.classType=='date'>
|
||||
<#assign query_field_date=true>
|
||||
<#if query_field_no gt 1> </#if><j-date placeholder="请选择开始日期" class="query-group-cust" v-model="queryParam.${po.fieldName}_begin"></j-date>
|
||||
<#if query_field_no gt 1> </#if><span class="query-group-split-cust"></span>
|
||||
<#if query_field_no gt 1> </#if><j-date placeholder="请选择结束日期" class="query-group-cust" v-model="queryParam.${po.fieldName}_end"></j-date>
|
||||
<#elseif po.classType=='datetime'>
|
||||
<#assign query_field_date=true>
|
||||
<#if query_field_no gt 1> </#if><j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" class="query-group-cust" v-model="queryParam.${po.fieldName}_begin"></j-date>
|
||||
<#if query_field_no gt 1> </#if><span class="query-group-split-cust"></span>
|
||||
<#if query_field_no gt 1> </#if><j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择结束时间" class="query-group-cust" v-model="queryParam.${po.fieldName}_end"></j-date>
|
||||
@ -234,81 +213,25 @@
|
||||
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import ${entityName}Modal from './modules/${entityName}Modal'
|
||||
<#if query_field_select>
|
||||
import JDictSelectTag from '@/components/dict/JDictSelectTag.vue'
|
||||
</#if>
|
||||
<#if query_field_date>
|
||||
import JDate from '@/components/jeecg/JDate.vue'
|
||||
</#if>
|
||||
<#if list_need_category>
|
||||
import { loadCategoryData } from '@/api/api'
|
||||
</#if>
|
||||
<#if list_need_dict>
|
||||
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
|
||||
</#if>
|
||||
<#if query_field_pca>
|
||||
import JAreaLinkage from '@comp/jeecg/JAreaLinkage'
|
||||
</#if>
|
||||
<#if list_need_pca>
|
||||
import Area from '@/components/_util/Area'
|
||||
</#if>
|
||||
<#if query_inp>
|
||||
import JInput from '@comp/jeecg/JInput'
|
||||
</#if>
|
||||
<#if query_sel_user>
|
||||
import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
|
||||
</#if>
|
||||
<#if query_sel_dep>
|
||||
import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
|
||||
</#if>
|
||||
<#if query_sel_multi>
|
||||
import JMultiSelectTag from '@/components/dict/JMultiSelectTag'
|
||||
</#if>
|
||||
<#if query_sel_cat>
|
||||
import JCategorySelect from '@comp/jeecg/JCategorySelect'
|
||||
</#if>
|
||||
<#if query_sel_search>
|
||||
import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
|
||||
</#if>
|
||||
import '@/assets/less/TableExpand.less'
|
||||
<#if bpm_flag>
|
||||
import { postAction } from '@/api/manage'
|
||||
</#if>
|
||||
import JSuperQuery from '@/components/jeecg/JSuperQuery.vue'
|
||||
|
||||
export default {
|
||||
name: "${entityName}List",
|
||||
mixins:[JeecgListMixin],
|
||||
components: {
|
||||
<#if query_field_select>
|
||||
JDictSelectTag,
|
||||
</#if>
|
||||
<#if query_field_date>
|
||||
JDate,
|
||||
</#if>
|
||||
<#if query_field_pca>
|
||||
JAreaLinkage,
|
||||
</#if>
|
||||
<#if query_inp>
|
||||
JInput,
|
||||
</#if>
|
||||
<#if query_sel_user>
|
||||
JSelectUserByDep,
|
||||
</#if>
|
||||
<#if query_sel_dep>
|
||||
JSelectDepart,
|
||||
</#if>
|
||||
<#if query_sel_multi>
|
||||
JMultiSelectTag,
|
||||
</#if>
|
||||
<#if query_sel_cat>
|
||||
JCategorySelect,
|
||||
</#if>
|
||||
<#if query_sel_search>
|
||||
JSearchSelectTag,
|
||||
</#if>
|
||||
${entityName}Modal,
|
||||
JSuperQuery
|
||||
${entityName}Modal
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
|
||||
@ -5,21 +5,8 @@
|
||||
<!-- 主表单区域 -->
|
||||
<a-form :form="form" slot="detail">
|
||||
<a-row>
|
||||
<#assign form_date = false>
|
||||
<#assign form_select = false>
|
||||
<#assign form_select_multi = false>
|
||||
<#assign form_select_search = false>
|
||||
<#assign form_popup = false>
|
||||
<#assign form_sel_depart = false>
|
||||
<#assign form_sel_user = false>
|
||||
<#assign form_file = false>
|
||||
<#assign form_image = false>
|
||||
<#assign form_editor = false>
|
||||
<#assign form_cat_tree = false>
|
||||
<#assign form_cat_back = "">
|
||||
<#assign form_pca = false>
|
||||
<#assign form_md = false>
|
||||
<#assign form_switch=false>
|
||||
<#assign form_span = 24>
|
||||
<#if tableVo.fieldRowNum==2>
|
||||
<#assign form_span = 12>
|
||||
@ -44,13 +31,12 @@
|
||||
<a-form-item label="${po.filedComment}" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
</#if>
|
||||
<#if po.classType =='date'>
|
||||
<#assign form_date=true>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='datetime'>
|
||||
<#assign form_date=true>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='time'>
|
||||
<j-time placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='popup'>
|
||||
<#assign form_popup=true>
|
||||
<j-popup
|
||||
v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"
|
||||
:trigger-change="true"
|
||||
@ -60,32 +46,24 @@
|
||||
@callback="popupCallback"
|
||||
<#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='sel_depart'>
|
||||
<#assign form_sel_depart=true>
|
||||
<j-select-depart v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" multi <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='switch'>
|
||||
<#assign form_switch=true>
|
||||
<j-switch v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" <#if po.dictField?default("")?trim?length gt 1>:options="${po.dictField}"</#if> <#if po.readonly=='Y'>disabled</#if>></j-switch>
|
||||
<#elseif po.classType =='pca'>
|
||||
<#assign form_pca=true>
|
||||
<j-area-linkage type="cascader" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入省市区" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='markdown'>
|
||||
<#assign form_md=true>
|
||||
<j-markdown-editor v-decorator="['${po.fieldName}']" id="${po.fieldName}"></j-markdown-editor>
|
||||
<j-markdown-editor v-decorator="[${autoStringSuffix(po)},{initialValue:''}]" id="${po.fieldName}"></j-markdown-editor>
|
||||
<#elseif po.classType =='password'>
|
||||
<a-input-password v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='sel_user'>
|
||||
<#assign form_sel_user = true>
|
||||
<j-select-user-by-dep v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='textarea'>
|
||||
<a-textarea v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" rows="4" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<a-textarea v-decorator="[${autoStringSuffix(po)}${autoWriteRules(po)}]" rows="4" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType=='list' || po.classType=='radio'>
|
||||
<#assign form_select = true>
|
||||
<j-dict-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType=='list_multi' || po.classType=='checkbox'>
|
||||
<#assign form_select_multi = true>
|
||||
<j-multi-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType=='sel_search'>
|
||||
<#assign form_select_search = true>
|
||||
<j-search-select-tag v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" dict="${form_field_dictCode}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType=='cat_tree'>
|
||||
<#assign form_cat_tree = true>
|
||||
@ -96,18 +74,12 @@
|
||||
<#elseif po.fieldDbType=='int' || po.fieldDbType=='double' || po.fieldDbType=='BigDecimal'>
|
||||
<a-input-number v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType=='file'>
|
||||
<#assign form_file = true>
|
||||
<j-upload v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" <#if po.readonly=='Y'>disabled</#if> <#if po.uploadnum??>:number=${po.uploadnum}</#if>></j-upload>
|
||||
<#elseif po.classType=='image'>
|
||||
<#assign form_image = true>
|
||||
<j-image-upload isMultiple <#if po.uploadnum??>:number=${po.uploadnum}</#if> v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" <#if po.readonly=='Y'>disabled</#if>></j-image-upload>
|
||||
<#elseif po.classType=='umeditor'>
|
||||
<#assign form_editor = true>
|
||||
<j-editor v-decorator="['${po.fieldName}',{trigger:'input'}]" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.fieldDbType=='Blob'>
|
||||
<a-input v-decorator="['${po.fieldName}String'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>></a-input>
|
||||
<j-editor v-decorator="[${autoStringSuffix(po)},{trigger:'input'}]" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType == 'sel_tree'>
|
||||
<#assign form_tree_select = true>
|
||||
<j-tree-select
|
||||
ref="treeSelect"
|
||||
placeholder="请选择${po.filedComment}"
|
||||
@ -125,7 +97,7 @@
|
||||
<#if po.readonly=='Y'>disabled</#if>>
|
||||
</j-tree-select>
|
||||
<#else>
|
||||
<a-input v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>></a-input>
|
||||
<a-input v-decorator="[${autoStringSuffix(po)}${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>></a-input>
|
||||
</#if>
|
||||
</a-form-item>
|
||||
<#if form_cat_tree && form_cat_back?length gt 1>
|
||||
@ -165,6 +137,7 @@
|
||||
</#if>
|
||||
</#list>
|
||||
</a-tabs>
|
||||
<a-row v-if="showFlowSubmitButton" style="text-align: center;width: 100%;margin-top: 16px;"><a-button @click="handleOk">提 交</a-button></a-row>
|
||||
</a-spin>
|
||||
</template>
|
||||
|
||||
@ -182,45 +155,6 @@
|
||||
import ${sub.entityName}Form from './${sub.entityName}Form.vue'
|
||||
</#if>
|
||||
</#list>
|
||||
<#if form_date>
|
||||
import JDate from '@/components/jeecg/JDate'
|
||||
</#if>
|
||||
<#if form_file>
|
||||
import JUpload from '@/components/jeecg/JUpload'
|
||||
</#if>
|
||||
<#if form_image>
|
||||
import JImageUpload from '@/components/jeecg/JImageUpload'
|
||||
</#if>
|
||||
<#if form_sel_depart>
|
||||
import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
|
||||
</#if>
|
||||
<#if form_sel_user>
|
||||
import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
|
||||
</#if>
|
||||
<#if form_select>
|
||||
import JDictSelectTag from "@/components/dict/JDictSelectTag"
|
||||
</#if>
|
||||
<#if form_select_multi>
|
||||
import JMultiSelectTag from "@/components/dict/JMultiSelectTag"
|
||||
</#if>
|
||||
<#if form_select_search>
|
||||
import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
|
||||
</#if>
|
||||
<#if form_editor>
|
||||
import JEditor from '@/components/jeecg/JEditor'
|
||||
</#if>
|
||||
<#if form_cat_tree>
|
||||
import JCategorySelect from '@/components/jeecg/JCategorySelect'
|
||||
</#if>
|
||||
<#if form_pca>
|
||||
import JAreaLinkage from '@comp/jeecg/JAreaLinkage'
|
||||
</#if>
|
||||
<#if form_md>
|
||||
import JMarkdownEditor from '@/components/jeecg/JMarkdownEditor/index'
|
||||
</#if>
|
||||
<#if form_switch==true >
|
||||
import JSwitch from '@/components/jeecg/JSwitch'
|
||||
</#if>
|
||||
|
||||
export default {
|
||||
name: '${entityName}Form',
|
||||
@ -232,45 +166,6 @@
|
||||
${sub.entityName}Form,
|
||||
</#if>
|
||||
</#list>
|
||||
<#if form_date>
|
||||
JDate,
|
||||
</#if>
|
||||
<#if form_file>
|
||||
JUpload,
|
||||
</#if>
|
||||
<#if form_image>
|
||||
JImageUpload,
|
||||
</#if>
|
||||
<#if form_sel_depart>
|
||||
JSelectDepart,
|
||||
</#if>
|
||||
<#if form_sel_user>
|
||||
JSelectUserByDep,
|
||||
</#if>
|
||||
<#if form_select>
|
||||
JDictSelectTag,
|
||||
</#if>
|
||||
<#if form_select_multi>
|
||||
JMultiSelectTag,
|
||||
</#if>
|
||||
<#if form_select_search>
|
||||
JSearchSelectTag,
|
||||
</#if>
|
||||
<#if form_editor>
|
||||
JEditor,
|
||||
</#if>
|
||||
<#if form_pca>
|
||||
JAreaLinkage,
|
||||
</#if>
|
||||
<#if form_cat_tree>
|
||||
JCategorySelect,
|
||||
</#if>
|
||||
<#if form_md>
|
||||
JMarkdownEditor,
|
||||
</#if>
|
||||
<#if form_switch==true >
|
||||
JSwitch,
|
||||
</#if>
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -312,7 +207,7 @@
|
||||
<#if col.filedComment !='外键' >
|
||||
{
|
||||
title: '${col.filedComment}',
|
||||
key: '${col.fieldName}',
|
||||
key: ${autoStringSuffix(col)},
|
||||
<#if col.classType =='date'>
|
||||
type: JVXETypes.date,
|
||||
<#if col.readonly=='Y'>
|
||||
@ -556,7 +451,7 @@
|
||||
},
|
||||
/** 调用完edit()方法之后会自动调用此方法 */
|
||||
editAfter() {
|
||||
let fieldval = pick(this.model<#list columns as po><#if po.fieldName !='id'><#if po.fieldDbType=='Blob'>,'${po.fieldName}String'<#else>,'${po.fieldName}'</#if></#if></#list>)
|
||||
let fieldval = pick(this.model<#list columns as po><#if po.fieldName !='id'>,${autoStringSuffix(po)}</#if></#list>)
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(fieldval)
|
||||
<#list subTables as sub><#rt/>
|
||||
@ -606,7 +501,7 @@
|
||||
this.$message.error(msg)
|
||||
},
|
||||
popupCallback(row){
|
||||
this.form.setFieldsValue(pick(row<#list columns as po><#if po.fieldName !='id'><#if po.fieldDbType=='Blob'>,'${po.fieldName}String'<#else>,'${po.fieldName}'</#if></#if></#list>))
|
||||
this.form.setFieldsValue(pick(row<#list columns as po><#if po.fieldName !='id'>,${autoStringSuffix(po)}</#if></#list>))
|
||||
},
|
||||
<#if form_cat_tree>
|
||||
handleCategoryChange(value,backObj){
|
||||
|
||||
@ -6,21 +6,8 @@
|
||||
<j-form-container :disabled="disabled">
|
||||
<a-form :form="form" slot="detail">
|
||||
<a-row>
|
||||
<#assign form_date = false>
|
||||
<#assign form_select = false>
|
||||
<#assign form_select_multi = false>
|
||||
<#assign form_select_search = false>
|
||||
<#assign form_popup = false>
|
||||
<#assign form_sel_depart = false>
|
||||
<#assign form_sel_user = false>
|
||||
<#assign form_file = false>
|
||||
<#assign form_image = false>
|
||||
<#assign form_editor = false>
|
||||
<#assign form_cat_tree = false>
|
||||
<#assign form_cat_back = "">
|
||||
<#assign form_pca = false>
|
||||
<#assign form_md = false>
|
||||
<#assign form_switch=false>
|
||||
<#assign form_span = 24>
|
||||
<#if tableVo.fieldRowNum == 2>
|
||||
<#assign form_span = 12>
|
||||
@ -45,13 +32,12 @@
|
||||
<a-form-item label="${po.filedComment}" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
</#if>
|
||||
<#if po.classType =='date'>
|
||||
<#assign form_date=true>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" style="width: 100%"/>
|
||||
<#elseif po.classType =='datetime'>
|
||||
<#assign form_date=true>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"/>
|
||||
<#elseif po.classType =='time'>
|
||||
<j-time placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='popup'>
|
||||
<#assign form_popup=true>
|
||||
<j-popup
|
||||
v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"
|
||||
:trigger-change="true"
|
||||
@ -60,32 +46,24 @@
|
||||
code="${po.dictTable}"
|
||||
@callback="popupCallback"/>
|
||||
<#elseif po.classType =='sel_depart'>
|
||||
<#assign form_sel_depart=true>
|
||||
<j-select-depart v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" multi/>
|
||||
<#elseif po.classType =='switch'>
|
||||
<#assign form_switch=true>
|
||||
<j-switch v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" <#if po.dictField?default("")?trim?length gt 1>:options="${po.dictField}"</#if>></j-switch>
|
||||
<#elseif po.classType =='pca'>
|
||||
<#assign form_pca=true>
|
||||
<j-area-linkage type="cascader" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入省市区"/>
|
||||
<#elseif po.classType =='markdown'>
|
||||
<#assign form_md=true>
|
||||
<j-markdown-editor v-decorator="['${po.fieldName}']" id="${po.fieldName}"></j-markdown-editor>
|
||||
<j-markdown-editor v-decorator="[${autoStringSuffix(po)},{initialValue:''}]" id="${po.fieldName}"></j-markdown-editor>
|
||||
<#elseif po.classType =='password'>
|
||||
<a-input-password v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}"/>
|
||||
<#elseif po.classType =='sel_user'>
|
||||
<#assign form_sel_user = true>
|
||||
<j-select-user-by-dep v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"/>
|
||||
<#elseif po.classType =='textarea'>
|
||||
<a-textarea v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" rows="4" placeholder="请输入${po.filedComment}"/>
|
||||
<a-textarea v-decorator="[${autoStringSuffix(po)}${autoWriteRules(po)}]" rows="4" placeholder="请输入${po.filedComment}"/>
|
||||
<#elseif po.classType=='list' || po.classType=='radio'>
|
||||
<#assign form_select = true>
|
||||
<j-dict-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}"/>
|
||||
<#elseif po.classType=='list_multi' || po.classType=='checkbox'>
|
||||
<#assign form_select_multi = true>
|
||||
<j-multi-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}"/>
|
||||
<#elseif po.classType=='sel_search'>
|
||||
<#assign form_select_search = true>
|
||||
<j-search-select-tag v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" dict="${form_field_dictCode}" />
|
||||
<#elseif po.classType=='cat_tree'>
|
||||
<#assign form_cat_tree = true>
|
||||
@ -96,18 +74,13 @@
|
||||
<#elseif po.fieldDbType=='int' || po.fieldDbType=='double' || po.fieldDbType=='BigDecimal'>
|
||||
<a-input-number v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" style="width: 100%"/>
|
||||
<#elseif po.classType=='file'>
|
||||
<#assign form_file = true>
|
||||
<j-upload v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true"></j-upload>
|
||||
<#elseif po.classType=='image'>
|
||||
<#assign form_image = true>
|
||||
<j-image-upload isMultiple v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"></j-image-upload>
|
||||
<#elseif po.classType=='umeditor'>
|
||||
<#assign form_editor = true>
|
||||
<j-editor v-decorator="['${po.fieldName}',{trigger:'input'}]"/>
|
||||
<#elseif po.fieldDbType=='Blob'>
|
||||
<a-input v-decorator="['${po.fieldName}String'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}"></a-input>
|
||||
<j-editor v-decorator="[${autoStringSuffix(po)},{trigger:'input'}]"/>
|
||||
<#else>
|
||||
<a-input v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}"></a-input>
|
||||
<a-input v-decorator="[${autoStringSuffix(po)}${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}"></a-input>
|
||||
</#if>
|
||||
</a-form-item>
|
||||
<#if form_cat_tree && form_cat_back?length gt 1>
|
||||
@ -127,89 +100,11 @@
|
||||
import { getAction } from '@/api/manage'
|
||||
import { validateDuplicateValue } from '@/utils/util'
|
||||
import JFormContainer from '@/components/jeecg/JFormContainer'
|
||||
<#if form_date>
|
||||
import JDate from '@/components/jeecg/JDate'
|
||||
</#if>
|
||||
<#if form_file>
|
||||
import JUpload from '@/components/jeecg/JUpload'
|
||||
</#if>
|
||||
<#if form_image>
|
||||
import JImageUpload from '@/components/jeecg/JImageUpload'
|
||||
</#if>
|
||||
<#if form_sel_depart>
|
||||
import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
|
||||
</#if>
|
||||
<#if form_sel_user>
|
||||
import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
|
||||
</#if>
|
||||
<#if form_select>
|
||||
import JDictSelectTag from "@/components/dict/JDictSelectTag"
|
||||
</#if>
|
||||
<#if form_select_multi>
|
||||
import JMultiSelectTag from "@/components/dict/JMultiSelectTag"
|
||||
</#if>
|
||||
<#if form_select_search>
|
||||
import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
|
||||
</#if>
|
||||
<#if form_editor>
|
||||
import JEditor from '@/components/jeecg/JEditor'
|
||||
</#if>
|
||||
<#if form_cat_tree>
|
||||
import JCategorySelect from '@/components/jeecg/JCategorySelect'
|
||||
</#if>
|
||||
<#if form_pca>
|
||||
import JAreaLinkage from '@comp/jeecg/JAreaLinkage'
|
||||
</#if>
|
||||
<#if form_md>
|
||||
import JMarkdownEditor from '@/components/jeecg/JMarkdownEditor/index'
|
||||
</#if>
|
||||
<#if form_switch==true >
|
||||
import JSwitch from '@/components/jeecg/JSwitch'
|
||||
</#if>
|
||||
|
||||
export default {
|
||||
name: '${sub.entityName}Form',
|
||||
components: {
|
||||
JFormContainer,
|
||||
<#if form_date>
|
||||
JDate,
|
||||
</#if>
|
||||
<#if form_file>
|
||||
JUpload,
|
||||
</#if>
|
||||
<#if form_image>
|
||||
JImageUpload,
|
||||
</#if>
|
||||
<#if form_sel_depart>
|
||||
JSelectDepart,
|
||||
</#if>
|
||||
<#if form_sel_user>
|
||||
JSelectUserByDep,
|
||||
</#if>
|
||||
<#if form_select>
|
||||
JDictSelectTag,
|
||||
</#if>
|
||||
<#if form_select_multi>
|
||||
JMultiSelectTag,
|
||||
</#if>
|
||||
<#if form_select_search>
|
||||
JSearchSelectTag,
|
||||
</#if>
|
||||
<#if form_editor>
|
||||
JEditor,
|
||||
</#if>
|
||||
<#if form_pca>
|
||||
JAreaLinkage,
|
||||
</#if>
|
||||
<#if form_cat_tree>
|
||||
JCategorySelect,
|
||||
</#if>
|
||||
<#if form_md>
|
||||
JMarkdownEditor,
|
||||
</#if>
|
||||
<#if form_switch==true >
|
||||
JSwitch,
|
||||
</#if>
|
||||
JFormContainer
|
||||
},
|
||||
props:{
|
||||
disabled: {
|
||||
@ -261,7 +156,7 @@
|
||||
edit(record){
|
||||
this.model = Object.assign({}, record)
|
||||
console.log("${sub.entityName}Form-edit",this.model);
|
||||
let fieldval = pick(this.model<#list sub.colums as po><#if po.fieldName !='id'>,'${po.fieldName}'</#if></#list>)
|
||||
let fieldval = pick(this.model<#list sub.colums as po><#if po.fieldName !='id'>,${autoStringSuffix(po)}</#if></#list>)
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(fieldval)
|
||||
})
|
||||
@ -288,7 +183,7 @@
|
||||
return formdata_arr;
|
||||
},
|
||||
popupCallback(row){
|
||||
this.form.setFieldsValue(pick(row<#list sub.colums as po><#if po.fieldName !='id'>,'${po.fieldName}'</#if></#list>))
|
||||
this.form.setFieldsValue(pick(row<#list sub.colums as po><#if po.fieldName !='id'>,${autoStringSuffix(po)}</#if></#list>))
|
||||
},
|
||||
clearFormData(){
|
||||
this.form.resetFields()
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package ${bussiPackage}.${entityPackage}.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@ -67,37 +68,6 @@ public class ${entityName} implements Serializable {
|
||||
@Dict(${list_field_dictCode?substring(2)})
|
||||
</#if>
|
||||
</#if>
|
||||
<#if po.fieldDbType=='Blob'>
|
||||
private transient java.lang.String ${po.fieldName}String;
|
||||
|
||||
private byte[] ${po.fieldName};
|
||||
|
||||
public byte[] get${po.fieldName?cap_first}(){
|
||||
if(${po.fieldName}String==null){
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return ${po.fieldName}String.getBytes("UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public String get${po.fieldName?cap_first}String(){
|
||||
if(${po.fieldName}==null || ${po.fieldName}.length==0){
|
||||
return "";
|
||||
}
|
||||
try {
|
||||
return new String(${po.fieldName},"UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
<#else>
|
||||
@ApiModelProperty(value = "${po.filedComment}")
|
||||
private ${po.fieldType} ${po.fieldName};
|
||||
</#if>
|
||||
<#include "/common/blob.ftl">
|
||||
</#list>
|
||||
}
|
||||
|
||||
@ -13,6 +13,7 @@ import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import java.util.Date;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
/**
|
||||
* @Description: ${subTab.ftlDescription}
|
||||
@ -65,8 +66,8 @@ public class ${subTab.entityName} implements Serializable {
|
||||
</#if>
|
||||
</#if>
|
||||
</#if>
|
||||
@ApiModelProperty(value = "${po.filedComment}")
|
||||
private <#if po.fieldType=='java.sql.Blob'>byte[]<#else>${po.fieldType}</#if> ${po.fieldName};
|
||||
<#-- 大字段转换 -->
|
||||
<#include "/common/blob.ftl">
|
||||
</#list>
|
||||
}
|
||||
</#list>
|
||||
@ -68,7 +68,11 @@ public class ${entityName}Page {
|
||||
</#if>
|
||||
</#if>
|
||||
@ApiModelProperty(value = "${po.filedComment}")
|
||||
private <#if po.fieldType=='java.sql.Blob'>byte[]<#else>${po.fieldType}</#if> ${po.fieldName};
|
||||
<#if po.fieldDbType=='Blob'>
|
||||
private java.lang.String ${po.fieldName}String;
|
||||
<#else>
|
||||
private ${po.fieldType} ${po.fieldName};
|
||||
</#if>
|
||||
</#list>
|
||||
|
||||
<#list subTables as sub>
|
||||
|
||||
@ -5,20 +5,10 @@
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
<#assign query_field_no=0>
|
||||
<#assign query_field_select=false>
|
||||
<#assign query_field_date=false>
|
||||
<#assign query_flag=false>
|
||||
<#assign list_need_pca=false>
|
||||
<#assign list_need_dict=false>
|
||||
<#assign list_need_category=false>
|
||||
<#assign query_field_pca=false>
|
||||
<#assign list_need_pca=false>
|
||||
<#assign query_flag=false>
|
||||
<#assign query_inp=false>
|
||||
<#assign query_popup=false>
|
||||
<#assign query_sel_user=false>
|
||||
<#assign query_sel_dep=false>
|
||||
<#assign query_sel_multi=false>
|
||||
<#assign query_sel_cat=false>
|
||||
<#assign query_sel_search=false>
|
||||
<#-- 开始循环 -->
|
||||
<#list columns as po>
|
||||
<#if po.isQuery=='Y'>
|
||||
@ -36,33 +26,24 @@
|
||||
<#if query_field_no gt 1> </#if><a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<#if query_field_no gt 1> </#if><a-form-item label="${po.filedComment}">
|
||||
<#if po.classType=='sel_search'>
|
||||
<#assign query_sel_search=true>
|
||||
<#if query_field_no gt 1> </#if><j-search-select-tag placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}" dict="${po.dictTable},${po.dictText},${po.dictField}"/>
|
||||
<#elseif po.classType=='sel_user'>
|
||||
<#assign query_sel_user=true>
|
||||
<#if query_field_no gt 1> </#if><j-select-user-by-dep placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}"/>
|
||||
<#elseif po.classType=='sel_depart'>
|
||||
<#assign query_sel_dep=true>
|
||||
<#if query_field_no gt 1> </#if><j-select-depart placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}"/>
|
||||
<#elseif po.classType=='list_multi'>
|
||||
<#assign query_sel_multi=true>
|
||||
<#if query_field_no gt 1> </#if><j-multi-select-tag placeholder="请选择${po.filedComment}" dictCode="${query_field_dictCode?default("")}" v-model="queryParam.${po.fieldName}"/>
|
||||
<#elseif po.classType=='cat_tree'>
|
||||
<#assign query_sel_cat=true>
|
||||
<#if query_field_no gt 1> </#if><j-category-select placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}" pcode="${po.dictField?default("")}"/>
|
||||
<#elseif po.classType=='date'>
|
||||
<#assign query_field_date=true>
|
||||
<#if query_field_no gt 1> </#if><j-date placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}"></j-date>
|
||||
<#elseif po.classType=='datetime'>
|
||||
<#assign query_field_date=true>
|
||||
<#if query_field_no gt 1> </#if><j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}"></j-date>
|
||||
<#elseif po.classType=='pca'>
|
||||
<#assign query_field_pca=true>
|
||||
<#if query_field_no gt 1> </#if><j-area-linkage type="cascader" v-model="queryParam.${po.fieldName}" placeholder="请选择省市区"/>
|
||||
<#elseif po.classType=='popup'>
|
||||
<#if query_field_no gt 1> </#if><j-popup placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}" code="${po.dictTable}" org-fields="${po.dictField}" dest-fields="${po.dictText}" :field="getPopupField('${po.dictText}')"/>
|
||||
<#elseif po.classType=='list' || po.classType=='radio' || po.classType=='checkbox'>
|
||||
<#assign query_field_select=true>
|
||||
<#-- ---------------------------下拉或是单选 判断数据字典是表字典还是普通字典------------------------------- -->
|
||||
<#if po.dictTable?default("")?trim?length gt 1>
|
||||
<#if query_field_no gt 1> </#if><j-dict-select-tag placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}" dictCode="${po.dictTable},${po.dictText},${po.dictField}"/>
|
||||
@ -80,12 +61,10 @@
|
||||
<#if query_field_no gt 1> </#if><a-col :xl="10" :lg="11" :md="12" :sm="24">
|
||||
<#if query_field_no gt 1> </#if><a-form-item label="${po.filedComment}">
|
||||
<#if po.classType=='date'>
|
||||
<#assign query_field_date=true>
|
||||
<#if query_field_no gt 1> </#if><j-date placeholder="请选择开始日期" class="query-group-cust" v-model="queryParam.${po.fieldName}_begin"></j-date>
|
||||
<#if query_field_no gt 1> </#if><span class="query-group-split-cust"></span>
|
||||
<#if query_field_no gt 1> </#if><j-date placeholder="请选择结束日期" class="query-group-cust" v-model="queryParam.${po.fieldName}_end"></j-date>
|
||||
<#elseif po.classType=='datetime'>
|
||||
<#assign query_field_date=true>
|
||||
<#if query_field_no gt 1> </#if><j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" class="query-group-cust" v-model="queryParam.${po.fieldName}_begin"></j-date>
|
||||
<#if query_field_no gt 1> </#if><span class="query-group-split-cust"></span>
|
||||
<#if query_field_no gt 1> </#if><j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择结束时间" class="query-group-cust" v-model="queryParam.${po.fieldName}_end"></j-date>
|
||||
@ -221,78 +200,22 @@
|
||||
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import ${entityName}Modal from './modules/${entityName}Modal'
|
||||
<#if query_field_select>
|
||||
import JDictSelectTag from '@/components/dict/JDictSelectTag.vue'
|
||||
</#if>
|
||||
<#if query_field_date>
|
||||
import JDate from '@/components/jeecg/JDate.vue'
|
||||
</#if>
|
||||
<#if list_need_category>
|
||||
import { loadCategoryData } from '@/api/api'
|
||||
</#if>
|
||||
<#if list_need_dict>
|
||||
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
|
||||
</#if>
|
||||
<#if query_field_pca>
|
||||
import JAreaLinkage from '@comp/jeecg/JAreaLinkage'
|
||||
</#if>
|
||||
<#if list_need_pca>
|
||||
import Area from '@/components/_util/Area'
|
||||
</#if>
|
||||
<#if query_inp>
|
||||
import JInput from '@comp/jeecg/JInput'
|
||||
</#if>
|
||||
<#if query_sel_user>
|
||||
import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
|
||||
</#if>
|
||||
<#if query_sel_dep>
|
||||
import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
|
||||
</#if>
|
||||
<#if query_sel_multi>
|
||||
import JMultiSelectTag from '@/components/dict/JMultiSelectTag'
|
||||
</#if>
|
||||
<#if query_sel_cat>
|
||||
import JCategorySelect from '@comp/jeecg/JCategorySelect'
|
||||
</#if>
|
||||
<#if query_sel_search>
|
||||
import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
|
||||
</#if>
|
||||
import '@/assets/less/TableExpand.less'
|
||||
import JSuperQuery from '@/components/jeecg/JSuperQuery.vue'
|
||||
|
||||
export default {
|
||||
name: "${entityName}List",
|
||||
mixins:[JeecgListMixin],
|
||||
components: {
|
||||
<#if query_field_select>
|
||||
JDictSelectTag,
|
||||
</#if>
|
||||
<#if query_field_date>
|
||||
JDate,
|
||||
</#if>
|
||||
<#if query_field_pca>
|
||||
JAreaLinkage,
|
||||
</#if>
|
||||
<#if query_inp>
|
||||
JInput,
|
||||
</#if>
|
||||
<#if query_sel_user>
|
||||
JSelectUserByDep,
|
||||
</#if>
|
||||
<#if query_sel_dep>
|
||||
JSelectDepart,
|
||||
</#if>
|
||||
<#if query_sel_multi>
|
||||
JMultiSelectTag,
|
||||
</#if>
|
||||
<#if query_sel_cat>
|
||||
JCategorySelect,
|
||||
</#if>
|
||||
<#if query_sel_search>
|
||||
JSearchSelectTag,
|
||||
</#if>
|
||||
${entityName}Modal,
|
||||
JSuperQuery
|
||||
${entityName}Modal
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
|
||||
@ -9,21 +9,8 @@
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel">
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<#assign form_date = false>
|
||||
<#assign form_select = false>
|
||||
<#assign form_select_multi = false>
|
||||
<#assign form_select_search = false>
|
||||
<#assign form_popup = false>
|
||||
<#assign form_sel_depart = false>
|
||||
<#assign form_sel_user = false>
|
||||
<#assign form_file = false>
|
||||
<#assign form_image = false>
|
||||
<#assign form_editor = false>
|
||||
<#assign form_cat_tree = false>
|
||||
<#assign form_cat_back = "">
|
||||
<#assign form_pca = false>
|
||||
<#assign form_md = false>
|
||||
<#assign form_switch=false>
|
||||
<#assign form_span = 24>
|
||||
|
||||
<a-tabs v-model="activeKey" @change="handleChangeTabs">
|
||||
@ -47,13 +34,12 @@
|
||||
<a-form-item label="${po.filedComment}" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
</#if>
|
||||
<#if po.classType =='date'>
|
||||
<#assign form_date=true>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='datetime'>
|
||||
<#assign form_date=true>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='time'>
|
||||
<j-time placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='popup'>
|
||||
<#assign form_popup=true>
|
||||
<j-popup
|
||||
v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"
|
||||
:trigger-change="true"
|
||||
@ -63,32 +49,24 @@
|
||||
@callback="popupCallback"
|
||||
<#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='sel_depart'>
|
||||
<#assign form_sel_depart=true>
|
||||
<j-select-depart v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" multi <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='switch'>
|
||||
<#assign form_switch=true>
|
||||
<j-switch v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" <#if po.dictField?default("")?trim?length gt 1>:options="${po.dictField}"</#if> <#if po.readonly=='Y'>disabled</#if>></j-switch>
|
||||
<#elseif po.classType =='pca'>
|
||||
<#assign form_pca=true>
|
||||
<j-area-linkage type="cascader" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入省市区" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='markdown'>
|
||||
<#assign form_md=true>
|
||||
<j-markdown-editor v-decorator="['${po.fieldName}']" id="${po.fieldName}"></j-markdown-editor>
|
||||
<j-markdown-editor v-decorator="[${autoStringSuffix(po)},{initialValue:''}]" id="${po.fieldName}"></j-markdown-editor>
|
||||
<#elseif po.classType =='password'>
|
||||
<a-input-password v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='sel_user'>
|
||||
<#assign form_sel_user = true>
|
||||
<j-select-user-by-dep v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='textarea'>
|
||||
<a-textarea v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" rows="4" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<a-textarea v-decorator="[${autoStringSuffix(po)}${autoWriteRules(po)}]" rows="4" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType=='list' || po.classType=='radio'>
|
||||
<#assign form_select = true>
|
||||
<j-dict-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType=='list_multi' || po.classType=='checkbox'>
|
||||
<#assign form_select_multi = true>
|
||||
<j-multi-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType=='sel_search'>
|
||||
<#assign form_select_search = true>
|
||||
<j-search-select-tag v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" dict="${form_field_dictCode}" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType=='cat_tree'>
|
||||
<#assign form_cat_tree = true>
|
||||
@ -99,18 +77,12 @@
|
||||
<#elseif po.fieldDbType=='int' || po.fieldDbType=='double' || po.fieldDbType=='BigDecimal'>
|
||||
<a-input-number v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType=='file'>
|
||||
<#assign form_file = true>
|
||||
<j-upload v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" <#if po.readonly=='Y'>disabled</#if> <#if po.uploadnum??>:number=${po.uploadnum}</#if>></j-upload>
|
||||
<#elseif po.classType=='image'>
|
||||
<#assign form_image = true>
|
||||
<j-image-upload isMultiple <#if po.uploadnum??>:number=${po.uploadnum}</#if> v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" <#if po.readonly=='Y'>disabled</#if>></j-image-upload>
|
||||
<#elseif po.classType=='umeditor'>
|
||||
<#assign form_editor = true>
|
||||
<j-editor v-decorator="['${po.fieldName}',{trigger:'input'}]" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.fieldDbType=='Blob'>
|
||||
<a-input v-decorator="['${po.fieldName}String'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>></a-input>
|
||||
<j-editor v-decorator="[${autoStringSuffix(po)},{trigger:'input'}]" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType == 'sel_tree'>
|
||||
<#assign form_tree_select = true>
|
||||
<j-tree-select
|
||||
ref="treeSelect"
|
||||
placeholder="请选择${po.filedComment}"
|
||||
@ -128,7 +100,7 @@
|
||||
<#if po.readonly=='Y'>disabled</#if>>
|
||||
</j-tree-select>
|
||||
<#else>
|
||||
<a-input v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>></a-input>
|
||||
<a-input v-decorator="[${autoStringSuffix(po)}${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>></a-input>
|
||||
</#if>
|
||||
</a-form-item>
|
||||
<#if form_cat_tree && form_cat_back?length gt 1>
|
||||
@ -184,45 +156,6 @@
|
||||
import ${sub.entityName}Form from './${sub.entityName}Form.vue'
|
||||
</#if>
|
||||
</#list>
|
||||
<#if form_date>
|
||||
import JDate from '@/components/jeecg/JDate'
|
||||
</#if>
|
||||
<#if form_file>
|
||||
import JUpload from '@/components/jeecg/JUpload'
|
||||
</#if>
|
||||
<#if form_image>
|
||||
import JImageUpload from '@/components/jeecg/JImageUpload'
|
||||
</#if>
|
||||
<#if form_sel_depart>
|
||||
import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
|
||||
</#if>
|
||||
<#if form_sel_user>
|
||||
import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
|
||||
</#if>
|
||||
<#if form_select>
|
||||
import JDictSelectTag from "@/components/dict/JDictSelectTag"
|
||||
</#if>
|
||||
<#if form_select_multi>
|
||||
import JMultiSelectTag from "@/components/dict/JMultiSelectTag"
|
||||
</#if>
|
||||
<#if form_select_search>
|
||||
import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
|
||||
</#if>
|
||||
<#if form_editor>
|
||||
import JEditor from '@/components/jeecg/JEditor'
|
||||
</#if>
|
||||
<#if form_cat_tree>
|
||||
import JCategorySelect from '@/components/jeecg/JCategorySelect'
|
||||
</#if>
|
||||
<#if form_pca>
|
||||
import JAreaLinkage from '@comp/jeecg/JAreaLinkage'
|
||||
</#if>
|
||||
<#if form_md>
|
||||
import JMarkdownEditor from '@/components/jeecg/JMarkdownEditor/index'
|
||||
</#if>
|
||||
<#if form_switch==true >
|
||||
import JSwitch from '@/components/jeecg/JSwitch'
|
||||
</#if>
|
||||
|
||||
export default {
|
||||
name: '${entityName}Modal',
|
||||
@ -233,45 +166,6 @@
|
||||
${sub.entityName}Form,
|
||||
</#if>
|
||||
</#list>
|
||||
<#if form_date>
|
||||
JDate,
|
||||
</#if>
|
||||
<#if form_file>
|
||||
JUpload,
|
||||
</#if>
|
||||
<#if form_image>
|
||||
JImageUpload,
|
||||
</#if>
|
||||
<#if form_sel_depart>
|
||||
JSelectDepart,
|
||||
</#if>
|
||||
<#if form_sel_user>
|
||||
JSelectUserByDep,
|
||||
</#if>
|
||||
<#if form_select>
|
||||
JDictSelectTag,
|
||||
</#if>
|
||||
<#if form_select_multi>
|
||||
JMultiSelectTag,
|
||||
</#if>
|
||||
<#if form_select_search>
|
||||
JSearchSelectTag,
|
||||
</#if>
|
||||
<#if form_editor>
|
||||
JEditor,
|
||||
</#if>
|
||||
<#if form_pca>
|
||||
JAreaLinkage,
|
||||
</#if>
|
||||
<#if form_cat_tree>
|
||||
JCategorySelect,
|
||||
</#if>
|
||||
<#if form_md>
|
||||
JMarkdownEditor,
|
||||
</#if>
|
||||
<#if form_switch==true >
|
||||
JSwitch,
|
||||
</#if>
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -313,7 +207,7 @@
|
||||
<#if col.filedComment !='外键' >
|
||||
{
|
||||
title: '${col.filedComment}',
|
||||
key: '${col.fieldName}',
|
||||
key: ${autoStringSuffix(col)},
|
||||
<#if col.classType =='date'>
|
||||
type: FormTypes.date,
|
||||
<#if col.readonly=='Y'>
|
||||
@ -503,7 +397,7 @@
|
||||
},
|
||||
/** 调用完edit()方法之后会自动调用此方法 */
|
||||
editAfter() {
|
||||
let fieldval = pick(this.model<#list columns as po><#if po.fieldName !='id'><#if po.fieldDbType=='Blob'>,'${po.fieldName}String'<#else>,'${po.fieldName}'</#if></#if></#list>)
|
||||
let fieldval = pick(this.model<#list columns as po><#if po.fieldName !='id'>,${autoStringSuffix(po)}</#if></#list>)
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(fieldval)
|
||||
<#list subTables as sub><#rt/>
|
||||
@ -565,7 +459,7 @@
|
||||
this.$message.error(msg)
|
||||
},
|
||||
popupCallback(row){
|
||||
this.form.setFieldsValue(pick(row<#list columns as po><#if po.fieldName !='id'><#if po.fieldDbType=='Blob'>,'${po.fieldName}String'<#else>,'${po.fieldName}'</#if></#if></#list>))
|
||||
this.form.setFieldsValue(pick(row<#list columns as po><#if po.fieldName !='id'>,${autoStringSuffix(po)}</#if></#list>))
|
||||
},
|
||||
<#if form_cat_tree>
|
||||
handleCategoryChange(value,backObj){
|
||||
|
||||
@ -0,0 +1,201 @@
|
||||
<#include "/common/utils.ftl">
|
||||
<#list subTables as sub>
|
||||
<#if sub.foreignRelationType=='1'>
|
||||
#segment#${sub.entityName}Form.vue
|
||||
<template>
|
||||
<j-form-container :disabled="disabled">
|
||||
<a-form :form="form" slot="detail">
|
||||
<a-row>
|
||||
<#assign form_cat_tree = false>
|
||||
<#assign form_cat_back = "">
|
||||
<#assign form_span = 24>
|
||||
<#if tableVo.fieldRowNum == 2>
|
||||
<#assign form_span = 12>
|
||||
<#elseif tableVo.fieldRowNum==3>
|
||||
<#assign form_span = 8>
|
||||
<#elseif tableVo.fieldRowNum==4>
|
||||
<#assign form_span = 6>
|
||||
</#if>
|
||||
<#list sub.colums as po>
|
||||
<#if po.isShow =='Y' && po.fieldName != 'id'>
|
||||
<#assign form_field_dictCode="">
|
||||
<#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>
|
||||
<#assign form_field_dictCode="${po.dictTable},${po.dictText},${po.dictField}">
|
||||
<#elseif po.dictField?default("")?trim?length gt 1>
|
||||
<#assign form_field_dictCode="${po.dictField}">
|
||||
</#if>
|
||||
<#if po.classType =='textarea'>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="${po.filedComment}" :labelCol="labelCol2" :wrapperCol="wrapperCol2">
|
||||
<#else>
|
||||
<a-col :span="${form_span}">
|
||||
<a-form-item label="${po.filedComment}" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
</#if>
|
||||
<#if po.classType =='date'>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" style="width: 100%"/>
|
||||
<#elseif po.classType =='datetime'>
|
||||
<j-date placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"/>
|
||||
<#elseif po.classType =='time'>
|
||||
<j-time placeholder="请选择${po.filedComment}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
|
||||
<#elseif po.classType =='popup'>
|
||||
<j-popup
|
||||
v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"
|
||||
:trigger-change="true"
|
||||
org-fields="${po.dictField}"
|
||||
dest-fields="${Format.underlineToHump(po.dictText)}"
|
||||
code="${po.dictTable}"
|
||||
@callback="popupCallback"/>
|
||||
<#elseif po.classType =='sel_depart'>
|
||||
<j-select-depart v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" multi/>
|
||||
<#elseif po.classType =='switch'>
|
||||
<j-switch v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" <#if po.dictField?default("")?trim?length gt 1>:options="${po.dictField}"</#if>></j-switch>
|
||||
<#elseif po.classType =='pca'>
|
||||
<j-area-linkage type="cascader" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入省市区"/>
|
||||
<#elseif po.classType =='markdown'>
|
||||
<j-markdown-editor v-decorator="[${autoStringSuffix(po)},{initialValue:''}]" id="${po.fieldName}"></j-markdown-editor>
|
||||
<#elseif po.classType =='password'>
|
||||
<a-input-password v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}"/>
|
||||
<#elseif po.classType =='sel_user'>
|
||||
<j-select-user-by-dep v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"/>
|
||||
<#elseif po.classType =='textarea'>
|
||||
<a-textarea v-decorator="[${autoStringSuffix(po)}${autoWriteRules(po)}]" rows="4" placeholder="请输入${po.filedComment}"/>
|
||||
<#elseif po.classType=='list' || po.classType=='radio'>
|
||||
<j-dict-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}"/>
|
||||
<#elseif po.classType=='list_multi' || po.classType=='checkbox'>
|
||||
<j-multi-select-tag type="${po.classType}" v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}"/>
|
||||
<#elseif po.classType=='sel_search'>
|
||||
<j-search-select-tag v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" dict="${form_field_dictCode}" />
|
||||
<#elseif po.classType=='cat_tree'>
|
||||
<#assign form_cat_tree = true>
|
||||
<j-category-select v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" pcode="${po.dictField?default("")}" placeholder="请选择${po.filedComment}" <#if po.dictText?default("")?trim?length gt 1>back="${po.dictText}" @change="handleCategoryChange"</#if>/>
|
||||
<#if po.dictText?default("")?trim?length gt 1>
|
||||
<#assign form_cat_back = "${po.dictText}">
|
||||
</#if>
|
||||
<#elseif po.fieldDbType=='int' || po.fieldDbType=='double' || po.fieldDbType=='BigDecimal'>
|
||||
<a-input-number v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}" style="width: 100%"/>
|
||||
<#elseif po.classType=='file'>
|
||||
<j-upload v-decorator="['${po.fieldName}'${autoWriteRules(po)}]" :trigger-change="true"></j-upload>
|
||||
<#elseif po.classType=='image'>
|
||||
<j-image-upload isMultiple v-decorator="['${po.fieldName}'${autoWriteRules(po)}]"></j-image-upload>
|
||||
<#elseif po.classType=='umeditor'>
|
||||
<j-editor v-decorator="[${autoStringSuffix(po)},{trigger:'input'}]"/>
|
||||
<#else>
|
||||
<a-input v-decorator="[${autoStringSuffix(po)}${autoWriteRules(po)}]" placeholder="请输入${po.filedComment}"></a-input>
|
||||
</#if>
|
||||
</a-form-item>
|
||||
<#if form_cat_tree && form_cat_back?length gt 1>
|
||||
<a-form-item v-show="false">
|
||||
<a-input v-decorator="['${form_cat_back}']"></a-input>
|
||||
</a-form-item>
|
||||
</#if>
|
||||
</a-col>
|
||||
</#if>
|
||||
</#list>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</j-form-container>
|
||||
</template>
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import { getAction } from '@/api/manage'
|
||||
import { validateDuplicateValue } from '@/utils/util'
|
||||
import JFormContainer from '@/components/jeecg/JFormContainer'
|
||||
|
||||
export default {
|
||||
name: '${sub.entityName}Form',
|
||||
components: {
|
||||
JFormContainer
|
||||
},
|
||||
props:{
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
required: false
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
form: this.$form.createForm(this),
|
||||
model: {},
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 6 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 },
|
||||
},
|
||||
labelCol2: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 3 },
|
||||
},
|
||||
wrapperCol2: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 20 },
|
||||
},
|
||||
<#include "/common/validatorRulesTemplate/sub.ftl">
|
||||
confirmLoading: false,
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
initFormData(url,id){
|
||||
this.clearFormData()
|
||||
if(!id){
|
||||
this.edit({})
|
||||
}else{
|
||||
getAction(url,{id:id}).then(res=>{
|
||||
if(res.success){
|
||||
let records = res.result
|
||||
if(records && records.length>0){
|
||||
this.edit(records[0])
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
edit(record){
|
||||
this.model = Object.assign({}, record)
|
||||
console.log("${sub.entityName}Form-edit",this.model);
|
||||
let fieldval = pick(this.model<#list sub.colums as po><#if po.fieldName !='id'>,${autoStringSuffix(po)}</#if></#list>)
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(fieldval)
|
||||
})
|
||||
},
|
||||
getFormData(){
|
||||
let formdata_arr = []
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
let formdata = Object.assign(this.model, values)
|
||||
let isNullObj = true
|
||||
Object.keys(formdata).forEach(key=>{
|
||||
if(formdata[key]){
|
||||
isNullObj = false
|
||||
}
|
||||
})
|
||||
if(!isNullObj){
|
||||
formdata_arr.push(formdata)
|
||||
}
|
||||
}else{
|
||||
this.$emit("validateError","${sub.ftlDescription}表单校验未通过");
|
||||
}
|
||||
})
|
||||
console.log("${sub.ftlDescription}表单数据集",formdata_arr);
|
||||
return formdata_arr;
|
||||
},
|
||||
popupCallback(row){
|
||||
this.form.setFieldsValue(pick(row<#list sub.colums as po><#if po.fieldName !='id'>,${autoStringSuffix(po)}</#if></#list>))
|
||||
},
|
||||
clearFormData(){
|
||||
this.form.resetFields()
|
||||
this.model={}
|
||||
},
|
||||
<#if form_cat_tree>
|
||||
handleCategoryChange(value,backObj){
|
||||
this.form.setFieldsValue(backObj);
|
||||
}
|
||||
</#if>
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</#if>
|
||||
</#list>
|
||||
@ -1,7 +1,7 @@
|
||||
#code_generate_project_path
|
||||
project_path=E:\\workspace-ui\\jeecg-boot-framework\\jeecg-boot-module-demo
|
||||
project_path=E:\\eclipse2018-workspace\\jeecg-boot
|
||||
#bussi_package[User defined]
|
||||
bussi_package=org.jeecg.modules.demo3
|
||||
bussi_package=org.jeecg.modules.demo
|
||||
|
||||
|
||||
#default code path
|
||||
@ -26,5 +26,4 @@ db_filed_convert=true
|
||||
page_search_filed_num=1
|
||||
#page_filter_fields
|
||||
page_filter_fields=create_time,create_by,update_time,update_by
|
||||
#exclude table prefix
|
||||
exclude_table=act_,ext_act_,design_,onl_,sys_,qrtz_,jmreport_,jimu_
|
||||
exclude_table=act_,ext_act_,design_,onl_,sys_,qrtz_
|
||||
|
||||
@ -0,0 +1,65 @@
|
||||
package org.jeecg;
|
||||
|
||||
import org.jeecg.modules.demo.mock.MockController;
|
||||
import org.jeecg.modules.demo.test.entity.JeecgDemo;
|
||||
import org.jeecg.modules.demo.test.mapper.JeecgDemoMapper;
|
||||
import org.jeecg.modules.demo.test.service.IJeecgDemoService;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,classes = JeecgSystemApplication.class)
|
||||
public class SampleTest {
|
||||
|
||||
@Resource
|
||||
private JeecgDemoMapper jeecgDemoMapper;
|
||||
@Resource
|
||||
private IJeecgDemoService jeecgDemoService;
|
||||
// @Resource
|
||||
// private ISysDataLogService sysDataLogService;
|
||||
@Resource
|
||||
private MockController mock;
|
||||
|
||||
@Test
|
||||
public void testSelect() {
|
||||
System.out.println(("----- selectAll method test ------"));
|
||||
List<JeecgDemo> userList = jeecgDemoMapper.selectList(null);
|
||||
Assert.assertEquals(5, userList.size());
|
||||
userList.forEach(System.out::println);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testXmlSql() {
|
||||
System.out.println(("----- selectAll method test ------"));
|
||||
List<JeecgDemo> userList = jeecgDemoMapper.getDemoByName("Sandy12");
|
||||
userList.forEach(System.out::println);
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试事务
|
||||
*/
|
||||
@Test
|
||||
public void testTran() {
|
||||
jeecgDemoService.testTran();
|
||||
}
|
||||
|
||||
//author:lvdandan-----date:20190315---for:添加数据日志测试----
|
||||
/**
|
||||
* 测试数据日志添加
|
||||
*/
|
||||
// @Test
|
||||
// public void testDataLogSave() {
|
||||
// System.out.println(("----- datalog test ------"));
|
||||
// String tableName = "jeecg_demo";
|
||||
// String dataId = "4028ef81550c1a7901550c1cd6e70001";
|
||||
// String dataContent = mock.sysDataLogJson();
|
||||
// sysDataLogService.addDataLog(tableName, dataId, dataContent);
|
||||
// }
|
||||
//author:lvdandan-----date:20190315---for:添加数据日志测试----
|
||||
}
|
||||
@ -1,6 +1,7 @@
|
||||
package org.jeecg.modules.online.desform.test;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.jeecg.JeecgSystemApplication;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.system.util.JwtUtil;
|
||||
import org.jeecg.common.util.RedisUtil;
|
||||
@ -19,7 +20,7 @@ import org.springframework.test.context.junit4.SpringRunner;
|
||||
* 表单设计器 API 接口单元测试
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,classes = JeecgSystemApplication.class)
|
||||
@SuppressWarnings({"FieldCanBeLocal", "SpringJavaAutowiredMembersInspection"})
|
||||
public class DesformApiTest {
|
||||
|
||||
|
||||
@ -0,0 +1,190 @@
|
||||
package org.jeecg.modules.online.desform.test;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.jeecg.JeecgSystemApplication;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.system.util.JwtUtil;
|
||||
import org.jeecg.common.util.RedisUtil;
|
||||
import org.jeecg.common.util.RestUtil;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
/**
|
||||
* online api online表单单元测试
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,classes = JeecgSystemApplication.class)
|
||||
@SuppressWarnings({"FieldCanBeLocal", "SpringJavaAutowiredMembersInspection"})
|
||||
public class OnlineApiTest {
|
||||
@Autowired
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
/**
|
||||
* 测试地址:实际使用时替换成你自己的地址
|
||||
*/
|
||||
private final String BASE_URL = "http://localhost:8080/jeecg-boot/online/cgform/api/";
|
||||
|
||||
// 请实际使用时替换成你自己的用户名和密码
|
||||
private final String USERNAME = "admin";
|
||||
private final String PASSWORD = "123456";
|
||||
|
||||
/**
|
||||
* online表单code,实际使用时可以替换成你要测试的表单code
|
||||
* (测试表test_demo)
|
||||
*/
|
||||
private final String ONLINE_CODE = "d35109c3632c4952a19ecc094943dd71";
|
||||
|
||||
/**
|
||||
* 测试用例:新增
|
||||
*/
|
||||
@Test
|
||||
public void testAdd() {
|
||||
// 用户Token
|
||||
String token = this.getToken();
|
||||
// 请求地址
|
||||
String url = BASE_URL + "form/" + ONLINE_CODE;
|
||||
// 请求 Header (用于传递Token)
|
||||
HttpHeaders headers = this.getHeaders(token);
|
||||
// 请求方式是 POST 代表提交新增数据
|
||||
HttpMethod method = HttpMethod.POST;
|
||||
|
||||
System.out.println("请求地址:" + url);
|
||||
System.out.println("请求方式:" + method);
|
||||
System.out.println("请求Token:" + token);
|
||||
|
||||
JSONObject params = new JSONObject();
|
||||
params.put("name", "张三");
|
||||
params.put("sex", "1");
|
||||
params.put("age",15);
|
||||
params.put("descc", "<p>富文本编辑</p>");
|
||||
|
||||
System.out.println("请求参数:" + params.toJSONString());
|
||||
|
||||
// 利用 RestUtil 请求该url
|
||||
ResponseEntity<JSONObject> result = RestUtil.request(url, method, headers, null, params, JSONObject.class);
|
||||
if (result != null && result.getBody() != null) {
|
||||
System.out.println("返回结果:" + result.getBody().toJSONString());
|
||||
} else {
|
||||
System.out.println("查询失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 测试用例:修改
|
||||
*/
|
||||
@Test
|
||||
public void testEdit() {
|
||||
// dataId
|
||||
String dataId = "1331797913880883201";
|
||||
// 用户Token
|
||||
String token = this.getToken();
|
||||
// 请求地址
|
||||
String url = BASE_URL + "form/" + ONLINE_CODE;
|
||||
// 请求 Header (用于传递Token)
|
||||
HttpHeaders headers = this.getHeaders(token);
|
||||
// 请求方式是 PUT 代表提交修改数据
|
||||
HttpMethod method = HttpMethod.PUT;
|
||||
|
||||
System.out.println("请求地址:" + url);
|
||||
System.out.println("请求方式:" + method);
|
||||
System.out.println("请求Token:" + token);
|
||||
|
||||
JSONObject params = new JSONObject();
|
||||
params.put("id", dataId);
|
||||
params.put("name", "张三");
|
||||
params.put("sex", "1");
|
||||
params.put("age",30);
|
||||
params.put("descc", "<p>富文本编辑,重新编辑</p>");
|
||||
|
||||
System.out.println("请求参数:" + params.toJSONString());
|
||||
|
||||
// 利用 RestUtil 请求该url
|
||||
ResponseEntity<JSONObject> result = RestUtil.request(url, method, headers, null, params, JSONObject.class);
|
||||
if (result != null && result.getBody() != null) {
|
||||
System.out.println("返回结果:" + result.getBody().toJSONString());
|
||||
} else {
|
||||
System.out.println("查询失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 测试用例:删除
|
||||
*/
|
||||
@Test
|
||||
public void testDelete() {
|
||||
// 数据id
|
||||
String dataId = "1331797913880883201";
|
||||
// 用户Token
|
||||
String token = this.getToken();
|
||||
// 请求地址
|
||||
String url = BASE_URL + "form/" + ONLINE_CODE + "/" + dataId;
|
||||
// 请求 Header (用于传递Token)
|
||||
HttpHeaders headers = this.getHeaders(token);
|
||||
// 请求方式是 DELETE 代表删除数据
|
||||
HttpMethod method = HttpMethod.DELETE;
|
||||
|
||||
System.out.println("请求地址:" + url);
|
||||
System.out.println("请求方式:" + method);
|
||||
System.out.println("请求Token:" + token);
|
||||
|
||||
// 利用 RestUtil 请求该url
|
||||
ResponseEntity<JSONObject> result = RestUtil.request(url, method, headers, null, null, JSONObject.class);
|
||||
if (result != null && result.getBody() != null) {
|
||||
System.out.println("返回结果:" + result.getBody().toJSONString());
|
||||
} else {
|
||||
System.out.println("查询失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试用例:查询记录
|
||||
*/
|
||||
@Test
|
||||
public void testQuery() {
|
||||
// 用户Token
|
||||
String token = this.getToken();
|
||||
// 请求地址
|
||||
String url = BASE_URL + "getData/"+ ONLINE_CODE ;
|
||||
// 请求 Header (用于传递Token)
|
||||
HttpHeaders headers = this.getHeaders(token);
|
||||
// 请求方式是 GET 代表获取数据
|
||||
HttpMethod method = HttpMethod.GET;
|
||||
|
||||
System.out.println("请求地址:" + url);
|
||||
System.out.println("请求方式:" + method);
|
||||
System.out.println("请求Token:" + token);
|
||||
|
||||
// 利用 RestUtil 请求该url
|
||||
ResponseEntity<JSONObject> result = RestUtil.request(url, method, headers, null, null, JSONObject.class);
|
||||
if (result != null && result.getBody() != null) {
|
||||
System.out.println("返回结果:" + result.getBody().toJSONString());
|
||||
} else {
|
||||
System.out.println("查询失败");
|
||||
}
|
||||
}
|
||||
|
||||
private String getToken() {
|
||||
String token = JwtUtil.sign(USERNAME, PASSWORD);
|
||||
redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, token);
|
||||
redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, 60);
|
||||
return token;
|
||||
}
|
||||
|
||||
private HttpHeaders getHeaders(String token) {
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
String mediaType = MediaType.APPLICATION_JSON_UTF8_VALUE;
|
||||
headers.setContentType(MediaType.parseMediaType(mediaType));
|
||||
headers.set("Accept", mediaType);
|
||||
headers.set("X-Access-Token", token);
|
||||
return headers;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,188 @@
|
||||
package org.jeecg.modules.system.test;
|
||||
|
||||
import org.jeecg.JeecgSystemApplication;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.system.util.JwtUtil;
|
||||
import org.jeecg.common.util.RedisUtil;
|
||||
import org.jeecg.common.util.RestUtil;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.MediaType;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
|
||||
/**
|
||||
* 系统用户单元测试
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,classes = JeecgSystemApplication.class)
|
||||
@SuppressWarnings({"FieldCanBeLocal", "SpringJavaAutowiredMembersInspection"})
|
||||
public class SysUserTest {
|
||||
@Autowired
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
/**
|
||||
* 测试地址:实际使用时替换成你自己的地址
|
||||
*/
|
||||
private final String BASE_URL = "http://localhost:8080/jeecg-boot/sys/user/";
|
||||
|
||||
// 请实际使用时替换成你自己的用户名和密码
|
||||
private final String USERNAME = "admin";
|
||||
private final String PASSWORD = "123456";
|
||||
|
||||
/**
|
||||
* 测试用例:新增
|
||||
*/
|
||||
@Test
|
||||
public void testAdd() {
|
||||
// 用户Token
|
||||
String token = this.getToken();
|
||||
// 请求地址
|
||||
String url = BASE_URL + "add" ;
|
||||
// 请求 Header (用于传递Token)
|
||||
HttpHeaders headers = this.getHeaders(token);
|
||||
// 请求方式是 POST 代表提交新增数据
|
||||
HttpMethod method = HttpMethod.POST;
|
||||
|
||||
System.out.println("请求地址:" + url);
|
||||
System.out.println("请求方式:" + method);
|
||||
System.out.println("请求Token:" + token);
|
||||
|
||||
JSONObject params = new JSONObject();
|
||||
params.put("username", "wangwuTest");
|
||||
params.put("password", "123456");
|
||||
params.put("confirmpassword","123456");
|
||||
params.put("realname", "单元测试");
|
||||
params.put("activitiSync", "1");
|
||||
params.put("userIdentity","1");
|
||||
params.put("workNo","0025");
|
||||
|
||||
System.out.println("请求参数:" + params.toJSONString());
|
||||
|
||||
// 利用 RestUtil 请求该url
|
||||
ResponseEntity<JSONObject> result = RestUtil.request(url, method, headers, null, params, JSONObject.class);
|
||||
if (result != null && result.getBody() != null) {
|
||||
System.out.println("返回结果:" + result.getBody().toJSONString());
|
||||
} else {
|
||||
System.out.println("查询失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 测试用例:修改
|
||||
*/
|
||||
@Test
|
||||
public void testEdit() {
|
||||
// 数据Id
|
||||
String dataId = "1331795062924374018";
|
||||
// 用户Token
|
||||
String token = this.getToken();
|
||||
// 请求地址
|
||||
String url = BASE_URL + "edit";
|
||||
// 请求 Header (用于传递Token)
|
||||
HttpHeaders headers = this.getHeaders(token);
|
||||
// 请求方式是 PUT 代表提交修改数据
|
||||
HttpMethod method = HttpMethod.PUT;
|
||||
|
||||
System.out.println("请求地址:" + url);
|
||||
System.out.println("请求方式:" + method);
|
||||
System.out.println("请求Token:" + token);
|
||||
|
||||
JSONObject params = new JSONObject();
|
||||
params.put("username", "wangwuTest");
|
||||
params.put("realname", "单元测试1111");
|
||||
params.put("activitiSync", "1");
|
||||
params.put("userIdentity","1");
|
||||
params.put("workNo","0025");
|
||||
params.put("id",dataId);
|
||||
|
||||
System.out.println("请求参数:" + params.toJSONString());
|
||||
|
||||
// 利用 RestUtil 请求该url
|
||||
ResponseEntity<JSONObject> result = RestUtil.request(url, method, headers, null, params, JSONObject.class);
|
||||
if (result != null && result.getBody() != null) {
|
||||
System.out.println("返回结果:" + result.getBody().toJSONString());
|
||||
} else {
|
||||
System.out.println("查询失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 测试用例:删除
|
||||
*/
|
||||
@Test
|
||||
public void testDelete() {
|
||||
// 数据Id
|
||||
String dataId = "1331795062924374018";
|
||||
// 用户Token
|
||||
String token = this.getToken();
|
||||
// 请求地址
|
||||
String url = BASE_URL + "delete" + "?id=" + dataId;
|
||||
// 请求 Header (用于传递Token)
|
||||
HttpHeaders headers = this.getHeaders(token);
|
||||
// 请求方式是 DELETE 代表删除数据
|
||||
HttpMethod method = HttpMethod.DELETE;
|
||||
|
||||
System.out.println("请求地址:" + url);
|
||||
System.out.println("请求方式:" + method);
|
||||
System.out.println("请求Token:" + token);
|
||||
|
||||
// 利用 RestUtil 请求该url
|
||||
ResponseEntity<JSONObject> result = RestUtil.request(url, method, headers, null, null, JSONObject.class);
|
||||
if (result != null && result.getBody() != null) {
|
||||
System.out.println("返回结果:" + result.getBody().toJSONString());
|
||||
} else {
|
||||
System.out.println("查询失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试用例:查询记录
|
||||
*/
|
||||
@Test
|
||||
public void testQuery() {
|
||||
// 用户Token
|
||||
String token = this.getToken();
|
||||
// 请求地址
|
||||
String url = BASE_URL + "list";
|
||||
// 请求 Header (用于传递Token)
|
||||
HttpHeaders headers = this.getHeaders(token);
|
||||
// 请求方式是 GET 代表获取数据
|
||||
HttpMethod method = HttpMethod.GET;
|
||||
|
||||
System.out.println("请求地址:" + url);
|
||||
System.out.println("请求方式:" + method);
|
||||
System.out.println("请求Token:" + token);
|
||||
|
||||
// 利用 RestUtil 请求该url
|
||||
ResponseEntity<JSONObject> result = RestUtil.request(url, method, headers, null, null, JSONObject.class);
|
||||
if (result != null && result.getBody() != null) {
|
||||
System.out.println("返回结果:" + result.getBody().toJSONString());
|
||||
} else {
|
||||
System.out.println("查询失败");
|
||||
}
|
||||
}
|
||||
|
||||
private String getToken() {
|
||||
String token = JwtUtil.sign(USERNAME, PASSWORD);
|
||||
redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, token);
|
||||
redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, 60);
|
||||
return token;
|
||||
}
|
||||
|
||||
private HttpHeaders getHeaders(String token) {
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
String mediaType = MediaType.APPLICATION_JSON_UTF8_VALUE;
|
||||
headers.setContentType(MediaType.parseMediaType(mediaType));
|
||||
headers.set("Accept", mediaType);
|
||||
headers.set("X-Access-Token", token);
|
||||
return headers;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user