From 436446ade15af8d2aeb591c80e16251257c44b12 Mon Sep 17 00:00:00 2001 From: weizhiqiang <598748873@qq.com> Date: Tue, 13 Nov 2018 10:09:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E5=AE=8C=E6=88=90+=E5=85=B6=E4=BB=96?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E8=A7=84=E6=A0=BC=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/RmPropertyServiceImpl.java | 4 +- .../resources/dbmapper/RmPropertyMapper.xml | 78 ++++++++++--- .../src/main/resources/mapping/reqmapping.xml | 17 +++ .../main/webapp/js/codemodel/codemodeladd.js | 2 +- .../main/webapp/js/codemodel/codemodeledit.js | 2 +- .../main/webapp/js/codemodel/codemodellist.js | 2 +- .../js/codemodelgroup/addcontenttohtmlorjs.js | 8 +- .../webapp/js/codemodelgroup/usemodelgroup.js | 1 + .../js/rmgroupmember/rmgroupmemberlist.js | 2 +- .../webapp/js/rmproperty/rmpropertyadd.js | 94 ++++++++++++++- .../webapp/js/rmproperty/rmpropertyedit.js | 110 +++++++++++++++++- .../webapp/js/rmproperty/rmpropertylist.js | 110 ++++++++++++++++-- .../webapp/tpl/rmproperty/rmpropertyadd.html | 37 +++++- .../webapp/tpl/rmproperty/rmpropertyedit.html | 1 + .../rmproperty/rmpropertyeditTemplate.html | 35 ------ .../tpl/rmproperty/rmpropertyeditTemplate.tpl | 65 +++++++++++ .../webapp/tpl/rmproperty/rmpropertylist.html | 26 ++++- ...5\254\345\205\261\350\257\267\346\261\202" | 14 +++ 18 files changed, 521 insertions(+), 87 deletions(-) delete mode 100644 skyeye-web/src/main/webapp/tpl/rmproperty/rmpropertyeditTemplate.html create mode 100644 skyeye-web/src/main/webapp/tpl/rmproperty/rmpropertyeditTemplate.tpl create mode 100644 "skyeye-web/src/main/webapp/\345\205\254\345\205\261\350\257\267\346\261\202" diff --git a/skyeye-service/src/main/java/com/skyeye/smprogram/service/impl/RmPropertyServiceImpl.java b/skyeye-service/src/main/java/com/skyeye/smprogram/service/impl/RmPropertyServiceImpl.java index a5b359a27..8c7f820b8 100644 --- a/skyeye-service/src/main/java/com/skyeye/smprogram/service/impl/RmPropertyServiceImpl.java +++ b/skyeye-service/src/main/java/com/skyeye/smprogram/service/impl/RmPropertyServiceImpl.java @@ -60,7 +60,7 @@ public class RmPropertyServiceImpl implements RmPropertyService{ map.put("createTime", ToolUtil.getTimeAndToString()); rmPropertyDao.insertRmPropertyMation(map); }else{ - outputObject.setreturnMessage("该小程序样式属性名称已存在,不可进行二次保存"); + outputObject.setreturnMessage("该样式属性名称或者标签已存在,不可进行二次保存"); } } @@ -115,7 +115,7 @@ public class RmPropertyServiceImpl implements RmPropertyService{ if(bean == null){ rmPropertyDao.editRmPropertyMationById(map); }else{ - outputObject.setreturnMessage("该小程序样式属性名称已存在,不可进行二次保存"); + outputObject.setreturnMessage("该样式属性名称或者标签已存在,不可进行二次保存"); } } diff --git a/skyeye-web/src/main/resources/dbmapper/RmPropertyMapper.xml b/skyeye-web/src/main/resources/dbmapper/RmPropertyMapper.xml index 41cba0b70..ca3a3f9eb 100644 --- a/skyeye-web/src/main/resources/dbmapper/RmPropertyMapper.xml +++ b/skyeye-web/src/main/resources/dbmapper/RmPropertyMapper.xml @@ -5,56 +5,106 @@ - INSERT into - (id, create_id, create_time) + INSERT into rm_property + (id, title, property_tag, property_out, ds_form_content_id, html_content, js_content, js_rely_on, create_id, create_time) VALUES - (#{id}, #{createId}, #{createTime}) + (#{id}, #{title}, #{propertyTag}, #{propertyOut}, #{dsFormContentId}, #{htmlContent}, #{jsContent}, #{jsRelyOn}, #{createId}, #{createTime}) DELETE FROM - + rm_property WHERE id = #{id} - UPDATE + UPDATE rm_property - + + title = #{title}, + + + property_tag = #{propertyTag}, + + + property_out = #{propertyOut}, + + + ds_form_content_id = #{dsFormContentId}, + + + html_content = #{htmlContent}, + + js_content = #{jsContent}, + js_rely_on = #{jsRelyOn}, WHERE id = #{id} diff --git a/skyeye-web/src/main/resources/mapping/reqmapping.xml b/skyeye-web/src/main/resources/mapping/reqmapping.xml index f2328c97f..1c22bf621 100644 --- a/skyeye-web/src/main/resources/mapping/reqmapping.xml +++ b/skyeye-web/src/main/resources/mapping/reqmapping.xml @@ -329,8 +329,18 @@ + + + + + + + + + + @@ -340,6 +350,13 @@ + + + + + + + diff --git a/skyeye-web/src/main/webapp/js/codemodel/codemodeladd.js b/skyeye-web/src/main/webapp/js/codemodel/codemodeladd.js index b94765b3d..cf3401561 100644 --- a/skyeye-web/src/main/webapp/js/codemodel/codemodeladd.js +++ b/skyeye-web/src/main/webapp/js/codemodel/codemodeladd.js @@ -30,7 +30,7 @@ layui.config({ var editor = CodeMirror.fromTextArea(document.getElementById("modelContent"), { mode : "text/x-java", // 模式 theme : "eclipse", // CSS样式选择 - indentUnit : 2, // 缩进单位,默认2 + indentUnit : 4, // 缩进单位,默认2 smartIndent : true, // 是否智能缩进 tabSize : 4, // Tab缩进,默认4 readOnly : false, // 是否只读,默认false diff --git a/skyeye-web/src/main/webapp/js/codemodel/codemodeledit.js b/skyeye-web/src/main/webapp/js/codemodel/codemodeledit.js index e3d4e233c..8b6e6a2d4 100644 --- a/skyeye-web/src/main/webapp/js/codemodel/codemodeledit.js +++ b/skyeye-web/src/main/webapp/js/codemodel/codemodeledit.js @@ -41,7 +41,7 @@ layui.config({ editor = CodeMirror.fromTextArea(document.getElementById("modelContent"), { mode : returnModel(json.bean.modelType), // 模式 theme : "eclipse", // CSS样式选择 - indentUnit : 2, // 缩进单位,默认2 + indentUnit : 4, // 缩进单位,默认2 smartIndent : true, // 是否智能缩进 tabSize : 4, // Tab缩进,默认4 readOnly : false, // 是否只读,默认false diff --git a/skyeye-web/src/main/webapp/js/codemodel/codemodellist.js b/skyeye-web/src/main/webapp/js/codemodel/codemodellist.js index 143bc2cd5..db6f14923 100644 --- a/skyeye-web/src/main/webapp/js/codemodel/codemodellist.js +++ b/skyeye-web/src/main/webapp/js/codemodel/codemodellist.js @@ -39,7 +39,7 @@ layui.config({ var editor = CodeMirror.fromTextArea(document.getElementById("modelContent"), { mode : "text/x-java", // 模式 theme : "eclipse", // CSS样式选择 - indentUnit : 2, // 缩进单位,默认2 + indentUnit : 4, // 缩进单位,默认2 smartIndent : true, // 是否智能缩进 tabSize : 4, // Tab缩进,默认4 readOnly : true, // 是否只读,默认false diff --git a/skyeye-web/src/main/webapp/js/codemodelgroup/addcontenttohtmlorjs.js b/skyeye-web/src/main/webapp/js/codemodelgroup/addcontenttohtmlorjs.js index 8cf2224fa..71fc46a5f 100644 --- a/skyeye-web/src/main/webapp/js/codemodelgroup/addcontenttohtmlorjs.js +++ b/skyeye-web/src/main/webapp/js/codemodelgroup/addcontenttohtmlorjs.js @@ -78,7 +78,7 @@ layui.config({ var htmlModelEditor = CodeMirror.fromTextArea(document.getElementById("htmlModelEditor"), { mode : "text/x-java", // 模式 theme : "eclipse", // CSS样式选择 - indentUnit : 2, // 缩进单位,默认2 + indentUnit : 4, // 缩进单位,默认2 smartIndent : true, // 是否智能缩进 tabSize : 4, // Tab缩进,默认4 readOnly : true, // 是否只读,默认false @@ -90,7 +90,7 @@ layui.config({ var jsModelEditor = CodeMirror.fromTextArea(document.getElementById("jsModelEditor"), { mode : "text/x-java", // 模式 theme : "eclipse", // CSS样式选择 - indentUnit : 2, // 缩进单位,默认2 + indentUnit : 4, // 缩进单位,默认2 smartIndent : true, // 是否智能缩进 tabSize : 4, // Tab缩进,默认4 readOnly : true, // 是否只读,默认false @@ -103,7 +103,7 @@ layui.config({ var htmlSuccessEditor = CodeMirror.fromTextArea(document.getElementById("htmlSuccessEditor"), { mode : "text/x-java", // 模式 theme : "eclipse", // CSS样式选择 - indentUnit : 2, // 缩进单位,默认2 + indentUnit : 4, // 缩进单位,默认2 smartIndent : true, // 是否智能缩进 tabSize : 4, // Tab缩进,默认4 readOnly : false, // 是否只读,默认false @@ -116,7 +116,7 @@ layui.config({ var jsSuccessEditor = CodeMirror.fromTextArea(document.getElementById("jsSuccessEditor"), { mode : "text/x-java", // 模式 theme : "eclipse", // CSS样式选择 - indentUnit : 2, // 缩进单位,默认2 + indentUnit : 4, // 缩进单位,默认2 smartIndent : true, // 是否智能缩进 tabSize : 4, // Tab缩进,默认4 readOnly : false, // 是否只读,默认false diff --git a/skyeye-web/src/main/webapp/js/codemodelgroup/usemodelgroup.js b/skyeye-web/src/main/webapp/js/codemodelgroup/usemodelgroup.js index 31cef6cbd..165c9da96 100644 --- a/skyeye-web/src/main/webapp/js/codemodelgroup/usemodelgroup.js +++ b/skyeye-web/src/main/webapp/js/codemodelgroup/usemodelgroup.js @@ -46,6 +46,7 @@ layui.config({ }else{ for(var i = 0; i < subData.length; i++){ 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){ if(json.returnCode == 0){ diff --git a/skyeye-web/src/main/webapp/js/rmgroupmember/rmgroupmemberlist.js b/skyeye-web/src/main/webapp/js/rmgroupmember/rmgroupmemberlist.js index d951965ee..ae98eed39 100644 --- a/skyeye-web/src/main/webapp/js/rmgroupmember/rmgroupmemberlist.js +++ b/skyeye-web/src/main/webapp/js/rmgroupmember/rmgroupmemberlist.js @@ -17,7 +17,7 @@ layui.config({ var editor = CodeMirror.fromTextArea(document.getElementById("modelContent"), { mode : "text/x-java", // 模式 theme : "eclipse", // CSS样式选择 - indentUnit : 2, // 缩进单位,默认2 + indentUnit : 4, // 缩进单位,默认2 smartIndent : true, // 是否智能缩进 tabSize : 4, // Tab缩进,默认4 readOnly : true, // 是否只读,默认false diff --git a/skyeye-web/src/main/webapp/js/rmproperty/rmpropertyadd.js b/skyeye-web/src/main/webapp/js/rmproperty/rmpropertyadd.js index ac469fe12..73dc0f40c 100644 --- a/skyeye-web/src/main/webapp/js/rmproperty/rmpropertyadd.js +++ b/skyeye-web/src/main/webapp/js/rmproperty/rmpropertyadd.js @@ -1,7 +1,8 @@ layui.config({ base: basePath, 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(); layui.use(['form'], function (form) { var index = parent.layer.getFrameIndex(window.name); //获取窗口索引 @@ -10,8 +11,60 @@ layui.config({ form.render(); - var editor = CodeMirror.fromTextArea(document.getElementById("htmlContent"), { - mode : "text/x-java", // 模式 + var 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, + }); + + 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样式选择 + indentUnit : 4, // 缩进单位,默认2 + smartIndent : true, // 是否智能缩进 + tabSize : 4, // Tab缩进,默认4 + readOnly : false, // 是否只读,默认false + showCursorWhenSelecting : true, + lineNumbers : true, // 是否显示行号 + styleActiveLine: true, //line选择是是否加亮 + matchBrackets: true, + }); + + 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, // 是否智能缩进 @@ -23,18 +76,47 @@ layui.config({ 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) { //表单验证 if (winui.verifyForm(data.elem)) { 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){ parent.layer.close(index); parent.refreshCode = '0'; diff --git a/skyeye-web/src/main/webapp/js/rmproperty/rmpropertyedit.js b/skyeye-web/src/main/webapp/js/rmproperty/rmpropertyedit.js index 1b895777a..ebf2be3ca 100644 --- a/skyeye-web/src/main/webapp/js/rmproperty/rmpropertyedit.js +++ b/skyeye-web/src/main/webapp/js/rmproperty/rmpropertyedit.js @@ -1,16 +1,18 @@ layui.config({ base: basePath, version: skyeyeVersion -}).define(['jquery', 'winui'], function (exports) { +}).define(['jquery', 'winui', 'codemirror', 'xml', 'clike', 'css', 'htmlmixed', 'javascript', 'nginx', + 'solr', 'sql', 'vue'], function (exports) { winui.renderColor(); layui.use(['form'], function (form) { var index = parent.layer.getFrameIndex(window.name); //获取窗口索引 var $ = layui.$, form = layui.form; + var htmlModelContent, jsModelContent, htmlContent, jsContent, jsRelyOnContent; showGrid({ id: "showForm", - url: reqBasePath "icon004", + url: reqBasePath + "rmproperty004", params: {rowId: parent.rowId}, pagination: false, template: getFileContent('tpl/rmproperty/rmpropertyeditTemplate.tpl'), @@ -18,20 +20,118 @@ layui.config({ }, 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(); + + //展现形式 + 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) { //表单验证 if (winui.verifyForm(data.elem)) { 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){ parent.layer.close(index); parent.refreshCode = '0'; diff --git a/skyeye-web/src/main/webapp/js/rmproperty/rmpropertylist.js b/skyeye-web/src/main/webapp/js/rmproperty/rmpropertylist.js index f2c8b5870..d8084f79b 100644 --- a/skyeye-web/src/main/webapp/js/rmproperty/rmpropertylist.js +++ b/skyeye-web/src/main/webapp/js/rmproperty/rmpropertylist.js @@ -4,7 +4,8 @@ var rowId = ""; layui.config({ base: basePath, 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(); @@ -16,20 +17,57 @@ layui.config({ id: 'messageTable', elem: '#messageTable', method: 'post', - url: reqBasePath 'rmxcx001', - where:{}, + url: reqBasePath + 'rmproperty001', + where:{title: $("#title").val(), propertyTag: $("#propertyTag").val(), dsFormContentId: $("#dsFormContentId").val()}, even:true, //隔行变色 page: true, limits: [8, 16, 24, 32, 40, 48, 56], limit: 8, cols: [[ { 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 ''; + }else{ + return '无'; + } + }}, + { field: 'id', title: 'JS内容', width: 180, templet: function(d){ + if(!isNull(d.jsContent)){ + return ''; + }else{ + return '无'; + } + }}, + { field: 'id', title: 'JS依赖文件', width: 180, templet: function(d){ + if(!isNull(d.jsRelyOn)){ + return ''; + }else{ + return '无'; + } + }}, { field: 'createTime', title: '创建时间', width: 180 }, { 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="对应的值" var data = obj.data; //获得当前行数据 var layEvent = obj.event; //获得 lay-event 对应的值 @@ -37,6 +75,48 @@ layui.config({ del(data, obj); }else if (layEvent === 'edit') { //编辑 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({ 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){ - var msg = obj ? '确认删除小程序样式属性【' obj.data.rmTypeName '】吗?' : '确认删除选中数据吗?'; - layer.confirm(msg, { icon: 3, title: '删除小程序样式属性' }, function (index) { + var msg = obj ? '确认删除样式属性【' + obj.data.title + '】吗?' : '确认删除选中数据吗?'; + layer.confirm(msg, { icon: 3, title: '删除样式属性' }, function (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){ top.winui.window.msg("删除成功", {icon: 1,time: 2000}); loadTable(); @@ -106,7 +200,7 @@ layui.config({ }); function loadTable(){ - table.reload("messageTable", {where:{}}); + table.reload("messageTable", {where:{title: $("#title").val(), propertyTag: $("#propertyTag").val(), dsFormContentId: $("#dsFormContentId").val()}}); } exports('rmpropertylist', {}); diff --git a/skyeye-web/src/main/webapp/tpl/rmproperty/rmpropertyadd.html b/skyeye-web/src/main/webapp/tpl/rmproperty/rmpropertyadd.html index 5ce8479b9..992a739ab 100644 --- a/skyeye-web/src/main/webapp/tpl/rmproperty/rmpropertyadd.html +++ b/skyeye-web/src/main/webapp/tpl/rmproperty/rmpropertyadd.html @@ -6,42 +6,67 @@ +
- +
- +
- +
- +
+
+
+ +
+ +
+
+
+ +
+ +
- +
+
+
+ +
+ +
+
+
+ +
+ +
diff --git a/skyeye-web/src/main/webapp/tpl/rmproperty/rmpropertyedit.html b/skyeye-web/src/main/webapp/tpl/rmproperty/rmpropertyedit.html index c689003e7..76782f100 100644 --- a/skyeye-web/src/main/webapp/tpl/rmproperty/rmpropertyedit.html +++ b/skyeye-web/src/main/webapp/tpl/rmproperty/rmpropertyedit.html @@ -6,6 +6,7 @@ +
diff --git a/skyeye-web/src/main/webapp/tpl/rmproperty/rmpropertyeditTemplate.html b/skyeye-web/src/main/webapp/tpl/rmproperty/rmpropertyeditTemplate.html deleted file mode 100644 index bcdde8738..000000000 --- a/skyeye-web/src/main/webapp/tpl/rmproperty/rmpropertyeditTemplate.html +++ /dev/null @@ -1,35 +0,0 @@ -{{#bean}} -
- -
- -
-
-
- -
- -
-
-
- -
- - -
-
-
- -
- -
-
-
-
- - -
-
-{{/bean}} \ No newline at end of file diff --git a/skyeye-web/src/main/webapp/tpl/rmproperty/rmpropertyeditTemplate.tpl b/skyeye-web/src/main/webapp/tpl/rmproperty/rmpropertyeditTemplate.tpl new file mode 100644 index 000000000..112d3450d --- /dev/null +++ b/skyeye-web/src/main/webapp/tpl/rmproperty/rmpropertyeditTemplate.tpl @@ -0,0 +1,65 @@ +{{#bean}} +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + +
+
+{{/bean}} \ No newline at end of file diff --git a/skyeye-web/src/main/webapp/tpl/rmproperty/rmpropertylist.html b/skyeye-web/src/main/webapp/tpl/rmproperty/rmpropertylist.html index b3e230c2c..7d77fb1fd 100644 --- a/skyeye-web/src/main/webapp/tpl/rmproperty/rmpropertylist.html +++ b/skyeye-web/src/main/webapp/tpl/rmproperty/rmpropertylist.html @@ -6,13 +6,27 @@ + -
+
- + +
+ +
+ +
+ +
+ +
+ +
@@ -22,12 +36,18 @@
+
- +
+ +
+ +
+