index.ts 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * @Author: liuzhenlin 461480418@qq.ocm
  3. * @Date: 2023-01-19 14:06:58
  4. * @LastEditors: liuzhenlin
  5. * @LastEditTime: 2023-02-15 18:45:00
  6. * @Description: file content
  7. * @FilePath: \oms\api\system\user.js
  8. */
  9. import request from '/@/utils/micro_request.js'
  10. const instrPath = import.meta.env.VITE_INSTR_ADMIN
  11. export function useInstrApi() {
  12. return {
  13. // 获取使用人仪器列表
  14. getList: (query?: object) => {
  15. return request.postRequest(instrPath, 'ZunyiCustom', 'GetList', query)
  16. },
  17. // 获取仪器详情
  18. getDetail: (query?: object) => {
  19. return request.postRequest(instrPath, 'TusInstrument', 'GetEntityById', query)
  20. },
  21. // 获取设置详情
  22. getSettingDetail: (query?: object) => {
  23. return request.postRequest(instrPath, 'TusInstrument', 'GetConfig', query)
  24. },
  25. // 获取全部预约情况
  26. getAppointInfo: (query?: object) => {
  27. return request.postRequest(instrPath, 'TusInstrumentAppointment', 'AppointInfo', query)
  28. },
  29. // 关注
  30. follow: (query?: object) => {
  31. return request.postRequest(instrPath, 'TusInstrument', 'Follow', query)
  32. },
  33. // 取关
  34. unfollow: (query?: object) => {
  35. return request.postRequest(instrPath, 'TusInstrument', 'Unfollow', query)
  36. },
  37. // 二维码解码
  38. decode: (query?: object) => {
  39. return request.postRequest(instrPath, 'TusInstrument', 'QrcodeDecrypto', query)
  40. },
  41. // 扫码开关
  42. switch: (query?: object) => {
  43. return request.postRequest(instrPath, 'TusInstrument', 'Switch', query)
  44. },
  45. // 蓝牙获取连接码
  46. getBlueToothCode: (query?: object) => {
  47. return request.postRequest(instrPath, 'TusInstrument', 'BluetoothCode', query)
  48. },
  49. // 根据编码获取仪器详情
  50. getIdByTerminal: (query?: object) => {
  51. return request.postRequest(instrPath, 'TusInstrument', 'GetEntityByTerminal', query)
  52. },
  53. // 获取我的信用分
  54. getMyScore: (query?: object) => {
  55. return request.postRequest(instrPath, 'TusBlacklist', 'MyScore', query)
  56. },
  57. // 下一个预约是否可以直接上机
  58. nextCanGeton: (query?: object) => {
  59. return request.postRequest(instrPath, 'TusInstrumentAppointment', 'NextCanGeton', query)
  60. },
  61. openBlueLock: (query?: object) => {
  62. return request.postRequest(instrPath, 'TusInstrument', 'OpenLock', query)
  63. }
  64. }
  65. }