chore: initial commit
Some checks failed
Synchronize to Gitee / repo-sync (push) Has been cancelled
Typos Checking / Spell Check with Typos (push) Has been cancelled

This commit is contained in:
2026-06-23 11:56:23 +08:00
commit 72e2110987
2883 changed files with 367388 additions and 0 deletions

View File

@@ -0,0 +1,73 @@
import type { TableQueryParams } from './common';
export interface AgentModuleRenameParams {
id: string;
name: string;
}
export interface AgentRenameParams {
id: string;
name: string;
agentModuleId: string;
}
export interface AddAgentModuleParams {
name: string;
parentId: string;
}
export interface AgentModuleTreeNode {
id: string;
name: string;
parentId: string;
organizationId: string;
children: AgentModuleTreeNode[];
}
export interface AddAgentParams {
name: string;
agentModuleId: string;
scopeIds: string[];
script: string;
type: string; // 添加方式
workspaceId: string; // 工作空间
applicationId: string; // 对应工作空间应用id
description: string;
}
export interface UpdateAgentParams extends AddAgentParams {
id: string;
}
export interface AgentTableQueryParams extends TableQueryParams {
agentModuleIds: string[];
}
export interface AgentMember {
id: string;
scope: string;
name: string;
}
export interface AgentDetail {
id: string;
name: string;
agentModuleId: string;
agentModuleName: string;
scopeId: string;
members: AgentMember[];
script: string;
description: string;
}
export type ApplicationScriptParams = Pick<AddAgentParams, 'applicationId' | 'workspaceId'>;
export interface AgentApplicationScript {
parameters: { parameter: string; value: string }[];
src: string;
}
export interface AgentPosParams {
moveId: string;
targetId: string;
moveMode: 'BEFORE' | 'AFTER';
}

View File

@@ -0,0 +1,89 @@
import type { CustomerSearchTypeEnum } from '../../enums/customerEnum';
import type { ModuleField, TableQueryParams } from '../common';
import type { SaveCustomerParams } from '@lib/shared/models/customer';
export interface SaveClueParams extends SaveCustomerParams {
contact?: string;
phone?: string;
}
export interface UpdateClueParams extends SaveClueParams {
id: string;
}
export interface ClueTransitionCustomerParams extends SaveCustomerParams {
clueId: string;
}
export interface ClueDetail {
id: string;
name: string;
owner: string;
ownerName: string;
contact: string;
phone: string;
departmentId: string;
departmentName: string;
stage: string;
lastStage: string;
createUser: string;
updateUser: string;
createTime: number;
updateTime: number;
createUserName: string;
updateUserName: string;
moduleFields: ModuleField[];
transitionType?: 'CUSTOMER' | 'OPPORTUNITY';
}
export interface ClueListItem extends ClueDetail {
inSharedPool: boolean;
latestFollowUpTime: number;
collectionTime: number;
reservedDays: number;
reasonName?: string;
hasPermission?: boolean;
}
export interface CluePoolTableParams extends TableQueryParams {
searchType?: CustomerSearchTypeEnum;
poolId?: string;
}
// 线索池线索列表项
export interface CluePoolListItem extends ClueListItem {
follower: string; // 最新跟进人
followerName: string; // 最新跟进人名称
followTime: number; // 最新跟进日期
poolId: string;
recyclePoolName: string; // 默认回收公海名称
}
export interface PickClueParams {
clueId: string;
poolId: string;
}
// 批量领取线索的请求参数
export interface BatchPickClueParams {
batchIds: (string | number)[];
poolId: string;
}
// 分配线索的请求参数
export interface AssignClueParams {
clueId: string;
assignUserId: string;
}
// 批量分配线索的请求参数
export interface BatchAssignClueParams {
batchIds: (string | number)[];
assignUserId: string;
}
export interface ConvertClueParams {
clueId: string;
oppCreated: boolean;
oppName: string;
}

View File

@@ -0,0 +1,123 @@
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[];
}

View File

@@ -0,0 +1,255 @@
import { AttachmentInfo } from '@cordys/web/src/components/business/crm-form-create/types';
import { ContractBusinessTitleStatusEnum } from '@lib/shared/enums/contractEnum';
import type { ModuleField, TableQueryParams } from './common';
import type { FormDesignConfigDetailParams } from './system/module';
import { ProcessStatusEnum } from '@lib/shared/enums/process';
// 合同列表项
export interface ContractItem {
id: string;
name: string;
customerId: string;
customerName: string;
amount: number;
alreadyPayAmount: number;
approved?: boolean;
approvalStatus: ProcessStatusEnum;
stage: string;
stageName: string;
owner: string;
ownerName: string;
createUser: string;
updateUser: string;
createTime: number;
updateTime: number;
createUserName: string;
updateUserName: string;
moduleFields: ModuleField[]; // 自定义字段
inCustomerPool: boolean;
poolId: string;
}
// 合同详情
export interface ContractDetail extends ContractItem {
optionMap?: Record<string, any[]>;
attachmentMap?: Record<string, AttachmentInfo[]>; // 附件信息映射
}
// 添加合同参数
export interface SaveContractParams {
name: string;
customerId: string; // 客户id
amount?: number; // 金额
owner: string; // 负责人
moduleFields: ModuleField[]; // 自定义字段
}
// 更新合同参数
export interface UpdateContractParams extends SaveContractParams {
id: string;
}
export interface ApprovalContractParams {
id: string;
approvalStatus: string;
}
// 回款计划列表项
export interface PaymentPlanItem {
id: string;
name: string;
createUser: string;
updateUser: string;
createTime: number;
updateTime: number;
contractId: string;
owner: string;
planStatus: string;
planAmount: number;
planEndTime: number;
organizationId: string;
createUserName: string;
updateUserName: string;
ownerName: string;
departmentId: string;
departmentName: string;
contractName: string;
moduleFields: ModuleField[]; // 自定义字段
}
// 回款计划详情
export interface PaymentPlanDetail extends PaymentPlanItem {
optionMap?: Record<string, any[]>;
}
// 添加回款计划参数
export interface SavePaymentPlanParams {
contractId?: string;
owner?: string;
planStatus: string;
planAmount?: number;
planEndTime?: number;
}
// 更新回款计划参数
export interface UpdatePaymentPlanParams extends SavePaymentPlanParams {
id: string;
}
// 回款记录列表项
export interface PaymentRecordItem {
id: string;
createUser: string;
updateUser: string;
createTime: number;
updateTime: number;
name: string;
contractId: string;
owner: string;
amount: number;
invoiceType: string;
taxRate: number;
businessTitleId: string;
approvalStatus: string;
organizationId: string;
contractName: string;
ownerName: string;
createUserName: string;
updateUserName: string;
paymentPlanName: string;
paymentPlanId: string;
departmentId: string;
departmentName: string;
moduleFields: ModuleField[];
}
// 回款记录详情
export interface PaymentRecordDetail extends PaymentRecordItem {
optionMap?: Record<string, any[]>;
}
// 添加回款记录参数
export interface SavePaymentRecordParams {
contractId: string;
owner: string;
name: string;
paymentPlanId?: string;
recordAmount: number;
recordEndTime: number;
recordBank: string;
recordBankNo: string;
}
// 更新回款记录参数
export interface UpdatePaymentRecordParams extends SavePaymentRecordParams {
id: string;
}
export interface BusinessTitleItem {
id: string;
name: string;
type: 'THIRD_PARTY' | 'CUSTOM';
identificationNumber: string;
province: string; // 省
city: string; // 市
remark: string;
scale: string; // 企业规模
industry: string; // 国标行业
openingBank: string;
bankAccount: string;
registrationAddress: string;
phoneNumber: string;
registeredCapital: string;
companySize: string;
registrationNumber: string;
approvalStatus: ContractBusinessTitleStatusEnum;
unapprovedReason: string;
organizationId: string;
createUserName: string;
updateUserName: string;
createUser: string;
updateUser: string;
createTime: number;
updateTime: number;
}
export interface SaveBusinessTitleParams {
id?: string;
companyNumber?: string; // 公司编号
name: string; // 公司名称
identificationNumber: string; // 纳税人识别号
openingBank: string; // 开户银行
bankAccount: string; // 银行账号
registrationAddress: string; // 注册地址
phoneNumber: string; // 注册电话
registeredCapital: string; // 注册资本
companySize: string; // 公司规模
registrationNumber: string; //工商注册号
type: string; // 来源类型
province: string; // 省
city: string; // 市
remark: string;
scale: string; // 企业规模
industry: string; // 国标行业
}
export interface BusinessTitleValidateConfig {
id: string;
field: keyof SaveBusinessTitleParams;
title: string;
required: boolean;
disabled?: boolean;
organizationId: string;
rule?: Record<string, any>[];
}
export interface ContractInvoiceTableQueryParam extends TableQueryParams {
contractId?: string;
customerId?: string;
}
export interface ContractInvoiceItem {
id: string;
contractId: string;
approved?: boolean;
name: string;
no: string;
owner: string;
businessTitleId: string;
businessTitleName: string;
organizationId: string;
createUser: string;
createUserName: string;
updateUser: string;
updateUserName: string;
ownerName: string;
departmentId: string;
departmentName: string;
contractName: string;
paymentPlanId: string;
recordBank: string;
recordBankNo: string;
paymentPlanName: string;
planName: string;
moduleFields: ModuleField[]; // 自定义字段
recordAmount: number;
recordEndTime: number;
approvalStatus: ProcessStatusEnum;
}
export interface SaveContractInvoiceParams {
name: string;
contractId: string;
owner: string;
amount: number;
invoiceType: string;
taxRate: number;
businessTitleId: string;
moduleFormConfigDTO?: FormDesignConfigDetailParams;
}
export interface UpdateContractInvoiceParams extends SaveContractInvoiceParams {
id: string;
}
export interface ContractInvoiceDetail extends ContractInvoiceItem {
optionMap?: Record<string, any[]>;
attachmentMap?: Record<string, AttachmentInfo[]>; // 附件信息映射
}

