mirror of
https://github.com/eyebluecn/tank-front
synced 2024-04-21 12:31:55 +00:00
prepare batchMove
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
|
||||
.matter-list {
|
||||
padding: 5px;
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ import ImagePreviewer from "../widget/previewer/ImagePreviewer";
|
||||
import Sun from "../../common/model/global/Sun";
|
||||
import { UserRole } from "../../common/model/user/UserRole";
|
||||
import StringUtil from "../../common/util/StringUtil";
|
||||
import MoveBatchPanel from "./widget/MoveBatchPanel";
|
||||
|
||||
interface IProps extends RouteComponentProps {}
|
||||
|
||||
@@ -34,7 +35,7 @@ export default class List extends TankComponent<IProps, IState> {
|
||||
//搜索的文字
|
||||
searchText: string | null = null;
|
||||
//获取分页的一个帮助器
|
||||
pager = new Pager<Matter>(this, Matter, 10); // todo 分页
|
||||
pager = new Pager<Matter>(this, Matter, 100); // todo 分页
|
||||
//移动的目标文件夹
|
||||
targetMatterUuid: string | null = null;
|
||||
user = Moon.getSingleton().user;
|
||||
@@ -326,10 +327,11 @@ export default class List extends TankComponent<IProps, IState> {
|
||||
|
||||
<Modal
|
||||
visible={moveModalVisible}
|
||||
title="移动到"
|
||||
width="50vw"
|
||||
onCancel={this.toggleMoveBatch}
|
||||
footer={null}
|
||||
>
|
||||
<Tree.DirectoryTree />
|
||||
<MoveBatchPanel />
|
||||
</Modal>
|
||||
|
||||
{Children.toArray(
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
import React from "react";
|
||||
import Pager from "../../../common/model/base/Pager";
|
||||
import Matter from "../../../common/model/matter/Matter";
|
||||
import TankComponent from "../../../common/component/TankComponent";
|
||||
import {Tree} from "antd";
|
||||
|
||||
interface IProps {
|
||||
}
|
||||
|
||||
interface IState {}
|
||||
|
||||
export default class UploadMatterPanel extends TankComponent<IProps, IState> {
|
||||
|
||||
pager = new Pager<Matter>(this, Matter, 10);
|
||||
targetMatter = new Matter();
|
||||
treeData = [];
|
||||
|
||||
constructor(props: IProps) {
|
||||
super(props);
|
||||
this.state = {};
|
||||
}
|
||||
componentDidMount() {
|
||||
this.listDir();
|
||||
}
|
||||
|
||||
fetchData() {
|
||||
this.pager.httpList((response: any) => {
|
||||
const {data, page, totalPages} = response.data.data;
|
||||
// todo do something
|
||||
if(page + 1 < totalPages) {
|
||||
this.pager.page++;
|
||||
this.fetchData();
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
listDir = (pMatter?: Matter) => {
|
||||
if(pMatter) {
|
||||
this.pager.setFilterValue('puuid', pMatter.uuid);
|
||||
} else {
|
||||
this.pager.setFilterValue('puuid', 'root');
|
||||
}
|
||||
this.pager.setFilterValue('dir', true);
|
||||
this.fetchData();
|
||||
};
|
||||
|
||||
// treeData = [
|
||||
// {
|
||||
// title: 'parent 0',
|
||||
// key: '0-0',
|
||||
// children: [
|
||||
// { title: 'leaf 0-0', key: '0-0-0' },
|
||||
// { title: 'leaf 0-1', key: '0-0-1', isLeaf: true },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// title: 'parent 1',
|
||||
// key: '0-1',
|
||||
// children: [
|
||||
// { title: 'leaf 1-0', key: '0-1-0', isLeaf: true },
|
||||
// { title: 'leaf 1-1', key: '0-1-1', isLeaf: true },
|
||||
// ],
|
||||
// },
|
||||
// ];
|
||||
|
||||
onSelect = (keys: any, event: any) => {
|
||||
console.log('Trigger Select', keys, event);
|
||||
};
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Tree.DirectoryTree treeData={this.treeData} onSelect={this.onSelect}/>
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
import React from "react";
|
||||
import TankComponent from "../../../common/component/TankComponent";
|
||||
import Matter from "../../../common/model/matter/Matter";
|
||||
import Director from "./Director";
|
||||
import StringUtil from "../../../common/util/StringUtil";
|
||||
import { Progress } from "antd";
|
||||
import "./UploadMatterPanel.less";
|
||||
|
||||
Reference in New Issue
Block a user