|
@@ -16,15 +16,29 @@ import {
|
|
|
} from '@ant-design/icons'
|
|
|
import LeftMenu from '../RuleCode/components/LeftMenu'
|
|
|
import ProTable from '@ant-design/pro-table'
|
|
|
+import { useState } from 'react'
|
|
|
|
|
|
export enum TemplateMode {
|
|
|
PAPER = 'paper',
|
|
|
UPLOAD = 'upload'
|
|
|
}
|
|
|
|
|
|
+interface IState {
|
|
|
+ subjectParams: {
|
|
|
+ gatherID?: Nullable<string>
|
|
|
+ businessType?: Nullable<string>
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
const Inventory = () => {
|
|
|
const contentHeight = document.body.clientHeight - 122
|
|
|
const [modal, ModalDOM] = useModal()
|
|
|
+ const [state, setState] = useState<IState>({
|
|
|
+ subjectParams: {
|
|
|
+ gatherID: '',
|
|
|
+ businessType: ''
|
|
|
+ }
|
|
|
+ })
|
|
|
const {
|
|
|
query,
|
|
|
loading,
|
|
@@ -99,6 +113,7 @@ const Inventory = () => {
|
|
|
const handleMenuOnChange = (key: string) => {
|
|
|
const [gatherID, businessType] = key.split('_')
|
|
|
query({ gatherID, businessType })
|
|
|
+ setState({ ...state, subjectParams: { ...state.subjectParams, gatherID, businessType } })
|
|
|
}
|
|
|
return (
|
|
|
<PageContainer title={false}>
|
|
@@ -111,7 +126,12 @@ const Inventory = () => {
|
|
|
headerTitle={
|
|
|
<div className="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
|
|
|
+ icon={<FolderAddOutlined />}
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ ghost
|
|
|
+ onClick={() => addFolder(state.subjectParams)}>
|
|
|
新建目录
|
|
|
</Button>
|
|
|
<Button
|
|
@@ -119,7 +139,7 @@ const Inventory = () => {
|
|
|
size="small"
|
|
|
type="primary"
|
|
|
ghost
|
|
|
- onClick={() => addFile()}>
|
|
|
+ onClick={() => addFile('add', state.subjectParams)}>
|
|
|
新建文件
|
|
|
</Button>
|
|
|
<Button
|
|
@@ -129,7 +149,7 @@ const Inventory = () => {
|
|
|
ghost
|
|
|
onClick={() => {
|
|
|
record?.folder && editFolder()
|
|
|
- !record?.folder && addFile('update')
|
|
|
+ !record?.folder && addFile('update', state.subjectParams)
|
|
|
}}
|
|
|
disabled={!record}>
|
|
|
编辑
|