From 3c84e7f7822e5273afc09d378843bf1dfdea3258 Mon Sep 17 00:00:00 2001
From: HFO4 <912394456@qq.com>
Date: Sun, 1 Dec 2019 20:00:32 +0800
Subject: [PATCH] =?UTF-8?q?Feat:=20=E6=8B=96=E6=8B=BD=E7=A7=BB=E5=8A=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/actions/index.js | 8 +++
src/component/FileManager/ContextMenu.js | 21 ++++----
src/component/FileManager/Modals.js | 64 +++++++++++++++++------
src/component/FileManager/ObjectIcon.js | 13 +++--
src/component/FileManager/PathSelector.js | 13 +++--
src/component/Modals/Loading.js | 45 ++++++++++++++++
src/index.js | 3 ++
src/reducers/index.js | 8 +++
8 files changed, 141 insertions(+), 34 deletions(-)
create mode 100644 src/component/Modals/Loading.js
diff --git a/src/actions/index.js b/src/actions/index.js
index 7e34e68..4d54825 100644
--- a/src/actions/index.js
+++ b/src/actions/index.js
@@ -18,6 +18,14 @@ export const drawerToggleAction = open => {
};
};
+export const dragAndDrop = (source,target) => {
+ return {
+ type: "DRAG_AND_DROP",
+ source: source,
+ target: target,
+ };
+};
+
export const changeViewMethod = method => {
return {
type: "CHANGE_VIEW_METHOD",
diff --git a/src/component/FileManager/ContextMenu.js b/src/component/FileManager/ContextMenu.js
index 12a6c6d..f9f23c0 100644
--- a/src/component/FileManager/ContextMenu.js
+++ b/src/component/FileManager/ContextMenu.js
@@ -32,6 +32,9 @@ import OpenIcon from '@material-ui/icons/OpenInNew'
import {MagnetOn} from 'mdi-material-ui'
import {baseURL} from "../../middleware/Api"
import { withStyles, Popover, Typography, MenuList, MenuItem, Divider, ListItemIcon } from '@material-ui/core';
+import pathHelper from "../../untils/page"
+import {withRouter} from 'react-router-dom'
+import Auth from "../../middleware/Auth"
const styles = theme => ({
propover:{
@@ -164,14 +167,14 @@ class ContextMenuCompoment extends Component {
window.open(window.apiURL.preview+"/?action=preview&path="+encodeURIComponent(previewPath));
return;
case 'video':
- if(window.isSharePage){
+ if(pathHelper.isSharePage(this.props.location.pathname)){
window.location.href=("/Viewer/Video?share=true&shareKey="+window.shareInfo.shareId+"&path="+encodeURIComponent(previewPath));
return;
}
window.location.href=("/Viewer/Video?&path="+encodeURIComponent(previewPath));
return;
case 'edit':
- if(window.isSharePage){
+ if(pathHelper.isSharePage(this.props.location.pathname)){
window.location.href=("/Viewer/Markdown?share=true&shareKey="+window.shareInfo.shareId+"&path="+encodeURIComponent(previewPath));
return;
}
@@ -211,7 +214,7 @@ class ContextMenuCompoment extends Component {
上传文件
- {window.uploadConfig.allowRemoteDownload==="1"&&
+ {Auth.GetUser().group.allowRemoteDownload&&
}
- {(!this.props.isMultiple&&this.props.withFile&&(window.uploadConfig.allowSource==="1"))&&
+ {(!this.props.isMultiple&&this.props.withFile&&(Auth.GetUser().policy.allowSource))&&
}
- {(!this.props.isMultiple&&window.isHomePage&&(window.uploadConfig.allowTorrentDownload==="1")&&this.props.withFile&&isTorrent(this.props.selected[0].name))&&
+ {(!this.props.isMultiple&&pathHelper.isHomePage(this.props.location.pathname)&&(Auth.GetUser().group.allowTorrentDownload)&&this.props.withFile&&isTorrent(this.props.selected[0].name))&&
}
- {(!this.props.isMultiple &&window.isHomePage)&&
+ {(!this.props.isMultiple && pathHelper.isHomePage(this.props.location.pathname))&&
}
- {(!this.props.isMultiple&&window.isHomePage)&&
+ {(!this.props.isMultiple&&pathHelper.isHomePage(this.props.location.pathname))&&
}
- {window.isHomePage&&
+ {pathHelper.isHomePage(this.props.location.pathname)&&