Przeglądaj źródła

feat(types): 修改setdata类型

zhangweicheng 5 lat temu
rodzic
commit
267b644b5c
1 zmienionych plików z 11 dodań i 1 usunięć
  1. 11 1
      types/src/interface/base.ts

+ 11 - 1
types/src/interface/base.ts

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