// src/api/mes/locktype/locktype.ts
import request from '@/config/axios'

export interface LockTypeVO {
  locksetTypeId?: number
  parentTypeId?: number
  locksetTypeCode: string
  locksetTypeName: string
  enableFlag?: string
  remark?: string
  createBy?: string
  createTime?: Date
  updateBy?: string
  updateTime?: Date
}

export interface PageParam {
  pageNo: number
  pageSize: number
  locksetTypeCode?: string
  locksetTypeName?: string
  enableFlag?: string
}

// 查询锁具机构-列表
export const listLocksetType = async (params: PageParam) => {
  return await request.get({ url: '/iscs/lockset-type/getLocksetTypePage', params })
}

// 获取锁具机构详细信息
export const getLocksetTypeInfo = async (id: number) => {
  return await request.get({
    url: '/iscs/lockset-type/selectLocksetTypeById',
    params: { id }
  })
}

// 新增锁具机构
export const addLocksetType = async (data: LockTypeVO) => {
  return await request.post({ url: '/iscs/lockset-type/insertLocksetType', data })
}

// 修改锁具机构信息
export const updateLocksetType = async (data: LockTypeVO) => {
  return await request.put({ url: '/iscs/lockset-type/updateLocksetType', data })
}

// 删除锁具机构信息
export const delLocksetType = async (ids: number) => {
  return await request.delete({
    url: '/iscs/lockset-type/deleteLocksetTypeList',
    params: { ids: ids }
  })
}
