Files
cody-crm/frontend/packages/lib-shared/models/common.ts
wangziqi 72e2110987
Some checks failed
Synchronize to Gitee / repo-sync (push) Has been cancelled
Typos Checking / Spell Check with Typos (push) Has been cancelled
chore: initial commit
2026-06-23 11:56:23 +08:00

124 lines
2.8 KiB
TypeScript

import type { FilterResult } from '@cordys/web/src/components/pure/crm-advance-filter/type';
import { ColumnTypeEnum, OperatorEnum } from '@lib/shared/enums/commonEnum';
// 请求返回结构
export default interface CommonResponse<T> {
code: number;
message: string;
messageDetail: string;
data: T;
}
export interface SortParams {
name?: string;
type?: string; // asc或desc
}
// 表格查询
export interface TableQueryParams {
// 当前页
current?: number;
// 每页条数
pageSize?: number;
// 排序仅针对单个字段
sort?: SortParams;
// 表头筛选
filter?: object;
// 查询条件
keyword?: string;
// 视图ID
viewId?: string;
filterCondition?: FilterResult;
[key: string]: any;
}
export interface CommonList<T> {
[x: string]: any;
pageSize: number;
total: number;
current: number;
list: T[];
optionMap?: Record<string, any[]>;
}
export interface FilterConditionItem {
name: string;
value: any; // 期望值,若操作符为 BETWEEN, IN, NOT_IN 时为数组,其他操作符为单个值
operator: OperatorEnum;
multipleValue?: boolean;
}
export interface ExportTableColumnItem {
key: string;
title: string;
columnType: ColumnTypeEnum;
}
export interface TableExportParams extends TableQueryParams {
fileName: string; // 导出文件名
headList: ExportTableColumnItem[]; // 导出表头
}
export interface TableExportSelectedParams {
fileName: string;
headList: ExportTableColumnItem[];
ids: string[];
}
export interface TableDraggedParams {
moveId: string;
moveMode: 'BEFORE' | 'AFTER';
orgId: string;
targetId: string;
oldIndex: number;
newIndex: number;
}
export interface SystemVersion {
currentVersion: string; // 当前版本
releaseDate: string; // 发行日期
latestVersion: string; // 最新版本
architecture: string; // 系统架构
copyright: string; // 版权信息
hasNewVersion: boolean; // 是否有新版本
}
export interface ModuleDragParams {
dragNodeId: string;
dropNodeId: string;
dropPosition: number;
}
export interface ChartValueAxis {
fieldId: string;
aggregateMethod: string;
}
export interface ChartCategoryAxis {
fieldId: string;
}
export interface ChartConfig {
chatType: string; // TODO:chart
categoryAxis: ChartCategoryAxis;
subCategoryAxis?: ChartCategoryAxis;
valueAxis: ChartValueAxis;
}
export interface GenerateChartParams extends TableQueryParams {
chartConfig: ChartConfig;
poolId?: string | number;
}
export interface ChartResponseDataItem {
categoryAxis: string; // 类目 id
categoryAxisName: string; // 类目名称
subCategoryAxis: string; // 子类目 id
subCategoryAxisName: string; // 子类目名称
valueAxis: string; // 值
}
export interface ModuleField {
fieldId: string;
fieldValue: string | string[];
}