View File

@@ -0,0 +1,114 @@
import type { FormCreateField } from '@cordys/web/src/components/business/crm-form-create/types';
import type { FormConfig } from '@lib/shared/models/system/module';
import type { RoleMemberRoleItem } from '@lib/shared/models/system/role';
import type { ModuleField, TableQueryParams } from '@lib/shared/models/common';
import type { SelectedUsersItem } from '@lib/shared/models/system/module';
export interface CustomFormSaveRequest {
id?: string;
name: string;
enable: boolean;
fields: FormCreateField[];
formProp: FormConfig;
}
export interface CustomFormDetail extends CustomFormSaveRequest {
id: string;
creator: SelectedUsersItem;
}
export interface CustomFormAdminParams {
customFormId: string;
userIds: string[];
}
export interface CustomFormRoleItem {
id: string;
name: string;
customFormId: string;
internalKey: string;
}
export interface CustomFormRoleUserQueryParams extends TableQueryParams {
customFormRoleId: string;
}
export interface RelateCustomFormMemberParams {
customFormRoleId: string;
deptIds?: string[];
roleIds?: string[];
userIds?: string[];
}
export interface CustomFormMemberItem {
id: string;
userId: string;
username: string;
departmentId: string;
departmentName: string;
position: string;
createTime: number;
roles: RoleMemberRoleItem[];
}
export interface CustomFormItem {
id: string;
name: string;
enable: boolean;
isAdmin: boolean;
hasCreateDataPermission: boolean;
}
export interface AddCustomFormDataParams {
customFormId: string;
name: string;
owner: string;
moduleFields: ModuleField[];
}
export interface UpdateCustomFormDataParams extends AddCustomFormDataParams {
id: string;
}
export interface GetCustomFormDataPageParams extends TableQueryParams {
customFormId: string;
}
export interface CustomFormPageItem {
id: string;
customFormId: string;
name: string;
owner: string;
ownerName: string;
createUser: string;
updateUser: string;
createTime: number;
updateTime: number;
createUserName: string;
updateUserName: string;
moduleFields: ModuleField[];
isAdmin: boolean;
}
export interface BatchUpdateCustomFormDataParams {
ids: string[];
customFormId: string;
name: string;
owner: string;
moduleFields: ModuleField[];
}
export interface CustomFormDataDetail {
id: string;
customFormId: string;
name: string;
owner: string;
ownerName: string;
createUser: string;
updateUser: string;
createTime: number;
updateTime: number;
createUserName: string;
updateUserName: string;
moduleFields: ModuleField[];
optionMap: Record<string, any>;
}

View File

