提交 b4fd03e0 authored 作者: 王鹏飞's avatar 王鹏飞

updates

上级 ed3bd017
......@@ -120,7 +120,7 @@ defineExpose({ refetch })
<template v-for="item in filters" :key="item.prop">
<el-form-item :label="item.label" :prop="item.prop">
<template v-if="item.slots">
<slot :name="item.slots" v-bind="{ params }" @change="search"></slot>
<slot :name="item.slots" v-bind="{ params }"></slot>
</template>
<template v-else>
<!-- input -->
......
import httpRequest from '@/utils/axios'
// 获取审核列表
// 类型(1:入学指南,2:学习地图,3:考试攻略,4:消息)
export function getAuditList(params?: { type?: string; page?: number; page_size?: number }) {
return httpRequest.get('/api/psp/backend/auditing/index', { params })
}
// 获取审核详情
export function getAudit(params: { id: string }) {
return httpRequest.get('/api/psp/backend/auditing/view', { params })
}
// 提交审核
export function submitAudit(data: { tab: string; id: string; status: number; audit_comment?: string }) {
return httpRequest.post('/api/psp/backend/auditing/audit', data)
}
import type { RouteRecordRaw } from 'vue-router'
import AppLayout from '@/components/layout/Index.vue'
export const routes: Array<RouteRecordRaw> = [
{
path: '/audit',
component: AppLayout,
children: [{ path: '', component: () => import('./views/List.vue') }]
}
]
<script setup lang="ts">
import { ref, computed } from 'vue'
import { ElMessage } from 'element-plus'
import { ArrowDown } from '@element-plus/icons-vue'
import { getAuditList, submitAudit } from '../api'
const appList = ref()
const tabActive = ref<string>('course')
const listOptions = computed(() => {
const columns =
tabActive.value === 'course'
? [
{ label: 'ID', prop: 'id' },
{ label: '课程名称', prop: 'course_name' },
{ label: '章节名称', prop: 'chapter_name' },
{ label: '申请人', prop: 'user_info.name' },
{ label: '审核状态', prop: 'status_name' },
{ label: '类型', prop: 'type_name' },
{ label: '浏览量', prop: 'pv' },
{ label: '评论数', prop: 'comment_count' },
{ label: '创建时间', prop: 'created_time' },
{ label: '操作', slots: 'table-operate', width: 180, align: 'right' }
]
: [
{ label: 'ID', prop: 'id' },
{ label: '申请人', prop: 'user_info.name' },
{ label: '审核状态', prop: 'status_name' },
{ label: '创建时间', prop: 'created_time' },
{ label: '操作', slots: 'table-operate', width: 180, align: 'right' }
]
return {
remote: {
httpRequest: getAuditList,
params: { tab: 'course', status: '' }
},
filters: [
{ label: '类型', prop: 'tab', slots: 'filter-type' },
{
type: 'select',
prop: 'status',
label: '状态',
options: [
{ label: '全部', value: '' },
{ label: '已审核', value: '1' },
{ label: '待审核', value: '2' }
]
}
],
columns
}
})
const typeList = [
{ label: '打卡审核', value: 'course' },
{ label: '导师申请审核', value: 'teacher' }
]
const onChangeType = (value: string) => {
tabActive.value = value
appList.value?.refetch()
}
const onAudit = (row: any, status: number) => {
submitAudit({ tab: tabActive.value, id: row.id, status, audit_comment: '' }).then(() => {
ElMessage({ type: 'success', message: '审核完成' })
appList.value?.refetch()
})
}
</script>
<template>
<AppCard>
<AppList v-bind="listOptions" ref="appList">
<template #header-aside>
<router-link to="/banner/create">
<el-button type="primary">创建</el-button>
</router-link>
</template>
<template #filter-type="{ params }">
<el-radio-group v-model="params.tab" @change="onChangeType">
<el-radio-button :label="item.value" v-for="item in typeList" :key="item.value">
{{ item.label }}
</el-radio-button>
</el-radio-group>
</template>
<template #table-operate="{ row }">
<el-space>
<el-dropdown v-if="row.status === '2'">
<el-button type="primary">
审核<el-icon class="el-icon--right"><arrow-down /></el-icon>
</el-button>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item @click="onAudit(row, 1)">通过</el-dropdown-item>
<el-dropdown-item @click="onAudit(row, 3)">拒绝</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
<router-link :to="`/banner/view/${row.id}`">
<el-button plain type="primary">查看</el-button>
</router-link>
</el-space>
</template>
</AppList>
</AppCard>
</template>
......@@ -10,7 +10,7 @@ const listOptions = {
httpRequest: getBannerList,
params: { type: '' }
},
filters: [{ label: '类型', slots: 'filter-type' }],
filters: [{ label: '类型', prop: 'type', slots: 'filter-type' }],
columns: [
{ label: '封面图片', slots: 'table-cover', width: 224 },
{ label: 'ID', prop: 'id' },
......@@ -19,7 +19,7 @@ const listOptions = {
{ label: '权重', prop: 'weight' },
{ label: '浏览量', prop: 'pv' },
{ label: '创建时间', prop: 'created_time' },
{ label: '操作', slots: 'table-operate', width: 160 }
{ label: '操作', slots: 'table-operate', width: 160, align: 'right' }
]
}
......
......@@ -14,7 +14,7 @@ const listOptions = {
{ label: '课程描述', prop: 'course_represent', slots: 'table-desc' },
{ label: '权重', prop: 'weight' },
{ label: '是否显示', prop: 'status' },
{ label: '操作', slots: 'table-operate', width: 90 }
{ label: '操作', slots: 'table-operate', width: 100, align: 'right' }
]
}
</script>
......
......@@ -10,14 +10,14 @@ const listOptions = {
httpRequest: getDocList,
params: { type: '' }
},
filters: [{ label: '类型', slots: 'filter-type' }],
filters: [{ label: '类型', prop: 'type', slots: 'filter-type' }],
columns: [
{ label: 'ID', prop: 'id' },
{ label: '标题', prop: 'title' },
{ label: '类型', prop: 'type_name' },
{ label: '浏览量', prop: 'pv' },
{ label: '创建时间', prop: 'created_time' },
{ label: '操作', slots: 'table-operate', width: 160 }
{ label: '操作', slots: 'table-operate', width: 160, align: 'right' }
]
}
......
import httpRequest from '@/utils/axios'
// 获取学员列表
// 获取问题列表
export function getQuestionList(params?: { name?: string; mobile?: string; page?: number; page_size?: number }) {
return httpRequest.get('/api/psp/backend/question/index', { params })
}
// 获取问题详情
export function getQuestion(params: { id: string }) {
return httpRequest.get('/api/psp/backend/question/view', { params })
}
// 删除问题
export function deleteQuestion(data: { id: string }) {
return httpRequest.post('/api/psp/backend/question/delete', data)
}
<script setup lang="ts">
import { getQuestionList } from '../api'
import { ref } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { getQuestionList, deleteQuestion } from '../api'
const appList = ref()
const listOptions = {
remote: {
......@@ -12,23 +16,34 @@ const listOptions = {
],
columns: [
{ label: 'ID', prop: 'id' },
{ label: '姓名', prop: 'name' },
{ label: '手机号', prop: 'mobile' },
{ label: '证书编号', prop: 'certificate_number' },
{ label: '星星数量', prop: 'star' },
{ label: '标签', prop: 'label' },
{ label: '操作', slots: 'table-operate' }
{ label: '标题', prop: 'title' },
{ label: '发布人', prop: 'user_info.name' },
{ label: '发布时间', prop: 'created_time' },
{ label: '回答数量', prop: 'comment_count' },
{ label: '浏览量', prop: 'pv' },
{ label: '操作', slots: 'table-operate', align: 'right' }
]
}
const onRemove = (row: any) => {
ElMessageBox.confirm('确定要删除吗?', '提示').then(() => {
deleteQuestion({ id: row.id }).then(() => {
ElMessage({ type: 'success', message: '删除成功' })
appList.value?.refetch()
})
})
}
</script>
<template>
<AppCard>
<AppList v-bind="listOptions">
<template #table-operate>
<el-button>查看</el-button>
<el-button>更新</el-button>
<el-button>签到记录</el-button>
<AppList v-bind="listOptions" ref="appList">
<template #table-operate="{ row }">
<el-space>
<router-link :to="`/video/view/${row.id}`">
<el-button type="primary" plain>查看</el-button>
</router-link>
<el-button type="danger" plain @click="onRemove(row)">删除</el-button>
</el-space>
</template>
</AppList>
</AppCard>
......
......@@ -17,7 +17,7 @@ const listOptions = {
{ label: '证书编号', prop: 'certificate_number' },
{ label: '星星数量', prop: 'star' },
{ label: '标签', prop: 'label', slots: 'table-label' },
{ label: '操作', slots: 'table-operate', width: 160 }
{ label: '操作', slots: 'table-operate', width: 160, align: 'right' }
]
}
const onSyncUser = async () => {
......
......@@ -29,7 +29,7 @@ const listOptions = {
{ label: '资料数量', prop: 'files_count' },
{ label: '问答数量', prop: 'questions_count' },
{ label: '审核', prop: 'status', slots: 'table-status' },
{ label: '操作', slots: 'table-operate' }
{ label: '操作', slots: 'table-operate', width: 100, align: 'right' }
]
}
</script>
......
......@@ -10,7 +10,7 @@ const listOptions = {
httpRequest: getVideoList,
params: { type: '' }
},
filters: [{ label: '类型', slots: 'filter-type' }],
filters: [{ label: '类型', prop: 'type', slots: 'filter-type' }],
columns: [
{ label: '封面', slots: 'table-cover', width: 224 },
{ label: 'ID', prop: 'id' },
......@@ -18,7 +18,7 @@ const listOptions = {
{ label: '类型', prop: 'type_name' },
{ label: '浏览量', prop: 'pv' },
{ label: '创建时间', prop: 'created_time' },
{ label: '操作', slots: 'table-operate', width: 230 }
{ label: '操作', slots: 'table-operate', width: 230, align: 'right' }
]
}
const typeList = [
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论