mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 19:24:17 +00:00
fix: 修复已知bug
This commit is contained in:
parent
c940698933
commit
19815415d0
@ -50,7 +50,7 @@ class DialogController extends AbstractController
|
||||
//
|
||||
$timerange = TimeRange::parse(Request::input());
|
||||
//
|
||||
$data = (new WebSocketDialog)->getDialogList($user->userid,$timerange->updated,$timerange->deleted);
|
||||
$data = (new WebSocketDialog)->getDialogList($user->userid, $timerange->updated, $timerange->deleted);
|
||||
//
|
||||
return Base::retSuccess('success', $data);
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ class FileController extends AbstractController
|
||||
$data = Request::all();
|
||||
$pid = intval($data['pid']);
|
||||
//
|
||||
return Base::retSuccess('success', (new File)->getFileList($user,$pid) );
|
||||
return Base::retSuccess('success', (new File)->getFileList($user, $pid));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -679,7 +679,7 @@ class FileController extends AbstractController
|
||||
$user = User::auth();
|
||||
$pid = intval(Request::input('pid'));
|
||||
$webkitRelativePath = Request::input('webkitRelativePath');
|
||||
$data = (new File)->contentUpload($user,$pid,$webkitRelativePath);
|
||||
$data = (new File)->contentUpload($user, $pid, $webkitRelativePath);
|
||||
return Base::retSuccess($data['data']['name'] . ' 上传成功', $data['addItem']);
|
||||
}
|
||||
|
||||
|
||||
@ -62,7 +62,7 @@ class ProjectTaskUser extends AbstractModel
|
||||
$item->save();
|
||||
}
|
||||
if ($item->projectTask) {
|
||||
$item->projectTask->addLog("移交{任务}身份", ['userid' => [$originalUserid, ' => ',$newUserid]]);
|
||||
$item->projectTask->addLog("移交{任务}身份", ['userid' => [$originalUserid, ' => ', $newUserid]]);
|
||||
if (!in_array($item->task_pid, $tastIds)) {
|
||||
$tastIds[] = $item->task_pid;
|
||||
$item->projectTask->syncDialogUser();
|
||||
|
||||
@ -167,9 +167,9 @@ class User extends AbstractModel
|
||||
if (!$this->bot) {
|
||||
return 0;
|
||||
}
|
||||
$key = "BotOwner::" . $this->userid;
|
||||
$key = "getBotOwner::" . $this->userid;
|
||||
return Cache::remember($key, now()->addMonth(), function() {
|
||||
return intval(UserBot::whereBotId($this->userid)->value('userid'));
|
||||
return intval(UserBot::whereBotId($this->userid)->value('userid')) ?: $this->userid;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -69,11 +69,12 @@ class WebSocketDialog extends AbstractModel
|
||||
|
||||
/**
|
||||
* 获取对话列表
|
||||
* @param int $userid 会员ID
|
||||
* @param bool $hasData
|
||||
* @return $this
|
||||
* @param int $userid 会员ID
|
||||
* @param $updated
|
||||
* @param $deleted
|
||||
* @return array
|
||||
*/
|
||||
public function getDialogList($userid, $updated="", $deleted="")
|
||||
public function getDialogList($userid, $updated = "", $deleted = "")
|
||||
{
|
||||
$builder = WebSocketDialog::select(['web_socket_dialogs.*', 'u.top_at', 'u.mark_unread', 'u.silence', 'u.updated_at as user_at'])
|
||||
->join('web_socket_dialog_users as u', 'web_socket_dialogs.id', '=', 'u.dialog_id')
|
||||
@ -96,8 +97,6 @@ class WebSocketDialog extends AbstractModel
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 格式化对话
|
||||
* @param int $userid 会员ID
|
||||
|
||||
@ -592,21 +592,16 @@ export default {
|
||||
this.selects = $A.cloneJSON(this.uncancelable)
|
||||
return
|
||||
}
|
||||
let optional = this.multipleMax - this.selects.length
|
||||
this.lists.some(item => {
|
||||
if (this.isUncancelable(item.userid)) {
|
||||
return false
|
||||
}
|
||||
if (this.isDisabled(item.userid)) {
|
||||
return false
|
||||
}
|
||||
if (optional <= 0) {
|
||||
if (this.multipleMax && this.selects.length >= this.multipleMax) {
|
||||
$A.messageWarning("已超过最大选择数量")
|
||||
return true
|
||||
}
|
||||
if (!this.selects.includes(item.userid)) {
|
||||
this.selects.push(item.userid)
|
||||
optional--
|
||||
}
|
||||
})
|
||||
},
|
||||
@ -626,6 +621,7 @@ export default {
|
||||
return
|
||||
}
|
||||
this.selects.push(userid)
|
||||
// 滚动到选中的位置
|
||||
this.$nextTick(() => {
|
||||
$A.scrollIntoViewIfNeeded(this.$refs.selected.querySelector(`li[data-id="${userid}"]`))
|
||||
})
|
||||
@ -649,6 +645,11 @@ export default {
|
||||
$A.messageWarning("部分成员禁止选择")
|
||||
}
|
||||
this.selects = this.selects.concat(addList.filter(userid => !this.selects.includes(userid)))
|
||||
// 超过最大数量
|
||||
if (this.multipleMax && this.selects.length > this.multipleMax) {
|
||||
$A.messageWarning("已超过最大选择数量")
|
||||
this.selects = this.selects.slice(0, this.multipleMax)
|
||||
}
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
@ -180,6 +180,7 @@
|
||||
:avatar-size="28"
|
||||
:title="$L('修改负责人')"
|
||||
:project-id="taskDetail.project_id"
|
||||
:add-icon="false"
|
||||
:before-submit="onOwner"/>
|
||||
</FormItem>
|
||||
<FormItem v-if="getAssist.length > 0 || assistForce">
|
||||
@ -195,6 +196,7 @@
|
||||
:title="$L(getAssist.length > 0 ? '修改协助人员' : '添加协助人员')"
|
||||
:project-id="taskDetail.project_id"
|
||||
:disabled-choice="assistData.disabled"
|
||||
:add-icon="false"
|
||||
:before-submit="onAssist"/>
|
||||
</FormItem>
|
||||
<FormItem v-if="taskDetail.end_at || timeForce">
|
||||
@ -1183,7 +1185,7 @@ export default {
|
||||
case 'assist':
|
||||
this.assistForce = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.assist.onSelect();
|
||||
this.$refs.assist.onSelection();
|
||||
});
|
||||
break;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user