fix: 修复已知bug

This commit is contained in:
kuaifan 2023-06-17 06:00:53 +08:00
parent c940698933
commit 19815415d0
7 changed files with 21 additions and 19 deletions

View File

@ -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;
});
}

View File

@ -70,8 +70,9 @@ class WebSocketDialog extends AbstractModel
/**
* 获取对话列表
* @param int $userid 会员ID
* @param bool $hasData
* @return $this
* @param $updated
* @param $deleted
* @return array
*/
public function getDialogList($userid, $updated = "", $deleted = "")
{
@ -96,8 +97,6 @@ class WebSocketDialog extends AbstractModel
return $data;
}
/**
* 格式化对话
* @param int $userid 会员ID

View File

@ -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;
}
},

View File

@ -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;