@kmkf-fe-packages/kmkf-work-order-service-component 2.10.21 → 2.10.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -42,7 +42,9 @@ var CustomerServiceToDoList = function CustomerServiceToDoList(props) {
42
42
  onlyCount: false,
43
43
  onlyStartNode: true,
44
44
  flowTags: ['AI_BUILD'],
45
- shopUniqueKeyList: [shopUniqueKey]
45
+ shopUniqueKeyList: [shopUniqueKey],
46
+ startCreatedTime: moment().subtract(3, 'month').format('YYYY-MM-DD 00:00:00'),
47
+ endCreatedTime: moment().format('YYYY-MM-DD 23:59:59')
46
48
  });
47
49
  }, {
48
50
  target: containerRef,
@@ -14,7 +14,11 @@ import { useEffect, useState } from 'react';
14
14
  import { useAppDispatch, useAppSelector } from "../../../model/hooks";
15
15
  import notificationIcon from "../../../common/imgs/notification.png";
16
16
  import { nodeWorkOrderPending } from "../../../model/servers/api";
17
+ import moment from 'moment';
17
18
  import styles from "./index.module.less";
19
+ var CACHE_KEY = 'customer_service_todo_count_cache';
20
+ var CACHE_DURATION = 10 * 60 * 1000; // 10分钟
21
+
18
22
  var CustomerServiceToDoCard = function CustomerServiceToDoCard(props) {
19
23
  var shopUniqueKey = props.shopUniqueKey;
20
24
  var dispatch = useAppDispatch();
@@ -28,25 +32,56 @@ var CustomerServiceToDoCard = function CustomerServiceToDoCard(props) {
28
32
  });
29
33
  var initHandle = /*#__PURE__*/function () {
30
34
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
31
- var _yield$nodeWorkOrderP, data;
35
+ var cached, _JSON$parse, value, timestamp, _yield$nodeWorkOrderP, data, total;
32
36
  return _regeneratorRuntime().wrap(function _callee$(_context) {
33
37
  while (1) switch (_context.prev = _context.next) {
34
38
  case 0:
35
- _context.next = 2;
39
+ // 尝试读取浏览器缓存
40
+ cached = localStorage.getItem(CACHE_KEY);
41
+ if (!cached) {
42
+ _context.next = 11;
43
+ break;
44
+ }
45
+ _context.prev = 2;
46
+ _JSON$parse = JSON.parse(cached), value = _JSON$parse.value, timestamp = _JSON$parse.timestamp;
47
+ if (!(Date.now() - timestamp < CACHE_DURATION)) {
48
+ _context.next = 7;
49
+ break;
50
+ }
51
+ // 缓存未过期,直接使用
52
+ setNumber(value || 0);
53
+ return _context.abrupt("return");
54
+ case 7:
55
+ _context.next = 11;
56
+ break;
57
+ case 9:
58
+ _context.prev = 9;
59
+ _context.t0 = _context["catch"](2);
60
+ case 11:
61
+ _context.next = 13;
36
62
  return nodeWorkOrderPending({
37
63
  flowTags: ['AI_BUILD'],
38
64
  onlyCount: true,
39
- shopUniqueKeyList: [shopUniqueKey]
65
+ shopUniqueKeyList: [shopUniqueKey],
66
+ startCreatedTime: moment().subtract(3, 'month').format('YYYY-MM-DD 00:00:00'),
67
+ endCreatedTime: moment().format('YYYY-MM-DD 23:59:59')
40
68
  });
41
- case 2:
69
+ case 13:
42
70
  _yield$nodeWorkOrderP = _context.sent;
43
71
  data = _yield$nodeWorkOrderP.data;
44
- setNumber((data === null || data === void 0 ? void 0 : data.total) || 0);
45
- case 5:
72
+ total = (data === null || data === void 0 ? void 0 : data.total) || 0;
73
+ setNumber(total);
74
+
75
+ // 写入浏览器缓存(数量为0时也缓存)
76
+ localStorage.setItem(CACHE_KEY, JSON.stringify({
77
+ value: total,
78
+ timestamp: Date.now()
79
+ }));
80
+ case 18:
46
81
  case "end":
47
82
  return _context.stop();
48
83
  }
49
- }, _callee);
84
+ }, _callee, null, [[2, 9]]);
50
85
  }));
51
86
  return function initHandle() {
52
87
  return _ref.apply(this, arguments);
@@ -2,17 +2,17 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2
2
  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 exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
3
3
  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); } }
4
4
  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); }); }; }
5
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7
+ 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; }
8
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
9
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
5
10
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
6
11
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
7
12
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
8
13
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
9
14
  function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
