update ctrl
This commit is contained in:
parent
a6c220b499
commit
20c21ea73d
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "axp-ts",
|
||||
"version": "1.9.8",
|
||||
"version": "1.9.9",
|
||||
"description": "TypeScript helper library",
|
||||
"author": "AntoXa PRO <info@antoxa.pro>",
|
||||
"homepage": "https://antoxahub.ru/antoxa/axp-ts",
|
||||
|
@ -3,7 +3,6 @@ import type { TNotificationItem } from '../notification'
|
||||
|
||||
import { FormSchemaCtrl } from './ctrl'
|
||||
|
||||
|
||||
/**
|
||||
* Интерфейс базовой формы для сущностей в БД.
|
||||
*/
|
||||
@ -101,4 +100,9 @@ export class BaseFormModel<T extends object = {}> implements IFormModel<T> {
|
||||
mergeObj(obj: any) {
|
||||
this.obj = Object.assign(this.obj, obj)
|
||||
}
|
||||
|
||||
updateCtrl(key: keyof T, ctrl: Partial<FormSchemaCtrl>) {
|
||||
const fieldIndex = this.ctrls.findIndex(e => e.key === key)
|
||||
this.ctrls[fieldIndex] = Object.assign(this.ctrls[fieldIndex], ctrl)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user