|
@@ -1,11 +1,13 @@
|
|
|
import Header from '@/components/Header'
|
|
|
import Slot from '@/components/Header/slot'
|
|
|
-import { contractStore } from '@/store/mobx'
|
|
|
+import { contractStore, tenderStore } from '@/store/mobx'
|
|
|
import { iIncomeTree, iModalBooleanProps } from '@/types/contract'
|
|
|
import { contractTreeBaseId } from '@/utils/common/constStatus'
|
|
|
+import consts from '@/utils/consts'
|
|
|
import { ArrowDownOutlined, ArrowLeftOutlined, ArrowRightOutlined, ArrowUpOutlined, CloseOutlined, PlusOutlined, SettingOutlined } from '@ant-design/icons'
|
|
|
import { Button, Tooltip } from 'antd'
|
|
|
import React, { useState } from 'react'
|
|
|
+import { apiResfulContractTree } from './api'
|
|
|
import ContractModal from './components/Modal'
|
|
|
import TableContent from './components/TableContent'
|
|
|
|
|
@@ -66,12 +68,12 @@ export default function Income() {
|
|
|
}
|
|
|
const treeResfulApiHandler = async (type: string, payload: any) => {
|
|
|
if (type === 'add') {
|
|
|
- contractStore.addRowTree(payload.id)
|
|
|
+ return contractStore.addRowTree(payload.id)
|
|
|
+ }
|
|
|
+ const { code } = await apiResfulContractTree(type, payload)
|
|
|
+ if ( code === consts.RET_CODE.SUCCESS) {
|
|
|
+ contractStore.resetTree(tenderStore.bidsectionId)
|
|
|
}
|
|
|
- // const { code } = await apiResfulContractTree(type, payload)
|
|
|
- // if ( code === consts.RET_CODE.SUCCESS) {
|
|
|
- // contractStore.resetTree(tenderStore.bidsectionId)
|
|
|
- // }
|
|
|
}
|
|
|
return (
|
|
|
<div className="content-wrap">
|
|
@@ -82,19 +84,19 @@ export default function Income() {
|
|
|
row.id ?
|
|
|
<>
|
|
|
<Tooltip title="添加子项">
|
|
|
- <Button type="text" icon={<PlusOutlined style={{ color: '#007bff' }}/>} onClick={() => treeResfulApiHandler('add', { id: row.id, bidsctionId: row.bidsectionId })}></Button>
|
|
|
+ <Button type="text" icon={<PlusOutlined style={{ color: '#007bff' }}/>} onClick={() => treeResfulApiHandler('add', { id: row.id, bidsectionId: row.bidsectionId })}></Button>
|
|
|
</Tooltip>
|
|
|
{
|
|
|
!row.children?.length ?
|
|
|
<Tooltip title="删除">
|
|
|
- <Button type="text" icon={<CloseOutlined style={{ color: '#007bff' }}/>} onClick={() => treeResfulApiHandler('del', { id: row.id, bidsctionId: row.bidsectionId })} />
|
|
|
+ <Button type="text" icon={<CloseOutlined style={{ color: '#007bff' }}/>} onClick={() => treeResfulApiHandler('del', { id: row.id, bidsectionId: row.bidsectionId })} />
|
|
|
</Tooltip>
|
|
|
: <span className="pi-width-32 pi-height-32 pi-pd-tb-4 pi-flex-row-center"><CloseOutlined style={{ color: '#9a9a9a', fontSize: '14px' }}/></span>
|
|
|
}
|
|
|
{
|
|
|
row.parentId && row.parentId !== contractTreeBaseId ?
|
|
|
<Tooltip title="升级">
|
|
|
- <Button type="text" icon={<ArrowLeftOutlined />} style={{ color: '#007bff' }} onClick={() => treeResfulApiHandler('depth', { id: row.id, bidsctionId: row.bidsectionId, operation: 'upDepth' })}></Button>
|
|
|
+ <Button type="text" icon={<ArrowLeftOutlined />} style={{ color: '#007bff' }} onClick={() => treeResfulApiHandler('depth', { id: row.id, bidsectionId: row.bidsectionId, operation: 'upDepth' })}></Button>
|
|
|
</Tooltip>
|
|
|
:
|
|
|
<span className="pi-width-32 pi-height-32 pi-pd-tb-4 pi-flex-row-center"><ArrowLeftOutlined style={{ color: '#9a9a9a', fontSize: '14px' }}/></span>
|
|
@@ -102,7 +104,7 @@ export default function Income() {
|
|
|
{
|
|
|
row.elderBrother ?
|
|
|
<Tooltip title="降级">
|
|
|
- <Button type="text" icon={<ArrowRightOutlined style={{ color: '#007bff' }}/>} onClick={() => treeResfulApiHandler('depth', { id: row.id, bidsctionId: row.bidsectionId, operation: 'downDepth' })} ></Button>
|
|
|
+ <Button type="text" icon={<ArrowRightOutlined style={{ color: '#007bff' }}/>} onClick={() => treeResfulApiHandler('depth', { id: row.id, bidsectionId: row.bidsectionId, operation: 'downDepth' })} ></Button>
|
|
|
</Tooltip>
|
|
|
:
|
|
|
<span className="pi-width-32 pi-height-32 pi-pd-tb-4 pi-flex-row-center"><ArrowRightOutlined style={{ color: '#9a9a9a', fontSize: '14px' }}/></span>
|
|
@@ -110,7 +112,7 @@ export default function Income() {
|
|
|
{
|
|
|
row.elderBrother ?
|
|
|
<Tooltip title="上移">
|
|
|
- <Button type="text" icon={<ArrowUpOutlined style={{ color: '#007bff' }}/>} onClick={() => treeResfulApiHandler('serial', { id: row.id, bidsctionId: row.bidsectionId, operation: 'upSerial' })} disabled={!row.elderBrother}></Button>
|
|
|
+ <Button type="text" icon={<ArrowUpOutlined style={{ color: '#007bff' }}/>} onClick={() => treeResfulApiHandler('serial', { id: row.id, bidsectionId: row.bidsectionId, operation: 'upSerial' })} disabled={!row.elderBrother}></Button>
|
|
|
</Tooltip>
|
|
|
:
|
|
|
<span className="pi-width-32 pi-height-32 pi-pd-tb-4 pi-flex-row-center"><ArrowUpOutlined style={{ color: '#9a9a9a', fontSize: '14px' }}/></span>
|
|
@@ -118,7 +120,7 @@ export default function Income() {
|
|
|
{
|
|
|
!row.isEnd ?
|
|
|
<Tooltip title="下移">
|
|
|
- <Button type="text" icon={<ArrowDownOutlined style={{ color: '#007bff' }}/>} onClick={() => treeResfulApiHandler('serial', { id: row.id, bidsctionId: row.bidsectionId, operation: 'downSerial' })} disabled={row.isEnd}></Button>
|
|
|
+ <Button type="text" icon={<ArrowDownOutlined style={{ color: '#007bff' }}/>} onClick={() => treeResfulApiHandler('serial', { id: row.id, bidsectionId: row.bidsectionId, operation: 'downSerial' })} disabled={row.isEnd}></Button>
|
|
|
</Tooltip>
|
|
|
:
|
|
|
<span className="pi-width-32 pi-height-32 pi-pd-tb-4 pi-flex-row-center"><ArrowDownOutlined style={{ color: '#9a9a9a', fontSize: '14px' }}/></span>
|