diff --git a/package.json b/package.json index fbaea06..b888193 100644 --- a/package.json +++ b/package.json @@ -26,10 +26,8 @@ "react-dom": "^16.13.1", "react-router": "^5.2.0", "react-router-dom": "^5.2.0", - "react-transition-group": "^4.4.1", "semver": "6.3.0", "ts-pnp": "1.1.6", - "velocity-animate": "^1.5.2", "velocity-react": "^1.4.3" }, "scripts": { diff --git a/src/pages/matter/widget/MatterPanel.less b/src/pages/matter/widget/MatterPanel.less index 267d236..6983cc4 100644 --- a/src/pages/matter/widget/MatterPanel.less +++ b/src/pages/matter/widget/MatterPanel.less @@ -109,7 +109,11 @@ .more-panel { border-top: 1px solid #eee; - padding-left: 35px; + padding-left: 32px; + + .text { + margin-left: 5px; + } .matter-size { margin-left: 15px; @@ -124,25 +128,4 @@ } } } - - //.drop-enter { - // transform: translateY(-100%); - //} - //.drop-enter-active { - // transform: translateY(0); - // transition: transform 2000ms linear; - //} - //.drop-enter-done { - // transform: translateY(0); - //} - //.drop-exit { - // transform: translateY(0); - //} - //.drop-exit-active { - // transform: translateY(-100%); - // transition: transform 2000ms linear; - //} - //.drop-exit-done { - // transform: translateY(-100%); - //} } diff --git a/src/pages/matter/widget/MatterPanel.tsx b/src/pages/matter/widget/MatterPanel.tsx index f1accb8..b72a736 100644 --- a/src/pages/matter/widget/MatterPanel.tsx +++ b/src/pages/matter/widget/MatterPanel.tsx @@ -1,6 +1,5 @@ import React from "react"; import copy from "copy-to-clipboard"; -import VelocityReact from 'velocity-react'; import Matter from "../../../common/model/matter/Matter"; import TankComponent from "../../../common/component/TankComponent"; import Director from "./Director"; @@ -46,7 +45,6 @@ export default class MatterPanel extends TankComponent { renamingLoading: boolean = false; // 小屏幕下操作栏 showMore: boolean = false; - transitionStatus: boolean = false; inputRef = React.createRef(); @@ -337,95 +335,90 @@ export default class MatterPanel extends TankComponent { - - - - {this.showMore ? ( -
-
-
- {DateUtil.simpleDateHourMinute(matter.updateTime)} - + + {this.showMore ? ( +
+
+ {DateUtil.simpleDateHourMinute(matter.updateTime)} + {StringUtil.humanFileSize(matter.size)} -
- - {!matter.dir && matter.privacy && ( -
- SafeUtil.stopPropagationWrap(e)(this.changePrivacy(false)) - } - > - - 设置为公有文件 -
- )} - - {!matter.dir && !matter.privacy && ( -
- SafeUtil.stopPropagationWrap(e)(this.changePrivacy(true)) - } - > - - 设置为私有文件 -
- )} - -
- SafeUtil.stopPropagationWrap(e)( - Sun.navigateTo("/matter/detail/" + matter.uuid) - ) - } - > - - 文件详情 -
-
- SafeUtil.stopPropagationWrap(e)(this.prepareRename()) - } - > - - 重命名 -
-
- SafeUtil.stopPropagationWrap(e)(this.clipboard()) - } - > - - 复制下载链接 -
-
- SafeUtil.stopPropagationWrap(e)(matter.download()) - } - > - - 下载 -
-
- SafeUtil.stopPropagationWrap(e)(this.deleteMatter()) - } - > - - 删除 -
-
- ) : undefined} - + {!matter.dir && matter.privacy && ( +
+ SafeUtil.stopPropagationWrap(e)(this.changePrivacy(false)) + } + > + + 设置为公有文件 +
+ )} + + {!matter.dir && !matter.privacy && ( +
+ SafeUtil.stopPropagationWrap(e)(this.changePrivacy(true)) + } + > + + 设置为私有文件 +
+ )} + +
+ SafeUtil.stopPropagationWrap(e)( + Sun.navigateTo("/matter/detail/" + matter.uuid) + ) + } + > + + 文件详情 +
+
+ SafeUtil.stopPropagationWrap(e)(this.prepareRename()) + } + > + + 重命名 +
+
+ SafeUtil.stopPropagationWrap(e)(this.clipboard()) + } + > + + 复制下载链接 +
+
+ SafeUtil.stopPropagationWrap(e)(matter.download()) + } + > + + 下载 +
+
+ SafeUtil.stopPropagationWrap(e)(this.deleteMatter()) + } + > + + 删除 +
+
+ ) : null} +
); } diff --git a/src/pages/matter/widget/imageCache/ImageCachePanel.less b/src/pages/matter/widget/imageCache/ImageCachePanel.less index f05cd33..1a2b435 100644 --- a/src/pages/matter/widget/imageCache/ImageCachePanel.less +++ b/src/pages/matter/widget/imageCache/ImageCachePanel.less @@ -11,7 +11,7 @@ display: inline-block; vertical-align: middle; line-height: @base-height; - margin-right: 5px; + margin-right: 10px; } .image-cache-icon { @@ -88,13 +88,20 @@ .more-panel { border-top: 1px solid #eee; - padding-left: 35px; - .info { - } + padding-left: 32px; .cell-btn { border-top: 1px solid #eee; line-height: @inner-cell-height; vertical-align: middle; + &:first-child { + border: 0; + } + } + .text { + margin-left: 5px; + } + .matter-size { + margin-left: 15px; } } } diff --git a/src/pages/matter/widget/imageCache/ImageCachePanel.tsx b/src/pages/matter/widget/imageCache/ImageCachePanel.tsx index 9a8ecdd..ee80bed 100644 --- a/src/pages/matter/widget/imageCache/ImageCachePanel.tsx +++ b/src/pages/matter/widget/imageCache/ImageCachePanel.tsx @@ -5,11 +5,17 @@ import SafeUtil from "../../../../common/util/SafeUtil"; import ImageCache from "../../../../common/model/image/cache/ImageCache"; import ImageUtil from "../../../../common/util/ImageUtil"; import { CheckboxChangeEvent } from "antd/es/checkbox"; -import { DeleteFilled, ExclamationCircleFilled } from "@ant-design/icons"; +import { + DeleteOutlined, + ExclamationCircleFilled, + SmallDashOutlined, +} from "@ant-design/icons"; import MessageBoxUtil from "../../../../common/util/MessageBoxUtil"; import FileUtil from "../../../../common/util/FileUtil"; import DateUtil from "../../../../common/util/DateUtil"; +import Expanding from "../../../widget/Expanding"; import "./ImageCachePanel.less"; +import StringUtil from "../../../../common/util/StringUtil"; interface IProps { imageCache: ImageCache; @@ -23,6 +29,7 @@ interface IState {} export default class ImageCachePanel extends TankComponent { //正在向服务器提交rename的请求 renamingLoading = false; + // 小屏幕下操作栏 showMore = false; clickRow = () => {}; @@ -46,6 +53,11 @@ export default class ImageCachePanel extends TankComponent { }); }; + toggleHandles = () => { + this.showMore = !this.showMore; + this.updateUI(); + }; + render() { const { imageCache } = this.props; @@ -58,7 +70,7 @@ export default class ImageCachePanel extends TankComponent { ) } > -
+
@@ -86,7 +98,8 @@ export default class ImageCachePanel extends TankComponent {
{imageCache.uuid ? (
- SafeUtil.stopPropagationWrap(e)(this.deleteImageCache()) @@ -101,14 +114,48 @@ export default class ImageCachePanel extends TankComponent {
) : null}
+ + {/*在小屏下的操作栏*/} +
+ + SafeUtil.stopPropagationWrap(e)(this.toggleHandles()) + } + > + + +
+
{imageCache.name}
- - {/*todo 在小屏下的操作栏*/}
+ + {this.showMore ? ( +
+
+ + {DateUtil.simpleDateHourMinute(imageCache.updateTime)} + + + {StringUtil.humanFileSize(imageCache.size)} + +
+
+ SafeUtil.stopPropagationWrap(e)(this.deleteImageCache()) + } + > + + 删除 +
+
+ ) : null} +
); diff --git a/src/pages/widget/Expanding.tsx b/src/pages/widget/Expanding.tsx index b92f731..3ddbaef 100644 --- a/src/pages/widget/Expanding.tsx +++ b/src/pages/widget/Expanding.tsx @@ -1,41 +1,20 @@ import React, { Component } from "react"; -import { Transition } from "react-transition-group"; -import Velocity from "velocity-animate"; +import VelocityReact from "velocity-react"; import SafeUtil from "../../common/util/SafeUtil"; -interface IProps { - inStatus: boolean; - onExited?: () => any -} +interface IProps {} interface IState {} export default class Expanding extends Component { - onEnter = (el: HTMLElement) => { - Velocity(el, "slideDown"); - }; - - onExit = (el: HTMLElement) => { - Velocity(el, "slideUp"); - }; - - onExited = () => { - SafeUtil.safeCallback(this.props.onExited)(); - }; - render() { return ( - - <> - {this.props.children} - - + {this.props.children} + ); } }