导入逻辑处理
This commit is contained in:
parent
ea338a7a8d
commit
a414ac07f1
Binary file not shown.
@ -2666,25 +2666,40 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
|||||||
input = "<input class=\"awsui-textbox\" autocomplete='off' id=\"" + id + "\" name=\"dateTimePicker\" sid=\"" + sid + "\" uuid=\"" + uuid + "\" placeholder='" + desc + "' data-originvalue='" + inputValue + "' value='" + inputValue + "' isRequired='" + isRequired + "' onblur='saveContent($(this));'>" + "</input>";
|
input = "<input class=\"awsui-textbox\" autocomplete='off' id=\"" + id + "\" name=\"dateTimePicker\" sid=\"" + sid + "\" uuid=\"" + uuid + "\" placeholder='" + desc + "' data-originvalue='" + inputValue + "' value='" + inputValue + "' isRequired='" + isRequired + "' onblur='saveContent($(this));'>" + "</input>";
|
||||||
}else if ("table".equals(type)){
|
}else if ("table".equals(type)){
|
||||||
|
|
||||||
JSONObject table = JSON.parseObject(jsonValue);
|
|
||||||
int subTableSize = 0;
|
//判断如果table不为准确json格式,则手动输入
|
||||||
if (null != table){
|
boolean falgtrue = getJSONType(jsonValue);
|
||||||
JSONArray subTable = table.getJSONArray("table");
|
|
||||||
if (null != subTable){
|
|
||||||
subTableSize = subTable.size();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
String tableInput = subTableSize > 1 ? "请查看" : "请输入";
|
|
||||||
String attrRef = attributeModel.getRef();
|
String attrRef = attributeModel.getRef();
|
||||||
JSONObject refValue = JSON.parseObject(attrRef);
|
JSONObject refValue = JSON.parseObject(attrRef);
|
||||||
String tableTitle = attributeModel.getTitle();
|
String tableTitle = attributeModel.getTitle();
|
||||||
|
|
||||||
input = "<span class=\"awsui-input-wrapper\" tableTitle="+ tableTitle +" ref="+ refValue +" onclick=\"showTableDialog($(this),"+ ( StringUtils.isEmpty(jsonValue) ? new JSONObject() : jsonValue.replace("\"","'") )+",'" + id + "')\">"
|
if (falgtrue == true) {
|
||||||
|
JSONObject table = JSON.parseObject(jsonValue);
|
||||||
|
int subTableSize = 0;
|
||||||
|
if (null != table) {
|
||||||
|
JSONArray subTable = table.getJSONArray("table");
|
||||||
|
if (null != subTable) {
|
||||||
|
subTableSize = subTable.size();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String tableInput = subTableSize > 1 ? "请查看" : "请输入";
|
||||||
|
|
||||||
|
input = "<span class=\"awsui-input-wrapper\" tableTitle=" + tableTitle + " ref=" + refValue + " onclick=\"showTableDialog($(this)," + (StringUtils.isEmpty(jsonValue) ? new JSONObject() : jsonValue.replace("\"", "'")) + ",'" + id + "')\">"
|
||||||
+ "<input type='text' id='" + id + "' value='" + tableInput + "' class=\"awsui-textbox\" />"
|
+ "<input type='text' id='" + id + "' value='" + tableInput + "' class=\"awsui-textbox\" />"
|
||||||
+ "<span class=\"awsui-input-suffix\" sid='" + sid + "' uuid='" + uuid + "' >"
|
+ "<span class=\"awsui-input-suffix\" sid='" + sid + "' uuid='" + uuid + "' >"
|
||||||
+ " <i class=\"awsui-iconfont\" ></i>"
|
+ " <i class=\"awsui-iconfont\" ></i>"
|
||||||
+ "</span>"
|
+ "</span>"
|
||||||
+ "</span>";
|
+ "</span>";
|
||||||
|
|
||||||
|
} else {
|
||||||
|
input = "<span class=\"awsui-input-wrapper\" tableTitle=" + tableTitle + " ref=" + refValue + " onclick=\"showTableDialog($(this),{}" + ",'" + id + "')\">"
|
||||||
|
+ "<input type='text' id='" + id + "' value='" + "请输入" + "' class=\"awsui-textbox\" />"
|
||||||
|
+ "<span class=\"awsui-input-suffix\" sid='" + sid + "' uuid='" + uuid + "' >"
|
||||||
|
+ " <i class=\"awsui-iconfont\" ></i>"
|
||||||
|
+ "</span>"
|
||||||
|
+ "</span>";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (readonly) {
|
if (readonly) {
|
||||||
@ -2700,6 +2715,25 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
|||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断是否为json格式
|
||||||
|
* @param str
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static boolean getJSONType(String str) {
|
||||||
|
boolean result = false;
|
||||||
|
if (StringUtils.isNotBlank(str)) {
|
||||||
|
str = str.trim();
|
||||||
|
if (str.startsWith("{") && str.endsWith("}")) {
|
||||||
|
result = true;
|
||||||
|
} else if (str.startsWith("[") && str.endsWith("]")) {
|
||||||
|
result = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取资产库节点的 json
|
* 获取资产库节点的 json
|
||||||
*
|
*
|
||||||
|
|||||||
@ -447,8 +447,8 @@ function openDialog(obj) {
|
|||||||
for ( let i = 1; i < dialogTable.length; i++) {
|
for ( let i = 1; i < dialogTable.length; i++) {
|
||||||
let str =
|
let str =
|
||||||
'<tr id="' + dialogTable[i].id + '">'
|
'<tr id="' + dialogTable[i].id + '">'
|
||||||
+ '<td style="width: 30%;">' + dialogTable[i].name + '</td>'
|
+ '<td style="width: 30%;font-size: 20px">' + dialogTable[i].name + '</td>'
|
||||||
+ '<td style="width: 70%;">' + dialogTable[i].desc + '</td>'
|
+ '<td style="width: 70%;font-size: 20px">' + dialogTable[i].desc + '</td>'
|
||||||
+'</tr>'
|
+'</tr>'
|
||||||
$('#attribute-table-content2').append(str)
|
$('#attribute-table-content2').append(str)
|
||||||
}
|
}
|
||||||
@ -456,6 +456,7 @@ function openDialog(obj) {
|
|||||||
$("#attribute-table-window2").dialog({
|
$("#attribute-table-window2").dialog({
|
||||||
title: tableName,
|
title: tableName,
|
||||||
draggable: true,
|
draggable: true,
|
||||||
|
height:50,
|
||||||
buttons : [{
|
buttons : [{
|
||||||
text : '确定',
|
text : '确定',
|
||||||
cls : "blue",
|
cls : "blue",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user