Browse Source

Merge pull request #105 in DEC/decision-webui-dcm from ~ALAN/decision-webui-dcm:feature/10.0 to feature/10.0

* commit '584ead2c79b746c9dee696e3bb983fa59b893ca4':
  fix: DEC-10231 调整布局,文本长度过长时显示...
qufenxi
alan 5 years ago
parent
commit
8898c75170
  1. 26
      src/modules/pages/connection/components/form_item/form_item.ts

26
src/modules/pages/connection/components/form_item/form_item.ts

@ -1,5 +1,5 @@
import { shortcut } from '@core/core'; import { shortcut } from '@core/core';
import { Label, Left, Layout } from 'ui'; import { Label, Htape, Vertical } from 'ui';
export const FormItemXtype = 'dec.dcm.connection_form_item'; export const FormItemXtype = 'dec.dcm.connection_form_item';
@shortcut(FormItemXtype) @shortcut(FormItemXtype)
export class FormItem extends BI.Widget { export class FormItem extends BI.Widget {
@ -11,29 +11,31 @@ export class FormItem extends BI.Widget {
} }
render () { render () {
const { nameWidth, unit, value } = this.options;
return { return {
type: Left, type: Htape,
height: 17,
items: [ items: [
{ {
el: {
type: Label, type: Label,
cls: 'bi-font-bold', cls: 'bi-font-bold',
width: this.options.nameWidth,
textAlign: 'left', textAlign: 'left',
text: this.options.name, text: this.options.name,
}, },
{ width: nameWidth,
type: Label,
text: this.options.value,
height: 17,
}, },
this.options.unit ? {
type: Vertical,
items: [
{ {
type: Label, type: Label,
text: this.options.unit, text: unit ? `${value} ${unit}` : value,
lgap: 5,
textAlign: 'left', textAlign: 'left',
} : { title: value,
type: Layout, },
],
}, },
], ],
}; };

Loading…
Cancel
Save