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

View File

@ -136,10 +136,14 @@ class User extends AbstractModel
if (empty($this->department)) {
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 = [];
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);
}

View File

@ -80,8 +80,8 @@
<div class="emoji-users">
<ul>
<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-else-if="uindex == 5" @click.stop="onShowEmojiUser(item)">+{{item.userids.length - 5}}</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 == emojiUsersNum" @click.stop="onShowEmojiUser(item)">+{{item.userids.length - emojiUsersNum}}</li>
</template>
</ul>
</div>
@ -228,9 +228,15 @@ export default {
todoLoad: 0,
todoShow: false,
todoList: [],
emojiUsersNum: 5
}
},
mounted() {
this.emojiUsersNum = Math.min(6, Math.max(2, Math.floor((this.windowWidth - 180) / 48)))
},
beforeDestroy() {
Store.set('audioSubscribe', this.msgData.id);
},

View File

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

View File

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