|
@@ -1,5 +1,5 @@
|
|
|
import React, { useState, useEffect } from 'react'
|
|
import React, { useState, useEffect } from 'react'
|
|
|
-import { Row, Col, Button } from 'antd'
|
|
|
|
|
|
|
+import { Row, Col, Button, Tooltip, Modal } from 'antd'
|
|
|
import { LinkOne, LinkInterrupt } from '@icon-park/react'
|
|
import { LinkOne, LinkInterrupt } from '@icon-park/react'
|
|
|
import { connect } from 'umi'
|
|
import { connect } from 'umi'
|
|
|
import { useModal } from '@/components/Modal'
|
|
import { useModal } from '@/components/Modal'
|
|
@@ -17,6 +17,7 @@ const Detail = props => {
|
|
|
updateKey = 'cloud',
|
|
updateKey = 'cloud',
|
|
|
refresh,
|
|
refresh,
|
|
|
visible,
|
|
visible,
|
|
|
|
|
+ actionPayload,
|
|
|
dataId = '',
|
|
dataId = '',
|
|
|
projectType,
|
|
projectType,
|
|
|
filterTag = true
|
|
filterTag = true
|
|
@@ -35,12 +36,12 @@ const Detail = props => {
|
|
|
compilationList: [],
|
|
compilationList: [],
|
|
|
log: [],
|
|
log: [],
|
|
|
serviceLog: [],
|
|
serviceLog: [],
|
|
|
- client: []
|
|
|
|
|
|
|
+ client: {}
|
|
|
})
|
|
})
|
|
|
const initData = async id => {
|
|
const initData = async id => {
|
|
|
setState({ ...state, loading: true })
|
|
setState({ ...state, loading: true })
|
|
|
const {
|
|
const {
|
|
|
- data: { cloudUser = {}, compilationList = [], log = [], serviceLog = [], client = [] },
|
|
|
|
|
|
|
+ data: { cloudUser = {}, compilationList = [], log = [], serviceLog = [], client = {} },
|
|
|
code = -1
|
|
code = -1
|
|
|
} = await apiRoadpricingDetail({ ssoId: id, projectType })
|
|
} = await apiRoadpricingDetail({ ssoId: id, projectType })
|
|
|
if (code === consts.RET_CODE.SUCCESS) {
|
|
if (code === consts.RET_CODE.SUCCESS) {
|
|
@@ -61,7 +62,7 @@ const Detail = props => {
|
|
|
<ConnectClient
|
|
<ConnectClient
|
|
|
onSelect={refreshClient}
|
|
onSelect={refreshClient}
|
|
|
dataId={state.cloudUser.ssoId}
|
|
dataId={state.cloudUser.ssoId}
|
|
|
- // preUrl="RoadPricing"
|
|
|
|
|
|
|
+ preUrl="RoadPricing"
|
|
|
showFooter={false}
|
|
showFooter={false}
|
|
|
otherParams={{ projectType }}
|
|
otherParams={{ projectType }}
|
|
|
/>
|
|
/>
|
|
@@ -70,32 +71,22 @@ const Detail = props => {
|
|
|
})
|
|
})
|
|
|
toggleModal(true)
|
|
toggleModal(true)
|
|
|
}
|
|
}
|
|
|
- // 关联cld客户
|
|
|
|
|
- // const connectPricingLinkClient = async ssoId => {
|
|
|
|
|
- // const { code = -1 } = await apiRoadPricingLinkClient(preUrl, {
|
|
|
|
|
- // id: dataId,
|
|
|
|
|
- // ssoId,
|
|
|
|
|
- // client_id,
|
|
|
|
|
- // projectPype
|
|
|
|
|
- // })
|
|
|
|
|
- // if (code === consts.RET_CODE.SUCCESS) {
|
|
|
|
|
- // onSelect()
|
|
|
|
|
- // closeModal()
|
|
|
|
|
- // }
|
|
|
|
|
- // }
|
|
|
|
|
// 移除cld客户
|
|
// 移除cld客户
|
|
|
- // const connectPricingUnLinkClient = async ssoId => {
|
|
|
|
|
- // const { code = -1 } = await apiRoadPricingUnLinkClient(preUrl, {
|
|
|
|
|
- // id: dataId,
|
|
|
|
|
- // ssoId,
|
|
|
|
|
- // client_id,
|
|
|
|
|
- // projectPype
|
|
|
|
|
- // })
|
|
|
|
|
- // if (code === consts.RET_CODE.SUCCESS) {
|
|
|
|
|
- // onSelect()
|
|
|
|
|
- // closeModal()
|
|
|
|
|
- // }
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ const pricingUnLinkClient = clientId => {
|
|
|
|
|
+ Modal.confirm({
|
|
|
|
|
+ zIndex: 1002,
|
|
|
|
|
+ title: '确认移除',
|
|
|
|
|
+ onOk: async () => {
|
|
|
|
|
+ await apiRoadPricingUnLinkClient(actionPayload, {
|
|
|
|
|
+ id: dataId,
|
|
|
|
|
+ clientId,
|
|
|
|
|
+ projectPype: projectType
|
|
|
|
|
+ })
|
|
|
|
|
+ refreshClient()
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
shouldUpdate && initData(dataId)
|
|
shouldUpdate && initData(dataId)
|
|
|
}, [shouldUpdate])
|
|
}, [shouldUpdate])
|
|
@@ -119,10 +110,12 @@ const Detail = props => {
|
|
|
<ClientDetail client={state.client} filterTag={filterTag} />
|
|
<ClientDetail client={state.client} filterTag={filterTag} />
|
|
|
</div>
|
|
</div>
|
|
|
<div className="text-center mt-6">
|
|
<div className="text-center mt-6">
|
|
|
- <Button type="primary" ghost size="small">
|
|
|
|
|
- <LinkInterrupt size="14" />
|
|
|
|
|
- <span className="ml-5px">移除CLD客户</span>
|
|
|
|
|
- </Button>
|
|
|
|
|
|
|
+ <Tooltip placement="right" title="移除CLD客户">
|
|
|
|
|
+ <Button type="primary" ghost size="small" onClick={pricingUnLinkClient}>
|
|
|
|
|
+ <LinkInterrupt size="14" />
|
|
|
|
|
+ <span className="ml-5px">移除CLD客户</span>
|
|
|
|
|
+ </Button>
|
|
|
|
|
+ </Tooltip>
|
|
|
</div>
|
|
</div>
|
|
|
</>
|
|
</>
|
|
|
) : (
|
|
) : (
|