@@ -0,0 +1,393 @@
import type { CustomerFollowPlanStatusEnum, CustomerSearchTypeEnum } from '../../enums/customerEnum';
import type { ModuleField, TableExportParams, TableQueryParams } from '../common';
export interface SaveCustomerParams {
name?: string;
owner: string; // 负责人
moduleFields?: ModuleField[];
}
export interface UpdateCustomerParams extends SaveCustomerParams {
id: string;
}
export interface CustomerTableParams extends TableQueryParams {
viewId: CustomerSearchTypeEnum; // 搜索类型(ALL/SELF/DEPARTMENT/CUSTOMER_COLLABORATION)
}
export interface CustomerListItem {
id: string;
name: string;
owner: string; // 负责人
inSharedPool: boolean; // 是否在公海池
dealStatus: string; // 最终成交状态
createUser: string;
updateUser: string;
createTime: number;
updateTime: number;
createUserName: string;
updateUserName: string;
departmentId: string;
departmentName: string;
latestFollowUpTime: number;
collectionTime: number;
reservedDays: number; // 剩余归属天数
moduleFields: ModuleField[];
}
export interface CustomerDetail {
id: string;
name: string;
owner: string;
createUser: string;
updateUser: string;
createTime: number;
updateTime: number;
createUserName: string;
updateUserName: string;
moduleFields: ModuleField[];
}
export interface SaveCustomerFollowRecordParams {
customerId: string;
opportunityId: string;
type: string;
clueId: string;
content: string;
owner: string;
contactId: string;
moduleFields: ModuleField[];
}
export interface UpdateCustomerFollowRecordParams extends SaveCustomerFollowRecordParams {
id: string;
}
export interface CustomerFollowRecordTableParams extends TableQueryParams {
sourceId: string; // 客户ID/商机ID/线索ID
}
export interface CustomerOpportunityTableParams extends TableQueryParams {
customerId: string; // 客户ID
}
export interface CustomerFollowRecordListItem {
id: string;
customerId: string;
customerName: string;
opportunityId: string;
type: string;
clueId: string;
clueName: string;
content: string; // 跟进内容
organizationId: string;
owner: string;
ownerName: string;
contactId: string;
contactName: string;
createUser: string;
createUserName: string;
updateUser: string;
updateUserName: string;
createTime: number;
updateTime: number;
followTime: number;
followMethod: string;
departmentId: string;
departmentName: string;
poolId: string;
moduleFields: ModuleField[];
}
export interface SaveCustomerFollowPlanParams extends SaveCustomerFollowRecordParams {
estimatedTime: number;
}
export interface UpdateCustomerFollowPlanParams extends SaveCustomerFollowPlanParams {
id: string;
}
export type StatusTagKey = Exclude<CustomerFollowPlanStatusEnum, CustomerFollowPlanStatusEnum.ALL>;
export interface CustomerFollowPlanTableParams extends TableQueryParams {
sourceId: string; // 客户ID/商机ID/线索ID
status: StatusTagKey; // 状态: ALL/PREPARED/UNDERWAY/COMPLETED/CANCELLED
myPlan?: boolean; // 个人中心查询时传入true
}
export interface CustomerFollowPlanListItem extends CustomerFollowRecordListItem {
estimatedTime: number;
status: StatusTagKey;
method: string;
converted: boolean;
}
export interface SaveCustomerContractParams {
customerId: string;
name: string;
owner: string;
enable: boolean;
moduleFields: ModuleField[];
}
export interface UpdateCustomerContractParams extends SaveCustomerContractParams {
id: string;
}
export interface CustomerContractTableParams extends TableQueryParams {
sourceId: string; // 客户ID
searchType?: CustomerSearchTypeEnum;
}
export interface CustomerContractListItem {
id: string;
createUser: string;
updateUser: string;
createTime: number;
updateTime: number;
customerId: string;
owner: string;
ownerName: string;
name: string;
enable: boolean; // 是否启用
disableReason: string; // 停用原因
organizationId: string;
departmentId: string;
departmentName: string;
customerName: string;
createUserName: string;
updateUserName: string;
moduleFields: ModuleField[];
phone: string; // 联系电话
}
export interface Condition {
column: string;
operator: string;
value: string;
}
export interface RecycleRule {
operator: string; // 操作符
conditions: Condition[]; // 规则条件集合
}
export interface PickRule {
limitOnNumber: boolean; // 是否限制每日领取数量
pickNumber: number; // 领取数量
limitPreOwner: boolean; // 是否限制前归属人领取
pickIntervalDays: number; // 领取间隔天数
}
export interface SaveCustomerOpenSeaParams {
name: string;
scopeIds: string[]; // 范围ID集合
ownerIds: string[]; // 管理员ID集合
enable: boolean;
auto: boolean; // 是否自动回收
pickRule: PickRule; // 领取规则
recycleRule: RecycleRule; // 回收规则
}
export interface UpdateCustomerOpenSeaParams extends SaveCustomerOpenSeaParams {
id: string;
}
export interface Member {
id: string;
scope: string;
name: string;
}
export interface CustomerOpenSeaListItem {
id: string;
createUser: string;
updateUser: string;
createTime: number;
updateTime: number;
organizationId: string;
name: string;
scopeId: string;
ownerId: string;
enable: boolean;
auto: boolean;
members: Member[];
owners: Member[];
createUserName: string;
updateUserName: string;
pickRule: PickRule;
recycleRule: RecycleRule;
}
export type FollowDetailItemType<T> = T;
// 跟进详情(跟进记录|跟进计划)
export type FollowDetailItem = FollowDetailItemType<CustomerFollowRecordListItem | CustomerFollowPlanListItem>;
export interface TransferParams {
ids?: (string | number)[];
owner: string | null; // 负责人
[key: string]: any;
}
export interface PickOpenSeaCustomerParams {
customerId: string;
poolId: string | number;
}
export interface BatchOperationOpenSeaCustomerParams {
batchIds: (string | number)[];
poolId?: string | number;
}
export interface BatchAssignOpenSeaCustomerParams extends BatchOperationOpenSeaCustomerParams {
assignUserId: string;
}
export interface AssignOpenSeaCustomerParams {
customerId: string;
assignUserId: string;
}
export interface OpenSeaCustomerTableParams extends TableQueryParams {
poolId: string;
}
export interface HeaderHistoryItem {
id: string;
customerId: string; // 客户id
owner: string; // 责任人
collectionTime: number; // 领取时间
endTime: number; // 结束时间
operator: string; // 操作人
operatorName: string; // 操作人名称
ownerName: string; // 责任人名称
departmentId: string;
departmentName: string;
}
export type RelationType = 'GROUP' | 'SUBSIDIARY';
export interface RelationItem {
customerId: string | number;
relationType: RelationType;
}
export interface RelationListItem extends RelationItem {
id: string | number;
customerName: string;
}
export type CollaborationType = 'READ_ONLY' | 'COLLABORATION';
export interface UpdateCustomerCollaborationParams {
id: string;
collaborationType: CollaborationType;
}
export interface AddCustomerCollaborationParams {
customerId: string;
userId: string;
collaborationType: CollaborationType;
}
export interface CollaborationItem {
id: string;
createUser: string;
updateUser: string;
createTime: number;
updateTime: number;
userId: string;
customerId: string;
collaborationType: CollaborationType;
userName: string;
createUserName: string;
updateUserName: string;
departmentId: string;
departmentName: string;
}
export interface AddCustomerRelationItemParams {
customerId: string;
relationType: string;
}
export interface UpdateCustomerRelationItemParams extends AddCustomerRelationItemParams {
id: string;
}
export interface CustomerOptionsItem {
id: string | number;
name: string;
editable: boolean; // 是否可编辑
}
export interface CustomerTabHidden {
all: boolean; // 是否显示所有数据tab
dept: boolean; // 是否显示部门数据tab
}
export interface UpdateFollowPlanStatusParams {
id: string;
status: StatusTagKey;
}
export interface MoveToPublicPoolParams {
id: string | number;
reasonId?: string | null;
}
export interface BatchMoveToPublicPoolParams {
ids: (string | number)[];
reasonId?: string | null;
}
export interface PoolTableExportParams extends TableExportParams {
poolId?: string;
}
export interface BatchUpdatePoolAccountParams {
ids: (string | number)[];
fieldId: string | null;
fieldValue: any;
}
export interface MergeAccountParams {
mergeIds: string[]; // 合并客户ids
toMergeId: string | null; // 合并目标客户id
ownerId: string | null;
}
export interface CustomerInvoiceStatistic {
contractAmount: number;
uninvoicedAmount: number;
invoicedAmount: number;
}
export interface CustomerInvoiceItem {
id: string;
createUser: string;
updateUser: string;
createTime: number;
updateTime: number;
name: string;
contractId: string;
owner: string;
amount: number;
invoiceType: string;
taxRate: number;
businessTitleId: string;
approvalStatus: string;
organizationId: string;
contractName: string;
ownerName: string;
createUserName: string;
updateUserName: string;
departmentId: string;
departmentName: string;
businessTitleName: string;
moduleFields: ModuleField[];
}
export interface CustomerInvoicePageQueryParams extends TableQueryParams {
customerId: string;
}

View File

@@ -0,0 +1,76 @@
import type { TableQueryParams } from './common';
import type { SelectedUsersItem } from './system/module';
import type { CrmTreeNodeData } from '@cordys/web/src/components/pure/crm-tree/type';
export interface DashboardModuleRenameParams {
id: string;
name: string;
}
export interface DashboardAddModuleParams {
parentId: string;
name: string;
}
export interface DashboardAddParams {
dashboardModuleId: string;
resourceUrl: string;
scopeIds: string[];
name: string;
description: string;
}
export interface DashboardUpdateParams extends DashboardAddParams {
id: string;
}
export interface DashboardRenameParams {
dashboardModuleId: string;
id: string;
name: string;
}
export interface DashboardTableItem {
id: string;
createUser: string;
updateUser: string;
createTime: number;
updateTime: number;
name: string;
resourceUrl: string;
dashboardModuleId: string;
organizationId: string;
pos: number;
scopeId: string;
description: string;
}
export interface DashboardTableQueryParams extends TableQueryParams {
dashboardModuleIds: string[];
}
export type DashboardModuleTreeItem = CrmTreeNodeData<{ type: 'MODULE' | 'DASHBOARD'; myCollect: boolean }>;
export interface DashboardDetail {
dashboardModuleId: string;
members: SelectedUsersItem[];
id: string;
description: string;
dashboardModuleName: string;
name: string;
scopeId: string;
resourceUrl: string;
}
export interface DashboardDragParams {
moveId: string;
targetId: string;
dashboardModuleId: string;
moveMode: string;
}
export interface DashboardModuleDragParams {
dragNodeId: string;
dropNodeId: string;
dropPosition: number;
}

View File

@@ -0,0 +1,42 @@
export interface GetHomeStatisticParams {
searchType: string;
deptIds: string[];
userField?: string;
timeField?: string;
winOrderTimeField?: string; // 赢单维度字段
priorPeriodEnable?: boolean;
}
export interface DimPeriodValue {
value: number;
priorPeriodCompareRate: number;
}
// 跟进商机
export interface FollowOptStatisticDetail {
todayOpportunity: DimPeriodValue;
thisWeekOpportunity: DimPeriodValue;
thisMonthOpportunity: DimPeriodValue;
thisYearOpportunity: DimPeriodValue;
thisYearOpportunityAmount: DimPeriodValue;
thisMonthOpportunityAmount: DimPeriodValue;
thisWeekOpportunityAmount: DimPeriodValue;
todayOpportunityAmount: DimPeriodValue;
}
// 线索统计
export interface HomeLeadStatisticDetail {
thisYearClue: DimPeriodValue;
thisMonthClue: DimPeriodValue;
thisWeekClue: DimPeriodValue;
todayClue: DimPeriodValue;
}
// 赢单统计
export interface HomeWinOrderDetail {
thisYearOpportunity: DimPeriodValue;
thisMonthOpportunity: DimPeriodValue;
thisWeekOpportunity: DimPeriodValue;
todayOpportunity: DimPeriodValue;
thisYearOpportunityAmount: DimPeriodValue;
thisMonthOpportunityAmount: DimPeriodValue;
thisWeekOpportunityAmount: DimPeriodValue;
todayOpportunityAmount: DimPeriodValue;
}

