From bae2d2d8f854b331b3d54ca672b062736439d948 Mon Sep 17 00:00:00 2001 From: bhq@iemsoft.cn <bhq@iemsoft.cn> Date: Wed, 07 Nov 2018 09:41:37 +0800 Subject: [PATCH] 更新测试环境js --- formEngine/src/app/resources/js/customAll/customS.js | 104 ++++++++++++++++++++++++++++++++++++--------------- 1 files changed, 73 insertions(+), 31 deletions(-) diff --git a/formEngine/src/app/resources/js/customAll/customS.js b/formEngine/src/app/resources/js/customAll/customS.js index c98830b..3cffdbf 100644 --- a/formEngine/src/app/resources/js/customAll/customS.js +++ b/formEngine/src/app/resources/js/customAll/customS.js @@ -4612,20 +4612,20 @@ var item = customShow.options.customItemShow.item[customItem.id]; //数据清空 - if (type == 'dropdownlist') { - $($('.customViewUEditorCss #' + customItem.id)[0]).empty(); - $($($('.customViewUEditorCss #' + customItem.id)[0]).parentNode).find(".select2").remove(); - var visibleTemp = customShow.options.customItemShow.item[customItem.id].tag_Attribute.visible; - if (!visibleTemp) { - $($($('.customViewUEditorCss #' + customItem.id)[0]).parentNode).remove(); - return; - } else { - $('.customViewUEditorCss #' + customItem.id).select2({ theme: "classic", width: '240' }); - } - } else if (type == 'radio' || type == 'checkbox') { - // var item = $('.customViewUEditorCss #'+customItem.id +" .line"); - $($($('.customViewUEditorCss #' + customItem.id + " .line"))[0]).empty(); - } + // if (type == 'dropdownlist') { + // $($('.customViewUEditorCss #' + customItem.id)[1]).empty(); + // $($($('.customViewUEditorCss #' + customItem.id)[1]).parentNode).find(".select2").remove(); + // var visibleTemp = customShow.options.customItemShow.item[customItem.id].tag_Attribute.visible; + // // if (!visibleTemp) { + // // $($($('.customViewUEditorCss #' + customItem.id)[0]).parentNode).remove(); + // // return; + // // } else { + // $('.customViewUEditorCss #' + customItem.id).select2({ theme: "classic", width: '240' }); + // // } + // } else if (type == 'radio' || type == 'checkbox') { + // // var item = $('.customViewUEditorCss #'+customItem.id +" .line"); + // $($($('.customViewUEditorCss #' + customItem.id + " .line"))[0]).empty(); + // } var datasourcetype = item.tag_Attribute.datasourcetype; @@ -5090,6 +5090,14 @@ } }); } + var heightShow = customShow.options.customItemShow.item[itemId].tag_Attribute.height; + var widthShow = customShow.options.customItemShow.item[itemId].tag_Attribute.width; + if (widthShow == undefined || heightShow == undefined||widthShow==0) { + $(".customViewUEditorCss #" + itemId).css('width',"100%"); + }else{ + $(".customViewUEditorCss #" + itemId).css('width',widthShow+"px"); + $(".customViewUEditorCss #" + itemId).css('height',heightShow+"px"); + } } else if (customItems[item].type == 'dropdownlist' || customItems[item].type == 'radio' || customItems[item].type == 'checkbox' || customItems[item].type == 'tree') { if ('customShow' != showClass) { @@ -5129,7 +5137,8 @@ linkurl = 'javascript:void(0)'; } if (customShow.costType[customItems[item].id].tag_Attribute.editable) {//不可编辑控制 - $('#' + customItems[item].id).attr('href', linkurl) + $('#' + customItems[item].id).attr('href', linkurl); + $('.customShow .'+customItems[item].id+'value').attr('href', linkurl); } } } @@ -6094,7 +6103,9 @@ }) _.each(unvisibleArr, function (opt) { - // $("[id='" + opt.id + "']").parent().parent().addClass("cfg_contentNone"); + if(customShow.options.customInit.designMode != 1){ + $("[id='" + opt.id + "']").parent().parent().addClass("cfg_contentNone"); + } $(".customViewUEditorCss [id='" + opt.id + "']").parent().addClass("cfg_contentNone"); $($(".customShow #itemId_" + opt.parentsubFormNum + " .tdTitleClass")[$("[id='" + opt.id + "']").parent().parent().index()]).addClass("cfg_contentNone"); $($(".customViewUEditorCss #itemId_" + opt.parentsubFormNum + " .tdTitleClass")[$("[id='" + opt.id + "']").parent().parent().index()]).addClass("cfg_contentNone"); @@ -6567,15 +6578,31 @@ widthShow = 200; heightShow = 200; } - var oNode = '<div style="word-break:break-all;width:' + widthShow + 'px;height:' + - heightShow + 'px;" class="customShowItemClass edui-default customShowItemClassTemp">'; - // var oNode ='<div style="word-break:break-all;border-width: 1px;border-style: solid;border-color: rgb(204, 204, 204);class="customShowItemClass edui-default">'; - oNode += value; - oNode += "</div>"; + if(customShow.options.customInit.designMode == 1){ + var oNode = '<span style="word-break:break-all;width:' + widthShow + 'px;height:' + + heightShow + 'px;" class="customShowItemClass edui-default customShowItemClassTemp">'; + oNode += value; + oNode += "</span>"; + }else{ + var oNode = '<div style="word-break:break-all;width:' + widthShow + 'px;height:' + + heightShow + 'px;" class="customShowItemClass edui-default customShowItemClassTemp">'; + oNode += value; + oNode += "</div>"; + } $($(".customShow #" + id + "Item")[0]).after(oNode); $($(".customShow #" + id + "Item")[0]).remove(); //标签数据设定 - } else if (customItems[item].type == 'textarea') { + }else if(customItems[item].type == 'text'){ + if(customShow.options.customInit.designMode == 1){ + var position = $(".customShow #" + id).parent().attr('align'); + } + $(".customShow ." + id + "value").css('text-align',position); + }else if(customItems[item].type == "calendar"){ + if(customShow.options.customInit.designMode == 1){ + var position = $(".customShow #" + id).parent().attr('align'); + } + $(".customShow ." + id + "value").css('text-align',position); + }else if (customItems[item].type == 'textarea') { var htmlediterShow = $(".customShow #" + id)[0]; var heightShow = customShow.options.customItemShow.item[id].tag_Attribute.height; var widthShow = customShow.options.customItemShow.item[id].tag_Attribute.width; @@ -6583,15 +6610,25 @@ widthShow = 300; heightShow = 80; } - var oNode = '<div style="word-break:break-all;border-width: 0px;border-style: solid;border-color: rgb(204, 204, 204);width:' + widthShow + 'px;height:' + + if(customShow.options.customInit.designMode == 1){ + var oNode = '<span style="word-break:break-all;border-width: 0px;border-style: solid;border-color: rgb(204, 204, 204);width:' + widthShow + 'px;height:' + + heightShow + 'px;" class="customShowItemClass edui-default customShowItemClassTemp">'; + oNode += value; + oNode += "</span>"; + }else{ + var oNode = '<div style="word-break:break-all;border-width: 0px;border-style: solid;border-color: rgb(204, 204, 204);width:' + widthShow + 'px;height:' + heightShow + 'px;" class="customShowItemClass edui-default customShowItemClassTemp">'; - // var oNode ='<div style="word-break:break-all;border-width: 1px;border-style: solid;border-color: rgb(204, 204, 204);class="customShowItemClass edui-default">'; - oNode += value; - oNode += "</div>"; + oNode += value; + oNode += "</div>"; + } $($(".customShow #" + id)[0]).after(oNode); $($(".customShow #" + id)[0]).remove(); //标签数据设定 } else if (customItems[item].type == 'number') { + if(customShow.options.customInit.designMode == 1){ + var position = $(".customShow #" + id).parent().attr('align'); + } + $(".customShow ." + id + "value").css('text-align',position); var numberShowItems = $(".customShow #" + id); for (var i = 0; i < numberShowItems.length; i++) { numberShowItems[i].setAttribute("type", "text"); @@ -6622,9 +6659,13 @@ } else if (customItems[item].type == 'tree') { //普通模式树形回显 - var oNode = '<div treeitemid=' + id + ' style="word-break:break-all;border-width: 0px;border-style: solid;border-color: rgb(204, 204, 204);width:200px;" class="customShowItemClass edui-default customShowItemClassTemp">'; - - "</div>"; + if(customShow.options.customInit.designMode == 1){ + var oNode = '<span treeitemid=' + id + ' style="word-break:break-all;border-width: 0px;border-style: solid;border-color: rgb(204, 204, 204);width:200px;" class="customShowItemClass edui-default customShowItemClassTemp">'; + "</span>"; + }else{ + var oNode = '<div treeitemid=' + id + ' style="word-break:break-all;border-width: 0px;border-style: solid;border-color: rgb(204, 204, 204);width:200px;" class="customShowItemClass edui-default customShowItemClassTemp">'; + "</div>"; + } $($(".customShow").find("#" + id)[0]).after(oNode); $($(".customShow").find("#" + id)[0]).remove(); // customShow.setShowItem(id, type, value, true); @@ -8545,7 +8586,7 @@ } //公式联动追加 if (results[i].doEvent != undefined && results[i].resultJsText.indexOf("setValue") != -1) { - var itemLength = $("." + results[i].targetid + "value").length-1; + var itemLength = $(".customViewUEditorCss" + results[i].targetid + "value").length-1; strFunction += '$(".' + results[i].targetid + 'value").eq('+itemLength+').trigger("' + results[i].doEvent + '.value");'; } //公式联动追加结束 @@ -9879,6 +9920,7 @@ //解决主数据重复 var options_xh = _.cloneDeep(xhSelect.options); options_xh.listData = []; + var xhSelectHeight = customShow.options.customItemShow.item[options.selectId].tag_Attribute.height; //解决主数据重复END options = $.extend(true, options_xh, options); var optionArr = ""; @@ -9901,7 +9943,7 @@ '</div>' + '<div class="selectItme" style="display:none;" value=""></div>' + '<div class="select3-element" style="width:100%;max-width: ' + options.width + 'px">' + - ' <div class="select-container select-container_box" gccolname="ex_c11"> ' + + ' <div style = "height:'+xhSelectHeight+'px;" class="select-container select-container_box" gccolname="ex_c11"> ' + ' <div class="suffix">' + ' <i class="fa fa-angle-down" aria-hidden="true"></i>' + ' </div>' + -- Gitblit v1.8.0