import { Moment } from 'moment'; import { CSSProperties } from 'react'; import { temporaryData } from './models/temporaryData'; import { BasicsAttribute } from './utils/attribute'; import { AttributeStyle } from './utils/external-attribute'; import { ProjectGeneral, HealthStatusObject, ProjectStatusExample } from './utils/project'; import { HealthStatus, ForbiddenTime, BudgetEditTypeApiCode } from './utils/project/const'; import { UserIdentity } from './utils/userIdentity'; import { ArchivingStatusType } from './utils/itemCode'; import { BasicsInstanceTab } from './hooks/useTabInfo/type'; import { workflowApprove } from './pages/qualityData/utils'; declare namespace APP { type user = { email: string; id: string; name: string; role: string; surname: string; username: string; avatar?: string; hasAuthFuncAuth: boolean; hasLogFuncAuth: boolean; hasUserFuncAuth: boolean; }; type settings = { collapsed: boolean; }; type appInfo = { title: string; name: string; }; type pageInfo = { // 页面标题 name: string; // 页面路径 path: string; // 子页面 route: { name: string; path: string; }; }; type historyBackOff = { // 当前页 currentPage: number; // 页面路径 path: string; }; interface Message { error: (text: string) => void; [k: string]: any; } interface CodeItemList { apicode: T; children: CodeItemList[]; description: string; icon: string; id: string; name: string; pid: null; readonly: boolean; sort: number; status: boolean; code?: string; value?: string; label?: string; [k: string]: any; } interface BudgetEditType extends CodeItemList { children: BudgetEditType[]; } interface CreateInstanceResult { affectedIn: string | null; canDel: boolean; checkOut: string | null; code: string; createBy: string; createTime: string; delFlag: number; id: string; itemCode: number; lifecycleId: string | null; objectApicode: string; objectId: string; publishTime: string | null; publishing: string | null; standardPartId: string | null; tenantId: string; updateBy: string | null; updateTime: string; versionNumber: string; versionOrder: string; workflowCode: string; workspaceId: string; } type Project = { /** 当前项目实例的id */ id: string; name: string; projectName: string; healthList: HealthStatusObject[]; /** 编辑预算费用方式的配置列表 */ budgetEditTypeList: BudgetEditType[]; /** 概览进度列表数据 */ dateTableData: { name: string; start: string; apicode: string; end: string; days: string; start_gap: string; end_gap: string; days_gap: string; progress: string; progress_name: string; forbiddenTime: Record; attrs: { days: BasicsAttribute; start: BasicsAttribute; end: BasicsAttribute; progress?: BasicsAttribute; }; id: number; }[]; /** 健康状态 */ health?: HealthStatus; /** 所有者 */ owner: string; /** 转移所有者目标用户 */ transferOwner: string; /** 预算费用 */ budget: string | number; /** 实际费用 */ actual: string | number; /** 项目实例所在的项目id */ projectId: string; /** 是否自上而下 */ isTopDown: boolean; /** 日历 */ ownerType: "" | "1"; calendar: Partial & { startFormat: string; endFormat: string; isInit: boolean; }; calendarInstance: OnChainProject.GanttCalendarInstance | null; /** 项目经理 */ projectManager: string; projectStatusName: string; /** 项目大类 apicode: id 映射 */ columnApiCodeIdMap: Record; /** 是否模板下拉列表 */ isTemplateList: CodeItemList<"Yes" | "No">[]; /** 是否是模板状态 */ // templateState: CodeItemList; /** 是否是模板 */ isTemplate: boolean; /** 当前进度 */ currentProcess: string; /** 计划进度 */ scheduleProcess: string; /** 已用工时 */ usedHours: string; /** 计划开始时间 */ startDate: string; /** 计划结束时间 */ endDate: string; /** 计划时长 */ days: string; /** 当前实例是否在发布后 基线变更中删除 */ isDeleteInProcess: boolean; /** listCode列表缓存对象 */ listCodeListCacheObject: Record; }; type instanceInfoType = { /** @deprecated 实例 id */ id: string; /** 实例 id */ insId: string; /** 产品id */ productId: string; /** 产品名称 */ productName: string; /** 通用描述(name) */ insDesc: string; /** 服务端给的是`number`或者`string`,这里使用`any`类型处理,可以使用`==`隐方转换 */ itemCode: any; /** 实例类型名称 */ objectName: string; /** 实例类型 id */ objectId: string; /** 实例类型 ApiCode */ objectApicode: string; /** 实例拥有的使有公有属性 */ BasicAttrs: BasicsAttribute[]; /** 编辑权限,以及所有的数据 */ updateInstanceVo: Record; /** 所有tab页签 */ allTabs: BasicsInstanceTab[]; /** 实际渲染的页签(例如概览就通过公有属性转换过来) */ tabs: any[]; /** 实施对象tab页签 */ effectTabs: any; /** tab页签的数量 */ tabInsCountMap: any; /** 是否有子节点 */ insBom: boolean; /** 是否在变更流程中 */ inChangeOrderWorkflow: any; /**@deprecated 项目是否在变更流程中 */ affectedInPCO: boolean; /** 实例在哪些流程中 */ affectedIn: string; /** 工作流id */ workflowId: string; /** 编号 */ number: string; Name: string; /** 当前版本 */ currentVersion: string; /** 当前版号 */ currentVersionOrder: string; /**@deprecated 最新版本 */ insVersion: string; /** 最新版号 */ insVersionOrder: string | number; /** 最新版本过权限 (有'~#~') */ insVersionWithAuth: string; /** 最新版次过权限 (有'~#~') */ insVersionOrderWithAuth: string; /** 最新版本(无'~#~') */ insVersionUnbound: string; /** 最新版次(无'~#~') */ insVersionOrderUnbound: string; /** 签出状态 */ checkOut: boolean; /** 属性id:属性值 */ attributes: { [k: string]: any }; /** @deprecated */ attributeList: { apiCode: string; attrId: string; attrValue: string; [k: string]: any; }[]; /** 基本属性布局方式 upperAndLowerLayout: 上下布局 | leftAndRightLayout: 左右布局 */ attributeStyle: AttributeStyle; userDetails: { [k: string]: any }; userItemCode: any; UserContent: { [k: string]: any }; archivingStatus?: ArchivingStatusType; /** 工作流拒绝时的指定目标用户ID */ workflowRejectTargetUserId?: string; workflow: Workflow["workflow"]; /** 生命周期 */ lifecycle: { id: string; instanceId: string; objectId: string | null; apicode: string; name: string; showName: string; color: string; status: boolean; bomRule: string; sort: number; code: number; isBase: boolean; objectShowName: string | null; objectBomRule: string | null; }; children?: instanceInfoType[]; [k: string]: any; }; /** 工作流 */ interface Workflow extends instanceInfoType { changeType: "order" | "request"; children?: Workflow[]; workflow: { cancel: boolean; changeId: string; changeItemCode: number; changeNumber: string; changeTypeName: string; crtNodeClazz: string; crtNodeId: string; crtNodeIntoTime: string; crtNodeName: string; end: boolean; publish: boolean; waitingApprovalObjectInstanceIds: string; wfDefId: string; wfDefName: string; wfId: string; wfName: string; [k: string]: any; }; workflowNodes: { children: Array; code: string; id: string; name: string; sort: number; type: string; [k: string]: any; }[]; workflowInstance: { change_instance_desc: string; change_instance_id: string; change_instance_item_code: number; change_instance_no: string; change_instance_type: string; create_by: string; create_time: string; follower: string; id: string; init_type: number; instance_name: string; is_cancel: boolean; is_denied: boolean; is_end: boolean; is_pause: boolean; is_publish: boolean; org_id: string; product_id: string; reject_src_node_id: string; remark: string; running_node_id: string; running_node_name: string; running_node_sort: number; status: string; update_by: string; update_time: string; workflow_definition_id: string; workflow_definition_name: string; workflow_definition_version: string; workflow_definition_version_id: string; [k: string]: any; }; workflowNodesThumb: { ActiveNodes: any[]; BranchNodes: any; MainNode: Record; [k: string]: any; }[]; } /** 文件实例 */ interface FileInstance extends instanceInfoType { fileUrl: any; fileName: any; FileFormat: any; FileSize: any; FileSizeWithAuth: any; storeNumber: any; CheckOutUser: any; onlineEditStatus: any; LastEditTime: any; } /** 物料实例 */ interface MaterialInstance extends instanceInfoType { extraAttr: any; } interface BasicsProjectInstance extends instanceInfoType, Workflow { /** 实例在哪些流程中 (PSCO: 状态变更 | PCO: 基线变更) */ affectedIn: "PCO" | "PSCO" | ""; /** 日历id */ calendarId: string; /** 前置任务已完成 */ preComplete: boolean; /** 预算编辑方式 */ budgetEditType: string; /** 项目版本号 */ projectVersionOrder: string; /** 前置任务 */ preTask: string; /** 后置任务 */ postTask: string; /** 目标交付数量 */ targetDeliveryCount: string; /** 资源用户 */ resUsers?: string[]; /** 是否模板 */ isTemplate?: boolean; /** 父级预算费用 */ pbudget?: string; /** 父级类型 */ pobjectApicode?: string; children?: BasicsProjectInstance[]; } /** 项目实例 */ interface ProjectInstance extends BasicsProjectInstance { project: Project; projectGeneral: ProjectGeneral; projectStatusExample: ProjectStatusExample; children?: ProjectInstance[]; } /** 个性化配置 */ interface Personality extends OnChainProject.Personality { /** 是否有科目数据 */ isHasSubject: boolean; /** 全局可替代bom */ globalSubstituteCopyBom: boolean; /** BOM位号和数量强制检查 */ bomCheck: boolean; /** 是否显示无权限字段 */ showNoPermissionField: boolean; /** 是否显示缩略图 */ showThumb: boolean; /**页面滚动加载数量 */ pageScrollingNum: number; [k: string]: any; } interface CurrentUserInfo { id?: any; consumerName?: any; empno?: any; orgCode?: any; email?: any; name?: any; avatar?: any; status?: any; deptname?: any; description?: any; managerRoles: string; otherRoles: string; managerRoleApicodes: string; otherRoleApicodes: string; hasLogFuncAuth: boolean; hasUserFuncAuth: boolean; hasAuthFuncAuth: boolean; userManager: boolean; } /** 产品清单对象 */ interface Detailed { canDel: boolean; category: string; icon: string; id: string; isShow: number; name: string; parentId: string; sort: number; type: string; [k: string]: any; } /** 全局模块对象 */ interface Module { alias: string; apiContext: string; apicode: string; id: string; itemCodes: null | number; name: string; pathCode: null | string; shortcutsCode: string; sort: number; status: boolean; } /** 产品数据实例分类对象 */ interface InstanceClassify { belongModule: string; butTabCode: null; children: InstanceClassify | null; conditionId: null; count: number; delFlag: boolean; icon: string; id: string; itemCode: number; leaf: boolean; level: number; name: string; objectApicode: string | null; parentId: string | null; pathCode: string | null; sort: number; type: number; } } declare interface ResponseData { code: number; message: string; result: T; success: boolean; warning: boolean; timestamp: number; [k: string]: any; } /** * Base props */ interface BaseComponentProps { className?: string; children?: React.ReactNode; id?: string; ref?: React.Ref; style?: CSSProperties; } export type logType = | "create" | "add" | "del" | "update" | "sort" | "display" | "enable" | "disable" | "other" | "transfer" | "reduction" | "unlock" | "saveAs" | "export" | "release" | "upload" | "addAppro" //添加审批人 | "addConcern" //添加关注人 | "delAppro" | "delConcern" | "download" | "importCreate" | "importUpdate"; export type tableType = | "menu" | "cad" | "coderule" | "version" | "authorization" | "list" | "condition" | "object" | "attribute" | "role" | "instance" | "lifecycle" | "extension" | "depart" | "tab" | "configEmail" | "configCustomization" | "configSso" | "configFormat" | "configPrint" | "departInfo" | "userStrategy" | "expression" | "workflow" | "user" | "userGroup" | "printSignature" | "filter" | "trigger" | "printTemplate"; interface SetOperateLogProps { id: string; table: tableType; type: logType; val: { name?: string; description: string; }; } export interface QiankunStateFromMaster { operateLog: (params: SetOperateLogProps) => void; generateAddDescription: ( labelVal: Record, newVal: Record ) => string; generateUpdateDescription: ( labelVal: Record, oldVal: Record, newVal: Record ) => string; getLabelInOptions: (params: { value: string | boolean | string[]; options: any; adaptor?: | { label: string; value: string; children?: string | undefined; } | undefined; }) => any; operateTypeMap: Record; } export interface ClipboardArray extends Array { namespace?: string; type?: "shear" | "copy"; onPasteCallback?: (runtimeNamespace: string) => Promise; }