Browse Source

refactor: 使用TextEditor替代Editor

qufenxi
alan 6 years ago
parent
commit
1a9ba0257f
  1. 3
      src/app/connection/left/item/left_item.ts
  2. 16
      src/app/connection/right/right_edit/right_edit.ts
  3. 17
      src/app/connection/right/right_edit/right_edit_jndi.ts
  4. 18
      src/app/connection/right/right_edit/right_edit_mysql.ts
  5. 3
      src/app/title/title.ts
  6. 24
      src/demo/plugin.redis.edit.ts

3
src/app/connection/left/item/left_item.ts

@ -10,7 +10,7 @@ const Widget: WidgetType = {
title: '', title: '',
id: '', id: '',
creator: '', creator: '',
baseCls: 'dec-webui-dcm-connection-left-item', baseCls: 'dec-webui-dcm-connection-left-item bi-list-item-active',
}, },
_store() { _store() {
return BI.Models.getModel(Model); return BI.Models.getModel(Model);
@ -20,7 +20,6 @@ const Widget: WidgetType = {
return { return {
type: LeftRightVerticalAdapt, type: LeftRightVerticalAdapt,
cls: 'bi-list-item-active',
height: 24, height: 24,
items: { items: {
left: [ left: [

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

@ -88,8 +88,7 @@ const Widget: WidgetType = {
type: FormItem, type: FormItem,
text: BI.i18nText('Dec-Dcm_Connection_Form_URL'), text: BI.i18nText('Dec-Dcm_Connection_Form_URL'),
form: { form: {
type: Editor, type: TextEditor,
cls: 'bi-border',
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'), watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
width: 300, width: 300,
value: linkSelected.url, value: linkSelected.url,
@ -133,8 +132,7 @@ const Widget: WidgetType = {
type: FormItem, type: FormItem,
text: BI.i18nText('Dec-Dcm_Connection_Form_UserName'), text: BI.i18nText('Dec-Dcm_Connection_Form_UserName'),
form: { form: {
type: Editor, type: TextEditor,
cls: 'bi-border',
allowBlank: true, allowBlank: true,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'), watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
width: 300, width: 300,
@ -154,8 +152,7 @@ const Widget: WidgetType = {
type: FormItem, type: FormItem,
text: BI.i18nText('Dec-Dcm_Connection_Form_Password'), text: BI.i18nText('Dec-Dcm_Connection_Form_Password'),
form: { form: {
type: Editor, type: TextEditor,
cls: 'bi-border',
inputType: 'password', inputType: 'password',
allowBlank: true, allowBlank: true,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'), watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
@ -182,7 +179,6 @@ const Widget: WidgetType = {
height: 100, height: 100,
form: { form: {
type: TextAreaEditor, type: TextAreaEditor,
cls: 'bi-border',
allowBlank: true, allowBlank: true,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'), watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
width: 300, width: 300,
@ -222,8 +218,7 @@ const Widget: WidgetType = {
type: FormItem, type: FormItem,
text: BI.i18nText('Dec-Dcm_Connection_Form_Connection_Max_Number'), text: BI.i18nText('Dec-Dcm_Connection_Form_Connection_Max_Number'),
form: { form: {
type: Editor, type: TextEditor,
cls: 'bi-border',
allowBlank: true, allowBlank: true,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'), watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
width: 60, width: 60,
@ -261,8 +256,7 @@ const Widget: WidgetType = {
type: FormItem, type: FormItem,
text: BI.i18nText('Dec-Dcm_Connection_Form_Pattern'), text: BI.i18nText('Dec-Dcm_Connection_Form_Pattern'),
form: { form: {
type: Editor, type: TextEditor,
cls: 'bi-border',
width: 300, width: 300,
disabled: true, disabled: true,
}, },

17
src/app/connection/right/right_edit/right_edit_jndi.ts

@ -1,4 +1,4 @@
import {Vertical, Editor, TextValueCombo, TextButton, Label} from '@ui'; import {Vertical, Editor, TextValueCombo, TextButton, Label, TextEditor} from '@ui';
import FormItem from '@shared/components/form_item'; import FormItem from '@shared/components/form_item';
import {JNDI_FACTORYS, OTHER_ATTRIBUTES, CONNECT_CHARSET} from '@private/constants'; import {JNDI_FACTORYS, OTHER_ATTRIBUTES, CONNECT_CHARSET} from '@private/constants';
import {AttributeType} from '../right.typing'; import {AttributeType} from '../right.typing';
@ -29,8 +29,7 @@ const Widget = BI.inherit(BI.Widget, {
type: FormItem, type: FormItem,
text: BI.i18nText('Dec-Dcm_Connection_JNDI_Form_ConnectionName'), text: BI.i18nText('Dec-Dcm_Connection_JNDI_Form_ConnectionName'),
form: { form: {
type: Editor, type: TextEditor,
cls: 'bi-border',
width: 300, width: 300,
allowBlank: true, allowBlank: true,
value: connectionName, value: connectionName,
@ -68,8 +67,7 @@ const Widget = BI.inherit(BI.Widget, {
text: 'PROVIDER_URL', text: 'PROVIDER_URL',
width: 180, width: 180,
form: { form: {
type: Editor, type: TextEditor,
cls: 'bi-border',
width: 300, width: 300,
allowBlank: true, allowBlank: true,
value: url, value: url,
@ -80,8 +78,7 @@ const Widget = BI.inherit(BI.Widget, {
text: 'SECURITY_PRINCIPAL', text: 'SECURITY_PRINCIPAL',
width: 180, width: 180,
form: { form: {
type: Editor, type: TextEditor,
cls: 'bi-border',
width: 300, width: 300,
allowBlank: true, allowBlank: true,
value: principal, value: principal,
@ -92,8 +89,7 @@ const Widget = BI.inherit(BI.Widget, {
text: 'SECURITY_CREDENTIALS', text: 'SECURITY_CREDENTIALS',
width: 180, width: 180,
form: { form: {
type: Editor, type: TextEditor,
cls: 'bi-border',
width: 300, width: 300,
allowBlank: true, allowBlank: true,
value: credentials, value: credentials,
@ -127,8 +123,7 @@ const Widget = BI.inherit(BI.Widget, {
text: item.text, text: item.text,
width: 180, width: 180,
form: { form: {
type: Editor, type: TextEditor,
cls: 'bi-border',
width: 300, width: 300,
allowBlank: true, allowBlank: true,
value: this.options[item.name], value: this.options[item.name],

18
src/app/connection/right/right_edit/right_edit_mysql.ts

@ -1,4 +1,4 @@
import {WidgetType, Vertical, MultiSelectItem, TextAreaEditor, Editor, Button, TextValueCombo} 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';
@ -23,8 +23,7 @@ const Widget: WidgetType = {
text: BI.i18nText('Dec-Dcm_Connection_Form_ConnectionName'), text: BI.i18nText('Dec-Dcm_Connection_Form_ConnectionName'),
hint: BI.i18nText('Dec-Dcm_Connection_Form_ConnectionName-Change-Confirm'), hint: BI.i18nText('Dec-Dcm_Connection_Form_ConnectionName-Change-Confirm'),
form: { form: {
type: Editor, type: TextEditor,
cls: 'bi-border',
width: 300, width: 300,
value: linkSelected.connectionName, value: linkSelected.connectionName,
listeners: [{ listeners: [{
@ -61,8 +60,7 @@ const Widget: WidgetType = {
type: FormItem, type: FormItem,
text: BI.i18nText('Dec-Dcm_Connection_Form_URL'), text: BI.i18nText('Dec-Dcm_Connection_Form_URL'),
form: { form: {
type: Editor, type: TextEditor,
cls: 'bi-border',
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'), watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
width: 300, width: 300,
value: linkSelected.url, value: linkSelected.url,
@ -106,8 +104,7 @@ const Widget: WidgetType = {
type: FormItem, type: FormItem,
text: BI.i18nText('Dec-Dcm_Connection_Form_UserName'), text: BI.i18nText('Dec-Dcm_Connection_Form_UserName'),
form: { form: {
type: Editor, type: TextEditor,
cls: 'bi-border',
allowBlank: true, allowBlank: true,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'), watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
width: 300, width: 300,
@ -127,8 +124,7 @@ const Widget: WidgetType = {
type: FormItem, type: FormItem,
text: BI.i18nText('Dec-Dcm_Connection_Form_Password'), text: BI.i18nText('Dec-Dcm_Connection_Form_Password'),
form: { form: {
type: Editor, type: TextEditor,
cls: 'bi-border',
inputType: 'password', inputType: 'password',
allowBlank: true, allowBlank: true,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'), watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
@ -155,7 +151,6 @@ const Widget: WidgetType = {
height: 100, height: 100,
form: { form: {
type: TextAreaEditor, type: TextAreaEditor,
cls: 'bi-border',
allowBlank: true, allowBlank: true,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'), watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
width: 300, width: 300,
@ -195,8 +190,7 @@ const Widget: WidgetType = {
type: FormItem, type: FormItem,
text: BI.i18nText('Dec-Dcm_Connection_Form_Connection_Max_Number'), text: BI.i18nText('Dec-Dcm_Connection_Form_Connection_Max_Number'),
form: { form: {
type: Editor, type: TextEditor,
cls: 'bi-border',
allowBlank: true, allowBlank: true,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'), watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
width: 60, width: 60,

3
src/app/title/title.ts

@ -6,14 +6,13 @@ import {TAB_LINK_SET, TAB_LINK_POOL} from '@private/constants';
const className = 'dec.dcm.title'; const className = 'dec.dcm.title';
const Widget: WidgetType = { const Widget: WidgetType = {
props: { props: {
baseCls: 'dec-webui-dcm-title', baseCls: 'dec-webui-dcm-title bi-card bi-border-bottom',
}, },
render() { render() {
const hideCloseButton = isDesigner(); const hideCloseButton = isDesigner();
return { return {
type: LeftRightVerticalAdapt, type: LeftRightVerticalAdapt,
cls: 'bi-card bi-border-bottom',
items: { items: {
left: [ left: [
{ {

24
src/demo/plugin.redis.edit.ts

@ -1,4 +1,5 @@
import './style.scss'; import './style.scss';
import {TextEditor, Vertical, Left, Label} from '@ui/index';
const RedisConstantName = 'dec.constant.database.conf.connect.form.redis.value'; const RedisConstantName = 'dec.constant.database.conf.connect.form.redis.value';
const form = { const form = {
url: '192.168.1.22', url: '192.168.1.22',
@ -10,24 +11,23 @@ const classNameEdit = 'dec.dcm.plugin.redis.edit';
const Widget = BI.inherit(BI.Widget, { const Widget = BI.inherit(BI.Widget, {
render() { render() {
return { return {
type: 'bi.vertical', type: Vertical,
cls: 'bi-plugin-redis', cls: 'bi-plugin-redis',
bgap: 10, bgap: 10,
items: [ items: [
{ {
type: 'bi.left', type: Left,
height: 30, height: 30,
items: [ items: [
{ {
type: 'bi.label', type: Label,
text: BI.i18nText('Dec-Dcm_Connection_Form_Database_Addr'), text: BI.i18nText('Dec-Dcm_Connection_Form_Database_Addr'),
height: 24, height: 24,
width: 115, width: 115,
textAlign: 'left', textAlign: 'left',
}, },
{ {
type: 'bi.editor', type: TextEditor,
cls: 'bi-border',
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Addr'), watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Addr'),
value: form.url, value: form.url,
allowBlank: true, allowBlank: true,
@ -36,19 +36,18 @@ const Widget = BI.inherit(BI.Widget, {
}], }],
}, },
{ {
type: 'bi.left', type: Left,
height: 30, height: 30,
items: [ items: [
{ {
type: 'bi.label', type: Label,
text: BI.i18nText('Dec-Dcm_Connection_Form_Database_Port'), text: BI.i18nText('Dec-Dcm_Connection_Form_Database_Port'),
height: 24, height: 24,
width: 115, width: 115,
textAlign: 'left', textAlign: 'left',
}, },
{ {
type: 'bi.editor', type: TextEditor,
cls: 'bi-border',
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Port'), watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Port'),
allowBlank: true, allowBlank: true,
width: 300, width: 300,
@ -61,19 +60,18 @@ const Widget = BI.inherit(BI.Widget, {
}], }],
}, },
{ {
type: 'bi.left', type: Left,
height: 30, height: 30,
items: [ items: [
{ {
type: 'bi.label', type: Label,
text: BI.i18nText('Dec-Dcm_Connection_Form_Password'), text: BI.i18nText('Dec-Dcm_Connection_Form_Password'),
height: 24, height: 24,
width: 115, width: 115,
textAlign: 'left', textAlign: 'left',
}, },
{ {
type: 'bi.editor', type: TextEditor,
cls: 'bi-border',
inputType: 'password', inputType: 'password',
value: form.password, value: form.password,
allowBlank: true, allowBlank: true,

Loading…
Cancel
Save