@gm-pc/business 1.24.7 → 1.24.9-beat.2
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/README.md +3 -3
- package/package.json +4 -4
- package/src/code_input/code_input.tsx +38 -38
- package/src/code_input/index.ts +2 -2
- package/src/code_input/stories.tsx +66 -66
- package/src/code_input/util.ts +11 -11
- package/src/data_category_tree/data_category_tree.tsx +75 -75
- package/src/data_category_tree/index.ts +1 -1
- package/src/data_category_tree/stories.tsx +46 -46
- package/src/data_category_tree/util.ts +109 -109
- package/src/data_gegraphic_label/data_address.tsx +46 -46
- package/src/data_gegraphic_label/data_address_name.tsx +30 -30
- package/src/data_gegraphic_label/index.ts +2 -2
- package/src/data_gegraphic_label/stories.tsx +36 -36
- package/src/data_gegraphic_label/types.ts +44 -44
- package/src/data_gegraphic_label/util.ts +73 -73
- package/src/index.ts +4 -4
- package/src/stories.tsx +27 -27
- package/src/table_list/index.ts +2 -2
- package/src/table_list/table_list.tsx +110 -110
- package/src/table_list/table_total_text.tsx +36 -36
- package/src/table_list/types.ts +51 -51
- package/src/table_list/util.ts +16 -16
package/README.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
DataXXXX 代表有数据的组件,约定 Data 有 onReady(data) 回调
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
DataXXXX 代表有数据的组件,约定 Data 有 onReady(data) 回调
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gm-pc/business",
|
|
3
|
-
"version": "1.24.
|
|
3
|
+
"version": "1.24.9-beat.2",
|
|
4
4
|
"description": "观麦科技业务组件库",
|
|
5
5
|
"author": "liyatang <liyatang@qq.com>",
|
|
6
6
|
"homepage": "https://github.com/gmfe/gm-pc#readme",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@gm-common/hooks": "^2.10.0",
|
|
30
30
|
"@gm-common/tool": "^2.10.0",
|
|
31
|
-
"@gm-pc/react": "^1.24.
|
|
32
|
-
"@gm-pc/table-x": "^1.24.
|
|
31
|
+
"@gm-pc/react": "^1.24.9-beat.2",
|
|
32
|
+
"@gm-pc/table-x": "^1.24.9-beat.2"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "307cc3b7b644f03b6591a9ead7408dbb43f37359"
|
|
35
35
|
}
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import React, { ChangeEvent, useEffect, forwardRef, useRef } from 'react'
|
|
2
|
-
import { Input, InputProps } from '@gm-pc/react'
|
|
3
|
-
|
|
4
|
-
import { getCustomizedCode } from './util'
|
|
5
|
-
|
|
6
|
-
interface CodeInputProps extends Omit<InputProps, 'onChange'> {
|
|
7
|
-
text?: string
|
|
8
|
-
onChange?(value: string): void
|
|
9
|
-
/** 是否需要随text变化 */
|
|
10
|
-
needTextChange?: boolean
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
// 一旦本身输入修改,就不再根据外层变动
|
|
14
|
-
const CodeInput = forwardRef<HTMLInputElement, CodeInputProps>(
|
|
15
|
-
({ text, onChange, needTextChange = true, ...rest }, ref) => {
|
|
16
|
-
// 记录当前自身是否编辑
|
|
17
|
-
const changed = useRef<boolean>(false)
|
|
18
|
-
const random = useRef<number>(Math.floor(Math.random() * 10000))
|
|
19
|
-
|
|
20
|
-
useEffect(() => {
|
|
21
|
-
if (!changed.current && needTextChange) {
|
|
22
|
-
const new_value: string = getCustomizedCode(text || '').trim()
|
|
23
|
-
const code: string = new_value ? `${new_value}${random.current}` : new_value
|
|
24
|
-
onChange && onChange(code)
|
|
25
|
-
}
|
|
26
|
-
}, [text, needTextChange])
|
|
27
|
-
|
|
28
|
-
const handleChange = (e: ChangeEvent<HTMLInputElement>) => {
|
|
29
|
-
changed.current = true
|
|
30
|
-
onChange && onChange(e.target.value)
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return <Input {...rest} ref={ref} onChange={handleChange} />
|
|
34
|
-
}
|
|
35
|
-
)
|
|
36
|
-
|
|
37
|
-
export default CodeInput
|
|
38
|
-
export type { CodeInputProps }
|
|
1
|
+
import React, { ChangeEvent, useEffect, forwardRef, useRef } from 'react'
|
|
2
|
+
import { Input, InputProps } from '@gm-pc/react'
|
|
3
|
+
|
|
4
|
+
import { getCustomizedCode } from './util'
|
|
5
|
+
|
|
6
|
+
interface CodeInputProps extends Omit<InputProps, 'onChange'> {
|
|
7
|
+
text?: string
|
|
8
|
+
onChange?(value: string): void
|
|
9
|
+
/** 是否需要随text变化 */
|
|
10
|
+
needTextChange?: boolean
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// 一旦本身输入修改,就不再根据外层变动
|
|
14
|
+
const CodeInput = forwardRef<HTMLInputElement, CodeInputProps>(
|
|
15
|
+
({ text, onChange, needTextChange = true, ...rest }, ref) => {
|
|
16
|
+
// 记录当前自身是否编辑
|
|
17
|
+
const changed = useRef<boolean>(false)
|
|
18
|
+
const random = useRef<number>(Math.floor(Math.random() * 10000))
|
|
19
|
+
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (!changed.current && needTextChange) {
|
|
22
|
+
const new_value: string = getCustomizedCode(text || '').trim()
|
|
23
|
+
const code: string = new_value ? `${new_value}${random.current}` : new_value
|
|
24
|
+
onChange && onChange(code)
|
|
25
|
+
}
|
|
26
|
+
}, [text, needTextChange])
|
|
27
|
+
|
|
28
|
+
const handleChange = (e: ChangeEvent<HTMLInputElement>) => {
|
|
29
|
+
changed.current = true
|
|
30
|
+
onChange && onChange(e.target.value)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return <Input {...rest} ref={ref} onChange={handleChange} />
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
export default CodeInput
|
|
38
|
+
export type { CodeInputProps }
|
package/src/code_input/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as CodeInput } from './code_input'
|
|
2
|
-
export type { CodeInputProps } from './code_input'
|
|
1
|
+
export { default as CodeInput } from './code_input'
|
|
2
|
+
export type { CodeInputProps } from './code_input'
|
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
import React, { ChangeEvent } from 'react'
|
|
2
|
-
import { observable } from 'mobx'
|
|
3
|
-
import { Input } from '@gm-pc/react'
|
|
4
|
-
|
|
5
|
-
import CodeInput from './code_input'
|
|
6
|
-
|
|
7
|
-
const store = observable({
|
|
8
|
-
value: '',
|
|
9
|
-
code: '',
|
|
10
|
-
code_value: '111',
|
|
11
|
-
setValue(v: string) {
|
|
12
|
-
this.value = v
|
|
13
|
-
},
|
|
14
|
-
setCode(v: string) {
|
|
15
|
-
this.code = v
|
|
16
|
-
},
|
|
17
|
-
setCodeValue(v: string) {
|
|
18
|
-
this.code_value = v
|
|
19
|
-
},
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
export const ComCodeInput = () => {
|
|
23
|
-
const handleChange = (e: ChangeEvent<HTMLInputElement>) => {
|
|
24
|
-
store.setValue(e.target.value)
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const handleCodeChange = (value: string) => {
|
|
28
|
-
store.setCode(value)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const handleCodeValueChange = (value: string) => {
|
|
32
|
-
store.setCodeValue(value)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return (
|
|
36
|
-
<>
|
|
37
|
-
<div>编码为空</div>
|
|
38
|
-
<div>
|
|
39
|
-
名称:
|
|
40
|
-
<Input value={store.value} onChange={handleChange} />
|
|
41
|
-
</div>
|
|
42
|
-
<div>
|
|
43
|
-
编码:
|
|
44
|
-
<CodeInput value={store.code} text={store.value} onChange={handleCodeChange} />
|
|
45
|
-
</div>
|
|
46
|
-
<div className='gm-margin-top-20'>编码不为空</div>
|
|
47
|
-
<div>
|
|
48
|
-
名称:
|
|
49
|
-
<Input value={store.value} onChange={handleChange} />
|
|
50
|
-
</div>
|
|
51
|
-
<div>
|
|
52
|
-
编码:
|
|
53
|
-
<CodeInput
|
|
54
|
-
needTextChange={false}
|
|
55
|
-
value={store.code_value}
|
|
56
|
-
text={store.value}
|
|
57
|
-
onChange={handleCodeValueChange}
|
|
58
|
-
/>
|
|
59
|
-
</div>
|
|
60
|
-
</>
|
|
61
|
-
)
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export default {
|
|
65
|
-
title: 'Business/CodeInput',
|
|
66
|
-
}
|
|
1
|
+
import React, { ChangeEvent } from 'react'
|
|
2
|
+
import { observable } from 'mobx'
|
|
3
|
+
import { Input } from '@gm-pc/react'
|
|
4
|
+
|
|
5
|
+
import CodeInput from './code_input'
|
|
6
|
+
|
|
7
|
+
const store = observable({
|
|
8
|
+
value: '',
|
|
9
|
+
code: '',
|
|
10
|
+
code_value: '111',
|
|
11
|
+
setValue(v: string) {
|
|
12
|
+
this.value = v
|
|
13
|
+
},
|
|
14
|
+
setCode(v: string) {
|
|
15
|
+
this.code = v
|
|
16
|
+
},
|
|
17
|
+
setCodeValue(v: string) {
|
|
18
|
+
this.code_value = v
|
|
19
|
+
},
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
export const ComCodeInput = () => {
|
|
23
|
+
const handleChange = (e: ChangeEvent<HTMLInputElement>) => {
|
|
24
|
+
store.setValue(e.target.value)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const handleCodeChange = (value: string) => {
|
|
28
|
+
store.setCode(value)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const handleCodeValueChange = (value: string) => {
|
|
32
|
+
store.setCodeValue(value)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<>
|
|
37
|
+
<div>编码为空</div>
|
|
38
|
+
<div>
|
|
39
|
+
名称:
|
|
40
|
+
<Input value={store.value} onChange={handleChange} />
|
|
41
|
+
</div>
|
|
42
|
+
<div>
|
|
43
|
+
编码:
|
|
44
|
+
<CodeInput value={store.code} text={store.value} onChange={handleCodeChange} />
|
|
45
|
+
</div>
|
|
46
|
+
<div className='gm-margin-top-20'>编码不为空</div>
|
|
47
|
+
<div>
|
|
48
|
+
名称:
|
|
49
|
+
<Input value={store.value} onChange={handleChange} />
|
|
50
|
+
</div>
|
|
51
|
+
<div>
|
|
52
|
+
编码:
|
|
53
|
+
<CodeInput
|
|
54
|
+
needTextChange={false}
|
|
55
|
+
value={store.code_value}
|
|
56
|
+
text={store.value}
|
|
57
|
+
onChange={handleCodeValueChange}
|
|
58
|
+
/>
|
|
59
|
+
</div>
|
|
60
|
+
</>
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export default {
|
|
65
|
+
title: 'Business/CodeInput',
|
|
66
|
+
}
|
package/src/code_input/util.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { pinyin } from '@gm-common/tool'
|
|
2
|
-
import _ from 'lodash'
|
|
3
|
-
|
|
4
|
-
export const getCustomizedCode = (text: string): string => {
|
|
5
|
-
if (!text) {
|
|
6
|
-
return ''
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
const code: string = _.map(text, (t) => pinyin(t)[0]).join('')
|
|
10
|
-
return code
|
|
11
|
-
}
|
|
1
|
+
import { pinyin } from '@gm-common/tool'
|
|
2
|
+
import _ from 'lodash'
|
|
3
|
+
|
|
4
|
+
export const getCustomizedCode = (text: string): string => {
|
|
5
|
+
if (!text) {
|
|
6
|
+
return ''
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const code: string = _.map(text, (t) => pinyin(t)[0]).join('')
|
|
10
|
+
return code
|
|
11
|
+
}
|
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
import React, { FC, CSSProperties, ReactNode } from 'react'
|
|
2
|
-
import { getCategoryTree, CategoryItem, SpuItem, SkuItem } from './util'
|
|
3
|
-
import { Tree, LoadingChunk, TreeListItem } from '@gm-pc/react'
|
|
4
|
-
import { useAsync } from '@gm-common/hooks'
|
|
5
|
-
import classNames from 'classnames'
|
|
6
|
-
import { ListSkuRequest } from 'gm_api/src/merchandise'
|
|
7
|
-
|
|
8
|
-
interface DataCategoryTreeProps {
|
|
9
|
-
className?: string
|
|
10
|
-
style?: CSSProperties
|
|
11
|
-
border?: boolean
|
|
12
|
-
needSku?: boolean
|
|
13
|
-
skuParams?: Omit<ListSkuRequest, 'paging'>
|
|
14
|
-
onReady?(data?: CategoryItem[]): void
|
|
15
|
-
activeValue?: any
|
|
16
|
-
findPlaceholder?: string
|
|
17
|
-
onActiveValue?(activeValue: any, item: CategoryItem | SpuItem | SkuItem): void
|
|
18
|
-
onLeafActiveValue?(activeValue: any, item: SpuItem | SkuItem): void
|
|
19
|
-
renderLeafItem?: (data: TreeListItem) => ReactNode
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const DataCategoryTree: FC<DataCategoryTreeProps> = ({
|
|
23
|
-
style,
|
|
24
|
-
border,
|
|
25
|
-
needSku,
|
|
26
|
-
onReady,
|
|
27
|
-
skuParams,
|
|
28
|
-
className,
|
|
29
|
-
activeValue,
|
|
30
|
-
onActiveValue,
|
|
31
|
-
findPlaceholder,
|
|
32
|
-
onLeafActiveValue,
|
|
33
|
-
renderLeafItem,
|
|
34
|
-
}) => {
|
|
35
|
-
const { data, loading } = useAsync(getCategoryTree, {
|
|
36
|
-
manual: false,
|
|
37
|
-
cacheKey: 'GMGetCategoryTree',
|
|
38
|
-
defaultParams: {
|
|
39
|
-
needSku,
|
|
40
|
-
skuParams,
|
|
41
|
-
},
|
|
42
|
-
onSuccess(data) {
|
|
43
|
-
onReady && onReady(data)
|
|
44
|
-
},
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
const handleActiveValue = (active: any, item: CategoryItem | SpuItem | SkuItem) => {
|
|
48
|
-
onActiveValue && onActiveValue(active, item)
|
|
49
|
-
if (!('children' in item && item.children)) {
|
|
50
|
-
onLeafActiveValue && onLeafActiveValue(active, item as SpuItem | SkuItem)
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
return (
|
|
55
|
-
<LoadingChunk
|
|
56
|
-
loading={loading}
|
|
57
|
-
className={classNames('gmb-category-tree', className)}
|
|
58
|
-
style={style}
|
|
59
|
-
>
|
|
60
|
-
<Tree
|
|
61
|
-
list={data || []}
|
|
62
|
-
border={border}
|
|
63
|
-
activeValue={activeValue}
|
|
64
|
-
onActiveValue={handleActiveValue}
|
|
65
|
-
disabledCheckbox
|
|
66
|
-
withFilter={false}
|
|
67
|
-
findPlaceholder={findPlaceholder}
|
|
68
|
-
renderLeafItem={renderLeafItem}
|
|
69
|
-
showFind
|
|
70
|
-
/>
|
|
71
|
-
</LoadingChunk>
|
|
72
|
-
)
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export default React.memo(DataCategoryTree)
|
|
1
|
+
import React, { FC, CSSProperties, ReactNode } from 'react'
|
|
2
|
+
import { getCategoryTree, CategoryItem, SpuItem, SkuItem } from './util'
|
|
3
|
+
import { Tree, LoadingChunk, TreeListItem } from '@gm-pc/react'
|
|
4
|
+
import { useAsync } from '@gm-common/hooks'
|
|
5
|
+
import classNames from 'classnames'
|
|
6
|
+
import { ListSkuRequest } from 'gm_api/src/merchandise'
|
|
7
|
+
|
|
8
|
+
interface DataCategoryTreeProps {
|
|
9
|
+
className?: string
|
|
10
|
+
style?: CSSProperties
|
|
11
|
+
border?: boolean
|
|
12
|
+
needSku?: boolean
|
|
13
|
+
skuParams?: Omit<ListSkuRequest, 'paging'>
|
|
14
|
+
onReady?(data?: CategoryItem[]): void
|
|
15
|
+
activeValue?: any
|
|
16
|
+
findPlaceholder?: string
|
|
17
|
+
onActiveValue?(activeValue: any, item: CategoryItem | SpuItem | SkuItem): void
|
|
18
|
+
onLeafActiveValue?(activeValue: any, item: SpuItem | SkuItem): void
|
|
19
|
+
renderLeafItem?: (data: TreeListItem) => ReactNode
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const DataCategoryTree: FC<DataCategoryTreeProps> = ({
|
|
23
|
+
style,
|
|
24
|
+
border,
|
|
25
|
+
needSku,
|
|
26
|
+
onReady,
|
|
27
|
+
skuParams,
|
|
28
|
+
className,
|
|
29
|
+
activeValue,
|
|
30
|
+
onActiveValue,
|
|
31
|
+
findPlaceholder,
|
|
32
|
+
onLeafActiveValue,
|
|
33
|
+
renderLeafItem,
|
|
34
|
+
}) => {
|
|
35
|
+
const { data, loading } = useAsync(getCategoryTree, {
|
|
36
|
+
manual: false,
|
|
37
|
+
cacheKey: 'GMGetCategoryTree',
|
|
38
|
+
defaultParams: {
|
|
39
|
+
needSku,
|
|
40
|
+
skuParams,
|
|
41
|
+
},
|
|
42
|
+
onSuccess(data) {
|
|
43
|
+
onReady && onReady(data)
|
|
44
|
+
},
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
const handleActiveValue = (active: any, item: CategoryItem | SpuItem | SkuItem) => {
|
|
48
|
+
onActiveValue && onActiveValue(active, item)
|
|
49
|
+
if (!('children' in item && item.children)) {
|
|
50
|
+
onLeafActiveValue && onLeafActiveValue(active, item as SpuItem | SkuItem)
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<LoadingChunk
|
|
56
|
+
loading={loading}
|
|
57
|
+
className={classNames('gmb-category-tree', className)}
|
|
58
|
+
style={style}
|
|
59
|
+
>
|
|
60
|
+
<Tree
|
|
61
|
+
list={data || []}
|
|
62
|
+
border={border}
|
|
63
|
+
activeValue={activeValue}
|
|
64
|
+
onActiveValue={handleActiveValue}
|
|
65
|
+
disabledCheckbox
|
|
66
|
+
withFilter={false}
|
|
67
|
+
findPlaceholder={findPlaceholder}
|
|
68
|
+
renderLeafItem={renderLeafItem}
|
|
69
|
+
showFind
|
|
70
|
+
/>
|
|
71
|
+
</LoadingChunk>
|
|
72
|
+
)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export default React.memo(DataCategoryTree)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as DataCategoryTree } from './data_category_tree'
|
|
1
|
+
export { default as DataCategoryTree } from './data_category_tree'
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { DataCategoryTree } from './index'
|
|
3
|
-
|
|
4
|
-
export const ComDataCategoryTree = () => {
|
|
5
|
-
return (
|
|
6
|
-
<DataCategoryTree
|
|
7
|
-
style={{ width: '250px', height: '500px', padding: '10px' }}
|
|
8
|
-
onReady={(data) => {
|
|
9
|
-
console.log(data)
|
|
10
|
-
}}
|
|
11
|
-
onActiveValue={(value, item) => {
|
|
12
|
-
console.log(value, item)
|
|
13
|
-
}}
|
|
14
|
-
onLeafActiveValue={(value, item) => {
|
|
15
|
-
console.log(value, item)
|
|
16
|
-
}}
|
|
17
|
-
/>
|
|
18
|
-
)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export const ComDataCategoryTreeNeedSku = () => {
|
|
22
|
-
return (
|
|
23
|
-
<div style={{ width: '250px', padding: '10px' }}>
|
|
24
|
-
<DataCategoryTree
|
|
25
|
-
border={false}
|
|
26
|
-
needSku
|
|
27
|
-
style={{ height: '500px' }}
|
|
28
|
-
onReady={(data) => {
|
|
29
|
-
console.log(data)
|
|
30
|
-
}}
|
|
31
|
-
onActiveValue={(value, item) => {
|
|
32
|
-
console.log(value, item)
|
|
33
|
-
}}
|
|
34
|
-
onLeafActiveValue={(value, item) => {
|
|
35
|
-
console.log('onLeafActiveValue', value, item)
|
|
36
|
-
}}
|
|
37
|
-
findPlaceholder='输入sku名称'
|
|
38
|
-
skuParams={{ process: 1, sku_type: 2 }}
|
|
39
|
-
/>
|
|
40
|
-
</div>
|
|
41
|
-
)
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export default {
|
|
45
|
-
title: 'Business/DataCategoryTree',
|
|
46
|
-
}
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { DataCategoryTree } from './index'
|
|
3
|
+
|
|
4
|
+
export const ComDataCategoryTree = () => {
|
|
5
|
+
return (
|
|
6
|
+
<DataCategoryTree
|
|
7
|
+
style={{ width: '250px', height: '500px', padding: '10px' }}
|
|
8
|
+
onReady={(data) => {
|
|
9
|
+
console.log(data)
|
|
10
|
+
}}
|
|
11
|
+
onActiveValue={(value, item) => {
|
|
12
|
+
console.log(value, item)
|
|
13
|
+
}}
|
|
14
|
+
onLeafActiveValue={(value, item) => {
|
|
15
|
+
console.log(value, item)
|
|
16
|
+
}}
|
|
17
|
+
/>
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const ComDataCategoryTreeNeedSku = () => {
|
|
22
|
+
return (
|
|
23
|
+
<div style={{ width: '250px', padding: '10px' }}>
|
|
24
|
+
<DataCategoryTree
|
|
25
|
+
border={false}
|
|
26
|
+
needSku
|
|
27
|
+
style={{ height: '500px' }}
|
|
28
|
+
onReady={(data) => {
|
|
29
|
+
console.log(data)
|
|
30
|
+
}}
|
|
31
|
+
onActiveValue={(value, item) => {
|
|
32
|
+
console.log(value, item)
|
|
33
|
+
}}
|
|
34
|
+
onLeafActiveValue={(value, item) => {
|
|
35
|
+
console.log('onLeafActiveValue', value, item)
|
|
36
|
+
}}
|
|
37
|
+
findPlaceholder='输入sku名称'
|
|
38
|
+
skuParams={{ process: 1, sku_type: 2 }}
|
|
39
|
+
/>
|
|
40
|
+
</div>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export default {
|
|
45
|
+
title: 'Business/DataCategoryTree',
|
|
46
|
+
}
|