|
|
@@ -1022,6 +1022,50 @@ public class ExcelTabController extends BladeController {
|
|
|
|
|
|
// 远程搜索配置
|
|
|
Document doc = Jsoup.parse(htmlString);
|
|
|
+
|
|
|
+ //获取所有input标签
|
|
|
+ String[] tagNames = {"el-input", "el-date-picker", "el-time-picker", "hc-form-select-search",
|
|
|
+ "hc-table-form-upload", "hc-form-checkbox-group", "el-radio-group", "el-select"};
|
|
|
+ Elements inputs = new Elements();
|
|
|
+ for (String tagName : tagNames) {
|
|
|
+ inputs.addAll(doc.select(tagName));
|
|
|
+ }
|
|
|
+
|
|
|
+ //获取元素表数据
|
|
|
+ List<WbsFormElement> wbsFormElements = wbsFormElementService.getBaseMapper().selectList(Wrappers.<WbsFormElement>lambdaQuery()
|
|
|
+ .eq(WbsFormElement::getFId, wbsTreePrivate.getInitTableId())
|
|
|
+ .eq(WbsFormElement::getIsDeleted, 0)
|
|
|
+ );
|
|
|
+ List<String> keys = wbsFormElements.stream().map(WbsFormElement::getEKey).collect(Collectors.toList());
|
|
|
+
|
|
|
+ //判断标签是否存在id属性
|
|
|
+ inputs.forEach(input -> {
|
|
|
+ String id = input.attr("id");
|
|
|
+ if(com.mixsmart.utils.StringUtils.isEmpty(id)){
|
|
|
+ input.attr("htmlElementError", "1");
|
|
|
+ } else {
|
|
|
+ /**
|
|
|
+ * 判断当前元素是否符合格式
|
|
|
+ * 1、是否存在key_
|
|
|
+ * 2、是否存在__
|
|
|
+ * 3、key_后面是否为数字
|
|
|
+ * 4、__后面是否为坐标
|
|
|
+ * 5、key是否在元素库中存在
|
|
|
+ */
|
|
|
+ if(!id.contains("key_")
|
|
|
+ || !id.contains("__")
|
|
|
+ || !com.mixsmart.utils.StringUtils.isNumber(id.split("__")[0].replace("key_",""))
|
|
|
+ || !id.split("__")[1].contains("_")
|
|
|
+ || !com.mixsmart.utils.StringUtils.isNumber(id.split("__")[1].split("_")[0])
|
|
|
+ || !com.mixsmart.utils.StringUtils.isNumber(id.split("__")[1].split("_")[1])
|
|
|
+ || !keys.contains(id.split("__")[0])
|
|
|
+ ){
|
|
|
+ input.attr("htmlElementError", "1");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
Element table = doc.select("table").first();
|
|
|
Elements col = doc.select("Col");
|
|
|
doc.select("Col").remove();
|