no message

This commit is contained in:
kuaifan 2023-03-04 13:26:04 +08:00
parent ba3eb7f27c
commit abe953f234
5 changed files with 30 additions and 16 deletions

View File

@ -526,7 +526,7 @@ class UsersController extends AbstractController
return preg_match("/\(M\)$/", $item); return preg_match("/\(M\)$/", $item);
}); });
if ($dep) { if ($dep) {
$tags[] = preg_replace("/\(M\)$/", "", $dep[0]) . " " . Base::Lang("负责人"); $tags[] = preg_replace("/\(M\)$/", "", trim($dep[0])) . " " . Base::Lang("负责人");
} }
if ($userInfo->isTemp()) { if ($userInfo->isTemp()) {
$tags[] = Base::Lang("临时"); $tags[] = Base::Lang("临时");
@ -1427,6 +1427,7 @@ class UsersController extends AbstractController
'parent_id' => $parent_id, 'parent_id' => $parent_id,
'owner_userid' => $owner_userid, 'owner_userid' => $owner_userid,
], $dialog_useid); ], $dialog_useid);
Cache::forever("UserDepartment::rand", Base::generatePassword());
// //
return Base::retSuccess($parent_id > 0 ? '保存成功' : '新建成功'); return Base::retSuccess($parent_id > 0 ? '保存成功' : '新建成功');
} }
@ -1456,6 +1457,7 @@ class UsersController extends AbstractController
return Base::retError('部门不存在或已被删除'); return Base::retError('部门不存在或已被删除');
} }
$userDepartment->deleteDepartment(); $userDepartment->deleteDepartment();
Cache::forever("UserDepartment::rand", Base::generatePassword());
// //
return Base::retSuccess('删除成功'); return Base::retSuccess('删除成功');
} }

View File

@ -136,10 +136,14 @@ class User extends AbstractModel
if (empty($this->department)) { if (empty($this->department)) {
return ""; return "";
} }
$list = UserDepartment::select(['id', 'owner_userid', 'name'])->whereIn('id', $this->department)->take(10)->get(); $key = "UserDepartment::" . md5(Cache::get("UserDepartment::rand") . '-' . implode(',' , $this->department));
$list = Cache::remember($key, now()->addMonth(), function() {
$list = UserDepartment::select(['id', 'owner_userid', 'name'])->whereIn('id', $this->department)->take(10)->get();
return $list->toArray();
});
$array = []; $array = [];
foreach ($list as $item) { foreach ($list as $item) {
$array[] = $item->name . ($item->owner_userid === $this->userid ? '(M)' : ''); $array[] = $item['name'] . ($item['owner_userid'] === $this->userid ? '(M)' : '');
} }
return implode(', ', $array); return implode(', ', $array);
} }

View File

@ -80,8 +80,8 @@
<div class="emoji-users"> <div class="emoji-users">
<ul> <ul>
<template v-for="(uitem, uindex) in item.userids"> <template v-for="(uitem, uindex) in item.userids">
<li v-if="uindex < 5" :class="{bold:uitem==userId}"><UserAvatar :userid="uitem" tooltip-disabled show-name :show-icon="false"/></li> <li v-if="uindex < emojiUsersNum" :class="{bold:uitem==userId}"><UserAvatar :userid="uitem" tooltip-disabled show-name :show-icon="false"/></li>
<li v-else-if="uindex == 5" @click.stop="onShowEmojiUser(item)">+{{item.userids.length - 5}}</li> <li v-else-if="uindex == emojiUsersNum" @click.stop="onShowEmojiUser(item)">+{{item.userids.length - emojiUsersNum}}</li>
</template> </template>
</ul> </ul>
</div> </div>
@ -228,9 +228,15 @@ export default {
todoLoad: 0, todoLoad: 0,
todoShow: false, todoShow: false,
todoList: [], todoList: [],
emojiUsersNum: 5
} }
}, },
mounted() {
this.emojiUsersNum = Math.min(6, Math.max(2, Math.floor((this.windowWidth - 180) / 48)))
},
beforeDestroy() { beforeDestroy() {
Store.set('audioSubscribe', this.msgData.id); Store.set('audioSubscribe', this.msgData.id);
}, },

View File

@ -137,8 +137,8 @@
</div> </div>
</ScrollerY> </ScrollerY>
<div class="messenger-menu"> <div class="messenger-menu">
<div class="menu-icon" @click="onActive(null)"> <div class="menu-icon">
<Icon @click="tabActive='dialog'" :class="{active:tabActive==='dialog'}" type="ios-chatbubbles" /> <Icon @click="onActive(null)" :class="{active:tabActive==='dialog'}" type="ios-chatbubbles" />
<Badge class="menu-num" :overflow-count="999" :count="msgUnread('all')"/> <Badge class="menu-num" :overflow-count="999" :count="msgUnread('all')"/>
</div> </div>
<div class="menu-icon"> <div class="menu-icon">
@ -490,19 +490,18 @@ export default {
}, },
onActive(type) { onActive(type) {
let block = "start"
if (type === null) { if (type === null) {
if (this.tabActive !== 'dialog') { if (this.tabActive !== 'dialog') {
this.tabActive = 'dialog'
return; return;
} }
type = this.dialogActive type = this.dialogActive
block = "end"
} }
if (this.dialogActive == type) { if (this.dialogActive == type) {
// this.shakeUnread() //
this.shakeUnread() } else {
this.dialogActive = type
} }
this.dialogActive = type
}, },
shakeUnread() { shakeUnread() {

View File

@ -845,9 +845,12 @@
&.bold { &.bold {
font-weight: 600; font-weight: 600;
} }
+ li { &:after {
&:before { content: "";
content: ""; }
&:last-child {
&:after {
display: none;
} }
} }
} }
@ -1647,7 +1650,7 @@ body.eeui-app {
.dialog-item { .dialog-item {
.dialog-view { .dialog-view {
&.text { &.text {
max-width: calc(100% - 52px); max-width: calc(100% - 80px);
} }
.dialog-head { .dialog-head {
.dialog-content { .dialog-content {