@kmkf-fe-packages/basic-components 0.8.9-alpha.1 → 0.8.9-alpha.5

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/dist/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import React, { useRef, useState, useEffect, useMemo, forwardRef, useImperativeHandle, useCallback } from 'react';
1
+ import React, { useRef, useState, useEffect, useMemo, forwardRef, useImperativeHandle } from 'react';
2
2
  import { Cascader, DatePicker, InputNumber, Input, Select, Upload, Image, message, Radio, Space, Spin, Checkbox, Row, Col, Slider, Rate, Button, Form, Tabs, Modal, ConfigProvider, Pagination, Popover, Table } from 'antd';
3
3
  import { EyeOutlined, DeleteOutlined, InboxOutlined } from '@ant-design/icons';
4
4
  import request, { extend as extend$1 } from 'umi-request';
@@ -9701,13 +9701,9 @@ var ItemList = function ItemList(props) {
9701
9701
 
9702
9702
  var columns = [{
9703
9703
  dataIndex: 'index',
9704
- title: '序号',
9704
+ title: 'No',
9705
9705
  render: function render(val, record, index) {
9706
- return /*#__PURE__*/React.createElement("div", {
9707
- style: {
9708
- width: '30px'
9709
- }
9710
- }, index + 1);
9706
+ return /*#__PURE__*/React.createElement("span", null, index + 1);
9711
9707
  }
9712
9708
  }, {
9713
9709
  dataIndex: 'skuName',
@@ -9757,12 +9753,12 @@ var columns = [{
9757
9753
  var GoodsModal$1 = function GoodsModal(props, ref) {
9758
9754
  useImperativeHandle(ref, function () {
9759
9755
  return {
9760
- open: function open() {
9756
+ open: function open(shopCode) {
9761
9757
  setVisible(true);
9762
9758
  setPageNo(1);
9763
9759
  setSelect([]);
9764
9760
  setSelectIds([]);
9765
- queryItems();
9761
+ queryItems(shopCode);
9766
9762
  getShopList();
9767
9763
  }
9768
9764
  };
@@ -9771,7 +9767,7 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
9771
9767
  shopId = props.shopId,
9772
9768
  shopList = props.shopList,
9773
9769
  width = props.width,
9774
- shopCode = props.shopCode;
9770
+ companyKey = props.companyKey;
9775
9771
  var _useState = useState(false),
9776
9772
  _useState2 = _slicedToArray(_useState, 2),
9777
9773
  visible = _useState2[0],
@@ -9826,44 +9822,49 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
9826
9822
  /**
9827
9823
  * 查询商品
9828
9824
  */
9829
- var queryItems = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
9830
- var params, res, products, newProducts;
9831
- return _regeneratorRuntime().wrap(function _callee$(_context) {
9832
- while (1) switch (_context.prev = _context.next) {
9833
- case 0:
9834
- form.setFieldsValue({
9835
- shopId: shopCode
9836
- });
9837
- _context.prev = 1;
9838
- setLoading(true);
9839
- params = {
9840
- shopCode: shopCode
9841
- };
9842
- _context.next = 6;
9843
- return extendRequest('/qy/gdfw/product/bsListProduct', {
9844
- method: 'post',
9845
- data: params
9846
- });
9847
- case 6:
9848
- res = _context.sent;
9849
- products = res.data.products;
9850
- newProducts = (products || []).map(function (item, index) {
9851
- return _objectSpread2(_objectSpread2({}, item), {}, {
9852
- index: index + 1
9825
+ var queryItems = /*#__PURE__*/function () {
9826
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(shopCode) {
9827
+ var params, res, products, newProducts;
9828
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
9829
+ while (1) switch (_context.prev = _context.next) {
9830
+ case 0:
9831
+ form.setFieldsValue({
9832
+ shopId: shopCode
9853
9833
  });
9854
- });
9855
- setAllList(_toConsumableArray(newProducts));
9856
- initData(_toConsumableArray(newProducts));
9857
- case 11:
9858
- _context.prev = 11;
9859
- setLoading(false);
9860
- return _context.finish(11);
9861
- case 14:
9862
- case "end":
9863
- return _context.stop();
9864
- }
9865
- }, _callee, null, [[1,, 11, 14]]);
9866
- })), [shopCode]);
9834
+ _context.prev = 1;
9835
+ setLoading(true);
9836
+ params = {
9837
+ shopCode: shopCode
9838
+ };
9839
+ _context.next = 6;
9840
+ return extendRequest('/qy/gdfw/product/bsListProduct', {
9841
+ method: 'post',
9842
+ data: params
9843
+ });
9844
+ case 6:
9845
+ res = _context.sent;
9846
+ products = res.data.products;
9847
+ newProducts = (products || []).map(function (item, index) {
9848
+ return _objectSpread2(_objectSpread2({}, item), {}, {
9849
+ index: index + 1
9850
+ });
9851
+ });
9852
+ setAllList(_toConsumableArray(newProducts));
9853
+ initData(_toConsumableArray(newProducts));
9854
+ case 11:
9855
+ _context.prev = 11;
9856
+ setLoading(false);
9857
+ return _context.finish(11);
9858
+ case 14:
9859
+ case "end":
9860
+ return _context.stop();
9861
+ }
9862
+ }, _callee, null, [[1,, 11, 14]]);
9863
+ }));
9864
+ return function queryItems(_x) {
9865
+ return _ref.apply(this, arguments);
9866
+ };
9867
+ }();
9867
9868
  var rowSelection = {
9868
9869
  selectedRowKeys: selectIds,
9869
9870
  fixed: true,
@@ -9911,31 +9912,32 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
9911
9912
  };
9912
9913
  var getShopList = /*#__PURE__*/function () {
9913
9914
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
9914
- var _yield$request, success, data, _ref3, list;
9915
+ var _yield$request, success, data, obj, list;
9915
9916
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
9916
9917
  while (1) switch (_context2.prev = _context2.next) {
9917
9918
  case 0:
9918
9919
  _context2.next = 2;
9919
- return extendRequest('/qy/gdfw/product/bsListProduct', {
9920
- method: 'post',
9921
- data: {
9922
- shopCode: 'DP007'
9920
+ return extendRequest('/qy/diamond/getConfigInfo', {
9921
+ method: 'get',
9922
+ params: {
9923
+ key: 'company-third-shop-info'
9923
9924
  }
9924
9925
  });
9925
9926
  case 2:
9926
9927
  _yield$request = _context2.sent;
9927
9928
  success = _yield$request.success;
9928
9929
  data = _yield$request.data;
9930
+ obj = JSON.parse(data || '{}');
9929
9931
  if (success) {
9930
- list = (_ref3 = data.products || []) === null || _ref3 === void 0 ? void 0 : _ref3.map(function (item, index) {
9932
+ list = ((obj === null || obj === void 0 ? void 0 : obj[companyKey]) || []).map(function (item) {
9931
9933
  return {
9932
- label: "\u5E97\u94FA\u540D\u79F0".concat(index),
9933
- value: index
9934
+ label: item.shopName,
9935
+ value: item.shopCode
9934
9936
  };
9935
9937
  });
9936
9938
  setShopList(list);
9937
9939
  }
9938
- case 6:
9940
+ case 7:
9939
9941
  case "end":
9940
9942
  return _context2.stop();
9941
9943
  }
@@ -9947,6 +9949,7 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
9947
9949
  }();
9948
9950
  var onValuesChange = function onValuesChange(changedValues) {
9949
9951
  if (changedValues === null || changedValues === void 0 ? void 0 : changedValues['shopId']) {
9952
+ queryItems(changedValues === null || changedValues === void 0 ? void 0 : changedValues.shopId);
9950
9953
  pubsub.publish('changeShopCode', {
9951
9954
  shopCode: changedValues.shopId
9952
9955
  });
@@ -10072,6 +10075,8 @@ var GoodItem = function GoodItem(props) {
10072
10075
  _props$canUpdateNumbe = props.canUpdateNumber,
10073
10076
  canUpdateNumber = _props$canUpdateNumbe === void 0 ? false : _props$canUpdateNumbe,
10074
10077
  shopCode = props.shopCode,
10078
+ _props$companyKey = props.companyKey,
10079
+ companyKey = _props$companyKey === void 0 ? '' : _props$companyKey,
10075
10080
  onSelect = props.onSelect,
10076
10081
  onDelete = props.onDelete;
10077
10082
  var refModal = useRef();
@@ -10253,7 +10258,7 @@ var GoodItem = function GoodItem(props) {
10253
10258
  }));
10254
10259
  };
10255
10260
  var handleChangeGoods = function handleChangeGoods() {
10256
- refModal.current.open();
10261
+ refModal.current.open(shopCode);
10257
10262
  };
10258
10263
  var rowSelection = {
10259
10264
  selectedRowKeys: selectedRowKeys,
@@ -10293,7 +10298,7 @@ var GoodItem = function GoodItem(props) {
10293
10298
  shopList: shopList,
10294
10299
  shopId: shopId,
10295
10300
  maxLength: maxLength,
10296
- shopCode: shopCode
10301
+ companyKey: companyKey
10297
10302
  }));
10298
10303
  };
10299
10304
 
@@ -10347,6 +10352,7 @@ var BsGoods = function BsGoods(props) {
10347
10352
  }
10348
10353
  });
10349
10354
  pubsub.subscribeOnce('changeShopCode', function (type, data) {
10355
+ console.log(data);
10350
10356
  onChange(_objectSpread2(_objectSpread2({}, valueRef === null || valueRef === void 0 ? void 0 : valueRef.current), {}, {
10351
10357
  shopCode: data.shopCode
10352
10358
  }));
package/dist/index.js CHANGED
@@ -9712,13 +9712,9 @@ var ItemList = function ItemList(props) {
9712
9712
 
9713
9713
  var columns = [{
9714
9714
  dataIndex: 'index',
9715
- title: '序号',
9715
+ title: 'No',
9716
9716
  render: function render(val, record, index) {
9717
- return /*#__PURE__*/React__default['default'].createElement("div", {
9718
- style: {
9719
- width: '30px'
9720
- }
9721
- }, index + 1);
9717
+ return /*#__PURE__*/React__default['default'].createElement("span", null, index + 1);
9722
9718
  }
9723
9719
  }, {
9724
9720
  dataIndex: 'skuName',
@@ -9768,12 +9764,12 @@ var columns = [{
9768
9764
  var GoodsModal$1 = function GoodsModal(props, ref) {
9769
9765
  React.useImperativeHandle(ref, function () {
9770
9766
  return {
9771
- open: function open() {
9767
+ open: function open(shopCode) {
9772
9768
  setVisible(true);
9773
9769
  setPageNo(1);
9774
9770
  setSelect([]);
9775
9771
  setSelectIds([]);
9776
- queryItems();
9772
+ queryItems(shopCode);
9777
9773
  getShopList();
9778
9774
  }
9779
9775
  };
@@ -9782,7 +9778,7 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
9782
9778
  shopId = props.shopId,
9783
9779
  shopList = props.shopList,
9784
9780
  width = props.width,
9785
- shopCode = props.shopCode;
9781
+ companyKey = props.companyKey;
9786
9782
  var _useState = React.useState(false),
9787
9783
  _useState2 = _slicedToArray(_useState, 2),
9788
9784
  visible = _useState2[0],
@@ -9837,44 +9833,49 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
9837
9833
  /**
9838
9834
  * 查询商品
9839
9835
  */
9840
- var queryItems = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
9841
- var params, res, products, newProducts;
9842
- return _regeneratorRuntime().wrap(function _callee$(_context) {
9843
- while (1) switch (_context.prev = _context.next) {
9844
- case 0:
9845
- form.setFieldsValue({
9846
- shopId: shopCode
9847
- });
9848
- _context.prev = 1;
9849
- setLoading(true);
9850
- params = {
9851
- shopCode: shopCode
9852
- };
9853
- _context.next = 6;
9854
- return extendRequest('/qy/gdfw/product/bsListProduct', {
9855
- method: 'post',
9856
- data: params
9857
- });
9858
- case 6:
9859
- res = _context.sent;
9860
- products = res.data.products;
9861
- newProducts = (products || []).map(function (item, index) {
9862
- return _objectSpread2(_objectSpread2({}, item), {}, {
9863
- index: index + 1
9836
+ var queryItems = /*#__PURE__*/function () {
9837
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(shopCode) {
9838
+ var params, res, products, newProducts;
9839
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
9840
+ while (1) switch (_context.prev = _context.next) {
9841
+ case 0:
9842
+ form.setFieldsValue({
9843
+ shopId: shopCode
9864
9844
  });
9865
- });
9866
- setAllList(_toConsumableArray(newProducts));
9867
- initData(_toConsumableArray(newProducts));
9868
- case 11:
9869
- _context.prev = 11;
9870
- setLoading(false);
9871
- return _context.finish(11);
9872
- case 14:
9873
- case "end":
9874
- return _context.stop();
9875
- }
9876
- }, _callee, null, [[1,, 11, 14]]);
9877
- })), [shopCode]);
9845
+ _context.prev = 1;
9846
+ setLoading(true);
9847
+ params = {
9848
+ shopCode: shopCode
9849
+ };
9850
+ _context.next = 6;
9851
+ return extendRequest('/qy/gdfw/product/bsListProduct', {
9852
+ method: 'post',
9853
+ data: params
9854
+ });
9855
+ case 6:
9856
+ res = _context.sent;
9857
+ products = res.data.products;
9858
+ newProducts = (products || []).map(function (item, index) {
9859
+ return _objectSpread2(_objectSpread2({}, item), {}, {
9860
+ index: index + 1
9861
+ });
9862
+ });
9863
+ setAllList(_toConsumableArray(newProducts));
9864
+ initData(_toConsumableArray(newProducts));
9865
+ case 11:
9866
+ _context.prev = 11;
9867
+ setLoading(false);
9868
+ return _context.finish(11);
9869
+ case 14:
9870
+ case "end":
9871
+ return _context.stop();
9872
+ }
9873
+ }, _callee, null, [[1,, 11, 14]]);
9874
+ }));
9875
+ return function queryItems(_x) {
9876
+ return _ref.apply(this, arguments);
9877
+ };
9878
+ }();
9878
9879
  var rowSelection = {
9879
9880
  selectedRowKeys: selectIds,
9880
9881
  fixed: true,
@@ -9922,31 +9923,32 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
9922
9923
  };
9923
9924
  var getShopList = /*#__PURE__*/function () {
9924
9925
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
9925
- var _yield$request, success, data, _ref3, list;
9926
+ var _yield$request, success, data, obj, list;
9926
9927
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
9927
9928
  while (1) switch (_context2.prev = _context2.next) {
9928
9929
  case 0:
9929
9930
  _context2.next = 2;
9930
- return extendRequest('/qy/gdfw/product/bsListProduct', {
9931
- method: 'post',
9932
- data: {
9933
- shopCode: 'DP007'
9931
+ return extendRequest('/qy/diamond/getConfigInfo', {
9932
+ method: 'get',
9933
+ params: {
9934
+ key: 'company-third-shop-info'
9934
9935
  }
9935
9936
  });
9936
9937
  case 2:
9937
9938
  _yield$request = _context2.sent;
9938
9939
  success = _yield$request.success;
9939
9940
  data = _yield$request.data;
9941
+ obj = JSON.parse(data || '{}');
9940
9942
  if (success) {
9941
- list = (_ref3 = data.products || []) === null || _ref3 === void 0 ? void 0 : _ref3.map(function (item, index) {
9943
+ list = ((obj === null || obj === void 0 ? void 0 : obj[companyKey]) || []).map(function (item) {
9942
9944
  return {
9943
- label: "\u5E97\u94FA\u540D\u79F0".concat(index),
9944
- value: index
9945
+ label: item.shopName,
9946
+ value: item.shopCode
9945
9947
  };
9946
9948
  });
9947
9949
  setShopList(list);
9948
9950
  }
9949
- case 6:
9951
+ case 7:
9950
9952
  case "end":
9951
9953
  return _context2.stop();
9952
9954
  }
@@ -9958,6 +9960,7 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
9958
9960
  }();
9959
9961
  var onValuesChange = function onValuesChange(changedValues) {
9960
9962
  if (changedValues === null || changedValues === void 0 ? void 0 : changedValues['shopId']) {
9963
+ queryItems(changedValues === null || changedValues === void 0 ? void 0 : changedValues.shopId);
9961
9964
  pubsub__default['default'].publish('changeShopCode', {
9962
9965
  shopCode: changedValues.shopId
9963
9966
  });
@@ -10083,6 +10086,8 @@ var GoodItem = function GoodItem(props) {
10083
10086
  _props$canUpdateNumbe = props.canUpdateNumber,
10084
10087
  canUpdateNumber = _props$canUpdateNumbe === void 0 ? false : _props$canUpdateNumbe,
10085
10088
  shopCode = props.shopCode,
10089
+ _props$companyKey = props.companyKey,
10090
+ companyKey = _props$companyKey === void 0 ? '' : _props$companyKey,
10086
10091
  onSelect = props.onSelect,
10087
10092
  onDelete = props.onDelete;
10088
10093
  var refModal = React.useRef();
@@ -10264,7 +10269,7 @@ var GoodItem = function GoodItem(props) {
10264
10269
  }));
10265
10270
  };
10266
10271
  var handleChangeGoods = function handleChangeGoods() {
10267
- refModal.current.open();
10272
+ refModal.current.open(shopCode);
10268
10273
  };
10269
10274
  var rowSelection = {
10270
10275
  selectedRowKeys: selectedRowKeys,
@@ -10304,7 +10309,7 @@ var GoodItem = function GoodItem(props) {
10304
10309
  shopList: shopList,
10305
10310
  shopId: shopId,
10306
10311
  maxLength: maxLength,
10307
- shopCode: shopCode
10312
+ companyKey: companyKey
10308
10313
  }));
10309
10314
  };
10310
10315
 
@@ -10358,6 +10363,7 @@ var BsGoods = function BsGoods(props) {
10358
10363
  }
10359
10364
  });
10360
10365
  pubsub__default['default'].subscribeOnce('changeShopCode', function (type, data) {
10366
+ console.log(data);
10361
10367
  onChange(_objectSpread2(_objectSpread2({}, valueRef === null || valueRef === void 0 ? void 0 : valueRef.current), {}, {
10362
10368
  shopCode: data.shopCode
10363
10369
  }));
@@ -15,6 +15,7 @@ interface BsGoodsProps {
15
15
  otherOperations: any;
16
16
  canUpdateNumber: boolean;
17
17
  shopCode: string;
18
+ companyKey: string;
18
19
  onChange: (val: any[]) => void;
19
20
  onSelect: (val: any[]) => void;
20
21
  onDelete: (val: any[]) => void;
@@ -5,6 +5,7 @@ interface GoodModelProps {
5
5
  shopList: any[];
6
6
  width?: string | number;
7
7
  shopCode?: string;
8
+ companyKey: string;
8
9
  onSubmit: (...args: any[]) => any;
9
10
  }
10
11
  declare const _default: React.ForwardRefExoticComponent<GoodModelProps & React.RefAttributes<unknown>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/basic-components",
3
- "version": "0.8.9-alpha.1",
3
+ "version": "0.8.9-alpha.5",
4
4
  "description": "> TODO: description",
5
5
  "homepage": "",
6
6
  "license": "ISC",
@@ -20,7 +20,7 @@
20
20
  "watch": "nodemon --ignore dist/ --ignore node_modules/ --watch src/ -C -e ts,tsx,less --debug -x 'yarn async'"
21
21
  },
22
22
  "dependencies": {
23
- "@kmkf-fe-packages/kmkf-utils": "^0.8.7-alpha.0",
23
+ "@kmkf-fe-packages/kmkf-utils": "^0.8.9-alpha.5",
24
24
  "lodash": "^4.17.21",
25
25
  "pubsub-js": "^1.9.4",
26
26
  "umi-request": "^1.4.0"
@@ -58,5 +58,5 @@
58
58
  "publishConfig": {
59
59
  "access": "public"
60
60
  },
61
- "gitHead": "ac4f58b96e2bde8340eefe7264e26a691078c729"
61
+ "gitHead": "7aad6296b89633808b2c665d6f40a5af8e5ebd7b"
62
62
  }