Browse Source
* commit 'd59d7fcd8c5fa3399bd3156e8bf367283f588b58': REPORT-82479 feat:添加数据连接超时设置页面feature/x
superman
2 years ago
5 changed files with 137 additions and 1 deletions
@ -0,0 +1,94 @@
|
||||
import { shortcut } from '@core/core'; |
||||
import { ApiFactory } from 'src/modules/crud/apiFactory'; |
||||
|
||||
const api = new ApiFactory().create(); |
||||
|
||||
@shortcut() |
||||
export class TimeOutSetting extends BI.Widget { |
||||
public static xtype = 'dec.dcm.page.timeout.setting'; |
||||
|
||||
public props = { |
||||
value: 0, |
||||
}; |
||||
|
||||
beforeRender(cb: Function) { |
||||
const self = this; |
||||
api.getTimeOut().then(res => { |
||||
self.props.value = res.data.count; |
||||
cb(); |
||||
}); |
||||
} |
||||
|
||||
public render() { |
||||
const { value } = this.props; |
||||
const self = this; |
||||
|
||||
return { |
||||
type: 'bi.vtape', |
||||
cls: 'bi-background', |
||||
items: [{ |
||||
type: 'dec.setting.header', |
||||
height: 40, |
||||
listeners: [{ |
||||
eventName: 'EVENT_CANCEL', |
||||
action: function () { |
||||
self.fireEvent('EVENT_CHANGE'); |
||||
}, |
||||
}, { |
||||
eventName: 'EVENT_SAVE', |
||||
action: function () { |
||||
api.putTimeOut(Number(self.editor.getValue())); |
||||
self.fireEvent('EVENT_CHANGE'); |
||||
}, |
||||
}], |
||||
}, { |
||||
type: 'bi.vertical', |
||||
cls: 'bi-card', |
||||
hgap: 10, |
||||
vgap: 10, |
||||
items: [ |
||||
{ |
||||
type: 'bi.vertical_adapt', |
||||
cls: 'bi-border-bottom', |
||||
height: 32, |
||||
items: [{ |
||||
type: 'bi.label', |
||||
textAlign: 'left', |
||||
width: 120, |
||||
cls: 'dec-font-weight-bold', |
||||
text: BI.i18nText('Dec-Dcm_Connection_Timeout_Detection'), |
||||
}] |
||||
}, |
||||
{ |
||||
type: 'bi.vertical_adapt', |
||||
items: [{ |
||||
type: 'dec.label.editor.item', |
||||
text: BI.i18nText('Dec-Over_Time'), |
||||
textWidth: 100, |
||||
editorWidth: 80, |
||||
allowBlank: false, |
||||
value: value, |
||||
validationChecker: function(v) { |
||||
return BI.isPositiveInteger(v); |
||||
}, |
||||
errorText: BI.i18nText('BI-Please_Input_Positive_Integer'), |
||||
ref: function (_ref) { |
||||
self.editor = _ref; |
||||
}, |
||||
}, { |
||||
el: { |
||||
type: 'bi.label', |
||||
text: BI.i18nText('Dec-Dcm_Connection_Timeout_Millisecond'), |
||||
}, |
||||
lgap: 10, |
||||
}] |
||||
|
||||
},
|
||||
] |
||||
}], |
||||
ref: function (_ref) { |
||||
self.setting = _ref; |
||||
}, |
||||
}; |
||||
} |
||||
} |
Loading…
Reference in new issue