Browse Source

Merge remote-tracking branch 'origin/master'

es6
guy 4 years ago
parent
commit
8f0d79edf2
  1. 14
      src/component/treevaluechooser/abstract.treevaluechooser.js
  2. 4
      src/widget/time/time.combo.js
  3. 13
      src/widget/timeinterval/timeperiods.js

14
src/component/treevaluechooser/abstract.treevaluechooser.js

@ -726,6 +726,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
var self = this;
var findParentNode;
var index = 0;
var currentParent = this.tree.getRoot();
this.tree.traverse(function (node) {
if (self.tree.isRoot(node)) {
return;
@ -733,14 +734,27 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
if (index > parentValues.length) {
return false;
}
/**
* 一个树结构要找root_1_3的子节点
* {root: { 1: {1: {}, 2: {}, 3: {}}, 3: {1: {}, 2: {}} } }
* 当遍历到root_1节点时index++而下一个节点root_3时符合下面的if逻辑这样找到的节点就是root_3节点了需要加步判断是否是root_1的子节点
*/
if (index === parentValues.length && node.value === v) {
if (node.getParent() !== currentParent) {
return;
}
findParentNode = node;
return false;
}
if (node.value === parentValues[index]) {
index++;
currentParent = node;
return;
}
return true;
});
return findParentNode;

4
src/widget/time/time.combo.js

@ -14,8 +14,8 @@
},
props: {
baseCls: "bi-time-combo bi-border bi-border-radius bi-focus-shadow",
width: 78,
height: 22,
// width: 78,
// height: 22,
format: "",
allowEdit: false
},

13
src/widget/timeinterval/timeperiods.js

@ -9,8 +9,8 @@
constants: {
height: 24,
width: 24,
lgap: 15,
offset: 0
hgap: 15,
offset: -15
},
props: {
extraCls: "bi-time-interval",
@ -43,6 +43,7 @@
el: {
type: "bi.center",
height: this.constants.height,
hgap: this.constants.hgap,
items: [{
type: "bi.absolute",
items: [{
@ -52,9 +53,9 @@
}
}, this._createCombo(o.value.start)),
left: this.constants.offset,
right: this.constants.width / 2,
right: 0,
top: 0,
bottom: 0
bottom: 0,
}]
}, {
type: "bi.absolute",
@ -64,10 +65,10 @@
self.right = _ref;
}
}, this._createCombo(o.value.end)),
left: this.constants.width / 2,
left: 0,
right: this.constants.offset,
top: 0,
bottom: 0
bottom: 0,
}]
}]
},

Loading…
Cancel
Save