xinyb
2024-07-15 7d060da3d4f9fdcea2466e1646e5b5496814f322
优化控件自定义布局保存功能
2个文件已修改
27 ■■■■ 已修改文件
WebRoot/general/CustomControl/css/main.css 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/com/yc/service/customControl/ControlLayoutImpl.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebRoot/general/CustomControl/css/main.css
@@ -355,7 +355,8 @@
    padding: 5px;
    cursor: pointer;
    font-size: 12px;
    color: #000;
    /*color: #000;*/
    color: red;
}
.vue-grid-item.vue-resizable:hover .icon-guanbi{
    display: block;
@@ -399,7 +400,7 @@
    max-width: 100px;
    min-width: 100px;
    box-sizing: border-box;
    padding: 0 5px;
    padding: 0px 15px 0px 5px;
}
/*.col-th{*/
/*  width: 100px;*/
@@ -412,12 +413,13 @@
.tableDiv .th-icon{
    visibility: hidden;
    background: url(../img/delete.png) no-repeat right center;
    background: url(../img/delete.png) no-repeat right center red;
    background-size: 16px 16px;
    cursor: pointer;
    position: absolute;
    right: 12px;
    top: 12px;
    /*right: 12px;*/
    right: 2px;
    top: 14px;
    width: 16px;
    height: 16px;
}
src/com/yc/service/customControl/ControlLayoutImpl.java
@@ -74,6 +74,7 @@
    @Override
    public List<CustomAttribute> getCustomAttributes(String userCode, Integer formId, Integer formType) {
        try {
            String where = "";
            String sql = "set nocount on;\n" +
                    "declare @table table(userCode varchar(50),formId int,formType int,headFlag int,fieldId varchar(50),controlType int,statisId int,fieldName varchar(200),dataType varchar(50),dataTypeLength int,\n" +
                    "showonGrid int,gridCaption varchar(200),visible int,hideLabel int,rowNo int,colNo int,lengthNum int,heightNum int,masterFieldShowLocation int);\n" +
@@ -99,11 +100,13 @@
                case 3:
                    sql += " and b.headFlag=0 and b.showOnGrid=1  \n" +//and b.statisFlag=1
                            " end\n";
                    where = "b.headFlag=0 and b.showOnGrid=1";
                    break;
                case 2:
                case 16:
                    sql += " and b.headFlag=0 and b.visible=1  \n" +//and b.statisFlag=1
                            " end\n";
                    where = "b.headFlag=0 and b.visible=1";
                    break;
                case 7:
                case 18:
@@ -111,13 +114,25 @@
                    //7,18,19主从表相反
                    sql += "  and ((b.visible=1 and b.headFlag=1) or (b.showOnGrid=1 and b.headFlag=0)) \n" +
                            " end \n";
                    where = "((b.visible=1 and b.headFlag=1) or (b.showOnGrid=1 and b.headFlag=0))";
                    break;
                default:
                    //主从表都需要加载的情况,5,8,496,....
                    sql += "  and ((b.visible=1 and b.headFlag=0) or (b.showOnGrid=1 and b.headFlag=1)) \n" +
                            " end \n";
                    where = "((b.visible=1 and b.headFlag=0) or (b.showOnGrid=1 and b.headFlag=1))";
                    break;
            }
            sql += "\n else  --自定义表有数据时候,需要检查下系统设置表(9802)是否有新设置字段\n" +
                    " begin\n" +
                    " insert into @table(userCode,formId,formType,headFlag,fieldId,controlType,statisId,fieldName,dataType,dataTypeLength,\n" +
                    "showonGrid,gridCaption,visible,hideLabel,rowNo,colNo,lengthNum,heightNum,masterFieldShowLocation) \n" +
                    "select '" + userCode + "',b.formid," + formType + ",b.HeadFlag,b.FieldId,b.controlType,b.StatisId,b.FieldName,b.DataType,b.DataTypeLength,b.ShowOnGrid,b.GridCaption,b.Visible,b.HideLabel,\n" +
                    " b.RowNo,b.ColNo,b.LengthNum,b.HeightNum,b.MasterFieldShowLocation from gField b " +
                    "where b.formid="+formId+" and "+where+" and b.fieldid not in(select fieldId from @table)\n" +
                    "  -- 如果系统设置表(9802)把显示出来的字段设置成不显示,那这里就删除临时表里对应字段信息 \n"+
                    " delete a from @table a where a.formType="+formType+" and a.fieldId not in (select b.fieldId from gField b where b.formid="+formId+" and "+where+")\n" +
                    " end \n";
            sql += "select a.userCode,a.formId,a.formType,a.headFlag,LOWER(a.fieldId) as fieldId,a.controlType,a.statisId,isnull(a.fieldName,a.fieldId) as fieldName," +
                    "a.dataType,a.dataTypeLength,a.showonGrid,a.gridCaption,(case when (a.rowNo > 0 and a.colNo > 0 and a.visible = 1) then 1 else 0 end) as visible,a.hideLabel,a.rowNo," +
                    " a.colNo,a.lengthNum,a.heightNum,isnull(a.masterFieldShowLocation,0) as masterFieldShowLocation" +