素材云完善切换报错问题
This commit is contained in:
@@ -622,4 +622,8 @@ export async function uploadImage(file: File): Promise<{ url: string; filename:
|
|||||||
if (!res.ok) throw new Error('图片上传失败');
|
if (!res.ok) throw new Error('图片上传失败');
|
||||||
const data = await res.json();
|
const data = await res.json();
|
||||||
return { url: data.url, filename: data.filename };
|
return { url: data.url, filename: data.filename };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function getFields(): Promise<any> {
|
||||||
|
return api.get('/material-consumption/fields');
|
||||||
|
}
|
||||||
|
|||||||
@@ -1021,7 +1021,11 @@ const GeneratedRecord: React.FC = () => {
|
|||||||
<Space>
|
<Space>
|
||||||
<Button
|
<Button
|
||||||
type={filterType === 'project' ? 'primary' : 'default'}
|
type={filterType === 'project' ? 'primary' : 'default'}
|
||||||
onClick={() => setFilterType('project')}
|
onClick={() => {
|
||||||
|
setFilterType('project');
|
||||||
|
setIsSelectionMode(false);
|
||||||
|
setSelectedItems(new Set());
|
||||||
|
}}
|
||||||
style={{
|
style={{
|
||||||
borderRadius: 8,
|
borderRadius: 8,
|
||||||
background: filterType === 'project'
|
background: filterType === 'project'
|
||||||
@@ -1037,7 +1041,11 @@ const GeneratedRecord: React.FC = () => {
|
|||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
type={filterType === 'creation' ? 'primary' : 'default'}
|
type={filterType === 'creation' ? 'primary' : 'default'}
|
||||||
onClick={() => setFilterType('creation')}
|
onClick={() => {
|
||||||
|
setFilterType('creation');
|
||||||
|
setIsSelectionMode(false);
|
||||||
|
setSelectedItems(new Set());
|
||||||
|
}}
|
||||||
style={{
|
style={{
|
||||||
borderRadius: 8,
|
borderRadius: 8,
|
||||||
background: filterType === 'creation'
|
background: filterType === 'creation'
|
||||||
@@ -1088,13 +1096,12 @@ const GeneratedRecord: React.FC = () => {
|
|||||||
onClick={() => handleDownloadSelected()}
|
onClick={() => handleDownloadSelected()}
|
||||||
style={{
|
style={{
|
||||||
borderRadius: 8,
|
borderRadius: 8,
|
||||||
background: '#f8f9fc',
|
background: 'linear-gradient(135deg, #6366f1, #8b5cf6)',
|
||||||
border: '1px solid #e2e8f0',
|
color: '#fff',
|
||||||
color: '#222222ff',
|
|
||||||
fontWeight: 600,
|
fontWeight: 600,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
下载{selectedItems.size}个
|
下载 ({selectedItems.size})
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
type="primary"
|
type="primary"
|
||||||
@@ -1104,12 +1111,11 @@ const GeneratedRecord: React.FC = () => {
|
|||||||
style={{
|
style={{
|
||||||
borderRadius: 8,
|
borderRadius: 8,
|
||||||
background: 'linear-gradient(135deg, #6366f1, #8b5cf6)',
|
background: 'linear-gradient(135deg, #6366f1, #8b5cf6)',
|
||||||
border: 'none',
|
|
||||||
color: '#fff',
|
color: '#fff',
|
||||||
fontWeight: 600,
|
fontWeight: 600,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{uploading ? '上传中...' : `上传选中 (${selectedItems.size})`}
|
{uploading ? '上传中...' : `推送至账户 (${selectedItems.size})`}
|
||||||
</Button>
|
</Button>
|
||||||
</Space>
|
</Space>
|
||||||
) : (
|
) : (
|
||||||
@@ -1149,7 +1155,11 @@ const GeneratedRecord: React.FC = () => {
|
|||||||
<Space>
|
<Space>
|
||||||
<Button
|
<Button
|
||||||
type={filterMedia === 'video' ? 'primary' : 'default'}
|
type={filterMedia === 'video' ? 'primary' : 'default'}
|
||||||
onClick={() => setFilterMedia('video')}
|
onClick={() => {
|
||||||
|
setFilterMedia('video');
|
||||||
|
setIsSelectionMode(false);
|
||||||
|
setSelectedItems(new Set());
|
||||||
|
}}
|
||||||
style={{
|
style={{
|
||||||
borderRadius: 8,
|
borderRadius: 8,
|
||||||
background: filterMedia === 'video'
|
background: filterMedia === 'video'
|
||||||
@@ -1165,7 +1175,11 @@ const GeneratedRecord: React.FC = () => {
|
|||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
type={filterMedia === 'image' ? 'primary' : 'default'}
|
type={filterMedia === 'image' ? 'primary' : 'default'}
|
||||||
onClick={() => setFilterMedia('image')}
|
onClick={() => {
|
||||||
|
setFilterMedia('image');
|
||||||
|
setIsSelectionMode(false);
|
||||||
|
setSelectedItems(new Set());
|
||||||
|
}}
|
||||||
style={{
|
style={{
|
||||||
borderRadius: 8,
|
borderRadius: 8,
|
||||||
background: filterMedia === 'image'
|
background: filterMedia === 'image'
|
||||||
|
|||||||
Reference in New Issue
Block a user