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

chore: upgrade to vue2.7

上级 5ba4b5f3
module.exports = {
root: true,
env: {
node: true
},
extends: ['plugin:vue/essential', 'standard'],
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/no-mutating-props': 'off' // 暂时关闭
}
}
{
"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.
......@@ -15,28 +15,23 @@
"axios": "^0.26.1",
"blueimp-md5": "^2.19.0",
"echarts": "^5.2.2",
"element-ui": "^2.15.6",
"js-base64": "^3.7.2",
"element-ui": "^2.15.12",
"js-base64": "^3.7.3",
"lodash": "^4.17.21",
"query-string": "^7.1.1",
"vue": "^2.6.14",
"vue": "^2.7.14",
"vue-html2pdf": "^1.8.0",
"vue-router": "^3.5.3",
"vue-router": "^3.6.5",
"vuex": "^3.6.2"
},
"devDependencies": {
"@vitejs/plugin-vue2": "^2.0.1",
"ali-oss": "^6.17.1",
"chalk": "^4.1.2",
"eslint": "^7.32.0",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.1",
"eslint-plugin-vue": "^8.5.0",
"sass": "1.49.10",
"vite": "^2.9.0",
"vite-plugin-checker": "^0.4.4",
"vite-plugin-vue2": "^1.9.3",
"vue-template-compiler": "^2.6.14"
"eslint": "^8.28.0",
"eslint-plugin-vue": "^9.8.0",
"sass": "1.56.1",
"vite": "^3.2.4",
"vite-plugin-checker": "^0.5.1"
}
}
......@@ -5,10 +5,7 @@
<aside class="question-list-hd__aside"><slot name="index"></slot></aside>
</div>
<div class="question-list-bd">
<h2 class="question-list-title" v-if="conmonTitle" v-html="conmonTitle">
<!-- <span class="num">{{ page }}.</span> -->
<!-- {{ conmonTitle }} -->
</h2>
<h2 class="question-list-title" v-if="commonTitle" v-html="commonTitle"></h2>
<question-list-item
v-for="(item, i) in data.question_list"
:data="item"
......@@ -16,8 +13,7 @@
:page="data.question_list.length > 1 ? i + 1 : page"
:key="item.id"
v-bind="$attrs"
v-on="$listeners"
>
v-on="$listeners">
<slot v-bind="{ item, data }"></slot>
</question-list-item>
</div>
......@@ -39,7 +35,7 @@ export default {
return map[this.data.question_type] || this.data.question_type
},
// 公共题干
conmonTitle() {
commonTitle() {
const [first = {}] = this.data.question_list || []
return first.common_content
}
......
......@@ -4,14 +4,21 @@
<div class="order-num" v-if="questionParams.card">
<template v-for="(item, index) in questionParams.card">
<div :key="index" v-if="item">
<div class="tit">{{ item.find(tit => { return tit.question_item_title }).question_item_title }}</div>
<div class="tit">
{{
item.find(tit => {
return tit.question_item_title
}).question_item_title
}}
</div>
<ul>
<template v-for="(cItem, cIndex) in item">
<li
:key="cItem.q_order + '-' + cIndex"
@click="goQuestion(cItem.q_order)"
:class="$route.query.id ? isAnalysisClass(cItem) + ' analy' : isClass(cItem)"
>{{ cItem.q_order }}</li>
:class="$route.query.id ? isAnalysisClass(cItem) + ' analy' : isClass(cItem)">
{{ cItem.q_order }}
</li>
</template>
</ul>
</div>
......@@ -65,7 +72,7 @@ export default {
return this.questionParams.answerRecord
},
isClass() {
return (cItem) => {
return cItem => {
const currentAnswer = this.questionParams.answerRecord[cItem.question_item_id]
return this.questionParams.questionIndex + 1 === cItem.q_order
? currentAnswer
......@@ -76,32 +83,32 @@ export default {
? 'stu1 stu2 stu3'
: 'stu1 stu2'
: currentAnswer[cItem.id].sign
? 'stu2 stu3'
: 'stu2'
: currentAnswer[cItem.id].sign
? 'stu2 stu3'
: 'stu2'
: currentAnswer[cItem.id].sign
? 'stu2 stu3'
: 'stu2'
: 'stu2'
: 'stu2'
: currentAnswer
? currentAnswer[cItem.id]
? currentAnswer[cItem.id].answer
? currentAnswer[cItem.id].answer.length !== 0
? currentAnswer[cItem.id].sign
? 'stu1 stu3'
: 'stu1'
: currentAnswer[cItem.id].sign
? 'stu3'
: ''
? currentAnswer[cItem.id]
? currentAnswer[cItem.id].answer
? currentAnswer[cItem.id].answer.length !== 0
? currentAnswer[cItem.id].sign
? 'stu1 stu3'
: 'stu1'
: currentAnswer[cItem.id].sign
? 'stu3'
: ''
? 'stu3'
: ''
: currentAnswer[cItem.id].sign
? 'stu3'
: ''
: ''
: ''
}
},
isAnalysisClass() {
return (cItem) => {
return cItem => {
const findItems = this.questionParams.beforeData.answers[cItem.question_item_id]
const scoreItems = this.questionParams.beforeData.score_items[cItem.question_item_id][cItem.id]
return findItems
......@@ -123,13 +130,13 @@ export default {
const id = this.questionParams.question
this.questionParams.answerRecord[id.question_item_id]
? this.questionParams.answerRecord[id.question_item_id][id.id]
? this.questionParams.answerRecord[id.question_item_id][id.id].sign = stu
: this.questionParams.answerRecord[id.question_item_id][id.id] = {
sign: stu
}
: this.questionParams.answerRecord[id.question_item_id] = {
[id.id]: { sign: stu }
}
? (this.questionParams.answerRecord[id.question_item_id][id.id].sign = stu)
: (this.questionParams.answerRecord[id.question_item_id][id.id] = {
sign: stu
})
: (this.questionParams.answerRecord[id.question_item_id] = {
[id.id]: { sign: stu }
})
this.$forceUpdate()
},
monitoringChanges() {
......@@ -140,36 +147,36 @@ export default {
}
},
watch: {
changeQuestionIndex(newV, oldV) {
changeQuestionIndex() {
this.$forceUpdate()
}
}
}
</script>
<style lang="scss" scoped>
.info{
.info {
display: flex;
align-items: center;
height: 100px;
.shape{
.shape {
width: 60px;
height: 60px;
border-radius: 50%;
overflow: hidden;
}
img{
img {
width: 75px;
// transform: scale(1);
display: block;
}
.right{
.right {
margin-left: 22px;
.name{
.name {
font-size: 18px;
color: #222222;
line-height: 25px;
}
.code{
.code {
font-size: 14px;
color: #222222;
line-height: 20px;
......@@ -177,54 +184,54 @@ export default {
}
}
}
.order-num{
.order-num {
padding-top: 20px;
padding-bottom: 90px;
.tit{
.tit {
font-size: 12px;
color: #999999;
line-height: 17px;
margin-bottom: 10px;
}
ul{
ul {
display: flex;
list-style: none;
padding: 0;
margin: 0;
flex-wrap: wrap;
li{
li {
cursor: pointer;
position: relative;
border-radius: 50px;
width: 24px;
height: 24px;
border: 1px solid #CCCCCC;
border: 1px solid #cccccc;
font-size: 14px;
color: #666666;
line-height: 24px;
margin-right: 20px;
margin-bottom: 10px;
text-align: center;
&:nth-child(5n+5){
&:nth-child(5n + 5) {
margin-right: 0;
}
&.analy{
&.stu1{
border: 2px solid #0FC118;
&.analy {
&.stu1 {
border: 2px solid #0fc118;
line-height: 22px;
background: #fff;
color: #999;
}
&.stu2{
border: 2px solid #C01540;
&.stu2 {
border: 2px solid #c01540;
line-height: 22px;
background: #fff;
color: #999;
}
&.stu3{
&.stu3 {
color: #fff;
background: #999999;
&::after{
&::after {
content: '';
position: absolute;
top: -1px;
......@@ -236,208 +243,208 @@ export default {
}
}
}
&.stu1{
&.stu1 {
background: #999;
border: 1px solid #999;
color: #fff;
}
&.stu2{
&.stu2 {
width: 22px;
height: 22px;
line-height: 22px;
border: 2px solid #0FC118;
border: 2px solid #0fc118;
}
&.stu3{
&::after{
&.stu3 {
&::after {
content: '';
position: absolute;
top: -1px;
right: -1px;
width: 4px;
height: 4px;
background: #C01540;
background: #c01540;
border-radius: 50%;
}
}
}
}
}
.flag-tips{
.flag-tips {
width: 260px;
position: fixed;
bottom: 60px;
right:0;
right: 0;
display: flex;
justify-content: space-around;
padding: 15px 0 10px;
background: #fff;
margin: 0;
list-style: none;
li{
.circle1{
li {
.circle1 {
width: 24px;
height: 24px;
background: #EEEEEE;
border: 1px solid #CCCCCC;
background: #eeeeee;
border: 1px solid #cccccc;
border-radius: 50%;
}
.circle1{
.circle1 {
width: 24px;
height: 24px;
border: 1px solid #CCCCCC;
border: 1px solid #cccccc;
border-radius: 50%;
}
.circle2{
.circle2 {
width: 24px;
height: 24px;
border: 1px solid #CCCCCC;
border: 1px solid #cccccc;
border-radius: 50%;
}
.circle3{
.circle3 {
width: 24px;
height: 24px;
border: 2px solid #0FC118;
border: 2px solid #0fc118;
border-radius: 50%;
}
.circle4{
.circle4 {
position: relative;
width: 24px;
height: 24px;
border: 1px solid #CCCCCC;
border: 1px solid #cccccc;
border-radius: 50%;
&::after{
&::after {
content: '';
position: absolute;
top: -1px;
right: -1px;
width: 4px;
height: 4px;
background: #C01540;
background: #c01540;
border-radius: 50%;
}
}
.txt{
.txt {
margin-top: 5px;
font-size: 12px;
color: #CCCCCC;
color: #cccccc;
line-height: 17px;
}
}
}
.flag-tips{
.flag-tips {
width: 260px;
position: fixed;
bottom: 60px;
right:0;
right: 0;
display: flex;
justify-content: space-around;
padding: 15px 0 10px;
background: #fff;
margin: 0;
list-style: none;
li{
.circle1{
li {
.circle1 {
width: 24px;
height: 24px;
background: #999;
border: 1px solid #999;
border-radius: 50%;
}
.circle2{
.circle2 {
width: 24px;
height: 24px;
border: 1px solid #CCCCCC;
border: 1px solid #cccccc;
border-radius: 50%;
}
.circle3{
.circle3 {
width: 24px;
height: 24px;
border: 2px solid #0FC118;
border: 2px solid #0fc118;
background: rgba(15, 193, 24, 0.1);
border-radius: 50%;
}
.circle4{
.circle4 {
position: relative;
width: 24px;
height: 24px;
border: 1px solid #CCCCCC;
border: 1px solid #cccccc;
border-radius: 50%;
&::after{
&::after {
content: '';
position: absolute;
top: -1px;
right: -1px;
width: 4px;
height: 4px;
background: #C01540;
background: #c01540;
border-radius: 50%;
}
}
.txt{
.txt {
margin-top: 5px;
font-size: 12px;
color: #CCCCCC;
color: #cccccc;
line-height: 17px;
}
}
}
.tips-box{
.tips-box {
width: 260px;
position: fixed;
bottom: 60px;
right:0;
right: 0;
display: flex;
justify-content: space-around;
padding: 15px 0 10px;
background: #fff;
margin: 0;
list-style: none;
li{
&:nth-child(2){
li {
&:nth-child(2) {
// margin: 0 50px;
}
.circle1{
.circle1 {
width: 24px;
height: 24px;
background: #fff;
border: 2px solid #0FC118;
border: 2px solid #0fc118;
border-radius: 50%;
box-sizing: border-box;
}
.circle2{
.circle2 {
width: 24px;
height: 24px;
border: 2px solid #C01540;
border: 2px solid #c01540;
border-radius: 50%;
box-sizing: border-box;
}
.circle3{
.circle3 {
width: 24px;
height: 24px;
background: #999999;
border-radius: 50%;
}
.circle4{
.circle4 {
position: relative;
width: 24px;
height: 24px;
border: 1px solid #CCCCCC;
border: 1px solid #cccccc;
border-radius: 50%;
&::after{
&::after {
content: '';
position: absolute;
top: -1px;
right: -1px;
width: 4px;
height: 4px;
background: #C01540;
background: #c01540;
border-radius: 50%;
}
}
.txt{
.txt {
margin-top: 5px;
font-size: 12px;
color: #CCCCCC;
color: #cccccc;
line-height: 17px;
}
}
......
......@@ -19,7 +19,7 @@ export default function (blobInfo, succFun, failFun) {
failFun('上传失败')
})
})
.catch(response => {
.catch(() => {
failFun('获取Signature失败')
})
}
......@@ -56,14 +56,14 @@ export default {
.catch(this.$refs.countdown.stop)
},
checkCode() {
api.checkCode(this.ruleForm).then(response => {
api.checkCode(this.ruleForm).then(() => {
this.updateUser()
})
},
updateUser() {
api
.updateUser({ mobile: this.ruleForm.account })
.then(response => {
.then(() => {
this.$message({ type: 'success', message: '手机号码修改成功' })
this.$store.dispatch('getUser')
this.$emit('success')
......
......@@ -98,7 +98,7 @@ export default {
},
// 发送邮箱验证码
sendEmailCode(account) {
api.sendCode({ account }).then(response => {
api.sendCode({ account }).then(() => {
this.$message({ message: '验证码发送成功,请前往邮箱获取验证码', type: 'success' })
})
},
......@@ -108,7 +108,7 @@ export default {
},
// 校验验证码
checkCode() {
api.checkCode(this.ruleForm).then(response => {
api.checkCode(this.ruleForm).then(() => {
this.$emit('success')
})
}
......
......@@ -61,7 +61,7 @@ export default {
this.submitLoading = true
api
.updatePassword(this.ruleForm)
.then(response => {
.then(() => {
this.$message({ message: '密码修改成功', type: 'success' })
// 重置表单
this.$refs.ruleForm.resetFields()
......
......@@ -9,8 +9,7 @@
:video="chatperResources.video"
@timeupdate="onTimeupdate"
@ready="onReady"
ref="videoPlayer"
></video-player>
ref="videoPlayer"></video-player>
</div>
<div class="player-column" v-if="pptVisible">
<!-- ppt -->
......@@ -19,8 +18,7 @@
:ppts="chatperResources.ppts"
@close="onPPTClose"
@fullscreen="onPPTFullscreen"
@videoSyncTime="onVideoSyncTime"
></ppt-player>
@videoSyncTime="onVideoSyncTime"></ppt-player>
</div>
</div>
<div class="player-footer">
......@@ -221,7 +219,7 @@ export default {
})
},
// 更新章节视频进度
updateChapterVideoProgress(time, durations) {
updateChapterVideoProgress() {
// 登录用户信息
const user = this.$store.state.user
const params = {
......
......@@ -14,13 +14,14 @@
</template>
</div>
<div class="ppt-player-controls__pages">
<span class="is-active">{{currentIndex + 1}}</span>
<span class="is-active">{{ currentIndex + 1 }}</span>
/
<span>{{ppts.length}}</span>
<span>{{ ppts.length }}</span
>
</div>
<div class="ppt-player-controls__tools">
<el-tooltip content="PPT同步视频播放">
<i :class="['el-icon-self-xuexiao', (isSync ? 'active' : '')]" @click="onToggleSync"></i>
<i :class="['el-icon-self-xuexiao', isSync ? 'active' : '']" @click="onToggleSync"></i>
</el-tooltip>
<el-tooltip content="放大PPT">
<i class="el-icon-self-quanping" @click="fullscreen"></i>
......@@ -62,9 +63,7 @@ export default {
},
computed: {
pptUrl() {
return this.ppts[this.currentIndex]
? this.ppts[this.currentIndex].ppt_url
: ''
return this.ppts[this.currentIndex] ? this.ppts[this.currentIndex].ppt_url : ''
}
},
methods: {
......@@ -78,14 +77,14 @@ export default {
this.currentIndex = this.getIndex(this.currentIndex - 1)
this.isSync = false
},
next(e) {
next() {
this.currentIndex = this.getIndex(this.currentIndex + 1)
this.isSync = false
},
onToggleSync(e) {
onToggleSync() {
this.isSync = !this.isSync
},
setVideoTime(e) {
setVideoTime() {
this.isSync = true
this.$emit('videoSyncTime', this.ppts[this.currentIndex].ppt_point)
},
......
......@@ -37,16 +37,16 @@ export default {
controlBarVisibility: 'always',
useHlsPluginForSafari: true
},
function(player) {
player.on('ready', function() {
function (player) {
player.on('ready', function () {
// 跳过片头
_this.isSkip && player.seek(6)
_this.$emit('ready', player)
})
player.on('timeupdate', function(event) {
player.on('timeupdate', function () {
_this.$emit('timeupdate', player.getCurrentTime())
})
player.on('error', function(event) {
player.on('error', function (event) {
console.log(event)
})
}
......
......@@ -11,8 +11,7 @@
@submit="submitExam"
@back="handleBack"
ref="exam"
v-if="Object.keys(data).length"
></exam-card>
v-if="Object.keys(data).length"></exam-card>
</div>
</template>
<script>
......@@ -113,7 +112,7 @@ export default {
answers: JSON.stringify(answer),
duration: duration
}
api.setCache(param).then(response => {
api.setCache(param).then(() => {
if (isCache) {
clearInterval(this.cacheAnswerTime)
this.$router.replace({ path: '/exam/exam/result', query: { exam_id: this.examId } })
......
......@@ -249,8 +249,7 @@ export default {
}
},
watch: {
dialogVisible: function (newVal, oldVal) {
console.log(this.dialogVisible)
dialogVisible() {
let numTime = 20
if (this.dialogVisible && !this.isRead) {
clearInterval(this.noticeTimes)
......
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/fd-learn/' : '/',
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',
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论