@bit-sun/business-component 1.1.29 → 1.1.32

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bit-sun/business-component",
3
- "version": "1.1.29",
3
+ "version": "1.1.32",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -161,7 +161,7 @@ export function commonFun (type?: string, prefixUrl: any, requestConfigProp?: an
161
161
  }
162
162
  let needModalTable = true;
163
163
 
164
- // 商品选择器
164
+ // 商品选择器sku
165
165
  if(type === 'skuCommodity') {
166
166
  requestConfig = {
167
167
  url: `${prefixUrl.selectPrefix}/sku/pager/v2`,
@@ -309,6 +309,117 @@ export function commonFun (type?: string, prefixUrl: any, requestConfigProp?: an
309
309
  }
310
310
  }
311
311
 
312
+ // 商品选择器spu
313
+ if(type === 'spuCommodity') {
314
+ requestConfig = {
315
+ url: `${prefixUrl.selectPrefix}/item`,
316
+ filter: 'qp-itemCode,name-orGroup,like', // 过滤参数
317
+ mappingTextField: 'name',
318
+ mappingValueField: 'itemCode',
319
+ otherParams: {
320
+ 'qp-approveStatus-eq': 1, // 审核状态(0.待审批;1.审批通过;2.驳回;3.审批未通过)
321
+ sorter: 'desc-id'
322
+ }, // 默认参数
323
+ sourceName: 'itemCode',
324
+ ...requestConfigProp,
325
+ }
326
+ tableSearchForm = [
327
+ { name: 'qp-name-like', label: 'SPU名称' },
328
+ { name: 'qp-itemCode-like', label: 'SPU编码' },
329
+ { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
330
+ type: 'select',
331
+ props: {
332
+ mode: 'multiple',
333
+ notFoundContent: '暂无数据',
334
+ allowClear: true,
335
+ showSearch: true,
336
+ showArrow: true,
337
+ maxTagCount: 1,
338
+ optionFilterProp: 'children',
339
+ filterOption: (input: string, option: { props: { children: string } }) =>
340
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
341
+ },
342
+ } },
343
+ { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
344
+ type: 'treeSelect',
345
+ props: {
346
+ treeData: [],
347
+ treeCheckable: true,
348
+ showSearch: true,
349
+ allowClear: true,
350
+ showArrow: true,
351
+ treeNodeFilterProp: 'title',
352
+ treeDefaultExpandAll: true,
353
+ maxTagCount: 1,
354
+ placeholder: '请选择',
355
+ style: {
356
+ width: '100%',
357
+ },
358
+ dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
359
+ },
360
+ } },
361
+ { name: 'qp-classId-in', type: 'select', label: '品类', field: {
362
+ type: 'select',
363
+ props: {
364
+ mode: 'multiple',
365
+ notFoundContent: '暂无数据',
366
+ allowClear: true,
367
+ showSearch: true,
368
+ showArrow: true,
369
+ maxTagCount: 1,
370
+ optionFilterProp: 'children',
371
+ filterOption: (input: string, option: { props: { children: string } }) =>
372
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
373
+ },
374
+ } },
375
+ ]
376
+ Promise.all([
377
+ loadSelectSource(`${prefixUrl.formSelectFix}/brand/queryBrandList`, {
378
+ pageSize: 5000,
379
+ currentPage: 1,
380
+ }),
381
+ loadSelectSource(`${prefixUrl.formSelectFix}/category/queryCategoryTree`, {
382
+ pageSize: 5000,
383
+ currentPage: 1,
384
+ }),
385
+ loadSelectSource(`${prefixUrl.formSelectFix}/class/withProperty`, {
386
+ pageSize: 5000,
387
+ currentPage: 1,
388
+ }),
389
+ ]).then((x: any)=>{
390
+ formatSource(x,0, 2, tableSearchForm,['id','name']);
391
+ formatTreeDataSource(x,1, 3, tableSearchForm);
392
+ formatSource(x,2, 4, tableSearchForm,['id','name']);
393
+ })
394
+ modalTableProps = {
395
+ modalTableTitle: '选择SPU',
396
+ tableSearchForm,
397
+ tableColumns: [
398
+ {
399
+ title: 'SPU编码',
400
+ dataIndex: 'itemCode',
401
+ },
402
+ {
403
+ title: 'SPU名称',
404
+ dataIndex: 'name',
405
+ },
406
+ {
407
+ title: '品牌',
408
+ dataIndex: 'brandName',
409
+ },
410
+ {
411
+ title: '类目',
412
+ dataIndex: 'categoryText',
413
+ },
414
+ {
415
+ title: '品类',
416
+ dataIndex: 'className',
417
+ },
418
+ ],
419
+ ...modalTableBusProps
420
+ }
421
+ }
422
+
312
423
  // 商品规格选择器(无弹窗)
313
424
  if(type === 'skuPropertyValue') {
314
425
  requestConfig = {
@@ -247,6 +247,63 @@ export default () => {
247
247
 
248
248
  [comment]: <> (```)
249
249
 
250
+ ## 商品SPU选择器 Select-SPU-001
251
+
252
+ ```tsx
253
+ import React, { useState } from 'react';
254
+ import { Tabs } from 'antd';
255
+ import {BusinessSearchSelect} from '../../../index.ts';
256
+
257
+ const { TabPane } = Tabs;
258
+ export default () => {
259
+ const selectProps = {
260
+ // mode: 'multiple',
261
+ // maxTagCount: 1,
262
+ // disabled: true
263
+ }
264
+ const selectPropsMultiple = {
265
+ mode: 'multiple',
266
+ maxTagCount: 6,
267
+ }
268
+
269
+ const [ tabKey, setTabKey ] = useState('single')
270
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
271
+
272
+ const props = {
273
+ value,
274
+ onChange: (value: any) => {
275
+ console.log(value)
276
+ setValue(value)
277
+ },
278
+ prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
279
+ selectProps,
280
+ selectBusinessType: 'spuCommodity',
281
+ };
282
+
283
+ const onTabChange = (key) => {
284
+ setTabKey(key)
285
+ setValue(key === 'single' ? null: [])
286
+ }
287
+
288
+ return (
289
+ <div>
290
+ <Tabs onChange={onTabChange} activeKey={tabKey}>
291
+ <TabPane tab='单选' key='single'>
292
+ {tabKey === 'single' && (
293
+ <BusinessSearchSelect {...props} />
294
+ )}
295
+ </TabPane>
296
+ <TabPane tab='多选' key='multiple'>
297
+ {tabKey === 'multiple' && (
298
+ <BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
299
+ )}
300
+ </TabPane>
301
+ </Tabs>
302
+ </div>
303
+ );
304
+ };
305
+ ```
306
+
250
307
 
251
308
  ## 仓库选择器(物理仓) Select-Warehouse-001
252
309
 
@@ -47,6 +47,11 @@ const mapping = new Map([
47
47
  ['checkQuantity', '实盘数量'],
48
48
  ['shareRatio', '共享比例'],
49
49
  ['lotNumberCode', '批号'],
50
+ ['warehouseCode', '仓库编码'],
51
+ ['regionCode', '库区'],
52
+ ['rowNumber', '货位排数'],
53
+ ['layerNumber', '货位层数'],
54
+ ['gridNumber', '货位格号'],
50
55
  ]);
51
56
 
52
57
  // for dnd