diff --git a/app/admin/controller/operation/UserNoticeRead.php b/app/admin/controller/operation/UserNoticeRead.php new file mode 100644 index 0000000..97442a8 --- /dev/null +++ b/app/admin/controller/operation/UserNoticeRead.php @@ -0,0 +1,33 @@ + 'desc']; + + protected string|array $orderGuarantee = ['id' => 'desc']; + + protected array $withJoinTable = ['user', 'operationNotice']; + + protected bool $modelValidate = false; + + protected function initController(WebmanRequest $request): ?Response + { + $this->model = new \app\common\model\UserNoticeRead(); + return null; + } +} diff --git a/app/common/model/UserNoticeRead.php b/app/common/model/UserNoticeRead.php new file mode 100644 index 0000000..5ef29e1 --- /dev/null +++ b/app/common/model/UserNoticeRead.php @@ -0,0 +1,28 @@ + 'integer', + 'read_at' => 'integer', + 'confirmed' => 'integer', + ]; + + public function user(): \think\model\relation\BelongsTo + { + return $this->belongsTo(User::class, 'user_id', 'id'); + } + + public function operationNotice(): \think\model\relation\BelongsTo + { + return $this->belongsTo(OperationNotice::class, 'notice_id', 'id'); + } +} diff --git a/web/src/lang/backend/en/operation/userNoticeRead.ts b/web/src/lang/backend/en/operation/userNoticeRead.ts new file mode 100644 index 0000000..aec7440 --- /dev/null +++ b/web/src/lang/backend/en/operation/userNoticeRead.ts @@ -0,0 +1,13 @@ +export default { + 'quick Search Fields': 'ID/User ID/Notice ID', + id: 'ID', + user_id: 'User', + notice_id: 'Notice', + notice_title: 'Notice title', + username: 'Username', + read_at: 'Read at', + confirmed: 'Confirmed', + 'confirmed 0': 'No', + 'confirmed 1': 'Yes', + create_time: 'Created', +} diff --git a/web/src/lang/backend/zh-cn/operation/userNoticeRead.ts b/web/src/lang/backend/zh-cn/operation/userNoticeRead.ts new file mode 100644 index 0000000..7f99a7b --- /dev/null +++ b/web/src/lang/backend/zh-cn/operation/userNoticeRead.ts @@ -0,0 +1,13 @@ +export default { + 'quick Search Fields': 'ID/用户ID/公告ID', + id: 'ID', + user_id: '用户', + notice_id: '公告', + notice_title: '公告标题', + username: '用户名', + read_at: '阅读时间', + confirmed: '已确认', + 'confirmed 0': '未确认', + 'confirmed 1': '已确认', + create_time: '创建时间', +} diff --git a/web/src/views/backend/operation/userNoticeRead/index.vue b/web/src/views/backend/operation/userNoticeRead/index.vue new file mode 100644 index 0000000..2cb37be --- /dev/null +++ b/web/src/views/backend/operation/userNoticeRead/index.vue @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + diff --git a/web/src/views/backend/operation/userNoticeRead/popupForm.vue b/web/src/views/backend/operation/userNoticeRead/popupForm.vue new file mode 100644 index 0000000..f659cd1 --- /dev/null +++ b/web/src/views/backend/operation/userNoticeRead/popupForm.vue @@ -0,0 +1,74 @@ + + + + {{ baTable.form.operate ? t(baTable.form.operate) : '' }} + + + + + + + + + + + + + + {{ t('Cancel') }} + {{ baTable.form.operateIds && baTable.form.operateIds.length > 1 ? t('Save and edit next item') : t('Save') }} + + + + + + + +