function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
var _excluded = ["carCode", "page", "size"],
  _excluded2 = ["id", "page", "size"],
  _excluded3 = ["carId", "stepThreeOperateTimeLeft", "stepThreeOperateTimeRight", "page", "size"],
  _excluded4 = ["carId", "startDate", "endDate"];
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
import { getVtxToken, request } from '@vtx/utils';
import { useRequest } from 'ahooks';
import http from "../_util/http";
var prefix = process.env.PREFIX || '';
export var BaseService = {
  useBaseInfo: function useBaseInfo(id) {
    var _useRequest = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/gps-reborn/sdk/car/getCarInfoByProductType"), {
          body: {
            carId: id
          }
        });
      }, {
        refreshDeps: [id]
      }),
      baseInfoRes = _useRequest.data;
    var _useRequest2 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/gps-reborn/car/np/getCarDetailById"), {
          body: {
            id: id,
            url: window.location.origin
          }
        });
      }, {
        refreshDeps: [id]
      }),
      detailRes = _useRequest2.data;
    var info = (baseInfoRes === null || baseInfoRes === void 0 ? void 0 : baseInfoRes.data) || {};
    var detail = (detailRes === null || detailRes === void 0 ? void 0 : detailRes.data) || {};
    return {
      info: info,
      detail: detail
    };
  },
  useFieldConfig: function useFieldConfig() {
    var _data$data;
    var _useRequest3 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/gps-reborn/car/dataConfig/list"));
      }),
      data = _useRequest3.data;
    return {
      showFields: (data === null || data === void 0 || (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.filter(function (ele) {
        return ele.isVisible;
      })) || []
    };
  },
  useDailyCarRun: function useDailyCarRun(id, beginTime, endTime) {
    //今日运行
    var _useRequest4 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/gps-reborn/report/dailyCarRun/list"), {
          body: {
            carIds: id,
            reportDateStart: beginTime,
            reportDateEnd: endTime
          }
        });
      }, {
        refreshDeps: [id, beginTime, endTime]
      }),
      dailyCarRunRes = _useRequest4.data,
      loading = _useRequest4.loading;
    return {
      dailyCarRunRes: (dailyCarRunRes === null || dailyCarRunRes === void 0 ? void 0 : dailyCarRunRes.data) || [],
      loading: loading
    };
  },
  useServiceInfo: function useServiceInfo(carId) {
    var _useRequest5 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/jcss-reborn/contract/carHistoryContract"), {
          body: {
            carId: carId
          }
        });
      }),
      data = _useRequest5.data;
    return {
      serviceInfo: data === null || data === void 0 ? void 0 : data.data
    };
  },
  useDeviceInfo: function useDeviceInfo(id) {
    var _useRequest6 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/gps-reborn/device/list"), {
          body: {
            carId: id,
            mainDevice: true
          }
        });
      }, {
        refreshDeps: [id]
      }),
      data = _useRequest6.data;
    return {
      deviceList: (data === null || data === void 0 ? void 0 : data.data) || []
    };
  },
  useAlarmType: function useAlarmType(carIds, startTime, endTime) {
    var _useRequest7 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/gps-reborn/alarm/record/statisticsPage"), {
          body: {
            carIds: carIds,
            startTime: startTime,
            endTime: endTime
          }
        });
      }, {
        refreshDeps: [carIds, startTime, endTime]
      }),
      alarmTypesRes = _useRequest7.data;
    return {
      alarmTypes: (alarmTypesRes === null || alarmTypesRes === void 0 ? void 0 : alarmTypesRes.data) || {
        totalCount: 0,
        summary: []
      }
    };
  },
  useAlarmList: function useAlarmList(carCode, alarmStrategyName, startTime, endTime, page, sort, sortField) {
    var _useRequest8 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/gps-reborn/alarm/record/pageList"), {
          body: {
            carCode: carCode,
            alarmTypeCodes: alarmStrategyName,
            startTime: startTime,
            endTime: endTime,
            page: page,
            rows: 10,
            sort: sort,
            sortField: sortField
          }
        });
      }, {
        ready: !!carCode,
        refreshDeps: [carCode, alarmStrategyName, startTime, endTime, page, sort, sortField]
      }),
      recordRes = _useRequest8.data,
      loading = _useRequest8.loading;
    return {
      alarmRecord: (recordRes === null || recordRes === void 0 ? void 0 : recordRes.data) || {},
      loading: loading
    };
  },
  useTodayRun: function useTodayRun(carId, beginTime, endTime) {
    //今日运行
    var _useRequest9 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/gps-reborn/car/detail/alarmSumWithDetail"), {
          body: {
            carId: carId,
            beginTime: "".concat(beginTime, " 00:00:00"),
            endTime: "".concat(endTime, " 23:59:59")
          }
        });
      }, {
        refreshDeps: [carId, beginTime, endTime]
      }),
      todayRunRes = _useRequest9.data,
      loading = _useRequest9.loading;
    return {
      todayRunRes: (todayRunRes === null || todayRunRes === void 0 ? void 0 : todayRunRes.data) || {},
      loading: loading
    };
  },
  useGetSetInfo: function useGetSetInfo() {
    var _useRequest10 = useRequest( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
        var res;
        return _regeneratorRuntime().wrap(function _callee$(_context) {
          while (1) switch (_context.prev = _context.next) {
            case 0:
              _context.next = 2;
              return http.get("".concat(prefix, "/cloud/gps-reborn/gps/constant/set/getSetInfo"));
            case 2:
              res = _context.sent;
              return _context.abrupt("return", (res === null || res === void 0 ? void 0 : res.data) || {});
            case 4:
            case "end":
              return _context.stop();
          }
        }, _callee);
      }))),
      _useRequest10$data = _useRequest10.data,
      setInfo = _useRequest10$data === void 0 ? {} : _useRequest10$data;
    return {
      setInfo: setInfo
    };
  }
};
export var CcService = {
  useTaskInfo: function useTaskInfo(carCode, day) {
    var _useRequest11 = useRequest( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
        var _res$data;
        var res;
        return _regeneratorRuntime().wrap(function _callee2$(_context2) {
          while (1) switch (_context2.prev = _context2.next) {
            case 0:
              _context2.next = 2;
              return http.get("".concat(prefix, "/cloud/cc-reborn/api/v101/kanban/kanbanTaskDetailList"), {
                body: {
                  carCode: carCode,
                  taskDay: day,
                  size: 5,
                  page: 0
                }
              });
            case 2:
              res = _context2.sent;
              return _context2.abrupt("return", (res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 || (_res$data = _res$data.rows) === null || _res$data === void 0 ? void 0 : _res$data[0]) || {});
            case 4:
            case "end":
              return _context2.stop();
          }
        }, _callee2);
      })), {
        refreshDeps: [carCode, day],
        ready: !!carCode
      }),
      _useRequest11$data = _useRequest11.data,
      data = _useRequest11$data === void 0 ? {} : _useRequest11$data,
      loading = _useRequest11.loading;
    return {
      taskInfo: data,
      loading: loading
    };
  },
  useTaskDaySummary: function useTaskDaySummary(_ref3) {
    var carId = _ref3.carId,
      startDay = _ref3.startDay,
      endDay = _ref3.endDay;
    var _useRequest12 = useRequest( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
        var res;
        return _regeneratorRuntime().wrap(function _callee3$(_context3) {
          while (1) switch (_context3.prev = _context3.next) {
            case 0:
              _context3.next = 2;
              return http.get("".concat(prefix, "/cloud/cc-reborn/api/v101/jsc/carTaskDaySummary"), {
                body: {
                  carId: carId,
                  startDay: startDay,
                  endDay: endDay
                }
              });
            case 2:
              res = _context3.sent;
              return _context3.abrupt("return", (res === null || res === void 0 ? void 0 : res.data) || []);
            case 4:
            case "end":
              return _context3.stop();
          }
        }, _callee3);
      })), {
        refreshDeps: [carId, startDay, endDay],
        ready: !!carId
      }),
      _useRequest12$data = _useRequest12.data,
      data = _useRequest12$data === void 0 ? [] : _useRequest12$data,
      loading = _useRequest12.loading;
    return {
      taskDaySummary: data,
      loading: loading
    };
  },
  useGetOrderPage: function useGetOrderPage(carCode, startDay, endDay, page) {
    var _useRequest13 = useRequest( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
        var res;
        return _regeneratorRuntime().wrap(function _callee4$(_context4) {
          while (1) switch (_context4.prev = _context4.next) {
            case 0:
              _context4.next = 2;
              return http.get("".concat(prefix, "/cloud/cc-reborn/api/v101/draftDisposeUnit/page"), {
                body: {
                  carCode: carCode,
                  startDay: startDay,
                  endDay: endDay,
                  size: 10,
                  page: page
                }
              });
            case 2:
              res = _context4.sent;
              return _context4.abrupt("return", (res === null || res === void 0 ? void 0 : res.data) || {});
            case 4:
            case "end":
              return _context4.stop();
          }
        }, _callee4);
      })), {
        refreshDeps: [carCode, startDay, endDay, page],
        ready: !!carCode
      }),
      _useRequest13$data = _useRequest13.data,
      data = _useRequest13$data === void 0 ? [] : _useRequest13$data,
      loading = _useRequest13.loading;
    return {
      orderPage: data,
      loading: loading
    };
  },
  useWeightList: function useWeightList(carId, queryStartTime, queryEndTime) {
    var _useRequest14 = useRequest( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
        var res;
        return _regeneratorRuntime().wrap(function _callee5$(_context5) {
          while (1) switch (_context5.prev = _context5.next) {
            case 0:
              _context5.next = 2;
              return http.get("".concat(prefix, "/cloud/cc-reborn/api/v101/rtCarDataDetail/list"), {
                body: {
                  carId: carId,
                  queryStartTime: queryStartTime,
                  queryEndTime: queryEndTime
                }
              });
            case 2:
              res = _context5.sent;
              return _context5.abrupt("return", (res === null || res === void 0 ? void 0 : res.data) || []);
            case 4:
            case "end":
              return _context5.stop();
          }
        }, _callee5);
      })), {
        refreshDeps: [carId, queryStartTime, queryEndTime],
        ready: !!carId
      }),
      _useRequest14$data = _useRequest14.data,
      data = _useRequest14$data === void 0 ? [] : _useRequest14$data;
    return {
      weightList: data
    };
  },
  useWeightPage: function useWeightPage(_ref7) {
    var carId = _ref7.carId,
      queryStartTime = _ref7.queryStartTime,
      queryEndTime = _ref7.queryEndTime,
      page = _ref7.page;
    var _useRequest15 = useRequest( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
        var res;
        return _regeneratorRuntime().wrap(function _callee6$(_context6) {
          while (1) switch (_context6.prev = _context6.next) {
            case 0:
              _context6.next = 2;
              return http.get("".concat(prefix, "/cloud/cc-reborn/api/v101/rtCarDataDetail/page"), {
                body: {
                  carId: carId,
                  queryStartTime: queryStartTime,
                  queryEndTime: queryEndTime,
                  page: page - 1,
                  size: 10
                }
              });
            case 2:
              res = _context6.sent;
              return _context6.abrupt("return", (res === null || res === void 0 ? void 0 : res.data) || {});
            case 4:
            case "end":
              return _context6.stop();
          }
        }, _callee6);
      })), {
        refreshDeps: [carId, queryStartTime, queryEndTime, page],
        ready: !!carId
      }),
      _useRequest15$data = _useRequest15.data,
      data = _useRequest15$data === void 0 ? {} : _useRequest15$data;
    return {
      weightData: data
    };
  },
  useGetAbnormalSummary: function useGetAbnormalSummary(_ref9) {
    var objectId = _ref9.objectId,
      startDay = _ref9.startDay,
      endDay = _ref9.endDay;
    var _useRequest16 = useRequest( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
        var res;
        return _regeneratorRuntime().wrap(function _callee7$(_context7) {
          while (1) switch (_context7.prev = _context7.next) {
            case 0:
              _context7.next = 2;
              return http.get("".concat(prefix, "/cloud/cc-reborn/api/v101/abnormalEventRecord/getAbnormalSummaryNums"), {
                body: {
                  objectId: objectId,
                  startDay: startDay,
                  endDay: endDay,
                  summaryType: 'DAY'
                }
              });
            case 2:
              res = _context7.sent;
              return _context7.abrupt("return", (res === null || res === void 0 ? void 0 : res.data) || []);
            case 4:
            case "end":
              return _context7.stop();
          }
        }, _callee7);
      })), {
        refreshDeps: [objectId, startDay, endDay],
        ready: !!objectId
      }),
      _useRequest16$data = _useRequest16.data,
      data = _useRequest16$data === void 0 ? [] : _useRequest16$data,
      loading = _useRequest16.loading;
    return {
      summaryData: data,
      loading: loading
    };
  },
  useAlarmList: function useAlarmList(_ref11) {
    var alarmObjId = _ref11.alarmObjId,
      queryStartTime = _ref11.queryStartTime,
      queryEndTime = _ref11.queryEndTime,
      page = _ref11.page,
      sort = _ref11.sort;
    var _useRequest17 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/cc-reborn/api/v101/abnormalEventRecord/page"), {
          body: {
            alarmObjId: alarmObjId,
            queryStartTime: queryStartTime,
            queryEndTime: queryEndTime,
            page: page,
            size: 10,
            sort: sort
          }
        });
      }, {
        ready: !!alarmObjId,
        refreshDeps: [alarmObjId, queryStartTime, queryEndTime, page, sort]
      }),
      recordRes = _useRequest17.data,
      loading = _useRequest17.loading;
    return {
      alarmRecord: (recordRes === null || recordRes === void 0 ? void 0 : recordRes.data) || {},
      loading: loading
    };
  }
};
export var JxhService = {
  useWorkSummaryJxh: function useWorkSummaryJxh(carId, startDate, endDate, matchHistory) {
    //机械化作业统计
    var _useRequest18 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/zyqs-zqb/api/kanban/workInfoStatisticsByCarId"), {
          body: {
            carId: carId,
            startDate: startDate,
            endDate: endDate,
            matchHistory: matchHistory
          }
        });
      }, {
        refreshDeps: [carId, startDate, endDate]
      }),
      workSummaryJxhRes = _useRequest18.data,
      loading = _useRequest18.loading;
    return {
      workSummaryJxhRes: (workSummaryJxhRes === null || workSummaryJxhRes === void 0 ? void 0 : workSummaryJxhRes.data) || {},
      loading: loading
    };
  },
  useWorkAnaJxh: function useWorkAnaJxh(carId, startDate, endDate) {
    //机械化作业分析
    var _useRequest19 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/zyqs-zqb/api/kanban/workInfoAnalysisByCarId"), {
          body: {
            carId: carId,
            startDate: startDate,
            endDate: endDate
          }
        });
      }, {
        refreshDeps: [carId, startDate, endDate]
      }),
      workAnaJxhRes = _useRequest19.data,
      loading = _useRequest19.loading;
    return {
      workAnaJxhRes: (workAnaJxhRes === null || workAnaJxhRes === void 0 ? void 0 : workAnaJxhRes.data) || [],
      loading: loading
    };
  },
  useCarWorkDailyReport: function useCarWorkDailyReport(carId, startDate, endDate) {
    //机械化作业类型
    var _useRequest20 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/zyqs-zqb/api/np/noshift/report/carWorkDailyReport"), {
          body: {
            carIds: carId,
            startDate: startDate,
            endDate: endDate
          }
        });
      }, {
        ready: !!startDate && !!endDate && !!carId,
        refreshDeps: [startDate, endDate, carId]
      }),
      dailyDataRes = _useRequest20.data,
      loading = _useRequest20.loading;
    return {
      dailyData: ((dailyDataRes === null || dailyDataRes === void 0 ? void 0 : dailyDataRes.data) || []).map(function (item) {
        var percent = item.workMileage / item.driveMileage * 100;
        return _objectSpread(_objectSpread({}, item), {}, {
          percent: (percent > 100 ? 100 : percent).toFixed(2)
        });
      }),
      loading: loading
    };
  },
  useRecordJxh: function useRecordJxh(carId, workTypeCodes, startDate, endDate, pageNo, order) {
    //机械化
    var _useRequest21 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/zyqs-zqb/api/v1.5/noshift/page"), {
          body: {
            carId: carId,
            workTypeCodes: workTypeCodes,
            needFilterWork: true,
            startDate: startDate,
            endDate: endDate,
            pageNo: pageNo,
            pageSize: 10,
            sort: 'workDate',
            order: order,
            processBindRule: true
          }
        });
      }, {
        refreshDeps: [carId, workTypeCodes, startDate, endDate, pageNo, order]
      }),
      recordJxhRes = _useRequest21.data,
      loading = _useRequest21.loading;
    return {
      recordJxhRes: (recordJxhRes === null || recordJxhRes === void 0 ? void 0 : recordJxhRes.data) || [],
      loading: loading
    };
  },
  useWorkTypeJxh: function useWorkTypeJxh() {
    //机械化作业类型
    var _useRequest22 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/zyqs-zqb/api/v101/common/listWorkType"), {
          body: {
            tenantId: getVtxToken('tenantId')
          }
        });
      }),
      workTypeRes = _useRequest22.data;
    return {
      workTypeRes: (workTypeRes === null || workTypeRes === void 0 ? void 0 : workTypeRes.data) || []
    };
  },
  useJXHAlarmStatistics: function useJXHAlarmStatistics(carIds, startDate, endDate) {
    var _useRequest23 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/zyqs-zqb/api/noshift/event/statistics"), {
          body: {
            carIds: carIds,
            startDate: startDate,
            endDate: endDate,
            categoryCode: 'Alarm',
            coordType: 'bd09'
          }
        });
      }, {
        refreshDeps: [carIds, startDate, endDate]
      }),
      alarmTypesRes = _useRequest23.data,
      loading = _useRequest23.loading;
    return {
      alarmTypes: (alarmTypesRes === null || alarmTypesRes === void 0 ? void 0 : alarmTypesRes.data) || {},
      loading: loading
    };
  },
  useSingleCarAlarmStatistics: function useSingleCarAlarmStatistics(carId, startTime, endTime) {
    var _useRequest24 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/zyqs-zqb/api/noshift/event/singleCarAlarmStatistic"), {
          body: {
            carId: carId,
            startTime: startTime,
            endTime: endTime
          }
        });
      }, {
        refreshDeps: [carId, startTime, endTime]
      }),
      alarmTypesRes = _useRequest24.data,
      loading = _useRequest24.loading;
    return {
      alarmStatistic: (alarmTypesRes === null || alarmTypesRes === void 0 ? void 0 : alarmTypesRes.data) || {},
      loading: loading
    };
  },
  useJXHAlarmList: function useJXHAlarmList(carIds, startDate, endDate, page, sort) {
    var _useRequest25 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/zyqs-zqb/api/noshift/event/page"), {
          body: {
            carIds: carIds,
            startDate: startDate,
            endDate: endDate,
            categoryCode: 'Alarm',
            coordType: 'bd09',
            pageNo: page,
            pageSize: 10,
            sort: sort
          }
        });
      }, {
        refreshDeps: [carIds, startDate, endDate, sort, page]
      }),
      alarmRecordRes = _useRequest25.data,
      loading = _useRequest25.loading;
    return {
      alarmRecord: (alarmRecordRes === null || alarmRecordRes === void 0 ? void 0 : alarmRecordRes.data) || {},
      loading: loading
    };
  }
};
export var Hw2Service = {
  useWorkCalendar: function useWorkCalendar(carId, startDate, endDate) {
    //作业情况
    var _useRequest26 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/zyqs-zqb/api/hwv2/popup/car/work/calendar"), {
          body: {
            id: carId,
            startDate: startDate,
            endDate: endDate
          }
        });
      }, {
        refreshDeps: [carId, startDate, endDate]
      }),
      workCalendarRes = _useRequest26.data,
      loading = _useRequest26.loading;
    return {
      workCalendar: (workCalendarRes === null || workCalendarRes === void 0 ? void 0 : workCalendarRes.data) || [],
      loading: loading
    };
  },
  useWorkInfo: function useWorkInfo(carId, date) {
    //作业情况
    var _useRequest27 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/zyqs-zqb/api/hwv2/popup/car/work/info"), {
          body: {
            id: carId,
            date: date
          }
        });
      }, {
        refreshDeps: [carId, date]
      }),
      workInfoRes = _useRequest27.data,
      loading = _useRequest27.loading;
    return {
      workInfo: (workInfoRes === null || workInfoRes === void 0 ? void 0 : workInfoRes.data) || {},
      loading: loading
    };
  },
  useJXHAlarmList: function useJXHAlarmList(carIds, startDate, endDate, page, sort) {
    var _useRequest28 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/zyqs-zqb/api/hwv2/alarm/page"), {
          body: {
            carIds: carIds,
            startDate: startDate,
            endDate: endDate,
            categoryCode: 'Alarm',
            coordType: 'bd09',
            pageNo: page,
            pageSize: 10,
            sort: sort
          }
        });
      }, {
        refreshDeps: [carIds, startDate, endDate, sort, page]
      }),
      alarmRecordRes = _useRequest28.data,
      loading = _useRequest28.loading;
    return {
      alarmRecord: (alarmRecordRes === null || alarmRecordRes === void 0 ? void 0 : alarmRecordRes.data) || {},
      loading: loading
    };
  },
  useAlarmSummary: function useAlarmSummary(carId, startDate, endDate) {
    //报警情况
    var _useRequest29 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/zyqs-zqb/api/hwv2/popup/car/alarm/summary"), {
          body: {
            id: carId,
            startDate: startDate,
            endDate: endDate
          }
        });
      }, {
        refreshDeps: [carId, startDate, endDate]
      }),
      alarmSummaryRes = _useRequest29.data,
      loading = _useRequest29.loading;
    return {
      alarmSummary: (alarmSummaryRes === null || alarmSummaryRes === void 0 ? void 0 : alarmSummaryRes.data) || {},
      loading: loading
    };
  },
  useWorkRecord: function useWorkRecord(carId, startDate, endDate) {
    //作业情况
    var _useRequest30 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/zyqs-zqb/api/hwv2/popup/car/work/record"), {
          body: {
            id: carId,
            startDate: startDate,
            endDate: endDate
          }
        });
      }, {
        refreshDeps: [carId, startDate, endDate]
      }),
      workRecordRes = _useRequest30.data,
      loading = _useRequest30.loading;
    return {
      workRecord: (workRecordRes === null || workRecordRes === void 0 ? void 0 : workRecordRes.data) || {},
      loading: loading
    };
  }
};
export var LjsyService = {
  useConfig: function useConfig() {
    var _useRequest31 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/ljsy-reborn/api/param/config/webList"));
      }),
      config = _useRequest31.data;
    var paramConfigsList = {};
    if (config !== null && config !== void 0 && config.data) {
      var _config$data;
      (_config$data = config.data) === null || _config$data === void 0 || (_config$data = _config$data.paramConfigs) === null || _config$data === void 0 || _config$data.forEach(function (element) {
        paramConfigsList[element.code] = _objectSpread({}, element);
      });
    }
    return paramConfigsList;
  },
  useSYCarInfo: function useSYCarInfo(id, date) {
    var _useRequest32 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/ljsy-reborn/api/gis/map/car/info"), {
          body: {
            carId: id,
            day: date
          }
        });
      }, {
        refreshDeps: [id, date]
      }),
      syInfoRes = _useRequest32.data,
      loading = _useRequest32.loading;
    return {
      syInfo: syInfoRes === null || syInfoRes === void 0 ? void 0 : syInfoRes.data,
      loading: loading
    };
  },
  useGetWorkInfo: function useGetWorkInfo(_ref12) {
    var carId = _ref12.carId,
      startDate = _ref12.startDate,
      endDate = _ref12.endDate;
    var _useRequest33 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/ljsy-reborn/api/kanban/getWorkInfoByCarIdDate"), {
          body: {
            carId: carId,
            startDate: startDate,
            endDate: endDate
          }
        });
      }, {
        refreshDeps: [carId, startDate, endDate]
      }),
      data = _useRequest33.data,
      loading = _useRequest33.loading;
    return {
      taskDaySummary: (data === null || data === void 0 ? void 0 : data.data) || [],
      loading: loading
    };
  },
  useAlarmList: function useAlarmList(_ref13) {
    var carId = _ref13.carId,
      startDate = _ref13.startDate,
      endDate = _ref13.endDate,
      page = _ref13.page,
      sort = _ref13.sort;
    var _useRequest34 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/ljsy-reborn/api/kanban/getAlarmDetailByCarId"), {
          body: {
            carId: carId,
            startDate: startDate,
            endDate: endDate,
            page: page,
            size: 10,
            sort: sort
          }
        });
      }, {
        ready: !!carId,
        refreshDeps: [carId, startDate, endDate, page, sort]
      }),
      recordRes = _useRequest34.data,
      loading = _useRequest34.loading;
    return {
      alarmRecord: (recordRes === null || recordRes === void 0 ? void 0 : recordRes.data) || {},
      loading: loading
    };
  },
  useGetWorkInfoAnalysis: function useGetWorkInfoAnalysis(_ref14) {
    var carId = _ref14.carId,
      startDate = _ref14.startDate,
      endDate = _ref14.endDate;
    var _useRequest35 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/ljsy-reborn/api/kanban/getWorkInfoAnalysisByCarId"), {
          body: {
            carId: carId,
            startDate: startDate,
            endDate: endDate
          }
        });
      }, {
        refreshDeps: [carId, startDate, endDate]
      }),
      data = _useRequest35.data,
      loading = _useRequest35.loading;
    return {
      workInfoAnalysis: (data === null || data === void 0 ? void 0 : data.data) || {},
      loading: loading
    };
  },
  useGetAlarmInfo: function useGetAlarmInfo(_ref15) {
    var carId = _ref15.carId,
      startDate = _ref15.startDate,
      endDate = _ref15.endDate;
    var _useRequest36 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/ljsy-reborn/api/kanban/getAlarmInfoByCarId"), {
          body: {
            carId: carId,
            startDate: startDate,
            endDate: endDate
          }
        });
      }, {
        refreshDeps: [carId, startDate, endDate]
      }),
      data = _useRequest36.data,
      loading = _useRequest36.loading;
    return {
      alarmInfo: (data === null || data === void 0 ? void 0 : data.data) || [],
      loading: loading
    };
  },
  useGetAlarmInfoAnalysis: function useGetAlarmInfoAnalysis(_ref16) {
    var carId = _ref16.carId,
      startDate = _ref16.startDate,
      endDate = _ref16.endDate;
    var _useRequest37 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/ljsy-reborn/api/kanban/getAlarmInfoAnalysisByCarId"), {
          body: {
            carId: carId,
            startDate: startDate,
            endDate: endDate
          }
        });
      }, {
        refreshDeps: [carId, startDate, endDate]
      }),
      data = _useRequest37.data,
      loading = _useRequest37.loading;
    return {
      alarmInfoAnalysis: (data === null || data === void 0 ? void 0 : data.data) || {},
      loading: loading
    };
  },
  useGetWorkDetail: function useGetWorkDetail(_ref17) {
    var carId = _ref17.carId,
      startDate = _ref17.startDate,
      endDate = _ref17.endDate,
      page = _ref17.page,
      sort = _ref17.sort;
    var _useRequest38 = useRequest( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
        var res;
        return _regeneratorRuntime().wrap(function _callee8$(_context8) {
          while (1) switch (_context8.prev = _context8.next) {
            case 0:
              _context8.next = 2;
              return http.get("".concat(prefix, "/cloud/ljsy-reborn/api/kanban/getWorkDetailByCarId"), {
                body: {
                  carId: carId,
                  startDate: startDate,
                  endDate: endDate,
                  page: page - 1,
                  size: 10,
                  sort: sort
                }
              });
            case 2:
              res = _context8.sent;
              return _context8.abrupt("return", (res === null || res === void 0 ? void 0 : res.data) || {});
            case 4:
            case "end":
              return _context8.stop();
          }
        }, _callee8);
      })), {
        refreshDeps: [carId, startDate, endDate, page, sort],
        ready: !!carId
      }),
      _useRequest38$data = _useRequest38.data,
      data = _useRequest38$data === void 0 ? {} : _useRequest38$data;
    return {
      workDetailData: data
    };
  }
};
export var LjzyService = {
  useGetCarSumByDate: function useGetCarSumByDate(_ref19) {
    var carCode = _ref19.carCode,
      startDate = _ref19.startDate,
      endDate = _ref19.endDate;
    var _useRequest39 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/zd/lm/api/cp/dataBoard/getCarSumByDate.smvc"), {
          body: {
            carCode: carCode,
            startDate: startDate,
            endDate: endDate
          }
        });
      }, {
        refreshDeps: [carCode, startDate, endDate],
        ready: !!carCode
      }),
      data = _useRequest39.data,
      loading = _useRequest39.loading;
    return {
      taskDaySummary: (data === null || data === void 0 ? void 0 : data.data) || [],
      loading: loading
    };
  },
  useGetCarSumByDateAndDisposeUnit: function useGetCarSumByDateAndDisposeUnit(_ref20) {
    var carCode = _ref20.carCode,
      startDate = _ref20.startDate,
      endDate = _ref20.endDate;
    var _useRequest40 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/zd/lm/api/cp/dataBoard/getCarSumByDateAndDisposeUnit.smvc"), {
          body: {
            carCode: carCode,
            startDate: startDate,
            endDate: endDate
          }
        });
      }, {
        refreshDeps: [carCode, startDate, endDate],
        ready: !!carCode
      }),
      data = _useRequest40.data,
      loading = _useRequest40.loading;
    return {
      taskDaySummary: (data === null || data === void 0 ? void 0 : data.data) || [],
      loading: loading
    };
  },
  useGetWorkDetail: function useGetWorkDetail(_ref21) {
    var carNo = _ref21.carNo,
      startTime = _ref21.startTime,
      endTime = _ref21.endTime,
      page = _ref21.page,
      sort = _ref21.sort,
      order = _ref21.order;
    var _useRequest41 = useRequest( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
        var res;
        return _regeneratorRuntime().wrap(function _callee9$(_context9) {
          while (1) switch (_context9.prev = _context9.next) {
            case 0:
              _context9.next = 2;
              return http.get("".concat(prefix, "/cloud/zd/lm/api/cp/zdjgLmWeighData/pageList.smvc"), {
                body: {
                  carNo: carNo,
                  startTime: startTime,
                  endTime: endTime,
                  page: page - 1,
                  rows: 10,
                  sort: sort,
                  order: order
                }
              });
            case 2:
              res = _context9.sent;
              return _context9.abrupt("return", (res === null || res === void 0 ? void 0 : res.data) || {});
            case 4:
            case "end":
              return _context9.stop();
          }
        }, _callee9);
      })), {
        refreshDeps: [carNo, startTime, endTime, page, sort, order],
        ready: !!carNo
      }),
      _useRequest41$data = _useRequest41.data,
      data = _useRequest41$data === void 0 ? {} : _useRequest41$data,
      loading = _useRequest41.loading;
    return {
      workDetailData: data,
      loading: loading
    };
  }
};

