he wei
2025-04-23 b9bd29a1a81f6f7de479e3cc3fdfe3d85fc660bf
src/api/keys.js
@@ -1,70 +1,39 @@
import request from '@/utils/request';
/**
 * 添加钥匙
 */
export function addKey(data) {
  return request({
    url: 'lockInf/addKey',
    method: 'POST',
    data,
  });
}
/**
 * 删除钥匙
 * 添加授权卡
 * idCardSet  卡号
 * lockId     锁号
 */
export function delKey(keyId) {
export function addCard(idCardSet, lockId) {
  return request({
    url: 'lockInf/delKey',
    url: 'lockRt/addIdCardSet',
    method: 'GET',
    params: { keyId },
    params: { idCardSet, lockId },
  });
}
/**
 * 查询所有钥匙信息
 * { keyName, pageNum, pageSize, uname
 * }
 * @returns
 * 清空所有授权ID卡
 * lockId     锁号
 */
export function getAllKeyList(params) {
export function cancleIdCard(lockId) {
  return request({
    url: 'lockInf/getAllKeyInf',
    url: 'lockRt/cancleIdCard',
    method: 'GET',
    params
    params: { lockId },
  });
}
/**
 * 授权时查询所有钥匙信息(不分页)
 *
 * @returns
 * 移除授权卡
 */
export function getKeyInfAuth() {
export function delCard(idCardSet, lockId) {
  return request({
    url: 'lockInf/getKeyInfAuth',
    url: 'lockRt/delIdCardSet',
    method: 'GET',
  });
}
/**
 * 查询所有钥匙名信息(用于下拉)
 */
export function authKey() {
  return request({
    url: 'lockInf/getkinf',
    method: 'GET',
  });
}
/**
 * 更新钥匙信息
 */
export function updateKey(data) {
  return request({
    url: 'lockInf/updateKey',
    method: 'POST',
    data,
    params: { idCardSet, lockId },
  });
}