/* eslint-disable camelcase */ import { Expose, Type } from 'class-transformer' class OrderByModel { @Expose() column!: string @Expose() sort_type!: 'ASC' | 'DESC' } class ColumnModel { @Expose() data!: string } export class ListModel { @Expose() name!: string @Expose() value!: string } export class DatatableModel { @Expose() start!: number @Type(() => Number) @Expose() limit!: number @Expose() search_str!: string @Expose() order_by!: OrderByModel[] @Expose() columns?: ColumnModel[] @Expose() other_params?: any constructor() { this.start = 0 this.limit = 20 this.search_str = '' this.order_by = [] this.columns = [] this.other_params = {} } } export class DatatableFilterModel { @Expose() title!: string @Expose() name!: string @Expose() type!: 'button' | 'input' | 'cascader' | 'select' | 'date' @Expose() clearable?: boolean @Type(() => Number) @Expose() col!: number @Expose() date_type?: string @Expose() options?: { shortcuts: Array<{ text: string, onClick: any }> } @Expose() placeholder?: string @Expose() multiple?: boolean @Expose() list?: Array constructor() { this.title = '' this.name = '' this.type = 'select' this.col = 5 this.clearable = true } }