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

chore: upgrade to vue 2.7

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