Просмотр исходного кода

后管表单输入框格式配置优化

lvy 2 недель назад
Родитель
Сommit
3f8d67adc1

+ 5 - 5
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -792,7 +792,7 @@ public class ExcelTabController extends BladeController {
                         String point = colKey.split("__")[1];
                         if (element == null && point.contains("_")) {
                             String[] split = point.split("_");
-                            element = doc.select("[trindex='" + split[0] + "'],[tdindex='" + split[1] + "']").first();
+                            element = doc.select("[trindex='" + split[0] + "'][tdindex='" + split[1] + "']").first();
                         }
                     }
                 }
@@ -804,11 +804,11 @@ public class ExcelTabController extends BladeController {
                     Element parent = element.parent();
                     while (i > 0 && parent != null) {
                         if (parent.hasAttr("title") || parent.hasAttr("dqid")) {
-                            String dqid = element.attr("dqid");
-                            if (dqid != null && !dqid.isEmpty()) {
-                                element.attr("dqid", dqid + "||" + config.getId());
+                            String dqid = parent.attr("dqid");
+                            if (!dqid.isEmpty()) {
+                                parent.attr("dqid", dqid + "||" + config.getId());
                             } else {
-                                element.attr("dqid", config.getId() + "");
+                                parent.attr("dqid", config.getId() + "");
                             }
                             return true;
                         }

+ 4 - 4
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/TextdictInfoController.java

@@ -433,12 +433,12 @@ public class TextdictInfoController extends BladeController {
                             String value1;
                             if (type == 1) {
                                 // 转数组格式
-                                value1 = String.format(" key_201 = concat(SUBSTRING_INDEX(key_201,'%s:',1), '%s:', if(substr(@v := if(INSTR(SUBSTRING_INDEX(key_201, '%s:',-1),'$$') - 1 < 0, SUBSTRING_INDEX(key_201, '%s:',-1), SUBSTR(SUBSTRING_INDEX(key_201, '%s:',-1), 1 , INSTR(SUBSTRING_INDEX(key_201, '%s:',-1),'$$') - 1)) , 1, 1) = '[', @v, concat('[', @vv := substr(@v,1, if(instr(@v, '_^_') - 1 < 0, char_length(@v), instr(@v, '_^_') - 1), if(instr(@vv,',') > 0, '', concat(',',@vv)) ,']', substr(@v, instr(@v, '_^_'))))  , if (INSTR(SUBSTRING_INDEX(key_201, 'key_16:',-1),'$$') - 1 < 0, '', concat('$$', SUBSTRING_INDEX(SUBSTRING_INDEX(key_201,'key_16:',-1),'$$',-1))) ) ",
-                                        split[0],split[0], split[0], split[0], split[0], split[0]);
+                                value1 = String.format(" key_201 = if(key_201 is null or instr(key_201, '%s') =0, key_201, concat(SUBSTRING_INDEX(key_201,'%s:',1), '%s:', if(substr(@v := if(INSTR(SUBSTRING_INDEX(key_201, '%s:',-1),'$$') - 1 < 0, SUBSTRING_INDEX(key_201, '%s:',-1), SUBSTR(SUBSTRING_INDEX(key_201, '%s:',-1), 1 , INSTR(SUBSTRING_INDEX(key_201, '%s:',-1),'$$') - 1)) , 1, 1) = '[', @v, concat('[', @vv := substr(@v,1, if(instr(@v, '_^_') - 1 < 0, char_length(@v), instr(@v, '_^_') - 1)), if(instr(@vv,',') > 0, '', concat(',',@vv)) ,']', substr(@v, instr(@v, '_^_'))))  , if (INSTR(SUBSTRING_INDEX(key_201, 'key_16:',-1),'$$') - 1 < 0, '', concat('$$', SUBSTRING_INDEX(SUBSTRING_INDEX(key_201,'key_16:',-1),'$$',-1))) ) )",
+                                        split[0],split[0], split[0], split[0], split[0], split[0], split[0]);
                             } else {
                                 // 转普通格式
-                                value1 = String.format(" key_201 = concat(SUBSTRING_INDEX(key_201,'%s:',1), '%s:', if(substr(@v := if(INSTR(SUBSTRING_INDEX(key_201, '%s:',-1),'$$') - 1 < 0, SUBSTRING_INDEX(key_201, '%s:',-1), SUBSTR(SUBSTRING_INDEX(key_201, '%s:',-1), 1 , INSTR(SUBSTRING_INDEX(key_201, '%s:',-1),'$$') - 1)) , 1, 1) != '[', @v, concat(substr(@v, instr(@v, '[') + 1, (CHAR_LENGTH(@v) - instr(REVERSE(@v) , ']') - instr(@v, '['))), substr(@v, instr(@v, '_^_')))) , if (INSTR(SUBSTRING_INDEX(key_201, 'key_16:',-1),'$$') - 1 < 0, '', concat('$$', SUBSTRING_INDEX(SUBSTRING_INDEX(key_201,'key_16:',-1),'$$',-1))) ) ",
-                                        split[0],split[0],split[0],split[0],split[0], split[0]);
+                                value1 = String.format(" key_201 = if(key_201 is null or instr(key_201, '%s') <= 0, key_201, concat(SUBSTRING_INDEX(key_201,'%s:',1), '%s:', if(substr(@v := if(INSTR(SUBSTRING_INDEX(key_201, '%s:',-1),'$$') - 1 < 0, SUBSTRING_INDEX(key_201, '%s:',-1), SUBSTR(SUBSTRING_INDEX(key_201, '%s:',-1), 1 , INSTR(SUBSTRING_INDEX(key_201, '%s:',-1),'$$') - 1)) , 1, 1) != '[', @v, concat(substr(@v, instr(@v, '[') + 1, (CHAR_LENGTH(@v) - instr(REVERSE(@v) , ']') - instr(@v, '['))), substr(@v, instr(@v, '_^_')))) , if (INSTR(SUBSTRING_INDEX(key_201, 'key_16:',-1),'$$') - 1 < 0, '', concat('$$', SUBSTRING_INDEX(SUBSTRING_INDEX(key_201,'key_16:',-1),'$$',-1))) ) )",
+                                        split[0],split[0],split[0],split[0],split[0],split[0], split[0]);
                             }
                             value = value + " , " + value1;
                             sql = String.format("update %s set %s where p_key_id in ( select p_key_id from m_wbs_tree_contract WHERE is_type_private_pid = %d and project_id = %s )",