upgrade matter detail

This commit is contained in:
seaheart
2023-06-25 23:33:30 +08:00
parent 43c3a8b936
commit c927a78e95
4 changed files with 45 additions and 43 deletions
+43 -32
View File
@@ -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,
+1
View File
@@ -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;
+1 -1
View File
@@ -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>
-10
View File
@@ -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) {