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
db0503ba
Commit
db0503ba
authored
Aug 14, 2020
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
仓位接口对接
parent
de18b38b
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
55 additions
and
28 deletions
+55
-28
base.config.json
config/base.config.json
+1
-1
index.js
scripts/services/index.js
+4
-1
app.tsx
src/app.tsx
+15
-1
global.d.ts
src/global/config/global.d.ts
+1
-1
useHttpRequest.ts
src/hooks/useHttpRequest.ts
+13
-9
menu.ts
src/locales/zh-CN/menu.ts
+1
-0
addRepository.tsx
src/pages/repositories/addRepository.tsx
+2
-9
adjustRepository.tsx
src/pages/repositories/adjustRepository.tsx
+8
-4
index.ts
src/services/index.ts
+0
-0
auth.ts
src/utils/auth.ts
+9
-2
request.ts
src/utils/request.ts
+1
-0
No files found.
config/base.config.json
View file @
db0503ba
{
"userRegister"
:{
"useType"
:{
"memberType"
:[{
"id"
:
1
,
"typeName"
:
"企业会员"
},{
"id"
:
3
,
"typeName"
:
"渠道企业会员"
},{
"id"
:
4
,
"typeName"
:
"渠道个人会员"
},{
"id"
:
2
,
"typeName"
:
"个人会员"
}],
"businessType"
:[{
"id"
:
1
,
"typeName"
:
"采购"
},{
"id"
:
24
,
"typeName"
:
"供应"
},{
"id"
:
33
,
"typeName"
:
"hcx供应商"
},{
"id"
:
34
,
"typeName"
:
"test3"
},{
"id"
:
35
,
"typeName"
:
"test4"
},{
"id"
:
36
,
"typeName"
:
"test5"
},{
"id"
:
37
,
"typeName"
:
"test6"
}]}},
"
global"
:{
"logo"
:
"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/logo.png"
,
"countryList"
:[{
"name"
:
"简体中文-ZH"
,
"key"
:
"zh-CN"
,
"icon"
:
"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/china.png"
},{
"name"
:
"English-EN"
,
"key"
:
"en-US"
,
"icon"
:
"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/us.png"
},{
"name"
:
"日本語-JP"
,
"key"
:
"jp"
,
"icon"
:
"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/japen.png"
},{
"name"
:
"한국어-KO"
,
"key"
:
"ko"
,
"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
"
}]}}
{
"userRegister"
:{
"useType"
:{
"memberType"
:[{
"id"
:
1
,
"typeName"
:
"企业会员"
},{
"id"
:
3
,
"typeName"
:
"渠道企业会员"
},{
"id"
:
4
,
"typeName"
:
"渠道个人会员"
},{
"id"
:
2
,
"typeName"
:
"个人会员"
}],
"businessType"
:[{
"id"
:
1
,
"typeName"
:
"采购"
},{
"id"
:
24
,
"typeName"
:
"供应"
},{
"id"
:
33
,
"typeName"
:
"hcx供应商"
},{
"id"
:
34
,
"typeName"
:
"test3"
},{
"id"
:
35
,
"typeName"
:
"test4"
},{
"id"
:
36
,
"typeName"
:
"test5"
},{
"id"
:
37
,
"typeName"
:
"test6"
}]}},
"
web"
:{
"shopInfo"
:[{
"id"
:
302
,
"name"
:
"云鲜采企业商城"
,
"type"
:
1
,
"environment"
:
1
,
"logoUrl"
:
"https://shushangyun01.oss-cn-shenzhen.aliyuncs.com/5b19a059530a4060984fc045125da1f81597395561658.png"
,
"describe"
:
null
,
"state"
:
1
,
"url"
:
"/"
},{
"id"
:
303
,
"name"
:
"云鲜采渠道商城"
,
"type"
:
3
,
"environment"
:
1
,
"logoUrl"
:
"https://shushangyun01.oss-cn-shenzhen.aliyuncs.com/a63c8c81e74947f88c64d4c72bfb565c1597395598958.png"
,
"describe"
:
null
,
"state"
:
1
,
"url"
:
"/shop"
}]},
"global"
:{
"siteId"
:
502
,
"siteUrl"
:
"http://localhost:4396"
,
"logo"
:
"https://shushangyun01.oss-cn-shenzhen.aliyuncs.com/4db4e7c5424c471c968ab540bce027f31597319423082.png"
,
"countryList"
:[{
"name"
:
"简体中文-ZH"
,
"key"
:
"zh-CN"
,
"icon"
:
"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/china.png"
},{
"name"
:
"English-EN"
,
"key"
:
"en-US"
,
"icon"
:
"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/us.png"
},{
"name"
:
"日本語-JP"
,
"key"
:
"jp"
,
"icon"
:
"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/japen.png"
},{
"name"
:
"한국어-KO"
,
"key"
:
"ko"
,
"icon"
:
"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/koren.png
"
}]}}
scripts/services/index.js
View file @
db0503ba
...
...
@@ -26,7 +26,10 @@ const serviceConfig = {
},
web
:
{
shopInfo
:
{
url
:
'/manage/shop/all'
,
url
:
'/manage/shop/findShopsBySiteId'
,
params
:
{
siteId
:
502
},
method
:
'get'
},
// site: {
...
...
src/app.tsx
View file @
db0503ba
...
...
@@ -9,7 +9,8 @@ import '@/global/styles/global.less'; // 导入全局样式
import
'antd/dist/antd.less'
import
{
isDev
}
from
'@/constants'
import
{
setup
}
from
'@formily/antd-components'
;
import
{
getRouters
,
getAuth
,
asyncRouter
}
from
'./utils/auth'
;
import
{
getRouters
,
getAuth
,
asyncRouter
,
setAuth
,
setRouters
}
from
'./utils/auth'
;
import
{
PublicApi
}
from
'./services/api'
;
setup
()
...
...
@@ -53,6 +54,19 @@ export function patchRoutes({ routes }: IRoutes) {
* @export
*/
export
function
render
(
oldRender
:
Function
)
{
const
authInfo
=
getAuth
()
if
(
authInfo
)
{
PublicApi
.
getMemberLoginReget
().
then
(
res
=>
{
const
{
data
}
=
res
setAuth
({
memberId
:
data
.
memberId
,
userId
:
data
.
userId
,
token
:
data
.
token
})
setRouters
(
data
.
urls
)
})
}
oldRender
()
}
...
...
src/global/config/global.d.ts
View file @
db0503ba
...
...
@@ -23,7 +23,7 @@ export interface ShopInfo {
type
:
number
;
environment
:
number
;
logoUrl
:
string
;
describe
:
string
;
describe
?:
any
;
state
:
number
;
url
:
string
;
}
...
...
src/hooks/useHttpRequest.ts
View file @
db0503ba
...
...
@@ -21,15 +21,19 @@ export function useHttpRequest<T>(api: (params?, config?) => Promise<T>, selfCon
const
[
data
,
setData
]
=
useState
<
T
|
null
>
(
null
)
const
[
err
,
setErr
]
=
useState
()
const
run
=
(
params
)
=>
{
setLoading
(
true
)
api
(
params
).
then
((
res
:
any
)
=>
{
setData
(
res
.
data
)
}).
catch
(
err
=>
{
setErr
(
err
)
}).
finally
(()
=>
{
setTimeout
(()
=>
{
setLoading
(
false
)
},
200
)
return
new
Promise
((
resolve
,
reject
)
=>
{
setLoading
(
true
)
api
(
params
).
then
((
res
:
any
)
=>
{
setData
(
res
.
data
)
resolve
(
res
)
}).
catch
(
err
=>
{
setErr
(
err
)
reject
(
err
)
}).
finally
(()
=>
{
setTimeout
(()
=>
{
setLoading
(
false
)
},
200
)
})
})
}
...
...
src/locales/zh-CN/menu.ts
View file @
db0503ba
...
...
@@ -71,6 +71,7 @@ export default {
'menu.memberAbility.memberManage.memberUpgradeRule'
:
'会员升级规则'
,
'menu.memberAbility.memberManage.memberLevel'
:
'会员等级'
,
'menu.memberAbility.memberManage.addEquity'
:
'会员权益设置'
,
'menu.memberAbility.memberManage.maintainDetail'
:
'未命名'
,
// 店铺能力
'menu.shopAbility'
:
'店铺'
,
...
...
src/pages/repositories/addRepository.tsx
View file @
db0503ba
...
...
@@ -25,15 +25,7 @@ import { useInitValue } from '@/formSchema/effects/useInitValue'
import
{
useWarehouseSelect
,
createAddRepositoryEffect
,
useUnitPreview
}
from
'./effects'
import
ModalTable
from
'@/components/ModalTable'
import
PositionSetting
from
'./components/PositionSetting'
const
fetchMemberList
=
async
(
params
)
=>
{
const
res
=
await
PublicApi
.
getMemberMaintenancePage
(
params
)
return
res
.
data
}
const
fetchProductList
=
async
(
params
)
=>
{
const
res
=
await
PublicApi
.
getProductCommodityGetCommodityDetailList
(
params
)
return
res
.
data
}
import
{
useHttpRequest
}
from
'@/hooks/useHttpRequest'
const
addSchemaAction
=
createFormActions
()
...
...
@@ -43,6 +35,7 @@ const AddRepository:React.FC<{}> = (props) => {
preview
,
pageStatus
}
=
usePageStatus
()
const
initValue
=
useInitValue
(
PublicApi
.
getWarehouseFreightSpaceDetails
)
useUnitPreview
(
initValue
,
addSchemaAction
)
...
...
src/pages/repositories/adjustRepository.tsx
View file @
db0503ba
...
...
@@ -18,6 +18,7 @@ import { useInitValue } from '@/formSchema/effects/useInitValue'
import
{
useLinkageUtils
}
from
'@/utils/formEffectUtils'
import
{
useUnitPreview
}
from
'./effects'
import
PositionSetting
from
'./components/PositionSetting'
import
{
useHttpRequest
}
from
'@/hooks/useHttpRequest'
const
addSchemaAction
=
createFormActions
()
const
repositInAction
=
createAsyncFormActions
()
...
...
@@ -30,6 +31,9 @@ const AddRepository:React.FC<{}> = (props) => {
// 获取到的所有仓库, 用于选中后获得仓库库存
const
[
reposits
,
setReposits
]
=
useState
<
any
>
([])
const
{
data
:
foldValue
,
loading
:
foldLoading
,
run
:
foldFn
}
=
useHttpRequest
(
PublicApi
.
postWarehouseFreightSpaceAllotFold
)
const
{
data
:
exportValue
,
loading
:
exportLoading
,
run
:
exportFn
}
=
useHttpRequest
(
PublicApi
.
postWarehouseFreightSpaceAllotExport
)
const
fetchRepositRecord
=
async
(
params
)
=>
{
const
{
data
}
=
await
PublicApi
.
getWarehouseFreightSpaceAllotFoldLog
({
id
,
...
...
@@ -88,7 +92,7 @@ const AddRepository:React.FC<{}> = (props) => {
params
[
key
]
=
value
}
})
const
{
data
}
=
await
PublicApi
.
postWarehouseFreightSpaceAllotFold
(
params
)
const
{
data
}
=
await
foldFn
(
params
)
const
{
callInInventory
,
bringUpTheInventory
}
=
data
repositInAction
.
setFieldValue
(
'NO_SUBMIT2'
,
bringUpTheInventory
)
...
...
@@ -104,7 +108,7 @@ const AddRepository:React.FC<{}> = (props) => {
params
[
key
]
=
value
}
})
const
{
data
}
=
await
PublicApi
.
postWarehouseFreightSpaceAllotExport
(
params
)
const
{
data
}
=
await
exportFn
(
params
)
const
{
callInInventory
,
bringUpTheInventory
}
=
data
...
...
@@ -114,10 +118,10 @@ const AddRepository:React.FC<{}> = (props) => {
}
const
transforInBtn
=
<
Row
justify=
'center'
>
<
Button
type=
'primary'
htmlType=
'submit'
>
调入
</
Button
>
<
Button
type=
'primary'
htmlType=
'submit'
loading=
{
foldLoading
}
>
调入
</
Button
>
</
Row
>
const
transforOutBtn
=
<
Row
justify=
'center'
>
<
Button
type=
'primary'
htmlType=
'submit'
>
调出
</
Button
>
<
Button
type=
'primary'
htmlType=
'submit'
loading=
{
exportLoading
}
>
调出
</
Button
>
</
Row
>
const
topTableChange
=
(
tabs
)
=>
{
...
...
src/services/index.ts
View file @
db0503ba
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/utils/auth.ts
View file @
db0503ba
import
{
isDev
}
from
'@/constants'
export
interface
AuthInfo
{
userId
:
number
,
memberId
:
number
,
...
...
@@ -10,19 +12,24 @@ export const setAuth = (info: AuthInfo) => {
export
const
getAuth
=
()
=>
{
try
{
return
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'auth'
))
||
{}
return
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'auth'
))
||
null
}
catch
(
error
)
{
return
{}
}
}
export
const
setRouters
=
(
routers
:
any
[])
=>
{
window
.
sessionStorage
.
setItem
(
'rt'
,
JSON
.
stringify
(
routers
))
}
export
const
getRouters
=
()
=>
{
try
{
return
JSON
.
parse
(
window
.
sessionStorage
.
getItem
(
'rt'
))
||
[]
return
JSON
.
parse
(
window
.
sessionStorage
.
getItem
(
'rt'
)).
concat
([
'/memberCenter/commodityAbility'
,
'/memberCenter/commodityAbility/classAndProperty'
,
'/memberCenter/commodityAbility/classAndProperty/attribute'
])
||
[]
}
catch
(
error
)
{
return
[]
}
...
...
src/utils/request.ts
View file @
db0503ba
...
...
@@ -106,6 +106,7 @@ class ApiRequest {
if
(
res
.
code
===
1101
)
{
removeAuth
()
history
.
replace
(
'/user/login'
)
message
.
error
(
res
.
message
)
return
false
}
...
...
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