fix: 将 admin 改为普通目录

This commit is contained in:
hajimi
2026-07-31 16:39:16 +08:00
parent e7f9328611
commit fdf8022662
592 changed files with 41318 additions and 1 deletions
@@ -0,0 +1,77 @@
<template>
<div class="community-comment-account">
<el-card class="!border-none" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" :inline="true">
<el-form-item class="w-[280px]" label="关键词">
<el-input
v-model="queryParams.keyword"
placeholder="输入账号/昵称/用户ID"
clearable
@keyup.enter="resetPage"
/>
</el-form-item>
<el-form-item class="w-[220px]" label="账号状态">
<el-select v-model="queryParams.is_disable" clearable>
<el-option label="全部" value="" />
<el-option label="正常" :value="0" />
<el-option label="禁用" :value="1" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-form>
</el-card>
<el-card class="!border-none mt-4" shadow="never">
<el-table size="large" v-loading="pager.loading" :data="pager.lists">
<el-table-column label="ID" prop="id" min-width="70" />
<el-table-column label="评论账号" min-width="180">
<template #default="{ row }">
<div>{{ row.account }}</div>
<div class="text-xs text-gray-400">SN: {{ row.sn }}</div>
</template>
</el-table-column>
<el-table-column label="昵称 / 人设" min-width="180">
<template #default="{ row }">
<div>{{ row.nickname }}</div>
<el-tag size="small" class="mt-1">{{ row.persona_label }}</el-tag>
</template>
</el-table-column>
<el-table-column label="账号状态" min-width="90">
<template #default="{ row }">
<el-tag :type="row.is_disable ? 'danger' : 'success'">
{{ row.is_disable ? '禁用' : '正常' }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="资讯评论数" prop="article_comment_count" min-width="100" />
<el-table-column label="社区评论数" prop="community_comment_count" min-width="100" />
<el-table-column label="总评论数" prop="total_comment_count" min-width="100" />
<el-table-column label="创建时间" prop="create_time" min-width="160" />
</el-table>
<div class="flex justify-end mt-4">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
</div>
</template>
<script lang="ts" setup name="communityCommentAccount">
import { reactive } from 'vue'
import { communityCommentAccountLists } from '@/api/community'
import { usePaging } from '@/hooks/usePaging'
const queryParams = reactive({
keyword: '',
is_disable: ''
})
const { pager, getLists, resetPage, resetParams } = usePaging({
fetchFun: communityCommentAccountLists,
params: queryParams
})
getLists()
</script>
+148
View File
@@ -0,0 +1,148 @@
<template>
<div class="community-comment">
<el-card class="!border-none" shadow="never">
<el-form ref="formRef" class="mb-[-16px]" :model="queryParams" :inline="true">
<el-form-item class="w-[220px]" label="目标ID">
<el-input
v-model="queryParams.target_id"
placeholder="输入文章ID/帖子ID"
clearable
@keyup.enter="resetPage"
/>
</el-form-item>
<el-form-item class="w-[220px]" label="评论类型">
<el-select v-model="queryParams.comment_type" clearable>
<el-option label="全部" value="" />
<el-option label="资讯评论" value="article" />
<el-option label="社区评论" value="post" />
</el-select>
</el-form-item>
<el-form-item class="w-[220px]" label="用户类型">
<el-select v-model="queryParams.is_virtual" clearable>
<el-option label="全部" value="" />
<el-option label="虚拟评论" :value="1" />
<el-option label="真实评论" :value="0" />
</el-select>
</el-form-item>
<el-form-item class="w-[220px]" label="评论状态">
<el-select v-model="queryParams.status" clearable>
<el-option label="全部" value="" />
<el-option label="正常" :value="1" />
<el-option label="隐藏" :value="0" />
</el-select>
</el-form-item>
<el-form-item class="w-[260px]" label="关键词">
<el-input
v-model="queryParams.keyword"
placeholder="输入评论内容/标题/用户"
clearable
@keyup.enter="resetPage"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-form>
</el-card>
<el-card class="!border-none mt-4" shadow="never">
<el-table size="large" v-loading="pager.loading" :data="pager.lists">
<el-table-column label="ID" prop="id" min-width="70" />
<el-table-column label="评论类型" min-width="100">
<template #default="{ row }">
<el-tag :type="row.comment_type === 'article' ? 'primary' : 'success'">
{{ row.source_type_desc }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="目标信息" min-width="280">
<template #default="{ row }">
<div class="text-xs text-gray-400">#{{ row.target_id }} · {{ row.target_owner_nickname }}</div>
<div class="truncate">{{ row.target_title }}</div>
<div class="truncate text-xs text-gray-400">{{ row.target_summary || '-' }}</div>
</template>
</el-table-column>
<el-table-column label="评论用户" min-width="180">
<template #default="{ row }">
<div>{{ row.nickname }} (ID:{{ row.user_id }})</div>
<div class="text-xs text-gray-400">{{ row.account }}</div>
<el-tag size="small" class="mt-1" :type="row.is_virtual ? 'warning' : 'info'">
{{ row.user_type_desc }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="评论内容" prop="content" min-width="220" show-tooltip-when-overflow />
<el-table-column label="点赞" prop="like_count" min-width="70" />
<el-table-column label="状态" min-width="90">
<template #default="{ row }">
<el-switch
v-perms="['community.communityComment/updateStatus']"
v-model="row.status"
:active-value="1"
:inactive-value="0"
@change="handleStatus($event, row.id, row.comment_type)"
/>
</template>
</el-table-column>
<el-table-column label="评论时间" prop="create_time" min-width="160" />
<el-table-column label="操作" width="100" fixed="right">
<template #default="{ row }">
<el-button
v-perms="['community.communityComment/delete']"
type="danger"
link
@click="handleDelete(row.id, row.comment_type)"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<div class="flex justify-end mt-4">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
</div>
</template>
<script lang="ts" setup name="communityComment">
import { reactive } from 'vue'
import {
communityCommentDelete,
communityCommentLists,
communityCommentStatus
} from '@/api/community'
import { usePaging } from '@/hooks/usePaging'
import feedback from '@/utils/feedback'
const queryParams = reactive({
target_id: '',
comment_type: '',
is_virtual: '',
status: '',
keyword: ''
})
const { pager, getLists, resetPage, resetParams } = usePaging({
fetchFun: communityCommentLists,
params: queryParams
})
const handleStatus = async (status: number, id: number, comment_type: string) => {
try {
await communityCommentStatus({ id, status, comment_type })
getLists()
} catch (error) {
getLists()
}
}
const handleDelete = async (id: number, comment_type: string) => {
await feedback.confirm('确定要删除该评论?')
await communityCommentDelete({ id, comment_type })
getLists()
}
getLists()
</script>
+210
View File
@@ -0,0 +1,210 @@
<template>
<div class="community-post">
<el-card class="!border-none" shadow="never">
<el-form ref="formRef" class="mb-[-16px]" :model="queryParams" :inline="true">
<el-form-item class="w-[280px]" label="帖子状态">
<el-select v-model="queryParams.status" clearable>
<el-option label="全部" value="" />
<el-option label="待审核" :value="0" />
<el-option label="已通过" :value="1" />
<el-option label="已拒绝" :value="2" />
</el-select>
</el-form-item>
<el-form-item class="w-[280px]" label="帖子类型">
<el-select v-model="queryParams.post_type" clearable>
<el-option label="全部" value="" />
<el-option label="普通帖子" :value="0" />
<el-option label="赛事分析" :value="1" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-form>
</el-card>
<el-card class="!border-none mt-4" shadow="never">
<el-table size="large" v-loading="pager.loading" :data="pager.lists">
<el-table-column label="ID" prop="id" min-width="60" />
<el-table-column label="用户" min-width="120">
<template #default="{ row }">
<span>{{ row.nickname }} (ID:{{ row.user_id }})</span>
</template>
</el-table-column>
<el-table-column label="内容" min-width="200" show-tooltip-when-overflow>
<template #default="{ row }">
{{ row.content ? row.content.substring(0, 50) : '-' }}
</template>
</el-table-column>
<el-table-column label="类型" min-width="80">
<template #default="{ row }">
<el-tag v-if="row.post_type === 1" type="warning">赛事分析</el-tag>
<el-tag v-else>普通</el-tag>
</template>
</el-table-column>
<el-table-column label="付费" min-width="80">
<template #default="{ row }">
<el-tag v-if="row.is_paid" type="danger">{{ row.price_points }}积分</el-tag>
<el-tag v-else type="info">免费</el-tag>
</template>
</el-table-column>
<el-table-column label="浏览" prop="view_count" min-width="70" />
<el-table-column label="点赞" prop="like_count" min-width="70" />
<el-table-column label="评论" prop="comment_count" min-width="70" />
<el-table-column label="置顶" min-width="70">
<template #default="{ row }">
<el-switch v-perms="['community.communityPost/setTop']" v-model="row.is_top" :active-value="1"
:inactive-value="0" @change="handleSetTop($event, row.id)" />
</template>
</el-table-column>
<el-table-column label="热门" min-width="70">
<template #default="{ row }">
<el-switch v-perms="['community.communityPost/setHot']" v-model="row.is_hot" :active-value="1"
:inactive-value="0" @change="handleSetHot($event, row.id)" />
</template>
</el-table-column>
<el-table-column label="状态" min-width="80">
<template #default="{ row }">
<el-tag v-if="row.status === 0" type="warning">待审核</el-tag>
<el-tag v-else-if="row.status === 1" type="success">已通过</el-tag>
<el-tag v-else type="danger">已拒绝</el-tag>
</template>
</el-table-column>
<el-table-column label="发布时间" prop="create_time" min-width="150" />
<el-table-column label="操作" width="230" fixed="right">
<template #default="{ row }">
<el-button v-perms="['community.communityPost/detail']" type="primary" link
@click="handleDetail(row.id)">
详情
</el-button>
<el-button v-if="row.status === 0" v-perms="['community.communityPost/updateStatus']"
type="success" link @click="handleAudit(row.id, 1)">
通过
</el-button>
<el-button v-if="row.status === 0" v-perms="['community.communityPost/updateStatus']"
type="warning" link @click="handleAudit(row.id, 2)">
拒绝
</el-button>
<el-button v-perms="['community.communityPost/delete']" type="danger" link
@click="handleDelete(row.id)">
删除
</el-button>
</template>
</el-table-column>
</el-table>
<div class="flex justify-end mt-4">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
<el-dialog v-model="showDetail" title="帖子详情" width="700px">
<div v-loading="detailLoading">
<div class="flex items-center mb-4">
<el-avatar :src="detailData.avatar" :size="40" />
<div class="ml-3">
<div class="font-bold">{{ detailData.nickname }}</div>
<div class="text-xs text-gray-400">用户ID: {{ detailData.user_id }} | {{ detailData.create_time }}
</div>
</div>
<div class="ml-auto">
<el-tag v-if="detailData.status === 0" type="warning">待审核</el-tag>
<el-tag v-else-if="detailData.status === 1" type="success">已通过</el-tag>
<el-tag v-else type="danger">已拒绝</el-tag>
<el-tag v-if="detailData.post_type === 1" type="warning" class="ml-2">赛事分析</el-tag>
</div>
</div>
<el-divider />
<div class="mb-4 whitespace-pre-wrap">{{ detailData.content }}</div>
<div v-if="detailData.images && detailData.images.length" class="flex flex-wrap gap-2 mb-4">
<el-image v-for="(img, idx) in detailData.images" :key="idx" :src="img"
:preview-src-list="detailData.images" :initial-index="idx" fit="cover"
class="w-[100px] h-[100px] rounded" />
</div>
<el-divider />
<el-descriptions :column="3" border size="small">
<el-descriptions-item label="浏览">{{ detailData.view_count || 0 }}</el-descriptions-item>
<el-descriptions-item label="点赞">{{ detailData.like_count || 0 }}</el-descriptions-item>
<el-descriptions-item label="评论">{{ detailData.comment_count || 0 }}</el-descriptions-item>
<el-descriptions-item label="分享">{{ detailData.share_count || 0 }}</el-descriptions-item>
<el-descriptions-item label="付费解锁">{{ detailData.paid_count || 0 }}</el-descriptions-item>
<el-descriptions-item label="付费积分">{{ detailData.is_paid ? detailData.price_points + '积分' : '免费'
}}</el-descriptions-item>
<el-descriptions-item label="置顶">{{ detailData.is_top ? '是' : '否' }}</el-descriptions-item>
<el-descriptions-item label="热门">{{ detailData.is_hot ? '是' : '否' }}</el-descriptions-item>
<el-descriptions-item label="更新时间">{{ detailData.update_time || '-' }}</el-descriptions-item>
</el-descriptions>
</div>
<template #footer>
<el-button @click="showDetail = false">关闭</el-button>
</template>
</el-dialog>
</div>
</template>
<script lang="ts" setup name="communityPost">
import {
communityPostLists,
communityPostDetail,
communityPostStatus,
communityPostSetTop,
communityPostSetHot,
communityPostDelete
} from '@/api/community'
import { usePaging } from '@/hooks/usePaging'
import feedback from '@/utils/feedback'
const queryParams = reactive({
status: '',
post_type: ''
})
const { pager, getLists, resetPage, resetParams } = usePaging({
fetchFun: communityPostLists,
params: queryParams
})
const handleAudit = async (id: number, status: number) => {
await feedback.confirm(status === 1 ? '确定通过该帖子?' : '确定拒绝该帖子?')
await communityPostStatus({ id, status })
getLists()
}
const handleSetTop = async (is_top: any, id: number) => {
try {
await communityPostSetTop({ id, is_top })
getLists()
} catch (error) {
getLists()
}
}
const handleSetHot = async (is_hot: any, id: number) => {
try {
await communityPostSetHot({ id, is_hot })
getLists()
} catch (error) {
getLists()
}
}
const handleDelete = async (id: number) => {
await feedback.confirm('确定要删除该帖子?')
await communityPostDelete({ id })
getLists()
}
const showDetail = ref(false)
const detailLoading = ref(false)
const detailData = ref<any>({})
const handleDetail = async (id: number) => {
showDetail.value = true
detailLoading.value = true
try {
const res = await communityPostDetail({ id })
detailData.value = res
} finally {
detailLoading.value = false
}
}
getLists()
</script>
+171
View File
@@ -0,0 +1,171 @@
<template>
<div class="community-tag">
<el-card class="!border-none" shadow="never">
<el-form ref="formRef" class="mb-[-16px]" :model="queryParams" :inline="true">
<el-form-item class="w-[280px]" label="标签名称">
<el-input
v-model="queryParams.name"
placeholder="输入标签名称"
clearable
@keyup.enter="resetPage"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-form>
</el-card>
<el-card class="!border-none mt-4" shadow="never">
<div>
<el-button
v-perms="['community.communityTag/add']"
type="primary"
class="mb-4"
@click="handleAdd"
>
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增标签
</el-button>
</div>
<el-table size="large" v-loading="pager.loading" :data="pager.lists">
<el-table-column label="ID" prop="id" min-width="60" />
<el-table-column label="标签名称" prop="name" min-width="120" />
<el-table-column label="帖子数" prop="post_count" min-width="80" />
<el-table-column label="排序" prop="sort" min-width="80" />
<el-table-column label="热门" min-width="80">
<template #default="{ row }">
<el-tag v-if="row.is_hot" type="danger">热门</el-tag>
<el-tag v-else type="info">普通</el-tag>
</template>
</el-table-column>
<el-table-column label="状态" min-width="80">
<template #default="{ row }">
<el-tag v-if="row.status === 1" type="success">启用</el-tag>
<el-tag v-else type="danger">禁用</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" width="150" fixed="right">
<template #default="{ row }">
<el-button
v-perms="['community.communityTag/edit']"
type="primary"
link
@click="handleEdit(row)"
>
编辑
</el-button>
<el-button
v-perms="['community.communityTag/delete']"
type="danger"
link
@click="handleDelete(row.id)"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<div class="flex justify-end mt-4">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
<!-- 新增/编辑弹窗 -->
<el-dialog
v-model="showEdit"
:title="editData.id ? '编辑标签' : '新增标签'"
width="500px"
>
<el-form ref="editFormRef" :model="editData" :rules="editRules" label-width="80px">
<el-form-item label="标签名称" prop="name">
<el-input v-model="editData.name" placeholder="请输入标签名称" />
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input-number v-model="editData.sort" :min="0" :max="9999" />
</el-form-item>
<el-form-item label="热门">
<el-switch v-model="editData.is_hot" :active-value="1" :inactive-value="0" />
</el-form-item>
<el-form-item label="状态">
<el-switch v-model="editData.status" :active-value="1" :inactive-value="0" />
</el-form-item>
</el-form>
<template #footer>
<el-button @click="showEdit = false">取消</el-button>
<el-button type="primary" @click="handleSubmit">确定</el-button>
</template>
</el-dialog>
</div>
</template>
<script lang="ts" setup name="communityTag">
import {
communityTagLists,
communityTagAdd,
communityTagEdit,
communityTagDelete
} from '@/api/community'
import { usePaging } from '@/hooks/usePaging'
import feedback from '@/utils/feedback'
import type { FormInstance } from 'element-plus'
const queryParams = reactive({
name: ''
})
const { pager, getLists, resetPage, resetParams } = usePaging({
fetchFun: communityTagLists,
params: queryParams
})
const showEdit = ref(false)
const editFormRef = ref<FormInstance>()
const editData = reactive({
id: 0,
name: '',
sort: 0,
is_hot: 0,
status: 1
})
const editRules = {
name: [{ required: true, message: '请输入标签名称', trigger: 'blur' }]
}
const handleAdd = () => {
Object.assign(editData, { id: 0, name: '', sort: 0, is_hot: 0, status: 1 })
showEdit.value = true
}
const handleEdit = (row: any) => {
Object.assign(editData, {
id: row.id,
name: row.name,
sort: row.sort,
is_hot: row.is_hot,
status: row.status
})
showEdit.value = true
}
const handleSubmit = async () => {
await editFormRef.value?.validate()
if (editData.id) {
await communityTagEdit(editData)
} else {
await communityTagAdd(editData)
}
showEdit.value = false
getLists()
}
const handleDelete = async (id: number) => {
await feedback.confirm('确定要删除该标签?')
await communityTagDelete({ id })
getLists()
}
getLists()
</script>