Merge remote-tracking branch 'origin/test'

This commit is contained in:
joylink_zhangsai 2021-03-30 18:46:50 +08:00
commit 1b8d19e555
34 changed files with 521 additions and 321 deletions

View File

@ -111,10 +111,11 @@ export function getLessonProjectList(params) {
});
}
/** 获取自己发布课程列表不分页 */
export function getLessonProjectListNoPage() {
export function getLessonProjectListNoPage(params) {
return request({
url: '/api/lesson/list/byLoginProject',
method: 'get'
method: 'get',
params
});
}
/** 获取班级关联的自己发布的课程 */

View File

@ -9,22 +9,6 @@ export function createExam(data) {
});
}
/** 获取对应课程下类型 */
export function getCourseTypeList(data) {
return request({
url: `/api/exam/${data.lessonId}/trainingTypes`,
method: 'get'
});
}
/** 获取考试课程详情 */
export function getCourseLessonDetail(data) {
return request({
url: `/api/exam/${data.lessonId}/list`,
method: 'get'
});
}
/** 获取试卷详情 */
export function getExamLessonDetail(examId) {
return request({
@ -66,17 +50,6 @@ export function setExamEffectivey(data) {
});
}
/** 查询课程下类型题数 */
export function getLessonTypeNum(data) {
return request({
url: `/api/exam/trainingNum/${data.lessonId}/${data.trainingType}`,
method: 'get',
params: {
operateType: data.operateType
}
});
}
/** 更新考试规则*/
export function updateExamRules(data) {
return request({

View File

@ -18,7 +18,7 @@ class Iscs {
this.methods = opts.methods;
// 鼠标事件
this.events = { __Pan: 'pan', Selected: 'selected', Contextmenu: 'contextmenu', Keyboard: 'keyboard', dblclick: 'dblclick'};
this.events = { __Pan: 'pan', Selected: 'selected', Contextmenu: 'contextmenu', Keyboard: 'keyboard', dblclick: 'dblclick', click:'click'};
// 设备数据
this.iscsDevice = {};
@ -280,6 +280,9 @@ class Iscs {
case this.events.dblclick:
this.$mouseController.on(this.events.dblclick, cb, context);
break;
case this.events.click:
this.$mouseController.on(this.events.click, cb, context);
break;
case this.events.Contextmenu:
this.$mouseController.on(this.events.Contextmenu, cb, context);
break;
@ -303,6 +306,9 @@ class Iscs {
case this.events.dblclick:
this.$mouseController.off(this.events.dblclick, cb);
break;
case this.events.click:
this.$mouseController.off(this.events.click, cb);
break;
case this.events.Contextmenu:
this.$mouseController.off(this.events.Contextmenu, cb);
break;

View File

@ -138,7 +138,11 @@ class MouseController extends Eventful {
}
click(e) {
var em = this.checkEvent(e);
this.trigger(this.events.Selected, em);
if (em.deviceType == 'IscsButton') {
this.trigger(this.events.click, em);
} else {
this.trigger(this.events.Selected, em);
}
}
moveEvent(e) {
const newEm = new EventModel(e);

View File

@ -7,34 +7,34 @@ const defaultConfig = {
/** 间隔高度*/
multiple: 3,
/** 偏移时间*/
translation: 60 * 60 * 2,
}
translation: 60 * 60 * 2
};
class EqualDistanceParser {
constructor() {
}
constructor() {
}
/** 加载配置*/
load(config = defaultConfig) {
this.config = config;
this.multiple = config.multiple;
this.translation = config.translation;
this.edge = config.edge;
return this;
}
/** 加载配置*/
load(config = defaultConfig) {
this.config = config;
this.multiple = config.multiple;
this.translation = config.translation;
this.edge = config.edge;
return this;
}
/** 解析excel数据转换为Json后台数据*/
importData(sheet, data) {
if (this.config &&
/** 解析excel数据转换为Json后台数据*/
importData(sheet, data) {
if (this.config &&
this.config.importData) {
this.config.importData(sheet, data)
} else {
console.info('no import data function');
}
}
this.config.importData(sheet, data);
} else {
console.info('no import data function');
}
}
/** 将后台数据解析成图表*/
convertDataToModels(data, stations, kmRangeMap, lineStyle) {
/** 将后台数据解析成图表*/
convertDataToModels(data, stations, kmRangeMap, lineStyle) {
var models = [];
if (data && data.serviceNumberDataList && data.serviceNumberDataList.length) {
@ -74,12 +74,16 @@ class EqualDistanceParser {
/** 计算折返点车次坐标点集合*/
if (!train.backup && train.reentry && service.tripNumberDataList[j + 1] && service.tripNumberDataList[j + 1].stationTimeList) {
lastPoint = train.stationTimeList[idx];
nextPoint = service.tripNumberDataList[j + 1].stationTimeList[0];
// ${train.directionCode}
const aa = `${train.tripNumber}`;
opt.data.push([lastPoint.secondTime, this.getCoordYByElem(stations, kmRangeMap, lastPoint, pointdata.directionCode, true), lastPoint.stationCode, aa, '折返轨']);
opt.data.push([nextPoint.secondTime, this.getCoordYByElem(stations, kmRangeMap, lastPoint, pointdata.directionCode, true), lastPoint.stationCode, aa, '折返轨']);
const currentTimeList = service.tripNumberDataList[j].stationTimeList;
const nextTimeList = service.tripNumberDataList[j + 1].stationTimeList;
if (currentTimeList[currentTimeList.length - 1].secondTime != nextTimeList[0].secondTime) {
lastPoint = train.stationTimeList[idx];
nextPoint = service.tripNumberDataList[j + 1].stationTimeList[0];
// ${train.directionCode}
const aa = `${train.tripNumber}`;
opt.data.push([lastPoint.secondTime, this.getCoordYByElem(stations, kmRangeMap, lastPoint, pointdata.directionCode, true), lastPoint.stationCode, aa, '折返轨']);
opt.data.push([nextPoint.secondTime, this.getCoordYByElem(stations, kmRangeMap, lastPoint, pointdata.directionCode, true), lastPoint.stationCode, aa, '折返轨']);
}
}
/** 如果是备用车,按车次添加线*/
@ -232,11 +236,11 @@ class EqualDistanceParser {
/** 根据方向计算y折返偏移量*/
getValueYByDirectionCode(defaultValue, directionCode) {
const sign = this.getReverse() ? -1 : 1;
const sign = this.getReverse() ? -1 : 1;
if (directionCode === '1') {
defaultValue -= sign*this.getEdge() / 2;
defaultValue -= sign * this.getEdge() / 2;
} else if (directionCode === '2') {
defaultValue += sign*this.getEdge() / 2;
defaultValue += sign * this.getEdge() / 2;
}
return defaultValue;
@ -256,33 +260,33 @@ class EqualDistanceParser {
return defaultValue;
}
getMultiple() {
return this.config.multiple;
}
getMultiple() {
return this.config.multiple;
}
getTranslation() {
return this.config.translation
}
getTranslation() {
return this.config.translation;
}
getEdge(){
return this.config.edge;
}
getEdge() {
return this.config.edge;
}
getReverse() {
return this.config.reverse;
}
getReverse() {
return this.config.reverse;
}
__createMartPoint(...args) {
return this.config.reverse ? createMartPointReverse(...args): createMartPoint(...args);
}
__createMartPoint(...args) {
return this.config.reverse ? createMartPointReverse(...args) : createMartPoint(...args);
}
__createSeriesModel(...args) {
return createSeriesModel(...args);
}
__createSeriesModel(...args) {
return createSeriesModel(...args);
}
__createMarkLineModels(...args) {
return createMarkLineModels(...args);
}
__createMarkLineModels(...args) {
return createMarkLineModels(...args);
}
}
export default EqualDistanceParser;

View File

@ -2,40 +2,40 @@ import { createSeriesModel, createMarkLineModels, createMartPoint, createMartPoi
import store from '@/store/index';
const defaultConfig = {
/** 最小时间*/
minTime: 0,
/** 最大时间*/
maxTime: 3600 * 24 - 1,
/** 边缘高度*/
edge: 600,
/** 间隔高度*/
multiple: 1,
/** 偏移时间*/
translation: 0,
}
/** 最小时间*/
minTime: 0,
/** 最大时间*/
maxTime: 3600 * 24 - 1,
/** 边缘高度*/
edge: 600,
/** 间隔高度*/
multiple: 1,
/** 偏移时间*/
translation: 0
};
class EqualRatioParser {
constructor() {
}
constructor() {
}
/** 加载配置*/
load(config = defaultConfig) {
this.config = config;
return this;
}
/** 加载配置*/
load(config = defaultConfig) {
this.config = config;
return this;
}
/** 解析excel数据转换为Json后台数据*/
importData(sheet, data) {
if (this.config &&
/** 解析excel数据转换为Json后台数据*/
importData(sheet, data) {
if (this.config &&
this.config.importData) {
this.config.importData(sheet, data)
} else {
console.info('no import data function');
}
}
this.config.importData(sheet, data);
} else {
console.info('no import data function');
}
}
/** 将后台数据解析成图表*/
convertDataToModels(data, stations, kmRangeMap, lineStyle) {
/** 将后台数据解析成图表*/
convertDataToModels(data, stations, kmRangeMap, lineStyle) {
var models = [];
if (data && data.serviceNumberDataList && data.serviceNumberDataList.length) {
/** 按服务遍历数据*/
@ -74,19 +74,23 @@ class EqualRatioParser {
// if (index == 0 && train.stationTimeList[index].stationCode != train.stationTimeList[index + 1].stationCode ||
// index == train.stationTimeList.length - 2 && train.stationTimeList[index].secondTime != train.stationTimeList[index + 1].secondTime ||
// index > 0 && index < train.stationTimeList.length - 1) {
const aa = `${train.tripNumber}`;
opt.data.push([elem.secondTime, this.getCoordYByElem(stations, kmRangeMap, elem, pointdata.directionCode, false), elem.stationCode, aa]);
const aa = `${train.tripNumber}`;
opt.data.push([elem.secondTime, this.getCoordYByElem(stations, kmRangeMap, elem, pointdata.directionCode, false), elem.stationCode, aa]);
// }
});
/** 计算折返点车次坐标点集合*/
if (!train.backup && train.reentry && service.tripNumberDataList[j + 1] && service.tripNumberDataList[j + 1].stationTimeList) {
lastPoint = train.stationTimeList[train.stationTimeList.length - 1];
nextPoint = service.tripNumberDataList[j + 1].stationTimeList[0];
num = this.computedReentryNumber(train.tripNumber);
const aa = `${train.tripNumber}`;
opt.data.push([lastPoint.secondTime, this.getCoordYByElem(stations, kmRangeMap, lastPoint, pointdata.directionCode, true, num), lastPoint.stationCode, aa]);
opt.data.push([nextPoint.secondTime, this.getCoordYByElem(stations, kmRangeMap, nextPoint, pointdata.directionCode, true, num), nextPoint.stationCode, aa]);
const currentTimeList = service.tripNumberDataList[j].stationTimeList;
const nextTimeList = service.tripNumberDataList[j + 1].stationTimeList;
if (currentTimeList[currentTimeList.length - 1].secondTime != nextTimeList[0].secondTime) {
lastPoint = train.stationTimeList[train.stationTimeList.length - 1];
nextPoint = service.tripNumberDataList[j + 1].stationTimeList[0];
num = this.computedReentryNumber(train.tripNumber);
const aa = `${train.tripNumber}`;
opt.data.push([lastPoint.secondTime, this.getCoordYByElem(stations, kmRangeMap, lastPoint, pointdata.directionCode, true, num), lastPoint.stationCode, aa]);
opt.data.push([nextPoint.secondTime, this.getCoordYByElem(stations, kmRangeMap, nextPoint, pointdata.directionCode, true, num), nextPoint.stationCode, aa]);
}
}
/** 如果是备用车,按车次添加线*/
@ -246,7 +250,7 @@ class EqualRatioParser {
/** 根据方向计算y折返偏移量*/
getValueYByDirectionCode(defaultValue, directionCode, num) {
const sign = this.getReverse() ? -1 : 1;
const sign = this.getReverse() ? -1 : 1;
if (directionCode === '1') {
defaultValue -= sign * this.getEdge() / 2 * num;
} else if (directionCode === '2') {
@ -270,33 +274,33 @@ class EqualRatioParser {
return defaultValue;
}
getMultiple() {
return this.config.multiple;
}
getMultiple() {
return this.config.multiple;
}
getTranslation() {
return this.config.translation
}
getTranslation() {
return this.config.translation;
}
getEdge(){
return this.config.edge;
}
getEdge() {
return this.config.edge;
}
getReverse() {
return this.config.reverse;
}
getReverse() {
return this.config.reverse;
}
__createMartPoint(...args) {
return this.config.reverse ? createMartPointReverse(...args): createMartPoint(...args);
}
__createMartPoint(...args) {
return this.config.reverse ? createMartPointReverse(...args) : createMartPoint(...args);
}
__createSeriesModel(...args) {
return createSeriesModel(...args);
}
__createSeriesModel(...args) {
return createSeriesModel(...args);
}
__createMarkLineModels(...args) {
return createMarkLineModels(...args);
}
__createMarkLineModels(...args) {
return createMarkLineModels(...args);
}
}
export default EqualRatioParser;

View File

@ -6,7 +6,12 @@
</div>
</el-card>
<el-card v-loading="loading">
<el-table :data="tableData" border style="width: 100%" height="calc(100vh - 150px)">
<el-row style="padding: 10px;display: flex;align-items: center;justify-content: flex-end;">
<div style="font-size: 14px;color: #000;">试卷名称</div>
<el-input v-model="inputName" size="small" style="width: 200px;margin-right: 50px;margin-left: 10px;" placeholder="请输入筛选的名称" @change="changeInput" />
<el-button size="small" type="primary" @click="goToFilter">查找</el-button>
</el-row>
<el-table ref="filterTable" :data="filterTableData" border style="width: 100%" height="calc(100vh - 150px)">
<el-table-column prop="name" label="试卷名称" />
<el-table-column v-if="isGzbShow" prop="classNames" label="所属班级">
<template slot-scope="scope">
@ -35,7 +40,6 @@
<script>
import { getSubSystemDetail } from '@/api/trainingPlatform';
import { UrlConfig } from '@/scripts/ConstDic';
import { forceDeleteLesson } from '@/api/jmap/lesson';
import { getSessionStorage } from '@/utils/auth';
import { lessonCreater } from '@/router/index';
import localStore from 'storejs';
@ -45,10 +49,12 @@ export default {
data() {
return {
tableData: [],
filterTableData: [],
loading: false,
project: '',
isTeacher: false,
userId: ''
userId: '',
inputName: ''
};
},
computed: {
@ -76,6 +82,8 @@ export default {
} else {
this.tableData = [];
}
this.inputName = localStore.get(this.$route.path) || '';
this.goToFilter();
}).catch((error)=>{
if (error.code == 30001) {
const url = localStore.get('orignalTrainingPlatformRoute' + this.$store.state.user.id + this.project);
@ -95,6 +103,21 @@ export default {
} else {
this.$router.push({ path: `${path}/${row.id}`, query: { subSystem: this.$route.params.subSystem, mapId: row.mapId, noPreLogout: this.$route.query.noPreLogout }});
}
},
changeInput(val) {
localStore.set(this.$route.path, val);
},
goToFilter() {
if (!this.inputName) {
this.filterTableData = [...this.tableData];
} else {
this.filterTableData = [];
this.tableData.forEach(item => {
if (item.name.includes(this.inputName)) {
this.filterTableData.push(item);
}
});
}
}
}
};

View File

@ -91,7 +91,7 @@ export default {
function: '',
textColor: '',
textColorActive: '#000',
fillColor: 'rgba(0,0,0,0)',
fillColor: 'rgba(0,0,0,0)',
fillColorActive: 'rgba(0,0,0,0)'
},
rules: {
@ -127,8 +127,8 @@ export default {
this.form.fontSize = model.fontSize;
this.form.textColor = model.textColor || '#fff';
this.form.textColorActive = model.textColorActive || '#000';
this.form.fillColor = model.fillColor;
this.form.fillColorActive = model.fillColorActive;
this.form.fillColor = model.fillColor;
this.form.fillColorActive = model.fillColorActive;
}
}
},
@ -136,6 +136,8 @@ export default {
if (this.$route.query.lineCode == '02') {
this.functionList = [
{label: '操作按钮', value: 'OperatingButton'},
{label: '门禁站台层', value: 'goToStand'},
{label: '门禁站厅层', value: 'goToStation'},
{label: '元素显隐', value: 'ElementShow'},
{label: '返回', value: 'GoBack'}
];
@ -172,8 +174,8 @@ export default {
fontSize: this.form.fontSize,
textColor: this.form.textColor,
textColorActive: this.form.textColorActive,
fillColor: this.form.fillColor,
fillColorActive: this.form.fillColorActive
fillColor: this.form.fillColor,
fillColorActive: this.form.fillColorActive
};
this.$emit('createDataModel', rectModel);
this.initPage();
@ -195,8 +197,8 @@ export default {
context: this.form.context,
function: this.form.function,
fontSize: this.form.fontSize,
fillColor: this.form.fillColor,
fillColorActive: this.form.fillColorActive
fillColor: this.form.fillColor,
fillColorActive: this.form.fillColorActive
};
this.$emit('deleteDataModel', rectModel);
},
@ -216,8 +218,8 @@ export default {
function: '',
textColor: '',
textColorActive: '#000',
fillColor: '',
fillColorActive: ''
fillColor: '',
fillColorActive: ''
};
}
}

View File

@ -90,6 +90,7 @@ export default {
this.$store.dispatch('iscs/setIscsData', iscsData);
if (this.$route.query.group) {
this.$iscs.on('dblclick', this.onDblclick, this);
this.$iscs.on('click', this.onlclick, this);
}
},
onDblclick(em) {
@ -97,10 +98,30 @@ export default {
if (em.deviceType == 'IscsGroup') {
this.$iscs.iscsDevice[em.deviceModel.code].instance.hide();
this.$refs.valve.doShow(em.deviceModel);
} else if (em.deviceType == 'IscsButton') {
} else if (em.deviceType == 'IscsButton' && em.deviceModel.function != 'goToStand' && em.deviceModel.function != 'goToStation') {
this.$refs.protectReset.doShow(em.deviceModel);
}
},
onlclick(em) {
//
const query = {
stationName: this.$route.query.stationName,
stationId: this.$route.query.stationId,
group: this.$route.query.group,
mapId: this.$route.query.mapId,
lineCode:'02',
noPreLogout:this.$route.query.noPreLogout
};
let type = '';
if (em.deviceType == 'IscsButton' && em.deviceModel.function == 'goToStand') {
type = 'afcTwo02';
} else if (em.deviceType == 'IscsButton' && em.deviceModel.function == 'goToStation') {
type = 'afcOne02';
}
this.$router.replace({ path: `/displayIscs/system/stationConfig/${type}`, query: query });
},
//
handleViewLoaded() {
this.loading = false;
@ -126,7 +147,7 @@ export default {
}
},
setIscs(data, oldData) {
this.$iscs.setIscs(oldData, data, this.$route.query.mapId);
this.$iscs.setIscs(oldData, data, this.$route.query.lineCode);
},
//
handleModel(model) {

View File

@ -19,7 +19,7 @@
<normal v-else-if="mode=='environmentTwelve'" /> -->
<!-- <big-screen v-else-if="mode === 'signal'" /> -->
<!-- <big-screen v-else-if="mode === 'signal'" /> -->
<ticket-or-entrance v-else-if="mode === 'autoTicket'||mode === 'entranceGuard'" />
<ticket-or-entrance v-else-if="mode === 'autoTicket'||mode === 'afcTwo02'||mode === 'afcOne02'" />
<!-- -->
</div>
</template>

View File

@ -62,12 +62,18 @@ export default {
this.title = this.stationName + ' 自动售检票系统';
this.scaleRate = window.innerWidth / 1920;
this.height = 800;
} else if (this.mode == 'entranceGuard') {
} else if (this.mode == 'afcTwo02') {
params.userInterface = 'afcTwo02';
params.system = 'entranceGuard';
this.title = this.stationName + ' 门禁系统 站台层';
this.scaleRate = window.innerWidth / 1920;
this.height = 800;
} else if (this.mode == 'afcOne02') {
params.userInterface = 'afcOne02';
params.system = 'entranceGuard';
this.title = this.stationName + ' 门禁系统 站厅层';
this.scaleRate = window.innerWidth / 1920;
this.height = 800;
}
this.loading = true;

View File

@ -249,8 +249,8 @@ export default {
},
{
name: '门禁系统',
mode: 'entranceGuard',
id: 'entranceGuard',
mode: 'afcOne02',
id: 'afcOne02',
type: 'interface'
}
]},
@ -443,6 +443,7 @@ export default {
stationId: this.selectStation,
group: this.group,
mapId: this.$route.query.mapId,
lineCode:'02',
noPreLogout:this.$route.query.noPreLogout
};
if (isReplace) {

View File

@ -58,7 +58,7 @@ export default {
async doShow(row) {
try {
this.examList = [];
const resp = await getExamListProjectUnpage();
const resp = await getExamListProjectUnpage({ status: '1' });
this.examList = resp.data;
const rest = await getExamListInClass(row.id);
this.classModel.id = row.id;

View File

@ -58,7 +58,7 @@ export default {
async doShow(row) {
try {
this.lessonList = [];
const resp = await getLessonProjectListNoPage();
const resp = await getLessonProjectListNoPage({ status: '1' });
this.lessonList = resp.data;
const rest = await getClassAssociatedLessons(row.id);
this.classModel.id = row.id;
@ -80,9 +80,10 @@ export default {
setClassAssociatedLessons( this.classModel.id, this.classModel.lessonIds).then(response => {
this.doClose();
this.$message.success('班级排课成功!');
}).catch(() => {
this.$message.error('班级排课失败');
}).catch((error) => {
this.$message.error('班级排课失败' + error.message);
});
// setClassAssociatedLessons( this.classModel.id, this.classModel.lessonIds)
}
});
},

View File

@ -5,7 +5,7 @@
:query-form="classQueryForm"
:pager-config="pagerConfig"
:query-list="classQueryList"
style="width:90%;margin: 0 auto;"
style="width:96%;margin: 0 auto;"
/>
<create-class ref="createClass" @refresh="classRefresh" />
<bind-lessons ref="bindLessons" />
@ -73,7 +73,7 @@ export default {
{
type: 'button',
title: this.$t('global.operate'),
width: '510',
width: '350',
buttons: [
{
name: '编辑班级',
@ -93,16 +93,16 @@ export default {
handleClick: this.handleGradeCheck,
type: 'primary'
},
{
name: '排课',
handleClick: this.handleBindLesson,
type: 'primary'
},
{
name: '安排考试',
handleClick: this.handleBindExam,
type: 'primary'
},
// {
// name: '',
// handleClick: this.handleBindLesson,
// type: 'primary'
// },
// {
// name: '',
// handleClick: this.handleBindExam,
// type: 'primary'
// },
{
name: '删除',
handleClick: this.handleDeleteClass,

View File

@ -189,7 +189,7 @@ export default {
return '创建章节';
} else if ( this.editType === 'updateChapter' ) {
return '编辑章节';
}
} else { return ''; }
},
lineCode() {
return this.$route.query.lineCode;
@ -314,6 +314,9 @@ export default {
});
}).catch(() => {});
},
deleteRow(index, data) {
data.splice(index, 1);
},
changeRouter(params) {
switch (params.event) {
case '01':

View File

@ -5,7 +5,7 @@
:query-form="draftLessonQueryForm"
:pager-config="pagerConfig"
:query-list="draftLessonQueryList"
style="width:90%;margin: 0 auto;"
style="width:96%;margin: 0 auto;"
/>
<create-by-published ref="createByPublished" @refresh="draftLessonRefresh" />
<publish-lesson ref="publishLesson" @refresh="draftLessonRefresh" />

View File

@ -16,6 +16,7 @@
import { getClassGradeList } from '@/api/management/userexam';
import { getClassListUnPage } from '@/api/company';
import XLSX from 'xlsx';
import localStore from 'storejs';
export default {
name: 'GradeList',
data() {
@ -84,17 +85,14 @@ export default {
}
};
},
created() {
const list = this.$route.query.clsIds.split('-');
getClassListUnPage().then(response => {
const classList = [];
response.data && response.data.forEach(item => {
if (list.includes(item.id + '')) {
classList.push({ value: item.id, label: item.name });
}
});
this.queryForm.queryObject.orgId.config.data = classList;
async created() {
const resp = await getClassListUnPage();
const classList = [];
resp.data && resp.data.forEach(item => {
classList.push({ value: item.id, label: item.name });
localStore.set(this.$route.path, { orgId: classList[0].value + '' });
});
this.queryForm.queryObject.orgId.config.data = classList;
},
methods: {
exportGrade() {

View File

@ -5,14 +5,14 @@
:query-form="examQueryForm"
:pager-config="pagerConfig"
:query-list="examQueryList"
style="width:90%;margin: 0 auto;"
style="width:96%;margin: 0 auto;"
/>
</div>
</template>
<script>
import { getClassListUnPage } from '@/api/company';
import { getExamListProject, deleteExam } from '@/api/management/exam';
import { getExamListProject, setExamEffectivey, setExamEfficacy } from '@/api/management/exam';
import localStore from 'storejs';
import { getPublishMapListOnline } from '@/api/jmap/map';
@ -39,6 +39,16 @@ export default {
creatorName: {
type: 'text',
label: '创建人:'
},
status: {
type: 'select',
label: '启用/禁用:',
config: {
data: [
{ label: '启用', value: '1' },
{ label: '禁用', value: '0' }
]
}
}
}
},
@ -65,6 +75,15 @@ export default {
columnValue: (row) => { if (row.prdType === '01') { return '现地工作站'; } else if (row.prdType === '02') { return '行调工作站'; } },
tagType: (row) => { return ''; }
},
{
title: '启用/禁用',
prop: 'status',
type: 'tag',
columnValue: (row) => {
return row.status == '1' ? '启用' : '禁用';
},
tagType: (row) => { return ''; }
},
{
title: '班级',
prop: 'clsIds',
@ -72,6 +91,14 @@ export default {
columnValue: (row) => { return this.$convertField(row.clsIds || [], this.classList || [], ['id', 'name'], true); },
tagType: (row) => { return 'success'; }
},
{
title: '开始时间',
prop: 'startTime'
},
{
title: '截止时间',
prop: 'endTime'
},
{
title: '满分',
prop: 'fullPoint',
@ -105,17 +132,22 @@ export default {
{
name: '成绩查询',
handleClick: this.handleQueryGrade,
type: 'primary',
type: 'primary'
},
{
name: '启用',
handleClick: this.handleEnableExam,
type: 'warning',
showControl: (row) => {
return row.clsIds && row.clsIds.length;
return row.creatorId == this.userId && row.status == '0';
}
},
{
name: '删除',
name: '禁用',
handleClick: this.handleDeleteExam,
type: 'danger',
showControl: (row) => {
return row.creatorId == this.userId;
return row.creatorId == this.userId && row.status == '1';
}
}
]
@ -133,6 +165,9 @@ export default {
}
},
created() {
const params = localStore.get(this.$route.path) || {};
if (!params.status) { params.status = '1'; }
localStore.set(this.$route.path, params);
getClassListUnPage().then(response => {
this.classList = response.data;
});
@ -143,31 +178,38 @@ export default {
},
methods: {
handleQueryGrade(index, row) {
localStore.set('/info/gradeList', { orgId: row.clsIds[0] + '' });
this.$router.push({ path: '/info/gradeList', query: { examId: row.id, clsIds: row.clsIds.join('-'), name: row.name } });
this.$router.push({ path: '/info/gradeList', query: { examId: row.id, name: row.name } });
},
examCreate() {
this.$router.push({ path: `/info/examRule/draft/add/0/0`, query: { source: 'org' } });
},
handleEnableExam(index, data) {
setExamEffectivey(data).then(res => {
this.examRefresh();
this.$message.success('启用试卷成功!');
}).catch(error => {
this.$message.error('启用试卷失败:' + error.message);
});
},
handleDeleteExam(index, data) {
this.$confirm(this.$t('publish.wellDelPaper'), this.$t('global.tips'), {
this.$confirm('该操作将禁用试卷,是否继续?', this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
deleteExam(data).then(res => {
setExamEfficacy(data).then(res => {
this.examRefresh();
this.$message({
type: 'success',
message: '删除试卷成功!'
message: '禁用试卷成功!'
});
}).catch(res => {
if (res.code == '10004') {
this.$message({ type: 'error', message: '删除失败:试卷已被使用,无法删除!' });
this.$message({ type: 'error', message: '禁用失败:试卷已被使用,无法禁用!' });
} else if (res.code == '10003') {
this.$message({ type: 'warning', message: '删除失败:无权限删除!'});
this.$message({ type: 'warning', message: '禁用失败:无权限禁用!'});
} else {
this.$message({ type: 'error', message: this.$t('error.deleteException') });
this.$message({ type: 'error', message: '禁用试卷失败!' });
}
});
}).catch(() => { });

View File

@ -2,7 +2,7 @@
<div>
<div class="title_content">{{ $store.state.user.companyName + '教学管理' }}</div>
<el-button type="text" style="position: fixed;right: 20px;top: 70px;" @click="back">返回</el-button>
<div style="width: 90%;margin: 0 auto;overflow: hidden;">
<div style="width: 96%;margin: 0 auto;overflow: hidden;">
<el-menu
style="width: 200px;float: left;"
default-active="2-1"

View File

@ -65,8 +65,8 @@ export default {
this.$emit('refresh');
this.$message.success(this.$t('publish.updateSuccess'));
self.doClose();
}).catch(() => {
this.$message.error(this.$t('error.updateFailed'));
}).catch((e) => {
this.$message.error('编辑课程失败:' + e.message);
self.doClose();
});
});

View File

@ -5,7 +5,7 @@
:query-form="lessonQueryForm"
:pager-config="pagerConfig"
:query-list="lessonQueryList"
style="width:90%;margin: 0 auto;"
style="width:96%;margin: 0 auto;"
/>
<edit-lesson-info ref="editLessonInfo" @refresh="lessonRefresh" />
</div>
@ -13,8 +13,9 @@
<script>
import { getPublishMapListOnline } from '@/api/jmap/map';
import { getLessonProjectList, forceDeleteLesson } from '@/api/jmap/lesson';
import { getLessonProjectList, putLessonOnLine, putLessonOffLine } from '@/api/jmap/lesson';
import EditLessonInfo from './editLessonInfo';
import localStore from 'storejs';
export default {
name: 'LessonManage',
components: {
@ -41,17 +42,17 @@ export default {
creatorName: {
type: 'text',
label: '创建人:'
},
status: {
type: 'select',
label: '启用/禁用:',
config: {
data: [
{ label: '启用', value: '1' },
{ label: '禁用', value: '0' }
]
}
}
// self: {
// type: 'select',
// label: ':',
// config: {
// data: [
// { label: '', value: true },
// { label: '', value: false }
// ]
// }
// }
}
},
lessonQueryList: {
@ -74,6 +75,30 @@ export default {
},
tagType: (row) => { return 'success'; }
},
{
title: '产品类型',
prop: 'prdType',
type: 'tag',
columnValue: (row) => {
if (row.prdType === '01') {
return '现地工作站';
} else if (row.prdType === '02') {
return '行调工作站';
} else {
return '';
}
},
tagType: (row) => { return ''; }
},
{
title: '启用/禁用',
prop: 'status',
type: 'tag',
columnValue: (row) => {
return row.status == '1' ? '启用' : '禁用';
},
tagType: (row) => { return ''; }
},
{
title: this.$t('lesson.courseDescription'),
prop: 'remarks'
@ -101,11 +126,19 @@ export default {
type: 'primary'
},
{
name: '删除',
name: '启用',
handleClick: this.handleEnableLesson,
type: 'warning',
showControl: (row) => {
return row.creatorId == this.userId && row.status == '0';
}
},
{
name: '禁用',
handleClick: this.handleDeleteLesson,
type: 'danger',
showControl: (row) => {
return row.creatorId == this.userId;
return row.creatorId == this.userId && row.status == '1';
}
}
]
@ -119,6 +152,11 @@ export default {
return this.$store.state.user.id;
}
},
created() {
const params = localStore.get(this.$route.path) || {};
if (!params.status) { params.status = '1'; }
localStore.set(this.$route.path, params);
},
mounted() {
this.mapIdList = [];
getPublishMapListOnline().then(response => {
@ -129,17 +167,26 @@ export default {
handleEditLessonInfo(index, row) {
this.$refs.editLessonInfo.doShow(row);
},
handleEnableLesson(index, row) {
putLessonOnLine(row.id).then(res => {
this.$message.success('启用课程成功!');
this.lessonRefresh();
}).catch(error => {
this.$message.error('启用课程失败:' + error.message);
this.lessonRefresh();
});
},
handleDeleteLesson(index, row) {
this.$confirm('此操作将删除课程,且无法恢复,是否继续?', this.$t('global.tips'), {
this.$confirm('此操作将禁用课程,是否继续?', this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
forceDeleteLesson(row.id).then(response => {
this.$message.success(this.$t('publish.deleteSuccess'));
putLessonOffLine(row.id).then(response => {
this.$message.success('禁用课程成功!');
this.lessonRefresh();
}).catch((error) => {
this.$messageBox(this.$t('error.deleteFailed') + ':' + error.message);
this.$message.error( '禁用课程失败:' + error.message);
this.lessonRefresh();
});
}).catch(() => { });

View File

@ -10,9 +10,9 @@
@submit.native.prevent
>
<el-form-item label="班级:" prop="orgIds">
<el-tooltip class="item" effect="dark" content="此处班级经过规则中涉及到的课程和考试筛选处理" placement="top-start">
<i class="el-icon-info" />
</el-tooltip>
<!--<el-tooltip class="item" effect="dark" content="此处班级经过规则中涉及到的课程和考试筛选处理" placement="top-start">-->
<!--<i class="el-icon-info" />-->
<!--</el-tooltip>-->
<el-select v-model="editModel.orgIds" multiple placeholder="请选择">
<el-option
v-for="item in classList"
@ -32,7 +32,7 @@
</template>
<script>
import { applyRuleToClass, getCanApplyToList } from '@/api/company';
import { applyRuleToClass, getClassListUnPage } from '@/api/company';
export default {
name: 'PublishLesson',
data() {
@ -58,7 +58,7 @@ export default {
},
methods: {
doShow(model) {
getCanApplyToList(model.id).then(resp => {
getClassListUnPage().then(resp => {
this.classList = resp.data;
if (!this.classList.length) {
this.$messageBox('暂无可应用的班级,请未班级排课或者修改规则后操作!');

View File

@ -45,38 +45,6 @@
<el-card class="box-card">
<div style="width: 100%;">
<div style="display: flex;flex-wrap:wrap;width: 100%;">
<!--<div style="width: 50%;padding: 20px;">-->
<!--<el-tag>考勤</el-tag>-->
<!--<el-table :data="attendanceData" style="margin-top: 10px;" border>-->
<!--<el-table-column prop="startDate" label="开始日期" />-->
<!--<el-table-column prop="endDate" label="截止日期" />-->
<!--<el-table-column prop="days4FullMarks" label="考勤天数" />-->
<!--<el-table-column prop="fullMarks" label="满分" />-->
<!--<el-table-column label="操作" width="100">-->
<!--<template slot-scope="scope">-->
<!--<el-button :disabled="isDetail" type="text" size="small" @click="editUsual(scope.row,scope.$index, 'attendance')">编辑</el-button>-->
<!--<el-button :disabled="isDetail" type="text" size="small" @click="deleteUsual(scope.row, scope.$index, 'attendance')">删除</el-button>-->
<!--</template>-->
<!--</el-table-column>-->
<!--</el-table>-->
<!--</div>-->
<!--<div style="width: 50%;padding: 20px;">-->
<!--<el-tag>日常测验</el-tag>-->
<!--<el-table :data="examsData" style="margin-top: 10px;" border>-->
<!--<el-table-column prop="examId" label="试卷">-->
<!--<template slot-scope="scope">-->
<!--<el-tag>{{ getExamName(scope.row.examId) }}</el-tag>-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column prop="fullMarks" label="满分" />-->
<!--<el-table-column label="操作" width="100">-->
<!--<template slot-scope="scope">-->
<!--<el-button :disabled="isDetail" type="text" size="small" @click="editUsual(scope.row,scope.$index, 'exam')">编辑</el-button>-->
<!--<el-button :disabled="isDetail" type="text" size="small" @click="deleteUsual(scope.row, scope.$index, 'exam')">删除</el-button>-->
<!--</template>-->
<!--</el-table-column>-->
<!--</el-table>-->
<!--</div>-->
<div style="width: 100%;padding: 20px;">
<el-tag>规则</el-tag>
<el-table :data="scoringDate" style="margin-top: 10px;" border>
@ -184,6 +152,7 @@
<el-option
v-for="item in examList"
:key="item.id"
:disabled="item.status == '0'"
:label="item.name"
:value="item.id"
/>
@ -203,6 +172,7 @@
<el-option
v-for="item in lessonList"
:key="item.id"
:disabled="item.status == '0'"
:label="item.name"
:value="item.id"
/>
@ -525,6 +495,7 @@ export default {
}).then(() => {
createRule(model).then(resp => {
this.$message.success( '创建规则成功!');
that.back();
that.$refs.form.resetFields();
that.scoringDate = [];
}).catch((e) => {

View File

@ -5,7 +5,7 @@
:query-form="ruleQueryForm"
:pager-config="pagerConfig"
:query-list="ruleQueryList"
style="width:90%;margin: 0 auto;"
style="width:96%;margin: 0 auto;"
/>
<apply-class ref="applyClass" @refresh="refresh" />
</div>

View File

@ -133,10 +133,10 @@ export default {
methods: {
exportGrade() {
const wb = XLSX.utils.book_new();
const data = [{A: '学号', B:'姓名', C: '平时成绩', D: '期末成绩', E: '评价结果'}];
const data = [{A: '学号', B:'姓名', C: '考勤得分', D: '学习时长得分', E: '测验得分', F: '评价结果'}];
if (this.tableData && this.tableData.length) {
this.tableData.forEach(item => {
data.push({ A: item.account, B: item.username, C:item.usualScore, D: item.finalScore, E: (item.usualScore || 0) + (item.finalScore || 0) });
data.push({ A: item.account, B: item.username, C:item.attendanceScore, D: item.learningTimeScore, E:item.examScore, F: (item.attendanceScore || 0) + ( item.examScore || 0 ) + ( item.learningTimeScore || 0 ) });
});
const ws = XLSX.utils.json_to_sheet(data, {skipHeader:true});
// ws['!cols'] = [

View File

@ -337,8 +337,8 @@ export default {
compuntedRunTime(list, index, runLevel) {
let runTime = 0;
if ((index == 0 && String(this.addModel.startTbFront) != 'undefined') ||
(index == list.length - 1 && String(this.addModel.endTbFront) != 'undefined')) {
if ((index == 0 && String(this.addModel.startTbFront) == false) ||
(index == list.length - 1 && String(this.addModel.endTbFront) == false)) {
return 0;
}
@ -376,7 +376,12 @@ export default {
tempTime = tempTime || this.computedTimeByString('23:59:59') / 1000 + 1;
elem.arriveTime = formatTime(tempTime);
elem.departureTime = formatTime(tempTime + elem.stopTime);
if (index == list.length - 1 && String(this.addModel.endTbFront) == 'true') {
const data = this.reentryData[list[index].stationCode] || {};
elem.departureTime = formatTime(tempTime + elem.stopTime + data.tbFront || 0);
} else {
elem.departureTime = formatTime(tempTime + elem.stopTime);
}
const runLevelObj = this.defaultSpeedLevelList.find(speedLevel=>{ return speedLevel.value == runLevel; });
const realRunlevel = this.compuntedRunTime(list, index, runLevel);
@ -391,6 +396,9 @@ export default {
} else if (index == list.length - 2 && String(this.addModel.endTbFront) == 'false') {
const data = this.reentryData[list[index + 1].stationCode] || {};
fronTime = data.tbTo || 0;
} else if (index == list.length - 1 && String(this.addModel.endTbFront) == 'true') {
const data = this.reentryData[list[index].stationCode] || {};
fronTime = data.tbFront || 0;
}
tempTime = tempTime + fronTime + elem.stopTime + elem.speedLevelTime;

View File

@ -257,8 +257,8 @@ export default {
compuntedRunTime(list, index, runLevel) {
let runTime = 0;
if ((index == 0 && String(this.editModel.startTbFront) != 'undefined') ||
(index == list.length - 1 && String(this.editModel.endTbFront) != 'undefined')) {
if ((index == 0 && String(this.editModel.startTbFront) == false) ||
(index == list.length - 1 && String(this.editModel.endTbFront) == false)) {
return 0;
}
@ -296,7 +296,13 @@ export default {
tempTime = tempTime || this.computedTimeByString('23:59:59') / 1000 + 1;
elem.arriveTime = formatTime(tempTime);
elem.departureTime = formatTime(tempTime + elem.stopTime);
if (index == list.length - 1 && String(this.editModel.endTbFront) == 'true') {
const data = this.reentryData[list[index].stationCode] || {};
elem.departureTime = formatTime(tempTime + elem.stopTime + data.tbFront || 0);
} else {
elem.departureTime = formatTime(tempTime + elem.stopTime);
}
const runLevelObj = this.defaultSpeedLevelList.find(speedLevel=>{ return speedLevel.value == runLevel; });
const realRunlevel = this.compuntedRunTime(list, index, runLevel);
@ -311,6 +317,9 @@ export default {
} else if (index == list.length - 2 && String(this.editModel.endTbFront) == 'false') {
const data = this.reentryData[list[index + 1].stationCode] || {};
fronTime = data.tbTo || 0;
} else if (index == list.length - 1 && String(this.editModel.endTbFront) == 'true') {
const data = this.reentryData[list[index].stationCode] || {};
fronTime = data.tbFront || 0;
}
tempTime = tempTime + fronTime + elem.stopTime + elem.speedLevelTime;

View File

@ -4,13 +4,13 @@
<el-form-item :label="$t('publish.testName')" prop="name">
<el-input v-model="examData.name" :placeholder="$t('publish.inputTestName')" />
</el-form-item>
<el-form-item label="归属地图" prop="mapId">
<el-form-item label="归属地图" prop="mapId">
<el-select v-model="examData.mapId" placeholder="请选择归属地图" :disabled="isEdit">
<el-option v-for="map in mapList" :key="map.id" :label="map.name" :value="map.id" />
</el-select>
</el-form-item>
<el-form-item label="产品类型:" prop="prdType">
<el-select v-model="examData.prdType" placeholder="请选择产品类型" :disabled="isEdit">
<el-form-item label="工作站类型" prop="prdType">
<el-select v-model="examData.prdType" placeholder="请选择工作站类型" :disabled="isEdit">
<el-option v-for="prd in prdList" :key="prd.value" :label="prd.label" :value="prd.value" />
</el-select>
</el-form-item>
@ -18,7 +18,10 @@
<el-input-number v-model="examData.duration" placeholder="请输入" style="float: left; width: calc(100% - 80px);" :disabled="isEdit" :min="1" />
<span style="width:80px; display: block;float: left; text-align: center;">&nbsp;{{ $t('publish.durationMinutes') }}</span>
</el-form-item>
<el-form-item :label="$t('publish.testDate')">
<el-form-item label="开放时间要求" prop="havaDate">
<el-switch v-model="havaDate" />
</el-form-item>
<el-form-item v-if="havaDate" :label="$t('publish.testDate')">
<el-col :span="11">
<el-form-item prop="startDate">
<el-date-picker
@ -46,7 +49,7 @@
</el-col>
</el-form-item>
<el-form-item :label="$t('publish.fullScore')" prop="fullMark">
<el-input-number v-model="examData.fullMark" placeholder="" :disabled="isEdit" :min="1" />
<el-input-number v-model="examData.fullMark" placeholder="" :disabled="isEdit" :min="1" @change="fullMarkChange" />
</el-form-item>
<el-form-item :label="$t('publish.passingScore')" prop="passMark">
<el-input-number v-model="examData.passMark" placeholder="" :disabled="isEdit" :min="1" />
@ -80,12 +83,33 @@ export default {
}
},
data() {
var checkEndDate = (rule, value, callback) => {
if (this.examData.startDate && value) {
const startTime = new Date(this.examData.startDate).getTime();
const endTime = new Date(value).getTime();
if (startTime > endTime) {
callback(new Error('开始时间必须小于截止时间'));
} else {
callback();
}
} else {
callback();
}
};
var checkPassMark = (rule, value, callback) => {
if (value > this.examData.fullMark) {
callback(new Error('及格分必须小于等于满分'));
} else {
callback();
}
};
return {
pickerOptions: {
disabledDate(time) {
return time.getTime() < new Date(new Date().toLocaleDateString()).getTime();
}
},
havaDate: false,
mapList: [],
prdList: [{ label: 'ATS现地工作站', value: '01' }, { label: 'ATS行调工作站', value: '02' }],
trial: '1',
@ -111,7 +135,11 @@ export default {
{ required: true, message: this.$t('publish.selectWetherTrial'), trigger: 'blur' }
],
passMark: [
{ required: true, message: this.$t('publish.inputPassingScore'), trigger: 'blur' }
{ required: true, message: this.$t('publish.inputPassingScore'), trigger: 'blur' },
{ validator: checkPassMark, trigger: 'blur' }
],
endDate: [
{ validator: checkEndDate, trigger: 'change' }
]
}
};
@ -127,21 +155,16 @@ export default {
mounted() {
},
methods: {
submit(type) {
checkedForm(type) {
this.$refs['form'].validate((valid) => {
if (valid) {
// const form = Object.assign({}, this.form);
// if (form.startDate) {
// form.startDate = this.getDate(form.startDate);
// }
// if (form.endDate) {
// form.endDate = this.getDate(form.endDate);
// }
// form['trial'] = this.trial;
// this.$emit(type, form);
this.$emit(type);
}
});
},
fullMarkChange() {
this.$refs.form.validateField('passMark');
},
getDate(date) {
const now = new Date(date);
const y = now.getFullYear();

View File

@ -7,7 +7,7 @@
</el-steps>
<div class="joylink-card forms">
<template v-if="display == 1" class="definition">
<exam-from ref="exam" :exam-data="examData" />
<exam-from ref="exam" :exam-data="examData" @goNextStep="goNextStep" @createQuickly="createQuickly" />
</template>
<template v-else class="rule">
<rule-from ref="rule" :rule-list="ruleList" :exam-data="examData" @regulation="regulation" />
@ -20,7 +20,7 @@
<el-button v-if="isUpdate" type="warning" @click="update">{{ $t('global.update') }}</el-button>
<el-button v-if="isCreate" type="primary" @click="create">{{ $t('global.create') }}</el-button>
<el-button type="primary" @click="turnback">{{ $t('global.back') }}</el-button>
<el-button v-if="isFastCreate" type="primary" @click="createQuickly">快速创建</el-button>
<el-button v-if="isFastCreate" type="primary" @click="goToCheckForm">快速创建</el-button>
</el-button-group>
</div>
</div>
@ -130,12 +130,18 @@ export default {
}
}
},
goToCheckForm() {
this.$refs.exam.checkedForm('createQuickly');
},
prevStep() {
this.$refs.rule.regulation();
},
nextStep() {
goNextStep() {
this.display = 2;
},
nextStep() {
this.$refs.exam.checkedForm('goNextStep');
},
update() {
this.$refs.exam.updateForm();
},

View File

@ -84,14 +84,14 @@ export default {
let val;
for (val in ConstConfig.ConstSelect.trainingDeviceType) {
if (res.data[val]) {
list.push({ value: val, label: ConstConfig.ConstSelect.trainingDeviceType[val].label});
list.push({ value: val, label: ConstConfig.ConstSelect.trainingDeviceType[val].label, disabled: false});
this.trainingTypeNums[val] = 0;
const operateLabelMap = getOperateTypeMap(val);
operateTypeMap[val] = [];
let item;
for (item in res.data[val]) {
this.trainingTypeNums[val] += res.data[val][item];
operateTypeMap[val].push({ value: item, label:operateLabelMap[item] });
operateTypeMap[val].push({ value: item, label:operateLabelMap[item], disabled: false });
}
}
}
@ -103,6 +103,7 @@ export default {
},
methods: {
handleAdd() {
this.changeCourseDisable();
this.$refs.addRule.show();
},
async creatOk() {
@ -157,23 +158,10 @@ export default {
point: Number(data.mark)
};
this.ruleList.push(element);
this.changeCourseDisable();
},
//
changeCourseDisable() {
// const arr = this.$store.state.exam.courseList;
// this.ruleList.forEach(ele => {
// arr.forEach(res => {
// if (ele.trainingType == res.code && !ele.operateType) {
// res.disabled = true;
// }
// });
// });
},
getOperateName(row) {
const trainingName = ConstConfig.ConstSelect.trainingDeviceType[row.trainingType].label;
const operateName = getOperateTypeMap(row.trainingType)[row.operateType];
return `${trainingName}-${operateName}`;
deleteForm(data) {
const index = data.$index;
this.ruleList.splice(index, 1);
},
editRuleList(data) {
const element = {
@ -184,23 +172,40 @@ export default {
};
this.$set(this.ruleList, this.indexCourse, element);
},
//
changeCourseDisable() {
this.trainingTypeList.forEach(item => { item.disabled = false; });
for (const val in this.operationTypeMap) {
this.operationTypeMap[val].forEach( item => { item.disabled = false; });
}
this.ruleList.forEach(ele => {
this.trainingTypeList.forEach(item => {
if (ele.trainingType == item.value && !ele.operateType) {
item.disabled = true;
}
});
(this.operationTypeMap[ele.trainingType] || []).forEach(item => {
if (ele.operateType && ele.operateType == item.value) {
item.disabled = true;
}
});
});
},
getOperateName(row) {
const trainingName = ConstConfig.ConstSelect.trainingDeviceType[row.trainingType].label;
if (row.operateType) {
const operateName = getOperateTypeMap(row.trainingType)[row.operateType];
return `${trainingName}-${operateName}`;
} else {
return trainingName;
}
},
handleForm(data) {
this.indexCourse = data.$index;
const list = JSON.stringify(data.row);
const detail = JSON.parse(list);
// var arr = this.$store.state.exam.courseList;
// arr.forEach(res => {
// if (res.name == detail.name) {
// detail.name = res.id;
// return detail.name;
// }
// });
this.$refs.addRule.show(detail);
},
deleteForm(data) {
const index = data.$index;
this.ruleList.splice(index, 1);
},
regulation() {
this.$emit('regulation', this.course);
},

View File

@ -60,6 +60,22 @@ export default {
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['id', 'name']); },
tagType: (row) => { return 'success'; }
},
{
title: '产品类型',
prop: 'prdType',
type: 'tag',
width: '120',
columnValue: (row) => {
if (row.prdType === '01') {
return '现地工作站';
} else if (row.prdType === '02') {
return '行调工作站';
} else {
return '';
}
},
tagType: (row) => { return ''; }
},
{
title: this.$t('publish.lessonIntroduction'),
prop: 'remarks'

View File

@ -7,7 +7,12 @@
<el-button v-if="isAdmin && project !== 'cgy'" size="mini" type="primary" style="position: absolute;right: 10px;top: 10px;" @click="draftLessonManage">草稿课程管理</el-button>
</el-card>
<el-card v-loading="loading">
<el-table :data="tableData" border style="width: 100%">
<el-row style="padding: 10px;display: flex;align-items: center;justify-content: flex-end;">
<div style="font-size: 14px;color: #000;">课程名称</div>
<el-input v-model="inputName" size="small" style="width: 200px;margin-right: 50px;margin-left: 10px;" placeholder="请输入筛选的名称" @change="changeInput" />
<el-button size="small" type="primary" @click="goToFilter">查找</el-button>
</el-row>
<el-table :data="filterTableData" border style="width: 100%">
<el-table-column prop="name" :label="project === 'cgy'?'项目名称':this.$t('teach.courseName')" />
<el-table-column v-if="isGzbShow" prop="classNames" label="所属班级">
<template slot-scope="scope">
@ -50,7 +55,9 @@ export default {
loading: false,
mapId: '',
prdType: '',
cityCode: ''
cityCode: '',
filterTableData: [],
inputName: ''
};
},
computed: {
@ -87,6 +94,8 @@ export default {
} else {
this.tableData = [];
}
this.inputName = localStore.get(this.$route.path) || '';
this.goToFilter();
}).catch((error)=>{
if (error.code == 30001) {
const url = localStore.get('orignalTrainingPlatformRoute' + this.$store.state.user.id + this.project);
@ -132,6 +141,21 @@ export default {
const query = {mapId: this.mapId, prdType: this.prdType, cityCode: this.cityCode};
this.$router.push({ path: `/trainingPlatform/draftTeach/${this.$route.params.subSystem}`, query: query });
},
changeInput(val) {
localStore.set(this.$route.path, val);
},
goToFilter() {
if (!this.inputName) {
this.filterTableData = [...this.tableData];
} else {
this.filterTableData = [];
this.tableData.forEach(item => {
if (item.name.includes(this.inputName)) {
this.filterTableData.push(item);
}
});
}
},
handleDelete(row) {
this.$confirm('此操作将删除课程,且无法恢复,是否继续?', this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),

View File

@ -111,9 +111,11 @@ export default {
let router = '';
switch (resp.data.type) {
case 'Exam':
this.setLocalRoute(`${UrlConfig.trainingPlatform.examHome}/${obj.id}`);
router = localStore.get('examDetail' + obj.id);
if (!router) { router = { path: `${UrlConfig.trainingPlatform.examHome}/${obj.id}`}; }
// this.setLocalRoute(`${UrlConfig.trainingPlatform.examHome}/${obj.id}`);
// router = localStore.get('examDetail' + obj.id);
// if (!router) { router = { path: `${UrlConfig.trainingPlatform.examHome}/${obj.id}`}; }
// this.toNextPage(isReplace, router);
router = { path: `${UrlConfig.trainingPlatform.examHome}/${obj.id}`};
this.toNextPage(isReplace, router);
break;
case 'Lesson':