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

chore: upgrade to vue 2.7

上级 11a39ecc
module.exports = { module.exports = {
env: { root: true,
node: true env: { node: true },
}, extends: ['eslint:recommended', 'plugin:vue/essential'],
extends: ['plugin:vue/essential', 'standard'],
rules: { rules: {
'vue/no-mutating-props': 'off', // 暂时关闭 'vue/no-mutating-props': 'off', // 暂时关闭
'vue/comment-directive': 'off', 'vue/multi-word-component-names': 'off'
'vue/multi-word-component-names': 'off',
'space-before-function-paren': 'off'
} }
} }
...@@ -2,7 +2,7 @@ const fs = require('fs') ...@@ -2,7 +2,7 @@ const fs = require('fs')
const path = require('path') const path = require('path')
const axios = require('axios') const axios = require('axios')
const domain = 'dev.ezijing.com' const domain = 'ezijing.com'
const outputPath = './https' const outputPath = './https'
......
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
}
},
"exclude": ["node_modules", "dist"],
"vueCompilerOptions": {
"target": 2.7
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -12,29 +12,24 @@ ...@@ -12,29 +12,24 @@
}, },
"dependencies": { "dependencies": {
"@tinymce/tinymce-vue": "^3.2.8", "@tinymce/tinymce-vue": "^3.2.8",
"@vitejs/plugin-vue2": "^2.2.0",
"axios": "^0.26.1", "axios": "^0.26.1",
"blueimp-md5": "^2.19.0", "blueimp-md5": "^2.19.0",
"clipboard": "^2.0.11", "clipboard": "^2.0.11",
"element-ui": "^2.15.8", "element-ui": "^2.15.12",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"query-string": "^7.1.1", "query-string": "^7.1.3",
"vue": "^2.6.14", "vue": "^2.7.14",
"vue-router": "^3.5.3", "vue-router": "^3.6.5",
"vuex": "^3.6.2" "vuex": "^3.6.2"
}, },
"devDependencies": { "devDependencies": {
"ali-oss": "^6.17.1", "ali-oss": "^6.17.1",
"chalk": "^4.1.2", "chalk": "^4.1.2",
"eslint": "^8.15.0", "eslint": "^8.32.0",
"eslint-config-standard": "^17.0.0", "eslint-plugin-vue": "^9.9.0",
"eslint-plugin-import": "^2.26.0", "sass": "1.57.1",
"eslint-plugin-node": "^11.1.0", "vite": "^4.0.4",
"eslint-plugin-promise": "^6.0.0", "vite-plugin-checker": "^0.5.3"
"eslint-plugin-vue": "^8.7.1",
"sass": "1.51.0",
"vite": "^2.9.10",
"vite-plugin-checker": "^0.4.6",
"vite-plugin-vue2": "^2.0.1",
"vue-template-compiler": "^2.6.14"
} }
} }
...@@ -19,7 +19,7 @@ export default function (blobInfo, succFun, failFun) { ...@@ -19,7 +19,7 @@ export default function (blobInfo, succFun, failFun) {
failFun('上传失败') failFun('上传失败')
}) })
}) })
.catch(response => { .catch(() => {
failFun('获取Signature失败') failFun('获取Signature失败')
}) })
} }
...@@ -4,8 +4,7 @@ ...@@ -4,8 +4,7 @@
<span style="color: #c01c40">*</span>考试名称:<el-input <span style="color: #c01c40">*</span>考试名称:<el-input
v-model="name" v-model="name"
placeholder="请输入考试名称" placeholder="请输入考试名称"
style="width: 398px; margin-left: 20px" style="width: 398px; margin-left: 20px"></el-input>
></el-input>
</el-row> </el-row>
<el-row :span="24" class="row_margin"> <el-row :span="24" class="row_margin">
<span style="color: #c01c40">*</span>考试时间: <span style="color: #c01c40">*</span>考试时间:
...@@ -15,8 +14,7 @@ ...@@ -15,8 +14,7 @@
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss">
>
</el-date-picker> </el-date-picker>
</el-row> </el-row>
<el-row :span="24" class="row_margin"> <el-row :span="24" class="row_margin">
...@@ -24,18 +22,13 @@ ...@@ -24,18 +22,13 @@
开考前<el-input 开考前<el-input
v-model="config.before_login" v-model="config.before_login"
class="input_time" class="input_time"
:disabled="config.enabled_before === false" :disabled="config.enabled_before === false"></el-input
></el-input
>分钟,考生可以登录系统,确认信息。(开考最多60分钟提前登录) >分钟,考生可以登录系统,确认信息。(开考最多60分钟提前登录)
</el-row> </el-row>
<el-row :span="24" class="row_margin"> <el-row :span="24" class="row_margin">
<el-checkbox v-model="config.enabled_after">限制结束 </el-checkbox> <el-checkbox v-model="config.enabled_after">限制结束 </el-checkbox>
开考后 开考后
<el-input <el-input v-model="config.after_login" class="input_time" :disabled="config.enabled_after === false"></el-input
v-model="config.after_login"
class="input_time"
:disabled="config.enabled_after === false"
></el-input
>分钟,不允许考生入场,考中退出的考生不受此影响。 >分钟,不允许考生入场,考中退出的考生不受此影响。
</el-row> </el-row>
<el-row :span="24" class="row_margin"> <el-row :span="24" class="row_margin">
...@@ -48,12 +41,7 @@ ...@@ -48,12 +41,7 @@
<v-editor v-model="config.welcome_message" class="editor"></v-editor> <v-editor v-model="config.welcome_message" class="editor"></v-editor>
</el-row> </el-row>
<el-row :span="24" class="btn_next row_margin"> <el-row :span="24" class="btn_next row_margin">
<el-button <el-button type="primary" v-if="$route.query.isEdit === '2'" @click="saveExamInfo">保存</el-button>
type="primary"
v-if="$route.query.isEdit === '2'"
@click="saveExamInfo"
>保存</el-button
>
<div v-if="isEdit === '1'"> <div v-if="isEdit === '1'">
<el-button type="primary" disabled>上一步</el-button> <el-button type="primary" disabled>上一步</el-button>
<el-button type="primary" @click="nextStep">下一步</el-button> <el-button type="primary" @click="nextStep">下一步</el-button>
...@@ -92,10 +80,7 @@ export default { ...@@ -92,10 +80,7 @@ export default {
return this.exam_time[0] return this.exam_time[0]
}, },
end_time() { end_time() {
if ( if (new Date('2037-01-01 00:00:00').getTime() < new Date(this.exam_time[1]).getTime()) {
new Date('2037-01-01 00:00:00').getTime() <
new Date(this.exam_time[1]).getTime()
) {
return '2037-01-01 00:00:00' return '2037-01-01 00:00:00'
} else { } else {
return this.exam_time[1] return this.exam_time[1]
...@@ -112,7 +97,7 @@ export default { ...@@ -112,7 +97,7 @@ export default {
}, },
methods: { methods: {
getDetailInfo() { getDetailInfo() {
getExamPaperDetail({ id: this.exam_id }).then((res) => { getExamPaperDetail({ id: this.exam_id }).then(res => {
console.log(res) console.log(res)
const detailList = res.data.exam_info const detailList = res.data.exam_info
this.exam_time = [detailList.start_time, detailList.end_time] this.exam_time = [detailList.start_time, detailList.end_time]
...@@ -132,11 +117,7 @@ export default { ...@@ -132,11 +117,7 @@ export default {
this.$message.warning('请输入考试名称') this.$message.warning('请输入考试名称')
return return
} }
if ( if ((!this.start_time && !this.end_time) || !this.start_time || !this.end_time) {
(!this.start_time && !this.end_time) ||
!this.start_time ||
!this.end_time
) {
this.$message.warning('请选择考试时间') this.$message.warning('请选择考试时间')
return return
} }
...@@ -182,7 +163,7 @@ export default { ...@@ -182,7 +163,7 @@ export default {
} }
} }
updateExam(params).then((res) => { updateExam(params).then(() => {
history.go(-1) history.go(-1)
}) })
} }
......
...@@ -5,8 +5,7 @@ ...@@ -5,8 +5,7 @@
style="margin-bottom: 10px; width: 200px" style="margin-bottom: 10px; width: 200px"
clearable clearable
@change="handleSearch" @change="handleSearch"
@clear="handleSearch" @clear="handleSearch"></el-input>
></el-input>
<el-button type="primary" size="small" style="margin-left: 10px" @click="handleSearch">搜索</el-button> <el-button type="primary" size="small" style="margin-left: 10px" @click="handleSearch">搜索</el-button>
<el-button type="plain" size="small" @click="handleReset">重置</el-button> <el-button type="plain" size="small" @click="handleReset">重置</el-button>
<el-transfer <el-transfer
...@@ -15,8 +14,7 @@ ...@@ -15,8 +14,7 @@
style="margin-top: 10px" style="margin-top: 10px"
v-model="q" v-model="q"
:props="transferProps" :props="transferProps"
@change="handleChange" @change="handleChange">
>
</el-transfer> </el-transfer>
<el-pagination <el-pagination
:hide-on-single-page="true" :hide-on-single-page="true"
...@@ -24,8 +22,7 @@ ...@@ -24,8 +22,7 @@
layout="total, prev, pager, next" layout="total, prev, pager, next"
:total="total" :total="total"
:page-size="limit" :page-size="limit"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"></el-pagination>
></el-pagination>
<el-card style="margin-top: 30px"> <el-card style="margin-top: 30px">
<ul style="margin-top: 20px"> <ul style="margin-top: 20px">
<li class="paper_desc">考生的试卷会从以上已选的试卷中随机抽取</li> <li class="paper_desc">考生的试卷会从以上已选的试卷中随机抽取</li>
...@@ -135,7 +132,7 @@ export default { ...@@ -135,7 +132,7 @@ export default {
return return
} }
const params = { id: this.$route.query.exam_id, type: 'paper', exam_paper: this.q.toString() } const params = { id: this.$route.query.exam_id, type: 'paper', exam_paper: this.q.toString() }
updateExam(params).then(res => { updateExam(params).then(() => {
history.go(-1) history.go(-1)
}) })
}, },
......
...@@ -13,8 +13,7 @@ ...@@ -13,8 +13,7 @@
v-model="config.ip_limits" v-model="config.ip_limits"
placeholder="如允许多个IP地址,请用英文逗号隔开" placeholder="如允许多个IP地址,请用英文逗号隔开"
style="width: 250px" style="width: 250px"
:disabled="config.enabled_ip_limit === false" :disabled="config.enabled_ip_limit === false"></el-input>
></el-input>
<span>您当前所在网络的IP地址是:{{ ip }}</span> <span>您当前所在网络的IP地址是:{{ ip }}</span>
</div> </div>
</div> </div>
...@@ -40,8 +39,7 @@ ...@@ -40,8 +39,7 @@
记录考生登录考试次数,只允许登录<el-input 记录考生登录考试次数,只允许登录<el-input
style="width: 100px" style="width: 100px"
v-model="config.max_login_times" v-model="config.max_login_times"
:disabled="config.enabled_lock === false" :disabled="config.enabled_lock === false"></el-input
></el-input
> >
</div> </div>
<div>当登录考试次数超过限定次数,系统会阻止考生登录考试</div> <div>当登录考试次数超过限定次数,系统会阻止考生登录考试</div>
...@@ -53,14 +51,12 @@ ...@@ -53,14 +51,12 @@
<el-input <el-input
v-model="config.leave_interval" v-model="config.leave_interval"
style="width: 100px" style="width: 100px"
:disabled="config.enabled_lock === false" :disabled="config.enabled_lock === false"></el-input>
></el-input>
<span>秒计为离开1次,只允许离开</span> <span>秒计为离开1次,只允许离开</span>
<el-input <el-input
style="width: 100px" style="width: 100px"
v-model="config.max_leave_times" v-model="config.max_leave_times"
:disabled="config.enabled_lock === false" :disabled="config.enabled_lock === false"></el-input
></el-input
> >
</div> </div>
<div>当登录考试次数超过限定次数,系统会阻止考生登录考试</div> <div>当登录考试次数超过限定次数,系统会阻止考生登录考试</div>
...@@ -140,7 +136,7 @@ export default { ...@@ -140,7 +136,7 @@ export default {
promise_message: this.config.promise_message promise_message: this.config.promise_message
} }
} }
updateExam(params).then(res => { updateExam(params).then(() => {
history.go(-1) history.go(-1)
}) })
}, },
......
...@@ -14,8 +14,7 @@ ...@@ -14,8 +14,7 @@
configs.enabled_promise === false && configs.enabled_promise === false &&
configs.enabled_lock === false && configs.enabled_lock === false &&
configs.enabled_watermark === false configs.enabled_watermark === false
" ">
>
暂无 暂无
</span> </span>
</div> </div>
...@@ -66,7 +65,7 @@ export default { ...@@ -66,7 +65,7 @@ export default {
exam_paper: this.examPaper, exam_paper: this.examPaper,
config: Object.assign(this.config, this.configs, this.params.config) config: Object.assign(this.config, this.configs, this.params.config)
} }
createExamList(params).then(res => { createExamList(params).then(() => {
this.$message.success('创建成功') this.$message.success('创建成功')
this.$router.push('list') this.$router.push('list')
}) })
......
...@@ -8,8 +8,7 @@ ...@@ -8,8 +8,7 @@
v-model="scope.row.enabled_edit" v-model="scope.row.enabled_edit"
active-color="#13ce66" active-color="#13ce66"
inactive-color="#ff4949" inactive-color="#ff4949"
@change="editChange(scope)" @change="editChange(scope)">
>
</el-switch> </el-switch>
</template> </template>
</el-table-column> </el-table-column>
...@@ -19,8 +18,7 @@ ...@@ -19,8 +18,7 @@
v-model="scope.row.enabled_visible" v-model="scope.row.enabled_visible"
active-color="#13ce66" active-color="#13ce66"
inactive-color="#ff4949" inactive-color="#ff4949"
@change="visibleChange(scope)" @change="visibleChange(scope)">
>
</el-switch> </el-switch>
</template> </template>
</el-table-column> </el-table-column>
...@@ -30,8 +28,7 @@ ...@@ -30,8 +28,7 @@
v-model="scope.row.required" v-model="scope.row.required"
active-color="#13ce66" active-color="#13ce66"
inactive-color="#ff4949" inactive-color="#ff4949"
@change="requiredChange(scope)" @change="requiredChange(scope)">
>
</el-switch> </el-switch>
</template> </template>
</el-table-column> </el-table-column>
...@@ -200,7 +197,7 @@ export default { ...@@ -200,7 +197,7 @@ export default {
} }
} }
} }
updateExam(params).then(res => { updateExam(params).then(() => {
history.go(-1) history.go(-1)
}) })
} }
......
...@@ -232,7 +232,7 @@ export default { ...@@ -232,7 +232,7 @@ export default {
}, },
// 删除考生 // 删除考生
delStudent() { delStudent() {
this.$confirm('确认删除该考试吗?删除后不可恢复').then(_ => { this.$confirm('确认删除该考试吗?删除后不可恢复').then(() => {
const studentId = this.multipleSelection.map(item => item.student_id).toString() const studentId = this.multipleSelection.map(item => item.student_id).toString()
deleteStudent({ id: studentId }).then(res => { deleteStudent({ id: studentId }).then(res => {
if (res.code === 0) { if (res.code === 0) {
...@@ -271,7 +271,7 @@ export default { ...@@ -271,7 +271,7 @@ export default {
}).then(() => { }).then(() => {
const studentId = this.multipleSelection.map(item => item.student_id).toString() const studentId = this.multipleSelection.map(item => item.student_id).toString()
const params = { exam_id: this.exam_id, students_id: studentId } const params = { exam_id: this.exam_id, students_id: studentId }
sendMessage(params).then(res => { sendMessage(params).then(() => {
this.$message.success('信息发送成功') this.$message.success('信息发送成功')
}) })
}) })
...@@ -290,7 +290,7 @@ export default { ...@@ -290,7 +290,7 @@ export default {
exam_id: this.exam_id, exam_id: this.exam_id,
student_ids: this.multipleSelection.map(item => item.student_id).toString() student_ids: this.multipleSelection.map(item => item.student_id).toString()
} }
transferStudent(params).then(res => { transferStudent(params).then(() => {
this.$message.success('考生转移成功') this.$message.success('考生转移成功')
this.dialogVisible = false this.dialogVisible = false
}) })
......
...@@ -117,7 +117,7 @@ export default { ...@@ -117,7 +117,7 @@ export default {
}, },
// 单个删除 // 单个删除
handleDelete(row) { handleDelete(row) {
this.$confirm('确认删除该考试吗?删除后不可恢复').then(_ => { this.$confirm('确认删除该考试吗?删除后不可恢复').then(() => {
const params = { id: row.exam_id } const params = { id: row.exam_id }
delExamPaper(params).then(res => { delExamPaper(params).then(res => {
if (res.code === 0) { if (res.code === 0) {
......
const modules = Object.values(import.meta.globEager('./**/index.js')) const modules = Object.values(import.meta.glob('./**/index.js', { eager: true }))
export default function ({ router }) { export default function ({ router }) {
modules.forEach(({ routes }) => { modules.forEach(({ routes }) => {
......
...@@ -19,8 +19,7 @@ ...@@ -19,8 +19,7 @@
v-for="item in questionTypeMap" v-for="item in questionTypeMap"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"></el-option>
></el-option>
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
...@@ -32,8 +31,7 @@ ...@@ -32,8 +31,7 @@
v-for="item in questionDifficultyMap" v-for="item in questionDifficultyMap"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"></el-option>
></el-option>
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
...@@ -46,8 +44,7 @@ ...@@ -46,8 +44,7 @@
:isRequestRemote="false" :isRequestRemote="false"
v-model="row.question_categories" v-model="row.question_categories"
@change="getQuestionMaxCount($index, row)" @change="getQuestionMaxCount($index, row)"
style="width: 100%" style="width: 100%"></question-type-treeselect>
></question-type-treeselect>
</template> </template>
</el-table-column> </el-table-column>
...@@ -58,8 +55,7 @@ ...@@ -58,8 +55,7 @@
:min="0" :min="0"
:max="row.max_question_num" :max="row.max_question_num"
step-strictly step-strictly
style="width: 100%" style="width: 100%"></el-input-number>
></el-input-number>
</template> </template>
</el-table-column> </el-table-column>
...@@ -78,8 +74,7 @@ ...@@ -78,8 +74,7 @@
size="mini" size="mini"
:plain="true" :plain="true"
type="danger" type="danger"
@click="handleAdd(scope.$index, scope.row)" @click="handleAdd(scope.$index, scope.row)"></el-button>
></el-button>
<el-button <el-button
style="margin-left: 10px" style="margin-left: 10px"
...@@ -89,8 +84,7 @@ ...@@ -89,8 +84,7 @@
:plain="true" :plain="true"
type="danger" type="danger"
@click="handleDelete(scope.$index, scope.row)" @click="handleDelete(scope.$index, scope.row)"
v-if="questionList.length > 1" v-if="questionList.length > 1"></el-button>
></el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -273,7 +267,7 @@ export default { ...@@ -273,7 +267,7 @@ export default {
} }
} }
const params = { id: this.data.id, permission: this.form.permission, rules } const params = { id: this.data.id, permission: this.form.permission, rules }
updatePaperRules(params).then(res => { updatePaperRules(params).then(() => {
this.$message.success('保存成功') this.$message.success('保存成功')
this.$emit('update') this.$emit('update')
this.$emit('update:visible', false) this.$emit('update:visible', false)
......
...@@ -29,8 +29,7 @@ ...@@ -29,8 +29,7 @@
:list="currentQuestions" :list="currentQuestions"
:disableScore="data.paper_type === 2" :disableScore="data.paper_type === 2"
style="margin-top: 20px" style="margin-top: 20px"
v-if="currentQuestions.length" v-if="currentQuestions.length">
>
<template v-slot:selection="item" v-if="hasSelection"> <template v-slot:selection="item" v-if="hasSelection">
<el-checkbox @change="handleSelectionChange(arguments[0], item)"></el-checkbox> <el-checkbox @change="handleSelectionChange(arguments[0], item)"></el-checkbox>
</template> </template>
...@@ -81,8 +80,7 @@ ...@@ -81,8 +80,7 @@
:data="data" :data="data"
:list="questions" :list="questions"
@update="handleUpdate" @update="handleUpdate"
v-if="paperVisible" v-if="paperVisible" />
/>
</template> </template>
</div> </div>
</template> </template>
...@@ -177,7 +175,7 @@ export default { ...@@ -177,7 +175,7 @@ export default {
}, },
// 删除选中试题 // 删除选中试题
handleRemove() { handleRemove() {
this.$confirm('确认删除选中试题吗?删除后不可恢复').then(_ => { this.$confirm('确认删除选中试题吗?删除后不可恢复').then(() => {
this.questions = this.questions.filter(item => { this.questions = this.questions.filter(item => {
if (item.children) { if (item.children) {
item.children = item.children.filter(item => !this.multipleSelection.includes(item.id)) item.children = item.children.filter(item => !this.multipleSelection.includes(item.id))
...@@ -214,7 +212,7 @@ export default { ...@@ -214,7 +212,7 @@ export default {
} }
} }
const params = { id: this.data.id, rules } const params = { id: this.data.id, rules }
updatePaperRules(params).then(res => { updatePaperRules(params).then(() => {
this.$message.success('保存成功') this.$message.success('保存成功')
this.$emit('update') this.$emit('update')
}) })
......
...@@ -23,8 +23,7 @@ ...@@ -23,8 +23,7 @@
<question-type-treeselect <question-type-treeselect
multiple multiple
v-model="params.paper_categories" v-model="params.paper_categories"
@change="refetchList" @change="refetchList"></question-type-treeselect>
></question-type-treeselect>
</template> </template>
<template v-slot:table-x="{ row }"> <template v-slot:table-x="{ row }">
<router-link :to="{ name: 'editPaper', params: { id: row.id } }" target="_blank" v-if="hasUpdate"> <router-link :to="{ name: 'editPaper', params: { id: row.id } }" target="_blank" v-if="hasUpdate">
...@@ -178,7 +177,7 @@ export default { ...@@ -178,7 +177,7 @@ export default {
}, },
// 批量删除 // 批量删除
batchDeletePaper(ids) { batchDeletePaper(ids) {
batchDeletePaper({ ids }).then(res => { batchDeletePaper({ ids }).then(() => {
// 刷新列表 // 刷新列表
this.refetchList() this.refetchList()
}) })
......
...@@ -47,8 +47,7 @@ ...@@ -47,8 +47,7 @@
v-for="item in paperTypeList" v-for="item in paperTypeList"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
:key="item.value" :key="item.value"></el-option>
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -71,8 +70,7 @@ ...@@ -71,8 +70,7 @@
:max="200" :max="200"
placeholder="请输入试卷总分" placeholder="请输入试卷总分"
style="width: 100%" style="width: 100%"
:precision="0" :precision="0"></el-input-number>
></el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10">
...@@ -84,8 +82,7 @@ ...@@ -84,8 +82,7 @@
:max="form.paper_total_score || 200" :max="form.paper_total_score || 200"
placeholder="请输入及格分数" placeholder="请输入及格分数"
style="width: 100%" style="width: 100%"
:precision="0" :precision="0"></el-input-number>
></el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -98,8 +95,7 @@ ...@@ -98,8 +95,7 @@
:min="1" :min="1"
:max="150" :max="150"
placeholder="请输入考试时长" placeholder="请输入考试时长"
:precision="0" :precision="0"></el-input-number
></el-input-number
>&nbsp;分钟 >&nbsp;分钟
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -111,8 +107,7 @@ ...@@ -111,8 +107,7 @@
:min="1" :min="1"
:max="150" :max="150"
placeholder="请输入考试时长" placeholder="请输入考试时长"
:precision="0" :precision="0"></el-input-number
></el-input-number
>&nbsp;分钟 >&nbsp;分钟
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -218,12 +213,12 @@ export default { ...@@ -218,12 +213,12 @@ export default {
this.$refs.form.validate().then(() => { this.$refs.form.validate().then(() => {
// 保存成功回到列表 // 保存成功回到列表
if (this.isEdit) { if (this.isEdit) {
this.updatePaper().then(res => { this.updatePaper().then(() => {
this.$router.back() this.$router.back()
this.$router.replace({ path: '/paper/list' }) this.$router.replace({ path: '/paper/list' })
}) })
} else { } else {
this.createPaper().then(res => { this.createPaper().then(() => {
this.$router.replace('/paper/list') this.$router.replace('/paper/list')
}) })
} }
......
...@@ -9,8 +9,7 @@ ...@@ -9,8 +9,7 @@
<el-form-item <el-form-item
label="子题目类型" label="子题目类型"
:prop="'children.' + index + '.child_question_type'" :prop="'children.' + index + '.child_question_type'"
:rules="rules.child_question_type" :rules="rules.child_question_type">
>
<el-select v-model="ruleForm.child_question_type" disabled> <el-select v-model="ruleForm.child_question_type" disabled>
<el-option label="单选题" :value="1"></el-option> <el-option label="单选题" :value="1"></el-option>
<el-option label="多选题" :value="2"></el-option> <el-option label="多选题" :value="2"></el-option>
...@@ -24,16 +23,14 @@ ...@@ -24,16 +23,14 @@
<el-form-item <el-form-item
label="子题目内容" label="子题目内容"
:prop="'children.' + index + '.question_content'" :prop="'children.' + index + '.question_content'"
:rules="rules.question_content" :rules="rules.question_content">
>
<v-editor :disabled="disabled" v-model="ruleForm.question_content"></v-editor> <v-editor :disabled="disabled" v-model="ruleForm.question_content"></v-editor>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="选项" label="选项"
:prop="'children.' + index + '.question_options'" :prop="'children.' + index + '.question_options'"
:rules="rules.question_options" :rules="rules.question_options"
v-if="ruleForm.child_question_type !== 3" v-if="ruleForm.child_question_type !== 3">
>
<!-- 单选题 --> <!-- 单选题 -->
<radio ref="options" :option="ruleForm.question_options" v-if="ruleForm.child_question_type == 1"></radio> <radio ref="options" :option="ruleForm.question_options" v-if="ruleForm.child_question_type == 1"></radio>
<!-- 多选题 --> <!-- 多选题 -->
......
...@@ -198,8 +198,7 @@ export default { ...@@ -198,8 +198,7 @@ export default {
}, },
// 删除试题 // 删除试题
handleDelete(id) { handleDelete(id) {
console.log(id) this.$confirm('确认删除该试题吗?删除后不可恢复').then(() => {
this.$confirm('确认删除该试题吗?删除后不可恢复').then(_ => {
const ids = id ? [id] : this.deleteQuestions const ids = id ? [id] : this.deleteQuestions
deleteQuestion({ ids }).then(res => { deleteQuestion({ ids }).then(res => {
if (res.code === 0) { if (res.code === 0) {
......
...@@ -226,14 +226,14 @@ export default { ...@@ -226,14 +226,14 @@ export default {
}, },
// 创建试题 // 创建试题
handleAddQuestion(params) { handleAddQuestion(params) {
addQuestion(params).then(res => { addQuestion(params).then(() => {
this.$message.success('创建成功') this.$message.success('创建成功')
this.$router.push({ path: '/question/list' }) this.$router.push({ path: '/question/list' })
}) })
}, },
// 更新试题 // 更新试题
handleUpdateQuestion(params) { handleUpdateQuestion(params) {
updateQuestion(this.questionId, params).then(res => { updateQuestion(this.questionId, params).then(() => {
this.$message.success('修改成功') this.$message.success('修改成功')
this.$router.push({ path: '/question/list' }) this.$router.push({ path: '/question/list' })
}) })
......
import fs from 'fs' import fs from 'fs'
import path from 'path' import path from 'path'
import { defineConfig } from 'vite' import { defineConfig } from 'vite'
import { createVuePlugin } from 'vite-plugin-vue2' import vue from '@vitejs/plugin-vue2'
import checker from 'vite-plugin-checker' import checker from 'vite-plugin-checker'
export default defineConfig(({ mode }) => { export default defineConfig(({ mode }) => {
return { return {
base: mode === 'prod' ? 'https://webapp-pub.ezijing.com/website/prod/qbs/' : '/', base: mode === 'prod' ? 'https://webapp-pub.ezijing.com/website/prod/qbs/' : '/',
plugins: [ plugins: [vue(), checker({ eslint: { lintCommand: 'eslint "./src/**/*.{vue,js,jsx,ts,tsx}"' } })],
checker({
eslint: {
lintCommand: 'eslint "./src/**/*.{vue,js,jsx,ts,tsx}"'
}
}),
createVuePlugin()
],
server: { server: {
open: true, open: true,
host: 'dev.ezijing.com', host: 'dev.ezijing.com',
https: { https: {
key: fs.readFileSync(path.join(__dirname, './https/dev.ezijing.com.key')), key: fs.readFileSync(path.join(__dirname, './https/ezijing.com.key')),
cert: fs.readFileSync(path.join(__dirname, './https/dev.ezijing.com.pem')) cert: fs.readFileSync(path.join(__dirname, './https/ezijing.com.pem'))
}, },
proxy: { proxy: {
'/api/xedu': 'https://project-center.ezijing.com',
// '/api/exam': {
// target: 'https://x-exam-admin-api.ezijing.com',
// // target: 'http://localhost-exam-admin.ezijing.com',
// rewrite: path => path.replace(/^\/api\/exam/, '')
// },
'/api': 'https://qa-center.ezijing.com' '/api': 'https://qa-center.ezijing.com'
} }
}, },
resolve: { resolve: {
alias: [ alias: [{ find: '@', replacement: path.resolve(__dirname, 'src') }]
{
find: '@',
replacement: path.resolve(__dirname, 'src')
}
]
}, },
css: { css: {
// 禁用SASS警告提醒 // 禁用SASS警告提醒
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论