Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陈智峰
jinfa-platform
Commits
d3096785
Commit
d3096785
authored
Aug 13, 2020
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
仓位跳转
parent
399bb3f4
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
55 additions
and
54 deletions
+55
-54
index.ts
config/mallRoutes/index.ts
+0
-1
demo.js
demo.js
+3
-5
index.js
scripts/services/index.js
+9
-9
useAsyncSelect.ts
src/formSchema/effects/useAsyncSelect.ts
+3
-0
global.d.ts
src/global/config/global.d.ts
+2
-20
adjustRepository.tsx
src/pages/repositories/adjustRepository.tsx
+25
-4
index.tsx
src/pages/repositories/effects/index.tsx
+5
-2
index.tsx
src/pages/repositories/schema/index.tsx
+4
-11
index.ts
src/store/site/index.ts
+4
-2
No files found.
config/mallRoutes/index.ts
View file @
d3096785
const
mallRoute
=
{
path
:
'/'
,
component
:
'@/pages/lxMall/layouts/LXMallLayout'
,
...
...
demo.js
View file @
d3096785
...
...
@@ -3,7 +3,9 @@ const mockData = {
code
:
1000
,
data
:
{
global
:
{
logo
:
'http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/logo.png'
,
siteId
:
502
,
siteUrl
:
'http://localhost:4396'
,
logo
:
'https://shushangyun01.oss-cn-shenzhen.aliyuncs.com/4db4e7c5424c471c968ab540bce027f31597319423082.png'
,
countryList
:
[
{
name
:
'简体中文-ZH'
,
...
...
@@ -26,10 +28,6 @@ const mockData = {
icon
:
'http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/koren.png'
}
],
menuList
:
[
{
code
:
'/memberCenter/commodityAbility'
,
children
:
[
{
code
:
'/mem'
}
]
},
{
code
:
'/memberCenter/commodityAbility/classAndProperty/class'
},
]
}
}
}
...
...
scripts/services/index.js
View file @
d3096785
...
...
@@ -29,15 +29,15 @@ const serviceConfig = {
url
:
'/manage/shop/all'
,
method
:
'get'
},
site
:
{
url
:
'/manage/paas/site/all'
,
method
:
'get'
,
// params: linkage => {
// return {
// id: linkage.id
// }
// }
}
//
site: {
//
url: '/manage/paas/site/all',
//
method: 'get',
//
// params: linkage => {
//
// return {
//
// id: linkage.id
//
// }
//
// }
//
}
},
}
...
...
src/formSchema/effects/useAsyncSelect.ts
View file @
d3096785
...
...
@@ -16,6 +16,9 @@ export const useAsyncSelect = (name, service: () => Promise<any[]>) => {
})
linkage
.
loading
(
name
)
service
().
then
(
res
=>
{
setFieldState
(
name
,
state
=>
{
state
.
originAsyncData
=
res
})
linkage
.
loaded
(
name
)
linkage
.
enum
(
name
,
res
)
//请求结束可以dispatch一个自定义事件收尾,方便后续针对该事件做联动
...
...
src/global/config/global.d.ts
View file @
d3096785
...
...
@@ -15,10 +15,6 @@ export interface UseType {
export
interface
UserRegister
{
useType
:
UseType
;
<<<<<<<
HEAD
useDetail
?:
any
;
=======
>>>>>>>
1
e9b352414679e662c2d94fb6725cc5e998b77d3
}
export
interface
ShopInfo
{
...
...
@@ -32,14 +28,8 @@ export interface ShopInfo {
url
:
string
;
}
export
interface
Site
{
id
:
number
;
name
:
string
;
}
export
interface
Web
{
shopInfo
:
ShopInfo
[];
site
:
Site
[];
}
export
interface
CountryList
{
...
...
@@ -48,19 +38,11 @@ export interface CountryList {
icon
:
string
;
}
export
interface
Children
{
code
:
string
;
}
export
interface
MenuList
{
code
:
string
;
children
:
Children
[];
}
export
interface
Global
{
siteId
:
number
;
siteUrl
:
string
;
logo
:
string
;
countryList
:
CountryList
[];
menuList
:
MenuList
[];
}
export
interface
RootObject
{
...
...
src/pages/repositories/adjustRepository.tsx
View file @
d3096785
...
...
@@ -14,7 +14,7 @@ import ReutrnEle from '@/components/ReturnEle';
import
'./index.less'
import
NiceForm
,
{
FlexBox
}
from
'@/components/NiceForm'
import
{
repositDetailSchema
,
repositMoreSchema
,
repositSchema
,
repositTabOneSchema
,
repositInSchema
}
from
'./schema'
import
{
createFormActions
,
ISchema
,
FormButtonGroup
,
Submit
,
FormEffectHooks
,
FormProvider
,
FormSpy
}
from
'@formily/antd'
import
{
createFormActions
,
ISchema
,
FormButtonGroup
,
Submit
,
FormEffectHooks
,
FormProvider
,
FormSpy
,
createAsyncFormActions
}
from
'@formily/antd'
import
EyePreview
from
'@/components/EyePreview'
import
{
findItemAndDelete
,
omit
}
from
'@/utils'
import
{
PublicApi
}
from
'@/services/api'
...
...
@@ -48,7 +48,7 @@ const fetchDepositAllList = async () => {
}
const
addSchemaAction
=
createFormActions
()
const
repositSchemaAction
=
createFormActions
()
const
repositSchemaAction
=
create
Async
FormActions
()
const
AddRepository
:
React
.
FC
<
{}
>
=
(
props
)
=>
{
const
ref
=
useRef
<
any
>
({})
...
...
@@ -276,6 +276,14 @@ const AddRepository:React.FC<{}> = (props) => {
<
Button
type=
'primary'
htmlType=
'submit'
>
调入
</
Button
>
</
Row
>
const
topTableChange
=
(
tabs
)
=>
{
if
(
tabs
===
'tab2'
)
{
repositSchemaAction
.
getFieldValue
(
'NO_SUBMIT1'
).
then
(
data
=>
{
console
.
log
(
data
)
})
// 调入的数值
}
}
return
(
<
PageHeaderWrapper
onBack=
{
()
=>
history
.
goBack
()
}
...
...
@@ -291,7 +299,7 @@ const AddRepository:React.FC<{}> = (props) => {
<
Card
className=
''
>
<
FormProvider
>
<
Tabs
type=
'card'
defaultActiveKey=
'tab1'
>
<
Tabs
type=
'card'
defaultActiveKey=
'tab1'
onChange=
{
topTableChange
}
>
<
Tabs
.
TabPane
key=
'tab1'
tab=
'仓位设置'
>
<
NiceForm
previewPlaceholder=
'loading...'
...
...
@@ -323,9 +331,22 @@ const AddRepository:React.FC<{}> = (props) => {
onSubmit=
{
handleRespotIn
}
effects=
{
(
$
,
{
setFieldState
})
=>
{
const
utils
=
useLinkageUtils
()
useAsyncSelect
(
'freightSpaceId'
,
fetchDepositAllList
)
FormEffectHooks
.
onFormMount$
().
subscribe
(()
=>
{
const
name
=
spyForm
.
getFieldValue
(
'name'
)
PublicApi
.
getWarehouseFreightSpaceAll
().
then
(
res
=>
{
const
{
data
}
=
res
const
asyncEnums
=
data
.
map
(
v
=>
({
label
:
v
.
name
,
value
:
v
.
id
}))
utils
.
enum
(
'freightSpaceId'
,
asyncEnums
)
$
(
'onFieldInputChange'
,
'freightSpaceId'
).
subscribe
(
state
=>
{
const
numberValue
=
data
.
find
(
v
=>
v
.
id
===
state
.
value
).
inventory
utils
.
value
(
'NO_SUBMIT1'
,
numberValue
)
})
})
utils
.
enum
(
'foldFreightSpaceId'
,
[
{
label
:
name
,
value
:
id
}
])
...
...
src/pages/repositories/effects/index.tsx
View file @
d3096785
import
React
,
{
useEffect
}
from
'react'
import
{
ISchemaFormActions
,
FormEffectHooks
}
from
'@formily/antd'
;
import
{
ISchemaFormActions
,
FormEffectHooks
,
IFormActions
}
from
'@formily/antd'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
useAsyncSelect
}
from
'@/formSchema/effects/useAsyncSelect'
;
const
{
onFieldValueChange$
}
=
FormEffectHooks
...
...
@@ -19,9 +19,12 @@ export const useWarehouseSelect = (context: ISchemaFormActions) => {
})
}
export
const
createAddRepositoryEffect
=
(
context
)
=>
{
export
const
createAddRepositoryEffect
=
(
context
:
ISchemaFormActions
)
=>
{
const
fetchWarehouseAll
=
async
()
=>
{
const
{
data
}
=
await
PublicApi
.
getWarehouseWarehouseAll
()
context
.
setFieldState
(
'warehouseId'
,
state
=>
{
state
.
warehouseLists
=
data
})
return
data
.
map
(
v
=>
({
value
:
v
.
id
,
label
:
v
.
name
...
...
src/pages/repositories/schema/index.tsx
View file @
d3096785
...
...
@@ -671,7 +671,7 @@ export const repositInSchema: ISchema = {
type
:
'string'
,
title
:
'调出仓位名称'
,
enum
:
[],
//
required: true,
required
:
true
,
"x-mega-props"
:
{
span
:
1
}
...
...
@@ -693,13 +693,13 @@ export const repositInSchema: ISchema = {
readOnly
:
true
,
title
:
'当前仓位库存(尺)'
,
"x-component"
:
'CircleBox'
,
default
:
2000
0
default
:
0
},
'NO_SUBMIT2'
:
{
type
:
'object'
,
title
:
'当前仓位库存(尺)'
,
"x-component"
:
'CircleBox'
,
default
:
2000
0
default
:
0
},
"foldInventory"
:
{
type
:
'number'
,
...
...
@@ -707,15 +707,8 @@ export const repositInSchema: ISchema = {
"x-component-props"
:
{
width
:
'80%'
,
isNumber
:
true
,
max
:
2000
0
,
max
:
0
,
min
:
0
,
marks
:
{
0
:
0
,
5000
:
5000
,
10000
:
10000
,
15000
:
15000
,
20000
:
20000
},
layout
:
{
display
:
'flex'
,
flexDirection
:
'column'
,
...
...
src/store/site/index.ts
View file @
d3096785
import
{
action
,
computed
,
observable
,
runInAction
}
from
'mobx'
import
{
ISiteModule
}
from
'@/module/siteModule'
;
import
{
GlobalConfig
}
from
'@/global/config'
;
class
SiteStore
implements
ISiteModule
{
@
observable
public
siteId
:
number
=
352
;
// 站点id
@
observable
public
siteUrl
:
string
=
'https://127.0.0.1:4379'
;
// 站点域名
// 可在根目录下的demo.js修改数据
@
observable
public
siteId
:
number
=
GlobalConfig
.
global
.
siteId
;
// 站点id
@
observable
public
siteUrl
:
string
=
GlobalConfig
.
global
.
siteUrl
;
// 站点域名
}
export
default
SiteStore
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment