提交 2016823d authored 作者: matian's avatar matian

chore:项目管理开发

上级 76ca616e
import httpRequest from '@/utils/axios' import httpRequest from '@/utils/axios'
// 获取视频列表 // 获取项目列表
export function getVideoList(params?: { type?: string; page?: number; page_size?: number }) { export function getProjectList(params?: {
return httpRequest.get('/api/psp/backend/video/index', { params }) name?: string
} type?: string
status?: string
// 创建视频 audit_status?: string
export function createVideo(data: { course_name: string; cover_page: string; type: string; weight?: string }) { page?: number
return httpRequest.post('/api/psp/backend/video/create', data) page_size?: number
}
// 更新视频
export function updateVideo(data: {
id: string
course_name: string
cover_page: string
type: string
weight?: string
}) { }) {
return httpRequest.post('/api/psp/backend/video/update', data) return httpRequest.get('/api/hr/admin/v1/projects', { params })
} }
// 获取视频详情 // 获取项目详情
export function getVideo(params: { id: string }) { export function getProjectDetails(params: { id: string }) {
return httpRequest.get('/api/psp/backend/video/view', { params }) return httpRequest.get(`/api/hr/admin/v1/project/${params.id}/detail`, { params })
} }
// 企业审核
// 删除视频 export function getProjectAdult(data: { id: string; status: number }) {
export function deleteVideo(data: { id: string }) { return httpRequest.post(`/api/hr/admin/v1/project/${data.id}/audit`, data)
return httpRequest.post('/api/psp/backend/video/delete', data) }
// 启用禁用
export function getProjectStatus(data: { id: string; status: number }) {
return httpRequest.post(`/api/hr/admin/v1/project/${data.id}/enable`, data)
} }
export const typeMap = [
{ label: '合作项目', value: 1 },
{ label: '创新项目', value: 2 },
{ label: '招聘项目', value: 3 }
]
export const adultStatus = [
{ value: 1, label: '审核通过' },
{ value: 2, label: '审核不通过' },
{ value: 3, label: '待审核' }
]
export const statusMap = [
{ value: 1, label: '启用' },
{ value: 2, label: '禁用' }
]
<script setup lang="ts"> <script setup lang="ts">
// import { getVideoList } from '../api' import { getProjectList, getProjectStatus } from '../api'
import { typeMap, adultStatus, statusMap } from '../map'
const appList = ref() const appList = ref()
const router = useRouter()
const listOptions = { const listOptions = {
remote: { remote: {
// httpRequest: getVideoList, httpRequest: getProjectList,
params: { status: '' } params: { name: '', type: '', status: '', audit_status: '' }
}, },
filters: [ filters: [
{ type: 'input', prop: 'name', placeholder: '项目名称' }, { type: 'input', prop: 'name', placeholder: '项目名称' },
...@@ -14,77 +15,70 @@ const listOptions = { ...@@ -14,77 +15,70 @@ const listOptions = {
type: 'select', type: 'select',
prop: 'type', prop: 'type',
placeholder: '项目类型', placeholder: '项目类型',
options: [ options: typeMap
{ label: '合作项目', value: '1' },
{ label: '创新项目', value: '2' },
{ label: '招聘项目', value: '3' }
]
}, },
{ {
type: 'select', type: 'select',
prop: 'adultStatus', prop: 'audit_status',
placeholder: '审核状态', placeholder: '审核状态',
options: [ options: adultStatus
{ value: '0', label: '待审核' },
{ value: '1', label: '通过' },
{ value: '2', label: '不通过' }
]
}, },
{ {
type: 'select', type: 'select',
prop: 'openStatus', prop: 'status',
placeholder: '启用状态', placeholder: '启用状态',
options: [ options: statusMap
{ value: '0', label: '启用' },
{ value: '1', label: '禁用' }
]
} }
], ],
columns: [ columns: [
{ label: '编号', prop: 'id', align: 'center' }, { label: '编号', prop: 'id', align: 'center' },
{ label: '项目名称', prop: 'name', align: 'center' }, { label: '项目名称', prop: 'name', align: 'center' },
{ label: '项目类型', prop: 'type', align: 'center' }, {
label: '项目类型',
prop: 'type',
align: 'center',
computed(row: any) {
return typeMap.filter(item => item.value === row.row.type)[0]?.label
}
},
{ label: '开始时间', prop: 'start_time', align: 'center' }, { label: '开始时间', prop: 'start_time', align: 'center' },
{ label: '结束时间', prop: 'end_time', align: 'center' }, { label: '结束时间', prop: 'end_time', align: 'center' },
{ label: '联系人', prop: 'contact', align: 'center' }, { label: '联系人', prop: 'contact', align: 'center' },
{ label: '项目所属公司 ', prop: 'company_name', align: 'center' }, // 待修改 { label: '项目所属公司 ', prop: 'company.name', align: 'center' }, // 待修改
{ {
label: '启用状态', label: '启用状态',
prop: 'openStatus', prop: 'status',
slots: 'status' slots: 'status'
}, },
{ {
label: '审核状态', label: '审核状态',
prop: 'adultStatus', prop: 'audit_status',
computed(row: any) { computed(row: any) {
if (row.status === 3) { return adultStatus.filter(item => item.value === row.row.type)[0]?.label
return '待审核'
} else if (row.status === 4) {
return '不通过'
} else {
return '通过'
}
} }
}, },
{ label: '操作', slots: 'table-operate', width: 230, align: 'center' } { label: '操作', slots: 'table-operate', width: 230, align: 'center' }
],
data: [
{
status: 1,
id: '11'
}
] ]
} }
// 修改启用状态,刷新列表 // 修改启用状态,刷新列表
const handleStatus = (row: any) => { const handleStatus = (row: any) => {
console.log(row) const params: any = {
// const params: any = { id: row.id,
// id: row.id, status: row.status
// status: row.status }
// } getProjectStatus(params).then(() => {
// getCompanyAdult(params).then(() => { appList.value.refetch()
// appList.value.refetch() })
// }) }
const handleDetail = (row: any) => {
router.push({
path: '/project/view',
query: {
id: row.id,
status: row.audit_status
}
})
} }
</script> </script>
...@@ -102,13 +96,12 @@ const handleStatus = (row: any) => { ...@@ -102,13 +96,12 @@ const handleStatus = (row: any) => {
inactive-text="禁用" inactive-text="禁用"
inline-prompt inline-prompt
style="--el-switch-on-color: #aa1941" style="--el-switch-on-color: #aa1941"
:disabled="row.audit_status === 2 || row.audit_status === 3"
></el-switch> ></el-switch>
</template> </template>
<template #table-operate="{ row }"> <template #table-operate="{ row }">
<el-space> <el-space>
<router-link :to="`/company/view?id=${row.id}&status=${row.status}`"> <el-link type="primary" @click="handleDetail(row)">{{ row.audit_status !== 3 ? '查看' : '审批' }}</el-link>
<el-link type="primary">{{ row.status !== 3 ? '查看' : '审批' }}</el-link>
</router-link>
</el-space> </el-space>
</template> </template>
</AppList> </AppList>
......
<script setup lang="ts"> <script setup lang="ts">
import { ElMessage } from 'element-plus'
import { getProjectDetails, getProjectAdult } from '../api'
import { typeMap } from '../map'
const route = useRoute() const route = useRoute()
const router = useRouter()
let detailList: any = ref({})
//审核通过 //审核通过
const handleAdultSuccess = () => { const handleAdultSuccess = () => {
console.log('审核通过') const params: any = {
history.go(-1) id: route.query.id,
status: 1
}
getProjectAdult(params).then(() => {
ElMessage.success('审批通过')
router.push('/project')
})
} }
//审核不通过 //审核不通过
const handleAdultFailed = () => { const handleAdultFailed = () => {
console.log('审核不通过') const params: any = {
history.go(-1) id: route.query.id,
status: 2
}
getProjectAdult(params).then(() => {
ElMessage.success('审批不通过')
router.push('/project')
})
} }
const detailList = reactive({ onMounted(() => {
logo: 'https://zws-imgs-pub.ezijing.com/static/ezijing/logo/ezijing-logo.svg', const params: any = { id: route.query.id }
name: '紫荆项目', getProjectDetails(params).then(res => {
contact: '里斯', detailList.value = res.data.detail
type: '合作项目', })
contact_mobile: '18339181067',
start_time: '2022-01-01',
end_time: '2022-06-30',
desc: '紫荆教育全称是清控紫荆(北京)教育科技股份有限公司,是清华控股有限公司2015年以清华大学五道口金融学院教研成果为基础发起设立。“紫荆”二字取自清华大学校花“紫荆花”,寓意“自强不息,向美而行”。',
documents: [
{
name: '招生简章',
icon: 'https://webapp-pub.ezijing.com/project/marywood/pdf.png',
url: 'https://webapp-pub.ezijing.com/project_online_pc/edd/%E6%8B%9B%E7%94%9F%E7%AE%80%E7%AB%A0.pdf'
},
{
name: '常见问题',
icon: 'https://webapp-pub.ezijing.com/project/marywood/pdf.png',
url: 'https://webapp-pub.ezijing.com/project_online_pc/edd/%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98.pdf'
}
]
}) })
</script> </script>
...@@ -39,7 +42,7 @@ const detailList = reactive({ ...@@ -39,7 +42,7 @@ const detailList = reactive({
<AppCard title="项目详情"> <AppCard title="项目详情">
<el-descriptions :column="4" direction="vertical"> <el-descriptions :column="4" direction="vertical">
<el-descriptions-item> <el-descriptions-item>
<el-image :src="detailList.logo" style="width: 100px" /> <el-image :src="detailList.logo" style="width: 150px" />
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="项目名称:">{{ detailList.name }}</el-descriptions-item> <el-descriptions-item label="项目名称:">{{ detailList.name }}</el-descriptions-item>
<el-descriptions-item label="开始时间:"> <el-descriptions-item label="开始时间:">
...@@ -48,7 +51,9 @@ const detailList = reactive({ ...@@ -48,7 +51,9 @@ const detailList = reactive({
<el-descriptions-item label="联系人:">{{ detailList.contact }}</el-descriptions-item> <el-descriptions-item label="联系人:">{{ detailList.contact }}</el-descriptions-item>
<el-descriptions-item></el-descriptions-item> <el-descriptions-item></el-descriptions-item>
<el-descriptions-item label="项目类型:">{{ detailList.type }}</el-descriptions-item> <el-descriptions-item label="项目类型:">{{
typeMap.filter(item => item.value === detailList.type)[0]?.label
}}</el-descriptions-item>
<el-descriptions-item label="结束时间:"> <el-descriptions-item label="结束时间:">
{{ detailList.end_time }} {{ detailList.end_time }}
</el-descriptions-item> </el-descriptions-item>
...@@ -62,10 +67,10 @@ const detailList = reactive({ ...@@ -62,10 +67,10 @@ const detailList = reactive({
</div> </div>
<div class="project_intro_title">项目文件</div> <div class="project_intro_title">项目文件</div>
<div class="dataList"> <div class="dataList">
<a target="_blank" :href="item.url" v-for="(item, index) in detailList.documents" :key="index"> <a target="_blank" :href="item" v-for="(item, index) in detailList.documents" :key="index">
<div class="item"> <div class="item">
<img :src="item.icon" alt="" /> <img :src="item" alt="" style="width: 30px; height: 30px" />
<p class="doc">{{ item.name }}</p> <!-- <p class="doc">{{ item }}</p> -->
<p class="p1">预览</p> <p class="p1">预览</p>
</div> </div>
</a> </a>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论