- {{# } else if(typeof(mData) == 'boolean') { }}
-
+ {{# } else if(typeof(mData) == 'boolean') { }}
+
+
+
+
- {{# } else if(typeof(mData) == 'number') { }}
-
+ {{# } else if(typeof(mData) == 'number') { }}
+
+ {{# } else if(typeof(mData) == 'object') { }}
+ {{# for(let key in mData) { }}
+ {{# if(typeof(mData[key]) == 'string' && !mData[key].match(RegExp(/\"/g))) { }}
+
+ {{# } else if(typeof(mData[key]) == 'number') { }}
+
+ {{# } else if(typeof(mData[key]) == 'boolean') { }}
+
+ {{# } else { }}
+
+ {{# } }}
+ {{# } }}
+ {{# } else { }}
+
+ {{# } }}
{{# } }}
@@ -380,16 +406,16 @@
var loadIndex = top.layer.load(1,{shade:0.5});
querySql = Encrypt(querySql);
top.restAjax.get(top.restAjax.path('app/bigdatatemplate/querysqlrelease?querySql={querySql}', [querySql]), {}, null, function(code, data) {
- if(code == 200 && data) {
- if(data.state == 200) {
- top.dialog.msg("语句校验通过");
- }else{
- top.dialog.msg("语句校验未通过");
- }
- }else{
- top.dialog.msg("语句校验不通过");
- }
- top.layer.close(loadIndex);
+ if(code == 200 && data) {
+ if(data.state == 200) {
+ top.dialog.msg("语句校验通过");
+ }else{
+ top.dialog.msg("语句校验未通过");
+ }
+ }else{
+ top.dialog.msg("语句校验不通过");
+ }
+ top.layer.close(loadIndex);
}, function(code, data) {
top.dialog.msg(data.msg);
top.layer.close(loadIndex);
@@ -402,7 +428,8 @@
var loadLayerIndex;
top.restAjax.get(top.restAjax.path('api/bigdatatemplatearea/getbigdatatemplateareabyid/{bigdataTemplateAreaId}', [bigdataTemplateAreaId]), {}, null, function(code, data) {
areaData = data;
- templateAreaModuleData = eval("("+ data.templateAreaModuleData+")");
+ templateAreaModuleData = eval("("+ data.templateAreaModuleData +")");
+ console.log(templateAreaModuleData)
laytpl(document.getElementById('templateAreaModuleDataScript').innerHTML).render(templateAreaModuleData, function(html) {
document.getElementById('templateAreaModuleDataDiv').innerHTML = html;
form.render();
@@ -453,17 +480,17 @@
}
// 对象
if(keySplit.length == 3) {
- var obj = moduleMap.get(index);
- if(obj) {
- if(fieldData[key] == "true" || fieldData[key] == "false") {
- obj[keySplit[2]] = fieldData[key].indexOf("true") != -1 ? true : false;
- } else if(/^\d+(?=\.{0,1}\d+$|$)/ .test(fieldData[key])){
- obj[keySplit[2]] = Number(fieldData[key]);
- } else {
- obj[keySplit[2]] = fieldData[key];
- }
- }else {
- obj = {};
+ var obj = moduleMap.get(index);
+ if(obj) {
+ if(fieldData[key] == "true" || fieldData[key] == "false") {
+ obj[keySplit[2]] = fieldData[key].indexOf("true") != -1 ? true : false;
+ } else if(/^\d+(?=\.{0,1}\d+$|$)/ .test(fieldData[key])){
+ obj[keySplit[2]] = Number(fieldData[key]);
+ } else {
+ obj[keySplit[2]] = fieldData[key];
+ }
+ }else {
+ obj = {};
var ke = keySplit[2];
if(fieldData[key] == "true" || fieldData[key] == "false") {
obj[ke] = fieldData[key].indexOf("true") != -1 ? true : false;
@@ -472,7 +499,7 @@
} else {
obj[ke] = fieldData[key];
}
- }
+ }
moduleMap.set(index, obj);
}
}
@@ -488,7 +515,16 @@
dataList.push(data);
}
templateAreaModuleJsonData.list = dataList;
- var newtTemplateAreaModuleData = JSON.stringify(templateAreaModuleJsonData).replace(/\"/g,"'");
+ var newtTemplateAreaModuleData = JSON.stringify(templateAreaModuleJsonData)
+ if(newtTemplateAreaModuleData.indexOf("\'") > 1) {
+ layer.msg("不允许使用单引号");
+ return;
+ }
+ console.log(newtTemplateAreaModuleData);
+ newtTemplateAreaModuleData = newtTemplateAreaModuleData.replace(/\"/g,"'");
+ console.log(newtTemplateAreaModuleData);
+ newtTemplateAreaModuleData = newtTemplateAreaModuleData.replace(/\\'/g,"\"");
+ console.log(newtTemplateAreaModuleData);
top.restAjax.put(top.restAjax.path('api/bigdatatemplatearea/updatebigdatatemplateareapointmoduledata/{bigdataTemplateAreaId}?templateAreaModuleData={newtTemplateAreaModuleData}', [bigdataTemplateAreaId]), newtTemplateAreaModuleData, null, function(code, data) {
top.dialog.close(index);
// window.location.reload();
diff --git a/pojo-building-pictures/src/main/java/cn/com/tenlion/buildingpictures/pojo/dtos/picturestemplatearea/PicturesTemplateAreaBuildingDTO.java b/pojo-building-pictures/src/main/java/cn/com/tenlion/buildingpictures/pojo/dtos/picturestemplatearea/PicturesTemplateAreaBuildingDTO.java
index 504e4ab..714c4a5 100644
--- a/pojo-building-pictures/src/main/java/cn/com/tenlion/buildingpictures/pojo/dtos/picturestemplatearea/PicturesTemplateAreaBuildingDTO.java
+++ b/pojo-building-pictures/src/main/java/cn/com/tenlion/buildingpictures/pojo/dtos/picturestemplatearea/PicturesTemplateAreaBuildingDTO.java
@@ -43,7 +43,7 @@ public class PicturesTemplateAreaBuildingDTO {
@ApiModelProperty(name = "templateAreaFontColor", value = "文字颜色")
private String templateAreaFontColor;
@ApiModelProperty(name = "templateAreaFontSize", value = "文字大小")
- private String templateAreaFontSize;
+ private Integer templateAreaFontSize;
@ApiModelProperty(name = "templateAreaFontLength", value = "字体长度限制")
private Integer templateAreaFontLength = 0;
@ApiModelProperty(name = "templateAreaFontBold", value = "文字加粗0:正常,1:加粗,2:斜体")
@@ -179,11 +179,11 @@ public class PicturesTemplateAreaBuildingDTO {
this.templateAreaFontColor = templateAreaFontColor;
}
- public String getTemplateAreaFontSize() {
- return templateAreaFontSize == null ? "" : templateAreaFontSize;
+ public Integer getTemplateAreaFontSize() {
+ return templateAreaFontSize == null ? 0 : templateAreaFontSize;
}
- public void setTemplateAreaFontSize(String templateAreaFontSize) {
+ public void setTemplateAreaFontSize(Integer templateAreaFontSize) {
this.templateAreaFontSize = templateAreaFontSize;
}