import {tScopeSlotsType, tSlotsType} from "@peryl/react-compose"; import {iTableCellRenderScope} from "../../Table/table/utils/table.utils"; import {TableOptionSpace} from "./TableOption.space"; import {iAiConfiguration} from "../../$ai"; import {tPlc} from "../../Table/plc/utils/plc.utils"; /** * AutoTable插槽类型 * @author 韦胜健 * @date 2022.12.24 13:52 */ export const AutoTableSlotsOption = ['default', 'noData'] as const; export type iAutoTableSlotsType = tSlotsType /** * AutoTable作用域插槽类型 * @author 韦胜健 * @date 2022.12.24 13:52 */ export const AutoTableScopeSlotsOption = { test: (scope: iTableCellRenderScope) => {}, } as const; export type iAutoTableScopeSlotsType = tScopeSlotsType /** * AutoTable引用类型 * @author 韦胜健 * @date 2022.12.24 13:52 */ export type iAutoTableRefer = { refs: { el: HTMLElement | null | undefined }, props: { option: TableOptionSpace.iTableOption }, slots: iAutoTableSlotsType, scopeSlots: iAutoTableScopeSlotsType, } /** * 分页信息 * @author 韦胜健 * @date 2022.12.25 13:01 */ export interface iAutoTablePageData { page: number, size: number, hasNext: boolean, total?: null | number, } /** * AutoOption中配置AI的相关设置 * @author 韦胜健 * @date 2025/4/6 10:58 */ export interface iAutoTableAiConfig { search: boolean, sort: boolean, config: boolean, aiConfig?: iAiConfiguration, } /** * settingConfig中编辑的数据类型 * @author 韦胜健 * @date 2025/4/7 22:43 */ export interface iPlcConfigData { field: string, title?: string, order: number, align: string, width: number, fixed: string, hide?: boolean, plcRef: () => tPlc, key: string, } /** * 通过外部数据源的方式配置字段信息的数据类型 * @author 韦胜健 * @date 2025/4/7 22:43 */ export type iPlcCustomData = Partial> & { field: string } /*---------------------------------------table ai types-------------------------------------------*/ /*ai返回列表搜索的数据类型*/ export interface iTableAiOperateSearch { type: 'search', data: { filters: { id: string, field: string, filterHandler: string, value: any }[], filterExpression: string } } /*ai返回列表排序的数据类型*/ export interface iTableAiOperateSort { type: 'sort', data: { field: string, desc: boolean, title: string }[] } /*ai返回列表字段配置的数据类型*/ export interface iTableAiOperateConfig { type: 'config', data: iTableAiOperatePlcMeta[] } /*ai返回的解析错误的数据类型*/ export interface iTableAiOperateError { type: 'error', data: string } /** * ai返回的配置字段的耽搁字段配置数据类型 * @author 韦胜健 * @date 2025/4/7 22:47 */ export type iTableAiOperatePlcMeta = iPlcCustomData & { filterType: string } /*ai返回的数据类型*/ export type iTableAiOperate = iTableAiOperateSearch | iTableAiOperateSort | iTableAiOperateConfig | iTableAiOperateError