View File

@@ -0,0 +1,221 @@
import type { ModuleField, TableQueryParams } from './common';
import type { FormDesignConfigDetailParams } from '@lib/shared/models/system/module';
import { ProcessStatusEnum } from '@lib/shared/enums/process';
import type { CirculationTypeEnum, CirculationValueTypeEnum } from '@lib/shared/enums/opportunityEnum';
import type { FormCreateField } from '@cordys/web/src/components/business/crm-form-create/types';
export interface OpportunityItem {
id: string; // 商机ID
name: string;
status: string;
opportunityName: string; // 商机名称
customerId: string;
customerName: string; // 客户名称
createUser: string; // 创建人ID
updateUser: string; // 更新人ID
createTime: number; // 创建时间
updateTime: number; // 更新时间
createUserName: string; // 创建人名称
updateUserName: string; // 更新人名称
reservedDays: number; // 归属天数
stage: string;
stageName: string;
lastStage: string;
inCustomerPool: boolean;
poolId?: string;
failureReason: string;
hasPermission?: boolean;
moduleFields: ModuleField[]; // 自定义字段
amount: number; // 金额
}
export interface SaveOpportunityParams {
name: string;
customerId: string; // 客户id
amount: number; // 金额
products: string[]; // 意向产品
possible: number; // 可能性
contactId: string; // 联系人ID
owner: string; // 负责人
moduleFields: ModuleField[]; // 自定义字段
}
export interface UpdateOpportunityParams extends SaveOpportunityParams {
id: string;
}
export interface OpportunityDetail extends OpportunityItem {
id: string;
name: string;
amount: number;
possible: number;
products: string[];
contactId: string;
contactName: string;
stage: string; // 当前阶段
status: string;
owner: string;
ownerName: string;
lastStage: string; // 上一个阶段
}
export interface UpdateStageParams {
id: string;
stage: string;
// expectedEndTime?: number; // 预计结束时间
failureReason?: string | null; // 失败原因
voidReason?: string;
fields?: ModuleField[];
}
export interface StageBoardPageQueryParams extends TableQueryParams {
board?: boolean; // 是否是看板模式
}
export interface StageBoardDraggedParams {
dragNodeId: string;
dropNodeId: string;
dropPosition: number;
stage: string;
}
export interface UpdateStageBaseParams {
id: string;
name: string;
}
export interface UpdateOpportunityStageParams {
rate: string;
}
export interface UpdateOpportunityStageRollbackParams {
afootRollBack: boolean;
endRollBack: boolean;
}
export interface StageBaseParams {
name: string;
type: 'AFOOT' | 'END';
dropPosition: number;
targetId: string;
}
export interface AddOpportunityStageParams extends StageBaseParams {
rate: string;
}
export interface StageConfigBaseItem {
id: string;
createUser: string;
updateUser: string;
createTime: number;
updateTime: number;
name: string;
type: 'AFOOT' | 'END';
afootRollBack: boolean;
endRollBack: boolean;
pos: number;
organizationId: string;
}
export interface StageConfigItem extends StageConfigBaseItem {
rate: string;
}
export interface OpportunityStageConfig {
stageConfigList: StageConfigItem[];
afootRollBack: boolean;
endRollBack: boolean;
stageHasData: boolean;
circulationType: CirculationTypeEnum;
advancedConfigs: CirculationSetting[];
}
export interface QuotationQueryParams extends TableQueryParams {
board?: boolean; // 是否是看板模式
}
export interface QuotationItem {
id: string;
name: string;
approved?: boolean;
approvalStatus: ProcessStatusEnum;
invalid: boolean;
opportunityId: string;
opportunityName: string;
amount: number;
createUser: string;
updateUser: string;
createTime: number;
updateTime: number;
createUserName: string;
updateUserName: string;
moduleFields: ModuleField[];
products?: any[];
}
export interface SaveQuotationParams {
name: string;
opportunityId: string;
amount: number;
moduleFields: ModuleField[]; // 自定义字段
moduleFormConfigDTO?: FormDesignConfigDetailParams;
}
export interface UpdateQuotationParams extends SaveQuotationParams {
id: string;
approvalStatus: ProcessStatusEnum;
}
export interface ApproveQuotation {
id: string;
name: string;
opportunityId: string;
approvalStatus: ProcessStatusEnum;
moduleFormConfigDTO?: FormDesignConfigDetailParams;
moduleFields: ModuleField[];
products: any[];
}
export interface BatchUpdateQuotationStatusParams {
ids: (string | number)[];
approvalStatus: ProcessStatusEnum;
}
export interface BatchVoidQuotationStatusParams {
ids: (string | number)[];
}
export interface BatchOperationResult {
success: number;
fail: number;
skip?: number;
errorMessages?: string;
}
export interface CirculationFieldValueItem {
fieldId?: string;
fieldValue: any;
required: boolean;
valueType: CirculationValueTypeEnum;
// 前端渲染使用
fieldProps?: FormCreateField;
}
export interface CirculationFieldTargetItem {
targetId: string;
enable: boolean;
circulationFieldValues: CirculationFieldValueItem[];
}
export interface CirculationSetting {
originId: string;
targets: CirculationFieldTargetItem[];
moduleType: string;
// 前端渲染使用
name?: string;
type?: 'AFOOT' | 'END' | string;
}
export interface SaveCirculationConfigParams {
circulationType: CirculationTypeEnum;
circulationSettings: CirculationSetting[];
}

View File

@@ -0,0 +1,47 @@
import type { ModuleField } from './common';
import type { FormDesignConfigDetailParams } from '@lib/shared/models/system/module';
import { ProcessStatusEnum } from '@lib/shared/enums/process';
export interface SaveOrderParams {
name: string;
customerId: string; // 客户id
contractId: string;
amount?: number; // 金额
owner: string; // 负责人
moduleFields?: ModuleField[]; // 自定义字段
moduleFormConfigDTO?: FormDesignConfigDetailParams;
}
export interface UpdateOrderParams extends SaveOrderParams {
id: string;
}
export interface OrderItem {
id: string;
name: string;
approved?: boolean;
contractName: string;
contractId: string;
moduleFields: ModuleField[]; // 自定义字段
createUser: string;
updateUser: string;
customerId: string;
owner: string;
number: string;
stage: string;
approvalStatus: ProcessStatusEnum;
stageName: string;
organizationId: string;
customerName: string;
createUserName: string;
updateUserName: string;
departmentId: string;
departmentName: string;
createTime:number;
updateTime:number;
amount:number;
inCustomerPool: boolean;
poolId: string;
optionMap?: Record<string, any>;
attachmentMap?: Record<string, any>;
}

View File

@@ -0,0 +1,33 @@
import type { ModuleField } from './common';
export interface ProductListItem {
id: string;
name: string;
status: string;
price: number;
createUser: string;
updateUser: string;
createTime: number;
updateTime: number;
createUserName: string;
updateUserName: string;
moduleFields: ModuleField[];
}
export interface SaveProductParams {
name: string;
moduleFields: ModuleField[];
}
export interface UpdateProductParams extends SaveProductParams {
id: string;
}
export interface UpdatePriceParams extends SaveProductParams {
id: string;
status: boolean;
}
export interface AddPriceParams extends SaveProductParams {
status: boolean;
}

View File

@@ -0,0 +1,9 @@
export interface LicenseInfo {
status: string | null;
corporation: string; // 客户名称
expired: string; // 授权时间
product: string; // 产品名称
edition: string; // 版本
licenseVersion: string; // 授权版本
count: number; // 授权数量
}

View File

