@pisell/pisellos 2.2.4 → 2.2.6

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.
@@ -29,6 +29,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
29
29
  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); }
30
30
  import { cloneDeep } from 'lodash-es';
31
31
  import { BaseModule } from "../BaseModule";
32
+ import { RequestModeENUM } from "../../plugins";
32
33
  import { DEFAULT_CUSTOMER, DEFAULT_PAGE_SIZE, SORT_BY } from "./constants";
33
34
  export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
34
35
  _inherits(CustomerModule, _BaseModule);
@@ -160,7 +161,12 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
160
161
  search: search
161
162
  }), otherParams);
162
163
  _context2.next = 6;
163
- return this.request.get(url, queryParams);
164
+ return this.request.get(url, queryParams, {
165
+ cache: {
166
+ mode: RequestModeENUM.REMOTE_LOCAL,
167
+ type: "indexDB"
168
+ }
169
+ });
164
170
  case 6:
165
171
  res = _context2.sent;
166
172
  if (!((res === null || res === void 0 ? void 0 : res.code) !== 200)) {
@@ -222,6 +222,8 @@ export var ProductsModule = /*#__PURE__*/function (_BaseModule) {
222
222
  return this.loadProductsPrice({
223
223
  ids: allProducts.map(function (product) {
224
224
  return product.id;
225
+ }).sort(function (a, b) {
226
+ return a - b;
225
227
  }),
226
228
  schedule_date: schedule_date
227
229
  });
@@ -123,7 +123,7 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
123
123
  * 获取当前的客户搜索条件
124
124
  * @returns 当前搜索条件
125
125
  */
126
- getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
126
+ getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
127
127
  /**
128
128
  * 获取客户列表状态(包含滚动加载相关状态)
129
129
  * @returns 客户状态
@@ -25,6 +25,7 @@ __export(Customer_exports, {
25
25
  module.exports = __toCommonJS(Customer_exports);
26
26
  var import_lodash_es = require("lodash-es");
27
27
  var import_BaseModule = require("../BaseModule");
28
+ var import_plugins = require("../../plugins");
28
29
  var import_constants = require("./constants");
29
30
  __reExport(Customer_exports, require("./types"), module.exports);
30
31
  var CustomerModule = class extends import_BaseModule.BaseModule {
@@ -107,7 +108,12 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
107
108
  ...search && { search },
108
109
  ...otherParams
109
110
  };
110
- const res = await this.request.get(url, queryParams);
111
+ const res = await this.request.get(url, queryParams, {
112
+ cache: {
113
+ mode: import_plugins.RequestModeENUM.REMOTE_LOCAL,
114
+ type: "indexDB"
115
+ }
116
+ });
111
117
  if ((res == null ? void 0 : res.code) !== 200) {
112
118
  throw new Error(res == null ? void 0 : res.message);
113
119
  }
@@ -129,7 +129,7 @@ var ProductsModule = class extends import_BaseModule.BaseModule {
129
129
  const allProducts = await this.getProducts();
130
130
  console.log(`[ProductsModule] 🌐 开始获取商品报价单价格`);
131
131
  const priceData = await this.loadProductsPrice({
132
- ids: allProducts.map((product) => product.id),
132
+ ids: allProducts.map((product) => product.id).sort((a, b) => a - b),
133
133
  schedule_date
134
134
  });
135
135
  console.log(`[ProductsModule] 🌐 获取商品报价单价格成功`, priceData);
@@ -123,7 +123,7 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
123
123
  * 获取当前的客户搜索条件
124
124
  * @returns 当前搜索条件
125
125
  */
126
- getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
126
+ getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
127
127
  /**
128
128
  * 获取客户列表状态(包含滚动加载相关状态)
129
129
  * @returns 客户状态
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "2.2.4",
4
+ "version": "2.2.6",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",