|
|
@ -1,5 +1,5 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div class="app-container" style="text-align:center"> |
|
|
|
<div class="app-container" style="text-align: center"> |
|
|
|
<el-form size="small" :inline="true" label-width="68px" @submit.native.prevent> |
|
|
|
<el-form size="small" :inline="true" label-width="68px" @submit.native.prevent> |
|
|
|
<el-row :gutter="20"> |
|
|
|
<el-row :gutter="20"> |
|
|
|
<el-form-item label="车型"> |
|
|
|
<el-form-item label="车型"> |
|
|
@ -16,22 +16,24 @@ |
|
|
|
</el-radio-group> |
|
|
|
</el-radio-group> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-row> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<el-form-item> |
|
|
|
|
|
|
|
<el-checkbox v-model="queryParams.isWatermark" :label="true">是否有水印</el-checkbox> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="题目"> |
|
|
|
<el-form-item label="题目"> |
|
|
|
<el-input v-model="queryParams.question" placeholder="请输入题目" clearable style="width:400px" @keyup.enter.native="handleQuery" /> |
|
|
|
<el-input v-model="queryParams.question" placeholder="请输入题目" clearable style="width: 400px" @keyup.enter.native="handleQuery" /> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
|
|
|
<el-button type="primary" icon="el-icon-plus" @click="handleAdd">新增</el-button> |
|
|
|
<el-button type="primary" icon="el-icon-plus" @click="handleAdd">新增</el-button> |
|
|
|
|
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
|
|
|
|
<el-table v-loading="loading" :data="tableList" style="width:80%;margin:auto" @row-click="handleEdit"> |
|
|
|
<el-table v-loading="loading" :data="tableList" style="width: 80%; margin: auto" @row-click="handleEdit"> |
|
|
|
<el-table-column type="index" width="55" align="center" /> |
|
|
|
<el-table-column type="index" width="55" align="center" /> |
|
|
|
<el-table-column label="题目" align="center" prop="question" min-width="140" /> |
|
|
|
<el-table-column label="题目" align="center" prop="question" min-width="140" /> |
|
|
|
<el-table-column label="选项" align="center" min-width="140"> |
|
|
|
<el-table-column label="选项" align="center" min-width="140"> |
|
|
|
<template slot-scope="{row}"> |
|
|
|
<template slot-scope="{ row }"> |
|
|
|
<p v-if="row.chooseA">A:{{ row.chooseA }}</p> |
|
|
|
<p v-if="row.chooseA">A:{{ row.chooseA }}</p> |
|
|
|
<p v-if="row.chooseB">B:{{ row.chooseB }}</p> |
|
|
|
<p v-if="row.chooseB">B:{{ row.chooseB }}</p> |
|
|
|
<p v-if="row.chooseC">C:{{ row.chooseC }}</p> |
|
|
|
<p v-if="row.chooseC">C:{{ row.chooseC }}</p> |
|
|
@ -43,21 +45,26 @@ |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="答案" align="center" prop="trueAnswer" min-width="100" /> |
|
|
|
<el-table-column label="答案" align="center" prop="trueAnswer" min-width="100" /> |
|
|
|
<el-table-column label="科目" align="center" prop="subject" min-width="100"> |
|
|
|
<el-table-column label="科目" align="center" prop="subject" min-width="100"> |
|
|
|
<template slot-scope="{row}"> |
|
|
|
<template slot-scope="{ row }"> |
|
|
|
<p v-if="row.subject == 1">科一</p> |
|
|
|
<p v-if="row.subject == 1">科一</p> |
|
|
|
<p v-if="row.subject == 4">科四</p> |
|
|
|
<p v-if="row.subject == 4">科四</p> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="是否新规" align="center" min-width="100"> |
|
|
|
<el-table-column label="是否新规" align="center" min-width="100"> |
|
|
|
<template slot-scope="{row}"> |
|
|
|
<template slot-scope="{ row }"> |
|
|
|
{{ row.isNew ? '是' : '' }} |
|
|
|
{{ row.isNew ? '是' : '' }} |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="车型" align="center" min-width="100"> |
|
|
|
<el-table-column label="车型" align="center" min-width="100"> |
|
|
|
<template slot-scope="{row}"> |
|
|
|
<template slot-scope="{ row }"> |
|
|
|
{{ row.carTypeId == 1001 ? '小车' : '摩托车' }} |
|
|
|
{{ row.carTypeId == 1001 ? '小车' : '摩托车' }} |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column label="图片" align="center" min-width="200"> |
|
|
|
|
|
|
|
<template slot-scope="{ row }"> |
|
|
|
|
|
|
|
<img :src="row.imageUrl" alt="" width="80px" srcset=""> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button size="mini" type="text" icon="el-icon-download" @click="handleEdit(scope.row)">编辑</el-button> |
|
|
|
<el-button size="mini" type="text" icon="el-icon-download" @click="handleEdit(scope.row)">编辑</el-button> |
|
|
@ -68,7 +75,6 @@ |
|
|
|
<!-- <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" /> --> |
|
|
|
<!-- <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" /> --> |
|
|
|
<QuestionForm v-if="dialogVisible" ref="dialogForm" :dialog-visible="dialogVisible" @update="getList" /> |
|
|
|
<QuestionForm v-if="dialogVisible" ref="dialogForm" :dialog-visible="dialogVisible" @update="getList" /> |
|
|
|
<QuestionAddForm v-if="dialogAddVisible" ref="dialogAddForm" :dialog-visible="dialogAddVisible" @update="getList" /> |
|
|
|
<QuestionAddForm v-if="dialogAddVisible" ref="dialogAddForm" :dialog-visible="dialogAddVisible" @update="getList" /> |
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
@ -80,7 +86,8 @@ import QuestionAddForm from './components/QuestionAddForm.vue'; |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
name: 'Question', |
|
|
|
name: 'Question', |
|
|
|
components: { |
|
|
|
components: { |
|
|
|
QuestionForm, QuestionAddForm |
|
|
|
QuestionForm, |
|
|
|
|
|
|
|
QuestionAddForm |
|
|
|
}, |
|
|
|
}, |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
@ -106,7 +113,7 @@ export default { |
|
|
|
/** 查询文件列表 */ |
|
|
|
/** 查询文件列表 */ |
|
|
|
getList() { |
|
|
|
getList() { |
|
|
|
this.loading = true; |
|
|
|
this.loading = true; |
|
|
|
searchQuestion(this.queryParams).then(response => { |
|
|
|
searchQuestion(this.queryParams).then((response) => { |
|
|
|
this.tableList = response.data; |
|
|
|
this.tableList = response.data; |
|
|
|
// this.total = response.total; |
|
|
|
// this.total = response.total; |
|
|
|
this.loading = false; |
|
|
|
this.loading = false; |
|
|
@ -115,10 +122,10 @@ export default { |
|
|
|
|
|
|
|
|
|
|
|
/** 搜索按钮操作 */ |
|
|
|
/** 搜索按钮操作 */ |
|
|
|
handleQuery() { |
|
|
|
handleQuery() { |
|
|
|
if (this.queryParams.question) { |
|
|
|
if (this.queryParams.question || (this.queryParams.isWatermark != undefined && this.queryParams.isWatermark)) { |
|
|
|
this.getList(); |
|
|
|
this.getList(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.$modal.msgWarning('请输入题目'); |
|
|
|
this.$modal.msgWarning('请输入题目 '); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
/** 重置按钮操作 */ |
|
|
|
/** 重置按钮操作 */ |
|
|
@ -135,7 +142,10 @@ export default { |
|
|
|
handleAdd(item) { |
|
|
|
handleAdd(item) { |
|
|
|
this.dialogAddVisible = true; |
|
|
|
this.dialogAddVisible = true; |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.dialogAddForm.init(item); |
|
|
|
this.$refs.dialogAddForm.init({ |
|
|
|
|
|
|
|
subject: this.queryParams.subject, |
|
|
|
|
|
|
|
carTypeId: this.queryParams.carTypeId |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|