@@ -0,0 +1,292 @@
import type { CompanyTypeEnum } from '../../enums/commonEnum';
import type { TableQueryParams } from '../common';
import { PersonalExportStatusEnum } from '@lib/shared/enums/systemEnum';
// 邮件设置
export interface ConfigEmailParams {
host: string; // SMTP 主机
port: string; // SMTP 端口
account: string; // SMTP 账号
password: string; // SMTP 密码
from: string; // 指定发件人
recipient: string; // 指定收件人
ssl: string; // SSL 开关
tsl: string; // TSL 开关
}
// 三方扫码登录配置基础类型
export interface ThirdPartyBaseLoginConfig {
agentId: string;
appSecret: string;
corpId: string;
startEnable: boolean;
}
// 钉钉扫码登录配置类型
export interface ThirdPartyDingTalkLoginConfig extends ThirdPartyBaseLoginConfig {
appId: string;
}
// 飞书扫码登录配置类型
export interface ThirdPartyLarkLoginConfig extends ThirdPartyBaseLoginConfig {
redirectUrl: string;
}
// DE配置类型
export interface ThirdPartyDEConfig {
agentId:string;
appSecret:string;
deAccessKey:string;
deAutoSync: boolean;
deBoardEnable: boolean;
deOrgID: string;
deSecretKey: string;
redirectUrl: string;
}
// sql智能体配置类型
export interface ThirdPartySQLBotConfig {
appSecret:string;
sqlBotChatEnable: boolean;
sqlBotBoardEnable: boolean;
}
// maxKB配置类型
export interface ThirdPartyMKConfig {
appSecret:string;
mkAddress: string;
mkEnable: boolean;
}
// 大单网配置类型
export interface ThirdPartyTenderConfig {
tenderAddress:string;
tenderEnable:boolean;
}
// 企查查配置类型
export interface ThirdPartyQccConfig{
qccAddress:string;
qccAccessKey:string;
qccSecretKey:string;
qccEnable:boolean;
}
export interface ThirdPartyResourceConfig{
type: CompanyTypeEnum;
verify: boolean;
config: Record<string, any>;
}
// 同步组织和扫码登录数据类型
export interface SyncAndScanItem extends ThirdPartyResourceConfig {
title: string;
description: string;
logo: string;
hasConfig: boolean;
}
export interface ThirdPartyResource {
id: string;
createUser: string;
updateUser: string;
createTime: number;
updateTime: number;
type: string;
organizationId: string;
sync: boolean;
syncResource: CompanyTypeEnum;
enable: boolean;
}
export interface DEOrgItem {
id: string;
name: string;
}
// 同步组织和扫码卡片数据类型
export interface IntegrationItem extends ThirdPartyResourceConfig {
type: CompanyTypeEnum; // 类型
title: string;
description: string;
logo: string;
hasConfig: boolean;
}
// 三方类型集合设置
export interface OptionDTO {
id: string; // key
name: string; // value
}
// 认证设置
export interface Auth {
description: string; // 描述
name: string; // 名称
type: string; // 类型 OAUTH2, LDAP, OIDC, CAS
enable: boolean; // 是否启用
}
export interface AuthForm extends Auth {
id?: string; // 认证源ID
configuration: Record<string, any>;
}
export interface AuthUpdateParams extends Auth {
id?: string; // 认证源ID
configuration: string; // 认证源配置
}
export interface AuthItem extends Auth {
id: string; // ID
createUser: string; // 创建人
updateUser: string; // 修改人
createTime: number; // 创建时间
updateTime: number; // 更新时间
configId: string; // 配置id
content: string; // 配置内容
}
export interface AuthTableQueryParams extends TableQueryParams {
configId: string; // 认证设置id
}
// 个人中心
export interface PersonalInfoRequest {
email: string;
phone: string;
}
export interface PersonalPassword {
originPassword: string;
password: string;
confirmPassword: string;
}
export interface SendEmailDTO {
email: string;
}
export interface RepeatClueParams extends TableQueryParams {
name: string;
id?: string;
}
export interface RepeatCustomerItem {
id: string;
name: string;
owner: string;
ownerName: string;
createTime: number;
repeatType: string;
clueCount: number;
clueModuleEnable: boolean;
opportunityCount: number;
opportunityModuleEnable: boolean;
}
export interface RepeatContactItem {
id: string;
name: string;
customerName: string;
ownerName: string;
createTime: number;
phone: string;
enable: boolean;
opportunityCount: number;
}
export interface RepeatClueItem {
id: string;
name: string;
owner: string;
stage: string;
ownerName: string;
contact: string;
phone: string;
}
export interface RepeatOpportunityItem {
id: string;
name: string;
customerId: string;
customerName: string;
stage: string;
products: string[];
productNames: string[];
owner: string;
ownerName: string;
productNameList: string[];
}
export interface ExportCenterListParams {
keyword: string;
exportType: string;
exportStatus: string;
}
export interface ExportCenterItem {
id: string;
createUser: string;
updateUser: string;
createTime: number;
updateTime: number;
fileName: string;
resourceType: string;
fileId: string;
status: PersonalExportStatusEnum;
organizationId: string;
}
export interface ApiKey {
id: string;
createUser: string;
accessKey: string;
secretKey: string;
createTime: number;
enable: boolean;
forever: boolean;
expireTime: number;
description: string;
}
export interface ApiKeyItem extends ApiKey {
isExpire: boolean;
desensitization: boolean;
showDescInput: boolean;
}
export interface DefaultTimeForm {
activeTimeType: string;
time?: number;
desc: string;
}
export interface UpdateApiKeyParams {
id: string;
forever?: boolean;
expireTime?: number;
description: string;
}
interface ParamItem {
paramKey: string; // 参数的 key
paramValue: string; // 参数的值
type: string; // 参数类型,一般是 string
}
// 保存基础信息、邮箱信息接口入参
export type SaveInfoParams = ParamItem[];
// 界面设置
export interface SavePageConfigParams {
fileList: (File | undefined)[];
request: (Record<string, any> | undefined)[];
}
interface FileParamItem extends ParamItem {
file: string;
fileName: string;
}
// 页面配置返回参数
export type PageConfigReturns = FileParamItem[];

View File

@@ -0,0 +1,46 @@
import type { TableQueryParams } from '../common';
export interface LoginLogParams extends TableQueryParams {
operator: string | null;
startTime?: number;
endTime?: number;
}
export interface LoginLogItem {
id: string;
createTime: number;
operator: string;
loginAddress: string;
platform: 'WEB' | 'MOBILE'; // 平台,WEB\MOBILE
operatorName: string;
}
export interface OperationLogParams extends LoginLogParams {
type?: string | null;
module?: string | null;
}
export interface OperationLogItem {
id: string;
operator: string;
operatorName: string;
createTime: number;
module: string;
type: string;
resourceName: string;
detail: string;
}
export interface OperationLogDetailDiffItem {
column: string;
oldValue: string;
newValue: string;
columnName: string;
oldValueName: string | number;
newValueName: string | number;
type: string;
}
export interface OperationLogDetail extends OperationLogItem {
diffs?: OperationLogDetailDiffItem[];
}

View File

@@ -0,0 +1,7 @@
export interface LoginParams {
username: string;
password: string;
authenticate: string;
loginAddress?: string;
platform: 'WEB' | 'MOBILE'; // 平台,WEB\MOBILE
}

View File

@@ -0,0 +1,120 @@
import type { TableQueryParams } from '../common';
import { SelectedUsersItem } from '@lib/shared/models/system/module';
export interface AnnouncementSaveParams {
id?: string;
subject: string; // 公告标题
content: string;
startTime: number;
endTime: number;
url: string; // 链接
organizationId: string;
deptIds: string[];
userIds: string[];
renameUrl: string;
range: [number, number] | undefined;
ownerIds: SelectedUsersItem[];
}
export interface AnnouncementTableQueryParams extends TableQueryParams {
organizationId: string;
}
export interface AnnouncementItemDetail {
id: string;
createUser: string;
updateUser: string;
createTime: number;
updateTime: number;
subject: string; // 公告标题
content: string; // 公告内容
startTime: number; // 公告开始时间
endTime: number; // 公告结束时间
url: string; // 公告链接
receiver: string; // 接收人
organizationId: string; // 组织ID
notice: boolean; // 是否为通知公告
receiveType: string; // 接收类型
contentText: string; // 公告文本内容
createUserName: string;
updateUserName: string;
renameUrl: string;
deptIdName: SelectedUsersItem[]; // 部门
userIdName: SelectedUsersItem[]; // 用户
}
export interface MessageTaskDetailDTOItem {
event: string;
eventName: string;
sysEnable: boolean;
emailEnable: boolean;
weComEnable: boolean;
dingTalkEnable: boolean;
larkEnable: boolean;
}
export interface MessageConfigItem extends MessageTaskDetailDTOItem {
id: string;
module: string; // 消息配置功能
moduleName: string; // 消息配置功能名称
messageTaskDetailDTOList: MessageTaskDetailDTOItem[];
}
export interface MessageSettingsConfig {
timeList: {
timeValue: number;
timeUnit: string;
}[];
userIds: string[];
roleIds: string[];
ownerEnable: boolean;
ownerLevel: number;
roleEnable: boolean;
userIdNames: { id: string; name: string }[];
roleIdNames: { id: string; name: string }[];
}
export interface SaveMessageConfigParams {
module: string;
event: string;
emailEnable?: boolean;
sysEnable?: boolean;
weComEnable?: boolean;
dingTalkEnable?: boolean;
larkEnable?: boolean;
config?:MessageSettingsConfig;
}
export interface MessageCenterItem {
id: string;
type: string; // 通知类型
receiver: string;
subject: string;
status: string;
operator: string;
operation: string;
organizationId: string;
resourceId: string;
resourceType: string; // 资源类型
resourceName: string; // 资源名称
content: string; // 通知内容
createUser: string;
updateUser: string;
createTime: number;
updateTime: number;
contentText: string;
}
export interface MessageCenterQueryParams extends TableQueryParams {
type: string;
status: string;
resourceType: string;
createTime: number | null;
endTime: number | null;
}
export type MessageCenterSubsetParams = Pick<
MessageCenterQueryParams,
'type' | 'status' | 'resourceType' | 'createTime' | 'endTime'
>;

