SUPPORT-8529: Добавлены компоненты взаимодействия с ConfigDataExecutor

This commit is contained in:
malkov34 2024-09-04 16:33:44 +03:00
parent d318a8bdae
commit c246132121
7 changed files with 197 additions and 61 deletions

View file

@ -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>

View 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');
}
}