sc
This commit is contained in:
@@ -33,3 +33,19 @@ export const uploadFile = async (data) => {
|
||||
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
|
||||
})
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="章节" prop="chapter">
|
||||
<el-select v-model="dialogForm.chapter" style="width: 100%">
|
||||
@@ -63,7 +63,7 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="排序" prop="showOrder">
|
||||
<el-input
|
||||
@@ -75,7 +75,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="选项A" prop="chooseA">
|
||||
<el-input
|
||||
@@ -97,7 +97,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="选项C" prop="chooseC">
|
||||
<el-input
|
||||
@@ -136,6 +136,8 @@
|
||||
<el-form-item label="答案解析" prop="bestAnswer">
|
||||
<el-input
|
||||
v-model="dialogForm.bestAnswer"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 2 }"
|
||||
maxlength="1000"
|
||||
placeholder="请输入"
|
||||
clearable
|
||||
@@ -148,6 +150,8 @@
|
||||
<el-form-item label="快速记忆" prop="skillInfo">
|
||||
<el-input
|
||||
v-model="dialogForm.skillInfo"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 2 }"
|
||||
maxlength="1000"
|
||||
placeholder="请输入"
|
||||
clearable
|
||||
@@ -155,7 +159,6 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="技巧关键字" prop="skillWords">
|
||||
@@ -168,7 +171,21 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<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="#"
|
||||
@@ -179,7 +196,8 @@
|
||||
:show-file-list="false"
|
||||
>
|
||||
<img v-if="imgUrl" :src="imgUrl" style="width: 200px" />
|
||||
<i v-else class="el-icon-plus"></i>
|
||||
<!-- <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>
|
||||
@@ -244,6 +262,8 @@ const open = (info = undefined, opts) => {
|
||||
imgUrl.value = dialogForm.value.imageUrl.includes('http')
|
||||
? dialogForm.value.imageUrl
|
||||
: 'https://ss-cloud.ahduima.com/xjxc/pic/' + dialogForm.value.imageUrl
|
||||
} else {
|
||||
imgUrl.value = ''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,20 +4,29 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="无人机类型">
|
||||
<el-radio-group v-model="queryParams.modelId">
|
||||
<el-radio label="10001" value="10001">多旋翼</el-radio>
|
||||
<el-radio label="10002" value="10002">垂直起降固定翼</el-radio>
|
||||
<el-radio label="10003" value="10003">直升机</el-radio>
|
||||
<el-radio label="10004" value="10004">固定翼</el-radio>
|
||||
<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 label="20001" value="20001">视距内驾驶员</el-radio>
|
||||
<el-radio label="20002" value="20002">超视距驾驶员</el-radio>
|
||||
<el-radio label="20003" value="20003">教员</el-radio>
|
||||
<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>
|
||||
@@ -50,6 +59,7 @@
|
||||
</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>
|
||||
@@ -61,9 +71,9 @@
|
||||
v-loading="loading"
|
||||
:data="tableList"
|
||||
highlight-current-row
|
||||
max-height="calc(100vh - 320px)"
|
||||
max-height="calc(100vh - 260px)"
|
||||
>
|
||||
<el-table-column type="index" width="55" align="center" />
|
||||
<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 }">
|
||||
@@ -137,7 +147,12 @@
|
||||
<script setup name="UAV">
|
||||
import QuestionAddForm from './components/QuestionAddForm.vue'
|
||||
import { searchChapter } from '@/api/uav/chapter'
|
||||
import { searchQuestion, deleteQuestion } from '@/api/uav/question.js'
|
||||
import {
|
||||
searchQuestion,
|
||||
deleteQuestion,
|
||||
getCarTypeOptions,
|
||||
getDriverTypeOptions
|
||||
} from '@/api/uav/question.js'
|
||||
|
||||
const message = useMessage()
|
||||
|
||||
@@ -145,7 +160,7 @@ const loading = ref(false)
|
||||
const total = ref(0)
|
||||
const tableList = ref([])
|
||||
const queryParams = ref({
|
||||
question: '',
|
||||
question: undefined,
|
||||
modelId: undefined,
|
||||
typeId: undefined,
|
||||
isPic: undefined,
|
||||
@@ -154,9 +169,40 @@ const queryParams = ref({
|
||||
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 = () => {
|
||||
@@ -187,7 +233,7 @@ function handleQuery() {
|
||||
|
||||
const dialogAddForm = ref(null)
|
||||
function handleEdit(item) {
|
||||
dialogAddForm.value.open(item, chapterOptions.value)
|
||||
dialogAddForm.value.open({ ...item, chapter: Number(item.chapter) }, chapterOptions.value)
|
||||
}
|
||||
|
||||
function handleAdd() {
|
||||
|
||||
Reference in New Issue
Block a user