Compare commits
No commits in common. 'main' and 'dev-zcx' have entirely different histories.
@ -1,53 +0,0 @@ |
||||
import request from '@/config/axios' |
||||
|
||||
// 分页
|
||||
export const getUserPage = (params) => { |
||||
return request.get({ url: 'admin-api/applet/sinology/sys/user/page', params }) |
||||
} |
||||
|
||||
export const getVipTypeList = async (params) => { |
||||
return await request.get({ |
||||
url: '/admin-api/applet/sinology/sys/member/page', |
||||
params: params |
||||
}) |
||||
} |
||||
|
||||
export const addVipType = async (data) => { |
||||
return await request.post({ |
||||
url: '/admin-api/applet/sinology/sys/member/create', |
||||
data |
||||
}) |
||||
} |
||||
|
||||
export const updateVipType = async (data) => { |
||||
return await request.put({ |
||||
url: '/admin-api/applet/sinology/sys/member/update', |
||||
data |
||||
}) |
||||
} |
||||
|
||||
export const deleteVipType = async (id) => { |
||||
return await request.delete({ |
||||
url: '/admin-api/applet/sinology/sys/member/delete?memberId=' + id |
||||
}) |
||||
} |
||||
|
||||
export const getVipType = async (id) => { |
||||
return await request.get({ |
||||
url: '/admin-api/applet/sinology/sys/member/get?id=' + id |
||||
}) |
||||
} |
||||
|
||||
export const addUserMember = async (data) => { |
||||
return await request.post({ |
||||
url: '/admin-api/applet/sinology/sys/user/add', |
||||
data |
||||
}) |
||||
} |
||||
|
||||
export const searchVipRecord = async (params) => { |
||||
return await request.get({ |
||||
url: '/admin-api/applet/sinology/memberLog/page', |
||||
params |
||||
}) |
||||
} |
@ -1,25 +0,0 @@ |
||||
import request from '@/config/axios' |
||||
|
||||
// 创建
|
||||
export const createChapter = (data) => { |
||||
return request.post({ |
||||
url: '/admin-api/applet/sinology/chapter/create', |
||||
data, |
||||
isSubmitForm: true |
||||
}) |
||||
} |
||||
|
||||
// 修改
|
||||
export const updateChapter = (data) => { |
||||
return request.put({ url: '/admin-api/applet/sinology/chapter/update', data }) |
||||
} |
||||
|
||||
// 分页
|
||||
export const getChapterPage = (params) => { |
||||
return request.get({ url: '/admin-api/applet/sinology/chapter/page', params }) |
||||
} |
||||
|
||||
// 删除
|
||||
export const deleteChapter = (id) => { |
||||
return request.delete({ url: '/admin-api/applet/sinology/chapter/delete', params: { id } }) |
||||
} |
@ -1,21 +0,0 @@ |
||||
import request from '@/config/axios' |
||||
|
||||
// 创建
|
||||
export const createCourse = (data) => { |
||||
return request.post({ url: '/admin-api/applet/sinology/lesson/create', data, isSubmitForm: true }) |
||||
} |
||||
|
||||
// 修改
|
||||
export const updateCourse = (data) => { |
||||
return request.put({ url: '/admin-api/applet/sinology/lesson/update', data }) |
||||
} |
||||
|
||||
// 分页
|
||||
export const getCoursePage = (params) => { |
||||
return request.get({ url: '/admin-api/applet/sinology/lesson/page', params }) |
||||
} |
||||
|
||||
// 删除
|
||||
export const deleteCourse = (id) => { |
||||
return request.delete({ url: '/admin-api/applet/sinology/lesson/delete', params: { id } }) |
||||
} |
@ -1,17 +0,0 @@ |
||||
import request from '@/config/axios' |
||||
|
||||
// 查询
|
||||
export const searchConfig = async (params) => { |
||||
return await request.get({ |
||||
url: 'admin-api/applet/wrj/sysConfig/page', |
||||
params |
||||
}) |
||||
} |
||||
|
||||
// 修改
|
||||
export const updateConfig = async (data) => { |
||||
return await request.post({ |
||||
url: 'admin-api/applet/wrj/sysConfig/update', |
||||
data |
||||
}) |
||||
} |
@ -1,28 +0,0 @@ |
||||
import request from '@/config/axios' |
||||
export const searchChapter = async (param) => { |
||||
return await request.get({ |
||||
url: '/admin-api/applet/wrj/chapter/list', |
||||
params: param |
||||
}) |
||||
} |
||||
|
||||
export const updateChapter = async (data) => { |
||||
return await request.put({ |
||||
url: '/admin-api/applet/wrj/chapter/update', |
||||
data: data |
||||
}) |
||||
} |
||||
|
||||
export const addChapter = async (data) => { |
||||
return await request.post({ |
||||
url: '/admin-api/applet/wrj/chapter/add', |
||||
data: data, |
||||
isSubmitForm: true |
||||
}) |
||||
} |
||||
|
||||
export const deleteChapter = async (id) => { |
||||
return await request.delete({ |
||||
url: `/admin-api/applet/wrj/chapter/delete?id=${id}` |
||||
}) |
||||
} |
@ -1,9 +0,0 @@ |
||||
import request from '@/config/axios' |
||||
|
||||
// 查询线索
|
||||
export const searchClue = async (params) => { |
||||
return await request.get({ |
||||
url: '/admin-api/applet/wrj/clue/page', |
||||
params |
||||
}) |
||||
} |
@ -1,51 +0,0 @@ |
||||
import request from '@/config/axios' |
||||
export const searchQuestion = async (param) => { |
||||
return await request.get({ |
||||
url: '/admin-api/applet/wrj/question/list', |
||||
params: param |
||||
}) |
||||
} |
||||
|
||||
export const updateQuestion = async (data) => { |
||||
return await request.put({ |
||||
url: '/admin-api/applet/wrj/question/update', |
||||
data: data |
||||
}) |
||||
} |
||||
|
||||
export const addQuestion = async (data) => { |
||||
return await request.post({ |
||||
url: '/admin-api/applet/wrj/question/add', |
||||
data: data, |
||||
isSubmitForm: true |
||||
}) |
||||
} |
||||
|
||||
export const deleteQuestion = async (id) => { |
||||
return await request.delete({ |
||||
url: `/admin-api/applet/wrj/question/delete?id=${id}` |
||||
}) |
||||
} |
||||
|
||||
export const uploadFile = async (data) => { |
||||
return await request.post({ |
||||
url: '/admin-api/applet/wrj/question/upload', |
||||
data: data |
||||
}) |
||||
} |
||||
|
||||
// 查询无人机类型列表
|
||||
export const getCarTypeOptions = async (params) => { |
||||
return await request.get({ |
||||
url: '/admin-api/applet/wrj/model/list', |
||||
params |
||||
}) |
||||
} |
||||
|
||||
// 查询驾驶员类型列表
|
||||
export const getDriverTypeOptions = async (params) => { |
||||
return await request.get({ |
||||
url: '/admin-api/applet/wrj/type/list', |
||||
params |
||||
}) |
||||
} |
@ -1,32 +0,0 @@ |
||||
import request from '@/config/axios' |
||||
|
||||
export const searchStudyRecords = async (params) => { |
||||
return await request.get({ |
||||
url: 'admin-api/applet/wrj/questionPractice/query', |
||||
params |
||||
}) |
||||
} |
||||
|
||||
// 模拟考试记录
|
||||
export const searchExamRecords = async (params) => { |
||||
return await request.get({ |
||||
url: 'admin-api/applet/wrj/questionTest/page', |
||||
params |
||||
}) |
||||
} |
||||
|
||||
// 考试详情
|
||||
export const searchExamDetail = async (params) => { |
||||
return await request.get({ |
||||
url: 'admin-api/applet/wrj/questionTest/detail', |
||||
params |
||||
}) |
||||
} |
||||
|
||||
// 收藏记录
|
||||
export const searchCollectRecords = async (params) => { |
||||
return await request.get({ |
||||
url: 'admin-api/applet/wrj/userCollectQuestion/page', |
||||
params |
||||
}) |
||||
} |
@ -1,61 +0,0 @@ |
||||
import request from '@/config/axios' |
||||
|
||||
// 查询机构
|
||||
export const searchStation = async (params) => { |
||||
return await request.get({ |
||||
url: '/admin-api/applet/wrj/school/page', |
||||
params |
||||
}) |
||||
} |
||||
|
||||
// 审核机构
|
||||
export const auditStation = async (data) => { |
||||
return await request.post({ |
||||
url: '/admin-api/applet/wrj/school/check', |
||||
data |
||||
}) |
||||
} |
||||
|
||||
// 机构详情
|
||||
export const stationDetail = async (id) => { |
||||
return await request.get({ |
||||
url: `/admin-api/applet/wrj/school/get/${id}` |
||||
}) |
||||
} |
||||
|
||||
// 修改机构
|
||||
export const updateStation = async (data) => { |
||||
return await request.post({ |
||||
url: 'admin-api/applet/wrj/school/check', |
||||
data |
||||
}) |
||||
} |
||||
|
||||
// 查询教员
|
||||
export const searchTeacher = async (params) => { |
||||
return await request.get({ |
||||
url: '/admin-api/applet/wrj/teacher/page', |
||||
params |
||||
}) |
||||
} |
||||
|
||||
// 审核教员
|
||||
export const auditTeacher = async (data) => { |
||||
return await request.post({ |
||||
url: '/admin-api/applet/wrj/teacher/check', |
||||
data |
||||
}) |
||||
} |
||||
// 修改
|
||||
export const updateTeacher = async (data) => { |
||||
return await request.post({ |
||||
url: '/admin-api/applet/wrj/teacher/update', |
||||
data |
||||
}) |
||||
} |
||||
|
||||
export const getCarTypeList = async () => { |
||||
return await request.get({ |
||||
url: 'admin-api/applet/wrj/schoolDriverType/list' |
||||
}) |
||||
} |
@ -1,36 +0,0 @@ |
||||
import request from '@/config/axios' |
||||
|
||||
export const searchTestroom = async (params) => { |
||||
return await request.get({ |
||||
url: '/admin-api/applet/wrj/examPlace/page', |
||||
params |
||||
}) |
||||
} |
||||
|
||||
export const addTestroom = async (data) => { |
||||
return await request.post({ |
||||
url: '/admin-api/applet/wrj/examPlace/add', |
||||
data, |
||||
isSubmitForm: true |
||||
}) |
||||
} |
||||
export const updateTestroom = async (data) => { |
||||
return await request.put({ |
||||
url: '/admin-api/applet/wrj/examPlace/update', |
||||
data |
||||
}) |
||||
} |
||||
export const deleteTestroom = async (params) => { |
||||
return await request.delete({ |
||||
url: '/admin-api/applet/wrj/examPlace/delete', |
||||
params |
||||
}) |
||||
} |
||||
|
||||
// 查询考试时间
|
||||
export const searchTesttime = async (params) => { |
||||
return await request.get({ |
||||
url: '/admin-api/applet/wrj/examPlace/queryDate', |
||||
params |
||||
}) |
||||
} |
@ -0,0 +1,181 @@ |
||||
<template> |
||||
<Dialog v-model="dialogVisible" :title="dialogTitle"> |
||||
<el-form |
||||
ref="formRef" |
||||
v-loading="formLoading" |
||||
:model="formData" |
||||
:rules="formRules" |
||||
label-width="80px" |
||||
> |
||||
<el-form-item label="字典类型" prop="type"> |
||||
<el-input |
||||
v-model="formData.dictType" |
||||
:disabled="typeof formData.id !== 'undefined'" |
||||
placeholder="请输入参数名称" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item label="数据标签" prop="label"> |
||||
<el-input v-model="formData.label" placeholder="请输入数据标签" /> |
||||
</el-form-item> |
||||
<el-form-item label="数据键值" prop="value"> |
||||
<el-input v-model="formData.value" placeholder="请输入数据键值" /> |
||||
</el-form-item> |
||||
<el-form-item label="显示排序" prop="sort"> |
||||
<el-input-number v-model="formData.sort" :min="0" controls-position="right" /> |
||||
</el-form-item> |
||||
<el-form-item label="状态" prop="status"> |
||||
<el-radio-group v-model="formData.status"> |
||||
<el-radio |
||||
v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)" |
||||
:key="dict.value" |
||||
:label="dict.value" |
||||
> |
||||
{{ dict.label }} |
||||
</el-radio> |
||||
</el-radio-group> |
||||
</el-form-item> |
||||
<el-form-item label="颜色类型" prop="colorType"> |
||||
<el-select v-model="formData.colorType"> |
||||
<el-option |
||||
v-for="item in colorTypeOptions" |
||||
:key="item.value" |
||||
:label="item.label + '(' + item.value + ')'" |
||||
:value="item.value" |
||||
/> |
||||
</el-select> |
||||
</el-form-item> |
||||
<el-form-item label="CSS Class" prop="cssClass"> |
||||
<el-input v-model="formData.cssClass" placeholder="请输入 CSS Class" /> |
||||
</el-form-item> |
||||
<el-form-item label="备注" prop="remark"> |
||||
<el-input v-model="formData.remark" placeholder="请输入内容" type="textarea" /> |
||||
</el-form-item> |
||||
</el-form> |
||||
<template #footer> |
||||
<el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button> |
||||
<el-button @click="dialogVisible = false">取 消</el-button> |
||||
</template> |
||||
</Dialog> |
||||
</template> |
||||
<script lang="ts" name="SystemDictDataForm" setup> |
||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' |
||||
import * as DictDataApi from '@/api/system/dict/dict.data' |
||||
import { CommonStatusEnum } from '@/utils/constants' |
||||
|
||||
const { t } = useI18n() // 国际化 |
||||
const message = useMessage() // 消息弹窗 |
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示 |
||||
const dialogTitle = ref('') // 弹窗的标题 |
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 |
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改 |
||||
const formData = ref({ |
||||
id: undefined, |
||||
sort: undefined, |
||||
label: '', |
||||
value: '', |
||||
dictType: '', |
||||
status: CommonStatusEnum.ENABLE, |
||||
colorType: '', |
||||
cssClass: '', |
||||
remark: '' |
||||
}) |
||||
const formRules = reactive({ |
||||
label: [{ required: true, message: '数据标签不能为空', trigger: 'blur' }], |
||||
value: [{ required: true, message: '数据键值不能为空', trigger: 'blur' }], |
||||
sort: [{ required: true, message: '数据顺序不能为空', trigger: 'blur' }], |
||||
status: [{ required: true, message: '状态不能为空', trigger: 'change' }] |
||||
}) |
||||
const formRef = ref() // 表单 Ref |
||||
|
||||
// 数据标签回显样式 |
||||
const colorTypeOptions = readonly([ |
||||
{ |
||||
value: 'default', |
||||
label: '默认' |
||||
}, |
||||
{ |
||||
value: 'primary', |
||||
label: '主要' |
||||
}, |
||||
{ |
||||
value: 'success', |
||||
label: '成功' |
||||
}, |
||||
{ |
||||
value: 'info', |
||||
label: '信息' |
||||
}, |
||||
{ |
||||
value: 'warning', |
||||
label: '警告' |
||||
}, |
||||
{ |
||||
value: 'danger', |
||||
label: '危险' |
||||
} |
||||
]) |
||||
|
||||
/** 打开弹窗 */ |
||||
const open = async (type: string, id?: number, dictType?: string) => { |
||||
dialogVisible.value = true |
||||
dialogTitle.value = t('action.' + type) |
||||
formType.value = type |
||||
resetForm() |
||||
if (dictType) { |
||||
formData.value.dictType = dictType |
||||
} |
||||
// 修改时,设置数据 |
||||
if (id) { |
||||
formLoading.value = true |
||||
try { |
||||
formData.value = await DictDataApi.getDictData(id) |
||||
} finally { |
||||
formLoading.value = false |
||||
} |
||||
} |
||||
} |
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
||||
|
||||
/** 提交表单 */ |
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 |
||||
const submitForm = async () => { |
||||
// 校验表单 |
||||
if (!formRef.value) return |
||||
const valid = await formRef.value.validate() |
||||
if (!valid) return |
||||
// 提交请求 |
||||
formLoading.value = true |
||||
try { |
||||
const data = formData.value as DictDataApi.DictDataVO |
||||
if (formType.value === 'create') { |
||||
await DictDataApi.createDictData(data) |
||||
message.success(t('common.createSuccess')) |
||||
} else { |
||||
await DictDataApi.updateDictData(data) |
||||
message.success(t('common.updateSuccess')) |
||||
} |
||||
dialogVisible.value = false |
||||
// 发送操作成功的事件 |
||||
emit('success') |
||||
} finally { |
||||
formLoading.value = false |
||||
} |
||||
} |
||||
|
||||
/** 重置表单 */ |
||||
const resetForm = () => { |
||||
formData.value = { |
||||
id: undefined, |
||||
sort: undefined, |
||||
label: '', |
||||
value: '', |
||||
dictType: '', |
||||
status: CommonStatusEnum.ENABLE, |
||||
colorType: '', |
||||
cssClass: '', |
||||
remark: '' |
||||
} |
||||
formRef.value?.resetFields() |
||||
} |
||||
</script> |
@ -0,0 +1,207 @@ |
||||
<template> |
||||
<ContentWrap> |
||||
<el-form |
||||
class="-mb-15px" |
||||
:model="queryParams" |
||||
ref="queryFormRef" |
||||
:inline="true" |
||||
label-width="68px" |
||||
> |
||||
<el-form-item label="字典名称" prop="dictType"> |
||||
<el-select v-model="queryParams.dictType" class="!w-240px"> |
||||
<el-option |
||||
v-for="item in dictTypeList" |
||||
:key="item.type" |
||||
:label="item.name" |
||||
:value="item.type" |
||||
/> |
||||
</el-select> |
||||
</el-form-item> |
||||
<el-form-item label="字典标签" prop="label"> |
||||
<el-input |
||||
v-model="queryParams.label" |
||||
placeholder="请输入字典标签" |
||||
clearable |
||||
@keyup.enter="handleQuery" |
||||
class="!w-240px" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item label="状态" prop="status"> |
||||
<el-select v-model="queryParams.status" placeholder="数据状态" clearable class="!w-240px"> |
||||
<el-option |
||||
v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)" |
||||
:key="dict.value" |
||||
:label="dict.label" |
||||
:value="dict.value" |
||||
/> |
||||
</el-select> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button> |
||||
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button> |
||||
<el-button |
||||
type="primary" |
||||
plain |
||||
@click="openForm('create')" |
||||
v-hasPermi="['system:dict:create']" |
||||
> |
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增 |
||||
</el-button> |
||||
<el-button |
||||
type="success" |
||||
plain |
||||
@click="handleExport" |
||||
:loading="exportLoading" |
||||
v-hasPermi="['system:dict:export']" |
||||
> |
||||
<Icon icon="ep:download" class="mr-5px" /> 导出 |
||||
</el-button> |
||||
</el-form-item> |
||||
</el-form> |
||||
</ContentWrap> |
||||
|
||||
<!-- 列表 --> |
||||
<ContentWrap> |
||||
<el-table v-loading="loading" :data="list"> |
||||
<el-table-column label="字典编码" align="center" prop="id" /> |
||||
<el-table-column label="字典标签" align="center" prop="label" /> |
||||
<el-table-column label="字典键值" align="center" prop="value" /> |
||||
<el-table-column label="字典排序" align="center" prop="sort" /> |
||||
<el-table-column label="状态" align="center" prop="status"> |
||||
<template #default="scope"> |
||||
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" /> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="颜色类型" align="center" prop="colorType" /> |
||||
<el-table-column label="CSS Class" align="center" prop="cssClass" /> |
||||
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip /> |
||||
<el-table-column |
||||
label="创建时间" |
||||
align="center" |
||||
prop="createTime" |
||||
width="180" |
||||
:formatter="dateFormatter" |
||||
/> |
||||
<el-table-column label="操作" align="center"> |
||||
<template #default="scope"> |
||||
<el-button |
||||
link |
||||
type="primary" |
||||
@click="openForm('update', scope.row.id)" |
||||
v-hasPermi="['system:dict:update']" |
||||
> |
||||
修改 |
||||
</el-button> |
||||
<el-button |
||||
link |
||||
type="danger" |
||||
@click="handleDelete(scope.row.id)" |
||||
v-hasPermi="['system:dict:delete']" |
||||
> |
||||
删除 |
||||
</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<!-- 分页 --> |
||||
<Pagination |
||||
:total="total" |
||||
v-model:page="queryParams.pageNo" |
||||
v-model:limit="queryParams.pageSize" |
||||
@pagination="getList" |
||||
/> |
||||
</ContentWrap> |
||||
|
||||
<!-- 表单弹窗:添加/修改 --> |
||||
<DictDataForm ref="formRef" @success="getList" /> |
||||
</template> |
||||
<script setup lang="ts" name="SystemDictData"> |
||||
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict' |
||||
import { dateFormatter } from '@/utils/formatTime' |
||||
import download from '@/utils/download' |
||||
import * as DictDataApi from '@/api/system/dict/dict.data' |
||||
import * as DictTypeApi from '@/api/system/dict/dict.type' |
||||
import DictDataForm from './DictDataForm.vue' |
||||
const message = useMessage() // 消息弹窗 |
||||
const { t } = useI18n() // 国际化 |
||||
const route = useRoute() // 路由 |
||||
|
||||
const loading = ref(true) // 列表的加载中 |
||||
const total = ref(0) // 列表的总页数 |
||||
const list = ref([]) // 列表的数据 |
||||
const queryParams = reactive({ |
||||
pageNo: 1, |
||||
pageSize: 10, |
||||
label: '', |
||||
status: undefined, |
||||
dictType: route.params.dictType |
||||
}) |
||||
const queryFormRef = ref() // 搜索的表单 |
||||
const exportLoading = ref(false) // 导出的加载中 |
||||
const dictTypeList = ref<DictTypeApi.DictTypeVO[]>() // 字典类型的列表 |
||||
|
||||
/** 查询列表 */ |
||||
const getList = async () => { |
||||
loading.value = true |
||||
try { |
||||
const data = await DictDataApi.getDictDataPage(queryParams) |
||||
list.value = data.list |
||||
total.value = data.total |
||||
} finally { |
||||
loading.value = false |
||||
} |
||||
} |
||||
|
||||
/** 搜索按钮操作 */ |
||||
const handleQuery = () => { |
||||
queryParams.pageNo = 1 |
||||
getList() |
||||
} |
||||
|
||||
/** 重置按钮操作 */ |
||||
const resetQuery = () => { |
||||
queryFormRef.value.resetFields() |
||||
handleQuery() |
||||
} |
||||
|
||||
/** 添加/修改操作 */ |
||||
const formRef = ref() |
||||
const openForm = (type: string, id?: number) => { |
||||
formRef.value.open(type, id, queryParams.dictType) |
||||
} |
||||
|
||||
/** 删除按钮操作 */ |
||||
const handleDelete = async (id: number) => { |
||||
try { |
||||
// 删除的二次确认 |
||||
await message.delConfirm() |
||||
// 发起删除 |
||||
await DictDataApi.deleteDictData(id) |
||||
message.success(t('common.delSuccess')) |
||||
// 刷新列表 |
||||
await getList() |
||||
} catch {} |
||||
} |
||||
|
||||
/** 导出按钮操作 */ |
||||
const handleExport = async () => { |
||||
try { |
||||
// 导出的二次确认 |
||||
await message.exportConfirm() |
||||
// 发起导出 |
||||
exportLoading.value = true |
||||
const data = await DictDataApi.exportDictData(queryParams) |
||||
download.excel(data, '字典数据.xls') |
||||
} catch { |
||||
} finally { |
||||
exportLoading.value = false |
||||
} |
||||
} |
||||
|
||||
/** 初始化 **/ |
||||
onMounted(async () => { |
||||
await getList() |
||||
// 查询字典(精简)列表 |
||||
dictTypeList.value = await DictTypeApi.getSimpleDictTypeList() |
||||
}) |
||||
</script> |
@ -1,74 +0,0 @@ |
||||
<template> |
||||
<div> |
||||
<el-tabs v-model="examType"> |
||||
<el-tab-pane label="理论考试" :name="1" /> |
||||
<el-tab-pane label="实践考试" :name="2" /> |
||||
<el-calendar> |
||||
<template #date-cell="{ data }"> |
||||
<el-popover placement="top" width="500px" trigger="click"> |
||||
<template #reference> |
||||
<div> |
||||
<div>{{ new Date(data.day).getDate() }}</div> |
||||
<div class="mt-10px"> |
||||
考场数量:{{ getRoomCount(new Date(data.day).getDate()) }} |
||||
</div> |
||||
</div> |
||||
</template> |
||||
<div style="max-height: 300px; overflow: auto"> |
||||
<el-table :data="showRoomList(new Date(data.day).getDate())" border stripe> |
||||
<el-table-column prop="placeName" label="考场名称" width="120px" /> |
||||
<el-table-column |
||||
:prop="examType == 1 ? 'theoryExamAddress' : 'practiceExamAddress'" |
||||
label="考场地址" |
||||
/> |
||||
</el-table> |
||||
</div> |
||||
</el-popover> |
||||
</template> |
||||
</el-calendar> |
||||
</el-tabs> |
||||
</div> |
||||
</template> |
||||
|
||||
<script setup name="Calendar"> |
||||
import { searchTestroom } from '@/api/uav/testRoom' |
||||
|
||||
const examType = ref(1) |
||||
|
||||
const roomList = ref([]) |
||||
|
||||
onMounted(() => { |
||||
getRoomList() |
||||
}) |
||||
|
||||
function getRoomList() { |
||||
searchTestroom({ |
||||
pageNum: -1, |
||||
pageSize: -1 |
||||
}).then((res) => { |
||||
roomList.value = res.list |
||||
}) |
||||
} |
||||
|
||||
function getRoomCount(date) { |
||||
return roomList.value.filter((item) => { |
||||
const pro = { |
||||
1: 'theoryExamDate', |
||||
2: 'practiceExamDate' |
||||
}[examType.value] |
||||
return item[pro].split(',').includes(date + '') |
||||
}).length |
||||
} |
||||
|
||||
function showRoomList(date) { |
||||
return roomList.value.filter((item) => { |
||||
const pro = { |
||||
1: 'theoryExamDate', |
||||
2: 'practiceExamDate' |
||||
}[examType.value] |
||||
return item[pro].split(',').includes(date + '') |
||||
}) |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss" scoped></style> |
@ -1,298 +0,0 @@ |
||||
<template> |
||||
<div> |
||||
<el-form :model="searchForm" inline label-width="0"> |
||||
<el-form-item> |
||||
<el-input v-model="searchForm.placeName" placeholder="考场名称" /> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-button type="primary" @click="handleQuery">搜 索</el-button> |
||||
<el-button v-hasPermi="['ExamVenue:Room:add']" @click="handleDetail(null)">新 增</el-button> |
||||
</el-form-item> |
||||
</el-form> |
||||
|
||||
<el-table :data="tableList" border stripe> |
||||
<el-table-column type="index" width="50" /> |
||||
<el-table-column prop="placeName" label="考点名称" min-width="200px" /> |
||||
<el-table-column prop="leader" label="负责人" width="100px" /> |
||||
<el-table-column prop="leaderPhone" label="负责人电话" width="100px" /> |
||||
<el-table-column prop="contacts" label="联系人" width="100px" /> |
||||
<el-table-column prop="contactPhone" label="联系人电话" width="100px" /> |
||||
<el-table-column prop="address" label="地址" min-width="200px" /> |
||||
<el-table-column label="理论" align="center"> |
||||
<el-table-column label="时间" width="100px" align="center"> |
||||
<template #default="{ row }"> |
||||
{{ |
||||
row.theoryExamDate |
||||
.split(',') |
||||
.map((item) => `每月${item}号`) |
||||
.join(',') |
||||
}} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="theoryExamAddress" label="地址" min-width="200px" align="center" /> |
||||
</el-table-column> |
||||
<el-table-column label="实践" align="center"> |
||||
<el-table-column label="时间" width="100px" align="center"> |
||||
<template #default="{ row }"> |
||||
{{ |
||||
row.practiceExamDate |
||||
.split(',') |
||||
.map((item) => `每月${item}号`) |
||||
.join(',') |
||||
}} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="practiceExamAddress" label="地址" min-width="200px" align="center" /> |
||||
</el-table-column> |
||||
<el-table-column label="操作" fixed="right" width="150"> |
||||
<template #default="{ row }"> |
||||
<el-button |
||||
v-hasPermi="['ExamVenue:Room:edit']" |
||||
type="primary" |
||||
link |
||||
@click="handleDetail(row)" |
||||
> |
||||
修改 |
||||
</el-button> |
||||
<el-button |
||||
v-hasPermi="['ExamVenue:Room:delete']" |
||||
type="danger" |
||||
link |
||||
@click="handleDelete(row)" |
||||
> |
||||
删除 |
||||
</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<Pagination |
||||
:total="total" |
||||
v-model:page="searchForm.pageNo" |
||||
v-model:limit="searchForm.pageSize" |
||||
@pagination="getList" |
||||
/> |
||||
|
||||
<Dialog v-model="dialogVisible" title="教员详情" style="width: 800px"> |
||||
<el-form :model="form" ref="formRef" :rules="rules" label-width="100px"> |
||||
<el-row :gutter="20"> |
||||
<el-col :span="24" :offset="0"> |
||||
<el-form-item label="考点名称" prop="placeName"> |
||||
<el-input v-model="form.placeName" placeholder="请输入" /> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12" :offset="0"> |
||||
<el-form-item label="负责人" prop="leader"> |
||||
<el-input v-model="form.leader" placeholder="请输入" /> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12" :offset="0"> |
||||
<el-form-item label="负责人电话" prop="leaderPhone"> |
||||
<el-input v-model="form.leaderPhone" placeholder="请输入" /> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12" :offset="0"> |
||||
<el-form-item label="联系人" prop="contacts"> |
||||
<el-input v-model="form.contacts" placeholder="请输入" /> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12" :offset="0"> |
||||
<el-form-item label="联系人电话" prop="contactPhone"> |
||||
<el-input v-model="form.contactPhone" placeholder="请输入" /> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="24" :offset="0"> |
||||
<el-form-item label="地址" prop="address"> |
||||
<el-input |
||||
v-model="form.address" |
||||
type="textarea" |
||||
:autosize="{ minRows: 2 }" |
||||
placeholder="请输入" |
||||
/> |
||||
</el-form-item> |
||||
</el-col> |
||||
</el-row> |
||||
<el-divider direction="horizontal" content-position="left">理论</el-divider> |
||||
<el-row :gutter="20"> |
||||
<el-col :span="24" :offset="0"> |
||||
<el-form-item label="理论地址" prop="theoryExamAddress"> |
||||
<el-input |
||||
v-model="form.theoryExamAddress" |
||||
type="textarea" |
||||
:autosize="{ minRows: 2 }" |
||||
placeholder="请输入" |
||||
/> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="24" :offset="0"> |
||||
<el-form-item label="理论时间"> |
||||
<el-input |
||||
class="mr-2 mb-2" |
||||
v-for="(item, index) in form.theoryExamDate" |
||||
:key="index" |
||||
v-model="form.theoryExamDate[index]" |
||||
style="width: 180px" |
||||
> |
||||
<template #prepend>每月</template> |
||||
<template #append>日</template> |
||||
</el-input> |
||||
<el-button type="primary" @click="form.theoryExamDate.push(undefined)"> |
||||
新增考试时间 |
||||
</el-button> |
||||
</el-form-item> |
||||
</el-col> |
||||
</el-row> |
||||
<el-divider direction="horizontal" content-position="left">实践</el-divider> |
||||
<el-row :gutter="20"> |
||||
<el-col :span="24" :offset="0"> |
||||
<el-form-item label="实践地址" prop="theoryExamAddress"> |
||||
<el-input |
||||
v-model="form.practiceExamAddress" |
||||
type="textarea" |
||||
:autosize="{ minRows: 2 }" |
||||
placeholder="请输入" |
||||
/> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="24" :offset="0"> |
||||
<el-form-item label="实践时间"> |
||||
<el-input |
||||
class="mr-2 mb-2" |
||||
v-for="(item, index) in form.practiceExamDate" |
||||
:key="index" |
||||
v-model="form.practiceExamDate[index]" |
||||
style="width: 180px" |
||||
> |
||||
<template #prepend>每月</template> |
||||
<template #append>日</template> |
||||
</el-input> |
||||
<el-button type="primary" @click="form.practiceExamDate.push(undefined)"> |
||||
新增考试时间 |
||||
</el-button> |
||||
</el-form-item> |
||||
</el-col> |
||||
</el-row> |
||||
</el-form> |
||||
<template #footer> |
||||
<el-button type="primary" :disabled="formLoading" @click="submitForm">保 存</el-button> |
||||
<el-button @click="dialogVisible = false">取 消</el-button> |
||||
</template> |
||||
</Dialog> |
||||
</div> |
||||
</template> |
||||
|
||||
<script setup name="ExamVenue"> |
||||
import * as api from '@/api/uav/testRoom' |
||||
|
||||
const message = useMessage() |
||||
|
||||
const searchForm = ref({ |
||||
placeName: '', |
||||
pageNo: 1, |
||||
pageSize: 20 |
||||
}) |
||||
|
||||
const tableList = ref([]) |
||||
const total = ref(0) |
||||
|
||||
onMounted(() => { |
||||
handleQuery() |
||||
}) |
||||
|
||||
function handleQuery() { |
||||
searchForm.value.pageNo = 1 |
||||
getList() |
||||
} |
||||
|
||||
function getList() { |
||||
try { |
||||
api.searchTestroom(searchForm.value).then((res) => { |
||||
tableList.value = res.list |
||||
total.value = res.total |
||||
}) |
||||
} catch (error) { |
||||
console.log(error) |
||||
} |
||||
} |
||||
|
||||
const form = ref({}) |
||||
const rules = { |
||||
placeName: { required: true, message: '请输入名称', trigger: 'blur' }, |
||||
leader: { required: true, message: '请输入姓名', trigger: 'blur' }, |
||||
leaderPhone: { required: true, message: '请输入手机号', trigger: 'blur' } |
||||
} |
||||
const dialogVisible = ref(false) |
||||
const formLoading = ref(false) |
||||
|
||||
const handleDetail = (row) => { |
||||
resetForm() |
||||
dialogVisible.value = true |
||||
if (row) { |
||||
form.value = { ...row } |
||||
form.value.theoryExamDate = row.theoryExamDate.split(',') |
||||
form.value.practiceExamDate = row.practiceExamDate.split(',') |
||||
} |
||||
} |
||||
|
||||
const formRef = ref(null) |
||||
function resetForm() { |
||||
form.value = { |
||||
id: undefined, |
||||
placeName: '', |
||||
leader: '', |
||||
leaderPhone: '', |
||||
contacts: '', |
||||
contactPhone: '', |
||||
address: '', |
||||
theoryExamAddress: '', |
||||
theoryExamDate: [], |
||||
practiceExamAddress: '', |
||||
practiceExamDate: [] |
||||
} |
||||
formRef.value && formRef.value.resetFields() |
||||
} |
||||
|
||||
const handleDelete = async (row) => { |
||||
try { |
||||
// 删除的二次确认 |
||||
await message.delConfirm() |
||||
// 发起删除 |
||||
await api.deleteTestroom({ id: row.placeId }) |
||||
message.success('删除成功') |
||||
// 刷新列表 |
||||
getList() |
||||
} catch {} |
||||
} |
||||
|
||||
const submitForm = async () => { |
||||
if (!formRef.value) return |
||||
const valid = await formRef.value.validate() |
||||
if (!valid) return |
||||
|
||||
try { |
||||
formLoading.value = true |
||||
let params = { ...form.value } |
||||
params.theoryExamDate = params.theoryExamDate.join(',') |
||||
params.practiceExamDate = params.practiceExamDate.join(',') |
||||
if (form.value.placeId) { |
||||
api.updateTestroom(params).then((response) => { |
||||
if (response) { |
||||
message.success('修改成功') |
||||
dialogVisible.value = false |
||||
} |
||||
}) |
||||
} else { |
||||
api.addTestroom(params).then((response) => { |
||||
if (response) { |
||||
message.success('新增成功') |
||||
dialogVisible.value = false |
||||
} |
||||
}) |
||||
} |
||||
} finally { |
||||
formLoading.value = false |
||||
getList() |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss" scoped></style> |
@ -1,169 +0,0 @@ |
||||
<template> |
||||
<div> |
||||
<el-form :model="searchForm" inline @submit.prevent> |
||||
<el-form-item> |
||||
<el-input |
||||
v-model="searchForm.phone" |
||||
placeholder="请输入手机号" |
||||
clearable |
||||
@keyup.enter="handleQuery" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-date-picker |
||||
v-model="searchForm.createTime" |
||||
type="daterange" |
||||
range-separator="-" |
||||
value-format="YYYY-MM-DD" |
||||
format="YYYY-MM-DD" |
||||
start-placeholder="注册日期" |
||||
end-placeholder="注册日期" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-button @click="handleQuery">搜索</el-button> |
||||
</el-form-item> |
||||
</el-form> |
||||
|
||||
<el-table v-loading="loading" :data="tableList" border stripe> |
||||
<el-table-column type="index" width="50" /> |
||||
<el-table-column label="头像" width="80"> |
||||
<template #default="scope"> |
||||
<el-avatar icon="el-icon-user-solid" shape="circle" :src="scope.row.avatar" fit="fill" /> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="昵称" prop="userName" min-width="120" /> |
||||
<el-table-column label="手机号码" prop="phone" width="120" /> |
||||
<el-table-column label="生日" prop="birthday" min-width="120" /> |
||||
<el-table-column |
||||
label="性别" |
||||
prop="sex" |
||||
width="100" |
||||
:formatter="(row) => (row.sex === 1 ? '男' : '女')" |
||||
/> |
||||
<el-table-column label="注册日期" prop="createTime" min-width="120" /> |
||||
<el-table-column label="会员类型" prop="memberName" min-width="120" /> |
||||
<el-table-column label="会员截止日期" prop="endDate" min-width="120" /> |
||||
<!-- 操作 --> |
||||
<el-table-column label="操作" width="120"> |
||||
<template #default="{ row }"> |
||||
<el-button type="primary" link @click="handleAddVip(row)">赠送会员</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<Pagination |
||||
:total="total" |
||||
v-model:page="searchForm.pageNo" |
||||
v-model:limit="searchForm.pageSize" |
||||
@pagination="getList" |
||||
/> |
||||
|
||||
<el-dialog title="赠送会员" v-model="showDialog" width="500px" :close-on-click-modal="false"> |
||||
<el-form :model="form" ref="formRef" :rules="rules" label-width="80px"> |
||||
<el-form-item label="会员类型" prop="memberId"> |
||||
<el-select v-model="form.memberId" clearable filterable style="width: 100%"> |
||||
<el-option |
||||
v-for="item in vipOptions" |
||||
:key="item.memberId" |
||||
:label="item.memberName" |
||||
:value="item.memberId" |
||||
> |
||||
<span style="float: left">{{ item.memberName }}</span> |
||||
<span style="float: right; color: #aaa">{{ item.carName }}</span> |
||||
</el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
</el-form> |
||||
|
||||
<template #footer> |
||||
<span> |
||||
<el-button @click="showDialog = false">取消</el-button> |
||||
<el-button type="primary" @click="sureAddVip">确定</el-button> |
||||
</span> |
||||
</template> |
||||
</el-dialog> |
||||
</div> |
||||
</template> |
||||
|
||||
<script name="AppletUser" setup> |
||||
import { removeNullField } from '@/utils' |
||||
import * as UserApi from '@/api/gds/appletUser.js' |
||||
import { getVipTypeList } from '@/api/gds/appletUser' |
||||
|
||||
const message = useMessage() |
||||
|
||||
const searchForm = ref({ |
||||
phone: '', |
||||
createTime: [], |
||||
createTimeBegin: undefined, |
||||
createTimeEnd: undefined, |
||||
pageNo: 1, |
||||
pageSize: 20 |
||||
}) |
||||
|
||||
onMounted(() => { |
||||
handleQuery() |
||||
}) |
||||
|
||||
/** 搜索按钮操作 */ |
||||
const handleQuery = () => { |
||||
searchForm.value.pageNo = 1 |
||||
getList() |
||||
} |
||||
|
||||
const loading = ref(false) |
||||
const tableList = ref([]) |
||||
const total = ref(0) |
||||
/** 查询列表 */ |
||||
const getList = async () => { |
||||
loading.value = true |
||||
try { |
||||
if (searchForm.value.createTime && searchForm.value.createTime.length > 0) { |
||||
searchForm.value.createTimeBegin = searchForm.value.createTime[0] + ' 00:00:00' |
||||
searchForm.value.createTimeEnd = searchForm.value.createTime[1] + ' 23:59:59' |
||||
} else { |
||||
searchForm.value.createTimeBegin = undefined |
||||
searchForm.value.createTimeEnd = undefined |
||||
} |
||||
const data = await UserApi.getUserPage(removeNullField(searchForm.value)) |
||||
tableList.value = data.list |
||||
total.value = data.total |
||||
} finally { |
||||
loading.value = false |
||||
} |
||||
} |
||||
|
||||
const showDialog = ref(false) |
||||
const form = ref({ |
||||
phone: '', |
||||
memberId: '' |
||||
}) |
||||
|
||||
const vipOptions = ref([]) |
||||
const rules = { |
||||
memberId: [{ required: true, message: '请选择会员类型', trigger: 'change' }] |
||||
} |
||||
const formRef = ref() |
||||
|
||||
function handleAddVip(row) { |
||||
getVipTypeList({ pageNo: 1, pageSize: -1 }).then((response) => { |
||||
vipOptions.value = response.list |
||||
}) |
||||
form.value.phone = row.phone |
||||
showDialog.value = true |
||||
} |
||||
|
||||
function sureAddVip() { |
||||
if (!formRef.value) return |
||||
formRef.value.validate((valid) => { |
||||
if (!valid) return |
||||
UserApi.addUserMember(form.value).then(() => { |
||||
showDialog.value = false |
||||
getList() |
||||
message.success('操作成功') |
||||
}) |
||||
}) |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss" scoped></style> |
@ -1,188 +0,0 @@ |
||||
<template> |
||||
<div> |
||||
<el-form :model="searchForm" inline @submit.prevent> |
||||
<el-form-item> |
||||
<el-input v-model="searchForm.memberName" placeholder="会员名称" clearable /> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-button @click="searchList">查询</el-button> |
||||
<el-button type="primary" @click="addVip">新增会员类型</el-button> |
||||
</el-form-item> |
||||
</el-form> |
||||
<el-table v-loading="loading" :data="tableList" height="calc(100vh - 260px)"> |
||||
<el-table-column type="index" width="55" align="center" /> |
||||
<el-table-column label="会员名" align="center" prop="memberName" min-width="140" /> |
||||
<el-table-column label="原价" align="center" prop="price" /> |
||||
<el-table-column label="折扣价" align="center" prop="discount" /> |
||||
<el-table-column label="有效期" align="center" prop="duration" /> |
||||
<el-table-column label="单位" align="center"> |
||||
<template #default="{ row }"> |
||||
<el-tag v-if="row.unit == 1">天</el-tag> |
||||
<el-tag v-else type="danger">年</el-tag> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="使用方式" align="center" prop="useTypeName" /> |
||||
<el-table-column label="操作" width="160"> |
||||
<template #default="{ row }"> |
||||
<el-button type="primary" link @click="editVip(row)">修改</el-button> |
||||
<el-button type="primary" link @click="handleDelete(row.memberId)">删除</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<pagination |
||||
v-show="total > 0" |
||||
:total="total" |
||||
v-model:page="searchForm.pageNo" |
||||
v-model:limit="searchForm.pageSize" |
||||
@pagination="getList" |
||||
/> |
||||
|
||||
<el-dialog title="会员详情" v-model="showDialog" width="500px" :close-on-click-modal="false"> |
||||
<el-form :model="form" ref="formRef" :rules="rules" label-width="80px"> |
||||
<el-form-item label="会员名称" prop="memberName"> |
||||
<el-input v-model="form.memberName" /> |
||||
</el-form-item> |
||||
<el-form-item label="原价" prop="price"> |
||||
<el-input v-model="form.price" type="number" /> |
||||
</el-form-item> |
||||
<el-form-item label="折扣价" prop="discount"> |
||||
<el-input v-model="form.discount" type="number" /> |
||||
</el-form-item> |
||||
<el-form-item label="有效期" prop="duration"> |
||||
<el-input v-model="form.duration" type="number" /> |
||||
</el-form-item> |
||||
<el-form-item label="单位" prop="unit"> |
||||
<el-radio-group v-model="form.unit"> |
||||
<el-radio :label="1">天</el-radio> |
||||
<el-radio :label="3">年</el-radio> |
||||
</el-radio-group> |
||||
</el-form-item> |
||||
<el-form-item label="使用方式" prop="useTypes"> |
||||
<el-checkbox-group v-model="form.useTypes"> |
||||
<el-checkbox :label="1"> 用户购买 </el-checkbox> |
||||
<el-checkbox :label="2"> 客服赠送 </el-checkbox> |
||||
</el-checkbox-group> |
||||
</el-form-item> |
||||
</el-form> |
||||
|
||||
<template #footer> |
||||
<span> |
||||
<el-button @click="showDialog = false">取消</el-button> |
||||
<el-button type="primary" @click="sureAdd">确定</el-button> |
||||
</span> |
||||
</template> |
||||
</el-dialog> |
||||
</div> |
||||
</template> |
||||
|
||||
<script setup name="VipType"> |
||||
import { |
||||
getVipTypeList, |
||||
addVipType, |
||||
updateVipType, |
||||
deleteVipType, |
||||
getVipType |
||||
} from '@/api/gds/appletUser' |
||||
const message = useMessage() |
||||
const searchForm = ref({ |
||||
memberName: undefined, |
||||
pageNo: 1, |
||||
pageSize: 50 |
||||
}) |
||||
|
||||
const loading = ref(false) |
||||
const tableList = ref([]) |
||||
const total = ref(0) |
||||
|
||||
onMounted(() => { |
||||
searchList() |
||||
}) |
||||
function searchList() { |
||||
searchForm.value.pageNo = 1 |
||||
getList() |
||||
} |
||||
|
||||
function getList() { |
||||
loading.value = true |
||||
getVipTypeList(searchForm.value).then((response) => { |
||||
tableList.value = response.list |
||||
total.value = response.total |
||||
loading.value = false |
||||
}) |
||||
} |
||||
|
||||
const showDialog = ref(false) |
||||
const form = ref({ |
||||
memberName: '', |
||||
price: '', |
||||
discount: '', |
||||
duration: '', |
||||
unit: 1, |
||||
useTypes: [1] |
||||
}) |
||||
const rules = ref({ |
||||
memberName: [{ required: true, message: '请输入会员名称', trigger: 'blur' }], |
||||
price: [{ required: true, message: '请输入价格', trigger: 'blur' }], |
||||
discount: [{ required: true, message: '请输入折扣价', trigger: 'blur' }], |
||||
duration: [{ required: true, message: '请输入有效期', trigger: 'blur' }] |
||||
}) |
||||
|
||||
function addVip() { |
||||
showDialog.value = true |
||||
|
||||
form.value = { |
||||
memberName: '', |
||||
price: '', |
||||
discount: '', |
||||
duration: '', |
||||
unit: 1, |
||||
useTypes: [1] |
||||
} |
||||
} |
||||
|
||||
function editVip(row) { |
||||
try { |
||||
getVipType(row.memberId).then((res) => { |
||||
form.value = { |
||||
...res, |
||||
useTypes: res.useType.split(',').map((item) => Number(item)), |
||||
unit: Number(res.unit) |
||||
} |
||||
showDialog.value = true |
||||
}) |
||||
} catch (error) {} |
||||
} |
||||
|
||||
const formRef = ref(null) |
||||
async function sureAdd() { |
||||
if (!formRef.value) return |
||||
const valid = await formRef.value.validate() |
||||
if (!valid) return |
||||
|
||||
// 调用接口 |
||||
if (form.value.memberId) { |
||||
updateVipType(form.value).then(() => { |
||||
message.success('修改成功') |
||||
showDialog.value = false |
||||
searchList() |
||||
}) |
||||
} else { |
||||
addVipType(form.value).then(() => { |
||||
message.success('添加成功') |
||||
showDialog.value = false |
||||
searchList() |
||||
}) |
||||
} |
||||
} |
||||
|
||||
function handleDelete(id) { |
||||
message.confirm('是否确认删除该会员?').then(() => { |
||||
deleteVipType(id).then(() => { |
||||
message.success('删除成功') |
||||
searchList() |
||||
}) |
||||
}) |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss" scoped></style> |
@ -1,81 +0,0 @@ |
||||
<template> |
||||
<div> |
||||
<el-form :model="searchForm" inline @submit.prevent> |
||||
<el-form-item> |
||||
<el-input v-model="searchForm.phone" placeholder="学员手机号" clearable /> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-select v-model="searchForm.memberId" placeholder="选择会员类型" clearable filterable> |
||||
<el-option |
||||
v-for="item in vipOptions" |
||||
:key="item.memberId" |
||||
:label="item.memberName" |
||||
:value="item.memberId" |
||||
/> |
||||
</el-select> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-button @click="searchList">查询</el-button> |
||||
</el-form-item> |
||||
</el-form> |
||||
<el-table v-loading="loading" :data="tableList" height="calc(100vh - 260px)"> |
||||
<el-table-column type="index" width="55" align="center" /> |
||||
<el-table-column label="手机号" align="left" prop="phone" min-width="140" /> |
||||
<el-table-column label="会员名" align="left" prop="memberName" min-width="140" /> |
||||
<el-table-column label="来源" align="left" prop="source" min-width="100" /> |
||||
<el-table-column label="截止日期" align="left" prop="endDate" min-width="120" /> |
||||
<el-table-column label="操作人" align="left" prop="operUser" min-width="100" /> |
||||
<el-table-column label="操作时间" align="left" prop="operTime" min-width="120" /> |
||||
</el-table> |
||||
<pagination |
||||
v-show="total > 0" |
||||
:total="total" |
||||
v-model:page="searchForm.pageNo" |
||||
v-model:limit="searchForm.pageSize" |
||||
@pagination="getList" |
||||
/> |
||||
</div> |
||||
</template> |
||||
|
||||
<script setup name="VipUser"> |
||||
import { getVipTypeList, searchVipRecord } from '@/api/gds/appletUser' |
||||
const searchForm = ref({ |
||||
memberId: undefined, |
||||
phone: undefined, |
||||
pageNo: 1, |
||||
pageSize: 50 |
||||
}) |
||||
|
||||
const loading = ref(false) |
||||
const tableList = ref([]) |
||||
const total = ref(0) |
||||
|
||||
const vipOptions = ref([]) |
||||
|
||||
onMounted(() => { |
||||
changeCarType() |
||||
}) |
||||
|
||||
function changeCarType() { |
||||
getVipTypeList({ pageNo: 1, pageSize: -1 }).then((response) => { |
||||
vipOptions.value = response.list |
||||
}) |
||||
searchList() |
||||
} |
||||
|
||||
function searchList() { |
||||
searchForm.value.pageNo = 1 |
||||
getList() |
||||
} |
||||
|
||||
function getList() { |
||||
loading.value = true |
||||
searchVipRecord(searchForm.value).then((response) => { |
||||
tableList.value = response.list |
||||
total.value = response.total |
||||
loading.value = false |
||||
}) |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss" scoped></style> |
@ -1,25 +0,0 @@ |
||||
<template> |
||||
<div> |
||||
<el-tabs v-model="tabIndex"> |
||||
<el-tab-pane label="小程序用户" :name="1"> |
||||
<GdsUser v-if="tabIndex == 1" /> |
||||
</el-tab-pane> |
||||
<el-tab-pane label="会员类型" :name="2"> |
||||
<VipType v-if="tabIndex == 2" /> |
||||
</el-tab-pane> |
||||
<el-tab-pane label="VIP操作记录" :name="5"> |
||||
<VipRecord v-if="tabIndex == 5" /> |
||||
</el-tab-pane> |
||||
</el-tabs> |
||||
</div> |
||||
</template> |
||||
|
||||
<script setup> |
||||
import VipType from './components/gdsVip.vue' |
||||
import GdsUser from './components/gdsUsers.vue' |
||||
import VipRecord from './components/gdsVipRecord.vue' |
||||
|
||||
const tabIndex = ref(1) |
||||
</script> |
||||
|
||||
<style lang="scss" scoped></style> |
@ -1,345 +0,0 @@ |
||||
<template> |
||||
<div> |
||||
<el-form :inline="true" label-width="0" @submit.prevent> |
||||
<el-form-item> |
||||
<el-input |
||||
v-model="queryParams.lessonName" |
||||
placeholder="请输入章节名" |
||||
clearable |
||||
@keyup.enter="handleQuery" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-select v-model="queryParams.status" placeholder="发布状态" clearable filterable> |
||||
<el-option label="已发布" :value="1" /> |
||||
<el-option label="已下架" :value="2" /> |
||||
</el-select> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-button type="primary" @click="handleQuery"> 搜索 </el-button> |
||||
<el-button type="primary" @click="handleAdd"> 新增 </el-button> |
||||
</el-form-item> |
||||
</el-form> |
||||
<el-table |
||||
v-loading="loading" |
||||
:data="tableList" |
||||
highlight-current-row |
||||
max-height="calc(100vh - 320px)" |
||||
> |
||||
<el-table-column type="index" width="55" align="center" /> |
||||
<el-table-column label="章节序号" align="left" prop="chapterIndex" width="140" /> |
||||
<el-table-column label="章节名" align="left" prop="chapterName" min-width="140" /> |
||||
<el-table-column label="作者" align="center" prop="author" min-width="100" /> |
||||
<el-table-column label="是否付费" align="center" width="100"> |
||||
<template #default="{ row }"> |
||||
<el-tag type="success" v-if="row.isFree">免费</el-tag> |
||||
<el-tag type="danger" v-else>付费</el-tag> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="章节内容" :width="90"> |
||||
<template #default="{ row }"> |
||||
<el-popover placement="right" width="300px" trigger="click" v-if="row.content"> |
||||
<template #reference> |
||||
<el-button type="primary" style="padding: 0" text>预览</el-button> |
||||
</template> |
||||
<!-- --> |
||||
<div class="iphone-frame"> |
||||
<!-- 屏幕边框(无内容) --> |
||||
<div class="iphone-screen-border"> |
||||
<div v-dompurify-html="row.content"></div> |
||||
</div> |
||||
|
||||
<!-- 顶部摄像头/听筒区域 --> |
||||
<div class="iphone-camera-bar"> |
||||
<div class="camera-dot"></div> |
||||
<div class="earpiece"></div> |
||||
<div class="camera-dot"></div> |
||||
</div> |
||||
|
||||
<!-- 左侧电源键 --> |
||||
<div class="iphone-power-btn"></div> |
||||
|
||||
<!-- 右侧音量键 --> |
||||
<div class="iphone-volume-btn volume-up"></div> |
||||
<div class="iphone-volume-btn volume-down"></div> |
||||
|
||||
<!-- 底部Home键 --> |
||||
<div class="iphone-home-btn"></div> |
||||
</div> |
||||
</el-popover> |
||||
</template> |
||||
</el-table-column> |
||||
|
||||
<el-table-column label="发布时间" align="center" prop="publicTime" min-width="100" /> |
||||
<el-table-column label="浏览数" align="center" prop="browseCount" width="100" /> |
||||
<el-table-column label="点赞数" align="center" prop="goodCount" width="100" /> |
||||
<el-table-column label="收藏数" align="center" prop="collectCount" width="100" /> |
||||
<el-table-column label="操作" align="center" width="140"> |
||||
<template #default="{ row }"> |
||||
<el-button type="primary" link @click.stop="handleEdit(row)"> 修改 </el-button> |
||||
<el-button type="primary" link @click="handleDelete(row)"> 删除 </el-button> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
|
||||
<pagination |
||||
style="margin-bottom: 0" |
||||
v-show="total > 0" |
||||
:total="total" |
||||
v-model:page="queryParams.pageNo" |
||||
v-model:limit="queryParams.pageSize" |
||||
@pagination="getList" |
||||
/> |
||||
|
||||
<el-dialog |
||||
:title="dialogTitle" |
||||
v-model="showDialog" |
||||
width="600px" |
||||
:close-on-click-modal="false" |
||||
> |
||||
<el-form :model="form" ref="formRef" :rules="rules" label-width="80px" :inline="false"> |
||||
<el-form-item label="章节序号" prop="chapterIndex"> |
||||
<el-input v-model="form.chapterIndex" placeholder="请输入" /> |
||||
</el-form-item> |
||||
<el-form-item label="章节名" prop="chapterName"> |
||||
<el-input v-model="form.chapterName" placeholder="请输入" /> |
||||
</el-form-item> |
||||
<el-form-item label="作者"> |
||||
<el-input v-model="form.author" placeholder="请输入" /> |
||||
</el-form-item> |
||||
<el-form-item label="是否付费"> |
||||
<el-radio-group v-model="form.isFree"> |
||||
<el-radio :label="true" :value="true">免费</el-radio> |
||||
<el-radio :label="false" :value="false">付费</el-radio> |
||||
</el-radio-group> |
||||
</el-form-item> |
||||
<el-form-item label="发布状态"> |
||||
<el-radio-group v-model="form.status"> |
||||
<el-radio :label="1" :vlaue="1">发布</el-radio> |
||||
<el-radio :label="2" :value="2">不发布</el-radio> |
||||
</el-radio-group> |
||||
</el-form-item> |
||||
<el-form-item label="章节内容" prop="content"> |
||||
<Editor v-model="form.content" /> |
||||
</el-form-item> |
||||
</el-form> |
||||
|
||||
<template #footer> |
||||
<span> |
||||
<el-button @click="showDialog = false">取 消</el-button> |
||||
<el-button type="primary" @click="handleSave">确 认</el-button> |
||||
</span> |
||||
</template> |
||||
</el-dialog> |
||||
</div> |
||||
</template> |
||||
|
||||
<script setup> |
||||
import * as ChapterApi from '@/api/gds/chapter' |
||||
|
||||
const route = useRoute() |
||||
const message = useMessage() |
||||
|
||||
const tableList = ref([]) |
||||
const total = ref(0) |
||||
const loading = ref(false) |
||||
|
||||
const queryParams = ref({ |
||||
pageNo: 1, |
||||
pageSize: 20, |
||||
lessonName: undefined, |
||||
author: undefined |
||||
}) |
||||
|
||||
function handleQuery() { |
||||
queryParams.value.pageNo = 1 |
||||
getList() |
||||
} |
||||
|
||||
async function getList() { |
||||
try { |
||||
loading.value = true |
||||
const params = { ...queryParams.value, lessonId: route.query.lessonId } |
||||
const data = await ChapterApi.getChapterPage(params) |
||||
tableList.value = data.list |
||||
total.value = data.total |
||||
loading.value = false |
||||
} finally { |
||||
loading.value = false |
||||
} |
||||
} |
||||
|
||||
const showDialog = ref(false) |
||||
const dialogTitle = ref('') |
||||
const form = ref({}) |
||||
const formRef = ref() |
||||
const rules = { |
||||
chapterName: [{ required: true, message: '请输入章节名称', trigger: 'blur' }], |
||||
chapterIndex: [{ required: true, message: '请输入章节序号', trigger: 'blur' }], |
||||
content: [{ required: true, message: '请输入章节内容', trigger: 'blur' }] |
||||
} |
||||
function handleAdd() { |
||||
resetForm() |
||||
dialogTitle.value = '新增章节' |
||||
showDialog.value = true |
||||
} |
||||
|
||||
function handleEdit(row) { |
||||
resetForm() |
||||
dialogTitle.value = '修改章节' |
||||
showDialog.value = true |
||||
form.value = { ...row } |
||||
} |
||||
|
||||
function resetForm() { |
||||
form.value = { |
||||
lessonName: '', |
||||
image: '', |
||||
isFree: false, |
||||
introduction: '', |
||||
author: '', |
||||
status: 2 |
||||
} |
||||
formRef.value && formRef.value.resetFields() |
||||
} |
||||
|
||||
function handleDelete(row) { |
||||
message |
||||
.confirm('是否确认删除该章节?', '警告', { |
||||
type: 'warning' |
||||
}) |
||||
.then(async () => { |
||||
try { |
||||
await ChapterApi.deleteChapter(row.chapterId) |
||||
message.success('删除成功') |
||||
getList() |
||||
} catch (error) {} |
||||
}) |
||||
.catch(() => {}) |
||||
} |
||||
|
||||
function handleSave() { |
||||
formRef.value.validate(async (valid) => { |
||||
if (!valid) return |
||||
try { |
||||
if (form.value.chapterId) { |
||||
await ChapterApi.updateChapter(form.value) |
||||
} else { |
||||
await ChapterApi.addChapter(form.value) |
||||
} |
||||
showDialog.value = false |
||||
getList() |
||||
} catch (error) {} |
||||
}) |
||||
} |
||||
|
||||
onMounted(() => { |
||||
getList() |
||||
}) |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
/* 手机框主体 - 核心样式 */ |
||||
.iphone-frame { |
||||
/* 机身比例(参考iPhone 14) */ |
||||
width: 280px; |
||||
height: 580px; |
||||
/* 机身样式 */ |
||||
background-color: #1c1c1e; /* 默认黑色 */ |
||||
border-radius: 42px; /* 机身大圆角 */ |
||||
border: 8px solid #1c1c1e; /* 边框厚度,增强立体感 */ |
||||
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.1); /* 外阴影+内阴影增强质感 */ |
||||
position: relative; |
||||
} |
||||
|
||||
/* 屏幕区域(仅边框,无内容) */ |
||||
.iphone-screen-border { |
||||
position: absolute; |
||||
top: 0; |
||||
left: 0; |
||||
right: 0; |
||||
bottom: 0; |
||||
padding: 20px 10px; |
||||
margin: 6px; /* 屏幕与机身边框间距 */ |
||||
border-radius: 36px; /* 屏幕圆角(比机身小) */ |
||||
background-color: #fff; /* 模拟屏幕黑边 */ |
||||
overflow-y: auto; |
||||
scrollbar-width: none; /* 隐藏滚动条,保留功能 */ |
||||
-ms-overflow-style: none; /* 针对 IE 和 Edge */ |
||||
::-webkit-scrollbar { |
||||
display: none; |
||||
} |
||||
} |
||||
|
||||
/* 顶部摄像头区域(刘海简化版) */ |
||||
.iphone-camera-bar { |
||||
position: absolute; |
||||
top: -8px; /* 与机身边框对齐 */ |
||||
left: 50%; |
||||
transform: translateX(-50%); |
||||
width: 110px; |
||||
height: 26px; |
||||
background-color: #1c1c1e; /* 与机身同色,隐藏接缝 */ |
||||
border-bottom-left-radius: 16px; |
||||
border-bottom-right-radius: 16px; |
||||
display: flex; |
||||
align-items: center; |
||||
justify-content: center; |
||||
gap: 8px; |
||||
} |
||||
/* 摄像头/听筒细节 */ |
||||
.camera-dot { |
||||
width: 8px; |
||||
height: 8px; |
||||
border-radius: 50%; |
||||
background-color: gray; /* 深灰,模拟摄像头 */ |
||||
} |
||||
.earpiece { |
||||
width: 30px; |
||||
height: 6px; |
||||
border-radius: 3px; |
||||
background-color: gray; /* 模拟听筒 */ |
||||
} |
||||
|
||||
/* 侧边按键 - 电源键(左侧) */ |
||||
.iphone-power-btn { |
||||
position: absolute; |
||||
left: -8px; /* 与机身边框对齐 */ |
||||
top: 120px; |
||||
width: 8px; |
||||
height: 40px; |
||||
background-color: gray; /* 按键颜色(比机身浅) */ |
||||
border-top-left-radius: 4px; |
||||
border-bottom-left-radius: 4px; |
||||
} |
||||
|
||||
/* 侧边按键 - 音量键(右侧) */ |
||||
.iphone-volume-btn { |
||||
position: absolute; |
||||
right: -8px; /* 与机身边框对齐 */ |
||||
width: 8px; |
||||
height: 32px; |
||||
background-color: gray; |
||||
border-top-right-radius: 4px; |
||||
border-bottom-right-radius: 4px; |
||||
} |
||||
.volume-up { |
||||
top: 100px; |
||||
} |
||||
.volume-down { |
||||
top: 150px; |
||||
} |
||||
|
||||
/* 底部Home键(圆形) */ |
||||
.iphone-home-btn { |
||||
position: absolute; |
||||
bottom: 20px; |
||||
left: 50%; |
||||
transform: translateX(-50%); |
||||
width: 40px; |
||||
height: 40px; |
||||
border-radius: 50%; |
||||
border: 2px solid #3a3a3c; /* 按键边框 */ |
||||
background-color: #1c1c1e; /* 与机身同色 */ |
||||
} |
||||
</style> |
@ -1,255 +0,0 @@ |
||||
<template> |
||||
<div> |
||||
<el-form :inline="true" label-width="0" @submit.prevent> |
||||
<el-form-item> |
||||
<el-input |
||||
v-model="queryParams.lessonName" |
||||
placeholder="请输入课程标题" |
||||
clearable |
||||
@keyup.enter="handleQuery" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-input |
||||
v-model="queryParams.author" |
||||
placeholder="请输入作者" |
||||
clearable |
||||
@keyup.enter="handleQuery" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-select v-model="queryParams.status" placeholder="发布状态" clearable filterable> |
||||
<el-option label="已发布" :value="1" /> |
||||
<el-option label="已下架" :value="2" /> |
||||
</el-select> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-button type="primary" @click="handleQuery" v-hasPermi="['GDS:course:search']"> |
||||
搜索 |
||||
</el-button> |
||||
<el-button type="primary" @click="handleAdd" v-hasPermi="['GDS:course:add']"> |
||||
新增 |
||||
</el-button> |
||||
</el-form-item> |
||||
</el-form> |
||||
<el-table |
||||
v-loading="loading" |
||||
:data="tableList" |
||||
highlight-current-row |
||||
max-height="calc(100vh - 320px)" |
||||
@row-click="handleRowClick" |
||||
> |
||||
<el-table-column type="index" width="55" align="center" /> |
||||
<el-table-column label="课程标题" align="left" prop="lessonName" min-width="140" /> |
||||
<el-table-column label="课程简介" align="center" prop="introduction" width="100" /> |
||||
<el-table-column label="图片" align="center" width="100"> |
||||
<template #default="{ row }"> |
||||
<el-image |
||||
v-if="row.image" |
||||
:src="getShowImg(row)" |
||||
:preview-src-list="[getShowImg(row)]" |
||||
:lazy="true" |
||||
style="width: 90px" |
||||
preview-teleported |
||||
/> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="作者" align="center" prop="author" min-width="100" /> |
||||
<el-table-column label="创建时间" align="center" prop="createTime" min-width="100" /> |
||||
<el-table-column label="发布时间" align="center" prop="publicTime" min-width="100" /> |
||||
<el-table-column label="浏览数" align="center" prop="browseCount" min-width="100" /> |
||||
<el-table-column label="点赞数" align="center" prop="goodCount" min-width="100" /> |
||||
<el-table-column label="收藏数" align="center" prop="collectCount" min-width="100" /> |
||||
<el-table-column label="操作" align="center" width="200"> |
||||
<template #default="scope"> |
||||
<el-button |
||||
type="primary" |
||||
link |
||||
@click.stop="handleRowClick(scope.row)" |
||||
v-hasPermi="['GDS:course:edit']" |
||||
> |
||||
课程章节 |
||||
</el-button> |
||||
<el-button |
||||
type="primary" |
||||
link |
||||
@click.stop="handleEdit(scope.row)" |
||||
v-hasPermi="['GDS:course:edit']" |
||||
> |
||||
修改 |
||||
</el-button> |
||||
<el-button |
||||
type="primary" |
||||
link |
||||
@click="handleDelete(scope.row)" |
||||
v-hasPermi="['GDS:course:delete']" |
||||
> |
||||
删除 |
||||
</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
|
||||
<pagination |
||||
style="margin-bottom: 0" |
||||
v-show="total > 0" |
||||
:total="total" |
||||
v-model:page="queryParams.pageNo" |
||||
v-model:limit="queryParams.pageSize" |
||||
@pagination="getList" |
||||
/> |
||||
|
||||
<el-dialog |
||||
:title="dialogTitle" |
||||
v-model="showDialog" |
||||
width="600px" |
||||
:close-on-click-modal="false" |
||||
> |
||||
<el-form :model="form" ref="formRef" :rules="rules" label-width="80px" :inline="false"> |
||||
<el-form-item label="课程名称" prop="lessonName"> |
||||
<el-input v-model="form.lessonName" placeholder="请输入" /> |
||||
</el-form-item> |
||||
<el-form-item label="课程简介" prop="introduction"> |
||||
<el-input |
||||
v-model="form.introduction" |
||||
type="textarea" |
||||
placeholder="请输入" |
||||
:autosize="{ minRows: 4 }" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item label="课程图片" prop="image"> |
||||
<UploadImg v-model="form.image" width="300px" /> |
||||
</el-form-item> |
||||
<el-form-item label="作者"> |
||||
<el-input v-model="form.author" placeholder="请输入" /> |
||||
</el-form-item> |
||||
<el-form-item label="发布状态"> |
||||
<el-radio-group v-model="form.status"> |
||||
<el-radio :label="1">发布</el-radio> |
||||
<el-radio :label="2">不发布</el-radio> |
||||
</el-radio-group> |
||||
</el-form-item> |
||||
</el-form> |
||||
|
||||
<template #footer> |
||||
<span> |
||||
<el-button @click="showDialog = false">取 消</el-button> |
||||
<el-button type="primary" @click="handleSave">确 认</el-button> |
||||
</span> |
||||
</template> |
||||
</el-dialog> |
||||
</div> |
||||
</template> |
||||
|
||||
<script setup> |
||||
import * as CourseApi from '@/api/gds/course' |
||||
|
||||
const router = useRouter() |
||||
const message = useMessage() |
||||
|
||||
const tableList = ref([]) |
||||
const total = ref(0) |
||||
const loading = ref(false) |
||||
|
||||
const queryParams = ref({ |
||||
pageNo: 1, |
||||
pageSize: 20, |
||||
lessonName: undefined, |
||||
author: undefined |
||||
}) |
||||
|
||||
function handleQuery() { |
||||
queryParams.value.pageNo = 1 |
||||
getList() |
||||
} |
||||
|
||||
async function getList() { |
||||
try { |
||||
loading.value = true |
||||
const data = await CourseApi.getCoursePage(queryParams.value) |
||||
tableList.value = data.list |
||||
total.value = data.total |
||||
loading.value = false |
||||
} finally { |
||||
loading.value = false |
||||
} |
||||
} |
||||
|
||||
function getShowImg(row) { |
||||
return row.image.includes('http') |
||||
? row.image |
||||
: `https://ss-cloud.ahduima.com/sinology/pic/${row.image}` |
||||
} |
||||
|
||||
const showDialog = ref(false) |
||||
const dialogTitle = ref('') |
||||
const form = ref({}) |
||||
const formRef = ref() |
||||
const rules = { |
||||
lessonName: [{ required: true, message: '请输入课程名称', trigger: 'blur' }], |
||||
introduction: [{ required: true, message: '请输入课程简介', trigger: 'blur' }] |
||||
} |
||||
function handleAdd() { |
||||
resetForm() |
||||
dialogTitle.value = '新增课程' |
||||
showDialog.value = true |
||||
} |
||||
|
||||
function handleEdit(row) { |
||||
resetForm() |
||||
dialogTitle.value = '修改课程' |
||||
showDialog.value = true |
||||
form.value = { ...row } |
||||
} |
||||
|
||||
function resetForm() { |
||||
form.value = { |
||||
lessonName: '', |
||||
image: '', |
||||
introduction: '', |
||||
author: '', |
||||
status: 2 |
||||
} |
||||
formRef.value && formRef.value.resetFields() |
||||
} |
||||
|
||||
function handleDelete(row) { |
||||
message |
||||
.confirm('是否确认删除该课程?', '警告', { |
||||
type: 'warning' |
||||
}) |
||||
.then(async () => { |
||||
try { |
||||
await CourseApi.deleteCourse(row.lessonId) |
||||
message.success('删除成功') |
||||
getList() |
||||
} catch (error) {} |
||||
}) |
||||
.catch(() => {}) |
||||
} |
||||
|
||||
function handleSave() { |
||||
formRef.value.validate(async (valid) => { |
||||
if (!valid) return |
||||
try { |
||||
if (form.value.lessonId) { |
||||
await CourseApi.updateCourse(form.value) |
||||
} else { |
||||
await CourseApi.addCourse(form.value) |
||||
} |
||||
showDialog.value = false |
||||
getList() |
||||
} catch (error) {} |
||||
}) |
||||
} |
||||
|
||||
function handleRowClick(row) { |
||||
router.push({ path: '/gdsChapter', query: { lessonId: row.lessonId } }) |
||||
} |
||||
|
||||
onMounted(() => { |
||||
getList() |
||||
}) |
||||
</script> |
||||
|
||||
<style lang="scss" scoped></style> |
@ -1,187 +0,0 @@ |
||||
<template> |
||||
<div> |
||||
<el-form :model="searchForm" inline label-width="0"> |
||||
<el-form-item> |
||||
<el-input v-model="searchForm.name" placeholder="教员姓名" /> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-input v-model="searchForm.phone" placeholder="手机号" /> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-select v-model="searchForm.status" clearable filterable placeholder="审核状态"> |
||||
<el-option label="待审核" :value="1" /> |
||||
<el-option label="已通过" :value="2" /> |
||||
<el-option label="未通过" :value="3" /> |
||||
</el-select> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-button type="primary" @click="handleQuery"> 搜索 </el-button> |
||||
</el-form-item> |
||||
</el-form> |
||||
|
||||
<el-table :data="tableList" border stripe> |
||||
<el-table-column type="index" width="50" /> |
||||
<el-table-column prop="name" label="教员姓名" /> |
||||
<el-table-column prop="phone" label="联系方式" /> |
||||
<el-table-column prop="remark" label="备注" /> |
||||
<el-table-column prop="applyTime" label="申请时间" /> |
||||
<el-table-column prop="status" label="审核状态"> |
||||
<template #default="{ row }"> |
||||
<el-tag v-if="row.status == 1" type="info">待审核</el-tag> |
||||
<el-tag v-else-if="row.status == 2" type="success">已通过</el-tag> |
||||
<el-tag v-else type="danger">未通过</el-tag> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="checkUser" label="审核人" /> |
||||
<el-table-column prop="checkTime" label="审核时间" /> |
||||
<!-- 操作 --> |
||||
<el-table-column label="操作" fixed="right" width="150"> |
||||
<template #default="{ row }"> |
||||
<el-button |
||||
type="primary" |
||||
link |
||||
v-hasPermi="['JoinUs:Station:audit']" |
||||
@click="handleDetail(row, 'edit')" |
||||
> |
||||
修改 |
||||
</el-button> |
||||
<el-button |
||||
v-if="row.status == 1" |
||||
type="primary" |
||||
link |
||||
v-hasPermi="['JoinUs:Station:audit']" |
||||
@click="handleDetail(row, 'audit')" |
||||
> |
||||
审核 |
||||
</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<Pagination |
||||
:total="total" |
||||
v-model:page="searchForm.pageNo" |
||||
v-model:limit="searchForm.pageSize" |
||||
@pagination="getList" |
||||
/> |
||||
|
||||
<Dialog v-model="dialogVisible" title="教员详情" style="width: 600px"> |
||||
<el-form :model="form" ref="formRef" :rules="rules" label-width="80px"> |
||||
<el-form-item label="教员姓名" prop="name"> |
||||
<el-input v-model="form.name" placeholder="请输入姓名" /> |
||||
</el-form-item> |
||||
<el-form-item label="联系方式" prop="phone"> |
||||
<el-input v-model="form.phone" placeholder="请输入电话" /> |
||||
</el-form-item> |
||||
<el-form-item label="备注" prop="remark"> |
||||
<el-input |
||||
v-model="form.remark" |
||||
type="textarea" |
||||
:autosize="{ minRows: 2 }" |
||||
placeholder="请输入" |
||||
/> |
||||
</el-form-item> |
||||
<div v-if="dialogType == 'audit'"> |
||||
<el-divider direction="horizontal" content-position="left">审核信息</el-divider> |
||||
<el-form-item label="审核结果" prop="status"> |
||||
<el-radio-group v-model="form.status"> |
||||
<el-radio :label="2" :value="2">通过</el-radio> |
||||
<el-radio :label="3" :value="3">不通过</el-radio> |
||||
</el-radio-group> |
||||
</el-form-item> |
||||
<el-form-item label="审核说明" prop="checkRemark"> |
||||
<el-input |
||||
v-model="form.checkRemark" |
||||
type="textarea" |
||||
:autosize="{ minRows: 2 }" |
||||
placeholder="请输入" |
||||
/> |
||||
</el-form-item> |
||||
</div> |
||||
</el-form> |
||||
<template #footer> |
||||
<el-button type="primary" :disabled="formLoading" @click="submitForm">保 存</el-button> |
||||
<el-button @click="dialogVisible = false">取 消</el-button> |
||||
</template> |
||||
</Dialog> |
||||
</div> |
||||
</template> |
||||
|
||||
<script setup name="Coach"> |
||||
import { auditTeacher, searchTeacher, updateTeacher } from '@/api/uav/regiest' |
||||
|
||||
const message = useMessage() |
||||
|
||||
const searchForm = ref({ |
||||
name: '', |
||||
phone: '', |
||||
status: 1, |
||||
pageNo: 1, |
||||
pageSize: 20 |
||||
}) |
||||
|
||||
const tableList = ref([]) |
||||
const total = ref(0) |
||||
|
||||
const form = ref({}) |
||||
const rules = { |
||||
name: { required: true, message: '请输入名称', trigger: 'blur' }, |
||||
phone: { required: true, message: '请输入手机号', trigger: 'blur' } |
||||
} |
||||
const dialogVisible = ref(false) |
||||
const dialogType = ref('audit') |
||||
|
||||
onMounted(() => { |
||||
handleQuery() |
||||
}) |
||||
|
||||
function handleQuery() { |
||||
searchForm.value.pageNo = 1 |
||||
getList() |
||||
} |
||||
|
||||
function getList() { |
||||
searchTeacher(searchForm.value).then((response) => { |
||||
tableList.value = response.list |
||||
total.value = response.total |
||||
}) |
||||
} |
||||
|
||||
function handleDetail(row, type) { |
||||
dialogType.value = type |
||||
dialogVisible.value = true |
||||
form.value = { ...row } |
||||
} |
||||
|
||||
const formLoading = ref(false) |
||||
const formRef = ref(null) |
||||
async function submitForm() { |
||||
if (!formRef.value) return |
||||
const valid = await formRef.value.validate() |
||||
if (!valid) return |
||||
|
||||
try { |
||||
formLoading.value = true |
||||
let params = { ...form.value } |
||||
if (dialogType.value == 'audit') { |
||||
auditTeacher(params).then((response) => { |
||||
if (response) { |
||||
dialogVisible.value = false |
||||
message.success('操作成功') |
||||
} |
||||
}) |
||||
} else { |
||||
updateTeacher(params).then((response) => { |
||||
if (response) { |
||||
dialogVisible.value = false |
||||
message.success('操作成功') |
||||
} |
||||
}) |
||||
} |
||||
} finally { |
||||
formLoading.value = false |
||||
getList() |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss" scoped></style> |
@ -1,397 +0,0 @@ |
||||
<template> |
||||
<div> |
||||
<el-form :model="searchForm" inline label-width="0"> |
||||
<el-form-item> |
||||
<el-input v-model="searchForm.schoolName" placeholder="机构名称" clearable /> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-select v-model="searchForm.status" clearable filterable placeholder="审核状态"> |
||||
<el-option label="待审核" :value="1" /> |
||||
<el-option label="已通过" :value="2" /> |
||||
<el-option label="未通过" :value="3" /> |
||||
</el-select> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-button type="primary" @click="handleQuery"> 搜索 </el-button> |
||||
</el-form-item> |
||||
</el-form> |
||||
|
||||
<el-table :data="tableList" border stripe> |
||||
<el-table-column type="index" width="50" /> |
||||
<el-table-column prop="schoolName" label="机构名称" /> |
||||
<el-table-column prop="contacts" label="联系人" /> |
||||
<el-table-column prop="phone" label="联系方式" /> |
||||
<el-table-column prop="createTime" label="申请时间" /> |
||||
<el-table-column prop="status" label="审核状态" width="100"> |
||||
<template #default="{ row }"> |
||||
<el-tag v-if="row.status == 1" type="info">待审核</el-tag> |
||||
<el-tag v-else-if="row.status == 2" type="success">已通过</el-tag> |
||||
<el-tag v-else type="danger">未通过</el-tag> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="checkUser" label="审核人" /> |
||||
<el-table-column prop="checkTime" label="审核时间" /> |
||||
<!-- 操作 --> |
||||
<el-table-column label="操作" fixed="right" width="150"> |
||||
<template #default="{ row }"> |
||||
<el-button |
||||
type="primary" |
||||
link |
||||
v-hasPermi="['JoinUs:Station:audit']" |
||||
@click="handleDetail(row, 'edit')" |
||||
> |
||||
修改 |
||||
</el-button> |
||||
<el-button |
||||
v-if="row.status == 1" |
||||
type="primary" |
||||
link |
||||
v-hasPermi="['JoinUs:Station:audit']" |
||||
@click="handleDetail(row, 'audit')" |
||||
> |
||||
审核 |
||||
</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<Pagination |
||||
:total="total" |
||||
v-model:page="searchForm.pageNo" |
||||
v-model:limit="searchForm.pageSize" |
||||
@pagination="getList" |
||||
/> |
||||
|
||||
<Dialog v-model="dialogVisible" title="机构详情" style="width: 1000px"> |
||||
<el-form :model="form" ref="formRef" :rules="rules" label-position="top"> |
||||
<el-row :gutter="20"> |
||||
<el-col :span="12"> |
||||
<el-form-item label="机构名称" prop="schoolName"> |
||||
<el-input v-model="form.schoolName" placeholder="请输入机构名称" /> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="6"> |
||||
<el-form-item label="联系人" prop="contacts"> |
||||
<el-input v-model="form.contacts" placeholder="请输入姓名" /> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="6"> |
||||
<el-form-item label="联系方式" prop="phone"> |
||||
<el-input v-model="form.phone" placeholder="请输入电话" /> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="培训机构宣传文案" prop="introduction"> |
||||
<el-input |
||||
v-model="form.introduction" |
||||
type="textarea" |
||||
:autosize="{ minRows: 2 }" |
||||
placeholder="请输入" |
||||
/> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="培训机构地址" prop="address"> |
||||
<el-input |
||||
v-model="form.address" |
||||
type="textarea" |
||||
:autosize="{ minRows: 2 }" |
||||
placeholder="请输入" |
||||
/> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12" v-for="(it, index) in form.modelList" :key="index"> |
||||
<el-form-item :label="`培训项目-${it.modelName}`" prop="dxy"> |
||||
<!-- <el-checkbox-group> --> |
||||
<el-checkbox |
||||
v-for="item in it.schoolTypeList" |
||||
v-model="item.checked" |
||||
:checked="item.checked" |
||||
:key="item.schoolTypeId" |
||||
:value="item.schoolTypeId" |
||||
> |
||||
{{ item.typeName }} |
||||
</el-checkbox> |
||||
<!-- </el-checkbox-group> --> |
||||
</el-form-item> |
||||
</el-col> |
||||
<!-- <el-col :span="12"> |
||||
<el-form-item label="培训项目-垂直起降" prop="czqj"> |
||||
<el-checkbox-group v-model="form.czqj"> |
||||
<el-checkbox |
||||
v-for="item in driverOptions" |
||||
:key="item.value" |
||||
:label="item.value" |
||||
:value="item.value" |
||||
> |
||||
{{ item.label }} |
||||
</el-checkbox> |
||||
</el-checkbox-group> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="培训项目-直升机" prop="zsj"> |
||||
<el-checkbox-group v-model="form.zsj"> |
||||
<el-checkbox |
||||
v-for="item in driverOptions" |
||||
:key="item.value" |
||||
:label="item.value" |
||||
:value="item.value" |
||||
> |
||||
{{ item.label }} |
||||
</el-checkbox> |
||||
</el-checkbox-group> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="培训项目-固定翼" prop="gdy"> |
||||
<el-checkbox-group v-model="form.gdy"> |
||||
<el-checkbox |
||||
v-for="item in driverOptions" |
||||
:key="item.value" |
||||
:label="item.value" |
||||
:value="item.value" |
||||
> |
||||
{{ item.label }} |
||||
</el-checkbox> |
||||
</el-checkbox-group> |
||||
</el-form-item> |
||||
</el-col> --> |
||||
<el-col :span="8"> |
||||
<el-form-item label="合格证图片" prop="certs"> |
||||
<UploadImgs v-model="form.certs" height="100px" width="100px" /> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="4"> |
||||
<el-form-item label="培训机构Logo" prop="logo"> |
||||
<UploadImg v-model="form.logo" height="100px" width="100px" /> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="主页宣传图" prop="imgUrl"> |
||||
<UploadImgs v-model="form.imgUrl" :limit="6" height="100px" width="100px" /> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="优势标签"> |
||||
<el-checkbox |
||||
v-for="item in form.schoolTagList" |
||||
v-model="item.checked" |
||||
:checked="item.checked" |
||||
:key="item.id" |
||||
:value="item.id" |
||||
> |
||||
{{ item.tag }} |
||||
</el-checkbox> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="其他服务" prop="schoolServiceList"> |
||||
<el-checkbox |
||||
v-for="item in form.schoolServiceList" |
||||
v-model="item.checked" |
||||
:checked="item.checked" |
||||
:key="item.id" |
||||
:value="item.id" |
||||
> |
||||
{{ item.serviceName }} |
||||
</el-checkbox> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="其他诉求" prop="otherRequirement"> |
||||
<el-input |
||||
v-model="form.otherRequirement" |
||||
type="textarea" |
||||
:autosize="{ minRows: 2 }" |
||||
placeholder="请输入" |
||||
/> |
||||
</el-form-item> |
||||
</el-col> |
||||
</el-row> |
||||
<!-- <div v-if="dialogType == 'audit'"> --> |
||||
<el-row> |
||||
<el-divider direction="horizontal" content-position="left">审核信息</el-divider> |
||||
<el-col :span="6" :offset="0"> |
||||
<el-form-item label="审核结果" prop="status"> |
||||
<el-radio-group v-model="form.status"> |
||||
<el-radio :label="2" :value="2">通过</el-radio> |
||||
<el-radio :label="3" :value="3">不通过</el-radio> |
||||
</el-radio-group> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="18" :offset="0"> |
||||
<el-form-item label="审核说明" prop="checkRemark"> |
||||
<el-input v-model="form.checkRemark" placeholder="请输入" /> |
||||
</el-form-item> |
||||
</el-col> |
||||
</el-row> |
||||
<!-- </div> --> |
||||
</el-form> |
||||
<template #footer> |
||||
<el-button type="primary" :disabled="formLoading" @click="submitForm">保 存</el-button> |
||||
<el-button @click="dialogVisible = false">取 消</el-button> |
||||
</template> |
||||
</Dialog> |
||||
</div> |
||||
</template> |
||||
|
||||
<script setup name="Station"> |
||||
import { |
||||
searchStation, |
||||
// auditStation, |
||||
updateStation, |
||||
stationDetail, |
||||
getCarTypeList |
||||
} from '@/api/uav/regiest' |
||||
|
||||
const message = useMessage() |
||||
|
||||
const searchForm = ref({ |
||||
schoolName: '', |
||||
status: 1, |
||||
pageNo: 1, |
||||
pageSize: 20 |
||||
}) |
||||
|
||||
const tableList = ref([]) |
||||
const total = ref(0) |
||||
|
||||
const form = ref({}) |
||||
const rules = { |
||||
schoolName: { required: true, message: '请输入名称', trigger: 'blur' }, |
||||
contacts: { required: true, message: '请输入创建人', trigger: 'blur' }, |
||||
phone: { required: true, message: '请输入手机号', trigger: 'blur' } |
||||
} |
||||
const dialogVisible = ref(false) |
||||
const dialogType = ref('audit') |
||||
const driverOptions = ref([]) |
||||
|
||||
const defaultTips = [ |
||||
{ tag: '服务好', isDefault: true, checked: false }, |
||||
{ tag: '交通便利', isDefault: true, checked: false }, |
||||
{ tag: '提供住宿', isDefault: true, checked: false }, |
||||
{ tag: '免费接送', isDefault: true, checked: false } |
||||
] |
||||
const defaultService = [ |
||||
{ serviceName: '希望平台主动推荐学员', isDefault: true, checked: false }, |
||||
{ serviceName: '接受团购学员报名', isDefault: true, checked: false }, |
||||
{ serviceName: '希望平台推荐教员资源', isDefault: true, checked: false }, |
||||
{ serviceName: '希望平台推荐无人机相关的设备', isDefault: true, checked: false } |
||||
] |
||||
|
||||
onMounted(() => { |
||||
handleQuery() |
||||
getCarTypeList().then((response) => { |
||||
driverOptions.value = response |
||||
}) |
||||
}) |
||||
|
||||
function handleQuery() { |
||||
searchForm.value.pageNo = 1 |
||||
getList() |
||||
} |
||||
|
||||
function getList() { |
||||
searchStation(searchForm.value).then((response) => { |
||||
tableList.value = response.list |
||||
total.value = response.total |
||||
}) |
||||
} |
||||
|
||||
function handleDetail(row, type) { |
||||
dialogType.value = type |
||||
stationDetail(row.schoolId).then((response) => { |
||||
dialogVisible.value = true |
||||
let arr = [] |
||||
response.modelGroupVoList?.map((model) => { |
||||
model.schoolModelVoList?.map((item) => { |
||||
arr.push(item.schoolTypeId) |
||||
}) |
||||
}) |
||||
const tags = [ |
||||
...(response.schoolTagList?.map((it) => ({ ...it, checked: true })) || []), |
||||
...defaultTips |
||||
] |
||||
const services = [ |
||||
...(response.schoolServiceList?.map((it) => ({ ...it, checked: true })) || []), |
||||
...defaultService |
||||
] |
||||
form.value = { |
||||
...response, |
||||
imgUrl: response.imgUrl || [], |
||||
certs: response.certs || [], |
||||
modelList: driverOptions.value.map((item) => { |
||||
return { |
||||
modelId: item.modelId, |
||||
modelName: item.modelName, |
||||
schoolTypeList: item.schoolDriverTypeVoList.map((type) => { |
||||
return { |
||||
...type, |
||||
checked: arr.includes(type.schoolTypeId) |
||||
} |
||||
}) |
||||
} |
||||
}), |
||||
schoolTagList: uniqueByKey(tags, 'tag'), |
||||
schoolServiceList: uniqueByKey(services, 'serviceName') |
||||
} |
||||
}) |
||||
} |
||||
|
||||
function uniqueByKey(arr, key) { |
||||
const map = new Map() |
||||
return arr.filter((item) => { |
||||
// 如果 map 中没有该 key,则保留并加入 map |
||||
if (!map.has(item[key])) { |
||||
map.set(item[key], true) |
||||
return true |
||||
} |
||||
return false |
||||
}) |
||||
} |
||||
|
||||
const formRef = ref(null) |
||||
const formLoading = ref(false) |
||||
async function submitForm() { |
||||
if (!formRef.value) return |
||||
const valid = await formRef.value.validate() |
||||
if (!valid) return |
||||
|
||||
try { |
||||
formLoading.value = true |
||||
|
||||
let params = { ...form.value } |
||||
params.modelGroupVoList = params.modelList |
||||
.map((item) => { |
||||
return { |
||||
modelId: item.modelId, |
||||
modelName: item.modelName, |
||||
schoolModelVoList: item.schoolTypeList.filter((type) => type.checked) |
||||
} |
||||
}) |
||||
.filter((item) => item.schoolModelVoList.length > 0) |
||||
params.schoolServiceList = params.schoolServiceList.filter((item) => item.checked) |
||||
params.schoolTagList = params.schoolTagList.filter((item) => item.checked) |
||||
// if (dialogType.value == 'audit') { |
||||
// auditStation(params).then((response) => { |
||||
// if (response) { |
||||
// dialogVisible.value = false |
||||
// message.success('操作成功') |
||||
// } |
||||
// }) |
||||
// } else { |
||||
updateStation(params).then((response) => { |
||||
if (response) { |
||||
dialogVisible.value = false |
||||
message.success('操作成功') |
||||
} |
||||
}) |
||||
// } |
||||
} finally { |
||||
formLoading.value = false |
||||
getList() |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss" scoped></style> |
@ -1,34 +0,0 @@ |
||||
<template> |
||||
<div> |
||||
<el-row :gutter="20"> |
||||
<el-col |
||||
:xs="24" |
||||
:sm="12" |
||||
:md="6" |
||||
:lg="6" |
||||
:xl="6" |
||||
v-for="(item, index) in appSource" |
||||
:key="index" |
||||
style="display: flex; align-items: center; border: 1px solid #eee; padding: 10px" |
||||
> |
||||
<span style="width: 120px">{{ item.name }}</span> |
||||
<el-select v-model="item.value" placeholder="请选择" class="flex-1"> |
||||
<el-option label="驾考精灵" value="1" /> |
||||
<el-option label="驾考宝典" value="2" /> |
||||
<el-option label="驾校一点通" value="3" /> |
||||
</el-select> |
||||
</el-col> |
||||
</el-row> |
||||
</div> |
||||
</template> |
||||
|
||||
<script setup name="SelectSource"> |
||||
const appSource = ref([ |
||||
{ name: '寻驾', value: '1' }, |
||||
{ name: '金武联', value: '3' }, |
||||
{ name: '通关考', value: '1' }, |
||||
{ name: '好驾到', value: '2' } |
||||
]) |
||||
</script> |
||||
|
||||
<style lang="scss" scoped></style> |
@ -1,18 +1,7 @@ |
||||
<template> |
||||
<div> |
||||
<el-tabs v-model="settingName"> |
||||
<el-tab-pane label="选择题库" :name="1" v-if="checkPermi(['Question:Setting:DataSource'])"> |
||||
<SelectSource /> |
||||
</el-tab-pane> |
||||
</el-tabs> |
||||
</div> |
||||
<div> 基础设置 </div> |
||||
</template> |
||||
|
||||
<script setup name="QuestionSetting"> |
||||
import { checkPermi } from '@/utils/permission' |
||||
import SelectSource from './Components/SelectSource.vue' |
||||
|
||||
const settingName = ref(1) |
||||
</script> |
||||
<script setup name="QuestionSetting"></script> |
||||
|
||||
<style lang="scss" scoped></style> |
||||
|
@ -1,342 +0,0 @@ |
||||
<template> |
||||
<el-dialog |
||||
title="无人机试题" |
||||
:close-on-click-modal="false" |
||||
append-to-body |
||||
v-model="visible" |
||||
width="900px" |
||||
> |
||||
<div> |
||||
<el-form |
||||
ref="dialogFormRef" |
||||
:model="dialogForm" |
||||
:rules="dataRule" |
||||
label-width="auto" |
||||
label-position="right" |
||||
@keyup.enter="dialogFormSubmit()" |
||||
> |
||||
<el-row> |
||||
<el-col :span="24"> |
||||
<el-form-item label="题目" prop="question"> |
||||
<el-input |
||||
v-model="dialogForm.question" |
||||
maxlength="200" |
||||
placeholder="请输入题目" |
||||
clearable |
||||
/> |
||||
</el-form-item> |
||||
</el-col> |
||||
</el-row> |
||||
<el-row> |
||||
<el-col :span="24"> |
||||
<el-form-item label="题目关键字" prop="titleWords"> |
||||
<el-input |
||||
v-model="dialogForm.titleWords" |
||||
maxlength="1000" |
||||
placeholder="请输入" |
||||
clearable |
||||
/> |
||||
</el-form-item> |
||||
</el-col> |
||||
</el-row> |
||||
<el-row> |
||||
<el-col :span="12"> |
||||
<el-form-item label="章节" prop="chapter"> |
||||
<el-select v-model="dialogForm.chapter" style="width: 100%"> |
||||
<el-option |
||||
v-for="dict in chapterOptions" |
||||
:key="dict.chapterId" |
||||
:label="dict.chapterName" |
||||
:value="dict.chapterId" |
||||
/> |
||||
</el-select> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="题型" prop="type"> |
||||
<el-radio-group v-model="dialogForm.type"> |
||||
<el-radio label="1" value="1">判断题</el-radio> |
||||
<el-radio label="2" value="2">单选题</el-radio> |
||||
<el-radio label="3" value="3">多选题</el-radio> |
||||
</el-radio-group> |
||||
</el-form-item> |
||||
</el-col> |
||||
</el-row> |
||||
|
||||
<el-row> |
||||
<el-col :span="12"> |
||||
<el-form-item label="排序" prop="showOrder"> |
||||
<el-input |
||||
v-model="dialogForm.showOrder" |
||||
maxlength="20" |
||||
placeholder="请输入" |
||||
clearable |
||||
/> |
||||
</el-form-item> |
||||
</el-col> |
||||
</el-row> |
||||
<el-row> |
||||
<el-col :span="12"> |
||||
<el-form-item label="选项A" prop="chooseA"> |
||||
<el-input |
||||
v-model="dialogForm.chooseA" |
||||
maxlength="200" |
||||
placeholder="请输入" |
||||
clearable |
||||
/> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="选项B" prop="chooseB"> |
||||
<el-input |
||||
v-model="dialogForm.chooseB" |
||||
maxlength="200" |
||||
placeholder="请输入" |
||||
clearable |
||||
/> |
||||
</el-form-item> |
||||
</el-col> |
||||
</el-row> |
||||
<el-row> |
||||
<el-col :span="12"> |
||||
<el-form-item label="选项C" prop="chooseC"> |
||||
<el-input |
||||
v-model="dialogForm.chooseC" |
||||
maxlength="200" |
||||
placeholder="请输入" |
||||
clearable |
||||
/> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="选项D" prop="chooseD"> |
||||
<el-input |
||||
v-model="dialogForm.chooseD" |
||||
maxlength="200" |
||||
placeholder="请输入" |
||||
clearable |
||||
/> |
||||
</el-form-item> |
||||
</el-col> |
||||
</el-row> |
||||
<el-row> |
||||
<el-col :span="24"> |
||||
<el-form-item label="正确答案" prop="trueAnswer"> |
||||
<el-input |
||||
v-model="dialogForm.trueAnswer" |
||||
maxlength="200" |
||||
placeholder="请输入" |
||||
clearable |
||||
/> |
||||
</el-form-item> |
||||
</el-col> |
||||
</el-row> |
||||
<el-row> |
||||
<el-col :span="24"> |
||||
<el-form-item label="答案解析" prop="bestAnswer"> |
||||
<el-input |
||||
v-model="dialogForm.bestAnswer" |
||||
type="textarea" |
||||
:autosize="{ minRows: 2 }" |
||||
maxlength="1000" |
||||
placeholder="请输入" |
||||
clearable |
||||
/> |
||||
</el-form-item> |
||||
</el-col> |
||||
</el-row> |
||||
<el-row> |
||||
<el-col :span="24"> |
||||
<el-form-item label="快速记忆" prop="skillInfo"> |
||||
<el-input |
||||
v-model="dialogForm.skillInfo" |
||||
type="textarea" |
||||
:autosize="{ minRows: 2 }" |
||||
maxlength="1000" |
||||
placeholder="请输入" |
||||
clearable |
||||
/> |
||||
</el-form-item> |
||||
</el-col> |
||||
</el-row> |
||||
<el-row> |
||||
<el-col :span="24"> |
||||
<el-form-item label="技巧关键字" prop="skillWords"> |
||||
<el-input |
||||
v-model="dialogForm.skillWords" |
||||
maxlength="1000" |
||||
placeholder="请输入" |
||||
clearable |
||||
/> |
||||
</el-form-item> |
||||
</el-col> |
||||
</el-row> |
||||
<el-row> |
||||
<el-col :span="24"> |
||||
<el-form-item label="错误答案解析" prop="errorInfo"> |
||||
<el-input |
||||
v-model="dialogForm.errorInfo" |
||||
type="textarea" |
||||
:autosize="{ minRows: 2 }" |
||||
maxlength="1000" |
||||
placeholder="请输入" |
||||
clearable |
||||
/> |
||||
</el-form-item> |
||||
</el-col> |
||||
</el-row> |
||||
<el-row> |
||||
<el-form-item label="题目图片" prop="imageUrl"> |
||||
<el-upload |
||||
action="#" |
||||
accept=".png,.jpg,.jpeg,.gif" |
||||
:limit="1" |
||||
:http-request="handleImport" |
||||
:on-exceed="handleExceed" |
||||
:show-file-list="false" |
||||
> |
||||
<img v-if="imgUrl" :src="imgUrl" style="width: 200px" /> |
||||
<!-- <i v-else class="el-icon-plus"></i> --> |
||||
<Icon icon="ep:plus" style="width: 80px; height: 80px; border: 1px dashed #dcdfe6" /> |
||||
</el-upload> |
||||
</el-form-item> |
||||
</el-row> |
||||
</el-form> |
||||
</div> |
||||
<template #footer> |
||||
<span class="dialog-footer"> |
||||
<el-button plain @click="visible = false">取消</el-button> |
||||
<el-button type="primary" :disabled="!canSubmit" @click="dialogFormSubmit()"> |
||||
确定 |
||||
</el-button> |
||||
</span> |
||||
</template> |
||||
</el-dialog> |
||||
</template> |
||||
|
||||
<script setup name="QuesAddForm"> |
||||
import { addQuestion, updateQuestion, uploadFile } from '@/api/uav/question.js' |
||||
|
||||
const message = useMessage() // 消息弹窗 |
||||
|
||||
const emit = defineEmits(['update']) |
||||
|
||||
const visible = ref(false) |
||||
const canSubmit = ref(true) |
||||
const imgUrl = ref(undefined) |
||||
const chapterOptions = ref([]) |
||||
const dialogForm = ref({ |
||||
id: undefined, |
||||
showOrder: 0, |
||||
categoryTitle: undefined, |
||||
question: undefined, |
||||
bestAnswer: undefined, |
||||
chooseA: undefined, |
||||
chooseB: undefined, |
||||
chooseC: undefined, |
||||
chooseD: undefined, |
||||
imageUrl: undefined, |
||||
type: '2', |
||||
trueAnswer: undefined, |
||||
carTypeId: undefined, |
||||
skillInfoPic: undefined, |
||||
chapter: undefined, |
||||
skillInfo: undefined, |
||||
skillWords: undefined |
||||
}) |
||||
|
||||
const dataRule = { |
||||
schoolName: [{ required: true, message: '驾校名称不能为空', trigger: 'blur' }], |
||||
status: [{ required: true, message: '状态不能为空', trigger: 'blur' }] |
||||
} |
||||
|
||||
const open = (info = undefined, opts) => { |
||||
visible.value = true |
||||
chapterOptions.value = opts |
||||
resetDialogForm() |
||||
dialogForm.value.driveTypeName = info.driveTypeName |
||||
dialogForm.value.carTypeName = info.carTypeName |
||||
if (info) { |
||||
dialogForm.value = { ...dialogForm.value, ...info, chapter: info.chapter } |
||||
if (dialogForm.value.imageUrl) { |
||||
imgUrl.value = dialogForm.value.imageUrl.includes('http') |
||||
? dialogForm.value.imageUrl |
||||
: 'https://ss-cloud.ahduima.com/xjxc/pic/' + dialogForm.value.imageUrl |
||||
} else { |
||||
imgUrl.value = '' |
||||
} |
||||
} |
||||
} |
||||
|
||||
defineExpose({ |
||||
open |
||||
}) |
||||
|
||||
const resetDialogForm = () => { |
||||
dialogForm.value = { |
||||
id: undefined, |
||||
showOrder: 0, |
||||
question: undefined, |
||||
bestAnswer: undefined, |
||||
chooseA: undefined, |
||||
chooseB: undefined, |
||||
chooseC: undefined, |
||||
chooseD: undefined, |
||||
imageUrl: undefined, |
||||
type: '2', |
||||
trueAnswer: undefined, |
||||
carTypeId: undefined, |
||||
skillInfoPic: undefined, |
||||
skillInfo: undefined, |
||||
jqtp: undefined, |
||||
biaoji: undefined, |
||||
titleWords: undefined, |
||||
skillWords: undefined, |
||||
optaWords: undefined, |
||||
optbWords: undefined, |
||||
optcWords: undefined, |
||||
optdWords: undefined, |
||||
carTypeId: undefined, |
||||
chapter: '1' |
||||
} |
||||
} |
||||
const dialogFormRef = ref(null) |
||||
// 表单提交 |
||||
const dialogFormSubmit = async () => { |
||||
if (!dialogFormRef.value) return |
||||
const valid = await dialogFormRef.value.validate() |
||||
if (!valid) return |
||||
|
||||
if (dialogForm.value.questionId) { |
||||
updateQuestion(dialogForm.value).then((response) => { |
||||
if (response) { |
||||
message.success('修改成功') |
||||
emit('update') |
||||
visible.value = false |
||||
} |
||||
}) |
||||
} else { |
||||
addQuestion(dialogForm.value).then((response) => { |
||||
if (response) { |
||||
message.success('新增成功') |
||||
visible.value = false |
||||
emit('update') |
||||
} |
||||
}) |
||||
} |
||||
} |
||||
const handleImport = (opt) => { |
||||
const data = new FormData() |
||||
data.append('file', opt.file) |
||||
uploadFile(data).then((resp) => { |
||||
if (resp.code == 200) { |
||||
message.success('文件上传成功') |
||||
dialogForm.value.imageUrl = resp.data |
||||
imgUrl.value = 'https://ss-cloud.ahduima.com/xjxc/pic/' + dialogForm.value.imageUrl |
||||
} |
||||
}) |
||||
} |
||||
const handleExceed = (files) => { |
||||
handleImport({ file: files[0] }) |
||||
} |
||||
</script> |
@ -1,265 +1,7 @@ |
||||
<template> |
||||
<div class="app-container"> |
||||
<el-form :inline="true" label-width="100px" @submit.prevent> |
||||
<el-row :gutter="20"> |
||||
<el-col :span="12" :offset="0"> |
||||
<el-form-item label="无人机类型"> |
||||
<el-radio-group v-model="queryParams.modelId" @change="changeCarType"> |
||||
<el-radio |
||||
v-for="item in cartypeOptions" |
||||
:key="item.modelId" |
||||
:label="item.modelId" |
||||
:value="item.modelId" |
||||
> |
||||
{{ item.modelName }} |
||||
</el-radio> |
||||
</el-radio-group> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12" :offset="0"> |
||||
<el-form-item label="驾驶员类型"> |
||||
<el-radio-group v-model="queryParams.typeId"> |
||||
<el-radio |
||||
v-for="item in driverOptions" |
||||
:key="item.typeId" |
||||
:label="item.typeId" |
||||
:value="item.typeId" |
||||
> |
||||
{{ item.typeName }} |
||||
</el-radio> |
||||
</el-radio-group> |
||||
</el-form-item> |
||||
</el-col> |
||||
</el-row> |
||||
<el-row :gutter="20"> |
||||
<el-form-item label="章节"> |
||||
<el-select v-model="queryParams.chapter" placeholder="选择章节" clearable filterable> |
||||
<el-option |
||||
v-for="item in chapterOptions" |
||||
:key="item.chapterId" |
||||
:label="item.chapterName" |
||||
:value="item.chapterId" |
||||
/> |
||||
</el-select> |
||||
</el-form-item> |
||||
<el-form-item label="图片"> |
||||
<el-radio-group v-model="queryParams.isPic"> |
||||
<el-radio :label="true" :value="true">有</el-radio> |
||||
<el-radio :label="false" :value="false">无</el-radio> |
||||
</el-radio-group> |
||||
</el-form-item> |
||||
<el-form-item label="题目"> |
||||
<el-input |
||||
v-model="queryParams.question" |
||||
placeholder="请输入题目" |
||||
clearable |
||||
style="width: 400px" |
||||
@keyup.enter="handleQuery" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-button type="primary" @click="handleQuery"> 搜索 </el-button> |
||||
<el-button plain @click="reset"> 重置 </el-button> |
||||
<el-button type="primary" @click="handleAdd" v-hasPermi="['Question:UAV:add']"> |
||||
新增 |
||||
</el-button> |
||||
</el-form-item> |
||||
</el-row> |
||||
</el-form> |
||||
|
||||
<el-table |
||||
v-loading="loading" |
||||
:data="tableList" |
||||
highlight-current-row |
||||
max-height="calc(100vh - 260px)" |
||||
> |
||||
<el-table-column label="序号" width="60" prop="showOrder" /> |
||||
<el-table-column label="题目" align="left" prop="question" min-width="140" /> |
||||
<el-table-column label="选项" align="left" min-width="140"> |
||||
<template #default="{ row }"> |
||||
<p v-if="row.chooseA">A:{{ row.chooseA }}</p> |
||||
<p v-if="row.chooseB">B:{{ row.chooseB }}</p> |
||||
<p v-if="row.chooseC">C:{{ row.chooseC }}</p> |
||||
<p v-if="row.chooseD">D:{{ row.chooseD }}</p> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="正确答案" align="center" prop="trueAnswer" width="100" /> |
||||
<!-- <el-table-column label="科目" align="center" prop="subject" width="100"> |
||||
<template #default="{ row }"> |
||||
<span v-if="row.subject == '1'">科一</span> |
||||
<span v-if="row.subject == '4'">科四</span> |
||||
</template> |
||||
</el-table-column> --> |
||||
<el-table-column label="章节" align="center" prop="chapterName" min-width="100" /> |
||||
<el-table-column label="图片" align="center" width="100"> |
||||
<template #default="{ row }"> |
||||
<el-image |
||||
v-if="row.imageUrl" |
||||
:src="getShowImg(row)" |
||||
:preview-src-list="[getShowImg(row)]" |
||||
:lazy="true" |
||||
style="width: 90px" |
||||
preview-teleported |
||||
/> |
||||
</template> |
||||
</el-table-column> |
||||
<!-- <el-table-column label="状态" width="100"> |
||||
<template #default="{ row }"> |
||||
<el-tag v-if="row.isActive == 0" type="success">使用中</el-tag> |
||||
<el-tag v-else type="danger">已删除</el-tag> |
||||
</template> |
||||
</el-table-column> --> |
||||
|
||||
<el-table-column label="操作" align="center" width="140"> |
||||
<template #default="scope"> |
||||
<el-button |
||||
type="primary" |
||||
link |
||||
@click="handleEdit(scope.row)" |
||||
v-hasPermi="['Question:UAVVip:edit']" |
||||
> |
||||
修改 |
||||
</el-button> |
||||
<el-button |
||||
type="primary" |
||||
link |
||||
@click="handleDelete(scope.row)" |
||||
v-hasPermi="['Question:UAVVip:delete']" |
||||
> |
||||
删除 |
||||
</el-button> |
||||
<div> 无人机题库 </div> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
|
||||
<pagination |
||||
style="margin-bottom: 0" |
||||
v-show="total > 0" |
||||
:total="total" |
||||
v-model:page="queryParams.pageNo" |
||||
v-model:limit="queryParams.pageSize" |
||||
@pagination="getList" |
||||
/> |
||||
<QuestionAddForm ref="dialogAddForm" @update="getList" /> |
||||
</div> |
||||
</template> |
||||
|
||||
<script setup name="UAV"> |
||||
import QuestionAddForm from './components/QuestionAddForm.vue' |
||||
import { searchChapter } from '@/api/uav/chapter' |
||||
import { |
||||
searchQuestion, |
||||
deleteQuestion, |
||||
getCarTypeOptions, |
||||
getDriverTypeOptions |
||||
} from '@/api/uav/question.js' |
||||
|
||||
const message = useMessage() |
||||
|
||||
const loading = ref(false) |
||||
const total = ref(0) |
||||
const tableList = ref([]) |
||||
const queryParams = ref({ |
||||
question: undefined, |
||||
modelId: undefined, |
||||
typeId: undefined, |
||||
isPic: undefined, |
||||
chapter: undefined, |
||||
pageNo: 1, |
||||
pageSize: 100 |
||||
}) |
||||
|
||||
const cartypeOptions = ref([]) |
||||
const driverOptions = ref([]) |
||||
|
||||
onMounted(() => { |
||||
getQuestionChapter() |
||||
getCarTypeOptions().then((res) => { |
||||
cartypeOptions.value = res |
||||
if (res.length) { |
||||
queryParams.value.modelId = res[0].modelId |
||||
changeCarType() |
||||
} |
||||
}) |
||||
}) |
||||
|
||||
function changeCarType() { |
||||
getDriverTypeOptions({ modelId: queryParams.value.modelId }).then((res) => { |
||||
driverOptions.value = res |
||||
if (res.length) { |
||||
queryParams.value.typeId = res[0].typeId |
||||
} |
||||
}) |
||||
} |
||||
|
||||
function reset() { |
||||
queryParams.value = { |
||||
question: undefined, |
||||
modelId: undefined, |
||||
typeId: undefined, |
||||
isPic: undefined, |
||||
chapter: undefined, |
||||
pageNo: 1, |
||||
pageSize: 100 |
||||
} |
||||
} |
||||
|
||||
const chapterOptions = ref([]) |
||||
const getQuestionChapter = () => { |
||||
searchChapter().then((res) => { |
||||
chapterOptions.value = res |
||||
}) |
||||
} |
||||
|
||||
function getShowImg(row) { |
||||
return row.imageUrl.includes('http') |
||||
? row.imageUrl |
||||
: `https://ss-cloud.ahduima.com/xjxc/pic/${row.imageUrl}` |
||||
} |
||||
|
||||
function getList() { |
||||
loading.value = true |
||||
searchQuestion(queryParams.value).then((response) => { |
||||
tableList.value = response.list |
||||
total.value = response.total |
||||
loading.value = false |
||||
}) |
||||
} |
||||
|
||||
function handleQuery() { |
||||
queryParams.value.pageNo = 1 |
||||
getList() |
||||
} |
||||
|
||||
const dialogAddForm = ref(null) |
||||
function handleEdit(item) { |
||||
dialogAddForm.value.open({ ...item, chapter: Number(item.chapter) }, chapterOptions.value) |
||||
} |
||||
|
||||
function handleAdd() { |
||||
dialogAddForm.value.open( |
||||
{ |
||||
chapter: queryParams.value.chapter, |
||||
modelId: queryParams.value.modelId, |
||||
typeId: queryParams.value.typeId |
||||
}, |
||||
chapterOptions.value |
||||
) |
||||
} |
||||
|
||||
function handleDelete(row) { |
||||
message |
||||
.confirm('是否确认删除该题?') |
||||
.then(function () { |
||||
deleteQuestion(row.questionId).then(() => { |
||||
getList() |
||||
message.success('删除题目成功') |
||||
}) |
||||
}) |
||||
.catch((err) => { |
||||
console.log(err) |
||||
}) |
||||
} |
||||
</script> |
||||
<script setup name="UAV"></script> |
||||
|
||||
<style lang="scss" scoped></style> |
||||
|
@ -1,185 +0,0 @@ |
||||
<template> |
||||
<div> |
||||
<!-- 查询条件 --> |
||||
<el-form ref="queryParamsRef" :model="queryParams" inline label-width="0" @submit.prevent> |
||||
<el-form-item> |
||||
<el-input |
||||
v-model="queryParams.chapterName" |
||||
placeholder="请输入章节名称" |
||||
@keyup.enter="handleQuery" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-button type="primary" @click="handleQuery"> 搜索 </el-button> |
||||
<el-button type="primary" @click="handleAdd" v-hasPermi="['Question:UAVChapter:add']"> |
||||
新增 |
||||
</el-button> |
||||
</el-form-item> |
||||
</el-form> |
||||
<el-table |
||||
v-loading="loading" |
||||
:data="tableList" |
||||
highlight-current-row |
||||
max-height="calc(100vh - 180px)" |
||||
> |
||||
<el-table-column type="index" width="55" align="center" /> |
||||
<el-table-column label="章节名称" prop="chapterName" /> |
||||
<el-table-column label="排序" prop="sort" /> |
||||
<el-table-column label="创建时间" prop="createTime" /> |
||||
<el-table-column label="创建人" prop="creator" /> |
||||
<el-table-column label="最近修改时间" prop="updateTime" /> |
||||
<el-table-column label="修改人" prop="updater" /> |
||||
|
||||
<el-table-column label="操作" align="center" width="140"> |
||||
<template #default="scope"> |
||||
<el-button |
||||
type="primary" |
||||
link |
||||
@click="handleEdit(scope.row)" |
||||
v-hasPermi="['Question:UAVChapter:edit']" |
||||
> |
||||
修改 |
||||
</el-button> |
||||
<el-button |
||||
type="primary" |
||||
link |
||||
@click="handleDelete(scope.row)" |
||||
v-hasPermi="['Question:UAVChapter:delete']" |
||||
> |
||||
删除 |
||||
</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
|
||||
<Dialog v-model="showDialog" :title="dialogTitle" style="width: 880px"> |
||||
<el-form ref="dialogFormRef" :model="form" :rules="rules" label-width="100px"> |
||||
<el-row> |
||||
<el-col :span="12"> |
||||
<el-form-item label="章节名称" prop="chapterName"> |
||||
<el-input v-model="form.chapterName" placeholder="请输入章节名称" /> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="排序" prop="sort"> |
||||
<el-input v-model="form.sort" placeholder="请输入排序" type="number" /> |
||||
</el-form-item> |
||||
</el-col> |
||||
</el-row> |
||||
<el-form-item label="知识总结" prop="summary"> |
||||
<Editor v-model="form.summary" /> |
||||
</el-form-item> |
||||
</el-form> |
||||
<template #footer> |
||||
<el-button type="primary" @click="submitForm">确 定</el-button> |
||||
<el-button @click="showDialog = false">取 消</el-button> |
||||
</template> |
||||
</Dialog> |
||||
</div> |
||||
</template> |
||||
|
||||
<script setup name="UAVChapter"> |
||||
import Editor from '@/components/Editor/src/Editor.vue' |
||||
import * as ChapterApi from '@/api/uav/chapter' |
||||
|
||||
const message = useMessage() |
||||
|
||||
const loading = ref(false) |
||||
const tableList = ref([]) |
||||
const queryParams = ref({ |
||||
chapterName: '' |
||||
}) |
||||
|
||||
onMounted(() => { |
||||
handleQuery() |
||||
}) |
||||
|
||||
function getList() { |
||||
loading.value = true |
||||
// 查询无人机章节列表 |
||||
ChapterApi.searchChapter(queryParams.value).then((response) => { |
||||
tableList.value = response |
||||
loading.value = false |
||||
}) |
||||
} |
||||
|
||||
function handleQuery() { |
||||
getList() |
||||
} |
||||
|
||||
const form = ref({}) |
||||
const showDialog = ref(false) |
||||
const rules = { |
||||
chapterName: [{ required: true, message: '请输入章节名称', trigger: 'blur' }], |
||||
sort: [{ required: true, message: '请输入排序', trigger: 'blur' }] |
||||
} |
||||
|
||||
const dialogTitle = ref('新增章节') |
||||
const dialogFormRef = ref() |
||||
function handleAdd() { |
||||
showDialog.value = true |
||||
dialogTitle.value = '新增章节' |
||||
resetForm() |
||||
} |
||||
|
||||
function handleEdit(row) { |
||||
showDialog.value = true |
||||
resetForm() |
||||
dialogTitle.value = '修改章节' |
||||
form.value = { |
||||
chapterName: row.chapterName, |
||||
sort: row.sort, |
||||
chapterId: row.chapterId, |
||||
summary: row.summary |
||||
} |
||||
} |
||||
|
||||
function resetForm() { |
||||
form.value = { |
||||
chapterName: undefined, |
||||
sort: 1, |
||||
summary: undefined |
||||
} |
||||
if (dialogFormRef.value) { |
||||
dialogFormRef.value.resetFields() |
||||
} |
||||
} |
||||
|
||||
function handleDelete(row) { |
||||
message |
||||
.confirm('是否确认删除该章节?') |
||||
.then(function () { |
||||
ChapterApi.deleteChapter(row.chapterId).then(() => { |
||||
getList() |
||||
message.success('删除成功') |
||||
}) |
||||
}) |
||||
.catch((err) => { |
||||
console.log(err) |
||||
}) |
||||
} |
||||
|
||||
const submitForm = async () => { |
||||
try { |
||||
if (!dialogFormRef.value) return |
||||
const valid = await dialogFormRef.value.validate() |
||||
if (!valid) return |
||||
|
||||
if (form.value.chapterId) { |
||||
await ChapterApi.updateChapter(form.value) |
||||
message.success('修改成功') |
||||
getList() |
||||
showDialog.value = false |
||||
} else { |
||||
await ChapterApi.addChapter(form.value) |
||||
message.success('新增成功') |
||||
showDialog.value = false |
||||
getList() |
||||
} |
||||
} catch (error) { |
||||
console.log(error) |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss" scoped></style> |
@ -1,205 +0,0 @@ |
||||
<template> |
||||
<div> |
||||
<el-form :model="searchForm" inline @submit.prevent> |
||||
<el-form-item> |
||||
<el-input v-model="searchForm.name" placeholder="输入姓名" @keyup.enter="handleQuery" /> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-input v-model="searchForm.phone" placeholder="输入手机号" @keyup.enter="handleQuery" /> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-input |
||||
v-model="searchForm.city" |
||||
placeholder="输入城市或地址" |
||||
@keyup.enter="handleQuery" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-button type="primary" @click="handleQuery"> 搜索 </el-button> |
||||
</el-form-item> |
||||
</el-form> |
||||
|
||||
<el-table |
||||
v-loading="loading" |
||||
:data="tableList" |
||||
highlight-current-row |
||||
max-height="calc(100vh - 320px)" |
||||
> |
||||
<el-table-column type="index" width="55" align="center" /> |
||||
<el-table-column label="姓名" prop="name" /> |
||||
<el-table-column label="手机号" prop="phone" /> |
||||
<el-table-column label="城市" prop="city" /> |
||||
<el-table-column label="意向机构" prop="schoolName" /> |
||||
<el-table-column label="咨询类型" prop="typeName" /> |
||||
<el-table-column label="咨询日期" prop="createTime" /> |
||||
<el-table-column label="预期开课时间" prop="studyTime" :formatter="dateFormatter" /> |
||||
<el-table-column label="诉求" prop="otherRequirement" /> |
||||
<el-table-column label="客服备注" prop="remark" /> |
||||
<el-table-column label="报名状态" prop="status"> |
||||
<template #default="{ row }"> |
||||
<el-tag v-if="row.status == 1" type="primary">未报名</el-tag> |
||||
<el-tag v-else-if="row.status == 2" type="success">报名成功</el-tag> |
||||
<el-tag v-else-if="row.status == 3" type="info">已失效</el-tag> |
||||
</template> |
||||
</el-table-column> |
||||
<!-- <el-table-column label="绑定机构" prop="bindSchoolName" /> --> |
||||
|
||||
<el-table-column label="操作" align="center" width="140"> |
||||
<template #default="{ row }"> |
||||
<el-button |
||||
type="primary" |
||||
link |
||||
@click="handleEdit(row)" |
||||
v-hasPermi="['UAVClue:CluePool:edit']" |
||||
> |
||||
修改 |
||||
</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
|
||||
<pagination |
||||
style="margin-bottom: 0" |
||||
v-show="total > 0" |
||||
:total="total" |
||||
v-model:page="searchForm.pageNo" |
||||
v-model:limit="searchForm.pageSize" |
||||
@pagination="getList" |
||||
/> |
||||
|
||||
<Dialog v-model="showDialog" title="修改线索" style="width: 800px"> |
||||
<el-form ref="dialogFormRef" :model="form" :rules="rules" label-width="100px"> |
||||
<el-row> |
||||
<el-col :span="12"> |
||||
<el-form-item label="姓名" prop="name"> |
||||
<el-input v-model="form.name" /> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="手机号" prop="phone"> |
||||
<el-input v-model="form.phone" /> |
||||
</el-form-item> |
||||
</el-col> |
||||
</el-row> |
||||
<el-row> |
||||
<el-col :span="12"> |
||||
<el-form-item label="城市" prop="city"> |
||||
<el-input v-model="form.city" placeholder="请输入城市或地址" /> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="12" :offset="0"> |
||||
<el-form-item label="咨询类型" prop="typeName"> |
||||
<el-input v-model="form.typeName" placeholder="请输入" clearable /> |
||||
</el-form-item> |
||||
</el-col> |
||||
</el-row> |
||||
<el-row> |
||||
<el-col :span="24"> |
||||
<el-form-item label="意向机构" prop="schoolName"> |
||||
<el-input v-model="form.schoolName" placeholder="请输入" clearable /> |
||||
</el-form-item> |
||||
</el-col> |
||||
</el-row> |
||||
<el-row> |
||||
<el-col :span="24" :offset="0"> |
||||
<el-form-item label="诉求" prop="need"> |
||||
<el-input type="textarea" v-model="form.need" placeholder="请输入诉求" /> |
||||
</el-form-item> |
||||
</el-col> |
||||
</el-row> |
||||
<el-row> |
||||
<el-col :span="12" :offset="0"> |
||||
<el-form-item label="报名状态" prop="status"> |
||||
<el-radio-group v-model="form.status"> |
||||
<el-radio :label="1" :value="1">未报名</el-radio> |
||||
<el-radio :label="2" :value="2">已报名</el-radio> |
||||
<el-radio :label="3" :value="3">已失效</el-radio> |
||||
</el-radio-group> |
||||
</el-form-item> |
||||
</el-col> |
||||
</el-row> |
||||
|
||||
<el-row> |
||||
<el-col :span="24" :offset="0"> |
||||
<el-form-item label="备注" prop="remark"> |
||||
<el-input |
||||
type="textarea" |
||||
v-model="form.remark" |
||||
placeholder="请输入备注" |
||||
:autosize="{ minRows: 5, maxRows: 10 }" |
||||
/> |
||||
</el-form-item> |
||||
</el-col> |
||||
</el-row> |
||||
</el-form> |
||||
<template #footer> |
||||
<el-button type="primary" @click="submitForm">确 定</el-button> |
||||
<el-button @click="showDialog = false">取 消</el-button> |
||||
</template> |
||||
</Dialog> |
||||
</div> |
||||
</template> |
||||
|
||||
<script setup name="CluePool"> |
||||
import * as api from '@/api/uav/clue' |
||||
import { removeNullField } from '@/utils' |
||||
import { dateFormatter } from '@/utils/formatTime' |
||||
|
||||
const loading = ref(false) |
||||
const total = ref(0) |
||||
const tableList = ref([]) |
||||
const searchForm = ref({ |
||||
name: '', |
||||
phone: '', |
||||
city: '', |
||||
pageNo: 1, |
||||
pageSize: 50 |
||||
}) |
||||
|
||||
onMounted(() => { |
||||
handleQuery() |
||||
}) |
||||
|
||||
function handleQuery() { |
||||
searchForm.value.pageNo = 1 |
||||
getList() |
||||
} |
||||
|
||||
function getList() { |
||||
loading.value = true |
||||
try { |
||||
api.searchClue(removeNullField(searchForm.value)).then((data) => { |
||||
tableList.value = data.list |
||||
total.value = data.total |
||||
}) |
||||
} finally { |
||||
loading.value = false |
||||
} |
||||
} |
||||
|
||||
const form = ref({}) |
||||
const showDialog = ref(false) |
||||
const rules = { |
||||
name: [{ required: true, message: '请输入姓名', trigger: 'blur' }], |
||||
phone: [{ required: true, message: '请输入手机号', trigger: 'blur' }] |
||||
} |
||||
|
||||
const dialogFormRef = ref() |
||||
|
||||
function handleEdit(row) { |
||||
form.value = row |
||||
showDialog.value = true |
||||
} |
||||
|
||||
const submitForm = async () => { |
||||
if (!dialogFormRef.value) return |
||||
const valid = await dialogFormRef.value.validate() |
||||
if (!valid) return |
||||
|
||||
message.success('修改成功') |
||||
getList() |
||||
showDialog.value = false |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss" scoped></style> |
@ -1,98 +0,0 @@ |
||||
<template> |
||||
<div> |
||||
<el-form :model="searchForm" inline @submit.prevent> |
||||
<el-form-item> |
||||
<el-input |
||||
v-model="searchForm.userName" |
||||
placeholder="输入学员姓名/手机号" |
||||
clearable |
||||
@keyup.enter="handleQuery" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-input |
||||
v-model="searchForm.question" |
||||
placeholder="输入题目" |
||||
clearable |
||||
@keyup.enter="handleQuery" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-button type="primary" @click="handleQuery"> 搜索 </el-button> |
||||
</el-form-item> |
||||
</el-form> |
||||
<el-table |
||||
v-loading="loading" |
||||
:data="tableList" |
||||
highlight-current-row |
||||
max-height="calc(100vh - 260px)" |
||||
> |
||||
<el-table-column type="index" width="55" align="center" /> |
||||
<el-table-column label="题目" prop="question" /> |
||||
<el-table-column label="图片"> |
||||
<template #default="{ row }"> |
||||
<img v-if="row.imageUrl" :src="row.imageUrl" width="100" height="100" /> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="选项"> |
||||
<template #default="{ row }"> |
||||
<div v-for="(item, index) in optionArr" :key="index"> |
||||
<span v-if="row['choose' + item]">{{ item }}. {{ row['choose' + item] }}</span> |
||||
</div> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="正确答案" prop="trueAnswer" /> |
||||
<el-table-column label="收藏人" prop="userName" /> |
||||
<el-table-column label="手机号" prop="phone" /> |
||||
<el-table-column label="收藏时间" prop="createTime" /> |
||||
</el-table> |
||||
|
||||
<pagination |
||||
style="margin-bottom: 0" |
||||
v-show="total > 0" |
||||
:total="total" |
||||
v-model:page="searchForm.pageNo" |
||||
v-model:limit="searchForm.pageSize" |
||||
@pagination="getList" |
||||
/> |
||||
</div> |
||||
</template> |
||||
|
||||
<script setup> |
||||
import { searchCollectRecords } from '@/api/uav/record' |
||||
|
||||
const searchForm = ref({ |
||||
question: '', |
||||
nameOrPhone: '', |
||||
pageNo: 1, |
||||
pageSize: 100 |
||||
}) |
||||
|
||||
const optionArr = ['A', 'B', 'C', 'D', 'E'] |
||||
|
||||
const loading = ref(false) |
||||
const total = ref(0) |
||||
const tableList = ref([]) |
||||
|
||||
onMounted(() => { |
||||
handleQuery() |
||||
}) |
||||
function getList() { |
||||
loading.value = true |
||||
try { |
||||
searchCollectRecords(searchForm.value).then((res) => { |
||||
tableList.value = res.list |
||||
total.value = res.total |
||||
}) |
||||
} finally { |
||||
loading.value = false |
||||
} |
||||
} |
||||
|
||||
function handleQuery() { |
||||
searchForm.value.pageNo = 1 |
||||
getList() |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss" scoped></style> |
@ -1,141 +0,0 @@ |
||||
<template> |
||||
<div> |
||||
<el-form :model="searchForm" inline @submit.prevent> |
||||
<el-form-item> |
||||
<el-input |
||||
v-model="searchForm.userName" |
||||
placeholder="输入学员姓名/手机号" |
||||
@keyup.enter="handleQuery" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-select |
||||
v-model="searchForm.isPass" |
||||
placeholder="选择考试结果" |
||||
@change="handleQuery" |
||||
style="width: 150px" |
||||
clearable |
||||
> |
||||
<el-option label="合格" :value="1" /> |
||||
<el-option label="不合格" :value="0" /> |
||||
</el-select> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-button type="primary" @click="handleQuery"> 搜索 </el-button> |
||||
</el-form-item> |
||||
</el-form> |
||||
<el-table |
||||
v-loading="loading" |
||||
:data="tableList" |
||||
highlight-current-row |
||||
max-height="calc(100vh - 260px)" |
||||
> |
||||
<el-table-column type="index" width="55" align="center" /> |
||||
<el-table-column label="姓名" prop="userName" /> |
||||
<el-table-column label="手机号" prop="phone" /> |
||||
<el-table-column label="无人机类型" prop="modelName" /> |
||||
<el-table-column label="驾驶员类型" prop="typeName" /> |
||||
<el-table-column label="交卷时间" prop="submitTime" /> |
||||
<el-table-column label="模考时长" prop="testTimeStr" /> |
||||
<el-table-column label="得分" prop="score" /> |
||||
<el-table-column label="答题结果" prop="isPass"> |
||||
<template #default="{ row }"> |
||||
<el-tag v-if="row.isPass" type="success">合格</el-tag> |
||||
<el-tag v-else type="danger">不合格</el-tag> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="操作" width="100"> |
||||
<template #default="{ row }"> |
||||
<el-button type="text" @click="handleView(row)">查看明细</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
|
||||
<pagination |
||||
style="margin-bottom: 0" |
||||
v-show="total > 0" |
||||
:total="total" |
||||
v-model:page="searchForm.pageNo" |
||||
v-model:limit="searchForm.pageSize" |
||||
@pagination="getList" |
||||
/> |
||||
|
||||
<Dialog v-model="dialogVisible" title="考试详情" width="80%"> |
||||
<el-table :data="testDetailList" border stripe max-height="calc(100vh - 180px)"> |
||||
<el-table-column type="index" width="55" align="center" /> |
||||
<el-table-column label="题目" prop="question" /> |
||||
<el-table-column label="图片" width="120"> |
||||
<template #default="{ row }"> |
||||
<img v-if="row.imageUrl" :src="row.imageUrl" width="100" height="100" /> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="选项"> |
||||
<template #default="{ row }"> |
||||
<div v-for="(item, index) in optionArr" :key="index"> |
||||
<span v-if="row['choose' + item]">{{ item }}. {{ row['choose' + item] }}</span> |
||||
</div> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="正确答案" prop="trueAnswer" width="85" /> |
||||
<el-table-column label="答题选择" prop="answer" width="85" /> |
||||
<el-table-column label="答题结果" prop="answerResult" width="100"> |
||||
<template #default="{ row }"> |
||||
<el-tag v-if="!row.answerResult" type="info">未答</el-tag> |
||||
<el-tag v-else-if="row.answerResult == 2" type="danger">答错</el-tag> |
||||
<el-tag v-else type="success">答对</el-tag> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
</Dialog> |
||||
</div> |
||||
</template> |
||||
|
||||
<script setup> |
||||
import { searchExamRecords, searchExamDetail } from '@/api/uav/record' |
||||
|
||||
const searchForm = ref({ |
||||
userName: '', |
||||
pageNo: 1, |
||||
pageSize: 50 |
||||
}) |
||||
|
||||
const loading = ref(false) |
||||
const total = ref(0) |
||||
const tableList = ref([]) |
||||
|
||||
onMounted(() => { |
||||
handleQuery() |
||||
}) |
||||
function getList() { |
||||
loading.value = true |
||||
try { |
||||
searchExamRecords(searchForm.value).then((res) => { |
||||
tableList.value = res.list |
||||
total.value = res.total |
||||
}) |
||||
} finally { |
||||
loading.value = false |
||||
} |
||||
} |
||||
|
||||
function handleQuery() { |
||||
searchForm.value.pageNo = 1 |
||||
getList() |
||||
} |
||||
|
||||
const testDetailList = ref([]) |
||||
const dialogVisible = ref(false) |
||||
const optionArr = ['A', 'B', 'C', 'D', 'E'] |
||||
function handleView(row) { |
||||
try { |
||||
// 跳转到考试记录详情页面 |
||||
searchExamDetail({ testId: row.testId }).then((res) => { |
||||
testDetailList.value = res |
||||
dialogVisible.value = true |
||||
}) |
||||
} finally { |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss" scoped></style> |
@ -1,116 +0,0 @@ |
||||
<template> |
||||
<div> |
||||
<el-form :model="searchForm" inline @submit.prevent> |
||||
<el-form-item> |
||||
<el-input |
||||
v-model="searchForm.userNameOrPhone" |
||||
placeholder="输入学员姓名/手机号" |
||||
clearable |
||||
@keyup.enter="handleQuery" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-input |
||||
v-model="searchForm.question" |
||||
placeholder="输入题目" |
||||
clearable |
||||
@keyup.enter="handleQuery" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-select |
||||
v-model="searchForm.answerResult" |
||||
placeholder="选择答题结果" |
||||
@change="handleQuery" |
||||
style="width: 150px" |
||||
clearable |
||||
> |
||||
<el-option label="答对" :value="1" /> |
||||
<el-option label="答错" :value="2" /> |
||||
</el-select> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-button type="primary" @click="handleQuery">搜 索</el-button> |
||||
</el-form-item> |
||||
</el-form> |
||||
<el-table |
||||
v-loading="loading" |
||||
:data="tableList" |
||||
highlight-current-row |
||||
max-height="calc(100vh - 260px)" |
||||
> |
||||
<el-table-column type="index" width="55" align="center" /> |
||||
<el-table-column label="题目" prop="question" /> |
||||
<el-table-column label="图片" width="120"> |
||||
<template #default="{ row }"> |
||||
<img v-if="row.imageUrl" :src="row.imageUrl" width="100" height="100" /> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="选项"> |
||||
<template #default="{ row }"> |
||||
<div v-for="(item, index) in row.optionList" :key="index"> |
||||
<span>{{ item.op }}. {{ item.opDesc }}</span> |
||||
</div> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="正确答案" prop="trueAnswer" width="80" /> |
||||
<el-table-column label="答题时间" prop="practiceTime" width="110" /> |
||||
<el-table-column label="姓名" prop="userName" width="100" /> |
||||
<el-table-column label="手机号" prop="phone" width="120" /> |
||||
<el-table-column label="答题选择" prop="answer" width="80" /> |
||||
<el-table-column label="答题结果" prop="answerResult" width="100"> |
||||
<template #default="{ row }"> |
||||
<el-tag v-if="row.answerResult == 2" type="danger">答错</el-tag> |
||||
<el-tag v-else type="success">答对</el-tag> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
|
||||
<pagination |
||||
style="margin-bottom: 0" |
||||
v-show="total > 0" |
||||
:total="total" |
||||
v-model:page="searchForm.pageNo" |
||||
v-model:limit="searchForm.pageSize" |
||||
@pagination="getList" |
||||
/> |
||||
</div> |
||||
</template> |
||||
|
||||
<script setup> |
||||
import { searchStudyRecords } from '@/api/uav/record' |
||||
|
||||
const searchForm = ref({ |
||||
userNameOrPhone: '', |
||||
practiceType: 1, |
||||
question: '', |
||||
answerResult: undefined, |
||||
pageNo: 1, |
||||
pageSize: 50 |
||||
}) |
||||
|
||||
const loading = ref(false) |
||||
const total = ref(0) |
||||
const tableList = ref([]) |
||||
|
||||
onMounted(() => { |
||||
handleQuery() |
||||
}) |
||||
async function getList() { |
||||
loading.value = true |
||||
try { |
||||
const resp = await searchStudyRecords(searchForm.value) |
||||
tableList.value = resp.list || [] |
||||
total.value = resp.total || 0 |
||||
} finally { |
||||
loading.value = false |
||||
} |
||||
} |
||||
|
||||
function handleQuery() { |
||||
searchForm.value.pageNo = 1 |
||||
getList() |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss" scoped></style> |
@ -1,7 +0,0 @@ |
||||
<template> |
||||
<div>收藏</div> |
||||
</template> |
||||
|
||||
<script setup></script> |
||||
|
||||
<style lang="scss" scoped></style> |
@ -1,58 +0,0 @@ |
||||
<template> |
||||
<div> |
||||
<el-tabs v-model="tabIndex"> |
||||
<el-tab-pane v-for="item in panes" :key="item.name" :label="item.label" :name="item.name"> |
||||
<component :is="item.component" /> |
||||
</el-tab-pane> |
||||
</el-tabs> |
||||
</div> |
||||
</template> |
||||
|
||||
<script setup name="StudyRecord"> |
||||
import Practice from './components/Practice.vue' |
||||
import Exam from './components/Exam.vue' |
||||
import Wrong from './components/Wrong.vue' |
||||
import Collect from './components/Collect.vue' |
||||
import { checkPermi } from '@/utils/permission' |
||||
|
||||
const tabIndex = ref('') |
||||
const panes = ref([]) |
||||
|
||||
onMounted(() => { |
||||
panes.value = [] |
||||
const arr = [ |
||||
{ |
||||
label: '做题记录', |
||||
name: 'practice', |
||||
permi: 'UAVClue:StudyRecord:practice', |
||||
component: markRaw(Practice) |
||||
}, |
||||
{ |
||||
label: '模考记录', |
||||
name: 'exam', |
||||
permi: 'UAVClue:StudyRecord:exam', |
||||
component: markRaw(Exam) |
||||
}, |
||||
{ |
||||
label: '错题记录', |
||||
name: 'wrong', |
||||
permi: 'UAVClue:StudyRecord:wrong', |
||||
component: markRaw(Wrong) |
||||
}, |
||||
{ |
||||
label: '收藏记录', |
||||
name: 'collect', |
||||
permi: 'UAVClue:StudyRecord:collect', |
||||
component: markRaw(Collect) |
||||
} |
||||
] |
||||
arr.map((item) => { |
||||
if (checkPermi([item.permi])) { |
||||
panes.value.push(item) |
||||
} |
||||
}) |
||||
tabIndex.value = panes.value[0].name |
||||
}) |
||||
</script> |
||||
|
||||
<style lang="scss" scoped></style> |
Loading…
Reference in new issue