From d6a8f30e2e92152488dc1a25de3b153fc18ebc77 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Wed, 24 Jan 2018 09:45:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89relationview=E4=B8=AD?= =?UTF-8?q?=E5=85=B3=E4=BA=8Epreview,doredmark=E7=9A=84=E5=85=AC=E5=85=B1?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E4=BB=A5=E5=8F=8A=E5=8A=9F=E8=83=BD=E6=80=A7?= =?UTF-8?q?=E7=9A=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../widget/relationview/demo.relationview.js | 41 ++++++----- dist/bundle.css | 6 -- dist/bundle.js | 73 +++---------------- dist/demo.js | 41 ++++++----- dist/fineui.css | 6 -- dist/fineui.js | 73 +++---------------- dist/widget.css | 6 -- dist/widget.js | 73 +++---------------- src/css/widget/relationview/relationview.css | 3 - .../relationview/relationview.region.css | 3 - .../relationview/relationview.region.less | 3 - src/widget/relationview/relationview.js | 43 +---------- .../relationview.region.container.js | 11 +-- .../relationview/relationview.region.js | 19 ++--- 14 files changed, 92 insertions(+), 309 deletions(-) diff --git a/demo/js/widget/relationview/demo.relationview.js b/demo/js/widget/relationview/demo.relationview.js index 61af7cf74..f50b66449 100644 --- a/demo/js/widget/relationview/demo.relationview.js +++ b/demo/js/widget/relationview/demo.relationview.js @@ -21,39 +21,47 @@ Demo.RelationView = BI.inherit(BI.Widget, { //disabled: true, handler: function () { alert("d"); - } + }, + keyword: "A", + isView: true }, - foreign: {region: "C", text: ["try", "try1"], value: "c1"} + foreign: {region: "C", text: ["try", "try1"], value: "c1", keyword: "A"} }, { - primary: {region: "A", value: "a1", text: "a1字段"}, - foreign: {region: "C", value: "c2", text: "c2字段"} + primary: {region: "A", value: "a1", text: "a1字段", keyword: "A"}, + foreign: {region: "C", value: "c2", text: "c2字段", keyword: "A"} }, { - primary: {region: "C", value: "c3", text: "c3字段"}, - foreign: {region: "D", value: "d1", text: "d1字段"} + primary: {region: "C", value: "c3", text: "c3字段", keyword: "A"}, + foreign: {region: "D", value: "d1", text: "d1字段", keyword: "A"} }, { - primary: {region: "A", value: "a1", text: "a1字段"}, - foreign: {region: "B", value: "b1", text: "b1字段"} + primary: {region: "A", value: "a1", text: "a1字段", keyword: "A"}, + foreign: {region: "B", value: "b1", text: "b1字段", keyword: "A"} }, { - primary: {region: "X", value: "x1", text: "x1字段"}, - foreign: {region: "Y", value: "y1", text: "y1字段"} + primary: {region: "X", value: "x1", text: "x1字段", keyword: "A"}, + foreign: {region: "Y", value: "y1", text: "y1字段", keyword: "A"} }, { - primary: {region: "X", value: "x2", text: "x2字段"}, - foreign: {region: "Z", value: "z1", text: "z1字段"} + primary: {region: "X", value: "x2", text: "x2字段", keyword: "A"}, + foreign: {region: "Z", value: "z1", text: "z1字段", keyword: "A"} }, { - primary: {region: "X", value: "x2", text: "x2字段"}, - foreign: {region: "B", value: "b1", text: "b1字段"} + primary: {region: "X", value: "x2", text: "x2字段", keyword: "A"}, + foreign: {region: "B", value: "b1", text: "b1字段", keyword: "A"} }, { - primary: {region: "X33"} + primary: {region: "X33", keyword: "A"} + } + ], + listeners: [{ + eventName: "EVENT_PREVIEW", + action: function (tableName, show) { + console.log(tableName + ": " + show); } - ] + }] }); return { type: "bi.float_center_adapt", @@ -63,7 +71,6 @@ Demo.RelationView = BI.inherit(BI.Widget, { }; }, mounted: function () { - this.relationview.doRedMark("A") } }); BI.shortcut("demo.relation_view", Demo.RelationView); \ No newline at end of file diff --git a/dist/bundle.css b/dist/bundle.css index 12dab8452..897ed3c0a 100644 --- a/dist/bundle.css +++ b/dist/bundle.css @@ -4489,9 +4489,6 @@ ul.ztree.zTreeDragUL { -moz-border-radius: 2px; border-radius: 2px; } -.bi-relation-view-region .relation-view-region-container.other-package { - border-style: dashed; -} .bi-relation-view-region .relation-view-region-container .relation-view-region-title .eye { font-size: 16px; } @@ -4507,9 +4504,6 @@ ul.ztree.zTreeDragUL { -moz-border-radius: 2px; border-radius: 2px; } -.bi-relation-view-region .relation-view-region-container.other-package { - border-style: dashed; -} .bi-relation-view-region .relation-view-region-container .relation-view-region-title .eye { font-size: 16px; } diff --git a/dist/bundle.js b/dist/bundle.js index edafe8f2c..c08c25746 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -91573,41 +91573,6 @@ BI.RelationView = BI.inherit(BI.Widget, { }); }, - previewRelationTables: function (relationTables, show) { - if (!show) { - BI.each(this.storeViews, function (i, view) { - view.toggleRegion(true); - view.setPreviewSelected(false); - }); - BI.each(this.lines, function (i, lines) { - BI.each(lines, function (j, line) { - line.show(); - }); - }); - return; - } - BI.each(this.storeViews, function (id, view) { - if (!relationTables.contains(id)) { - view.toggleRegion(false); - } else { - view.setPreviewSelected(true); - } - }); - BI.each(this.lines, function (id, lines) { - BI.each(lines, function (cId, line) { - if (!relationTables.contains(id) || !relationTables.contains(cId)) { - line.hide(); - } - }); - }); - }, - - doRedMark: function (keyword) { - BI.each(this.storeViews, function (idx, view) { - view.doRedMark(keyword); - }); - }, - populate: function (items) { var self = this, o = this.options, c = this._const; o.items = items || []; @@ -91672,13 +91637,11 @@ BI.RelationView = BI.inherit(BI.Widget, { header: items[0].regionTitle, text: items.length > 0 ? items[0].regionText : "", handler: items.length > 0 ? items[0].regionHandler : BI.emptyFn, + isView: items[0].isView, + keyword: items[0].keyword, items: items, - disabled: items[0].disabled, - belongPackage: items.length > 0 ? items[0].belongPackage : true + disabled: items[0].disabled }); - if (BI.isNotNull(items[0]) && BI.isNotNull(items[0].keyword)) { - views[i][j].doRedMark(items[0].keyword); - } views[i][j].on(BI.RelationViewRegionContainer.EVENT_HOVER_IN, function (v) { self._hoverIn(v); }); @@ -91846,7 +91809,8 @@ BI.RelationViewRegionContainer = BI.inherit(BI.Widget, { handler: o.handler, disabled: o.disabled, items: o.items, - belongPackage: o.belongPackage + isView: o.isView, + keyword: o.keyword }); this.region.on(BI.RelationViewRegion.EVENT_PREVIEW, function (v) { self.fireEvent(BI.RelationViewRegionContainer.EVENT_PREVIEW, v); @@ -91866,14 +91830,6 @@ BI.RelationViewRegionContainer = BI.inherit(BI.Widget, { }); }, - doRedMark: function () { - this.region.doRedMark.apply(this.region, arguments); - }, - - unRedMark: function () { - this.region.unRedMark.apply(this.region, arguments); - }, - getWidth: function () { return this.region.getWidth(); }, @@ -91934,8 +91890,7 @@ BI.RelationViewRegion = BI.inherit(BI.BasicButton, { text: "", value: "", header: "", - items: [], - belongPackage: true + items: [] }); }, @@ -91948,7 +91903,8 @@ BI.RelationViewRegion = BI.inherit(BI.BasicButton, { cls: "eye relation-table-preview-font", width: 36, height: 24, - stopPropagation: true + stopPropagation: true, + selected: o.isView }); this.preview.on(BI.IconButton.EVENT_CHANGE, function () { self.fireEvent(BI.RelationViewRegion.EVENT_PREVIEW, this.isSelected()); @@ -91961,7 +91917,8 @@ BI.RelationViewRegion = BI.inherit(BI.BasicButton, { text: o.text, value: o.value, textAlign: "left", - disabled: o.disabled + disabled: o.disabled, + keyword: o.keyword }); // title放body上 if (BI.isKey(o.header)) { @@ -91983,7 +91940,7 @@ BI.RelationViewRegion = BI.inherit(BI.BasicButton, { element: this, items: [{ type: "bi.vertical", - cls: "relation-view-region-container bi-card bi-border " + (o.belongPackage ? "" : "other-package"), + cls: "relation-view-region-container bi-card bi-border", items: [{ type: "bi.vertical_adapt", cls: "relation-view-region-title bi-border-bottom bi-background", @@ -92015,14 +91972,6 @@ BI.RelationViewRegion = BI.inherit(BI.BasicButton, { }); }, - doRedMark: function () { - this.title.doRedMark.apply(this.title, arguments); - }, - - unRedMark: function () { - this.title.unRedMark.apply(this.title, arguments); - }, - getWidth: function () { return this.options.width; }, diff --git a/dist/demo.js b/dist/demo.js index 048b8d012..f311410eb 100644 --- a/dist/demo.js +++ b/dist/demo.js @@ -13202,39 +13202,47 @@ Demo.RelationView = BI.inherit(BI.Widget, { //disabled: true, handler: function () { alert("d"); - } + }, + keyword: "A", + isView: true }, - foreign: {region: "C", text: ["try", "try1"], value: "c1"} + foreign: {region: "C", text: ["try", "try1"], value: "c1", keyword: "A"} }, { - primary: {region: "A", value: "a1", text: "a1字段"}, - foreign: {region: "C", value: "c2", text: "c2字段"} + primary: {region: "A", value: "a1", text: "a1字段", keyword: "A"}, + foreign: {region: "C", value: "c2", text: "c2字段", keyword: "A"} }, { - primary: {region: "C", value: "c3", text: "c3字段"}, - foreign: {region: "D", value: "d1", text: "d1字段"} + primary: {region: "C", value: "c3", text: "c3字段", keyword: "A"}, + foreign: {region: "D", value: "d1", text: "d1字段", keyword: "A"} }, { - primary: {region: "A", value: "a1", text: "a1字段"}, - foreign: {region: "B", value: "b1", text: "b1字段"} + primary: {region: "A", value: "a1", text: "a1字段", keyword: "A"}, + foreign: {region: "B", value: "b1", text: "b1字段", keyword: "A"} }, { - primary: {region: "X", value: "x1", text: "x1字段"}, - foreign: {region: "Y", value: "y1", text: "y1字段"} + primary: {region: "X", value: "x1", text: "x1字段", keyword: "A"}, + foreign: {region: "Y", value: "y1", text: "y1字段", keyword: "A"} }, { - primary: {region: "X", value: "x2", text: "x2字段"}, - foreign: {region: "Z", value: "z1", text: "z1字段"} + primary: {region: "X", value: "x2", text: "x2字段", keyword: "A"}, + foreign: {region: "Z", value: "z1", text: "z1字段", keyword: "A"} }, { - primary: {region: "X", value: "x2", text: "x2字段"}, - foreign: {region: "B", value: "b1", text: "b1字段"} + primary: {region: "X", value: "x2", text: "x2字段", keyword: "A"}, + foreign: {region: "B", value: "b1", text: "b1字段", keyword: "A"} }, { - primary: {region: "X33"} + primary: {region: "X33", keyword: "A"} } - ] + ], + listeners: [{ + eventName: "EVENT_PREVIEW", + action: function (tableName, show) { + console.log(tableName + ": " + show); + } + }] }); return { type: "bi.float_center_adapt", @@ -13244,7 +13252,6 @@ Demo.RelationView = BI.inherit(BI.Widget, { }; }, mounted: function () { - this.relationview.doRedMark("A") } }); BI.shortcut("demo.relation_view", Demo.RelationView);/** diff --git a/dist/fineui.css b/dist/fineui.css index 1932eee4f..0ad837635 100644 --- a/dist/fineui.css +++ b/dist/fineui.css @@ -4489,9 +4489,6 @@ ul.ztree.zTreeDragUL { -moz-border-radius: 2px; border-radius: 2px; } -.bi-relation-view-region .relation-view-region-container.other-package { - border-style: dashed; -} .bi-relation-view-region .relation-view-region-container .relation-view-region-title .eye { font-size: 16px; } @@ -4507,9 +4504,6 @@ ul.ztree.zTreeDragUL { -moz-border-radius: 2px; border-radius: 2px; } -.bi-relation-view-region .relation-view-region-container.other-package { - border-style: dashed; -} .bi-relation-view-region .relation-view-region-container .relation-view-region-title .eye { font-size: 16px; } diff --git a/dist/fineui.js b/dist/fineui.js index 996ed9a14..57dc00e38 100644 --- a/dist/fineui.js +++ b/dist/fineui.js @@ -93327,41 +93327,6 @@ BI.RelationView = BI.inherit(BI.Widget, { }); }, - previewRelationTables: function (relationTables, show) { - if (!show) { - BI.each(this.storeViews, function (i, view) { - view.toggleRegion(true); - view.setPreviewSelected(false); - }); - BI.each(this.lines, function (i, lines) { - BI.each(lines, function (j, line) { - line.show(); - }); - }); - return; - } - BI.each(this.storeViews, function (id, view) { - if (!relationTables.contains(id)) { - view.toggleRegion(false); - } else { - view.setPreviewSelected(true); - } - }); - BI.each(this.lines, function (id, lines) { - BI.each(lines, function (cId, line) { - if (!relationTables.contains(id) || !relationTables.contains(cId)) { - line.hide(); - } - }); - }); - }, - - doRedMark: function (keyword) { - BI.each(this.storeViews, function (idx, view) { - view.doRedMark(keyword); - }); - }, - populate: function (items) { var self = this, o = this.options, c = this._const; o.items = items || []; @@ -93426,13 +93391,11 @@ BI.RelationView = BI.inherit(BI.Widget, { header: items[0].regionTitle, text: items.length > 0 ? items[0].regionText : "", handler: items.length > 0 ? items[0].regionHandler : BI.emptyFn, + isView: items[0].isView, + keyword: items[0].keyword, items: items, - disabled: items[0].disabled, - belongPackage: items.length > 0 ? items[0].belongPackage : true + disabled: items[0].disabled }); - if (BI.isNotNull(items[0]) && BI.isNotNull(items[0].keyword)) { - views[i][j].doRedMark(items[0].keyword); - } views[i][j].on(BI.RelationViewRegionContainer.EVENT_HOVER_IN, function (v) { self._hoverIn(v); }); @@ -93600,7 +93563,8 @@ BI.RelationViewRegionContainer = BI.inherit(BI.Widget, { handler: o.handler, disabled: o.disabled, items: o.items, - belongPackage: o.belongPackage + isView: o.isView, + keyword: o.keyword }); this.region.on(BI.RelationViewRegion.EVENT_PREVIEW, function (v) { self.fireEvent(BI.RelationViewRegionContainer.EVENT_PREVIEW, v); @@ -93620,14 +93584,6 @@ BI.RelationViewRegionContainer = BI.inherit(BI.Widget, { }); }, - doRedMark: function () { - this.region.doRedMark.apply(this.region, arguments); - }, - - unRedMark: function () { - this.region.unRedMark.apply(this.region, arguments); - }, - getWidth: function () { return this.region.getWidth(); }, @@ -93688,8 +93644,7 @@ BI.RelationViewRegion = BI.inherit(BI.BasicButton, { text: "", value: "", header: "", - items: [], - belongPackage: true + items: [] }); }, @@ -93702,7 +93657,8 @@ BI.RelationViewRegion = BI.inherit(BI.BasicButton, { cls: "eye relation-table-preview-font", width: 36, height: 24, - stopPropagation: true + stopPropagation: true, + selected: o.isView }); this.preview.on(BI.IconButton.EVENT_CHANGE, function () { self.fireEvent(BI.RelationViewRegion.EVENT_PREVIEW, this.isSelected()); @@ -93715,7 +93671,8 @@ BI.RelationViewRegion = BI.inherit(BI.BasicButton, { text: o.text, value: o.value, textAlign: "left", - disabled: o.disabled + disabled: o.disabled, + keyword: o.keyword }); // title放body上 if (BI.isKey(o.header)) { @@ -93737,7 +93694,7 @@ BI.RelationViewRegion = BI.inherit(BI.BasicButton, { element: this, items: [{ type: "bi.vertical", - cls: "relation-view-region-container bi-card bi-border " + (o.belongPackage ? "" : "other-package"), + cls: "relation-view-region-container bi-card bi-border", items: [{ type: "bi.vertical_adapt", cls: "relation-view-region-title bi-border-bottom bi-background", @@ -93769,14 +93726,6 @@ BI.RelationViewRegion = BI.inherit(BI.BasicButton, { }); }, - doRedMark: function () { - this.title.doRedMark.apply(this.title, arguments); - }, - - unRedMark: function () { - this.title.unRedMark.apply(this.title, arguments); - }, - getWidth: function () { return this.options.width; }, diff --git a/dist/widget.css b/dist/widget.css index 0c7883eac..bcf02d1d6 100644 --- a/dist/widget.css +++ b/dist/widget.css @@ -389,9 +389,6 @@ -moz-border-radius: 2px; border-radius: 2px; } -.bi-relation-view-region .relation-view-region-container.other-package { - border-style: dashed; -} .bi-relation-view-region .relation-view-region-container .relation-view-region-title .eye { font-size: 16px; } @@ -407,9 +404,6 @@ -moz-border-radius: 2px; border-radius: 2px; } -.bi-relation-view-region .relation-view-region-container.other-package { - border-style: dashed; -} .bi-relation-view-region .relation-view-region-container .relation-view-region-title .eye { font-size: 16px; } diff --git a/dist/widget.js b/dist/widget.js index 0957b6673..b12a5db28 100644 --- a/dist/widget.js +++ b/dist/widget.js @@ -15061,41 +15061,6 @@ BI.RelationView = BI.inherit(BI.Widget, { }); }, - previewRelationTables: function (relationTables, show) { - if (!show) { - BI.each(this.storeViews, function (i, view) { - view.toggleRegion(true); - view.setPreviewSelected(false); - }); - BI.each(this.lines, function (i, lines) { - BI.each(lines, function (j, line) { - line.show(); - }); - }); - return; - } - BI.each(this.storeViews, function (id, view) { - if (!relationTables.contains(id)) { - view.toggleRegion(false); - } else { - view.setPreviewSelected(true); - } - }); - BI.each(this.lines, function (id, lines) { - BI.each(lines, function (cId, line) { - if (!relationTables.contains(id) || !relationTables.contains(cId)) { - line.hide(); - } - }); - }); - }, - - doRedMark: function (keyword) { - BI.each(this.storeViews, function (idx, view) { - view.doRedMark(keyword); - }); - }, - populate: function (items) { var self = this, o = this.options, c = this._const; o.items = items || []; @@ -15160,13 +15125,11 @@ BI.RelationView = BI.inherit(BI.Widget, { header: items[0].regionTitle, text: items.length > 0 ? items[0].regionText : "", handler: items.length > 0 ? items[0].regionHandler : BI.emptyFn, + isView: items[0].isView, + keyword: items[0].keyword, items: items, - disabled: items[0].disabled, - belongPackage: items.length > 0 ? items[0].belongPackage : true + disabled: items[0].disabled }); - if (BI.isNotNull(items[0]) && BI.isNotNull(items[0].keyword)) { - views[i][j].doRedMark(items[0].keyword); - } views[i][j].on(BI.RelationViewRegionContainer.EVENT_HOVER_IN, function (v) { self._hoverIn(v); }); @@ -15334,7 +15297,8 @@ BI.RelationViewRegionContainer = BI.inherit(BI.Widget, { handler: o.handler, disabled: o.disabled, items: o.items, - belongPackage: o.belongPackage + isView: o.isView, + keyword: o.keyword }); this.region.on(BI.RelationViewRegion.EVENT_PREVIEW, function (v) { self.fireEvent(BI.RelationViewRegionContainer.EVENT_PREVIEW, v); @@ -15354,14 +15318,6 @@ BI.RelationViewRegionContainer = BI.inherit(BI.Widget, { }); }, - doRedMark: function () { - this.region.doRedMark.apply(this.region, arguments); - }, - - unRedMark: function () { - this.region.unRedMark.apply(this.region, arguments); - }, - getWidth: function () { return this.region.getWidth(); }, @@ -15422,8 +15378,7 @@ BI.RelationViewRegion = BI.inherit(BI.BasicButton, { text: "", value: "", header: "", - items: [], - belongPackage: true + items: [] }); }, @@ -15436,7 +15391,8 @@ BI.RelationViewRegion = BI.inherit(BI.BasicButton, { cls: "eye relation-table-preview-font", width: 36, height: 24, - stopPropagation: true + stopPropagation: true, + selected: o.isView }); this.preview.on(BI.IconButton.EVENT_CHANGE, function () { self.fireEvent(BI.RelationViewRegion.EVENT_PREVIEW, this.isSelected()); @@ -15449,7 +15405,8 @@ BI.RelationViewRegion = BI.inherit(BI.BasicButton, { text: o.text, value: o.value, textAlign: "left", - disabled: o.disabled + disabled: o.disabled, + keyword: o.keyword }); // title放body上 if (BI.isKey(o.header)) { @@ -15471,7 +15428,7 @@ BI.RelationViewRegion = BI.inherit(BI.BasicButton, { element: this, items: [{ type: "bi.vertical", - cls: "relation-view-region-container bi-card bi-border " + (o.belongPackage ? "" : "other-package"), + cls: "relation-view-region-container bi-card bi-border", items: [{ type: "bi.vertical_adapt", cls: "relation-view-region-title bi-border-bottom bi-background", @@ -15503,14 +15460,6 @@ BI.RelationViewRegion = BI.inherit(BI.BasicButton, { }); }, - doRedMark: function () { - this.title.doRedMark.apply(this.title, arguments); - }, - - unRedMark: function () { - this.title.unRedMark.apply(this.title, arguments); - }, - getWidth: function () { return this.options.width; }, diff --git a/src/css/widget/relationview/relationview.css b/src/css/widget/relationview/relationview.css index be0232d27..546f6ea34 100644 --- a/src/css/widget/relationview/relationview.css +++ b/src/css/widget/relationview/relationview.css @@ -8,9 +8,6 @@ -moz-border-radius: 2px; border-radius: 2px; } -.bi-relation-view-region .relation-view-region-container.other-package { - border-style: dashed; -} .bi-relation-view-region .relation-view-region-container .relation-view-region-title .eye { font-size: 16px; } diff --git a/src/css/widget/relationview/relationview.region.css b/src/css/widget/relationview/relationview.region.css index fe150f562..4fe0d5476 100644 --- a/src/css/widget/relationview/relationview.region.css +++ b/src/css/widget/relationview/relationview.region.css @@ -4,9 +4,6 @@ -moz-border-radius: 2px; border-radius: 2px; } -.bi-relation-view-region .relation-view-region-container.other-package { - border-style: dashed; -} .bi-relation-view-region .relation-view-region-container .relation-view-region-title .eye { font-size: 16px; } diff --git a/src/less/widget/relationview/relationview.region.less b/src/less/widget/relationview/relationview.region.less index 82082265a..f4cf9617d 100644 --- a/src/less/widget/relationview/relationview.region.less +++ b/src/less/widget/relationview/relationview.region.less @@ -2,9 +2,6 @@ .bi-relation-view-region { & .relation-view-region-container { - &.other-package { - border-style: dashed; - } z-index: 1; .border-radius(2px); & .relation-view-region-title { diff --git a/src/widget/relationview/relationview.js b/src/widget/relationview/relationview.js index b6b80fdbe..2835cea49 100644 --- a/src/widget/relationview/relationview.js +++ b/src/widget/relationview/relationview.js @@ -73,41 +73,6 @@ BI.RelationView = BI.inherit(BI.Widget, { }); }, - previewRelationTables: function (relationTables, show) { - if (!show) { - BI.each(this.storeViews, function (i, view) { - view.toggleRegion(true); - view.setPreviewSelected(false); - }); - BI.each(this.lines, function (i, lines) { - BI.each(lines, function (j, line) { - line.show(); - }); - }); - return; - } - BI.each(this.storeViews, function (id, view) { - if (!relationTables.contains(id)) { - view.toggleRegion(false); - } else { - view.setPreviewSelected(true); - } - }); - BI.each(this.lines, function (id, lines) { - BI.each(lines, function (cId, line) { - if (!relationTables.contains(id) || !relationTables.contains(cId)) { - line.hide(); - } - }); - }); - }, - - doRedMark: function (keyword) { - BI.each(this.storeViews, function (idx, view) { - view.doRedMark(keyword); - }); - }, - populate: function (items) { var self = this, o = this.options, c = this._const; o.items = items || []; @@ -172,13 +137,11 @@ BI.RelationView = BI.inherit(BI.Widget, { header: items[0].regionTitle, text: items.length > 0 ? items[0].regionText : "", handler: items.length > 0 ? items[0].regionHandler : BI.emptyFn, + isView: items[0].isView, + keyword: items[0].keyword, items: items, - disabled: items[0].disabled, - belongPackage: items.length > 0 ? items[0].belongPackage : true + disabled: items[0].disabled }); - if (BI.isNotNull(items[0]) && BI.isNotNull(items[0].keyword)) { - views[i][j].doRedMark(items[0].keyword); - } views[i][j].on(BI.RelationViewRegionContainer.EVENT_HOVER_IN, function (v) { self._hoverIn(v); }); diff --git a/src/widget/relationview/relationview.region.container.js b/src/widget/relationview/relationview.region.container.js index 061dc83bf..7d85c1431 100644 --- a/src/widget/relationview/relationview.region.container.js +++ b/src/widget/relationview/relationview.region.container.js @@ -21,7 +21,8 @@ BI.RelationViewRegionContainer = BI.inherit(BI.Widget, { handler: o.handler, disabled: o.disabled, items: o.items, - belongPackage: o.belongPackage + isView: o.isView, + keyword: o.keyword }); this.region.on(BI.RelationViewRegion.EVENT_PREVIEW, function (v) { self.fireEvent(BI.RelationViewRegionContainer.EVENT_PREVIEW, v); @@ -41,14 +42,6 @@ BI.RelationViewRegionContainer = BI.inherit(BI.Widget, { }); }, - doRedMark: function () { - this.region.doRedMark.apply(this.region, arguments); - }, - - unRedMark: function () { - this.region.unRedMark.apply(this.region, arguments); - }, - getWidth: function () { return this.region.getWidth(); }, diff --git a/src/widget/relationview/relationview.region.js b/src/widget/relationview/relationview.region.js index ee1dbb5c1..273ca7076 100644 --- a/src/widget/relationview/relationview.region.js +++ b/src/widget/relationview/relationview.region.js @@ -14,8 +14,7 @@ BI.RelationViewRegion = BI.inherit(BI.BasicButton, { text: "", value: "", header: "", - items: [], - belongPackage: true + items: [] }); }, @@ -28,7 +27,8 @@ BI.RelationViewRegion = BI.inherit(BI.BasicButton, { cls: "eye relation-table-preview-font", width: 36, height: 24, - stopPropagation: true + stopPropagation: true, + selected: o.isView }); this.preview.on(BI.IconButton.EVENT_CHANGE, function () { self.fireEvent(BI.RelationViewRegion.EVENT_PREVIEW, this.isSelected()); @@ -41,7 +41,8 @@ BI.RelationViewRegion = BI.inherit(BI.BasicButton, { text: o.text, value: o.value, textAlign: "left", - disabled: o.disabled + disabled: o.disabled, + keyword: o.keyword }); // title放body上 if (BI.isKey(o.header)) { @@ -63,7 +64,7 @@ BI.RelationViewRegion = BI.inherit(BI.BasicButton, { element: this, items: [{ type: "bi.vertical", - cls: "relation-view-region-container bi-card bi-border " + (o.belongPackage ? "" : "other-package"), + cls: "relation-view-region-container bi-card bi-border", items: [{ type: "bi.vertical_adapt", cls: "relation-view-region-title bi-border-bottom bi-background", @@ -95,14 +96,6 @@ BI.RelationViewRegion = BI.inherit(BI.BasicButton, { }); }, - doRedMark: function () { - this.title.doRedMark.apply(this.title, arguments); - }, - - unRedMark: function () { - this.title.unRedMark.apply(this.title, arguments); - }, - getWidth: function () { return this.options.width; },