|
@@ -1,6 +1,6 @@
|
|
import useModal from '@/components/Modal'
|
|
import useModal from '@/components/Modal'
|
|
import { PageContainer } from '@ant-design/pro-layout'
|
|
import { PageContainer } from '@ant-design/pro-layout'
|
|
-import { Button, Dropdown, Table, Menu, Space } from 'antd'
|
|
|
|
|
|
+import { Button, Table } from 'antd'
|
|
import { ColumnsType } from 'antd/lib/table'
|
|
import { ColumnsType } from 'antd/lib/table'
|
|
import { useRowScript } from './hooks/useRowScript'
|
|
import { useRowScript } from './hooks/useRowScript'
|
|
import {
|
|
import {
|
|
@@ -11,27 +11,22 @@ import {
|
|
FileAddOutlined,
|
|
FileAddOutlined,
|
|
FolderAddOutlined,
|
|
FolderAddOutlined,
|
|
SelectOutlined,
|
|
SelectOutlined,
|
|
- DownOutlined,
|
|
|
|
FolderOpenFilled,
|
|
FolderOpenFilled,
|
|
FileTextOutlined
|
|
FileTextOutlined
|
|
} from '@ant-design/icons'
|
|
} from '@ant-design/icons'
|
|
|
|
+import LeftMenu from '../RuleCode/components/LeftMenu'
|
|
|
|
|
|
export enum TemplateMode {
|
|
export enum TemplateMode {
|
|
PAPER = 'paper',
|
|
PAPER = 'paper',
|
|
UPLOAD = 'upload'
|
|
UPLOAD = 'upload'
|
|
}
|
|
}
|
|
-const items = [
|
|
|
|
- {
|
|
|
|
- key: '1',
|
|
|
|
- label: '预算业务审批'
|
|
|
|
- }
|
|
|
|
-]
|
|
|
|
|
|
|
|
const Inventory = () => {
|
|
const Inventory = () => {
|
|
const contentHeight = document.body.clientHeight - 122
|
|
const contentHeight = document.body.clientHeight - 122
|
|
const [modal, ModalDOM] = useModal()
|
|
const [modal, ModalDOM] = useModal()
|
|
|
|
|
|
const {
|
|
const {
|
|
|
|
+ query,
|
|
loading,
|
|
loading,
|
|
record,
|
|
record,
|
|
list = [],
|
|
list = [],
|
|
@@ -101,98 +96,95 @@ const Inventory = () => {
|
|
}
|
|
}
|
|
]
|
|
]
|
|
|
|
|
|
|
|
+ const handleMenuOnChange = (key: string) => {
|
|
|
|
+ const [subjectID, businessType] = key.split('_')
|
|
|
|
+ query({ subjectID, businessType })
|
|
|
|
+ }
|
|
return (
|
|
return (
|
|
<PageContainer title={false}>
|
|
<PageContainer title={false}>
|
|
- <div style={{ height: `${contentHeight}px` }} className="bg-white">
|
|
|
|
- <Table
|
|
|
|
- rowKey="ID"
|
|
|
|
- title={() => (
|
|
|
|
- <div className="ml-2 flex flex-nowrap justify-start items-center">
|
|
|
|
- <Dropdown
|
|
|
|
- overlay={<Menu selectable defaultSelectedKeys={['1']} items={items} />}
|
|
|
|
- trigger={['click']}>
|
|
|
|
- <div className="font-bold cursor-pointer">
|
|
|
|
- <Space>
|
|
|
|
- {items[0].label}
|
|
|
|
- <DownOutlined />
|
|
|
|
- </Space>
|
|
|
|
|
|
+ <div className="h-full w-full flex flex-row">
|
|
|
|
+ <LeftMenu title="业务列表" onChange={key => handleMenuOnChange(key)} />
|
|
|
|
+ <div style={{ height: `${contentHeight}px` }} className="bg-white w-6/7 ml-8">
|
|
|
|
+ <Table
|
|
|
|
+ rowKey="ID"
|
|
|
|
+ title={() => (
|
|
|
|
+ <div className="ml-2 flex flex-nowrap justify-start items-center">
|
|
|
|
+ <div className="children:mx-1 px-1 py-2 ">
|
|
|
|
+ <Button icon={<FolderAddOutlined />} size="small" type="primary" ghost onClick={addFolder}>
|
|
|
|
+ 新建目录
|
|
|
|
+ </Button>
|
|
|
|
+ <Button
|
|
|
|
+ icon={<FileAddOutlined />}
|
|
|
|
+ size="small"
|
|
|
|
+ type="primary"
|
|
|
|
+ ghost
|
|
|
|
+ onClick={() => addFile()}>
|
|
|
|
+ 新建文件
|
|
|
|
+ </Button>
|
|
|
|
+ <Button
|
|
|
|
+ icon={<EditOutlined />}
|
|
|
|
+ size="small"
|
|
|
|
+ type="primary"
|
|
|
|
+ ghost
|
|
|
|
+ onClick={() => {
|
|
|
|
+ record?.folder && editFolder()
|
|
|
|
+ !record?.folder && addFile('update')
|
|
|
|
+ }}
|
|
|
|
+ disabled={!record}>
|
|
|
|
+ 编辑
|
|
|
|
+ </Button>
|
|
|
|
+ <Button
|
|
|
|
+ icon={<DeleteOutlined />}
|
|
|
|
+ size="small"
|
|
|
|
+ type="primary"
|
|
|
|
+ ghost
|
|
|
|
+ onClick={deleteFolderOrFile}
|
|
|
|
+ disabled={!record}>
|
|
|
|
+ 删除
|
|
|
|
+ </Button>
|
|
|
|
+ <Button
|
|
|
|
+ icon={<ArrowUpOutlined />}
|
|
|
|
+ size="small"
|
|
|
|
+ type="primary"
|
|
|
|
+ ghost
|
|
|
|
+ disabled={!record?.moveable || record?.position === 'top'}
|
|
|
|
+ onClick={() => moveWithOperation('up')}>
|
|
|
|
+ 上移
|
|
|
|
+ </Button>
|
|
|
|
+ <Button
|
|
|
|
+ icon={<ArrowDownOutlined />}
|
|
|
|
+ size="small"
|
|
|
|
+ type="primary"
|
|
|
|
+ ghost
|
|
|
|
+ disabled={!record?.moveable || record?.position === 'bottom'}
|
|
|
|
+ onClick={() => moveWithOperation('down')}>
|
|
|
|
+ 下移
|
|
|
|
+ </Button>
|
|
|
|
+ <Button
|
|
|
|
+ icon={<SelectOutlined />}
|
|
|
|
+ size="small"
|
|
|
|
+ type="primary"
|
|
|
|
+ ghost
|
|
|
|
+ disabled={!record}
|
|
|
|
+ onClick={move}>
|
|
|
|
+ 移动至
|
|
|
|
+ </Button>
|
|
</div>
|
|
</div>
|
|
- </Dropdown>
|
|
|
|
- <div className="children:mx-1 px-1 py-2 ml-5">
|
|
|
|
- <Button icon={<FolderAddOutlined />} size="small" type="primary" ghost onClick={addFolder}>
|
|
|
|
- 新建目录
|
|
|
|
- </Button>
|
|
|
|
- <Button
|
|
|
|
- icon={<FileAddOutlined />}
|
|
|
|
- size="small"
|
|
|
|
- type="primary"
|
|
|
|
- ghost
|
|
|
|
- onClick={() => addFile()}>
|
|
|
|
- 新建文件
|
|
|
|
- </Button>
|
|
|
|
- <Button
|
|
|
|
- icon={<EditOutlined />}
|
|
|
|
- size="small"
|
|
|
|
- type="primary"
|
|
|
|
- ghost
|
|
|
|
- onClick={() => {
|
|
|
|
- record?.folder && editFolder()
|
|
|
|
- !record?.folder && addFile('update')
|
|
|
|
- }}
|
|
|
|
- disabled={!record}>
|
|
|
|
- 编辑
|
|
|
|
- </Button>
|
|
|
|
- <Button
|
|
|
|
- icon={<DeleteOutlined />}
|
|
|
|
- size="small"
|
|
|
|
- type="primary"
|
|
|
|
- ghost
|
|
|
|
- onClick={deleteFolderOrFile}
|
|
|
|
- disabled={!record}>
|
|
|
|
- 删除
|
|
|
|
- </Button>
|
|
|
|
- <Button
|
|
|
|
- icon={<ArrowUpOutlined />}
|
|
|
|
- size="small"
|
|
|
|
- type="primary"
|
|
|
|
- ghost
|
|
|
|
- disabled={!record?.moveable || record?.position === 'top'}
|
|
|
|
- onClick={() => moveWithOperation('up')}>
|
|
|
|
- 上移
|
|
|
|
- </Button>
|
|
|
|
- <Button
|
|
|
|
- icon={<ArrowDownOutlined />}
|
|
|
|
- size="small"
|
|
|
|
- type="primary"
|
|
|
|
- ghost
|
|
|
|
- disabled={!record?.moveable || record?.position === 'bottom'}
|
|
|
|
- onClick={() => moveWithOperation('down')}>
|
|
|
|
- 下移
|
|
|
|
- </Button>
|
|
|
|
- <Button
|
|
|
|
- icon={<SelectOutlined />}
|
|
|
|
- size="small"
|
|
|
|
- type="primary"
|
|
|
|
- ghost
|
|
|
|
- disabled={!record}
|
|
|
|
- onClick={move}>
|
|
|
|
- 移动至
|
|
|
|
- </Button>
|
|
|
|
</div>
|
|
</div>
|
|
- </div>
|
|
|
|
- )}
|
|
|
|
- loading={loading}
|
|
|
|
- columns={columns}
|
|
|
|
- dataSource={list}
|
|
|
|
- pagination={false}
|
|
|
|
- size="small"
|
|
|
|
- bordered
|
|
|
|
- expandable={{ defaultExpandAllRows: true }}
|
|
|
|
- onRow={record => ({
|
|
|
|
- onClick: () => rowClick(record)
|
|
|
|
- })}
|
|
|
|
- rowClassName={row => (row.ID === record?.ID ? 'ant-table-row-selected' : '')}
|
|
|
|
- />
|
|
|
|
|
|
+ )}
|
|
|
|
+ loading={loading}
|
|
|
|
+ columns={columns}
|
|
|
|
+ dataSource={list}
|
|
|
|
+ pagination={false}
|
|
|
|
+ size="small"
|
|
|
|
+ bordered
|
|
|
|
+ expandable={{ defaultExpandAllRows: true }}
|
|
|
|
+ onRow={record => ({
|
|
|
|
+ onClick: () => rowClick(record)
|
|
|
|
+ })}
|
|
|
|
+ rowClassName={row => (row.ID === record?.ID ? 'ant-table-row-selected' : '')}
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
{ModalDOM}
|
|
{ModalDOM}
|
|
</PageContainer>
|
|
</PageContainer>
|