import { BasicPageParams, BasicFetchResult } from '@/api/model/baseModel';

export interface responses {
  message: string;
  code: number;
  result: boolean;
}

export type responsesModel = BasicFetchResult<responses>;

// 字典 FormSort
export interface FromSort {
  itemDetailId: string;
  itemId: string;
  parentId: string;
  itemCode: string | null;
  itemName: string;
  itemValue: string;
  quickQuery: string;
  simpleSpelling: string;
  isDefault?: string | null;
  sortCode: string;
  deleteMark: string;
  enabledMark: number;
  description: string | null;
  createDate: string;
  createUserId: string | null;
  createUserName: string | null;
  modifyDate: string;
  modifyUserId: string | null;
  modifyUserName: string | null;
}

// 查询表单分页信息
export interface LoadFormPage {
  keyWord: string;
  category: string;
  isEnabled: boolean;
  pageIndex: number;
  pageSize: number;
  name: string;
}

// 表单设计
export interface FromSchemeInfo {
  id: string;
  name: string;
  category: string;
  schemeId: string;
  enabledMark: number;
  formType: number;
  description: string;
  type: number;
  createUserName: string;
  createUserId: string;
  createDate: string;
  tenantId: string;
}

export interface FromScheme {
  id: string;
  schemeInfoId: string;
  type: number;
  scheme: string;
  createDate: string;
  createUserId: string;
  createUserName: string;
  tenantId: string;
}

export interface dataColName {
  dbCode: string;
  sql: string;
}

// 启用或者停用表单
export interface state {
  id: string;
  state: string;
}
// 启用或者停用历史表单
export interface scheme {
  id: string;
  schemeId: string;
}
// 获取自定义表单模板历史数据
export interface schemePageList {
  page: number;
  limit: number;
  key: string;
  schemeInfoId: string;
}

export type AccountParams = BasicPageParams & {
  account?: string;
  nickname?: string;
  [key: string]: any;
};

// 字典
export type FromSortModel = BasicFetchResult<FromSort>;
// 分页
export type LoadFormPageModel = BasicFetchResult<LoadFormPage>;
// 自定义表单
export type FromSchemeInfoModel = BasicFetchResult<FromSchemeInfo>;
export type FromSchemeModel = BasicFetchResult<FromScheme>;
export type FromSchemandAndInfoModel = {
  info: FromSchemeInfoModel;
  scheme: FromSchemeModel;
};
// 数据库数据
export type dataColNameModel = BasicFetchResult<dataColName>;
// 启用或者停用表单
export type stateModel = BasicFetchResult<state>;
// 历史记录数据
export type schemeModel = BasicFetchResult<scheme>;
// 获取自定义表单模板历史数据
export type schemePageListModel = BasicFetchResult<schemePageList>;

// -------------------------------------------------------------
// CodeTable 数据对象模型管理
// 获取CodeTable的分页数据
export interface CodeTable_LoadCodeTablePage_Parameters {
  keyWord: string;
  dbCode: string;
  pageIndex: number;
  pageSize: number;
}

export interface CodeTable_LoadCodeTablePage_Responses {
  id: string;
  className: string;
  tableName: string;
  dbId: string;
  description: string;
  isLock: number;
  deleteMark: number;
  state: number;
  tenantId: string;
}

// 获取字典分类列表
// export interface CodeTable_GetForms_Parameters {
//   dbCode: string;
//   tableNames: string;
// }

// // 获取表的对象集合数据
export interface CodeTable_GetForms_Parameters {
  dbCode: string;
  tableNames: string;
}

export interface db_codetable {
  id: string;
  className: string;
  tableName: string;
  dbId: string;
  description: string;
  isLock: number;
  deleteMark: number;
  state: number;
  tenantId: string | null;
}

export interface db_codecolumnsList {
  id: string;
  codeTableId: string;
  dbColumnName: string;
  description: string;
  isIdentity: number;
  isPrimaryKey: number;
  isNullable: number;
  csType: string;
  dbType: string;
  length: number;
  decimalDigits: number;
  sort: number;
  tenantId: string | null;
}

// // 获取表的对象集合数据
// export interface CodeTable_ImportTable_Parameters {
//   dbCode: string;
//   tableNames: string;
// }
export interface getTableList {
  name: string;
  description: string;
  dbObjectType: number;
}
export type getTableList_Model = BasicFetchResult<getTableList>;

export interface codeTableStr {
  codeTableStr: string;
}

export type codeTableStr_Model = BasicFetchResult<codeTableStr>;

export type CodeTable_ImportTable_Responses_Model = {
  codeTableStr: codeTableStr_Model;
  tableList: getTableList_Model;
};

// CodeTable 数据对象模型管理
// 获取CodeTable的分页数据
export type CodeTable_LoadCodeTablePage_Parameters_Model =
  BasicFetchResult<CodeTable_LoadCodeTablePage_Parameters>;

export type CodeTable_LoadCodeTablePage_Responses_Model =
  BasicFetchResult<CodeTable_LoadCodeTablePage_Responses>;

// 获取字典分类列表
export type CodeTable_GetForms_Parameters_Model = BasicFetchResult<CodeTable_GetForms_Parameters>;

export type db_codetable_Model = BasicFetchResult<db_codetable>;
export type db_codecolumnsList_Model = BasicFetchResult<db_codecolumnsList>;

export type CodeTable_GetForms_Responses_Model = {
  db_codetable: db_codetable_Model;
  db_codecolumnsList: db_codecolumnsList_Model;
};

// 图斑组件-图层列表
export interface ShpLayerSourceLoadPage {
  id: string;
  name: string;
  description: string;
  type: number;
  image: string;
  createTime: string;
  createId: string;
  relationTable: string;
}
export type ShpLayerSourceLoadPage_Model = BasicFetchResult<ShpLayerSourceLoadPage>;
