提交 fba6b253 authored 作者: 王鹏飞's avatar 王鹏飞

试题增加筛选

上级 9bcd159b
<template>
<div class="my-question-list" element-loading-text="加载中..." v-loading="!loaded">
<div class="my-question-list-hd">
<div class="select">
<el-select v-model="selectId" placeholder="选择课程" clearable @change="handleTypeChange">
<el-option v-for="item in selectList" :key="item.id" :label="item.category_name" :value="item.id"></el-option>
</el-select>
</div>
<div class="title"><slot name="title"></slot></div>
<div class="tools">
<span>选择题型</span>
......@@ -24,7 +29,7 @@
@on-remove="handleRemove"
@on-addCollection="handleAddCollection"
@on-removeCollection="handleRemoveCollection"
@on-goDetails="goDetails(item.num)"
@on-click="handleClick(item.num)"
></my-question-list-item>
</template>
<div class="empty" v-else>暂无试题</div>
......@@ -64,7 +69,9 @@ export default {
questionType: 0,
list: [],
total: 0,
currentPage: 1
currentPage: 1,
selectList: [],
selectId: ''
}
},
computed: {
......@@ -82,25 +89,14 @@ export default {
}
},
methods: {
// 跳详情
goDetails(i) {
window.localStorage.removeItem('answerRecord')
this.$router.push({
path: '/my/questions/details',
query: {
type: this.requestParams.type,
qType: this.questionType,
index: i
}
})
},
// 获取试题列表
getMyQuestions() {
this.loaded = false
const params = Object.assign({}, this.requestParams, {
question_type: this.questionType,
page: this.currentPage,
page_size: 10
page_size: 10,
category_id: this.selectId
})
api
.getMyQuestions(params)
......@@ -111,6 +107,7 @@ export default {
item.checked = false
return item
})
this.selectList = response.all_category
this.$emit('request-success', response)
})
.finally(() => {
......@@ -163,6 +160,14 @@ export default {
this.$message({ message: '删除成功', type: 'success' })
this.getMyQuestions()
})
},
// 跳详情
handleClick(index) {
window.localStorage.removeItem('answerRecord')
this.$router.push({
path: '/my/questions/details',
query: { type: this.requestParams.type, qType: this.questionType, index }
})
}
},
beforeMount() {
......
......@@ -2,7 +2,7 @@
<div class="my-question-list-item">
<el-checkbox v-model="data.checked"></el-checkbox>
<div class="badge" :class="`questiont-type_${data.question_type}`">{{ questionTypeName }}</div>
<div class="name" v-html="data.question_content" @click="goDetails"></div>
<div class="name" v-html="data.question_content" @click="$emti('on-click')"></div>
<div class="tools">
<i class="el-icon-delete" @click="$emit('on-remove', data)"></i>
<i
......@@ -35,9 +35,6 @@ export default {
methods: {
toggleCollection() {
this.data.is_collection ? this.$emit('on-removeCollection', this.data) : this.$emit('on-addCollection', this.data)
},
goDetails() {
this.$emit('on-goDetails')
}
}
}
......
<template>
<app-container title="个人信息"> </app-container>
<app-container title="个人信息">
<el-form :model="ruleForm" :rules="rules" label-width="120px" ref="ruleForm" class="form">
<el-form-item label="所在院校" prop="phone">
<el-input type="password" v-model="ruleForm.phone"></el-input>
</el-form-item>
<el-form-item label="学院名称" prop="phone">
<el-input type="password" v-model="ruleForm.phone"></el-input>
</el-form-item>
<el-form-item label="专业名称" prop="phone">
<el-input type="password" v-model="ruleForm.phone"></el-input>
</el-form-item>
<el-form-item label="考证等级" prop="phone">
<el-input type="password" v-model="ruleForm.phone"></el-input>
</el-form-item>
<el-form-item label="用户真实姓名" prop="phone">
<el-input type="password" v-model="ruleForm.phone"></el-input>
</el-form-item>
<el-form-item label="身份证号码" prop="phone">
<el-input type="password" v-model="ruleForm.phone"></el-input>
</el-form-item>
<el-form-item label="身份" prop="phone">
<el-input type="password" v-model="ruleForm.phone"></el-input>
</el-form-item>
<el-form-item label="登录帐号" prop="phone">
<el-input type="password" v-model="ruleForm.phone"></el-input>
</el-form-item>
<el-form-item label="账号名" prop="phone">
<el-input type="password" v-model="ruleForm.phone"></el-input>
</el-form-item>
<el-form-item label="常用邮箱" prop="phone">
<el-input type="password" v-model="ruleForm.phone"></el-input>
</el-form-item>
</el-form>
<template #footer>
<div class="app-container-ft">
<el-button type="primary" :loading="submitLoading" @click="handleSubmit">保存</el-button>
</div>
</template>
</app-container>
</template>
<script>
import AppContainer from '@/components/AppContainer'
import * as api from '@/api/account'
export default {
components: { AppContainer }
components: { AppContainer },
data() {
return {
ruleForm: {
phone: ''
},
rules: {
phone: [{ required: true, message: '请输入手机号码', trigger: 'blur' }]
},
submitLoading: false
}
},
computed: {
user() {
return this.$store.state.user
}
},
methods: {
handleSubmit() {
this.$refs.ruleForm.validate().then(this.handleSubmitRequest)
},
handleSubmitRequest() {
this.submitLoading = true
api
.updatePassword(this.ruleForm)
.then(response => {
this.$message({ message: '密码修改成功', type: 'success' })
})
.finally(() => {
this.submitLoading = false
})
}
}
}
</script>
<style lang="scss" scoped>
.form {
max-width: 360px;
}
</style>
<template>
<app-container title="安全设置">
<el-form :model="ruleForm" :rules="rules" label-width="100px" ref="ruleForm" class="form">
<el-form :model="ruleForm" :rules="rules" label-width="90px" ref="ruleForm" class="form">
<el-form-item label="手机号码" prop="phone">
<el-input type="password" v-model="ruleForm.phone"></el-input>
</el-form-item>
......
......@@ -8,7 +8,7 @@ const httpRequest = axios.create({
withCredentials: true,
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
tenant: 'transport'
tenant: 'x1'
}
})
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论