Merge branch 'test_dispaly' of https://git.code.tencent.com/lian-cbtc/jl-client into test_dispaly

This commit is contained in:
fan 2022-10-21 09:52:46 +08:00
commit f2ac931350
8 changed files with 1327 additions and 912 deletions

View File

@ -244,3 +244,32 @@ export function deletePaper(pcId) {
method: 'DELETE',
})
}
/**
* @param {Number} pcId 试卷蓝图Id
*/
export function generateExam(pcId) {
return request({
url: `/api/v2/paper/${pcId}`,
method: 'POST',
})
}
/** 删除用户试卷 */
export function deleteUserExam(param) {
return request({
url: `/api/v2/paper/user/${puId}`,
method: 'method',
})
}
/**
* @param {Number} pcId 用户试卷Id
*/
export function getUserExamInfo(puId) {
return request({
url: `/api/v2/paper/user/${puId}`,
method: 'GET',
})
}

View File

@ -293,6 +293,8 @@ export default {
{ label: '列车', value: 'Train' },
{ label: '自动闭塞', value: 'StationDirectionAuto' },
{ label: '半自动闭塞', value: 'StationDirectionSemi' }
]
],
paperStateArr: ['正在编辑', '封存', '已使用'], //试卷定义状态
paperStateQueryArr: ['所有', '正在编辑', '可生成试卷', '封存', '已被使用'], //试卷定义查询状态
}
};

View File

@ -23,13 +23,13 @@ export function handlerUrl() {
let OSS_URL;
if (process.env.NODE_ENV === 'development') {
// 开发分支
// BASE_API = 'http://192.168.3.233/rtss-server';
BASE_API = 'http://192.168.3.233/rtss-server';
// BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://114.116.51.125/jlcloud';
// BASE_API = 'http://192.168.3.90:9100'; // 周寅
// BASE_API = 'http://192.168.3.94:9000'; // 旭强
BASE_API = 'http://192.168.3.15:9000'; // 张赛
// BASE_API = 'http://192.168.3.15:9000'; // 张赛
// BASE_API = 'http://192.168.3.5:9000'; // 夏增彬
// BASE_API = 'http://192.168.3.37:9000'; // 卫志宏
// BASE_API = 'http://b29z135112.zicp.vip';

View File

@ -0,0 +1,39 @@
<template>
<div class="examPanel">
<div class="header">
<div>满分: {{ composition.fullScore }}</div>
<div>考试时间: {{ composition.validDuration }}分钟</div>
</div>
<div class="questionList"></div>
</div>
</template>
<script>
export default {
name: 'ExamPanel',
data() {
return {
composition: {},
paper: {},
questionList: {},
}
},
methods: {
init(data) {
this.composition = data.composition
this.paper = data.paper
this.questionList = data.questionList
},
},
}
</script>
<style lang="scss" scoped>
.examPanel {
position: fixed;
background: #fff;
left: 0;
top: 50%;
transform: translateY(-50%);
}
</style>

View File

@ -0,0 +1,107 @@
<template>
<el-dialog
:visible.sync="show"
:before-close="doClose"
title="选择试卷"
width="1200px"
@open="onOpen"
:close-on-click-modal="false"
>
<el-table :data="paperList" border>
<el-table-column prop="name" label="试卷名称" width="150px">
<template slot-scope="scope">
<span>{{ scope.row.name }}</span>
</template>
</el-table-column>
<el-table-column prop="profile" label="试卷简介">
<template slot-scope="scope">
<span>{{ scope.row.profile }}</span>
</template>
</el-table-column>
<el-table-column label="试卷启用时间" width="160px">
<template slot-scope="scope">
<span>{{ scope.row.startTime }} </span>
<span>{{ scope.row.endTime }} </span>
</template>
</el-table-column>
<el-table-column prop="validDuration" label="考试时间" width="80px">
<template slot-scope="scope">
<span>{{ scope.row.validDuration }} 分钟</span>
</template>
</el-table-column>
<el-table-column label="题目数量" width="100px">
<template slot-scope="scope">
<span
>理论:{{
scope.row.ruleList.reduce((prev, curr) => prev + (curr.type === 1 ? curr.amount : 0), 0)
}}</span
><br />
<span
>实操:{{
scope.row.ruleList.reduce((prev, curr) => prev + (curr.type === 2 ? curr.amount : 0), 0)
}}</span
>
</template>
</el-table-column>
<el-table-column prop="fullScore" label="总分" width="80px">
<template slot-scope="scope">
<span>{{ scope.row.fullScore }}</span>
</template>
</el-table-column>
<el-table-column prop="passScore" label="及格分" width="80px">
<template slot-scope="scope">
<span>{{ scope.row.passScore }}</span>
</template>
</el-table-column>
<el-table-column label="操作" width="100px">
<el-button slot-scope="scope" type="primary" size="small" @click="start(scope.row)">开始考试</el-button>
</el-table-column>
</el-table>
</el-dialog>
</template>
<script>
import { getPapaerListOfOrg, generateExam, getUserExamInfo } from '@/api/management/exam'
export default {
name: 'SelectExam',
emits: ['examStart'],
data() {
return {
show: false,
paperList: [],
}
},
methods: {
doShow() {
this.show = true
},
doClose() {
this.show = false
},
onOpen() {
getPapaerListOfOrg({
orgId: this.$store.state.user.companyId,
findState: 3,
}).then(resp => {
console.log(resp)
this.paperList = resp.data.list
})
},
start(row) {
generateExam(row.id)
.then(resp => {
getUserExamInfo(resp.data.id).then(res => {
this.$emit('examStart', res.data)
this.doClose()
})
})
.catch(e => {
console.log(e)
})
},
},
}
</script>
<style></style>

File diff suppressed because it is too large Load Diff

View File

@ -11,11 +11,12 @@
</template>
<script>
const paperStateArr = ['正在编辑', '封存', '已使用']
const paperStateQueryArr = ['所有', '正在编辑', '可生成试卷', '封存', '已被使用']
import config from '@/scripts/ConstConfig'
import { getPapaerListOfOrg, lockPaper, unlockPaper, deletePaper } from '@/api/management/exam'
import { getPublishMapListOnline } from '@/api/jmap/map'
const { paperStateArr, paperStateQueryArr } = config.ConstSelect
export default {
name: 'ExamManage',
data() {
@ -235,7 +236,9 @@ export default {
})
})
.catch(res => {
this.$message({ type: 'error', message: '删除试卷失败!' })
if (res.code && res.code !== 200) {
this.$message({ type: 'error', message: res.message })
}
})
},
examRefresh() {

View File

@ -42,12 +42,11 @@
v-model="form.amount"
:precision="0"
:min="0"
:max="this.topicNum"
style="width: calc(100% - 280px); float: left; margin-right: 10px;"
/>
<span v-if="this.form.type === 1" style="width: 190px; float: left;"
>{{ $t('publish.allNumberTipOne') }} {{ topicNum }} {{ $t('publish.allNumberTipTwo') }}</span
>
<span v-if="this.form.type === 1" style="width: 190px; float: left;">
{{ $t('publish.allNumberTipOne') }} {{ topicNum }} {{ $t('publish.allNumberTipTwo') }}
</span>
</el-form-item>
<el-form-item :label="$t('publish.scorePerQuestion')" prop="score">
<el-input-number v-model="form.score" :precision="0" :min="0" style="width:200px" />