|
|
@@ -1,5 +1,5 @@
|
|
|
import React, { useState, useEffect } from 'react'
|
|
|
-import { Row, Col, Button, Tooltip, Modal, message } from 'antd'
|
|
|
+import { Row, Col, Button, Tooltip, Spin, Modal } from 'antd'
|
|
|
import { LinkOne, LinkInterrupt } from '@icon-park/react'
|
|
|
import { connect } from 'umi'
|
|
|
import { useModal } from '@/components/Modal'
|
|
|
@@ -24,12 +24,10 @@ const Detail = props => {
|
|
|
const { toggleModal, setModalProps } = useModal()
|
|
|
const shouldUpdate = refresh[updateKey] || false
|
|
|
const refreshClient = () => {
|
|
|
- if (shouldUpdate) {
|
|
|
- dispatch({
|
|
|
- type: 'refresh/commitAction',
|
|
|
- payload: updateKey
|
|
|
- })
|
|
|
- }
|
|
|
+ dispatch({
|
|
|
+ type: 'refresh/commitAction',
|
|
|
+ payload: 'cloud'
|
|
|
+ })
|
|
|
}
|
|
|
const [state, setState] = useState({
|
|
|
loading: false,
|
|
|
@@ -84,8 +82,10 @@ const Detail = props => {
|
|
|
projectType
|
|
|
})
|
|
|
if (code === consts.RET_CODE.SUCCESS) {
|
|
|
- message.success('移除成功')
|
|
|
- refreshClient()
|
|
|
+ dispatch({
|
|
|
+ type: 'refresh/commitAction',
|
|
|
+ payload: updateKey
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
@@ -98,62 +98,64 @@ const Detail = props => {
|
|
|
visible && initData(dataId)
|
|
|
}, [visible])
|
|
|
return (
|
|
|
- <div className="sheet-box">
|
|
|
- <Row>
|
|
|
- <Col
|
|
|
- sm={{ span: 24 }}
|
|
|
- md={{ span: 24 }}
|
|
|
- lg={{ span: 9 }}
|
|
|
- xl={{ span: 9 }}
|
|
|
- className="sheet-box-left">
|
|
|
- <div className="sheet-left-panel pr-4">
|
|
|
- <Form cloudUser={state.cloudUser} updateKey={updateKey} projectType={projectType} />
|
|
|
- {state.cloudUser.cld?.clientId ? (
|
|
|
- <>
|
|
|
- <div className="mt-4">
|
|
|
- <ClientDetail client={state.client} filterTag={filterTag} />
|
|
|
- </div>
|
|
|
+ <Spin spinning={state.loading}>
|
|
|
+ <div className="sheet-box">
|
|
|
+ <Row>
|
|
|
+ <Col
|
|
|
+ sm={{ span: 24 }}
|
|
|
+ md={{ span: 24 }}
|
|
|
+ lg={{ span: 9 }}
|
|
|
+ xl={{ span: 9 }}
|
|
|
+ className="sheet-box-left">
|
|
|
+ <div className="sheet-left-panel pr-4">
|
|
|
+ <Form cloudUser={state.cloudUser} updateKey={updateKey} projectType={projectType} />
|
|
|
+ {state.cloudUser.cld?.clientId ? (
|
|
|
+ <>
|
|
|
+ <div className="mt-4">
|
|
|
+ <ClientDetail client={state.client} filterTag={filterTag} />
|
|
|
+ </div>
|
|
|
+ <div className="text-center mt-6">
|
|
|
+ <Tooltip placement="right" title="移除CLD客户">
|
|
|
+ <Button
|
|
|
+ type="primary"
|
|
|
+ ghost
|
|
|
+ size="small"
|
|
|
+ onClick={() => {
|
|
|
+ pricingUnLinkClient(state.cloudUser.cld?.clientId)
|
|
|
+ }}>
|
|
|
+ <LinkInterrupt size="14" />
|
|
|
+ <span className="ml-5px">移除CLD客户</span>
|
|
|
+ </Button>
|
|
|
+ </Tooltip>
|
|
|
+ </div>
|
|
|
+ </>
|
|
|
+ ) : (
|
|
|
<div className="text-center mt-6">
|
|
|
- <Tooltip placement="right" title="移除CLD客户">
|
|
|
- <Button
|
|
|
- type="primary"
|
|
|
- ghost
|
|
|
- size="small"
|
|
|
- onClick={() => {
|
|
|
- pricingUnLinkClient(state.cloudUser.cld?.clientId)
|
|
|
- }}>
|
|
|
- <LinkInterrupt size="14" />
|
|
|
- <span className="ml-5px">移除CLD客户</span>
|
|
|
- </Button>
|
|
|
- </Tooltip>
|
|
|
+ <Button type="primary" ghost size="small" onClick={handleConnectClient}>
|
|
|
+ <LinkOne size="14" />
|
|
|
+ <span className="ml-5px">关联CLD客户</span>
|
|
|
+ </Button>
|
|
|
</div>
|
|
|
- </>
|
|
|
- ) : (
|
|
|
- <div className="text-center mt-6">
|
|
|
- <Button type="primary" ghost size="small" onClick={handleConnectClient}>
|
|
|
- <LinkOne size="14" />
|
|
|
- <span className="ml-5px">关联CLD客户</span>
|
|
|
- </Button>
|
|
|
- </div>
|
|
|
- )}
|
|
|
- </div>
|
|
|
- </Col>
|
|
|
- <Col
|
|
|
- sm={{ span: 24 }}
|
|
|
- md={{ span: 24 }}
|
|
|
- lg={{ span: 15 }}
|
|
|
- xl={{ span: 15 }}
|
|
|
- flex={{ flexDirection: 'column' }}
|
|
|
- className="sheet-box-right">
|
|
|
- <TabList
|
|
|
- compilationList={state.compilationList}
|
|
|
- cloudUser={state.cloudUser}
|
|
|
- projectType={projectType}
|
|
|
- />
|
|
|
- <LowerList log={state.log} serviceLog={state.serviceLog} />
|
|
|
- </Col>
|
|
|
- </Row>
|
|
|
- </div>
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
+ </Col>
|
|
|
+ <Col
|
|
|
+ sm={{ span: 24 }}
|
|
|
+ md={{ span: 24 }}
|
|
|
+ lg={{ span: 15 }}
|
|
|
+ xl={{ span: 15 }}
|
|
|
+ flex={{ flexDirection: 'column' }}
|
|
|
+ className="sheet-box-right">
|
|
|
+ <TabList
|
|
|
+ compilationList={state.compilationList}
|
|
|
+ cloudUser={state.cloudUser}
|
|
|
+ projectType={projectType}
|
|
|
+ />
|
|
|
+ <LowerList log={state.log} serviceLog={state.serviceLog} />
|
|
|
+ </Col>
|
|
|
+ </Row>
|
|
|
+ </div>
|
|
|
+ </Spin>
|
|
|
)
|
|
|
}
|
|
|
|