diff --git a/Doc/设计思路.txt b/Doc/设计思路.txt index 8d39c8e..36dda28 100644 --- a/Doc/设计思路.txt +++ b/Doc/设计思路.txt @@ -3,5 +3,4 @@ 每个任务有多个模板, - -http://10.10.11.124:9000/FengHuang/html/formDesign/index.html \ No newline at end of file +http://10.10.11.124:9000/FengHuang/html/formDesign/listPageInfo.html?module_id=1 \ No newline at end of file diff --git a/WebRoot/html/formDesign/ayq/modules/formDesigner.js b/WebRoot/html/formDesign/ayq/modules/formDesigner.js index 599582a..899b077 100644 --- a/WebRoot/html/formDesign/ayq/modules/formDesigner.js +++ b/WebRoot/html/formDesign/ayq/modules/formDesigner.js @@ -4647,8 +4647,8 @@ layui.config({base: './ayq/modules/'}).define(["layer", 'flow', "laytpl", "eleme layer.closeAll(); layer.msg('导入成功'); }); - //注册导出数据 - $('.exportJson').on('click', function () { + + function save(flag) { //需要获取当前的url中参数module_id和page let module_id = $.getUrlParam('module_id'); let page = $.getUrlParam('page'); @@ -4669,10 +4669,27 @@ layui.config({base: './ayq/modules/'}).define(["layer", 'flow', "laytpl", "eleme }, async: false, success: function (result) { - layer.msg('保存成功!', {icon: 1,time:1500}) + layer.msg('保存成功!', {icon: 1, time: 1500}, + function (index) { + if (flag) window.location.href = "listPageInfo.html?module_id=" + module_id; + } + ); return; } }); + } + + //保存 + $('.exportJson').on('click', function () { + save(false); + }) + //保存&返回 + $('.saveAndPrePage').on('click', function () { + save(true); + }) + //直接返回 + $('.prePage').on('click', function () { + history.back(); }) $('.generateCode').on('click', function () { diff --git a/WebRoot/html/formDesign/ayq/modules/staticField.js b/WebRoot/html/formDesign/ayq/modules/staticField.js index b082950..d4e58d0 100644 --- a/WebRoot/html/formDesign/ayq/modules/staticField.js +++ b/WebRoot/html/formDesign/ayq/modules/staticField.js @@ -175,12 +175,12 @@ layui.define(['layer'], function (exports) { '
  • \n' + ' 保存\n' + '
  • \n' + - // '
  • \n' + - // ' 查看测试页\n' + - // '
  • \n' + - // '
  • \n' + - // ' 生成代码\n' + - // '
  • \n' + + '
  • \n' + + ' 保存&返回\n' + + '
  • \n' + + '
  • \n' + + ' 直接返回\n' + + '
  • \n' + ' \n' + ' \n' + '
    \n' + diff --git a/WebRoot/html/formDesign/index.html b/WebRoot/html/formDesign/designModulePage.html similarity index 100% rename from WebRoot/html/formDesign/index.html rename to WebRoot/html/formDesign/designModulePage.html diff --git a/WebRoot/html/formDesign/listPageInfo.html b/WebRoot/html/formDesign/listPageInfo.html new file mode 100644 index 0000000..47ae1b0 --- /dev/null +++ b/WebRoot/html/formDesign/listPageInfo.html @@ -0,0 +1,65 @@ + + + + + + 模板内容构建 + + + + + + + + +
    + + + + + \ No newline at end of file diff --git a/src/main/java/com/dsideal/FengHuang/Zjb/Controller/ZjbController.java b/src/main/java/com/dsideal/FengHuang/Zjb/Controller/ZjbController.java index 7cbcadb..b3d5212 100644 --- a/src/main/java/com/dsideal/FengHuang/Zjb/Controller/ZjbController.java +++ b/src/main/java/com/dsideal/FengHuang/Zjb/Controller/ZjbController.java @@ -7,6 +7,9 @@ import com.jfinal.aop.Before; import com.jfinal.core.Controller; import com.jfinal.ext.interceptor.GET; import com.jfinal.ext.interceptor.POST; +import com.jfinal.plugin.activerecord.Record; + +import java.util.List; public class ZjbController extends Controller { ZjbModel zm = new ZjbModel(); @@ -24,4 +27,11 @@ public class ZjbController extends Controller { String json = zm.getModulePage(module_id, page); renderJson(json); } + + @Before({GET.class}) + @IsNumericInterface({"module_id"}) + public void getModulePageFillInfo(int module_id) { + List list = zm.getModulePageFillInfo(module_id); + renderJson(CommonUtil.renderJsonForLayUI(list)); + } } \ No newline at end of file diff --git a/src/main/java/com/dsideal/FengHuang/Zjb/Model/ZjbModel.java b/src/main/java/com/dsideal/FengHuang/Zjb/Model/ZjbModel.java index 1112744..559ac96 100644 --- a/src/main/java/com/dsideal/FengHuang/Zjb/Model/ZjbModel.java +++ b/src/main/java/com/dsideal/FengHuang/Zjb/Model/ZjbModel.java @@ -8,7 +8,10 @@ import com.jfinal.plugin.activerecord.Page; import com.jfinal.plugin.activerecord.Record; import com.jfinal.plugin.activerecord.SqlPara; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; public class ZjbModel { @@ -43,4 +46,34 @@ public class ZjbModel { if (list.size() > 0) return list.get(0).getStr("json"); return "[]"; } + + public Record getMoudleInfo(int module_id) { + String sql = "select * from t_zjb_module where module_id=?"; + return Db.findFirst(sql, module_id); + } + + public List getModulePageFillInfo(int module_id) { + String sql = "select * from t_zjb_module_page where module_id=?"; + List exist = Db.find(sql, module_id); + Map _map = new HashMap<>(); + for (Record record : exist) { + _map.put(record.getInt("page"), record.getStr("json")); + } + Record record = getMoudleInfo(module_id); + int page_count = record.getInt("page_count"); + List res = new ArrayList<>(); + for (int i = 1; i <= page_count; i++) { + Record r = new Record(); + r.set("page", i); + if (_map.containsKey(i)) { + r.set("json", _map.get(i)); + r.set("filled", true); + } else { + r.set("json", "[]"); + r.set("filled", false); + } + res.add(r); + } + return res; + } } \ No newline at end of file