//油耗
export var OilService = {
  useHasOil: function useHasOil(carId) {
    var _data$data2;
    var _useRequest42 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/gps-reborn/car/config/getById"), {
          body: {
            id: carId
          }
        });
      }, {
        refreshDeps: [carId]
      }),
      data = _useRequest42.data;
    return {
      beenOilStatus: data === null || data === void 0 || (_data$data2 = data.data) === null || _data$data2 === void 0 ? void 0 : _data$data2.beenOilStatus
    };
  },
  useOilLine: function useOilLine(carId, startTime, endTime) {
    var _useRequest43 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/oil-reborn/api/oilUse/oilLine.smvc"), {
          body: {
            carId: carId,
            startTime: startTime,
            endTime: endTime,
            tenantId: getVtxToken('tenantId')
          }
        });
      }, {
        refreshDeps: [carId, startTime, endTime]
      }),
      oilLineRes = _useRequest43.data,
      loading = _useRequest43.loading;
    return {
      oilLineRes: (oilLineRes === null || oilLineRes === void 0 ? void 0 : oilLineRes.data) || [],
      loading: loading
    };
  },
  useSummary: function useSummary(carId, startTime, endTime) {
    var _useRequest44 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/oil-reborn/api/oilUse/summary.smvc"), {
          body: {
            carId: carId,
            startTime: startTime,
            endTime: endTime,
            tenantId: getVtxToken('tenantId')
          }
        });
      }, {
        refreshDeps: [carId, startTime, endTime]
      }),
      summaryRes = _useRequest44.data;
    return {
      summaryRes: (summaryRes === null || summaryRes === void 0 ? void 0 : summaryRes.data) || []
    };
  },
  useRecord: function useRecord(carId, startTime, endTime, page, sort) {
    var _useRequest45 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/oil-reborn/api/oilUse/simplePage.smvc"), {
          body: {
            carId: carId,
            startTime: startTime,
            endTime: endTime,
            page: page,
            rows: 10,
            sortKey: 'day',
            sort: sort,
            tenantId: getVtxToken('tenantId')
          }
        });
      }, {
        refreshDeps: [carId, startTime, endTime, page, sort]
      }),
      recordRes = _useRequest45.data;
    return {
      recordRes: (recordRes === null || recordRes === void 0 ? void 0 : recordRes.data) || []
    };
  }
};

