no message

This commit is contained in:
kuaifan 2022-05-23 23:54:15 +08:00
parent d015118199
commit 52464e232b
7 changed files with 148 additions and 11 deletions

View File

@ -390,6 +390,8 @@ class ProjectController extends AbstractController
}
$project->syncDialogUser();
$project->addLog("修改项目成员");
$project->user_simple = count($array) . "|" . implode(",", array_slice($array, 0, 3));
$project->save();
return $deleteUser->toArray();
});
//

View File

@ -19,6 +19,7 @@ use Request;
* @property string|null $desc 描述、备注
* @property int|null $userid 创建人
* @property int|null $personal 是否个人项目
* @property string|null $user_simple 成员总数|1,2,3
* @property int|null $dialog_id 聊天会话ID
* @property string|null $archived_at 归档时间
* @property int|null $archived_userid 归档会员
@ -48,6 +49,7 @@ use Request;
* @method static \Illuminate\Database\Eloquent\Builder|Project whereName($value)
* @method static \Illuminate\Database\Eloquent\Builder|Project wherePersonal($value)
* @method static \Illuminate\Database\Eloquent\Builder|Project whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|Project whereUserSimple($value)
* @method static \Illuminate\Database\Eloquent\Builder|Project whereUserid($value)
* @method static \Illuminate\Database\Query\Builder|Project withTrashed()
* @method static \Illuminate\Database\Query\Builder|Project withoutTrashed()

View File

@ -0,0 +1,46 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddProjectsUserSimple extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
$isAdd = false;
Schema::table('projects', function (Blueprint $table) use (&$isAdd) {
if (!Schema::hasColumn('projects', 'user_simple')) {
$isAdd = true;
$table->string('user_simple', 255)->nullable()->default('')->after('personal')->comment('成员总数|1,2,3');
}
});
if ($isAdd) {
\App\Models\Project::chunkById(100, function ($lists) {
/** @var \App\Models\Project $item */
foreach ($lists as $item) {
$array = $item->projectUser->pluck('userid')->toArray();
$item->user_simple = count($array) . "|" . implode(",", array_slice($array, 0, 3));
$item->save();
}
});
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('projects', function (Blueprint $table) {
$table->dropColumn("user_simple");
});
}
}

View File

@ -18,7 +18,15 @@
{{item.desc}}
</div>
<div class="project-percent">
<Progress :percent="item.task_percent" :stroke-width="6" />
<Progress :percent="item.task_my_percent" :stroke-width="5" hide-info />
<div class="percent-info" @click.stop="modalPercent(item)">{{item.task_my_complete}}<em>/{{item.task_my_num}}</em></div>
</div>
<div class="project-footer">
<div class="footer-percent" @click.stop="modalPercent(item)">{{item.task_complete}}<em>/{{item.task_num}}</em></div>
<div class="footer-user">
<UserAvatar v-for="(uid, ukey) in item.user_simple" :key="ukey" :userid="uid" :size="26" :borderWitdh="2"/>
<div v-if="item.user_count > 3" class="footer-user-more">{{item.user_count > 99 ? '99+' : `${item.user_count}+`}}</div>
</div>
</div>
</li>
</ul>
@ -38,14 +46,6 @@ export default {
}
},
mounted() {
},
destroyed() {
},
computed: {
...mapState([
'cacheProjects',
@ -62,7 +62,19 @@ export default {
if (projectKeyValue) {
return data.filter(({name}) => name.toLowerCase().indexOf(projectKeyValue.toLowerCase()) > -1);
}
return data;
return data.map(item => {
if (!$A.isArray(item.user_simple)) {
const arr = item.user_simple.split("|");
if (arr.length > 1) {
item.user_count = arr[0];
item.user_simple = arr[1].split(",");
} else {
item.user_count = 0;
item.user_simple = [];
}
}
return item;
});
},
},
@ -104,6 +116,13 @@ export default {
let location = {name: 'manage-' + path, params: params || {}};
this.goForward(location);
},
modalPercent(item) {
$A.modalInfo({
title: `${item.name} 项目进度`,
content: `总进度:${item.task_complete}/${item.task_num}<br/>我的任务:${item.task_my_complete}/${item.task_my_num}`
});
}
}
}
</script>

View File

@ -70,6 +70,47 @@
}
.project-percent {
margin-top: 12px;
display: flex;
align-items: center;
.percent-info {
margin-left: 12px;
min-width: 28px;
text-align: right;
> em {
opacity: 0.7;
font-style: normal;
}
}
}
.project-footer {
margin-top: 12px;
margin-bottom: -2px;
display: flex;
align-items: center;
.footer-percent {
flex-shrink: 0;
margin-right: 12px;
min-width: 28px;
text-align: left;
> em {
opacity: 0.7;
font-style: normal;
}
}
.footer-user {
flex: 1;
display: flex;
align-items: center;
justify-content: flex-end;
.common-avatar {
margin-left: -4px;
}
.footer-user-more {
padding-left: 6px;
font-weight: 500;
color: $primary-color;
}
}
}
}
}

View File

@ -411,6 +411,34 @@
height: 60px;
opacity: 0;
}
.messenger-list {
flex: 1;
height: 0;
width: 100%;
overflow-x: hidden;
overflow-y: auto;
> ul {
&.dialog {
> li {
&:after {
content: "";
position: absolute;
bottom: 0;
right: 0;
left: 68px;
height: 1px;
background-color: #f2f2f2;
transform: scaleY(0.5);
}
&:last-child {
&:after {
display: none;
}
}
}
}
}
}
}
.messenger-msg {
z-index: 49;

View File

@ -290,7 +290,6 @@
width: 100%;
height: 100%;
z-index: 9;
transition: all 0.2s;
background-color: #ffffff;
transform: translateX(-120%);
&.show768-menu {