10
15
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
12
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
13
- 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; }
14
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
15
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
16
16
  import React, { useEffect, useCallback, useState, useRef, useMemo } from 'react';
17
17
  import { Form, Row, Col, DatePicker, Input, Select, Cascader, Checkbox, message, Button, Drawer, Spin, Tabs, Empty } from 'antd';
18
18
  import { LeftOutlined } from '@ant-design/icons';
@@ -32,6 +32,23 @@ import { queryAllWorkOrderList, queryTemplateDetail, queryNodesByFlowTemplateKey
32
32
  import FlowTemplateDetail from "../../../FlowTemplateDetailV2";
33
33
  import "./index.less";
34
34
  var RangePicker = DatePicker.RangePicker;
35
+ var MAX_TIME_RANGE_MONTHS = 3;
36
+ var isTimeRangeOverLimit = function isTimeRangeOverLimit(time) {
37
+ if (!(time !== null && time !== void 0 && time[0]) || !(time !== null && time !== void 0 && time[1])) {
38
+ return false;
39
+ }
40
+ var _ref = time[0].isBefore(time[1]) ? time : [time[1], time[0]],
41
+ _ref2 = _slicedToArray(_ref, 2),
42
+ start = _ref2[0],
43
+ end = _ref2[1];
44
+ return end.isAfter(start.clone().add(MAX_TIME_RANGE_MONTHS, 'months'), 'day');
45
+ };
46
+ var isDateOutsideRangeLimit = function isDateOutsideRangeLimit(current, anchor) {
47
+ var months = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : MAX_TIME_RANGE_MONTHS;
48
+ var minDate = anchor.clone().subtract(months, 'months').startOf('day');
49
+ var maxDate = anchor.clone().add(months, 'months').endOf('day');
50
+ return current.isBefore(minDate, 'day') || current.isAfter(maxDate, 'day');
51
+ };
35
52
  var workOrderStatus = [{
36
53
  label: '处理中',
37
54
  value: 'PROCESSING'
@@ -51,16 +68,16 @@ var workOrderStatus = [{
51
68
  label: '回退中',
52
69
  value: 'RETURNING'
53
70
  }];
54
- var getTableData = function getTableData(_ref) {
55
- var checkedBuyerId = _ref.checkedBuyerId,
56
- buyerId = _ref.buyerId,
57
- shopList = _ref.shopList,
58
- shopId = _ref.shopId;
59
- return function (_ref2, formData) {
60
- var _ref3, _ref3$find, _formData$flowTemplat;
61
- var pageNo = _ref2.pageNo,
62
- pageSize = _ref2.pageSize,
63
- onlyWaitForMe = _ref2.onlyWaitForMe;
71
+ var getTableData = function getTableData(_ref3) {
72
+ var checkedBuyerId = _ref3.checkedBuyerId,
73
+ buyerId = _ref3.buyerId,
74
+ shopList = _ref3.shopList,
75
+ shopId = _ref3.shopId;
76
+ return function (_ref4, formData) {
77
+ var _ref5, _ref5$find, _formData$flowTemplat;
78
+ var pageNo = _ref4.pageNo,
79
+ pageSize = _ref4.pageSize,
80
+ onlyWaitForMe = _ref4.onlyWaitForMe;
64
81
  //判断店铺列表是否存在 端上必须要有店铺 需要过滤
65
82
  if (!shopList || !shopList.length) {
66
83
  return Promise.resolve();
@@ -75,9 +92,9 @@ var getTableData = function getTableData(_ref) {
75
92
  params.buyerOpenUid = buyerId;
76
93
  }
77
94
  delete params.time; // time是moment类型的,监控上报的时侯,格式化报错了
78
- var shopUniqueKey = (_ref3 = shopList || []) === null || _ref3 === void 0 ? void 0 : (_ref3$find = _ref3.find(function (item) {
95
+ var shopUniqueKey = (_ref5 = shopList || []) === null || _ref5 === void 0 ? void 0 : (_ref5$find = _ref5.find(function (item) {
79
96
  return item.shopId === shopId;
80
- })) === null || _ref3$find === void 0 ? void 0 : _ref3$find.uniqueKey;
97
+ })) === null || _ref5$find === void 0 ? void 0 : _ref5$find.uniqueKey;
81
98
  if (shopUniqueKey) {
82
99
  params.shopUniqueKey = shopUniqueKey;
83
100
  }
@@ -132,11 +149,11 @@ var FlowOrderList = function FlowOrderList(props) {
132
149
  }, "\u6CA1\u6709\u66F4\u591A\u6570\u636E\u4E86") : null));
133
150
  };
134
151
  //工单列表
135
- var CustomizeWorkOrderList = function CustomizeWorkOrderList(_ref4) {
152
+ var CustomizeWorkOrderList = function CustomizeWorkOrderList(_ref6) {
136
153
  var _nodesData$data, _nodesData$data$workO;
137
- var tabActive = _ref4.tabActive,
138
- onOpenWangWang = _ref4.onOpenWangWang,
139
- otherInfo = _ref4.otherInfo;
154
+ var tabActive = _ref6.tabActive,
155
+ onOpenWangWang = _ref6.onOpenWangWang,
156
+ otherInfo = _ref6.otherInfo;
140
157
  var dispatch = useAppDispatch();
141
158
  var _useState = useState(false),
142
159
  _useState2 = _slicedToArray(_useState, 2),
@@ -166,6 +183,17 @@ var CustomizeWorkOrderList = function CustomizeWorkOrderList(_ref4) {
166
183
  _useState14 = _slicedToArray(_useState13, 2),
167
184
  searchHeight = _useState14[0],
168
185
  setSearchHeight = _useState14[1];
186
+ var defaultTimeRange = useMemo(function () {
187
+ return [moment().subtract(30, 'day'), moment()];
188
+ }, []);
189
+ var _useState15 = useState(defaultTimeRange),
190
+ _useState16 = _slicedToArray(_useState15, 2),
191
+ selectedTimeRange = _useState16[0],
192
+ setSelectedTimeRange = _useState16[1];
193
+ var _useState17 = useState(null),
194
+ _useState18 = _slicedToArray(_useState17, 2),
195
+ activeTimeRange = _useState18[0],
196
+ setActiveTimeRange = _useState18[1];
169
197
  var allLogicFlowList = useSelector(selectFlowList);
170
198
  var flowTemplateGroupWorkOrderTemplateList = useSelector(selectFlowTemplateGroupWorkOrderTemplateList);
171
199
  var shopList = useAppSelector(function (state) {
@@ -372,7 +400,7 @@ var CustomizeWorkOrderList = function CustomizeWorkOrderList(_ref4) {
372
400
  };
373
401
  }, []);
374
402
  var initHandle = /*#__PURE__*/function () {
375
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(otherInfo, buyerId, orderNo) {
403
+ var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(otherInfo, buyerId, orderNo) {
376
404
  return _regeneratorRuntime().wrap(function _callee$(_context) {
377
405
  while (1) switch (_context.prev = _context.next) {
378
406
  case 0:
@@ -401,13 +429,20 @@ var CustomizeWorkOrderList = function CustomizeWorkOrderList(_ref4) {
401
429
  }, _callee);
402
430
  }));
403
431
  return function initHandle(_x2, _x3, _x4) {
404
- return _ref5.apply(this, arguments);
432
+ return _ref7.apply(this, arguments);
405
433
  };
406
434
  }();
407
435
  useEffect(function () {
408
436
  initHandle(otherInfo, buyerId, orderNo);
409
437
  }, [otherInfo, buyerId, orderNo]);
410
438
  var searchHandle = function searchHandle() {
439
+ var time = form.getFieldValue('time');
440
+ if (!(time !== null && time !== void 0 && time[0]) || !(time !== null && time !== void 0 && time[1])) {
441
+ return message.warning('请选择时间');
442
+ }
443
+ if (isTimeRangeOverLimit(time)) {
444
+ return message.warning('时间范围不能超过3个月');
445
+ }
411
446
  var templateList = form.getFieldValue('templateIdList');
412
447
  if (templateList && templateList.length) {
413
448
  var tempId = templateList[templateList.length - 1];
@@ -428,6 +463,8 @@ var CustomizeWorkOrderList = function CustomizeWorkOrderList(_ref4) {
428
463
  };
429
464
  var resetHandle = function resetHandle() {
430
465
  form.resetFields();
466
+ setSelectedTimeRange(defaultTimeRange);
467
+ setActiveTimeRange(null);
431
468
  searchList();
432
469
  run('');
433
470
  };
@@ -440,7 +477,7 @@ var CustomizeWorkOrderList = function CustomizeWorkOrderList(_ref4) {
440
477
  className: "custom_box_search_buyer",
441
478
  checked: currentBuyerChecked,
442
479
  onChange: /*#__PURE__*/function () {
443
- var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
480
+ var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
444
481
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
445
482
  while (1) switch (_context2.prev = _context2.next) {
446
483
  case 0:
@@ -461,7 +498,7 @@ var CustomizeWorkOrderList = function CustomizeWorkOrderList(_ref4) {
461
498
  }, _callee2);
462
499
  }));
463
500
  return function (_x5) {
464
- return _ref6.apply(this, arguments);
501
+ return _ref8.apply(this, arguments);
465
502
  };
466
503
  }()
467
504
  }, "\u5F53\u524D\u4E70\u5BB6")), /*#__PURE__*/React.createElement(Col, null, /*#__PURE__*/React.createElement("span", {
@@ -479,7 +516,7 @@ var CustomizeWorkOrderList = function CustomizeWorkOrderList(_ref4) {
479
516
  className: "customizeSearch ".concat(open ? 'open' : 'close'),
480
517
  initialValues: {
481
518
  type: 'ALL',
482
- time: [moment().subtract(30, 'day'), moment()]
519
+ time: defaultTimeRange
483
520
  }
484
521
  }, /*#__PURE__*/React.createElement(Row, {
485
522
  gutter: 24
@@ -491,7 +528,25 @@ var CustomizeWorkOrderList = function CustomizeWorkOrderList(_ref4) {
491
528
  style: {
492
529
  width: '100%'
493
530
  },
494
- placeholder: ['开始日期', '结束日期']
531
+ placeholder: ['开始日期', '结束日期'],
532
+ disabledDate: function disabledDate(current) {
533
+ if (!current) {
534
+ return false;
535
+ }
536
+ var _ref9 = selectedTimeRange || [],
537
+ _ref10 = _slicedToArray(_ref9, 2),
538
+ start = _ref10[0],
539
+ end = _ref10[1];
540
+ var anchor = activeTimeRange === 'start' ? end : activeTimeRange === 'end' ? start : start || end;
541
+ if (!anchor) {
542
+ return false;
543
+ }
544
+ return isDateOutsideRangeLimit(current, anchor);
545
+ },
546
+ onCalendarChange: function onCalendarChange(values, _, info) {
547
+ setSelectedTimeRange(values);
548
+ setActiveTimeRange(info.range);
549
+ }
495
550
  }))), /*#__PURE__*/React.createElement(Col, {
496
551
  span: 12
497
552
  }, /*#__PURE__*/React.createElement(Form.Item, {
@@ -578,13 +633,13 @@ var CustomizeWorkOrderList = function CustomizeWorkOrderList(_ref4) {
578
633
  dispatch(setFormModalVisible(false));
579
634
  queryPanelInfoHandle(record);
580
635
  };
581
- var handleCreateWorkOrderByFlowId = function handleCreateWorkOrderByFlowId(_ref7) {
636
+ var handleCreateWorkOrderByFlowId = function handleCreateWorkOrderByFlowId(_ref11) {
582
637
  var _allLogicFlowList$fin;
583
- var logicFlowId = _ref7.id,
584
- name = _ref7.name;
585
- var _ref8 = featureConfig || {},
586
- generalSingle = _ref8.generalSingle,
587
- generalMulti = _ref8.generalMulti;
638
+ var logicFlowId = _ref11.id,
639
+ name = _ref11.name;
640
+ var _ref12 = featureConfig || {},
641
+ generalSingle = _ref12.generalSingle,
642
+ generalMulti = _ref12.generalMulti;
588
643
  var templateType = ((_allLogicFlowList$fin = allLogicFlowList.find(function (item) {
589
644
  return item.key === logicFlowId;
590
645
  })) === null || _allLogicFlowList$fin === void 0 ? void 0 : _allLogicFlowList$fin.type) || '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/kmkf-work-order-service-component",
3
- "version": "2.10.21",
3
+ "version": "2.10.22",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -32,9 +32,9 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@ant-design/icons": "^4.7.0",
35
- "@kmkf-fe-packages/basic-components": "2.10.20",
36
- "@kmkf-fe-packages/kmkf-utils": "2.10.20",
37
- "@kmkf-fe-packages/services-components": "2.10.21",
35
+ "@kmkf-fe-packages/basic-components": "2.10.22",
36
+ "@kmkf-fe-packages/kmkf-utils": "2.10.22",
37
+ "@kmkf-fe-packages/services-components": "2.10.22",
38
38
  "@reduxjs/toolkit": "^1.8.5",
39
39
  "ahooks": "^3.7.4",
40
40
  "copy-to-clipboard": "^3.3.3",
@@ -75,7 +75,7 @@
75
75
  "publishConfig": {
76
76
  "access": "public"
77
77
  },
78
- "gitHead": "fcecb439104eb28d1069606dc82197dc876128ab",
78
+ "gitHead": "57ef936ce0251d160e6cf254976cf3a806188914",
79
79
  "gitHooks": {
80
80
  "pre-commit": "lint-staged"
81
81
  }