//水耗
export var WaterService = {
  useSummary: function useSummary(carId, startTime, endTime) {
    var _useRequest46 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/water-reborn/api/v101/water/waterMeasure/summary"), {
          body: {
            hasWaterStatus: true,
            carId: carId,
            startTime: startTime,
            endTime: endTime
          }
        });
      }, {
        refreshDeps: [carId, startTime, endTime]
      }),
      summaryRes = _useRequest46.data;
    return {
      summaryRes: (summaryRes === null || summaryRes === void 0 ? void 0 : summaryRes.data) || []
    };
  },
  useRecord: function useRecord(carId, startDate, endDate) {
    var _useRequest47 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/water-reborn/api/v101/water/waterMeasure/queryList"), {
          body: {
            hasWaterStatus: true,
            carId: carId,
            startDate: startDate,
            endDate: endDate
          }
        });
      }, {
        refreshDeps: [carId, startDate, endDate]
      }),
      recordRes = _useRequest47.data,
      loading = _useRequest47.loading;
    return {
      recordRes: (recordRes === null || recordRes === void 0 ? void 0 : recordRes.data) || [],
      loading: loading
    };
  }
};

// 维保
export var MaintenanceService = {
  useMaintenance: function useMaintenance(carId) {
    var _useRequest48 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/clwb/api/v101/carComprehensiveBoard/carWbAnalyse"), {
          body: {
            carId: carId
          }
        });
      }, {
        refreshDeps: [carId]
      }),
      maintenanceRes = _useRequest48.data;
    return {
      maintenanceRes: (maintenanceRes === null || maintenanceRes === void 0 ? void 0 : maintenanceRes.data) || []
    };
  }
};

