Единый интерфейс элементов
This commit is contained in:
@@ -1,21 +1,16 @@
|
||||
// Типы элементов интерфейса
|
||||
export type ElementType =
|
||||
| 'text'
|
||||
| 'select'
|
||||
| 'radio'
|
||||
| 'checkbox'
|
||||
| 'number'
|
||||
| 'textarea'
|
||||
| 'date'
|
||||
| 'standards'
|
||||
| 'calibration-conditions'
|
||||
| 'button-group'
|
||||
|
||||
// Импортируем ElementType из interface.ts
|
||||
import type { ElementType } from '@/entitiy/element/model/interface'
|
||||
|
||||
export interface ElementOption {
|
||||
value: string
|
||||
label: string
|
||||
}
|
||||
|
||||
// Реэкспортируем ElementType для удобства
|
||||
export type { ElementType }
|
||||
|
||||
// Расширенный тип для ячейки с указанием листа
|
||||
export interface CellTarget {
|
||||
sheet: string // название листа, например "L" или "R"
|
||||
@@ -64,6 +59,39 @@ export interface MergedCell {
|
||||
endCol: number
|
||||
}
|
||||
|
||||
// Определение атрибута (глобальный атрибут из API)
|
||||
export interface Attribute {
|
||||
id: string
|
||||
name: string
|
||||
is_required: boolean
|
||||
created_at: string
|
||||
updated_at: string
|
||||
deleted_at?: string | null
|
||||
}
|
||||
|
||||
// Детальная информация об атрибуте шаблона (из API)
|
||||
export interface TemplateAttributeDetail {
|
||||
attribute_id: string
|
||||
attribute_name: string
|
||||
is_required: boolean
|
||||
value: string | null
|
||||
created_at: string
|
||||
updated_at: string
|
||||
}
|
||||
|
||||
// Для совместимости со старым кодом - алиас
|
||||
export type CategoryField = Attribute
|
||||
export type CategoryFieldType = 'text' | 'select' | 'number' | 'textarea'
|
||||
export interface CategoryFieldOption {
|
||||
id: string
|
||||
value: string
|
||||
label: string
|
||||
}
|
||||
export interface CategoryFieldValue {
|
||||
fieldId: string
|
||||
value: string | number
|
||||
}
|
||||
|
||||
// Типы шаблонов
|
||||
export interface Template {
|
||||
id: string
|
||||
|
||||
Reference in New Issue
Block a user