Browse Source

refactor: 优化布局的使用

qufenxi
alan 6 years ago
parent
commit
286ac1982d
  1. 34
      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. 9
      src/shared/components/form_item.ts

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

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

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

@ -7,8 +7,6 @@ const Widget: WidgetType = {
top: 200,
items: [{
type: Vertical,
width: 260,
height: 180,
items: [
{
type: Layout,
@ -18,7 +16,6 @@ const Widget: WidgetType = {
},
{
type: Label,
height: 20,
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 {CONNECT_CHARSET} from '@private/constants';
import Model from '../../link_set.model';

5
src/shared/components/both_side.ts

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

9
src/shared/components/form_item.ts

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

Loading…
Cancel
Save