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
17a037df
Commit
17a037df
authored
Aug 04, 2020
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save
parent
6b3a0258
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
152 additions
and
34 deletions
+152
-34
base.config.json
config/base.config.json
+0
-0
commodityRoute.ts
config/routes/commodityRoute.ts
+3
-1
index.ts
config/routes/index.ts
+0
-1
demo.js
demo.js
+4
-0
app.tsx
src/app.tsx
+29
-13
index.tsx
src/components/AuthWrapper/index.tsx
+19
-0
MultTable.tsx
src/components/NiceForm/components/MultTable.tsx
+3
-3
Search.tsx
src/components/NiceForm/components/Search.tsx
+1
-0
index.tsx
src/components/NiceForm/index.tsx
+3
-3
global.d.ts
src/global/config/global.d.ts
+10
-0
useRowSelectionTable.ts
src/hooks/useRowSelectionTable.ts
+36
-0
OuterSide.tsx
src/layouts/components/OuterSide.tsx
+2
-3
document.ejs
src/pages/document.ejs
+1
-1
addRepository.tsx
src/pages/repositories/addRepository.tsx
+0
-0
index.less
src/pages/repositories/index.less
+17
-0
index.tsx
src/pages/repositories/schema/index.tsx
+18
-7
LoginWrap.tsx
src/pages/user/components/LoginWrap.tsx
+4
-0
index.tsx
src/store/index.tsx
+2
-2
No files found.
config/base.config.json
View file @
17a037df
This diff is collapsed.
Click to expand it.
config/routes/commodityRoute.ts
View file @
17a037df
...
...
@@ -7,10 +7,11 @@
*/
const
CommodityRoute
=
{
// 商品能力
path
:
'/memberCenter/commodityAbility'
,
name
:
'commodityAbility'
,
key
:
'commodityAbility'
,
icon
:
'smile'
,
menuCode
:
''
,
routes
:
[
{
path
:
'/memberCenter/commodityAbility/classAndProperty'
,
...
...
@@ -21,6 +22,7 @@ const CommodityRoute = {
path
:
'/memberCenter/commodityAbility/classAndProperty/class'
,
name
:
'class'
,
icon
:
'smile'
,
menuCode
:
'/memberCenter/commodityAbility/classAndProperty/class'
,
component
:
'@/pages/classAndProperty/class'
,
},
{
...
...
config/routes/index.ts
View file @
17a037df
...
...
@@ -25,7 +25,6 @@ const memberCenterRoute = {
redirect
:
'/memberCenter/shopAbility/infoManage'
},
{
// 首页
path
:
`/memberCenter/home`
,
name
:
'home'
,
icon
:
'smile'
,
...
...
demo.js
View file @
17a037df
...
...
@@ -25,6 +25,10 @@ const mockData = {
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'
},
]
}
}
...
...
src/app.tsx
View file @
17a037df
...
...
@@ -8,9 +8,21 @@ import '@/global/styles/global.less'; // 导入全局样式
// 默认引入所有的ant样式, 不引入css因为无法做到变量覆盖
import
'antd/dist/antd.less'
import
{
setup
}
from
'@formily/antd-components'
;
import
{
GlobalConfig
}
from
'./global/config'
;
setup
()
let
extraRoutes
=
[]
const
mockFetchData
=
()
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
resolve
([
{
menuCode
:
'/memberCenter/commodityAbility'
},
{
menuCode
:
'/memberCenter/commodityAbility/classAndProperty/class'
},
])
},
2000
)
})
}
let
extraRoutes
:
any
[]
=
[]
/**
* @description 配置函数,对已配置的路由做修改, 一般与render函数一起结合可根据接口动态配置路由
...
...
@@ -27,7 +39,8 @@ let extraRoutes = []
*
*/
// export function patchRoutes({ routes }: IRoutes) {
// routes.concat(extraRoutes as [])
// GlobalConfig.global.menuList.map(v => v.menuCode)
// console.log(routes)
// }
...
...
@@ -38,19 +51,22 @@ let extraRoutes = []
* @export
*/
// export function render(oldRender:Function) {
// // 做动态路由
// fetch('/api').then((res: any) => {
// extraRoutes = res.routes
// mockFetchData().then((res: any[]) => {
// extraRoutes = res
// })
// // 做动态路由
// // fetch('/api').then((res: any) => {
// // extraRoutes = res.routes
// // })
// // 做权限校验
// fetch('/auth').then((res: any) => {
// if (res.isLogin) {
// oldRender()
// } else {
// history.push('/login')
// }
// })
// //
//
做权限校验
//
//
fetch('/auth').then((res: any) => {
//
//
if (res.isLogin) {
//
//
oldRender()
//
//
} else {
//
//
history.push('/login')
//
//
}
//
//
})
// }
...
...
src/components/AuthWrapper/index.tsx
0 → 100644
View file @
17a037df
import
React
from
'react'
// 从pass平台获取所有菜单列表的集合
const
authList
=
[]
/**
* @description 对组件级别进行权限控制,只有当传入的preId复合存在authList中,才显示
*
*/
export
const
AuthWrapper
=
(
props
)
=>
{
const
{
preId
,
children
}
=
props
const
result
=
authList
.
includes
(
preId
)
return
result
?
children
:
null
}
export
default
AuthWrapper
\ No newline at end of file
src/components/NiceForm/components/MultTable.tsx
View file @
17a037df
...
...
@@ -3,13 +3,13 @@ import { Input, Space, Button, Table } from 'antd'
import
{
PlusOutlined
}
from
'@ant-design/icons'
const
MultTable
=
(
props
)
=>
{
const
{
columns
}
=
props
.
props
[
'x-component-props'
]
const
{
columns
,
prefix
,
rowKey
}
=
props
.
props
[
'x-component-props'
]
const
value
=
props
.
value
||
[]
return
(
<
div
style=
{
{
width
:
'100%'
}
}
>
<
Button
block
icon=
{
<
PlusOutlined
/>
}
type=
'dashed'
>
选择指定会员
</
Button
>
{
prefix
}
<
Table
rowKey=
'id'
rowKey=
{
rowKey
||
'id'
}
columns=
{
columns
}
dataSource=
{
value
}
/>
...
...
src/components/NiceForm/components/Search.tsx
View file @
17a037df
...
...
@@ -26,6 +26,7 @@ const Search = (props) => {
filterSearch
:
!
state
.
filterSearch
})
}
return
(
<
Space
size=
{
20
}
style=
{
{
justifyContent
:
'flex-end'
,
width
:
'100%'
}
}
>
<
Input
.
Search
...
...
src/components/NiceForm/index.tsx
View file @
17a037df
import
React
from
'react'
import
SchemaForm
,
{
IAntdSchemaFormProps
,
createFormActions
,
FormPath
,
SchemaField
}
from
'@formily/antd'
import
SchemaForm
,
{
IAntdSchemaFormProps
}
from
'@formily/antd'
import
{
Button
,
Space
}
from
'antd'
;
import
CustomUpload
from
'./components/CustomUpload'
;
import
CustomStatus
from
'./components/CustomStatus'
;
...
...
@@ -10,7 +10,7 @@ import Submit from './components/Submit';
import
Text
from
'./components/Text'
;
import
CardCheckBox
from
'./components/CardCheckBox'
;
import
MultTable
from
'./components/MultTable'
;
import
{
setup
,
FormTab
}
from
'@formily/antd-components'
;
export
interface
NiceFormProps
extends
IAntdSchemaFormProps
{
}
...
...
@@ -25,7 +25,7 @@ const NiceForm:React.FC<NiceFormProps> = (props) => {
Submit
,
Text
,
CardCheckBox
,
MultTable
MultTable
,
}
const
defineComponents
=
Object
.
assign
(
customComponents
,
components
)
...
...
src/global/config/global.d.ts
View file @
17a037df
...
...
@@ -41,9 +41,19 @@ export interface CountryList {
icon
:
string
;
}
export
interface
Children
{
code
:
string
;
}
export
interface
MenuList
{
code
:
string
;
children
:
Children
[];
}
export
interface
Global
{
logo
:
string
;
countryList
:
CountryList
[];
menuList
:
MenuList
[];
}
export
interface
RootObject
{
...
...
src/hooks/useRowSelectionTable.ts
0 → 100644
View file @
17a037df
import
{
useState
}
from
'react'
import
{
TableRowSelection
}
from
'antd/es/table/interface'
interface
useRowSelectionTableCtl
{
selectRow
:
any
[],
selectedRowKeys
:
any
[],
setSelectRow
(
rows
:
any
[]),
setSelectedRowKeys
(
rows
:
any
)
}
interface
useRowSelectionOptions
{
type
?:
'checkbox'
|
'radio'
}
/**
* 用于处理table 多选或者单选时的hooks
* @auth xjm
*/
export
const
useRowSelectionTable
=
(
options
:
useRowSelectionOptions
=
{}):
[
TableRowSelection
<
any
>
,
useRowSelectionTableCtl
]
=>
{
const
{
type
=
'checkbox'
}
=
options
const
[
selectRow
,
setSelectRow
]
=
useState
<
any
[]
>
([])
// 模态框选择的行数据
const
[
selectedRowKeys
,
setSelectedRowKeys
]
=
useState
<
any
[]
>
(()
=>
[])
const
rowSelection
=
{
selectedRowKeys
:
selectedRowKeys
,
type
,
onChange
:
(
selectedRowKeys
:
any
,
selectedRows
:
any
)
=>
{
setSelectRow
(
selectedRows
);
setSelectedRowKeys
(
selectedRowKeys
);
}
}
return
[
rowSelection
,
{
selectRow
,
setSelectRow
,
selectedRowKeys
,
setSelectedRowKeys
}]
}
\ No newline at end of file
src/layouts/components/OuterSide.tsx
View file @
17a037df
...
...
@@ -20,8 +20,7 @@ const OuterSider: React.FC<OuterSiderProps> = (props) => {
if
(
pathname
.
indexOf
(
item
.
key
)
>
-
1
)
{
defaultSelectedKeys
=
item
.
key
}
subHeadMenus
.
push
({
!
item
.
hideInMenu
&&
subHeadMenus
.
push
({
path
:
item
.
path
,
title
:
item
.
name
,
icon
:
item
.
icon
,
...
...
@@ -38,7 +37,7 @@ const OuterSider: React.FC<OuterSiderProps> = (props) => {
<
ul
className=
{
styles
.
menuBox
}
>
{
siderMunu
.
map
(
item
=>
(
<
li
key=
{
item
.
key
}
className=
{
defaultSelectedKeys
===
item
.
key
?
styles
.
currentItem
:
''
}
>
!
item
.
hideInMenu
&&
<
li
key=
{
item
.
key
}
className=
{
defaultSelectedKeys
===
item
.
key
?
styles
.
currentItem
:
''
}
>
<
Link
to=
{
item
.
path
}
>
<
AppstoreOutlined
/>
<
label
>
{
item
.
title
}
</
label
>
...
...
src/pages/document.ejs
View file @
17a037df
...
...
@@ -3,7 +3,7 @@
<head>
<meta
charset=
"UTF-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"ie=edge"
>
<title>
God-Template
</title>
<title>
瓴犀开放平台
</title>
</head>
<body>
<div
id=
"root"
></div>
...
...
src/pages/repositories/addRepository.tsx
View file @
17a037df
This diff is collapsed.
Click to expand it.
src/pages/repositories/index.less
View file @
17a037df
.addRepository {
.ant-input-group-addon {
padding: 0;
border: none;
}
.connectBtn {
width: 80px;
height: 32px;
line-height: 32px;
background: #6B778C;
color: #fff;
text-align: center;
cursor: pointer;
}
}
// 添加仓位
.storeItemRadio{
display: flex;
...
...
src/pages/repositories/schema/index.tsx
View file @
17a037df
...
...
@@ -105,6 +105,13 @@ export const repositDetailSchema: ISchema = {
productName
:
{
type
:
'string'
,
title
:
'商品名称'
,
"x-mega-props"
:
{
full
:
true
},
"x-component-props"
:
{
disabled
:
true
,
addonAfter
:
"{{connectProduct}}"
},
required
:
true
},
warehouseId
:
{
...
...
@@ -154,7 +161,6 @@ export const repositDetailSchema: ISchema = {
"x-component-props"
:
{
"tab"
:
"适用商城"
},
"properties"
:
{
MEGA_LAYOUT2
:
{
type
:
'object'
,
...
...
@@ -206,17 +212,22 @@ export const repositDetailSchema: ISchema = {
"title"
:
"选择渠道会员"
,
default
:
1
,
required
:
true
,
"x-linkages"
:
[
{
type
:
'value:visible'
,
target
:
'applyMember'
,
"condition"
:
"{{!$value}}"
}
]
},
applyMember
:
{
type
:
'array:number'
,
"x-component"
:
'MultTable'
,
"x-component-props"
:
{
columns
:
"{{tableColumns}}"
},
default
:
[
{
id
:
1
,
name
:
'名称'
,
type
:
'类型'
},
{
id
:
2
,
name
:
'名称1'
,
type
:
'类型1'
}
]
rowKey
:
'memberId'
,
columns
:
"{{tableColumns}}"
,
prefix
:
"{{tableAddButton}}"
}
}
}
}
...
...
src/pages/user/components/LoginWrap.tsx
View file @
17a037df
...
...
@@ -6,6 +6,7 @@ import {
ExclamationCircleFilled
}
from
'@ant-design/icons'
;
import
styles
from
'../index.less'
import
{
PublicApi
}
from
'@/services/api'
;
const
LoginWrap
:
React
.
FC
=
()
=>
{
const
[
validFrame
,
setValidFrame
]
=
useState
(
false
)
...
...
@@ -13,6 +14,9 @@ const LoginWrap: React.FC = () => {
const
finish
=
(
value
:
any
)
=>
{
console
.
log
(
value
)
PublicApi
.
postMemberLogin
(
value
).
then
(
res
=>
{
console
.
log
(
res
)
})
}
return
(
...
...
src/store/index.tsx
View file @
17a037df
...
...
@@ -3,7 +3,7 @@ import ThemeStore from './theme'
import
ProductStroe
from
'./product'
import
React
from
'react'
;
import
{
Provider
}
from
'mobx-react'
import
{
I
User
Module
}
from
'@/module/userModule'
;
import
{
I
Login
Module
}
from
'@/module/userModule'
;
import
{
IProductModule
}
from
'@/module/productModule'
// import { ProductContext } from '@/pages/commodity/products/addProducts';
...
...
@@ -23,7 +23,7 @@ import { IProductModule } from '@/module/productModule'
*/
export
interface
IStore
{
userStore
:
I
User
Module
;
userStore
:
I
Login
Module
;
ProductStore
:
IProductModule
;
}
...
...
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