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
a7dcfc6d
Commit
a7dcfc6d
authored
Aug 27, 2020
by
GuanHua
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://10.0.0.22:3000/lingxi/lingxi-business-paltform
into dev
parents
2067b652
bf75e844
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
166 additions
and
111 deletions
+166
-111
.gitignore
.gitignore
+4
-0
index.js
scripts/services/index.js
+31
-3
app.tsx
src/app.tsx
+1
-1
index.tsx
src/components/ModalTable/index.tsx
+1
-1
SearchSelect.tsx
src/components/NiceForm/components/SearchSelect.tsx
+3
-0
global.d.ts
src/global/config/global.d.ts
+0
-58
global.less
src/global/styles/global.less
+10
-0
PositionSetting.tsx
src/pages/repositories/components/PositionSetting.tsx
+70
-4
api.ts
src/services/api.ts
+20
-2
ytt.config.ts
ytt.config.ts
+26
-42
No files found.
.gitignore
View file @
a7dcfc6d
...
...
@@ -27,3 +27,6 @@
/src/services/index.ts
.vscode
config/base.config.json
src/global/config/global.d.ts
src/services/*Api.ts
\ No newline at end of file
scripts/services/index.js
View file @
a7dcfc6d
...
...
@@ -82,19 +82,47 @@ async function batchAxiosHttps() {
// }
// }
// serverFn(asyncHttpQueue)
const
httpErrorQueue
=
[]
const
serverErrorQueue
=
[]
console
.
log
(
'
\
n'
)
for
(
const
item
in
serviceConfig
)
{
if
(
JSON
.
stringify
(
item
)
!==
'{}'
){
for
(
const
subItem
in
serviceConfig
[
item
])
{
try
{
const
data
=
await
axios
(
serviceConfig
[
item
][
subItem
])
asyncHttpQueue
[
item
][
subItem
]
=
data
.
data
.
data
// 当接口出错时 不写入json文件
if
(
data
.
data
.
code
===
1000
)
{
asyncHttpQueue
[
item
][
subItem
]
=
data
.
data
.
data
}
else
{
serverErrorQueue
.
push
({
...
asyncHttpQueue
[
item
][
subItem
],
...
data
.
data
})
// 默认置为null
asyncHttpQueue
[
item
][
subItem
]
=
null
}
}
catch
(
err
)
{
console
.
log
(
serviceConfig
[
item
][
subItem
].
url
)
console
.
log
(
err
.
response
.
data
)
httpErrorQueue
.
push
({...
serviceConfig
[
item
][
subItem
],
...
err
.
response
.
data
})
}
}
}
}
if
(
httpErrorQueue
.
length
>
0
)
{
console
.
log
(
'
\
n网络错误
\
n'
)
// 可在此做日志收集
console
.
log
(
httpErrorQueue
)
}
if
(
serverErrorQueue
.
length
>
0
)
{
console
.
log
(
'
\
n接口服务错误
\
n'
)
// 可在此做日志收集
console
.
log
(
serverErrorQueue
)
}
if
(
httpErrorQueue
.
length
>
0
||
serverErrorQueue
.
length
>
0
)
{
// 退出构建
console
.
log
(
'
\
n脚本构建失败!!!!!!'
)
// 终止当前进程
process
.
exit
(
1
)
}
return
isDemo
?
Object
.
assign
(
asyncHttpQueue
,
await
demoFetch
())
:
asyncHttpQueue
}
...
...
src/app.tsx
View file @
a7dcfc6d
...
...
@@ -29,7 +29,7 @@ const whiteLists = [
'/shop'
,
'/purchaseOnline'
,
'/pointsMall'
,
'/memberCenter'
,
//
'/memberCenter',
'/memberCenter/noAuth'
,
'/commodity'
,
'/shops'
,
...
...
src/components/ModalTable/index.tsx
View file @
a7dcfc6d
...
...
@@ -38,7 +38,7 @@ const ModalTable:React.FC<ModalTableProps> = (props) => {
tableType=
'small'
currentRef=
{
selfRef
}
formRender=
{
(
child
,
ps
)
=>
<
Row
justify=
'space-between'
>
<
Col
>
{
child
}
</
Col
>
<
Col
span=
{
18
}
>
{
child
}
</
Col
>
<
Col
style=
{
{
marginTop
:
4
}
}
>
{
ps
}
</
Col
>
</
Row
>
}
{
...
resetTable
}
...
...
src/components/NiceForm/components/SearchSelect.tsx
View file @
a7dcfc6d
...
...
@@ -128,6 +128,9 @@ const SearchSelect = (props: ISchemaFieldComponentProps) => {
filterOption=
{
false
}
loading=
{
loading
}
options=
{
dataSource
}
getPopupContainer=
{
triggerNode
=>
{
return
triggerNode
}
}
value=
{
props
.
value
}
dropdownRender=
{
originNode
=>
<
SelectContent
confirm=
{
confirm
}
resetField=
{
resetField
}
parentRef=
{
ref
}
handleChange=
{
handleChange
}
multiple=
{
multiple
}
value=
{
props
.
value
}
>
{
originNode
}
</
SelectContent
>
}
{
...
multipleProps
}
...
...
src/global/config/global.d.ts
deleted
100644 → 0
View file @
2067b652
export
interface
MemberType
{
id
:
number
;
typeName
:
string
;
}
export
interface
BusinessType
{
id
:
number
;
typeName
:
string
;
}
export
interface
UseType
{
memberType
:
MemberType
[];
businessType
:
BusinessType
[];
}
export
interface
UserRegister
{
useType
:
UseType
;
}
export
interface
ShopInfo
{
id
:
number
;
name
:
string
;
type
:
number
;
environment
:
number
;
logoUrl
:
string
;
describe
:
string
;
state
:
number
;
url
:
string
;
}
export
interface
Web
{
shopInfo
:
ShopInfo
[];
}
export
interface
PayConfig
{
paymemberConfig
?:
any
;
}
export
interface
CountryList
{
name
:
string
;
key
:
string
;
icon
:
string
;
}
export
interface
Global
{
siteId
:
number
;
siteUrl
:
string
;
logo
:
string
;
countryList
:
CountryList
[];
}
export
interface
RootObject
{
userRegister
:
UserRegister
;
web
:
Web
;
payConfig
:
PayConfig
;
global
:
Global
;
}
\ No newline at end of file
src/global/styles/global.less
View file @
a7dcfc6d
...
...
@@ -206,6 +206,8 @@ h6 {
}
}
.tree-node-circle {
width: 4px;
height: 4px;
...
...
@@ -266,4 +268,11 @@ h6 {
position: absolute;
top: 100%;
font-size: 12px;
}
// 强制覆盖下拉框固定位置
.fixed-ant-selected-down {
.ant-select-dropdown {
top: 36px !important;
}
}
\ No newline at end of file
src/pages/repositories/components/PositionSetting.tsx
View file @
a7dcfc6d
...
...
@@ -15,6 +15,11 @@ import { Button, message } from 'antd'
import
NiceForm
from
'@/components/NiceForm'
import
ModalTable
from
'@/components/ModalTable'
import
{
GlobalConfig
}
from
'@/global/config'
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
import
SearchSelect
from
'@/components/NiceForm/components/SearchSelect'
import
Search
from
'@/components/NiceForm/components/Search'
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
import
Submit
from
'@/components/NiceForm/components/Submit'
export
interface
PositionSettingProps
{
addSchemaAction
:
ISchemaFormActions
,
...
...
@@ -221,9 +226,59 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => {
properties
:
{
name
:
{
type
:
'string'
,
"x-component"
:
'Search'
,
"x-component-props"
:
{
placeholder
:
'请输入商品名称或者ID'
'x-component'
:
'ModalSearch'
,
'x-component-props'
:
{
placeholder
:
'请输入商品名称/ID'
,
align
:
'flex-left'
,
},
},
[
FORM_FILTER_PATH
]:
{
type
:
'object'
,
'x-component'
:
'flex-layout'
,
'x-component-props'
:
{
rowStyle
:
{
flexWrap
:
'nowrap'
,
style
:
{
marginRight
:
0
}
},
colStyle
:
{
marginTop
:
20
,
},
},
properties
:
{
categoryId
:
{
type
:
'string'
,
"x-component"
:
'SearchSelect'
,
"x-component-props"
:
{
placeholder
:
'请选择品类'
,
className
:
'fixed-ant-selected-down'
,
// 该类强制将显示的下拉框出现在select下, 只有这里出现问题, ??
fetchSearch
:
PublicApi
.
getProductSelectGetSelectCategory
,
style
:
{
width
:
160
}
}
},
brandId
:
{
type
:
'string'
,
"x-component"
:
'SearchSelect'
,
"x-component-props"
:
{
placeholder
:
'请选择品牌'
,
fetchSearch
:
PublicApi
.
getProductSelectGetSelectBrand
,
style
:
{
width
:
160
}
}
},
submit
:
{
"x-component"
:
'Submit'
,
"x-mega-props"
:
{
span
:
1
},
"x-component-props"
:
{
children
:
'查询'
}
}
}
}
}
...
...
@@ -282,7 +337,18 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => {
fetchTableData=
{
params
=>
fetchProductList
(
params
)
}
formilyProps=
{
{
ctx
:
{
schema
:
formProduct
}
ctx
:
{
schema
:
formProduct
,
components
:
{
ModalSearch
:
Search
,
SearchSelect
,
Submit
}
,
effects
:
(
$
,
actions
)
=>
{
useStateFilterSearchLinkageEffect
(
$
,
actions
,
'name'
,
FORM_FILTER_PATH
,
);
}
}
}
}
tableProps=
{
{
...
...
src/services/api.ts
View file @
a7dcfc6d
...
...
@@ -4,7 +4,15 @@
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-07-22 10:23:38
*/
import
*
as
Api
from
'./index'
import
*
as
LogisticsApi
from
'./LogisticsApi'
import
*
as
PassApi
from
'./PassApi'
import
*
as
WarehouseApi
from
'./WarehouseApi'
import
*
as
MemberApi
from
'./MemberApi'
import
*
as
ProductApi
from
'./ProductApi'
import
*
as
TemplateApi
from
'./TemplateApi'
import
*
as
PayApi
from
'./PayApi'
import
*
as
SearchApi
from
'./SearchApi'
import
*
as
OrderApi
from
'./OrderApi'
import
request
from
'@/utils/request'
/**
...
...
@@ -15,4 +23,14 @@ export const CustomApi = {
}
// 公共的接口,从yapi拉下
export
const
PublicApi
=
Api
export
const
PublicApi
=
{
...
LogisticsApi
,
...
PassApi
,
...
WarehouseApi
,
...
MemberApi
,
...
ProductApi
,
...
TemplateApi
,
...
PayApi
,
...
SearchApi
,
...
OrderApi
,
}
ytt.config.ts
View file @
a7dcfc6d
/*
* @Author: LeeJiancong
* @Date: 2020-07-22 09:54:50
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-08-24 16:09:13
*/
import
{
Config
}
from
'god-yapi2ts'
const
tokens
=
[
'b063a0a29fb1a570d9f00eaabbdd8ccfe8e6e10e24739441990cc1098e79b601'
,
// 业务中台管理平台
'7c8f235d95f6224ceb97c4d832b09658f9a75fb8721a95699b230af0733d7fa4'
,
// 仓库服务
'8d14d945507d1f8cd89afe139ca6d111bbad25f702fafe0aec59d3c9cd2e0ffe'
,
// 物流服务
'3a46198c5b97ac7147e5b07ad2dff5ac5c93c1afed47e1911961db87149e6ebf'
,
// 商户会员管理服务
'efe99e20ed1375dc0db3e809e4fc7692f42ecebaf60cd77e65c50ed65d6ba6c4'
,
// 商品服务
'7ec923520215c7e2f771867cb4d29cafbf823daf0fb2d3d9fa70b57a523c8bfb'
,
// 店铺服务
'c789e0e56ee8a8cc2fbd85f930eb2928c58fc1014583c6643acf29cff954da49'
,
// 支付服务
'ca19f532efba91f7773cbfbd526b798c6ac83df670071e97d72c50dca1d53a48'
,
// 搜索服务
'5de0aaeaac12c8d911d86dada6cd128993e34cd6e13135fa79246aa5979a2bcd'
//订单服务
const
tokenList
=
[
{
name
:
'Pass'
,
token
:
'b063a0a29fb1a570d9f00eaabbdd8ccfe8e6e10e24739441990cc1098e79b601'
},
// 业务中台管理平台
{
name
:
'Warehouse'
,
token
:
'7c8f235d95f6224ceb97c4d832b09658f9a75fb8721a95699b230af0733d7fa4'
},
// 仓库服务
{
name
:
'Logistics'
,
token
:
'8d14d945507d1f8cd89afe139ca6d111bbad25f702fafe0aec59d3c9cd2e0ffe'
},
// 物流服务
{
name
:
'Member'
,
token
:
'3a46198c5b97ac7147e5b07ad2dff5ac5c93c1afed47e1911961db87149e6ebf'
},
// 商户会员管理服务
{
name
:
'Product'
,
token
:
'efe99e20ed1375dc0db3e809e4fc7692f42ecebaf60cd77e65c50ed65d6ba6c4'
},
// 商品服务
{
name
:
'Template'
,
token
:
'7ec923520215c7e2f771867cb4d29cafbf823daf0fb2d3d9fa70b57a523c8bfb'
},
// 店铺模板服务
{
name
:
'Pay'
,
token
:
'c789e0e56ee8a8cc2fbd85f930eb2928c58fc1014583c6643acf29cff954da49'
},
// 支付服务
{
name
:
'Search'
,
token
:
'ca19f532efba91f7773cbfbd526b798c6ac83df670071e97d72c50dca1d53a48'
},
// 搜索服务
{
name
:
'Order'
,
token
:
'5de0aaeaac12c8d911d86dada6cd128993e34cd6e13135fa79246aa5979a2bcd'
},
//订单服务
]
const
genMap
=
(
tokens
)
=>
{
return
tokens
.
map
(
v
=>
{
return
{
token
:
v
,
const
getConfigMap
=
(
tokens
)
=>
tokens
.
map
(
v
=>
({
serverUrl
:
'http://10.0.0.25:4000/'
,
typesOnly
:
false
,
reactHooks
:
{
enabled
:
false
,
},
outputFilePath
:
`src/services/
${
v
.
name
}
Api.ts`
,
requestFunctionFilePath
:
'request.ts'
,
dataKey
:
'data'
,
projects
:
[
{
token
:
v
.
token
,
categories
:
[
{
id
:
0
,
...
...
@@ -33,21 +31,7 @@ const genMap = (tokens) => {
},
]
}
})
}
const
config
:
Config
=
[
{
serverUrl
:
'http://10.0.0.25:4000/'
,
typesOnly
:
false
,
reactHooks
:
{
enabled
:
false
,
},
outputFilePath
:
'src/services/index.ts'
,
requestFunctionFilePath
:
'request.ts'
,
dataKey
:
'data'
,
projects
:
genMap
(
tokens
),
},
]
],
}))
export
default
config
\ No newline at end of file
export
default
getConfigMap
(
tokenList
)
\ No newline at end of file
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