// 无人车实时信息
export var unmannedRealByCarId = function unmannedRealByCarId(body) {
  return http.get("".concat(prefix, "/cloud/zyqs-zqb/api/kanban/unmannedRealByCarId"), {
    body: body
  });
};
export var carIdentityMap = new Map([['innerCode', '自编号'], ['carCode', '车牌号'], ['originalDeviceCode', '原始设备编码'], ['carClassName', '车辆类别'], ['carGradeName', '车辆种类'], ['emissionStageName', '排放阶段'], ['licensePlateColorName', '车牌颜色'], ['drivingLicenseCode', '行驶证编号'], ['useUnitName', '使用单位'], ['belongUnitName', '所属单位'], ['manageStaffName', '责任人'], ['divisionName', '行政区划'], ['backupManageStaffName', '后备责任人'], ['contact', '联系人'], ['contactWay', '联系方式'], ['carBrand', '车辆品牌'], ['carType', '车辆型号'], ['procurementDate', '购置时间'], ['useYears', '使用年限'], ['procurementAmt', '购置金额（元）'], ['life', '使用年限（年）'], ['scrapDate', '报废时间'], ['depreciationVal', '已折旧金额（元）'], ['reDepreciationVal', '剩余折旧金额（元）'], ['invoiceCode', '发票编号'], ['certificateCode', '证书编号'], ['certificateKeeper', '证书保管人'], ['identifyCode', '车辆识别代号'], ['engineCode', '发动机号'], ['purchaseApprovalCode', '采购审批单号'], ['orderIndex', '排序号'], ['workTypeName', '作业类型'], ['carStateStr', '生命周期'], ['bidSectionName', '所属标段'], ['photoIds', '车辆照片'],
// ['qrCode', '车辆二维码'],
['photoTwoIds', '图片']]);
export var carConfigMap = new Map([['carLabel', '车辆厂牌'], ['productionDate', '出厂日期'], ['productionPlace', '出厂地'], ['ownWeight', '自有重量（T）'], ['curbWeight', '整备质量（Kg）'], ['regulationWeight', '核定载质量（Kg）'], ['carUseWayName', '车辆用途'], ['carPropertyName', '车辆性质'], ['carAttrOneName', '车辆属性1'], ['carAttrTwoName', '车辆属性2'], ['regulationPerson', '核定载员（人）'], ['carWorkingWidth', '车辆作业宽度（米）'], ['driveLicensePhotoIds', '行驶证照片']]);
export var carAuditMap = new Map([['annualReviewDate', '年审日期'], ['maturityDate', '到期日期'], ['annualAuditFee', '年审费用（元）']]);
export var carSYMap = new Map([['matchingMethodStr', '匹配方式'], ['productTypeName', '垃圾类型'], ['collectMethodStr', '收运方式'], ['collectModeName', '收运模式'], ['taskGenerationMethodStr', '任务生成方式']]);

