Compare commits
6 Commits
main
...
0382424440
| Author | SHA1 | Date | |
|---|---|---|---|
| 0382424440 | |||
| 7e04aface2 | |||
| 4d9aebc9e3 | |||
| 996288c808 | |||
| 29cf5bbeaf | |||
| 64c0728c34 |
@@ -4,9 +4,10 @@ VITE_NODE_ENV=development
|
||||
VITE_DEV=true
|
||||
|
||||
# 请求路径
|
||||
# VITE_BASE_URL='http://localhost:48080'
|
||||
VITE_BASE_URL='http://localhost:48080'
|
||||
|
||||
VITE_BASE_URL='http://47.98.161.246:48080'
|
||||
# VITE_BASE_URL='http://114.55.169.15:48080'
|
||||
# VITE_BASE_URL='http://114.215.207.150:48080'
|
||||
|
||||
# 上传路径
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
"@vueuse/core": "^10.1.2",
|
||||
"@wangeditor/editor": "^5.1.23",
|
||||
"@wangeditor/editor-for-vue": "^5.1.10",
|
||||
"@wangeditor/plugin-upload-attachment": "^1.1.0",
|
||||
"@zxcvbn-ts/core": "^3.0.1",
|
||||
"animate.css": "^4.1.1",
|
||||
"axios": "^1.4.0",
|
||||
@@ -54,7 +53,6 @@
|
||||
"echarts-wordcloud": "^2.1.0",
|
||||
"element-plus": "2.9.4",
|
||||
"fast-xml-parser": "^4.2.2",
|
||||
"file-saver": "^2.0.5",
|
||||
"highlight.js": "^11.8.0",
|
||||
"intro.js": "^7.0.1",
|
||||
"jsencrypt": "^3.3.2",
|
||||
@@ -67,7 +65,7 @@
|
||||
"qs": "^6.11.2",
|
||||
"steady-xml": "^0.1.0",
|
||||
"url": "^0.11.0",
|
||||
"video.js": "^7.0.0",
|
||||
"video.js": "^8.3.0",
|
||||
"vue": "3.3.4",
|
||||
"vue-amap": "^0.5.10",
|
||||
"vue-dompurify-html": "^5.0.1",
|
||||
@@ -78,7 +76,6 @@
|
||||
"vuedraggable": "^4.1.0",
|
||||
"web-storage-cache": "^1.1.1",
|
||||
"xe-utils": "^3.5.7",
|
||||
"xlsx": "^0.18.5",
|
||||
"xml-js": "^1.6.11"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -114,7 +111,7 @@
|
||||
"prettier": "^2.8.8",
|
||||
"rimraf": "^5.0.1",
|
||||
"rollup": "^3.22.0",
|
||||
"sass": "^1.75.0",
|
||||
"sass": "^1.62.1",
|
||||
"stylelint": "^15.6.2",
|
||||
"stylelint-config-html": "^1.1.0",
|
||||
"stylelint-config-recommended": "^12.0.0",
|
||||
|
||||
@@ -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
|
||||
})
|
||||
}
|
||||
@@ -46,17 +46,3 @@ export const getMjList = async (params) => {
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
export const getDuplicateQuesionList = async (params) => {
|
||||
return await request.get({
|
||||
url: `admin-api/applet/xunjia/question/duplicate/list`,
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export const deleteDuplicateQuestion = async (data) => {
|
||||
return await request.delete({
|
||||
url: `admin-api/applet/xunjia/question/duplicate/delete`,
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
@@ -42,11 +42,7 @@ const props = defineProps({
|
||||
'undo', // 撤销
|
||||
'redo', // 重做
|
||||
'fullScreen'
|
||||
],
|
||||
insertKeys: {
|
||||
index: 20, // 自定义插入的位置
|
||||
keys: ['uploadAttachment'] // “上传附件”菜单
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -108,12 +104,6 @@ const editorConfig = computed((): IEditorConfig => {
|
||||
},
|
||||
autoFocus: false,
|
||||
scroll: true,
|
||||
// 在编辑器中,点击选中“附件”节点时,要弹出的菜单
|
||||
hoverbarKeys: {
|
||||
attachment: {
|
||||
menuKeys: ['downloadAttachment'] // “下载附件”菜单
|
||||
}
|
||||
},
|
||||
MENU_CONF: {
|
||||
['uploadImage']: {
|
||||
server: import.meta.env.VITE_UPLOAD_URL,
|
||||
@@ -228,52 +218,6 @@ const editorConfig = computed((): IEditorConfig => {
|
||||
customInsert(res: any, insertFn: InsertFnType) {
|
||||
insertFn(res.data, 'video', res.data)
|
||||
}
|
||||
},
|
||||
uploadAttachment: {
|
||||
server: import.meta.env.VITE_UPLOAD_URL,
|
||||
timeout: 20 * 1000, // 2s
|
||||
|
||||
fieldName: 'file',
|
||||
// meta: { token: 'xxx', a: 100 }, // 请求时附加的数据
|
||||
// metaWithUrl: true, // meta 拼接到 url 上
|
||||
// headers: { Accept: 'text/x-json' },
|
||||
// 自定义增加 http header
|
||||
headers: {
|
||||
Accept: '*',
|
||||
Authorization: 'Bearer ' + getAccessToken(),
|
||||
'tenant-id': getTenantId(),
|
||||
'instance-id': getAppId()
|
||||
},
|
||||
|
||||
maxFileSize: 20 * 1024 * 1024, // 20M
|
||||
|
||||
onBeforeUpload(file: File) {
|
||||
console.log('onBeforeUpload', file)
|
||||
return file // 上传 file 文件
|
||||
// return false // 会阻止上传
|
||||
},
|
||||
onProgress(progress: number) {
|
||||
console.log('onProgress', progress)
|
||||
},
|
||||
onSuccess(file: File, res: any) {
|
||||
console.log('onSuccess', file, res)
|
||||
},
|
||||
onFailed(file: File, res: any) {
|
||||
alert(res.message)
|
||||
console.log('onFailed', file, res)
|
||||
},
|
||||
onError(file: File, err: Error, res: any) {
|
||||
alert(err.message)
|
||||
console.error('onError', file, err, res)
|
||||
},
|
||||
// 上传成功后,用户自定义插入文件
|
||||
customInsert(res: any, file: File, insertFn: Function) {
|
||||
console.log('customInsert', res)
|
||||
|
||||
// 插入附件到编辑器
|
||||
insertFn(file.name, res.data)
|
||||
// insertFn(res.data, `customInsert-${file.name}`, res.data)
|
||||
}
|
||||
}
|
||||
},
|
||||
uploadImgShowBase64: true
|
||||
|
||||
@@ -218,7 +218,7 @@ service.interceptors.response.use(
|
||||
resetRouter() // 重置静态路由表
|
||||
cache.local.clear()
|
||||
removeToken()
|
||||
window.location.href = `/tiku/login?tenantId=${tenantId}&appId=${appId}`
|
||||
window.location.href = `/login?tenantId=${tenantId}&appId=${appId}`
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -266,7 +266,7 @@ const handleAuthorized = () => {
|
||||
isRelogin.show = false
|
||||
// 干掉token后再走一次路由让它过router.beforeEach的校验
|
||||
// window.location.href = window.location.href
|
||||
window.location.href = `/tiku/login?tenantId=${tenantId}&appId=${appId}`
|
||||
window.location.href = `/login?tenantId=${tenantId}&appId=${appId}`
|
||||
})
|
||||
}
|
||||
return Promise.reject(t('sys.api.timeoutMessage'))
|
||||
|
||||
@@ -42,14 +42,8 @@ import '@/plugins/tongji' // 百度统计
|
||||
import Logger from '@/utils/Logger'
|
||||
import VueDOMPurifyHTML from 'vue-dompurify-html'
|
||||
|
||||
import { Boot } from '@wangeditor/editor'
|
||||
import attachmentModule from '@wangeditor/plugin-upload-attachment'
|
||||
|
||||
// 创建实例
|
||||
const setupAll = async () => {
|
||||
// 注册。要在创建编辑器之前注册,且只能注册一次,不可重复注册。
|
||||
Boot.registerModule(attachmentModule)
|
||||
|
||||
const app = createApp(App)
|
||||
|
||||
await setupI18n(app)
|
||||
|
||||
@@ -103,15 +103,6 @@ const remainingRouter: AppRouteRecordRaw[] = [
|
||||
icon: 'ep:user',
|
||||
title: t('common.profile')
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/gdsChapter',
|
||||
component: () => import('@/views/GDS/course/chapter.vue'),
|
||||
name: 'GdsChapter',
|
||||
meta: {
|
||||
hidden: true,
|
||||
noTagsView: true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -1,17 +1,35 @@
|
||||
<template>
|
||||
<Dialog v-model="dialogVisible" :title="dialogTitle">
|
||||
<el-form v-loading="formLoading" :model="formData" label-width="80px">
|
||||
<el-form-item label="名称" prop="configName">
|
||||
<el-input v-model="formData.configName" disabled />
|
||||
<el-form
|
||||
ref="formRef"
|
||||
v-loading="formLoading"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="80px"
|
||||
>
|
||||
<el-form-item label="字典名称" prop="name">
|
||||
<el-input v-model="formData.name" placeholder="请输入字典名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="值" prop="configValue">
|
||||
<el-input v-model="formData.configValue" />
|
||||
<el-form-item label="字典类型" prop="type">
|
||||
<el-input
|
||||
v-model="formData.type"
|
||||
:disabled="typeof formData.id !== 'undefined'"
|
||||
placeholder="请输入参数名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="json" prop="configJson">
|
||||
<el-input v-model="formData.configJson" type="textarea" />
|
||||
<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="configDesc">
|
||||
<el-input v-model="formData.configDesc" placeholder="请输入内容" type="textarea" />
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" placeholder="请输入内容" type="textarea" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
@@ -20,8 +38,10 @@
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
<script name="SystemDictTypeForm" setup>
|
||||
import { updateConfig } from '@/api/system/dict/config'
|
||||
<script lang="ts" name="SystemDictTypeForm" setup>
|
||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||
import * as DictTypeApi from '@/api/system/dict/dict.type'
|
||||
import { CommonStatusEnum } from '@/utils/constants'
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
@@ -29,33 +49,57 @@ const message = useMessage() // 消息弹窗
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formData = ref({})
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formData = ref({
|
||||
id: undefined,
|
||||
name: '',
|
||||
type: '',
|
||||
status: CommonStatusEnum.ENABLE,
|
||||
remark: ''
|
||||
})
|
||||
const formRules = reactive({
|
||||
name: [{ required: true, message: '字典名称不能为空', trigger: 'blur' }],
|
||||
type: [{ required: true, message: '字典类型不能为空', trigger: 'blur' }],
|
||||
status: [{ required: true, message: '状态不能为空', trigger: 'change' }]
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (val) => {
|
||||
const open = async (type: string, id?: number) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = '修改配置项'
|
||||
dialogTitle.value = t('action.' + type)
|
||||
formType.value = type
|
||||
resetForm()
|
||||
// 修改时,设置数据
|
||||
formData.value = { ...val }
|
||||
if (id) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value = await DictTypeApi.getDictType(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 params = {
|
||||
driverTypeId: formData.value.driverTypeId,
|
||||
configKey: formData.value.configKey,
|
||||
configValue: formData.value.configValue,
|
||||
configJson: formData.value.configJson,
|
||||
configName: formData.value.configName,
|
||||
configDesc: formData.value.configDesc
|
||||
}
|
||||
await updateConfig(params)
|
||||
const data = formData.value as DictTypeApi.DictTypeVO
|
||||
if (formType.value === 'create') {
|
||||
await DictTypeApi.createDictType(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await DictTypeApi.updateDictType(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
@@ -63,4 +107,16 @@ const submitForm = async () => {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
id: undefined,
|
||||
type: '',
|
||||
name: '',
|
||||
status: CommonStatusEnum.ENABLE,
|
||||
remark: ''
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
</script>
|
||||
|
||||
181
src/views/Basic/Dict/data/DictDataForm.vue
Normal file
181
src/views/Basic/Dict/data/DictDataForm.vue
Normal file
@@ -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>
|
||||
207
src/views/Basic/Dict/data/index.vue
Normal file
207
src/views/Basic/Dict/data/index.vue
Normal file
@@ -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,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- 搜索工作栏 -->
|
||||
<ContentWrap>
|
||||
<el-form
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
@@ -8,31 +8,122 @@
|
||||
class="-mb-15px"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="编码" prop="configKey">
|
||||
<el-form-item label="字典名称" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.configKey"
|
||||
v-model="queryParams.name"
|
||||
class="!w-240px"
|
||||
clearable
|
||||
placeholder="请输入"
|
||||
placeholder="请输入字典名称"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="字典类型" prop="type">
|
||||
<el-input
|
||||
v-model="queryParams.type"
|
||||
class="!w-240px"
|
||||
clearable
|
||||
placeholder="请输入字典类型"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select
|
||||
v-model="queryParams.status"
|
||||
class="!w-240px"
|
||||
clearable
|
||||
placeholder="请选择字典状态"
|
||||
>
|
||||
<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 label="创建时间" prop="createTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.createTime"
|
||||
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||
class="!w-240px"
|
||||
end-placeholder="结束日期"
|
||||
start-placeholder="开始日期"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery"> 搜索 </el-button>
|
||||
<el-button @click="handleQuery">
|
||||
<Icon class="mr-5px" icon="ep:search" />
|
||||
搜索
|
||||
</el-button>
|
||||
<el-button @click="resetQuery">
|
||||
<Icon class="mr-5px" icon="ep:refresh" />
|
||||
重置
|
||||
</el-button>
|
||||
<el-button
|
||||
v-hasPermi="['system:dict:create']"
|
||||
plain
|
||||
type="primary"
|
||||
@click="openForm('create')"
|
||||
>
|
||||
<Icon class="mr-5px" icon="ep:plus" />
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
v-hasPermi="['system:dict:export']"
|
||||
:loading="exportLoading"
|
||||
plain
|
||||
type="success"
|
||||
@click="handleExport"
|
||||
>
|
||||
<Icon class="mr-5px" icon="ep:download" />
|
||||
导出
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list">
|
||||
<el-table-column label="编码" prop="configKey" />
|
||||
<el-table-column label="名称" prop="configName" />
|
||||
<el-table-column label="值" prop="configValue" />
|
||||
<el-table-column label="json" prop="configJson" />
|
||||
<el-table-column label="备注" prop="configDesc" />
|
||||
<el-table-column label="创建时间" prop="createTime" width="180" />
|
||||
<el-table-column label="操作" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-button link type="primary" @click="openForm(row)"> 修改 </el-button>
|
||||
<el-table-column align="center" label="字典编号" prop="id" />
|
||||
<el-table-column align="center" label="字典名称" prop="name" show-overflow-tooltip />
|
||||
<el-table-column align="center" label="字典类型" prop="type" width="300" />
|
||||
<el-table-column align="center" label="状态" prop="status">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="备注" prop="remark" />
|
||||
<el-table-column
|
||||
:formatter="dateFormatter"
|
||||
align="center"
|
||||
label="创建时间"
|
||||
prop="createTime"
|
||||
width="180"
|
||||
/>
|
||||
<el-table-column align="center" label="操作">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
v-hasPermi="['system:dict:update']"
|
||||
link
|
||||
type="primary"
|
||||
@click="openForm('update', scope.row.id)"
|
||||
>
|
||||
修改
|
||||
</el-button>
|
||||
<router-link :to="'/dict/type/data/' + scope.row.type">
|
||||
<el-button link type="primary">数据</el-button>
|
||||
</router-link>
|
||||
<el-button
|
||||
v-hasPermi="['system:dict:delete']"
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row.id)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -43,31 +134,41 @@
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<DictTypeForm ref="formRef" @success="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script name="SystemDictType" setup>
|
||||
import { searchConfig } from '@/api/system/dict/config'
|
||||
<script lang="ts" name="SystemDictType" setup>
|
||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import * as DictTypeApi from '@/api/system/dict/dict.type'
|
||||
import DictTypeForm from './DictTypeForm.vue'
|
||||
import download from '@/utils/download'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const total = ref(0) // 列表的总页数
|
||||
const list = ref([]) // 字典表格数据
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 50,
|
||||
configKey: ''
|
||||
pageSize: 10,
|
||||
name: '',
|
||||
type: '',
|
||||
status: undefined,
|
||||
createTime: []
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
|
||||
/** 查询字典类型列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await searchConfig(queryParams)
|
||||
const data = await DictTypeApi.getDictTypePage(queryParams)
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
@@ -77,13 +178,48 @@ const getList = async () => {
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value.resetFields()
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
/** 添加/修改操作 */
|
||||
const formRef = ref()
|
||||
const openForm = (val) => {
|
||||
formRef.value.open(val)
|
||||
const openForm = (type: string, id?: number) => {
|
||||
formRef.value.open(type, id)
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (id: number) => {
|
||||
try {
|
||||
// 删除的二次确认
|
||||
await message.delConfirm()
|
||||
// 发起删除
|
||||
await DictTypeApi.deleteDictType(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
// 导出的二次确认
|
||||
await message.exportConfirm()
|
||||
// 发起导出
|
||||
exportLoading.value = true
|
||||
const data = await DictTypeApi.exportDictType(queryParams)
|
||||
download.excel(data, '字典类型.xls')
|
||||
} catch {
|
||||
} finally {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
|
||||
@@ -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,100 +0,0 @@
|
||||
<template>
|
||||
<Dialog v-model="dialogVisible" title="疑似重复题目" width="70%">
|
||||
<el-table v-loading="loading" :data="tableList" highlight-current-row>
|
||||
<el-table-column type="index" width="55" align="center" />
|
||||
<el-table-column prop="questionId" label="ID" width="60" />
|
||||
<el-table-column label="题目" align="left" prop="question" min-width="140" />
|
||||
<el-table-column label="选项" align="left" min-width="120">
|
||||
<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="70" />
|
||||
<el-table-column label="章节" align="center" prop="chapterName" 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="难点分析" align="center" prop="bestAnswer" min-width="200">
|
||||
<template #default="{ row }">
|
||||
<div v-dompurify-html="row.bestAnswer"></div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="答题技巧" align="center" prop="skillInfo" min-width="100">
|
||||
<template #default="{ row }">
|
||||
<div v-if="row.skillInfo" v-dompurify-html="row.skillInfo"></div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="文盲技巧" align="center" prop="illiteracyAnswer" min-width="100" />
|
||||
<el-table-column label="题目来源" prop="oldSource" width="100" />
|
||||
|
||||
<el-table-column label="操作" align="center" width="140">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" link @click="handleDelete(scope.row)"> 删除 </el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getDuplicateQuesionList, deleteQuestion } from '@/api/xjapplet/xjdatabase'
|
||||
|
||||
const message = useMessage()
|
||||
const dialogVisible = ref(false)
|
||||
|
||||
const tableList = ref([])
|
||||
const loading = ref(false)
|
||||
function open(row) {
|
||||
dialogVisible.value = true
|
||||
getList(row)
|
||||
}
|
||||
defineExpose({ open })
|
||||
|
||||
function getList(row) {
|
||||
loading.value = true
|
||||
// 调接口获取数据
|
||||
getDuplicateQuesionList({
|
||||
questionId: row.questionId,
|
||||
carTypeId: row.carTypeId,
|
||||
subject: row.subject,
|
||||
source: row.source
|
||||
})
|
||||
.then((response) => {
|
||||
tableList.value = response
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
function getShowImg(row) {
|
||||
return row.imageUrl.includes('http')
|
||||
? row.imageUrl
|
||||
: `https://ss-cloud.ahduima.com/xjxc/pic/${row.imageUrl}`
|
||||
}
|
||||
|
||||
const emits = defineEmits(['update'])
|
||||
const handleDelete = (row) => {
|
||||
message.confirm('是否确认删除该题目?').then(() => {
|
||||
deleteQuestion(row.questionId, row.source).then(() => {
|
||||
message.success('删除成功')
|
||||
tableList.value = tableList.value.filter((item) => item.questionId !== row.questionId)
|
||||
emits('update')
|
||||
})
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -41,9 +41,9 @@
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="专项" prop="category">
|
||||
<el-form-item label="专项" prop="categoryTitle">
|
||||
<el-input
|
||||
v-model="dialogForm.category"
|
||||
v-model="dialogForm.categoryTitle"
|
||||
maxlength="1000"
|
||||
placeholder="请输入"
|
||||
clearable
|
||||
@@ -97,16 +97,6 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="A关键字" prop="awords">
|
||||
<el-input
|
||||
v-model="dialogForm.awords"
|
||||
maxlength="200"
|
||||
placeholder="请输入"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="选项B" prop="chooseB">
|
||||
<el-input
|
||||
@@ -117,16 +107,8 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="B关键字" prop="bwords">
|
||||
<el-input
|
||||
v-model="dialogForm.bwords"
|
||||
maxlength="200"
|
||||
placeholder="请输入"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="选项C" prop="chooseC">
|
||||
<el-input
|
||||
@@ -137,16 +119,6 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="C关键字" prop="cwords">
|
||||
<el-input
|
||||
v-model="dialogForm.cwords"
|
||||
maxlength="200"
|
||||
placeholder="请输入"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="选项D" prop="chooseD">
|
||||
<el-input
|
||||
@@ -157,19 +129,9 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="D关键字" prop="dwords">
|
||||
<el-input
|
||||
v-model="dialogForm.dwords"
|
||||
maxlength="200"
|
||||
placeholder="请输入"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="答案" prop="trueAnswer">
|
||||
<el-input
|
||||
v-model="dialogForm.trueAnswer"
|
||||
@@ -179,11 +141,6 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="标签" prop="tags">
|
||||
<el-input v-model="dialogForm.tags" maxlength="200" placeholder="请输入" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
@@ -209,6 +166,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="技巧关键字" prop="skillWords">
|
||||
@@ -223,34 +181,19 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="文盲技巧" prop="illiteracyAnswer">
|
||||
<el-input
|
||||
v-model="dialogForm.illiteracyAnswer"
|
||||
maxlength="1000"
|
||||
placeholder="请输入"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="车型" prop="carTypeId">
|
||||
<span v-if="dialogForm.carTypeId == '1001'">小车</span>
|
||||
<span v-if="dialogForm.carTypeId == '1002'">摩托车</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="科目" prop="subject">
|
||||
<span v-if="dialogForm.subject == '1'">科一</span>
|
||||
<span v-if="dialogForm.subject == '4'">科四</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="错误率" prop="cuowulv">
|
||||
<el-input v-model="dialogForm.cuoWuLv" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-form-item label="题目图片" prop="imageUrl">
|
||||
@@ -263,13 +206,7 @@
|
||||
:show-file-list="false"
|
||||
>
|
||||
<img v-if="imgUrl" :src="imgUrl" style="width: 200px" />
|
||||
<div
|
||||
v-else
|
||||
class="flex items-center justify-center"
|
||||
style="width: 100px; height: 100px; border: 1px dashed #d9d9d9"
|
||||
>
|
||||
<Icon icon="ep:plus" :size="20" />
|
||||
</div>
|
||||
<i v-else class="el-icon-plus"></i>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
@@ -300,10 +237,9 @@ const chapterOptions = ref([])
|
||||
const dialogForm = ref({
|
||||
id: undefined,
|
||||
showOrder: 0,
|
||||
category: undefined,
|
||||
categoryTitle: undefined,
|
||||
question: undefined,
|
||||
bestAnswer: undefined,
|
||||
chapter: undefined,
|
||||
chooseA: undefined,
|
||||
chooseB: undefined,
|
||||
chooseC: undefined,
|
||||
@@ -313,11 +249,7 @@ const dialogForm = ref({
|
||||
trueAnswer: undefined,
|
||||
carTypeId: undefined,
|
||||
skillInfoPic: undefined,
|
||||
source: undefined,
|
||||
illiteracyAnswer: undefined,
|
||||
skillInfo: undefined,
|
||||
skillWords: undefined,
|
||||
cuoWuLv: undefined
|
||||
source: undefined
|
||||
})
|
||||
|
||||
const dataRule = {
|
||||
@@ -332,12 +264,10 @@ const open = (info = undefined, opts) => {
|
||||
if (info) {
|
||||
dialogForm.value = { ...info, chapter: parseInt(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
|
||||
imgUrl.value = dialogForm.value.imageUrl.includes('http') ? dialogForm.value.imageUrl : 'https://ss-cloud.ahduima.com/xjxc/pic/' + dialogForm.value.imageUrl
|
||||
}
|
||||
}
|
||||
dialogForm.value.source = info.source
|
||||
info.source = info.source
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
@@ -350,7 +280,6 @@ const resetDialogForm = () => {
|
||||
showOrder: 0,
|
||||
question: undefined,
|
||||
bestAnswer: undefined,
|
||||
chapter: undefined,
|
||||
chooseA: undefined,
|
||||
chooseB: undefined,
|
||||
chooseC: undefined,
|
||||
@@ -370,9 +299,7 @@ const resetDialogForm = () => {
|
||||
optcWords: undefined,
|
||||
optdWords: undefined,
|
||||
carTypeId: undefined,
|
||||
source: undefined,
|
||||
illiteracyAnswer: undefined,
|
||||
cuoWuLv: undefined
|
||||
source: undefined
|
||||
}
|
||||
}
|
||||
const dialogFormRef = ref(null)
|
||||
|
||||
@@ -7,77 +7,35 @@
|
||||
:label="item.label"
|
||||
:name="item.key"
|
||||
>
|
||||
<el-form :inline="true" label-width="0" @submit.prevent>
|
||||
<el-row>
|
||||
<el-form-item>
|
||||
<el-select
|
||||
v-model="queryParams.carTypeId"
|
||||
placeholder="选择车型"
|
||||
filterable
|
||||
style="width: 120px"
|
||||
@change="getQuestionChapter"
|
||||
>
|
||||
<el-option label="小车" value="1001" />
|
||||
<el-option label="摩托车" value="1002" />
|
||||
<el-option label="货车" value="1003" />
|
||||
<el-option label="客车" value="1004" />
|
||||
</el-select>
|
||||
<el-form :inline="true" label-width="68px" @submit.prevent>
|
||||
<el-row :gutter="20">
|
||||
<el-form-item label="车型">
|
||||
<el-radio-group v-model="queryParams.carTypeId" @change="getQuestionChapter">
|
||||
<el-radio label="1001" value="1001">小车</el-radio>
|
||||
<el-radio label="1002" value="1002">摩托车</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select
|
||||
v-model="queryParams.subject"
|
||||
placeholder="选择科目"
|
||||
filterable
|
||||
style="width: 120px"
|
||||
@change="getQuestionChapter"
|
||||
>
|
||||
<el-option label="科一" value="1" />
|
||||
<el-option label="科四" value="4" />
|
||||
</el-select>
|
||||
<el-form-item label="科目">
|
||||
<el-radio-group v-model="queryParams.subject" @change="getQuestionChapter">
|
||||
<el-radio label="1" value="1">科一</el-radio>
|
||||
<el-radio label="4" value="4">科四</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select
|
||||
v-model="queryParams.chapter"
|
||||
placeholder="选择章节"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 180px"
|
||||
>
|
||||
<el-option
|
||||
v-for="chapter in chapterOptions"
|
||||
:key="chapter.chapterId"
|
||||
:label="chapter.chapterName"
|
||||
:value="chapter.chapterId"
|
||||
/>
|
||||
</el-select>
|
||||
|
||||
<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>
|
||||
<el-select
|
||||
v-model="queryParams.isPic"
|
||||
placeholder="是否有图片"
|
||||
filterable
|
||||
clearable
|
||||
style="width: 140px"
|
||||
>
|
||||
<el-option label="有图片" :value="true" />
|
||||
<el-option label="无图片" :value="false" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-form-item label="题目">
|
||||
<el-input
|
||||
v-model="queryParams.question"
|
||||
placeholder="请输入题目"
|
||||
clearable
|
||||
style="width: 300px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input
|
||||
v-model="queryParams.keyword"
|
||||
placeholder="请输入选项/技巧/解析"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
style="width: 400px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
@@ -89,9 +47,6 @@
|
||||
>
|
||||
搜索
|
||||
</el-button>
|
||||
<el-button @click="handleReset" v-hasPermi="['question:database:search']">
|
||||
重置
|
||||
</el-button>
|
||||
<el-button type="primary" @click="handleAdd" v-hasPermi="['question:database:add']">
|
||||
新增
|
||||
</el-button>
|
||||
@@ -103,12 +58,11 @@
|
||||
v-loading="loading"
|
||||
:data="tableList"
|
||||
highlight-current-row
|
||||
max-height="calc(100vh - 270px)"
|
||||
max-height="calc(100vh - 260px)"
|
||||
>
|
||||
<el-table-column type="index" width="55" align="center" />
|
||||
<el-table-column prop="questionId" label="ID" width="60" />
|
||||
<el-table-column label="题目" align="left" prop="question" min-width="140" />
|
||||
<el-table-column label="选项" align="left" min-width="100">
|
||||
<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>
|
||||
@@ -116,8 +70,14 @@
|
||||
<p v-if="row.chooseD">D:{{ row.chooseD }}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="答案" align="center" prop="trueAnswer" width="70" />
|
||||
<el-table-column label="章节" align="center" prop="chapterName" width="100" />
|
||||
<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
|
||||
@@ -125,50 +85,15 @@
|
||||
:src="getShowImg(row)"
|
||||
:preview-src-list="[getShowImg(row)]"
|
||||
:lazy="true"
|
||||
style="width: 90px"
|
||||
style="width: 80px"
|
||||
preview-teleported
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="难点分析" align="center" prop="bestAnswer" min-width="200">
|
||||
<el-table-column label="状态" width="100">
|
||||
<template #default="{ row }">
|
||||
<div v-dompurify-html="row.bestAnswer"></div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="答题技巧" align="center" prop="skillInfo" min-width="100">
|
||||
<template #default="{ row }">
|
||||
<div v-if="row.skillInfo" v-dompurify-html="row.skillInfo"></div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="文盲技巧"
|
||||
align="center"
|
||||
prop="illiteracyAnswer"
|
||||
min-width="100"
|
||||
/>
|
||||
<el-table-column label="错误率" align="center" prop="cuoWuLv" width="100" />
|
||||
<el-table-column
|
||||
label="题目来源"
|
||||
v-if="queryParams.source == 'XJ'"
|
||||
prop="oldSource"
|
||||
width="80"
|
||||
/>
|
||||
<el-table-column
|
||||
label="疑似重复"
|
||||
v-if="queryParams.source == 'XJ'"
|
||||
prop="duplicateNum"
|
||||
width="80"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
type="primary"
|
||||
v-if="row.duplicateNum && row.duplicateNum > 0"
|
||||
link
|
||||
@click="showDuplicate(row)"
|
||||
>{{ row.duplicateNum }}</el-button
|
||||
>
|
||||
|
||||
<span v-else>无</span>
|
||||
<el-tag v-if="row.isActive == 0" type="success">使用中</el-tag>
|
||||
<el-tag v-else type="danger">已删除</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -185,7 +110,7 @@
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
@click="handleDelete(scope.row)"
|
||||
@click="handleDelete(scope.row.id)"
|
||||
v-hasPermi="['question:database:remove']"
|
||||
>
|
||||
删除
|
||||
@@ -195,7 +120,6 @@
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
style="margin-bottom: 0"
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
@@ -206,49 +130,34 @@
|
||||
</el-tabs>
|
||||
|
||||
<QuestionAddForm ref="dialogAddForm" @update="getList" />
|
||||
<DialogDuplicateQuestion ref="dialogDuplicate" @update="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="XjDatabase">
|
||||
import { searchQuestion, getQuestionSort, deleteQuestion } from '@/api/xjapplet/xjdatabase'
|
||||
import QuestionAddForm from './Components/QuestionAddForm.vue'
|
||||
import DialogDuplicateQuestion from './Components/DialogDuplicateQuestion.vue'
|
||||
|
||||
const message = useMessage()
|
||||
import { searchQuestion, deleteQuestion, getQuestionSort } from '@/api/xjapplet/xjdatabase'
|
||||
import QuestionAddForm from './components/QuestionAddForm.vue'
|
||||
|
||||
const loading = ref(false)
|
||||
const total = ref(0)
|
||||
const tableList = ref([])
|
||||
const queryParams = ref({
|
||||
source: 'XJ',
|
||||
source: '1',
|
||||
question: '',
|
||||
carTypeId: '1001',
|
||||
subject: '1',
|
||||
isPic: undefined,
|
||||
isDuplicate: undefined,
|
||||
keyword: '',
|
||||
chapter: undefined,
|
||||
pageNo: 1,
|
||||
pageSize: 20
|
||||
pageSize: 100
|
||||
})
|
||||
|
||||
const sourceOptions = [
|
||||
{
|
||||
key: 'JKJL',
|
||||
key: '1',
|
||||
label: '驾考精灵'
|
||||
},
|
||||
{
|
||||
key: 'YDT',
|
||||
key: '2',
|
||||
label: '驾校一点通'
|
||||
},
|
||||
{
|
||||
key: 'JKBD',
|
||||
label: '驾考宝典'
|
||||
},
|
||||
{
|
||||
key: 'XJ',
|
||||
label: '寻驾'
|
||||
}
|
||||
]
|
||||
|
||||
@@ -264,30 +173,13 @@ const getQuestionChapter = () => {
|
||||
source: queryParams.value.source
|
||||
}).then((data) => {
|
||||
chapterOptions.value = data
|
||||
queryParams.value.chapter = undefined
|
||||
})
|
||||
}
|
||||
|
||||
function getShowImg(row) {
|
||||
return row.imageUrl.includes('http')
|
||||
? row.imageUrl
|
||||
: `https://ss-cloud.ahduima.com/xjxc/pic/${row.imageUrl}`
|
||||
return row.imageUrl.includes('http') ? row.imageUrl : `https://ss-cloud.ahduima.com/xjxc/pic/${row.imageUrl}`
|
||||
}
|
||||
|
||||
function handleReset() {
|
||||
queryParams.value = {
|
||||
...queryParams.value,
|
||||
question: '',
|
||||
carTypeId: '1001',
|
||||
subject: '1',
|
||||
isPic: undefined,
|
||||
keyword: '',
|
||||
chapter: undefined,
|
||||
pageNo: 1,
|
||||
pageSize: 20
|
||||
}
|
||||
getList()
|
||||
}
|
||||
function getList() {
|
||||
loading.value = true
|
||||
searchQuestion(queryParams.value).then((response) => {
|
||||
@@ -320,15 +212,16 @@ function handleAdd() {
|
||||
function handleDelete(row) {
|
||||
message
|
||||
.confirm('是否确认删除该题?')
|
||||
.then(() => {
|
||||
deleteQuestion(row.questionId, row.source).then(() => {
|
||||
.then(function () {
|
||||
deleteQuestion(row.id, row.source).then(() => {
|
||||
getList()
|
||||
})
|
||||
})
|
||||
.then(() => {
|
||||
getQuestionList()
|
||||
message.success('删除题目成功')
|
||||
})
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err)
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
|
||||
function handleChangeSource() {
|
||||
@@ -341,13 +234,7 @@ function handleChangeSource() {
|
||||
}
|
||||
queryParams.value = { ...obj, source: queryParams.value.source }
|
||||
getQuestionChapter()
|
||||
tableList.value = []
|
||||
total.value = 0
|
||||
}
|
||||
|
||||
const dialogDuplicate = ref(null)
|
||||
const showDuplicate = (row) => {
|
||||
dialogDuplicate.value.open({ ...row, subject: queryParams.value.subject })
|
||||
getList()
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -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>
|
||||
</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>
|
||||
<div> 无人机题库 </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>
|
||||
@@ -16,7 +16,7 @@
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div style="display: flex; padding: 10px; border: 1px solid #eee; height: calc(100vh - 220px)">
|
||||
<div style="display: flex; padding: 10px; border: 1px solid #eee; height: calc(100vh - 80px)">
|
||||
<div style="width: 300px; border-right: 1px solid #eee">
|
||||
<div style="display: flex; justify-content: space-between; padding-right: 20px">
|
||||
<div style="font-size: 18px; font-weight: bold">密卷</div>
|
||||
@@ -207,9 +207,7 @@ onMounted(() => {
|
||||
})
|
||||
|
||||
function getShowImg(row) {
|
||||
return row.imageUrl.includes('http')
|
||||
? row.imageUrl
|
||||
: `https://ss-cloud.ahduima.com/xjxc/pic/${row.imageUrl}`
|
||||
return row.imageUrl.includes('http') ? row.imageUrl : `https://ss-cloud.ahduima.com/xjxc/pic/${row.imageUrl}`
|
||||
}
|
||||
|
||||
function addMjItem() {
|
||||
@@ -290,7 +288,7 @@ function takeoutMj(row) {
|
||||
})
|
||||
.then(() => {
|
||||
getQuestionList()
|
||||
message.success('移除题目成功')
|
||||
message.success('清空题目成功')
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
@@ -305,7 +303,7 @@ function getQuestionList() {
|
||||
function sureAddQues(row) {
|
||||
addMjQuestion({
|
||||
secretId: mjList.value[mjIndex.value].secretId,
|
||||
questionId: row.questionId,
|
||||
subId: row.subId,
|
||||
source: queryParams.value.source
|
||||
})
|
||||
.then((resp) => {
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-table v-loading="loading" :data="tableList" height="calc(100vh - 270px)">
|
||||
<el-table v-loading="loading" :data="tableList" height="calc(100vh - 250px)">
|
||||
<el-table-column type="index" width="55" align="center" />
|
||||
<el-table-column label="题目" align="left" prop="question" min-width="140" />
|
||||
<el-table-column label="选项" align="left" min-width="140">
|
||||
@@ -79,7 +79,6 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
style="margin-bottom: 0"
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
@@ -167,9 +166,7 @@ onMounted(() => {
|
||||
})
|
||||
|
||||
function getShowImg(row) {
|
||||
return row.imageUrl.includes('http')
|
||||
? row.imageUrl
|
||||
: `https://ss-cloud.ahduima.com/xjxc/pic/${row.imageUrl}`
|
||||
return row.imageUrl.includes('http') ? row.imageUrl : `https://ss-cloud.ahduima.com/xjxc/pic/${row.imageUrl}`
|
||||
}
|
||||
|
||||
function addMjDetail() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<el-tabs v-model="source" @tab-click="handleChangeSource">
|
||||
<el-tab-pane v-for="item in sourceOptions" :key="item.key" :label="item.label" :name="item.key">
|
||||
<el-tabs v-model="tabIndex" tab-position="left" class="profile-tabs">
|
||||
<el-tabs v-model="tabIndex" tab-position="left" style="height: 400px" class="profile-tabs">
|
||||
<el-tab-pane label="精选题" :name="1" v-if="checkPermi(['question:vip-data:jx'])">
|
||||
<SimpleData v-if="tabIndex == 1" :source="source" />
|
||||
</el-tab-pane>
|
||||
@@ -19,12 +19,10 @@ import SimpleData from './conponents/SimpleData.vue'
|
||||
import SecretData from './conponents/SecretData.vue'
|
||||
|
||||
const tabIndex = ref(1)
|
||||
const source = ref('XJ')
|
||||
const source = ref('1')
|
||||
const sourceOptions = [
|
||||
{ key: 'XJ', label: '寻驾' },
|
||||
{ key: 'JKJL', label: '驾考精灵' },
|
||||
{ key: 'YDT', label: '驾校一点通' },
|
||||
{ key: 'JKBD', label: '驾考宝典' }
|
||||
{ key: '1', label: '驾考精灵' },
|
||||
{ key: '2', label: '驾校一点通' }
|
||||
]
|
||||
const handleChangeSource = () => {}
|
||||
</script>
|
||||
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user