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
shenshaokai
jinfa-platform
Commits
f19b7121
Commit
f19b7121
authored
Aug 09, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v2' of
http://10.0.0.22:3000/lingxi/lingxi-business-paltform
into v2
parents
cdd82d9f
6927854a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
283 additions
and
174 deletions
+283
-174
package.json
package.json
+1
-1
index.tsx
src/components/PopConfirmControl/index.tsx
+19
-0
useControlTable.ts
src/hooks/useControlTable.ts
+37
-0
BasicLayout.tsx
src/layouts/BasicLayout.tsx
+2
-1
MenuSlider.tsx
src/layouts/components/MenuSlider.tsx
+1
-0
OuterSide.tsx
src/layouts/components/OuterSide.tsx
+12
-6
index.ts
src/module/channelProductModule/index.ts
+2
-3
index.tsx
src/pages/authConfig/userSystem/index.tsx
+9
-99
useSystemTable.tsx
src/pages/authConfig/userSystem/useSystemTable.tsx
+114
-0
index.less
src/pages/user/index.less
+0
-0
index.ts
src/store/channelProduct/index.ts
+73
-63
index.ts
src/store/product/index.ts
+13
-1
No files found.
package.json
View file @
f19b7121
...
...
@@ -12,7 +12,7 @@
"api"
:
"god-ytt"
,
"scripts:build"
:
"node scripts/run"
,
"scripts:build-yxc"
:
"node scripts/run http://yxc-web-demo.shushangyun.com/api"
,
"start:dev"
:
"
umi dev
"
,
"start:dev"
:
"
cross-env NODE_OPTIONS=--max_old_space_size=4096 umi dev
"
,
"start:analyze"
:
"ANALYZE=1 umi dev"
,
"clean"
:
"rimraf node_modules"
,
"start"
:
"yarn api && yarn scripts:build && cross-env NODE_OPTIONS=--max_old_space_size=4096 umi dev"
,
...
...
src/components/PopConfirmControl/index.tsx
0 → 100644
View file @
f19b7121
import
{
Popconfirm
,
PopconfirmProps
}
from
'antd'
import
React
from
'react'
export
interface
PopConfirmControlProps
extends
Partial
<
PopconfirmProps
>
{
visible
?:
boolean
}
const
PopConfirmControl
:
React
.
FC
<
PopConfirmControlProps
>
=
(
props
)
=>
{
const
{
visible
=
true
,
children
,
...
restProps
}
=
props
return
<
Popconfirm
title=
"确定要执行这个操作?"
okText=
"是"
cancelText=
"否"
{
...
restProps
}
>
{
children
}
</
Popconfirm
>
}
export
default
PopConfirmControl
src/hooks/useControlTable.ts
0 → 100644
View file @
f19b7121
import
{
useCallback
}
from
"react"
interface
ControlTableOptions
{
update
?:
any
,
remove
?:
any
,
preview
?:
any
,
changeStatus
?:
any
,
}
const
emptyFn
=
()
=>
{}
const
useControlTable
=
(
options
:
ControlTableOptions
)
=>
{
const
{
update
=
emptyFn
,
remove
=
emptyFn
,
preview
=
emptyFn
,
changeStatus
=
emptyFn
}
=
options
const
handleUpdate
=
useCallback
(()
=>
{
},
[])
const
handleRemove
=
useCallback
(()
=>
{
},
[])
const
handlePreview
=
useCallback
(()
=>
{
},
[])
const
handleChangeStatus
=
useCallback
(()
=>
{
},
[])
return
{
handleUpdate
,
handleRemove
,
handlePreview
,
handleChangeStatus
}
}
src/layouts/BasicLayout.tsx
View file @
f19b7121
...
...
@@ -152,7 +152,7 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
minWidth
:
'1280px'
,
}
:
{}
console
.
log
(
currentRouter
)
return
currentRouter
.
noLayout
?
props
.
children
:
(
<
ProLayout
pageTitleRender=
{
()
=>
currentRouter
?
currentRouter
.
name
:
window
.
location
.
href
}
...
...
@@ -179,6 +179,7 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
menuData=
{
menuData
}
pathname=
{
location
.
pathname
}
collapseState=
{
collapsed
}
currentRouter=
{
currentRouter
}
changeOpenKeys=
{
(
keys
:
string
[])
=>
setOpenKeys
(
keys
)
}
/>
}
footerRender=
{
()
=>
defaultFooterDom
}
...
...
src/layouts/components/MenuSlider.tsx
View file @
f19b7121
...
...
@@ -20,6 +20,7 @@ export interface MenuSliderProps {
currentSelectKey
:
string
[];
openKeys
:
string
[];
changeOpenKeys
:
Function
;
currentRouter
:
any
;
}
const
MenuSlider
:
React
.
FC
<
MenuSliderProps
>
=
(
props
)
=>
{
...
...
src/layouts/components/OuterSide.tsx
View file @
f19b7121
...
...
@@ -13,12 +13,13 @@ const { Sider } = Layout
export
interface
OuterSiderProps
{
menuData
:
Array
<
any
>
;
pathname
:
string
|
undefined
;
UserStore
?:
any
currentRouter
:
any
,
UserStore
?:
any
,
}
const
OuterSider
:
React
.
FC
<
OuterSiderProps
>
=
observer
((
props
)
=>
{
const
{
menuData
,
pathname
=
"/"
}
=
props
const
{
menuData
,
pathname
=
"/"
,
currentRouter
}
=
props
const
authRouters
=
getRouters
()
let
defaultSelectedKeys
=
""
...
...
@@ -33,14 +34,19 @@ const OuterSider: React.FC<OuterSiderProps> = observer((props) => {
const
getSubMenu
=
()
=>
{
const
subHeadMenus
:
Array
<
any
>
=
[]
menuData
.
forEach
(
item
=>
{
if
(
pathname
.
indexOf
(
item
.
key
)
>
-
1
)
{
defaultSelectedKeys
=
item
.
key
// 为适配pass菜单自由组合变更, 使用code进行高亮显示
const
code
=
currentRouter
.
relationParentCode
console
.
log
(
code
,
item
.
relationParentCode
)
if
(
code
&&
code
===
item
.
relationParentCode
)
{
defaultSelectedKeys
=
item
.
relationParentCode
}
!
item
.
hideInMenu
&&
isAuthPath
(
item
.
path
)
&&
subHeadMenus
.
push
({
path
:
item
.
path
,
title
:
item
.
name
,
icon
:
item
.
icon
,
key
:
item
.
key
key
:
item
.
key
,
// 新增code属性 用于辨别子菜单是否属于该菜单下的属性
relationParentCode
:
item
.
relationParentCode
,
})
})
return
subHeadMenus
...
...
@@ -60,7 +66,7 @@ const OuterSider: React.FC<OuterSiderProps> = observer((props) => {
<
ul
className=
{
styles
.
menuBox
}
>
{
siderMenu
.
map
(
item
=>
(
!
item
.
hideInMenu
&&
<
li
key=
{
item
.
key
}
className=
{
defaultSelectedKeys
===
item
.
key
?
styles
.
currentItem
:
''
}
>
!
item
.
hideInMenu
&&
<
li
key=
{
item
.
key
}
className=
{
defaultSelectedKeys
===
item
.
relationParentCode
?
styles
.
currentItem
:
''
}
>
<
Link
to=
{
item
.
path
}
>
<
CustomIcon
type=
{
item
.
icon
}
style=
{
{
width
:
20
,
height
:
20
}
}
/>
<
label
>
{
item
.
title
}
</
label
>
...
...
src/module/channelProductModule/index.ts
View file @
f19b7121
import
{
GetProductChannelCommodityGetCommodityUnitPriceResponse
}
from
'@/services'
;
import
{
GetProductChannelCommodityGetCommodityUnitPriceResponse
}
from
'@/services
/ProductV2Api
'
;
export
interface
IRole
{
key
:
string
;
...
...
@@ -29,4 +29,4 @@ export interface IChannelProductModule {
setTableDataInSetPrice
(
data
:
GetProductChannelCommodityGetCommodityUnitPriceResponse
[]):
void
;
setSelectChannel
(
data
:
any
):
void
;
setSelectSource
(
data
:
number
):
void
;
}
\ No newline at end of file
}
src/pages/authConfig/userSystem/index.tsx
View file @
f19b7121
...
...
@@ -9,13 +9,13 @@ import {
EyeOutlined
}
from
'@ant-design/icons'
;
import
{
StandardTable
}
from
'god'
import
{
ColumnType
}
from
'antd/lib/table/interface'
import
{
IButtonFilter
,
IFormFilter
}
from
'god/dist/src/standard-table/TableController'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
EyePreview
from
'@/components/EyePreview'
;
import
StatusSwitch
from
'@/components/StatusSwitch'
;
import
{
STATUS_ENUM
}
from
'@/constants'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
useSysetemTable
from
'./useSystemTable'
;
// 模拟请求
const
fetchData
=
async
(
params
)
=>
{
...
...
@@ -24,108 +24,18 @@ const fetchData = async (params) => {
}
const
UserSystem
:
React
.
FC
<
{}
>
=
()
=>
{
const
ref
=
useRef
<
any
>
({})
const
addItem
=
()
=>
{
history
.
push
(
'/memberCenter/systemSetting/authConfig/userSystem/add'
)
}
const
deleteItem
=
(
record
)
=>
{
// 删除该项
PublicApi
.
postMemberUserDelete
({
userId
:
record
.
userId
}).
then
(()
=>
{
ref
.
current
.
reload
()
})
}
const
updateItem
=
(
record
)
=>
{
history
.
push
(
`/memberCenter/systemSetting/authConfig/userSystem/edit?id=
${
record
.
userId
}
&preview=0`
)
}
const
handleStatus
=
(
record
)
=>
{
PublicApi
.
postMemberUserUpdatestatus
({
userId
:
record
.
userId
,
status
:
record
.
status
===
1
?
0
:
1
}).
then
(
res
=>
{
ref
.
current
.
reload
()
})
}
const
columns
:
ColumnType
<
any
>
[]
=
[
{
title
:
'账号'
,
dataIndex
:
'account'
,
align
:
'center'
,
key
:
'account'
,
className
:
'commonPickColor'
,
render
:
(
text
,
record
)
=>
<
EyePreview
url=
{
`/memberCenter/systemSetting/authConfig/userSystem/detail?id=${record.userId}&preview=1`
}
>
{
text
}
</
EyePreview
>
},
{
title
:
'用户姓名'
,
dataIndex
:
'name'
,
align
:
'center'
,
key
:
'name'
,
},
{
title
:
'所属机构'
,
dataIndex
:
'orgName'
,
align
:
'center'
,
key
:
'orgName'
},
{
title
:
'绑定手机号码'
,
align
:
'center'
,
dataIndex
:
'phone'
,
key
:
'phone'
,
},
{
title
:
'所属角色'
,
align
:
'center'
,
dataIndex
:
'roleName'
,
key
:
'roleName'
,
},
{
title
:
'最后登录时间'
,
align
:
'center'
,
dataIndex
:
'lastLoginTime'
,
key
:
'lastLoginTime'
,
},
{
title
:
'状态'
,
align
:
'center'
,
dataIndex
:
'status'
,
key
:
'status'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
StatusSwitch
handleConfirm=
{
()
=>
handleStatus
(
record
)
}
record=
{
record
}
/>
},
{
title
:
'操作'
,
dataIndex
:
'option'
,
align
:
'center'
,
render
:
(
text
:
any
,
record
:
any
)
=>
{
return
(
<>
{
record
.
status
===
0
&&
<
Popconfirm
title=
"确定要执行这个操作?"
onConfirm=
{
()
=>
deleteItem
(
record
)
}
okText=
"是"
cancelText=
"否"
>
<
Button
type=
'link'
>
删除
</
Button
>
</
Popconfirm
>
}
<
Button
type=
'link'
onClick=
{
()
=>
updateItem
(
record
)
}
>
修改
</
Button
>
</>
)
}
}
];
const
{
dataRef
,
tableRef
,
addItem
}
=
useSysetemTable
()
return
(
<
PageHeaderWrapper
>
<
Card
className=
"common-wrapper"
>
<
StandardTable
columns=
{
columns
}
currentRef=
{
ref
}
columns=
{
dataRef
.
current
.
columns
}
currentRef=
{
tableRef
.
current
}
fetchTableData=
{
(
params
:
any
)
=>
fetchData
(
params
)
}
formilyLayouts=
{
{
justify
:
'space-between'
...
...
@@ -143,7 +53,7 @@ const UserSystem: React.FC<{}> = () => {
ctx
:
{
effects
:
(
$
)
=>
{
$
(
'onFieldInputChange'
,
'status'
).
subscribe
(()
=>
{
r
ef
.
current
.
reload
()
tableR
ef
.
current
.
reload
()
})
},
schema
:
{
...
...
src/pages/authConfig/userSystem/useSystemTable.tsx
0 → 100644
View file @
f19b7121
import
React
,
{
useRef
}
from
'react'
import
EyePreview
from
"@/components/EyePreview"
;
import
StatusSwitch
from
'@/components/StatusSwitch'
;
import
{
Button
}
from
'antd'
;
import
PopConfirmControl
from
'@/components/PopConfirmControl'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
history
}
from
'umi'
const
useSysetemTable
=
()
=>
{
const
tableRef
=
useRef
<
any
>
({})
const
dataRef
=
useRef
<
any
>
({
columns
:
[
{
title
:
'账号'
,
dataIndex
:
'account'
,
align
:
'center'
,
key
:
'account'
,
className
:
'commonPickColor'
,
render
:
(
text
,
record
)
=>
<
EyePreview
url=
{
`/memberCenter/systemSetting/authConfig/userSystem/detail?id=${record.userId}&preview=1`
}
>
{
text
}
</
EyePreview
>
},
{
title
:
'用户姓名'
,
dataIndex
:
'name'
,
align
:
'center'
,
key
:
'name'
,
},
{
title
:
'所属机构'
,
dataIndex
:
'orgName'
,
align
:
'center'
,
key
:
'orgName'
},
{
title
:
'绑定手机号码'
,
align
:
'center'
,
dataIndex
:
'phone'
,
key
:
'phone'
,
},
{
title
:
'所属角色'
,
align
:
'center'
,
dataIndex
:
'roleName'
,
key
:
'roleName'
,
},
{
title
:
'最后登录时间'
,
align
:
'center'
,
dataIndex
:
'lastLoginTime'
,
key
:
'lastLoginTime'
,
},
{
title
:
'状态'
,
align
:
'center'
,
dataIndex
:
'status'
,
key
:
'status'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
StatusSwitch
handleConfirm=
{
()
=>
handleStatus
(
record
)
}
record=
{
record
}
/>
},
{
title
:
'操作'
,
dataIndex
:
'option'
,
align
:
'center'
,
render
:
(
text
:
any
,
record
:
any
)
=>
{
return
(
<>
<
PopConfirmControl
onConfirm=
{
()
=>
deleteItem
(
record
)
}
visible=
{
record
.
status
===
0
}
>
<
Button
type=
'link'
>
删除
</
Button
>
</
PopConfirmControl
>
<
Button
type=
'link'
onClick=
{
()
=>
updateItem
(
record
)
}
>
修改
</
Button
>
</>
)
}
}
]
})
const
addItem
=
()
=>
{
history
.
push
(
'/memberCenter/systemSetting/authConfig/userSystem/add'
)
}
const
deleteItem
=
(
record
)
=>
{
// 删除该项
PublicApi
.
postMemberUserDelete
({
userId
:
record
.
userId
}).
then
(()
=>
{
tableRef
.
current
.
reload
()
})
}
const
updateItem
=
(
record
)
=>
{
history
.
push
(
`/memberCenter/systemSetting/authConfig/userSystem/edit?id=
${
record
.
userId
}
&preview=0`
)
}
const
handleStatus
=
(
record
)
=>
{
PublicApi
.
postMemberUserUpdatestatus
({
userId
:
record
.
userId
,
status
:
record
.
status
===
1
?
0
:
1
}).
then
(
res
=>
{
tableRef
.
current
.
reload
()
})
}
return
{
tableRef
,
dataRef
,
addItem
,
}
}
export
default
useSysetemTable
src/pages/user/index.less
View file @
f19b7121
This diff is collapsed.
Click to expand it.
src/store/channelProduct/index.ts
View file @
f19b7121
import
{
action
,
computed
,
observable
,
runInAction
}
from
'mobx'
import
{
IChannelProductModule
,
IRole
,
IChannel
}
from
'@/module/channelProductModule'
;
/**
* 渠道直采商品
*/
class
ChannelProductStore
implements
IChannelProductModule
{
// 选择商品区块
@
observable
public
productSourceInStore
:
number
=
1
;
@
observable
public
productSelectRowInStore
:
any
=
null
;
@
observable
public
priceType
:
number
=
null
;
@
observable
public
productName
:
string
=
null
;
@
observable
public
tableDataInSetPrice
:
any
[]
=
null
;
@
observable
public
selectedRole
:
IRole
=
null
;
@
observable
public
selectChannel
:
any
=
null
;
@
observable
public
selectedSource
:
number
=
1
;
@
action
.
bound
public
setProductSourceInStore
(
data
:
number
)
{
this
.
productSourceInStore
=
data
;
}
@
action
.
bound
public
setProductSelectRowInStore
(
data
:
any
)
{
this
.
productSelectRowInStore
=
data
;
}
@
action
.
bound
public
setPriceType
(
data
:
number
){
this
.
priceType
=
data
;
}
@
action
.
bound
public
setProductName
(
data
:
string
){
this
.
productName
=
data
;
}
@
action
.
bound
public
setTableDataInSetPrice
(
data
:
any
[]){
this
.
tableDataInSetPrice
=
data
;
}
@
action
.
bound
public
setSelectedRole
(
data
:
IRole
){
this
.
selectedRole
=
data
;
}
@
action
.
bound
public
setSelectChannel
(
data
:
any
[]){
this
.
selectChannel
=
data
}
@
action
.
bound
public
setSelectSource
(
data
:
number
){
this
.
selectedSource
=
data
}
}
export
default
ChannelProductStore
import
{
action
,
computed
,
observable
,
runInAction
}
from
'mobx'
import
{
IChannelProductModule
}
from
'@/module/channelProductModule'
;
export
interface
IRole
{
key
:
string
;
value
:
number
;
children
:
string
;
}
export
interface
IChannel
{
name
:
string
;
memberId
?:
number
;
}
/**
* 渠道直采商品
*/
class
ChannelProductStore
implements
IChannelProductModule
{
// 选择商品区块
@
observable
public
productSourceInStore
:
number
=
1
;
@
observable
public
productSelectRowInStore
:
any
=
null
;
@
observable
public
priceType
:
number
=
null
;
@
observable
public
productName
:
string
=
null
;
@
observable
public
tableDataInSetPrice
:
any
[]
=
null
;
@
observable
public
selectedRole
:
IRole
=
null
;
@
observable
public
selectChannel
:
any
=
null
;
@
observable
public
selectedSource
:
number
=
1
;
@
action
.
bound
public
setProductSourceInStore
(
data
:
number
)
{
this
.
productSourceInStore
=
data
;
}
@
action
.
bound
public
setProductSelectRowInStore
(
data
:
any
)
{
this
.
productSelectRowInStore
=
data
;
}
@
action
.
bound
public
setPriceType
(
data
:
number
){
this
.
priceType
=
data
;
}
@
action
.
bound
public
setProductName
(
data
:
string
){
this
.
productName
=
data
;
}
@
action
.
bound
public
setTableDataInSetPrice
(
data
:
any
[]){
this
.
tableDataInSetPrice
=
data
;
}
@
action
.
bound
public
setSelectedRole
(
data
:
IRole
){
this
.
selectedRole
=
data
;
}
@
action
.
bound
public
setSelectChannel
(
data
:
any
[]){
this
.
selectChannel
=
data
}
@
action
.
bound
public
setSelectSource
(
data
:
number
){
this
.
selectedSource
=
data
}
}
export
default
ChannelProductStore
src/store/product/index.ts
View file @
f19b7121
import
{
action
,
computed
,
observable
,
runInAction
}
from
'mobx'
import
{
IProductModule
,
IProductSelectAttribute
,
IBasicFormParam
,
IPriceAttributeParam
,
IOtherParam
,
IDecsParams
,
IPage
}
from
'@/module/productModule'
;
// mobx要用到的数据类型
import
{
IProductModule
,
IProductSelectAttribute
,
IBasicFormParam
,
IPriceAttributeParam
,
IOtherParam
}
from
'@/module/productModule'
;
// mobx要用到的数据类型
export
interface
IPage
{
current
:
number
;
pageSize
:
number
;
}
export
interface
IDecsParams
{
id
?:
number
;
video
:
string
[];
image
:
string
[]
;
word
:
string
[];
}
class
ProductStore
implements
IProductModule
{
@
observable
public
attributeLists
:
any
[]
=
[];
...
...
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