// 建筑垃圾车辆
export var JzljService = {
  // 总览其他信息：二维码、生效中处置证、联单、报警
  useZlOtherInfo: function useZlOtherInfo(_ref23) {
    var id = _ref23.id,
      startDate = _ref23.startDate,
      endDate = _ref23.endDate,
      url = _ref23.url;
    var _useRequest49 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/jzlj/web/api/gis/real/time/carBaseInfo"), {
          body: {
            id: id,
            startDate: startDate,
            endDate: endDate,
            url: url
          }
        });
      }, {
        refreshDeps: [id, startDate, endDate, url]
      }),
      zlOtherInfoRes = _useRequest49.data;
    return {
      zlOtherInfoData: (zlOtherInfoRes === null || zlOtherInfoRes === void 0 ? void 0 : zlOtherInfoRes.data) || {}
    };
  },
  // 运行信息
  useDailyCarRun: function useDailyCarRun(_ref24) {
    var _dailyCarRunRes$data, _dailyCarRunRes$data2;
    var id = _ref24.id,
      startDate = _ref24.startDate,
      endDate = _ref24.endDate;
    var _useRequest50 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/gps-reborn/report/dailyCarRun/list"), {
          body: {
            carIds: id,
            reportDateStart: startDate,
            reportDateEnd: endDate
          }
        });
      }, {
        refreshDeps: [id, startDate, endDate]
      }),
      dailyCarRunRes = _useRequest50.data;
    return {
      dailyCarRunData: dailyCarRunRes !== null && dailyCarRunRes !== void 0 && (_dailyCarRunRes$data = dailyCarRunRes.data) !== null && _dailyCarRunRes$data !== void 0 && _dailyCarRunRes$data.length ? (dailyCarRunRes === null || dailyCarRunRes === void 0 || (_dailyCarRunRes$data2 = dailyCarRunRes.data) === null || _dailyCarRunRes$data2 === void 0 ? void 0 : _dailyCarRunRes$data2[0]) || {} : {}
    };
  },
  // 近7天运行分析
  useYxfx: function useYxfx(_ref25) {
    var id = _ref25.id,
      startDate = _ref25.startDate,
      endDate = _ref25.endDate;
    var _useRequest51 = useRequest(function () {
        return http.get("".concat(prefix, "/cloud/jzlj/web/dz/kanban/carWorkAnalyse"), {
          body: {
            id: id,
            startDate: startDate,
            endDate: endDate
          }
        });
      }, {
        refreshDeps: [id, startDate, endDate]
      }),
      yxfxRes = _useRequest51.data,
      loading = _useRequest51.loading;
    return {
      yxfxData: (yxfxRes === null || yxfxRes === void 0 ? void 0 : yxfxRes.data) || [],
      loading: loading
    };
  },
  // 处置证信息-分页
  czzPage: function czzPage(_ref26) {
    var carCode = _ref26.carCode,
      page = _ref26.page,
      size = _ref26.size,
      restParams = _objectWithoutProperties(_ref26, _excluded);
    return http.get("/cloud/jzlj/web/api/disposal/certificate/info/page", {
      body: _objectSpread({
        page: page,
        size: size,
        effectiveCarCode: carCode
      }, restParams)
    });
  },
  // 处置证信息-饼图
  czzPie: function czzPie(_ref27) {
    var id = _ref27.id,
      page = _ref27.page,
      size = _ref27.size,
      restParams = _objectWithoutProperties(_ref27, _excluded2);
    return http.get("/cloud/jzlj//web/api/gis/real/time/carCzzPieChart", {
      body: _objectSpread({
        page: page,
        size: size,
        id: id
      }, restParams)
    });
  },
  // 建筑垃圾枚举
  fetchJzljEnum: function fetchJzljEnum(enumName) {
    var _useRequest52 = useRequest(function () {
        return http.get("/cloud/jzlj/common/loadEnumValue", {
          body: {
            enumName: enumName
          }
        });
      }, {
        refreshDeps: [enumName]
      }),
      _useRequest52$data = _useRequest52.data,
      data = _useRequest52$data === void 0 ? {} : _useRequest52$data;
    return (data === null || data === void 0 ? void 0 : data.data) || [];
  },
  // 字段配置
  fieldConfig: function fieldConfig() {
    var _useRequest53 = useRequest(function () {
        return http.get("/cloud/jzlj/web/field/config/list?ledgerType=CZHZBA", {
          body: {}
        });
      }, {
        refreshDeps: []
      }),
      _useRequest53$data = _useRequest53.data,
      data = _useRequest53$data === void 0 ? {} : _useRequest53$data;
    return (data === null || data === void 0 ? void 0 : data.data) || [];
  },
  // 联单-分页
  ldPage: function ldPage(_ref28) {
    var carId = _ref28.carId,
      stepThreeOperateTimeLeft = _ref28.stepThreeOperateTimeLeft,
      stepThreeOperateTimeRight = _ref28.stepThreeOperateTimeRight,
      page = _ref28.page,
      size = _ref28.size,
      restParams = _objectWithoutProperties(_ref28, _excluded3);
    return http.get("/cloud/jzlj/web/api/car/transport/joint/order/record/page", {
      body: _objectSpread({
        page: page,
        size: size,
        carId: carId,
        stepThreeOperateTimeLeft: stepThreeOperateTimeLeft,
        stepThreeOperateTimeRight: stepThreeOperateTimeRight
      }, restParams)
    });
  },
  ldChart: function ldChart(_ref29) {
    var id = _ref29.id,
      startDate = _ref29.startDate,
      endDate = _ref29.endDate;
    return http.get("".concat(prefix, "/cloud/jzlj/web/dz/kanban/carWorkAnalyse"), {
      body: {
        id: id,
        startDate: startDate,
        endDate: endDate
      }
    });
  },
  // 联单-统计
  ldTotal: function ldTotal(_ref30) {
    var carId = _ref30.carId,
      startDate = _ref30.startDate,
      endDate = _ref30.endDate,
      restParams = _objectWithoutProperties(_ref30, _excluded4);
    return http.get("/cloud/jzlj/web/api/gis/real/time/jcssJzJointOrderSummaryStatistics", {
      body: _objectSpread({
        carId: carId,
        stepThreeOperateTimeLeft: startDate + ' 00:00:00',
        stepThreeOperateTimeRight: endDate + ' 23:59:59'
      }, restParams)
    });
  },
  page_tccs: function page_tccs(_ref31) {
    var id = _ref31.id,
      startTime = _ref31.startTime,
      endTime = _ref31.endTime,
      page = _ref31.page,
      size = _ref31.size;
    return http.get("/cloud/jzlj/web/api/car/parking/timeout/alarm/job/page", {
      body: {
        page: page,
        size: size,
        carId: id,
        alarmTimeLeft: startTime,
        alarmTimeRight: endTime
      }
    });
  },
  page_lxpl: function page_lxpl(_ref32) {
    var id = _ref32.id,
      startTime = _ref32.startTime,
      endTime = _ref32.endTime,
      page = _ref32.page,
      size = _ref32.size;
    return http.get("/cloud/jzlj/web/api/car/route/deviation/alarm/job/page", {
      body: {
        page: page,
        size: size,
        carId: id,
        alarmTimeLeft: startTime,
        alarmTimeRight: endTime
      }
    });
  },
  // 报警汇总-饼图
  useAlarmSummary: function useAlarmSummary(_ref33) {
    var carId = _ref33.carId,
      startDate = _ref33.startDate,
      endDate = _ref33.endDate;
    var _useRequest54 = useRequest(function () {
        return http.get("/cloud/jzlj/web/dz/kanban/carAlarmTypeCountSummaryInfo", {
          body: {
            carId: carId,
            startDate: startDate,
            endDate: endDate,
            alarmTypes: 'parkingTimeout,routeDeviation'
          }
        });
      }, {
        refreshDeps: [carId, startDate, endDate]
      }),
      alarmSummaryRes = _useRequest54.data;
    return {
      alarmSummaryData: (alarmSummaryRes === null || alarmSummaryRes === void 0 ? void 0 : alarmSummaryRes.data) || {}
    };
  },
  // 报警趋势-折线图
  useAlarmTrend: function useAlarmTrend(_ref34) {
    var id = _ref34.id,
      startDate = _ref34.startDate,
      endDate = _ref34.endDate;
    var _useRequest55 = useRequest(function () {
        return http.get("/cloud/jzlj/web/api/gis/real/time/carOrderAlarmAnalyse", {
          body: {
            id: id,
            startDate: startDate,
            endDate: endDate
          }
        });
      }, {
        refreshDeps: [id, startDate, endDate]
      }),
      alarmTrendRes = _useRequest55.data;
    return {
      alarmTrendData: (alarmTrendRes === null || alarmTrendRes === void 0 ? void 0 : alarmTrendRes.data) || []
    };
  },
  // 单位
  useUnit: function useUnit() {
    var _data$data3, _unitStr;
    var groupCode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'XTPZ';
    var _useRequest56 = useRequest(function () {
        return http.get("/cloud/jzlj/web/api/tenant/system/config/getConfig", {
          body: {}
        });
      }, {
        refreshDeps: [groupCode]
      }),
      data = _useRequest56.data;
    var obj = {};
    var originalData = data === null || data === void 0 || (_data$data3 = data.data) === null || _data$data3 === void 0 ? void 0 : _data$data3[groupCode];
    for (var group in originalData) {
      if (originalData.hasOwnProperty(group)) {
        for (var item in originalData[group]) {
          var _originalData$group;
          obj[item] = (_originalData$group = originalData[group]) === null || _originalData$group === void 0 ? void 0 : _originalData$group[item];
        }
      }
    }
    var jointOrderWeightUnitTypeName = obj === null || obj === void 0 ? void 0 : obj.jointOrderWeightUnitTypeName;
    var nameSplitArr = jointOrderWeightUnitTypeName === null || jointOrderWeightUnitTypeName === void 0 ? void 0 : jointOrderWeightUnitTypeName.split('（');
    var unitStr = (nameSplitArr === null || nameSplitArr === void 0 ? void 0 : nameSplitArr[1]) || '吨）';
    unitStr = (_unitStr = unitStr) === null || _unitStr === void 0 ? void 0 : _unitStr.replace('）', '');
    return {
      unitStr: unitStr
    };
  },
  // 处置证字段配置
  useCzzFields: function useCzzFields() {
    var _useRequest57 = useRequest(function () {
        return http.get("/cloud/jzlj/web/field/config/list", {
          body: {
            ledgerType: 'CZHZBA'
          }
        });
      }, {
        refreshDeps: []
      }),
      res = _useRequest57.data;
    var dataList = (res === null || res === void 0 ? void 0 : res.data) || [];
    var visibleList = dataList.filter(function (item) {
      var _item$functionKeys;
      return ['YES', 'YES_NO_UPDATE'].includes(item.isVisible) && ['YES', 'YES_NO_UPDATE'].includes(item.listVisible) && (item === null || item === void 0 || (_item$functionKeys = item.functionKeys) === null || _item$functionKeys === void 0 || (_item$functionKeys = _item$functionKeys.split(',')) === null || _item$functionKeys === void 0 ? void 0 : _item$functionKeys.includes('modal_show'));
    });
    return {
      visibleList: visibleList
    };
  },
  // 联单字段配置
  useLdFields: function useLdFields() {
    var _useRequest58 = useRequest(function () {
        return http.get("/cloud/jzlj/web/field/config/list", {
          body: {
            ledgerType: 'CLYSLD'
          }
        });
      }, {
        refreshDeps: []
      }),
      res = _useRequest58.data;
    var dataList = (res === null || res === void 0 ? void 0 : res.data) || [];
    var visibleList = dataList.filter(function (item) {
      var _item$functionKeys2;
      return ['YES', 'YES_NO_UPDATE'].includes(item.isVisible) && ['YES', 'YES_NO_UPDATE'].includes(item.listVisible) && (item === null || item === void 0 || (_item$functionKeys2 = item.functionKeys) === null || _item$functionKeys2 === void 0 || (_item$functionKeys2 = _item$functionKeys2.split(',')) === null || _item$functionKeys2 === void 0 ? void 0 : _item$functionKeys2.includes('modal_show'));
    });
    return {
      visibleList: visibleList
    };
  }
};

