Browse Source

Pull request #1968: 无JIRA任务 null值显示成空

Merge in VISUAL/fineui from ~GUY/fineui:master to master

* commit 'a66971d49535db1683dbada63816484c966f805f':
  null值显示成空
es6
guy 3 years ago
parent
commit
1611ad4d89
  1. 14
      src/case/ztree/0.treeview.js
  2. 10
      src/widget/multiselect/trigger/searcher.multiselect.insert.js
  3. 12
      src/widget/multiselect/trigger/searcher.multiselect.js
  4. 6
      src/widget/multitree/trigger/searcher.list.multi.tree.js
  5. 10
      src/widget/multitree/trigger/searcher.multi.tree.js

14
src/case/ztree/0.treeview.js

@ -95,7 +95,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
expandSpeed: "", expandSpeed: "",
nameIsHTML: true, // 节点可以用html标签代替 nameIsHTML: true, // 节点可以用html标签代替
dblClickExpand: false, dblClickExpand: false,
showLine: o.showLine, showLine: o.showLine
}, },
callback: { callback: {
beforeExpand: beforeExpand, beforeExpand: beforeExpand,
@ -238,7 +238,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
_getNodeValue: function (node) { _getNodeValue: function (node) {
// 去除标红 // 去除标红
return node.value == null ? BI.replaceAll(node.text.replace(/<[^>]+>/g, ""), "&nbsp;", " ") : node.value; return BI.isUndefined(node.value) ? BI.replaceAll(node.text.replace(/<[^>]+>/g, ""), "&nbsp;", " ") : node.value;
}, },
// 获取半选框值 // 获取半选框值
@ -338,10 +338,14 @@ BI.TreeView = BI.inherit(BI.Pane, {
n.isParent = n.isParent || n.parent; n.isParent = n.isParent || n.parent;
n.value = BI.isUndefined(n.value) ? n.text : n.value; n.value = BI.isUndefined(n.value) ? n.text : n.value;
// 处理标红 // 处理标红
if (BI.isKey(o.paras.keyword)) { if (BI.isNotNull(n.text)) {
n.text = BI.$("<div>").__textKeywordMarked__(BI.Text.formatText(n.text + ""), o.paras.keyword, n.py).html(); if (BI.isKey(o.paras.keyword)) {
n.text = BI.$("<div>").__textKeywordMarked__(BI.Text.formatText(n.text + ""), o.paras.keyword, n.py).html();
} else {
n.text = BI.htmlEncode(BI.Text.formatText(n.text + ""));
}
} else { } else {
n.text = BI.htmlEncode(BI.Text.formatText(n.text + "")); n.text = "";
} }
}); });
return nodes; return nodes;

10
src/widget/multiselect/trigger/searcher.multiselect.insert.js

@ -135,9 +135,9 @@ BI.MultiSelectInsertSearcher = BI.inherit(BI.Widget, {
var state = ""; var state = "";
BI.each(ob.assist, function (i, v) { BI.each(ob.assist, function (i, v) {
if (i === 0) { if (i === 0) {
state += "" + (o.valueFormatter(v + "") || v); state += "" + (v === null ? "" : (o.valueFormatter(v + "") || v));
} else { } else {
state += "," + (o.valueFormatter(v + "") || v); state += "," + (v === null ? "" : (o.valueFormatter(v + "") || v));
} }
}); });
this.editor.setState(state); this.editor.setState(state);
@ -151,9 +151,9 @@ BI.MultiSelectInsertSearcher = BI.inherit(BI.Widget, {
var state = ""; var state = "";
BI.each(ob.value, function (i, v) { BI.each(ob.value, function (i, v) {
if (i === 0) { if (i === 0) {
state += "" + (o.valueFormatter(v + "") || v); state += "" + (v === null ? "" : (o.valueFormatter(v + "") || v));
} else { } else {
state += "," + (o.valueFormatter(v + "") || v); state += "," + (v === null ? "" : (o.valueFormatter(v + "") || v));
} }
}); });
this.editor.setState(state); this.editor.setState(state);
@ -193,4 +193,4 @@ BI.MultiSelectInsertSearcher.EVENT_PAUSE = "EVENT_PAUSE";
BI.MultiSelectInsertSearcher.EVENT_SEARCHING = "EVENT_SEARCHING"; BI.MultiSelectInsertSearcher.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiSelectInsertSearcher.EVENT_FOCUS = "EVENT_FOCUS"; BI.MultiSelectInsertSearcher.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiSelectInsertSearcher.EVENT_BLUR = "EVENT_BLUR"; BI.MultiSelectInsertSearcher.EVENT_BLUR = "EVENT_BLUR";
BI.shortcut("bi.multi_select_insert_searcher", BI.MultiSelectInsertSearcher); BI.shortcut("bi.multi_select_insert_searcher", BI.MultiSelectInsertSearcher);

12
src/widget/multiselect/trigger/searcher.multiselect.js

@ -133,9 +133,9 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
var state = ""; var state = "";
BI.each(ob.assist, function (i, v) { BI.each(ob.assist, function (i, v) {
if (i === 0) { if (i === 0) {
state += "" + (o.valueFormatter(v + "") || v); state += "" + (v === null ? "" : (o.valueFormatter(v + "") || v));
} else { } else {
state += "," + (o.valueFormatter(v + "") || v); state += "," + (v === null ? "" : (o.valueFormatter(v + "") || v));
} }
}); });
this.editor.setState(state); this.editor.setState(state);
@ -149,9 +149,9 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
var state = ""; var state = "";
BI.each(ob.value, function (i, v) { BI.each(ob.value, function (i, v) {
if (i === 0) { if (i === 0) {
state += "" + (o.valueFormatter(v + "") || v); state += "" + (v === null ? "" : (o.valueFormatter(v + "") || v));
} else { } else {
state += "," + (o.valueFormatter(v + "") || v); state += "," + (v === null ? "" : (o.valueFormatter(v + "") || v));
} }
}); });
this.editor.setState(state); this.editor.setState(state);
@ -161,7 +161,7 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
} }
}, },
getState: function() { getState: function () {
return this.editor.getState(); return this.editor.getState();
}, },
@ -191,4 +191,4 @@ BI.MultiSelectSearcher.EVENT_PAUSE = "EVENT_PAUSE";
BI.MultiSelectSearcher.EVENT_SEARCHING = "EVENT_SEARCHING"; BI.MultiSelectSearcher.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiSelectSearcher.EVENT_FOCUS = "EVENT_FOCUS"; BI.MultiSelectSearcher.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiSelectSearcher.EVENT_BLUR = "EVENT_BLUR"; BI.MultiSelectSearcher.EVENT_BLUR = "EVENT_BLUR";
BI.shortcut("bi.multi_select_searcher", BI.MultiSelectSearcher); BI.shortcut("bi.multi_select_searcher", BI.MultiSelectSearcher);

