Browse Source

refactor: 优化代码结构

qufenxi
alan 6 years ago
parent
commit
076edbadcf
  1. 2
      src/app/connection/more/item/more_link_item.less
  2. 1
      src/app/connection/right/right_title/right_title.ts
  3. 3
      src/app/status/link_status.ts
  4. 5
      src/app/title/item/title_item.ts
  5. 3
      src/app/title/title.less
  6. 9
      src/app/title/title.ts
  7. 2
      src/shared/crud/crud.request.ts

2
src/app/connection/more/item/more_link_item.less

@ -1,6 +1,6 @@
@import '../../../../less/index.less'; @import '../../../../less/index.less';
.dec-webui-dcm-connection-more-link-item{ .dec-webui-dcm-connection-more-link-item{
&:hover{ &:hover{
border: solid 1px @border-color-highlight; border-color :@border-color-highlight;
} }
} }

1
src/app/connection/right/right_title/right_title.ts

@ -12,7 +12,6 @@ const Widget: WidgetType = {
}, },
render() { render() {
const linkSelected: LinkType = this.model.linkSelected; const linkSelected: LinkType = this.model.linkSelected;
const linkList: LinkType[] = this.model.linkList;
const that = this; const that = this;
const {isEdit} = this.options; const {isEdit} = this.options;
const title = linkSelected.text === OTHER_CONNECT ? BI.i18nText('Dec-Dcm_Connection_Other') : linkSelected.text; const title = linkSelected.text === OTHER_CONNECT ? BI.i18nText('Dec-Dcm_Connection_Other') : linkSelected.text;

3
src/app/status/link_status.ts

@ -23,7 +23,7 @@ const Widget: WidgetType = {
items: [{ items: [{
el: { el: {
type: Vtape, type: Vtape,
cls: 'dcm-link-left bi-border-right', cls: 'dcm-link-left',
items: [ items: [
{ {
el: { el: {
@ -49,6 +49,7 @@ const Widget: WidgetType = {
width: 280, width: 280,
}, { }, {
type: Right, type: Right,
cls: 'bi-border-left',
}], }],
}; };
}, },

5
src/app/title/item/title_item.ts

@ -13,7 +13,7 @@ const Widget = BI.inherit(BI.BasicButton, {
watch: { watch: {
tab(tab: string) { tab(tab: string) {
const {value} = this.options; const {value} = this.options;
this.element.css(getSelectStyle(value, tab)); this.title.setStyle(getSelectStyle(value, tab));
}, },
}, },
render() { render() {
@ -23,6 +23,9 @@ const Widget = BI.inherit(BI.BasicButton, {
type: Label, type: Label,
height: 40, height: 40,
hgap: 15, hgap: 15,
ref: _ref => {
this.title = _ref;
},
text, text,
}; };
}, },

3
src/app/title/title.less

@ -2,6 +2,7 @@
.dec-webui-dcm-title{ .dec-webui-dcm-title{
.title-item-selected{ .title-item-selected{
color: @background-color-highlight; color: @background-color-highlight;
border-bottom: solid 2px @border-color-highlight; border-bottom-color:@border-color-highlight;
border-bottom-width: 2px;
} }
} }

9
src/app/title/title.ts

@ -9,7 +9,7 @@ const Widget: WidgetType = {
baseCls: 'dec-webui-dcm-title bi-card bi-border-bottom', baseCls: 'dec-webui-dcm-title bi-card bi-border-bottom',
}, },
render() { render() {
const hideCloseButton = isDesigner(); const showCloseButton = isDesigner();
return { return {
type: LeftRightVerticalAdapt, type: LeftRightVerticalAdapt,
@ -17,7 +17,7 @@ const Widget: WidgetType = {
left: [ left: [
{ {
type: TitleItem, type: TitleItem,
cls: 'title-item-selected', cls: 'title-item-selected bi-border-bottom',
text: BI.i18nText('Dec-Dcm_Connection_Management'), text: BI.i18nText('Dec-Dcm_Connection_Management'),
value: TAB_LINK_SET, value: TAB_LINK_SET,
}, },
@ -28,17 +28,16 @@ const Widget: WidgetType = {
}, },
], ],
right: [ right: [
{ showCloseButton ? {
type: IconButton, type: IconButton,
cls: 'close-ha-font', cls: 'close-ha-font',
invisible: !hideCloseButton,
width: 30, width: 30,
height: 30, height: 30,
rgap: 10, rgap: 10,
handler() { handler() {
closeWindow(); closeWindow();
}, },
}, } : null,
], ],
}, },
}; };

2
src/shared/crud/crud.request.ts

@ -11,7 +11,7 @@ export function isDesigner(): boolean {
return PluginHelper.isDesigner(); return PluginHelper.isDesigner();
} }
return true; return false;
} }
/** /**

Loading…
Cancel
Save