perf: 压缩下载改名打包下载

This commit is contained in:
weifashi 2023-11-14 11:39:14 +08:00
parent 6ffb458ffc
commit 4205b68b8c
7 changed files with 27 additions and 12 deletions

View File

@ -1014,7 +1014,7 @@ class FileController extends AbstractController
} }
/** /**
* @api {get} api/file/download/zip 20. 压缩下载 * @api {get} api/file/download/zip 20. 打包下载
* *
* @apiDescription 需要token身份 * @apiDescription 需要token身份
* @apiVersion 1.0.0 * @apiVersion 1.0.0

View File

@ -74,6 +74,7 @@ class SystemController extends AbstractController
'image_compress', 'image_compress',
'image_save_local', 'image_save_local',
'start_home', 'start_home',
'file_upload_limit',
])) { ])) {
unset($all[$key]); unset($all[$key]);
} }
@ -114,6 +115,7 @@ class SystemController extends AbstractController
$setting['image_compress'] = $setting['image_compress'] ?: 'open'; $setting['image_compress'] = $setting['image_compress'] ?: 'open';
$setting['image_save_local'] = $setting['image_save_local'] ?: 'open'; $setting['image_save_local'] = $setting['image_save_local'] ?: 'open';
$setting['start_home'] = $setting['start_home'] ?: 'close'; $setting['start_home'] = $setting['start_home'] ?: 'close';
$setting['file_upload_limit'] = $setting['file_upload_limit'] ?: '';
// //
return Base::retSuccess('success', $setting ?: json_decode('{}')); return Base::retSuccess('success', $setting ?: json_decode('{}'));
} }

View File

@ -244,9 +244,10 @@ class File extends AbstractModel
"type" => 'more', "type" => 'more',
"autoThumb" => false, "autoThumb" => false,
"path" => $path, "path" => $path,
"size" => 100 * 1024
]); ]);
if (Base::isError($data)) { if (Base::isError($data)) {
return $data; throw new ApiException($data['msg']);
} }
$data = $data['data']; $data = $data['data'];
// //

View File

@ -616,6 +616,7 @@ class WebSocketDialog extends AbstractModel
"type" => 'more', "type" => 'more',
"path" => $path, "path" => $path,
"fileName" => $fileName, "fileName" => $fileName,
"size" => 100 * 1024
]); ]);
} }
// //

View File

@ -1382,7 +1382,8 @@ APP推送
未设置时间 未设置时间
检测到所属的任务列表已被删除,该操作将会还原任务列表,你确定要还原归档吗? 检测到所属的任务列表已被删除,该操作将会还原任务列表,你确定要还原归档吗?
压缩下载 打包下载
你确定要下载【(*)】文件吗? 你确定要打包下载【(*)】文件吗?
你确定要下载(*)等(*)个文件吗? 你确定要打包下载(*)等(*)个文件吗?
此文件夹内已有共享文件夹,子文件的共享状态将被取消,是否继续? 此文件夹内已有共享文件夹,子文件的共享状态将被取消,是否继续?
文件上传限制

View File

@ -50,8 +50,8 @@
{{$L('剪切')}} {{$L('剪切')}}
</Button> </Button>
<Button :disabled="compressedSownloadDisabled" size="small" type="info" @click="downloadZipFile(selectIds)"> <Button :disabled="compressedSownloadDisabled" size="small" type="info" @click="downloadZipFile(selectIds)">
<Icon type="ios-download-outline" /> <Icon type="ios-download" />
{{$L('压缩下载')}} {{$L('打包下载')}}
</Button> </Button>
<Button size="small" type="error" @click="deleteFile(selectIds)"> <Button size="small" type="error" @click="deleteFile(selectIds)">
<Icon type="ios-trash" /> <Icon type="ios-trash" />
@ -199,7 +199,7 @@
<DropdownItem name="send" :disabled="contextMenuItem.type == 'folder'">{{$L('发送')}}</DropdownItem> <DropdownItem name="send" :disabled="contextMenuItem.type == 'folder'">{{$L('发送')}}</DropdownItem>
<DropdownItem name="link" :divided="contextMenuItem.userid != userId && !contextMenuItem.share" :disabled="contextMenuItem.type == 'folder'">{{$L('链接')}}</DropdownItem> <DropdownItem name="link" :divided="contextMenuItem.userid != userId && !contextMenuItem.share" :disabled="contextMenuItem.type == 'folder'">{{$L('链接')}}</DropdownItem>
<DropdownItem name="download" :disabled="contextMenuItem.ext == '' || (contextMenuItem.userid != userId && contextMenuItem.permission == 0)">{{$L('下载')}}</DropdownItem> <DropdownItem name="download" :disabled="contextMenuItem.ext == '' || (contextMenuItem.userid != userId && contextMenuItem.permission == 0)">{{$L('下载')}}</DropdownItem>
<DropdownItem name="downloadzip" :disabled="contextMenuItem.userid != userId && contextMenuItem.permission == 0">{{$L('压缩下载')}}</DropdownItem> <DropdownItem name="downloadzip" :disabled="contextMenuItem.userid != userId && contextMenuItem.permission == 0">{{$L('打包下载')}}</DropdownItem>
<DropdownItem name="delete" divided style="color:red">{{$L('删除')}}</DropdownItem> <DropdownItem name="delete" divided style="color:red">{{$L('删除')}}</DropdownItem>
</template> </template>
@ -1419,9 +1419,9 @@ export default {
const fileName = ids.length === 1 ? `${firstFile.name}${typeName}` : `${firstFile.name}】等${ids.length}${typeName}`; const fileName = ids.length === 1 ? `${firstFile.name}${typeName}` : `${firstFile.name}】等${ids.length}${typeName}`;
$A.modalConfirm({ $A.modalConfirm({
title: '下载文件', title: '打包下载',
content: `你确定要下载${fileName}吗?`, content: `你确定要打包下载${fileName}吗?`,
okText: '立即下载', okText: '确定',
onOk: () => { onOk: () => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.$store.dispatch("call", { this.$store.dispatch("call", {

View File

@ -165,6 +165,16 @@
</RadioGroup> </RadioGroup>
<div class="form-tip">{{$L('仅支持网页版。')}}</div> <div class="form-tip">{{$L('仅支持网页版。')}}</div>
</FormItem> </FormItem>
<FormItem v-if="$A.isDooServer()" :label="$L('文件上传限制')" prop="fileUploadLimit">
<div style="width: 192px;">
<Input type="number" number v-model="formDatum.file_upload_limit" :placeholder="$L('默认不限制')">
<template #append>
<span>MB</span>
</template>
</Input>
</div>
<div class="form-tip">{{$L('包含消息发送文件')}}</div>
</FormItem>
</div> </div>
</div> </div>
</Form> </Form>