Explorar el Código

feat(types): setData增加多个泛型

vian hace 4 años
padre
commit
51d497d3f2
Se han modificado 1 ficheros con 4 adiciones y 4 borrados
  1. 4 4
      types/src/interface/base.ts

+ 4 - 4
types/src/interface/base.ts

@@ -173,17 +173,17 @@ export interface IFilter {
   [key: string]: string;
 }
 // 统一subject更新提交数据入口,为撤销功能做准备
-export interface ISetData<T = any> {
+export interface ISetData<T = any, F = any, R = any> {
   projectID: string; // 考虑到可能会跨项目更新,提高一层
   module: CptModelName | SubModelName;
   action: ActionType;
   prop?: string; // 用来指表中的数组属性名,针对如configMaterial里,一个collections 里有多个数组数据的情况
   actionName?: ActionName; // 除了增删改查,还会有更复杂的操作,用这个来区分
-  filter?: any; // 查询条件
-  update?: any; // 和update类型对应,
+  filter?: F; // 查询条件
+  update?: Partial<T>; // 和update类型对应,
   documents?: T[]; // add 类型对应,批量插入
   odocs?: any[]; // 存放撤销的原始数据?
-  result?: any; // 特殊的返回结果
+  result?: R; // 特殊的返回结果
 }
 
 export interface IColumnMeta {