// 单位
export var useUnit = function useUnit() {
  var _data$data4, _unitStr2;
  var groupCode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'XTPZ';
  var _useRequest59 = useRequest(function () {
      return request.get("/cloud/jzlj/web/api/tenant/system/config/getConfig", {
        data: {}
      });
    }, {
      refreshDeps: [groupCode]
    }),
    data = _useRequest59.data;
  var obj = {};
  var originalData = data === null || data === void 0 || (_data$data4 = data.data) === null || _data$data4 === void 0 ? void 0 : _data$data4[groupCode];
  for (var group in originalData) {
    if (originalData.hasOwnProperty(group)) {
      for (var item in originalData[group]) {
        var _originalData$group2;
        obj[item] = (_originalData$group2 = originalData[group]) === null || _originalData$group2 === void 0 ? void 0 : _originalData$group2[item];
      }
    }
  }
  var jointOrderWeightUnitTypeName = obj === null || obj === void 0 ? void 0 : obj.jointOrderWeightUnitTypeName;
  var nameSplitArr = jointOrderWeightUnitTypeName === null || jointOrderWeightUnitTypeName === void 0 ? void 0 : jointOrderWeightUnitTypeName.split('（');
  var unitStr = (nameSplitArr === null || nameSplitArr === void 0 ? void 0 : nameSplitArr[1]) || '吨）';
  unitStr = (_unitStr2 = unitStr) === null || _unitStr2 === void 0 ? void 0 : _unitStr2.replace('）', '');
  return {
    unitStr: unitStr
  };
};