From b9642b29e5c17db2ef634d93081bcd6f524591cb Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 26 Apr 2017 14:01:30 +0800 Subject: [PATCH] add --- bi/case.js | 45 ++++++++++--------- bi/core.css | 3 -- bi/widget.js | 32 +++++++------ docs/case.js | 45 ++++++++++--------- docs/core.css | 3 -- docs/widget.js | 32 +++++++------ .../table/table.dynamicsummarylayertree.js | 23 +++++----- src/case/table/table.layertree.js | 22 ++++----- .../sequencetable/listnumber.sequencetable.js | 16 ++++--- .../sequencetable/treenumber.sequencetable.js | 16 ++++--- 10 files changed, 129 insertions(+), 108 deletions(-) diff --git a/bi/case.js b/bi/case.js index 12dde9b59c..41a27538cc 100644 --- a/bi/case.js +++ b/bi/case.js @@ -9106,6 +9106,9 @@ BI.DynamicSummaryLayerTreeTable = BI.inherit(BI.Widget, { regionColumnSize: [], + //行表头 + rowHeaderCreator: null, + headerCellStyleGetter: BI.emptyFn, summaryCellStyleGetter: BI.emptyFn, sequenceCellStyleGetter: BI.emptyFn, @@ -9142,17 +9145,17 @@ BI.DynamicSummaryLayerTreeTable = BI.inherit(BI.Widget, { var newHeader = this._formatColumns(header); var deep = this._getHDeep(); if (deep <= 0) { - newHeader.unshift({ - type: "bi.table_style_cell", - text: BI.i18nText("BI-Row_Header"), - styleGetter: o.headerCellStyleGetter - }); + newHeader.unshift(o.rowHeaderCreator || { + type: "bi.table_style_cell", + text: BI.i18nText("BI-Row_Header"), + styleGetter: o.headerCellStyleGetter + }); } else { - newHeader[0] = { - type: "bi.table_style_cell", - text: BI.i18nText("BI-Row_Header"), - styleGetter: o.headerCellStyleGetter - }; + newHeader[0] = o.rowHeaderCreator || { + type: "bi.table_style_cell", + text: BI.i18nText("BI-Row_Header"), + styleGetter: o.headerCellStyleGetter + }; } result.push(newHeader); } @@ -9796,6 +9799,8 @@ BI.LayerTreeTable = BI.inherit(BI.Widget, { regionColumnSize: [], + rowHeaderCreator: null, + headerCellStyleGetter: BI.emptyFn, summaryCellStyleGetter: BI.emptyFn, sequenceCellStyleGetter: BI.emptyFn, @@ -9831,17 +9836,17 @@ BI.LayerTreeTable = BI.inherit(BI.Widget, { var newHeader = this._formatColumns(header); var deep = this._getHDeep(); if (deep <= 0) { - newHeader.unshift({ - type: "bi.table_style_cell", - text: BI.i18nText("BI-Row_Header"), - styleGetter: o.headerCellStyleGetter - }); + newHeader.unshift(o.rowHeaderCreator || { + type: "bi.table_style_cell", + text: BI.i18nText("BI-Row_Header"), + styleGetter: o.headerCellStyleGetter + }); } else { - newHeader[0] = { - type: "bi.table_style_cell", - text: BI.i18nText("BI-Row_Header"), - styleGetter: o.headerCellStyleGetter - }; + newHeader[0] = o.rowHeaderCreator || { + type: "bi.table_style_cell", + text: BI.i18nText("BI-Row_Header"), + styleGetter: o.headerCellStyleGetter + }; } result.push(newHeader); } diff --git a/bi/core.css b/bi/core.css index 88b55286d2..9d2ea47015 100644 --- a/bi/core.css +++ b/bi/core.css @@ -3040,9 +3040,6 @@ i { .bi-keyword-red-mark { color: #f07d0a; } -.bi-white { - color: #ffffff; -} .bi-high-light { color: #3f8ce8; } diff --git a/bi/widget.js b/bi/widget.js index 64a98ef1a2..0bcb9fec08 100644 --- a/bi/widget.js +++ b/bi/widget.js @@ -15,6 +15,8 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, { headerRowSize: 25, rowSize: 25, + sequenceHeaderCreator: null, + header: [], items: [], //二维数组 @@ -33,12 +35,12 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, { this.renderedCells = []; this.renderedKeys = []; - this.header = BI.createWidget({ - type: "bi.table_style_cell", - cls: "sequence-table-title-cell bi-border", - styleGetter: o.headerCellStyleGetter, - text: BI.i18nText("BI-Number_Index") - }); + this.header = BI.createWidget(o.sequenceHeaderCreator || { + type: "bi.table_style_cell", + cls: "sequence-table-title-cell bi-border", + styleGetter: o.headerCellStyleGetter, + text: BI.i18nText("BI-Number_Index") + }); this.container = BI.createWidget({ type: "bi.absolute", width: 60, @@ -320,7 +322,7 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, { task.apply(self); }); this.tasks = []; - this.header.populate(); + this.header.populate && this.header.populate(); this._layout(); this._calculateChildrenToRender(); }, @@ -15724,6 +15726,8 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, { headerRowSize: 25, rowSize: 25, + sequenceHeaderCreator: null, + header: [], items: [], //二维数组 @@ -15742,12 +15746,12 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, { this.renderedCells = []; this.renderedKeys = []; - this.header = BI.createWidget({ - type: "bi.table_style_cell", - cls: "sequence-table-title-cell bi-border", - styleGetter: o.headerCellStyleGetter, - text: BI.i18nText("BI-Number_Index") - }); + this.header = BI.createWidget(o.sequenceHeaderCreator || { + type: "bi.table_style_cell", + cls: "sequence-table-title-cell bi-border", + styleGetter: o.headerCellStyleGetter, + text: BI.i18nText("BI-Number_Index") + }); this.container = BI.createWidget({ type: "bi.absolute", width: 60, @@ -15866,7 +15870,7 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, { }, _populate: function () { - this.header.populate(); + this.header.populate && this.header.populate(); this._layout(); this._calculateChildrenToRender(); }, diff --git a/docs/case.js b/docs/case.js index 12dde9b59c..41a27538cc 100644 --- a/docs/case.js +++ b/docs/case.js @@ -9106,6 +9106,9 @@ BI.DynamicSummaryLayerTreeTable = BI.inherit(BI.Widget, { regionColumnSize: [], + //行表头 + rowHeaderCreator: null, + headerCellStyleGetter: BI.emptyFn, summaryCellStyleGetter: BI.emptyFn, sequenceCellStyleGetter: BI.emptyFn, @@ -9142,17 +9145,17 @@ BI.DynamicSummaryLayerTreeTable = BI.inherit(BI.Widget, { var newHeader = this._formatColumns(header); var deep = this._getHDeep(); if (deep <= 0) { - newHeader.unshift({ - type: "bi.table_style_cell", - text: BI.i18nText("BI-Row_Header"), - styleGetter: o.headerCellStyleGetter - }); + newHeader.unshift(o.rowHeaderCreator || { + type: "bi.table_style_cell", + text: BI.i18nText("BI-Row_Header"), + styleGetter: o.headerCellStyleGetter + }); } else { - newHeader[0] = { - type: "bi.table_style_cell", - text: BI.i18nText("BI-Row_Header"), - styleGetter: o.headerCellStyleGetter - }; + newHeader[0] = o.rowHeaderCreator || { + type: "bi.table_style_cell", + text: BI.i18nText("BI-Row_Header"), + styleGetter: o.headerCellStyleGetter + }; } result.push(newHeader); } @@ -9796,6 +9799,8 @@ BI.LayerTreeTable = BI.inherit(BI.Widget, { regionColumnSize: [], + rowHeaderCreator: null, + headerCellStyleGetter: BI.emptyFn, summaryCellStyleGetter: BI.emptyFn, sequenceCellStyleGetter: BI.emptyFn, @@ -9831,17 +9836,17 @@ BI.LayerTreeTable = BI.inherit(BI.Widget, { var newHeader = this._formatColumns(header); var deep = this._getHDeep(); if (deep <= 0) { - newHeader.unshift({ - type: "bi.table_style_cell", - text: BI.i18nText("BI-Row_Header"), - styleGetter: o.headerCellStyleGetter - }); + newHeader.unshift(o.rowHeaderCreator || { + type: "bi.table_style_cell", + text: BI.i18nText("BI-Row_Header"), + styleGetter: o.headerCellStyleGetter + }); } else { - newHeader[0] = { - type: "bi.table_style_cell", - text: BI.i18nText("BI-Row_Header"), - styleGetter: o.headerCellStyleGetter - }; + newHeader[0] = o.rowHeaderCreator || { + type: "bi.table_style_cell", + text: BI.i18nText("BI-Row_Header"), + styleGetter: o.headerCellStyleGetter + }; } result.push(newHeader); } diff --git a/docs/core.css b/docs/core.css index 88b55286d2..9d2ea47015 100644 --- a/docs/core.css +++ b/docs/core.css @@ -3040,9 +3040,6 @@ i { .bi-keyword-red-mark { color: #f07d0a; } -.bi-white { - color: #ffffff; -} .bi-high-light { color: #3f8ce8; } diff --git a/docs/widget.js b/docs/widget.js index 64a98ef1a2..0bcb9fec08 100644 --- a/docs/widget.js +++ b/docs/widget.js @@ -15,6 +15,8 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, { headerRowSize: 25, rowSize: 25, + sequenceHeaderCreator: null, + header: [], items: [], //二维数组 @@ -33,12 +35,12 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, { this.renderedCells = []; this.renderedKeys = []; - this.header = BI.createWidget({ - type: "bi.table_style_cell", - cls: "sequence-table-title-cell bi-border", - styleGetter: o.headerCellStyleGetter, - text: BI.i18nText("BI-Number_Index") - }); + this.header = BI.createWidget(o.sequenceHeaderCreator || { + type: "bi.table_style_cell", + cls: "sequence-table-title-cell bi-border", + styleGetter: o.headerCellStyleGetter, + text: BI.i18nText("BI-Number_Index") + }); this.container = BI.createWidget({ type: "bi.absolute", width: 60, @@ -320,7 +322,7 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, { task.apply(self); }); this.tasks = []; - this.header.populate(); + this.header.populate && this.header.populate(); this._layout(); this._calculateChildrenToRender(); }, @@ -15724,6 +15726,8 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, { headerRowSize: 25, rowSize: 25, + sequenceHeaderCreator: null, + header: [], items: [], //二维数组 @@ -15742,12 +15746,12 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, { this.renderedCells = []; this.renderedKeys = []; - this.header = BI.createWidget({ - type: "bi.table_style_cell", - cls: "sequence-table-title-cell bi-border", - styleGetter: o.headerCellStyleGetter, - text: BI.i18nText("BI-Number_Index") - }); + this.header = BI.createWidget(o.sequenceHeaderCreator || { + type: "bi.table_style_cell", + cls: "sequence-table-title-cell bi-border", + styleGetter: o.headerCellStyleGetter, + text: BI.i18nText("BI-Number_Index") + }); this.container = BI.createWidget({ type: "bi.absolute", width: 60, @@ -15866,7 +15870,7 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, { }, _populate: function () { - this.header.populate(); + this.header.populate && this.header.populate(); this._layout(); this._calculateChildrenToRender(); }, diff --git a/src/case/table/table.dynamicsummarylayertree.js b/src/case/table/table.dynamicsummarylayertree.js index 79794c80a3..15e7083490 100644 --- a/src/case/table/table.dynamicsummarylayertree.js +++ b/src/case/table/table.dynamicsummarylayertree.js @@ -33,6 +33,9 @@ BI.DynamicSummaryLayerTreeTable = BI.inherit(BI.Widget, { regionColumnSize: [], + //行表头 + rowHeaderCreator: null, + headerCellStyleGetter: BI.emptyFn, summaryCellStyleGetter: BI.emptyFn, sequenceCellStyleGetter: BI.emptyFn, @@ -69,17 +72,17 @@ BI.DynamicSummaryLayerTreeTable = BI.inherit(BI.Widget, { var newHeader = this._formatColumns(header); var deep = this._getHDeep(); if (deep <= 0) { - newHeader.unshift({ - type: "bi.table_style_cell", - text: BI.i18nText("BI-Row_Header"), - styleGetter: o.headerCellStyleGetter - }); + newHeader.unshift(o.rowHeaderCreator || { + type: "bi.table_style_cell", + text: BI.i18nText("BI-Row_Header"), + styleGetter: o.headerCellStyleGetter + }); } else { - newHeader[0] = { - type: "bi.table_style_cell", - text: BI.i18nText("BI-Row_Header"), - styleGetter: o.headerCellStyleGetter - }; + newHeader[0] = o.rowHeaderCreator || { + type: "bi.table_style_cell", + text: BI.i18nText("BI-Row_Header"), + styleGetter: o.headerCellStyleGetter + }; } result.push(newHeader); } diff --git a/src/case/table/table.layertree.js b/src/case/table/table.layertree.js index 565969c5a3..568f83240a 100644 --- a/src/case/table/table.layertree.js +++ b/src/case/table/table.layertree.js @@ -33,6 +33,8 @@ BI.LayerTreeTable = BI.inherit(BI.Widget, { regionColumnSize: [], + rowHeaderCreator: null, + headerCellStyleGetter: BI.emptyFn, summaryCellStyleGetter: BI.emptyFn, sequenceCellStyleGetter: BI.emptyFn, @@ -68,17 +70,17 @@ BI.LayerTreeTable = BI.inherit(BI.Widget, { var newHeader = this._formatColumns(header); var deep = this._getHDeep(); if (deep <= 0) { - newHeader.unshift({ - type: "bi.table_style_cell", - text: BI.i18nText("BI-Row_Header"), - styleGetter: o.headerCellStyleGetter - }); + newHeader.unshift(o.rowHeaderCreator || { + type: "bi.table_style_cell", + text: BI.i18nText("BI-Row_Header"), + styleGetter: o.headerCellStyleGetter + }); } else { - newHeader[0] = { - type: "bi.table_style_cell", - text: BI.i18nText("BI-Row_Header"), - styleGetter: o.headerCellStyleGetter - }; + newHeader[0] = o.rowHeaderCreator || { + type: "bi.table_style_cell", + text: BI.i18nText("BI-Row_Header"), + styleGetter: o.headerCellStyleGetter + }; } result.push(newHeader); } diff --git a/src/widget/sequencetable/listnumber.sequencetable.js b/src/widget/sequencetable/listnumber.sequencetable.js index ea4e535476..fb8c57eb4c 100644 --- a/src/widget/sequencetable/listnumber.sequencetable.js +++ b/src/widget/sequencetable/listnumber.sequencetable.js @@ -15,6 +15,8 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, { headerRowSize: 25, rowSize: 25, + sequenceHeaderCreator: null, + header: [], items: [], //二维数组 @@ -33,12 +35,12 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, { this.renderedCells = []; this.renderedKeys = []; - this.header = BI.createWidget({ - type: "bi.table_style_cell", - cls: "sequence-table-title-cell bi-border", - styleGetter: o.headerCellStyleGetter, - text: BI.i18nText("BI-Number_Index") - }); + this.header = BI.createWidget(o.sequenceHeaderCreator || { + type: "bi.table_style_cell", + cls: "sequence-table-title-cell bi-border", + styleGetter: o.headerCellStyleGetter, + text: BI.i18nText("BI-Number_Index") + }); this.container = BI.createWidget({ type: "bi.absolute", width: 60, @@ -157,7 +159,7 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, { }, _populate: function () { - this.header.populate(); + this.header.populate && this.header.populate(); this._layout(); this._calculateChildrenToRender(); }, diff --git a/src/widget/sequencetable/treenumber.sequencetable.js b/src/widget/sequencetable/treenumber.sequencetable.js index a5800f847b..9de53c08c0 100644 --- a/src/widget/sequencetable/treenumber.sequencetable.js +++ b/src/widget/sequencetable/treenumber.sequencetable.js @@ -15,6 +15,8 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, { headerRowSize: 25, rowSize: 25, + sequenceHeaderCreator: null, + header: [], items: [], //二维数组 @@ -33,12 +35,12 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, { this.renderedCells = []; this.renderedKeys = []; - this.header = BI.createWidget({ - type: "bi.table_style_cell", - cls: "sequence-table-title-cell bi-border", - styleGetter: o.headerCellStyleGetter, - text: BI.i18nText("BI-Number_Index") - }); + this.header = BI.createWidget(o.sequenceHeaderCreator || { + type: "bi.table_style_cell", + cls: "sequence-table-title-cell bi-border", + styleGetter: o.headerCellStyleGetter, + text: BI.i18nText("BI-Number_Index") + }); this.container = BI.createWidget({ type: "bi.absolute", width: 60, @@ -320,7 +322,7 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, { task.apply(self); }); this.tasks = []; - this.header.populate(); + this.header.populate && this.header.populate(); this._layout(); this._calculateChildrenToRender(); },