|
|
@ -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,30 +11,32 @@ export class FormItem extends BI.Widget { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
render () { |
|
|
|
render () { |
|
|
|
|
|
|
|
const { nameWidth, unit, value } = this.options; |
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
return { |
|
|
|
type: Left, |
|
|
|
type: Htape, |
|
|
|
|
|
|
|
height: 17, |
|
|
|
items: [ |
|
|
|
items: [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
type: Label, |
|
|
|
el: { |
|
|
|
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 ? |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
type: Label, |
|
|
|
type: Label, |
|
|
|
text: this.options.unit, |
|
|
|
cls: 'bi-font-bold', |
|
|
|
lgap: 5, |
|
|
|
|
|
|
|
textAlign: 'left', |
|
|
|
textAlign: 'left', |
|
|
|
} : { |
|
|
|
text: this.options.name, |
|
|
|
type: Layout, |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
width: nameWidth, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
type: Vertical, |
|
|
|
|
|
|
|
items: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
type: Label, |
|
|
|
|
|
|
|
text: unit ? `${value} ${unit}` : value, |
|
|
|
|
|
|
|
textAlign: 'left', |
|
|
|
|
|
|
|
title: value, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
}, |
|
|
|
], |
|
|
|
], |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|