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. 8
      src/case/ztree/0.treeview.js
  2. 8
      src/widget/multiselect/trigger/searcher.multiselect.insert.js
  3. 10
      src/widget/multiselect/trigger/searcher.multiselect.js
  4. 4
      src/widget/multitree/trigger/searcher.list.multi.tree.js
  5. 8
      src/widget/multitree/trigger/searcher.multi.tree.js

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

@ -95,7 +95,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
expandSpeed: "",
nameIsHTML: true, // 节点可以用html标签代替
dblClickExpand: false,
showLine: o.showLine,
showLine: o.showLine
},
callback: {
beforeExpand: beforeExpand,
@ -238,7 +238,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
_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,11 +338,15 @@ BI.TreeView = BI.inherit(BI.Pane, {
n.isParent = n.isParent || n.parent;
n.value = BI.isUndefined(n.value) ? n.text : n.value;
// 处理标红
if (BI.isNotNull(n.text)) {
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 {
n.text = "";
}
});
return nodes;
},

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

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

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

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

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

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

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

@ -16,7 +16,7 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
popup: {},
adapter: null,
masker: {},
masker: {}
});
},
@ -136,7 +136,7 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
var names = BI.Func.getSortedResult(BI.keys(value));
BI.each(names, function (idx, name) {
var childNodes = getChildrenNode(value[name]);
text += (o.valueFormatter(name + "") || name) + (childNodes === "" ? "" : (":" + childNodes)) + "; ";
text += (name === "null" ? "" : (o.valueFormatter(name + "") || name)) + (childNodes === "" ? "" : (":" + childNodes)) + "; ";
if (childNodes === "") {
count++;
}
@ -156,7 +156,7 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
BI.each(names, function (idx, name) {
index++;
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 === "") {
count++;
}
@ -165,7 +165,7 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
}
},
getState: function() {
getState: function () {
return this.editor.getState();
},

Loading…
Cancel
Save