Browse Source

relationView 样式

es6
windy 7 years ago
parent
commit
edd304900e
  1. 18
      dist/bundle.css
  2. 74
      dist/bundle.js
  3. 18
      dist/fineui.css
  4. 74
      dist/fineui.js
  5. 18
      dist/widget.css
  6. 74
      dist/widget.js
  7. 9
      src/css/widget/relationview/relationview.css
  8. 3
      src/css/widget/relationview/relationview.item.css
  9. 6
      src/css/widget/relationview/relationview.region.css
  10. 3
      src/less/widget/relationview/relationview.item.less
  11. 7
      src/less/widget/relationview/relationview.region.less
  12. 50
      src/widget/relationview/relationview.item.js
  13. 2
      src/widget/relationview/relationview.region.container.js
  14. 22
      src/widget/relationview/relationview.region.js

18
dist/bundle.css vendored

@ -4479,6 +4479,9 @@ ul.ztree.zTreeDragUL {
-moz-border-radius: 2px; -moz-border-radius: 2px;
border-radius: 2px; border-radius: 2px;
} }
.bi-relation-view-item .primary-key-region {
font-size: 16px;
}
.bi-relation-view-region .relation-view-region-container { .bi-relation-view-region .relation-view-region-container {
z-index: 1; z-index: 1;
@ -4489,6 +4492,15 @@ ul.ztree.zTreeDragUL {
.bi-relation-view-region .relation-view-region-container.other-package { .bi-relation-view-region .relation-view-region-container.other-package {
border-style: dashed; border-style: dashed;
} }
.bi-relation-view-region .relation-view-region-container .relation-view-region-title .eye {
font-size: 16px;
}
.bi-relation-view-region .relation-view-region-container .split-line {
border-bottom: 1px solid #cccccc;
}
.bi-relation-view-item .primary-key-region {
font-size: 16px;
}
.bi-relation-view-region .relation-view-region-container { .bi-relation-view-region .relation-view-region-container {
z-index: 1; z-index: 1;
-webkit-border-radius: 2px; -webkit-border-radius: 2px;
@ -4498,6 +4510,12 @@ ul.ztree.zTreeDragUL {
.bi-relation-view-region .relation-view-region-container.other-package { .bi-relation-view-region .relation-view-region-container.other-package {
border-style: dashed; border-style: dashed;
} }
.bi-relation-view-region .relation-view-region-container .relation-view-region-title .eye {
font-size: 16px;
}
.bi-relation-view-region .relation-view-region-container .split-line {
border-bottom: 1px solid #cccccc;
}
.bi-sequence-table-dynamic-number .sequence-table-title-cell { .bi-sequence-table-dynamic-number .sequence-table-title-cell {
overflow: hidden; overflow: hidden;
overflow-x: hidden; overflow-x: hidden;

74
dist/bundle.js vendored

@ -91449,36 +91449,34 @@ BI.RelationViewItem = BI.inherit(BI.BasicButton, {
var body = []; var body = [];
var header = { var header = {
type: "bi.vertical_adapt", type: "bi.vertical_adapt",
cls: "primary-key-font", items: [{
items: [] type: "bi.center_adapt",
cls: o.isPrimary ? "primary-key-region primary-key-font" : "",
items: [{
type: "bi.icon",
title: o.isPrimary ? BI.i18nText("BI-Primary_Key") : ""
}],
width: 36,
height: 16
}, {
type: "bi.label",
text: o.text.length > 1 ? BI.i18nText("BI-Basic_Union_Relation") : o.text[0],
value: o.value,
height: 24,
textAlign: "left"
}]
}; };
if (o.isPrimary) {
header.items.push({
type: "bi.icon",
width: 12,
height: 16,
title: BI.i18nText("BI-Primary_Key")
});
}
header.items.push({
type: "bi.label",
text: o.text.length > 1 ? BI.i18nText("BI-Basic_Union_Relation") : o.text[0],
value: o.value,
height: 25,
textAlign: "left",
width: o.isPrimary ? 70 : 90,
lgap: o.isPrimary ? 0 : 10
});
if(o.text.length > 1){ if(o.text.length > 1){
body = BI.map(o.text, function (idx, text) { body = BI.map(o.text, function (idx, text) {
return { return {
type: "bi.label", el: {
text: text, type: "bi.label",
value: o.value, text: text,
height: 25, value: o.value,
textAlign: "left", height: 24,
width: 70, textAlign: "left"
lgap: 15 },
lgap: 49
} }
}) })
} }
@ -91831,7 +91829,7 @@ BI.RelationViewRegionContainer = BI.inherit(BI.Widget, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.RelationViewRegionContainer.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.RelationViewRegionContainer.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-relation-view-region-container", baseCls: "bi-relation-view-region-container",
width: 200 width: 210
}); });
}, },
@ -91946,9 +91944,9 @@ BI.RelationViewRegion = BI.inherit(BI.BasicButton, {
this.preview = BI.createWidget({ this.preview = BI.createWidget({
type: "bi.icon_button", type: "bi.icon_button",
cls: "relation-table-preview-font", cls: "eye relation-table-preview-font",
width: 25, width: 36,
height: 25, height: 24,
stopPropagation: true stopPropagation: true
}); });
this.preview.on(BI.IconButton.EVENT_CHANGE, function () { this.preview.on(BI.IconButton.EVENT_CHANGE, function () {
@ -91957,11 +91955,12 @@ BI.RelationViewRegion = BI.inherit(BI.BasicButton, {
this.title = BI.createWidget({ this.title = BI.createWidget({
type: "bi.label", type: "bi.label",
height: 25, height: 24,
width: 70, width: 70,
text: o.text, text: o.text,
value: o.value, value: o.value,
textAlign: "left" textAlign: "left",
disabled: o.disabled
}); });
// title放body上 // title放body上
if (BI.isKey(o.header)) { if (BI.isKey(o.header)) {
@ -92001,7 +92000,8 @@ BI.RelationViewRegion = BI.inherit(BI.BasicButton, {
var texts = BI.isArray(item.text) ? item.text : [item.text]; var texts = BI.isArray(item.text) ? item.text : [item.text];
return BI.extend(item, { return BI.extend(item, {
type: "bi.relation_view_item", type: "bi.relation_view_item",
height: texts.length > 1 ? (texts.length + 1) * 25 : 25, height: texts.length > 1 ? (texts.length + 1) * 24 : 24,
cls: i === items.length - 1 ? "" : "split-line",
hoverIn: function () { hoverIn: function () {
self.setValue(item.value); self.setValue(item.value);
self.fireEvent(BI.RelationViewRegion.EVENT_HOVER_IN, item.value); self.fireEvent(BI.RelationViewRegion.EVENT_HOVER_IN, item.value);
@ -92028,10 +92028,12 @@ BI.RelationViewRegion = BI.inherit(BI.BasicButton, {
getHeight: function () { getHeight: function () {
var height = 0; var height = 0;
BI.each(this.button_group.getAllButtons(), function (idx, button) { var buttons = this.button_group.getAllButtons();
height += button.getHeight(); BI.each(buttons, function (idx, button) {
//获取item高度的时候加上边框
height += button.getHeight() + (idx === buttons.length - 1 ? 0 : 1);
}); });
return height + 25 + 2 * 20 + 3; return height + 24 + 2 * 20 + 3;
}, },
// 获取上方开始划线的位置 // 获取上方开始划线的位置

18
dist/fineui.css vendored

@ -4479,6 +4479,9 @@ ul.ztree.zTreeDragUL {
-moz-border-radius: 2px; -moz-border-radius: 2px;
border-radius: 2px; border-radius: 2px;
} }
.bi-relation-view-item .primary-key-region {
font-size: 16px;
}
.bi-relation-view-region .relation-view-region-container { .bi-relation-view-region .relation-view-region-container {
z-index: 1; z-index: 1;
@ -4489,6 +4492,15 @@ ul.ztree.zTreeDragUL {
.bi-relation-view-region .relation-view-region-container.other-package { .bi-relation-view-region .relation-view-region-container.other-package {
border-style: dashed; border-style: dashed;
} }
.bi-relation-view-region .relation-view-region-container .relation-view-region-title .eye {
font-size: 16px;
}
.bi-relation-view-region .relation-view-region-container .split-line {
border-bottom: 1px solid #cccccc;
}
.bi-relation-view-item .primary-key-region {
font-size: 16px;
}
.bi-relation-view-region .relation-view-region-container { .bi-relation-view-region .relation-view-region-container {
z-index: 1; z-index: 1;
-webkit-border-radius: 2px; -webkit-border-radius: 2px;
@ -4498,6 +4510,12 @@ ul.ztree.zTreeDragUL {
.bi-relation-view-region .relation-view-region-container.other-package { .bi-relation-view-region .relation-view-region-container.other-package {
border-style: dashed; border-style: dashed;
} }
.bi-relation-view-region .relation-view-region-container .relation-view-region-title .eye {
font-size: 16px;
}
.bi-relation-view-region .relation-view-region-container .split-line {
border-bottom: 1px solid #cccccc;
}
.bi-sequence-table-dynamic-number .sequence-table-title-cell { .bi-sequence-table-dynamic-number .sequence-table-title-cell {
overflow: hidden; overflow: hidden;
overflow-x: hidden; overflow-x: hidden;

74
dist/fineui.js vendored

@ -93203,36 +93203,34 @@ BI.RelationViewItem = BI.inherit(BI.BasicButton, {
var body = []; var body = [];
var header = { var header = {
type: "bi.vertical_adapt", type: "bi.vertical_adapt",
cls: "primary-key-font", items: [{
items: [] type: "bi.center_adapt",
cls: o.isPrimary ? "primary-key-region primary-key-font" : "",
items: [{
type: "bi.icon",
title: o.isPrimary ? BI.i18nText("BI-Primary_Key") : ""
}],
width: 36,
height: 16
}, {
type: "bi.label",
text: o.text.length > 1 ? BI.i18nText("BI-Basic_Union_Relation") : o.text[0],
value: o.value,
height: 24,
textAlign: "left"
}]
}; };
if (o.isPrimary) {
header.items.push({
type: "bi.icon",
width: 12,
height: 16,
title: BI.i18nText("BI-Primary_Key")
});
}
header.items.push({
type: "bi.label",
text: o.text.length > 1 ? BI.i18nText("BI-Basic_Union_Relation") : o.text[0],
value: o.value,
height: 25,
textAlign: "left",
width: o.isPrimary ? 70 : 90,
lgap: o.isPrimary ? 0 : 10
});
if(o.text.length > 1){ if(o.text.length > 1){
body = BI.map(o.text, function (idx, text) { body = BI.map(o.text, function (idx, text) {
return { return {
type: "bi.label", el: {
text: text, type: "bi.label",
value: o.value, text: text,
height: 25, value: o.value,
textAlign: "left", height: 24,
width: 70, textAlign: "left"
lgap: 15 },
lgap: 49
} }
}) })
} }
@ -93585,7 +93583,7 @@ BI.RelationViewRegionContainer = BI.inherit(BI.Widget, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.RelationViewRegionContainer.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.RelationViewRegionContainer.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-relation-view-region-container", baseCls: "bi-relation-view-region-container",
width: 200 width: 210
}); });
}, },
@ -93700,9 +93698,9 @@ BI.RelationViewRegion = BI.inherit(BI.BasicButton, {
this.preview = BI.createWidget({ this.preview = BI.createWidget({
type: "bi.icon_button", type: "bi.icon_button",
cls: "relation-table-preview-font", cls: "eye relation-table-preview-font",
width: 25, width: 36,
height: 25, height: 24,
stopPropagation: true stopPropagation: true
}); });
this.preview.on(BI.IconButton.EVENT_CHANGE, function () { this.preview.on(BI.IconButton.EVENT_CHANGE, function () {
@ -93711,11 +93709,12 @@ BI.RelationViewRegion = BI.inherit(BI.BasicButton, {
this.title = BI.createWidget({ this.title = BI.createWidget({
type: "bi.label", type: "bi.label",
height: 25, height: 24,
width: 70, width: 70,
text: o.text, text: o.text,
value: o.value, value: o.value,
textAlign: "left" textAlign: "left",
disabled: o.disabled
}); });
// title放body上 // title放body上
if (BI.isKey(o.header)) { if (BI.isKey(o.header)) {
@ -93755,7 +93754,8 @@ BI.RelationViewRegion = BI.inherit(BI.BasicButton, {
var texts = BI.isArray(item.text) ? item.text : [item.text]; var texts = BI.isArray(item.text) ? item.text : [item.text];
return BI.extend(item, { return BI.extend(item, {
type: "bi.relation_view_item", type: "bi.relation_view_item",
height: texts.length > 1 ? (texts.length + 1) * 25 : 25, height: texts.length > 1 ? (texts.length + 1) * 24 : 24,
cls: i === items.length - 1 ? "" : "split-line",
hoverIn: function () { hoverIn: function () {
self.setValue(item.value); self.setValue(item.value);
self.fireEvent(BI.RelationViewRegion.EVENT_HOVER_IN, item.value); self.fireEvent(BI.RelationViewRegion.EVENT_HOVER_IN, item.value);
@ -93782,10 +93782,12 @@ BI.RelationViewRegion = BI.inherit(BI.BasicButton, {
getHeight: function () { getHeight: function () {
var height = 0; var height = 0;
BI.each(this.button_group.getAllButtons(), function (idx, button) { var buttons = this.button_group.getAllButtons();
height += button.getHeight(); BI.each(buttons, function (idx, button) {
//获取item高度的时候加上边框
height += button.getHeight() + (idx === buttons.length - 1 ? 0 : 1);
}); });
return height + 25 + 2 * 20 + 3; return height + 24 + 2 * 20 + 3;
}, },
// 获取上方开始划线的位置 // 获取上方开始划线的位置

18
dist/widget.css vendored

@ -379,6 +379,9 @@
-moz-border-radius: 2px; -moz-border-radius: 2px;
border-radius: 2px; border-radius: 2px;
} }
.bi-relation-view-item .primary-key-region {
font-size: 16px;
}
.bi-relation-view-region .relation-view-region-container { .bi-relation-view-region .relation-view-region-container {
z-index: 1; z-index: 1;
@ -389,6 +392,15 @@
.bi-relation-view-region .relation-view-region-container.other-package { .bi-relation-view-region .relation-view-region-container.other-package {
border-style: dashed; border-style: dashed;
} }
.bi-relation-view-region .relation-view-region-container .relation-view-region-title .eye {
font-size: 16px;
}
.bi-relation-view-region .relation-view-region-container .split-line {
border-bottom: 1px solid #cccccc;
}
.bi-relation-view-item .primary-key-region {
font-size: 16px;
}
.bi-relation-view-region .relation-view-region-container { .bi-relation-view-region .relation-view-region-container {
z-index: 1; z-index: 1;
-webkit-border-radius: 2px; -webkit-border-radius: 2px;
@ -398,6 +410,12 @@
.bi-relation-view-region .relation-view-region-container.other-package { .bi-relation-view-region .relation-view-region-container.other-package {
border-style: dashed; border-style: dashed;
} }
.bi-relation-view-region .relation-view-region-container .relation-view-region-title .eye {
font-size: 16px;
}
.bi-relation-view-region .relation-view-region-container .split-line {
border-bottom: 1px solid #cccccc;
}
.bi-sequence-table-dynamic-number .sequence-table-title-cell { .bi-sequence-table-dynamic-number .sequence-table-title-cell {
overflow: hidden; overflow: hidden;
overflow-x: hidden; overflow-x: hidden;

74
dist/widget.js vendored

@ -14939,36 +14939,34 @@ BI.RelationViewItem = BI.inherit(BI.BasicButton, {
var body = []; var body = [];
var header = { var header = {
type: "bi.vertical_adapt", type: "bi.vertical_adapt",
cls: "primary-key-font", items: [{
items: [] type: "bi.center_adapt",
cls: o.isPrimary ? "primary-key-region primary-key-font" : "",
items: [{
type: "bi.icon",
title: o.isPrimary ? BI.i18nText("BI-Primary_Key") : ""
}],
width: 36,
height: 16
}, {
type: "bi.label",
text: o.text.length > 1 ? BI.i18nText("BI-Basic_Union_Relation") : o.text[0],
value: o.value,
height: 24,
textAlign: "left"
}]
}; };
if (o.isPrimary) {
header.items.push({
type: "bi.icon",
width: 12,
height: 16,
title: BI.i18nText("BI-Primary_Key")
});
}
header.items.push({
type: "bi.label",
text: o.text.length > 1 ? BI.i18nText("BI-Basic_Union_Relation") : o.text[0],
value: o.value,
height: 25,
textAlign: "left",
width: o.isPrimary ? 70 : 90,
lgap: o.isPrimary ? 0 : 10
});
if(o.text.length > 1){ if(o.text.length > 1){
body = BI.map(o.text, function (idx, text) { body = BI.map(o.text, function (idx, text) {
return { return {
type: "bi.label", el: {
text: text, type: "bi.label",
value: o.value, text: text,
height: 25, value: o.value,
textAlign: "left", height: 24,
width: 70, textAlign: "left"
lgap: 15 },
lgap: 49
} }
}) })
} }
@ -15321,7 +15319,7 @@ BI.RelationViewRegionContainer = BI.inherit(BI.Widget, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.RelationViewRegionContainer.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.RelationViewRegionContainer.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-relation-view-region-container", baseCls: "bi-relation-view-region-container",
width: 200 width: 210
}); });
}, },
@ -15436,9 +15434,9 @@ BI.RelationViewRegion = BI.inherit(BI.BasicButton, {
this.preview = BI.createWidget({ this.preview = BI.createWidget({
type: "bi.icon_button", type: "bi.icon_button",
cls: "relation-table-preview-font", cls: "eye relation-table-preview-font",
width: 25, width: 36,
height: 25, height: 24,
stopPropagation: true stopPropagation: true
}); });
this.preview.on(BI.IconButton.EVENT_CHANGE, function () { this.preview.on(BI.IconButton.EVENT_CHANGE, function () {
@ -15447,11 +15445,12 @@ BI.RelationViewRegion = BI.inherit(BI.BasicButton, {
this.title = BI.createWidget({ this.title = BI.createWidget({
type: "bi.label", type: "bi.label",
height: 25, height: 24,
width: 70, width: 70,
text: o.text, text: o.text,
value: o.value, value: o.value,
textAlign: "left" textAlign: "left",
disabled: o.disabled
}); });
// title放body上 // title放body上
if (BI.isKey(o.header)) { if (BI.isKey(o.header)) {
@ -15491,7 +15490,8 @@ BI.RelationViewRegion = BI.inherit(BI.BasicButton, {
var texts = BI.isArray(item.text) ? item.text : [item.text]; var texts = BI.isArray(item.text) ? item.text : [item.text];
return BI.extend(item, { return BI.extend(item, {
type: "bi.relation_view_item", type: "bi.relation_view_item",
height: texts.length > 1 ? (texts.length + 1) * 25 : 25, height: texts.length > 1 ? (texts.length + 1) * 24 : 24,
cls: i === items.length - 1 ? "" : "split-line",
hoverIn: function () { hoverIn: function () {
self.setValue(item.value); self.setValue(item.value);
self.fireEvent(BI.RelationViewRegion.EVENT_HOVER_IN, item.value); self.fireEvent(BI.RelationViewRegion.EVENT_HOVER_IN, item.value);
@ -15518,10 +15518,12 @@ BI.RelationViewRegion = BI.inherit(BI.BasicButton, {
getHeight: function () { getHeight: function () {
var height = 0; var height = 0;
BI.each(this.button_group.getAllButtons(), function (idx, button) { var buttons = this.button_group.getAllButtons();
height += button.getHeight(); BI.each(buttons, function (idx, button) {
//获取item高度的时候加上边框
height += button.getHeight() + (idx === buttons.length - 1 ? 0 : 1);
}); });
return height + 25 + 2 * 20 + 3; return height + 24 + 2 * 20 + 3;
}, },
// 获取上方开始划线的位置 // 获取上方开始划线的位置

9
src/css/widget/relationview/relationview.css

@ -1,3 +1,6 @@
.bi-relation-view-item .primary-key-region {
font-size: 16px;
}
.bi-relation-view-region .relation-view-region-container { .bi-relation-view-region .relation-view-region-container {
z-index: 1; z-index: 1;
@ -8,3 +11,9 @@
.bi-relation-view-region .relation-view-region-container.other-package { .bi-relation-view-region .relation-view-region-container.other-package {
border-style: dashed; border-style: dashed;
} }
.bi-relation-view-region .relation-view-region-container .relation-view-region-title .eye {
font-size: 16px;
}
.bi-relation-view-region .relation-view-region-container .split-line {
border-bottom: 1px solid #cccccc;
}

3
src/css/widget/relationview/relationview.item.css

@ -0,0 +1,3 @@
.bi-relation-view-item .primary-key-region {
font-size: 16px;
}

6
src/css/widget/relationview/relationview.region.css

@ -7,3 +7,9 @@
.bi-relation-view-region .relation-view-region-container.other-package { .bi-relation-view-region .relation-view-region-container.other-package {
border-style: dashed; border-style: dashed;
} }
.bi-relation-view-region .relation-view-region-container .relation-view-region-title .eye {
font-size: 16px;
}
.bi-relation-view-region .relation-view-region-container .split-line {
border-bottom: 1px solid #cccccc;
}

3
src/less/widget/relationview/relationview.item.less

@ -1,4 +1,7 @@
@import "../../index"; @import "../../index";
.bi-relation-view-item{ .bi-relation-view-item{
& .primary-key-region{
font-size: 16px;
}
} }

7
src/less/widget/relationview/relationview.region.less

@ -8,6 +8,13 @@
z-index: 1; z-index: 1;
.border-radius(2px); .border-radius(2px);
& .relation-view-region-title { & .relation-view-region-title {
& .eye{
font-size: 16px;
}
}
& .split-line{
border-bottom: 1px solid @color-bi-border-disabled
} }
} }
} }

50
src/widget/relationview/relationview.item.js

@ -23,36 +23,34 @@ BI.RelationViewItem = BI.inherit(BI.BasicButton, {
var body = []; var body = [];
var header = { var header = {
type: "bi.vertical_adapt", type: "bi.vertical_adapt",
cls: "primary-key-font", items: [{
items: [] type: "bi.center_adapt",
cls: o.isPrimary ? "primary-key-region primary-key-font" : "",
items: [{
type: "bi.icon",
title: o.isPrimary ? BI.i18nText("BI-Primary_Key") : ""
}],
width: 36,
height: 16
}, {
type: "bi.label",
text: o.text.length > 1 ? BI.i18nText("BI-Basic_Union_Relation") : o.text[0],
value: o.value,
height: 24,
textAlign: "left"
}]
}; };
if (o.isPrimary) {
header.items.push({
type: "bi.icon",
width: 12,
height: 16,
title: BI.i18nText("BI-Primary_Key")
});
}
header.items.push({
type: "bi.label",
text: o.text.length > 1 ? BI.i18nText("BI-Basic_Union_Relation") : o.text[0],
value: o.value,
height: 25,
textAlign: "left",
width: o.isPrimary ? 70 : 90,
lgap: o.isPrimary ? 0 : 10
});
if(o.text.length > 1){ if(o.text.length > 1){
body = BI.map(o.text, function (idx, text) { body = BI.map(o.text, function (idx, text) {
return { return {
type: "bi.label", el: {
text: text, type: "bi.label",
value: o.value, text: text,
height: 25, value: o.value,
textAlign: "left", height: 24,
width: 70, textAlign: "left"
lgap: 15 },
lgap: 49
} }
}) })
} }

2
src/widget/relationview/relationview.region.container.js

@ -5,7 +5,7 @@ BI.RelationViewRegionContainer = BI.inherit(BI.Widget, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.RelationViewRegionContainer.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.RelationViewRegionContainer.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-relation-view-region-container", baseCls: "bi-relation-view-region-container",
width: 200 width: 210
}); });
}, },

22
src/widget/relationview/relationview.region.js

@ -25,9 +25,9 @@ BI.RelationViewRegion = BI.inherit(BI.BasicButton, {
this.preview = BI.createWidget({ this.preview = BI.createWidget({
type: "bi.icon_button", type: "bi.icon_button",
cls: "relation-table-preview-font", cls: "eye relation-table-preview-font",
width: 25, width: 36,
height: 25, height: 24,
stopPropagation: true stopPropagation: true
}); });
this.preview.on(BI.IconButton.EVENT_CHANGE, function () { this.preview.on(BI.IconButton.EVENT_CHANGE, function () {
@ -36,11 +36,12 @@ BI.RelationViewRegion = BI.inherit(BI.BasicButton, {
this.title = BI.createWidget({ this.title = BI.createWidget({
type: "bi.label", type: "bi.label",
height: 25, height: 24,
width: 70, width: 70,
text: o.text, text: o.text,
value: o.value, value: o.value,
textAlign: "left" textAlign: "left",
disabled: o.disabled
}); });
// title放body上 // title放body上
if (BI.isKey(o.header)) { if (BI.isKey(o.header)) {
@ -80,7 +81,8 @@ BI.RelationViewRegion = BI.inherit(BI.BasicButton, {
var texts = BI.isArray(item.text) ? item.text : [item.text]; var texts = BI.isArray(item.text) ? item.text : [item.text];
return BI.extend(item, { return BI.extend(item, {
type: "bi.relation_view_item", type: "bi.relation_view_item",
height: texts.length > 1 ? (texts.length + 1) * 25 : 25, height: texts.length > 1 ? (texts.length + 1) * 24 : 24,
cls: i === items.length - 1 ? "" : "split-line",
hoverIn: function () { hoverIn: function () {
self.setValue(item.value); self.setValue(item.value);
self.fireEvent(BI.RelationViewRegion.EVENT_HOVER_IN, item.value); self.fireEvent(BI.RelationViewRegion.EVENT_HOVER_IN, item.value);
@ -107,10 +109,12 @@ BI.RelationViewRegion = BI.inherit(BI.BasicButton, {
getHeight: function () { getHeight: function () {
var height = 0; var height = 0;
BI.each(this.button_group.getAllButtons(), function (idx, button) { var buttons = this.button_group.getAllButtons();
height += button.getHeight(); BI.each(buttons, function (idx, button) {
//获取item高度的时候加上边框
height += button.getHeight() + (idx === buttons.length - 1 ? 0 : 1);
}); });
return height + 25 + 2 * 20 + 3; return height + 24 + 2 * 20 + 3;
}, },
// 获取上方开始划线的位置 // 获取上方开始划线的位置

Loading…
Cancel
Save