mirror of
https://github.com/kuaifan/dootask.git
synced 2026-03-02 06:54:19 +00:00
perf: 任务详情窗口通过附件传图片保存到附件列表
This commit is contained in:
parent
003ddb4016
commit
fd40ae6b67
@ -261,10 +261,11 @@ class DialogController extends AbstractController
|
||||
* @apiGroup dialog
|
||||
* @apiName msg__sendfile
|
||||
*
|
||||
* @apiParam {Number} dialog_id 对话ID
|
||||
* @apiParam {String} [filename] post-文件名称
|
||||
* @apiParam {String} [image64] post-base64图片(二选一)
|
||||
* @apiParam {File} [files] post-文件对象(二选一)
|
||||
* @apiParam {Number} dialog_id 对话ID
|
||||
* @apiParam {Number} [image_attachment] 图片是否也存到附件
|
||||
* @apiParam {String} [filename] post-文件名称
|
||||
* @apiParam {String} [image64] post-base64图片(二选一)
|
||||
* @apiParam {File} [files] post-文件对象(二选一)
|
||||
*
|
||||
* @apiSuccess {Number} ret 返回状态码(1正确、0错误)
|
||||
* @apiSuccess {String} msg 返回信息(错误描述)
|
||||
@ -275,6 +276,7 @@ class DialogController extends AbstractController
|
||||
$user = User::auth();
|
||||
//
|
||||
$dialog_id = Base::getPostInt('dialog_id');
|
||||
$image_attachment = Base::getPostInt('image_attachment');
|
||||
//
|
||||
$dialog = WebSocketDialog::checkDialog($dialog_id);
|
||||
//
|
||||
@ -303,8 +305,8 @@ class DialogController extends AbstractController
|
||||
$fileData['thumb'] = Base::unFillUrl($fileData['thumb']);
|
||||
$fileData['size'] *= 1024;
|
||||
//
|
||||
if ($dialog->type === 'group' && $dialog->group_type === 'task') { // 任务群聊保存文件
|
||||
if (!in_array($fileData['ext'], File::localExt)) { // 如果是图片不保存
|
||||
if ($dialog->type === 'group' && $dialog->group_type === 'task') { // 任务群聊保存文件
|
||||
if ($image_attachment || !in_array($fileData['ext'], File::imageExt)) { // 如果是图片不保存
|
||||
$task = ProjectTask::whereDialogId($dialog->id)->first();
|
||||
if ($task) {
|
||||
$file = ProjectTaskFile::createInstance([
|
||||
|
||||
@ -64,7 +64,7 @@
|
||||
"stylus-loader": "^6.2.0",
|
||||
"tinymce": "^5.10.3",
|
||||
"tui-calendar-hi": "^1.15.1-5",
|
||||
"view-design-hi": "^4.7.0-19",
|
||||
"view-design-hi": "^4.7.0-20",
|
||||
"vue": "^2.6.14",
|
||||
"vue-clipboard2": "^0.3.3",
|
||||
"vue-emoji-picker": "^1.0.3",
|
||||
|
||||
@ -1123,7 +1123,11 @@ export default {
|
||||
|
||||
sendDialogMsg() {
|
||||
if (this.msgFile.length > 0) {
|
||||
this.$refs.dialog.sendFileMsg(this.msgFile);
|
||||
this.$refs.dialog.sendFileMsg(this.msgFile.map(file => Object.assign(file, {
|
||||
ajaxExtraData: {
|
||||
image_attachment: 1
|
||||
}
|
||||
})));
|
||||
} else if (this.msgText) {
|
||||
this.$refs.dialog.sendMsg(this.msgText);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user