import { IProjectGlj } from './glj'; import { IBill } from './bill'; import { IProject, IProjectPermission } from './project'; import { IRation } from './ration'; import { IFeeRateFile } from './feeRate'; import { ICalcProgramFile } from './calculation'; import { IConfigMaterial } from './configMaterial'; export interface IAny { [prop: string]: any; } export interface ITreeScm { ID: string; parentID: string; seq: number; } export interface IFileRef { ID: string; name: string; type?: number; } export interface INumFileRef { ID: number; name: string; type?: number; isDefault?: boolean; } export enum DeleteEnum { NORMAL = 1, DELETED, COMPLETEDELETED, } // 返回数据接口 export interface IResult { errno: number; message: string; data: T; } export enum FromType { STD = 'std', CPT = 'cpt', } export enum RationPrefix { BOR = '借', CPT = '补', REP = '换', } // 工料机生成的类型 export enum GljCreateType { NORMAL = 'normal', ADD = 'add', REPLACE = 'replace', } export enum CreateLocation { CSXM = 1, // 模板子目分别放在措施项目下 FBFX = 2, // 模板子目分别放在分部分项下 HNTZM = 3, // 模板子目分别放在对应混凝土子目下 } export enum BRType { // 1 :大项费用 2:分部 3分项 4清单;5补项 6 定额、7 量价、8 工料机定额 DXFY = 1, // 大项费用 FB = 2, // 分部 FX = 3, // 分项 BILL = 4, // 清单 BX = 5, // 这个补项因为旧版本是后定义的,所以放在后面,为了统一不混淆 CS = 6, // 分类 DT = 7, // 费用明细 RATION = 20, // 定额 INST = 21, // 安装增加费生成的定额 VP = 22, // 量价 GLJ = 23, // 工料机 OH = 24, // 超高子目 ITEM = 25, // 子目增加 // 虚拟节点,主材、设备,只是显示 MAIN = 50, // 主材 EQUIP = 51, // 设备 } export enum SupplyType { ZXCG = 1, // 自行采购 BFJG, // 部分甲供 WQJG, // 完全甲供 JGCL, // 甲供材料 (“完全甲供”改文字为“甲供材料”) JDYG, // 甲定乙供 } export interface IUpdate { filter: T; update: T; } export interface ICreate { document: T; } export interface IDelete { filter: T; } export interface IBulkWrite { update?: IUpdate[]; create?: ICreate[]; remove?: IDelete[]; } export enum CptModelName { projects = 'projects', bills = 'bills', rations = 'rations', rationGljs = 'rationGljs', shareList = 'shareList', unitPriceFile = 'unitPriceFile', feeRateFile = 'feeRateFile', labourCoeFile = 'labourCoeFile', importLogs = 'importLogs', cptRationSectionTpl = 'cptRationSectionTpl', cptGlj = 'cptGlj', cptGljTree = 'cptGljTree', cptRationCoeList = 'cptRationCoeList', cptRationInstallation = 'cptRationInstallation', cptRationInstallationSection = 'cptRationInstallationSection', cptRationItems = 'cptRationItems', cptRationChapterTrees = 'cptRationChapterTrees', configMaterials = 'configMaterials', projectGljs = 'projectGljs', calcProgramFile = 'calcProgramFile', options = 'options', installationFee = 'installationFee', } // 无数据表的模块名称的枚举 export enum SubModelName { bookmarks = 'bookmarks', // 书签批注 components = 'components', // 组成物 rationSubs = 'rationSubs', // 定额的子项 } export enum ActionType { ADD = 'add', UPDATE = 'update', REPLACE = 'replace', // 和update不同,如替换定额,替换清单等,操作不一样 DELETE = 'delete', } // 特殊的action export enum ActionName { // ration相关 addStdRations = 'addStdRations', // 添加标准定额 resetColMetas = 'resetColMetas', // 重置默认列设置 updateIndexKey = 'updateIndexKey', // 修改定额工料机的名称,规格,单位 addRationGljs = 'addRationGljs', // 添加定额工料机(多个) replaceRationGlj = 'replaceRationGlj', // 替换定额工料机(单个) applyAllInfoPrice = 'applyAllInfoPrice', // 批量套用信息价 } export interface IBaseFilter { ID: string; prop?: string; } export interface IFilter { ID: string; [key: string]: string; } // 统一subject更新提交数据入口,为撤销功能做准备 export interface ISetData { projectID: string; // 考虑到可能会跨项目更新,提高一层 module: CptModelName | SubModelName; action: ActionType; prop?: string; // 用来指表中的数组属性名,针对如configMaterial里,一个collections 里有多个数组数据的情况 actionName?: ActionName; // 除了增删改查,还会有更复杂的操作,用这个来区分 filter?: F; // 查询条件 update?: T; // 和update类型对应, documents?: T[]; // add 类型对应,批量插入 odocs?: any[]; // 存放撤销的原始数据? result?: R; // 特殊的返回结果 } export interface IColumnMeta { title: string; data: string; renderer?: string; editor?: string; readOnly?: boolean; width: number; type?: string; numericFormat?: { pattern?: string; zeroFormat?: string }; visible?: boolean; source?: string[]; } // subject getData数据接口 export interface ISubjectGetData { project: IProject; [CptModelName.bills]: IBill[]; [CptModelName.rations]: IRation[]; [CptModelName.projectGljs]: IProjectGlj[]; [CptModelName.feeRateFile]: IFeeRateFile; [CptModelName.calcProgramFile]: ICalcProgramFile; [CptModelName.configMaterials]: IConfigMaterial; } // getData数据接口 export interface IGetData { subject: ISubjectGetData; construction: { project?: IProject }; treeData: IProject[]; isOwner: boolean; projectsPermission: IProjectPermission[]; }