View File

@@ -0,0 +1,274 @@
import type { FormDesignKeyEnum, FormLinkScenarioEnum } from '../../enums/formDesignEnum';
import type { ModuleField, TableQueryParams } from '../common';
import type { FormCreateField } from '@cordys/web/src/components/business/crm-form-create/types';
import { MemberSelectTypeEnum, ReasonTypeEnum } from '@lib/shared/enums/moduleEnum';
export interface ModuleNavCommon {
id?: string;
createUser?: string;
updateUser?: string;
createTime?: number;
updateTime?: number;
organizationId?: string;
enable: boolean;
pos?: number;
}
// 模块首页-导航模块列表
export interface ModuleNavBaseInfoItem extends ModuleNavCommon {
moduleKey: string;
disabled?: boolean;
}
// 顶部导航配置
export interface ModuleNavTopItem extends ModuleNavCommon {
navigationKey: string;
}
export interface ModuleNavItem extends ModuleNavBaseInfoItem {
icon: string;
key: string;
label: string;
}
// 模块首页-导航模块排序入参
export interface ModuleSortParams {
start: number;
end: number;
dragModuleId: string; // 拖拽模块ID
}
export interface SelectedUsersItem {
id: string; // ID
scope?: MemberSelectTypeEnum; // 范围
name: string; // 名称
disabled?: boolean;
}
export interface ModuleConditionsItem {
column: string;
operator: string;
value: string;
scope?: string[];
}
export interface OpportunityBaseInfoItem {
name: string;
enable: boolean;
operator: string; // 操作符
auto: boolean; // 自动回收
}
// 模块商机列表
export interface OpportunityItem extends OpportunityBaseInfoItem {
id: string;
organizationId: string;
ownerId: string; // 管理员ID
scopeId: string; // 范围ID
condition: string; // 回收条件
createUser: string;
updateUser: string;
createTime: number;
updateTime: number;
members: SelectedUsersItem[]; // 成员集合
owners: SelectedUsersItem[]; // 管理员集合
createUserName: string;
updateUserName: string;
}
// 模块商机详情
export interface OpportunityDetail extends OpportunityBaseInfoItem {
id?: string;
conditions: ModuleConditionsItem[]; // 规则条件集合
}
export interface OpportunityParams extends OpportunityDetail {
scopeIds: string[];
ownerIds: string[];
}
// 线索池领取规则
export interface CluePoolPickRuleParams {
limitOnNumber: boolean; // 是否限制领取数量
pickNumber?: number; // 领取数量
limitPreOwner: boolean; // 是否限制前归属人领取
pickIntervalDays?: number; // 领取间隔天数
limitNew: boolean; // 是否限制新数据领取
newPickInterval?: number; // 新数据领取间隔天数
}
// 线索池回收规则
export interface CluePoolRecycleRuleParams {
operator: string; // 操作符
conditions: ModuleConditionsItem[]; // 规则条件集合
}
// 编辑线索池请求参数
export interface CluePoolParams {
id?: string; // ID
name: string; // 线索池名称
scopeIds: string[]; // 范围ID集合
ownerIds: string[]; // 管理员ID集合
enable: boolean; // 启用/禁用
auto: boolean; // 自动回收
pickRule: CluePoolPickRuleParams; // 领取规则
recycleRule: CluePoolRecycleRuleParams; // 回收规则
hiddenFieldIds: string[]; // 隐藏的表格字段
}
export interface CluePoolForm extends Omit<CluePoolParams, 'scopeIds' | 'ownerIds'> {
adminIds: SelectedUsersItem[];
userIds: SelectedUsersItem[]; // 成员ID
hiddenFieldIds: string[]; // 隐藏的表格字段
}
// 线索池列表项
export interface CluePoolItem {
id: string;
createUser: string;
updateUser: string;
updateUserName: string;
createTime: number;
updateTime: number;
name: string;
scopeId: string;
organizationId: string;
ownerId: string;
enable: boolean;
auto: boolean;
members: SelectedUsersItem[];
owners: SelectedUsersItem[];
pickRule: CluePoolPickRuleParams; // 领取规则
recycleRule: CluePoolRecycleRuleParams; // 回收规则
fieldConfigs: {
editable: boolean;
enable: boolean;
fieldId: string;
fieldName: string;
}[]; // 隐藏的表格字段
}
// 库容参数
export interface CapacityParams {
scopeIds: string[]; // 范围ID集合
capacity?: number; // 容量
}
// 库容列表项
export interface CapacityItem {
id: string;
createUser: string;
updateUser: string;
createTime: number;
updateTime: number;
organizationId: string;
scopeId: string;
capacity: number;
members: SelectedUsersItem[];
filters?: { column: 'string'; operator: 'string'; value: 'string' }[];
}
// 表单设计保存参数
export type FormFooterDirection = 'flex-row' | 'flex-row-reverse' | 'justify-center';
export interface FormActionButton {
text: string;
enable: boolean;
}
export interface FormFieldLinkItem {
current: string;
link: string;
enable: boolean;
}
export interface FormConfigLinkScenarioItem {
key: FormLinkScenarioEnum;
linkFields: FormFieldLinkItem[];
}
export type FormConfigLinkProp = Partial<Record<FormDesignKeyEnum, FormConfigLinkScenarioItem[]>>;
export type FormViewSize = 'small' | 'medium' | 'large';
export interface FormConfig {
layout: number;
labelPos: 'left' | 'top';
inputWidth: 'custom' | 'full';
optBtnContent: FormActionButton[];
optBtnPos: FormFooterDirection;
viewSize?: FormViewSize;
linkProp?: FormConfigLinkProp;
}
export interface SaveFormDesignConfigParams {
formKey: FormDesignKeyEnum;
fields: FormCreateField[];
formProp: FormConfig;
}
export interface FormDesignConfigDetailParams {
fields: FormCreateField[];
formProp: FormConfig;
}
export interface FormDesignDataSourceTableQueryParams extends TableQueryParams {
field: string;
}
export interface ReasonParams {
id?: string;
name: string;
module: ReasonTypeEnum;
}
export interface UpdateReasonEnableParams {
module: ReasonTypeEnum;
enable: boolean;
}
export interface ReasonItem {
id: string;
createUser: string;
updateUser: string;
createTime: number;
updateTime: number;
name: string;
module: ReasonTypeEnum;
type: string;
organizationId: string;
}
export interface ReasonConfig {
enable: boolean;
dictList: ReasonItem[];
}
export interface SortReasonParams {
dragDictId: string; // 拖拽元素id
start: number; // 排序前
end: number; // 排序后
}
export interface DefaultSearchSetFormModel {
searchFields: Record<string, any>;
resultDisplay: boolean;
sortSetting: string[];
}
export interface CheckRepeatParams {
id: string;
value: string;
formKey: string;
}
export interface CheckRepeatInfo {
repeat: boolean;
name: string;
}
export interface GetRefDataSourceFieldParams {
sourceIds: string[];
dataSourceType: string;
}
export interface RefDataSourceFieldItem {
id: string;
moduleFields: ModuleField[];
optionMap?: Record<string, any[]>;
[key: string]: any;
}

View File

