.
This commit is contained in:
commit
7d32bb98f3
2
pom.xml
2
pom.xml
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
<groupId>com.eversec.kit</groupId>
|
<groupId>com.eversec.kit</groupId>
|
||||||
<artifactId>lxy-kit</artifactId>
|
<artifactId>lxy-kit</artifactId>
|
||||||
<version>2.0_0228</version>
|
<version>2.0_0617</version>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
14
root/EverCA.html
Normal file
14
root/EverCA.html
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Title</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
专注服务研发效率,专注探索合理有效降低项目开发/维护成本
|
||||||
|
<ul>
|
||||||
|
<li><a href="lxy-kit.html">Lxy-kit 代码构建工具</a></li>
|
||||||
|
<li><a href="lxy-kit.html">Meta-kit 元数据编程</a></li>
|
||||||
|
</ul>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -69,14 +69,14 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th>后端模板选择</th>
|
<th>后端模板选择</th>
|
||||||
<td>
|
<td>
|
||||||
<label class="radio-inline"><input type="radio" name="a" value="" checked> <span>mybaits</span></label>
|
<label class="radio-inline"><input type="radio" v-model="row.serviceTpl" value="mb" v-checked="true"> <span>mybaits</span></label>
|
||||||
<label class="radio-inline"><input type="radio" name="a" value="" disabled> <span>hibernate</span></label>
|
<label class="radio-inline"><input type="radio" v-model="row.serviceTpl" value="hb"> <span>hibernate</span></label>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<th>前端模板选择</th>
|
<th>前端模板选择</th>
|
||||||
<td>
|
<td>
|
||||||
<label class="radio-inline"><input type="radio" name="b" value="" checked> <span>angularjs</span></label>
|
<label class="radio-inline"><input type="radio" v-model="row.fontTpl" value="a" v-checked="true"> <span>angularjs</span></label>
|
||||||
<label class="radio-inline"><input type="radio" name="b" value="" disabled> <span>vue</span></label>
|
<label class="radio-inline"><input type="radio" v-model="row.fontTpl" value="v" > <span>vue</span></label>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -167,7 +167,7 @@
|
|||||||
red.setData("cfg_" + fileName, n);
|
red.setData("cfg_" + fileName, n);
|
||||||
},
|
},
|
||||||
deep: true
|
deep: true
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//历史上传的文件数据(文件存贮在用户本地)
|
//历史上传的文件数据(文件存贮在用户本地)
|
||||||
@ -234,8 +234,6 @@
|
|||||||
},
|
},
|
||||||
//创建代码
|
//创建代码
|
||||||
creater: function () {
|
creater: function () {
|
||||||
console.log(this.fileName)
|
|
||||||
console.log(this.row);
|
|
||||||
this.row["fileName"] = fileName;
|
this.row["fileName"] = fileName;
|
||||||
red.post("/abc/creater", {cfgBean: JSON.stringify(this.row)}, function (json) {
|
red.post("/abc/creater", {cfgBean: JSON.stringify(this.row)}, function (json) {
|
||||||
//red.showMsg({msg:"创建代码成功"})
|
//red.showMsg({msg:"创建代码成功"})
|
||||||
@ -268,7 +266,9 @@
|
|||||||
pageModel: "abx",
|
pageModel: "abx",
|
||||||
author: "EverCA",
|
author: "EverCA",
|
||||||
ca:["service"],
|
ca:["service"],
|
||||||
sheetNames: []
|
sheetNames: [],
|
||||||
|
fontTpl: "a",
|
||||||
|
serviceTpl: "mb",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -297,7 +297,9 @@
|
|||||||
pageModel: "abx",
|
pageModel: "abx",
|
||||||
author: "EverCA",
|
author: "EverCA",
|
||||||
ca:["service"],
|
ca:["service"],
|
||||||
sheetNames: ["message_finger"]
|
sheetNames: ["message_finger"],
|
||||||
|
fontTpl: "a",
|
||||||
|
serviceTpl: "mb",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
13
root/lxy-kit.html
Normal file
13
root/lxy-kit.html
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Title</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<ul>
|
||||||
|
<li><a href="./lxy-kit_2.0_test0301.rar">工具包下载</a></li>
|
||||||
|
<li><a href="">使用手册</a></li>
|
||||||
|
</ul>
|
||||||
|
</body>
|
||||||
|
</html>
|
BIN
root/lxy-kit_2.0_test0301.rar
Normal file
BIN
root/lxy-kit_2.0_test0301.rar
Normal file
Binary file not shown.
@ -29,21 +29,7 @@ public abstract class ICreator {
|
|||||||
public static String pageModel;
|
public static String pageModel;
|
||||||
public static String author;
|
public static String author;
|
||||||
private static List<String> sheetNames;
|
private static List<String> sheetNames;
|
||||||
/*static {
|
|
||||||
xlsPath = PropKit.getProperty("xlsPath", "res/xls/table.xls");
|
|
||||||
pkg = PropKit.getProperty("pkg", "");
|
|
||||||
tplPath = PropKit.getProperty("tplPath", "");
|
|
||||||
dirPath = PropKit.getProperty("dirPath", "");
|
|
||||||
pageDirPath = PropKit.getProperty("page.dirPath", dirPath);
|
|
||||||
|
|
||||||
pageModel = PropKit.getProperty("page.model", "");
|
|
||||||
author = PropKit.getProperty("author", "lxy-kit");
|
|
||||||
sheetNames = sheets(PropKit.getProperty("sheetNames", ""));
|
|
||||||
|
|
||||||
//路径兼容处理
|
|
||||||
if (!dirPath.endsWith("/")) dirPath += "/";
|
|
||||||
if (!pageDirPath.endsWith("/")) pageDirPath += "/";
|
|
||||||
}*/
|
|
||||||
public static void setCfgBean(CfgBean cfgBean) {
|
public static void setCfgBean(CfgBean cfgBean) {
|
||||||
ICreator.cfgBean = cfgBean;
|
ICreator.cfgBean = cfgBean;
|
||||||
xlsPath = cfgBean.getXlsPath();
|
xlsPath = cfgBean.getXlsPath();
|
||||||
@ -77,7 +63,7 @@ public abstract class ICreator {
|
|||||||
public static Engine engine = Engine.use();
|
public static Engine engine = Engine.use();
|
||||||
|
|
||||||
public static Map<String, String> cateRelation = Kv.of("varchar", "String").set("text", "String").set("int", "Integer").set("bigint", "Long").set("long", "Long").set(null, "String").set("datetime", "Date");
|
public static Map<String, String> cateRelation = Kv.of("varchar", "String").set("text", "String").set("int", "Integer").set("bigint", "Long").set("long", "Long").set(null, "String").set("datetime", "Date");
|
||||||
public static String[] fields = {"field","cate", "must","remark1", "remark2", "tag", "selects", "column","filter", "ck", "edit"};
|
public static String[] fields = {"field","cate", "must","remark1", "remark2", "tag", "selects", "column","filter", "ck", "edit","update","xqzs"};
|
||||||
public static Gson gson = new Gson();
|
public static Gson gson = new Gson();
|
||||||
|
|
||||||
public static List<String> sheetNames() {
|
public static List<String> sheetNames() {
|
||||||
|
@ -2,8 +2,14 @@ package com.eversec.kit.creator;
|
|||||||
|
|
||||||
import com.eversec.common.FileKit;
|
import com.eversec.common.FileKit;
|
||||||
import com.eversec.common.Kv;
|
import com.eversec.common.Kv;
|
||||||
import com.eversec.kit.creator.impl.*;
|
import com.eversec.kit.creator.impl.ControllerKit;
|
||||||
|
import com.eversec.kit.creator.impl.DaoMapper;
|
||||||
|
import com.eversec.kit.creator.impl.JavaBeanKit;
|
||||||
|
import com.eversec.kit.creator.impl.ServiceImplKit;
|
||||||
|
import com.eversec.kit.creator.impl.ServiceKit;
|
||||||
|
import com.eversec.kit.creator.impl.SqlKit;
|
||||||
import com.eversec.kit.creator.impl.page.*;
|
import com.eversec.kit.creator.impl.page.*;
|
||||||
|
import com.eversec.kit.creator.impl.XmlSqlKit;
|
||||||
import com.eversec.service.CfgBean;
|
import com.eversec.service.CfgBean;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@ -20,26 +26,38 @@ public class Runner {
|
|||||||
List<ICreator> creators = new ArrayList<>();
|
List<ICreator> creators = new ArrayList<>();
|
||||||
|
|
||||||
List<String> ca = cfgBean.getCa();
|
List<String> ca = cfgBean.getCa();
|
||||||
|
|
||||||
|
// fixme:bfx ,
|
||||||
|
// 此处逻辑比较混乱可改善
|
||||||
|
// R:lxy
|
||||||
ca.forEach(x -> {
|
ca.forEach(x -> {
|
||||||
if ("service".equalsIgnoreCase(x)) {
|
if ("service".equalsIgnoreCase(x)) {
|
||||||
creators.add(new JavaBeanKit());// JavaBean
|
if ("mb".equalsIgnoreCase(cfgBean.getServiceTpl())){
|
||||||
creators.add(new XmlSqlKit());// 生成mysql 版本的xml配置文件, 如果要生成Es使用对应的实例对象即可
|
creators.add(new JavaBeanKit());// JavaBean
|
||||||
creators.add(new ControllerKit());// Controller
|
creators.add(new XmlSqlKit());// 生成mysql 版本的xml配置文件, 如果要生成Es使用对应的实例对象即可
|
||||||
creators.add(new ServiceKit());//service
|
creators.add(new ControllerKit());// Controller
|
||||||
creators.add(new ServiceImplKit());//ServiceImpl
|
creators.add(new ServiceKit());//service
|
||||||
creators.add(new DaoMapper());// Mapper.java文件 针对使用Mybites创建对应的xxxMapper.java
|
creators.add(new ServiceImplKit());//ServiceImpl
|
||||||
|
creators.add(new DaoMapper());// Mapper.java文件 针对使用Mybites创建对应的xxxMapper.java
|
||||||
|
}else if ("hb".equalsIgnoreCase(cfgBean.getServiceTpl())){
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ("ddl".equalsIgnoreCase(x)) {
|
if ("ddl".equalsIgnoreCase(x)) {
|
||||||
creators.add(new SqlKit());// Mysql 建表语句,【提示Es或者其他建表语句可自行创建对应的实现】
|
creators.add(new SqlKit());// Mysql 建表语句,【提示Es或者其他建表语句可自行创建对应的实现】
|
||||||
}
|
}
|
||||||
if ("front".equalsIgnoreCase(x)) {
|
if ("front".equalsIgnoreCase(x)) {
|
||||||
creators.add(new CtrlKit());
|
if ("a".equalsIgnoreCase(cfgBean.getFontTpl())){
|
||||||
creators.add(new ListKit());
|
creators.add(new CtrlKit());
|
||||||
creators.add(new EditKit());
|
creators.add(new ListKit());
|
||||||
creators.add(new EditCtrlKit());
|
creators.add(new EditKit());
|
||||||
creators.add(new ConditionKit());
|
creators.add(new EditCtrlKit());
|
||||||
creators.add(new DetailKit());
|
creators.add(new ConditionKit());
|
||||||
creators.add(new DetailCtrlKit());
|
creators.add(new DetailKit());
|
||||||
|
creators.add(new DetailCtrlKit());
|
||||||
|
}else if ("v".equalsIgnoreCase(cfgBean.getFontTpl())){
|
||||||
|
creators.add(new VueKit());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return creators;
|
return creators;
|
||||||
@ -50,6 +68,7 @@ public class Runner {
|
|||||||
|
|
||||||
StringBuilder sqlBuf = new StringBuilder();
|
StringBuilder sqlBuf = new StringBuilder();
|
||||||
List<Kv> ctrList = new ArrayList<>();
|
List<Kv> ctrList = new ArrayList<>();
|
||||||
|
List<Kv> vueRouterList = new ArrayList<>();
|
||||||
|
|
||||||
infoBuf.append("------------ start ... ------------\n");
|
infoBuf.append("------------ start ... ------------\n");
|
||||||
infoBuf.append("create service code path:" + ICreator.dirPath + "\n");
|
infoBuf.append("create service code path:" + ICreator.dirPath + "\n");
|
||||||
@ -82,9 +101,19 @@ public class Runner {
|
|||||||
else if (x instanceof SqlKit){
|
else if (x instanceof SqlKit){
|
||||||
sqlBuf.append(x.createStr(clazz, list, para));
|
sqlBuf.append(x.createStr(clazz, list, para));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//构建业务代码文件
|
||||||
else {
|
else {
|
||||||
|
if (x instanceof VueKit){
|
||||||
|
Kv kt = new Kv();
|
||||||
|
kt.put("name",ICreator.toLowerCaseFirst(clazz));
|
||||||
|
kt.put("title",remark);
|
||||||
|
vueRouterList.add(kt);
|
||||||
|
}
|
||||||
|
|
||||||
x.createFile(x.createStr(clazz, list, para), clazz);
|
x.createFile(x.createStr(clazz, list, para), clazz);
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@ -109,6 +138,12 @@ public class Runner {
|
|||||||
String strList = ICreator.engine.getTemplate(ICreator.tplPath + "front/ext/listExtTpl.html").renderToString(Kv.of("data", ctrList));
|
String strList = ICreator.engine.getTemplate(ICreator.tplPath + "front/ext/listExtTpl.html").renderToString(Kv.of("data", ctrList));
|
||||||
FileKit.strToFile(strList, new File("tmp/list.html"));
|
FileKit.strToFile(strList, new File("tmp/list.html"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (vueRouterList.size() > 0){
|
||||||
|
String vList = ICreator.engine.getTemplate(ICreator.tplPath + "front/VueRouterTpl.js").renderToString(Kv.of("cfg", vueRouterList));
|
||||||
|
FileKit.strToFile(vList, new File(ICreator.pageDirPath + "/kit/routerConfig.js"));
|
||||||
|
}
|
||||||
|
|
||||||
infoBuf.append("------------ complete! -----------\n");
|
infoBuf.append("------------ complete! -----------\n");
|
||||||
|
|
||||||
System.out.println(infoBuf.toString());
|
System.out.println(infoBuf.toString());
|
||||||
|
129
src/com/eversec/kit/creator/impl/page/VueKit.java
Normal file
129
src/com/eversec/kit/creator/impl/page/VueKit.java
Normal file
@ -0,0 +1,129 @@
|
|||||||
|
package com.eversec.kit.creator.impl.page;
|
||||||
|
|
||||||
|
import com.eversec.common.Kv;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import static java.util.Arrays.asList;
|
||||||
|
|
||||||
|
public class VueKit extends PageKit {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public File getFile(String clazz) {
|
||||||
|
return new File(filePath(clazz), toLowerCaseFirst(clazz) + ".vue");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String createStr(String clazz, List<Map> fieldList, Map para) {
|
||||||
|
List<Map> ft = new ArrayList<>();
|
||||||
|
ft.addAll(fieldList);
|
||||||
|
List<String> sc = new ArrayList<>();
|
||||||
|
List<Map> filterList = new ArrayList<>();
|
||||||
|
List<String> detailsList = new ArrayList<>();
|
||||||
|
List<Map> editsList = new ArrayList<>();
|
||||||
|
ft.forEach(x -> {
|
||||||
|
x.put("field", (x.get("field") + "").trim());
|
||||||
|
x.put("isMust", isMust(x));
|
||||||
|
x.put("fieldType", getFiledType(x.get("cate")+""));
|
||||||
|
x.put("fieldV",createFiled(x));
|
||||||
|
// Fixme: bfx ,
|
||||||
|
// 下面几个if - else 中存在明显的重复性代码,可改善
|
||||||
|
// R:lxy
|
||||||
|
if ("1".equals(x.get("column"))){
|
||||||
|
sc.add((x.get("field") + "").trim());
|
||||||
|
}
|
||||||
|
if ("1".equals(x.get("filter"))){
|
||||||
|
Map map = new HashMap();
|
||||||
|
map.put("name",(x.get("field") + "").trim());
|
||||||
|
map.put("label",x.get("remark1"));
|
||||||
|
map.put("col","EQUAL");
|
||||||
|
map.put("remark","等于");
|
||||||
|
filterList.add(map);
|
||||||
|
}
|
||||||
|
if ("like".equals(x.get("filter"))){
|
||||||
|
Map map = new HashMap();
|
||||||
|
map.put("name",(x.get("field") + "").trim());
|
||||||
|
map.put("label",x.get("remark1"));
|
||||||
|
map.put("col","LIKE");
|
||||||
|
map.put("remark","LIKE");
|
||||||
|
filterList.add(map);
|
||||||
|
}
|
||||||
|
if ("1".equals(x.get("xqzs"))){
|
||||||
|
detailsList.add((x.get("field") + "").trim());
|
||||||
|
}
|
||||||
|
if ("1".equals(x.get("edit"))){
|
||||||
|
Map map = new HashMap();
|
||||||
|
if ("id".equals((x.get("field") + "").trim())){
|
||||||
|
map.put("col",(x.get("field") + "").trim());
|
||||||
|
map.put("upAttr","hidden");
|
||||||
|
map.put("addAttr","none");
|
||||||
|
|
||||||
|
}else {
|
||||||
|
map.put("col",(x.get("field") + "").trim());
|
||||||
|
if ("1".equals(x.get("ck"))){
|
||||||
|
map.put("ck",(x.get("field") + "").trim());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
editsList.add(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
Kv kv = createTplData(clazz);
|
||||||
|
kv.set("remark", para.get("remark"));
|
||||||
|
kv.set("fieldList", ft);
|
||||||
|
kv.set("showCol",sc);
|
||||||
|
kv.set("fs",filterList);
|
||||||
|
kv.set("detailsList",detailsList);
|
||||||
|
kv.set("editsList",editsList);
|
||||||
|
kv.set("conditionLabel", getConditionLabel(ft, para));
|
||||||
|
|
||||||
|
return engine.getTemplate(tplPath + "front/VueTpl.vue").renderToString(kv);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String createFiled(Map x){
|
||||||
|
String res = "";
|
||||||
|
if ("2".equals(String.valueOf(x.get("edit")))) {
|
||||||
|
res = x.get("field") + "||" + x.get("selects");
|
||||||
|
} else if ("SELECT".equalsIgnoreCase(String.valueOf(x.get("tag")))) {
|
||||||
|
res = x.get("field") + "=" + x.get("field");
|
||||||
|
} else if ("SELECT_EXT".equalsIgnoreCase(String.valueOf(x.get("tag")))) {
|
||||||
|
res = x.get("field") + "|" + x.get("selects");
|
||||||
|
} else if ("INPUT_DT".equalsIgnoreCase(String.valueOf(x.get("tag")))) {
|
||||||
|
res = x.get("field") + "=dt";
|
||||||
|
} else if ("FILE_EXT".equalsIgnoreCase(String.valueOf(x.get("tag")))) {
|
||||||
|
res = x.get("selects") + "";
|
||||||
|
} else {
|
||||||
|
res = x.get("field") + "";
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String filePath(String clazz) {
|
||||||
|
return dirPath + "/kit/";
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取设置了关键字查询的 字段“描述”
|
||||||
|
private String getConditionLabel(List<Map> fieldList, Map para) {
|
||||||
|
StringBuilder buf = new StringBuilder();
|
||||||
|
if (para.get("condition") != null){
|
||||||
|
List<String> conditions = asList((String[]) para.get("condition"));
|
||||||
|
fieldList.forEach(m->{
|
||||||
|
for (String str : conditions) {
|
||||||
|
//字段有大小写转换,这里需要使用 equalsIgnoreCase 进行比较
|
||||||
|
if ((m.get("field")+"").trim().equalsIgnoreCase(str)) {
|
||||||
|
buf.append(m.get("remark1")+"/");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (buf.length() > 0){
|
||||||
|
buf.deleteCharAt(buf.length()-1);
|
||||||
|
}
|
||||||
|
return buf.toString();
|
||||||
|
}
|
||||||
|
}
|
@ -19,6 +19,8 @@ public class CfgBean {
|
|||||||
private String pkg;
|
private String pkg;
|
||||||
private String pageModel;
|
private String pageModel;
|
||||||
private String author;
|
private String author;
|
||||||
|
private String fontTpl;
|
||||||
|
private String serviceTpl;
|
||||||
private List<String> ca;
|
private List<String> ca;
|
||||||
private List<String> sheetNames;
|
private List<String> sheetNames;
|
||||||
|
|
||||||
@ -86,6 +88,22 @@ public class CfgBean {
|
|||||||
this.author = author;
|
this.author = author;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getFontTpl() {
|
||||||
|
return fontTpl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFontTpl(String fontTpl) {
|
||||||
|
this.fontTpl = fontTpl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getServiceTpl() {
|
||||||
|
return serviceTpl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setServiceTpl(String serviceTpl) {
|
||||||
|
this.serviceTpl = serviceTpl;
|
||||||
|
}
|
||||||
|
|
||||||
public List<String> getCa() {
|
public List<String> getCa() {
|
||||||
return ca;
|
return ca;
|
||||||
}
|
}
|
||||||
|
@ -3,9 +3,9 @@ package #(pkg).controller;
|
|||||||
import com.eversec.common.AbstractBaseController;
|
import com.eversec.common.AbstractBaseController;
|
||||||
import com.eversec.common.JBean;
|
import com.eversec.common.JBean;
|
||||||
import com.eversec.common.Domain;
|
import com.eversec.common.Domain;
|
||||||
|
import com.eversec.common.PageBean;
|
||||||
import #(pkg).domain.#(bean);
|
import #(pkg).domain.#(bean);
|
||||||
import #(pkg).service.#(bean)Service;
|
import #(pkg).service.#(bean)Service;
|
||||||
import com.eversec.framework.core.data.QueryResult;
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.annotations.ApiParam;
|
||||||
@ -99,7 +99,7 @@ public class #(bean)Controller extends AbstractBaseController {
|
|||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
|
|
||||||
QueryResult pageBean = #(beanFL)Service.findPage(m);
|
PageBean pageBean = #(beanFL)Service.findPage(m);
|
||||||
return JBean.by(200, "成功", pageBean).toJson();
|
return JBean.by(200, "成功", pageBean).toJson();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ public class #(bean) extends Domain {
|
|||||||
,field=field.substring(0, 1).toLowerCase() + field.substring(1)
|
,field=field.substring(0, 1).toLowerCase() + field.substring(1)
|
||||||
)
|
)
|
||||||
#if(x.fieldType == "Date")
|
#if(x.fieldType == "Date")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
#end
|
#end
|
||||||
private #(x.fieldType) #(field); //#(x.remark)
|
private #(x.fieldType) #(field); //#(x.remark)
|
||||||
#end
|
#end
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
#define buildIF(x)
|
#define buildIF(x)
|
||||||
<if test="#(x.field) != null#if((!x.isNumber)) and #(x.field) != ''#end">
|
<if test="#(x.field) != null#if((!x.isNumber)) and #(x.field) != ''#end">
|
||||||
#end
|
#end
|
||||||
|
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="#(pkg).dao.#(bean)Mapper">
|
<mapper namespace="#(pkg).dao.#(bean)Mapper">
|
||||||
|
14
tpl/front/VueRouterTpl.js
Normal file
14
tpl/front/VueRouterTpl.js
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
/**
|
||||||
|
* 工具模板路由配置信息
|
||||||
|
*/
|
||||||
|
export default [
|
||||||
|
#for(x : cfg)
|
||||||
|
#set(name=x.name,
|
||||||
|
title=x.title)
|
||||||
|
{
|
||||||
|
name: '#(name)',
|
||||||
|
title: '#(title)'
|
||||||
|
}#if(!(for.last)),
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
]
|
108
tpl/front/VueTpl.vue
Normal file
108
tpl/front/VueTpl.vue
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
|
||||||
|
<template>
|
||||||
|
<kit-common-list :componentListCfg="componentListCfg"/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "kit-#(beanFL)",
|
||||||
|
data(){
|
||||||
|
return {
|
||||||
|
componentListCfg: {
|
||||||
|
apiCfg: {
|
||||||
|
|
||||||
|
title: "#(remark)",
|
||||||
|
|
||||||
|
conditionLabel: "#(conditionLabel)",
|
||||||
|
|
||||||
|
url: "/#(bean.toLowerCase())",
|
||||||
|
|
||||||
|
items: {
|
||||||
|
#for(x : fieldList)
|
||||||
|
#set(field=x.field,field=field.substring(0, 1).toLowerCase() + field.substring(1)
|
||||||
|
,selects=x.selects
|
||||||
|
,tag=x.tag
|
||||||
|
,remark=x.remark1
|
||||||
|
,fieldV=x.fieldV
|
||||||
|
)
|
||||||
|
"#(field)": {
|
||||||
|
"col": "#(field)",
|
||||||
|
"label": "#(remark)",
|
||||||
|
"inExt": "#(selects)",
|
||||||
|
"inType": "#(tag)",
|
||||||
|
"expr": "#(fieldV)"
|
||||||
|
}#if(!(for.last)),
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
},
|
||||||
|
|
||||||
|
shows: [
|
||||||
|
#for(x : showCol)
|
||||||
|
#set(col=x
|
||||||
|
)
|
||||||
|
{
|
||||||
|
"col": "#(col)",
|
||||||
|
"order": false
|
||||||
|
}#if(!(for.last)),
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
],
|
||||||
|
|
||||||
|
filters: [
|
||||||
|
#for(x : fs)
|
||||||
|
#set(name=x.name,
|
||||||
|
label=x.label,
|
||||||
|
col=x.col,
|
||||||
|
remark=x.remark
|
||||||
|
)
|
||||||
|
{
|
||||||
|
name: "#(name)",
|
||||||
|
label: "#(label)",
|
||||||
|
filterType: [
|
||||||
|
{
|
||||||
|
col: "#(col)",
|
||||||
|
remark: "#(remark)"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
checked: false
|
||||||
|
}#if(!(for.last)),
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
],
|
||||||
|
|
||||||
|
edits: [
|
||||||
|
#for(x : editsList)
|
||||||
|
#set(col=x.col,
|
||||||
|
upAttr=x.upAttr,
|
||||||
|
addAttr=x.addAttr,
|
||||||
|
ck=x.ck
|
||||||
|
)
|
||||||
|
{
|
||||||
|
col: "#(col)",
|
||||||
|
#if(null!=upAttr)
|
||||||
|
upAttr: "#(upAttr)",
|
||||||
|
#end
|
||||||
|
#if(null!=addAttr)
|
||||||
|
addAttr: "#(addAttr)",
|
||||||
|
#end
|
||||||
|
#if(null!=ck)
|
||||||
|
ck: "#(ck)"
|
||||||
|
#end
|
||||||
|
}#if(!(for.last)),
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
],
|
||||||
|
|
||||||
|
details: [
|
||||||
|
#for(x : detailsList)
|
||||||
|
#set(col=x)
|
||||||
|
{col: "#(col)"}#if(!(for.last)),
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
Loading…
Reference in New Issue
Block a user