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
82e3c418
Commit
82e3c418
authored
May 31, 2021
by
卢均锐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 采购竞价&在线竞价 调整store取值,websocket链接端口修改为9880
parent
35eb5aac
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
192 additions
and
114 deletions
+192
-114
package.json
package.json
+2
-2
RightContent.tsx
src/layouts/components/RightContent.tsx
+25
-14
index.tsx
...ction/purchaseAbility/onlineBid/readyBid/detail/index.tsx
+56
-42
index.tsx
.../transaction/purchaseAbility/purchaseBid/detail/index.tsx
+12
-7
index.tsx
...ransaction/purchaseAbility/purchaseBid/readyAdd/index.tsx
+1
-1
index.tsx
...purchaseAbility/purchaseBid/readyBid/management/index.tsx
+70
-48
index.ts
src/store/purchaseBid/index.ts
+26
-0
No files found.
package.json
View file @
82e3c418
...
...
@@ -24,7 +24,7 @@
"build:all"
:
"cross-env SITE_ID=1 BACK_GATEWAY=http://lingxi-all.wg.shushangyun.com USE_ROUTE_CONFIG=false SOCKET_URL=ws://lingxi-all.wg.shushangyun.com yarn build"
,
"build:10"
:
"cross-env SITE_ID=1 BACK_GATEWAY=http://10.0.0.10:8100 USE_ROUTE_CONFIG=false SOCKET_URL=ws://10.0.0.10:9400 yarn build"
,
"build:study"
:
"cross-env SITE_ID=1 BACK_GATEWAY=http://10.0.1.207:8100 USE_ROUTE_CONFIG=false SOCKET_URL=ws://10.0.1.207:9400 yarn build"
,
"build:v2"
:
"cross-env SITE_ID=1 BACK_GATEWAY=http://10.0.0.17:8100 USE_ROUTE_CONFIG=false SOCKET_URL=ws://10.0.0.17:9
40
0 yarn build"
,
"build:v2"
:
"cross-env SITE_ID=1 BACK_GATEWAY=http://10.0.0.17:8100 USE_ROUTE_CONFIG=false SOCKET_URL=ws://10.0.0.17:9
88
0 yarn build"
,
"build:v2Preview"
:
"cross-env SITE_ID=1 BACK_GATEWAY=http://10.0.1.220:8100 USE_ROUTE_CONFIG=false SOCKET_URL=ws://10.0.1.220:9400 yarn build"
,
"postinstall"
:
"umi generate tmp"
,
"prettier"
:
"prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'"
,
...
...
@@ -36,7 +36,7 @@
"start:10"
:
"cross-env SITE_ID=1 BACK_GATEWAY=http://10.0.0.10:8100 USE_ROUTE_CONFIG=true SOCKET_URL=ws://10.0.0.10:9400 yarn start"
,
"start:study"
:
"cross-env SITE_ID=1 BACK_GATEWAY=http://10.0.1.207:8100 USE_ROUTE_CONFIG=false SOCKET_URL=ws://10.0.1.207:9400 yarn start"
,
"start:25"
:
"cross-env SITE_ID=1 BACK_GATEWAY=http://10.0.0.25:8100 USE_ROUTE_CONFIG=true SOCKET_URL=ws://10.0.0.25:9400 yarn start"
,
"start:v2"
:
"cross-env SITE_ID=1 BACK_GATEWAY=http://10.0.0.17:8100 USE_ROUTE_CONFIG=true SOCKET_URL=ws://10.0.0.17:9
40
0 yarn start"
,
"start:v2"
:
"cross-env SITE_ID=1 BACK_GATEWAY=http://10.0.0.17:8100 USE_ROUTE_CONFIG=true SOCKET_URL=ws://10.0.0.17:9
88
0 yarn start"
,
"start:v2Preview"
:
"cross-env SITE_ID=1 BACK_GATEWAY=http://10.0.1.220:8100 USE_ROUTE_CONFIG=false SOCKET_URL=ws://10.0.1.220:9400 yarn start"
},
...
...
src/layouts/components/RightContent.tsx
View file @
82e3c418
import
{
Tooltip
,
Badge
}
from
'antd'
;
import
{
BellOutlined
,
CustomerServiceOutlined
}
from
'@ant-design/icons'
;
import
React
,
{
useCallback
,
useRef
,
useLayoutEffect
,
useState
}
from
'react'
;
import
React
,
{
useCallback
,
useRef
,
useLayoutEffect
,
useState
,
useEffect
}
from
'react'
;
import
Avatar
from
'./AvatarDropdown'
;
import
SelectLang
from
'./SelectLang'
;
import
Location
from
'./Location'
;
...
...
@@ -11,6 +11,8 @@ import styles from '../styles/RightContent.less';
import
{
getAuth
}
from
'@/utils/auth'
;
import
{
SOCKET_URL
,
LAYOUT_TYPE
}
from
'@/constants'
;
import
{
usePurchaseBidStore
}
from
'@/store/purchaseBid'
;
// export type SiderTheme = 'light' | 'dark';
// export interface GlobalHeaderRightProps extends Partial<ConnectProps> {
// theme?: SiderTheme | 'realDark';
...
...
@@ -18,7 +20,7 @@ import { SOCKET_URL, LAYOUT_TYPE } from '@/constants';
// }
const
NOT_READ_MESSAGE
=
1
;
const
GlobalHeaderRight
:
React
.
FC
<
{
SiteStore
?:
any
}
>
=
(
props
)
=>
{
const
GlobalHeaderRight
:
React
.
FC
<
{
SiteStore
?:
any
}
>
=
(
props
)
=>
{
const
{
SiteStore
:
{
currentLayoutInfo
}
}
=
props
;
const
[
message
,
setMessage
]
=
useState
<
number
>
(
0
);
const
className
=
styles
.
right
;
...
...
@@ -28,16 +30,25 @@ const GlobalHeaderRight: React.FC<{SiteStore?: any}> = (props) => {
// }
const
userInfo
=
getAuth
()
const
{
purchaseBidStore
}
=
usePurchaseBidStore
();
const
{
setPurchaseBiddingMessage
,
setPurchaseBiddingMessageSupplier
}
=
purchaseBidStore
;
const
ws
=
useRef
<
WebSocket
|
null
>
(
null
);
const
webSocketInit
=
useCallback
(()
=>
{
if
(
SOCKET_URL
&&
(
!
ws
.
current
||
ws
.
current
.
readyState
===
3
)
&&
userInfo
)
{
const
url
=
`
${
SOCKET_URL
}
/report/websocket?memberId=
${
userInfo
.
memberId
}
&roleId=
${
userInfo
.
memberRoleId
}
&token=
${
userInfo
.
token
}
&source=
${
1
}
`
;
const
url
=
`
${
SOCKET_URL
}
/message/websocket?memberId=
${
userInfo
.
memberId
}
&roleId=
${
userInfo
.
memberRoleId
}
&token=
${
userInfo
.
token
}
&source=
${
1
}
`
;
console
.
log
(
url
)
ws
.
current
=
new
WebSocket
(
url
);
// ws.current.onopen = (e) => {}
ws
.
current
.
onmessage
=
(
e
)
=>
{
const
data
=
JSON
.
parse
(
e
.
data
);
if
(
data
.
type
===
NOT_READ_MESSAGE
)
{
console
.
log
(
data
)
if
(
data
.
action
===
'purchase_bidding_message_supplier'
)
{
setPurchaseBiddingMessageSupplier
(
data
)
}
else
if
(
data
.
action
===
'purchase_bidding_message'
)
{
setPurchaseBiddingMessage
(
data
)
}
if
(
data
.
type
===
NOT_READ_MESSAGE
)
{
setMessage
(
data
.
data
);
}
};
...
...
@@ -50,7 +61,7 @@ const GlobalHeaderRight: React.FC<{SiteStore?: any}> = (props) => {
}
},
[
ws
]);
use
Layout
Effect
(()
=>
{
useEffect
(()
=>
{
webSocketInit
();
return
()
=>
{
ws
.
current
?.
close
();
...
...
@@ -63,19 +74,19 @@ const GlobalHeaderRight: React.FC<{SiteStore?: any}> = (props) => {
return
(
<
div
className=
{
className
}
>
<
span
style=
{
{
color
:
'rgba(0, 0, 0, 0.85)'
,
cursor
:
"pointer"
}
}
onClick=
{
handleBackMall
}
>
返回商城
</
span
>
<
span
style=
{
{
color
:
'rgba(0, 0, 0, 0.85)'
,
cursor
:
"pointer"
}
}
onClick=
{
handleBackMall
}
>
返回商城
</
span
>
<
Roles
/>
{
/* <Location /> */
}
<
SelectLang
/>
<
Tooltip
title=
"消息"
>
<
a
href=
"/memberCenter/systemSetting/message"
className=
{
styles
.
action
}
>
<
Badge
count=
{
message
}
size=
{
"small"
}
>
<
BellOutlined
/>
</
Badge
>
</
a
>
<
a
href=
"/memberCenter/systemSetting/message"
className=
{
styles
.
action
}
>
<
Badge
count=
{
message
}
size=
{
"small"
}
>
<
BellOutlined
/>
</
Badge
>
</
a
>
</
Tooltip
>
{
/* <Tooltip title="服务">
<a
...
...
src/pages/transaction/purchaseAbility/onlineBid/readyBid/detail/index.tsx
View file @
82e3c418
import
React
,
{
useEffect
,
useState
,
useRef
,
useCallback
}
from
'react'
;
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
history
}
from
'umi'
;
import
{
Row
,
Col
}
from
'antd'
;
import
{
ArrowLeftOutlined
}
from
'@ant-design/icons'
;
import
isEmpty
from
'lodash/isEmpty'
import
{
observer
}
from
'mobx-react'
import
{
PublicApi
}
from
'@/services/api'
;
import
{
priceFormat
}
from
'@/utils/numberFomat'
;
import
{
formatTimeString
}
from
'@/utils'
import
{
getAuth
}
from
'@/utils/auth'
;
import
{
SOCKET_URL
}
from
'@/constants'
;
import
{
usePurchaseBidStore
}
from
'@/store/purchaseBid'
;
import
StatusBox
from
'../../../purchaseBid/readyBid/management/components/statusBox'
;
import
QuotationDeskLayout
from
'../../../components/detail/components/quotationDeskLayout'
;
...
...
@@ -20,6 +21,9 @@ import HistoryItem from './history';
import
styles
from
'./index.less'
;
const
Detail
=
()
=>
{
const
{
purchaseBidStore
}
=
usePurchaseBidStore
();
const
{
purchaseBiddingMessageSupplier
}
=
purchaseBidStore
;
const
{
query
:
{
id
,
...
...
@@ -32,43 +36,53 @@ const Detail = () => {
const
[
dataSource
,
setDataSource
]
=
useState
<
any
>
({});
const
[
chartsList
,
setChartsList
]
=
useState
<
any
>
([]);
const
userInfo
=
getAuth
();
const
ws
=
useRef
<
WebSocket
|
null
>
(
null
);
const
webSocketInit
=
useCallback
(()
=>
{
if
(
SOCKET_URL
&&
(
!
ws
.
current
||
ws
.
current
.
readyState
===
3
)
&&
userInfo
)
{
const
url
=
`
${
SOCKET_URL
}
/message/websocket?memberId=
${
userInfo
.
memberId
}
&roleId=
${
userInfo
.
memberRoleId
}
&token=
${
userInfo
.
token
}
&source=
${
1
}
`
;
console
.
log
(
url
)
ws
.
current
=
new
WebSocket
(
url
);
// ws.current.onopen = (e) => {}
ws
.
current
.
onmessage
=
(
e
)
=>
{
const
data
=
JSON
.
parse
(
e
.
data
);
console
.
log
(
data
)
const
_data
=
data
.
data
;
if
(
data
.
action
===
'purchase_bidding_message_supplier'
&&
_data
.
id
==
onlineId
){
const
_obj
=
{
ranking
:
_data
.
ranking
,
minLowPrice
:
_data
.
minPrice
,
quotationDesks
:
_data
.
awardProcesss
}
fetchDataSource
(
_obj
);
}
};
ws
.
current
.
onclose
=
(
e
)
=>
{
console
.
log
(
"关闭连接"
)
}
ws
.
current
.
onerror
=
(
e
)
=>
{
console
.
log
(
"socket 出错"
)
useEffect
(()
=>
{
const
_data
=
purchaseBiddingMessageSupplier
?.
data
if
(
purchaseBiddingMessageSupplier
&&
!
isEmpty
(
dataSource
)
&&
_data
.
id
==
onlineId
)
{
const
_obj
=
{
ranking
:
_data
.
ranking
,
minLowPrice
:
_data
.
minPrice
,
quotationDesks
:
_data
.
awardProcesss
}
fetchDataSource
(
_obj
);
}
},
[
ws
]);
},
[
purchaseBiddingMessageSupplier
])
useEffect
(()
=>
{
webSocketInit
();
return
()
=>
{
ws
.
current
?.
close
();
};
},
[
ws
,
webSocketInit
]);
// const ws = useRef<WebSocket | null>(null);
// const webSocketInit = useCallback(() => {
// if (SOCKET_URL && (!ws.current || ws.current.readyState === 3) && userInfo) {
// const url = `${SOCKET_URL}/message/websocket?memberId=${userInfo.memberId}&roleId=${userInfo.memberRoleId}&token=${userInfo.token}&source=${1}`;
// console.log(url)
// ws.current = new WebSocket(url);
// // ws.current.onopen = (e) => {}
// ws.current.onmessage = (e) => {
// const data = JSON.parse(e.data);
// console.log(data)
// const _data = data.data;
// if(data.action === 'purchase_bidding_message_supplier' && _data.id == onlineId){
// const _obj = {
// ranking: _data.ranking,
// minLowPrice : _data.minPrice,
// quotationDesks : _data.awardProcesss
// }
// fetchDataSource(_obj);
// }
// };
// ws.current.onclose = (e) => {
// console.log("关闭连接")
// }
// ws.current.onerror = (e) => {
// console.log("socket 出错")
// }
// }
// }, [ws]);
// useEffect(() => {
// webSocketInit();
// return () => {
// ws.current?.close();
// };
// }, [ws, webSocketInit]);
const
fetchDataSource
=
async
(
socketObj
?:
any
)
=>
{
const
params
=
{
...
...
@@ -84,7 +98,7 @@ const Detail = () => {
}
const
{
data
}
=
res
;
let
_flag
=
false
;
if
(
socketObj
)
{
if
(
socketObj
)
{
_flag
=
true
;
data
.
ranking
=
socketObj
.
ranking
;
data
.
minLowPrice
=
socketObj
.
minLowPrice
;
...
...
@@ -95,16 +109,16 @@ const Detail = () => {
let
_offerList
=
[];
let
_minList
=
[];
let
_quotationDesks
=
data
?.
quotationDesks
?
[...
data
.
quotationDesks
].
reverse
()
:
[];
if
(
_flag
)
{
if
(
_flag
)
{
_quotationDesks
=
socketObj
.
quotationDesks
.
filter
((
item
)
=>
item
.
id
==
onlineId
)
}
_quotationDesks
.
forEach
((
item
)
=>
{
_offerList
.
push
({
type
:
'offer'
,
time
:
formatTimeString
(
item
.
offerTime
||
item
.
peportTime
,
'HH:mm:ss'
),
value
:
priceFormat
(
item
.
price
||
item
.
sumPice
,
0
)
});
_offerList
.
push
({
type
:
'offer'
,
time
:
formatTimeString
(
item
.
offerTime
||
item
.
peportTime
,
'HH:mm:ss'
),
value
:
priceFormat
(
item
.
price
||
item
.
sumPice
,
0
)
});
})
_list
.
push
({
title
:
'报价金额'
,
type
:
'offer'
,
list
:
_offerList
});
if
(
data
.
isOpenPurchase
)
{
_quotationDesks
.
forEach
((
item
)
=>
{
_minList
.
push
({
type
:
'min'
,
time
:
formatTimeString
(
item
.
offerTime
||
item
.
peportTime
,
'HH:mm:ss'
),
value
:
priceFormat
(
item
.
minPrice
,
0
)
});
_minList
.
push
({
type
:
'min'
,
time
:
formatTimeString
(
item
.
offerTime
||
item
.
peportTime
,
'HH:mm:ss'
),
value
:
priceFormat
(
item
.
minPrice
,
0
)
});
})
_list
.
push
({
title
:
'最低价'
,
type
:
'min'
,
list
:
_minList
});
}
...
...
@@ -142,4 +156,4 @@ const Detail = () => {
)
}
export
default
Detail
;
export
default
observer
(
Detail
)
;
src/pages/transaction/purchaseAbility/purchaseBid/detail/index.tsx
View file @
82e3c418
...
...
@@ -280,13 +280,18 @@ const SearchDetail = () => {
const
_returnTopButton
=
()
=>
{
switch
(
pathPci
)
{
case
'readyAdd'
:
return
(
<
Popconfirm
title=
"确定要提交审核吗?"
okText=
"是"
cancelText=
"否"
onConfirm=
{
fetchSubmitBatch
}
>
<
Button
type=
'primary'
>
<
CheckCircleOutlined
/>
提交
</
Button
>
</
Popconfirm
>
)
if
(
button
===
1
){
return
(
<
Popconfirm
title=
"确定要提交审核吗?"
okText=
"是"
cancelText=
"否"
onConfirm=
{
fetchSubmitBatch
}
>
<
Button
type=
'primary'
>
<
CheckCircleOutlined
/>
提交
</
Button
>
</
Popconfirm
>
)
}
else
{
return
null
}
case
'readyExamineOne'
:
case
'readyExamineTwo'
:
case
'readyExamineSignUp'
:
...
...
src/pages/transaction/purchaseAbility/purchaseBid/readyAdd/index.tsx
View file @
82e3c418
...
...
@@ -28,7 +28,7 @@ const ReadyAdd = () => {
dataIndex
:
'biddingNo'
,
render
:
(
text
:
any
,
record
:
any
)
=>
(
<
Space
direction=
'vertical'
>
<
EyePreview
url=
{
`/memberCenter/procurementAbility/purchaseBid/readyAdd/detail?id=${record.id}&number=${text}`
}
>
{
text
}
</
EyePreview
>
<
EyePreview
url=
{
`/memberCenter/procurementAbility/purchaseBid/readyAdd/detail?id=${record.id}&number=${text}
&button=${record.button}
`
}
>
{
text
}
</
EyePreview
>
<
Text
type=
'secondary'
>
{
record
.
details
}
</
Text
>
</
Space
>
)
...
...
src/pages/transaction/purchaseAbility/purchaseBid/readyBid/management/index.tsx
View file @
82e3c418
import
React
,
{
useEffect
,
useState
,
useRef
,
useCallback
}
from
'react'
;
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
history
}
from
'umi'
;
import
{
Row
,
Col
}
from
'antd'
;
import
{
ArrowLeftOutlined
}
from
'@ant-design/icons'
;
import
isEmpty
from
'lodash/isEmpty'
import
{
observer
}
from
'mobx-react'
import
{
PublicApi
}
from
'@/services/api'
;
import
{
formatTimeString
}
from
'@/utils'
import
{
priceFormat
}
from
'@/utils/numberFomat'
;
import
{
getAuth
}
from
'@/utils/auth'
;
import
{
SOCKET_URL
}
from
'@/constants'
;
import
{
usePurchaseBidStore
}
from
'@/store/purchaseBid'
;
import
QuotationDeskLayout
from
'../../../components/detail/components/quotationDeskLayout'
;
import
BidDetailLayout
from
'../../../components/detail/components/bidDetailLayout'
;
...
...
@@ -34,52 +35,73 @@ const Management = () => {
const
[
awardProcess
,
setAwardProcess
]
=
useState
<
any
>
([]);
const
[
lowestList
,
setLowestList
]
=
useState
<
any
>
({});
const
userInfo
=
getAuth
();
const
ws
=
useRef
<
WebSocket
|
null
>
(
null
);
const
webSocketInit
=
useCallback
(()
=>
{
if
(
SOCKET_URL
&&
(
!
ws
.
current
||
ws
.
current
.
readyState
===
3
)
&&
userInfo
)
{
const
url
=
`
${
SOCKET_URL
}
/message/websocket?memberId=
${
userInfo
.
memberId
}
&roleId=
${
userInfo
.
memberRoleId
}
&token=
${
userInfo
.
token
}
&source=
${
1
}
`
;
console
.
log
(
url
)
ws
.
current
=
new
WebSocket
(
url
);
// ws.current.onopen = (e) => {}
ws
.
current
.
onmessage
=
(
e
)
=>
{
const
data
=
JSON
.
parse
(
e
.
data
);
console
.
log
(
data
)
const
_data
=
data
.
data
;
if
(
data
.
action
===
'purchase_bidding_message'
&&
_data
.
id
==
id
)
{
let
_dynamic
=
{
...
dynamic
};
_dynamic
.
count
=
_data
.
count
;
_dynamic
.
id
=
_data
.
id
;
_dynamic
.
memberName
=
_data
.
memberName
;
_dynamic
.
minPrice
=
_data
.
minPrice
;
setDynamic
(
_dynamic
);
setQueryPriceDynamics
(
_data
.
queryPriceDynamics
);
setSignupMembers
(
_data
.
sginUpInfos
);
setAwardProcess
(
_data
.
awardProcesss
);
setLowestList
({
type
:
'min'
,
title
:
'最低价'
,
list
:
_data
.
awardProcesss
?
_data
.
awardProcesss
.
map
((
item
)
=>
{
return
{
type
:
'min'
,
time
:
formatTimeString
(
item
.
peportTime
,
'HH:mm:ss'
),
value
:
priceFormat
(
item
.
sumPice
,
0
)
}
})
:
[]
})
}
};
ws
.
current
.
onclose
=
(
e
)
=>
{
console
.
log
(
e
)
console
.
log
(
"关闭连接"
)
}
ws
.
current
.
onerror
=
(
e
)
=>
{
console
.
log
(
"socket 出错"
)
}
}
},
[
ws
]);
const
{
purchaseBidStore
}
=
usePurchaseBidStore
();
const
{
purchaseBiddingMessage
}
=
purchaseBidStore
;
useEffect
(()
=>
{
webSocketInit
();
return
()
=>
{
ws
.
current
?.
close
();
};
},
[
ws
,
webSocketInit
]);
const
_data
=
purchaseBiddingMessage
?.
data
if
(
purchaseBiddingMessage
&&
!
isEmpty
(
dataSource
)
&&
_data
.
id
==
id
)
{
let
_dynamic
=
{
...
dynamic
};
_dynamic
.
count
=
_data
.
count
;
_dynamic
.
id
=
_data
.
id
;
_dynamic
.
memberName
=
_data
.
memberName
;
_dynamic
.
minPrice
=
_data
.
minPrice
;
setDynamic
(
_dynamic
);
setQueryPriceDynamics
(
_data
.
queryPriceDynamics
);
setSignupMembers
(
_data
.
sginUpInfos
);
setAwardProcess
(
_data
.
awardProcesss
);
setLowestList
({
type
:
'min'
,
title
:
'最低价'
,
list
:
_data
.
awardProcesss
?
_data
.
awardProcesss
.
map
((
item
)
=>
{
return
{
type
:
'min'
,
time
:
formatTimeString
(
item
.
peportTime
,
'HH:mm:ss'
),
value
:
priceFormat
(
item
.
sumPice
,
0
)
}
})
:
[]
})
}
},
[
purchaseBiddingMessage
])
// const ws = useRef<WebSocket | null>(null);
// const webSocketInit = useCallback(() => {
// if (SOCKET_URL && (!ws.current || ws.current.readyState === 3) && userInfo) {
// const url = `${SOCKET_URL}/message/websocket?memberId=${userInfo.memberId}&roleId=${userInfo.memberRoleId}&token=${userInfo.token}&source=${1}`;
// console.log(url)
// ws.current = new WebSocket(url);
// // ws.current.onopen = (e) => {}
// ws.current.onmessage = (e) => {
// const data = JSON.parse(e.data);
// console.log(data)
// const _data = data.data;
// if (data.action === 'purchase_bidding_message' && _data.id == id) {
// let _dynamic = { ...dynamic };
// _dynamic.count = _data.count;
// _dynamic.id = _data.id;
// _dynamic.memberName = _data.memberName;
// _dynamic.minPrice = _data.minPrice;
// setDynamic(_dynamic);
// setQueryPriceDynamics(_data.queryPriceDynamics);
// setSignupMembers(_data.sginUpInfos);
// setAwardProcess(_data.awardProcesss);
// setLowestList({
// type: 'min',
// title: '最低价',
// list: _data.awardProcesss ? _data.awardProcesss.map((item) => { return { type: 'min', time: formatTimeString(item.peportTime, 'HH:mm:ss'), value: priceFormat(item.sumPice, 0) } }) : []
// })
// }
// };
// ws.current.onclose = (e) => {
// console.log(e)
// console.log("关闭连接")
// }
// ws.current.onerror = (e) => {
// console.log("socket 出错")
// }
// }
// }, [ws]);
// useEffect(() => {
// webSocketInit();
// return () => {
// ws.current?.close();
// };
// }, [ws, webSocketInit]);
const
fetchDataSource
=
async
()
=>
{
const
params
=
{
...
...
@@ -177,4 +199,4 @@ const Management = () => {
)
}
export
default
Management
;
export
default
observer
(
Management
)
;
src/store/purchaseBid/index.ts
0 → 100644
View file @
82e3c418
import
React
from
'react'
;
import
{
action
,
computed
,
observable
,
runInAction
}
from
'mobx'
class
PurchaseBidStore
{
@
observable
public
purchaseBiddingMessage
:
any
=
''
;
@
observable
public
purchaseBiddingMessageSupplier
:
any
=
''
;
@
action
.
bound
public
setPurchaseBiddingMessage
(
data
:
any
)
{
this
.
purchaseBiddingMessage
=
data
}
@
action
.
bound
public
setPurchaseBiddingMessageSupplier
(
data
:
any
)
{
this
.
purchaseBiddingMessageSupplier
=
data
}
}
const
store
=
{
purchaseBidStore
:
new
PurchaseBidStore
()
};
const
storeContext
=
React
.
createContext
(
store
);
export
const
usePurchaseBidStore
=
()
=>
React
.
useContext
(
storeContext
);
export
default
PurchaseBidStore
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