!1916 修复:修复画廊文件大小显示错误

Merge pull request !1916 from 我是一条懒汉/gallery_size
pull/1904/MERGE
我是一条懒汉 2 years ago committed by ChenX
parent 0b72b9bfa8
commit 8e8b5b7f3e

@ -3,6 +3,7 @@ import { observable } from 'mobx';
import { observer } from 'mobx-react';
import React, { Component, createRef, RefObject } from 'react';
import { CURRENT_HOST } from '../../../../Common/HostUrl';
import { getFileSize } from '../../../../Common/Utils';
import { UpdateBatchGallery } from '../data/GalleryData';
import GalleryStore from '../GalleryStore';
import { IGalleryItem } from '../interface/GalleryInterfaces';
@ -151,7 +152,7 @@ export default class GalleryDetailDrawer extends Component<GalleryDetailDrawerPr
<span>{this.props.gallery.create_date}</span>
</FormGroup>
<FormGroup label='画廊大小:' inline>
<span>{(Number(this.props.gallery.size) / 1024).toFixed(2)}M</span>
<span>{getFileSize(Number.parseInt(this.props.gallery.size))}</span>
</FormGroup>
</FormGroup>
<FormGroup label='画廊图片' inline>

@ -1,6 +1,7 @@
import { Button, Checkbox, Intent, Tag } from '@blueprintjs/core';
import { observer } from 'mobx-react';
import React, { Component } from 'react';
import { getFileSize } from '../../../../Common/Utils';
import GalleryStore from '../GalleryStore';
import { IGalleryItem } from '../interface/GalleryInterfaces';
import { State, StateIcon } from '../StateIcon';
@ -46,7 +47,7 @@ export default class GalleryManagementItem extends Component<GalleryManagementIt
<li><span>{this.props.gallery.shop_name}</span></li>
<li><Tag children={this.props.gallery.class_name} /></li>
<li><span> {this.props.gallery.create_date}</span></li>
<li><span>{(Number(this.props.gallery.size) / 1024).toFixed(2)}M</span></li>
<li><span>{getFileSize(Number.parseInt(this.props.gallery.size))}</span></li>
<li>
<Tag children={this.props.gallery.state_name} minimal intent={this.props.gallery.state === "2" ? Intent.SUCCESS : Intent.DANGER} />
</li>

@ -1,6 +1,7 @@
import { Button, Card, Icon, Intent, Tag } from '@blueprintjs/core';
import React, { Component, CSSProperties } from 'react';
import { CURRENT_HOST } from '../../../../Common/HostUrl';
import { getFileSize } from '../../../../Common/Utils';
import GalleryStore from '../GalleryStore';
import { IGalleryItem } from '../interface/GalleryInterfaces';
import { State, StateIcon } from '../StateIcon';
@ -58,7 +59,7 @@ export default class GalleryItem extends Component<GalleryItemProps>
<span><Icon icon='user' /> {this.props.item.login_name}</span>
<span><Icon icon='shop' /> {this.props.item.shop_name}</span>
<span><Icon icon='flame' /> {this.props.item.hot}</span>
<span><Icon icon='document' /> {(Number(this.props.item.size) / 1024).toFixed(2)}M</span>
<span><Icon icon='document' />{getFileSize(Number.parseInt(this.props.item.size))}</span>
<span>{this.props.item.create_date}</span>
<Button text='免费使用' intent={Intent.PRIMARY} onClick={async () => { await this.GalleryStore.OpenGallery(this.props.item.gallery_id); }} />
</div>

@ -2,6 +2,7 @@ import { Button, Classes, Dialog, FileInput, FormGroup, HTMLSelect, Icon, InputG
import { observer } from 'mobx-react';
import React, { Component, createRef, RefObject } from 'react';
import { CURRENT_HOST } from '../../../Common/HostUrl';
import { getFileSize } from '../../../Common/Utils';
import { UploadNewGallery } from './data/GalleryData';
import GalleryStore from './GalleryStore';
@ -89,7 +90,7 @@ export default class UploadGalleryDialog extends Component<UploadGalleryDialogPr
<InputGroup disabled defaultValue={this.GalleryStore?.galleryFileData?.update_date ?? ''} />
</FormGroup>
<FormGroup label='文件大小'>
<InputGroup disabled defaultValue={`${(Number(this.GalleryStore?.galleryFileData?.size) / 1024).toFixed(2)}M` ?? ''} />
<InputGroup disabled defaultValue={`${getFileSize(this.GalleryStore?.galleryFileData?.size)}` ?? ''} />
</FormGroup>
<FormGroup label='压缩类型'>
<InputGroup disabled defaultValue={this.GalleryStore?.galleryFileData?.zip_type ?? ''} />

@ -198,10 +198,13 @@
z-index : 10;
>h4
{
margin : 0;
margin-left: 20px;
font-size : 18px;
flex-grow : 1;
margin : 0;
margin-left : 20px;
font-size : 18px;
flex-grow : 1;
text-overflow: ellipsis;
max-width : 180px;
overflow : hidden;
}
}
.bp3-dialog-body

Loading…
Cancel
Save