@fle-ui/plus-choose-goods 0.0.1

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.
package/lib/index.js ADDED
@@ -0,0 +1,526 @@
1
+ "use strict";
2
+
3
+ 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); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _react = _interopRequireWildcard(require("react"));
9
+ var _antd = require("antd");
10
+ var _proComponents = require("@ant-design/pro-components");
11
+ var _plusConfigProvider = _interopRequireDefault(require("@fle-ui/plus-config-provider"));
12
+ var _plusImage = _interopRequireDefault(require("@fle-ui/plus-image"));
13
+ var _lodash = _interopRequireDefault(require("lodash"));
14
+ var _icon = _interopRequireDefault(require("./components/icon"));
15
+ var _options = require("./utils/options");
16
+ var _request = _interopRequireDefault(require("./utils/request"));
17
+ var _serviceEnv = require("./utils/serviceEnv");
18
+ var _api = _interopRequireDefault(require("./utils/api"));
19
+ var _common = require("./utils/common");
20
+ var _ahooks = require("ahooks");
21
+ var _plusRangeInput = _interopRequireDefault(require("@fle-ui/plus-range-input"));
22
+ require("./index.less");
23
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
24
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
25
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
26
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
27
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
28
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
29
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
30
+ 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 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 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 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; }
31
+ 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); } }
32
+ 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); }); }; }
33
+ 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; }
34
+ 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; }
35
+ 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; }
36
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
37
+ 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); }
38
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
39
+ 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."); }
40
+ 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); }
41
+ 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; }
42
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
43
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
44
+ var ChooseSiteGoods = function ChooseSiteGoods(props) {
45
+ var open = props.open,
46
+ env = props.env,
47
+ token = props.token,
48
+ serviceUrl = props.serviceUrl,
49
+ _props$columns = props.columns,
50
+ columns = _props$columns === void 0 ? [] : _props$columns,
51
+ _props$loginErrFn = props.loginErrFn,
52
+ loginErrFn = _props$loginErrFn === void 0 ? function () {} : _props$loginErrFn,
53
+ _props$multiple = props.multiple,
54
+ multiple = _props$multiple === void 0 ? true : _props$multiple,
55
+ _props$defaultSelecte = props.defaultSelectedGoodsIds,
56
+ defaultSelectedGoodsIds = _props$defaultSelecte === void 0 ? [] : _props$defaultSelecte,
57
+ _props$customParams = props.customParams,
58
+ customParams = _props$customParams === void 0 ? {} : _props$customParams,
59
+ _props$rowKey = props.rowKey,
60
+ rowKey = _props$rowKey === void 0 ? 'goodsId' : _props$rowKey,
61
+ _props$onOk = props.onOk,
62
+ onOk = _props$onOk === void 0 ? function () {} : _props$onOk,
63
+ _props$onCancel = props.onCancel,
64
+ onCancel = _props$onCancel === void 0 ? function () {} : _props$onCancel,
65
+ _props$scroll = props.scroll,
66
+ scroll = _props$scroll === void 0 ? {
67
+ x: 1500,
68
+ y: 400
69
+ } : _props$scroll;
70
+ var formRef = (0, _react.useRef)();
71
+ var $http = (0, _request.default)({
72
+ baseURL: (0, _serviceEnv.getApiHost)(env),
73
+ token: token,
74
+ loginErrFn: loginErrFn
75
+ });
76
+ var _useState = (0, _react.useState)(10),
77
+ _useState2 = _slicedToArray(_useState, 2),
78
+ pageSize = _useState2[0],
79
+ setPageSize = _useState2[1];
80
+ var DefaultParams = (0, _react.useMemo)(function () {
81
+ return _objectSpread(_objectSpread({}, customParams), {}, {
82
+ pageSize: pageSize,
83
+ pageNo: 1,
84
+ isGetSubSupplierName: 1
85
+ });
86
+ }, [customParams, pageSize]);
87
+ var _useState3 = (0, _react.useState)(DefaultParams),
88
+ _useState4 = _slicedToArray(_useState3, 2),
89
+ searchParams = _useState4[0],
90
+ setSearchParams = _useState4[1];
91
+ var _useRequest = (0, _ahooks.useRequest)( /*#__PURE__*/function () {
92
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(val) {
93
+ var _val$flagCategory, _res$data, _res$data2;
94
+ var params, _val$rangePrice, _val$rangePrice2, res;
95
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
96
+ while (1) switch (_context.prev = _context.next) {
97
+ case 0:
98
+ params = _objectSpread(_objectSpread({}, val), {}, {
99
+ flagCategory: ((_val$flagCategory = val.flagCategory) === null || _val$flagCategory === void 0 ? void 0 : _val$flagCategory.length) ? val.flagCategory[val.flagCategory.length - 1] : undefined
100
+ }); // 价格区间
101
+ if (val.priceType && val.rangePrice) {
102
+ params["".concat(val.priceType, "Min")] = (0, _common.formartNum)((_val$rangePrice = val.rangePrice) === null || _val$rangePrice === void 0 ? void 0 : _val$rangePrice[0]);
103
+ params["".concat(val.priceType, "Max")] = (0, _common.formartNum)((_val$rangePrice2 = val.rangePrice) === null || _val$rangePrice2 === void 0 ? void 0 : _val$rangePrice2[1]);
104
+ if (val.priceType.includes('once')) {
105
+ params['isOnce'] = 1;
106
+ }
107
+ if (val.priceType.includes('purchase')) {
108
+ params['isPurchase'] = 1;
109
+ }
110
+ }
111
+ _context.next = 4;
112
+ return $http.post(serviceUrl || _api.default['getGoodsList'], params);
113
+ case 4:
114
+ res = _context.sent;
115
+ return _context.abrupt("return", {
116
+ list: (res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.list) || [],
117
+ total: (res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.total) || 0
118
+ });
119
+ case 6:
120
+ case "end":
121
+ return _context.stop();
122
+ }
123
+ }, _callee);
124
+ }));
125
+ return function (_x) {
126
+ return _ref.apply(this, arguments);
127
+ };
128
+ }(), {
129
+ manual: true,
130
+ loadingDelay: 300
131
+ }),
132
+ goodsData = _useRequest.data,
133
+ getGoodsListLoading = _useRequest.loading,
134
+ getGoodsList = _useRequest.run;
135
+ // 自有商品 标签 begin
136
+ var _useState5 = (0, _react.useState)([]),
137
+ _useState6 = _slicedToArray(_useState5, 2),
138
+ flagSceneOptions = _useState6[0],
139
+ setFlagSceneOptions = _useState6[1]; // 场景标签
140
+ var _useState7 = (0, _react.useState)([]),
141
+ _useState8 = _slicedToArray(_useState7, 2),
142
+ flagTagsOptions = _useState8[0],
143
+ setFlagTagsOptions = _useState8[1]; // 商品标签
144
+ var _useState9 = (0, _react.useState)([]),
145
+ _useState10 = _slicedToArray(_useState9, 2),
146
+ flagIndustryOptions = _useState10[0],
147
+ setFlagIndustryOptions = _useState10[1]; // 行业标签
148
+ var _useState11 = (0, _react.useState)([]),
149
+ _useState12 = _slicedToArray(_useState11, 2),
150
+ flagCategoryOptions = _useState12[0],
151
+ setFlagCategoryOptions = _useState12[1]; // 品类标签
152
+ // 获取自有商品标签 - 场景 商品 行业
153
+ var getSelfGoodsFlag = /*#__PURE__*/function () {
154
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
155
+ var res, list;
156
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
157
+ while (1) switch (_context2.prev = _context2.next) {
158
+ case 0:
159
+ _context2.next = 2;
160
+ return $http.post(_api.default['getSelfGoodsFlag']);
161
+ case 2:
162
+ res = _context2.sent;
163
+ if (res === null || res === void 0 ? void 0 : res.success) {
164
+ list = (res === null || res === void 0 ? void 0 : res.data) || [];
165
+ setFlagSceneOptions(list[3]);
166
+ setFlagTagsOptions(list[1]);
167
+ setFlagIndustryOptions(list[2]);
168
+ }
169
+ case 4:
170
+ case "end":
171
+ return _context2.stop();
172
+ }
173
+ }, _callee2);
174
+ }));
175
+ return function getSelfGoodsFlag() {
176
+ return _ref2.apply(this, arguments);
177
+ };
178
+ }();
179
+ // 获取自有商品标签 - 品类
180
+ var getSelfGoodsFlagCategory = /*#__PURE__*/function () {
181
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
182
+ var res;
183
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
184
+ while (1) switch (_context3.prev = _context3.next) {
185
+ case 0:
186
+ _context3.next = 2;
187
+ return $http.get(_api.default['getSelfGoodsFlagCategory']);
188
+ case 2:
189
+ res = _context3.sent;
190
+ if (res === null || res === void 0 ? void 0 : res.success) {
191
+ setFlagCategoryOptions((res === null || res === void 0 ? void 0 : res.data) || []);
192
+ }
193
+ case 4:
194
+ case "end":
195
+ return _context3.stop();
196
+ }
197
+ }, _callee3);
198
+ }));
199
+ return function getSelfGoodsFlagCategory() {
200
+ return _ref3.apply(this, arguments);
201
+ };
202
+ }();
203
+ (0, _react.useEffect)(function () {
204
+ if (open) {
205
+ var _formRef$current;
206
+ var values = (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : _formRef$current.getFieldsValue();
207
+ getGoodsList(_objectSpread(_objectSpread({}, searchParams), values));
208
+ getSelfGoodsFlag();
209
+ getSelfGoodsFlagCategory();
210
+ } else {
211
+ var _formRef$current2;
212
+ setSearchParams(DefaultParams);
213
+ (_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 ? void 0 : _formRef$current2.resetFields();
214
+ }
215
+ }, [open]);
216
+ // 选择 begin
217
+ var _useState13 = (0, _react.useState)([]),
218
+ _useState14 = _slicedToArray(_useState13, 2),
219
+ selectedRowKeys = _useState14[0],
220
+ setSelectedRowKeys = _useState14[1];
221
+ var _useState15 = (0, _react.useState)([]),
222
+ _useState16 = _slicedToArray(_useState15, 2),
223
+ selectedRows = _useState16[0],
224
+ setSelectedRows = _useState16[1];
225
+ var onSelectChange = function onSelectChange(newSelectedRowKeys, newSelectedRows) {
226
+ setSelectedRowKeys(newSelectedRowKeys);
227
+ setSelectedRows(newSelectedRows);
228
+ };
229
+ var rowSelection = {
230
+ selectedRowKeys: selectedRowKeys,
231
+ onChange: onSelectChange,
232
+ getCheckboxProps: function getCheckboxProps(row) {
233
+ return {
234
+ disabled: defaultSelectedGoodsIds.includes(row[rowKey])
235
+ };
236
+ }
237
+ };
238
+ (0, _react.useEffect)(function () {
239
+ setSelectedRowKeys(defaultSelectedGoodsIds);
240
+ }, [defaultSelectedGoodsIds]);
241
+ var defaultColumns = [{
242
+ title: '商品信息',
243
+ key: 'goodsInfo',
244
+ align: 'center',
245
+ width: 250,
246
+ fixed: 'left',
247
+ render: function render(_, record) {
248
+ return /*#__PURE__*/_react.default.createElement("div", {
249
+ className: 'table-goods-wrap'
250
+ }, /*#__PURE__*/_react.default.createElement("div", {
251
+ className: 'table-goods-img-wrap'
252
+ }, /*#__PURE__*/_react.default.createElement(_plusImage.default, {
253
+ preview: true,
254
+ src: record.mainImage,
255
+ className: "pro-image",
256
+ needOssProcess: false
257
+ })), /*#__PURE__*/_react.default.createElement("div", {
258
+ className: 'table-goods-content'
259
+ }, /*#__PURE__*/_react.default.createElement(_antd.Typography.Paragraph, {
260
+ ellipsis: {
261
+ rows: 2
262
+ },
263
+ className: "table-goods-content-title"
264
+ }, record.name), /*#__PURE__*/_react.default.createElement("div", {
265
+ title: record.goodsId,
266
+ className: 'table-goods-content-sub-title'
267
+ }, "\u5546\u54C1ID\uFF1A", record.goodsId)));
268
+ }
269
+ }, {
270
+ title: '商品品牌',
271
+ dataIndex: 'brandName',
272
+ key: 'brandName',
273
+ align: 'center',
274
+ width: 120
275
+ }, {
276
+ title: '商品分类',
277
+ key: 'flagCategoryInfo',
278
+ align: 'center',
279
+ width: 150,
280
+ render: function render(_, record) {
281
+ var _record$flagCategoryI;
282
+ return (record === null || record === void 0 ? void 0 : (_record$flagCategoryI = record.flagCategoryInfo) === null || _record$flagCategoryI === void 0 ? void 0 : _record$flagCategoryI.treeName) || '-';
283
+ }
284
+ }, {
285
+ title: '所属供应商',
286
+ dataIndex: 'subSupplierName',
287
+ key: 'subSupplierName',
288
+ align: 'center',
289
+ width: 150
290
+ }, {
291
+ title: '一件代发价格',
292
+ key: 'oncePrice',
293
+ align: 'center',
294
+ render: function render(_, record) {
295
+ var _record$onceInfo, _record$onceInfo2, _record$onceInfo3, _record$onceInfo4, _record$onceInfo5, _record$onceInfo6, _record$onceInfo7, _record$onceInfo8, _record$onceInfo9, _record$onceInfo10, _record$onceInfo11, _record$onceInfo12, _record$onceInfo13, _record$onceInfo14, _record$onceInfo15, _record$onceInfo16, _record$onceInfo17, _record$onceInfo18, _record$onceInfo19, _record$onceInfo20;
296
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, !_lodash.default.isNil(record === null || record === void 0 ? void 0 : (_record$onceInfo = record.onceInfo) === null || _record$onceInfo === void 0 ? void 0 : _record$onceInfo.purchasePriceMin) && /*#__PURE__*/_react.default.createElement("div", null, "\u91C7\u8D2D\u4EF7\uFF1A", (0, _common.showMoney)(record === null || record === void 0 ? void 0 : (_record$onceInfo2 = record.onceInfo) === null || _record$onceInfo2 === void 0 ? void 0 : _record$onceInfo2.purchasePriceMin), (record === null || record === void 0 ? void 0 : (_record$onceInfo3 = record.onceInfo) === null || _record$onceInfo3 === void 0 ? void 0 : _record$onceInfo3.purchasePriceMax) !== (record === null || record === void 0 ? void 0 : (_record$onceInfo4 = record.onceInfo) === null || _record$onceInfo4 === void 0 ? void 0 : _record$onceInfo4.purchasePriceMin) ? "~".concat((0, _common.showMoney)(record.onceInfo.purchasePriceMax)) : ''), !_lodash.default.isNil(record === null || record === void 0 ? void 0 : (_record$onceInfo5 = record.onceInfo) === null || _record$onceInfo5 === void 0 ? void 0 : _record$onceInfo5.marketPriceMin) && /*#__PURE__*/_react.default.createElement("div", null, "\u5E02\u573A\u4EF7\uFF1A", (0, _common.showMoney)(record === null || record === void 0 ? void 0 : (_record$onceInfo6 = record.onceInfo) === null || _record$onceInfo6 === void 0 ? void 0 : _record$onceInfo6.marketPriceMin), (record === null || record === void 0 ? void 0 : (_record$onceInfo7 = record.onceInfo) === null || _record$onceInfo7 === void 0 ? void 0 : _record$onceInfo7.marketPriceMax) !== (record === null || record === void 0 ? void 0 : (_record$onceInfo8 = record.onceInfo) === null || _record$onceInfo8 === void 0 ? void 0 : _record$onceInfo8.marketPriceMin) ? "~".concat((0, _common.showMoney)(record.onceInfo.marketPriceMax)) : ''), !_lodash.default.isNil(record === null || record === void 0 ? void 0 : (_record$onceInfo9 = record.onceInfo) === null || _record$onceInfo9 === void 0 ? void 0 : _record$onceInfo9.salePriceMin) && /*#__PURE__*/_react.default.createElement("div", null, "\u9500\u552E\u4EF7\uFF1A", (0, _common.showMoney)(record === null || record === void 0 ? void 0 : (_record$onceInfo10 = record.onceInfo) === null || _record$onceInfo10 === void 0 ? void 0 : _record$onceInfo10.salePriceMin), (record === null || record === void 0 ? void 0 : (_record$onceInfo11 = record.onceInfo) === null || _record$onceInfo11 === void 0 ? void 0 : _record$onceInfo11.salePriceMax) !== (record === null || record === void 0 ? void 0 : (_record$onceInfo12 = record.onceInfo) === null || _record$onceInfo12 === void 0 ? void 0 : _record$onceInfo12.salePriceMin) ? "~".concat((0, _common.showMoney)(record.onceInfo.salePriceMax)) : ''), !_lodash.default.isNil(record === null || record === void 0 ? void 0 : (_record$onceInfo13 = record.onceInfo) === null || _record$onceInfo13 === void 0 ? void 0 : _record$onceInfo13.sitePriceMin) && /*#__PURE__*/_react.default.createElement("div", null, "\u5206\u9500\u4EF7\uFF1A", (0, _common.showMoney)(record === null || record === void 0 ? void 0 : (_record$onceInfo14 = record.onceInfo) === null || _record$onceInfo14 === void 0 ? void 0 : _record$onceInfo14.sitePriceMin), (record === null || record === void 0 ? void 0 : (_record$onceInfo15 = record.onceInfo) === null || _record$onceInfo15 === void 0 ? void 0 : _record$onceInfo15.sitePriceMax) !== (record === null || record === void 0 ? void 0 : (_record$onceInfo16 = record.onceInfo) === null || _record$onceInfo16 === void 0 ? void 0 : _record$onceInfo16.sitePriceMin) ? "~".concat((0, _common.showMoney)(record.onceInfo.sitePriceMax)) : ''), [record === null || record === void 0 ? void 0 : (_record$onceInfo17 = record.onceInfo) === null || _record$onceInfo17 === void 0 ? void 0 : _record$onceInfo17.purchasePriceMin, record === null || record === void 0 ? void 0 : (_record$onceInfo18 = record.onceInfo) === null || _record$onceInfo18 === void 0 ? void 0 : _record$onceInfo18.marketPriceMin, record === null || record === void 0 ? void 0 : (_record$onceInfo19 = record.onceInfo) === null || _record$onceInfo19 === void 0 ? void 0 : _record$onceInfo19.salePriceMin, record === null || record === void 0 ? void 0 : (_record$onceInfo20 = record.onceInfo) === null || _record$onceInfo20 === void 0 ? void 0 : _record$onceInfo20.sitePriceMin].every(function (num) {
297
+ return num == null;
298
+ }) && '-');
299
+ }
300
+ }, {
301
+ title: '集采批发价格',
302
+ key: 'purchasePrice',
303
+ align: 'center',
304
+ render: function render(_, record) {
305
+ var _record$purchaseInfo, _record$purchaseInfo2, _record$purchaseInfo3, _record$purchaseInfo4, _record$purchaseInfo5, _record$purchaseInfo6, _record$purchaseInfo7, _record$purchaseInfo8, _record$purchaseInfo9, _record$purchaseInfo10, _record$purchaseInfo11, _record$purchaseInfo12, _record$purchaseInfo13, _record$purchaseInfo14, _record$purchaseInfo15, _record$purchaseInfo16, _record$purchaseInfo17, _record$purchaseInfo18, _record$purchaseInfo19, _record$purchaseInfo20;
306
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, !_lodash.default.isNil(record === null || record === void 0 ? void 0 : (_record$purchaseInfo = record.purchaseInfo) === null || _record$purchaseInfo === void 0 ? void 0 : _record$purchaseInfo.purchasePriceMin) && /*#__PURE__*/_react.default.createElement("div", null, "\u91C7\u8D2D\u4EF7\uFF1A", (0, _common.showMoney)(record === null || record === void 0 ? void 0 : (_record$purchaseInfo2 = record.purchaseInfo) === null || _record$purchaseInfo2 === void 0 ? void 0 : _record$purchaseInfo2.purchasePriceMin), (record === null || record === void 0 ? void 0 : (_record$purchaseInfo3 = record.purchaseInfo) === null || _record$purchaseInfo3 === void 0 ? void 0 : _record$purchaseInfo3.purchasePriceMax) !== (record === null || record === void 0 ? void 0 : (_record$purchaseInfo4 = record.purchaseInfo) === null || _record$purchaseInfo4 === void 0 ? void 0 : _record$purchaseInfo4.purchasePriceMin) ? "~".concat((0, _common.showMoney)(record.purchaseInfo.purchasePriceMax)) : ''), !_lodash.default.isNil(record === null || record === void 0 ? void 0 : (_record$purchaseInfo5 = record.purchaseInfo) === null || _record$purchaseInfo5 === void 0 ? void 0 : _record$purchaseInfo5.marketPriceMin) && /*#__PURE__*/_react.default.createElement("div", null, "\u5E02\u573A\u4EF7\uFF1A", (0, _common.showMoney)(record === null || record === void 0 ? void 0 : (_record$purchaseInfo6 = record.purchaseInfo) === null || _record$purchaseInfo6 === void 0 ? void 0 : _record$purchaseInfo6.marketPriceMin), (record === null || record === void 0 ? void 0 : (_record$purchaseInfo7 = record.purchaseInfo) === null || _record$purchaseInfo7 === void 0 ? void 0 : _record$purchaseInfo7.marketPriceMax) !== (record === null || record === void 0 ? void 0 : (_record$purchaseInfo8 = record.purchaseInfo) === null || _record$purchaseInfo8 === void 0 ? void 0 : _record$purchaseInfo8.marketPriceMin) ? "~".concat((0, _common.showMoney)(record.purchaseInfo.marketPriceMax)) : ''), !_lodash.default.isNil(record === null || record === void 0 ? void 0 : (_record$purchaseInfo9 = record.purchaseInfo) === null || _record$purchaseInfo9 === void 0 ? void 0 : _record$purchaseInfo9.salePriceMin) && /*#__PURE__*/_react.default.createElement("div", null, "\u9500\u552E\u4EF7\uFF1A", (0, _common.showMoney)(record === null || record === void 0 ? void 0 : (_record$purchaseInfo10 = record.purchaseInfo) === null || _record$purchaseInfo10 === void 0 ? void 0 : _record$purchaseInfo10.salePriceMin), (record === null || record === void 0 ? void 0 : (_record$purchaseInfo11 = record.purchaseInfo) === null || _record$purchaseInfo11 === void 0 ? void 0 : _record$purchaseInfo11.salePriceMax) !== (record === null || record === void 0 ? void 0 : (_record$purchaseInfo12 = record.purchaseInfo) === null || _record$purchaseInfo12 === void 0 ? void 0 : _record$purchaseInfo12.salePriceMin) ? "~".concat((0, _common.showMoney)(record.purchaseInfo.salePriceMax)) : ''), !_lodash.default.isNil(record === null || record === void 0 ? void 0 : (_record$purchaseInfo13 = record.purchaseInfo) === null || _record$purchaseInfo13 === void 0 ? void 0 : _record$purchaseInfo13.sitePriceMin) && /*#__PURE__*/_react.default.createElement("div", null, "\u5206\u9500\u4EF7\uFF1A", (0, _common.showMoney)(record === null || record === void 0 ? void 0 : (_record$purchaseInfo14 = record.purchaseInfo) === null || _record$purchaseInfo14 === void 0 ? void 0 : _record$purchaseInfo14.sitePriceMin), (record === null || record === void 0 ? void 0 : (_record$purchaseInfo15 = record.purchaseInfo) === null || _record$purchaseInfo15 === void 0 ? void 0 : _record$purchaseInfo15.sitePriceMax) !== (record === null || record === void 0 ? void 0 : (_record$purchaseInfo16 = record.purchaseInfo) === null || _record$purchaseInfo16 === void 0 ? void 0 : _record$purchaseInfo16.sitePriceMin) ? "~".concat((0, _common.showMoney)(record.purchaseInfo.sitePriceMax / 100)) : ''), [record === null || record === void 0 ? void 0 : (_record$purchaseInfo17 = record.purchaseInfo) === null || _record$purchaseInfo17 === void 0 ? void 0 : _record$purchaseInfo17.purchasePriceMin, record === null || record === void 0 ? void 0 : (_record$purchaseInfo18 = record.purchaseInfo) === null || _record$purchaseInfo18 === void 0 ? void 0 : _record$purchaseInfo18.marketPriceMin, record === null || record === void 0 ? void 0 : (_record$purchaseInfo19 = record.purchaseInfo) === null || _record$purchaseInfo19 === void 0 ? void 0 : _record$purchaseInfo19.salePriceMin, record === null || record === void 0 ? void 0 : (_record$purchaseInfo20 = record.purchaseInfo) === null || _record$purchaseInfo20 === void 0 ? void 0 : _record$purchaseInfo20.sitePriceMin].every(function (num) {
307
+ return num == null;
308
+ }) && '-');
309
+ }
310
+ }, {
311
+ title: '库存',
312
+ dataIndex: 'stock',
313
+ key: 'stock',
314
+ align: 'center',
315
+ width: 100
316
+ }, {
317
+ title: '操作',
318
+ dataIndex: 'action',
319
+ key: 'action',
320
+ align: 'center',
321
+ fixed: 'right',
322
+ width: 80,
323
+ hideInTable: !multiple,
324
+ render: function render(text, record) {
325
+ if (defaultSelectedGoodsIds.includes(record[rowKey])) {
326
+ return /*#__PURE__*/_react.default.createElement(_antd.Button, {
327
+ disabled: true,
328
+ type: "link",
329
+ size: "small"
330
+ }, "\u5DF2\u6311\u9009");
331
+ }
332
+ return /*#__PURE__*/_react.default.createElement(_antd.Button, {
333
+ onClick: function onClick() {
334
+ return onOk([record[rowKey]], [record]);
335
+ },
336
+ type: "link",
337
+ size: "small"
338
+ }, "\u6311\u9009");
339
+ }
340
+ }];
341
+ return /*#__PURE__*/_react.default.createElement(_plusConfigProvider.default, null, /*#__PURE__*/_react.default.createElement(_antd.Modal, {
342
+ title: "\u6311\u9009\u5546\u54C1",
343
+ open: open,
344
+ footer: null,
345
+ width: 1366,
346
+ onCancel: onCancel,
347
+ className: "choose-goods-modal",
348
+ centered: true
349
+ }, /*#__PURE__*/_react.default.createElement(_proComponents.QueryFilter, {
350
+ className: "fle-choose-mall-filter",
351
+ formRef: formRef,
352
+ colProps: {
353
+ span: 8
354
+ },
355
+ defaultCollapsed: false,
356
+ loading: getGoodsListLoading,
357
+ initialValues: {
358
+ orderName: _options.sortOptions[0].value,
359
+ orderWay: 'desc'
360
+ },
361
+ onFinish: function onFinish(values) {
362
+ var params = _objectSpread(_objectSpread({}, DefaultParams), values);
363
+ setSearchParams(params);
364
+ getGoodsList(params);
365
+ },
366
+ onReset: function onReset(values) {
367
+ var params = _objectSpread(_objectSpread({}, DefaultParams), values);
368
+ setSearchParams(params);
369
+ getGoodsList(params);
370
+ }
371
+ }, /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
372
+ name: "keyword"
373
+ }, /*#__PURE__*/_react.default.createElement(_antd.Input, {
374
+ className: "prod-search",
375
+ placeholder: "\u8BF7\u8F93\u5165\u5546\u54C1\u540D\u79F0/ID/\u54C1\u724C",
376
+ maxLength: 20
377
+ })), /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
378
+ name: "flagCategory"
379
+ }, /*#__PURE__*/_react.default.createElement(_antd.Cascader, {
380
+ allowClear: true,
381
+ changeOnSelect: true,
382
+ placeholder: "\u9009\u62E9\u5546\u54C1\u5206\u7C7B",
383
+ fieldNames: {
384
+ label: 'name',
385
+ value: 'id'
386
+ },
387
+ options: flagCategoryOptions,
388
+ expandTrigger: "hover"
389
+ })), /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
390
+ label: /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
391
+ noStyle: true,
392
+ name: "priceType",
393
+ initialValue: "purchaseMarketPrice"
394
+ }, /*#__PURE__*/_react.default.createElement(_antd.Select, {
395
+ dropdownStyle: {
396
+ width: 120
397
+ },
398
+ className: "price-type",
399
+ placeholder: "\u4EF7\u683C\u7C7B\u578B",
400
+ options: _options.priceRangeForPurchase,
401
+ variant: "borderless"
402
+ }))
403
+ }, /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
404
+ name: "rangePrice",
405
+ noStyle: true
406
+ }, /*#__PURE__*/_react.default.createElement(_plusRangeInput.default, {
407
+ placeholder: ['最低', '最高'],
408
+ precision: 2
409
+ }))), /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
410
+ name: "flagScene"
411
+ }, /*#__PURE__*/_react.default.createElement(_antd.Select, {
412
+ options: flagSceneOptions,
413
+ fieldNames: {
414
+ label: 'flag',
415
+ value: 'id'
416
+ },
417
+ placeholder: "\u9009\u62E9\u573A\u666F\u6807\u7B7E",
418
+ allowClear: true
419
+ })), /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
420
+ name: "flagTags"
421
+ }, /*#__PURE__*/_react.default.createElement(_antd.Select, {
422
+ options: flagTagsOptions,
423
+ fieldNames: {
424
+ label: 'flag',
425
+ value: 'id'
426
+ },
427
+ placeholder: "\u9009\u62E9\u5546\u54C1\u6807\u7B7E",
428
+ allowClear: true
429
+ })), /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
430
+ name: "flagIndustry"
431
+ }, /*#__PURE__*/_react.default.createElement(_antd.Select, {
432
+ options: flagIndustryOptions,
433
+ fieldNames: {
434
+ label: 'flag',
435
+ value: 'id'
436
+ },
437
+ placeholder: "\u9009\u62E9\u884C\u4E1A\u6807\u7B7E",
438
+ allowClear: true
439
+ })), /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
440
+ name: "orderName"
441
+ }, /*#__PURE__*/_react.default.createElement(_antd.Radio.Group, {
442
+ optionType: "button",
443
+ buttonStyle: "solid",
444
+ onChange: function onChange() {
445
+ var _formRef$current3;
446
+ return (_formRef$current3 = formRef.current) === null || _formRef$current3 === void 0 ? void 0 : _formRef$current3.submit();
447
+ }
448
+ }, _options.sortOptions.map(function (item) {
449
+ return /*#__PURE__*/_react.default.createElement(_antd.Radio.Button, {
450
+ key: item.value,
451
+ value: item.value
452
+ }, /*#__PURE__*/_react.default.createElement("div", {
453
+ className: "sort-item"
454
+ }, /*#__PURE__*/_react.default.createElement("div", {
455
+ className: "sort-item-label"
456
+ }, item.label), /*#__PURE__*/_react.default.createElement(_icon.default, {
457
+ type: "icon-paixu",
458
+ className: "sort-item-icon"
459
+ })));
460
+ }))), /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
461
+ name: "orderWay",
462
+ hidden: true
463
+ }, /*#__PURE__*/_react.default.createElement(_antd.Input, null))), /*#__PURE__*/_react.default.createElement(_proComponents.ProTable, {
464
+ bordered: true,
465
+ size: "small",
466
+ search: false,
467
+ options: false,
468
+ onRow: function onRow(record) {
469
+ return {
470
+ onClick: function onClick(event) {
471
+ event.preventDefault();
472
+ if (defaultSelectedGoodsIds.includes(record[rowKey])) {
473
+ return;
474
+ }
475
+ var newSelectedRowKeys = selectedRowKeys.includes(record[rowKey]);
476
+ if (multiple && !newSelectedRowKeys) {
477
+ setSelectedRows([].concat(_toConsumableArray(selectedRows), [record]));
478
+ setSelectedRowKeys([].concat(_toConsumableArray(selectedRowKeys), [record[rowKey]]));
479
+ }
480
+ }
481
+ };
482
+ },
483
+ dataSource: goodsData === null || goodsData === void 0 ? void 0 : goodsData.list,
484
+ columns: columns.length ? columns : defaultColumns,
485
+ pagination: {
486
+ pageSize: pageSize,
487
+ current: searchParams.pageNo,
488
+ position: ['bottomCenter'],
489
+ total: goodsData === null || goodsData === void 0 ? void 0 : goodsData.total,
490
+ showQuickJumper: false,
491
+ showSizeChanger: true,
492
+ size: 'default',
493
+ onChange: function onChange(page, pageSize) {
494
+ setSearchParams(function (params) {
495
+ var newParams = _objectSpread(_objectSpread({}, params), {}, {
496
+ pageSize: pageSize,
497
+ pageNo: page
498
+ });
499
+ getGoodsList(newParams);
500
+ setPageSize(pageSize);
501
+ return newParams;
502
+ });
503
+ },
504
+ showTotal: function showTotal(total) {
505
+ return "\u5171 ".concat(total, " \u6761\u6570\u636E");
506
+ }
507
+ },
508
+ rowKey: rowKey,
509
+ tableAlertRender: false,
510
+ loading: getGoodsListLoading,
511
+ scroll: scroll,
512
+ rowSelection: multiple ? rowSelection : undefined
513
+ }), multiple && /*#__PURE__*/_react.default.createElement(_antd.Button, {
514
+ type: "primary",
515
+ style: {
516
+ position: 'absolute',
517
+ bottom: 16,
518
+ right: 24
519
+ },
520
+ onClick: function onClick() {
521
+ return onOk(selectedRowKeys, selectedRows);
522
+ },
523
+ disabled: selectedRowKeys.length === 0
524
+ }, "\u6279\u91CF\u6311\u9009(", selectedRowKeys.length, ")")));
525
+ };
526
+ var _default = exports.default = ChooseSiteGoods;
package/lib/index.less ADDED
@@ -0,0 +1,76 @@
1
+ @primar-color: #2c68ff;
2
+
3
+ .choose-goods-modal {
4
+ .fle-modal-body {
5
+ padding: 0 !important;
6
+ }
7
+ .fle-radio-button-wrapper {
8
+ padding-inline: 12px;
9
+ }
10
+ .fle-pro-query-filter-actions {
11
+ .fle-space-item:first-child > div {
12
+ flex-direction: row-reverse;
13
+ }
14
+ }
15
+ .table-goods-wrap {
16
+ display: flex;
17
+
18
+ .table-goods-img-wrap {
19
+ width: 60px;
20
+ height: 60px;
21
+ background: #f2f2f2;
22
+ border-radius: 1px;
23
+ box-sizing: border-box;
24
+ display: flex;
25
+ align-items: center;
26
+ overflow: hidden;
27
+ .pro-image {
28
+ width: 100%;
29
+ height: 100%;
30
+ object-fit: cover;
31
+ .fle-image {
32
+ width: 100%;
33
+ height: 100%;
34
+ }
35
+ }
36
+ }
37
+
38
+ .table-goods-content {
39
+ margin-left: 10px;
40
+ flex: 1;
41
+
42
+ .table-goods-content-title {
43
+ height: 34px;
44
+ font-size: 12px;
45
+ font-weight: 500;
46
+ color: #666666;
47
+ line-height: 17px;
48
+ text-align: left;
49
+ }
50
+
51
+ .table-goods-content-sub-title {
52
+ text-align: left;
53
+ height: 17px;
54
+ font-size: 12px;
55
+ font-weight: 400;
56
+ color: #666666;
57
+ overflow: hidden;
58
+ text-overflow: ellipsis;
59
+ white-space: nowrap;
60
+ margin-top: 9px;
61
+ }
62
+ }
63
+ }
64
+
65
+ .sort-item {
66
+ display: flex;
67
+ align-items: center;
68
+ .sort-item-label {
69
+ font-size: 12px;
70
+ }
71
+ .sort-item-icon {
72
+ font-size: 10px;
73
+ margin-left: 4px;
74
+ }
75
+ }
76
+ }
@@ -0,0 +1,6 @@
1
+ declare const _default: {
2
+ getGoodsList: string;
3
+ getSelfGoodsFlag: string;
4
+ getSelfGoodsFlagCategory: string;
5
+ };
6
+ export default _default;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _default = exports.default = {
8
+ getGoodsList: '/psc/goods/search/getMemberGoodsList',
9
+ getSelfGoodsFlag: '/fleshopy/goods/flag/allList',
10
+ getSelfGoodsFlagCategory: '/elebuys/goodsCategory/tree' // 获取自有商品分类
11
+ };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * 金额格式化
3
+ * @param data
4
+ */
5
+ type moneyType = number | string;
6
+ interface ShowMoneyType {
7
+ (data: moneyType): string;
8
+ }
9
+ export declare const showMoney: ShowMoneyType;
10
+ export declare const formartNum: (data: moneyType, len?: number) => number | '';
11
+ export {};