| | |
| | | </div> |
| | | <!-- 搜索 --> |
| | | <div> |
| | | <el-form :inline="true" :model="formLabelAlign" class="demo-form-inline" label-width="80px"> |
| | | <el-form :inline="true" :model="queryParam" class="demo-form-inline" label-width="80px"> |
| | | <el-form-item> |
| | | <el-input v-model="formLabelAlign.type" placeholder="题目名"></el-input> |
| | | <el-input v-model="queryParam.content" placeholder="题目名"></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-select v-model="formLabelAlign.region" placeholder="全部科目"> |
| | | <el-select v-model="queryParam.subjectId" placeholder="全部科目"> |
| | | <el-option label="全部科目" value="shanghai"></el-option> |
| | | <el-option label="语文" value="beijing"></el-option> |
| | | <el-option label="数学" value="beijing"></el-option> |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-select v-model="formLabelAlign.region" placeholder="选择题"> |
| | | <el-select v-model="queryParam.questionType" placeholder="选择题"> |
| | | <el-option label="选择题" value="shanghai"></el-option> |
| | | <el-option label="问答题" value="beijing"></el-option> |
| | | <el-option label="判断题" value="beijing"></el-option> |
| | |
| | | </div> |
| | | <!-- 表格 --> |
| | | <el-table v-loading="listLoading" :header-cell-style="getRowClass" :data="tableData" border style="width: 100%;"> |
| | | <el-table-column align="center" prop="title" label="题目名"> |
| | | <el-table-column align="center" prop="shortTitle" label="题目名"> |
| | | </el-table-column> |
| | | <el-table-column align="center" prop="subject" label="科目"> |
| | | <el-table-column align="center" prop="subjectName" label="科目"> |
| | | </el-table-column> |
| | | <el-table-column align="center" prop="type" label="题目类型"> |
| | | <el-table-column align="center" prop="questionTypeName" label="题型"> |
| | | </el-table-column> |
| | | <el-table-column align="center" prop="score" label="参考答案"> |
| | | <el-table-column align="center" prop="score" label="分数"> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center"> |
| | | <el-button type="text">编辑</el-button> |
| | | <el-button type="text">删除</el-button> |
| | | <el-table-column prop="difficult" label="难度" width="60px"/> |
| | | <el-table-column prop="createTime" label="创建时间" width="160px"/> |
| | | <el-table-column label="操作" align="center" width="220px"> |
| | | <template slot-scope="{row}"> |
| | | <el-button size="mini" @click="showQuestion(row)">预览</el-button> |
| | | <el-button size="mini" @click="editQuestion(row)">编辑</el-button> |
| | | <el-button size="mini" type="danger" @click="deleteQuestion(row)" class="link-left">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div class="block" style="display: flex; margin-top: 40px;"> |
| | |
| | | </div> |
| | | <!-- 填空 --> |
| | | <el-dialog :visible.sync="gapVisible" :close-on-click-modal="false"> |
| | | <gap ref="gap" @children="parentGoods" /> |
| | | <gap ref="gap" @children="parentGoods" @callback="callback" /> |
| | | </el-dialog> |
| | | <!-- 多选 --> |
| | | <el-dialog :visible.sync="multipleVisible" :close-on-click-modal="false"> |
| | | <multiple ref="multiple" @children="parentGoods" /> |
| | | <multiple ref="multiple" @children="parentGoods" @callback="callback" /> |
| | | </el-dialog> |
| | | <!-- 简答 --> |
| | | <el-dialog :visible.sync="shortVisible" :close-on-click-modal="false"> |
| | | <short ref="short" @children="parentGoods" /> |
| | | <short ref="short" @children="parentGoods" @callback="callback" /> |
| | | </el-dialog> |
| | | <!-- 单选 --> |
| | | <el-dialog :visible.sync="singleVisible" :close-on-click-modal="false"> |
| | | <single ref="single" @children="parentGoods" /> |
| | | <single ref="single" @children="parentGoods" @callback="callback" /> |
| | | </el-dialog> |
| | | <!-- 判断 --> |
| | | <el-dialog :visible.sync="truesVisible" :close-on-click-modal="false"> |
| | | <trues ref="trues" @children="parentGoods" /> |
| | | <trues ref="trues" @children="parentGoods" @callback="callback" /> |
| | | </el-dialog> |
| | | |
| | | <el-dialog :visible.sync="questionShow.dialog" style="width: 100%;height: 100%"> |
| | | <QuestionShow :qType="questionShow.qType" :question="questionShow.question" :qLoading="questionShow.loading"/> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | |
| | | import trues from "@/components/PopUp/true-false.vue"; |
| | | import { mapGetters, mapState } from 'vuex' |
| | | import questionApi from '@/api/question' |
| | | import QuestionShow from '@/components/PopUp/question/Show' |
| | | |
| | | export default { |
| | | // 注册 |
| | |
| | | short, |
| | | single, |
| | | trues, |
| | | QuestionShow |
| | | }, |
| | | data() { |
| | | return { |
| | | questionShow: { |
| | | qType: 0, |
| | | dialog: false, |
| | | question: null, |
| | | loading: false |
| | | }, |
| | | listLoading: true, |
| | | queryParam: { |
| | | questionType: null, |
| | | subjectId: null, |
| | | content: null, |
| | | pageIndex: 1, |
| | | pageSize: 10 |
| | | }, |
| | |
| | | shortVisible: false, |
| | | singleVisible: false, |
| | | truesVisible: false, |
| | | formLabelAlign: { |
| | | type: "", |
| | | user: "", |
| | | region: "", |
| | | }, |
| | | tableData: [], |
| | | }; |
| | | }, |
| | |
| | | this.search() |
| | | }, |
| | | methods: { |
| | | callback() { |
| | | this.gapVisible = false; |
| | | this.multipleVisible = false; |
| | | this.shortVisible = false; |
| | | this.singleVisible = false; |
| | | this.truesVisible = false; |
| | | this.search() |
| | | }, |
| | | // 获取列表 |
| | | search() { |
| | | this.listLoading = true |
| | | questionApi.pageList(this.queryParam).then(re => { |
| | | this.tableData = re.data |
| | | this.total = re.total |
| | | this.queryParam.pageIndex = re.pageNum |
| | | this.tableData = re.data.list |
| | | this.total = re.data.total |
| | | this.queryParam.pageSize = re.data.pageSize |
| | | this.queryParam.pageIndex = re.data.pageNum |
| | | this.listLoading = false |
| | | }) |
| | | }, |
| | |
| | | parentGoods(obj) { |
| | | console.log(obj, "弹窗组件的表单值"); |
| | | }, |
| | | showQuestion (row) { |
| | | let _this = this |
| | | this.questionShow.dialog = true |
| | | this.questionShow.loading = true |
| | | questionApi.select(row.id).then(re => { |
| | | _this.questionShow.qType = re.data.questionType |
| | | _this.questionShow.question = re.data |
| | | _this.questionShow.loading = false |
| | | }) |
| | | }, |
| | | editQuestion (row) { |
| | | let url = this.enumFormat(this.editUrlEnum, row.questionType) |
| | | this.$router.push({ path: url, query: { id: row.id } }) |
| | | }, |
| | | deleteQuestion (row) { |
| | | let _this = this |
| | | questionApi.deleteQuestion(row.id).then(re => { |
| | | if (re.code === 1) { |
| | | _this.search() |
| | | _this.$message.success(re.message) |
| | | } else { |
| | | _this.$message.error(re.message) |
| | | } |
| | | }) |
| | | }, |
| | | }, |
| | | computed: { |
| | | ...mapGetters('enumItem', ['enumFormat']), |
| | |
| | | questionTypeEnum: state => state.exam.question.typeEnum, |
| | | editUrlEnum: state => state.exam.question.editUrlEnum |
| | | }), |
| | | ...mapGetters('exam', ['subjectEnumFormat']), |
| | | ...mapState('exam', { subjects: state => state.subjects }) |
| | | } |
| | | }; |