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
linweijiong
jinfa-platform
Commits
7851de3f
Commit
7851de3f
authored
Feb 23, 2022
by
Bill
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
2a6ddada
a4104788
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
102 additions
and
21 deletions
+102
-21
purchase.ts
src/locales/en-US/purchase.ts
+1
-0
shop.ts
src/locales/en-US/shop.ts
+2
-2
purchase.ts
src/locales/ko-KR/purchase.ts
+1
-0
shop.ts
src/locales/ko-KR/shop.ts
+2
-2
purchase.ts
src/locales/zh-CN/purchase.ts
+1
-0
shop.ts
src/locales/zh-CN/shop.ts
+2
-2
index.tsx
...ages/ownMall/ownMallManager/components/useModal/index.tsx
+74
-4
index.tsx
src/pages/ownMall/ownMallManager/templateDetail/index.tsx
+15
-9
type.ts
src/utils/type.ts
+4
-2
No files found.
src/locales/en-US/purchase.ts
View file @
7851de3f
...
...
@@ -109,6 +109,7 @@ export default {
'table.purchase.moduleWarning1'
:
'Please create a purchasing portal first! '
,
'table.purchase.xjzb'
:
'New tender'
,
'table.purchase.bjzb'
:
'Edit bidding'
,
'table.purchase.qingshuruzhaobiao1'
:
'Please enter tender number'
,
// detail
'detail.purchase.isAward'
:
'award'
,
...
...
src/locales/en-US/shop.ts
View file @
7851de3f
...
...
@@ -3,8 +3,8 @@
*/
export
default
{
/** Shop */
'shop.form.label.memberShopAreas'
:
'
Attribution to the city
'
,
'shop.form.memberShopAreas.required'
:
'Please select the
attribution city
'
,
'shop.form.label.memberShopAreas'
:
'
City of business
'
,
'shop.form.memberShopAreas.required'
:
'Please select the
city where the business is located
'
,
'shop.form.upload.size.limit'
:
'Upload file size does not exceed 50M!'
,
'shop.form.upload.type.required'
:
'Please upload a pdf format file'
,
'shop.form.label.name'
:
'Shop name'
,
...
...
src/locales/ko-KR/purchase.ts
View file @
7851de3f
...
...
@@ -109,6 +109,7 @@ export default {
'table.purchase.moduleWarning1'
:
'먼저 구매 포털을 만드세요!'
,
'table.purchase.xjzb'
:
'신설 입찰 공고'
,
'table.purchase.bjzb'
:
'편집 입찰'
,
'table.purchase.qingshuruzhaobiao1'
:
'입찰번호를 입력하십시오'
,
// detail
'detail.purchase.isAward'
:
'수표'
,
...
...
src/locales/ko-KR/shop.ts
View file @
7851de3f
...
...
@@ -3,8 +3,8 @@
*/
export
default
{
/** 店铺 */
'shop.form.label.memberShopAreas'
:
'
귀속지
'
,
'shop.form.memberShopAreas.required'
:
'
귀속지를 선택하십시오
'
,
'shop.form.label.memberShopAreas'
:
'
비즈니스의 도시
'
,
'shop.form.memberShopAreas.required'
:
'
사업장이 위치한 도시를 선택하세요.
'
,
'shop.form.upload.size.limit'
:
'업로드 파일 크기가 50M을 넘지 않습니다!'
,
'shop.form.upload.type.required'
:
'pdf 형식 파일을 업로드하십시오'
,
'shop.form.label.name'
:
'가게 이름'
,
...
...
src/locales/zh-CN/purchase.ts
View file @
7851de3f
...
...
@@ -109,6 +109,7 @@ export default {
'table.purchase.moduleWarning1'
:
'请先创建采购门户!'
,
'table.purchase.xjzb'
:
'新建招标'
,
'table.purchase.bjzb'
:
'编辑招标'
,
'table.purchase.qingshuruzhaobiao1'
:
'请输入招标编号'
,
// detail
'detail.purchase.isAward'
:
'授标'
,
...
...
src/locales/zh-CN/shop.ts
View file @
7851de3f
...
...
@@ -3,8 +3,8 @@
*/
export
default
{
/** 店铺 */
'shop.form.label.memberShopAreas'
:
'
归属
地市'
,
'shop.form.memberShopAreas.required'
:
'请选择
归属
地市'
,
'shop.form.label.memberShopAreas'
:
'
业务所在
地市'
,
'shop.form.memberShopAreas.required'
:
'请选择
业务所在
地市'
,
'shop.form.upload.size.limit'
:
'上传文件大小不超过 50M!'
,
'shop.form.upload.type.required'
:
'请上传pdf格式文件'
,
'shop.form.label.name'
:
'店铺名称'
,
...
...
src/pages/ownMall/ownMallManager/components/useModal/index.tsx
View file @
7851de3f
import
React
from
'react'
import
{
Modal
}
from
'antd'
import
React
,
{
useEffect
,
useState
}
from
'react'
import
{
Modal
,
Form
,
Select
}
from
'antd'
import
isEmpty
from
'lodash/isEmpty'
import
styles
from
'./index.less'
import
{
useIntl
}
from
'umi'
import
{
PostManageWebShopWebAllResponse
}
from
'@/services/ManageV2Api'
export
interface
MallItemType
{
id
:
number
;
name
:
string
;
type
:
number
;
environment
:
number
;
property
:
number
;
self
:
number
;
memberOperate
:
number
;
logoUrl
:
string
;
describe
:
string
;
state
:
number
;
url
:
string
;
isDefault
:
number
;
createTime
:
number
;
}
interface
UseModalPropsType
{
visible
:
boolean
;
...
...
@@ -10,11 +28,41 @@ interface UseModalPropsType {
title
:
string
;
dataInfo
:
any
;
confirmLoading
?:
boolean
;
mallList
:
MallItemType
[]
}
interface
SelectItemType
{
label
:
string
,
value
:
number
,
}
const
UseModal
:
React
.
FC
<
UseModalPropsType
>
=
(
props
)
=>
{
const
{
visible
,
onOk
,
onCancel
,
title
,
dataInfo
=
{},
confirmLoading
=
false
}
=
props
const
{
visible
,
onOk
,
onCancel
,
title
,
dataInfo
=
{},
confirmLoading
=
false
,
mallList
}
=
props
const
[
selectItem
,
setSelectItem
]
=
useState
<
SelectItemType
>
()
const
intl
=
useIntl
()
const
[
form
]
=
Form
.
useForm
()
useEffect
(()
=>
{
if
(
!
isEmpty
(
dataInfo
))
{
const
item
=
mallList
.
filter
((
item
)
=>
item
.
id
===
dataInfo
.
shopId
)[
0
]
if
(
item
)
{
setSelectItem
({
label
:
item
.
name
,
value
:
item
.
id
})
form
.
setFieldsValue
({
shopId
:
item
.
id
})
}
}
},
[
dataInfo
])
const
layout
=
{
labelCol
:
{
span
:
24
},
wrapperCol
:
{
span
:
24
},
};
const
handleSelect
=
(
_
,
option
)
=>
{
setSelectItem
(
option
)
}
return
(
<
Modal
...
...
@@ -22,10 +70,32 @@ const UseModal: React.FC<UseModalPropsType> = (props) => {
title=
{
title
}
visible=
{
visible
}
confirmLoading=
{
confirmLoading
}
onOk=
{
()
=>
onOk
()
}
onOk=
{
()
=>
{
form
.
validateFields
()
if
(
selectItem
)
{
onOk
(
selectItem
)
}
}
}
centered
onCancel=
{
()
=>
onCancel
()
}
>
<
Form
{
...
layout
}
form=
{
form
}
>
<
Form
.
Item
name=
"shopId"
label=
{
intl
.
formatMessage
({
id
:
'detail.purchase.selectMall'
})
}
rules=
{
[{
required
:
true
}]
}
>
<
Select
className=
{
styles
.
selectBox
}
onChange=
{
handleSelect
}
>
{
mallList
&&
mallList
.
map
((
mallItem
)
=>
(
<
Select
.
Option
value=
{
mallItem
.
id
}
label=
{
mallItem
.
name
}
key=
{
mallItem
.
id
}
>
{
mallItem
.
name
}
</
Select
.
Option
>
))
}
</
Select
>
</
Form
.
Item
>
</
Form
>
{
dataInfo
.
inUseTemplateName
?
(
<>
...
...
src/pages/ownMall/ownMallManager/templateDetail/index.tsx
View file @
7851de3f
...
...
@@ -8,7 +8,7 @@ import UseModal from '../components/useModal'
import
{
Environment_Status
}
from
'@/constants'
import
styles
from
'./index.less'
import
{
getTemplateWebPageTemplateWebFindSelfTemplateDetails
,
postTemplateWebPageTemplateWebUseSelfTemplate
}
from
'@/services/TemplateV2Api'
import
{
postManageWebShopWebAll
}
from
'@/services/ManageV2Api'
import
{
postManageWebShopWebAll
,
PostManageWebShopWebAllResponse
}
from
'@/services/ManageV2Api'
import
{
getAuth
}
from
'@/utils/auth'
import
{
GlobalConfig
}
from
'@/global/config'
...
...
@@ -25,6 +25,7 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
const
{
query
:
{
type
,
id
}
}
=
props
.
location
const
[
detailInfo
,
setDetailInfo
]
=
useState
<
any
>
()
const
[
useModalVisible
,
setUseModalVisible
]
=
useState
<
boolean
>
(
false
)
const
[
mallList
,
setMallList
]
=
useState
<
PostManageWebShopWebAllResponse
>
([])
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
)
const
intl
=
useIntl
()
const
userInfo
=
getAuth
()
...
...
@@ -41,10 +42,12 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
const
res
=
await
postManageWebShopWebAll
(
params
)
message
.
destroy
()
if
(
res
.
code
===
1000
&&
res
.
data
&&
Array
.
isArray
(
res
.
data
)
&&
res
.
data
.
length
>
0
)
{
console
.
log
(
res
.
data
.
filter
((
item
)
=>
item
.
self
===
1
&&
item
.
property
===
property
),
'selfMalllist'
)
const
selfMall
=
res
.
data
.
filter
((
item
)
=>
item
.
self
===
1
&&
item
.
property
===
property
)[
0
]
if
(
selfMall
)
{
return
selfMall
.
id
const
list
=
res
.
data
.
filter
((
item
)
=>
item
.
self
===
1
&&
item
.
property
===
property
)
setMallList
(
list
)
if
(
list
&&
list
.
length
===
1
)
{
return
list
[
0
].
id
}
else
{
return
undefined
}
}
}
...
...
@@ -72,10 +75,12 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
/**
* 使用模板
*/
const
handleConfirmUse
=
()
=>
{
const
handleConfirmUse
=
(
selectItem
)
=>
{
setConfirmLoading
(
true
)
const
params
:
any
=
{
id
id
,
shopId
:
selectItem
.
value
,
shopName
:
selectItem
.
label
,
}
postTemplateWebPageTemplateWebUseSelfTemplate
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
...
...
@@ -167,7 +172,7 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
</div>
)
}
<div className={cx(styles.btn, detailInfo?.use === 1 ? styles.use : '')} onClick={() =>
detailInfo?.use !== 1 ? setUseModalVisible(true) : {}
}>
<div className={cx(styles.btn, detailInfo?.use === 1 ? styles.use : '')} onClick={() =>
setUseModalVisible(true)
}>
<PushpinOutlined />
<label>{detailInfo?.use === 1 ? intl.formatMessage({ id: 'shop.template.button.state.using' }) : intl.formatMessage({ id: 'shop.template.button.state.use' })}</label>
</div>
...
...
@@ -176,8 +181,9 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
title={intl.formatMessage({ id: 'own.template.modal.title.use' })}
visible={useModalVisible}
dataInfo={detailInfo}
mallList={mallList}
confirmLoading={confirmLoading}
onOk={(
) => handleConfirmUse(
)}
onOk={(
selectItem) => handleConfirmUse(selectItem
)}
onCancel={() => setUseModalVisible(false)}
/>
</div>
...
...
src/utils/type.ts
View file @
7851de3f
...
...
@@ -42,6 +42,8 @@ interface getShopListsParmasProps {
* @param params 接口参数
*/
export
const
fectchShopListsSource
=
async
(
params
?:
getShopListsParmasProps
)
=>
{
const
{
data
}
=
await
postManageWebShopWebAll
({
...
params
,
siteId
:
GlobalConfig
.
global
.
siteInfo
.
id
},
{
ctlType
:
'none'
})
return
data
if
(
postManageWebShopWebAll
)
{
const
{
data
}
=
await
postManageWebShopWebAll
({
...
params
,
siteId
:
GlobalConfig
.
global
.
siteInfo
.
id
},
{
ctlType
:
'none'
})
return
data
}
}
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