diff --git a/app/Http/Controllers/Api/ProjectController.php b/app/Http/Controllers/Api/ProjectController.php index cd3d7dbcc..8ea0a21fd 100755 --- a/app/Http/Controllers/Api/ProjectController.php +++ b/app/Http/Controllers/Api/ProjectController.php @@ -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(); }); // diff --git a/app/Models/Project.php b/app/Models/Project.php index c3e3314b7..0de89fea5 100644 --- a/app/Models/Project.php +++ b/app/Models/Project.php @@ -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() diff --git a/database/migrations/2022_05_23_232135_add_projects_user_simple.php b/database/migrations/2022_05_23_232135_add_projects_user_simple.php new file mode 100644 index 000000000..b6a0c537a --- /dev/null +++ b/database/migrations/2022_05_23_232135_add_projects_user_simple.php @@ -0,0 +1,46 @@ +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"); + }); + } +} diff --git a/resources/assets/js/pages/manage/components/ProjectList.vue b/resources/assets/js/pages/manage/components/ProjectList.vue index 478e67ccc..c05503ef2 100644 --- a/resources/assets/js/pages/manage/components/ProjectList.vue +++ b/resources/assets/js/pages/manage/components/ProjectList.vue @@ -18,7 +18,15 @@ {{item.desc}}
- + +
{{item.task_my_complete}}/{{item.task_my_num}}
+
+ @@ -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}
我的任务:${item.task_my_complete}/${item.task_my_num}` + }); + } } } diff --git a/resources/assets/sass/pages/components/project-list.scss b/resources/assets/sass/pages/components/project-list.scss index db2cad947..a8afe9985 100644 --- a/resources/assets/sass/pages/components/project-list.scss +++ b/resources/assets/sass/pages/components/project-list.scss @@ -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; + } + } } } } diff --git a/resources/assets/sass/pages/page-messenger.scss b/resources/assets/sass/pages/page-messenger.scss index a23593d34..e3477c91a 100644 --- a/resources/assets/sass/pages/page-messenger.scss +++ b/resources/assets/sass/pages/page-messenger.scss @@ -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; diff --git a/resources/assets/sass/pages/page-setting.scss b/resources/assets/sass/pages/page-setting.scss index cca5c1f3e..77e0e87f4 100755 --- a/resources/assets/sass/pages/page-setting.scss +++ b/resources/assets/sass/pages/page-setting.scss @@ -290,7 +290,6 @@ width: 100%; height: 100%; z-index: 9; - transition: all 0.2s; background-color: #ffffff; transform: translateX(-120%); &.show768-menu {