feat: admin/Projects.vue 桩合并到 manager/Projects.vue
admin 的 Projects.vue 原本是未完成桩 (91 行, 5 列只读, 无操作), 实质上是 manager 的 Projects.vue (874 行全功能) 的早期开始但没收尾。 合并方案 (最小动刀): - router L28: admin-projects 组件由 @/views/admin/Projects.vue 改为 @/views/manager/Projects.vue 注意: admin 路由 meta.title 由 '项目全览' 一并改为 '项目管理', 与 manager 文案统一 - AdminLayout L77: 菜单标题 '项目全览' → '项目管理' (与 router 同步) - 删除 ry-vue3/src/views/admin/Projects.vue admin 角色登录后看到的项目页 = manager 的全功能页 (新建/编辑/分配/评分/批量/导出/结题/开通/删除公告), 一步到位, 后续不用再分叉。 未做 / 后续: - admin 角色缺 /projects/new /projects/edit/:id /projects/detail/:id 路由, 想新建/编辑/查看会 404 (当前 manager 专属) - 后端权限校验 (例如 /business/project/rate) 是否对 admin 开放待确认
This commit is contained in:
@@ -74,7 +74,7 @@ const MENU = {
|
|||||||
{ path: '/admin/workbench', title: '工作台', icon: House },
|
{ path: '/admin/workbench', title: '工作台', icon: House },
|
||||||
{ path: '/admin/users', title: '用户管理', icon: User },
|
{ path: '/admin/users', title: '用户管理', icon: User },
|
||||||
{ path: '/admin/roles', title: '角色管理', icon: Setting },
|
{ path: '/admin/roles', title: '角色管理', icon: Setting },
|
||||||
{ path: '/admin/projects', title: '项目全览', icon: Document },
|
{ path: '/admin/projects', title: '项目管理', icon: Document },
|
||||||
{ path: '/admin/meetings', title: '会议全览', icon: Calendar },
|
{ path: '/admin/meetings', title: '会议全览', icon: Calendar },
|
||||||
{ path: '/admin/library', title: '资料库管理', icon: Box, children: [
|
{ path: '/admin/library', title: '资料库管理', icon: Box, children: [
|
||||||
{ path: '/admin/experts', title: '专家管理', icon: UserFilled },
|
{ path: '/admin/experts', title: '专家管理', icon: UserFilled },
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ const routes = [
|
|||||||
{ path: 'workbench', name: 'admin-workbench', component: () => import('@/views/admin/Workbench.vue'), meta: { title: '工作台' } },
|
{ path: 'workbench', name: 'admin-workbench', component: () => import('@/views/admin/Workbench.vue'), meta: { title: '工作台' } },
|
||||||
{ path: 'users', name: 'admin-users', component: () => import('@/views/admin/Users.vue'), meta: { title: '用户管理' } },
|
{ path: 'users', name: 'admin-users', component: () => import('@/views/admin/Users.vue'), meta: { title: '用户管理' } },
|
||||||
{ path: 'roles', name: 'admin-roles', component: () => import('@/views/admin/Roles.vue'), meta: { title: '角色管理' } },
|
{ path: 'roles', name: 'admin-roles', component: () => import('@/views/admin/Roles.vue'), meta: { title: '角色管理' } },
|
||||||
{ path: 'projects', name: 'admin-projects', component: () => import('@/views/admin/Projects.vue'), meta: { title: '项目全览' } },
|
{ path: 'projects', name: 'admin-projects', component: () => import('@/views/manager/Projects.vue'), meta: { title: '项目管理' } },
|
||||||
{ path: 'meetings', name: 'admin-meetings', component: () => import('@/views/admin/Meetings.vue'), meta: { title: '会议全览' } },
|
{ path: 'meetings', name: 'admin-meetings', component: () => import('@/views/admin/Meetings.vue'), meta: { title: '会议全览' } },
|
||||||
{ path: 'department', name: 'admin-department', component: () => import('@/views/admin/Department.vue'), meta: { title: '科室管理' } },
|
{ path: 'department', name: 'admin-department', component: () => import('@/views/admin/Department.vue'), meta: { title: '科室管理' } },
|
||||||
{ path: 'title', name: 'admin-title', component: () => import('@/views/admin/Title.vue'), meta: { title: '职称管理' } },
|
{ path: 'title', name: 'admin-title', component: () => import('@/views/admin/Title.vue'), meta: { title: '职称管理' } },
|
||||||
|
|||||||
@@ -1,99 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="page-card admin-projects">
|
|
||||||
<div class="breadcrumb">首页 / 项目全览</div>
|
|
||||||
|
|
||||||
<!-- ========== 筛选区 (与 People.vue 风格一致) ========== -->
|
|
||||||
<el-form inline :model="q" class="filter-form">
|
|
||||||
<el-form-item label="项目编号"><el-input v-model="q.projectNo" placeholder="输入项目编号" clearable /></el-form-item>
|
|
||||||
<el-form-item label="项目名称"><el-input v-model="q.projectName" placeholder="输入项目名称" clearable /></el-form-item>
|
|
||||||
<el-form-item label="状态">
|
|
||||||
<el-select v-model="q.status" placeholder="全部状态" clearable>
|
|
||||||
<el-option v-for="s in statusOptions" :key="s.value" :label="s.label" :value="s.value" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="是否结题">
|
|
||||||
<el-select v-model="q.isFinished" placeholder="全部" clearable>
|
|
||||||
<el-option label="未结题" value="0" />
|
|
||||||
<el-option label="已结题" value="1" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" @click="load">查询</el-button>
|
|
||||||
<el-button @click="reset">重置</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
|
|
||||||
<!-- ========== 表格 (与 People.vue 风格一致, 无 page-card 包裹) ========== -->
|
|
||||||
<el-table :data="rows" border stripe v-loading="loading">
|
|
||||||
<el-table-column prop="projectNo" label="项目编号" width="140" />
|
|
||||||
<el-table-column prop="projectName" label="项目名称" min-width="200" show-overflow-tooltip />
|
|
||||||
<el-table-column prop="status" label="状态" width="100">
|
|
||||||
<template #default="{ row }">
|
|
||||||
<el-tag :type="STATUS_TAG[row.status] || 'info'">{{ STATUS_LABEL[row.status] || row.status }}</el-tag>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="isFinished" label="结题" width="80">
|
|
||||||
<template #default="{ row }">
|
|
||||||
<el-tag :type="row.isFinished === '1' ? 'success' : 'info'">{{ row.isFinished === '1' ? '已结题' : '未结题' }}</el-tag>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="createTime" label="创建时间" width="170" />
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<div class="pager">
|
|
||||||
<el-pagination
|
|
||||||
v-model:current-page="q.pageNum"
|
|
||||||
v-model:page-size="q.pageSize"
|
|
||||||
:total="total"
|
|
||||||
:page-sizes="[10, 20, 50]"
|
|
||||||
layout="total, sizes, prev, pager, next, jumper"
|
|
||||||
@current-change="load"
|
|
||||||
@size-change="load"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { ref, reactive, onMounted } from 'vue'
|
|
||||||
import { bizList } from '@/api/public'
|
|
||||||
|
|
||||||
const STATUS_LABEL = {
|
|
||||||
DRAFT: '草稿', PENDING: '待审批', APPROVED: '已审批', REJECTED: '已驳回', FINISHED: '已结题'
|
|
||||||
}
|
|
||||||
const STATUS_TAG = {
|
|
||||||
DRAFT: 'info', PENDING: 'warning', APPROVED: 'success', REJECTED: 'danger', FINISHED: 'success'
|
|
||||||
}
|
|
||||||
const statusOptions = Object.entries(STATUS_LABEL).map(([value, label]) => ({ value, label }))
|
|
||||||
|
|
||||||
const q = reactive({ projectNo: '', projectName: '', status: '', isFinished: '', pageNum: 1, pageSize: 20 })
|
|
||||||
const rows = ref([])
|
|
||||||
const total = ref(0)
|
|
||||||
const loading = ref(false)
|
|
||||||
|
|
||||||
async function load() {
|
|
||||||
loading.value = true
|
|
||||||
try {
|
|
||||||
const r = await bizList('project', { ...q })
|
|
||||||
rows.value = r.rows || (r.data && r.data.rows) || []
|
|
||||||
total.value = r.total || (r.data && r.data.total) || 0
|
|
||||||
} finally {
|
|
||||||
loading.value = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function reset() {
|
|
||||||
Object.assign(q, { projectNo: '', projectName: '', status: '', isFinished: '', pageNum: 1 })
|
|
||||||
load()
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(load)
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
/* 整页面板 (与 People.vue 风格一致) */
|
|
||||||
.admin-projects { padding: 16px; }
|
|
||||||
.breadcrumb { font-size: 13px; color: #8c8c8c; margin-bottom: 12px; }
|
|
||||||
.filter-form { margin-bottom: 12px; }
|
|
||||||
.pager { display: flex; justify-content: flex-end; margin-top: 12px; }
|
|
||||||
</style>
|
|
||||||
Reference in New Issue
Block a user