mirror of
https://github.com/eyebluecn/tank-front
synced 2024-04-21 12:31:55 +00:00
upgrade matter detail
This commit is contained in:
@@ -143,38 +143,6 @@ export default class Matter extends BaseEntity {
|
||||
return FileUtil.isImage(this.name);
|
||||
}
|
||||
|
||||
isPdf() {
|
||||
return FileUtil.isPdf(this.name);
|
||||
}
|
||||
|
||||
isText() {
|
||||
return FileUtil.isText(this.name);
|
||||
}
|
||||
|
||||
isDoc() {
|
||||
return FileUtil.isDoc(this.name);
|
||||
}
|
||||
|
||||
isPpt() {
|
||||
return FileUtil.isPpt(this.name);
|
||||
}
|
||||
|
||||
isXls() {
|
||||
return FileUtil.isXls(this.name);
|
||||
}
|
||||
|
||||
isAudio() {
|
||||
return FileUtil.isAudio(this.name);
|
||||
}
|
||||
|
||||
isVideo() {
|
||||
return FileUtil.isVideo(this.name);
|
||||
}
|
||||
|
||||
isPsd() {
|
||||
return FileUtil.isPsd(this.name);
|
||||
}
|
||||
|
||||
getIcon() {
|
||||
if (FileUtil.isImage(this.name)) {
|
||||
return ImageUtil.handleImageUrl(this.getPreviewUrl(), false, 100, 100);
|
||||
@@ -314,6 +282,49 @@ export default class Matter extends BaseEntity {
|
||||
);
|
||||
}
|
||||
|
||||
httpDetail(
|
||||
successCallback?: any,
|
||||
errorCallback?: any,
|
||||
finallyCallback?: any
|
||||
) {
|
||||
let that = this;
|
||||
if (!this.uuid) {
|
||||
this.errorMessage = 'uuid未指定,无法获取到详情!';
|
||||
|
||||
this.defaultErrorHandler(this.errorMessage, errorCallback);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
this.detailLoading = true;
|
||||
|
||||
this.httpGet(
|
||||
this.getUrlDetail(),
|
||||
{
|
||||
uuid: this.uuid,
|
||||
spaceUuid: this.spaceUuid,
|
||||
},
|
||||
function (response: any) {
|
||||
that.detailLoading = false;
|
||||
|
||||
that.assign(response.data.data);
|
||||
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
},
|
||||
function (response: any) {
|
||||
that.detailLoading = false;
|
||||
|
||||
if (typeof errorCallback === 'function') {
|
||||
errorCallback(that.getErrorMessage(response), response);
|
||||
} else {
|
||||
//没有传入错误处理的方法就采用默认处理方法:toast弹出该错误信息。
|
||||
that.defaultErrorHandler(response);
|
||||
}
|
||||
},
|
||||
finallyCallback
|
||||
);
|
||||
}
|
||||
|
||||
httpRename(
|
||||
name: string,
|
||||
successCallback?: any,
|
||||
|
||||
@@ -498,6 +498,7 @@ export default class List extends TankComponent<IProps, IState> {
|
||||
|
||||
this.breadcrumbModels = [rootBreadcrumb];
|
||||
if (!isRootDirectory) {
|
||||
this.currentDirectory.spaceUuid = this.getSpaceUuid();
|
||||
this.currentDirectory.httpDetail(() => {
|
||||
const arr = [];
|
||||
let cur: Matter | null = this.currentDirectory;
|
||||
|
||||
@@ -193,7 +193,7 @@ export default class List extends TankComponent<IProps, IState> {
|
||||
</>
|
||||
}
|
||||
>
|
||||
<Progress percent={percent * 100} />
|
||||
<Progress percent={Math.round(percent * 100)} />
|
||||
</Tooltip>
|
||||
</div>
|
||||
</Card>
|
||||
|
||||
@@ -4,7 +4,6 @@ import './TableEmpty.less';
|
||||
import TankComponent from '../../common/component/TankComponent';
|
||||
import BreadcrumbModel from '../../common/model/base/option/BreadcrumbModel';
|
||||
import Sun from '../../common/model/global/Sun';
|
||||
import { HomeOutlined } from '@ant-design/icons/lib';
|
||||
|
||||
interface IProps {
|
||||
breadcrumbModels: BreadcrumbModel[];
|
||||
@@ -22,15 +21,6 @@ export default class BreadcrumbPanel extends TankComponent<IProps, IState> {
|
||||
render() {
|
||||
return (
|
||||
<Breadcrumb>
|
||||
{/*<Breadcrumb.Item>
|
||||
<HomeOutlined
|
||||
className="cursor"
|
||||
onClick={() => {
|
||||
Sun.navigateTo('/');
|
||||
}}
|
||||
/>
|
||||
</Breadcrumb.Item>*/}
|
||||
|
||||
{this.props.breadcrumbModels.map(
|
||||
(item: BreadcrumbModel, index: number) => {
|
||||
if (item.displayDirect) {
|
||||
|
||||
Reference in New Issue
Block a user