From 584ead2c79b746c9dee696e3bb983fa59b893ca4 Mon Sep 17 00:00:00 2001 From: alan Date: Wed, 9 Oct 2019 15:02:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20DEC-10231=20=E8=B0=83=E6=95=B4=E5=B8=83?= =?UTF-8?q?=E5=B1=80=EF=BC=8C=E6=96=87=E6=9C=AC=E9=95=BF=E5=BA=A6=E8=BF=87?= =?UTF-8?q?=E9=95=BF=E6=97=B6=E6=98=BE=E7=A4=BA...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/form_item/form_item.ts | 40 ++++++++++--------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/src/modules/pages/connection/components/form_item/form_item.ts b/src/modules/pages/connection/components/form_item/form_item.ts index 3266f08..24dacd8 100644 --- a/src/modules/pages/connection/components/form_item/form_item.ts +++ b/src/modules/pages/connection/components/form_item/form_item.ts @@ -1,5 +1,5 @@ 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'; @shortcut(FormItemXtype) export class FormItem extends BI.Widget { @@ -11,30 +11,32 @@ export class FormItem extends BI.Widget { } render () { + const { nameWidth, unit, value } = this.options; + return { - type: Left, + type: Htape, + height: 17, items: [ { - type: Label, - cls: 'bi-font-bold', - width: this.options.nameWidth, - textAlign: 'left', - text: this.options.name, - }, - { - type: Label, - text: this.options.value, - height: 17, - }, - this.options.unit ? - { + el: { type: Label, - text: this.options.unit, - lgap: 5, + cls: 'bi-font-bold', textAlign: 'left', - } : { - type: Layout, + text: this.options.name, }, + width: nameWidth, + }, + { + type: Vertical, + items: [ + { + type: Label, + text: unit ? `${value} ${unit}` : value, + textAlign: 'left', + title: value, + }, + ], + }, ], }; }