6
src/widget/multitree/trigger/searcher.list.multi.tree.js

@ -122,7 +122,7 @@ BI.MultiListTreeSearcher = BI.inherit(BI.Widget, {
var text = ""; var text = "";
BI.each(ob.value, function (idx, path) { BI.each(ob.value, function (idx, path) {
var childValue = BI.last(path); var childValue = BI.last(path);
text += (o.valueFormatter(childValue + "") || childValue) + "; "; text += (path === "null" ? "" : (o.valueFormatter(childValue + "") || childValue) + "; ");
count++; count++;
}); });
@ -134,7 +134,7 @@ BI.MultiListTreeSearcher = BI.inherit(BI.Widget, {
} }
}, },
getState: function() { getState: function () {
return this.editor.getState(); return this.editor.getState();
}, },
@ -161,4 +161,4 @@ BI.MultiListTreeSearcher.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiListTreeSearcher.EVENT_START = "EVENT_START"; BI.MultiListTreeSearcher.EVENT_START = "EVENT_START";
BI.MultiListTreeSearcher.EVENT_STOP = "EVENT_STOP"; BI.MultiListTreeSearcher.EVENT_STOP = "EVENT_STOP";
BI.MultiListTreeSearcher.EVENT_PAUSE = "EVENT_PAUSE"; BI.MultiListTreeSearcher.EVENT_PAUSE = "EVENT_PAUSE";
BI.shortcut("bi.multi_list_tree_searcher", BI.MultiListTreeSearcher); BI.shortcut("bi.multi_list_tree_searcher", BI.MultiListTreeSearcher);

10
src/widget/multitree/trigger/searcher.multi.tree.js

@ -16,7 +16,7 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
popup: {}, popup: {},
adapter: null, adapter: null,
masker: {}, masker: {}
}); });
}, },
@ -136,7 +136,7 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
var names = BI.Func.getSortedResult(BI.keys(value)); var names = BI.Func.getSortedResult(BI.keys(value));
BI.each(names, function (idx, name) { BI.each(names, function (idx, name) {
var childNodes = getChildrenNode(value[name]); var childNodes = getChildrenNode(value[name]);
text += (o.valueFormatter(name + "") || name) + (childNodes === "" ? "" : (":" + childNodes)) + "; "; text += (name === "null" ? "" : (o.valueFormatter(name + "") || name)) + (childNodes === "" ? "" : (":" + childNodes)) + "; ";
if (childNodes === "") { if (childNodes === "") {
count++; count++;
} }
@ -156,7 +156,7 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
BI.each(names, function (idx, name) { BI.each(names, function (idx, name) {
index++; index++;
var childNodes = getChildrenNode(ob[name]); var childNodes = getChildrenNode(ob[name]);
text += (o.valueFormatter(name + "") || name) + (childNodes === "" ? "" : (":" + childNodes)) + (index === size ? "" : ","); text += (name === "null" ? "" : (o.valueFormatter(name + "") || name)) + (childNodes === "" ? "" : (":" + childNodes)) + (index === size ? "" : ",");
if (childNodes === "") { if (childNodes === "") {
count++; count++;
} }
@ -165,7 +165,7 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
} }
}, },
getState: function() { getState: function () {
return this.editor.getState(); return this.editor.getState();
}, },
@ -193,4 +193,4 @@ BI.MultiTreeSearcher.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiTreeSearcher.EVENT_START = "EVENT_START"; BI.MultiTreeSearcher.EVENT_START = "EVENT_START";
BI.MultiTreeSearcher.EVENT_STOP = "EVENT_STOP"; BI.MultiTreeSearcher.EVENT_STOP = "EVENT_STOP";
BI.MultiTreeSearcher.EVENT_PAUSE = "EVENT_PAUSE"; BI.MultiTreeSearcher.EVENT_PAUSE = "EVENT_PAUSE";
BI.shortcut("bi.multi_tree_searcher", BI.MultiTreeSearcher); BI.shortcut("bi.multi_tree_searcher", BI.MultiTreeSearcher);

Loading…
Cancel
Save