Compare commits
46 Commits
29cf5bbeaf
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0015d4e147 | ||
|
|
ebf551890e | ||
|
|
5f3dd35e61 | ||
|
|
240c5a85a2 | ||
|
|
324ae19115 | ||
|
|
9f09523950 | ||
|
|
d4648e14a2 | ||
|
|
50d7e3dcb5 | ||
|
|
c49711997d | ||
|
|
9b6a0e82dd | ||
|
|
1cda159b44 | ||
|
|
35bdf6881d | ||
|
|
b543dd9c2e | ||
| 87d1d50821 | |||
|
|
6c6538898b | ||
|
|
1ddbf4b6bb | ||
|
|
9e9c7b27b0 | ||
|
|
ff25185517 | ||
|
|
e8632e9054 | ||
|
|
d984ac4e23 | ||
|
|
0058b74ddf | ||
|
|
ef263219ac | ||
|
|
f507214116 | ||
|
|
cd9b974389 | ||
|
|
e449f1a124 | ||
|
|
80b8eddd35 | ||
|
|
6359913c2c | ||
|
|
cff96918ce | ||
|
|
f5b7a77fb0 | ||
|
|
c70b530362 | ||
|
|
ef625e3dc1 | ||
|
|
cdf810507c | ||
|
|
d7c155ba8e | ||
|
|
cbaaec207b | ||
|
|
119aab5e3f | ||
|
|
e40cf44f84 | ||
|
|
1a3bfe93d2 | ||
| 479a0d5580 | |||
| 0632fa2362 | |||
|
|
99ed1be271 | ||
|
|
95a198eab1 | ||
|
|
e65984d2e8 | ||
|
|
6a5e3794e8 | ||
|
|
e25d53c9e6 | ||
|
|
efadee9db0 | ||
|
|
bc781ce292 |
2
.env
2
.env
@@ -5,7 +5,7 @@ VITE_APP_TITLE=刷题后台
|
||||
VITE_NODE_ENV=development
|
||||
|
||||
# 项目本地运行端口号
|
||||
VITE_PORT=8000
|
||||
VITE_PORT=8001
|
||||
|
||||
# open 运行 npm run dev 时自动打开浏览器
|
||||
VITE_OPEN=true
|
||||
|
||||
@@ -4,14 +4,13 @@ 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'
|
||||
|
||||
# 上传路径
|
||||
VITE_UPLOAD_URL='http://47.98.161.246:48080/admin-api/system/file/upload'
|
||||
VITE_UPLOAD_URL='http://47.98.161.246:48080/admin-api/system/file/upload'
|
||||
# VITE_UPLOAD_URL='http://114.55.169.15:48080/admin-api/system/file/upload'
|
||||
|
||||
# 接口前缀
|
||||
|
||||
5
.vscode/settings.json
vendored
Normal file
5
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"i18n-ally.localesPaths": [
|
||||
"src/locales"
|
||||
]
|
||||
}
|
||||
@@ -39,6 +39,7 @@
|
||||
"@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",
|
||||
@@ -53,6 +54,7 @@
|
||||
"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",
|
||||
@@ -65,7 +67,7 @@
|
||||
"qs": "^6.11.2",
|
||||
"steady-xml": "^0.1.0",
|
||||
"url": "^0.11.0",
|
||||
"video.js": "^8.3.0",
|
||||
"video.js": "^7.0.0",
|
||||
"vue": "3.3.4",
|
||||
"vue-amap": "^0.5.10",
|
||||
"vue-dompurify-html": "^5.0.1",
|
||||
@@ -76,6 +78,7 @@
|
||||
"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": {
|
||||
@@ -111,7 +114,7 @@
|
||||
"prettier": "^2.8.8",
|
||||
"rimraf": "^5.0.1",
|
||||
"rollup": "^3.22.0",
|
||||
"sass": "^1.62.1",
|
||||
"sass": "^1.75.0",
|
||||
"stylelint": "^15.6.2",
|
||||
"stylelint-config-html": "^1.1.0",
|
||||
"stylelint-config-recommended": "^12.0.0",
|
||||
|
||||
@@ -30,3 +30,10 @@ export const getCustomerExamCarType = () => {
|
||||
export const importStudent = async (data) => {
|
||||
return await request.upload({ url: '/admin-api/applet/xunjia/user/import', data })
|
||||
}
|
||||
|
||||
export const getAppletUserList = async (params) => {
|
||||
return await request.get({
|
||||
url: '/admin-api/applet/xunjia/user/pageList',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
53
src/api/gds/appletUser.js
Normal file
53
src/api/gds/appletUser.js
Normal file
@@ -0,0 +1,53 @@
|
||||
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
|
||||
})
|
||||
}
|
||||
25
src/api/gds/chapter.js
Normal file
25
src/api/gds/chapter.js
Normal file
@@ -0,0 +1,25 @@
|
||||
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 } })
|
||||
}
|
||||
21
src/api/gds/course.js
Normal file
21
src/api/gds/course.js
Normal file
@@ -0,0 +1,21 @@
|
||||
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 } })
|
||||
}
|
||||
17
src/api/system/dict/config.js
Normal file
17
src/api/system/dict/config.js
Normal file
@@ -0,0 +1,17 @@
|
||||
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
|
||||
})
|
||||
}
|
||||
28
src/api/uav/chapter.js
Normal file
28
src/api/uav/chapter.js
Normal file
@@ -0,0 +1,28 @@
|
||||
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}`
|
||||
})
|
||||
}
|
||||
9
src/api/uav/clue.js
Normal file
9
src/api/uav/clue.js
Normal file
@@ -0,0 +1,9 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 查询线索
|
||||
export const searchClue = async (params) => {
|
||||
return await request.get({
|
||||
url: '/admin-api/applet/wrj/clue/page',
|
||||
params
|
||||
})
|
||||
}
|
||||
51
src/api/uav/question.js
Normal file
51
src/api/uav/question.js
Normal file
@@ -0,0 +1,51 @@
|
||||
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
|
||||
})
|
||||
}
|
||||
32
src/api/uav/record.js
Normal file
32
src/api/uav/record.js
Normal file
@@ -0,0 +1,32 @@
|
||||
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
|
||||
})
|
||||
}
|
||||
61
src/api/uav/regiest.js
Normal file
61
src/api/uav/regiest.js
Normal file
@@ -0,0 +1,61 @@
|
||||
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'
|
||||
})
|
||||
}
|
||||
36
src/api/uav/testRoom.js
Normal file
36
src/api/uav/testRoom.js
Normal file
@@ -0,0 +1,36 @@
|
||||
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
|
||||
})
|
||||
}
|
||||
@@ -30,3 +30,10 @@ export const getResellDetail = async (id) => {
|
||||
url: '/admin-api/applet/xunjia/distribution/' + id
|
||||
})
|
||||
}
|
||||
|
||||
export const getResellSimpleList = async (params) => {
|
||||
return await request.get({
|
||||
url: '/admin-api/applet/xunjia/distribution/simple-list',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ export const updateVipType = async (data) => {
|
||||
|
||||
export const deleteVipType = async (id) => {
|
||||
return await request.delete({
|
||||
url: '/admin-api/applet/xunjia/member/memberId?id=' + id
|
||||
url: '/admin-api/applet/xunjia/member/delete?memberId=' + id
|
||||
})
|
||||
}
|
||||
|
||||
@@ -47,3 +47,10 @@ export const getVipTypeOptions = async (params) => {
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
export const getRechargeRecords = async (params) => {
|
||||
return await request.get({
|
||||
url: '/admin-api/applet/xunjia/pay/list',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
@@ -14,9 +14,9 @@ export const getJxQuestionList = async (params) => {
|
||||
})
|
||||
}
|
||||
|
||||
export const delJxData = async (id) => {
|
||||
export const delJxData = async (id, source) => {
|
||||
return await request.delete({
|
||||
url: `/admin-api/applet/xunjia/question/jx/delete?id=${id}`
|
||||
url: `/admin-api/applet/xunjia/question/jx/delete?id=${id}&source=${source}`
|
||||
})
|
||||
}
|
||||
|
||||
@@ -34,15 +34,15 @@ export const getMjList = async (params) => {
|
||||
})
|
||||
}
|
||||
|
||||
export const delMj = async (secretId) => {
|
||||
export const delMj = async (secretId, source) => {
|
||||
return await request.delete({
|
||||
url: `/admin-api/applet/xunjia/secret/delete?secretId=${secretId}`
|
||||
url: `/admin-api/applet/xunjia/secret/delete?secretId=${secretId}&source=${source}`
|
||||
})
|
||||
}
|
||||
|
||||
export const clearMj = async (secretId) => {
|
||||
export const clearMj = async (secretId, source) => {
|
||||
return await request.delete({
|
||||
url: `/admin-api/applet/xunjia/secret/clear?secretId=${secretId}`
|
||||
url: `/admin-api/applet/xunjia/secret/clear?secretId=${secretId}&source=${source}`
|
||||
})
|
||||
}
|
||||
|
||||
@@ -60,8 +60,8 @@ export const addMjQuestion = async (data) => {
|
||||
})
|
||||
}
|
||||
|
||||
export const delMjQuestion = async (id) => {
|
||||
export const delMjQuestion = async (id, source) => {
|
||||
return await request.delete({
|
||||
url: `/admin-api/applet/xunjia/secret/question/delete?id=${id}`
|
||||
url: `/admin-api/applet/xunjia/secret/question/delete?id=${id}&source=${source}`
|
||||
})
|
||||
}
|
||||
|
||||
@@ -20,9 +20,9 @@ export const addQuestion = async (data) => {
|
||||
})
|
||||
}
|
||||
|
||||
export const deleteQuestion = async (id) => {
|
||||
export const deleteQuestion = async (id, source) => {
|
||||
return await request.delete({
|
||||
url: '/admin-api/applet/xunjia/question/delete?id=' + id
|
||||
url: `/admin-api/applet/xunjia/question/delete?id=${id}&source=${source}`
|
||||
})
|
||||
}
|
||||
|
||||
@@ -46,3 +46,17 @@ 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,7 +42,11 @@ const props = defineProps({
|
||||
'undo', // 撤销
|
||||
'redo', // 重做
|
||||
'fullScreen'
|
||||
]
|
||||
],
|
||||
insertKeys: {
|
||||
index: 20, // 自定义插入的位置
|
||||
keys: ['uploadAttachment'] // “上传附件”菜单
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -104,6 +108,12 @@ const editorConfig = computed((): IEditorConfig => {
|
||||
},
|
||||
autoFocus: false,
|
||||
scroll: true,
|
||||
// 在编辑器中,点击选中“附件”节点时,要弹出的菜单
|
||||
hoverbarKeys: {
|
||||
attachment: {
|
||||
menuKeys: ['downloadAttachment'] // “下载附件”菜单
|
||||
}
|
||||
},
|
||||
MENU_CONF: {
|
||||
['uploadImage']: {
|
||||
server: import.meta.env.VITE_UPLOAD_URL,
|
||||
@@ -218,6 +228,52 @@ 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 = `/login?tenantId=${tenantId}&appId=${appId}`
|
||||
window.location.href = `/tiku/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 = `/login?tenantId=${tenantId}&appId=${appId}`
|
||||
window.location.href = `/tiku/login?tenantId=${tenantId}&appId=${appId}`
|
||||
})
|
||||
}
|
||||
return Promise.reject(t('sys.api.timeoutMessage'))
|
||||
|
||||
@@ -42,8 +42,14 @@ 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)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import router from './router'
|
||||
import { isRelogin } from '@/config/axios/service'
|
||||
import { getAccessToken, removeToken } from '@/utils/auth'
|
||||
import { getAccessToken } from '@/utils/auth'
|
||||
import { useTitle } from '@/hooks/web/useTitle'
|
||||
import { useNProgress } from '@/hooks/web/useNProgress'
|
||||
import { usePageLoading } from '@/hooks/web/usePageLoading'
|
||||
@@ -9,7 +9,6 @@ import { useUserStoreWithOut } from '@/store/modules/user'
|
||||
import { usePermissionStoreWithOut } from '@/store/modules/permission'
|
||||
import { useAppStoreWithOut } from '@/store/modules/app'
|
||||
import { getTenantId, getAppId, setTenantId, setAppId } from '@/utils/auth'
|
||||
import cache from '@/plugins/cache'
|
||||
|
||||
const { start, done } = useNProgress()
|
||||
|
||||
@@ -21,65 +20,65 @@ const whiteList = ['/login', '/social-login', '/auth-redirect', '/bind', '/regis
|
||||
router.beforeEach(async (to, from, next) => {
|
||||
start()
|
||||
loadStart()
|
||||
if (getAppId() && to.query?.appId && getAppId() != to.query?.appId) {
|
||||
removeToken()
|
||||
cache?.local?.delete('appInfo')
|
||||
cache?.local?.delete('roleRouters')
|
||||
cache?.local?.delete('user')
|
||||
cache?.local?.delete('App_ID')
|
||||
next(`/login?tenantId=${to.query?.tenantId}&appId=${to.query?.appId}`)
|
||||
} else {
|
||||
if (getAccessToken()) {
|
||||
if (to.path === '/login') {
|
||||
// next({ path: '/' })
|
||||
if (to.query?.tenantId && to.query?.appId) {
|
||||
setApp(to.query.tenantId, to.query.appId)
|
||||
// setTimeout(() => {
|
||||
// next({ path: '/' })
|
||||
// }, 1500)
|
||||
}
|
||||
next({ path: '/' })
|
||||
} else {
|
||||
// 获取所有字典
|
||||
const dictStore = useDictStoreWithOut()
|
||||
const userStore = useUserStoreWithOut()
|
||||
const permissionStore = usePermissionStoreWithOut()
|
||||
if (!dictStore.getIsSetDict) {
|
||||
await dictStore.setDictMap()
|
||||
}
|
||||
if (!userStore.getIsSetUser) {
|
||||
isRelogin.show = true
|
||||
await userStore.setUserInfoAction()
|
||||
isRelogin.show = false
|
||||
// 后端过滤菜单
|
||||
await permissionStore.generateRoutes()
|
||||
permissionStore.getAddRouters.forEach((route) => {
|
||||
router.addRoute(route) // 动态添加可访问路由表
|
||||
})
|
||||
const redirectPath = from.query.redirect || to.path
|
||||
const redirect = decodeURIComponent(redirectPath)
|
||||
const nextData = to.path === redirect ? { ...to, replace: true } : { path: redirect }
|
||||
next(nextData)
|
||||
} else {
|
||||
next()
|
||||
}
|
||||
const userStore = useUserStoreWithOut()
|
||||
if (to.path == '/login') {
|
||||
userStore.resetState() // 重置用户信息状态
|
||||
}
|
||||
if (getAccessToken()) {
|
||||
if (to.path === '/login') {
|
||||
// next({ path: '/' })
|
||||
if (to.query?.tenantId && to.query?.appId) {
|
||||
setApp(to.query.tenantId, to.query.appId)
|
||||
await waitTime(1500)
|
||||
}
|
||||
next({ path: '/' })
|
||||
} else {
|
||||
if (whiteList.indexOf(to.path) !== -1) {
|
||||
next()
|
||||
// 获取所有字典
|
||||
const dictStore = useDictStoreWithOut()
|
||||
const permissionStore = usePermissionStoreWithOut()
|
||||
if (!dictStore.getIsSetDict) {
|
||||
await dictStore.setDictMap()
|
||||
}
|
||||
if (!userStore.getIsSetUser) {
|
||||
isRelogin.show = true
|
||||
await userStore.setUserInfoAction()
|
||||
isRelogin.show = false
|
||||
// 后端过滤菜单
|
||||
await permissionStore.generateRoutes()
|
||||
permissionStore.getAddRouters.forEach((route) => {
|
||||
router.addRoute(route) // 动态添加可访问路由表
|
||||
})
|
||||
const redirectPath = from.query.redirect || to.path
|
||||
const redirect = decodeURIComponent(redirectPath)
|
||||
const nextData = to.path === redirect ? { ...to, replace: true } : { path: redirect }
|
||||
next(nextData)
|
||||
} else {
|
||||
const tenantId = getTenantId()
|
||||
const appId = getAppId()
|
||||
if (tenantId && appId) {
|
||||
next(`/tiku/login?tenantId=${tenantId}&appId=${appId}&redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||
} else {
|
||||
next(`/tiku/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||
}
|
||||
next()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (whiteList.indexOf(to.path) !== -1) {
|
||||
next()
|
||||
} else {
|
||||
const tenantId = getTenantId()
|
||||
const appId = getAppId()
|
||||
if (tenantId && appId) {
|
||||
next(`/login?tenantId=${tenantId}&appId=${appId}&redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||
} else {
|
||||
next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
async function waitTime(seconds) {
|
||||
return new Promise((resolve) => {
|
||||
setTimeout(() => {
|
||||
resolve()
|
||||
}, seconds)
|
||||
})
|
||||
}
|
||||
|
||||
function setApp(tenantId, appId) {
|
||||
setTenantId(tenantId)
|
||||
|
||||
|
||||
@@ -33,23 +33,23 @@ const { t } = useI18n()
|
||||
}
|
||||
**/
|
||||
const remainingRouter: AppRouteRecordRaw[] = [
|
||||
{
|
||||
path: '/redirect',
|
||||
component: Layout,
|
||||
name: 'Redirect',
|
||||
children: [
|
||||
{
|
||||
path: '/redirect/:path(.*)',
|
||||
name: 'Redirect',
|
||||
component: () => import('@/views/Redirect/Redirect.vue'),
|
||||
meta: {}
|
||||
}
|
||||
],
|
||||
meta: {
|
||||
hidden: true,
|
||||
noTagsView: true
|
||||
}
|
||||
},
|
||||
// {
|
||||
// path: '/redirect',
|
||||
// component: Layout,
|
||||
// name: 'Redirect',
|
||||
// children: [
|
||||
// {
|
||||
// path: '/redirect/:path(.*)',
|
||||
// name: 'Redirect',
|
||||
// component: () => import('@/views/Redirect/Redirect.vue'),
|
||||
// meta: {}
|
||||
// }
|
||||
// ],
|
||||
// meta: {
|
||||
// hidden: true,
|
||||
// noTagsView: true
|
||||
// }
|
||||
// },
|
||||
{
|
||||
path: '/',
|
||||
component: Layout,
|
||||
@@ -72,18 +72,18 @@ const remainingRouter: AppRouteRecordRaw[] = [
|
||||
}
|
||||
]
|
||||
},
|
||||
// {
|
||||
// path: '/swagger',
|
||||
// component: () => import('@/views/Basic/Swagger/index.vue'),
|
||||
// name: 'swagger',
|
||||
// meta: {
|
||||
// title: '接口文档',
|
||||
// noCache: true,
|
||||
// hidden: true,
|
||||
// canTo: true,
|
||||
// icon: ''
|
||||
// }
|
||||
// },
|
||||
{
|
||||
path: '/swagger',
|
||||
component: () => import('@/views/Basic/Swagger/index.vue'),
|
||||
name: 'swagger',
|
||||
meta: {
|
||||
title: '接口文档',
|
||||
noCache: true,
|
||||
hidden: true,
|
||||
canTo: true,
|
||||
icon: ''
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/user',
|
||||
component: Layout,
|
||||
@@ -103,6 +103,15 @@ 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
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -75,6 +75,7 @@ export const useUserStore = defineStore('admin-user', {
|
||||
avatar: '',
|
||||
nickname: ''
|
||||
}
|
||||
cache.local.delete(CACHE_KEY.USER)
|
||||
},
|
||||
refresh() {
|
||||
cache.local.delete(CACHE_KEY.USER)
|
||||
|
||||
@@ -97,4 +97,18 @@
|
||||
/* 去除 Firefox 中的指示器 */
|
||||
.el-input__inner[type='number'] {
|
||||
-moz-appearance: textfield;
|
||||
}
|
||||
|
||||
.flex-radio{
|
||||
display: flex;
|
||||
width: 100%;
|
||||
align-items: center;
|
||||
line-height: 40px;
|
||||
height: 40px;
|
||||
.el-radio__label {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
align-items: center;
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
66
src/views/Basic/Dict/DictTypeForm.vue
Normal file
66
src/views/Basic/Dict/DictTypeForm.vue
Normal file
@@ -0,0 +1,66 @@
|
||||
<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-item>
|
||||
<el-form-item label="值" prop="configValue">
|
||||
<el-input v-model="formData.configValue" />
|
||||
</el-form-item>
|
||||
<el-form-item label="json" prop="configJson">
|
||||
<el-input v-model="formData.configJson" type="textarea" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="configDesc">
|
||||
<el-input v-model="formData.configDesc" 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 name="SystemDictTypeForm" setup>
|
||||
import { updateConfig } from '@/api/system/dict/config'
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formData = ref({})
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (val) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = '修改配置项'
|
||||
// 修改时,设置数据
|
||||
formData.value = { ...val }
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
// 提交请求
|
||||
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)
|
||||
message.success(t('common.updateSuccess'))
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
</script>
|
||||
93
src/views/Basic/Dict/index.vue
Normal file
93
src/views/Basic/Dict/index.vue
Normal file
@@ -0,0 +1,93 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
:model="queryParams"
|
||||
class="-mb-15px"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="编码" prop="configKey">
|
||||
<el-input
|
||||
v-model="queryParams.configKey"
|
||||
class="!w-240px"
|
||||
clearable
|
||||
placeholder="请输入"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery"> 搜索 </el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!-- 列表 -->
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<Pagination
|
||||
v-model:limit="queryParams.pageSize"
|
||||
v-model:page="queryParams.pageNo"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<DictTypeForm ref="formRef" @success="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script name="SystemDictType" setup>
|
||||
import { searchConfig } from '@/api/system/dict/config'
|
||||
import DictTypeForm from './DictTypeForm.vue'
|
||||
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const total = ref(0) // 列表的总页数
|
||||
const list = ref([]) // 字典表格数据
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 50,
|
||||
configKey: ''
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
|
||||
/** 查询字典类型列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await searchConfig(queryParams)
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 添加/修改操作 */
|
||||
const formRef = ref()
|
||||
const openForm = (val) => {
|
||||
formRef.value.open(val)
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
83
src/views/Basic/Role/Comp/RoleEmployee.vue
Normal file
83
src/views/Basic/Role/Comp/RoleEmployee.vue
Normal file
@@ -0,0 +1,83 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-table v-loading="loading" :data="tableList" border>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column
|
||||
v-for="col in columns"
|
||||
:prop="col.prop"
|
||||
:key="col.prop"
|
||||
:label="col.label"
|
||||
:width="col.width"
|
||||
/>
|
||||
<el-table-column label="状态" key="status">
|
||||
<template #default="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.status"
|
||||
:active-value="0"
|
||||
active-text="在职"
|
||||
inactive-text="离职"
|
||||
:inactive-value="1"
|
||||
disabled
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<Pagination
|
||||
v-model:limit="pageSize"
|
||||
v-model:page="currentPage"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="RoleEmployee">
|
||||
import { getRoleUsers } from '@/api/system/role'
|
||||
|
||||
const props = defineProps({
|
||||
roleId: {
|
||||
type: Number
|
||||
}
|
||||
})
|
||||
|
||||
watch(
|
||||
() => props.roleId,
|
||||
(newValue) => {
|
||||
getList(newValue)
|
||||
}
|
||||
)
|
||||
|
||||
const loading = ref(false)
|
||||
const tableList = ref([])
|
||||
const total = ref(0)
|
||||
const pageSize = ref(20)
|
||||
const currentPage = ref(1)
|
||||
|
||||
const columns = ref([
|
||||
{ prop: 'name', label: '姓名', width: '200px' },
|
||||
{ prop: 'mobile', label: '手机号', width: '150px' },
|
||||
{ prop: 'deptName', label: '部门' },
|
||||
{ prop: 'roles', label: '角色' }
|
||||
])
|
||||
|
||||
async function getList() {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await getRoleUsers({
|
||||
pageNo: currentPage.value,
|
||||
pageSize: pageSize.value,
|
||||
id: props.roleId
|
||||
})
|
||||
tableList.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
99
src/views/Basic/Role/RoleAssignMenuForm.vue
Normal file
99
src/views/Basic/Role/RoleAssignMenuForm.vue
Normal file
@@ -0,0 +1,99 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form ref="formRef" v-loading="formLoading" label-width="0px">
|
||||
<el-form-item>
|
||||
<el-tree
|
||||
ref="treeRef"
|
||||
:data="menuOptions"
|
||||
:props="defaultProps"
|
||||
empty-text="加载中,请稍候"
|
||||
node-key="id"
|
||||
show-checkbox
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
:disabled="formLoading"
|
||||
type="primary"
|
||||
@click="submitForm"
|
||||
v-hasPermi="['basic:role:update-menu']"
|
||||
>保存权限</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" name="RoleAssignMenuForm" setup>
|
||||
import { defaultProps, handleTree } from '@/utils/tree'
|
||||
import * as MenuApi from '@/api/system/menu'
|
||||
import * as PermissionApi from '@/api/system/permission'
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const props = defineProps({
|
||||
roleId: {
|
||||
type: Number
|
||||
}
|
||||
})
|
||||
|
||||
watch(
|
||||
() => props.roleId,
|
||||
(newValue) => {
|
||||
getCheckedMenu(newValue)
|
||||
}
|
||||
)
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formRef = ref() // 表单 Ref
|
||||
const menuOptions = ref<any[]>([]) // 菜单树形结构
|
||||
const treeRef = ref() // 菜单树组件 Ref
|
||||
|
||||
/** 提交表单 */
|
||||
const submitForm = async () => {
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = {
|
||||
roleId: props.roleId,
|
||||
menuIds: [
|
||||
...(treeRef.value.getCheckedKeys(false) as unknown as Array<number>), // 获得当前选中节点
|
||||
...(treeRef.value.getHalfCheckedKeys() as unknown as Array<number>) // 获得半选中的父节点
|
||||
]
|
||||
}
|
||||
await PermissionApi.assignRoleMenu(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
dialogVisible.value = false
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const checkedMenuIds = ref([])
|
||||
|
||||
async function init() {
|
||||
menuOptions.value = handleTree(await MenuApi.getSimpleMenusList())
|
||||
getCheckedMenu(props.roleId)
|
||||
}
|
||||
|
||||
async function getCheckedMenu(id) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
checkedMenuIds.value = await PermissionApi.getRoleMenuList(id)
|
||||
treeRef.value.setCheckedKeys([], false)
|
||||
// 设置选中
|
||||
checkedMenuIds.value.forEach((menuId: number) => {
|
||||
treeRef.value.setChecked(menuId, true, false)
|
||||
})
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
init()
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
166
src/views/Basic/Role/RoleDataPermissionForm.vue
Normal file
166
src/views/Basic/Role/RoleDataPermissionForm.vue
Normal file
@@ -0,0 +1,166 @@
|
||||
<template>
|
||||
<el-form ref="formRef" v-loading="formLoading" :model="formData" label-width="80px">
|
||||
<el-form-item label="权限范围">
|
||||
<el-select v-model="formData.dataScope">
|
||||
<el-option
|
||||
v-for="item in dataScopeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="formData.dataScope === SystemDataScopeEnum.DEPT_CUSTOM"
|
||||
label="权限范围"
|
||||
style="display: flex"
|
||||
>
|
||||
<el-card class="card" shadow="never">
|
||||
<template #header>
|
||||
全选/全不选:
|
||||
<el-switch
|
||||
v-model="treeNodeAll"
|
||||
active-text="是"
|
||||
inactive-text="否"
|
||||
inline-prompt
|
||||
@change="handleCheckedTreeNodeAll()"
|
||||
/>
|
||||
全部展开/折叠:
|
||||
<el-switch
|
||||
v-model="deptExpand"
|
||||
active-text="展开"
|
||||
inactive-text="折叠"
|
||||
inline-prompt
|
||||
@change="handleCheckedTreeExpand"
|
||||
/>
|
||||
父子联动(选中父节点,自动选择子节点):
|
||||
<el-switch v-model="checkStrictly" active-text="是" inactive-text="否" inline-prompt />
|
||||
</template>
|
||||
<el-tree
|
||||
ref="treeRef"
|
||||
:check-strictly="!checkStrictly"
|
||||
:data="deptOptions"
|
||||
:props="defaultProps"
|
||||
default-expand-all
|
||||
empty-text="加载中,请稍后"
|
||||
node-key="id"
|
||||
show-checkbox
|
||||
/>
|
||||
</el-card>
|
||||
</el-form-item>
|
||||
<el-form-item label-width="0">
|
||||
<el-button
|
||||
:disabled="formLoading"
|
||||
type="primary"
|
||||
@click="submitForm"
|
||||
v-hasPermi="['basic:role:update-data']"
|
||||
>保存权限</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
<script lang="ts" name="RoleDataPermissionForm" setup>
|
||||
import { defaultProps, handleTree } from '@/utils/tree'
|
||||
import { SystemDataScopeEnum } from '@/utils/constants'
|
||||
|
||||
import * as DeptApi from '@/api/system/dept'
|
||||
import * as PermissionApi from '@/api/system/permission'
|
||||
import * as RoleApi from '@/api/system/role'
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const props = defineProps({
|
||||
roleId: {
|
||||
type: Number
|
||||
}
|
||||
})
|
||||
|
||||
watch(
|
||||
() => props.roleId,
|
||||
(newValue) => {
|
||||
getRoleInfo(newValue)
|
||||
}
|
||||
)
|
||||
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formData = ref({
|
||||
id: 0,
|
||||
name: '',
|
||||
dataScope: undefined,
|
||||
dataScopeDeptIds: []
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
const deptOptions = ref<any[]>([]) // 部门树形结构
|
||||
const deptExpand = ref(false) // 展开/折叠
|
||||
const treeRef = ref() // 菜单树组件 Ref
|
||||
const treeNodeAll = ref(false) // 全选/全不选
|
||||
const checkStrictly = ref(true) // 是否严格模式,即父子不关联
|
||||
|
||||
// const dataScopeOptions = getIntDictOptions(DICT_TYPE.SYSTEM_DATA_SCOPE)
|
||||
const dataScopeOptions = [
|
||||
{ label: '全部数据权限', value: 1 },
|
||||
{ label: '指定部门数据权限', value: 2 },
|
||||
{ label: '部门数据权限', value: 3 },
|
||||
{ label: '部门及以下数据权限', value: 4 },
|
||||
{ label: '仅本人数据权限', value: 5 }
|
||||
]
|
||||
|
||||
async function getRoleInfo(id) {
|
||||
try {
|
||||
formData.value = await RoleApi.getRole(id)
|
||||
nextTick(() => {
|
||||
treeRef.value.setCheckedKeys(formData.value.dataScopeDeptIds)
|
||||
})
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = {
|
||||
roleId: formData.value.id,
|
||||
dataScope: formData.value.dataScope,
|
||||
dataScopeDeptIds:
|
||||
formData.value.dataScope !== SystemDataScopeEnum.DEPT_CUSTOM
|
||||
? []
|
||||
: treeRef.value.getCheckedKeys(false)
|
||||
}
|
||||
await PermissionApi.assignRoleDataScope(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 全选/全不选 */
|
||||
const handleCheckedTreeNodeAll = () => {
|
||||
treeRef.value.setCheckedNodes(treeNodeAll.value ? deptOptions.value : [])
|
||||
}
|
||||
|
||||
/** 展开/折叠全部 */
|
||||
const handleCheckedTreeExpand = () => {
|
||||
const nodes = treeRef.value?.store.nodesMap
|
||||
for (let node in nodes) {
|
||||
if (nodes[node].expanded === deptExpand.value) {
|
||||
continue
|
||||
}
|
||||
nodes[node].expanded = deptExpand.value
|
||||
}
|
||||
}
|
||||
|
||||
async function init() {
|
||||
getRoleInfo(props.roleId)
|
||||
deptOptions.value = handleTree(await DeptApi.getSimpleDeptList())
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
init()
|
||||
})
|
||||
</script>
|
||||
96
src/views/Basic/Role/RoleForm.vue
Normal file
96
src/views/Basic/Role/RoleForm.vue
Normal file
@@ -0,0 +1,96 @@
|
||||
<template>
|
||||
<Dialog v-model="dialogVisible" :title="dialogTitle" width="400px">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
v-loading="formLoading"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="80px"
|
||||
>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24" :offset="0">
|
||||
<el-form-item label="角色名称" prop="name">
|
||||
<el-input v-model="formData.name" placeholder="请输入角色名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</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="SystemRoleForm" setup>
|
||||
// import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||
import * as RoleApi from '@/api/system/role'
|
||||
|
||||
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,
|
||||
name: ''
|
||||
})
|
||||
const formRules = reactive({
|
||||
name: [{ required: true, message: '角色名称不能为空', trigger: 'blur' }]
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type: string, id?: number) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = t('action.' + type)
|
||||
formType.value = type
|
||||
resetForm()
|
||||
// 修改时,设置数据
|
||||
if (id) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value = await RoleApi.getRole(id)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
id: undefined,
|
||||
name: ''
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
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 unknown as RoleApi.RoleVO
|
||||
if (formType.value === 'create') {
|
||||
await RoleApi.createRole(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await RoleApi.updateRole(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
</script>
|
||||
147
src/views/Basic/Role/index.vue
Normal file
147
src/views/Basic/Role/index.vue
Normal file
@@ -0,0 +1,147 @@
|
||||
<template>
|
||||
<div class="flex">
|
||||
<el-card shadow="always" :body-style="{ padding: '10px' }">
|
||||
<div class="flex justify-between items-center" style="width: 300px">
|
||||
<div class="text-16px font-bold">角色列表</div>
|
||||
<el-button
|
||||
type="primary"
|
||||
style="padding: 0px"
|
||||
text
|
||||
@click="openForm('create')"
|
||||
v-hasPermi="['basic:role:add']"
|
||||
>
|
||||
新增
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="border-top-1px mt-10px pt-10px">
|
||||
<div
|
||||
class="flex justify-between items-center pl-10px pr-10px cursor-pointer pt-5px pb-5px"
|
||||
v-for="(item, index) in list"
|
||||
:key="index"
|
||||
:class="{ actived: libraryIndex == index }"
|
||||
@click="libraryIndex = index"
|
||||
>
|
||||
<div class="flex-1 text-14px">{{ item.name }}</div>
|
||||
<div class="ml-10px">
|
||||
<el-button
|
||||
type="primary"
|
||||
style="padding: 0px"
|
||||
text
|
||||
v-hasPermi="['basic:role:update']"
|
||||
@click="openForm('update', item.id)"
|
||||
>
|
||||
修改
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
class="ml-10px"
|
||||
style="padding: 0px"
|
||||
text
|
||||
v-hasPermi="['basic:role:delete']"
|
||||
@click="handleDelete(item.id)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<Pagination
|
||||
v-model:limit="queryParams.pageSize"
|
||||
v-model:page="queryParams.pageNo"
|
||||
layout="total, prev, pager, next"
|
||||
small
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="ml-20px" style="flex: 1" shadow="always" :body-style="{ padding: '10px' }">
|
||||
<el-tabs v-if="list && list.length" v-model="roleOperateIndex" type="card">
|
||||
<el-tab-pane label="角色用户" :name="1">
|
||||
<RoleEmployee v-if="roleOperateIndex == 1" :roleId="list[libraryIndex].id" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="菜单权限" :name="2">
|
||||
<RoleAssignMenuForm
|
||||
v-if="roleOperateIndex == 2"
|
||||
ref="assignMenuFormRef"
|
||||
:roleId="list[libraryIndex].id"
|
||||
@success="getList"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="数据权限" :name="3">
|
||||
<RoleDataPermissionForm
|
||||
v-if="roleOperateIndex == 3"
|
||||
ref="dataPermissionFormRef"
|
||||
:roleId="list[libraryIndex].id"
|
||||
@success="getList"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-card>
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<RoleForm ref="formRef" @success="getList" />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" name="SystemRole" setup>
|
||||
import RoleForm from './RoleForm.vue'
|
||||
import RoleEmployee from './Comp/RoleEmployee.vue'
|
||||
import RoleAssignMenuForm from './RoleAssignMenuForm.vue'
|
||||
import RoleDataPermissionForm from './RoleDataPermissionForm.vue'
|
||||
import * as RoleApi from '@/api/system/role'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
const total = ref(0) // 列表的总页数
|
||||
const list = ref<any>([]) // 列表的数据
|
||||
|
||||
const libraryIndex = ref(0)
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 20
|
||||
})
|
||||
|
||||
/** 查询角色列表 */
|
||||
const getList = async () => {
|
||||
const data = await RoleApi.getRolePage(queryParams)
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
}
|
||||
|
||||
/** 添加/修改操作 */
|
||||
const formRef = ref()
|
||||
const openForm = (type: string, id?: number) => {
|
||||
formRef.value.open(type, id)
|
||||
}
|
||||
|
||||
/** 数据权限操作 */
|
||||
const dataPermissionFormRef = ref()
|
||||
|
||||
/** 菜单权限操作 */
|
||||
const assignMenuFormRef = ref()
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (id: number) => {
|
||||
try {
|
||||
// 删除的二次确认
|
||||
await message.delConfirm()
|
||||
// 发起删除
|
||||
await RoleApi.deleteRole(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
const roleOperateIndex = ref(1)
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.actived {
|
||||
background-color: var(--el-color-primary-light-9);
|
||||
}
|
||||
</style>
|
||||
24
src/views/Basic/Swagger/index.vue
Normal file
24
src/views/Basic/Swagger/index.vue
Normal file
@@ -0,0 +1,24 @@
|
||||
<template>
|
||||
<IFrame :src="src" />
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import * as ConfigApi from '@/api/infra/config'
|
||||
|
||||
defineOptions({ name: 'InfraSwagger' })
|
||||
|
||||
const loading = ref(true) // 是否加载中
|
||||
const src = ref(import.meta.env.VITE_BASE_URL + '/doc.html') // Knife4j UI
|
||||
// const src = ref(import.meta.env.VITE_BASE_URL + '/swagger-ui') // Swagger UI
|
||||
|
||||
/** 初始化 */
|
||||
onMounted(async () => {
|
||||
try {
|
||||
const data = await ConfigApi.getConfigKey('url.swagger')
|
||||
if (data && data.length > 0) {
|
||||
src.value = data
|
||||
}
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
})
|
||||
</script>
|
||||
56
src/views/Basic/User/DeptTree.vue
Normal file
56
src/views/Basic/User/DeptTree.vue
Normal file
@@ -0,0 +1,56 @@
|
||||
<template>
|
||||
<div class="head-container">
|
||||
<el-input v-model="deptName" class="mb-20px" clearable placeholder="请输入部门名称">
|
||||
<template #prefix>
|
||||
<Icon icon="ep:search" />
|
||||
</template>
|
||||
</el-input>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-tree
|
||||
ref="treeRef"
|
||||
:data="deptList"
|
||||
:expand-on-click-node="false"
|
||||
:filter-node-method="filterNode"
|
||||
:props="defaultProps"
|
||||
default-expand-all
|
||||
highlight-current
|
||||
node-key="id"
|
||||
@node-click="handleNodeClick"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="SystemUserDeptTree" setup>
|
||||
import { ElTree } from 'element-plus'
|
||||
import * as DeptApi from '@/api/system/dept'
|
||||
import { defaultProps, handleTree } from '@/utils/tree'
|
||||
|
||||
const deptName = ref('')
|
||||
const deptList = ref<Tree[]>([]) // 树形结构
|
||||
const treeRef = ref<InstanceType<typeof ElTree>>()
|
||||
|
||||
/** 获得部门树 */
|
||||
const getTree = async () => {
|
||||
const res = await DeptApi.getSimpleDeptList()
|
||||
deptList.value = []
|
||||
deptList.value.push(...handleTree(res))
|
||||
}
|
||||
|
||||
/** 基于名字过滤 */
|
||||
const filterNode = (name: string, data: Tree) => {
|
||||
if (!name) return true
|
||||
return data.name.includes(name)
|
||||
}
|
||||
|
||||
/** 处理部门被点击 */
|
||||
const handleNodeClick = async (row: { [key: string]: any }) => {
|
||||
emits('node-click', row)
|
||||
}
|
||||
const emits = defineEmits(['node-click'])
|
||||
|
||||
/** 初始化 */
|
||||
onMounted(async () => {
|
||||
await getTree()
|
||||
})
|
||||
</script>
|
||||
228
src/views/Basic/User/UserForm.vue
Normal file
228
src/views/Basic/User/UserForm.vue
Normal file
@@ -0,0 +1,228 @@
|
||||
<template>
|
||||
<Dialog v-model="dialogVisible" :title="dialogTitle" style="width: 800px">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
v-loading="formLoading"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="80px"
|
||||
>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="用户姓名" prop="nickname">
|
||||
<el-input v-model="formData.nickname" placeholder="请输入用户姓名" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="12">
|
||||
<el-form-item label="用户性别">
|
||||
<el-radio-group v-model="formData.sex">
|
||||
<el-radio :value="1"> 男 </el-radio>
|
||||
<el-radio :value="2"> 女 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="归属部门" prop="deptId">
|
||||
<el-tree-select
|
||||
v-model="formData.deptId"
|
||||
:data="deptList"
|
||||
:props="defaultProps"
|
||||
check-strictly
|
||||
node-key="id"
|
||||
placeholder="请选择归属部门"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="角色" prop="role">
|
||||
<el-select
|
||||
v-model="formData.roleIds"
|
||||
multiple
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
:max-collapse-tags="2"
|
||||
placeholder="请选择角色"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in roleOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="手机号码" prop="mobile">
|
||||
<el-input v-model="formData.mobile" maxlength="11" placeholder="请输入手机号码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="邮箱" prop="email">
|
||||
<el-input v-model="formData.email" maxlength="50" placeholder="请输入邮箱" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item v-if="formData.id === undefined" label="登录账号" prop="username">
|
||||
<el-input v-model="formData.username" placeholder="请输入登录账号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item v-if="formData.id === undefined" label="用户密码" prop="password">
|
||||
<el-input
|
||||
v-model="formData.password"
|
||||
placeholder="请输入用户密码"
|
||||
show-password
|
||||
type="password"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- <el-row :gutter="20">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="入职日期" prop="hireDate">
|
||||
<el-date-picker
|
||||
v-model="formData.hireDate"
|
||||
type="date"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="选择日期时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row> -->
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="formData.remark" placeholder="请输入内容" type="textarea" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</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="SystemUserForm" setup>
|
||||
import { CommonStatusEnum } from '@/utils/constants'
|
||||
// import { defaultProps, handleTree } from '@/utils/tree'
|
||||
import { handleTree } from '@/utils/tree'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
|
||||
import * as RoleApi from '@/api/system/role'
|
||||
import * as DeptApi from '@/api/system/dept'
|
||||
import * as UserApi from '@/api/system/user'
|
||||
|
||||
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({
|
||||
nickname: '',
|
||||
deptId: '',
|
||||
mobile: '',
|
||||
email: '',
|
||||
id: undefined,
|
||||
username: '',
|
||||
password: '',
|
||||
sex: 1,
|
||||
remark: '',
|
||||
status: CommonStatusEnum.ENABLE,
|
||||
roleIds: [],
|
||||
hireDate: ''
|
||||
})
|
||||
const formRules = ref<any>({
|
||||
username: [{ required: true, message: '登录账号不能为空', trigger: 'blur' }],
|
||||
nickname: [{ required: true, message: '用户姓名不能为空', trigger: 'blur' }],
|
||||
password: [{ required: true, message: '用户密码不能为空', trigger: 'blur' }],
|
||||
email: [
|
||||
{
|
||||
type: 'email',
|
||||
message: '请输入正确的邮箱地址',
|
||||
trigger: ['blur', 'change']
|
||||
}
|
||||
],
|
||||
mobile: [{ required: true, message: '手机号不能为空', trigger: 'blur' }]
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
const deptList = ref<Tree[]>([]) // 树形结构
|
||||
const roleOptions = ref<any>([])
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type: string, id?: number) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = t('action.' + type)
|
||||
formType.value = type
|
||||
resetForm()
|
||||
// 修改时,设置数据
|
||||
if (id) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value = await UserApi.getUser(id)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
// 加载部门树
|
||||
deptList.value = handleTree(await DeptApi.getSimpleDeptList({ allFlag: false }))
|
||||
// 加载岗位列表
|
||||
roleOptions.value = await RoleApi.getSimpleRoleList()
|
||||
}
|
||||
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 unknown as UserApi.UserVO
|
||||
if (formType.value === 'create') {
|
||||
await UserApi.createUser(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await UserApi.updateUser(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
nickname: '',
|
||||
deptId: '',
|
||||
mobile: '',
|
||||
email: '',
|
||||
id: undefined,
|
||||
username: '',
|
||||
password: '',
|
||||
sex: 1,
|
||||
remark: '',
|
||||
status: CommonStatusEnum.ENABLE,
|
||||
roleIds: [],
|
||||
hireDate: formatDate(new Date(), 'YYYY-MM-DD')
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
</script>
|
||||
209
src/views/Basic/User/index.vue
Normal file
209
src/views/Basic/User/index.vue
Normal file
@@ -0,0 +1,209 @@
|
||||
<template>
|
||||
<!-- <el-row :gutter="20"> -->
|
||||
<!-- 左侧部门树 -->
|
||||
<!-- <el-col :span="4" :xs="24">
|
||||
<DeptTree @node-click="handleDeptNodeClick" />
|
||||
</el-col>
|
||||
<el-col :span="20" :xs="24"> -->
|
||||
<!-- 搜索 -->
|
||||
<el-form :model="queryParams" ref="queryFormRef" inline label-width="0">
|
||||
<el-form-item prop="nickname">
|
||||
<el-input
|
||||
v-model="queryParams.nickname"
|
||||
placeholder="请输入姓名"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item prop="mobile">
|
||||
<el-input
|
||||
v-model="queryParams.mobile"
|
||||
placeholder="请输入手机号码"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery" v-hasPermi="['basic:employee:search']">搜索</el-button>
|
||||
<el-button @click="resetQuery" v-hasPermi="['basic:employee:reset']">重置</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
@click="openForm('create')"
|
||||
v-hasPermi="['basic:employee:add']"
|
||||
>
|
||||
新增
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table v-loading="loading" :data="list">
|
||||
<el-table-column label="用户编号" key="id" prop="id" />
|
||||
<el-table-column label="登录账号" prop="username" />
|
||||
<el-table-column label="用户姓名" prop="nickname" />
|
||||
<!-- <el-table-column label="部门" key="deptName" prop="deptName" /> -->
|
||||
<el-table-column label="手机号码" prop="mobile" width="120" />
|
||||
<el-table-column label="状态" key="status">
|
||||
<template #default="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.status"
|
||||
:active-value="0"
|
||||
:inactive-value="1"
|
||||
active-text="在职"
|
||||
inactive-text="离职"
|
||||
v-hasPermi="['basic:employee:update']"
|
||||
@change="handleStatusChange(scope.row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" prop="createTime" width="180" :formatter="dateFormatter" />
|
||||
<el-table-column label="操作" width="260">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
@click="openForm('update', scope.row.id)"
|
||||
v-hasPermi="['basic:employee:update']"
|
||||
>
|
||||
修改
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
@click="handleDelete(scope.row.id)"
|
||||
v-hasPermi="['basic:employee:delete']"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
@click="handleResetPwd(scope.row)"
|
||||
v-hasPermi="['basic:employee:password']"
|
||||
>
|
||||
重置密码
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<Pagination
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<!-- </el-col> -->
|
||||
<!-- </el-row> -->
|
||||
|
||||
<!-- 添加或修改用户对话框 -->
|
||||
<UserForm ref="formRef" @success="getList" />
|
||||
</template>
|
||||
<script setup lang="ts" name="SystemUser">
|
||||
import { CommonStatusEnum } from '@/utils/constants'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import * as UserApi from '@/api/system/user'
|
||||
import UserForm from './UserForm.vue'
|
||||
// import DeptTree from './DeptTree.vue'
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const total = ref(0) // 列表的总页数
|
||||
const list = ref([]) // 列表的数
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
username: undefined,
|
||||
nickname: undefined,
|
||||
mobile: undefined,
|
||||
deptId: undefined
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await UserApi.getUserPage(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 handleDeptNodeClick = async (row) => {
|
||||
// queryParams.deptId = row.id
|
||||
// await getList()
|
||||
// }
|
||||
|
||||
/** 添加/修改操作 */
|
||||
const formRef = ref()
|
||||
const openForm = (type: string, id?: number) => {
|
||||
formRef.value.open(type, id)
|
||||
}
|
||||
|
||||
/** 修改用户状态 */
|
||||
const handleStatusChange = async (row: UserApi.UserVO) => {
|
||||
try {
|
||||
// 修改状态的二次确认
|
||||
const text = row.status === CommonStatusEnum.ENABLE ? '启用' : '停用'
|
||||
await message.confirm('确认要"' + text + '""' + row.username + '"用户吗?')
|
||||
// 发起修改状态
|
||||
await UserApi.updateUserStatus(row.id, row.status)
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {
|
||||
// 取消后,进行恢复按钮
|
||||
row.status =
|
||||
row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.DISABLE : CommonStatusEnum.ENABLE
|
||||
}
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (id: number) => {
|
||||
try {
|
||||
// 删除的二次确认
|
||||
await message.delConfirm()
|
||||
// 发起删除
|
||||
await UserApi.deleteUser(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
/** 重置密码 */
|
||||
const handleResetPwd = async (row: UserApi.UserVO) => {
|
||||
try {
|
||||
// 重置的二次确认
|
||||
const result = await message.prompt(
|
||||
'请输入"' + row.username + '"的新密码',
|
||||
t('common.reminder')
|
||||
)
|
||||
const password = result.value
|
||||
// 发起重置
|
||||
await UserApi.resetUserPwd(row.id, password)
|
||||
message.success('修改成功,新密码是:' + password)
|
||||
} catch {}
|
||||
}
|
||||
|
||||
/** 初始化 */
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
@@ -11,7 +11,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select
|
||||
v-model="searchForm.resellMan"
|
||||
v-model="searchForm.distributionld"
|
||||
placeholder="选择分销人"
|
||||
clearable
|
||||
filterable
|
||||
@@ -30,6 +30,8 @@
|
||||
v-model="searchForm.createDate"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
value-format="YYYY-MM-DD"
|
||||
format="YYYY-MM-DD"
|
||||
start-placeholder="注册日期"
|
||||
end-placeholder="注册日期"
|
||||
/>
|
||||
@@ -43,8 +45,8 @@
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="手机号码" prop="phone" width="120" />
|
||||
<el-table-column label="分销人" prop="distributionName" min-width="120" />
|
||||
<el-table-column label="注册日期" prop="registerDate" min-width="120" />
|
||||
<el-table-column label="最近登陆日期" prop="lastLoginTime" min-width="120" />
|
||||
<el-table-column label="注册日期" prop="createTime" min-width="120" />
|
||||
<el-table-column label="最近登陆日期" prop="rencentlyLoginTime" min-width="120" />
|
||||
</el-table>
|
||||
<Pagination
|
||||
:total="total"
|
||||
@@ -56,11 +58,12 @@
|
||||
</template>
|
||||
|
||||
<script name="AppletUser" setup>
|
||||
// import { removeNullField } from '@/utils'
|
||||
// import * as CustomerApi from '@/api/customer/customer.js'
|
||||
import { removeNullField } from '@/utils'
|
||||
import * as CustomerApi from '@/api/customer/customer.js'
|
||||
import { getResellSimpleList } from '@/api/xjapplet/resell'
|
||||
|
||||
const searchForm = ref({
|
||||
resellMan: undefined,
|
||||
distributionld: undefined,
|
||||
phone: '',
|
||||
createDate: [],
|
||||
pageNo: 1,
|
||||
@@ -70,9 +73,9 @@ const searchForm = ref({
|
||||
const resellOptions = ref([])
|
||||
|
||||
onMounted(() => {
|
||||
// CustomerApi.getCustomerExamCarType().then((res) => {
|
||||
// carTypeOptions.value = res
|
||||
// })
|
||||
getResellSimpleList().then((res) => {
|
||||
resellOptions.value = res
|
||||
})
|
||||
handleQuery()
|
||||
})
|
||||
|
||||
@@ -89,24 +92,14 @@ const total = ref(0)
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
// const data = await CustomerApi.getCustomerPage(removeNullField(searchForm.value))
|
||||
const data = {
|
||||
list: [
|
||||
{
|
||||
phone: '12345678901',
|
||||
distributionName: '分销人A',
|
||||
registerDate: '2023-10-01',
|
||||
lastLoginTime: '2023-10-02'
|
||||
},
|
||||
{
|
||||
phone: '12345678902',
|
||||
distributionName: '分销人B',
|
||||
registerDate: '2023-10-03',
|
||||
lastLoginTime: '2023-10-04'
|
||||
}
|
||||
],
|
||||
total: 2
|
||||
if (searchForm.value.createDate && searchForm.value.createDate.length > 0) {
|
||||
searchForm.value.createTimeBegin = searchForm.value.createDate[0] + ' 00:00:00'
|
||||
searchForm.value.createTimeEnd = searchForm.value.createDate[1] + ' 23:59:59'
|
||||
} else {
|
||||
searchForm.value.createTimeBegin = undefined
|
||||
searchForm.value.createTimeEnd = undefined
|
||||
}
|
||||
const data = await CustomerApi.getAppletUserList(removeNullField(searchForm.value))
|
||||
tableList.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
|
||||
@@ -5,12 +5,17 @@
|
||||
<el-input v-model="searchForm.phone" placeholder="学员手机号" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="searchForm.memberId" placeholder="选择分销人" clearable filterable>
|
||||
<el-select
|
||||
v-model="searchForm.distributionId"
|
||||
placeholder="选择分销人"
|
||||
clearable
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in vipOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
v-for="item in distributionOptions"
|
||||
:key="item.distributionId"
|
||||
:label="item.name"
|
||||
:value="item.distributionId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -19,6 +24,8 @@
|
||||
v-model="searchForm.createDate"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
value-format="YYYY-MM-DD"
|
||||
format="YYYY-MM-DD"
|
||||
start-placeholder="充值日期"
|
||||
end-placeholder="充值日期"
|
||||
/>
|
||||
@@ -31,16 +38,12 @@
|
||||
<el-table-column type="index" width="55" align="center" />
|
||||
<el-table-column label="手机号" align="left" prop="phone" width="140" />
|
||||
<el-table-column label="会员名" align="left" prop="memberName" min-width="140" />
|
||||
<el-table-column label="支付金额" align="left" prop="operUser" min-width="100" />
|
||||
<el-table-column label="车型" align="left" width="100">
|
||||
<template #default="{ row }">
|
||||
{{ row.carTypeId == 1001 ? '小车' : '摩托车' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="支付金额" align="left" prop="money" min-width="100" />
|
||||
<el-table-column label="车型" prop="carName" align="left" width="100" />
|
||||
<el-table-column label="科目" align="left" prop="subjects" width="100" />
|
||||
<el-table-column label="充值日期" align="left" prop="startDate" min-width="120" />
|
||||
<el-table-column label="充值日期" align="left" prop="payTime" min-width="120" />
|
||||
<el-table-column label="截止日期" align="left" prop="endDate" min-width="120" />
|
||||
<el-table-column label="分销人" align="left" prop="useTypeName" min-width="100" />
|
||||
<el-table-column label="分销人" align="left" prop="distributionName" min-width="100" />
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
@@ -49,44 +52,17 @@
|
||||
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="phone">
|
||||
<el-input v-model="form.phone" maxlength="11" />
|
||||
</el-form-item>
|
||||
<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="sureAdd">确定</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Recharge">
|
||||
import { getUserMemberList, giveUserMember, getVipTypeOptions } from '@/api/xjapplet/vip'
|
||||
const message = useMessage()
|
||||
import { getRechargeRecords } from '@/api/xjapplet/vip'
|
||||
import { getResellSimpleList } from '@/api/xjapplet/resell'
|
||||
|
||||
const searchForm = ref({
|
||||
carTypeId: '1001',
|
||||
memberId: undefined,
|
||||
distributionId: undefined,
|
||||
phone: undefined,
|
||||
createDate: [],
|
||||
pageNo: 1,
|
||||
pageSize: 50
|
||||
})
|
||||
@@ -95,15 +71,15 @@ const loading = ref(false)
|
||||
const tableList = ref([])
|
||||
const total = ref(0)
|
||||
|
||||
const vipOptions = ref([])
|
||||
const distributionOptions = ref([])
|
||||
|
||||
onMounted(() => {
|
||||
changeCarType()
|
||||
})
|
||||
|
||||
function changeCarType() {
|
||||
getVipTypeOptions({ carTypeId: searchForm.value.carTypeId }).then((response) => {
|
||||
vipOptions.value = response
|
||||
getResellSimpleList().then((response) => {
|
||||
distributionOptions.value = response
|
||||
})
|
||||
searchList()
|
||||
}
|
||||
@@ -115,43 +91,19 @@ function searchList() {
|
||||
|
||||
function getList() {
|
||||
loading.value = true
|
||||
getUserMemberList(searchForm.value).then((response) => {
|
||||
if (searchForm.value.createDate && searchForm.value.createDate.length > 0) {
|
||||
searchForm.value.payTimeBegin = searchForm.value.createDate[0] + ' 00:00:00'
|
||||
searchForm.value.payTimeEnd = searchForm.value.createDate[1] + ' 23:59:59'
|
||||
} else {
|
||||
searchForm.value.payTimeBegin = undefined
|
||||
searchForm.value.payTimeEnd = undefined
|
||||
}
|
||||
getRechargeRecords(searchForm.value).then((response) => {
|
||||
tableList.value = response.list
|
||||
total.value = response.total
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
const showDialog = ref(false)
|
||||
const form = ref({
|
||||
phone: '',
|
||||
memberId: ''
|
||||
})
|
||||
const rules = ref({
|
||||
phone: [{ required: true, message: '请输入用户手机号', trigger: 'blur' }],
|
||||
memberId: [{ required: true, message: '请选择会员类型', trigger: 'change' }]
|
||||
})
|
||||
|
||||
function addVipUser() {
|
||||
showDialog.value = true
|
||||
}
|
||||
|
||||
const formRef = ref(null)
|
||||
async function sureAdd() {
|
||||
if (!formRef.value) return
|
||||
const valid = await formRef.value.validate()
|
||||
if (!valid) return
|
||||
|
||||
giveUserMember(form.value).then((response) => {
|
||||
if (response) {
|
||||
message.success('赠送成功')
|
||||
showDialog.value = false
|
||||
searchList()
|
||||
} else {
|
||||
message.error('赠送失败')
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-radio-group v-model="searchForm.carTypeId" @change="searchList">
|
||||
<el-radio label="1001">小车</el-radio>
|
||||
<el-radio label="1002">摩托车</el-radio>
|
||||
<el-radio value="1001">小车</el-radio>
|
||||
<el-radio value="1002">摩托车</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
@@ -32,20 +32,8 @@
|
||||
<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)"
|
||||
v-hasPermi="['xj-applet:vip:vip-type:update']"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
@click="handleDelete(row.memberId)"
|
||||
v-hasPermi="['xj-applet:vip:vip-type:delete']"
|
||||
>删除</el-button
|
||||
>
|
||||
<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>
|
||||
@@ -68,10 +56,10 @@
|
||||
<el-option label="摩托车" value="1002" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="科目" prop="subjects">
|
||||
<el-select v-model="form.subjects" placeholder="多选" multiple style="width: 100%">
|
||||
<el-option label="科一" value="4" />
|
||||
<el-option label="科四" value="1" />
|
||||
<el-form-item label="科目" prop="subjectList">
|
||||
<el-select v-model="form.subjectList" placeholder="多选" multiple style="width: 100%">
|
||||
<el-option label="科一" value="1" />
|
||||
<el-option label="科四" value="4" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="原价" prop="price">
|
||||
@@ -142,7 +130,7 @@ const showDialog = ref(false)
|
||||
const form = ref({
|
||||
memberName: '',
|
||||
carTypeId: undefined,
|
||||
subjects: [],
|
||||
subjectList: [],
|
||||
price: '',
|
||||
discount: '',
|
||||
duration: '',
|
||||
@@ -152,7 +140,7 @@ const form = ref({
|
||||
const rules = ref({
|
||||
memberName: [{ required: true, message: '请输入会员名称', trigger: 'blur' }],
|
||||
carTypeId: [{ required: true, message: '请输入车型', trigger: 'change' }],
|
||||
subjects: [{ required: true, message: '请输入科目', trigger: 'blur' }],
|
||||
subjectList: [{ required: true, message: '请输入科目', trigger: 'blur' }],
|
||||
price: [{ required: true, message: '请输入价格', trigger: 'blur' }],
|
||||
discount: [{ required: true, message: '请输入折扣价', trigger: 'blur' }],
|
||||
duration: [{ required: true, message: '请输入有效期', trigger: 'blur' }]
|
||||
@@ -161,10 +149,10 @@ const rules = ref({
|
||||
function addVip() {
|
||||
showDialog.value = true
|
||||
|
||||
form.value.carTypeId = {
|
||||
form.value = {
|
||||
memberName: '',
|
||||
carTypeId: searchForm.value.carTypeId,
|
||||
subjects: [],
|
||||
subjectList: [],
|
||||
price: '',
|
||||
discount: '',
|
||||
duration: '',
|
||||
@@ -174,7 +162,7 @@ function addVip() {
|
||||
}
|
||||
|
||||
function editVip(row) {
|
||||
form.value = { ...row, subjects: row.subjects.split(','), unit: Number(row.unit) }
|
||||
form.value = { ...row, carTypeId: row.carTypeId + '', unit: Number(row.unit) }
|
||||
showDialog.value = true
|
||||
}
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-radio-group v-model="searchForm.carTypeId" @change="changeCarType">
|
||||
<el-radio label="1001">小车</el-radio>
|
||||
<el-radio label="1002">摩托车</el-radio>
|
||||
<el-radio value="1001">小车</el-radio>
|
||||
<el-radio value="1002">摩托车</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item>
|
||||
|
||||
74
src/views/ExamVenue/Calendar/index.vue
Normal file
74
src/views/ExamVenue/Calendar/index.vue
Normal file
@@ -0,0 +1,74 @@
|
||||
<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>
|
||||
298
src/views/ExamVenue/Room/index.vue
Normal file
298
src/views/ExamVenue/Room/index.vue
Normal file
@@ -0,0 +1,298 @@
|
||||
<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>
|
||||
169
src/views/GDS/appletUser/components/gdsUsers.vue
Normal file
169
src/views/GDS/appletUser/components/gdsUsers.vue
Normal file
@@ -0,0 +1,169 @@
|
||||
<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>
|
||||
188
src/views/GDS/appletUser/components/gdsVip.vue
Normal file
188
src/views/GDS/appletUser/components/gdsVip.vue
Normal file
@@ -0,0 +1,188 @@
|
||||
<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>
|
||||
81
src/views/GDS/appletUser/components/gdsVipRecord.vue
Normal file
81
src/views/GDS/appletUser/components/gdsVipRecord.vue
Normal file
@@ -0,0 +1,81 @@
|
||||
<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>
|
||||
25
src/views/GDS/appletUser/index.vue
Normal file
25
src/views/GDS/appletUser/index.vue
Normal file
@@ -0,0 +1,25 @@
|
||||
<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>
|
||||
345
src/views/GDS/course/chapter.vue
Normal file
345
src/views/GDS/course/chapter.vue
Normal file
@@ -0,0 +1,345 @@
|
||||
<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>
|
||||
255
src/views/GDS/course/index.vue
Normal file
255
src/views/GDS/course/index.vue
Normal file
@@ -0,0 +1,255 @@
|
||||
<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>
|
||||
187
src/views/JoinUs/Coach/index.vue
Normal file
187
src/views/JoinUs/Coach/index.vue
Normal file
@@ -0,0 +1,187 @@
|
||||
<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>
|
||||
397
src/views/JoinUs/Station/index.vue
Normal file
397
src/views/JoinUs/Station/index.vue
Normal file
@@ -0,0 +1,397 @@
|
||||
<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>
|
||||
@@ -0,0 +1,100 @@
|
||||
<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>
|
||||
417
src/views/Question/Database/Components/QuestionAddForm.vue
Normal file
417
src/views/Question/Database/Components/QuestionAddForm.vue
Normal file
@@ -0,0 +1,417 @@
|
||||
<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 :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="专项" prop="category">
|
||||
<el-input
|
||||
v-model="dialogForm.category"
|
||||
maxlength="1000"
|
||||
placeholder="请输入"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<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-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<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-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 :gutter="20">
|
||||
<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="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
|
||||
v-model="dialogForm.chooseB"
|
||||
maxlength="200"
|
||||
placeholder="请输入"
|
||||
clearable
|
||||
/>
|
||||
</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-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="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
|
||||
v-model="dialogForm.chooseD"
|
||||
maxlength="200"
|
||||
placeholder="请输入"
|
||||
clearable
|
||||
/>
|
||||
</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-form-item label="答案" prop="trueAnswer">
|
||||
<el-input
|
||||
v-model="dialogForm.trueAnswer"
|
||||
maxlength="200"
|
||||
placeholder="请输入"
|
||||
clearable
|
||||
/>
|
||||
</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">
|
||||
<el-form-item label="难点分析" prop="bestAnswer">
|
||||
<el-input
|
||||
v-model="dialogForm.bestAnswer"
|
||||
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"
|
||||
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="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-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">
|
||||
<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" />
|
||||
<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>
|
||||
</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/xjapplet/xjdatabase'
|
||||
|
||||
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,
|
||||
category: undefined,
|
||||
question: undefined,
|
||||
bestAnswer: undefined,
|
||||
chapter: undefined,
|
||||
chooseA: undefined,
|
||||
chooseB: undefined,
|
||||
chooseC: undefined,
|
||||
chooseD: undefined,
|
||||
imageUrl: undefined,
|
||||
type: undefined,
|
||||
trueAnswer: undefined,
|
||||
carTypeId: undefined,
|
||||
skillInfoPic: undefined,
|
||||
source: undefined,
|
||||
illiteracyAnswer: undefined,
|
||||
skillInfo: undefined,
|
||||
skillWords: undefined,
|
||||
cuoWuLv: 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()
|
||||
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
|
||||
}
|
||||
}
|
||||
dialogForm.value.source = info.source
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open
|
||||
})
|
||||
|
||||
const resetDialogForm = () => {
|
||||
dialogForm.value = {
|
||||
id: undefined,
|
||||
showOrder: 0,
|
||||
question: undefined,
|
||||
bestAnswer: undefined,
|
||||
chapter: undefined,
|
||||
chooseA: undefined,
|
||||
chooseB: undefined,
|
||||
chooseC: undefined,
|
||||
chooseD: undefined,
|
||||
imageUrl: undefined,
|
||||
type: undefined,
|
||||
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,
|
||||
source: undefined,
|
||||
illiteracyAnswer: undefined,
|
||||
cuoWuLv: undefined
|
||||
}
|
||||
}
|
||||
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>
|
||||
354
src/views/Question/Database/index.vue
Normal file
354
src/views/Question/Database/index.vue
Normal file
@@ -0,0 +1,354 @@
|
||||
<template>
|
||||
<div class="app-container" style="text-align: center">
|
||||
<el-tabs v-model="queryParams.source" @tab-click="handleChangeSource">
|
||||
<el-tab-pane
|
||||
v-for="item in sourceOptions"
|
||||
:key="item.key"
|
||||
: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-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>
|
||||
<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>
|
||||
<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-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"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="handleQuery"
|
||||
v-hasPermi="['question:database:search']"
|
||||
>
|
||||
搜索
|
||||
</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>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableList"
|
||||
highlight-current-row
|
||||
max-height="calc(100vh - 270px)"
|
||||
>
|
||||
<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">
|
||||
<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="错误率" 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>
|
||||
</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:database:edit']"
|
||||
>
|
||||
修改
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['question:database:remove']"
|
||||
>
|
||||
删除
|
||||
</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-tab-pane>
|
||||
</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()
|
||||
|
||||
const loading = ref(false)
|
||||
const total = ref(0)
|
||||
const tableList = ref([])
|
||||
const queryParams = ref({
|
||||
source: 'XJ',
|
||||
question: '',
|
||||
carTypeId: '1001',
|
||||
subject: '1',
|
||||
isPic: undefined,
|
||||
isDuplicate: undefined,
|
||||
keyword: '',
|
||||
chapter: undefined,
|
||||
pageNo: 1,
|
||||
pageSize: 20
|
||||
})
|
||||
|
||||
const sourceOptions = [
|
||||
{
|
||||
key: 'JKJL',
|
||||
label: '驾考精灵'
|
||||
},
|
||||
{
|
||||
key: 'YDT',
|
||||
label: '驾校一点通'
|
||||
},
|
||||
{
|
||||
key: 'JKBD',
|
||||
label: '驾考宝典'
|
||||
},
|
||||
{
|
||||
key: 'XJ',
|
||||
label: '寻驾'
|
||||
}
|
||||
]
|
||||
|
||||
onMounted(() => {
|
||||
getQuestionChapter()
|
||||
})
|
||||
|
||||
const chapterOptions = ref([])
|
||||
const getQuestionChapter = () => {
|
||||
getQuestionSort({
|
||||
carTypeId: queryParams.value.carTypeId,
|
||||
subject: queryParams.value.subject,
|
||||
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}`
|
||||
}
|
||||
|
||||
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) => {
|
||||
tableList.value = response.list
|
||||
total.value = response.total
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
function handleQuery() {
|
||||
getList()
|
||||
}
|
||||
|
||||
const dialogAddForm = ref(null)
|
||||
function handleEdit(item) {
|
||||
dialogAddForm.value.open(item, chapterOptions.value)
|
||||
}
|
||||
|
||||
function handleAdd() {
|
||||
dialogAddForm.value.open(
|
||||
{
|
||||
subject: queryParams.value.subject,
|
||||
carTypeId: queryParams.value.carTypeId,
|
||||
source: queryParams.value.source
|
||||
},
|
||||
chapterOptions.value
|
||||
)
|
||||
}
|
||||
|
||||
function handleDelete(row) {
|
||||
message
|
||||
.confirm('是否确认删除该题?')
|
||||
.then(() => {
|
||||
deleteQuestion(row.questionId, row.source).then(() => {
|
||||
getList()
|
||||
message.success('删除题目成功')
|
||||
})
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err)
|
||||
})
|
||||
}
|
||||
|
||||
function handleChangeSource() {
|
||||
const obj = {
|
||||
question: '',
|
||||
carTypeId: '1001',
|
||||
subject: '1',
|
||||
isPic: undefined,
|
||||
pageNo: 1
|
||||
}
|
||||
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 })
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
34
src/views/Question/Setting/Components/SelectSource.vue
Normal file
34
src/views/Question/Setting/Components/SelectSource.vue
Normal file
@@ -0,0 +1,34 @@
|
||||
<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>
|
||||
18
src/views/Question/Setting/index.vue
Normal file
18
src/views/Question/Setting/index.vue
Normal file
@@ -0,0 +1,18 @@
|
||||
<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>
|
||||
</template>
|
||||
|
||||
<script setup name="QuestionSetting">
|
||||
import { checkPermi } from '@/utils/permission'
|
||||
import SelectSource from './Components/SelectSource.vue'
|
||||
|
||||
const settingName = ref(1)
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
342
src/views/Question/UAV/Components/QuestionAddForm.vue
Normal file
342
src/views/Question/UAV/Components/QuestionAddForm.vue
Normal file
@@ -0,0 +1,342 @@
|
||||
<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>
|
||||
265
src/views/Question/UAV/index.vue
Normal file
265
src/views/Question/UAV/index.vue
Normal file
@@ -0,0 +1,265 @@
|
||||
<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>
|
||||
</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>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
185
src/views/Question/UAVChapter/index.vue
Normal file
185
src/views/Question/UAVChapter/index.vue
Normal file
@@ -0,0 +1,185 @@
|
||||
<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>
|
||||
7
src/views/Question/UAVVip/index.vue
Normal file
7
src/views/Question/UAVVip/index.vue
Normal file
@@ -0,0 +1,7 @@
|
||||
<template>
|
||||
<div> 无人机VIP </div>
|
||||
</template>
|
||||
|
||||
<script setup name="UAVVip"></script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
321
src/views/Question/VipData/conponents/SecretData.vue
Normal file
321
src/views/Question/VipData/conponents/SecretData.vue
Normal file
@@ -0,0 +1,321 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form inline label-width="68px" @submit.prevent>
|
||||
<el-row :gutter="20">
|
||||
<el-form-item label="车型" @change="searchMj">
|
||||
<el-radio-group v-model="queryParams.carTypeId">
|
||||
<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 label="科目">
|
||||
<el-radio-group v-model="queryParams.subject" @change="searchMj">
|
||||
<el-radio label="1" value="1">科一</el-radio>
|
||||
<el-radio label="4" value="4">科四</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div style="display: flex; padding: 10px; border: 1px solid #eee; height: calc(100vh - 220px)">
|
||||
<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>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
@click="addMjItem"
|
||||
v-hasPermi="['questiont:vip-data:mj:add']"
|
||||
>新增</el-button
|
||||
>
|
||||
</div>
|
||||
<el-radio-group
|
||||
v-model="mjIndex"
|
||||
style="width: 100%; display: block; margin-top: 20px"
|
||||
@change="getQuestionList"
|
||||
>
|
||||
<el-radio v-for="(item, index) in mjList" :key="index" :label="index" class="flex-radio">
|
||||
<div style="flex: 1; width: 100px">{{ getMjTitle(index) }}</div>
|
||||
<div style="padding-right: 15px">
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
@click="removeMj(item)"
|
||||
v-hasPermi="['questiont:vip-data:mj:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
@click="clearMjDetail(item)"
|
||||
v-hasPermi="['questiont:vip-data:mj:clear']"
|
||||
>清空</el-button
|
||||
>
|
||||
</div>
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<div style="flex: 1; padding-left: 20px; padding-right: 20px">
|
||||
<div
|
||||
v-if="mjList.length > 0"
|
||||
style="display: flex; justify-content: space-between; align-items: center"
|
||||
>
|
||||
<div style="font-size: 20px; font-weight: bold">
|
||||
当前密卷:{{ getMjTitle(mjIndex) }}
|
||||
</div>
|
||||
<div style="margin-left: 10px; margin-right: 10px"> 题目数:{{ tableList.length }} </div>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="addMjDetail"
|
||||
v-hasPermi="['questiont:vip-data:mj:add-question']"
|
||||
>新增密卷试题</el-button
|
||||
>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableList"
|
||||
style="margin-top: 10px"
|
||||
max-height="calc(100vh - 280px)"
|
||||
>
|
||||
<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">
|
||||
<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="`https://ss-cloud.ahduima.com/xjxc/pic/${row.imageUrl}`"
|
||||
:preview-src-list="[`https://ss-cloud.ahduima.com/xjxc/pic/${row.imageUrl}`]"
|
||||
:lazy="true"
|
||||
preview-teleported
|
||||
style="width: 80px"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" align="center" width="100px">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
@click="takeoutMj(row)"
|
||||
v-hasPermi="['questiont:vip-data:mj:remove-question']"
|
||||
>移出密卷</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-dialog v-model="showDialog" title="新增试题" width="80%">
|
||||
<div style="display: flex; align-items: center; margin-bottom: 20px">
|
||||
<el-input v-model="quesName" placeholder="请输入题目" clearable @keyup.enter="searchQues" />
|
||||
<el-button style="margin-left: 20px" type="primary" @click="searchQues">搜索</el-button>
|
||||
</div>
|
||||
<el-table :data="quesLit" highlight-current-row height="calc(100vh - 260px)">
|
||||
<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="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"
|
||||
preview-teleported
|
||||
style="width: 80px"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100px">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" link @click="sureAddQues(row)">加入密卷</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="SimpleData">
|
||||
import {
|
||||
getMjList,
|
||||
addMj,
|
||||
delMj,
|
||||
clearMj,
|
||||
getMjQuestionList,
|
||||
addMjQuestion,
|
||||
delMjQuestion
|
||||
} from '@/api/xjapplet/vipdatabase.js'
|
||||
import { searchQuestion } from '@/api/xjapplet/xjdatabase.js'
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const props = defineProps({
|
||||
source: {
|
||||
type: String,
|
||||
default: '1'
|
||||
}
|
||||
})
|
||||
|
||||
watch(
|
||||
() => props.source,
|
||||
(newValue) => {
|
||||
queryParams.value.source = newValue
|
||||
searchMj()
|
||||
}
|
||||
)
|
||||
|
||||
const queryParams = ref({
|
||||
carTypeId: '1001',
|
||||
subject: '1',
|
||||
source: props.source
|
||||
})
|
||||
const mjIndex = ref(0)
|
||||
const mjList = ref([])
|
||||
const loading = ref(false)
|
||||
const tableList = ref([])
|
||||
const showDialog = ref(false)
|
||||
const quesName = ref('')
|
||||
const quesLit = ref([])
|
||||
|
||||
onMounted(() => {
|
||||
searchMj()
|
||||
})
|
||||
|
||||
function getShowImg(row) {
|
||||
return row.imageUrl.includes('http')
|
||||
? row.imageUrl
|
||||
: `https://ss-cloud.ahduima.com/xjxc/pic/${row.imageUrl}`
|
||||
}
|
||||
|
||||
function addMjItem() {
|
||||
addMj(queryParams.value).then((res) => {
|
||||
if (res) {
|
||||
searchMj()
|
||||
message.success('添加成功')
|
||||
} else {
|
||||
message.error('添加失败')
|
||||
}
|
||||
})
|
||||
}
|
||||
function getMjTitle(idx) {
|
||||
// const cjObj = {
|
||||
// 1001: '小车',
|
||||
// 1002: '摩托车'
|
||||
// }
|
||||
// const kmObj = {
|
||||
// 1: '科一',
|
||||
// 4: '科四'
|
||||
// }
|
||||
// return `${cjObj[queryParams.value.carTypeId]}${kmObj[queryParams.value.subject]}考前密卷 第${
|
||||
// idx + 1
|
||||
// }套`
|
||||
return `考前密卷 第${idx + 1}套`
|
||||
}
|
||||
function removeMj(item) {
|
||||
message
|
||||
.confirm('是否确认删除密卷?')
|
||||
.then(function () {
|
||||
return delMj(item.secretId, queryParams.value.source)
|
||||
})
|
||||
.then(() => {
|
||||
searchMj()
|
||||
message.success('删除成功')
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
function clearMjDetail(item) {
|
||||
message
|
||||
.confirm('是否确认清空密卷题目?')
|
||||
.then(function () {
|
||||
return clearMj(item.secretId, queryParams.value.source)
|
||||
})
|
||||
.then(() => {
|
||||
getQuestionList()
|
||||
message.success('清空题目成功')
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
function searchMj() {
|
||||
getMjList(queryParams.value).then((resp) => {
|
||||
mjList.value = resp || []
|
||||
if (mjList.value.length > 0) {
|
||||
mjIndex.value = 0
|
||||
getQuestionList()
|
||||
}
|
||||
})
|
||||
}
|
||||
function addMjDetail() {
|
||||
showDialog.value = true
|
||||
}
|
||||
function searchQues() {
|
||||
searchQuestion({
|
||||
...queryParams.value,
|
||||
pageNo: 1,
|
||||
pageSize: 1000,
|
||||
question: quesName.value
|
||||
}).then((response) => {
|
||||
quesLit.value = response.list
|
||||
})
|
||||
}
|
||||
function takeoutMj(row) {
|
||||
message
|
||||
.confirm('是否确认将该题移出密卷?')
|
||||
.then(function () {
|
||||
return delMjQuestion(row.id, queryParams.value.source)
|
||||
})
|
||||
.then(() => {
|
||||
getQuestionList()
|
||||
message.success('移除题目成功')
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
function getQuestionList() {
|
||||
getMjQuestionList({
|
||||
secretId: mjList.value[mjIndex.value].secretId,
|
||||
source: queryParams.value.source
|
||||
}).then((resp) => {
|
||||
tableList.value = resp
|
||||
})
|
||||
}
|
||||
function sureAddQues(row) {
|
||||
addMjQuestion({
|
||||
secretId: mjList.value[mjIndex.value].secretId,
|
||||
questionId: row.questionId,
|
||||
source: queryParams.value.source
|
||||
})
|
||||
.then((resp) => {
|
||||
if (resp) {
|
||||
message.success('添加成功')
|
||||
getQuestionList()
|
||||
}
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
223
src/views/Question/VipData/conponents/SimpleData.vue
Normal file
223
src/views/Question/VipData/conponents/SimpleData.vue
Normal file
@@ -0,0 +1,223 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form inline label-width="68px" @submit.prevent>
|
||||
<el-row :gutter="20">
|
||||
<el-form-item label="车型">
|
||||
<el-radio-group v-model="queryParams.carTypeId">
|
||||
<el-radio label="1001" value="1001">小车</el-radio>
|
||||
<el-radio label="1002" value="1002">摩托车</el-radio>
|
||||
<!-- <el-radio label="B2">货车</el-radio> -->
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="科目">
|
||||
<el-radio-group v-model="queryParams.subject">
|
||||
<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-button
|
||||
type="primary"
|
||||
v-hasPermi="['question:vip-data:jx:search']"
|
||||
@click="
|
||||
() => {
|
||||
queryParams.pageNo = 1
|
||||
getQuestionList()
|
||||
}
|
||||
"
|
||||
>
|
||||
查询
|
||||
</el-button>
|
||||
<el-button type="primary" @click="addMjDetail" v-hasPermi="['question:vip-data:jx:add']">
|
||||
新增精选试题
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-table v-loading="loading" :data="tableList" height="calc(100vh - 270px)">
|
||||
<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">
|
||||
<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" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-image
|
||||
v-if="row.imageUrl"
|
||||
:src="getShowImg(row)"
|
||||
:preview-src-list="[getShowImg(row)]"
|
||||
:lazy="true"
|
||||
preview-teleported
|
||||
style="width: 80px"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="100px">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
link
|
||||
@click="takeoutMj(row)"
|
||||
v-hasPermi="['question:vip-data:jx:remove']"
|
||||
>
|
||||
移出精选
|
||||
</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="getQuestionList"
|
||||
/>
|
||||
|
||||
<el-dialog v-model="showDialog" title="新增试题" width="80%">
|
||||
<div style="display: flex; align-items: center; margin-bottom: 20px">
|
||||
<el-input v-model="quesName" placeholder="请输入题目" clearable @keyup.enter="searchQues" />
|
||||
<el-button style="margin-left: 20px" type="primary" @click="searchQues">搜索</el-button>
|
||||
</div>
|
||||
<el-table :data="quesLit" highlight-current-row height="calc(100vh - 260px)">
|
||||
<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="chapterName" min-width="100" />
|
||||
<el-table-column label="图片" align="center" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-image
|
||||
v-if="row.imageUrl"
|
||||
:src="`https://ss-cloud.ahduima.com/xjxc/pic/${row.imageUrl}`"
|
||||
:preview-src-list="[`https://ss-cloud.ahduima.com/xjxc/pic/${row.imageUrl}`]"
|
||||
:lazy="true"
|
||||
preview-teleported
|
||||
style="width: 80px"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100px">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" link @click="sureAddQues(row)">加入精选</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="SimpleData">
|
||||
import { getJxQuestionList, addJx, delJxData } from '@/api/xjapplet/vipdatabase.js'
|
||||
import { searchQuestion } from '@/api/xjapplet/xjdatabase.js'
|
||||
|
||||
const props = defineProps({
|
||||
source: {
|
||||
type: String,
|
||||
default: '1'
|
||||
}
|
||||
})
|
||||
watch(
|
||||
() => props.source,
|
||||
(newValue) => {
|
||||
queryParams.value.source = newValue
|
||||
getQuestionList()
|
||||
}
|
||||
)
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const queryParams = ref({
|
||||
carTypeId: '1001',
|
||||
subject: '1',
|
||||
source: props.source,
|
||||
pageNo: 1,
|
||||
pageSize: 100
|
||||
})
|
||||
|
||||
const total = ref(0)
|
||||
|
||||
const loading = ref(false)
|
||||
const tableList = ref([])
|
||||
const showDialog = ref(false)
|
||||
const quesName = ref('')
|
||||
const quesLit = ref([])
|
||||
|
||||
onMounted(() => {
|
||||
getQuestionList()
|
||||
})
|
||||
|
||||
function getShowImg(row) {
|
||||
return row.imageUrl.includes('http')
|
||||
? row.imageUrl
|
||||
: `https://ss-cloud.ahduima.com/xjxc/pic/${row.imageUrl}`
|
||||
}
|
||||
|
||||
function addMjDetail() {
|
||||
showDialog.value = true
|
||||
}
|
||||
function searchQues() {
|
||||
searchQuestion({
|
||||
...queryParams.value,
|
||||
pageNo: 1,
|
||||
pageSize: 1000,
|
||||
question: quesName.value
|
||||
}).then((response) => {
|
||||
quesLit.value = response.list
|
||||
})
|
||||
}
|
||||
function takeoutMj(row) {
|
||||
message
|
||||
.confirm('是否确认将该题移出精选?')
|
||||
.then(function () {
|
||||
return delJxData(row.id, queryParams.value.source)
|
||||
})
|
||||
.then(() => {
|
||||
getQuestionList()
|
||||
message.success('清空题目成功')
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
function getQuestionList() {
|
||||
getJxQuestionList(queryParams.value).then((resp) => {
|
||||
tableList.value = resp.list
|
||||
total.value = resp.total
|
||||
})
|
||||
}
|
||||
function sureAddQues(row) {
|
||||
addJx({
|
||||
questionId: row.questionId,
|
||||
carTypeId: queryParams.value.carTypeId,
|
||||
subject: queryParams.value.subject,
|
||||
source: queryParams.value.source
|
||||
})
|
||||
.then((resp) => {
|
||||
if (resp) {
|
||||
message.success('添加成功')
|
||||
getQuestionList()
|
||||
}
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
32
src/views/Question/VipData/index.vue
Normal file
32
src/views/Question/VipData/index.vue
Normal file
@@ -0,0 +1,32 @@
|
||||
<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-tab-pane label="精选题" :name="1" v-if="checkPermi(['question:vip-data:jx'])">
|
||||
<SimpleData v-if="tabIndex == 1" :source="source" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="密卷" :name="2" v-if="checkPermi(['question:vip-data:mj'])">
|
||||
<SecretData v-if="tabIndex == 2" :source="source" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
|
||||
<script setup name="VipData">
|
||||
import { checkPermi } from '@/utils/permission'
|
||||
import SimpleData from './conponents/SimpleData.vue'
|
||||
import SecretData from './conponents/SecretData.vue'
|
||||
|
||||
const tabIndex = ref(1)
|
||||
const source = ref('XJ')
|
||||
const sourceOptions = [
|
||||
{ key: 'XJ', label: '寻驾' },
|
||||
{ key: 'JKJL', label: '驾考精灵' },
|
||||
{ key: 'YDT', label: '驾校一点通' },
|
||||
{ key: 'JKBD', label: '驾考宝典' }
|
||||
]
|
||||
const handleChangeSource = () => {}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
205
src/views/UAVClue/CluePool/index.vue
Normal file
205
src/views/UAVClue/CluePool/index.vue
Normal file
@@ -0,0 +1,205 @@
|
||||
<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>
|
||||
98
src/views/UAVClue/StudyRecord/components/Collect.vue
Normal file
98
src/views/UAVClue/StudyRecord/components/Collect.vue
Normal file
@@ -0,0 +1,98 @@
|
||||
<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>
|
||||
141
src/views/UAVClue/StudyRecord/components/Exam.vue
Normal file
141
src/views/UAVClue/StudyRecord/components/Exam.vue
Normal file
@@ -0,0 +1,141 @@
|
||||
<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>
|
||||
116
src/views/UAVClue/StudyRecord/components/Practice.vue
Normal file
116
src/views/UAVClue/StudyRecord/components/Practice.vue
Normal file
@@ -0,0 +1,116 @@
|
||||
<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>
|
||||
7
src/views/UAVClue/StudyRecord/components/Wrong.vue
Normal file
7
src/views/UAVClue/StudyRecord/components/Wrong.vue
Normal file
@@ -0,0 +1,7 @@
|
||||
<template>
|
||||
<div>收藏</div>
|
||||
</template>
|
||||
|
||||
<script setup></script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
58
src/views/UAVClue/StudyRecord/index.vue
Normal file
58
src/views/UAVClue/StudyRecord/index.vue
Normal file
@@ -0,0 +1,58 @@
|
||||
<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