提交 98b740e0 编写于 作者: Skyeye云's avatar Skyeye云

给html或者js或者xml添加内容的界面完成

上级 0a8f1404
......@@ -20,4 +20,8 @@ public interface DsFormContentDao {
public int editDsFormContentMationById(Map<String, Object> map) throws Exception;
public List<Map<String, Object>> queryDsFormContentMationToShow(Map<String, Object> map) throws Exception;
public Map<String, Object> queryDsFormContentDetailedMationToShow(Map<String, Object> map) throws Exception;
}
......@@ -20,4 +20,6 @@ public interface DsFormLimitRequirementDao {
public int editDsFormLimitRequirementMationById(Map<String, Object> map) throws Exception;
public List<Map<String, Object>> queryDsFormLimitRequirementMationToShow(Map<String, Object> map) throws Exception;
}
......@@ -15,4 +15,8 @@ public interface DsFormContentService {
public void editDsFormContentMationById(InputObject inputObject, OutputObject outputObject) throws Exception;
public void queryDsFormContentMationToShow(InputObject inputObject, OutputObject outputObject) throws Exception;
public void queryDsFormContentDetailedMationToShow(InputObject inputObject, OutputObject outputObject) throws Exception;
}
......@@ -15,4 +15,6 @@ public interface DsFormLimitRequirementService {
public void editDsFormLimitRequirementMationById(InputObject inputObject, OutputObject outputObject) throws Exception;
public void queryDsFormLimitRequirementMationToShow(InputObject inputObject, OutputObject outputObject) throws Exception;
}
......@@ -118,5 +118,42 @@ public class DsFormContentServiceImpl implements DsFormContentService{
outputObject.setreturnMessage("该动态表单内容名称已存在,不可进行二次保存");
}
}
/**
*
* @Title: queryDsFormContentMationToShow
* @Description: 获取动态表单内容供展示
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@Override
public void queryDsFormContentMationToShow(InputObject inputObject, OutputObject outputObject) throws Exception {
Map<String, Object> map = inputObject.getParams();
List<Map<String, Object>> beans = dsFormContentDao.queryDsFormContentMationToShow(map);
if(beans != null){
outputObject.setBeans(beans);
outputObject.settotal(beans.size());
}
}
/**
*
* @Title: queryDsFormContentDetailedMationToShow
* @Description: 获取动态表单内容详细信息供展示
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@Override
public void queryDsFormContentDetailedMationToShow(InputObject inputObject, OutputObject outputObject) throws Exception {
Map<String, Object> map = inputObject.getParams();
Map<String, Object> bean = dsFormContentDao.queryDsFormContentDetailedMationToShow(map);
outputObject.setBean(bean);
}
}
......@@ -118,5 +118,25 @@ public class DsFormLimitRequirementServiceImpl implements DsFormLimitRequirement
outputObject.setreturnMessage("该动态表单条件限制类型名称已存在,不可进行二次保存");
}
}
/**
*
* @Title: queryDsFormLimitRequirementMationToShow
* @Description: 获取动态表单内容供展示
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@Override
public void queryDsFormLimitRequirementMationToShow(InputObject inputObject, OutputObject outputObject) throws Exception {
Map<String, Object> map = inputObject.getParams();
List<Map<String, Object>> beans = dsFormLimitRequirementDao.queryDsFormLimitRequirementMationToShow(map);
if(beans != null){
outputObject.setBeans(beans);
outputObject.settotal(beans.size());
}
}
}
......@@ -94,4 +94,36 @@ public class DsFormContentController {
dsFormContentService.editDsFormContentMationById(inputObject, outputObject);
}
/**
*
* @Title: queryDsFormContentMationToShow
* @Description: 获取动态表单内容供展示
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@RequestMapping("/post/DsFormContentController/queryDsFormContentMationToShow")
@ResponseBody
public void queryDsFormContentMationToShow(InputObject inputObject, OutputObject outputObject) throws Exception{
dsFormContentService.queryDsFormContentMationToShow(inputObject, outputObject);
}
/**
*
* @Title: queryDsFormContentDetailedMationToShow
* @Description: 获取动态表单内容详细信息供展示
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@RequestMapping("/post/DsFormContentController/queryDsFormContentDetailedMationToShow")
@ResponseBody
public void queryDsFormContentDetailedMationToShow(InputObject inputObject, OutputObject outputObject) throws Exception{
dsFormContentService.queryDsFormContentDetailedMationToShow(inputObject, outputObject);
}
}
......@@ -94,4 +94,20 @@ public class DsFormLimitRequirementController {
dsFormLimitRequirementService.editDsFormLimitRequirementMationById(inputObject, outputObject);
}
/**
*
* @Title: queryDsFormLimitRequirementMationToShow
* @Description: 获取动态表单内容供展示
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@RequestMapping("/post/DsFormLimitRequirementController/queryDsFormLimitRequirementMationToShow")
@ResponseBody
public void queryDsFormLimitRequirementMationToShow(InputObject inputObject, OutputObject outputObject) throws Exception{
dsFormLimitRequirementService.queryDsFormLimitRequirementMationToShow(inputObject, outputObject);
}
}
......@@ -82,5 +82,29 @@
WHERE id = #{id}
</update>
<select id="queryDsFormContentMationToShow" parameterType="java.util.Map" resultType="java.util.Map">
SELECT
a.id,
a.`name`
FROM
ds_form_content a
WHERE 1 = 1
ORDER BY a.create_time DESC
</select>
<select id="queryDsFormContentDetailedMationToShow" parameterType="java.util.Map" resultType="java.util.Map">
SELECT
a.id,
a.`name` contentName,
a.html_content htmlContent,
a.html_type htmlType,
a.js_content jsContent,
a.js_type jsType,
CONVERT(a.create_time, char) createTime
FROM
ds_form_content a
WHERE a.id = #{id}
</select>
</mapper>
\ No newline at end of file
......@@ -88,4 +88,16 @@
WHERE id = #{id}
</update>
<select id="queryDsFormLimitRequirementMationToShow" parameterType="java.util.Map" resultType="java.util.Map">
SELECT
a.id,
a.`name` requireName,
a.former_requirement formerRequirement,
a.after_requirement afterRequirement,
CONVERT(a.create_time, char) createTime
FROM
ds_form_limit_requirement a
ORDER BY a.create_time DESC
</select>
</mapper>
\ No newline at end of file
......@@ -381,6 +381,11 @@
<property id="jsContent" name="jsContent" ref="" var="js内容"/>
<property id="rowId" name="id" ref="required" var="动态表单内容id"/>
</url>
<url id="dsform006" path="/post/DsFormContentController/queryDsFormContentMationToShow" val="获取动态表单内容供展示" allUse="1">
</url>
<url id="dsform007" path="/post/DsFormContentController/queryDsFormContentDetailedMationToShow" val="获取动态表单内容详细信息供展示" allUse="1">
<property id="rowId" name="id" ref="required" var="动态表单内容id"/>
</url>
<url id="dsformlimitrequirement001" path="/post/DsFormLimitRequirementController/queryDsFormLimitRequirementList" val="获取动态表单条件限制类型列表" allUse="1">
<property id="limit" name="limit" ref="required,num" var="分页参数,每页多少条数据" />
<property id="page" name="page" ref="required,num" var="分页参数,第几页"/>
......@@ -405,6 +410,8 @@
<property id="formerRequirement" name="formerRequirement" ref="required" var="前端限制条件标签"/>
<property id="afterRequirement" name="afterRequirement" ref="required" var="后端限制条件标签"/>
</url>
<url id="dsformlimitrequirement006" path="/post/DsFormLimitRequirementController/queryDsFormLimitRequirementMationToShow" val="获取动态表单内容供展示" allUse="1">
</url>
<!-- 动态表单系列结束 -->
<!-- 系统各部分说明开始 -->
......
......@@ -1103,6 +1103,18 @@ function js_beautify(js_source_text, indent_size, indent_character, indent_level
}
/**
* 根据数据展示
*/
function showDataUseHandlebars(id, source, data){
//预编译模板
var template = Handlebars.compile(source);
//匹配json内容
var html = template(data);
//输入模板
layui.$("#" + id).html(html);
}
......
layui.config({
base: basePath,
version: skyeyeVersion
}).define(['table', 'jquery', 'winui'], function (exports) {
winui.renderColor();
layui.use(['form', 'codemirror', 'xml', 'clike', 'css', 'htmlmixed', 'javascript', 'nginx',
'solr', 'sql', 'vue'], function (form) {
var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
var $ = layui.$,
form = layui.form;
form.render();
showDataUseHandlebars("tableColumn", getFileContent('tpl/template/table-column.tpl'), parent.tableColumn);
form.render('select');
//展现形式
showGrid({
id: "showModel",
url: reqBasePath + "dsform006",
params: {},
pagination: false,
template: getFileContent('tpl/template/select-option.tpl'),
ajaxSendLoadBefore: function(hdb){
},
ajaxSendAfter:function(json){
//限制条件
showGrid({
id: "limitRequire",
url: reqBasePath + "dsformlimitrequirement006",
params: {},
pagination: false,
template: getFileContent('tpl/template/checkbox-limit.tpl'),
ajaxSendLoadBefore: function(hdb){
},
ajaxSendAfter:function(json){
form.render();
}
});
form.on('select(selectParent)', function(data){
AjaxPostUtil.request({url:reqBasePath + "dsform007", params:{rowId: data.value}, type:'json', callback:function(json){
if(json.returnCode == 0){
var mode = returnModel(json.bean.htmlType);
if (!isNull(mode.length)) {
htmlModelEditor.setOption('mode', mode);
htmlSuccessEditor.setOption('mode', mode);
}
htmlModelEditor.setValue(json.bean.htmlContent);
mode = returnModel(json.bean.jsType);
if (!isNull(mode.length)) {
jsModelEditor.setOption('mode', mode);
jsSuccessEditor.setOption('mode', mode);
}
jsModelEditor.setValue(json.bean.jsContent);
}else{
top.winui.window.msg(json.returnMessage, {icon: 2,time: 2000});
}
}});
});
}
});
var htmlModelEditor = CodeMirror.fromTextArea(document.getElementById("htmlModelEditor"), {
mode : "text/x-java", // 模式
theme : "eclipse", // CSS样式选择
indentUnit : 2, // 缩进单位,默认2
smartIndent : true, // 是否智能缩进
tabSize : 4, // Tab缩进,默认4
readOnly : true, // 是否只读,默认false
showCursorWhenSelecting : true,
lineNumbers : true, // 是否显示行号
styleActiveLine: true, //line选择是是否加亮
matchBrackets: true,
});
var jsModelEditor = CodeMirror.fromTextArea(document.getElementById("jsModelEditor"), {
mode : "text/x-java", // 模式
theme : "eclipse", // CSS样式选择
indentUnit : 2, // 缩进单位,默认2
smartIndent : true, // 是否智能缩进
tabSize : 4, // Tab缩进,默认4
readOnly : true, // 是否只读,默认false
showCursorWhenSelecting : true,
lineNumbers : true, // 是否显示行号
styleActiveLine: true, //line选择是是否加亮
matchBrackets: true,
});
var htmlSuccessEditor = CodeMirror.fromTextArea(document.getElementById("htmlSuccessEditor"), {
mode : "text/x-java", // 模式
theme : "eclipse", // CSS样式选择
indentUnit : 2, // 缩进单位,默认2
smartIndent : true, // 是否智能缩进
tabSize : 4, // Tab缩进,默认4
readOnly : false, // 是否只读,默认false
showCursorWhenSelecting : true,
lineNumbers : true, // 是否显示行号
styleActiveLine: true, //line选择是是否加亮
matchBrackets: true,
});
var jsSuccessEditor = CodeMirror.fromTextArea(document.getElementById("jsSuccessEditor"), {
mode : "text/x-java", // 模式
theme : "eclipse", // CSS样式选择
indentUnit : 2, // 缩进单位,默认2
smartIndent : true, // 是否智能缩进
tabSize : 4, // Tab缩进,默认4
readOnly : false, // 是否只读,默认false
showCursorWhenSelecting : true,
lineNumbers : true, // 是否显示行号
styleActiveLine: true, //line选择是是否加亮
matchBrackets: true,
});
form.on('submit(formAddBean)', function (data) {
//表单验证
if (winui.verifyForm(data.elem)) {
}
return false;
});
//取消
$("body").on("click", "#cancle", function(){
parent.layer.close(index);
});
});
});
\ No newline at end of file
var rowId = "";
var tableColumn = '';//数据库表中的列
layui.config({
base: basePath,
version: skyeyeVersion
......@@ -16,6 +17,8 @@ layui.config({
var editId = "";//当前编辑的模板id
$("#addContentToHTMLorJS").hide();
var list = [];//存储模板生成集合
//集合内容
//var s = {
......@@ -120,6 +123,11 @@ layui.config({
if(isNull(s)){
top.winui.window.msg('请先转换模板', {icon: 2,time: 2000});
}else{
if(row.modelType == 'xml' || row.modelType == 'javascript' || row.modelType == 'htmlmixed' || row.modelType == 'htmlhh'){
$("#addContentToHTMLorJS").show();
}else{
$("#addContentToHTMLorJS").hide();
}
editId = row.id;
var mode = returnModel(row.modelType);
if (!isNull(mode.length)) {
......@@ -179,6 +187,21 @@ layui.config({
}
});
//给html、xml或者js添加内容
$("body").on("click", "#addContentToHTMLorJS", function(e){
_openNewWindows({
url: "../../tpl/codemodelgroup/addcontenttohtmlorjs.html",
title: "添加内容",
pageId: "addcontenttohtmlorjs",
callBack: function(refreshCode){
if (refreshCode == '0') {
} else if (refreshCode == '-9999') {
top.winui.window.msg("操作失败", {icon: 2,time: 2000});
}
}});
});
//txtcenter DIV内的输入框内容变化事件
$("body").on("keyup", ".txtcenter input", function(e){
for(var i = 0; i < list.length; i++){
......@@ -204,6 +227,7 @@ layui.config({
ajaxSendLoadBefore: function(hdb){
},
ajaxSendAfter:function(json){
tableColumn = json;
AjaxPostUtil.request({url:reqBasePath + "codemodel012", params:{tableName: $("#tableName").val()}, type:'json', callback:function(json){
if(json.returnCode == 0){
$(".createResult").removeClass("layui-btn-normal");
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/font-awesome-4.7.0/css/font-awesome.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
<link href="../../assets/lib/layui/css/codemirror.css" rel="stylesheet" />
<link href="../../assets/lib/layui/lay/modules/ztree/css/zTreeStyle/zTreeStyle.css" rel="stylesheet" />
<link href="../../assets/lib/layui/lay/modules/contextMenu/jquery.contextMenu.min.css" rel="stylesheet" />
</head>
<body>
<div style="width:600px;margin:0 auto;padding-top:20px;">
<form class="layui-form" action="" id="showForm" autocomplete="off">
<div class="layui-form-item">
<label class="layui-form-label">表参数<i class="red">*</i></label>
<div class="layui-input-block">
<select id="tableColumn" name="tableColumn" class="layui-input" win-verify="required">
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">展现形式<i class="red">*</i></label>
<div class="layui-input-block">
<select id="showModel" name="showModel" class="layui-input" win-verify="required" lay-filter="selectParent">
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">限制条件</label>
<div class="layui-input-block" id="limitRequire">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">HTML模板展示</label>
<div class="layui-input-block">
<textarea id="htmlModelEditor" name="htmlModelEditor"></textarea>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">HTML模板展示</label>
<div class="layui-input-block">
<textarea id="jsModelEditor" name="jsModelEditor"></textarea>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">HTML最终结果</label>
<div class="layui-input-block">
<textarea id="htmlSuccessEditor" name="htmlSuccessEditor"></textarea>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">JS最终结果</label>
<div class="layui-input-block">
<textarea id="jsSuccessEditor" name="jsSuccessEditor"></textarea>
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="winui-btn" id="cancle">取消</button>
<button class="winui-btn" lay-submit lay-filter="formAddBean">保存</button>
</div>
</div>
</form>
</div>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/codemodelgroup/'}).use('addcontenttohtmlorjs');
</script>
</body>
</html>
\ No newline at end of file
......@@ -94,7 +94,7 @@
</div>
<div class="layui-col-xs6 center-content">
<div class="winui-toolbar">
<div class="winui-tool">参数设置</div>
<div class="winui-tool">参数设置(最终保存内容)<button type="button" class="layui-btn layui-btn-xs" style="float: right;" id="addContentToHTMLorJS">添加参数</button></div>
</div>
<div class="layui-row" style="height: 100%">
<textarea id="textContent"></textarea>
......
{{#each rows}}
<input type="checkbox" name="limitrequire" title="{{requireName}}" formermation="{{formerRequirement}}" aftermation="{{afterRequirement}}">
{{/each}}
\ No newline at end of file
<option value="">全部</option>
{{#each rows}}
<option value="{{columnComment}}--{{columnName}}">{{columnComment}}--{{columnName}}</option>
{{/each}}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册