提交 436446ad 编写于 作者: Skyeye云's avatar Skyeye云

小程序组件标签完成+其他页面规格调整

上级 6ba1e6b7
...@@ -60,7 +60,7 @@ public class RmPropertyServiceImpl implements RmPropertyService{ ...@@ -60,7 +60,7 @@ public class RmPropertyServiceImpl implements RmPropertyService{
map.put("createTime", ToolUtil.getTimeAndToString()); map.put("createTime", ToolUtil.getTimeAndToString());
rmPropertyDao.insertRmPropertyMation(map); rmPropertyDao.insertRmPropertyMation(map);
}else{ }else{
outputObject.setreturnMessage("该小程序样式属性名称已存在,不可进行二次保存"); outputObject.setreturnMessage("该样式属性名称或者标签已存在,不可进行二次保存");
} }
} }
...@@ -115,7 +115,7 @@ public class RmPropertyServiceImpl implements RmPropertyService{ ...@@ -115,7 +115,7 @@ public class RmPropertyServiceImpl implements RmPropertyService{
if(bean == null){ if(bean == null){
rmPropertyDao.editRmPropertyMationById(map); rmPropertyDao.editRmPropertyMationById(map);
}else{ }else{
outputObject.setreturnMessage("该小程序样式属性名称已存在,不可进行二次保存"); outputObject.setreturnMessage("该样式属性名称或者标签已存在,不可进行二次保存");
} }
} }
......
...@@ -5,56 +5,106 @@ ...@@ -5,56 +5,106 @@
<select id="queryRmPropertyList" parameterType="java.util.Map" resultType="java.util.Map"> <select id="queryRmPropertyList" parameterType="java.util.Map" resultType="java.util.Map">
SELECT SELECT
a.id, a.id,
a.title,
a.property_tag propertyTag,
CASE a.property_out WHEN '1' THEN '是' WHEN '2' THEN '否' ELSE '否' END propertyOut,
b.`name` contentName,
a.html_content htmlContent,
a.js_content jsContent,
a.js_rely_on jsRelyOn,
CONVERT(a.create_time, char) createTime CONVERT(a.create_time, char) createTime
FROM FROM
rm_property a
WHERE LEFT JOIN ds_form_content b ON a.ds_form_content_id = b.id
WHERE 1 = 1
<if test="title != '' and title != null">
AND a.title LIKE '%${title}%'
</if>
<if test="propertyTag != '' and propertyTag != null">
AND a.property_tag LIKE '%${propertyTag}%'
</if>
<if test="dsFormContentId != '' and dsFormContentId != null">
AND a.ds_form_content_id = #{dsFormContentId}
</if>
ORDER BY a.create_time DESC ORDER BY a.create_time DESC
</select> </select>
<select id="queryRmPropertyMationByName" parameterType="java.util.Map" resultType="java.util.Map"> <select id="queryRmPropertyMationByName" parameterType="java.util.Map" resultType="java.util.Map">
SELECT SELECT
a.id a.id,
a.title,
a.property_tag propertyTag
FROM FROM
rm_property a
WHERE WHERE
a.title = #{title}
OR a.property_tag = #{propertyTag}
</select> </select>
<insert id="insertRmPropertyMation" parameterType="java.util.Map"> <insert id="insertRmPropertyMation" parameterType="java.util.Map">
INSERT into INSERT into rm_property
(id, create_id, create_time) (id, title, property_tag, property_out, ds_form_content_id, html_content, js_content, js_rely_on, create_id, create_time)
VALUES VALUES
(#{id}, #{createId}, #{createTime}) (#{id}, #{title}, #{propertyTag}, #{propertyOut}, #{dsFormContentId}, #{htmlContent}, #{jsContent}, #{jsRelyOn}, #{createId}, #{createTime})
</insert> </insert>
<delete id="deleteRmPropertyMationById" parameterType="java.util.Map"> <delete id="deleteRmPropertyMationById" parameterType="java.util.Map">
DELETE DELETE
FROM FROM
rm_property
WHERE WHERE
id = #{id} id = #{id}
</delete> </delete>
<select id="queryRmPropertyMationToEditById" parameterType="java.util.Map" resultType="java.util.Map"> <select id="queryRmPropertyMationToEditById" parameterType="java.util.Map" resultType="java.util.Map">
SELECT SELECT
a.id a.id,
a.title,
a.property_tag propertyTag,
a.property_out propertyOut,
a.ds_form_content_id dsFormContentId,
a.html_content htmlContent,
a.js_content jsContent,
a.js_rely_on jsRelyOn,
b.html_content htmlModelContent,
b.js_content jsModelContent
FROM FROM
rm_property a
LEFT JOIN ds_form_content b ON a.ds_form_content_id = b.id
WHERE a.id = #{id} WHERE a.id = #{id}
</select> </select>
<select id="queryRmPropertyMationByNameAndId" parameterType="java.util.Map" resultType="java.util.Map"> <select id="queryRmPropertyMationByNameAndId" parameterType="java.util.Map" resultType="java.util.Map">
SELECT SELECT
a.id a.id,
a.title,
a.property_tag propertyTag
FROM FROM
rm_property a
WHERE a.id != #{id} WHERE a.id != #{id}
AND (a.title = #{title} OR a.property_tag = #{propertyTag})
</select> </select>
<update id="editRmPropertyMationById" parameterType="java.util.Map"> <update id="editRmPropertyMationById" parameterType="java.util.Map">
UPDATE UPDATE rm_property
<set> <set>
<if test="title != '' and title != null">
title = #{title},
</if>
<if test="propertyTag != '' and propertyTag != null">
property_tag = #{propertyTag},
</if>
<if test="propertyOut != '' and propertyOut != null">
property_out = #{propertyOut},
</if>
<if test="dsFormContentId != '' and dsFormContentId != null">
ds_form_content_id = #{dsFormContentId},
</if>
<if test="htmlContent != '' and htmlContent != null">
html_content = #{htmlContent},
</if>
js_content = #{jsContent},
js_rely_on = #{jsRelyOn},
</set> </set>
WHERE id = #{id} WHERE id = #{id}
</update> </update>
......
...@@ -329,8 +329,18 @@ ...@@ -329,8 +329,18 @@
<url id="rmproperty001" path="/post/RmPropertyController/queryRmPropertyList" val="获取小程序样式属性列表" allUse="1"> <url id="rmproperty001" path="/post/RmPropertyController/queryRmPropertyList" val="获取小程序样式属性列表" allUse="1">
<property id="limit" name="limit" ref="required,num" var="分页参数,每页多少条数据" /> <property id="limit" name="limit" ref="required,num" var="分页参数,每页多少条数据" />
<property id="page" name="page" ref="required,num" var="分页参数,第几页"/> <property id="page" name="page" ref="required,num" var="分页参数,第几页"/>
<property id="title" name="title" ref="" var="样式属性别名"/>
<property id="propertyTag" name="propertyTag" ref="" var="样式属性标签"/>
<property id="dsFormContentId" name="dsFormContentId" ref="" var="样式属性展现形式"/>
</url> </url>
<url id="rmproperty002" path="/post/RmPropertyController/insertRmPropertyMation" val="添加小程序样式属性信息" allUse="1"> <url id="rmproperty002" path="/post/RmPropertyController/insertRmPropertyMation" val="添加小程序样式属性信息" allUse="1">
<property id="title" name="title" ref="required" var="样式属性别名"/>
<property id="propertyTag" name="propertyTag" ref="required" var="样式属性标签"/>
<property id="dsFormContentId" name="dsFormContentId" ref="required" var="样式属性展现形式"/>
<property id="propertyOut" name="propertyOut" ref="required,num" var="是否为外部属性 1是 2否"/>
<property id="htmlContent" name="htmlContent" ref="required" var="html内容"/>
<property id="jsContent" name="jsContent" ref="" var="js内容"/>
<property id="jsRelyOn" name="jsRelyOn" ref="" var="js依赖的js包"/>
</url> </url>
<url id="rmproperty003" path="/post/RmPropertyController/deleteRmPropertyMationById" val="删除小程序样式属性信息" allUse="1"> <url id="rmproperty003" path="/post/RmPropertyController/deleteRmPropertyMationById" val="删除小程序样式属性信息" allUse="1">
<property id="rowId" name="id" ref="required" var="小程序样式属性id"/> <property id="rowId" name="id" ref="required" var="小程序样式属性id"/>
...@@ -340,6 +350,13 @@ ...@@ -340,6 +350,13 @@
</url> </url>
<url id="rmproperty005" path="/post/RmPropertyController/editRmPropertyMationById" val="编辑小程序样式属性信息" allUse="1"> <url id="rmproperty005" path="/post/RmPropertyController/editRmPropertyMationById" val="编辑小程序样式属性信息" allUse="1">
<property id="rowId" name="id" ref="required" var="小程序样式属性id"/> <property id="rowId" name="id" ref="required" var="小程序样式属性id"/>
<property id="title" name="title" ref="required" var="样式属性别名"/>
<property id="propertyTag" name="propertyTag" ref="required" var="样式属性标签"/>
<property id="dsFormContentId" name="dsFormContentId" ref="required" var="样式属性展现形式"/>
<property id="propertyOut" name="propertyOut" ref="required,num" var="是否为外部属性 1是 2否"/>
<property id="htmlContent" name="htmlContent" ref="required" var="html内容"/>
<property id="jsContent" name="jsContent" ref="" var="js内容"/>
<property id="jsRelyOn" name="jsRelyOn" ref="" var="js依赖的js包"/>
</url> </url>
<!-- 小程序系列结束 --> <!-- 小程序系列结束 -->
......
...@@ -30,7 +30,7 @@ layui.config({ ...@@ -30,7 +30,7 @@ layui.config({
var editor = CodeMirror.fromTextArea(document.getElementById("modelContent"), { var editor = CodeMirror.fromTextArea(document.getElementById("modelContent"), {
mode : "text/x-java", // 模式 mode : "text/x-java", // 模式
theme : "eclipse", // CSS样式选择 theme : "eclipse", // CSS样式选择
indentUnit : 2, // 缩进单位,默认2 indentUnit : 4, // 缩进单位,默认2
smartIndent : true, // 是否智能缩进 smartIndent : true, // 是否智能缩进
tabSize : 4, // Tab缩进,默认4 tabSize : 4, // Tab缩进,默认4
readOnly : false, // 是否只读,默认false readOnly : false, // 是否只读,默认false
......
...@@ -41,7 +41,7 @@ layui.config({ ...@@ -41,7 +41,7 @@ layui.config({
editor = CodeMirror.fromTextArea(document.getElementById("modelContent"), { editor = CodeMirror.fromTextArea(document.getElementById("modelContent"), {
mode : returnModel(json.bean.modelType), // 模式 mode : returnModel(json.bean.modelType), // 模式
theme : "eclipse", // CSS样式选择 theme : "eclipse", // CSS样式选择
indentUnit : 2, // 缩进单位,默认2 indentUnit : 4, // 缩进单位,默认2
smartIndent : true, // 是否智能缩进 smartIndent : true, // 是否智能缩进
tabSize : 4, // Tab缩进,默认4 tabSize : 4, // Tab缩进,默认4
readOnly : false, // 是否只读,默认false readOnly : false, // 是否只读,默认false
......
...@@ -39,7 +39,7 @@ layui.config({ ...@@ -39,7 +39,7 @@ layui.config({
var editor = CodeMirror.fromTextArea(document.getElementById("modelContent"), { var editor = CodeMirror.fromTextArea(document.getElementById("modelContent"), {
mode : "text/x-java", // 模式 mode : "text/x-java", // 模式
theme : "eclipse", // CSS样式选择 theme : "eclipse", // CSS样式选择
indentUnit : 2, // 缩进单位,默认2 indentUnit : 4, // 缩进单位,默认2
smartIndent : true, // 是否智能缩进 smartIndent : true, // 是否智能缩进
tabSize : 4, // Tab缩进,默认4 tabSize : 4, // Tab缩进,默认4
readOnly : true, // 是否只读,默认false readOnly : true, // 是否只读,默认false
......
...@@ -78,7 +78,7 @@ layui.config({ ...@@ -78,7 +78,7 @@ layui.config({
var htmlModelEditor = CodeMirror.fromTextArea(document.getElementById("htmlModelEditor"), { var htmlModelEditor = CodeMirror.fromTextArea(document.getElementById("htmlModelEditor"), {
mode : "text/x-java", // 模式 mode : "text/x-java", // 模式
theme : "eclipse", // CSS样式选择 theme : "eclipse", // CSS样式选择
indentUnit : 2, // 缩进单位,默认2 indentUnit : 4, // 缩进单位,默认2
smartIndent : true, // 是否智能缩进 smartIndent : true, // 是否智能缩进
tabSize : 4, // Tab缩进,默认4 tabSize : 4, // Tab缩进,默认4
readOnly : true, // 是否只读,默认false readOnly : true, // 是否只读,默认false
...@@ -90,7 +90,7 @@ layui.config({ ...@@ -90,7 +90,7 @@ layui.config({
var jsModelEditor = CodeMirror.fromTextArea(document.getElementById("jsModelEditor"), { var jsModelEditor = CodeMirror.fromTextArea(document.getElementById("jsModelEditor"), {
mode : "text/x-java", // 模式 mode : "text/x-java", // 模式
theme : "eclipse", // CSS样式选择 theme : "eclipse", // CSS样式选择
indentUnit : 2, // 缩进单位,默认2 indentUnit : 4, // 缩进单位,默认2
smartIndent : true, // 是否智能缩进 smartIndent : true, // 是否智能缩进
tabSize : 4, // Tab缩进,默认4 tabSize : 4, // Tab缩进,默认4
readOnly : true, // 是否只读,默认false readOnly : true, // 是否只读,默认false
...@@ -103,7 +103,7 @@ layui.config({ ...@@ -103,7 +103,7 @@ layui.config({
var htmlSuccessEditor = CodeMirror.fromTextArea(document.getElementById("htmlSuccessEditor"), { var htmlSuccessEditor = CodeMirror.fromTextArea(document.getElementById("htmlSuccessEditor"), {
mode : "text/x-java", // 模式 mode : "text/x-java", // 模式
theme : "eclipse", // CSS样式选择 theme : "eclipse", // CSS样式选择
indentUnit : 2, // 缩进单位,默认2 indentUnit : 4, // 缩进单位,默认2
smartIndent : true, // 是否智能缩进 smartIndent : true, // 是否智能缩进
tabSize : 4, // Tab缩进,默认4 tabSize : 4, // Tab缩进,默认4
readOnly : false, // 是否只读,默认false readOnly : false, // 是否只读,默认false
...@@ -116,7 +116,7 @@ layui.config({ ...@@ -116,7 +116,7 @@ layui.config({
var jsSuccessEditor = CodeMirror.fromTextArea(document.getElementById("jsSuccessEditor"), { var jsSuccessEditor = CodeMirror.fromTextArea(document.getElementById("jsSuccessEditor"), {
mode : "text/x-java", // 模式 mode : "text/x-java", // 模式
theme : "eclipse", // CSS样式选择 theme : "eclipse", // CSS样式选择
indentUnit : 2, // 缩进单位,默认2 indentUnit : 4, // 缩进单位,默认2
smartIndent : true, // 是否智能缩进 smartIndent : true, // 是否智能缩进
tabSize : 4, // Tab缩进,默认4 tabSize : 4, // Tab缩进,默认4
readOnly : false, // 是否只读,默认false readOnly : false, // 是否只读,默认false
......
...@@ -46,6 +46,7 @@ layui.config({ ...@@ -46,6 +46,7 @@ layui.config({
}else{ }else{
for(var i = 0; i < subData.length; i++){ for(var i = 0; i < subData.length; i++){
subData[i].modelContent = ""; subData[i].modelContent = "";
subData[i].content = encodeURI(subData[i].content.replace(/\+/g, "%2B").replace(/\&/g, "%26"));
} }
AjaxPostUtil.request({url:reqBasePath + "codemodel014", params:{jsonData: JSON.stringify(subData)}, type:'json', callback:function(json){ AjaxPostUtil.request({url:reqBasePath + "codemodel014", params:{jsonData: JSON.stringify(subData)}, type:'json', callback:function(json){
if(json.returnCode == 0){ if(json.returnCode == 0){
......
...@@ -17,7 +17,7 @@ layui.config({ ...@@ -17,7 +17,7 @@ layui.config({
var editor = CodeMirror.fromTextArea(document.getElementById("modelContent"), { var editor = CodeMirror.fromTextArea(document.getElementById("modelContent"), {
mode : "text/x-java", // 模式 mode : "text/x-java", // 模式
theme : "eclipse", // CSS样式选择 theme : "eclipse", // CSS样式选择
indentUnit : 2, // 缩进单位,默认2 indentUnit : 4, // 缩进单位,默认2
smartIndent : true, // 是否智能缩进 smartIndent : true, // 是否智能缩进
tabSize : 4, // Tab缩进,默认4 tabSize : 4, // Tab缩进,默认4
readOnly : true, // 是否只读,默认false readOnly : true, // 是否只读,默认false
......
layui.config({ layui.config({
base: basePath, base: basePath,
version: skyeyeVersion version: skyeyeVersion
}).define(['jquery', 'winui', 'codemirror', 'xml', 'clike', 'css', 'htmlmixed', 'javascript', 'nginx', 'solr', 'sql', 'vue'], function (exports) { }).define(['jquery', 'winui', 'codemirror', 'xml', 'clike', 'css', 'htmlmixed', 'javascript', 'nginx',
'solr', 'sql', 'vue'], function (exports) {
winui.renderColor(); winui.renderColor();
layui.use(['form'], function (form) { layui.use(['form'], function (form) {
var index = parent.layer.getFrameIndex(window.name); //获取窗口索引 var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
...@@ -10,8 +11,34 @@ layui.config({ ...@@ -10,8 +11,34 @@ layui.config({
form.render(); form.render();
var editor = CodeMirror.fromTextArea(document.getElementById("htmlContent"), { var htmlModelContent = CodeMirror.fromTextArea(document.getElementById("htmlModelContent"), {
mode : "text/x-java", // 模式 mode : "xml", // 模式
theme : "eclipse", // CSS样式选择
indentUnit : 4, // 缩进单位,默认2
smartIndent : true, // 是否智能缩进
tabSize : 4, // Tab缩进,默认4
readOnly : true, // 是否只读,默认false
showCursorWhenSelecting : true,
lineNumbers : true, // 是否显示行号
styleActiveLine: true, //line选择是是否加亮
matchBrackets: true,
});
var jsModelContent = CodeMirror.fromTextArea(document.getElementById("jsModelContent"), {
mode : "text/javascript", // 模式
theme : "eclipse", // CSS样式选择
indentUnit : 4, // 缩进单位,默认2
smartIndent : true, // 是否智能缩进
tabSize : 4, // Tab缩进,默认4
readOnly : true, // 是否只读,默认false
showCursorWhenSelecting : true,
lineNumbers : true, // 是否显示行号
styleActiveLine: true, //line选择是是否加亮
matchBrackets: true,
});
var htmlContent = CodeMirror.fromTextArea(document.getElementById("htmlContent"), {
mode : "xml", // 模式
theme : "eclipse", // CSS样式选择 theme : "eclipse", // CSS样式选择
indentUnit : 4, // 缩进单位,默认2 indentUnit : 4, // 缩进单位,默认2
smartIndent : true, // 是否智能缩进 smartIndent : true, // 是否智能缩进
...@@ -23,18 +50,73 @@ layui.config({ ...@@ -23,18 +50,73 @@ layui.config({
matchBrackets: true, matchBrackets: true,
}); });
form.on('select(selectParent)', function(data){ var jsContent = CodeMirror.fromTextArea(document.getElementById("jsContent"), {
mode : "text/javascript", // 模式
theme : "eclipse", // CSS样式选择
indentUnit : 4, // 缩进单位,默认2
smartIndent : true, // 是否智能缩进
tabSize : 4, // Tab缩进,默认4
readOnly : false, // 是否只读,默认false
showCursorWhenSelecting : true,
lineNumbers : true, // 是否显示行号
styleActiveLine: true, //line选择是是否加亮
matchBrackets: true,
});
var jsRelyOnContent = CodeMirror.fromTextArea(document.getElementById("jsRelyOnContent"), {
mode : "text/javascript", // 模式
theme : "eclipse", // CSS样式选择
indentUnit : 4, // 缩进单位,默认2
smartIndent : true, // 是否智能缩进
tabSize : 4, // Tab缩进,默认4
readOnly : false, // 是否只读,默认false
showCursorWhenSelecting : true,
lineNumbers : true, // 是否显示行号
styleActiveLine: true, //line选择是是否加亮
matchBrackets: true,
});
//展现形式
showGrid({
id: "dsFormContentId",
url: reqBasePath + "dsform006",
params: {},
pagination: false,
template: getFileContent('tpl/template/select-option.tpl'),
ajaxSendLoadBefore: function(hdb){
},
ajaxSendAfter:function(json){
form.render('select');
}
});
form.on('select(selectParent)', function(data){
AjaxPostUtil.request({url:reqBasePath + "dsform007", params:{rowId: data.value}, type:'json', callback:function(json){
if(json.returnCode == 0){
htmlModelContent.setValue(json.bean.htmlContent);
jsModelContent.setValue(json.bean.jsContent);
htmlContent.setValue(json.bean.htmlContent);
jsContent.setValue(json.bean.jsContent);
}else{
top.winui.window.msg(json.returnMessage, {icon: 2,time: 2000});
}
}});
}); });
form.on('submit(formAddBean)', function (data) { form.on('submit(formAddBean)', function (data) {
//表单验证 //表单验证
if (winui.verifyForm(data.elem)) { if (winui.verifyForm(data.elem)) {
var params = { var params = {
title:$("#title").val(),
propertyTag:$("#propertyTag").val(),
dsFormContentId:$("#dsFormContentId").val(),
propertyOut:data.field.propertyOut,
htmlContent:encodeURI(htmlContent.getValue().replace(/\+/g, "%2B").replace(/\&/g, "%26")),
jsContent:encodeURI(jsContent.getValue().replace(/\+/g, "%2B").replace(/\&/g, "%26")),
jsRelyOn:encodeURI(jsRelyOnContent.getValue().replace(/\+/g, "%2B").replace(/\&/g, "%26")),
}; };
AjaxPostUtil.request({url:reqBasePath "icon002", params:params, type:'json', callback:function(json){ AjaxPostUtil.request({url:reqBasePath + "rmproperty002", params:params, type:'json', callback:function(json){
if(json.returnCode == 0){ if(json.returnCode == 0){
parent.layer.close(index); parent.layer.close(index);
parent.refreshCode = '0'; parent.refreshCode = '0';
......
layui.config({ layui.config({
base: basePath, base: basePath,
version: skyeyeVersion version: skyeyeVersion
}).define(['jquery', 'winui'], function (exports) { }).define(['jquery', 'winui', 'codemirror', 'xml', 'clike', 'css', 'htmlmixed', 'javascript', 'nginx',
'solr', 'sql', 'vue'], function (exports) {
winui.renderColor(); winui.renderColor();
layui.use(['form'], function (form) { layui.use(['form'], function (form) {
var index = parent.layer.getFrameIndex(window.name); //获取窗口索引 var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
var $ = layui.$, var $ = layui.$,
form = layui.form; form = layui.form;
var htmlModelContent, jsModelContent, htmlContent, jsContent, jsRelyOnContent;
showGrid({ showGrid({
id: "showForm", id: "showForm",
url: reqBasePath "icon004", url: reqBasePath + "rmproperty004",
params: {rowId: parent.rowId}, params: {rowId: parent.rowId},
pagination: false, pagination: false,
template: getFileContent('tpl/rmproperty/rmpropertyeditTemplate.tpl'), template: getFileContent('tpl/rmproperty/rmpropertyeditTemplate.tpl'),
...@@ -18,20 +20,118 @@ layui.config({ ...@@ -18,20 +20,118 @@ layui.config({
}, },
ajaxSendAfter:function(json){ ajaxSendAfter:function(json){
htmlModelContent = CodeMirror.fromTextArea(document.getElementById("htmlModelContent"), {
mode : "xml", // 模式
theme : "eclipse", // CSS样式选择
indentUnit : 4, // 缩进单位,默认2
smartIndent : true, // 是否智能缩进
tabSize : 4, // Tab缩进,默认4
readOnly : true, // 是否只读,默认false
showCursorWhenSelecting : true,
lineNumbers : true, // 是否显示行号
styleActiveLine: true, //line选择是是否加亮
matchBrackets: true,
});
jsModelContent = CodeMirror.fromTextArea(document.getElementById("jsModelContent"), {
mode : "text/javascript", // 模式
theme : "eclipse", // CSS样式选择
indentUnit : 4, // 缩进单位,默认2
smartIndent : true, // 是否智能缩进
tabSize : 4, // Tab缩进,默认4
readOnly : true, // 是否只读,默认false
showCursorWhenSelecting : true,
lineNumbers : true, // 是否显示行号
styleActiveLine: true, //line选择是是否加亮
matchBrackets: true,
});
htmlContent = CodeMirror.fromTextArea(document.getElementById("htmlContent"), {
mode : "xml", // 模式
theme : "eclipse", // CSS样式选择
indentUnit : 4, // 缩进单位,默认2
smartIndent : true, // 是否智能缩进
tabSize : 4, // Tab缩进,默认4
readOnly : false, // 是否只读,默认false
showCursorWhenSelecting : true,
lineNumbers : true, // 是否显示行号
styleActiveLine: true, //line选择是是否加亮
matchBrackets: true,
});
jsContent = CodeMirror.fromTextArea(document.getElementById("jsContent"), {
mode : "text/javascript", // 模式
theme : "eclipse", // CSS样式选择
indentUnit : 4, // 缩进单位,默认2
smartIndent : true, // 是否智能缩进
tabSize : 4, // Tab缩进,默认4
readOnly : false, // 是否只读,默认false
showCursorWhenSelecting : true,
lineNumbers : true, // 是否显示行号
styleActiveLine: true, //line选择是是否加亮
matchBrackets: true,
});
jsRelyOnContent = CodeMirror.fromTextArea(document.getElementById("jsRelyOnContent"), {
mode : "text/javascript", // 模式
theme : "eclipse", // CSS样式选择
indentUnit : 4, // 缩进单位,默认2
smartIndent : true, // 是否智能缩进
tabSize : 4, // Tab缩进,默认4
readOnly : false, // 是否只读,默认false
showCursorWhenSelecting : true,
lineNumbers : true, // 是否显示行号
styleActiveLine: true, //line选择是是否加亮
matchBrackets: true,
});
$("input:radio[name=propertyOut][value=" + json.bean.propertyOut + "]").prop("checked", true);
form.render(); form.render();
form.on('select(selectParent)', function(data){ //展现形式
showGrid({
id: "dsFormContentId",
url: reqBasePath + "dsform006",
params: {},
pagination: false,
template: getFileContent('tpl/template/select-option.tpl'),
ajaxSendLoadBefore: function(hdb){
},
ajaxSendAfter:function(data){
$("#dsFormContentId").val(json.bean.dsFormContentId);
form.render('select');
}
});
form.on('select(selectParent)', function(data){
AjaxPostUtil.request({url:reqBasePath + "dsform007", params:{rowId: data.value}, type:'json', callback:function(json){
if(json.returnCode == 0){
htmlModelContent.setValue(json.bean.htmlContent);
jsModelContent.setValue(json.bean.jsContent);
htmlContent.setValue(json.bean.htmlContent);
jsContent.setValue(json.bean.jsContent);
}else{
top.winui.window.msg(json.returnMessage, {icon: 2,time: 2000});
}
}});
}); });
form.on('submit(formEditBean)', function (data) { form.on('submit(formEditBean)', function (data) {
//表单验证 //表单验证
if (winui.verifyForm(data.elem)) { if (winui.verifyForm(data.elem)) {
var params = { var params = {
title:$("#title").val(),
propertyTag:$("#propertyTag").val(),
dsFormContentId:$("#dsFormContentId").val(),
propertyOut:data.field.propertyOut,
htmlContent:encodeURI(htmlContent.getValue().replace(/\+/g, "%2B").replace(/\&/g, "%26")),
jsContent:encodeURI(jsContent.getValue().replace(/\+/g, "%2B").replace(/\&/g, "%26")),
jsRelyOn:encodeURI(jsRelyOnContent.getValue().replace(/\+/g, "%2B").replace(/\&/g, "%26")),
rowId:parent.rowId
}; };
AjaxPostUtil.request({url:reqBasePath "icon005", params:params, type:'json', callback:function(json){ AjaxPostUtil.request({url:reqBasePath + "rmproperty005", params:params, type:'json', callback:function(json){
if(json.returnCode == 0){ if(json.returnCode == 0){
parent.layer.close(index); parent.layer.close(index);
parent.refreshCode = '0'; parent.refreshCode = '0';
......
...@@ -4,7 +4,8 @@ var rowId = ""; ...@@ -4,7 +4,8 @@ var rowId = "";
layui.config({ layui.config({
base: basePath, base: basePath,
version: skyeyeVersion version: skyeyeVersion
}).define(['table', 'jquery', 'winui', 'form'], function (exports) { }).define(['table', 'jquery', 'winui', 'form', 'codemirror', 'xml', 'clike', 'css', 'htmlmixed', 'javascript', 'nginx',
'solr', 'sql', 'vue'], function (exports) {
winui.renderColor(); winui.renderColor();
...@@ -16,20 +17,57 @@ layui.config({ ...@@ -16,20 +17,57 @@ layui.config({
id: 'messageTable', id: 'messageTable',
elem: '#messageTable', elem: '#messageTable',
method: 'post', method: 'post',
url: reqBasePath 'rmxcx001', url: reqBasePath + 'rmproperty001',
where:{}, where:{title: $("#title").val(), propertyTag: $("#propertyTag").val(), dsFormContentId: $("#dsFormContentId").val()},
even:true, //隔行变色 even:true, //隔行变色
page: true, page: true,
limits: [8, 16, 24, 32, 40, 48, 56], limits: [8, 16, 24, 32, 40, 48, 56],
limit: 8, limit: 8,
cols: [[ cols: [[
{ title: '序号', type: 'numbers'}, { title: '序号', type: 'numbers'},
{ field: 'title', title: '属性别名', width: 180 },
{ field: 'propertyTag', title: '属性标签', width: 180 },
{ field: 'propertyOut', title: '外部属性', width: 150 },
{ field: 'contentName', title: '展现形式', width: 180 },
{ field: 'id', title: 'HTML内容', width: 180, templet: function(d){
if(!isNull(d.htmlContent)){
return '<i class="fa fa-fw fa-html5 cursor" lay-event="htmlContent"></i>';
}else{
return '';
}
}},
{ field: 'id', title: 'JS内容', width: 180, templet: function(d){
if(!isNull(d.jsContent)){
return '<i class="fa fa-fw fa-html5 cursor" lay-event="jsContent"></i>';
}else{
return '';
}
}},
{ field: 'id', title: 'JS依赖文件', width: 180, templet: function(d){
if(!isNull(d.jsRelyOn)){
return '<i class="fa fa-fw fa-html5 cursor" lay-event="jsRelyOn"></i>';
}else{
return '';
}
}},
{ field: 'createTime', title: '创建时间', width: 180 }, { field: 'createTime', title: '创建时间', width: 180 },
{ title: '操作', fixed: 'right', align: 'center', width: 240, toolbar: '#tableBar'} { title: '操作', fixed: 'right', align: 'center', width: 240, toolbar: '#tableBar'}
]] ]]
}); });
var editor = CodeMirror.fromTextArea(document.getElementById("modelContent"), {
mode : "text/x-java", // 模式
theme : "eclipse", // CSS样式选择
indentUnit : 4, // 缩进单位,默认2
smartIndent : true, // 是否智能缩进
tabSize : 4, // Tab缩进,默认4
readOnly : true, // 是否只读,默认false
showCursorWhenSelecting : true,
lineNumbers : true, // 是否显示行号
styleActiveLine: true, //line选择是是否加亮
matchBrackets: true,
});
table.on('tool(messageTable)', function (obj) { //注:tool是工具条事件名,test是table原始容器的属性 lay-filter="对应的值" table.on('tool(messageTable)', function (obj) { //注:tool是工具条事件名,test是table原始容器的属性 lay-filter="对应的值"
var data = obj.data; //获得当前行数据 var data = obj.data; //获得当前行数据
var layEvent = obj.event; //获得 lay-event 对应的值 var layEvent = obj.event; //获得 lay-event 对应的值
...@@ -37,6 +75,48 @@ layui.config({ ...@@ -37,6 +75,48 @@ layui.config({
del(data, obj); del(data, obj);
}else if (layEvent === 'edit') { //编辑 }else if (layEvent === 'edit') { //编辑
edit(data); edit(data);
}else if (layEvent === 'htmlContent') { //HTML内容
var mode = returnModel('html');
if (!isNull(mode.length)) {
editor.setOption('mode', mode)
}
editor.setValue(data.htmlContent);
layer.open({
id: 'HTML内容',
type: 1,
title: 'HTML内容',
shade: 0.3,
area: ['1200px', '600px'],
content: $("#modelContentDiv").html(),
});
}else if (layEvent === 'jsContent') { //JS内容
var mode = returnModel('javascript');
if (!isNull(mode.length)) {
editor.setOption('mode', mode)
}
editor.setValue(data.jsContent);
layer.open({
id: 'HTML-JS内容',
type: 1,
title: 'HTML-JS内容',
shade: 0.3,
area: ['1200px', '600px'],
content: $("#modelContentDiv").html(),
});
}else if (layEvent === 'jsRelyOn') { //JS依赖文件
var mode = returnModel('javascript');
if (!isNull(mode.length)) {
editor.setOption('mode', mode)
}
editor.setValue(data.jsRelyOn);
layer.open({
id: 'HTML-JS内容',
type: 1,
title: 'HTML-JS内容',
shade: 0.3,
area: ['1200px', '600px'],
content: $("#modelContentDiv").html(),
});
} }
}); });
...@@ -50,13 +130,27 @@ layui.config({ ...@@ -50,13 +130,27 @@ layui.config({
return false; return false;
}); });
//展现形式
showGrid({
id: "dsFormContentId",
url: reqBasePath + "dsform006",
params: {},
pagination: false,
template: getFileContent('tpl/template/select-option.tpl'),
ajaxSendLoadBefore: function(hdb){
},
ajaxSendAfter:function(json){
form.render('select');
}
});
//删除 //删除
function del(data, obj){ function del(data, obj){
var msg = obj ? '确认删除小程序样式属性【' obj.data.rmTypeName '】吗?' : '确认删除选中数据吗?'; var msg = obj ? '确认删除样式属性【' + obj.data.title + '】吗?' : '确认删除选中数据吗?';
layer.confirm(msg, { icon: 3, title: '删除小程序样式属性' }, function (index) { layer.confirm(msg, { icon: 3, title: '删除样式属性' }, function (index) {
layer.close(index); layer.close(index);
//向服务端发送删除指令 //向服务端发送删除指令
AjaxPostUtil.request({url:reqBasePath "rmxcx003", params:{rowId: data.id}, type:'json', callback:function(json){ AjaxPostUtil.request({url:reqBasePath + "rmproperty003", params:{rowId: data.id}, type:'json', callback:function(json){
if(json.returnCode == 0){ if(json.returnCode == 0){
top.winui.window.msg("删除成功", {icon: 1,time: 2000}); top.winui.window.msg("删除成功", {icon: 1,time: 2000});
loadTable(); loadTable();
...@@ -106,7 +200,7 @@ layui.config({ ...@@ -106,7 +200,7 @@ layui.config({
}); });
function loadTable(){ function loadTable(){
table.reload("messageTable", {where:{}}); table.reload("messageTable", {where:{title: $("#title").val(), propertyTag: $("#propertyTag").val(), dsFormContentId: $("#dsFormContentId").val()}});
} }
exports('rmpropertylist', {}); exports('rmpropertylist', {});
......
...@@ -6,42 +6,67 @@ ...@@ -6,42 +6,67 @@
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" /> <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/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/winui/css/winui.css" rel="stylesheet" />
<link href="../../assets/lib/layui/css/codemirror.css" rel="stylesheet" />
</head> </head>
<body> <body>
<div style="width:600px;margin:0 auto;padding-top:20px;"> <div style="width:600px;margin:0 auto;padding-top:20px;">
<form class="layui-form" action="" id="showForm" autocomplete="off"> <form class="layui-form" action="" id="showForm" autocomplete="off">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">样式属性别名</label> <label class="layui-form-label">属性别名<i class="red">*</i></label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" id="title" name="title" win-verify="required" placeholder="请输入属性别名" class="layui-input"/> <input type="text" id="title" name="title" win-verify="required" placeholder="请输入属性别名" class="layui-input"/>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">属性标签</label> <label class="layui-form-label">属性标签<i class="red">*</i></label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" id="propertyTag" name="propertyTag" win-verify="required" placeholder="请输入属性标签" class="layui-input"/> <input type="text" id="propertyTag" name="propertyTag" win-verify="required" placeholder="请输入属性标签" class="layui-input"/>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">是否为外部属性</label> <label class="layui-form-label">外部属性<i class="red">*</i></label>
<div class="layui-input-block winui-radio"> <div class="layui-input-block winui-radio">
<input type="radio" name="propertyOut" value="1" title="是" /> <input type="radio" name="propertyOut" value="1" title="是" />
<input type="radio" name="propertyOut" value="2" title="否" checked /> <input type="radio" name="propertyOut" value="2" title="否" checked />
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">展现形式</label> <label class="layui-form-label">展现形式<i class="red">*</i></label>
<div class="layui-input-block"> <div class="layui-input-block">
<select id="dsFormContentId" name="dsFormContentId" class="layui-input" win-verify="required" lay-filter="selectParent"> <select id="dsFormContentId" name="dsFormContentId" class="layui-input" win-verify="required" lay-filter="selectParent">
<option value=""></option> <option value="">全部</option>
</select> </select>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">html内容</label> <label class="layui-form-label">HTML模板</label>
<div class="layui-input-block">
<textarea id="htmlModelContent"></textarea>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">JS模板</label>
<div class="layui-input-block">
<textarea id="jsModelContent"></textarea>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">HTML内容<i class="red">*</i></label>
<div class="layui-input-block"> <div class="layui-input-block">
<textarea id="htmlContent"></textarea> <textarea id="htmlContent"></textarea>
</div> </div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">JS内容</label>
<div class="layui-input-block">
<textarea id="jsContent"></textarea>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">JS依赖文件</label>
<div class="layui-input-block">
<textarea id="jsRelyOnContent"></textarea>
</div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-input-block"> <div class="layui-input-block">
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" /> <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/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/winui/css/winui.css" rel="stylesheet" />
<link href="../../assets/lib/layui/css/codemirror.css" rel="stylesheet" />
</head> </head>
<body> <body>
<div style="width:600px;margin:0 auto;padding-top:20px;"> <div style="width:600px;margin:0 auto;padding-top:20px;">
......
{{#bean}} {{#bean}}
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">样式属性别名</label> <label class="layui-form-label">属性别名<i class="red">*</i></label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" id="title" name="title" win-verify="required" placeholder="请输入属性别名" class="layui-input" value="{{title}}"/> <input type="text" id="title" name="title" win-verify="required" placeholder="请输入属性别名" class="layui-input" value="{{title}}"/>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">属性标签</label> <label class="layui-form-label">属性标签<i class="red">*</i></label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" id="propertyTag" name="propertyTag" win-verify="required" placeholder="请输入属性标签" class="layui-input" value="{{propertyTag}}"/> <input type="text" id="propertyTag" name="propertyTag" win-verify="required" placeholder="请输入属性标签" class="layui-input" value="{{propertyTag}}"/>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">是否为外部属性</label> <label class="layui-form-label">外部属性<i class="red">*</i></label>
<div class="layui-input-block winui-radio"> <div class="layui-input-block winui-radio">
<input type="radio" name="propertyOut" value="1" title="是" /> <input type="radio" name="propertyOut" value="1" title="是" />
<input type="radio" name="propertyOut" value="2" title="否" checked /> <input type="radio" name="propertyOut" value="2" title="否" />
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">展现形式</label> <label class="layui-form-label">展现形式<i class="red">*</i></label>
<div class="layui-input-block"> <div class="layui-input-block">
<select id="dsFormContentId" name="dsFormContentId" class="layui-input" win-verify="required" lay-filter="selectParent"> <select id="dsFormContentId" name="dsFormContentId" class="layui-input" win-verify="required" lay-filter="selectParent">
<option value=""></option> <option value="">全部</option>
</select> </select>
</div> </div>
</div> </div>
<div class="layui-form-item">
<label class="layui-form-label">HTML模板</label>
<div class="layui-input-block">
<textarea id="htmlModelContent">{{htmlModelContent}}</textarea>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">JS模板</label>
<div class="layui-input-block">
<textarea id="jsModelContent">{{jsModelContent}}</textarea>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">HTML内容<i class="red">*</i></label>
<div class="layui-input-block">
<textarea id="htmlContent">{{htmlContent}}</textarea>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">JS内容</label>
<div class="layui-input-block">
<textarea id="jsContent">{{jsContent}}</textarea>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">JS依赖文件</label>
<div class="layui-input-block">
<textarea id="jsRelyOnContent">{{jsRelyOn}}</textarea>
</div>
</div>
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-input-block"> <div class="layui-input-block">
<button class="winui-btn" id="cancle">取消</button> <button class="winui-btn" id="cancle">取消</button>
......
...@@ -6,13 +6,27 @@ ...@@ -6,13 +6,27 @@
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" /> <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/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/winui/css/winui.css" rel="stylesheet" />
<link href="../../assets/lib/layui/css/codemirror.css" rel="stylesheet" />
</head> </head>
<body> <body>
<div class="txtcenter" style="width:700px;margin:0 auto;padding-top:20px;"> <div class="txtcenter" style="width:100%;margin:0 auto;padding-top:20px;">
<form class="layui-form layui-form-pane" action="" autocomplete="off"> <form class="layui-form layui-form-pane" action="" autocomplete="off">
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-inline"> <div class="layui-inline">
<label class="layui-form-label">展现形式</label>
<div class="layui-input-inline">
<select id="dsFormContentId" name="dsFormContentId" class="layui-input" win-verify="required" lay-filter="selectParent">
<option value="">全部</option>
</select>
</div>
<label class="layui-form-label">属性别名</label>
<div class="layui-input-inline">
<input type="text" id="title" name="title" placeholder="请输入属性别名" class="layui-input" />
</div>
<label class="layui-form-label">属性标签</label>
<div class="layui-input-inline">
<input type="text" id="propertyTag" name="propertyTag" placeholder="请输入属性标签" class="layui-input" />
</div>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
...@@ -22,12 +36,18 @@ ...@@ -22,12 +36,18 @@
</div> </div>
</form> </form>
</div> </div>
<div class="winui-toolbar"> <div class="winui-toolbar">
<div class="winui-tool"> <div class="winui-tool">
<button id="reloadTable" class="winui-toolbtn"><i class="fa fa-refresh" aria-hidden="true"></i>刷新数据</button> <button id="reloadTable" class="winui-toolbtn"><i class="fa fa-refresh" aria-hidden="true"></i>刷新数据</button>
<button id="addBean" class="winui-toolbtn"><i class="fa fa-plus" aria-hidden="true"></i>新增小程序样式属性</button> <button id="addBean" class="winui-toolbtn"><i class="fa fa-plus" aria-hidden="true"></i>新增样式属性</button>
</div>
</div> </div>
<div id="modelContentDiv" style="height:auto; position: fixed; left: 10000px;">
<textarea id="modelContent"></textarea>
</div> </div>
<div style="margin:auto 10px;"> <div style="margin:auto 10px;">
<table id="messageTable" lay-filter="messageTable"></table> <table id="messageTable" lay-filter="messageTable"></table>
<script type="text/html" id="tableBar"> <script type="text/html" id="tableBar">
......
//展现形式 例如:输入框,选择框
showGrid({
id: "showModel",
url: reqBasePath + "dsform006",
params: {},
pagination: false,
template: getFileContent('tpl/template/select-option.tpl'),
ajaxSendLoadBefore: function(hdb){
},
ajaxSendAfter:function(json){
form.render('select');
}
});
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册