@@ -0,0 +1,109 @@
import type { TableQueryParams } from '../common';
import { UserInfo } from '../user';
import { SelectedUsersItem } from '@lib/shared/models/system/module';
// 添加部门
export interface DepartmentItemParams {
name: string;
parentId: string;
}
export interface UpdateDepartmentItemParams {
name: string;
id: string;
}
// 设置部门负责人
export interface SetCommanderParams {
departmentId: string;
commanderId: string | null;
}
export interface SetCommanderForm extends SetCommanderParams {
ownerIds: SelectedUsersItem[];
}
export interface MemberRoleItem {
id: string;
name: string;
userId: string;
}
export interface UserTableQueryParams extends TableQueryParams {
departmentId?: string;
}
export interface BaseMemberInfo {
phone: string;
gender: boolean; // 性别(false-男/true-女)
email: string;
name: string;
departmentId: string | null;
position: string; // 职位
employeeId: string; // 工号
employeeType: string | null; // 员工类型
supervisorId: string | null; // 直属上级
workCity: string | null; // 工作城市
enable: boolean; // 是否启用
roleIds: string[]; // 角色
userGroupIds: string[]; // 用户组
onboardingDate: number | null; // 入职日期
}
export interface MemberItem extends BaseMemberInfo {
id: string;
userId: string; // 用户ID
userName: string;
organizationId: string;
roles: MemberRoleItem[];
userGroups: MemberRoleItem[];
createUser: string;
createUserName: string;
updateUser: string;
updateUserName: string;
createTime: number;
updateTime: number;
departmentName: string;
supervisorName: string; // 直属上级名称
commander: boolean; // 是否是负责人
}
export interface MemberParams extends BaseMemberInfo {
id?: string;
userName: string;
roles: {
id: string;
name: string;
userId: string;
}[];
}
export interface ErrorMessagesType {
rowNum: number;
errMsg: string;
}
// 导入校验信息
export interface ValidateInfo {
failCount: number;
successCount: number;
errorMessages: ErrorMessagesType[];
}
export interface OrgUserInfo extends Omit<UserInfo, 'roles'> {
userId: string;
userName: string;
departmentName: string;
roles: MemberRoleItem[];
}
export interface DragNodeParams {
dragNodeId: string;
dropNodeId: string;
dropPosition: -1 | 0 | 1; // -1dropNodeId节点之前。 1dropNodeId节点后 0dropNodeId节点内
}
export interface DEToken {
url: string;
token: string;
}

View File

@@ -0,0 +1,352 @@
import {
ApprovalLevelDirectionEnum,
ApprovalOperationEnum,
ApprovalTypeEnum,
ApproverTypeEnum,
ProcessStatusEnum,
type ApprovalResourceTypeEnum,
} from '@lib/shared/enums/process';
import { RequestEnum } from '@lib/shared/enums/httpEnum';
import type { SelectedUsersItem } from './module';
import type { OptionDTO } from './business';
import type { FilterForm } from '@cordys/web/src/components/pure/crm-advance-filter/type';
import type { UserInfo } from '@lib/shared/models/user';
import {
ApprovalFieldPermissionModeEnum,
ApprovalNodeTypeEnum,
EmptyApproverActionEnum,
MultiApproverModeEnum,
SameSubmitterActionEnum,
} from '@lib/shared/enums/process';
import type { ActionNode, ConditionBranch } from '@cordys/web/src/components/business/crm-flow/types';
import type { TableQueryParams } from '../common';
import type { AttachmentInfo } from '@cordys/web/src/components/business/crm-form-create/types';
export interface BaseItem {
id: string;
name: string;
}
// 权限项
export interface PermissionItem {
id: string;
name: string;
enabled: boolean;
}
// 审批流程基本信息接口
export interface ApprovalProcessItem extends BaseItem {
number: string;
formType: string;
createExecute: boolean;
updateExecute: boolean;
deleteExecute: boolean;
enable: boolean;
submitterCanRevoke: boolean;
allowBatchProcess: boolean;
allowWithdraw: boolean;
allowAddSign: boolean;
duplicateApproverRule: string;
requireComment: boolean;
organizationId: string;
createUserName: string;
createUser: string;
updateUser: string;
updateUserName: string;
createTime: number;
updateTime: number;
}
// 审批权限详情
export interface ApprovalPermissionsDetail {
permissions: PermissionItem[];
statusPermissions: StatusPermissions[];
}
export interface ApprovalFieldPermission {
fieldId: string;
permissionType: ApprovalFieldPermissionModeEnum;
}
export interface ApprovalFieldUpdateConfig {
fieldId: string | null;
fieldValue: any;
enable: boolean;
}
export interface ApprovalWebhookConfig {
webHookDescribe: string;
webHookEnable: boolean;
webHookUrl: string;
webHookMethod: RequestEnum;
webHookHeader: string;
webHookBody: string;
}
export interface ApprovalPostConfig {
fieldUpdateConfigs: ApprovalFieldUpdateConfig[];
webHookConfig?: ApprovalWebhookConfig;
}
// 后端审批流节点的基础结构
export interface ApprovalProcessNodeBase<TNodeType extends ApprovalNodeTypeEnum> extends BaseItem {
nodeType: TNodeType;
number?: string;
sort: number;
}
// 审批节点里前后端共用的业务配置
export interface ApprovalNodeParticipantConfig {
approvalType: ApprovalTypeEnum; // 审批类型:人工审批/自动通过/自动拒绝
approverType: ApproverTypeEnum | null;
approverDirection?: ApprovalLevelDirectionEnum;
approverList: string[]; // 审批人配置列表:成员 ID / 角色 ID / 层级等
approverSelectOptions?: OptionDTO[]; // 审批人选择项(用于前端回显)
multiApproverMode: MultiApproverModeEnum; // 多人审批方式
emptyApproverAction: EmptyApproverActionEnum; // 异常处理-审批人为空时动作
fallbackApprover: string | null; // 异常处理-兜底审批人
fallbackApproverName?: string;
sameSubmitterAction: SameSubmitterActionEnum; // 异常处理-审批人与提交人相同时动作
ccType: ApproverTypeEnum | null; // 抄送人
ccDirection?: ApprovalLevelDirectionEnum;
ccList: string[]; // 抄送人配置列表:成员 ID / 角色 ID / 层级等
ccSelectOptions?: OptionDTO[]; // 抄送人选择项(用于前端回显)
passPostConfig?: ApprovalPostConfig; // 审批通过后配置
rejectPostConfig?: ApprovalPostConfig; // 审批驳回后配置
fieldPermissions?: ApprovalFieldPermission[]; // 字段权限配置列表
}
export type ApprovalProcessStartNode = ApprovalProcessNodeBase<ApprovalNodeTypeEnum.START>;
export type ApprovalProcessEndNode = ApprovalProcessNodeBase<ApprovalNodeTypeEnum.END>;
export interface ApprovalProcessApproverNode
extends ApprovalProcessNodeBase<ApprovalNodeTypeEnum.APPROVER>,
ApprovalNodeParticipantConfig {}
export interface ApprovalProcessConditionNode extends ApprovalProcessNodeBase<ApprovalNodeTypeEnum.CONDITION> {
nodeType: ApprovalNodeTypeEnum.CONDITION;
conditionConfig?: FilterForm;
}
export type ApprovalProcessDefaultNode = ApprovalProcessNodeBase<ApprovalNodeTypeEnum.DEFAULT>;
export type ApprovalProcessNode =
| ApprovalProcessStartNode
| ApprovalProcessEndNode
| ApprovalProcessApproverNode
| ApprovalProcessConditionNode
| ApprovalProcessDefaultNode;
// 审批动作节点(前端审批流图使用)
export interface ApprovalActionNode extends ActionNode, ApprovalNodeParticipantConfig {
approverSelectedList?: SelectedUsersItem[]; // 前端展示用的审批人选中列表
emptyApproverSelectedList?: SelectedUsersItem[]; // 异常处理-前端展示用的
ccSelectedList?: SelectedUsersItem[]; // 前端展示用的抄送选中列表
}
// 审批条件分支(前端审批流图使用)
export interface ApprovalConditionBranch extends ConditionBranch {
conditionConfig?: FilterForm;
}
// 状态权限
export interface StatusPermissions {
approvalStatus: ProcessStatusEnum;
permission: string;
enabled: boolean;
}
// 基本表单参数
export interface BasicFormParams {
name: string;
formType: string;
description: string;
createExecute: boolean; // 创建执行
updateExecute: boolean; // 更新执行
deleteExecute: boolean; // 删除执行
}
// 更多设置参数
export interface MoreSettingsParams {
submitterCanRevoke: boolean;
allowBatchProcess: boolean;
allowWithdraw: boolean;
allowAddSign: boolean;
duplicateApproverRule: string;
requireComment: boolean;
permissions: BaseItem[];
statusPermissions: StatusPermissions[];
}
export interface ApprovalNodeLinkResponse {
id: string;
fromNodeId: string;
toNodeId: string;
}
export interface ApprovalFlowNodeConfig {
nodes: ApprovalProcessNode[];
links: ApprovalNodeLinkResponse[];
}
export interface AddApprovalProcessParams extends BasicFormParams, MoreSettingsParams {
enable: boolean;
createNodeConfig?: ApprovalFlowNodeConfig;
updateNodeConfig?: ApprovalFlowNodeConfig;
deleteNodeConfig?: ApprovalFlowNodeConfig;
}
export interface UpdateApprovalProcessParams extends AddApprovalProcessParams {
id: string;
}
export interface ApprovalProcessDetail extends UpdateApprovalProcessParams {
permissions: PermissionItem[];
id: string;
number: string;
optionMap?: Record<string, any[]>;
}
export interface ApprovalProcessForm {
id: string;
enable: boolean;
createNodeConfig?: ApprovalFlowNodeConfig;
updateNodeConfig?: ApprovalFlowNodeConfig;
deleteNodeConfig?: ApprovalFlowNodeConfig;
basicConfig: BasicFormParams;
moreConfig: MoreSettingsParams;
}
export interface ApproverItem extends Pick<UserInfo, 'id' | 'name' | 'avatar'> {
approveResult: ProcessStatusEnum;
approveReason: string;
}
export interface ApprovalPopoverDetail {
resourceId: string;
approveStatus: ProcessStatusEnum;
approveUserList: ApproverItem[];
}
export interface CommonApprovalActionParams {
resourceId: string;
formKey: string;
}
export interface ApprovalTodoTableParams extends TableQueryParams {
resourceName?: string;
resourceType: ApprovalResourceTypeEnum;
}
export interface ApprovalTodoItem {
approvalTaskId: string;
approvalNodeId: string;
approvalInstanceId: string;
approvalId: string;
approvalFlowId: string;
approvalFlowVersionId: string;
resourceId: string;
resourceName: string;
resourceType: ApprovalResourceTypeEnum;
applicant: string;
submitTime: number;
approvalOperation: ApprovalOperationEnum;
dataResult: ProcessStatusEnum;
}
export interface ApprovalOperationParams {
id: string;
nodeId: string;
instanceId: string;
approverId: string;
comment?: string;
attachmentIds: string[];
module: string;
}
export interface ApprovalBackParams extends ApprovalOperationParams {
returnToNodeId: string;
}
export interface ApprovalAddSignParams extends ApprovalOperationParams {
type: string;
signApprover: string;
}
export interface BatchRejectApprovalParams {
ids: string[];
comment: string;
attachmentIds: string[];
}
export interface BatchApprovalParams {
ids: string[];
comment?: string;
attachmentIds: string[];
}
export interface TodoStatistic {
total: number;
quotation: number;
contract: number;
order: number;
invoice: number;
}
export interface ApprovalDetail {
id: string;
submitterId: string;
submitAvatar: string;
submitter: string;
submitTime: number;
comment: string;
result: string;
approvalStatus: ProcessStatusEnum;
currentNodeId: string;
currentNodeFieldPermissions: string;
nodes: ApprovalNode[];
}
export interface ApprovalNode {
taskId: string;
recordId: string;
nodeId: string;
nodeName: string;
endNode: boolean;
approverId: string;
approver: string;
approvalStatus: ProcessStatusEnum;
approvalTime: number;
comment: string;
attachments: AttachmentInfo[];
ccNodes: CcNode[];
nodeRound: number; // 节点轮次
taskNodes: ApprovalNodeTaskNode[];
multiApproverMode: MultiApproverModeEnum; // 多人审批方式
backNode: boolean; // 是否回退节点
backReason: string; // 回退原因
backAttachments: AttachmentInfo[]; // 回退附件
}
export interface ApprovalNodeTaskNode {
taskId: string;
approverId: string;
approver: string;
approverAvatar: string;
approvalStatus: ProcessStatusEnum;
recordId: string;
comment: string;
attachments: AttachmentInfo[];
approvalTime: number;
sign: boolean; // 是否加签任务
signAction: boolean; // 是否操作加签
signComment: string; // 加签备注
signAttachments: AttachmentInfo[]; // 加签附件
}
export interface CcNode {
ccUserId: string;
ccUserName: string;
ccUserAvatar: string;
}

