//common type file, you can not export the type in common.d.ts
//not export can use
import { Ref } from 'vue'

interface ObjTy {
  [propName: string]: any
}

/*axiosReq请求配置*/
import { AxiosRequestConfig } from 'axios'
interface AxiosReqTy extends AxiosRequestConfig {
  url?: string
  method?: string
  data?: ObjTy
  isParams?: boolean
  bfLoading?: boolean
  afHLoading?: boolean
  isUploadFile?: boolean
  isDownLoadFile?: boolean
  isAlertErrorMsg?: boolean
  baseURL?: string
  timeout?: number
}
interface AxiosConfigTy {
  url?: string
  method?: string
  data?: ObjTy
  headers?: any
  isParams?: boolean
  bfLoading?: boolean
  afHLoading?: boolean
  isUploadFile?: boolean
  isDownLoadFile?: boolean
  isAlertErrorMsg?: boolean
  baseURL?: string
  timeout?: number
}

interface SettingTy {
  title: string
  sidebarLogo: boolean
  showLeftMenu: boolean
  ShowDropDown: boolean
  showHamburger: boolean
  isNeedLogin: boolean
  isNeedNprogress: boolean
  showTagsView: boolean
  tagsViewNum: number
  openProdMock: boolean
  errorLog: string | Array<string>
  permissionMode: string
  delWindowHeight: string
  tmpToken: string
  showNavbarTitle: boolean
  showTopNavbar: boolean
  mainNeedAnimation: boolean
  viteBasePath: string
}

interface CommonTableColumn {
  columnDescribe: string
  columnLabel: string
  columnName: string
  dataType: string
  listqueryTemplateID: number | null
  needCount: number | null
  needFilters: number | null
  needGroup: number | null
  needSearch: number | null
  needShow: number | null
  needSort: number | null
  orderNumber: number | null
  queryTemplateColumnSetID: number | null
  queryTemplateID: number | null
  [propName: string]: any
}

type CommonValue = string | number | null
interface CommonData {
  [x: string]: CommonValue
}

interface SelectOption {
  k: string
  setlabel: string
  setvalue: string
  v: string
  [x: string]: string
}

interface CommonQueryResult<T = any> {
  code?: string | number
  returnData: {
    columnSet: CommonTableColumn[]
    listValues: Array<T>
    submitID?: number
  }
  message?: string
  needPage?: number
  [propName: string]: any
}

type SelectOptionQueryResult = CommonQueryResult<SelectOption>

type MaybeRef<T> = Ref<T> | T
