main
黄海 3 years ago
parent abe08b88ba
commit 9bcfcb2877

@ -0,0 +1,7 @@
3个阶段
每个阶段有不同的任务
每个任务有多个模板,
http://10.10.11.124:9000/FengHuang/html/formDesign/index.html

@ -1839,7 +1839,8 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen
} else {
$label.css("display", "block");
$block.css("margin-left", json.labelWidth);
} $label.css("width",json.labelWidth);
}
$label.css("width", json.labelWidth);
$label.append(json.label + ":");
if (json.disabled) {
$("#" + json.id).find(".layui-input-block").append('<div class="iceEditor-disabled" style="width: 10%;height: 89%;"></div>');
@ -4100,7 +4101,6 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen
}
/* 给字段属性绑定事件 实现双向绑定*/
Class.prototype.bindPropertyEvent = function (_json) {
var that = this
@ -4649,28 +4649,36 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen
});
//注册导出数据
$('.exportJson').on('click', function () {
document.getElementById('generate-code-view').value = JSON.stringify(options.data, null, 4);
layer.open({
type: 1
, title: 'JSON 数据导出'
, id: 'Lay_layer_htmlcodeview'
, content: $('.htmlcodeview')
, area: ['800px', '640px']
, shade: false
, resize: false
, success: function (layero, index) {
//需要获取当前的url中参数module_id和page
let module_id = $.getUrlParam('module_id');
let page = $.getUrlParam('page');
let content = JSON.stringify(options.data, null, 4);
if (content.length == 2) {
layer.alert('内容不能为空', {icon: 0, title: '保存失败'})
return;
}
, end: function () {
$('.htmlcodeview').css("display","none")
$.ajax({
type: "POST",
dataType: "json",
url: "/FengHuang/zjb/saveModulePage",
data: {
"module_id": module_id,
"page": page,
"json": content
},
async: false,
success: function (result) {
layer.alert('保存成功!', {icon: 1, title: '成功'})
return;
}
});
});
$('.generateCode').on('click', function () {
var _html = $('<div style="height:100%;width:100%;"></div>');
var _script = $('<div style="height:100%;width:100%;"></div>');;
var _script = $('<div style="height:100%;width:100%;"></div>');
;
that.generateHtml(options.data, _html, _script);
var _htmlCode = staticField.htmlCode.format(_html.html(), _script.html());
document.getElementById('generate-code-view').value = style_html(_htmlCode, 4, ' ', 400);
@ -4748,7 +4756,8 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen
//拖动结束
onEnd: function (evt) {
//console.log(evt);
}};
}
};
var gridSortable = Sortable.create(el, ops);
}
};
@ -5085,7 +5094,6 @@ layui.config({base: './ayq/modules/'}).define(["layer",'flow', "laytpl", "elemen
}
/* 复制json中的节点并返回上一个节点*/
Class.prototype.copyJsonAfterItem = function (json, id) {
var that = this,

@ -173,10 +173,10 @@ layui.define(['layer'], function (exports) {
// ' <a id="btnImportJson" href="#" class="importJson">导入数据</a>\n' +
// ' </li>\n' +
' <li class="layui-nav-item">\n' +
' <a id="btnExportJson" href="#" class="exportJson">保存模板</a>\n' +
' <a id="btnExportJson" href="#" class="exportJson">保存</a>\n' +
' </li>\n' +
' <li class="layui-nav-item">\n' +
' <a href="#" class="previewForm">生成表单页</a>\n' +
' <a href="#" class="previewForm">查看测试页</a>\n' +
' </li>\n' +
// ' <li class="layui-nav-item">\n' +
// ' <a href="#" class="generateCode">生成代码</a>\n' +

@ -23,6 +23,11 @@
<script type="text/javascript" src="./ayq/js/htmlformat.js"></script>
<script type="text/javascript" src="./ayq/js/jsformat.js"></script>
<script type="text/javascript" src="./ayq/modules/iceEditor/iceEditor.js"></script>
<!--引用新版本Jquery-->
<script type="text/javascript" src="../../js/jquery-3.6.0.min.js"></script>
<script type="text/javascript" src="../../js/jquery_Extend.js"></script>
<script>
layui.config({base: './ayq/modules/'}).use(['layer', 'formDesigner'], function () {
var formDesigner = layui.formDesigner;

@ -0,0 +1,8 @@
//扩展一下Jquery支持计入Url中的参数
(function ($) {
$.getUrlParam = function (name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]); return null;
}
})(jQuery);

@ -20,6 +20,7 @@ import com.dsideal.FengHuang.TeacherYd.Controller.TeacherYdController;
import com.dsideal.FengHuang.Util.FileUtil;
import com.dsideal.FengHuang.Util.LogBackLogFactory;
import com.dsideal.FengHuang.Util.PkUtil;
import com.dsideal.FengHuang.Zjb.Controller.ZjbController;
import com.jfinal.config.*;
import com.jfinal.kit.PropKit;
import com.jfinal.plugin.activerecord.ActiveRecordPlugin;
@ -82,6 +83,8 @@ public class Start extends JFinalConfig {
me.add("/studentYd", StudentYdController.class);
//菜单管理
me.add("/menu", MenuController.class);
//装甲兵
me.add("/zjb", ZjbController.class);
// 配置Swagger UI访问路由
// http://127.0.0.1:9000/FengHuang/swagger/index

@ -0,0 +1,19 @@
package com.dsideal.FengHuang.Zjb.Controller;
import com.dsideal.FengHuang.Interceptor.IsNumericInterface;
import com.dsideal.FengHuang.Util.CommonUtil;
import com.dsideal.FengHuang.Zjb.Model.ZjbModel;
import com.jfinal.aop.Before;
import com.jfinal.core.Controller;
import com.jfinal.ext.interceptor.POST;
public class ZjbController extends Controller {
ZjbModel zm = new ZjbModel();
@Before({POST.class})
@IsNumericInterface({"module_id", "page"})
public void saveModulePage(int module_id, int page, String json) {
zm.saveModulePage(module_id, page, json);
renderJson(CommonUtil.returnMessageJson(true, "保存成功!"));
}
}

@ -0,0 +1,36 @@
package com.dsideal.FengHuang.Zjb.Model;
import com.dsideal.FengHuang.LoginPerson.Model.LoginPersonModel;
import com.dsideal.FengHuang.Util.CommonUtil;
import com.dsideal.FengHuang.Util.IpUtil;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Page;
import com.jfinal.plugin.activerecord.Record;
import com.jfinal.plugin.activerecord.SqlPara;
import java.util.List;
public class ZjbModel {
/*
*/
public void delModulePage(int module_id, int page) {
String sql = "delete from t_zjb_module_page where module_id=? and page=?";
Db.update(sql, module_id, page);
}
/*
2022-12-26
*/
public void saveModulePage(int module_id, int page, String json) {
delModulePage(module_id, page);
Record record = new Record();
record.set("module_id", module_id);
record.set("page", page);
record.set("json", json);
Db.save("t_zjb_module_page", "module_id,page", record);
}
}
Loading…
Cancel
Save