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';
.dec-webui-dcm-connection-more-link-item{
&: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() {
const linkSelected: LinkType = this.model.linkSelected;
const linkList: LinkType[] = this.model.linkList;
const that = this;
const {isEdit} = this.options;
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: [{
el: {
type: Vtape,
cls: 'dcm-link-left bi-border-right',
cls: 'dcm-link-left',
items: [
{
el: {
@ -49,6 +49,7 @@ const Widget: WidgetType = {
width: 280,
}, {
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: {
tab(tab: string) {
const {value} = this.options;
this.element.css(getSelectStyle(value, tab));
this.title.setStyle(getSelectStyle(value, tab));
},
},
render() {
@ -23,6 +23,9 @@ const Widget = BI.inherit(BI.BasicButton, {
type: Label,
height: 40,
hgap: 15,
ref: _ref => {
this.title = _ref;
},
text,
};
},

3
src/app/title/title.less

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

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

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

Loading…
Cancel
Save