增加文字长度自动设置/栏目增加校验
This commit is contained in:
parent
acecdd5b06
commit
3618bfe8a0
@ -539,9 +539,9 @@ public class PicturesTemplateServiceImpl extends DefaultBaseService implements I
|
|||||||
*/
|
*/
|
||||||
PicturesTemplateDTO dto = picturesTemplateDao.getPicturesTemplateByCode(picturesTemplateCode);
|
PicturesTemplateDTO dto = picturesTemplateDao.getPicturesTemplateByCode(picturesTemplateCode);
|
||||||
// 因为使用快照的原因, 旧的预览图片不能删除 2021年8月14日19:32:57
|
// 因为使用快照的原因, 旧的预览图片不能删除 2021年8月14日19:32:57
|
||||||
/*if(!StringUtils.isEmpty(dto.getPicturesTemplatePictureUrl())) {
|
if(!StringUtils.isEmpty(dto.getPicturesTemplatePictureUrl())) {
|
||||||
iFileService.delete(dto.getPicturesTemplatePictureUrl());
|
iFileService.delete(dto.getPicturesTemplatePictureUrl());
|
||||||
}*/
|
}
|
||||||
String picturesTemplatePictureUrl = iPicturesTemplateBuildingService.saveBase64ToFile(base64);
|
String picturesTemplatePictureUrl = iPicturesTemplateBuildingService.saveBase64ToFile(base64);
|
||||||
Map<String, Object> map = new HashMap<String, Object>();
|
Map<String, Object> map = new HashMap<String, Object>();
|
||||||
map.put("picturesTemplatePicture", base64);
|
map.put("picturesTemplatePicture", base64);
|
||||||
|
@ -203,7 +203,7 @@ public class PicturesTemplateBuildingServiceImpl extends DefaultBaseService impl
|
|||||||
int y = bean.getY() + fontHeight + 3;
|
int y = bean.getY() + fontHeight + 3;
|
||||||
// 超出部分, 不显示
|
// 超出部分, 不显示
|
||||||
int gao = (bean.getY() + bean.getHeight()) - (bean.getFontSize() + 3 );
|
int gao = (bean.getY() + bean.getHeight()) - (bean.getFontSize() + 3 );
|
||||||
if(y > gao) {
|
if(y > gao && rowList.size() > 1) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
graphics.drawString(fontContent, bean.getX(), y);
|
graphics.drawString(fontContent, bean.getX(), y);
|
||||||
@ -367,7 +367,7 @@ public class PicturesTemplateBuildingServiceImpl extends DefaultBaseService impl
|
|||||||
int y = bean.getY() + fontHeight + 3;
|
int y = bean.getY() + fontHeight + 3;
|
||||||
// 超出部分, 不显示
|
// 超出部分, 不显示
|
||||||
int gao = (bean.getY() + bean.getHeight()) - (bean.getFontSize() + 3 );
|
int gao = (bean.getY() + bean.getHeight()) - (bean.getFontSize() + 3 );
|
||||||
if(y > gao) {
|
if(y > gao && rowList.size() > 1) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
graphics.drawString(fontContent, bean.getX(), y);
|
graphics.drawString(fontContent, bean.getX(), y);
|
||||||
@ -559,8 +559,9 @@ public class PicturesTemplateBuildingServiceImpl extends DefaultBaseService impl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(countLength > areaDto.getTemplateAreaFontLength()) {
|
if(countLength > areaDto.getTemplateAreaFontLength()) {
|
||||||
throw new SaveException(areaDto.getPicturesTemplateTitle() + "超出长度");
|
throw new SaveException(areaDto.getTemplateAreaName() + "超出长度");
|
||||||
}
|
}
|
||||||
|
createImageBean.setFontLength(areaDto.getTemplateAreaFontLength());
|
||||||
}
|
}
|
||||||
createImageBean.setFontBold(Integer.valueOf(areaDto.getTemplateAreaFontBold()));
|
createImageBean.setFontBold(Integer.valueOf(areaDto.getTemplateAreaFontBold()));
|
||||||
createImageBean.setFontFamily(areaDto.getTemplateAreaFontFamily());
|
createImageBean.setFontFamily(areaDto.getTemplateAreaFontFamily());
|
||||||
@ -640,8 +641,9 @@ public class PicturesTemplateBuildingServiceImpl extends DefaultBaseService impl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(countLength > areaDto.getTemplateAreaFontLength()) {
|
if(countLength > areaDto.getTemplateAreaFontLength()) {
|
||||||
throw new SaveException(areaDto.getPicturesTemplateTitle() + "超出长度");
|
throw new SaveException(areaDto.getTemplateAreaName() + "超出长度");
|
||||||
}
|
}
|
||||||
|
createImageBean.setFontLength(areaDto.getTemplateAreaFontLength());
|
||||||
}
|
}
|
||||||
createImageBean.setFontBold(Integer.valueOf(areaDto.getTemplateAreaFontBold()));
|
createImageBean.setFontBold(Integer.valueOf(areaDto.getTemplateAreaFontBold()));
|
||||||
createImageBean.setFontFamily(areaDto.getTemplateAreaFontFamily());
|
createImageBean.setFontFamily(areaDto.getTemplateAreaFontFamily());
|
||||||
|
@ -176,6 +176,9 @@
|
|||||||
if(!noChange) {
|
if(!noChange) {
|
||||||
var formData = {templateAreaLeft : x , templateAreaTop : y , templateAreaHeight : h , templateAreaWidth : w };
|
var formData = {templateAreaLeft : x , templateAreaTop : y , templateAreaHeight : h , templateAreaWidth : w };
|
||||||
top.restAjax.put(top.restAjax.path('api/picturestemplatearea/updatepicturestemplateareapoint/{picturesTemplateAreaId}', [id]), formData, null, function(code, data) {
|
top.restAjax.put(top.restAjax.path('api/picturestemplatearea/updatepicturestemplateareapoint/{picturesTemplateAreaId}', [id]), formData, null, function(code, data) {
|
||||||
|
if(data.data) {
|
||||||
|
top.dialog.msg(data.data, {time: 2000});
|
||||||
|
}
|
||||||
}, function(code, data) {
|
}, function(code, data) {
|
||||||
}, function() {
|
}, function() {
|
||||||
}, function() {
|
}, function() {
|
||||||
@ -375,6 +378,8 @@
|
|||||||
}
|
}
|
||||||
});*/
|
});*/
|
||||||
|
|
||||||
|
var currentFormData = new Map();
|
||||||
|
|
||||||
//修改区域点的x,y,width,height
|
//修改区域点的x,y,width,height
|
||||||
$(document).on('mouseup', '#canvas', function(e){
|
$(document).on('mouseup', '#canvas', function(e){
|
||||||
if(lock == true){
|
if(lock == true){
|
||||||
@ -395,7 +400,15 @@
|
|||||||
x = $('#'+id).css("left");
|
x = $('#'+id).css("left");
|
||||||
y = $('#'+id).css("top");
|
y = $('#'+id).css("top");
|
||||||
console.log("x坐标:"+x.replace("px","")+"y坐标:"+y.replace("px","")+"宽度:"+w+"高度:"+h+"id:"+id);
|
console.log("x坐标:"+x.replace("px","")+"y坐标:"+y.replace("px","")+"宽度:"+w+"高度:"+h+"id:"+id);
|
||||||
var formData = {templateAreaLeft : x.replace("px","") , templateAreaTop : y.replace("px","") , templateAreaHeight : h , templateAreaWidth : w };
|
var formData = {templateAreaLeft : x.replace("px","") , templateAreaTop : y.replace("px","") , templateAreaHeight : h , templateAreaWidth : w , id : id};
|
||||||
|
var oldData = currentFormData.get(id);
|
||||||
|
if(oldData) {
|
||||||
|
if (oldData.templateAreaLeft == formData.templateAreaLeft && oldData.templateAreaTop == formData.templateAreaTop && oldData.templateAreaHeight == formData.templateAreaHeight && oldData.templateAreaWidth == formData.templateAreaWidth) {
|
||||||
|
console.log("位置没有变化, 不进行重复请求");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
currentFormData.set(id, formData);
|
||||||
var loadLayerIndex;
|
var loadLayerIndex;
|
||||||
top.restAjax.put(top.restAjax.path('api/picturestemplatearea/updatepicturestemplateareapoint/{picturesTemplateAreaId}', [id]), formData, null, function(code, data) {
|
top.restAjax.put(top.restAjax.path('api/picturestemplatearea/updatepicturestemplateareapoint/{picturesTemplateAreaId}', [id]), formData, null, function(code, data) {
|
||||||
if(data.data) {
|
if(data.data) {
|
||||||
|
Loading…
Reference in New Issue
Block a user