diff --git a/app/Http/Controllers/Api/ComplaintController.php b/app/Http/Controllers/Api/ComplaintController.php index 9019168db..71d3b477a 100755 --- a/app/Http/Controllers/Api/ComplaintController.php +++ b/app/Http/Controllers/Api/ComplaintController.php @@ -7,6 +7,7 @@ use App\Models\User; use App\Module\Base; use App\Models\Complaint; use App\Models\WebSocketDialog; +use App\Models\WebSocketDialogMsg; /** * @apiDefine dialog @@ -103,6 +104,19 @@ class ComplaintController extends AbstractController 'reason' => $reason, 'imgs' => $report_imgs, ])->save(); + // 通知管理员 + $botUser = User::botGetOrCreate('system-msg'); + User::where("identity", "like", "%,admin,%") + ->orderByDesc('line_at') + ->take(10) + ->get() + ->each(function ($adminUser) use ($reason, $botUser) { + $dialog = WebSocketDialog::checkUserDialog($botUser, $adminUser->userid); + if ($dialog) { + $text = "
收到新的举报信息:{$reason} (请前往应用查看详情)
"; + WebSocketDialogMsg::sendMsg(null, $dialog->id, 'text', ['text' => $text], $botUser->userid); // todo 未能在任务end事件来发送任务 + } + }); // return Base::retSuccess('success'); } diff --git a/resources/assets/js/pages/manage/components/ComplaintManagement.vue b/resources/assets/js/pages/manage/components/ComplaintManagement.vue index f4ec6307c..be760f9f5 100644 --- a/resources/assets/js/pages/manage/components/ComplaintManagement.vue +++ b/resources/assets/js/pages/manage/components/ComplaintManagement.vue @@ -94,61 +94,89 @@ export default { { title: this.$L('举报类型'), key: 'type', - minWidth: 80, + minWidth: 120, render: (h, { row }) => { - const arr = [h('AutoTip', this.$L(typeList.find(h => h.id == row.type).label))]; - return h('div', arr) + const label = this.$L(typeList.find(h => h.id == row.type).label) + return h('div', { + style: { + 'overflow': 'hidden', + 'text-overflow': 'ellipsis', + 'white-space': 'nowrap' + }, + on: { + click: () => { + $A.modalInfo({ + language: false, + title: this.$L('举报类型'), + content: label + }) + } + } + }, label) } }, { title: this.$L('状态'), key: 'status', - minWidth: 60, + minWidth: 80, render: (h, { row }) => { let text = row.status == 0 ? '未处理': '已处理'; - return h('div', this.$L(text)) + return h('div', { + style: { + color: row.status == 0 ? '#f00' : 'inherit', + } + }, [h('AutoTip', this.$L(text))]) } }, { title: this.$L('举报原因'), - minWidth: 120, + minWidth: 150, render: (h, { row }) => { - return h('div', [h('AutoTip', row.reason)]) + return h('div', { + style: { + 'overflow': 'hidden', + 'text-overflow': 'ellipsis', + 'white-space': 'nowrap' + }, + on: { + click: () => { + $A.modalInfo({ + language: false, + title: this.$L('举报原因'), + content: row.reason + }) + } + } + }, row.reason) } }, { title: this.$L('举报图'), - minWidth: 100, + minWidth: 85, render: (h, { row }) => { - const arr = []; - const imgs = JSON.parse(row.imgs)?.map(path => { + const list = JSON.parse(row.imgs)?.map(path => { return { src: $A.apiUrl("../" + path), } }); - imgs.forEach((item, index) => { - arr.push(h('img', { - attrs: { - src: item.src, - width: 70 - }, - on: { - click: () => { - this.$store.dispatch("previewImage", { index: index, list: imgs }) - } - } - })) - }); + if (list.length === 0) { + return h('div', '-') + } return h('div', { - attrs: { - style: "display: flex;padding: 4px 0;gap: 10px;" + style: { + color: '#1890ff', + }, + on: { + click: () => { + this.$store.dispatch("previewImage", { index: 0, list }) + } } - }, arr) + }, [h('AutoTip', this.$L('点击查看'))]) } }, { title: this.$L('举报人'), - minWidth: 60, + minWidth: 100, render: (h, { row }) => { return h('UserAvatar', { props: { @@ -200,7 +228,7 @@ export default { cancelText: this.$L('取消'), }, style: { - marginLeft: '8px', + marginLeft: params.row.status == 0 ? '8px' : '0', fontSize: '13px', cursor: 'pointer', color: '#f00', diff --git a/resources/assets/js/pages/manage/components/DialogWrapper.vue b/resources/assets/js/pages/manage/components/DialogWrapper.vue index 613bc913b..b9d0c3d9c 100644 --- a/resources/assets/js/pages/manage/components/DialogWrapper.vue +++ b/resources/assets/js/pages/manage/components/DialogWrapper.vue @@ -77,9 +77,6 @@ @command="onDialogMenu">