diff --git a/demo/config.js b/demo/config.js index cc3e5dfe7..71893d1b2 100644 --- a/demo/config.js +++ b/demo/config.js @@ -1524,13 +1524,19 @@ Demo.CONSTANTS = { {id: 121, pId: 12, value: "第三级目录1", text: "第三级目录1"}, {id: 122, pId: 12, value: "第三级文件1", text: "第三级文件1"}, {id: 1211, pId: 121, value: "第四级目录1", text: "第四级目录1"}, - {id: 12111, pId: 1211, value: "第五级文件1", text: "第五级文件111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"}, + { + id: 12111, + pId: 1211, + value: "第五级文件1", + text: "第五级文件111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + }, {id: 2, pId: -1, value: "第一级目录2", text: "第一级目录2"}, {id: 21, pId: 2, value: "第二级目录3", text: "第二级目录3"}, {id: 22, pId: 2, value: "第二级文件2", text: "第二级文件2"}, {id: 211, pId: 21, value: "第三级目录2", text: "第三级目录2"}, {id: 212, pId: 21, value: "第三级文件2", text: "第三级文件2"}, - {id: 2111, pId: 211, value: "第四级文件1", text: "第四级文件1"}], + {id: 2111, pId: 211, value: "第四级文件1", text: "第四级文件1"}, + {id: 3, pId: -1, value: "第一级目录3", text: "第一级目录3", isParent: true}], LEVELTREE: [{ id: 1, text: "第一项", diff --git a/dist/bundle.ie.js b/dist/bundle.ie.js index 639c01b5c..24834c95c 100644 --- a/dist/bundle.ie.js +++ b/dist/bundle.ie.js @@ -53789,7 +53789,7 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { this._createValueMap(); var value; - if(BI.isNotNull(o.value)){ + if(BI.isNotNull(o.value)) { value = this._digest(o.value); } this.trigger = BI.createWidget({ @@ -53813,13 +53813,19 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { }); this.combo.on(BI.DownListCombo.EVENT_CHANGE, function () { - self.setValue(self.combo.getValue()[0].value); - self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE); + var currentVal = self.combo.getValue()[0].value; + if (currentVal !== self.value) { + self.setValue(currentVal); + self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE); + } }); this.combo.on(BI.DownListCombo.EVENT_SON_VALUE_CHANGE, function () { - self.setValue(self.combo.getValue()[0].childValue); - self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE); + var currentVal = self.combo.getValue()[0].childValue; + if (currentVal !== self.value) { + self.setValue(currentVal); + self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE); + } }); }, @@ -53838,6 +53844,7 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { }, _digest: function (v) { + this.value = v; return this.valueMap[v]; }, @@ -57327,7 +57334,7 @@ BI.LevelTree = BI.inherit(BI.Widget, { node.id = BI.UUID(); } extend.pNode = pNode; - if (node.isParent === true || BI.isNotEmptyArray(node.children)) { + if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) { extend.type = "bi.mid_plus_group_node"; if (i === nodes.length - 1) { extend.type = "bi.last_plus_group_node"; @@ -57469,7 +57476,7 @@ BI.DisplayTree = BI.inherit(BI.TreeView, { } }; - function beforeCollapse (treeId, treeNode) { + function beforeCollapse(treeId, treeNode) { return false; } @@ -57480,6 +57487,7 @@ BI.DisplayTree = BI.inherit(BI.TreeView, { nodes = BI.DisplayTree.superclass._dealWidthNodes.apply(this, arguments); var self = this, o = this.options; BI.each(nodes, function (i, node) { + node.isParent = node.isParent || node.parent; if (node.text == null) { if (node.count > 0) { node.text = node.value + "(" + BI.i18nText("BI-Basic_Altogether") + node.count + BI.i18nText("BI-Basic_Count") + ")"; @@ -64857,7 +64865,7 @@ BI.MultiLayerSelectLevelTree = BI.inherit(BI.Widget, { node.id = BI.UUID(); } extend.pNode = pNode; - if (node.isParent === true || BI.isNotEmptyArray(node.children)) { + if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) { extend.type = "bi.multilayer_select_tree_mid_plus_group_node"; if (i === nodes.length - 1) { extend.type = "bi.multilayer_select_tree_last_plus_group_node"; @@ -65548,7 +65556,7 @@ BI.MultiLayerSingleLevelTree = BI.inherit(BI.Widget, { node.id = BI.UUID(); } extend.pNode = pNode; - if (node.isParent === true || BI.isNotEmptyArray(node.children)) { + if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) { extend.type = "bi.multilayer_single_tree_mid_plus_group_node"; if (i === nodes.length - 1) { extend.type = "bi.multilayer_single_tree_last_plus_group_node"; @@ -74163,7 +74171,7 @@ BI.SelectTreePopup = BI.inherit(BI.Pane, { var extend = {layer: layer}; node.id = node.id || BI.UUID(); extend.pNode = pNode; - if (node.isParent === true || BI.isNotEmptyArray(node.children)) { + if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) { extend.type = "bi.select_tree_mid_plus_group_node"; if (i === nodes.length - 1) { extend.type = "bi.select_tree_last_plus_group_node"; diff --git a/dist/bundle.js b/dist/bundle.js index c40c94cb6..79e94bff9 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -54328,7 +54328,7 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { this._createValueMap(); var value; - if(BI.isNotNull(o.value)){ + if(BI.isNotNull(o.value)) { value = this._digest(o.value); } this.trigger = BI.createWidget({ @@ -54352,13 +54352,19 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { }); this.combo.on(BI.DownListCombo.EVENT_CHANGE, function () { - self.setValue(self.combo.getValue()[0].value); - self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE); + var currentVal = self.combo.getValue()[0].value; + if (currentVal !== self.value) { + self.setValue(currentVal); + self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE); + } }); this.combo.on(BI.DownListCombo.EVENT_SON_VALUE_CHANGE, function () { - self.setValue(self.combo.getValue()[0].childValue); - self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE); + var currentVal = self.combo.getValue()[0].childValue; + if (currentVal !== self.value) { + self.setValue(currentVal); + self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE); + } }); }, @@ -54377,6 +54383,7 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { }, _digest: function (v) { + this.value = v; return this.valueMap[v]; }, @@ -57866,7 +57873,7 @@ BI.LevelTree = BI.inherit(BI.Widget, { node.id = BI.UUID(); } extend.pNode = pNode; - if (node.isParent === true || BI.isNotEmptyArray(node.children)) { + if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) { extend.type = "bi.mid_plus_group_node"; if (i === nodes.length - 1) { extend.type = "bi.last_plus_group_node"; @@ -58008,7 +58015,7 @@ BI.DisplayTree = BI.inherit(BI.TreeView, { } }; - function beforeCollapse (treeId, treeNode) { + function beforeCollapse(treeId, treeNode) { return false; } @@ -58019,6 +58026,7 @@ BI.DisplayTree = BI.inherit(BI.TreeView, { nodes = BI.DisplayTree.superclass._dealWidthNodes.apply(this, arguments); var self = this, o = this.options; BI.each(nodes, function (i, node) { + node.isParent = node.isParent || node.parent; if (node.text == null) { if (node.count > 0) { node.text = node.value + "(" + BI.i18nText("BI-Basic_Altogether") + node.count + BI.i18nText("BI-Basic_Count") + ")"; @@ -65396,7 +65404,7 @@ BI.MultiLayerSelectLevelTree = BI.inherit(BI.Widget, { node.id = BI.UUID(); } extend.pNode = pNode; - if (node.isParent === true || BI.isNotEmptyArray(node.children)) { + if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) { extend.type = "bi.multilayer_select_tree_mid_plus_group_node"; if (i === nodes.length - 1) { extend.type = "bi.multilayer_select_tree_last_plus_group_node"; @@ -66087,7 +66095,7 @@ BI.MultiLayerSingleLevelTree = BI.inherit(BI.Widget, { node.id = BI.UUID(); } extend.pNode = pNode; - if (node.isParent === true || BI.isNotEmptyArray(node.children)) { + if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) { extend.type = "bi.multilayer_single_tree_mid_plus_group_node"; if (i === nodes.length - 1) { extend.type = "bi.multilayer_single_tree_last_plus_group_node"; @@ -74702,7 +74710,7 @@ BI.SelectTreePopup = BI.inherit(BI.Pane, { var extend = {layer: layer}; node.id = node.id || BI.UUID(); extend.pNode = pNode; - if (node.isParent === true || BI.isNotEmptyArray(node.children)) { + if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) { extend.type = "bi.select_tree_mid_plus_group_node"; if (i === nodes.length - 1) { extend.type = "bi.select_tree_last_plus_group_node"; diff --git a/dist/case.js b/dist/case.js index 0ff496e20..71aa9ba7b 100644 --- a/dist/case.js +++ b/dist/case.js @@ -5466,7 +5466,7 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { this._createValueMap(); var value; - if(BI.isNotNull(o.value)){ + if(BI.isNotNull(o.value)) { value = this._digest(o.value); } this.trigger = BI.createWidget({ @@ -5490,13 +5490,19 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { }); this.combo.on(BI.DownListCombo.EVENT_CHANGE, function () { - self.setValue(self.combo.getValue()[0].value); - self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE); + var currentVal = self.combo.getValue()[0].value; + if (currentVal !== self.value) { + self.setValue(currentVal); + self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE); + } }); this.combo.on(BI.DownListCombo.EVENT_SON_VALUE_CHANGE, function () { - self.setValue(self.combo.getValue()[0].childValue); - self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE); + var currentVal = self.combo.getValue()[0].childValue; + if (currentVal !== self.value) { + self.setValue(currentVal); + self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE); + } }); }, @@ -5515,6 +5521,7 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { }, _digest: function (v) { + this.value = v; return this.valueMap[v]; }, @@ -9004,7 +9011,7 @@ BI.LevelTree = BI.inherit(BI.Widget, { node.id = BI.UUID(); } extend.pNode = pNode; - if (node.isParent === true || BI.isNotEmptyArray(node.children)) { + if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) { extend.type = "bi.mid_plus_group_node"; if (i === nodes.length - 1) { extend.type = "bi.last_plus_group_node"; @@ -9146,7 +9153,7 @@ BI.DisplayTree = BI.inherit(BI.TreeView, { } }; - function beforeCollapse (treeId, treeNode) { + function beforeCollapse(treeId, treeNode) { return false; } @@ -9157,6 +9164,7 @@ BI.DisplayTree = BI.inherit(BI.TreeView, { nodes = BI.DisplayTree.superclass._dealWidthNodes.apply(this, arguments); var self = this, o = this.options; BI.each(nodes, function (i, node) { + node.isParent = node.isParent || node.parent; if (node.text == null) { if (node.count > 0) { node.text = node.value + "(" + BI.i18nText("BI-Basic_Altogether") + node.count + BI.i18nText("BI-Basic_Count") + ")"; diff --git a/dist/demo.js b/dist/demo.js index fc5951847..29f067c2a 100644 --- a/dist/demo.js +++ b/dist/demo.js @@ -13286,13 +13286,19 @@ Demo.CONSTANTS = { {id: 121, pId: 12, value: "第三级目录1", text: "第三级目录1"}, {id: 122, pId: 12, value: "第三级文件1", text: "第三级文件1"}, {id: 1211, pId: 121, value: "第四级目录1", text: "第四级目录1"}, - {id: 12111, pId: 1211, value: "第五级文件1", text: "第五级文件111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"}, + { + id: 12111, + pId: 1211, + value: "第五级文件1", + text: "第五级文件111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + }, {id: 2, pId: -1, value: "第一级目录2", text: "第一级目录2"}, {id: 21, pId: 2, value: "第二级目录3", text: "第二级目录3"}, {id: 22, pId: 2, value: "第二级文件2", text: "第二级文件2"}, {id: 211, pId: 21, value: "第三级目录2", text: "第三级目录2"}, {id: 212, pId: 21, value: "第三级文件2", text: "第三级文件2"}, - {id: 2111, pId: 211, value: "第四级文件1", text: "第四级文件1"}], + {id: 2111, pId: 211, value: "第四级文件1", text: "第四级文件1"}, + {id: 3, pId: -1, value: "第一级目录3", text: "第一级目录3", isParent: true}], LEVELTREE: [{ id: 1, text: "第一项", diff --git a/dist/fineui.ie.js b/dist/fineui.ie.js index 3eb564125..7b468d3e7 100644 --- a/dist/fineui.ie.js +++ b/dist/fineui.ie.js @@ -54031,7 +54031,7 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { this._createValueMap(); var value; - if(BI.isNotNull(o.value)){ + if(BI.isNotNull(o.value)) { value = this._digest(o.value); } this.trigger = BI.createWidget({ @@ -54055,13 +54055,19 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { }); this.combo.on(BI.DownListCombo.EVENT_CHANGE, function () { - self.setValue(self.combo.getValue()[0].value); - self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE); + var currentVal = self.combo.getValue()[0].value; + if (currentVal !== self.value) { + self.setValue(currentVal); + self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE); + } }); this.combo.on(BI.DownListCombo.EVENT_SON_VALUE_CHANGE, function () { - self.setValue(self.combo.getValue()[0].childValue); - self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE); + var currentVal = self.combo.getValue()[0].childValue; + if (currentVal !== self.value) { + self.setValue(currentVal); + self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE); + } }); }, @@ -54080,6 +54086,7 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { }, _digest: function (v) { + this.value = v; return this.valueMap[v]; }, @@ -57569,7 +57576,7 @@ BI.LevelTree = BI.inherit(BI.Widget, { node.id = BI.UUID(); } extend.pNode = pNode; - if (node.isParent === true || BI.isNotEmptyArray(node.children)) { + if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) { extend.type = "bi.mid_plus_group_node"; if (i === nodes.length - 1) { extend.type = "bi.last_plus_group_node"; @@ -57711,7 +57718,7 @@ BI.DisplayTree = BI.inherit(BI.TreeView, { } }; - function beforeCollapse (treeId, treeNode) { + function beforeCollapse(treeId, treeNode) { return false; } @@ -57722,6 +57729,7 @@ BI.DisplayTree = BI.inherit(BI.TreeView, { nodes = BI.DisplayTree.superclass._dealWidthNodes.apply(this, arguments); var self = this, o = this.options; BI.each(nodes, function (i, node) { + node.isParent = node.isParent || node.parent; if (node.text == null) { if (node.count > 0) { node.text = node.value + "(" + BI.i18nText("BI-Basic_Altogether") + node.count + BI.i18nText("BI-Basic_Count") + ")"; @@ -65099,7 +65107,7 @@ BI.MultiLayerSelectLevelTree = BI.inherit(BI.Widget, { node.id = BI.UUID(); } extend.pNode = pNode; - if (node.isParent === true || BI.isNotEmptyArray(node.children)) { + if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) { extend.type = "bi.multilayer_select_tree_mid_plus_group_node"; if (i === nodes.length - 1) { extend.type = "bi.multilayer_select_tree_last_plus_group_node"; @@ -65790,7 +65798,7 @@ BI.MultiLayerSingleLevelTree = BI.inherit(BI.Widget, { node.id = BI.UUID(); } extend.pNode = pNode; - if (node.isParent === true || BI.isNotEmptyArray(node.children)) { + if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) { extend.type = "bi.multilayer_single_tree_mid_plus_group_node"; if (i === nodes.length - 1) { extend.type = "bi.multilayer_single_tree_last_plus_group_node"; @@ -74405,7 +74413,7 @@ BI.SelectTreePopup = BI.inherit(BI.Pane, { var extend = {layer: layer}; node.id = node.id || BI.UUID(); extend.pNode = pNode; - if (node.isParent === true || BI.isNotEmptyArray(node.children)) { + if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) { extend.type = "bi.select_tree_mid_plus_group_node"; if (i === nodes.length - 1) { extend.type = "bi.select_tree_last_plus_group_node"; diff --git a/dist/fineui.js b/dist/fineui.js index 41bde3487..2a534ba2d 100644 --- a/dist/fineui.js +++ b/dist/fineui.js @@ -54570,7 +54570,7 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { this._createValueMap(); var value; - if(BI.isNotNull(o.value)){ + if(BI.isNotNull(o.value)) { value = this._digest(o.value); } this.trigger = BI.createWidget({ @@ -54594,13 +54594,19 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { }); this.combo.on(BI.DownListCombo.EVENT_CHANGE, function () { - self.setValue(self.combo.getValue()[0].value); - self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE); + var currentVal = self.combo.getValue()[0].value; + if (currentVal !== self.value) { + self.setValue(currentVal); + self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE); + } }); this.combo.on(BI.DownListCombo.EVENT_SON_VALUE_CHANGE, function () { - self.setValue(self.combo.getValue()[0].childValue); - self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE); + var currentVal = self.combo.getValue()[0].childValue; + if (currentVal !== self.value) { + self.setValue(currentVal); + self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE); + } }); }, @@ -54619,6 +54625,7 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { }, _digest: function (v) { + this.value = v; return this.valueMap[v]; }, @@ -58108,7 +58115,7 @@ BI.LevelTree = BI.inherit(BI.Widget, { node.id = BI.UUID(); } extend.pNode = pNode; - if (node.isParent === true || BI.isNotEmptyArray(node.children)) { + if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) { extend.type = "bi.mid_plus_group_node"; if (i === nodes.length - 1) { extend.type = "bi.last_plus_group_node"; @@ -58250,7 +58257,7 @@ BI.DisplayTree = BI.inherit(BI.TreeView, { } }; - function beforeCollapse (treeId, treeNode) { + function beforeCollapse(treeId, treeNode) { return false; } @@ -58261,6 +58268,7 @@ BI.DisplayTree = BI.inherit(BI.TreeView, { nodes = BI.DisplayTree.superclass._dealWidthNodes.apply(this, arguments); var self = this, o = this.options; BI.each(nodes, function (i, node) { + node.isParent = node.isParent || node.parent; if (node.text == null) { if (node.count > 0) { node.text = node.value + "(" + BI.i18nText("BI-Basic_Altogether") + node.count + BI.i18nText("BI-Basic_Count") + ")"; @@ -65638,7 +65646,7 @@ BI.MultiLayerSelectLevelTree = BI.inherit(BI.Widget, { node.id = BI.UUID(); } extend.pNode = pNode; - if (node.isParent === true || BI.isNotEmptyArray(node.children)) { + if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) { extend.type = "bi.multilayer_select_tree_mid_plus_group_node"; if (i === nodes.length - 1) { extend.type = "bi.multilayer_select_tree_last_plus_group_node"; @@ -66329,7 +66337,7 @@ BI.MultiLayerSingleLevelTree = BI.inherit(BI.Widget, { node.id = BI.UUID(); } extend.pNode = pNode; - if (node.isParent === true || BI.isNotEmptyArray(node.children)) { + if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) { extend.type = "bi.multilayer_single_tree_mid_plus_group_node"; if (i === nodes.length - 1) { extend.type = "bi.multilayer_single_tree_last_plus_group_node"; @@ -74944,7 +74952,7 @@ BI.SelectTreePopup = BI.inherit(BI.Pane, { var extend = {layer: layer}; node.id = node.id || BI.UUID(); extend.pNode = pNode; - if (node.isParent === true || BI.isNotEmptyArray(node.children)) { + if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) { extend.type = "bi.select_tree_mid_plus_group_node"; if (i === nodes.length - 1) { extend.type = "bi.select_tree_last_plus_group_node"; diff --git a/dist/fineui_without_jquery_polyfill.js b/dist/fineui_without_jquery_polyfill.js index 1eead17e4..ccd28bbac 100644 --- a/dist/fineui_without_jquery_polyfill.js +++ b/dist/fineui_without_jquery_polyfill.js @@ -37651,7 +37651,7 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { this._createValueMap(); var value; - if(BI.isNotNull(o.value)){ + if(BI.isNotNull(o.value)) { value = this._digest(o.value); } this.trigger = BI.createWidget({ @@ -37675,13 +37675,19 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { }); this.combo.on(BI.DownListCombo.EVENT_CHANGE, function () { - self.setValue(self.combo.getValue()[0].value); - self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE); + var currentVal = self.combo.getValue()[0].value; + if (currentVal !== self.value) { + self.setValue(currentVal); + self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE); + } }); this.combo.on(BI.DownListCombo.EVENT_SON_VALUE_CHANGE, function () { - self.setValue(self.combo.getValue()[0].childValue); - self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE); + var currentVal = self.combo.getValue()[0].childValue; + if (currentVal !== self.value) { + self.setValue(currentVal); + self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE); + } }); }, @@ -37700,6 +37706,7 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { }, _digest: function (v) { + this.value = v; return this.valueMap[v]; }, @@ -41189,7 +41196,7 @@ BI.LevelTree = BI.inherit(BI.Widget, { node.id = BI.UUID(); } extend.pNode = pNode; - if (node.isParent === true || BI.isNotEmptyArray(node.children)) { + if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) { extend.type = "bi.mid_plus_group_node"; if (i === nodes.length - 1) { extend.type = "bi.last_plus_group_node"; @@ -48521,7 +48528,7 @@ BI.MultiLayerSelectLevelTree = BI.inherit(BI.Widget, { node.id = BI.UUID(); } extend.pNode = pNode; - if (node.isParent === true || BI.isNotEmptyArray(node.children)) { + if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) { extend.type = "bi.multilayer_select_tree_mid_plus_group_node"; if (i === nodes.length - 1) { extend.type = "bi.multilayer_select_tree_last_plus_group_node"; @@ -49212,7 +49219,7 @@ BI.MultiLayerSingleLevelTree = BI.inherit(BI.Widget, { node.id = BI.UUID(); } extend.pNode = pNode; - if (node.isParent === true || BI.isNotEmptyArray(node.children)) { + if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) { extend.type = "bi.multilayer_single_tree_mid_plus_group_node"; if (i === nodes.length - 1) { extend.type = "bi.multilayer_single_tree_last_plus_group_node"; @@ -57827,7 +57834,7 @@ BI.SelectTreePopup = BI.inherit(BI.Pane, { var extend = {layer: layer}; node.id = node.id || BI.UUID(); extend.pNode = pNode; - if (node.isParent === true || BI.isNotEmptyArray(node.children)) { + if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) { extend.type = "bi.select_tree_mid_plus_group_node"; if (i === nodes.length - 1) { extend.type = "bi.select_tree_last_plus_group_node"; diff --git a/dist/widget.js b/dist/widget.js index b9997e2b4..f51826e97 100644 --- a/dist/widget.js +++ b/dist/widget.js @@ -6713,7 +6713,7 @@ BI.MultiLayerSelectLevelTree = BI.inherit(BI.Widget, { node.id = BI.UUID(); } extend.pNode = pNode; - if (node.isParent === true || BI.isNotEmptyArray(node.children)) { + if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) { extend.type = "bi.multilayer_select_tree_mid_plus_group_node"; if (i === nodes.length - 1) { extend.type = "bi.multilayer_select_tree_last_plus_group_node"; @@ -7404,7 +7404,7 @@ BI.MultiLayerSingleLevelTree = BI.inherit(BI.Widget, { node.id = BI.UUID(); } extend.pNode = pNode; - if (node.isParent === true || BI.isNotEmptyArray(node.children)) { + if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) { extend.type = "bi.multilayer_single_tree_mid_plus_group_node"; if (i === nodes.length - 1) { extend.type = "bi.multilayer_single_tree_last_plus_group_node"; @@ -16019,7 +16019,7 @@ BI.SelectTreePopup = BI.inherit(BI.Pane, { var extend = {layer: layer}; node.id = node.id || BI.UUID(); extend.pNode = pNode; - if (node.isParent === true || BI.isNotEmptyArray(node.children)) { + if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) { extend.type = "bi.select_tree_mid_plus_group_node"; if (i === nodes.length - 1) { extend.type = "bi.select_tree_last_plus_group_node"; diff --git a/src/case/combo/textvaluedownlistcombo/combo.textvaluedownlist.js b/src/case/combo/textvaluedownlistcombo/combo.textvaluedownlist.js index f075a3ec9..734395889 100644 --- a/src/case/combo/textvaluedownlistcombo/combo.textvaluedownlist.js +++ b/src/case/combo/textvaluedownlistcombo/combo.textvaluedownlist.js @@ -20,7 +20,7 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { this._createValueMap(); var value; - if(BI.isNotNull(o.value)){ + if(BI.isNotNull(o.value)) { value = this._digest(o.value); } this.trigger = BI.createWidget({ @@ -44,13 +44,19 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { }); this.combo.on(BI.DownListCombo.EVENT_CHANGE, function () { - self.setValue(self.combo.getValue()[0].value); - self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE); + var currentVal = self.combo.getValue()[0].value; + if (currentVal !== self.value) { + self.setValue(currentVal); + self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE); + } }); this.combo.on(BI.DownListCombo.EVENT_SON_VALUE_CHANGE, function () { - self.setValue(self.combo.getValue()[0].childValue); - self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE); + var currentVal = self.combo.getValue()[0].childValue; + if (currentVal !== self.value) { + self.setValue(currentVal); + self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE); + } }); }, @@ -69,6 +75,7 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { }, _digest: function (v) { + this.value = v; return this.valueMap[v]; }, diff --git a/src/case/tree/tree.level.js b/src/case/tree/tree.level.js index 1600a0d71..193ce0e7a 100644 --- a/src/case/tree/tree.level.js +++ b/src/case/tree/tree.level.js @@ -31,7 +31,7 @@ BI.LevelTree = BI.inherit(BI.Widget, { node.id = BI.UUID(); } extend.pNode = pNode; - if (node.isParent === true || BI.isNotEmptyArray(node.children)) { + if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) { extend.type = "bi.mid_plus_group_node"; if (i === nodes.length - 1) { extend.type = "bi.last_plus_group_node"; diff --git a/src/case/tree/ztree/tree.display.js b/src/case/tree/ztree/tree.display.js index 002ede97d..b54a1c0d9 100644 --- a/src/case/tree/ztree/tree.display.js +++ b/src/case/tree/ztree/tree.display.js @@ -38,7 +38,7 @@ BI.DisplayTree = BI.inherit(BI.TreeView, { } }; - function beforeCollapse (treeId, treeNode) { + function beforeCollapse(treeId, treeNode) { return false; } @@ -49,6 +49,7 @@ BI.DisplayTree = BI.inherit(BI.TreeView, { nodes = BI.DisplayTree.superclass._dealWidthNodes.apply(this, arguments); var self = this, o = this.options; BI.each(nodes, function (i, node) { + node.isParent = node.isParent || node.parent; if (node.text == null) { if (node.count > 0) { node.text = node.value + "(" + BI.i18nText("BI-Basic_Altogether") + node.count + BI.i18nText("BI-Basic_Count") + ")"; diff --git a/src/widget/multilayerselecttree/multilayerselecttree.leveltree.js b/src/widget/multilayerselecttree/multilayerselecttree.leveltree.js index 5f072737e..48ba3ce1d 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.leveltree.js +++ b/src/widget/multilayerselecttree/multilayerselecttree.leveltree.js @@ -30,7 +30,7 @@ BI.MultiLayerSelectLevelTree = BI.inherit(BI.Widget, { node.id = BI.UUID(); } extend.pNode = pNode; - if (node.isParent === true || BI.isNotEmptyArray(node.children)) { + if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) { extend.type = "bi.multilayer_select_tree_mid_plus_group_node"; if (i === nodes.length - 1) { extend.type = "bi.multilayer_select_tree_last_plus_group_node"; diff --git a/src/widget/multilayersingletree/multilayersingletree.leveltree.js b/src/widget/multilayersingletree/multilayersingletree.leveltree.js index 76086042b..220af07b0 100644 --- a/src/widget/multilayersingletree/multilayersingletree.leveltree.js +++ b/src/widget/multilayersingletree/multilayersingletree.leveltree.js @@ -30,7 +30,7 @@ BI.MultiLayerSingleLevelTree = BI.inherit(BI.Widget, { node.id = BI.UUID(); } extend.pNode = pNode; - if (node.isParent === true || BI.isNotEmptyArray(node.children)) { + if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) { extend.type = "bi.multilayer_single_tree_mid_plus_group_node"; if (i === nodes.length - 1) { extend.type = "bi.multilayer_single_tree_last_plus_group_node"; diff --git a/src/widget/selecttree/selecttree.popup.js b/src/widget/selecttree/selecttree.popup.js index b190686d6..f2aeea428 100644 --- a/src/widget/selecttree/selecttree.popup.js +++ b/src/widget/selecttree/selecttree.popup.js @@ -20,7 +20,7 @@ BI.SelectTreePopup = BI.inherit(BI.Pane, { var extend = {layer: layer}; node.id = node.id || BI.UUID(); extend.pNode = pNode; - if (node.isParent === true || BI.isNotEmptyArray(node.children)) { + if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) { extend.type = "bi.select_tree_mid_plus_group_node"; if (i === nodes.length - 1) { extend.type = "bi.select_tree_last_plus_group_node";