|
@@ -16,7 +16,7 @@
|
|
|
:label-width="formLabelWidth"
|
|
:label-width="formLabelWidth"
|
|
|
:model="form"
|
|
:model="form"
|
|
|
:rules="rules"
|
|
:rules="rules"
|
|
|
- class="question-form"
|
|
|
|
|
|
|
+ class="paper-form"
|
|
|
@submit.native.prevent
|
|
@submit.native.prevent
|
|
|
>
|
|
>
|
|
|
<el-form-item label="题库名称:" prop="ti_ku_ming_cheng_">
|
|
<el-form-item label="题库名称:" prop="ti_ku_ming_cheng_">
|
|
@@ -44,6 +44,18 @@
|
|
|
<el-radio label="不可用">不可用</el-radio>
|
|
<el-radio label="不可用">不可用</el-radio>
|
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
+ <el-form-item prop="shi_fou_gong_kai_">
|
|
|
|
|
+ <template slot="label">
|
|
|
|
|
+ 是否公开
|
|
|
|
|
+ <el-tooltip effect="dark" content="限制该题库是否可自主考核。若您希望该题库仅用于考试中,则需要设置为“否" placement="top">
|
|
|
|
|
+ <i class="el-icon-question question-icon">:</i>
|
|
|
|
|
+ </el-tooltip>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <el-radio-group v-model="form.shi_fou_gong_kai_">
|
|
|
|
|
+ <el-radio label="是">是</el-radio>
|
|
|
|
|
+ <el-radio label="否">否</el-radio>
|
|
|
|
|
+ </el-radio-group>
|
|
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="所属范围:" prop="suo_shu_fan_wei_" class="inline-item">
|
|
<el-form-item label="所属范围:" prop="suo_shu_fan_wei_" class="inline-item">
|
|
|
<el-radio-group v-model="form.suo_shu_fan_wei_">
|
|
<el-radio-group v-model="form.suo_shu_fan_wei_">
|
|
|
<el-radio label="科级">科级</el-radio>
|
|
<el-radio label="科级">科级</el-radio>
|
|
@@ -135,12 +147,124 @@
|
|
|
<el-input v-model="form.miao_shu_" type="textarea" :rows="4" placeholder="请输入描述内容" />
|
|
<el-input v-model="form.miao_shu_" type="textarea" :rows="4" placeholder="请输入描述内容" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
|
|
+ <div class="question-table">
|
|
|
|
|
+ <el-table
|
|
|
|
|
+ ref="elTable"
|
|
|
|
|
+ :data="questionData"
|
|
|
|
|
+ border
|
|
|
|
|
+ stripe
|
|
|
|
|
+ highlight-current-row
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ max-height="400px"
|
|
|
|
|
+ class="exam-table"
|
|
|
|
|
+ @row-dblclick="handleRowDblclick"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-table-column label="序号" type="index" width="50" />
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ prop="content"
|
|
|
|
|
+ label="题干"
|
|
|
|
|
+ min-width="150"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-popover trigger="hover" placement="top">
|
|
|
|
|
+ <div class="question-info">
|
|
|
|
|
+ <div class="question-info-item">
|
|
|
|
|
+ <div class="label">出题人</div>
|
|
|
|
|
+ <div class="value">{{ transformUser(scope.row.creator) }}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="question-info-item">
|
|
|
|
|
+ <div class="label">选项类型</div>
|
|
|
|
|
+ <div class="value">{{ scope.row.optionType || '—' }}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="question-info-item">
|
|
|
|
|
+ <div class="label">评分方式</div>
|
|
|
|
|
+ <div class="value">{{ scope.row.rateType }}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="question-info-item">
|
|
|
|
|
+ <div class="label">评分人</div>
|
|
|
|
|
+ <div class="value">{{ scope.row.rater || '—' }}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="question-info-item">
|
|
|
|
|
+ <div class="label">标签</div>
|
|
|
|
|
+ <div class="value">{{ scope.row.quesTag }}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="question-info-item">
|
|
|
|
|
+ <div class="label">状态</div>
|
|
|
|
|
+ <div class="value">{{ scope.row.quesState }}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div slot="reference" class="name-wrapper">{{ scope.row.content }}</div>
|
|
|
|
|
+ </el-popover>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ prop="quesType"
|
|
|
|
|
+ label="题型"
|
|
|
|
|
+ width="70"
|
|
|
|
|
+ />
|
|
|
|
|
+ <!-- <el-table-column
|
|
|
|
|
+ prop="optionType"
|
|
|
|
|
+ label="选项类型"
|
|
|
|
|
+ width="70"
|
|
|
|
|
+ />
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ prop="rateType"
|
|
|
|
|
+ label="评分方式"
|
|
|
|
|
+ width="70"
|
|
|
|
|
+ />
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ prop="rater"
|
|
|
|
|
+ label="评分人"
|
|
|
|
|
+ width="70"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <div>{{ transformUser(scope.row.rater) }}</div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column> -->
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ prop="score"
|
|
|
|
|
+ label="分值"
|
|
|
|
|
+ width="75"
|
|
|
|
|
+ sortable
|
|
|
|
|
+ />
|
|
|
|
|
+ <!-- <el-table-column
|
|
|
|
|
+ prop="creator"
|
|
|
|
|
+ label="出题人"
|
|
|
|
|
+ width="70"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <div>{{ transformUser(scope.row.creator) }}</div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column> -->
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ prop="createTime"
|
|
|
|
|
+ label="出题时间"
|
|
|
|
|
+ width="150"
|
|
|
|
|
+ sortable
|
|
|
|
|
+ />
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ fixed="right"
|
|
|
|
|
+ label="操作"
|
|
|
|
|
+ width="60"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-button type="text" size="small" @click="handleRowDblclick(scope.row)">修改</el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ </div>
|
|
|
<div slot="footer" class="el-dialog--center">
|
|
<div slot="footer" class="el-dialog--center">
|
|
|
<ibps-toolbar
|
|
<ibps-toolbar
|
|
|
:actions="toolbars"
|
|
:actions="toolbars"
|
|
|
@action-event="handleActionEvent"
|
|
@action-event="handleActionEvent"
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <ques-edit
|
|
|
|
|
+ v-if="questionDialogVisible"
|
|
|
|
|
+ :id="quesId"
|
|
|
|
|
+ :visible.sync="questionDialogVisible"
|
|
|
|
|
+ @close="questionDialogVisible = false"
|
|
|
|
|
+ />
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -148,6 +272,9 @@
|
|
|
import ActionUtils from '@/utils/action'
|
|
import ActionUtils from '@/utils/action'
|
|
|
import { paperTypeOptions } from '../constants'
|
|
import { paperTypeOptions } from '../constants'
|
|
|
export default {
|
|
export default {
|
|
|
|
|
+ components: {
|
|
|
|
|
+ QuesEdit: () => import('../question/edit')
|
|
|
|
|
+ },
|
|
|
props: {
|
|
props: {
|
|
|
visible: {
|
|
visible: {
|
|
|
type: Boolean,
|
|
type: Boolean,
|
|
@@ -164,11 +291,13 @@ export default {
|
|
|
userList,
|
|
userList,
|
|
|
paperTypeOptions,
|
|
paperTypeOptions,
|
|
|
deptList: deptList.filter(i => i.depth === 4),
|
|
deptList: deptList.filter(i => i.depth === 4),
|
|
|
- title: '创建题库',
|
|
|
|
|
|
|
+ title: this.id ? '编辑题库' : '创建题库',
|
|
|
formLabelWidth: '120px',
|
|
formLabelWidth: '120px',
|
|
|
dialogVisible: this.visible,
|
|
dialogVisible: this.visible,
|
|
|
dialogLoading: false,
|
|
dialogLoading: false,
|
|
|
- filePreviewVisible: false,
|
|
|
|
|
|
|
+ questionData: [],
|
|
|
|
|
+ questionDialogVisible: false,
|
|
|
|
|
+ quesId: '',
|
|
|
form: {
|
|
form: {
|
|
|
bian_zhi_bu_men_: '',
|
|
bian_zhi_bu_men_: '',
|
|
|
bian_zhi_ren_: userId,
|
|
bian_zhi_ren_: userId,
|
|
@@ -178,6 +307,7 @@ export default {
|
|
|
ti_ku_fen_lei_: paperTypeOptions.length ? paperTypeOptions[0].value : '',
|
|
ti_ku_fen_lei_: paperTypeOptions.length ? paperTypeOptions[0].value : '',
|
|
|
ti_ku_zhuang_tai_: '可用',
|
|
ti_ku_zhuang_tai_: '可用',
|
|
|
xian_kao_ci_shu_: '不限',
|
|
xian_kao_ci_shu_: '不限',
|
|
|
|
|
+ shi_fou_gong_kai_: '是',
|
|
|
ping_fen_ren_: '',
|
|
ping_fen_ren_: '',
|
|
|
da_biao_zhan_bi_: 60,
|
|
da_biao_zhan_bi_: 60,
|
|
|
miao_shu_: '',
|
|
miao_shu_: '',
|
|
@@ -203,6 +333,7 @@ export default {
|
|
|
suo_shu_fan_wei_: [{ required: true, message: this.$t('validate.required') }],
|
|
suo_shu_fan_wei_: [{ required: true, message: this.$t('validate.required') }],
|
|
|
bian_zhi_bu_men_: [{ required: true, message: this.$t('validate.required') }],
|
|
bian_zhi_bu_men_: [{ required: true, message: this.$t('validate.required') }],
|
|
|
ti_ku_fen_lei_: [{ required: true, message: this.$t('validate.required') }],
|
|
ti_ku_fen_lei_: [{ required: true, message: this.$t('validate.required') }],
|
|
|
|
|
+ shi_fou_gong_kai_: [{ required: true, message: this.$t('validate.required') }],
|
|
|
ti_ku_zhuang_tai_: [{ required: true, message: this.$t('validate.required') }],
|
|
ti_ku_zhuang_tai_: [{ required: true, message: this.$t('validate.required') }],
|
|
|
xian_kao_ci_shu_: [{ required: true, message: this.$t('validate.required') }],
|
|
xian_kao_ci_shu_: [{ required: true, message: this.$t('validate.required') }],
|
|
|
kao_shi_shi_chang: [{ required: true, message: this.$t('validate.required') }],
|
|
kao_shi_shi_chang: [{ required: true, message: this.$t('validate.required') }],
|
|
@@ -214,9 +345,6 @@ export default {
|
|
|
computed: {
|
|
computed: {
|
|
|
formId () {
|
|
formId () {
|
|
|
return this.id
|
|
return this.id
|
|
|
- },
|
|
|
|
|
- formData () {
|
|
|
|
|
- return this.data
|
|
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
watch: {
|
|
watch: {
|
|
@@ -267,6 +395,15 @@ export default {
|
|
|
]
|
|
]
|
|
|
return this.userList
|
|
return this.userList
|
|
|
},
|
|
},
|
|
|
|
|
+ transformUser (userId) {
|
|
|
|
|
+ const { userList = [] } = this.$store.getters
|
|
|
|
|
+ const user = userList.find(u => u.userId === userId) || {}
|
|
|
|
|
+ return user.userName || '-'
|
|
|
|
|
+ },
|
|
|
|
|
+ handleRowDblclick (row) {
|
|
|
|
|
+ this.quesId = row.quesId
|
|
|
|
|
+ this.questionDialogVisible = true
|
|
|
|
|
+ },
|
|
|
handleActionEvent ({ key }) {
|
|
handleActionEvent ({ key }) {
|
|
|
switch (key) {
|
|
switch (key) {
|
|
|
case 'submit':
|
|
case 'submit':
|
|
@@ -284,24 +421,29 @@ export default {
|
|
|
if (this.$utils.isEmpty(this.formId)) {
|
|
if (this.$utils.isEmpty(this.formId)) {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
- const sql = `select id_, bian_zhi_ren_, bian_zhi_bu_men_, bian_zhi_shi_jian, ti_ku_ming_cheng_, ti_ku_fen_lei_, ti_ku_zhuang_tai_, xian_kao_ci_shu_, ping_fen_ren_, miao_shu_, suo_shu_fan_wei_, kao_shi_shi_chang, da_biao_zhan_bi_ from t_question_bank where id_ = '${this.formId}'`
|
|
|
|
|
- this.$common.request('sql', sql).then(res => {
|
|
|
|
|
- const { data = [] } = res.variables || {}
|
|
|
|
|
- if (!data.length) {
|
|
|
|
|
|
|
+ const sql1 = `select id_, bian_zhi_ren_, bian_zhi_bu_men_, bian_zhi_shi_jian, ti_ku_ming_cheng_, ti_ku_fen_lei_, ti_ku_zhuang_tai_, shi_fou_gong_kai_, xian_kao_ci_shu_, ping_fen_ren_, miao_shu_, suo_shu_fan_wei_, kao_shi_shi_chang, da_biao_zhan_bi_ from t_question_bank where id_ = '${this.formId}'`
|
|
|
|
|
+ const sql2 = `select id_ as quesId, chu_ti_ren_ as creator, bu_men_ as createDept, chu_ti_shi_jian_ as createTime, xu_hao_ as sn, ti_gan_ as content, ti_xing_ as quesType, xuan_xiang_lei_xi as optionType, zheng_que_da_an_ as answer, ping_fen_fang_shi as rateType, ping_fen_ren_ as rater, fen_zhi_ as score, biao_qian_ as quesTag, zhuang_tai_ as quesState from t_questions where parent_id_ = '${this.formId}'`
|
|
|
|
|
+ Promise.all([this.$common.request('sql', sql1), this.$common.request('sql', sql2)]).then(([res1, res2]) => {
|
|
|
|
|
+ const { data: bankData = [] } = res1.variables || {}
|
|
|
|
|
+ const { data: questionData = [] } = res2.variables || {}
|
|
|
|
|
+ if (!bankData.length) {
|
|
|
this.$message.error('数据不存在')
|
|
this.$message.error('数据不存在')
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
- data[0].isLimit = data[0].xian_kao_ci_shu_ === '不限' ? '0' : '1'
|
|
|
|
|
- if (data[0].kao_shi_shi_chang === '不限') {
|
|
|
|
|
- data[0].limitTime = '0'
|
|
|
|
|
- data[0].hours = null
|
|
|
|
|
- data[0].minutes = null
|
|
|
|
|
|
|
+ const bank = bankData[0]
|
|
|
|
|
+ bank.isLimit = bank.xian_kao_ci_shu_ === '不限' ? '0' : '1'
|
|
|
|
|
+ if (bank.kao_shi_shi_chang === '不限') {
|
|
|
|
|
+ bank.limitTime = '0'
|
|
|
|
|
+ bank.hours = null
|
|
|
|
|
+ bank.minutes = null
|
|
|
} else {
|
|
} else {
|
|
|
- data[0].limitTime = '1'
|
|
|
|
|
- data[0].hours = Math.floor(data[0].kao_shi_shi_chang / (1000 * 60 * 60))
|
|
|
|
|
- data[0].minutes = (data[0].kao_shi_shi_chang % (1000 * 60 * 60)) / (60 * 1000)
|
|
|
|
|
|
|
+ bank.limitTime = '1'
|
|
|
|
|
+ bank.hours = Math.floor(bank.kao_shi_shi_chang / (1000 * 60 * 60))
|
|
|
|
|
+ bank.minutes = (bank.kao_shi_shi_chang % (1000 * 60 * 60)) / (60 * 1000)
|
|
|
}
|
|
}
|
|
|
- this.form = data[0]
|
|
|
|
|
|
|
+ console.log(questionData)
|
|
|
|
|
+ this.questionData = questionData
|
|
|
|
|
+ this.form = bank
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
handleSubmit () {
|
|
handleSubmit () {
|
|
@@ -360,17 +502,28 @@ export default {
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
.paper-dialog {
|
|
.paper-dialog {
|
|
|
::v-deep {
|
|
::v-deep {
|
|
|
|
|
+ .el-dialog {
|
|
|
|
|
+ min-width: 1080px;
|
|
|
|
|
+ }
|
|
|
.el-dialog__body {
|
|
.el-dialog__body {
|
|
|
height: calc(88vh - 200px);
|
|
height: calc(88vh - 200px);
|
|
|
}
|
|
}
|
|
|
.el-form-item {
|
|
.el-form-item {
|
|
|
margin-bottom: 14px !important;
|
|
margin-bottom: 14px !important;
|
|
|
- padding: 0 20px;
|
|
|
|
|
|
|
+ &:last-child {
|
|
|
|
|
+ margin-bottom: 0 !important;
|
|
|
|
|
+ }
|
|
|
|
|
+ .el-form-item__label {
|
|
|
|
|
+ font-size: 14px !important;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
.el-form-item--small .el-form-item__error {
|
|
.el-form-item--small .el-form-item__error {
|
|
|
padding-top: 6px;
|
|
padding-top: 6px;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ .paper-form {
|
|
|
|
|
+ padding: 20px;
|
|
|
|
|
+ }
|
|
|
.inline-item {
|
|
.inline-item {
|
|
|
::v-deep {
|
|
::v-deep {
|
|
|
.el-radio-group {
|
|
.el-radio-group {
|
|
@@ -385,5 +538,40 @@ export default {
|
|
|
display: inline-block;
|
|
display: inline-block;
|
|
|
margin: 0 20px 0 5px;
|
|
margin: 0 20px 0 5px;
|
|
|
}
|
|
}
|
|
|
|
|
+ .question-table {
|
|
|
|
|
+ margin-bottom: 20px;
|
|
|
|
|
+ padding: 0 20px;
|
|
|
|
|
+ ::v-deep {
|
|
|
|
|
+ .el-table {
|
|
|
|
|
+ th {
|
|
|
|
|
+ font-size: 14px !important;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ }
|
|
|
|
|
+ td {
|
|
|
|
|
+ font-size: 14px !important;
|
|
|
|
|
+ }
|
|
|
|
|
+ .el-table__row {
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ .question-info {
|
|
|
|
|
+ .question-info-item {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ margin-bottom: 10px;
|
|
|
|
|
+ max-width: 200px;
|
|
|
|
|
+ .label {
|
|
|
|
|
+ width: 100px;
|
|
|
|
|
+ font-size: 14px;
|
|
|
|
|
+ color: #606266;
|
|
|
|
|
+ text-align: right;
|
|
|
|
|
+ margin-right: 10px;
|
|
|
|
|
+ }
|
|
|
|
|
+ .value {
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|