|
@@ -1,12 +1,11 @@
|
|
|
import Header from '@/components/Header'
|
|
|
import Slot from '@/components/Header/slot'
|
|
|
+import { contractStore } 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 { apiContractSheet } from './api'
|
|
|
import ContractModal from './components/Modal'
|
|
|
import TableContent from './components/TableContent'
|
|
|
|
|
@@ -17,6 +16,8 @@ export default function Income() {
|
|
|
confirmLoading: false
|
|
|
})
|
|
|
const [ row, setRow ] = useState<iIncomeTree>({
|
|
|
+ elderBrother: false,
|
|
|
+ isEnd: false,
|
|
|
attribsortution: 0,
|
|
|
attribution: '',
|
|
|
bidsectionId: '',
|
|
@@ -45,10 +46,10 @@ export default function Income() {
|
|
|
...modalObj,
|
|
|
confirmLoading: true
|
|
|
})
|
|
|
- const { code = -1 } = await apiContractSheet()
|
|
|
- if (code === consts.RET_CODE.SUCCESS) {
|
|
|
+ // const { code = -1 } = await apiContractIncome()
|
|
|
+ // if (code === consts.RET_CODE.SUCCESS) {
|
|
|
//
|
|
|
- }
|
|
|
+ // }
|
|
|
setModalObj({
|
|
|
...modalObj,
|
|
|
type: '',
|
|
@@ -63,6 +64,15 @@ export default function Income() {
|
|
|
type
|
|
|
})
|
|
|
}
|
|
|
+ const treeResfulApiHandler = async (type: string, payload: any) => {
|
|
|
+ if (type === 'add') {
|
|
|
+ contractStore.addRowTree(payload.id)
|
|
|
+ }
|
|
|
+ // const { code } = await apiResfulContractTree(type, payload)
|
|
|
+ // if ( code === consts.RET_CODE.SUCCESS) {
|
|
|
+ // contractStore.resetTree(tenderStore.bidsectionId)
|
|
|
+ // }
|
|
|
+ }
|
|
|
return (
|
|
|
<div className="content-wrap">
|
|
|
<Header title="维护项目节:">
|
|
@@ -72,36 +82,50 @@ export default function Income() {
|
|
|
row.id ?
|
|
|
<>
|
|
|
<Tooltip title="添加子项">
|
|
|
- <Button type="text" icon={<PlusOutlined style={{ color: '#007bff' }}/>}></Button>
|
|
|
+ <Button type="text" icon={<PlusOutlined style={{ color: '#007bff' }}/>} onClick={() => treeResfulApiHandler('add', { id: row.id, bidsctionId: row.bidsectionId })}></Button>
|
|
|
</Tooltip>
|
|
|
{
|
|
|
- !row.children ?
|
|
|
+ !row.children?.length ?
|
|
|
<Tooltip title="删除">
|
|
|
- <Button type="text" icon={<CloseOutlined style={{ color: '#007bff' }}/>}/>
|
|
|
- </Tooltip> : ''
|
|
|
+ <Button type="text" icon={<CloseOutlined style={{ color: '#007bff' }}/>} onClick={() => treeResfulApiHandler('del', { id: row.id, bidsctionId: 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' }}></Button>
|
|
|
- </Tooltip> : ''
|
|
|
+ <Button type="text" icon={<ArrowLeftOutlined />} style={{ color: '#007bff' }} onClick={() => treeResfulApiHandler('depth', { id: row.id, bidsctionId: 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>
|
|
|
+ }
|
|
|
+ {
|
|
|
+ row.elderBrother ?
|
|
|
+ <Tooltip title="降级">
|
|
|
+ <Button type="text" icon={<ArrowRightOutlined style={{ color: '#007bff' }}/>} onClick={() => treeResfulApiHandler('depth', { id: row.id, bidsctionId: 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>
|
|
|
+ }
|
|
|
+ {
|
|
|
+ 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>
|
|
|
+ </Tooltip>
|
|
|
+ :
|
|
|
+ <span className="pi-width-32 pi-height-32 pi-pd-tb-4 pi-flex-row-center"><ArrowUpOutlined style={{ color: '#9a9a9a', fontSize: '14px' }}/></span>
|
|
|
+ }
|
|
|
+ {
|
|
|
+ !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>
|
|
|
+ </Tooltip>
|
|
|
+ :
|
|
|
+ <span className="pi-width-32 pi-height-32 pi-pd-tb-4 pi-flex-row-center"><ArrowDownOutlined style={{ color: '#9a9a9a', fontSize: '14px' }}/></span>
|
|
|
}
|
|
|
-
|
|
|
- <Tooltip title="降级">
|
|
|
- <Button type="text" icon={<ArrowRightOutlined style={{ color: '#007bff' }}/>}></Button>
|
|
|
- </Tooltip>
|
|
|
-
|
|
|
- <Tooltip title="下移">
|
|
|
- <Button type="text" icon={<ArrowUpOutlined style={{ color: '#007bff' }}/>}></Button>
|
|
|
- </Tooltip>
|
|
|
-
|
|
|
- <Tooltip title="上移">
|
|
|
- <Button type="text" icon={<ArrowDownOutlined style={{ color: '#007bff' }}/>}></Button>
|
|
|
- </Tooltip>
|
|
|
</>
|
|
|
: ''
|
|
|
}
|
|
|
-
|
|
|
</div>
|
|
|
</Slot>
|
|
|
<Slot position="right">
|