Browse Source

refactor: 优化布局的使用

qufenxi
alan 6 years ago
parent
commit
286ac1982d
  1. 28
      src/app/connection/more/item/more_link_item.ts
  2. 3
      src/app/connection/right/nothing.ts
  3. 2
      src/app/connection/right/right_edit/right_edit.ts
  4. 5
      src/shared/components/both_side.ts
  5. 7
      src/shared/components/form_item.ts

28
src/app/connection/more/item/more_link_item.ts

@ -1,11 +1,13 @@
import './more_link_item.less'; import './more_link_item.less';
import {WidgetType, Vertical, Img, Label, Layout, Absolute} from '@ui/index'; import {WidgetType, Vertical, Img, Label, Layout, Absolute, Vtape} from '@ui/index';
import ModelName from './more_link_litem.model'; import ModelName from './more_link_litem.model';
const className = 'dec.dcm.component.linkSet.morelink.item'; const className = 'dec.dcm.component.linkSet.morelink.item';
const Widget: WidgetType = { const Widget: WidgetType = {
props: { props: {
baseCls: 'dec-webui-dcm-connection-more-link-item bi-border', baseCls: 'dec-webui-dcm-connection-more-link-item bi-border',
height: 120,
width: 120,
}, },
_store() { _store() {
return BI.Models.getModel(ModelName); return BI.Models.getModel(ModelName);
@ -20,16 +22,17 @@ const Widget: WidgetType = {
const {text, name} = this.options; const {text, name} = this.options;
return { return {
type: Vertical, type: Vtape,
items: [ items: [
{ {
type: Img,
width: 120,
height: 90,
src: this._buildResourceUrl(name),
}, {
type: Absolute, type: Absolute,
items: [ items: [
{
el: {
type: Img,
src: this._buildResourceUrl(name),
},
},
{ {
el: { el: {
type: Layout, type: Layout,
@ -41,17 +44,18 @@ const Widget: WidgetType = {
this.selected = _ref; this.selected = _ref;
}, },
}, },
left: 90, right: 0,
top: -90,
}, },
], ],
}, { },
{
el: {
type: Label, type: Label,
cls: 'bi-header-background', cls: 'bi-header-background',
height: 27,
width: 120,
text, text,
}, },
height: 30,
},
], ],
}; };
}, },

3
src/app/connection/right/nothing.ts

@ -7,8 +7,6 @@ const Widget: WidgetType = {
top: 200, top: 200,
items: [{ items: [{
type: Vertical, type: Vertical,
width: 260,
height: 180,
items: [ items: [
{ {
type: Layout, type: Layout,
@ -18,7 +16,6 @@ const Widget: WidgetType = {
}, },
{ {
type: Label, type: Label,
height: 20,
text: BI.i18nText('Dec-Dcm_Connection_Plase_Add_One'), text: BI.i18nText('Dec-Dcm_Connection_Plase_Add_One'),
}, },
], ],

2
src/app/connection/right/right_edit/right_edit.ts

@ -1,4 +1,4 @@
import {WidgetType, Vertical, MultiSelectItem, TextAreaEditor, Editor, Button, TextValueCombo, TextEditor} from '@ui/index'; import {WidgetType, Vertical, MultiSelectItem, TextAreaEditor, Button, TextValueCombo, TextEditor} from '@ui/index';
import {LinkType} from '@ui/type'; import {LinkType} from '@ui/type';
import {CONNECT_CHARSET} from '@private/constants'; import {CONNECT_CHARSET} from '@private/constants';
import Model from '../../link_set.model'; import Model from '../../link_set.model';

5
src/shared/components/both_side.ts

@ -1,13 +1,14 @@
import {WidgetType, Htape, Label} from '@ui/index'; import {WidgetType, Htape, Label} from '@ui/index';
const BothSide = 'dec.dcm.shared.component.both.side'; const BothSide = 'dec.dcm.shared.component.both.side';
const Widget: WidgetType = { const Widget: WidgetType = {
props: {
height: 24,
},
render() { render() {
const {leftText, rightText} = this.options; const {leftText, rightText} = this.options;
return { return {
type: Htape, type: Htape,
cls: 'both-side',
height: 24,
items: [{ items: [{
el: { el: {
type: Label, type: Label,

7
src/shared/components/form_item.ts

@ -1,13 +1,14 @@
import {WidgetType, Htape, Label} from '@ui/index'; import {WidgetType, Htape, Label} from '@ui/index';
const className = 'dec.dcm.shared.component.form.item'; const className = 'dec.dcm.shared.component.form.item';
const Widget: WidgetType = { const Widget: WidgetType = {
props: {
height: 24,
},
render() { render() {
const {text, form, hint, height, width = 115} = this.options; const {text, form, hint, width = 115} = this.options;
return { return {
type: Htape, type: Htape,
cls: 'both-side',
height: height ? height : 24,
items: [{ items: [{
el: { el: {
type: Label, type: Label,

Loading…
Cancel
Save