SUPPORT-8529: Добавлены компоненты взаимодействия с ConfigDataExecutor
This commit is contained in:
parent
d318a8bdae
commit
c246132121
7 changed files with 197 additions and 61 deletions
|
|
@ -0,0 +1,9 @@
|
|||
<div>
|
||||
<button type="button"
|
||||
[disabled]="!isEnabled()"
|
||||
class="btn btn-secondary"
|
||||
[ngbTooltip]="tooltip | emptyIfNull"
|
||||
(click)="onClick()"
|
||||
(focus)="onFocus()"
|
||||
(blur)="onBlur()">{{caption}}</button>
|
||||
</div>
|
||||
42
frontend/src/ts/ervu/ConfigExecuteBtn.ts
Normal file
42
frontend/src/ts/ervu/ConfigExecuteBtn.ts
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
import {ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef} from "@angular/core";
|
||||
import {AbstractButton, NotNull, ObjectRef, TextArea} from "@webbpm/base-package";
|
||||
import {ConfigExecutorRpcService} from "../generated/rpc/ConfigExecutorRpcService";
|
||||
|
||||
/**
|
||||
* @author: a.petrov
|
||||
*/
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'button-component',
|
||||
templateUrl: './../../../src/resources/template/app/component/ConfigExecuteBtn.html',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
})
|
||||
export class ConfigExecuteBtn extends AbstractButton {
|
||||
|
||||
@ObjectRef()
|
||||
@NotNull()
|
||||
public ervuIdField: TextArea;
|
||||
@NotNull()
|
||||
public methodPath: string;
|
||||
private script: ConfigExecutorRpcService;
|
||||
|
||||
constructor(el: ElementRef, cd: ChangeDetectorRef) {
|
||||
super(el, cd);
|
||||
}
|
||||
|
||||
public initialize() {
|
||||
super.initialize();
|
||||
this.script = this.getScript(ConfigExecutorRpcService)
|
||||
}
|
||||
|
||||
doClickActions(): Promise<any> {
|
||||
const methodPath = this.methodPath;
|
||||
const idsValue = this.ervuIdField.getValue();
|
||||
this.script.callConfigExecutor(methodPath, idsValue, true);
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
protected getFocusElement(): HTMLInputElement {
|
||||
return this.el.nativeElement.querySelector('button');
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue