删除无用的文件
This commit is contained in:
parent
7cccb83a08
commit
45190c3b6f
@ -66,7 +66,6 @@ const LessonHome = () => import('@/views/lesson/home');
|
||||
const LessonDetail = () => import('@/views/lesson/details');
|
||||
|
||||
const ScriptmanageHome = () => import('@/views/scriptManage/home');
|
||||
const PracticeDisplayNew = () => import('@/views/competitionManage/practiceList/display/index');
|
||||
|
||||
const IbpHome = () => import('@/views/ibp/home');
|
||||
const IbpDraw = () => import('@/views/ibp/ibpDraw/index');
|
||||
@ -121,15 +120,12 @@ const UserRulesDetail = () => import('@/views/orderauthor/rules/detail');
|
||||
const DeviceManage = () => import('@/views/system/deviceManage/index');
|
||||
const MapSort = () => import('@/views/publish/publishMap/mapSort');
|
||||
const StudentManage = () => import('@/views/studentManage');
|
||||
const RaceManage = () => import('@/views/competitionManage/competition/index');
|
||||
const BankManage = () => import('@/views/competitionManage/bankList/index');
|
||||
|
||||
const Scene = () => import('@/views/drts/scene/index');
|
||||
|
||||
// const PracticeManage = () => import('@/views/competitionManage/practiceList/index');
|
||||
const QuestionCreatePage = () => import('@/views/competitionManage/bankList/question-create-page');
|
||||
const QuestionUpdatePage = () => import('@/views/competitionManage/bankList/question-update-page');
|
||||
const GeneratePaper = () => import('@/views/competitionManage/generatePaper');
|
||||
|
||||
const CompetitionDetail = () => import('@/views/jsxt/competition/examDetail');
|
||||
const CompetitionManage = () => import('@/views/jsxt/competition/index');
|
||||
@ -319,11 +315,6 @@ export const publicAsyncRoute = [
|
||||
component: DisplayNew,
|
||||
hidden: true
|
||||
},
|
||||
{ // 实操试题编辑 战场图
|
||||
path: '/practiceDisplayNew/:mode',
|
||||
component: PracticeDisplayNew,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/displayBigScreen/:mapId',
|
||||
component: BigScreen,
|
||||
@ -1004,14 +995,6 @@ export const asyncRouter = [
|
||||
roles: [admin]
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'manage',
|
||||
component: RaceManage,
|
||||
meta: {
|
||||
i18n: 'router.raceManage',
|
||||
icon: 'design'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'bank',
|
||||
component: BankManage,
|
||||
@ -1020,14 +1003,6 @@ export const asyncRouter = [
|
||||
icon: 'design'
|
||||
}
|
||||
},
|
||||
// {
|
||||
// path: 'practice',
|
||||
// component: PracticeManage,
|
||||
// meta: {
|
||||
// i18n: 'router.practiceManage',
|
||||
// icon: 'design'
|
||||
// }
|
||||
// },
|
||||
{
|
||||
path: 'scene',
|
||||
component: Scene,
|
||||
@ -1045,11 +1020,6 @@ export const asyncRouter = [
|
||||
path: 'questionUpdate/:questionId',
|
||||
component: QuestionUpdatePage,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'generate',
|
||||
component: GeneratePaper,
|
||||
hidden: true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -1,165 +0,0 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag title="创建竞赛" :visible.sync="dialogVisible" width="500px" center :show-close="false" :close-on-click-modal="false" :close-on-press-escape="false">
|
||||
<el-form ref="form" :model="formModel" :rules="rules" label-width="90px">
|
||||
<el-form-item label="竞赛名称:" prop="name">
|
||||
<el-input v-model="formModel.name" style="width: 220px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="竞赛地图:" prop="mapId">
|
||||
<el-select v-model="formModel.mapId" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in mapList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="开始日期:" prop="startDate">
|
||||
<el-date-picker
|
||||
v-model="formModel.startDate"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择日期"
|
||||
:picker-options="pickerOptions"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="结束日期:" prop="endDate">
|
||||
<el-date-picker
|
||||
v-model="formModel.endDate"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择日期"
|
||||
:picker-options="pickerOptions"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button v-if="!isUpdate" v-loading="loading" type="primary" @click="doSave">创建</el-button>
|
||||
<el-button v-if="isUpdate" v-loading="loading" type="primary" @click="doUpdate">修改</el-button>
|
||||
<el-button @click="dialogVisible = false">{{ $t('global.cancel') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { updateRace, createRace } from '@/api/race';
|
||||
export default {
|
||||
name: 'CreateRace',
|
||||
props: {
|
||||
mapList: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
var validatePass = (rule, value, callback) => {
|
||||
if (this.formModel.startDate && this.formModel.endDate) {
|
||||
if (new Date(this.formModel.startDate).valueOf() > new Date(this.formModel.endDate).valueOf()) {
|
||||
callback(new Error('竞赛开始日期不得在结束日期之后'));
|
||||
} else {
|
||||
this.$refs.form.clearValidate('startDate');
|
||||
this.$refs.form.clearValidate('endDate');
|
||||
callback();
|
||||
}
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
return {
|
||||
dialogVisible: false,
|
||||
formModel: {
|
||||
name: '',
|
||||
startDate: '',
|
||||
endDate: '',
|
||||
mapId: '',
|
||||
optionalTypes: ['DISPATCHER']
|
||||
},
|
||||
pickerOptions: {
|
||||
disabledDate(time) {
|
||||
return time.getTime() < Date.now();
|
||||
}
|
||||
},
|
||||
raceId: '',
|
||||
loading: false,
|
||||
isUpdate: false,
|
||||
mapId: '',
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: '请输入竞赛名称', trigger: 'blur' }
|
||||
],
|
||||
mapId: [
|
||||
{ required: true, message: '请输入竞赛地图', trigger: 'change'}
|
||||
],
|
||||
startDate: [
|
||||
{ required: true, message: '请输入竞赛开始日期', trigger: 'change' },
|
||||
{validator: validatePass, trigger: 'change' }
|
||||
],
|
||||
endDate: [
|
||||
{ required: true, message: '请输入竞赛开始日期', trigger: 'change' },
|
||||
{validator: validatePass, trigger: 'change' }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
methods: {
|
||||
doShow(row) {
|
||||
this.dialogVisible = true;
|
||||
this.loading = false;
|
||||
this.isUpdate = false;
|
||||
this.raceId = '';
|
||||
if (row) {
|
||||
this.isUpdate = true;
|
||||
this.raceId = row.id;
|
||||
this.formModel.name = row.name;
|
||||
this.formModel.startDate = row.startDate;
|
||||
this.formModel.endDate = row.endDate;
|
||||
this.formModel.mapId = row.mapId + '';
|
||||
}
|
||||
},
|
||||
doSave() {
|
||||
if (this.loading) {
|
||||
return;
|
||||
}
|
||||
this.loading = true;
|
||||
createRace(this.formModel).then(resp => {
|
||||
this.$message.success('创建竞赛成功!');
|
||||
this.$emit('refresh');
|
||||
}).catch(()=> {
|
||||
this.$message.error('创建竞赛失败!');
|
||||
}).finally(()=> {
|
||||
this.dialogVisible = false;
|
||||
this.loading = false;
|
||||
this.$refs.form.resetFields();
|
||||
});
|
||||
},
|
||||
doUpdate() {
|
||||
if (this.loading) {
|
||||
return;
|
||||
}
|
||||
this.loading = true;
|
||||
const params = {
|
||||
id: this.raceId,
|
||||
name: this.formModel.name,
|
||||
startDate: this.formModel.startDate,
|
||||
endDate: this.formModel.endDate,
|
||||
mapId: this.formModel.mapId
|
||||
};
|
||||
updateRace(this.raceId, params).then(resp => {
|
||||
this.$message.success('修改竞赛成功!');
|
||||
this.$emit('refresh');
|
||||
}).catch(()=> {
|
||||
this.$message.error('修改竞赛失败!');
|
||||
}).finally(() => {
|
||||
this.dialogVisible = false;
|
||||
this.loading = false;
|
||||
this.$refs.form.resetFields();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -1,184 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
<create-race ref="createRace" :map-list="mapList" @refresh="refresh" />
|
||||
<input id="competition-manage-url" v-model="url" style="opacity: 0;">
|
||||
<div id="bm" ref="bm" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getRaceList } from '@/api/race';
|
||||
import CreateRace from './create';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
|
||||
export default {
|
||||
name: 'PublishMap',
|
||||
components: {
|
||||
CreateRace
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
cityList: [],
|
||||
lineCodeList: [],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '80px',
|
||||
reset: true,
|
||||
queryObject: {
|
||||
raceName: {
|
||||
type: 'text',
|
||||
label: '竞赛名称'
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
queryList: {
|
||||
query: getRaceList,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '竞赛名称',
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '竞赛地图',
|
||||
prop: 'mapId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['value', 'label']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '开始日期',
|
||||
prop: 'startDate'
|
||||
},
|
||||
{
|
||||
title: '结束日期',
|
||||
prop: 'endDate'
|
||||
},
|
||||
{
|
||||
title: '创建人',
|
||||
prop: 'creatorName'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('global.operate'),
|
||||
width: 580,
|
||||
buttons: [
|
||||
{
|
||||
name: '修改',
|
||||
handleClick: this.update,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
name: '报名地址',
|
||||
handleClick: this.showApplyUrl,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
name: '参赛地址',
|
||||
handleClick: this.showJoinUrl
|
||||
},
|
||||
{
|
||||
name: '裁判地址',
|
||||
handleClick: this.showRefereeUrl
|
||||
},
|
||||
{
|
||||
name: '生成试卷',
|
||||
handleClick: this.generatePaper
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '创建竞赛', handler: this.createRace }
|
||||
]
|
||||
},
|
||||
mapList: [],
|
||||
currentModel: {},
|
||||
url: ''
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.loadInitData();
|
||||
getPublishMapListOnline().then(response=>{
|
||||
this.mapList = response.data.map(elem => { return { value: elem.id, label: elem.name }; });
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
loadInitData() {
|
||||
this.cityList = [];
|
||||
this.lineCodeList = [];
|
||||
},
|
||||
createRace() {
|
||||
this.$refs.createRace.doShow();
|
||||
},
|
||||
refresh() {
|
||||
this.$refs.queryListPage.refresh(true);
|
||||
},
|
||||
update(index, row) {
|
||||
this.$refs.createRace.doShow(row);
|
||||
},
|
||||
showJoinUrl(index, row) {
|
||||
const url = `${window.location.protocol}//${window.location.host}/jsxt/login?raceId=${row.id}`;
|
||||
this.url = url;
|
||||
this.$messageBox();
|
||||
this.$confirm(`${row.name}参赛路径:${url}`, '参赛路径', {
|
||||
confirmButtonText: '复制路径',
|
||||
cancelButtonText: '关闭',
|
||||
type: 'success'
|
||||
}).then(() => {
|
||||
const inputText = document.getElementById('competition-manage-url');
|
||||
inputText.select(); // 选择对象
|
||||
document.execCommand('Copy'); // 执行浏览器复制命令
|
||||
this.$message.success('参赛路径已经复制到粘贴板');
|
||||
});
|
||||
},
|
||||
showApplyUrl(index, row) {
|
||||
// this.$messageBox(`${row.name}报名路径:${window.location.protocol}//${window.location.host}/jsxtApply?raceId=${row.id}`);
|
||||
const url = `${window.location.protocol}//${window.location.host}/jsxtApply?raceId=${row.id}`;
|
||||
this.url = url;
|
||||
this.$messageBox();
|
||||
this.$confirm(`${row.name}报名路径:${url}`, '报名路径', {
|
||||
confirmButtonText: '复制路径',
|
||||
cancelButtonText: '关闭',
|
||||
type: 'success'
|
||||
}).then(() => {
|
||||
const inputText = document.getElementById('competition-manage-url');
|
||||
inputText.select(); // 选择对象
|
||||
document.execCommand('Copy'); // 执行浏览器复制命令
|
||||
this.$message.success('报名路径已经复制到粘贴板');
|
||||
});
|
||||
},
|
||||
showRefereeUrl(index, row) {
|
||||
const url = `${window.location.protocol}//${window.location.host}/refereeJsxt/login?raceId=${row.id}`;
|
||||
this.url = url;
|
||||
this.$messageBox();
|
||||
this.$confirm(`${row.name}裁判地址:${url}`, '报名路径', {
|
||||
confirmButtonText: '复制路径',
|
||||
cancelButtonText: '关闭',
|
||||
type: 'success'
|
||||
}).then(() => {
|
||||
const inputText = document.getElementById('competition-manage-url');
|
||||
inputText.select(); // 选择对象
|
||||
document.execCommand('Copy'); // 执行浏览器复制命令
|
||||
this.$message.success('报名路径已经复制到粘贴板');
|
||||
});
|
||||
},
|
||||
generatePaper(index, row) {
|
||||
this.$router.push({ path: `/design/race/generate`, query: {raceId:row.id, mapId: row.mapId} });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
/deep/
|
||||
.el-button+.el-button{
|
||||
margin-top: 5px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
</style>
|
@ -1,230 +0,0 @@
|
||||
<template>
|
||||
<div style="width: 100%;height: 100%;">
|
||||
<div style="margin-top: 10px;position: absolute; right: 50px;">
|
||||
<el-button size="small" type="primary" @click="exportPaper">导出试题</el-button>
|
||||
<el-button size="small" type="primary" @click="goBack">返回</el-button>
|
||||
</div>
|
||||
<el-card style="width: 45%;margin-left: 50px;margin-top: 60px;display: inline-block;height: calc(100% - 100px);">
|
||||
<div slot="header">
|
||||
<span>理论试题列表</span>
|
||||
<el-button style="float: right; padding: 3px 0" type="text" @click="addTheoryQuestion">添加试题</el-button>
|
||||
<el-button style="float: right; padding: 3px 0;margin-right: 5px" type="text" @click="theoryReview">预览</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
:data="theoryQuestionList"
|
||||
style="width: 100%"
|
||||
height="100%"
|
||||
:summary-method="getSummaries"
|
||||
:show-summary="showSummary"
|
||||
:row-style="handleRowStyle"
|
||||
>
|
||||
<el-table-column prop="type" label="类型" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-tag type="primary" disable-transitions>{{ QuestionTypeMap[scope.row.type] }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="topic" label="题目" show-overflow-tooltip="">
|
||||
<template slot-scope="scope">
|
||||
<span v-html="scope.row.topic" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="score" label="分值" width="100">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="!scope.row.editScope" @click="editScope(scope.row)">{{ scope.row.score }}</span>
|
||||
<i v-if="!scope.row.editScope" class="el-icon-edit" @click="editScope(scope.row)" />
|
||||
<el-input-number v-if="scope.row.editScope" v-model="scope.row.score" v-focus="scope.row.editFocus" :controls="noControls" :min="0" size="mini" style="width: 90px" @blur="editScopeBlur(scope.row)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="operate" label="操作" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="warning" size="mini" @click="removeTheoryQuestion(scope.row)">移出</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<el-card style="width: 45%;margin-left: calc(10% - 100px);margin-top: 60px;display: inline-block;height: calc(100% - 100px);">
|
||||
<div slot="header">
|
||||
<span>实操试题列表</span>
|
||||
<el-button style="float: right; padding: 3px 0" type="text" @click="addOperateQuestion">添加试题</el-button>
|
||||
<el-button style="float: right; padding: 3px 0;margin-right: 5px" type="text" @click="operateReview">预览</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
:data="operateQuestionList"
|
||||
style="width: 100%"
|
||||
height="100%"
|
||||
:row-style="handleRowStyle"
|
||||
:summary-method="getSummaries"
|
||||
:show-summary="showSummary"
|
||||
>
|
||||
<el-table-column prop="question" label="实操名称">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.question.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="question" label="实操描述">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.question.description }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="score" label="分值">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="!scope.row.editScope" @click="editScope(scope.row)">{{ scope.row.score }}</span>
|
||||
<i v-if="!scope.row.editScope" class="el-icon-edit" @click="editScope(scope.row)" />
|
||||
<el-input-number v-if="scope.row.editScope" v-model="scope.row.score" v-focus="scope.row.editFocus" :controls="noControls" :min="0" size="mini" @blur="editScopeBlur(scope.row)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="operate" label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="warning" size="mini" @click="removeOperateQuestion(scope.row)">移出</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<set-exam-time ref="setExamTime" :theory-question-list="theoryQuestionList" :operate-question-list="operateQuestionList" />
|
||||
<theory-review ref="theoryReview" :theory-question-list="theoryQuestionList" />
|
||||
<theory-question ref="theoryQuestion" :theory-index-list="theoryIndexList" @addQuestion="addTheoryQuestionList" @removeQuestion="removeTheoryQuestion" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TheoryReview from './theoryReview';
|
||||
import TheoryQuestion from './theoryQuestion';
|
||||
import SetExamTime from './setExamTime';
|
||||
export default {
|
||||
name: 'GeneratPaper',
|
||||
components: {
|
||||
SetExamTime,
|
||||
TheoryReview,
|
||||
TheoryQuestion
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
QuestionTypeMap: {
|
||||
select: '选择题',
|
||||
judge: '判断题'
|
||||
},
|
||||
showSummary: true,
|
||||
noControls: false,
|
||||
theoryQuestionList: [], // 理论试卷试题列表
|
||||
operateQuestionList: [], // 实操试卷试题列表
|
||||
theoryIndexList: [], // 理论试卷试题索引列表
|
||||
operateIndexList: []// 实操试卷试题索引列表
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
removeOperateQuestion(row) {
|
||||
const index = this.operateIndexList.indexOf(row.id);
|
||||
this.operateIndexList.splice(index, 1);
|
||||
this.operateQuestionList.splice(index, 1);
|
||||
},
|
||||
removeTheoryQuestion(row) {
|
||||
const index = this.theoryIndexList.indexOf(row.id);
|
||||
this.theoryIndexList.splice(index, 1);
|
||||
this.theoryQuestionList.splice(index, 1);
|
||||
},
|
||||
addTheoryQuestionList(row) {
|
||||
if (this.theoryQuestionList.length) {
|
||||
this.theoryIndexList.push(row.id);
|
||||
this.theoryQuestionList.push(row);
|
||||
} else {
|
||||
this.theoryIndexList = [row.id];
|
||||
this.theoryQuestionList = [row];
|
||||
}
|
||||
},
|
||||
addOperateQuestionList(row) {
|
||||
const length = this.operateQuestionList.length;
|
||||
if (length) {
|
||||
this.operateIndexList.push(row.id);
|
||||
this.operateQuestionList.push({id:length + 1, score:0, question: row});
|
||||
} else {
|
||||
this.operateIndexList = [row.id];
|
||||
this.operateQuestionList = [{id:1, score:0, question: row}];
|
||||
}
|
||||
},
|
||||
addTheoryQuestion() {
|
||||
this.$refs.theoryQuestion.doShow();
|
||||
},
|
||||
addOperateQuestion() {
|
||||
},
|
||||
goBack() {
|
||||
this.$router.go(-1);
|
||||
},
|
||||
theoryReview() {
|
||||
this.$refs.theoryReview.doShow();
|
||||
},
|
||||
operateReview() {
|
||||
},
|
||||
editScope(row) {
|
||||
this.$set(row, 'editScope', true);
|
||||
this.$nextTick(() => {
|
||||
this.$set(row, 'editFocus', true);
|
||||
});
|
||||
},
|
||||
editScopeBlur(row) {
|
||||
this.$set(row, 'editScope', false);
|
||||
this.$set(row, 'editFocus', true);
|
||||
if (row.score > 0) {
|
||||
this.$set(row, 'isError', false);
|
||||
}
|
||||
this.showSummary = false;
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.getSummaries({data: this.theoryQuestionList});
|
||||
});
|
||||
},
|
||||
handleRowStyle({row, rowIndex}) {
|
||||
return row.isError ? {background: '#F00'} : {background: '#FFF'};
|
||||
},
|
||||
getSummaries(param) {
|
||||
const { data } = param;
|
||||
const sums = [];
|
||||
sums[0] = '总分';
|
||||
const values = data.map(item => Number(item.score));
|
||||
if (!values.every(value => isNaN(value))) {
|
||||
sums[2] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr);
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr;
|
||||
} else {
|
||||
return prev;
|
||||
}
|
||||
}, 0);
|
||||
sums[2] += ' 分';
|
||||
}
|
||||
this.showSummary = true;
|
||||
return sums;
|
||||
},
|
||||
exportPaper() {
|
||||
let flag = false;
|
||||
this.theoryQuestionList.forEach((item) => {
|
||||
if (item.score <= 0) {
|
||||
flag = true;
|
||||
this.$set(item, 'isError', true);
|
||||
}
|
||||
});
|
||||
this.operateQuestionList.forEach((item) => {
|
||||
if (item.score <= 0) {
|
||||
flag = true;
|
||||
this.$set(item, 'isError', true);
|
||||
}
|
||||
});
|
||||
if (flag) {
|
||||
this.$message.error('试题分分值不得为0');
|
||||
} else {
|
||||
this.$refs.setExamTime.doShow();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/deep/
|
||||
.el-card__body{
|
||||
height: calc(100% - 47px);
|
||||
}
|
||||
/deep/
|
||||
.el-table__body-wrapper {
|
||||
height: calc(100% - 97px) !important;
|
||||
}
|
||||
</style>
|
@ -1,120 +0,0 @@
|
||||
<template>
|
||||
<el-dialog :title="title" :visible.sync="dialogVisible" width="500px" :before-close="doClose" center>
|
||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doCreate">{{ $t('global.confirm') }}</el-button>
|
||||
<el-button @click="doClose">{{ $t('global.cancel') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getScriptByIdBasic} from '@/api/script';
|
||||
|
||||
export default {
|
||||
name: 'ScriptDraft',
|
||||
props: {
|
||||
title: {
|
||||
type: String,
|
||||
default() {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
mapList:{
|
||||
type: Array,
|
||||
default() {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
isEdit:false,
|
||||
formModel: {
|
||||
name: '',
|
||||
mapId: '',
|
||||
description:''
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
const form = {
|
||||
labelWidth: '120px',
|
||||
items: [
|
||||
{ prop: 'name', label: '实操名称', type: 'text' },
|
||||
{ prop:'mapId', label:'实操地图', type:'select', options:this.mapList, disabled:this.isEdit},
|
||||
{ prop: 'description', label: '实操描述', type: 'textarea' }
|
||||
]
|
||||
};
|
||||
return form;
|
||||
},
|
||||
rules() {
|
||||
const crules = {
|
||||
name: [
|
||||
{ validator: this.validateScriptName, trigger: 'blur' },
|
||||
{ validator: this.validateScriptName, trigger: 'change' }
|
||||
],
|
||||
description: [
|
||||
{ validator: this.validateDescription, trigger: 'blur' },
|
||||
{ validator: this.validateDescription, trigger: 'change' }
|
||||
],
|
||||
mapId:[
|
||||
{ required: true, message: '请选择地图', trigger: 'change' }
|
||||
]
|
||||
};
|
||||
return crules;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
validateScriptName(rule, value, callback) {
|
||||
if (value.trim().length === 0) {
|
||||
this.formModel.name = this.formModel.name.replace(/\s/g, '');
|
||||
return callback(new Error('请输入实操名称'));
|
||||
} else {
|
||||
return callback();
|
||||
}
|
||||
},
|
||||
validateDescription(rule, value, callback) {
|
||||
if (value.trim().length === 0) {
|
||||
this.formModel.description = this.formModel.description.replace(/\s/g, '');
|
||||
return callback(new Error('请输入实操描述'));
|
||||
} else {
|
||||
return callback();
|
||||
}
|
||||
},
|
||||
doShow(questid) {
|
||||
if (questid) {
|
||||
getScriptByIdBasic(questid).then(resp=>{
|
||||
const data = {'name':resp.data.name, 'description':resp.data.description, 'mapId':resp.data.mapId, isRace:resp.data.isRace};
|
||||
this.formModel = data;
|
||||
this.formModel.id = questid;
|
||||
this.dialogVisible = true;
|
||||
this.isEdit = true;
|
||||
});
|
||||
} else {
|
||||
this.formModel.isRace = true;
|
||||
this.dialogVisible = true;
|
||||
this.isEdit = false;
|
||||
}
|
||||
},
|
||||
doCreate() {
|
||||
const self = this;
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
self.$emit('create', Object.assign({}, this.formModel));
|
||||
self.doClose();
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.$refs.dataform.resetForm();
|
||||
this.dialogVisible = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
/deep/ .el-dialog--center .el-dialog__body{
|
||||
padding: 25px 65px 30px 10px;
|
||||
}
|
||||
</style>
|
@ -1,59 +0,0 @@
|
||||
<template>
|
||||
<div class="script-parent">
|
||||
<div class="script-card" :style="{width: widthLeft+'px'}">
|
||||
<practice-record ref="tipTaskRecord" :group="group" :width="widthLeft" />
|
||||
</div>
|
||||
<drap-left :width-left="widthLeft" :min="480" :max="580" @drapWidth="drapWidth" />
|
||||
<div class="script-display">
|
||||
<display ref="display" :size="size" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Display from '@/views/newMap/displayNew/index';
|
||||
import PracticeRecord from './practiceRecord';
|
||||
import drapLeft from '@/views/components/drapLeft/index';
|
||||
|
||||
export default {
|
||||
name: 'ScriptDisplayNew',
|
||||
components: {
|
||||
Display,
|
||||
PracticeRecord,
|
||||
drapLeft
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
widthLeft: 480,
|
||||
size: {
|
||||
width: document.documentElement.clientWidth - 480,
|
||||
height: document.documentElement.clientHeight
|
||||
},
|
||||
group: this.$route.query.group
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
'$store.state.app.windowSizeCount': function() {
|
||||
this.size = { width: this.$store.state.app.width - 480, height: this.$store.state.app.height};
|
||||
},
|
||||
widthLeft: function(val) {
|
||||
this.size = { width: this.$store.state.app.width - val, height: this.$store.state.app.height};
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
drapWidth(width) {
|
||||
this.widthLeft = Number(width);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
.script-parent {
|
||||
display: flex;
|
||||
flex-flow: row;
|
||||
.script-card {
|
||||
width: 780px;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,10 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
111
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
|
||||
};
|
||||
</script>
|
@ -1,201 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<query-list-page ref="user" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
<create-practice ref="createPractice" :map-list="mapList" title="创建实操" @reloadTable="reloadTable" @create="handleConfirmCreate" />
|
||||
<create-practice ref="modifyPractice" :map-list="mapList" title="修改实操" @reloadTable="reloadTable" @create="handleConfirmModify" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import Cookies from 'js-cookie';
|
||||
import { getPublishMapListOnline, getPublishMapInfo } from '@/api/jmap/map';
|
||||
import { getPracticeList } from '@/api/race';
|
||||
import {updateScript, deleteScript, createScript} from '@/api/script';
|
||||
import { scriptRecordNotifyNew } from '@/api/simulation';
|
||||
|
||||
import { launchFullscreen } from '@/utils/screen';
|
||||
import { UrlConfig } from '@/scripts/ConstDic';
|
||||
import CreatePractice from './create';
|
||||
export default {
|
||||
name:'PracticeManage',
|
||||
components:{
|
||||
CreatePractice
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
mapList:[],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
reset: true,
|
||||
labelWidth: '80px',
|
||||
queryObject: {
|
||||
mapId: {
|
||||
type: 'select',
|
||||
label: '实操地图',
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
},
|
||||
name: {
|
||||
type: 'text',
|
||||
label: '实操名称'
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: getPracticeList,
|
||||
// data:[
|
||||
// {id:1, raceId:2, name:'行调进行扣车操作', creatorName:'水墨'},
|
||||
// {id:2, raceId:4, name:'行调进行扣车操作', creatorName:'zyy'},
|
||||
// {id:3, raceId:3, name:'行调进行扣车操作', creatorName:'水墨'}
|
||||
// ],
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '实操地图',
|
||||
prop: 'mapId',
|
||||
type: 'tag',
|
||||
width: '320',
|
||||
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['value', 'label']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '实操名称',
|
||||
prop: 'name',
|
||||
width: '400'
|
||||
},
|
||||
{
|
||||
title: '实操描述',
|
||||
prop: 'description'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操 作',
|
||||
width: '420',
|
||||
buttons: [
|
||||
{
|
||||
name: '录 制',
|
||||
handleClick: this.doRecord,
|
||||
type: 'success'
|
||||
},
|
||||
{
|
||||
name: '更 新',
|
||||
handleClick: this.doUpdate,
|
||||
type: 'primary'
|
||||
},
|
||||
{
|
||||
name: '删 除',
|
||||
handleClick: this.doDelete,
|
||||
type: 'danger'
|
||||
}
|
||||
// {
|
||||
// name: '预 览',
|
||||
// handleClick: this.doDetail
|
||||
// }
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '添 加', handler: this.doCreate }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
getPublishMapListOnline().then(response=>{
|
||||
this.mapList = response.data.map(elem => { return { value: elem.id, label: elem.name }; });
|
||||
this.queryForm.queryObject.mapId.config.data = this.mapList;
|
||||
});
|
||||
},
|
||||
methods:{
|
||||
doCreate() {
|
||||
this.$refs.createPractice.doShow(null);
|
||||
},
|
||||
doDetail() {
|
||||
|
||||
},
|
||||
doDelete(index, row) {
|
||||
this.$confirm('此操作将删除此实操, 是否继续?', this.$t('global.tips'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteScript(row.id).then(response => {
|
||||
this.$message.success('删除实操试题成功');
|
||||
this.reloadTable();
|
||||
}).catch((error) => {
|
||||
this.$messageBox(`删除实操试题失败: ${error.message}`);
|
||||
});
|
||||
}).catch(() => { });
|
||||
},
|
||||
doRecord(index, row) {
|
||||
getPublishMapInfo(row.mapId).then(response=>{
|
||||
const lineCode = response.data.lineCode;
|
||||
scriptRecordNotifyNew(row.id).then(resp => {
|
||||
const query = { mapId: row.mapId, group: resp.data, scriptId: row.id, lang:row.lang, drawWay:true, lineCode:lineCode};
|
||||
this.$router.push({ path: `${UrlConfig.scriptDisplayNew}/script`, query });
|
||||
launchFullscreen();
|
||||
}).catch(error => {
|
||||
this.$messageBox(`创建仿真失败: ${error.message}`);
|
||||
});
|
||||
});
|
||||
// row.id
|
||||
// let raceInfo;
|
||||
// this.raceList.forEach(each=>{
|
||||
// if (each.id == row.raceId) {
|
||||
// raceInfo = each;
|
||||
// }
|
||||
// });
|
||||
// practiceRecordNotify(83).then(resp => {
|
||||
// const query = { mapId: raceInfo.mapId, group: resp.data, scriptId: row.id, lineCode:raceInfo.lineCode};
|
||||
// this.$router.push({ path: `${UrlConfig.practiceDisplayNew}/practice`, query });
|
||||
// launchFullscreen();
|
||||
// }).catch(error => {
|
||||
// this.$messageBox(`创建仿真失败: ${error.message}`);
|
||||
// });
|
||||
},
|
||||
// 修改
|
||||
doUpdate(index, row) {
|
||||
this.$refs.modifyPractice.doShow(row.id);
|
||||
},
|
||||
getRaceName(raceId) {
|
||||
let raceName = '';
|
||||
this.raceList.forEach(each=>{
|
||||
if (each.id == raceId) {
|
||||
raceName = each.name;
|
||||
}
|
||||
});
|
||||
return raceName;
|
||||
},
|
||||
reloadTable() {
|
||||
if (this.queryList && this.queryList.reload) {
|
||||
this.queryList.reload();
|
||||
}
|
||||
},
|
||||
handleConfirmCreate(data) {
|
||||
if (Cookies.get('user_lang') == 'en') {
|
||||
data.lang = 'en';
|
||||
} else {
|
||||
data.lang = 'zh';
|
||||
}
|
||||
createScript(data).then(resp => {
|
||||
this.reloadTable();
|
||||
this.$message.success('创建实操试题成功');
|
||||
}).catch(error => {
|
||||
this.$messageBox(`创建实操试题失败: ${error.message}`);
|
||||
});
|
||||
},
|
||||
handleConfirmModify(data) {
|
||||
updateScript(data.id, data).then(resp => {
|
||||
this.reloadTable();
|
||||
this.$message.success('修改实操试题成功');
|
||||
}).catch(error => {
|
||||
this.$messageBox(`修改实操试题失败: ${error.message}`);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user