View File

@@ -0,0 +1,121 @@
import type { DeptNodeTypeEnum } from '../../enums/systemEnum';
import type { TableQueryParams } from '../common';
// 角色关联用户分页列表接口参数
export interface RoleMemberTableQueryParams extends TableQueryParams {
roleId?: string;
}
// 角色关联用户接口参数
export interface RelateRoleMemberParams {
roleId: string;
deptIds?: string[];
roleIds?: string[];
userIds?: string[];
}
export interface PermissionItem {
id: string;
name: string;
enable: boolean;
license: boolean;
}
// 权限树节点
export interface PermissionTreeNode {
id: string;
name: string;
license: boolean;
enable: boolean;
permissions: PermissionItem[];
children: PermissionTreeNode[];
}
export interface RolePermissionItem {
id: string;
enable: boolean;
}
export interface Role {
name: string;
dataScope?: string;
deptIds?: string[];
description?: string;
}
export interface RoleCreateParams extends Role {
permissions: RolePermissionItem[];
}
export interface RoleUpdateParams extends Role {
id: string;
permissions?: RolePermissionItem[];
}
export interface RoleDetail extends Role {
id: string;
deptIds: string[];
permissions: PermissionTreeNode[];
}
// 部门用户树成员
export interface DeptTreeMember {
id: string;
name: string;
parentId: string;
organizationId: string;
}
export type DeptNodeType = DeptNodeTypeEnum;
// 部门用户树节点
export interface DeptUserTreeNode {
id: string;
name: string;
parentId: string;
organizationId: string;
children?: DeptTreeMember[];
nodeType?: DeptNodeType;
enabled?: boolean; // 是否启用
}
// 部门树节点
export interface DeptTreeNode {
id: string;
name: string;
parentId: string;
organizationId: string;
}
// 角色列表项
export interface RoleItem {
id: string;
createUser?: string;
updateUser?: string;
createTime?: number;
updateTime?: number;
name: string;
internal: boolean; // 是否内置
dataScope: string;
description?: string;
organizationId?: string;
createUserName?: string;
updateUserName?: string;
[key: string]: any; // 前端扩展字段
}
export interface RoleMemberRoleItem {
id: string;
name: string;
userId: string;
}
export interface RoleMemberItem {
id: string;
userId: string;
userName: string;
enable: boolean;
departmentId: string;
departmentName: string;
position: string;
createTime: number;
roles: RoleMemberRoleItem[];
}

View File

@@ -0,0 +1,33 @@
import type { MessageCenterItem } from '@lib/shared/models/system/message';
export interface UserInfo {
id: string;
name: string;
email: string;
password: string;
enable: boolean;
createTime: number;
updateTime: number;
language: string;
lastOrganizationId: string;
phone: string;
source: string;
createUser: string;
updateUser: string;
platformInfo: string;
avatar: string;
permissionIds: string[];
organizationIds: string[];
csrfToken: string;
sessionId: string;
roles: string[];
departmentId: string;
departmentName: string;
defaultPwd: boolean;
}
export interface MessageInfo {
read: boolean;
notificationDTOList: MessageCenterItem[];
announcementDTOList: MessageCenterItem[];
}

View File

@@ -0,0 +1,15 @@
import type { FilterForm, FilterResult } from '@cordys/web/src/components/pure/crm-advance-filter/type';
export interface ViewParams extends FilterResult {
id?: string;
name: string;
}
export interface ViewItem extends FilterForm {
id: string;
name: string;
fixed: boolean;
enable: boolean;
type?: string;
optionMap?: Record<string, any>;
}