This commit is contained in:
joylink_cuiweidong 2019-10-30 18:07:45 +08:00
commit 2df4c5f8cb
59 changed files with 7762 additions and 8138 deletions

View File

@ -2,111 +2,103 @@ import request from '@/utils/request';
/** 获取课程树*/
export function getLessonTree(skinCode) {
return request({
url: `/api/lessonDraft/${skinCode}/tree`,
method: 'get'
});
return request({
url: `/api/lessonDraft/${skinCode}/tree`,
method: 'get'
});
}
/** 获取课程详细内容*/
export function getLessonDetail(data) {
return request({
url: `/api/lessonDraft/${data.id}`,
method: 'get'
});
return request({
url: `/api/lessonDraft/${data.id}`,
method: 'get'
});
}
/** 创建课程*/
export function createLesson(data) {
return request({
url: '/api/lessonDraft',
method: 'post',
data: data
});
return request({
url: '/api/lessonDraft',
method: 'post',
data: data
});
}
/** 从发布课程创建*/
export function createLessonFromPublish(data) {
return request({
url: '/api/lessonDraft/createForm',
method: 'post',
data: data
});
return request({
url: '/api/lessonDraft/createForm',
method: 'post',
data: data
});
}
/** 更新课程*/
export function updateLesson(data) {
return request({
url: `/api/lessonDraft/${data.id}`,
method: 'put',
data: data
});
return request({
url: `/api/lessonDraft/${data.id}`,
method: 'put',
data: data
});
}
/** 删除课程*/
export function delLesson(data) {
return request({
url: `/api/lessonDraft/${data.id}`,
method: 'delete',
data: data
});
return request({
url: `/api/lessonDraft/${data.id}`,
method: 'delete',
data: data
});
}
/** 创建课程章节*/
export function createLessonChapter(data) {
return request({
url: `/api/lessonDraft/${data.lessonId}/chapter`,
method: 'post',
data: data
});
return request({
url: `/api/lessonDraft/${data.lessonId}/chapter`,
method: 'post',
data: data
});
}
/** 更新课程章节*/
export function updateLessonChapter(data) {
return request({
url: `/api/lessonDraft/chapter/${data.id}`,
method: 'put',
data: data
});
return request({
url: `/api/lessonDraft/chapter/${data.id}`,
method: 'put',
data: data
});
}
/** 创建课程章节详细内容*/
export function getLessonChapterDetail(data) {
return request({
url: `/api/lessonDraft/chapter/${data.id}`,
method: 'get'
});
return request({
url: `/api/lessonDraft/chapter/${data.id}`,
method: 'get'
});
}
/** 发布课程*/
export function publishLesson(data) {
return request({
url: `/api/lessonDraft/${data.id}/publish`,
method: 'post',
data: data
});
return request({
url: `/api/lessonDraft/${data.id}/publish`,
method: 'post',
data: data
});
}
/** 课程章节拖拽排序*/
export function dragSortLessonChapter(data) {
return request({
url: '/api/lessonDraft/dragSort',
method: 'put',
data: data
});
}
/** 根据lessonId获取课程名称*/
export function getLessonNameByMapIdAndLessonId(model) {
return request({
url: `/api/lessonDraft/${model.mapId}/${model.lessonId}`,
method: 'get'
});
return request({
url: '/api/lessonDraft/dragSort',
method: 'put',
data: data
});
}
export function getLessonDrftList(params) {
return request({
url: `/api/lessonDraft`,
method: 'get',
params: params
});
return request({
url: `/api/lessonDraft`,
method: 'get',
params: params
});
}

View File

@ -17,22 +17,6 @@ export function getPublishMapListBySkinCode(skinCode) {
});
}
/** 根据皮肤获取地图版本信息*/
export function getPublishMapVersion(skinCode) {
return request({
url: `/api/map/skin/${skinCode}/version`,
method: 'get'
});
}
/** 根据皮肤获取发布地图详细内容*/
export function getPublishMapDetail(skinCode) {
return request({
url: `/api/map/skin/${skinCode}/details`,
method: 'get'
});
}
/** 根据地图id获取地图版本信息*/
export function getPublishMapVersionById(id) {
return request({
@ -49,14 +33,6 @@ export function getPublishMapDetailById(id) {
});
}
/** 获取发布地图列车列表*/
export function getPublishTrainList(skinCode) {
return request({
url: `/api/map/${skinCode}/train`,
method: 'get'
});
}
/** 获取发布地图列表*/
export function listPublishMap(params) {
return request({

View File

@ -62,9 +62,9 @@ export function deleteTrainingCategory(data) {
/**
* 获取地图下的产品列表
*/
export function getCommodityMapProduct(skinCode) {
export function getCommodityMapProduct(mapId) {
return request({
url: `/api/mapPrd/${skinCode}/list`,
url: `/api/mapPrd/${mapId}/list`,
method: 'get'
});
}

View File

@ -2,68 +2,68 @@ import request from '@/utils/request';
/** 分页查询皮肤*/
export function getSkinCodePageList(params) {
return request({
url: `/api/mapSkin`,
method: 'get',
params: params
});
return request({
url: `/api/realLine`,
method: 'get',
params: params
});
}
/** 添加皮肤*/
export function addSkinCode(data) {
return request({
url: `/api/mapSkin`,
method: 'post',
data: data
});
return request({
url: `/api/realLine`,
method: 'post',
data: data
});
}
/** 删除皮肤*/
export function delSkinCode(id) {
return request({
url: `/api/mapSkin/${id}`,
method: 'delete'
});
return request({
url: `/api/realLine/${id}`,
method: 'delete'
});
}
/** 查询地图皮肤 */
export function querySkinCode(id) {
return request({
url: `/api/mapSkin/${id}`,
method: 'get'
});
return request({
url: `/api/realLine/${id}`,
method: 'get'
});
}
/** 修改地图皮肤*/
export function updateSkinCode(data) {
return request({
url: `/api/mapSkin/${data.id}`,
method: 'put',
data: data
});
return request({
url: `/api/realLine/${data.id}`,
method: 'put',
data: data
});
}
/** 通过皮肤Code更新地图皮肤*/
export function updateSkinCodeByCode(data) {
return request({
url: `/api/mapSkin/${data.code}/update`,
method: 'put',
data: data
});
return request({
url: `/api/realLine/${data.code}/update`,
method: 'put',
data: data
});
}
/** 查询皮肤是否存在*/
export function querySkinCodeExistByCode(code) {
return request({
url: `/api/mapSkin/${code}/exist`,
method: 'get'
});
return request({
url: `/api/realLine/${code}/exist`,
method: 'get'
});
}
/** 获取皮肤列表*/
export function getSkinCodeList() {
return request({
url: `/api/mapSkin/list`,
method: 'get'
});
return request({
url: `/api/realLine/list`,
method: 'get'
});
}

View File

@ -1,15 +1,5 @@
import request from '@/utils/request';
/**
* 获取运行图列表
*/
export function getRunPlanList() {
return request({
url: '/api/runPlan/draft/tree',
method: 'get'
});
}
/**
* 获取地图速度等级列表
*/
@ -41,16 +31,6 @@ export function getStationList(mapId) {
});
}
/**
* 通过皮肤获取运行图车站列表
*/
export function getStationListBySkinCode(skinCode) {
return request({
url: `/api/runPlan/draft/station/${skinCode}/bySkin`,
method: 'get'
});
}
/**
* 创建运行图
*/
@ -73,9 +53,9 @@ export function queryRunPlan(planId) {
}
// 根据skinCode查询发布运行图列表
export function queryRunPlanList(skinCode) {
export function queryRunPlanList(mapId) {
return request({
url: `/api/runPlan/template/skin/${skinCode}`,
url: `/api/runPlan/template/${mapId}/list`,
method: 'get'
});
}

View File

@ -82,383 +82,375 @@
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { getPublishTrainList } from '@/api/jmap/map';
import ConfirmTrain from './childDialog/confirmTrain';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default {
name: 'TrainControl',
components: {
ConfirmTrain,
NoticeInfo
},
data() {
return {
trainList: [],
formModel: {
trainNo: '',
trainNumber: '',
trainType: '01',
serverNo: '',
targetCode: ''
},
name: 'TrainControl',
components: {
ConfirmTrain,
NoticeInfo
},
data() {
return {
trainList: [],
formModel: {
trainNo: '',
trainNumber: '',
trainType: '01',
serverNo: '',
targetCode: ''
},
rules: {
trainNumber: [
{ required: true, message: '请选择车组号', trigger: 'change' }
],
trainType: [
{ required: true, message: '请选择一个列车类型', trigger: 'change' }
],
serverNo: [
{ required: true, message: '请输入表号', trigger: 'blur' }
],
trainNo: [
{ required: true, message: '请输入车次号', trigger: 'blur' }
],
targetCode: [
{ required: true, message: '请输入目的地号', trigger: 'blur' }
]
},
operation: null,
dialogShow: false,
loading: false,
direction: 0
};
},
computed: {
...mapGetters('map', [
'map'
]),
trainNoIsDisabled() {
return false;
},
serverNoIsDisabled() {
return false;
},
targetCodeIsDisabled() {
return false;
},
trainNumberIsDisabled() {
if (this.operation != OperationEvent.Train.addTrainId.menu.operation) {
return true;
}
return false;
},
trainTypeIsDisabled() {
if (this.operation != OperationEvent.Train.addTrainId.menu.operation) {
return true;
}
return false;
},
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdTrainNumber() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 添加列车识别号*/
return OperationEvent.Train.addTrainId.trainNumberChange.domId;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/
return OperationEvent.Train.editTrainId.trainNumberChange.domId;
}
}
return null;
},
domIdTrainNo() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 添加列车识别号*/
return OperationEvent.Train.addTrainId.trainNoChange.domId;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/
return OperationEvent.Train.editTrainId.trainNoChange.domId;
}
}
return null;
},
domIdTrainType() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 添加列车识别号*/
return OperationEvent.Train.addTrainId.trainTypeChange.domId;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/
return OperationEvent.Train.editTrainId.trainTypeChange.domId;
}
}
return null;
},
domIdServerNo() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 添加列车识别号*/
return OperationEvent.Train.addTrainId.serverNoChange.domId;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/
return OperationEvent.Train.editTrainId.serverNoChange.domId;
}
}
return null;
},
domIdTargetCode() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 添加列车识别号*/
return OperationEvent.Train.addTrainId.targetCodeChange.domId;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/
return OperationEvent.Train.editTrainId.targetCodeChange.domId;
}
}
return null;
},
domIdConfirm() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 添加列车识别号*/
return OperationEvent.Train.addTrainId.menu.domId;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/
return OperationEvent.Train.editTrainId.menu.domId;
}
}
return null;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
title() {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
return '添加列车识别号';
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
return '修改列车识别号';
}
return '';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
loadInitData(map) {
if (map) {
getPublishTrainList(map.skinCode).then(resp => {
this.trainList = resp.data;
}).catch(() => {
this.$messageBox(`获取列车车组号失败`);
});
}
},
doShow(operate, selected) {
//
if (!this.dialogShow) {
this.operation = operate.operation;
}
rules: {
trainNumber: [
{ required: true, message: '请选择车组号', trigger: 'change' }
],
trainType: [
{ required: true, message: '请选择一个列车类型', trigger: 'change' }
],
serverNo: [
{ required: true, message: '请输入表号', trigger: 'blur' }
],
trainNo: [
{ required: true, message: '请输入车次号', trigger: 'blur' }
],
targetCode: [
{ required: true, message: '请输入目的地号', trigger: 'blur' }
]
},
operation: null,
dialogShow: false,
loading: false,
direction: 0
};
},
computed: {
...mapGetters('map', [
'map'
]),
trainNoIsDisabled() {
return false;
},
serverNoIsDisabled() {
return false;
},
targetCodeIsDisabled() {
return false;
},
trainNumberIsDisabled() {
if (this.operation != OperationEvent.Train.addTrainId.menu.operation) {
return true;
}
return false;
},
trainTypeIsDisabled() {
if (this.operation != OperationEvent.Train.addTrainId.menu.operation) {
return true;
}
return false;
},
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdTrainNumber() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 添加列车识别号*/
return OperationEvent.Train.addTrainId.trainNumberChange.domId;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/
return OperationEvent.Train.editTrainId.trainNumberChange.domId;
}
}
return null;
},
domIdTrainNo() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 添加列车识别号*/
return OperationEvent.Train.addTrainId.trainNoChange.domId;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/
return OperationEvent.Train.editTrainId.trainNoChange.domId;
}
}
return null;
},
domIdTrainType() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 添加列车识别号*/
return OperationEvent.Train.addTrainId.trainTypeChange.domId;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/
return OperationEvent.Train.editTrainId.trainTypeChange.domId;
}
}
return null;
},
domIdServerNo() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 添加列车识别号*/
return OperationEvent.Train.addTrainId.serverNoChange.domId;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/
return OperationEvent.Train.editTrainId.serverNoChange.domId;
}
}
return null;
},
domIdTargetCode() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 添加列车识别号*/
return OperationEvent.Train.addTrainId.targetCodeChange.domId;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/
return OperationEvent.Train.editTrainId.targetCodeChange.domId;
}
}
return null;
},
domIdConfirm() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 添加列车识别号*/
return OperationEvent.Train.addTrainId.menu.domId;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/
return OperationEvent.Train.editTrainId.menu.domId;
}
}
return null;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
title() {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
return '添加列车识别号';
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
return '修改列车识别号';
}
return '';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
loadInitData(map) {
},
doShow(operate, selected) {
//
if (!this.dialogShow) {
this.operation = operate.operation;
}
this.formModel = {
trainNumber: selected.trainNumber,
trainNo: selected.trainNo,
trainType: '01',
serverNo: selected.serverNo,
targetCode: selected.targetCode
};
this.formModel = {
trainNumber: selected.trainNumber,
trainNo: selected.trainNo,
trainType: '01',
serverNo: selected.serverNo,
targetCode: selected.targetCode
};
/** 加载列车数据*/
this.loadInitData(this.map);
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
},
trainNumberChange(trainNumber) {
const operate = {
type: MapDeviceType.Train.type,
val: `${trainNumber}`,
operation: ''
};
/** 加载列车数据*/
this.loadInitData(this.map);
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
},
trainNumberChange(trainNumber) {
const operate = {
type: MapDeviceType.Train.type,
val: `${trainNumber}`,
operation: ''
};
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
operate.operation = OperationEvent.Train.addTrainId.trainNumberChange.operation;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
operate.operation = OperationEvent.Train.editTrainId.trainNumberChange.operation;
}
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
operate.operation = OperationEvent.Train.addTrainId.trainNumberChange.operation;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
operate.operation = OperationEvent.Train.editTrainId.trainNumberChange.operation;
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
trainTypeChange(trainType) {
const operate = {
type: MapDeviceType.Train.type,
val: `${trainType}`,
operation: ''
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
trainTypeChange(trainType) {
const operate = {
type: MapDeviceType.Train.type,
val: `${trainType}`,
operation: ''
};
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
operate.operation = OperationEvent.Train.addTrainId.trainTypeChange.operation;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
operate.operation = OperationEvent.Train.editTrainId.trainTypeChange.operation;
}
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
operate.operation = OperationEvent.Train.addTrainId.trainTypeChange.operation;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
operate.operation = OperationEvent.Train.editTrainId.trainTypeChange.operation;
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
serverNoChange(serverNo) {
const operate = {
type: MapDeviceType.Train.type,
val: `${serverNo}`,
operation: ''
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
serverNoChange(serverNo) {
const operate = {
type: MapDeviceType.Train.type,
val: `${serverNo}`,
operation: ''
};
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
operate.operation = OperationEvent.Train.addTrainId.serverNoChange.operation;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
operate.operation = OperationEvent.Train.editTrainId.serverNoChange.operation;
}
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
operate.operation = OperationEvent.Train.addTrainId.serverNoChange.operation;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
operate.operation = OperationEvent.Train.editTrainId.serverNoChange.operation;
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
trainNoChange(trainNo) {
const operate = {
type: MapDeviceType.Train.type,
val: `${trainNo}`,
operation: ''
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
trainNoChange(trainNo) {
const operate = {
type: MapDeviceType.Train.type,
val: `${trainNo}`,
operation: ''
};
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
operate.operation = OperationEvent.Train.addTrainId.trainNoChange.operation;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
operate.operation = OperationEvent.Train.editTrainId.trainNoChange.operation;
}
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
operate.operation = OperationEvent.Train.addTrainId.trainNoChange.operation;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
operate.operation = OperationEvent.Train.editTrainId.trainNoChange.operation;
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
targetCodeChange(targetCode) {
const operate = {
type: MapDeviceType.Train.type,
val: `${targetCode}`,
operation: ''
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
targetCodeChange(targetCode) {
const operate = {
type: MapDeviceType.Train.type,
val: `${targetCode}`,
operation: ''
};
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
operate.operation = OperationEvent.Train.addTrainId.targetCodeChange.operation;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
operate.operation = OperationEvent.Train.editTrainId.targetCodeChange.operation;
}
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
operate.operation = OperationEvent.Train.addTrainId.targetCodeChange.operation;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
operate.operation = OperationEvent.Train.editTrainId.targetCodeChange.operation;
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
commit() {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 增加列车识别号*/
this.addTrainId();
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/
this.editTrainId();
}
},
//
addTrainId() {
this.$refs['form'].validate((valid) => {
if (valid) {
const model = this.formModel;
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.addTrainId.menu.operation,
messages: [`添加列车识别号:成功`],
val: `${model.trainNumber}::${model.trainType}::${model.serverNo}::${model.trainNo}::${model.targetCode}`
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
commit() {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 增加列车识别号*/
this.addTrainId();
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/
this.editTrainId();
}
},
//
addTrainId() {
this.$refs['form'].validate((valid) => {
if (valid) {
const model = this.formModel;
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.addTrainId.menu.operation,
messages: [`添加列车识别号:成功`],
val: `${model.trainNumber}::${model.trainType}::${model.serverNo}::${model.trainNo}::${model.targetCode}`
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.confirmTrain.doShow(operate);
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
} else {
return false;
}
});
},
//
editTrainId() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.editTrainId.menu.operation,
messages: [`修改列车识别号:成功`],
val: this.formModel.trainNo
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.confirmTrain.doShow(operate);
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
} else {
return false;
}
});
},
//
editTrainId() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.editTrainId.menu.operation,
messages: [`修改列车识别号:成功`],
val: this.formModel.trainNo
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.confirmTrain.doShow(operate);
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
} else {
return false;
}
});
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.confirmTrain.doShow(operate);
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
} else {
return false;
}
});
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>

View File

@ -1,155 +1,160 @@
<template>
<el-dialog class="fuzhou_01 route-create" :title="title" :visible.sync="show" width="580px" label-position="top"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<div style="padding: 10px 20px; border: 1px solid lightgray;">
<el-form size="small" label-width="100px">
<el-form-item label="列车:" prop="trainCode">
<el-select v-model="trainCode" filterable placeholder="列车">
<el-option v-for="item in trainList" :key="item.code" :label="item.trainNumber"
:value="item.code"></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="列车车次:" prop="trainNo">
<el-dialog
class="fuzhou_01 route-create"
v-dialogDrag
:title="title"
:visible.sync="show"
width="580px"
label-position="top"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<div style="padding: 10px 20px; border: 1px solid lightgray;">
<el-form size="small" label-width="100px">
<el-form-item label="列车:" prop="trainCode">
<el-select v-model="trainCode" filterable placeholder="列车">
<el-option
v-for="item in trainList"
:key="item.code"
:label="item.trainNumber"
:value="item.code"
/>
</el-select>
</el-form-item>
<!-- <el-form-item label="列车车次:" prop="trainNo">
<el-select v-model="trainNo" filterable placeholder="列车车次">
<el-option v-for="no in trainNoList" :key="no" :label="no" :value="no"></el-option>
</el-select>
<div style="font-size: 12px;">(上行路线车次号选择偶数下行路线车次号选择基数)</div>
</el-form-item> -->
<el-form-item label="列车方向:" prop="direction">
<el-select v-model="direction" filterable placeholder="列车方向">
<el-option v-for="no in directionList" :key="no.value" :label="no.label" :value="no.value">
</el-option>
</el-select>
<!-- <div style="font-size: 12px;">(上行路线车次号选择偶数下行路线车次号选择基数)</div> -->
</el-form-item>
</el-form>
<el-row>
<el-col style="text-align: right;">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</div>
<notice-info ref="noticeInfo"></notice-info>
</el-dialog>
<el-form-item label="列车方向:" prop="direction">
<el-select v-model="direction" filterable placeholder="列车方向">
<el-option v-for="no in directionList" :key="no.value" :label="no.label" :value="no.value" />
</el-select>
<!-- <div style="font-size: 12px;">(上行路线车次号选择偶数下行路线车次号选择基数)</div> -->
</el-form-item>
</el-form>
<el-row>
<el-col style="text-align: right;">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</div>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { getPublishTrainList } from '@/api/jmap/map';
import NoticeInfo from './childDialog/childDialog/noticeInfo'
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default {
name: 'RouteCreate',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
trainList: [],
trainNoList: [],
directionList: [
{
value: '2',
label: '上行'
},
{
value: '1',
label: '下行'
}
],
trainCode: '',
trainNo: '',
direction: '',
selected: null
}
},
computed: {
...mapGetters('map', [
'map'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return OperationEvent.Section.newtrain.menu.domId;
},
title() {
return '设置列车';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
methods: {
loadInitData(map) {
if (Object.keys(map || {}).length) {
getPublishTrainList(map.skinCode).then(response => {
this.trainList = response.data;
}).catch(error => {
this.$messageBox(`获取列车列表失败`);
})
export default {
name: 'RouteCreate',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
trainList: [],
trainNoList: [],
directionList: [
{
value: '2',
label: '上行'
},
{
value: '1',
label: '下行'
}
},
doShow(operate, selected) {
this.dialogShow = true;
this.selected = selected;
],
trainCode: '',
trainNo: '',
direction: '',
selected: null
};
},
computed: {
...mapGetters('map', [
'map'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return OperationEvent.Section.newtrain.menu.domId;
},
title() {
return '设置列车';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
loadInitData(map) {
},
doShow(operate, selected) {
this.dialogShow = true;
this.selected = selected;
/** 加载列车数据*/
this.loadInitData(this.map);
/** 加载列车数据*/
this.loadInitData(this.map);
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.trainCode = '';
this.direction = '';
this.loading = false;
this.dialogShow = false;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
},
commit() {
let operate = {
send: true,
type: MapDeviceType.Section.type,
operation: OperationEvent.Section.newtrain.menu.operation,
val: '' + this.direction + '::' + this.trainCode
}
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
});
},
doClose() {
this.trainCode = '';
this.direction = '';
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
commit() {
const operate = {
send: true,
type: MapDeviceType.Section.type,
operation: OperationEvent.Section.newtrain.menu.operation,
val: '' + this.direction + '::' + this.trainCode
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
},
cancel() {
let operate = {
type: MapDeviceType.Section.type,
operation: OperationEvent.Command.cancel.menu.operation,
}
}).catch(error => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
},
cancel() {
const operate = {
type: MapDeviceType.Section.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => {
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
});
}
}
}).catch(error => {
this.doClose();
});
}
}
</script>
};
</script>

View File

@ -1,151 +1,155 @@
<template>
<el-dialog class="beijing-01__systerm route-create" :title="title" :visible.sync="show" width="580px"
label-position="top" :before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false"
v-dialogDrag>
<div style="padding: 10px 20px; border: 1px solid lightgray;">
<el-form size="small" label-width="100px">
<el-form-item label="列车:" prop="trainCode">
<el-select v-model="trainCode" filterable placeholder="列车">
<el-option v-for="item in trainList" :key="item.code" :label="item.groupNumber"
:value="item.code"></el-option>
</el-select>
</el-form-item>
<el-form-item label="列车方向:" prop="direction">
<el-select v-model="direction" filterable placeholder="列车方向">
<el-option v-for="no in directionList" :key="no.value" :label="no.label" :value="no.value">
</el-option>
</el-select>
</el-form-item>
</el-form>
<el-row>
<el-col style="text-align: right;">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</div>
<notice-info ref="noticeInfo"></notice-info>
</el-dialog>
<el-dialog
v-dialogDrag
class="beijing-01__systerm route-create"
:title="title"
:visible.sync="show"
width="580px"
label-position="top"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<div style="padding: 10px 20px; border: 1px solid lightgray;">
<el-form size="small" label-width="100px">
<el-form-item label="列车:" prop="trainCode">
<el-select v-model="trainCode" filterable placeholder="列车">
<el-option
v-for="item in trainList"
:key="item.code"
:label="item.groupNumber"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="列车方向:" prop="direction">
<el-select v-model="direction" filterable placeholder="列车方向">
<el-option v-for="no in directionList" :key="no.value" :label="no.label" :value="no.value" />
</el-select>
</el-form-item>
</el-form>
<el-row>
<el-col style="text-align: right;">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</div>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { getPublishTrainList } from '@/api/jmap/map';
import { mouseCancelState } from '../utils/menuItemStatus';
import NoticeInfo from './childDialog/childDialog/noticeInfo'
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { mouseCancelState } from '../utils/menuItemStatus';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default {
name: 'RouteCreate',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
trainList: [],
trainNoList: [],
directionList: [
{
value: '2',
label: '上行'
},
{
value: '1',
label: '下行'
}
],
trainCode: '',
tripNumber: '',
direction: '',
selected: null
}
},
computed: {
...mapGetters('map', [
'map'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return OperationEvent.Section.newtrain.menu.domId;
},
title() {
return '设置列车';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
methods: {
loadInitData(map) {
if (Object.keys(map || {}).length) {
getPublishTrainList(map.skinCode).then(response => {
this.trainList = response.data;
}).catch(error => {
this.$messageBox(`获取列车列表失败`);
})
export default {
name: 'RouteCreate',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
trainList: [],
trainNoList: [],
directionList: [
{
value: '2',
label: '上行'
},
{
value: '1',
label: '下行'
}
},
doShow(operate, selected) {
this.dialogShow = true;
this.selected = selected;
],
trainCode: '',
tripNumber: '',
direction: '',
selected: null
};
},
computed: {
...mapGetters('map', [
'map'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return OperationEvent.Section.newtrain.menu.domId;
},
title() {
return '设置列车';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
loadInitData(map) {
},
doShow(operate, selected) {
this.dialogShow = true;
this.selected = selected;
/** 加载列车数据*/
this.loadInitData(this.map);
/** 加载列车数据*/
this.loadInitData(this.map);
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.trainCode = '';
this.direction = '';
this.loading = false;
this.dialogShow = false;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
mouseCancelState(this.selected);
},
commit() {
let operate = {
send: true,
type: MapDeviceType.Section.type,
operation: OperationEvent.Section.newtrain.menu.operation,
val: '' + this.direction + '::' + this.trainCode
}
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
});
},
doClose() {
this.trainCode = '';
this.direction = '';
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
mouseCancelState(this.selected);
},
commit() {
const operate = {
send: true,
type: MapDeviceType.Section.type,
operation: OperationEvent.Section.newtrain.menu.operation,
val: '' + this.direction + '::' + this.trainCode
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
},
cancel() {
let operate = {
type: MapDeviceType.Section.type,
operation: OperationEvent.Command.cancel.menu.operation,
}
}).catch(error => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
},
cancel() {
const operate = {
type: MapDeviceType.Section.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => {
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
});
}
}
}).catch(error => {
this.doClose();
});
}
}
</script>
};
</script>

View File

@ -19,127 +19,128 @@
<script>
import { runPlanTemplateList } from '@/api/runplan';
import { getStationListBySkinCode } from '@/api/runplan';
import { getStationList } from '@/api/runplan';
import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
import { getSkinCodeList } from '@/api/management/mapskin';
export default {
name: 'ReloadTodayPlan',
data() {
return {
dialogShow: false,
loading: false,
skinCodeList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
reset: true,
labelWidth: '100px',
queryObject: {
name: {
type: 'text',
label: '运行图名称'
}
}
},
queryList: {
query: this.queryFunction,
selectCheckShow: false,
radioShow: true,
columns: [
{
title: '运行图名称',
prop: 'name'
},
{
title: '皮肤类型',
prop: 'skinCode',
type: 'tag',
columnValue: (row) => {
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
},
tagType: (row) => { return 'success'; }
}
]
},
name: 'ReloadTodayPlan',
data() {
return {
dialogShow: false,
loading: false,
skinCodeList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
reset: true,
labelWidth: '100px',
queryObject: {
name: {
type: 'text',
label: '运行图名称'
}
}
},
queryList: {
query: this.queryFunction,
selectCheckShow: false,
radioShow: true,
columns: [
{
title: '运行图名称',
prop: 'name'
},
{
title: '皮肤类型',
prop: 'skinCode',
type: 'tag',
columnValue: (row) => {
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
},
tagType: (row) => { return 'success'; }
}
]
},
currentModel: {}
};
},
computed: {
title() {
return '加载当天计划';
}
},
methods: {
loadInitData() {
this.skinCodeList = [];
getSkinCodeList().then(response => {
this.skinCodeList = response.data;
});
},
doShow() {
this.loading = false;
this.dialogShow = true;
this.loadInitData();
},
doClose() {
this.dialogShow = false;
},
queryFunction(params) {
if (this.$store.state.map && this.$store.state.map.map) {
params['skinCode'] = this.$store.getters['map/skinCode'];
}
return runPlanTemplateList(params);
},
//
handleConfirm() {
if (this.$refs && this.$refs.pageRules) {
const choose = this.$refs.pageRules.currentChoose();
if (choose && choose.id) {
this.loading = true;
generateDayRunPlan(choose.id, this.$route.query.group).then(response => {
this.loading = false;
this.reloadTable();
this.loadRunData();
this.doClose();
this.$message.success(`生成用户每日运行图成功`);
}).catch(() => {
this.loading = false;
this.reloadTable();
this.$messageBox(`生成用户每日运行图失败`);
});
} else {
this.$messageBox(`请选择需要加载的运行图`);
}
}
},
loadRunData() {
const skinCode = this.$route.query.skinCode;
this.$store.dispatch('runPlan/clear');
if (skinCode) {
getStationListBySkinCode(skinCode).then(response => {
const stations = response.data;
this.PlanConvert = this.$theme.loadPlanConvert(skinCode);
this.$store.dispatch('runPlan/setStations', stations).then(() => {
getEveryDayRunPlanData(this.$route.query.group).then(resp => {
this.$store.dispatch('runPlan/setPlanData', resp.data);
}).catch(() => {
this.$store.dispatch('runPlan/setPlanData', []);
this.$messageBox(`获取运行图数据失败`);
});
});
}).catch(() => {
this.$messageBox(`获取车站列表失败`);
});
}
},
reloadTable() {
this.queryList.reload();
}
}
currentModel: {}
};
},
computed: {
title() {
return '加载当天计划';
}
},
methods: {
loadInitData() {
this.skinCodeList = [];
getSkinCodeList().then(response => {
this.skinCodeList = response.data;
});
},
doShow() {
this.loading = false;
this.dialogShow = true;
this.loadInitData();
},
doClose() {
this.dialogShow = false;
},
queryFunction(params) {
if (this.$store.state.map && this.$store.state.map.map) {
params['skinCode'] = this.$store.getters['map/skinCode'];
}
return runPlanTemplateList(params);
},
//
handleConfirm() {
if (this.$refs && this.$refs.pageRules) {
const choose = this.$refs.pageRules.currentChoose();
if (choose && choose.id) {
this.loading = true;
generateDayRunPlan(choose.id, this.$route.query.group).then(response => {
this.loading = false;
this.reloadTable();
this.loadRunData();
this.doClose();
this.$message.success(`生成用户每日运行图成功`);
}).catch(() => {
this.loading = false;
this.reloadTable();
this.$messageBox(`生成用户每日运行图失败`);
});
} else {
this.$messageBox(`请选择需要加载的运行图`);
}
}
},
loadRunData() {
const skinCode = this.$route.query.skinCode;
const mapId = this.$route.query.mapId;
this.$store.dispatch('runPlan/clear');
if (mapId) {
getStationList(mapId).then(response => {
const stations = response.data;
this.PlanConvert = this.$theme.loadPlanConvert(skinCode);
this.$store.dispatch('runPlan/setStations', stations).then(() => {
getEveryDayRunPlanData(this.$route.query.group).then(resp => {
this.$store.dispatch('runPlan/setPlanData', resp.data);
}).catch(() => {
this.$store.dispatch('runPlan/setPlanData', []);
this.$messageBox(`获取运行图数据失败`);
});
});
}).catch(() => {
this.$messageBox(`获取车站列表失败`);
});
}
},
reloadTable() {
this.queryList.reload();
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -97,241 +97,233 @@
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { getPublishTrainList } from '@/api/jmap/map';
import { mouseCancelState } from '../utils/menuItemStatus';
import ConfirmTrain from './childDialog/confirmTrain';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default {
name: 'TrainControl',
components: {
ConfirmTrain,
NoticeInfo
},
data() {
return {
trainList: [],
selected: null,
addModel: {
stationName: '',
sectionCode: '',
trainWindowCode: '',
groupNumber: '',
serviceNumber: '',
targetCode: '',
trainCode: '',
runningMode: ''
},
name: 'TrainControl',
components: {
ConfirmTrain,
NoticeInfo
},
data() {
return {
trainList: [],
selected: null,
addModel: {
stationName: '',
sectionCode: '',
trainWindowCode: '',
groupNumber: '',
serviceNumber: '',
targetCode: '',
trainCode: '',
runningMode: ''
},
rules: {
stationName: [
{ required: true, message: '请输入车站', trigger: 'blur'}
],
sectionCode: [
{ required: true, message: '请输入轨道', trigger: 'blur'}
],
trainWindowCode: [
{ required: true, message: '请输入车次窗', trigger: 'blur'}
],
groupNumber: [
{ required: true, message: '请选择车组号', trigger: 'change' }
],
serviceNumber: [
{ required: true, message: '请输入服务号', trigger: 'blur'}
],
targetCode: [
{ required: true, message: '请输入目的地号', trigger: 'blur'}
],
trainCode: [
{ required: true, message: '请输入序列号', trigger: 'blur'}
],
runningMode: [
{ required: true, message: '请选择运行模式', trigger: 'blur'}
]
},
operation: null,
rules: {
stationName: [
{ required: true, message: '请输入车站', trigger: 'blur'}
],
sectionCode: [
{ required: true, message: '请输入轨道', trigger: 'blur'}
],
trainWindowCode: [
{ required: true, message: '请输入车次窗', trigger: 'blur'}
],
groupNumber: [
{ required: true, message: '请选择车组号', trigger: 'change' }
],
serviceNumber: [
{ required: true, message: '请输入服务号', trigger: 'blur'}
],
targetCode: [
{ required: true, message: '请输入目的地号', trigger: 'blur'}
],
trainCode: [
{ required: true, message: '请输入序列号', trigger: 'blur'}
],
runningMode: [
{ required: true, message: '请选择运行模式', trigger: 'blur'}
]
},
operation: null,
dialogShow: false,
loading: false,
direction: 0
};
},
computed: {
...mapGetters('map', [
'map'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Train.destinationTrainId.menu.operation) {
/* 设目的地*/
return OperationEvent.Train.destinationTrainId.menu.domId;
} else if (this.operation == OperationEvent.Train.setPlanTrainId.menu.operation) {
/* 设计划车*/
return OperationEvent.Train.setPlanTrainId.menu.domId;
} else if (this.operation == OperationEvent.Train.artificialTrainId.menu.operation) {
/* 设人工车*/
return OperationEvent.Train.artificialTrainId.menu.domId;
}
return '';
}
return '';
},
title() {
if ( this.operation == OperationEvent.Train.destinationTrainId.menu.operation) {
return '设目的地车';
} else if ( this.operation == OperationEvent.Train.setPlanTrainId.menu.operation ) {
return '设计划车';
} else if ( this.operation == OperationEvent.Train.artificialTrainId.menu.operation ) {
return '设人工车';
}
return '';
dialogShow: false,
loading: false,
direction: 0
};
},
computed: {
...mapGetters('map', [
'map'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Train.destinationTrainId.menu.operation) {
/* 设目的地*/
return OperationEvent.Train.destinationTrainId.menu.domId;
} else if (this.operation == OperationEvent.Train.setPlanTrainId.menu.operation) {
/* 设计划车*/
return OperationEvent.Train.setPlanTrainId.menu.domId;
} else if (this.operation == OperationEvent.Train.artificialTrainId.menu.operation) {
/* 设人工车*/
return OperationEvent.Train.artificialTrainId.menu.domId;
}
return '';
}
return '';
},
title() {
if ( this.operation == OperationEvent.Train.destinationTrainId.menu.operation) {
return '设目的地车';
} else if ( this.operation == OperationEvent.Train.setPlanTrainId.menu.operation ) {
return '设计划车';
} else if ( this.operation == OperationEvent.Train.artificialTrainId.menu.operation ) {
return '设人工车';
}
return '';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
loadInitData(map) {
if (map) {
getPublishTrainList(map.skinCode).then(resp => {
this.trainList = resp.data;
}).catch(() => {
this.$messageBox(`获取列车车组号失败`);
});
}
},
doShow(operate, selected) {
this.selected = selected;
//
if (!this.dialogShow) {
this.operation = operate.operation;
}
this.addModel = {
tripNumber: '',
groupNumber: '',
trainType: '01',
serviceNumber: '',
targetCode: ''
};
/** 加载列车数据*/
this.loadInitData(this.map);
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
mouseCancelState(this.selected);
},
commit() {
if ( this.operation == OperationEvent.Train.destinationTrainId.menu.operation ) {
this.destinationTrainId();
} else if (this.operation == OperationEvent.Train.setPlanTrainId.menu.operation ) {
this.setPlanTrainId();
} else if (this.operation == OperationEvent.Train.artificialTrainId.menu.operation ) {
this.artificialTrainId();
}
},
//
destinationTrainId() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.destinationTrainId.menu.operation,
message: [`设目的地车:成功`],
val: ''
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
} else {
return false;
}
});
},
//
setPlanTrainId() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.setPlanTrainId.menu.operation,
message: [`设计划车:成功`],
val: ''
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
} else {
return false;
}
});
},
//
artificialTrainId() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.artificialTrainId.menu.operation,
message: [`设人工车:成功`],
val: ''
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
} else {
return false;
}
});
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
loadInitData(map) {
},
doShow(operate, selected) {
this.selected = selected;
//
if (!this.dialogShow) {
this.operation = operate.operation;
}
this.addModel = {
tripNumber: '',
groupNumber: '',
trainType: '01',
serviceNumber: '',
targetCode: ''
};
/** 加载列车数据*/
this.loadInitData(this.map);
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
mouseCancelState(this.selected);
},
commit() {
if ( this.operation == OperationEvent.Train.destinationTrainId.menu.operation ) {
this.destinationTrainId();
} else if (this.operation == OperationEvent.Train.setPlanTrainId.menu.operation ) {
this.setPlanTrainId();
} else if (this.operation == OperationEvent.Train.artificialTrainId.menu.operation ) {
this.artificialTrainId();
}
},
//
destinationTrainId() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.destinationTrainId.menu.operation,
message: [`设目的地车:成功`],
val: ''
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
} else {
return false;
}
});
},
//
setPlanTrainId() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.setPlanTrainId.menu.operation,
message: [`设计划车:成功`],
val: ''
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
} else {
return false;
}
});
},
//
artificialTrainId() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.artificialTrainId.menu.operation,
message: [`设人工车:成功`],
val: ''
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
} else {
return false;
}
});
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>
<style scoped>

View File

@ -33,121 +33,113 @@
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { getPublishTrainList } from '@/api/jmap/map';
import { mouseCancelState } from '../utils/menuItemStatus';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default {
name: 'RouteCreate',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
trainList: [],
trainNoList: [],
directionList: [
{
value: '2',
label: '上行'
},
{
value: '1',
label: '下行'
}
],
trainCode: '',
tripNumber: '',
direction: '',
selected: null
};
},
computed: {
...mapGetters('map', [
'map'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return OperationEvent.Section.newtrain.menu.domId;
},
title() {
return '设置列车';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
loadInitData(map) {
if (Object.keys(map || {}).length) {
getPublishTrainList(map.skinCode).then(response => {
this.trainList = response.data;
}).catch(() => {
this.$messageBox(`获取列车列表失败`);
});
}
},
doShow(operate, selected) {
this.dialogShow = true;
this.selected = selected;
console.log(this.map);
/** 加载列车数据*/
this.loadInitData(this.map);
name: 'RouteCreate',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
trainList: [],
trainNoList: [],
directionList: [
{
value: '2',
label: '上行'
},
{
value: '1',
label: '下行'
}
],
trainCode: '',
tripNumber: '',
direction: '',
selected: null
};
},
computed: {
...mapGetters('map', [
'map'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return OperationEvent.Section.newtrain.menu.domId;
},
title() {
return '设置列车';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
loadInitData(map) {
},
doShow(operate, selected) {
this.dialogShow = true;
this.selected = selected;
console.log(this.map);
/** 加载列车数据*/
this.loadInitData(this.map);
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.trainCode = '';
this.direction = '';
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
mouseCancelState(this.selected);
},
commit() {
const operate = {
send: true,
type: MapDeviceType.Section.type,
operation: OperationEvent.Section.newtrain.menu.operation,
val: '' + this.direction + '::' + this.trainCode
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
},
cancel() {
const operate = {
type: MapDeviceType.Section.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.trainCode = '';
this.direction = '';
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
mouseCancelState(this.selected);
},
commit() {
const operate = {
send: true,
type: MapDeviceType.Section.type,
operation: OperationEvent.Section.newtrain.menu.operation,
val: '' + this.direction + '::' + this.trainCode
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
},
cancel() {
const operate = {
type: MapDeviceType.Section.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>

View File

@ -1,169 +1,173 @@
<template>
<el-dialog class="chengdou-03__systerm stand-stop-time" :title="title" :visible.sync="show" width="480px"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<div class="el-dialog-div">
<el-form size="small" label-width="80px" :model="addModel" :rules="rules" ref="form" label-position="left">
<el-row>
<el-col :span="11">
<el-form-item prop="stationName">
<span slot="label">车站</span>
<el-input v-model="addModel.stationName" :disabled="true"></el-input>
</el-form-item>
</el-col>
<el-col :span="11" :offset="1">
<el-form-item prop="trainWindowCode">
<span slot="label">车次窗</span>
<el-input v-model="addModel.trainWindowCode" :disabled="true"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="车 组 号:" prop="groupNumber">
<el-select v-model="addModel.groupNumber" filterable>
<el-option v-for="train in trainList" :key="train.groupNumber" :label="train.groupNumber"
:value="train.groupNumber">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
<el-dialog
v-dialogDrag
class="chengdou-03__systerm stand-stop-time"
:title="title"
:visible.sync="show"
width="480px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<div class="el-dialog-div">
<el-form ref="form" size="small" label-width="80px" :model="addModel" :rules="rules" label-position="left">
<el-row>
<el-col :span="11">
<el-form-item prop="stationName">
<span slot="label">车站</span>
<el-input v-model="addModel.stationName" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="11" :offset="1">
<el-form-item prop="trainWindowCode">
<span slot="label">车次窗</span>
<el-input v-model="addModel.trainWindowCode" :disabled="true" />
</el-form-item>
</el-col>
</el-row>
</el-dialog>
<el-row>
<el-col :span="11">
<el-form-item label="车 组 号:" prop="groupNumber">
<el-select v-model="addModel.groupNumber" filterable>
<el-option
v-for="train in trainList"
:key="train.groupNumber"
:label="train.groupNumber"
:value="train.groupNumber"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { mouseCancelState } from '../utils/menuItemStatus';
import { getPublishTrainList } from '@/api/jmap/map';
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { mouseCancelState } from '../utils/menuItemStatus';
export default {
name: 'TrainCreateNumber',
components: {
export default {
name: 'TrainCreateNumber',
components: {
},
data() {
return {
trainNoList: [],
trainList: [],
selected: null,
addModel: {
stationName:'',
trainWindowCode: '',
groupNumber:''
},
rules: {
groupNumber: [
{ required: true, message: '请输入车组号', trigger: 'blur'}
]
},
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
data() {
return {
trainNoList: [],
trainList: [],
selected: null,
addModel: {
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.editTrainNo.menu.domId : '';
},
title() {
return '新建车组号';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
loadInitData(map) {
},
doShow(operate, selected) {
this.selected = selected;
//
if (!this.dialogShow) {
this.addModel = {
stationName:'',
trainWindowCode: '',
groupNumber:'',
},
rules: {
groupNumber: [
{ required: true, message: '请输入车组号', trigger: 'blur'}
],
},
dialogShow: false,
loading: false,
groupNumber:''
};
}
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.editTrainNo.menu.domId : '';
},
title() {
return '新建车组号'
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
methods: {
loadInitData(map) {
if (map) {
getPublishTrainList(map.skinCode).then(resp => {
this.trainList = resp.data;
}).catch(error => {
this.$messageBox(`获取列车车组号失败`);
});
}
},
doShow(operate, selected) {
this.selected = selected;
//
if (!this.dialogShow) {
this.addModel ={
stationName:'',
trainWindowCode: '',
groupNumber:'',
}
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
mouseCancelState(this.selected);
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
let operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.createTrainNo.menu.operation,
}
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
mouseCancelState(this.selected);
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.createTrainNo.menu.operation
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
// this.$refs.noticeInfo.doShow(operate);
})
} else {
return false;
}
});
},
cancel() {
let operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
}
}).catch(error => {
this.loading = false;
this.doClose();
}
}).catch(error => { this.doClose(); });
}
// this.$refs.noticeInfo.doShow(operate);
});
} else {
return false;
}
});
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => { this.doClose(); });
}
}
};
</script>
<style scoped>
.chengdou-03__systerm .el-dialog .base-label {

View File

@ -1,164 +1,168 @@
<template>
<el-dialog class="chengdou-03__systerm stand-stop-time" :title="title" :visible.sync="show" width="480px"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<div class="el-dialog-div">
<el-form size="small" label-width="80px" :model="addModel" ref="form" label-position="left">
<el-row>
<el-col :span="11">
<el-form-item prop="stationName">
<span slot="label">车站</span>
<el-input v-model="addModel.stationName" :disabled="true"></el-input>
</el-form-item>
</el-col>
<el-col :span="11" :offset="1">
<el-form-item prop="trainWindowCode">
<span slot="label">车次窗</span>
<el-input v-model="addModel.trainWindowCode" :disabled="true"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="车 组 号:" prop="groupNumber">
<el-select v-model="addModel.groupNumber" filterable disabled>
<el-option v-for="train in trainList" :key="train.groupNumber" :label="train.groupNumber"
:value="train.groupNumber">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</el-dialog>
<el-dialog
v-dialogDrag
class="chengdou-03__systerm stand-stop-time"
:title="title"
:visible.sync="show"
width="480px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<div class="el-dialog-div">
<el-form ref="form" size="small" label-width="80px" :model="addModel" label-position="left">
<el-row>
<el-col :span="11">
<el-form-item prop="stationName">
<span slot="label">车站</span>
<el-input v-model="addModel.stationName" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="11" :offset="1">
<el-form-item prop="trainWindowCode">
<span slot="label">车次窗</span>
<el-input v-model="addModel.trainWindowCode" :disabled="true" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="车 组 号:" prop="groupNumber">
<el-select v-model="addModel.groupNumber" filterable disabled>
<el-option
v-for="train in trainList"
:key="train.groupNumber"
:label="train.groupNumber"
:value="train.groupNumber"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { mouseCancelState } from '../utils/menuItemStatus';
import { getPublishTrainList } from '@/api/jmap/map';
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { mouseCancelState } from '../utils/menuItemStatus';
export default {
name: 'TrainDeleteNumber',
components: {
export default {
name: 'TrainDeleteNumber',
components: {
},
data() {
return {
trainNoList: [],
trainList: [],
selected: null,
addModel: {
stationName:'',
trainWindowCode: '',
groupNumber:''
},
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
data() {
return {
trainNoList: [],
trainList: [],
selected: null,
addModel: {
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.editTrainNo.menu.domId : '';
},
title() {
return '删除车组号';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
loadInitData(map) {
},
doShow(operate, selected) {
this.selected = selected;
//
if (!this.dialogShow) {
this.addModel = {
stationName:'',
trainWindowCode: '',
groupNumber:'',
},
dialogShow: false,
loading: false,
groupNumber:''
};
}
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.editTrainNo.menu.domId : '';
},
title() {
return '删除车组号'
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
methods: {
loadInitData(map) {
if (map) {
getPublishTrainList(map.skinCode).then(resp => {
this.trainList = resp.data;
}).catch(error => {
this.$messageBox(`获取列车车组号失败`);
});
}
},
doShow(operate, selected) {
this.selected = selected;
//
if (!this.dialogShow) {
this.addModel ={
stationName:'',
trainWindowCode: '',
groupNumber:'',
}
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
mouseCancelState(this.selected);
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
let operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.deleteTrainNo.menu.operation,
};
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
mouseCancelState(this.selected);
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.deleteTrainNo.menu.operation
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
// this.$refs.noticeInfo.doShow(operate);
})
} else {
return false;
}
});
},
cancel() {
let operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
}
}).catch(error => {
this.loading = false;
this.doClose();
}
}).catch(error => { this.doClose(); });
}
// this.$refs.noticeInfo.doShow(operate);
});
} else {
return false;
}
});
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => { this.doClose(); });
}
}
};
</script>
<style scoped>
.chengdou-03__systerm .el-dialog .base-label {

View File

@ -234,7 +234,6 @@
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { mouseCancelState } from '../utils/menuItemStatus';
import { getPublishTrainList } from '@/api/jmap/map';
export default {
name: 'TrainDetailInfo',

View File

@ -49,125 +49,117 @@
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { mouseCancelState } from '../utils/menuItemStatus';
import { getPublishTrainList } from '@/api/jmap/map';
export default {
name: 'TrainEditNumber',
components: {
},
data() {
return {
trainNoList: [],
trainList: [],
selected: null,
addModel: {
stationName: '',
trainWindowCode: '',
oldGroupNumber: '',
newGroupNumber: ''
},
name: 'TrainEditNumber',
components: {
},
data() {
return {
trainNoList: [],
trainList: [],
selected: null,
addModel: {
stationName: '',
trainWindowCode: '',
oldGroupNumber: '',
newGroupNumber: ''
},
rules: {
newGroupNumber: [
{ required: true, message: '请输入新车组号', trigger: 'blur'}
]
},
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.editTrainNo.menu.domId : '';
},
title() {
return '修改车组号';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
loadInitData(map) {
if (map) {
getPublishTrainList(map.skinCode).then(resp => {
this.trainList = resp.data;
}).catch(() => {
this.$messageBox(`获取列车车组号失败`);
});
}
},
doShow(operate, selected) {
this.selected = selected;
//
if (!this.dialogShow) {
this.addModel ={
stationName: '',
trainWindowCode: '',
oldGroupNumber: '',
newGroupNumber: ''
};
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
mouseCancelState(this.selected);
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.editTrainNo.menu.operation
};
rules: {
newGroupNumber: [
{ required: true, message: '请输入新车组号', trigger: 'blur'}
]
},
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.editTrainNo.menu.domId : '';
},
title() {
return '修改车组号';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
loadInitData(map) {
},
doShow(operate, selected) {
this.selected = selected;
//
if (!this.dialogShow) {
this.addModel = {
stationName: '',
trainWindowCode: '',
oldGroupNumber: '',
newGroupNumber: ''
};
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
mouseCancelState(this.selected);
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.editTrainNo.menu.operation
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
});
} else {
return false;
}
});
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
});
} else {
return false;
}
});
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => { this.doClose(); });
}
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => { this.doClose(); });
}
}
};
</script>
<style scoped>

View File

@ -1,182 +1,186 @@
<template>
<el-dialog class="chengdou-03__systerm stand-stop-time" :title="title" :visible.sync="show" width="480px"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<div class="el-dialog-div">
<el-form size="small" label-width="90px" :model="addModel" ref="form" label-position="left">
<el-row>
<el-col :span="11">
<el-form-item prop="stationName">
<span slot="label">车站</span>
<el-input v-model="addModel.stationName" :disabled="true"></el-input>
</el-form-item>
</el-col>
<el-col :span="11" :offset="1">
<el-form-item prop="trainWindowCode">
<span slot="label">车次窗</span>
<el-input v-model="addModel.trainWindowCode" :disabled="true"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="车 组 号:" prop="groupNumber">
<el-select v-model="addModel.groupNumber" filterable disabled>
<el-option v-for="train in trainList" :key="train.groupNumber" :label="train.groupNumber"
:value="train.groupNumber">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item prop="purposeStationName">
<span slot="label">车站</span>
<el-input v-model="addModel.purposeStationName" :disabled="true"></el-input>
</el-form-item>
</el-col>
<el-col :span="11" :offset="1">
<el-form-item prop="purposeTrainWindowCode" >
<span slot="label">目的车次窗</span>
<el-input v-model="addModel.purposeTrainWindowCode" :disabled="true"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
<el-dialog
v-dialogDrag
class="chengdou-03__systerm stand-stop-time"
:title="title"
:visible.sync="show"
width="480px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<div class="el-dialog-div">
<el-form ref="form" size="small" label-width="90px" :model="addModel" label-position="left">
<el-row>
<el-col :span="11">
<el-form-item prop="stationName">
<span slot="label">车站</span>
<el-input v-model="addModel.stationName" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="11" :offset="1">
<el-form-item prop="trainWindowCode">
<span slot="label">车次窗</span>
<el-input v-model="addModel.trainWindowCode" :disabled="true" />
</el-form-item>
</el-col>
</el-row>
</el-dialog>
<el-row>
<el-col :span="11">
<el-form-item label="车 组 号:" prop="groupNumber">
<el-select v-model="addModel.groupNumber" filterable disabled>
<el-option
v-for="train in trainList"
:key="train.groupNumber"
:label="train.groupNumber"
:value="train.groupNumber"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item prop="purposeStationName">
<span slot="label">车站</span>
<el-input v-model="addModel.purposeStationName" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="11" :offset="1">
<el-form-item prop="purposeTrainWindowCode">
<span slot="label">目的车次窗</span>
<el-input v-model="addModel.purposeTrainWindowCode" :disabled="true" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { mouseCancelState } from '../utils/menuItemStatus';
import { getPublishTrainList } from '@/api/jmap/map';
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { mouseCancelState } from '../utils/menuItemStatus';
export default {
name: 'TrainMoveNumber',
components: {
export default {
name: 'TrainMoveNumber',
components: {
},
data() {
return {
trainNoList: [],
trainList: [],
selected: null,
addModel: {
stationName: '',
trainWindowCode: '',
groupNumber: '',
purposeStationName: '',
purposeTrainWindowCode: ''
},
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
data() {
return {
trainNoList: [],
trainList: [],
selected: null,
addModel: {
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.editTrainNo.menu.domId : '';
},
title() {
return '移动车组号';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
loadInitData(map) {
},
doShow(operate, selected) {
console.log('operate', operate, selected);
this.selected = selected;
//
if (!this.dialogShow) {
this.addModel = {
stationName: '',
trainWindowCode: '',
groupNumber: '',
purposeStationName: '',
purposeTrainWindowCode: '',
},
dialogShow: false,
loading: false,
}
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.editTrainNo.menu.domId : '';
},
title() {
return '移动车组号'
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
methods: {
loadInitData(map) {
if (map) {
getPublishTrainList(map.skinCode).then(resp => {
this.trainList = resp.data;
}).catch(error => {
this.$messageBox(`获取列车车组号失败`);
});
}
},
doShow(operate, selected) {
console.log('operate',operate,selected);
this.selected = selected;
//
if (!this.dialogShow) {
this.addModel ={
stationName: '',
trainWindowCode: '',
groupNumber: '',
purposeStationName: '',
purposeTrainWindowCode: '',
}
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
mouseCancelState(this.selected);
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
let operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.moveTrainNo.menu.operation,
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.doClose();
// this.$refs.noticeInfo.doShow(operate);
})
} else {
return false;
}
});
},
cancel() {
let operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation,
purposeTrainWindowCode: ''
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => { this.doClose(); });
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
mouseCancelState(this.selected);
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.moveTrainNo.menu.operation
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.doClose();
// this.$refs.noticeInfo.doShow(operate);
});
} else {
return false;
}
});
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => { this.doClose(); });
}
}
};
</script>
<style scoped>
.chengdou-03__systerm .el-dialog .base-label {

View File

@ -19,128 +19,129 @@
<script>
import { runPlanTemplateList } from '@/api/runplan';
import { getStationListBySkinCode } from '@/api/runplan';
import { getStationList } from '@/api/runplan';
import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
import { getSkinCodeList } from '@/api/management/mapskin';
export default {
name: 'ReloadTodayPlan',
data() {
return {
dialogShow: false,
loading: false,
skinCodeList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
reset: true,
labelWidth: '100px',
queryObject: {
name: {
type: 'text',
label: '运行图名称'
}
}
},
queryList: {
query: this.queryFunction,
selectCheckShow: false,
radioShow: true,
columns: [
{
title: '运行图名称',
prop: 'name'
},
{
title: '皮肤类型',
prop: 'skinCode',
type: 'tag',
columnValue: (row) => {
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
},
tagType: (row) => { return 'success'; }
}
]
},
name: 'ReloadTodayPlan',
data() {
return {
dialogShow: false,
loading: false,
skinCodeList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
reset: true,
labelWidth: '100px',
queryObject: {
name: {
type: 'text',
label: '运行图名称'
}
}
},
queryList: {
query: this.queryFunction,
selectCheckShow: false,
radioShow: true,
columns: [
{
title: '运行图名称',
prop: 'name'
},
{
title: '皮肤类型',
prop: 'skinCode',
type: 'tag',
columnValue: (row) => {
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
},
tagType: (row) => { return 'success'; }
}
]
},
currentModel: {}
};
},
computed: {
title() {
return '加载当天计划';
}
},
methods: {
loadInitData() {
this.skinCodeList = [];
getSkinCodeList().then(response => {
this.skinCodeList = response.data;
});
},
doShow() {
this.loading = false;
this.dialogShow = true;
this.loadInitData();
},
doClose() {
this.dialogShow = false;
},
queryFunction(params) {
if (this.$store.state.map && this.$store.state.map.map) {
params['skinCode'] = this.$store.getters['map/skinCode'];
}
return runPlanTemplateList(params);
},
//
handleConfirm() {
if (this.$refs && this.$refs.pageRules) {
const choose = this.$refs.pageRules.currentChoose();
if (choose && choose.id) {
this.loading = true;
generateDayRunPlan(choose.id, this.$route.query.group).then(response => {
this.loading = false;
this.reloadTable();
this.loadRunData();
this.doClose();
this.$message.success(`生成用户每日运行图成功`);
}).catch((error) => {
console.error(error);
this.loading = false;
this.reloadTable();
this.$messageBox(`生成用户每日运行图失败`);
});
} else {
this.$messageBox(`请选择需要加载的运行图`);
}
}
},
loadRunData() {
const skinCode = this.$route.query.skinCode;
this.$store.dispatch('runPlan/clear');
if (skinCode) {
getStationListBySkinCode(skinCode).then(response => {
const stations = response.data;
this.PlanConvert = this.$theme.loadPlanConvert(skinCode);
this.$store.dispatch('runPlan/setStations', stations).then(() => {
getEveryDayRunPlanData(this.$route.query.group).then(resp => {
this.$store.dispatch('runPlan/setPlanData', resp.data);
}).catch(() => {
this.$store.dispatch('runPlan/setPlanData', []);
this.$messageBox(`获取运行图数据失败`);
});
});
}).catch(() => {
this.$messageBox(`获取车站列表失败`);
});
}
},
reloadTable() {
this.queryList.reload();
}
}
currentModel: {}
};
},
computed: {
title() {
return '加载当天计划';
}
},
methods: {
loadInitData() {
this.skinCodeList = [];
getSkinCodeList().then(response => {
this.skinCodeList = response.data;
});
},
doShow() {
this.loading = false;
this.dialogShow = true;
this.loadInitData();
},
doClose() {
this.dialogShow = false;
},
queryFunction(params) {
if (this.$store.state.map && this.$store.state.map.map) {
params['skinCode'] = this.$store.getters['map/skinCode'];
}
return runPlanTemplateList(params);
},
//
handleConfirm() {
if (this.$refs && this.$refs.pageRules) {
const choose = this.$refs.pageRules.currentChoose();
if (choose && choose.id) {
this.loading = true;
generateDayRunPlan(choose.id, this.$route.query.group).then(response => {
this.loading = false;
this.reloadTable();
this.loadRunData();
this.doClose();
this.$message.success(`生成用户每日运行图成功`);
}).catch((error) => {
console.error(error);
this.loading = false;
this.reloadTable();
this.$messageBox(`生成用户每日运行图失败`);
});
} else {
this.$messageBox(`请选择需要加载的运行图`);
}
}
},
loadRunData() {
const skinCode = this.$route.query.skinCode;
const mapId = this.$route.query.mapId;
this.$store.dispatch('runPlan/clear');
if (mapId) {
getStationList(mapId).then(response => {
const stations = response.data;
this.PlanConvert = this.$theme.loadPlanConvert(skinCode);
this.$store.dispatch('runPlan/setStations', stations).then(() => {
getEveryDayRunPlanData(this.$route.query.group).then(resp => {
this.$store.dispatch('runPlan/setPlanData', resp.data);
}).catch(() => {
this.$store.dispatch('runPlan/setPlanData', []);
this.$messageBox(`获取运行图数据失败`);
});
});
}).catch(() => {
this.$messageBox(`获取车站列表失败`);
});
}
},
reloadTable() {
this.queryList.reload();
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -19,127 +19,128 @@
<script>
import { runPlanTemplateList } from '@/api/runplan';
import { getStationListBySkinCode } from '@/api/runplan';
import { getStationList } from '@/api/runplan';
import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
import { getSkinCodeList } from '@/api/management/mapskin';
export default {
name: 'ReloadTodayPlan',
data() {
return {
dialogShow: false,
loading: false,
skinCodeList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
reset: true,
labelWidth: '100px',
queryObject: {
name: {
type: 'text',
label: '运行图名称'
}
}
},
queryList: {
query: this.queryFunction,
selectCheckShow: false,
radioShow: true,
columns: [
{
title: '运行图名称',
prop: 'name'
},
{
title: '皮肤类型',
prop: 'skinCode',
type: 'tag',
columnValue: (row) => {
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
},
tagType: (row) => { return 'success'; }
}
]
},
name: 'ReloadTodayPlan',
data() {
return {
dialogShow: false,
loading: false,
skinCodeList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
reset: true,
labelWidth: '100px',
queryObject: {
name: {
type: 'text',
label: '运行图名称'
}
}
},
queryList: {
query: this.queryFunction,
selectCheckShow: false,
radioShow: true,
columns: [
{
title: '运行图名称',
prop: 'name'
},
{
title: '皮肤类型',
prop: 'skinCode',
type: 'tag',
columnValue: (row) => {
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
},
tagType: (row) => { return 'success'; }
}
]
},
currentModel: {}
};
},
computed: {
title() {
return '加载当天计划';
}
},
methods: {
loadInitData() {
this.skinCodeList = [];
getSkinCodeList().then(response => {
this.skinCodeList = response.data;
});
},
doShow() {
this.loading = false;
this.dialogShow = true;
this.loadInitData();
},
doClose() {
this.dialogShow = false;
},
queryFunction(params) {
if (this.$store.state.map && this.$store.state.map.map) {
params['skinCode'] = this.$store.getters['map/skinCode'];
}
return runPlanTemplateList(params);
},
//
handleConfirm() {
if (this.$refs && this.$refs.pageRules) {
const choose = this.$refs.pageRules.currentChoose();
if (choose && choose.id) {
this.loading = true;
generateDayRunPlan(choose.id, this.$route.query.group).then(response => {
this.loading = false;
this.reloadTable();
this.loadRunData();
this.doClose();
this.$message.success(`生成用户每日运行图成功`);
}).catch(() => {
this.loading = false;
this.reloadTable();
this.$messageBox(`生成用户每日运行图失败`);
});
} else {
this.$messageBox(`请选择需要加载的运行图`);
}
}
},
loadRunData() {
const skinCode = this.$route.query.skinCode;
this.$store.dispatch('runPlan/clear');
if (skinCode) {
getStationListBySkinCode(skinCode).then(response => {
const stations = response.data;
this.PlanConvert = this.$theme.loadPlanConvert(skinCode);
this.$store.dispatch('runPlan/setStations', stations).then(() => {
getEveryDayRunPlanData(this.$route.query.group).then(resp => {
this.$store.dispatch('runPlan/setPlanData', resp.data);
}).catch(() => {
this.$store.dispatch('runPlan/setPlanData', []);
this.$messageBox(`获取运行图数据失败`);
});
});
}).catch(() => {
this.$messageBox(`获取车站列表失败`);
});
}
},
reloadTable() {
this.queryList.reload();
}
}
currentModel: {}
};
},
computed: {
title() {
return '加载当天计划';
}
},
methods: {
loadInitData() {
this.skinCodeList = [];
getSkinCodeList().then(response => {
this.skinCodeList = response.data;
});
},
doShow() {
this.loading = false;
this.dialogShow = true;
this.loadInitData();
},
doClose() {
this.dialogShow = false;
},
queryFunction(params) {
if (this.$store.state.map && this.$store.state.map.map) {
params['skinCode'] = this.$store.getters['map/skinCode'];
}
return runPlanTemplateList(params);
},
//
handleConfirm() {
if (this.$refs && this.$refs.pageRules) {
const choose = this.$refs.pageRules.currentChoose();
if (choose && choose.id) {
this.loading = true;
generateDayRunPlan(choose.id, this.$route.query.group).then(response => {
this.loading = false;
this.reloadTable();
this.loadRunData();
this.doClose();
this.$message.success(`生成用户每日运行图成功`);
}).catch(() => {
this.loading = false;
this.reloadTable();
this.$messageBox(`生成用户每日运行图失败`);
});
} else {
this.$messageBox(`请选择需要加载的运行图`);
}
}
},
loadRunData() {
const skinCode = this.$route.query.skinCode;
const mapId = this.$route.query.mapId;
this.$store.dispatch('runPlan/clear');
if (mapId) {
getStationList(mapId).then(response => {
const stations = response.data;
this.PlanConvert = this.$theme.loadPlanConvert(skinCode);
this.$store.dispatch('runPlan/setStations', stations).then(() => {
getEveryDayRunPlanData(this.$route.query.group).then(resp => {
this.$store.dispatch('runPlan/setPlanData', resp.data);
}).catch(() => {
this.$store.dispatch('runPlan/setPlanData', []);
this.$messageBox(`获取运行图数据失败`);
});
});
}).catch(() => {
this.$messageBox(`获取车站列表失败`);
});
}
},
reloadTable() {
this.queryList.reload();
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -84,393 +84,384 @@
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { getPublishTrainList } from '@/api/jmap/map';
import ConfirmTrain from './childDialog/confirmTrain';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
import OperateHandler from '@/scripts/plugin/trainingOperateHandler';
export default {
name: 'TrainControl',
components: {
ConfirmTrain,
NoticeInfo
},
data() {
return {
trainList: [],
categoryList: [
{ name: 'MM', value: '01' }
],
formModel: {
tripNumber: '',
groupNumber: '',
trainType: '01',
serviceNumber: '',
targetCode: '',
category: 'MM'
},
name: 'TrainControl',
components: {
ConfirmTrain,
NoticeInfo
},
data() {
return {
trainList: [],
categoryList: [
{ name: 'MM', value: '01' }
],
formModel: {
tripNumber: '',
groupNumber: '',
trainType: '01',
serviceNumber: '',
targetCode: '',
category: 'MM'
},
rules: {
groupNumber: [
{ required: true, message: this.$t('rules.selectGroupNumber'), trigger: 'change' }
],
trainType: [
{ required: true, message: this.$t('rules.selectATrainType'), trigger: 'change' }
],
serviceNumber: [
{ required: true, message: this.$t('rules.enterTheServiceNumber'), trigger: 'blur' }
],
tripNumber: [
{ required: true, message: this.$t('rules.enterTheTripNumber'), trigger: 'blur' }
],
targetCode: [
{ required: true, message: this.$t('rules.enterTheTargetCode'), trigger: 'blur' }
]
},
operation: null,
dialogShow: false,
loading: false,
direction: 0
};
},
computed: {
...mapGetters('map', [
'map'
]),
trainNoIsDisabled() {
return false;
},
serverNoIsDisabled() {
return true;
},
targetCodeIsDisabled() {
return true;
},
trainNumberIsDisabled() {
if (this.operation != OperationEvent.Train.addTrainId.menu.operation) {
return true;
}
return '';
},
// trainTypeIsDisabled() {
// if (this.operation != OperationEvent.Train.addTrainId.menu.operation) {
// return true;
// }
// return '';
// },
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdTrainNumber() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 添加列车识别号*/
return OperationEvent.Train.addTrainId.trainNumberChange.domId;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/
return OperationEvent.Train.editTrainId.trainNumberChange.domId;
}
}
return '';
},
domIdTrainNo() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 添加列车识别号*/
return OperationEvent.Train.addTrainId.trainNoChange.domId;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/
return OperationEvent.Train.editTrainId.trainNoChange.domId;
}
}
return '';
},
domIdTrainType() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 添加列车识别号*/
return OperationEvent.Train.addTrainId.trainTypeChange.domId;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/
return OperationEvent.Train.editTrainId.trainTypeChange.domId;
}
}
return '';
},
domIdServerNo() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 添加列车识别号*/
return OperationEvent.Train.addTrainId.serverNoChange.domId;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/
return OperationEvent.Train.editTrainId.serverNoChange.domId;
}
}
return '';
},
domIdTargetCode() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 添加列车识别号*/
return OperationEvent.Train.addTrainId.targetCodeChange.domId;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/
return OperationEvent.Train.editTrainId.targetCodeChange.domId;
}
}
return '';
},
domIdConfirm() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 添加列车识别号*/
return OperationEvent.Train.addTrainId.menu.domId;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/
return OperationEvent.Train.editTrainId.menu.domId;
}
}
return '';
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
title() {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
return this.$t('menu.menuTrain.addTrainId');
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
return this.$t('menu.menuTrain.editTrainId');
}
return '';
},
istargetCode() {
if (this.formModel.serviceNumber && this.formModel.targetCode) {
return false;
}
return true;
}
},
watch: {
'formModel.tripNumber': function(val) {
if (val.length == 4) {
this.trainNoChange(val);
} else {
this.formModel = {
groupNumber: this.formModel.groupNumber,
tripNumber: val,
trainType: this.formModel.trainType,
serviceNumber: '',
targetCode: '',
category: 'MM'
};
}
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
loadInitData(map) {
if (map.skinCode) {
getPublishTrainList(map.skinCode).then(resp => {
this.trainList = resp.data;
}).catch(() => {
this.$messageBox(this.$t('error.obtainTrainGroupNumberFailed'));
});
}
},
doShow(operate, selected) {
//
if (!this.dialogShow) {
this.operation = operate.operation;
}
const model = this.$store.getters['map/getDeviceByCode'](selected.code);
this.formModel = {
groupNumber: model.groupNumber,
tripNumber: `${model.directionCode}${model.tripNumber}`,
trainType: model.type,
serviceNumber: model.serviceNumber,
targetCode: model.targetCode,
category: 'MM'
};
rules: {
groupNumber: [
{ required: true, message: this.$t('rules.selectGroupNumber'), trigger: 'change' }
],
trainType: [
{ required: true, message: this.$t('rules.selectATrainType'), trigger: 'change' }
],
serviceNumber: [
{ required: true, message: this.$t('rules.enterTheServiceNumber'), trigger: 'blur' }
],
tripNumber: [
{ required: true, message: this.$t('rules.enterTheTripNumber'), trigger: 'blur' }
],
targetCode: [
{ required: true, message: this.$t('rules.enterTheTargetCode'), trigger: 'blur' }
]
},
operation: null,
dialogShow: false,
loading: false,
direction: 0
};
},
computed: {
...mapGetters('map', [
'map'
]),
trainNoIsDisabled() {
return false;
},
serverNoIsDisabled() {
return true;
},
targetCodeIsDisabled() {
return true;
},
trainNumberIsDisabled() {
if (this.operation != OperationEvent.Train.addTrainId.menu.operation) {
return true;
}
return '';
},
// trainTypeIsDisabled() {
// if (this.operation != OperationEvent.Train.addTrainId.menu.operation) {
// return true;
// }
// return '';
// },
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdTrainNumber() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 添加列车识别号*/
return OperationEvent.Train.addTrainId.trainNumberChange.domId;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/
return OperationEvent.Train.editTrainId.trainNumberChange.domId;
}
}
return '';
},
domIdTrainNo() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 添加列车识别号*/
return OperationEvent.Train.addTrainId.trainNoChange.domId;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/
return OperationEvent.Train.editTrainId.trainNoChange.domId;
}
}
return '';
},
domIdTrainType() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 添加列车识别号*/
return OperationEvent.Train.addTrainId.trainTypeChange.domId;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/
return OperationEvent.Train.editTrainId.trainTypeChange.domId;
}
}
return '';
},
domIdServerNo() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 添加列车识别号*/
return OperationEvent.Train.addTrainId.serverNoChange.domId;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/
return OperationEvent.Train.editTrainId.serverNoChange.domId;
}
}
return '';
},
domIdTargetCode() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 添加列车识别号*/
return OperationEvent.Train.addTrainId.targetCodeChange.domId;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/
return OperationEvent.Train.editTrainId.targetCodeChange.domId;
}
}
return '';
},
domIdConfirm() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 添加列车识别号*/
return OperationEvent.Train.addTrainId.menu.domId;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/
return OperationEvent.Train.editTrainId.menu.domId;
}
}
return '';
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
title() {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
return this.$t('menu.menuTrain.addTrainId');
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
return this.$t('menu.menuTrain.editTrainId');
}
return '';
},
istargetCode() {
if (this.formModel.serviceNumber && this.formModel.targetCode) {
return false;
}
return true;
}
},
watch: {
'formModel.tripNumber': function(val) {
if (val.length == 4) {
this.trainNoChange(val);
} else {
this.formModel = {
groupNumber: this.formModel.groupNumber,
tripNumber: val,
trainType: this.formModel.trainType,
serviceNumber: '',
targetCode: '',
category: 'MM'
};
}
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
loadInitData(map) {},
doShow(operate, selected) {
//
if (!this.dialogShow) {
this.operation = operate.operation;
}
const model = this.$store.getters['map/getDeviceByCode'](selected.code);
this.formModel = {
groupNumber: model.groupNumber,
tripNumber: `${model.directionCode}${model.tripNumber}`,
trainType: model.type,
serviceNumber: model.serviceNumber,
targetCode: model.targetCode,
category: 'MM'
};
/** 加载列车数据*/
this.loadInitData(this.map);
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
},
trainNumberChange(groupNumber) {
const operate = {
type: MapDeviceType.Train.type,
val: `${groupNumber}`,
operation: ''
};
/** 加载列车数据*/
this.loadInitData(this.map);
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
},
trainNumberChange(groupNumber) {
const operate = {
type: MapDeviceType.Train.type,
val: `${groupNumber}`,
operation: ''
};
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
operate.operation = OperationEvent.Train.addTrainId.trainNumberChange.operation;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
operate.operation = OperationEvent.Train.editTrainId.trainNumberChange.operation;
}
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
operate.operation = OperationEvent.Train.addTrainId.trainNumberChange.operation;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
operate.operation = OperationEvent.Train.editTrainId.trainNumberChange.operation;
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
trainTypeChange(trainType) {
const operate = {
type: MapDeviceType.Train.type,
val: `${trainType}`,
operation: ''
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
trainTypeChange(trainType) {
const operate = {
type: MapDeviceType.Train.type,
val: `${trainType}`,
operation: ''
};
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
operate.operation = OperationEvent.Train.addTrainId.trainTypeChange.operation;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
operate.operation = OperationEvent.Train.editTrainId.trainTypeChange.operation;
}
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
operate.operation = OperationEvent.Train.addTrainId.trainTypeChange.operation;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
operate.operation = OperationEvent.Train.editTrainId.trainTypeChange.operation;
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
trainNoChange(tripNumber) {
const operate = {
send: true,
type: MapDeviceType.Train.type,
val: tripNumber,
operation: ''
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
trainNoChange(tripNumber) {
const operate = {
send: true,
type: MapDeviceType.Train.type,
val: tripNumber,
operation: ''
};
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
operate.operation = OperationEvent.Train.addTrainId.trainNoChange.operation;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
operate.operation = OperationEvent.Train.editTrainId.trainNoChange.operation;
}
OperateHandler.backStep(1);
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
if (valid) {
if (response.data) {
this.formModel = {
groupNumber: this.formModel.groupNumber,
tripNumber: tripNumber,
trainType: this.formModel.trainType,
serviceNumber: response.data.serviceNumber,
targetCode: response.data.targetCode,
category: 'MM'
};
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else {
this.formModel = {
groupNumber: this.formModel.groupNumber,
tripNumber: tripNumber,
trainType: this.formModel.trainType,
serviceNumber: '',
targetCode: '',
category: 'MM'
};
}
}
});
},
commit() {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 增加列车识别号*/
this.addTrainId();
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/
this.editTrainId();
}
},
//
addTrainId() {
this.$refs['form'].validate((valid) => {
if (valid) {
const model = this.formModel;
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.addTrainId.menu.operation,
messages: [this.$t('tip.addTrainIdTip')],
val: `${model.groupNumber}::${model.trainType}::${model.serviceNumber}::${model.tripNumber}::${model.targetCode}`
};
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
operate.operation = OperationEvent.Train.addTrainId.trainNoChange.operation;
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
operate.operation = OperationEvent.Train.editTrainId.trainNoChange.operation;
}
OperateHandler.backStep(1);
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
if (valid) {
if (response.data) {
this.formModel = {
groupNumber: this.formModel.groupNumber,
tripNumber: tripNumber,
trainType: this.formModel.trainType,
serviceNumber: response.data.serviceNumber,
targetCode: response.data.targetCode,
category: 'MM'
};
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else {
this.formModel = {
groupNumber: this.formModel.groupNumber,
tripNumber: tripNumber,
trainType: this.formModel.trainType,
serviceNumber: '',
targetCode: '',
category: 'MM'
};
}
}
});
},
commit() {
if (this.operation == OperationEvent.Train.addTrainId.menu.operation) {
/** 增加列车识别号*/
this.addTrainId();
} else if (this.operation == OperationEvent.Train.editTrainId.menu.operation) {
/** 修改列车识别号*/
this.editTrainId();
}
},
//
addTrainId() {
this.$refs['form'].validate((valid) => {
if (valid) {
const model = this.formModel;
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.addTrainId.menu.operation,
messages: [this.$t('tip.addTrainIdTip')],
val: `${model.groupNumber}::${model.trainType}::${model.serviceNumber}::${model.tripNumber}::${model.targetCode}`
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.confirmTrain.doShow(operate);
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
} else {
return false;
}
});
},
//
editTrainId() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.editTrainId.menu.operation,
messages: [this.$t('tip.editTrainIdTip')],
val: `${this.formModel.trainType}::${this.formModel.tripNumber}`
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.confirmTrain.doShow(operate);
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
} else {
return false;
}
});
},
//
editTrainId() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.editTrainId.menu.operation,
messages: [this.$t('tip.editTrainIdTip')],
val: `${this.formModel.trainType}::${this.formModel.tripNumber}`
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.confirmTrain.doShow(operate);
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
} else {
return false;
}
});
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.confirmTrain.doShow(operate);
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
} else {
return false;
}
});
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>

View File

@ -39,117 +39,116 @@
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
// import { getPublishTrainList } from '@/api/jmap/map';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default {
name: 'RouteCreate',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
trainList: [],
trainNoList: [],
directionList: [
{
value: '2',
label: this.$t('menu.up')
},
{
value: '1',
label: this.$t('menu.down')
}
],
trainCode: '',
tripNumber: '',
direction: '',
selected: null
};
},
computed: {
...mapGetters('map', [
'map'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return OperationEvent.Section.newtrain.menu.domId;
},
title() {
return this.$t('menu.settingTrain');
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
loadInitData(map) {
if (map.trainList.length) {
this.trainList = map.trainList;
} else {
this.$messageBox(this.$t('error.getTrainListFailed'));
}
},
doShow(operate, selected) {
this.dialogShow = true;
this.selected = selected;
console.log(this.map, 111);
/** 加载列车数据*/
this.loadInitData(this.map);
name: 'RouteCreate',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
trainList: [],
trainNoList: [],
directionList: [
{
value: '2',
label: this.$t('menu.up')
},
{
value: '1',
label: this.$t('menu.down')
}
],
trainCode: '',
tripNumber: '',
direction: '',
selected: null
};
},
computed: {
...mapGetters('map', [
'map'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return OperationEvent.Section.newtrain.menu.domId;
},
title() {
return this.$t('menu.settingTrain');
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
loadInitData(map) {
if (map.trainList.length) {
this.trainList = map.trainList;
} else {
this.$messageBox(this.$t('error.getTrainListFailed'));
}
},
doShow(operate, selected) {
this.dialogShow = true;
this.selected = selected;
console.log(this.map, 111);
/** 加载列车数据*/
this.loadInitData(this.map);
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.trainCode = '';
this.direction = '';
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
commit() {
const operate = {
send: true,
type: MapDeviceType.Section.type,
operation: OperationEvent.Section.newtrain.menu.operation,
val: '' + this.direction + '::' + this.trainCode
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
},
cancel() {
const operate = {
type: MapDeviceType.Section.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.trainCode = '';
this.direction = '';
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
commit() {
const operate = {
send: true,
type: MapDeviceType.Section.type,
operation: OperationEvent.Section.newtrain.menu.operation,
val: '' + this.direction + '::' + this.trainCode
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
},
cancel() {
const operate = {
type: MapDeviceType.Section.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>

View File

@ -78,118 +78,118 @@ import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
export default {
name: 'TrainSwitch',
components: {
},
data() {
return {
trainNoList: [],
addModel: {
trainNumberSource: '',
trainSource: '',
stationStandSource: '',
trainGoal: '',
stationStandGoal: '',
trainNumberGoal: ''
},
name: 'TrainSwitch',
components: {
},
data() {
return {
trainNoList: [],
addModel: {
trainNumberSource: '',
trainSource: '',
stationStandSource: '',
trainGoal: '',
stationStandGoal: '',
trainNumberGoal: ''
},
rules: {
trainNumberSource: [
{ required: true, message: this.$t('rules.selectGroupNumber'), trigger: 'blur' }
],
trainSource: [
{ required: true, message: this.$t('rules.enterTheTripNumber'), trigger: 'blur' }
],
stationStandSource: [
{ required: true, message: this.$t('rules.selectStation'), trigger: 'change' }
],
trainNumberGoal: [
{ required: true, message: this.$t('rules.selectGroupNumber'), trigger: 'blur' }
],
trainGoal: [
{ required: true, message: this.$t('rules.enterTheTripNumber'), trigger: 'blur' }
],
stationStandGoal: [
{ required: true, message: this.$t('rules.selectStation'), trigger: 'change' }
]
},
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.moveTrainId.menu.domId : '';
},
title() {
return this.$t('menu.menuTrain.moveTrainId');
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.moveTrainId.menu.operation
};
rules: {
trainNumberSource: [
{ required: true, message: this.$t('rules.selectGroupNumber'), trigger: 'blur' }
],
trainSource: [
{ required: true, message: this.$t('rules.enterTheTripNumber'), trigger: 'blur' }
],
stationStandSource: [
{ required: true, message: this.$t('rules.selectStation'), trigger: 'change' }
],
trainNumberGoal: [
{ required: true, message: this.$t('rules.selectGroupNumber'), trigger: 'blur' }
],
trainGoal: [
{ required: true, message: this.$t('rules.enterTheTripNumber'), trigger: 'blur' }
],
stationStandGoal: [
{ required: true, message: this.$t('rules.selectStation'), trigger: 'change' }
]
},
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.moveTrainId.menu.domId : '';
},
title() {
return this.$t('menu.menuTrain.switchTrainId');
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.moveTrainId.menu.operation
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
// this.$refs.noticeInfo.doShow(operate);
});
} else {
return false;
}
});
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
// this.$refs.noticeInfo.doShow(operate);
});
} else {
return false;
}
});
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => { this.doClose(); });
}
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => { this.doClose(); });
}
}
};
</script>
<style scoped>

View File

@ -19,127 +19,128 @@
<script>
import { runPlanTemplateList } from '@/api/runplan';
import { getStationListBySkinCode } from '@/api/runplan';
import { getStationList } from '@/api/runplan';
import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
import { getSkinCodeList } from '@/api/management/mapskin';
export default {
name: 'ReloadTodayPlan',
data() {
return {
dialogShow: false,
loading: false,
skinCodeList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
reset: true,
labelWidth: '120px',
queryObject: {
name: {
type: 'text',
label: this.$t('menu.runGraphName')
}
}
},
queryList: {
query: this.queryFunction,
selectCheckShow: false,
radioShow: true,
columns: [
{
title: this.$t('menu.runGraphName'),
prop: 'name'
},
{
title: this.$t('menu.skinType'),
prop: 'skinCode',
type: 'tag',
columnValue: (row) => {
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
},
tagType: (row) => { return 'success'; }
}
]
},
name: 'ReloadTodayPlan',
data() {
return {
dialogShow: false,
loading: false,
skinCodeList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
reset: true,
labelWidth: '120px',
queryObject: {
name: {
type: 'text',
label: this.$t('menu.runGraphName')
}
}
},
queryList: {
query: this.queryFunction,
selectCheckShow: false,
radioShow: true,
columns: [
{
title: this.$t('menu.runGraphName'),
prop: 'name'
},
{
title: this.$t('menu.skinType'),
prop: 'skinCode',
type: 'tag',
columnValue: (row) => {
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
},
tagType: (row) => { return 'success'; }
}
]
},
currentModel: {}
};
},
computed: {
title() {
return this.$t('menu.loadTheDayPlan');
}
},
methods: {
loadInitData() {
this.skinCodeList = [];
getSkinCodeList().then(response => {
this.skinCodeList = response.data;
});
},
doShow() {
this.loading = false;
this.dialogShow = true;
this.loadInitData();
},
doClose() {
this.dialogShow = false;
},
queryFunction(params) {
if (this.$store.state.map && this.$store.state.map.map) {
params['skinCode'] = this.$store.getters['map/skinCode'];
}
return runPlanTemplateList(params);
},
//
handleConfirm() {
if (this.$refs && this.$refs.pageRules) {
const choose = this.$refs.pageRules.currentChoose();
if (choose && choose.id) {
this.loading = true;
generateDayRunPlan(choose.id, this.$route.query.group).then(response => {
this.loading = false;
this.reloadTable();
this.loadRunData();
this.doClose();
this.$message.success(this.$t('tip.generateUserDailyRunGraphSuccessfully'));
}).catch(() => {
this.loading = false;
this.reloadTable();
this.$messageBox(this.$t('tip.generateUserDailyRunGraphFailed'));
});
} else {
this.$messageBox(this.$t('rules.selectTheRunningDiagramToBeLoaded'));
}
}
},
loadRunData() {
const skinCode = this.$route.query.skinCode;
this.$store.dispatch('runPlan/clear');
if (skinCode) {
getStationListBySkinCode(skinCode).then(response => {
const stations = response.data;
this.PlanConvert = this.$theme.loadPlanConvert(skinCode);
this.$store.dispatch('runPlan/setStations', stations).then(() => {
getEveryDayRunPlanData(this.$route.query.group).then(resp => {
this.$store.dispatch('runPlan/setPlanData', resp.data);
}).catch(() => {
this.$store.dispatch('runPlan/setPlanData', []);
this.$messageBox(this.$t('error.getRunGraphDataFailed'));
});
});
}).catch(() => {
this.$messageBox(this.$t('error.getStationListFail'));
});
}
},
reloadTable() {
this.queryList.reload();
}
}
currentModel: {}
};
},
computed: {
title() {
return this.$t('menu.loadTheDayPlan');
}
},
methods: {
loadInitData() {
this.skinCodeList = [];
getSkinCodeList().then(response => {
this.skinCodeList = response.data;
});
},
doShow() {
this.loading = false;
this.dialogShow = true;
this.loadInitData();
},
doClose() {
this.dialogShow = false;
},
queryFunction(params) {
if (this.$store.state.map && this.$store.state.map.map) {
params['skinCode'] = this.$store.getters['map/skinCode'];
}
return runPlanTemplateList(params);
},
//
handleConfirm() {
if (this.$refs && this.$refs.pageRules) {
const choose = this.$refs.pageRules.currentChoose();
if (choose && choose.id) {
this.loading = true;
generateDayRunPlan(choose.id, this.$route.query.group).then(response => {
this.loading = false;
this.reloadTable();
this.loadRunData();
this.doClose();
this.$message.success(this.$t('tip.generateUserDailyRunGraphSuccessfully'));
}).catch(() => {
this.loading = false;
this.reloadTable();
this.$messageBox(this.$t('tip.generateUserDailyRunGraphFailed'));
});
} else {
this.$messageBox(this.$t('rules.selectTheRunningDiagramToBeLoaded'));
}
}
},
loadRunData() {
const skinCode = this.$route.query.skinCode;
const mapId = this.$route.query.mapId;
this.$store.dispatch('runPlan/clear');
if (mapId) {
getStationList(mapId).then(response => {
const stations = response.data;
this.PlanConvert = this.$theme.loadPlanConvert(skinCode);
this.$store.dispatch('runPlan/setStations', stations).then(() => {
getEveryDayRunPlanData(this.$route.query.group).then(resp => {
this.$store.dispatch('runPlan/setPlanData', resp.data);
}).catch(() => {
this.$store.dispatch('runPlan/setPlanData', []);
this.$messageBox(this.$t('error.getRunGraphDataFailed'));
});
});
}).catch(() => {
this.$messageBox(this.$t('error.getStationListFail'));
});
}
},
reloadTable() {
this.queryList.reload();
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -41,7 +41,6 @@ import ScriptmanageHome from '@/views/scriptManage/home';
import ScriptDisplay from '@/views/scriptManage/display/index';
import TeachDetail from '@/views/teach/detail/index';
import TeachPractical from '@/views/teach/practical/index';
import TeachHome from '@/views/teach/index';
import Pay from '@/views/components/pay/index';
import ExamDetail from '@/views/exam/detail/examDetail';
@ -603,11 +602,6 @@ export const asyncRouter = [
component: ExamDetail,
hidden: true
},
{
path: 'practical/:trainingId/:lessonId',
component: TeachPractical,
hidden: true
},
{
path: 'pay/:lessonId',
component: Pay,

File diff suppressed because it is too large Load Diff

View File

@ -3,9 +3,9 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.41:9000'; // 王兴杰
} else {
BASE_API = process.env.VUE_APP_BASE_API;

View File

@ -1,66 +1,36 @@
import store from '@/store';
import { getPublishMapVersion, getPublishMapDetail, getPublishMapVersionById, getPublishMapDetailById} from '@/api/jmap/map';
import { getPublishMapVersionById, getPublishMapDetailById} from '@/api/jmap/map';
// 获取地图版本数据和store里面的map版本做比较如果不同
// 获取发布的地图数据
// 先设置地图数据
// 清除列车数据
export function loadMapData(skinCode) {
return new Promise((resolve, reject) => {
getPublishMapVersion(skinCode).then(resp => {
var version = resp.data;
var mapData = store.state.map.mapList[`mapDate_${skinCode}`];
if (mapData && mapData.version == version) {
store.dispatch('map/setMapData', mapData).then(() => {
store.dispatch('map/clearJlmapTrainView').then(() => {
resolve();
});
});
} else {
getPublishMapDetail(skinCode).then(res => {
mapData = res.data;
store.dispatch('map/setMapDataList', mapData);
store.dispatch('map/setMapData', mapData).then(() => {
store.dispatch('map/clearJlmapTrainView').then(() => {
resolve();
});
});
}).catch(error => {
reject(error);
});
}
}).catch(error => {
reject(error);
});
});
}
export function loadMapDataById(mapId) {
return new Promise((resolve, reject) => {
getPublishMapVersionById(mapId).then(resp => {
var version = resp.data;
var mapData = store.state.map.mapIdList[`mapDate_${mapId}`];
if (mapData && mapData.version == version) {
store.dispatch('map/setMapData', mapData).then(() => {
store.dispatch('map/clearJlmapTrainView').then(() => {
resolve();
});
});
} else {
getPublishMapDetailById(mapId).then(res => {
mapData = res.data;
store.dispatch('map/setMapDataIdList', {mapData, mapId});
store.dispatch('map/setMapData', mapData).then(() => {
store.dispatch('map/clearJlmapTrainView').then(() => {
resolve();
});
});
}).catch(error => {
reject(error);
});
}
}).catch(error => {
reject(error);
});
});
return new Promise((resolve, reject) => {
getPublishMapVersionById(mapId).then(resp => {
var version = resp.data;
var mapData = store.state.map.mapIdList[`mapDate_${mapId}`];
if (mapData && mapData.version == version) {
store.dispatch('map/setMapData', mapData).then(() => {
store.dispatch('map/clearJlmapTrainView').then(() => {
resolve();
});
});
} else {
getPublishMapDetailById(mapId).then(res => {
mapData = res.data;
store.dispatch('map/setMapDataIdList', {mapData, mapId});
store.dispatch('map/setMapData', mapData).then(() => {
store.dispatch('map/clearJlmapTrainView').then(() => {
resolve();
});
});
}).catch(error => {
reject(error);
});
}
}).catch(error => {
reject(error);
});
});
}

View File

@ -14,61 +14,61 @@ import { publisMapCityList} from '@/api/designPlatform';
import localStore from 'storejs';
export default {
name: 'FilterCity',
props: {
size: {
type: String,
default() {
return 'medium';
}
},
filterEmpty: {
type: Boolean,
default() {
return false;
}
},
queryFunction: {
type: Function,
required: true
},
localParamName: {
type: String,
required: true
}
},
data() {
return {
filterSelect: ['', ''],
filterOptions: []
};
},
created() {
this.loadInitData();
},
methods: {
async loadInitData() {
//
this.filterOptions=[];
name: 'FilterCity',
props: {
size: {
type: String,
default() {
return 'medium';
}
},
filterEmpty: {
type: Boolean,
default() {
return false;
}
},
queryFunction: {
type: Function,
required: true
},
localParamName: {
type: String,
required: true
}
},
data() {
return {
filterSelect: ['', ''],
filterOptions: []
};
},
created() {
this.loadInitData();
},
methods: {
async loadInitData() {
//
this.filterOptions = [];
let resp = this.$route.fullPath.includes('design/userlist')?await this.$Dictionary.cityType():await publisMapCityList('city_type');
resp=this.$route.fullPath.includes('design/userlist')?resp:resp.data;
const cityList = resp.sort((a, b) => {
return a.code.localeCompare(b.code);
});
let resp = this.$route.fullPath.includes('design/userlist') ? await this.$Dictionary.cityType() : await publisMapCityList('city_type');
resp = this.$route.fullPath.includes('design/userlist') ? resp : resp.data;
const cityList = resp.sort((a, b) => {
return a.code.localeCompare(b.code);
});
this.filterOptions=cityList;
this.filterSelect = localStore.get(this.localParamName) || cityList[0].code;
this.filterOptions = cityList;
this.filterSelect = localStore.get(this.localParamName) || cityList[0].code;
this.$emit('filterSelectChange', this.filterSelect);
},
filterSelectChange(filterSelect) {
//
// localStore.set('_cityCode', filterSelect);
localStore.set(this.localParamName, filterSelect);
this.$emit('filterSelectChange', filterSelect);
}
}
this.$emit('filterSelectChange', this.filterSelect);
},
filterSelectChange(filterSelect) {
//
// localStore.set('_cityCode', filterSelect);
localStore.set(this.localParamName, filterSelect);
this.$emit('filterSelectChange', filterSelect);
}
}
};
</script>

View File

@ -19,43 +19,43 @@ import Digit from './digit';
import Separator from './separator';
export default {
name: 'SystenTime',
components: {
Digit,
Separator
},
props: {
background: {
type: String,
default() {
return '#000';
}
},
color: {
type: String,
default() {
return '#00FF00';
}
},
time: {
type: String,
default() {
return '12:3456';
}
},
zoom: {
type: Number,
default() {
return 4;
}
},
fine: {
type: Number,
default() {
return 2;
}
}
}
name: 'SystenTime',
components: {
Digit,
Separator
},
props: {
background: {
type: String,
default() {
return '#000';
}
},
color: {
type: String,
default() {
return '#00FF00';
}
},
time: {
type: String,
default() {
return '12:3456';
}
},
zoom: {
type: Number,
default() {
return 4;
}
},
fine: {
type: Number,
default() {
return 2;
}
}
}
};
</script>
@ -63,5 +63,6 @@ export default {
.system-time-box {
display: inline-block;
text-align: center;
background: #000;
}
</style>

View File

@ -21,7 +21,7 @@
<span
class="el-icon-tickets"
:style="{color: data.valid ? 'green':''}"
></span>
/>
<span :style="{color: data.valid ? 'green':''}">&nbsp;{{ tnode.label }}</span>
</span>
</el-tree>
@ -35,94 +35,94 @@ import { getSessionStorage, setSessionStorage, removeSessionStorage } from '@/ut
import FilterCity from '@/views/components/filterCity';
export default {
name: 'ExamDetailList',
components: {
FilterCity
},
props: {
height: {
type: Number,
required: true
}
},
data() {
return {
loading: true,
defaultShowKeys: [],
queryFunction: getPublishMapTree,
filterText: '',
treeData: [],
treeList: [],
selected: {},
defaultProps: {
children: 'children',
label: 'name'
},
node: {
}
};
},
computed: {
role() {
return this.$store.state.user.roles.includes('04') ||
name: 'ExamDetailList',
components: {
FilterCity
},
props: {
height: {
type: Number,
required: true
}
},
data() {
return {
loading: true,
defaultShowKeys: [],
queryFunction: getPublishMapTree,
filterText: '',
treeData: [],
treeList: [],
selected: {},
defaultProps: {
children: 'children',
label: 'name'
},
node: {
}
};
},
computed: {
role() {
return this.$store.state.user.roles.includes('04') ||
this.$store.state.user.roles.includes('05') ||
this.$store.state.user.roles.includes('01');
}
},
watch: {
filterText(val) {
this.treeList = this.treeData.filter((res) => {
return res.name.includes(val);
});
}
},
beforeDestroy () {
removeSessionStorage('demonList');
},
methods: {
filterNode(value, data) {
if (!value) return true;
return data.name.indexOf(value) !== -1;
},
showContextMenu(e, obj, node, vueElem) {
if (obj) {
this.node = node;
this.selected = obj;
}
},
clickEvent(obj, data, ele) {
if (obj.type == 'Map') {
setSessionStorage('demonList', obj.id);
this.$router.push({ path: `${UrlConfig.demonstration.detail}/${obj.id}` });
}
},
async refresh(filterSelect) {
this.loading = true;
this.treeData = this.treeList = [];
try {
const res = await getPublishMapTree(filterSelect);
this.treeData = res.data;
this.treeList = this.filterText
? res.data.filter(elem => { return elem.name.includes(this.filterText); })
: res.data;
}
},
watch: {
filterText(val) {
this.treeList = this.treeData.filter((res) => {
return res.name.includes(val);
});
}
},
beforeDestroy () {
removeSessionStorage('demonList');
},
methods: {
filterNode(value, data) {
if (!value) return true;
return data.name.indexOf(value) !== -1;
},
showContextMenu(e, obj, node, vueElem) {
if (obj) {
this.node = node;
this.selected = obj;
}
},
clickEvent(obj, data, ele) {
if (obj.type == 'Map') {
setSessionStorage('demonList', obj.id);
this.$router.push({ path: `${UrlConfig.demonstration.detail}/${obj.id}` });
}
},
async refresh(filterSelect) {
this.loading = true;
this.treeData = this.treeList = [];
try {
const res = await getPublishMapTree(filterSelect);
this.treeData = res.data;
this.treeList = this.filterText
? res.data.filter(elem => { return elem.name.includes(this.filterText); })
: res.data;
if (this.treeData.length > 0) {
this.treeData.forEach(v => {
v.children = [];
});
if (this.treeData.length > 0) {
this.treeData.forEach(v => {
v.children = [];
});
}
this.$nextTick(() => {
const mapId = getSessionStorage('demonList') || null;
this.$refs.tree.setCurrentKey(mapId);
this.loading = false;
});
} catch (error) {
this.loading = false;
this.$messageBox(this.$t('error.refreshFailed'));
}
}
}
}
this.$nextTick(() => {
const mapId = getSessionStorage('demonList') || null;
this.$refs.tree.setCurrentKey(mapId);
this.loading = false;
});
} catch (error) {
this.loading = false;
this.$messageBox(this.$t('error.refreshFailed'));
}
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -79,10 +79,9 @@ import { getProductDetail } from '@/api/management/mapprd';
import { runDiagramQuit, getSimulationInfo } from '@/api/simulation';
import { OperateMode, TrainingMode } from '@/scripts/ConstDic';
import { checkLoginLine } from '@/api/login';
import { loadMapData, loadMapDataById } from '@/utils/loaddata';
import { loadMapDataById } from '@/utils/loaddata';
import { EventBus } from '@/scripts/event-bus';
import Vue from 'vue';
// import { UrlConfig } from '@/router/index';
import {loadDraftScript} from '@/api/designPlatform';
//
@ -401,7 +400,7 @@ export default {
if (rest && rest.code == 200) {
const data = rest.data;
await this.$store.dispatch('training/setPrdType', data.prdType);
await this.loadMapData(detail.skinCode);
await this.loadMapDataById(this.mapId);
}
} else {
this.$messageBox(`获取实训步骤数据失败`);
@ -417,9 +416,8 @@ export default {
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
this.$store.dispatch('training/setPrdType', '');
if (parseInt(this.skinCode)) {
await this.loadMapData(this.skinCode);
if (parseInt(this.mapId)) {
await this.loadMapDataById(this.mapId);
} else {
this.endViewLoading();
}
@ -430,9 +428,8 @@ export default {
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
this.$store.dispatch('training/setPrdType', this.prdTypeMap[this.prdType]);
if (parseInt(this.skinCode)) {
await this.loadMapData(this.skinCode);
if (parseInt(this.mapId)) {
await this.loadMapDataById(this.mapId);
} else {
this.endViewLoading();
}
@ -443,9 +440,8 @@ export default {
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
this.$store.dispatch('training/setPrdType', '01');
if (parseInt(this.skinCode)) {
await this.loadMapData(this.skinCode);
if (parseInt(this.mapId)) {
await this.loadMapDataById(this.mapId);
} else {
this.endViewLoading();
}
@ -468,9 +464,8 @@ export default {
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
this.$store.dispatch('training/setPrdType', '01');
if (parseInt(this.skinCode)) {
await this.loadMapData(this.skinCode);
if (parseInt(this.mapId)) {
await this.loadMapDataById(this.mapId);
} else {
this.endViewLoading();
}
@ -535,16 +530,6 @@ export default {
async quitQuest() {
this.questId = 0;
},
//
async loadMapData(skinCode) {
try {
await loadMapData(skinCode);
await this.$store.dispatch('training/setMapDefaultState');
} catch (error) {
this.$messageBox(`获取地图数据失败: ${error.message}`);
this.endViewLoading();
}
},
// id
async loadMapDataById(mapId) {

File diff suppressed because it is too large Load Diff

View File

@ -27,132 +27,132 @@ import { launchFullscreen } from '@/utils/screen';
import { UrlConfig } from '@/router/index';
export default {
name: 'MenuExam',
components: {
TipExamList
},
props: {
group: {
type: String,
required: true
},
offset: {
type: Number,
required: true
}
},
data() {
return {
isDisable: false,
startLoading: false,
training: {
id: '',
name: '',
remarks: ''
}
};
},
computed: {
formatUsedTime() {
return timeFormat(this.$store.state.training.usedTime);
}
},
watch: {
'$store.state.map.mapViewLoadedCount': function() {
this.$store.dispatch('exam/countUsedTime');
}
},
methods: {
tipInfo(opt) {
if (opt && opt.hasOwnProperty('color') && opt.hasOwnProperty('message')) {
const h = this.$createElement;
this.$notify({
title: this.$t('global.tips'),
message: h('i', { style: 'color:' + opt.color }, this.$t('display.exam.startTestOperateTip'))
});
}
},
start() {
this.$store.dispatch('menuOperation/setButtonOperation', null);
this.startLoading = true;
if (this.$route.query.trainingId) {
this.isDisable = true;
startTraining({ id: this.$route.query.trainingId }, this.group).then(response => {
this.$store.dispatch('training/examModeStart');
this.$store.dispatch('map/clearJlmapTrainView').then(() => {
this.$store.dispatch('training/setMapDefaultState').then(() => {
this.$store.dispatch('training/emitTipFresh');
});
});
this.startLoading = false;
}).catch(() => {
this.isDisable = false;
this.startLoading = false;
});
} else {
this.startLoading = true;
this.$messageBox(this.$t('display.exam.selectTest'));
}
},
end() {
if (this.$route.query.trainingId) {
this.isDisable = false;
if (this.$store.state.training.started) {
const model = {
id: this.$route.query.examQuestionId,
usedTime: this.$store.state.training.usedTime,
group: this.group
};
name: 'MenuExam',
components: {
TipExamList
},
props: {
group: {
type: String,
required: true
},
offset: {
type: Number,
required: true
}
},
data() {
return {
isDisable: false,
startLoading: false,
training: {
id: '',
name: '',
remarks: ''
}
};
},
computed: {
formatUsedTime() {
return timeFormat(this.$store.state.training.usedTime);
}
},
watch: {
'$store.state.map.mapViewLoadedCount': function() {
this.$store.dispatch('exam/countUsedTime');
}
},
methods: {
tipInfo(opt) {
if (opt && opt.hasOwnProperty('color') && opt.hasOwnProperty('message')) {
const h = this.$createElement;
this.$notify({
title: this.$t('global.tips'),
message: h('i', { style: 'color:' + opt.color }, this.$t('display.exam.startTestOperateTip'))
});
}
},
start() {
this.$store.dispatch('menuOperation/setButtonOperation', null);
this.startLoading = true;
if (this.$route.query.trainingId) {
this.isDisable = true;
startTraining({ id: this.$route.query.trainingId }, this.group).then(response => {
this.$store.dispatch('training/examModeStart');
this.$store.dispatch('map/clearJlmapTrainView').then(() => {
this.$store.dispatch('training/setMapDefaultState').then(() => {
this.$store.dispatch('training/emitTipFresh');
});
});
this.startLoading = false;
}).catch(() => {
this.isDisable = false;
this.startLoading = false;
});
} else {
this.startLoading = true;
this.$messageBox(this.$t('display.exam.selectTest'));
}
},
end() {
if (this.$route.query.trainingId) {
this.isDisable = false;
if (this.$store.state.training.started) {
const model = {
id: this.$route.query.examQuestionId,
usedTime: this.$store.state.training.usedTime,
group: this.group
};
this.$store.dispatch('training/end', null);
finishOneExamQuestion(model).then(response => {
this.$store.dispatch('training/emitTipFresh');
this.init();
}).catch(() => {
this.$store.dispatch('training/emitTipFresh');
this.$messageBox(this.$t('display.exam.endTrainingError'));
});
} else {
this.isDisable = true;
this.$messageBox(this.$t('display.exam.startTestTip'));
}
}
},
back() {
this.$confirm(this.$t('display.exam.endTestTip'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
this.$emit('quit');
this.$router.push({ path: `${UrlConfig.trainingPlatform.examDetail}/${this.$route.query.examId}`, query: { subSystem: this.$route.query.subSystem }});
Notification.closeAll();
exitFullscreen();
}).catch(() => {
this.$store.dispatch('training/end', null);
finishOneExamQuestion(model).then(response => {
this.$store.dispatch('training/emitTipFresh');
this.init();
}).catch(() => {
this.$store.dispatch('training/emitTipFresh');
this.$messageBox(this.$t('display.exam.endTrainingError'));
});
} else {
this.isDisable = true;
this.$messageBox(this.$t('display.exam.startTestTip'));
}
}
},
back() {
this.$confirm(this.$t('display.exam.endTestTip'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
this.$emit('quit');
this.$router.push({ path: `${UrlConfig.trainingPlatform.examDetail}/${this.$route.query.examId}`, query: { subSystem: this.$route.query.subSystem, mapId: this.$route.query.mapId }});
Notification.closeAll();
exitFullscreen();
}).catch(() => {
});
},
init() {
launchFullscreen();
//
refreshExamList(this.$route.query.userExamId).then(response => {
this.$store.dispatch('exam/setUsedTime', response.data.usedTime);
this.$store.dispatch('exam/setTotalTime', response.data.duration);
this.$store.dispatch('trainingList/setTrainingList', response.data.userExamQuestionsVOs).then(response => { });
}).catch(error => {
// 50009y
if (error.code === 500009) {
this.$router.replace({ path: `/trainingPlatform/result/${this.$route.params.userExamId}`, query: {subSystem: this.$route.query.subSystem} });
} else {
this.$messageBox(this.$t('display.exam.refreshListError'));
}
});
},
refresh() {
this.isDisable = false;
this.$store.dispatch('training/end', null);
}
}
});
},
init() {
launchFullscreen();
//
refreshExamList(this.$route.query.userExamId).then(response => {
this.$store.dispatch('exam/setUsedTime', response.data.usedTime);
this.$store.dispatch('exam/setTotalTime', response.data.duration);
this.$store.dispatch('trainingList/setTrainingList', response.data.userExamQuestionsVOs).then(response => { });
}).catch(error => {
// 50009y
if (error.code === 500009) {
this.$router.replace({ path: `/trainingPlatform/result/${this.$route.params.userExamId}`, query: {subSystem: this.$route.query.subSystem} });
} else {
this.$messageBox(this.$t('display.exam.refreshListError'));
}
});
},
refresh() {
this.isDisable = false;
this.$store.dispatch('training/end', null);
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -5,164 +5,164 @@
</el-select>
<el-button-group>
<!-- viewRunQuest -->
<el-button v-if="isDemon && isDesignPlatform" size="small" :disabled="viewDisabled" type="success" @click="viewScriptRoles">{{$t('display.schema.selectRoles')}}</el-button>
<el-button v-if="isDemon && !isDesignPlatform" size="small" :disabled="viewDisabled" type="success" @click="viewRunQuest">{{$t('display.schema.loadScript')}}</el-button>
<el-button v-if="notScript && runing" size="small" :disabled="viewDisabled" @click="viewRunPlan">{{$t('display.schema.previewRunDiagram')}}</el-button>
<el-button v-if="!runing && !isPlan && notScript" size="small" :disabled="viewDisabled" type="warning" @click="loadRunPlan">{{$t('display.schema.loadRunDiagram')}}</el-button>
<el-button v-if="mode==OperateMode.FAULT" size="small" type="danger" @click="setFault">{{$t('display.schema.faultSetting')}}</el-button>
<!-- viewRunQuest -->
<el-button v-if="isDemon && isDesignPlatform" size="small" :disabled="viewDisabled" type="success" @click="viewScriptRoles">{{ $t('display.schema.selectRoles') }}</el-button>
<el-button v-if="isDemon && !isDesignPlatform" size="small" :disabled="viewDisabled" type="success" @click="viewRunQuest">{{ $t('display.schema.loadScript') }}</el-button>
<el-button v-if="notScript && runing" size="small" :disabled="viewDisabled" @click="viewRunPlan">{{ $t('display.schema.previewRunDiagram') }}</el-button>
<el-button v-if="!runing && !isPlan && notScript" size="small" :disabled="viewDisabled" type="warning" @click="loadRunPlan">{{ $t('display.schema.loadRunDiagram') }}</el-button>
<el-button v-if="mode==OperateMode.FAULT" size="small" type="danger" @click="setFault">{{ $t('display.schema.faultSetting') }}</el-button>
</el-button-group>
<el-radio-group v-if="!isPlan" v-model="mode" size="small" @change="changeOperateMode(mode)">
<el-radio-button class="mode" :label="OperateMode.NORMAL">{{$t('display.schema.normalOperation')}}</el-radio-button>
<el-radio-button class="mode" :label="OperateMode.FAULT">{{$t('display.schema.faultOperation')}}</el-radio-button>
<el-radio-button class="mode" :label="OperateMode.NORMAL">{{ $t('display.schema.normalOperation') }}</el-radio-button>
<el-radio-button class="mode" :label="OperateMode.FAULT">{{ $t('display.schema.faultOperation') }}</el-radio-button>
</el-radio-group>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic';
import { getStationListBySkinCode, queryRunPlan } from '@/api/runplan';
import { getStationList, queryRunPlan } from '@/api/runplan';
import { getEveryDayRunPlanData } from '@/api/simulation';
import {getRpDetailByUserMapId} from '@/api/designPlatform';
export default {
name: 'MenuSchema',
props: {
group: {
type: String,
required: true
},
offset: {
type: Number,
required: true
}
},
data() {
return {
mode: OperateMode.NORMAL,
OperateMode: OperateMode,
viewDisabled: true,
runing: false,
swch: '02',
swchList: [
{ value: '01', name: '现地' },
{ value: '02', name: '行调' }
]
};
},
computed: {
...mapGetters('runPlan', [
'stations'
]),
notScript() {
return this.$route.params.mode !== 'script';
},
isPlan() {
return this.$route.params.mode === 'plan';
},
isScript() {
// return this.$route.params.mode === 'script';
return false;
},
isDemon() {
return this.$route.params.mode === 'demon';
},
isDesignPlatform(){
return this.$route.fullPath.includes('design/display/demon');
}
},
watch: {
'$store.state.training.started': function (val) {
this.setRuning(val);
},
'$store.state.training.switchcount': async function () {
if (this.group) {
const started = this.$store.state.training.started;
if (started) {
await this.loadRunData(this.$route.query);
}
}
}
},
async mounted() {
await this.loadRunData(this.$route.query);
},
methods: {
loadRunData(opt) {
this.$store.dispatch('runPlan/clear').then(() => {
if (opt && opt.skinCode) {
this.viewDisabled = true;
getStationListBySkinCode(opt.skinCode).then(response => {
this.$store.dispatch('runPlan/setStations', response.data).then(() => {
if (this.$route.params.mode == 'plan') {
// debugger;
if(this.$route.query.from=="user"){
//
getRpDetailByUserMapId(this.$route.query.planId).then(resp => {
this.$store.dispatch('runPlan/setPlanData', resp.data);
this.viewDisabled = false;
}).catch(() => {
this.$store.dispatch('runPlan/setPlanData', []);
this.$messageBox(this.$t('display.schema.getRunDiagramFail'));
});
}else{
//
queryRunPlan(this.$route.query.planId).then(resp => {
this.$store.dispatch('runPlan/setPlanData', resp.data);
this.viewDisabled = false;
}).catch(() => {
this.$store.dispatch('runPlan/setPlanData', []);
this.$messageBox(this.$t('display.schema.getRunDiagramFail'));
});
}
name: 'MenuSchema',
props: {
group: {
type: String,
required: true
},
offset: {
type: Number,
required: true
}
},
data() {
return {
mode: OperateMode.NORMAL,
OperateMode: OperateMode,
viewDisabled: true,
runing: false,
swch: '02',
swchList: [
{ value: '01', name: '现地' },
{ value: '02', name: '行调' }
]
};
},
computed: {
...mapGetters('runPlan', [
'stations'
]),
notScript() {
return this.$route.params.mode !== 'script';
},
isPlan() {
return this.$route.params.mode === 'plan';
},
isScript() {
// return this.$route.params.mode === 'script';
return false;
},
isDemon() {
return this.$route.params.mode === 'demon';
},
isDesignPlatform() {
return this.$route.fullPath.includes('design/display/demon');
}
},
watch: {
'$store.state.training.started': function (val) {
this.setRuning(val);
},
'$store.state.training.switchcount': async function () {
if (this.group) {
const started = this.$store.state.training.started;
if (started) {
await this.loadRunData(this.$route.query);
}
}
}
},
async mounted() {
console.log(this.$route.query, '=====');
await this.loadRunData(this.$route.query);
},
methods: {
loadRunData(opt) {
this.$store.dispatch('runPlan/clear').then(() => {
if (opt && opt.mapId) {
this.viewDisabled = true;
getStationList(opt.mapId).then(response => {
this.$store.dispatch('runPlan/setStations', response.data).then(() => {
if (this.$route.params.mode == 'plan') {
// debugger;
if (this.$route.query.from == 'user') {
//
getRpDetailByUserMapId(this.$route.query.planId).then(resp => {
this.$store.dispatch('runPlan/setPlanData', resp.data);
this.viewDisabled = false;
}).catch(() => {
this.$store.dispatch('runPlan/setPlanData', []);
this.$messageBox(this.$t('display.schema.getRunDiagramFail'));
});
} else {
//
queryRunPlan(this.$route.query.planId).then(resp => {
this.$store.dispatch('runPlan/setPlanData', resp.data);
this.viewDisabled = false;
}).catch(() => {
this.$store.dispatch('runPlan/setPlanData', []);
this.$messageBox(this.$t('display.schema.getRunDiagramFail'));
});
}
} else {
getEveryDayRunPlanData(this.group).then(resp => {
this.$store.dispatch('runPlan/setPlanData', resp.data);
this.viewDisabled = false;
}).catch(error => {
this.$store.dispatch('runPlan/setPlanData', []);
if (error.code == 30001) {
this.$messageBox(this.$t('display.schema.todayRunDiagramNoLoad'));
} else {
this.$messageBox(this.$t('display.schema.getRunDiagramFail'));
}
});
}
});
}).catch(() => {
this.$messageBox(this.$t('display.schema.getStationListFail'));
});
}
});
},
changeOperateMode(handle) {
this.$store.dispatch('training/changeOperateMode', { mode: handle });
},
setRuning(run) {
this.runing = run;
},
setFault() {
this.$emit('faultChooseShow');
},
loadRunPlan() {
this.$emit('runPlanLoadShow');
},
viewRunPlan() {
this.$emit('runPlanViewShow');
},
viewRunQuest() {
this.$emit('runQuestLoadShow');
},
viewScriptRoles(){
this.$emit('runAddRolesLoadShow');
},
switchMode(swch) {
this.$emit('switchMode', swch);
}
}
} else {
getEveryDayRunPlanData(this.group).then(resp => {
this.$store.dispatch('runPlan/setPlanData', resp.data);
this.viewDisabled = false;
}).catch(error => {
this.$store.dispatch('runPlan/setPlanData', []);
if (error.code == 30001) {
this.$messageBox(this.$t('display.schema.todayRunDiagramNoLoad'));
} else {
this.$messageBox(this.$t('display.schema.getRunDiagramFail'));
}
});
}
});
}).catch(() => {
this.$messageBox(this.$t('display.schema.getStationListFail'));
});
}
});
},
changeOperateMode(handle) {
this.$store.dispatch('training/changeOperateMode', { mode: handle });
},
setRuning(run) {
this.runing = run;
},
setFault() {
this.$emit('faultChooseShow');
},
loadRunPlan() {
this.$emit('runPlanLoadShow');
},
viewRunPlan() {
this.$emit('runPlanViewShow');
},
viewRunQuest() {
this.$emit('runQuestLoadShow');
},
viewScriptRoles() {
this.$emit('runAddRolesLoadShow');
},
switchMode(swch) {
this.$emit('switchMode', swch);
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -83,202 +83,203 @@ import { getTrainingDetail } from '@/api/jmap/training';
import { launchFullscreen, exitFullscreen } from '@/utils/screen';
export default {
name: 'TipExamList',
components: {
},
data() {
return {
training: {
id: '',
name: '',
remarks: ''
},
isShrink: false,
examName: '',
courseModel: {
id: '',
name: '',
maxDuration: '',
minDuration: '',
remarks: '',
updateTime: ''
},
detailShow: false,
examIndex: 0
};
},
computed: {
...mapGetters('trainingList', [
'trainingList'
]),
remainTime() {
return this.$store.state.exam.totalTime - this.$store.state.exam.usedTime;
},
formatRemainTime() {
if (this.remainTime < 0) {
this.$message.success(this.$t('display.exam.autoSubmit'));
this.submit();
}
name: 'TipExamList',
components: {
},
data() {
return {
training: {
id: '',
name: '',
remarks: ''
},
isShrink: false,
examName: '',
courseModel: {
id: '',
name: '',
maxDuration: '',
minDuration: '',
remarks: '',
updateTime: ''
},
detailShow: false,
examIndex: 0
};
},
computed: {
...mapGetters('trainingList', [
'trainingList'
]),
remainTime() {
return this.$store.state.exam.totalTime - this.$store.state.exam.usedTime;
},
formatRemainTime() {
if (this.remainTime < 0) {
this.$message.success(this.$t('display.exam.autoSubmit'));
this.submit();
}
return timeFormat(this.remainTime);
},
isFirst() {
return this.examIndex == 0;
},
isLast() {
return this.examIndex == this.trainingList.length - 1;
}
},
mounted() {
this.loadInitData();
},
methods: {
backList() {
this.detailShow = true;
this.$nextTick(() => {
this.$refs.treeQuestion.setCurrentKey(this.$route.query.examQuestionId); // value node-key
});
},
//
selectedTraining(obj) {
this.trainingList.forEach((item, index) => {
if (item.id == obj.id) {
this.examIndex = index;
return;
}
});
if (obj) {
getTrainingDetail(obj.trainingId ).then(res => {
this.courseModel = {
id: res.data.id,
name: res.data.name,
maxDuration: res.data.maxDuration,
remarks: res.data.remarks,
minDuration: res.data.minDuration,
updateTime: res.data.updateTime
};
}).catch(error => {
this.$message.error(this.$t('display.exam.getTestInformation')+':' + error.message);
});
}
return timeFormat(this.remainTime);
},
isFirst() {
return this.examIndex == 0;
},
isLast() {
return this.examIndex == this.trainingList.length - 1;
}
},
mounted() {
this.loadInitData();
},
methods: {
backList() {
this.detailShow = true;
this.$nextTick(() => {
this.$refs.treeQuestion.setCurrentKey(this.$route.query.examQuestionId); // value node-key
});
},
//
selectedTraining(obj) {
this.trainingList.forEach((item, index) => {
if (item.id == obj.id) {
this.examIndex = index;
return;
}
});
if (obj) {
getTrainingDetail(obj.trainingId ).then(res => {
this.courseModel = {
id: res.data.id,
name: res.data.name,
maxDuration: res.data.maxDuration,
remarks: res.data.remarks,
minDuration: res.data.minDuration,
updateTime: res.data.updateTime
};
}).catch(error => {
this.$message.error(this.$t('display.exam.getTestInformation') + ':' + error.message);
});
}
this.jump(obj);
},
getTrainDetail(obj) {
this.selectedTraining(obj);
this.detailShow = false;
},
//
loadInitData() {
//
refreshExamList(this.$route.query.userExamId).then(response => {
this.examName = response.data.examName;
this.$store.dispatch('exam/setUsedTime', response.data.usedTime);
this.$store.dispatch('exam/setTotalTime', response.data.duration);
this.$store.dispatch('trainingList/setTrainingList', response.data.userExamQuestionsVOs).then(response => { });
const obj = {
trainingId: '',
id: ''
};
if (this.$route.query.examQuestionId && this.$route.query.trainingId) {
obj.trainingId = this.$route.query.trainingId;
obj.id = this.$route.query.examQuestionId;
} else {
obj.trainingId = response.data.userExamQuestionsVOs[0].trainingId;
obj.id = response.data.userExamQuestionsVOs[0].id;
}
this.selectedTraining(obj);
}).catch(error => {
// 50009y
if (error.code === 500009) {
this.$router.replace({ path: `/trainingPlatform/result/${this.$route.params.userExamId}`, query: { subSystem: this.$route.query.subSystem } });
} else {
this.$messageBox(this.$t('display.exam.refreshListError'));
this.jump(obj);
},
getTrainDetail(obj) {
this.selectedTraining(obj);
this.detailShow = false;
},
//
loadInitData() {
//
refreshExamList(this.$route.query.userExamId).then(response => {
this.examName = response.data.examName;
this.$store.dispatch('exam/setUsedTime', response.data.usedTime);
this.$store.dispatch('exam/setTotalTime', response.data.duration);
this.$store.dispatch('trainingList/setTrainingList', response.data.userExamQuestionsVOs).then(response => { });
const obj = {
trainingId: '',
id: ''
};
if (this.$route.query.examQuestionId && this.$route.query.trainingId) {
obj.trainingId = this.$route.query.trainingId;
obj.id = this.$route.query.examQuestionId;
} else {
obj.trainingId = response.data.userExamQuestionsVOs[0].trainingId;
obj.id = response.data.userExamQuestionsVOs[0].id;
}
this.selectedTraining(obj);
}).catch(error => {
// 50009y
if (error.code === 500009) {
this.$router.replace({ path: `/trainingPlatform/result/${this.$route.params.userExamId}`, query: { subSystem: this.$route.query.subSystem } });
} else {
this.$messageBox(this.$t('display.exam.refreshListError'));
}
});
}
});
this.shrink();
},
nextExam() {
const obj = {
trainingId: '',
id: ''
};
if (this.trainingList[this.examIndex + 1] && this.trainingList[this.examIndex + 1].trainingId) {
obj.trainingId = this.trainingList[this.examIndex + 1].trainingId;
obj.id = this.trainingList[this.examIndex + 1].id;
this.examIndex = this.examIndex + 1;
}
if (obj.trainingId && obj.id) {
this.selectedTraining(obj);
}
},
lastExam() {
const obj = {
trainingId: '',
id: ''
};
if (this.trainingList[this.examIndex - 1] && this.trainingList[this.examIndex - 1].trainingId) {
obj.trainingId = this.trainingList[this.examIndex - 1].trainingId;
obj.id = this.trainingList[this.examIndex - 1].id;
this.examIndex = this.examIndex - 1;
}
if (obj.trainingId && obj.id) {
this.selectedTraining(obj);
}
},
jump(obj) {
const query = {
group: this.$route.query.group,
userExamId: this.$route.query.userExamId,
trainingId: obj.trainingId,
examQuestionId: obj.id,
subSystem: this.$route.query.subSystem,
examId: this.$route.query.examId
};
this.$router.push({ path: '/display/exam', query: query });
this.$emit('refresh');
launchFullscreen();
},
overExam() {
this.$store.dispatch('exam/isOver').then(isOver => {
if (isOver) {
this.submit();
} else {
this.$confirm(this.$t('display.exam.cancleExam'), this.$t('global.tips'), {
cancelButtonText: this.$t('global.cancel'),
confirmButtonText: this.$t('global.confirm'),
type: 'warning',
center: true
}).then(() => {
this.submit();
}).catch(() => {
});
}
});
},
submit() {
exitFullscreen();
this.$store.dispatch('exam/over').then(() => {
this.$store.dispatch('trainingList/clearTrainingList');
this.$router.replace({ path: `/trainingPlatform/result/${this.$route.query.userExamId}`, query: {subSystem: this.$route.query.subSystem} });
});
},
shrink() {
const height = this.$refs.dragBody.offsetHeight + 40;
const top = this.$refs.drapBox.style.top;
if (this.isShrink) {
this.$refs.drapBox.style.height = '40px';
this.$refs.drapBox.style.top = '';
this.isShrink = false;
} else {
this.$refs.drapBox.style.height = height + 'px';
this.$refs.drapBox.style.top = top;
this.isShrink = true;
}
}
}
this.shrink();
},
nextExam() {
const obj = {
trainingId: '',
id: ''
};
if (this.trainingList[this.examIndex + 1] && this.trainingList[this.examIndex + 1].trainingId) {
obj.trainingId = this.trainingList[this.examIndex + 1].trainingId;
obj.id = this.trainingList[this.examIndex + 1].id;
this.examIndex = this.examIndex + 1;
}
if (obj.trainingId && obj.id) {
this.selectedTraining(obj);
}
},
lastExam() {
const obj = {
trainingId: '',
id: ''
};
if (this.trainingList[this.examIndex - 1] && this.trainingList[this.examIndex - 1].trainingId) {
obj.trainingId = this.trainingList[this.examIndex - 1].trainingId;
obj.id = this.trainingList[this.examIndex - 1].id;
this.examIndex = this.examIndex - 1;
}
if (obj.trainingId && obj.id) {
this.selectedTraining(obj);
}
},
jump(obj) {
const query = {
group: this.$route.query.group,
userExamId: this.$route.query.userExamId,
trainingId: obj.trainingId,
examQuestionId: obj.id,
subSystem: this.$route.query.subSystem,
examId: this.$route.query.examId,
mapId: this.$route.query.mapId
};
this.$router.push({ path: '/display/exam', query: query });
this.$emit('refresh');
launchFullscreen();
},
overExam() {
this.$store.dispatch('exam/isOver').then(isOver => {
if (isOver) {
this.submit();
} else {
this.$confirm(this.$t('display.exam.cancleExam'), this.$t('global.tips'), {
cancelButtonText: this.$t('global.cancel'),
confirmButtonText: this.$t('global.confirm'),
type: 'warning',
center: true
}).then(() => {
this.submit();
}).catch(() => {
});
}
});
},
submit() {
exitFullscreen();
this.$store.dispatch('exam/over').then(() => {
this.$store.dispatch('trainingList/clearTrainingList');
this.$router.replace({ path: `/trainingPlatform/result/${this.$route.query.userExamId}`, query: {subSystem: this.$route.query.subSystem} });
});
},
shrink() {
const height = this.$refs.dragBody.offsetHeight + 40;
const top = this.$refs.drapBox.style.top;
if (this.isShrink) {
this.$refs.drapBox.style.height = '40px';
this.$refs.drapBox.style.top = '';
this.isShrink = false;
} else {
this.$refs.drapBox.style.height = height + 'px';
this.$refs.drapBox.style.top = top;
this.isShrink = true;
}
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -60,149 +60,149 @@ import { getSessionStorage, setSessionStorage } from '@/utils/auth';
import localStore from 'storejs';
export default {
name: 'ExamDetailView',
components: {
LimitList
},
data() {
return {
loading: false,
courseModel: {
id: '',
name: this.$t('rules.lessonInput'),
price: 0,
remarks: '',
detail: [],
pmsList: [],
treeList: []
},
EffectiveTypeList: [],
activeName: 'first',
defaultProps: {
children: 'children',
label: 'name'
},
expandList: [],
valid: false
};
},
computed: {
hasPermssion() {
return this.courseModel.pmsList.length > 0;
},
isAddRule() {
let sumRemains = 0;
if (this.courseModel.pmsList) {
this.courseModel.pmsList.forEach(elem => {
sumRemains += elem.remains;
});
}
return sumRemains >= 10;
},
height() {
return this.$store.state.app.height - 91;
}
},
watch: {
'$route.params.subSystem': function (val) {
this.loadInitPage();
}
},
mounted() {
this.$Dictionary.effectiveType().then(list => {
this.EffectiveTypeList = list;
});
this.loadInitPage();
},
methods: {
loadInitPage() {
getCourseLessonDetail({lessonId: this.$route.query.lessonId}).then(resp =>{
if (resp.data) {
this.courseModel = {
id: resp.data.id,
name: resp.data.name,
pmsList: resp.data.permissionList || [],
prdCode: resp.data.prdCode,
mapId: resp.data.mapId,
PermissionType: PermissionType.EXAM,
treeList: resp.data.examDefinitionList
};
}
if (this.courseModel.pmsList && this.courseModel.pmsList.length >0) {
this.valid = true;
}
this.getExpandList(this.courseModel.id);
}).catch(()=>{
this.$messageBox('获取考试信息失败!');
});
},
buy() {
this.loading = true;
this.$router.push({
path: `${UrlConfig.trainingPlatform.pay}/${this.courseModel.id}`,
query: { permissionType: PermissionType.EXAM, lessonId: this.courseModel.id, prdCode: this.courseModel.prdCode, mapId: this.courseModel.mapId, subSystem: this.$route.params.subSystem }
});
},
checkCourse() {
this.loading = true;
this.$router.push({
path: `${UrlConfig.trainingPlatform.examRuleManage}`,
query: { lessonId: this.courseModel.id }
});
},
transfer() { //
this.loading = false;
if (this.$refs) {
this.activeName = 'second';
this.$refs.limitList.transfer(this.courseModel);
}
},
distribute() { //
this.loading = false;
if (this.$refs) {
this.activeName = 'second';
this.$refs.limitList.distribute(this.courseModel);
}
},
clickEvent(obj, node, data) {
if (this.valid || obj.trial) {
this.$router.push({ path: `${UrlConfig.trainingPlatform.examDetail}/${obj.id}`, query: { subSystem: this.$route.params.subSystem }});
} else {
this.$confirm(this.$t('tip.accessCourseNo'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel')
}).then(() => {
this.buy();
}).catch(() => { });
}
},
filterNode(value, data) {
if (!value) return true;
return data.name.indexOf(value) !== -1;
},
nodeExpand(obj, node, ele) {
const key = obj.id;
this.expandList = this.expandList.filter(item => item!==key);
this.expandList.push(key);
setSessionStorage('trainingExamExpandList'+this.courseModel.id, this.expandList);
},
nodeCollapse(obj, node, ele) {
const key = obj.id;
this.expandList = this.expandList.filter(item => item!==key);
setSessionStorage('trainingExamExpandList'+this.courseModel.id, this.expandList);
},
getExpandList(id) {
let expand = getSessionStorage('trainingExamExpandList'+id);
expand = expand?(expand+'').split(','):'';
if (expand instanceof Array) {
this.expandList = expand;
}
},
backLessonList() {
localStore.remove('examDetail'+this.$route.params.subSystem);
this.$router.push({ path: `${UrlConfig.trainingPlatform.examHome}/${this.$route.params.subSystem}`});
}
}
name: 'ExamDetailView',
components: {
LimitList
},
data() {
return {
loading: false,
courseModel: {
id: '',
name: this.$t('rules.lessonInput'),
price: 0,
remarks: '',
detail: [],
pmsList: [],
treeList: []
},
EffectiveTypeList: [],
activeName: 'first',
defaultProps: {
children: 'children',
label: 'name'
},
expandList: [],
valid: false
};
},
computed: {
hasPermssion() {
return this.courseModel.pmsList.length > 0;
},
isAddRule() {
let sumRemains = 0;
if (this.courseModel.pmsList) {
this.courseModel.pmsList.forEach(elem => {
sumRemains += elem.remains;
});
}
return sumRemains >= 10;
},
height() {
return this.$store.state.app.height - 91;
}
},
watch: {
'$route.params.subSystem': function (val) {
this.loadInitPage();
}
},
mounted() {
this.$Dictionary.effectiveType().then(list => {
this.EffectiveTypeList = list;
});
this.loadInitPage();
},
methods: {
loadInitPage() {
getCourseLessonDetail({lessonId: this.$route.query.lessonId}).then(resp =>{
if (resp.data) {
this.courseModel = {
id: resp.data.id,
name: resp.data.name,
pmsList: resp.data.permissionList || [],
prdCode: resp.data.prdCode,
mapId: resp.data.mapId,
PermissionType: PermissionType.EXAM,
treeList: resp.data.examDefinitionList
};
}
if (this.courseModel.pmsList && this.courseModel.pmsList.length > 0) {
this.valid = true;
}
this.getExpandList(this.courseModel.id);
}).catch(()=>{
this.$messageBox('获取考试信息失败!');
});
},
buy() {
this.loading = true;
this.$router.push({
path: `${UrlConfig.trainingPlatform.pay}/${this.courseModel.id}`,
query: { permissionType: PermissionType.EXAM, lessonId: this.courseModel.id, prdCode: this.courseModel.prdCode, mapId: this.courseModel.mapId, subSystem: this.$route.params.subSystem }
});
},
checkCourse() {
this.loading = true;
this.$router.push({
path: `${UrlConfig.trainingPlatform.examRuleManage}`,
query: { lessonId: this.courseModel.id }
});
},
transfer() { //
this.loading = false;
if (this.$refs) {
this.activeName = 'second';
this.$refs.limitList.transfer(this.courseModel);
}
},
distribute() { //
this.loading = false;
if (this.$refs) {
this.activeName = 'second';
this.$refs.limitList.distribute(this.courseModel);
}
},
clickEvent(obj, node, data) {
if (this.valid || obj.trial) {
this.$router.push({ path: `${UrlConfig.trainingPlatform.examDetail}/${obj.id}`, query: { subSystem: this.$route.params.subSystem, mapId: this.courseModel.mapId }});
} else {
this.$confirm(this.$t('tip.accessCourseNo'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel')
}).then(() => {
this.buy();
}).catch(() => { });
}
},
filterNode(value, data) {
if (!value) return true;
return data.name.indexOf(value) !== -1;
},
nodeExpand(obj, node, ele) {
const key = obj.id;
this.expandList = this.expandList.filter(item => item !== key);
this.expandList.push(key);
setSessionStorage('trainingExamExpandList' + this.courseModel.id, this.expandList);
},
nodeCollapse(obj, node, ele) {
const key = obj.id;
this.expandList = this.expandList.filter(item => item !== key);
setSessionStorage('trainingExamExpandList' + this.courseModel.id, this.expandList);
},
getExpandList(id) {
let expand = getSessionStorage('trainingExamExpandList' + id);
expand = expand ? (expand + '').split(',') : '';
if (expand instanceof Array) {
this.expandList = expand;
}
},
backLessonList() {
localStore.remove('examDetail' + this.$route.params.subSystem);
this.$router.push({ path: `${UrlConfig.trainingPlatform.examHome}/${this.$route.params.subSystem}`});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -60,164 +60,165 @@ import { launchFullscreen } from '@/utils/screen';
import { UrlConfig } from '@/router/index';
export default {
name: 'ExamDetailView',
data() {
return {
loading: false,
examDetails: {
lessonId: '',
name: '',
remarks: '',
examDefinitionRulesVOList: [],
startTime: '',
endTime: '',
fullPoint: '',
passingPoint: '',
duration: '',
type: ''
},
typeList: [],
examList: [],
trainingOperateTypeMap: {}
};
},
computed: {
...mapGetters('trainingList', [
'trainingList'
]),
height() {
return this.$store.state.app.height - 50;
}
},
watch: {
'$route.params.examId': function (val) {
this.loadInitPage(val);
}
},
async mounted() {
this.trainingOperateTypeMap = {};
this.$Dictionary.stationControl().then(list => {
this.trainingOperateTypeMap['01'] = list; //
});
this.$Dictionary.signalOperation().then(list => {
this.trainingOperateTypeMap['02'] = list; //
});
this.$Dictionary.switchOperation().then(list => {
this.trainingOperateTypeMap['03'] = list; //
});
this.$Dictionary.sectionOperation().then(list => {
this.trainingOperateTypeMap['04'] = list; //
});
this.$Dictionary.stationStandOperation().then(list => {
this.trainingOperateTypeMap['05'] = list; //
});
this.$Dictionary.trainPlanOperation().then(list => {
this.trainingOperateTypeMap['06'] = list; //
});
this.$Dictionary.trainOperation().then(list => {
this.trainingOperateTypeMap['07'] = list; //
});
await this.getList();
this.loadInitPage(this.$route.params.examId);
},
methods: {
async getList() {
this.typeList = [];
await getDetailList('training_type').then(res => {
this.typeList = res.data;
});
},
async loadInitPage(examId) {
if (examId) {
const res = await getExamLessonDetail(examId);
this.examDetails = res.data;
this.examDetails.examDefinitionRulesVOList.forEach((res, index) => {
res.chapterIdLong = Number(res.num) * Number(res.point);
this.typeList.forEach(v => {
if (res.trainingType == v.code) {
this.examDetails.examDefinitionRulesVOList[index].name = v.name;
if (res.operateType) {
this.trainingOperateTypeMap[res.trainingType].forEach(item => {
if (item.code == res.operateType) {
this.examDetails.examDefinitionRulesVOList[index].name = `${this.examDetails.examDefinitionRulesVOList[index].name}-${item.name}`;
return;
}
});
}
}
});
});
name: 'ExamDetailView',
data() {
return {
loading: false,
examDetails: {
lessonId: '',
name: '',
remarks: '',
examDefinitionRulesVOList: [],
startTime: '',
endTime: '',
fullPoint: '',
passingPoint: '',
duration: '',
type: ''
},
typeList: [],
examList: [],
trainingOperateTypeMap: {}
};
},
computed: {
...mapGetters('trainingList', [
'trainingList'
]),
height() {
return this.$store.state.app.height - 50;
}
},
watch: {
'$route.params.examId': function (val) {
this.loadInitPage(val);
}
},
async mounted() {
this.trainingOperateTypeMap = {};
this.$Dictionary.stationControl().then(list => {
this.trainingOperateTypeMap['01'] = list; //
});
this.$Dictionary.signalOperation().then(list => {
this.trainingOperateTypeMap['02'] = list; //
});
this.$Dictionary.switchOperation().then(list => {
this.trainingOperateTypeMap['03'] = list; //
});
this.$Dictionary.sectionOperation().then(list => {
this.trainingOperateTypeMap['04'] = list; //
});
this.$Dictionary.stationStandOperation().then(list => {
this.trainingOperateTypeMap['05'] = list; //
});
this.$Dictionary.trainPlanOperation().then(list => {
this.trainingOperateTypeMap['06'] = list; //
});
this.$Dictionary.trainOperation().then(list => {
this.trainingOperateTypeMap['07'] = list; //
});
await this.getList();
this.loadInitPage(this.$route.params.examId);
},
methods: {
async getList() {
this.typeList = [];
await getDetailList('training_type').then(res => {
this.typeList = res.data;
});
},
async loadInitPage(examId) {
if (examId) {
const res = await getExamLessonDetail(examId);
this.examDetails = res.data;
this.examDetails.examDefinitionRulesVOList.forEach((res, index) => {
res.chapterIdLong = Number(res.num) * Number(res.point);
this.typeList.forEach(v => {
if (res.trainingType == v.code) {
this.examDetails.examDefinitionRulesVOList[index].name = v.name;
if (res.operateType) {
this.trainingOperateTypeMap[res.trainingType].forEach(item => {
if (item.code == res.operateType) {
this.examDetails.examDefinitionRulesVOList[index].name = `${this.examDetails.examDefinitionRulesVOList[index].name}-${item.name}`;
return;
}
});
}
}
});
});
}
},
buy() {
this.loading = true;
getPublishLessonDetail({ id: this.examDetails.lessonId }).then((res) => {
this.$router.push({
path: `${UrlConfig.trainingPlatform.pay}/${this.examDetails.lessonId}`,
query: { permissionType: PermissionType.EXAM, lessonId: this.examDetails.lessonId, prdCode: res.data.prdCode, mapId: res.data.mapId }
});
}).catch(() => {
this.$messageBox(this.$t('error.obtainCourseDetailsFailed'));
this.loading = false;
});
}
},
buy() {
this.loading = true;
getPublishLessonDetail({ id: this.examDetails.lessonId }).then((res) => {
this.$router.push({
path: `${UrlConfig.trainingPlatform.pay}/${this.examDetails.lessonId}`,
query: { permissionType: PermissionType.EXAM, lessonId: this.examDetails.lessonId, prdCode: res.data.prdCode, mapId: res.data.mapId }
});
}).catch(() => {
this.$messageBox(this.$t('error.obtainCourseDetailsFailed'));
this.loading = false;
});
},
async examDetail() {
const data = this.examDetails;
try {
const response = await generateExamList(data.id);
this.examList = response.data.userExamQuestionsVOs;
this.userExam = response.data;
const list = response.data.userExamQuestionsVOs;
await this.$store.dispatch('exam/setUsedTime', this.userExam.usedTime);
await this.$store.dispatch('exam/setTotalTime', this.userExam.duration);
await this.$store.dispatch('trainingList/setTrainingList', list);
} catch (error) {
//
if (error.code === 500004) {
this.$confirm( this.$t('tip.noCourseAuthority'), this.$t('tip.hint'), {
cancelButtonText: this.$t('global.cancel'),
confirmButtonText: this.$t('global.confirm'),
type: 'warning',
center: true
}).then(() => {
this.buy();
}).catch(() => { });
} else if (error.code === 500005) {
this.$messageBox(this.$t('tip.notWithinTheScopeOfTheExamination'));
} else {
this.$messageBox(`${error.message}`);
}
}
},
async exmaStart() {
this.loading = true;
await this.examDetail();
if (this.examList.length) {
examNotify({ examId: this.$route.params.examId }).then(resp => {
const query = {
group: resp.data,
trainingId: this.examList[0].trainingId,
userExamId: this.userExam.id,
examQuestionId: this.examList[0].id,
subSystem: this.$route.query.subSystem,
examId: this.$route.params.examId
};
this.$router.push({ path: `${UrlConfig.display}/exam`, query: query });
launchFullscreen();
}).catch(error => {
this.loading = false;
this.$messageBox( this.$t('error.createSimulationFailed') +`: ${error.message}`);
});
} else {
this.loading = false;
}
},
back() {
this.$router.push({ path: `${UrlConfig.trainingPlatform.course}/${this.$route.query.subSystem}`, query: {lessonId: this.examDetails.lessonId}});
}
}
},
async examDetail() {
const data = this.examDetails;
try {
const response = await generateExamList(data.id);
this.examList = response.data.userExamQuestionsVOs;
this.userExam = response.data;
const list = response.data.userExamQuestionsVOs;
await this.$store.dispatch('exam/setUsedTime', this.userExam.usedTime);
await this.$store.dispatch('exam/setTotalTime', this.userExam.duration);
await this.$store.dispatch('trainingList/setTrainingList', list);
} catch (error) {
//
if (error.code === 500004) {
this.$confirm( this.$t('tip.noCourseAuthority'), this.$t('tip.hint'), {
cancelButtonText: this.$t('global.cancel'),
confirmButtonText: this.$t('global.confirm'),
type: 'warning',
center: true
}).then(() => {
this.buy();
}).catch(() => { });
} else if (error.code === 500005) {
this.$messageBox(this.$t('tip.notWithinTheScopeOfTheExamination'));
} else {
this.$messageBox(`${error.message}`);
}
}
},
async exmaStart() {
this.loading = true;
await this.examDetail();
if (this.examList.length) {
examNotify({ examId: this.$route.params.examId }).then(resp => {
const query = {
group: resp.data,
trainingId: this.examList[0].trainingId,
userExamId: this.userExam.id,
examQuestionId: this.examList[0].id,
subSystem: this.$route.query.subSystem,
examId: this.$route.params.examId,
mapId: this.$route.query.mapId
};
this.$router.push({ path: `${UrlConfig.display}/exam`, query: query });
launchFullscreen();
}).catch(error => {
this.loading = false;
this.$messageBox( this.$t('error.createSimulationFailed') + `: ${error.message}`);
});
} else {
this.loading = false;
}
},
back() {
this.$router.push({ path: `${UrlConfig.trainingPlatform.course}/${this.$route.query.subSystem}`, query: {lessonId: this.examDetails.lessonId}});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -35,83 +35,83 @@ import { launchFullscreen } from '@/utils/screen';
import { timeFormat } from '@/utils/date';
export default {
name: 'ExamDetailList',
filters: {
setTime(val) {
return val;
}
},
data() {
return {
loading: false,
courseModel: {
id: '',
name: '',
skinCode: '',
maxDuration: '',
minDuration: '',
remarks: '',
updateTime: ''
}
};
},
computed: {
formatExamUsedTime() {
return timeFormat(this.$store.state.exam.usedTime);
},
height() {
return this.$store.state.app.height;
}
},
watch: {
$route(newVal) {
this.initLoadPage();
}
},
mounted() {
this.initLoadPage();
},
methods: {
initLoadPage() {
const trainingId = this.$route.query.trainingId;
if (parseInt(trainingId)) {
getTrainingDetail(trainingId).then(res => {
this.courseModel = {
id: res.data.id,
name: res.data.name,
skinCode: res.data.skinCode,
maxDuration: res.data.maxDuration,
remarks: res.data.remarks,
minDuration: res.data.minDuration,
updateTime: res.data.updateTime
};
}).catch(error => {
this.$message.error( this.$t('error.getTestInformationFailed') + ':' + error.message);
});
}
},
start() {
this.loading = true;
const query = { skinCode: this.$route.query.skinCode, trainingId: this.$route.query.trainingId, userExamId: this.$route.query.userExamId, examQuestionId: this.$route.params.examQuestionId };
this.$router.push({ path: '/display/exam', query: query });
launchFullscreen();
},
back() {
this.loading = true;
this.$confirm( this.$t('tip.giveUpTheExamTip'), this.$t('tip.hint'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
//
setExamGive(this.$route.query.userExamId).then(() => {
this.$router.back();
});
}).catch(() => {
this.loading = false;
});
}
}
name: 'ExamDetailList',
filters: {
setTime(val) {
return val;
}
},
data() {
return {
loading: false,
courseModel: {
id: '',
name: '',
skinCode: '',
maxDuration: '',
minDuration: '',
remarks: '',
updateTime: ''
}
};
},
computed: {
formatExamUsedTime() {
return timeFormat(this.$store.state.exam.usedTime);
},
height() {
return this.$store.state.app.height;
}
},
watch: {
$route(newVal) {
this.initLoadPage();
}
},
mounted() {
this.initLoadPage();
},
methods: {
initLoadPage() {
const trainingId = this.$route.query.trainingId;
if (parseInt(trainingId)) {
getTrainingDetail(trainingId).then(res => {
this.courseModel = {
id: res.data.id,
name: res.data.name,
skinCode: res.data.skinCode,
maxDuration: res.data.maxDuration,
remarks: res.data.remarks,
minDuration: res.data.minDuration,
updateTime: res.data.updateTime
};
}).catch(error => {
this.$message.error( this.$t('error.getTestInformationFailed') + ':' + error.message);
});
}
},
start() {
this.loading = true;
const query = { skinCode: this.$route.query.skinCode, trainingId: this.$route.query.trainingId, userExamId: this.$route.query.userExamId, examQuestionId: this.$route.params.examQuestionId };
this.$router.push({ path: '/display/exam', query: query });
launchFullscreen();
},
back() {
this.loading = true;
this.$confirm( this.$t('tip.giveUpTheExamTip'), this.$t('tip.hint'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
//
setExamGive(this.$route.query.userExamId).then(() => {
this.$router.back();
});
}).catch(() => {
this.loading = false;
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -1,103 +0,0 @@
<template>
<div :id="id" style="background: #000;" />
</template>
<script>
import Jlmap from '@/jmap/map';
import deviceType from '@/jmap/constant/deviceType';
import { getPublishMapDetail } from '@/api/test.js';
export default {
name: 'Jlmap',
data() {
return {
id: '__jmap__',
jmap: null
};
},
watch: {
'$store.state.app.windowSizeCount': function() {
this.$nextTick(() => {
this.jmap.resize({width: this.$store.state.app.width, height: this.$store.state.app.height});
});
}
},
mounted() {
document.getElementById(this.id).oncontextmenu = function (e) {
return false;
};
this.jmap = new Jlmap({
dom: document.getElementById(this.id),
config: {
renderer: 'canvas',
width: document.documentElement.clientWidth,
height: document.documentElement.clientHeight
},
options: {
scaleRate: 1,
offsetX: 0,
offsetY: 0
},
methods: {
dataLoaded() { console.log('dataLoaded'); },
viewLoaded() { console.log('viewLoaded'); },
stateLoaded() { console.log('stateLoaded'); },
viewUpdate() { console.log('viewUpdate'); },
stateUpdate() { console.log('stateUpdate'); }
// optionsUpdate() { console.log('optionsUpdate'); }
}
});
this.jmap.on('selected', this.selected);
this.jmap.on('contextmenu', this.contextmenu);
// const list = [];
// for (let i = 1; i < 20; i++) {
// for (let j = 1; j < 500; j++) {
// list.push({ code: `${(Array(3).join(0) + i).slice(-3)}${(Array(3).join(0) + j).slice(-3)}`, lp: { x: 50 + i * 120, y: 50 + j * 20 }, rp: { x: 150 + i * 120, y: 50 + j * 20 } });
// }
// }
// this.jmap.load({ skinVO: { code: '02' }, linkList: list });
getPublishMapDetail('02').then(resp => {
this.jmap.setLevelVisible([deviceType.Link], false);
this.jmap.setMap(resp.data);
// this.jmap.setDefaultState();
});
// this.jmap.render([
// {code: '11', type: 'Link', lp: { x: 20 , y: 100}, rp: { x: 120, y: 100 }}
// ]);
// this.jmap.update([
// { code: '11', type: 'Link', status: '02' }
// ]);
// this.jmap.render([
// { code: '11', type: 'Link', lp: { x: 0, y: 0 }, rp: { x: 200, y: 200 } }
// ]);
// this.jmap.update([]);
},
beforeDestroy() {
this.jmap.off('selected', this.selected);
this.jmap.off('contextmenu', this.contextmenu);
this.jmap.dispose();
this.jmap = null;
},
methods: {
selected(e) {
// console.log('selected', e, this.jmap);
},
contextmenu(e) {
// console.log('contextmenu', e);
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss">
</style>

View File

@ -37,7 +37,7 @@ import IbpPlate from '@/views/ibp/index';
import { mapGetters } from 'vuex';
import { OperateMode, TrainingMode } from '@/scripts/ConstDic';
import { checkLoginLine } from '@/api/login';
import { loadMapData } from '@/utils/loaddata';
import { loadMapDataById } from '@/utils/loaddata';
import { getUserRoles, deljointTrainRoom } from '@/api/chat';
import { runDiagramOver, getSimulationInfo } from '@/api/simulation';
import Jl3dDrive from '@/views/jlmap3d/drive/jl3ddrive';
@ -46,345 +46,345 @@ import ibpData from '@/ibp/constant/ibpData';
import { Message } from 'element-ui';
export default {
name: 'JointTrainingDraft',
components: {
MapSystemDraft,
MenuDemonJoint,
MenuDemonSchema,
JoinFaultChoose,
JoinRunPlanLoad,
JoinRunPlanView,
menuSystemTime,
Jl3dDrive,
IbpPlate
},
data() {
return {
trainingObj: {},
checkLine: null,
timeDemonNum: 0,
offset: 10,
mouseNum: 1,
ierval: null,
mouseNumTime: 0,
mapBox: null,
mapBoxP: null,
userRole: '',
deviceCode: '',
group: '',
mapId: '',
skinCode: '',
simulationShow: false,
drivingShow: false,
ibpShow: false,
panelShow: true,
ibpPart: ''
};
},
computed: {
...mapGetters([
'canvasWidth',
'canvasHeight'
]),
...mapGetters('map', [
'map'
]),
...mapGetters('training', [
'offsetStationCode'
]),
...mapGetters('config', [
'canvasId'
]),
width() {
return this.$store.state.app.width;
},
height() {
return this.$store.state.app.height;
},
right() {
return this.$store.state.config.width / 2 - 55;
}
},
watch: {
'$store.state.config.menuBarLoadedCount': function (val) {
this.setPosition();
},
'$store.state.map.mapViewLoadedCount': function (val) {
this.mapBoxP = document.getElementById(this.canvasId).children[0];
this.mapBox = document.getElementsByTagName('canvas');
},
'$store.state.socket.permissionOver': function () {
this.$alert(this.$t('tip.userRightsHaveBeenReclaimed'), this.$t('tip.hint'), {
confirmButtonText: this.$t('global.confirm'),
showClose: false,
callback: async (action) => {
await this.$store.dispatch('training/over');
await runDiagramOver(this.group);
await deljointTrainRoom(this.group);
await this.$router.push({ path: `/trainingPlatform/detail/${this.subSystem}`, query: {mapId: this.mapId} });
}
});
},
'$store.state.socket.jointRoomInfo': function (val) { //
if (val.creatorId) {
this.handleRoomInfo(val);
}
},
'$store.state.socket.chatContentList': function (val) { //
if (val.type === 'userRoomKickOut'&&val.oneself) {
this.$router.push({ path: `/` });
this.messageInfo(this.$t('tip.beKickedOut'), 'warning');
}
},
'$store.state.app.windowSizeCount': function() {
this.setWindowSize();
},
$route() {
this.$nextTick(() => {
this.initLoadData();
});
}
},
async created() {
this.group = this.$route.query.group;
this.mapId = this.$route.query.mapId;
this.skinCode = this.$route.query.skinCode;
this.subSystem = this.$route.query.subSystem;
Message.closeAll();
},
async mounted() {
await this.setWindowSize();
await this.initLoadData();
},
async beforeDestroy() {
await this.clearAllTimer();
await this.$store.dispatch('training/end', null);
await this.$store.dispatch('training/reset');
await this.$store.dispatch('map/mapClear');
await this.$store.dispatch('training/setGroup', '');
Message.closeAll();
},
methods: {
mousemove(e) {
this.mouseNum = 1;
},
handleRoomInfo(data) {
if (data.state == '03') { // 退
this.$router.push({ path: `/` });
// this.clearSubscribe();
} else if (data.state == '01') { //
const query = { group: this.group };
this.$router.push({ path: `/trainroom`, query: query });
// this.clearSubscribe();
}
this.$store.dispatch('socket/setJointRoomInfo'); //
},
// 线
clearAllTimer() {
if (this.ierval) {
clearTimeout(this.ierval);
this.ierval = null;
}
name: 'JointTrainingDraft',
components: {
MapSystemDraft,
MenuDemonJoint,
MenuDemonSchema,
JoinFaultChoose,
JoinRunPlanLoad,
JoinRunPlanView,
menuSystemTime,
Jl3dDrive,
IbpPlate
},
data() {
return {
trainingObj: {},
checkLine: null,
timeDemonNum: 0,
offset: 10,
mouseNum: 1,
ierval: null,
mouseNumTime: 0,
mapBox: null,
mapBoxP: null,
userRole: '',
deviceCode: '',
group: '',
mapId: '',
skinCode: '',
simulationShow: false,
drivingShow: false,
ibpShow: false,
panelShow: true,
ibpPart: ''
};
},
computed: {
...mapGetters([
'canvasWidth',
'canvasHeight'
]),
...mapGetters('map', [
'map'
]),
...mapGetters('training', [
'offsetStationCode'
]),
...mapGetters('config', [
'canvasId'
]),
width() {
return this.$store.state.app.width;
},
height() {
return this.$store.state.app.height;
},
right() {
return this.$store.state.config.width / 2 - 55;
}
},
watch: {
'$store.state.config.menuBarLoadedCount': function (val) {
this.setPosition();
},
'$store.state.map.mapViewLoadedCount': function (val) {
this.mapBoxP = document.getElementById(this.canvasId).children[0];
this.mapBox = document.getElementsByTagName('canvas');
},
'$store.state.socket.permissionOver': function () {
this.$alert(this.$t('tip.userRightsHaveBeenReclaimed'), this.$t('tip.hint'), {
confirmButtonText: this.$t('global.confirm'),
showClose: false,
callback: async (action) => {
await this.$store.dispatch('training/over');
await runDiagramOver(this.group);
await deljointTrainRoom(this.group);
await this.$router.push({ path: `/trainingPlatform/detail/${this.subSystem}`, query: {mapId: this.mapId} });
}
});
},
'$store.state.socket.jointRoomInfo': function (val) { //
if (val.creatorId) {
this.handleRoomInfo(val);
}
},
'$store.state.socket.chatContentList': function (val) { //
if (val.type === 'userRoomKickOut' && val.oneself) {
this.$router.push({ path: `/` });
this.messageInfo(this.$t('tip.beKickedOut'), 'warning');
}
},
'$store.state.app.windowSizeCount': function() {
this.setWindowSize();
},
$route() {
this.$nextTick(() => {
this.initLoadData();
});
}
},
async created() {
this.group = this.$route.query.group;
this.mapId = this.$route.query.mapId;
this.skinCode = this.$route.query.skinCode;
this.subSystem = this.$route.query.subSystem;
Message.closeAll();
},
async mounted() {
await this.setWindowSize();
await this.initLoadData();
},
async beforeDestroy() {
await this.clearAllTimer();
await this.$store.dispatch('training/end', null);
await this.$store.dispatch('training/reset');
await this.$store.dispatch('map/mapClear');
await this.$store.dispatch('training/setGroup', '');
Message.closeAll();
},
methods: {
mousemove(e) {
this.mouseNum = 1;
},
handleRoomInfo(data) {
if (data.state == '03') { // 退
this.$router.push({ path: `/` });
// this.clearSubscribe();
} else if (data.state == '01') { //
const query = { group: this.group };
this.$router.push({ path: `/trainroom`, query: query });
// this.clearSubscribe();
}
this.$store.dispatch('socket/setJointRoomInfo'); //
},
// 线
clearAllTimer() {
if (this.ierval) {
clearTimeout(this.ierval);
this.ierval = null;
}
if (this.checkLine) {
clearTimeout(this.checkLine);
this.checkLine = null;
}
},
// 线
checkLoginLineTimer() {
if (this.checkLine) {
clearTimeout(this.checkLine);
}
if (this.checkLine) {
clearTimeout(this.checkLine);
this.checkLine = null;
}
},
// 线
checkLoginLineTimer() {
if (this.checkLine) {
clearTimeout(this.checkLine);
}
this.checkLine = setInterval(() => {
checkLoginLine();
}, 5000 * 60);
},
//
checkMouseStatusTimer() {
if (this.ierval) {
clearTimeout(this.ierval);
}
this.checkLine = setInterval(() => {
checkLoginLine();
}, 5000 * 60);
},
//
checkMouseStatusTimer() {
if (this.ierval) {
clearTimeout(this.ierval);
}
this.ierval = setInterval(() => {
if (this.mouseNum) {
this.mouseNum = 0;
this.mouseNumTime = 0;
} else {
this.mouseNumTime += 1;
}
if (this.mapBox) {
if (this.mouseNumTime >= 15) {
for (let i = 0; i < this.mapBox.length; i++) {
this.mapBox[i].style.cursor = 'none';
}
} else {
for (let i = 0; i < this.mapBox.length; i++) {
this.mapBox[i].style.cursor = '';
}
}
}
}, 1000);
},
//
setPosition() {
this.$nextTick(() => {
let offset = 10;
const menuBar = document.getElementById('menuBar');
const menuTool = document.getElementById('menuTool');
this.ierval = setInterval(() => {
if (this.mouseNum) {
this.mouseNum = 0;
this.mouseNumTime = 0;
} else {
this.mouseNumTime += 1;
}
if (this.mapBox) {
if (this.mouseNumTime >= 15) {
for (let i = 0; i < this.mapBox.length; i++) {
this.mapBox[i].style.cursor = 'none';
}
} else {
for (let i = 0; i < this.mapBox.length; i++) {
this.mapBox[i].style.cursor = '';
}
}
}
}, 1000);
},
//
setPosition() {
this.$nextTick(() => {
let offset = 10;
const menuBar = document.getElementById('menuBar');
const menuTool = document.getElementById('menuTool');
if (menuBar) {
offset += (menuBar.offsetHeight || 0);
}
if (menuBar) {
offset += (menuBar.offsetHeight || 0);
}
if (menuTool) {
offset += (menuTool.offsetHeight || 0);
}
if (menuTool) {
offset += (menuTool.offsetHeight || 0);
}
if (this.offset != offset) {
this.offset = offset;
}
});
},
//
endViewLoading(isSuccess) {
if (!isSuccess) {
this.$store.dispatch('map/mapClear');
}
if (this.offset != offset) {
this.offset = offset;
}
});
},
//
endViewLoading(isSuccess) {
if (!isSuccess) {
this.$store.dispatch('map/mapClear');
}
this.$nextTick(() => {
EventBus.$emit('viewLoading', false);
});
},
//
initLoadData() {
const width = document.documentElement.clientWidth;
const height = document.documentElement.clientHeight + 200;
this.$store.dispatch('config/resize', { width, height });
this.$nextTick(() => {
EventBus.$emit('viewLoading', false);
});
},
//
initLoadData() {
const width = document.documentElement.clientWidth;
const height = document.documentElement.clientHeight + 200;
this.$store.dispatch('config/resize', { width, height });
try {
this.loadSimulationInfo();
this.initLoadDemonData();
this.checkLoginLineTimer();
this.checkMouseStatusTimer();
} catch (error) {
this.$messageBox( this.$t('error.initializationFailed') + error.message);
this.endViewLoading();
}
},
async loadSimulationInfo() {
const resp = await getSimulationInfo(this.group);
if (resp && resp.code == 200) {
this.$store.dispatch('scriptRecord/updateSimulationPause', resp.data.pause);
this.questId = Number(resp.data.questId) || 0;
}
},
async getUserRole() {
const res = await getUserRoles(this.group);
this.userRole = res.data.userRole;
this.deviceCode = res.data.deviceCode;
this.ibpPart = res.data.ibpPart;
if (this.userRole === 'IBP') {
this.showIbp(this.deviceCode);
} else {
this.hideIbp();
}
return res;
},
// 仿
async initLoadDemonData() {
this.$store.dispatch('training/end', TrainingMode.NORMAL);
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
try {
this.loadSimulationInfo();
this.initLoadDemonData();
this.checkLoginLineTimer();
this.checkMouseStatusTimer();
} catch (error) {
this.$messageBox( this.$t('error.initializationFailed') + error.message);
this.endViewLoading();
}
},
async loadSimulationInfo() {
const resp = await getSimulationInfo(this.group);
if (resp && resp.code == 200) {
this.$store.dispatch('scriptRecord/updateSimulationPause', resp.data.pause);
this.questId = Number(resp.data.questId) || 0;
}
},
async getUserRole() {
const res = await getUserRoles(this.group);
this.userRole = res.data.userRole;
this.deviceCode = res.data.deviceCode;
this.ibpPart = res.data.ibpPart;
if (this.userRole === 'IBP') {
this.showIbp(this.deviceCode);
} else {
this.hideIbp();
}
return res;
},
// 仿
async initLoadDemonData() {
this.$store.dispatch('training/end', TrainingMode.NORMAL);
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
if (this.skinCode) {
// 01 02 ''
const resp = await this.getUserRole();
if (resp && resp.code == 200) {
// Admin Instructor Dispatcher Attendant Audience Driver Repair IBP:IBP
this.userRole = resp.data.userRole;
switch (this.userRole) {
case 'Admin': this.$store.dispatch('training/setPrdType', '02'); this.$store.dispatch('training/setRoles', 'Admin'); this.hideIbp(); break;
case 'Instructor': this.$store.dispatch('training/setPrdType', '02'); this.$store.dispatch('training/setRoles', 'Instructor'); this.hideIbp(); break;
case 'Dispatcher': this.$store.dispatch('training/setPrdType', '02'); this.$store.dispatch('training/setRoles', 'Dispatcher'); this.hideIbp(); break;
case 'Attendant': this.$store.dispatch('training/setPrdType', '01'); this.$store.dispatch('training/setRoles', 'Attendant'); this.hideIbp(); break;
case 'Audience': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'Audience'); this.hideIbp(); break;
case 'Driver': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'Driver'); this.hideIbp(); break;
case 'Repair': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'Repair'); this.hideIbp(); break;
case 'IBP': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'IBP'); this.showIbp(resp.data.deviceCode); break;
case 'BigScreen': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'BigScreen'); this.hideIbp(); break;
}
}
await this.getTrainDetail(this.skinCode);
} else {
this.endViewLoading();
}
},
async getTrainDetail(skinCode) {
try {
await loadMapData(skinCode);
await this.$store.dispatch('training/setMapDefaultState');
} catch (error) {
this.$messageBox(this.$t('error.getMapDataFailed'));
this.endViewLoading();
}
},
back() {
this.$refs.demonMenu.back();
},
runPlanViewShow() {
this.$refs.runPlanView.doShow();
},
runPlanLoadShow() {
this.$refs.runPlanLoad.doShow();
},
faultChooseShow() {
this.$refs.faultChoose.doShow();
},
showdriving() {
this.panelShow = true;
this.drivingShow = false;
this.ibpShow =false;
},
showIbp(deviceCode) {
this.drivingShow = false;
this.panelShow = false;
this.ibpShow = true;
if (!deviceCode || !ibpData[deviceCode]) {
Message.warning({message: this.$t('error.ibpNoDraw'), duration: 0, showClose: true, type: 'error'});
return;
} else {
Message.closeAll();
}
this.$refs.ibpPlate.show(deviceCode, this.ibpPart);
},
hidepanel() {
this.panelShow = false;
this.drivingShow = true;
this.ibpShow = false;
this.$refs.Jl3dDrive.show(this.skinCode);
},
hideIbp() {
Message.closeAll();
this.drivingShow = false;
this.panelShow = true;
this.ibpShow = false;
this.$refs.ibpPlate.ibpDestroy();
},
messageInfo(message, type) {
this.$message({
showClose: true,
message: message,
type: type
});
},
setWindowSize() {
this.$nextTick(() => {
this.$store.dispatch('config/resize', { width: this.width, height: this.height });
this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: this.offsetStationCode });
});
}
}
if (this.skinCode) {
// 01 02 ''
const resp = await this.getUserRole();
if (resp && resp.code == 200) {
// Admin Instructor Dispatcher Attendant Audience Driver Repair IBP:IBP
this.userRole = resp.data.userRole;
switch (this.userRole) {
case 'Admin': this.$store.dispatch('training/setPrdType', '02'); this.$store.dispatch('training/setRoles', 'Admin'); this.hideIbp(); break;
case 'Instructor': this.$store.dispatch('training/setPrdType', '02'); this.$store.dispatch('training/setRoles', 'Instructor'); this.hideIbp(); break;
case 'Dispatcher': this.$store.dispatch('training/setPrdType', '02'); this.$store.dispatch('training/setRoles', 'Dispatcher'); this.hideIbp(); break;
case 'Attendant': this.$store.dispatch('training/setPrdType', '01'); this.$store.dispatch('training/setRoles', 'Attendant'); this.hideIbp(); break;
case 'Audience': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'Audience'); this.hideIbp(); break;
case 'Driver': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'Driver'); this.hideIbp(); break;
case 'Repair': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'Repair'); this.hideIbp(); break;
case 'IBP': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'IBP'); this.showIbp(resp.data.deviceCode); break;
case 'BigScreen': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'BigScreen'); this.hideIbp(); break;
}
}
await this.getTrainDetail();
} else {
this.endViewLoading();
}
},
async getTrainDetail() {
try {
await loadMapDataById(this.mapId);
await this.$store.dispatch('training/setMapDefaultState');
} catch (error) {
this.$messageBox(this.$t('error.getMapDataFailed'));
this.endViewLoading();
}
},
back() {
this.$refs.demonMenu.back();
},
runPlanViewShow() {
this.$refs.runPlanView.doShow();
},
runPlanLoadShow() {
this.$refs.runPlanLoad.doShow();
},
faultChooseShow() {
this.$refs.faultChoose.doShow();
},
showdriving() {
this.panelShow = true;
this.drivingShow = false;
this.ibpShow = false;
},
showIbp(deviceCode) {
this.drivingShow = false;
this.panelShow = false;
this.ibpShow = true;
if (!deviceCode || !ibpData[deviceCode]) {
Message.warning({message: this.$t('error.ibpNoDraw'), duration: 0, showClose: true, type: 'error'});
return;
} else {
Message.closeAll();
}
this.$refs.ibpPlate.show(deviceCode, this.ibpPart);
},
hidepanel() {
this.panelShow = false;
this.drivingShow = true;
this.ibpShow = false;
this.$refs.Jl3dDrive.show(this.skinCode);
},
hideIbp() {
Message.closeAll();
this.drivingShow = false;
this.panelShow = true;
this.ibpShow = false;
this.$refs.ibpPlate.ibpDestroy();
},
messageInfo(message, type) {
this.$message({
showClose: true,
message: message,
type: type
});
},
setWindowSize() {
this.$nextTick(() => {
this.$store.dispatch('config/resize', { width: this.width, height: this.height });
this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: this.offsetStationCode });
});
}
}
};
</script>
<style>

View File

@ -12,14 +12,14 @@
<el-button-group>
<template>
<el-button v-if="runing" size="small" :disabled="viewDisabled" @click="viewRunPlan">{{$t('joinTraining.runGraphPreview')}}</el-button>
<el-button v-if="runing" size="small" :disabled="viewDisabled" @click="viewRunPlan">{{ $t('joinTraining.runGraphPreview') }}</el-button>
</template>
<template v-if="userRole == 'Admin'">
<el-button v-if="!runing" size="small" type="warning" :disabled="viewDisabled" @click="loadRunPlan">
{{$t('joinTraining.runGraphLoading')}}</el-button>
{{ $t('joinTraining.runGraphLoading') }}</el-button>
</template>
<template v-if="userRole == 'Instructor' || userRole == 'Admin'">
<el-button v-if="mode==OperateMode.FAULT" size="small" type="danger" @click="setFault">{{$t('joinTraining.faultSetting')}}</el-button>
<el-button v-if="mode==OperateMode.FAULT" size="small" type="danger" @click="setFault">{{ $t('joinTraining.faultSetting') }}</el-button>
</template>
</el-button-group>
@ -29,121 +29,122 @@
size="small"
@change="changeOperateMode(mode)"
>
<el-radio-button class="mode" :label="OperateMode.NORMAL">{{$t('joinTraining.normalOperation')}}</el-radio-button>
<el-radio-button class="mode" :label="OperateMode.FAULT">{{$t('joinTraining.faultOperation')}}</el-radio-button>
<el-radio-button class="mode" :label="OperateMode.NORMAL">{{ $t('joinTraining.normalOperation') }}</el-radio-button>
<el-radio-button class="mode" :label="OperateMode.FAULT">{{ $t('joinTraining.faultOperation') }}</el-radio-button>
</el-radio-group>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic';
import { getStationListBySkinCode } from '@/api/runplan';
import { getStationList } from '@/api/runplan';
import { getEveryDayRunPlanData } from '@/api/simulation';
export default {
name: 'MenuDemonSchema',
props: {
group: {
type: String,
required: true
},
offset: {
type: Number,
required: true
},
userRole: {
type: String,
required: true
}
},
data() {
return {
mode: OperateMode.NORMAL,
OperateMode: OperateMode,
viewDisabled: true,
realData: {},
series: [],
kmRangeCoordMap: {},
runPlanData: {},
swch: '02',
swchList: [
{ value: '01', name: this.$t('joinTraining.local') },
{ value: '02', name: this.$t('joinTraining.lineAdjustment') }
],
runing: false,
userId: ''
};
},
computed: {
...mapGetters('runPlan', [
'stations'
]),
isShowMenuBar() {
return this.$store.state.map.roles == 'Admin';
}
},
watch: {
'$store.state.training.started': function (val) {
this.setRuning(val);
},
'$store.state.training.switchcount': async function () {
if (this.group) {
const started = this.$store.state.training.started;
if (started) {
await this.loadRunData(this.$route.query);
}
}
}
},
async mounted() {
this.userId = this.$store.state.user.id;
await this.loadRunData(this.$route.query);
},
methods: {
loadRunData(opt) {
this.$store.dispatch('runPlan/clear').then(resp => {
if (opt && opt.skinCode) {
this.viewDisabled = true;
getStationListBySkinCode(opt.skinCode).then(response => {
const stations = response.data;
this.$store.dispatch('runPlan/setStations', stations).then(() => {
getEveryDayRunPlanData(this.group).then(resp => {
this.$store.dispatch('runPlan/setPlanData', resp.data);
this.viewDisabled = false;
}).catch(error => {
this.$store.dispatch('runPlan/setPlanData', []);
if (error.code == 30001) {
this.$messageBox(this.$t('error.runGraphIsNotLoaded'));
} else {
this.$messageBox(this.$t('error.obtainOperationGraphFailed'));
}
});
});
}).catch(() => {
this.$messageBox(this.$t('error.obtainStationListFailed'));
});
}
});
},
switchMode(swch) {
this.$store.dispatch('training/setPrdType', swch);
},
changeOperateMode(handle) {
this.$store.dispatch('training/changeOperateMode', { mode: handle });
},
setFault() {
this.$emit('faultChooseShow');
},
loadRunPlan() {
this.$emit('runPlanLoadShow');
},
viewRunPlan() {
this.$emit('runPlanViewShow');
},
setRuning(run) {
this.runing = run;
}
}
name: 'MenuDemonSchema',
props: {
group: {
type: String,
required: true
},
offset: {
type: Number,
required: true
},
userRole: {
type: String,
required: true
}
},
data() {
return {
mode: OperateMode.NORMAL,
OperateMode: OperateMode,
viewDisabled: true,
realData: {},
series: [],
kmRangeCoordMap: {},
runPlanData: {},
swch: '02',
swchList: [
{ value: '01', name: this.$t('joinTraining.local') },
{ value: '02', name: this.$t('joinTraining.lineAdjustment') }
],
runing: false,
userId: ''
};
},
computed: {
...mapGetters('runPlan', [
'stations'
]),
isShowMenuBar() {
return this.$store.state.map.roles == 'Admin';
}
},
watch: {
'$store.state.training.started': function (val) {
this.setRuning(val);
},
'$store.state.training.switchcount': async function () {
if (this.group) {
const started = this.$store.state.training.started;
if (started) {
await this.loadRunData(this.$route.query);
}
}
}
},
async mounted() {
this.userId = this.$store.state.user.id;
console.log(this.$route.query);
await this.loadRunData(this.$route.query);
},
methods: {
loadRunData(opt) {
this.$store.dispatch('runPlan/clear').then(resp => {
if (opt && opt.mapId) {
this.viewDisabled = true;
getStationList(opt.mapId).then(response => {
const stations = response.data;
this.$store.dispatch('runPlan/setStations', stations).then(() => {
getEveryDayRunPlanData(this.group).then(resp => {
this.$store.dispatch('runPlan/setPlanData', resp.data);
this.viewDisabled = false;
}).catch(error => {
this.$store.dispatch('runPlan/setPlanData', []);
if (error.code == 30001) {
this.$messageBox(this.$t('error.runGraphIsNotLoaded'));
} else {
this.$messageBox(this.$t('error.obtainOperationGraphFailed'));
}
});
});
}).catch(() => {
this.$messageBox(this.$t('error.obtainStationListFailed'));
});
}
});
},
switchMode(swch) {
this.$store.dispatch('training/setPrdType', swch);
},
changeOperateMode(handle) {
this.$store.dispatch('training/changeOperateMode', { mode: handle });
},
setFault() {
this.$emit('faultChooseShow');
},
loadRunPlan() {
this.$emit('runPlanLoadShow');
},
viewRunPlan() {
this.$emit('runPlanViewShow');
},
setRuning(run) {
this.runing = run;
}
}
};
</script>
<style>

View File

@ -119,7 +119,7 @@ export default {
} else {
this.courseModel.skinCode = this.$route.query.skinCode;
}
getCommodityMapProduct(this.$route.query.skinCode).then(response => {
getCommodityMapProduct(this.$route.query.mapId).then(response => {
this.productList = response.data || [];
this.productList = this.productList.filter(elem => { return elem.prdType != '03'; });
});

View File

@ -197,7 +197,7 @@ export default {
}
},
mounted() {
this.skinCodeChoose(this.$route.params.skinCode);
this.mapIdChoose(this.$route.query.mapId);
},
methods: {
show(data) {
@ -211,11 +211,11 @@ export default {
this.dialogShow = false;
this.loading = false;
},
skinCodeChoose(skinCode) {
mapIdChoose(mapId) {
this.operateModel.prdCode = '';
this.productList = [];
if (skinCode) {
getCommodityMapProduct(skinCode).then((response) => {
if (mapId) {
getCommodityMapProduct(mapId).then((response) => {
this.productList = response.data;
this.productList = this.productList.filter(elem => { return elem.prdType != '03'; });
});

View File

@ -172,7 +172,7 @@ export default {
listPublishMap().then(response => {
this.mapIdList = response.data;
});
getCommodityMapProduct(this.$route.params.skinCode).then((response) => {
getCommodityMapProduct(this.$route.query.mapId).then((response) => {
const productList = response.data;
if (productList && productList.length > 0) {
productList.forEach(elem => {

View File

@ -23,70 +23,70 @@ import localStore from 'storejs';
import drapLeft from '@/views/components/drapLeft/index';
export default {
name: 'TrainingDraft',
components: {
TrainingCategory,
drapLeft
},
data() {
return {
widthLeft: localStore.get('LeftWidth') ? Number(localStore.get('LeftWidth')) : 320,
trainingObj: null,
group: ''
};
},
computed: {
width() {
return this.$store.state.app.width - 481 - this.widthLeft;
},
height() {
return this.$store.state.app.height - 90;
}
},
watch: {
'$store.state.app.windowSizeCount': function() {
this.resize();
},
widthLeft(val) {
this.resize(val);
},
$route() {
this.resize();
}
},
mounted() {
this.group = this.$route.query.group;
this.resize();
},
async beforeDestroy() {
if (this.group) {
runDiagramQuit(this.group);
}
},
methods: {
selectMapSure(data) {
trainingNotify({ trainingId: data.id }).then(resp => {
this.group = resp.data;
this.$router.push({ path: `${UrlConfig.lesson.record}/${data.id}/${data.name}`, query: { group: resp.data } });
}).catch(error => {
this.$messageBox(`${this.$t('error.createSimulationFailed')}: ${error.message}`);
});
},
trainingStart(data) {
/** 区分演示和正式需要在演示时设置lessonId为0*/
trainingNotify({ trainingId: data.id }).then(resp => {
this.$router.push({ path: `${UrlConfig.display}/record`, query: { trainingId: this.$route.params.trainingId, trainingName: this.$route.params.trainingName, group: resp.data, lessonId: 0 } });
}).catch(error => {
this.$messageBox(`${this.$t('error.createSimulationFailed')}: ${error.message}`);
});
},
drapWidth(width) {
this.widthLeft = Number(width);
},
resize() {
this.$store.dispatch('config/resize', { width: this.width, height: this.height });
}
}
name: 'TrainingDraft',
components: {
TrainingCategory,
drapLeft
},
data() {
return {
widthLeft: localStore.get('LeftWidth') ? Number(localStore.get('LeftWidth')) : 320,
trainingObj: null,
group: ''
};
},
computed: {
width() {
return this.$store.state.app.width - 481 - this.widthLeft;
},
height() {
return this.$store.state.app.height - 90;
}
},
watch: {
'$store.state.app.windowSizeCount': function() {
this.resize();
},
widthLeft(val) {
this.resize(val);
},
$route() {
this.resize();
}
},
mounted() {
this.group = this.$route.query.group;
this.resize();
},
async beforeDestroy() {
if (this.group) {
runDiagramQuit(this.group);
}
},
methods: {
selectMapSure(data) {
trainingNotify({ trainingId: data.id }).then(resp => {
this.group = resp.data;
this.$router.push({ path: `${UrlConfig.lesson.record}/${data.id}/${data.name}`, query: { group: resp.data } });
}).catch(error => {
this.$messageBox(`${this.$t('error.createSimulationFailed')}: ${error.message}`);
});
},
trainingStart(data) {
/** 区分演示和正式需要在演示时设置lessonId为0*/
trainingNotify({ trainingId: data.id }).then(resp => {
this.$router.push({ path: `${UrlConfig.display}/record`, query: { trainingId: this.$route.params.trainingId, trainingName: this.$route.params.trainingName, group: resp.data, lessonId: 0 } });
}).catch(error => {
this.$messageBox(`${this.$t('error.createSimulationFailed')}: ${error.message}`);
});
},
drapWidth(width) {
this.widthLeft = Number(width);
},
resize() {
this.$store.dispatch('config/resize', { width: this.width, height: this.height });
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -22,96 +22,96 @@ import { loadMapData } from '@/utils/loaddata';
import { EventBus } from '@/scripts/event-bus';
export default {
name: 'LessonDraft',
components: {
MapSystemDraft,
StepManage
},
data() {
return {
stationObj: null,
trainingObj: null,
widthLeft: 0
};
},
computed: {
...mapGetters('map', [
'mapData'
]),
group() {
return this.$route.query.group;
},
trainingId() {
return this.$route.params.trainingId;
},
width() {
return this.$store.state.app.width - 481 - this.widthLeft;
},
height() {
return this.$store.state.app.height - 90;
}
},
watch: {
$route(newVal) {
this.initLoadData();
},
'$store.state.map.mapViewLoadedCount': function() {
if (this.trainingId) {
getTrainingStepsDetail(this.trainingId, { group: this.group }).then(response => {
this.$store.dispatch('training/setTrainingData', response.data);
}).catch(() => {
this.$messageBox(this.$t('error.getMapStepsFailed'));
this.endViewLoading();
});
}
}
},
mounted() {
this.initLoadData();
},
beforeDestroy() {
this.$store.dispatch('map/mapClear');
},
methods: {
endViewLoading(isSuccess) {
if (!isSuccess) {
this.$store.dispatch('map/mapClear');
}
name: 'LessonDraft',
components: {
MapSystemDraft,
StepManage
},
data() {
return {
stationObj: null,
trainingObj: null,
widthLeft: 0
};
},
computed: {
...mapGetters('map', [
'mapData'
]),
group() {
return this.$route.query.group;
},
trainingId() {
return this.$route.params.trainingId;
},
width() {
return this.$store.state.app.width - 481 - this.widthLeft;
},
height() {
return this.$store.state.app.height - 90;
}
},
watch: {
$route(newVal) {
this.initLoadData();
},
'$store.state.map.mapViewLoadedCount': function() {
if (this.trainingId) {
getTrainingStepsDetail(this.trainingId, { group: this.group }).then(response => {
this.$store.dispatch('training/setTrainingData', response.data);
}).catch(() => {
this.$messageBox(this.$t('error.getMapStepsFailed'));
this.endViewLoading();
});
}
}
},
mounted() {
this.initLoadData();
},
beforeDestroy() {
this.$store.dispatch('map/mapClear');
},
methods: {
endViewLoading(isSuccess) {
if (!isSuccess) {
this.$store.dispatch('map/mapClear');
}
this.$nextTick(() => {
EventBus.$emit('viewLoading', false);
});
},
initLoadData() {
this.$store.dispatch('training/end', TrainingMode.EDIT);
this.$store.dispatch('training/reset');
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
this.$nextTick(() => {
EventBus.$emit('viewLoading', false);
});
},
initLoadData() {
this.$store.dispatch('training/end', TrainingMode.EDIT);
this.$store.dispatch('training/reset');
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
if (parseInt(this.trainingId)) {
this.trainingObj = { id: this.trainingId, name: this.$route.params.trainingName };
//
//
//
getTrainingDetail(this.trainingId).then(resp => {
const detail = resp.data;
getProductDetail(detail.prdCode).then(rest => {
const data = rest.data;
loadMapData(detail.skinCode).then(() => {
this.$store.dispatch('training/setPrdType', data.prdType);
}).catch(() => {
this.$messageBox(this.$t('error.loadMapDataFailed'));
this.endViewLoading();
});
});
}).catch(() => {
this.$messageBox(this.$t('error.getMapDetailFailed'));
this.endViewLoading();
});
} else {
this.endViewLoading();
}
}
}
if (parseInt(this.trainingId)) {
this.trainingObj = { id: this.trainingId, name: this.$route.params.trainingName };
//
//
//
getTrainingDetail(this.trainingId).then(resp => {
const detail = resp.data;
getProductDetail(detail.prdCode).then(rest => {
const data = rest.data;
loadMapData(detail.skinCode).then(() => {
this.$store.dispatch('training/setPrdType', data.prdType);
}).catch(() => {
this.$messageBox(this.$t('error.loadMapDataFailed'));
this.endViewLoading();
});
});
}).catch(() => {
this.$messageBox(this.$t('error.getMapDetailFailed'));
this.endViewLoading();
});
} else {
this.endViewLoading();
}
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -15,176 +15,168 @@ import { getPublishMapList } from '@/api/jmap/map';
import { getCommodityMapProduct } from '@/api/management/mapprd';
export default {
name: 'UsersTrainingAdd',
props: {
type: {
type: String,
required: true
}
},
data() {
return {
dialogVisible: false,
formModel: {
mapId: '',
mapPrdCode: '',
userId: '',
userName: '',
duration: ''
},
LessonList: [],
mapPrdList: [],
UserList: [],
UserLoading: false
};
},
computed: {
form() {
const form = {
labelWidth: '120px',
items: [
{ prop: 'mapId', label: this.$t('system.mapName'), type: 'select', required: true, options: this.LessonList, change: true, onChange: this.mapChange, placeholder: this.$t('rules.mapInput') },
{ prop: 'mapPrdCode', label: this.$t('system.productName'), type: 'select', required: true, options: this.mapPrdList, placeholder: this.$t('rules.productInput') },
{ prop: 'userName', label: this.$t('system.userName'), type: 'complete', required: false, querySearchAsync: this.querySearchAsync, handleSelect: this.prdSelect, placeholder: this.$t('system.pleaseInputNames') },
{ prop: 'duration', label: this.$t('system.trainingUseTime'), type: 'text', rightWidth: true, required: true, message: 's' }
]
};
return form;
},
rules() {
const crules = {
mapId: [
{ required: true, message: this.$t('rules.mapInput'), trigger: 'change' }
],
userName: [
{ required: true, message: this.$t('rules.chooseUser'), trigger: 'change' }
],
mapPrdCode: [
{ required: true, message: this.$t('rules.productInput'), trigger: 'change' }
],
duration: [
{ required: true, message: this.$t('rules.timeInput'), trigger: 'blur' }
]
};
return crules;
},
title() {
return this.$t('system.createSimulationTitle');
}
},
mounted() {
this.initLoadPage();
},
methods: {
initLoadPage() {
//
this.LessonList.length = 0;
this.UserList.length = 0;
const param = {
pageNum: 1,
pageSize: 10
};
getPublishMapList(param).then(response => {
const data = response.data.list;
if (data && data.length) {
data.forEach(elem => {
this.LessonList.push({ value: elem.id, label: elem.name, skinCode: elem.skinCode });
});
}
});
},
// input
async querySearchAsync(queryString, cb) {
// queryString
const results = [];
if (queryString) {
try {
const params = {
fuzzyParam: queryString
};
const res = await getDimUserList(params);
const list = res.data;
list.forEach(item => {
const value = {
id: item.id,
value: `${item.nickname}(${item.name})${item.mobile}`
};
results.push(value);
});
cb(results);
} catch (error) {
console.error(error);
cb(results);
}
} else {
cb(results);
}
},
prdSelect(item) {
this.formModel.userId = item.id;
},
async mapChange(val) {
let skinCode = '';
this.mapPrdList = [];
this.formModel.mapPrdCode = '';
if (this.LessonList.length) {
this.LessonList.forEach(item => {
if (item.value == val) {
skinCode = item.skinCode;
}
});
try {
const res = await getCommodityMapProduct(skinCode);
const data = res.data;
if (data && data.length) {
data.forEach(elem => {
this.mapPrdList.push({ value: elem.code, label: elem.name });
});
}
} catch (error) {
console.error(error);
}
}
},
show(data) {
this.dialogVisible = true;
},
doSave() {
const self = this;
this.$refs.dataform.validateForm(() => {
self.save();
});
},
save() {
const self = this;
const params = {
mapId: this.formModel.mapId,
mapPrdCode: this.formModel.mapPrdCode,
userId: this.formModel.userId,
duration: parseInt(this.formModel.duration)
};
if (params.userId) {
postSimulationStats(params).then(response => {
self.$message.success(this.$t('system.addSuccess'));
self.handleClose();
self.$emit('reloadTable');
}).catch(error => {
self.$message.error(this.$t('error.addFailed') + error.message);
});
} else {
this.$message.error(this.$t('rules.chooseUser'));
}
},
handleClose(done) {
this.formModel = {
mapId: '',
mapPrdCode: '',
userId: '',
userName: '',
duration: ''
};
this.dialogVisible = false;
}
}
name: 'UsersTrainingAdd',
props: {
type: {
type: String,
required: true
}
},
data() {
return {
dialogVisible: false,
formModel: {
mapId: '',
mapPrdCode: '',
userId: '',
userName: '',
duration: ''
},
LessonList: [],
mapPrdList: [],
UserList: [],
UserLoading: false
};
},
computed: {
form() {
const form = {
labelWidth: '120px',
items: [
{ prop: 'mapId', label: this.$t('system.mapName'), type: 'select', required: true, options: this.LessonList, change: true, onChange: this.mapChange, placeholder: this.$t('rules.mapInput') },
{ prop: 'mapPrdCode', label: this.$t('system.productName'), type: 'select', required: true, options: this.mapPrdList, placeholder: this.$t('rules.productInput') },
{ prop: 'userName', label: this.$t('system.userName'), type: 'complete', required: false, querySearchAsync: this.querySearchAsync, handleSelect: this.prdSelect, placeholder: this.$t('system.pleaseInputNames') },
{ prop: 'duration', label: this.$t('system.trainingUseTime'), type: 'text', rightWidth: true, required: true, message: 's' }
]
};
return form;
},
rules() {
const crules = {
mapId: [
{ required: true, message: this.$t('rules.mapInput'), trigger: 'change' }
],
userName: [
{ required: true, message: this.$t('rules.chooseUser'), trigger: 'change' }
],
mapPrdCode: [
{ required: true, message: this.$t('rules.productInput'), trigger: 'change' }
],
duration: [
{ required: true, message: this.$t('rules.timeInput'), trigger: 'blur' }
]
};
return crules;
},
title() {
return this.$t('system.createSimulationTitle');
}
},
mounted() {
this.initLoadPage();
},
methods: {
initLoadPage() {
//
this.LessonList.length = 0;
this.UserList.length = 0;
const param = {
pageNum: 1,
pageSize: 10
};
getPublishMapList(param).then(response => {
const data = response.data.list;
if (data && data.length) {
data.forEach(elem => {
this.LessonList.push({ value: elem.id, label: elem.name, skinCode: elem.skinCode });
});
}
});
},
// input
async querySearchAsync(queryString, cb) {
// queryString
const results = [];
if (queryString) {
try {
const params = {
fuzzyParam: queryString
};
const res = await getDimUserList(params);
const list = res.data;
list.forEach(item => {
const value = {
id: item.id,
value: `${item.nickname}(${item.name})${item.mobile}`
};
results.push(value);
});
cb(results);
} catch (error) {
console.error(error);
cb(results);
}
} else {
cb(results);
}
},
prdSelect(item) {
this.formModel.userId = item.id;
},
async mapChange(val) {
this.mapPrdList = [];
this.formModel.mapPrdCode = '';
try {
const res = await getCommodityMapProduct(val);
const data = res.data;
if (data && data.length) {
data.forEach(elem => {
this.mapPrdList.push({ value: elem.code, label: elem.name });
});
}
} catch (error) {
console.error(error);
}
},
show(data) {
this.dialogVisible = true;
},
doSave() {
const self = this;
this.$refs.dataform.validateForm(() => {
self.save();
});
},
save() {
const self = this;
const params = {
mapId: this.formModel.mapId,
mapPrdCode: this.formModel.mapPrdCode,
userId: this.formModel.userId,
duration: parseInt(this.formModel.duration)
};
if (params.userId) {
postSimulationStats(params).then(response => {
self.$message.success(this.$t('system.addSuccess'));
self.handleClose();
self.$emit('reloadTable');
}).catch(error => {
self.$message.error(this.$t('error.addFailed') + error.message);
});
} else {
this.$message.error(this.$t('rules.chooseUser'));
}
},
handleClose(done) {
this.formModel = {
mapId: '',
mapPrdCode: '',
userId: '',
userName: '',
duration: ''
};
this.dialogVisible = false;
}
}
};
</script>

View File

@ -10,7 +10,6 @@
</template>
<script>
import { getPublishMapInfo } from '@/api/jmap/map';
import { getCommodityMapProduct } from '@/api/management/mapprd';
import { OperatorModel, PermissionType } from '@/scripts/ConstDic';
import { getTotalRemains } from '@/api/management/author';
@ -18,295 +17,293 @@ import { superAdmin, admin } from '@/router';
import { getDimUserList } from '@/api/management/user';
export default {
name: 'EditRule',
props: {
permissionTypeList: {
type: Array,
required: true
},
publishMapList: {
type: Array,
required: true
},
publisLessonList: {
type: Array,
required: true
}
},
data() {
return {
show: false,
type: '',
mapProductList: [],
filterPublisLessonList: [],
formModel: {
permissionType: '',
mapId: '',
lessonId: '',
prdCode: '',
date: '',
amount: 0,
ownerId: '',
roleName: ''
},
DatePicker: {
shortcuts: [{
text: this.$t('global.today'),
onClick(picker) {
picker.$emit('pick', new Date());
}
}]
},
numberMessage: ''
};
},
name: 'EditRule',
props: {
permissionTypeList: {
type: Array,
required: true
},
publishMapList: {
type: Array,
required: true
},
publisLessonList: {
type: Array,
required: true
}
},
data() {
return {
show: false,
type: '',
mapProductList: [],
filterPublisLessonList: [],
formModel: {
permissionType: '',
mapId: '',
lessonId: '',
prdCode: '',
date: '',
amount: 0,
ownerId: '',
roleName: ''
},
DatePicker: {
shortcuts: [{
text: this.$t('global.today'),
onClick(picker) {
picker.$emit('pick', new Date());
}
}]
},
numberMessage: ''
};
},
computed: {
form() {
const form = {
labelWidth: '120px',
items: [
{ prop: 'permissionType', label: this.$t('permission.permissionType'), type: 'select', required: false, disabled: !this.isAdd, options: this.permissionTypeList, change: true, onChange: this.permissionTypeChange },
{ prop: 'mapId', label: this.$t('permission.mapName'), type: 'select', required: false, disabled: !this.isAdd, show: this.isShowMap, options: this.publishMapList, change: true, onChange: this.mapChange },
{ prop: 'prdCode', label: this.$t('permission.mapProductName'), type: 'select', required: false, disabled: !this.isAdd, show: this.isShowMapProduct, options: this.mapProductList, change: true, onChange: this.mapProductChange },
{ prop: 'lessonId', label: this.$t('permission.lessonName'), type: 'select', required: false, disabled: !this.isAdd, show: this.isShowLesson, options: this.filterPublisLessonList },
{ prop: 'roleName', label: this.$t('permission.belonger'), type: 'complete', required: false, disabled: !this.isAdd && this.isAdministrator, show: this.isShowRole, querySearchAsync: this.querySearchAsync, handleSelect: this.prdSelect, placeholder: '请输入昵称/名字/手机号' },
{ prop: 'date', label: this.$t('permission.selectDate'), type: 'daterange', required: false, viewFormat: 'yyyy-MM-dd HH:mm:ss', valueFormat: 'yyyy-MM-dd HH:mm:ss' },
{ prop: 'amount', label: '权限个数', type: 'number', required: false, min: 0, max: this.maxTotal, message: this.numberMessage }
]
};
return form;
},
rules() {
const that = this;
const crules = {
permissionType: [
{ required: true, message: this.$t('rules.permissionTypeInput'), trigger: 'change' }
],
mapId: [
{ required: true, message: this.$t('rules.selectMapName'), trigger: 'change' }
],
prdCode: [
{ required: true, message: this.$t('rules.selectMapProductName'), trigger: 'change' }
],
lessonId: [
{ required: true, message: this.$t('rules.lessonInput'), trigger: 'change' }
],
date: [
{ required: true, message: this.$t('rules.inputTime'), trigger: 'blur' }
],
amount: [
{ required: true, message: this.$t('rules.inputPermissionNumber'), trigger: 'change' },
{
validator(rule, value, callback) {
if (Number.isInteger(Number(value)) && Number(value) > 0) {
callback();
} else {
callback(new Error(that.$t('rules.permissionNumberGreater0')));
}
},
trigger: 'blur'
}
]
};
return crules;
},
title() {
if (this.isAdd) {
return this.$t('permission.addPermissionPackageRule');
} else {
return this.$t('permission.editPermissionPackageRule');
}
},
disabled() {
return this.formModel.amount > this.maxTotal || this.formModel.amount <= 0;
},
isAdd() {
return this.type == 'add';
},
isAdministrator() {
return this.$store.state.user.roles.indexOf(superAdmin) || this.$store.state.user.roles.indexOf(admin);
},
isShowMap() {
return this.formModel.permissionType !== '04';
computed: {
form() {
const form = {
labelWidth: '120px',
items: [
{ prop: 'permissionType', label: this.$t('permission.permissionType'), type: 'select', required: false, disabled: !this.isAdd, options: this.permissionTypeList, change: true, onChange: this.permissionTypeChange },
{ prop: 'mapId', label: this.$t('permission.mapName'), type: 'select', required: false, disabled: !this.isAdd, show: this.isShowMap, options: this.publishMapList, change: true, onChange: this.mapChange },
{ prop: 'prdCode', label: this.$t('permission.mapProductName'), type: 'select', required: false, disabled: !this.isAdd, show: this.isShowMapProduct, options: this.mapProductList, change: true, onChange: this.mapProductChange },
{ prop: 'lessonId', label: this.$t('permission.lessonName'), type: 'select', required: false, disabled: !this.isAdd, show: this.isShowLesson, options: this.filterPublisLessonList },
{ prop: 'roleName', label: this.$t('permission.belonger'), type: 'complete', required: false, disabled: !this.isAdd && this.isAdministrator, show: this.isShowRole, querySearchAsync: this.querySearchAsync, handleSelect: this.prdSelect, placeholder: '请输入昵称/名字/手机号' },
{ prop: 'date', label: this.$t('permission.selectDate'), type: 'daterange', required: false, viewFormat: 'yyyy-MM-dd HH:mm:ss', valueFormat: 'yyyy-MM-dd HH:mm:ss' },
{ prop: 'amount', label: '权限个数', type: 'number', required: false, min: 0, max: this.maxTotal, message: this.numberMessage }
]
};
return form;
},
rules() {
const that = this;
const crules = {
permissionType: [
{ required: true, message: this.$t('rules.permissionTypeInput'), trigger: 'change' }
],
mapId: [
{ required: true, message: this.$t('rules.selectMapName'), trigger: 'change' }
],
prdCode: [
{ required: true, message: this.$t('rules.selectMapProductName'), trigger: 'change' }
],
lessonId: [
{ required: true, message: this.$t('rules.lessonInput'), trigger: 'change' }
],
date: [
{ required: true, message: this.$t('rules.inputTime'), trigger: 'blur' }
],
amount: [
{ required: true, message: this.$t('rules.inputPermissionNumber'), trigger: 'change' },
{
validator(rule, value, callback) {
if (Number.isInteger(Number(value)) && Number(value) > 0) {
callback();
} else {
callback(new Error(that.$t('rules.permissionNumberGreater0')));
}
},
trigger: 'blur'
}
]
};
return crules;
},
title() {
if (this.isAdd) {
return this.$t('permission.addPermissionPackageRule');
} else {
return this.$t('permission.editPermissionPackageRule');
}
},
disabled() {
return this.formModel.amount > this.maxTotal || this.formModel.amount <= 0;
},
isAdd() {
return this.type == 'add';
},
isAdministrator() {
return this.$store.state.user.roles.indexOf(superAdmin) || this.$store.state.user.roles.indexOf(admin);
},
isShowMap() {
return this.formModel.permissionType !== '04';
},
isShowRole() {
return this.$store.state.user.roles.indexOf(superAdmin) != -1;
},
isShowMapProduct() {
return this.formModel.permissionType !== '04';
},
isShowLesson() {
return this.formModel.permissionType != '04' && this.formModel.permissionType != '03';
}
},
watch: {
formModel: {
handler: function (val, old) {
this.setTotalMax();
},
deep: true
}
},
methods: {
setTotalMax() {
let endTime;
let startTime;
if (this.formModel.date) {
endTime = this.formModel.date[1];
startTime = this.formModel.date[0];
}
},
isShowRole() {
return this.$store.state.user.roles.indexOf(superAdmin) != -1;
},
isShowMapProduct() {
return this.formModel.permissionType !== '04';
},
isShowLesson() {
return this.formModel.permissionType != '04' && this.formModel.permissionType != '03';
}
},
watch: {
formModel: {
handler: function (val, old) {
this.setTotalMax();
},
deep: true
}
},
methods: {
setTotalMax() {
let endTime;
let startTime;
if (this.formModel.date) {
endTime = this.formModel.date[1];
startTime = this.formModel.date[0];
}
var validator = {};
validator[PermissionType.LESSON] = () => { return this.formModel.lessonId && this.formModel.mapId && this.formModel.prdCode; };
validator[PermissionType.EXAM] = () => { return this.formModel.lessonId && this.formModel.mapId && this.formModel.prdCode; };
validator[PermissionType.SIMULATION] = () => { return this.formModel.mapId && this.formModel.prdCode; };
validator[PermissionType.SCREEN] = () => { return true; };
var validator = {};
validator[PermissionType.LESSON] = () => { return this.formModel.lessonId && this.formModel.mapId && this.formModel.prdCode; };
validator[PermissionType.EXAM] = () => { return this.formModel.lessonId && this.formModel.mapId && this.formModel.prdCode; };
validator[PermissionType.SIMULATION] = () => { return this.formModel.mapId && this.formModel.prdCode; };
validator[PermissionType.SCREEN] = () => { return true; };
if (endTime && startTime && this.formModel.permissionType && validator[this.formModel.permissionType]()) {
if (endTime > startTime) {
const model = {
startTime: startTime,
endTime: endTime,
permissionType: this.formModel.permissionType,
ownerId: this.formModel.ownerId
};
if (endTime && startTime && this.formModel.permissionType && validator[this.formModel.permissionType]()) {
if (endTime > startTime) {
const model = {
startTime: startTime,
endTime: endTime,
permissionType: this.formModel.permissionType,
ownerId: this.formModel.ownerId
};
if (this.formModel.permissionType == PermissionType.LESSON || this.formModel.permissionType == PermissionType.EXAM) {
model['lessonId'] = this.formModel.lessonId;
model['mapId'] = this.formModel.mapId;
model['prdCode'] = this.formModel.prdCode;
} else if (this.formModel.permissionType == PermissionType.SIMULATION) {
model['mapId'] = this.formModel.mapId;
model['prdCode'] = this.formModel.prdCode;
}
if (this.formModel.permissionType == PermissionType.LESSON || this.formModel.permissionType == PermissionType.EXAM) {
model['lessonId'] = this.formModel.lessonId;
model['mapId'] = this.formModel.mapId;
model['prdCode'] = this.formModel.prdCode;
} else if (this.formModel.permissionType == PermissionType.SIMULATION) {
model['mapId'] = this.formModel.mapId;
model['prdCode'] = this.formModel.prdCode;
}
getTotalRemains(model).then(response => {
this.maxTotal = response.data;
if (this.maxTotal == 0) {
this.numberMessage = '可用权限数量为0';
} else {
this.numberMessage = `${this.$t('global.remainPermissionNumber')}${this.maxTotal}`;
}
}).catch(() => {
this.$messageBox(this.$t('error.obtainMaxNumberFailed'));
});
} else {
this.numberMessage = '结束时间必须大于开始时间';
}
} else {
this.numberMessage = '';
}
},
permissionTypeChange() {
this.formModel.mapId = '';
this.formModel.prdCode = '';
this.formModel.lessonId = '';
},
mapChange(mapId) {
this.formModel.prdCode = '';
this.formModel.lessonId = '';
this.mapProductList = [];
getPublishMapInfo(mapId).then(resp => {
getCommodityMapProduct(resp.data.skinCode).then(rest => {
const list = rest.data || [];
this.mapProductList = list.map(elem => {
return { value: elem.code, label: elem.name };
});
});
});
},
mapProductChange(prdCode) {
this.formModel.lessonId = '';
this.filterPublisLessonList = this.publisLessonList.filter(elem => { return elem.mapId == this.formModel.mapId && elem.prdCode == this.formModel.prdCode; });
},
// input
async querySearchAsync(queryString, cb) {
// queryString
const results = [];
if (queryString) {
try {
const params = {
fuzzyParam: queryString
};
const res = await getDimUserList(params);
const list = res.data;
list.forEach(item => {
const value = {
id: item.id,
value: `${item.nickname}(${item.name})${item.mobile}`
};
results.push(value);
});
cb(results);
} catch (error) {
cb(results);
}
} else {
cb(results);
}
},
prdSelect(item) {
this.formModel.ownerId = item.id;
},
doShow(data) {
this.show = true;
this.type = data.type;
if (!this.isAdd) {
const model = data.item;
this.formModel = {
permissionType: model.permissionType,
mapId: model.mapId,
lessonId: model.lessonId,
prdCode: model.prdCode,
date: [model.startTime, model.endTime],
amount: model.amount,
ownerId: this.formModel.ownerId,
roleName: this.formModel.roleName
};
}
getTotalRemains(model).then(response => {
this.maxTotal = response.data;
if (this.maxTotal == 0) {
this.numberMessage = '可用权限数量为0';
} else {
this.numberMessage = `${this.$t('global.remainPermissionNumber')}${this.maxTotal}`;
}
}).catch(() => {
this.$messageBox(this.$t('error.obtainMaxNumberFailed'));
});
} else {
this.numberMessage = '结束时间必须大于开始时间';
}
} else {
this.numberMessage = '';
}
},
permissionTypeChange() {
this.formModel.mapId = '';
this.formModel.prdCode = '';
this.formModel.lessonId = '';
},
mapChange(mapId) {
this.formModel.prdCode = '';
this.formModel.lessonId = '';
this.mapProductList = [];
getCommodityMapProduct(mapId).then(rest => {
const list = rest.data || [];
this.mapProductList = list.map(elem => {
return { value: elem.code, label: elem.name };
});
});
},
mapProductChange(prdCode) {
this.formModel.lessonId = '';
this.filterPublisLessonList = this.publisLessonList.filter(elem => { return elem.mapId == this.formModel.mapId && elem.prdCode == this.formModel.prdCode; });
},
// input
async querySearchAsync(queryString, cb) {
// queryString
const results = [];
if (queryString) {
try {
const params = {
fuzzyParam: queryString
};
const res = await getDimUserList(params);
const list = res.data;
list.forEach(item => {
const value = {
id: item.id,
value: `${item.nickname}(${item.name})${item.mobile}`
};
results.push(value);
});
cb(results);
} catch (error) {
cb(results);
}
} else {
cb(results);
}
},
prdSelect(item) {
this.formModel.ownerId = item.id;
},
doShow(data) {
this.show = true;
this.type = data.type;
if (!this.isAdd) {
const model = data.item;
this.formModel = {
permissionType: model.permissionType,
mapId: model.mapId,
lessonId: model.lessonId,
prdCode: model.prdCode,
date: [model.startTime, model.endTime],
amount: model.amount,
ownerId: this.formModel.ownerId,
roleName: this.formModel.roleName
};
}
this.formModel.amount = 0;
},
doClose() {
this.show = false;
},
draftRule() {
this.$refs.dataform.validateForm(() => {
if (this.formModel.amount <= this.maxTotal && this.formModel.amount) {
if (this.isAdd) {
this.$emit('addRuleForm', {
operator: OperatorModel.TRANSFER,
permissionType: this.formModel.permissionType,
mapId: this.isShowMap ? this.formModel.mapId : '',
lessonId: this.isShowLesson ? this.formModel.lessonId : '',
prdCode: this.isShowMapProduct ? this.formModel.prdCode : '',
startTime: this.formModel.date[0],
endTime: this.formModel.date[1],
amount: this.formModel.amount,
ownerId: this.formModel.ownerId,
roleName: this.formModel.roleName
});
} else {
this.$emit('editRuleForm', {
operator: OperatorModel.TRANSFER,
permissionType: this.formModel.permissionType,
mapId: this.isShowMap ? this.formModel.mapId : '',
lessonId: this.isShowLesson ? this.formModel.lessonId : '',
prdCode: this.isShowMapProduct ? this.formModel.prdCode : '',
startTime: this.formModel.date[0],
endTime: this.formModel.date[1],
amount: this.formModel.amount,
ownerId: this.formModel.ownerId,
roleName: this.formModel.roleName
});
}
this.doClose();
}
});
}
}
this.formModel.amount = 0;
},
doClose() {
this.show = false;
},
draftRule() {
this.$refs.dataform.validateForm(() => {
if (this.formModel.amount <= this.maxTotal && this.formModel.amount) {
if (this.isAdd) {
this.$emit('addRuleForm', {
operator: OperatorModel.TRANSFER,
permissionType: this.formModel.permissionType,
mapId: this.isShowMap ? this.formModel.mapId : '',
lessonId: this.isShowLesson ? this.formModel.lessonId : '',
prdCode: this.isShowMapProduct ? this.formModel.prdCode : '',
startTime: this.formModel.date[0],
endTime: this.formModel.date[1],
amount: this.formModel.amount,
ownerId: this.formModel.ownerId,
roleName: this.formModel.roleName
});
} else {
this.$emit('editRuleForm', {
operator: OperatorModel.TRANSFER,
permissionType: this.formModel.permissionType,
mapId: this.isShowMap ? this.formModel.mapId : '',
lessonId: this.isShowLesson ? this.formModel.lessonId : '',
prdCode: this.isShowMapProduct ? this.formModel.prdCode : '',
startTime: this.formModel.date[0],
endTime: this.formModel.date[1],
amount: this.formModel.amount,
ownerId: this.formModel.ownerId,
roleName: this.formModel.roleName
});
}
this.doClose();
}
});
}
}
};
</script>

View File

@ -70,7 +70,7 @@
</template>
<script>
import { listPublishMap, getPublishMapInfo } from '@/api/jmap/map';
import { listPublishMap } from '@/api/jmap/map';
import { getPublishLessonList } from '@/api/jmap/lesson';
import { getCommodityMapProduct } from '@/api/management/mapprd';
import { packagePermissionDistribute } from '@/api/management/distribute';
@ -79,187 +79,184 @@ import EditRule from './editRule';
import CanTransfer from './canDistribute';
export default {
name: 'PackRule',
components: {
EditRule,
QrCode,
CanTransfer
},
data() {
return {
display: 1,
urlInfo: {},
PermissionTypeList: [],
PublisLessonList: [],
PublishMapList: [],
mapProductList: [],
ruleList: []
};
},
computed: {
height() {
return this.$store.state.app.height - 63;
}
},
mounted() {
this.loadInitData();
},
methods: {
getSummaries(param) {
const { columns, data } = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = this.$t('global.totoal');
return;
}
name: 'PackRule',
components: {
EditRule,
QrCode,
CanTransfer
},
data() {
return {
display: 1,
urlInfo: {},
PermissionTypeList: [],
PublisLessonList: [],
PublishMapList: [],
mapProductList: [],
ruleList: []
};
},
computed: {
height() {
return this.$store.state.app.height - 63;
}
},
mounted() {
this.loadInitData();
},
methods: {
getSummaries(param) {
const { columns, data } = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = this.$t('global.totoal');
return;
}
if (index === 6) {
const values = data.map(item => Number(item[column.property]));
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
}
}
});
if (index === 6) {
const values = data.map(item => Number(item[column.property]));
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
}
}
});
return sums;
},
computedName(list, code) {
let name = '';
list.forEach(elem => {
if (elem.value == code) {
name = elem.label;
}
});
return name;
},
async computedMapProduct(item) {
let name = '';
const resp = await getPublishMapInfo(item.mapId);
const rest = await getCommodityMapProduct(resp.data.skinCode);
const list = rest.data || [];
list.forEach(elem => {
if (elem.id == item.mapProductCode) {
name = elem.name;
return;
}
});
return name;
},
loadInitData() {
this.PermissionTypeList = [];
this.$Dictionary.permissionType().then(list => {
this.PermissionTypeList = list.map(elem => {
return { value: elem.code, label: elem.name };
});
});
return sums;
},
computedName(list, code) {
let name = '';
list.forEach(elem => {
if (elem.value == code) {
name = elem.label;
}
});
return name;
},
async computedMapProduct(item) {
let name = '';
const rest = await getCommodityMapProduct(item.mapId);
const list = rest.data || [];
list.forEach(elem => {
if (elem.id == item.mapProductCode) {
name = elem.name;
return;
}
});
return name;
},
loadInitData() {
this.PermissionTypeList = [];
this.$Dictionary.permissionType().then(list => {
this.PermissionTypeList = list.map(elem => {
return { value: elem.code, label: elem.name };
});
});
this.EffectiveTypeList = [];
this.$Dictionary.effectiveType().then(list => {
this.EffectiveTypeList = list.map(elem => {
return { value: elem.code, label: elem.name };
});
});
this.EffectiveTypeList = [];
this.$Dictionary.effectiveType().then(list => {
this.EffectiveTypeList = list.map(elem => {
return { value: elem.code, label: elem.name };
});
});
this.PublishMapList = [];
listPublishMap().then(response => {
const list = response.data || [];
this.PublishMapList = list.map(elem => {
return { value: elem.id, label: elem.name };
});
});
this.PublishMapList = [];
listPublishMap().then(response => {
const list = response.data || [];
this.PublishMapList = list.map(elem => {
return { value: elem.id, label: elem.name };
});
});
this.PublisLessonList = [];
getPublishLessonList().then(response => {
const list = response.data || [];
this.PublisLessonList = list.map(elem => {
return { value: elem.id, label: elem.name, mapId: elem.mapId, prdCode: elem.prdCode };
});
});
},
turnback() {
this.$router.go(-1);
},
dialogAdd() {
this.$refs.addRule.doShow({ type: 'add' });
},
dialogEdit(item) {
this.$refs.addRule.doShow({ type: 'edit', item: item });
},
deleteForm(item) {
var index = this.ruleList.indexOf(item);
if (index >= 0) {
this.ruleList.splice(index, 1);
}
},
addRuleForm(item) {
const index = this.ruleList.findIndex(elem => {
return item.mapId == elem.mapId &&
this.PublisLessonList = [];
getPublishLessonList().then(response => {
const list = response.data || [];
this.PublisLessonList = list.map(elem => {
return { value: elem.id, label: elem.name, mapId: elem.mapId, prdCode: elem.prdCode };
});
});
},
turnback() {
this.$router.go(-1);
},
dialogAdd() {
this.$refs.addRule.doShow({ type: 'add' });
},
dialogEdit(item) {
this.$refs.addRule.doShow({ type: 'edit', item: item });
},
deleteForm(item) {
var index = this.ruleList.indexOf(item);
if (index >= 0) {
this.ruleList.splice(index, 1);
}
},
addRuleForm(item) {
const index = this.ruleList.findIndex(elem => {
return item.mapId == elem.mapId &&
item.lessonId == elem.lessonId &&
item.prdCode == elem.prdCode &&
item.permissionType == elem.permissionType;
});
getPublishMapInfo(item.mapId).then(resp => {
getCommodityMapProduct(resp.data.skinCode).then(rest => {
const list = rest.data || [];
this.mapProductList = list.map(elem => {
return { value: elem.code, label: elem.name };
});
});
});
if (index < 0) {
this.ruleList.push(item);
} else {
this.$message.warning(this.$t('permission.hasExitRule'));
}
},
editRuleForm(item) {
const index = this.ruleList.findIndex(elem => {
return item.mapId == elem.mapId &&
});
getCommodityMapProduct(item.mapId).then(rest => {
const list = rest.data || [];
this.mapProductList = list.map(elem => {
return { value: elem.code, label: elem.name };
});
});
if (index < 0) {
this.ruleList.push(item);
} else {
this.$message.warning(this.$t('permission.hasExitRule'));
}
},
editRuleForm(item) {
const index = this.ruleList.findIndex(elem => {
return item.mapId == elem.mapId &&
item.lessonId == elem.lessonId &&
item.mapProductCode == elem.mapProductCode &&
item.permissionType == elem.permissionType;
});
});
if (index >= 0) {
Object.assign(this.ruleList[index], item);
}
},
packForm() {
if (this.ruleList.length) {
this.$refs.canDistribute.doShow();
} else {
this.$messageBox(this.$t('permission.pleaseAddRule'));
}
},
distribute(data) {
this.url = '';
this.ruleList.forEach(item => {
item.canDistribute = data.canDistribute;
});
packagePermissionDistribute(this.ruleList).then(resp => {
this.urlInfo = {
url: resp.data,
title: this.$t('global.distributeQrcode')
};
this.qrcodeShow();
}).catch(() => {
this.$messageBox(this.$t('error.packagePermissionFailed'));
});
},
qrcodeShow() {
if (this.$refs) {
this.$refs.qrCode.doShow(this.urlInfo);
}
}
}
if (index >= 0) {
Object.assign(this.ruleList[index], item);
}
},
packForm() {
if (this.ruleList.length) {
this.$refs.canDistribute.doShow();
} else {
this.$messageBox(this.$t('permission.pleaseAddRule'));
}
},
distribute(data) {
this.url = '';
this.ruleList.forEach(item => {
item.canDistribute = data.canDistribute;
});
packagePermissionDistribute(this.ruleList).then(resp => {
this.urlInfo = {
url: resp.data,
title: this.$t('global.distributeQrcode')
};
this.qrcodeShow();
}).catch(() => {
this.$messageBox(this.$t('error.packagePermissionFailed'));
});
},
qrcodeShow() {
if (this.$refs) {
this.$refs.qrCode.doShow(this.urlInfo);
}
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -1,43 +1,47 @@
<template>
<el-card :style="{height: height+'px'}" style="overflow-y:scroll;padding-bottom:20px;">
<div class="runPlanHeader" style="width: 90%;margin-left:5%;margin-top:20px;display: inline-block;">
<div class="runPlanList">{{$t('planMonitor.openRunPlan.runPlanList')}}</div>
<el-button size="small" type="primary" @click="handleCreate" class="createRunPlan" v-if="isCreate">{{$t('planMonitor.createRunningDiagram')}}</el-button>
</div>
<el-table :data="runPlanList" height="500" stripe
border
style="width: 90%;margin-left:5%;margin-top:20px;display: inline-block;">
<el-table-column prop="name" :label="this.$t('planMonitor.runGraphName')" />
<el-table-column :label="this.$t('global.status')" v-if="!(/^\/design\/userlist/.test(this.$route.fullPath))">
<template slot-scope="scope">
<el-tag>{{handlerStatus(scope.row)}}</el-tag>
</template>
</el-table-column>
<el-table-column
prop="explanation"
show-overflow-tooltip
v-if="!(/^\/design\/userlist/.test(this.$route.fullPath))"
:label="this.$t('planMonitor.explanation')">
</el-table-column>
<el-table-column :label="this.$t('planMonitor.creationDate')">
<template slot-scope="scope">
<el-tag type="success">{{handleTime(scope.row.createTime)}}</el-tag>
</template>
</el-table-column>
<el-table-column :label="this.$t('global.operate')" width="400">
<template slot-scope="scope">
<el-button size="mini" class="button_box" type="success" @click="handleConfirm(scope.row)" v-if="scope.row.status !=='1'">{{$t('planMonitor.load')}}</el-button>
<el-button size="mini" class="button_box" type="primary" @click="handleEdit(scope.row)" v-if="isCreate && scope.row.status !=='1'">{{$t('planMonitor.modifyName')}}</el-button>
<el-button size="mini" class="button_box" type="danger" @click="handleDelete(scope.row)" v-if="isCreate && scope.row.status !=='1'">{{$t('global.delete')}}</el-button>
<el-button size="mini" class="button_box" type="primary" @click="handlePublish(scope.row)" v-if="isCreate && scope.row.status ==='0'">{{hasRelease?$t('global.release'):$t('planMonitor.applyRelease')}}</el-button>
<el-button size="mini" class="button_box" type="primary" @click="handlePreview(scope.row)" v-if="scope.row.status === '1'">{{$t('planMonitor.preview')}}</el-button>
<el-button size="mini" class="button_box" type="danger" @click="handelRevert(scope.row)" v-if="scope.row.status === '1'" >{{$t('planMonitor.revoke')}}</el-button>
</template>
</el-table-column>
</el-table>
<create-empty-plan ref="createEmptyPlan" :plan-convert="PlanConvert" @dispatchDialog="dispatchDialog" @refresh="refresh"/>
<!-- @dispatchOperate="dispatchOperate" -->
<edit-plan-name ref="editPlan" @renewal="getRunPlanList" />
<div class="runPlanHeader" style="width: 90%;margin-left:5%;margin-top:20px;display: inline-block;">
<div class="runPlanList">{{ $t('planMonitor.openRunPlan.runPlanList') }}</div>
<el-button v-if="isCreate" size="small" type="primary" class="createRunPlan" @click="handleCreate">{{ $t('planMonitor.createRunningDiagram') }}</el-button>
</div>
<el-table
:data="runPlanList"
height="500"
stripe
border
style="width: 90%;margin-left:5%;margin-top:20px;display: inline-block;"
>
<el-table-column prop="name" :label="this.$t('planMonitor.runGraphName')" />
<el-table-column v-if="!(/^\/design\/userlist/.test(this.$route.fullPath))" :label="this.$t('global.status')">
<template slot-scope="scope">
<el-tag>{{ handlerStatus(scope.row) }}</el-tag>
</template>
</el-table-column>
<el-table-column
v-if="!(/^\/design\/userlist/.test(this.$route.fullPath))"
prop="explanation"
show-overflow-tooltip
:label="this.$t('planMonitor.explanation')"
/>
<el-table-column :label="this.$t('planMonitor.creationDate')">
<template slot-scope="scope">
<el-tag type="success">{{ handleTime(scope.row.createTime) }}</el-tag>
</template>
</el-table-column>
<el-table-column :label="this.$t('global.operate')" width="400">
<template slot-scope="scope">
<el-button v-if="scope.row.status !=='1'" size="mini" class="button_box" type="success" @click="handleConfirm(scope.row)">{{ $t('planMonitor.load') }}</el-button>
<el-button v-if="isCreate && scope.row.status !=='1'" size="mini" class="button_box" type="primary" @click="handleEdit(scope.row)">{{ $t('planMonitor.modifyName') }}</el-button>
<el-button v-if="isCreate && scope.row.status !=='1'" size="mini" class="button_box" type="danger" @click="handleDelete(scope.row)">{{ $t('global.delete') }}</el-button>
<el-button v-if="isCreate && scope.row.status ==='0'" size="mini" class="button_box" type="primary" @click="handlePublish(scope.row)">{{ hasRelease?$t('global.release'):$t('planMonitor.applyRelease') }}</el-button>
<el-button v-if="scope.row.status === '1'" size="mini" class="button_box" type="primary" @click="handlePreview(scope.row)">{{ $t('planMonitor.preview') }}</el-button>
<el-button v-if="scope.row.status === '1'" size="mini" class="button_box" type="danger" @click="handelRevert(scope.row)">{{ $t('planMonitor.revoke') }}</el-button>
</template>
</el-table-column>
</el-table>
<create-empty-plan ref="createEmptyPlan" :plan-convert="PlanConvert" @dispatchDialog="dispatchDialog" @refresh="refresh" />
<!-- @dispatchOperate="dispatchOperate" -->
<edit-plan-name ref="editPlan" @renewal="getRunPlanList" />
</el-card>
</template>
<script>
@ -48,156 +52,154 @@ import { getRpListByMapId, deleteRunPlan } from '@/api/runplan';
import { launchFullscreen } from '@/utils/screen';
import { UrlConfig } from '@/router/index';
export default {
name: 'userRunPlanList',
components: {
CreateEmptyPlan,
EditPlanName
// LimitList
},
filters: {
},
data() {
return {
dialogShow: false,
loading: false,
// height: 260,
// planId: '',
// planName: '',
type: 'add',
// defaultShowKeys: [],
runPlanList: [],
runPlanDict: {},
isCreate:false,
PlanConvert: {}
// defaultProps: {
// label: 'name'
// }
};
},
computed: {
height() {
return this.$store.state.app.height - 60 -30;
},
skinCode() {
return this.$route.query.skinCode || '02';
},
name: 'UserRunPlanList',
components: {
CreateEmptyPlan,
EditPlanName
// LimitList
},
filters: {
},
data() {
return {
dialogShow: false,
loading: false,
// height: 260,
// planId: '',
// planName: '',
type: 'add',
// defaultShowKeys: [],
runPlanList: [],
runPlanDict: {},
isCreate:false,
PlanConvert: {}
// defaultProps: {
// label: 'name'
// }
};
},
computed: {
height() {
return this.$store.state.app.height - 60 - 30;
},
skinCode() {
return this.$route.query.skinCode || '02';
},
hasRelease() {
return this.$store.state.user.roles.includes('04') ||
this.$store.state.user.roles.includes('05');
}
},
created(){
this.PlanConvert = this.$theme.loadPlanConvert(this.$route.query.skinCode);
},
mounted(){
this.getRunPlanList();
},
watch: {
'$route' () {
this.getRunPlanList();
}
},
methods:{
refresh(){
this.getRunPlanList();
},
getRunPlanList() {
if(/^\/design\/userlist/.test(this.$route.fullPath)){
this.isCreate=false;
getRpListByUserMapId(this.$route.params.mapId).then((resp) => {
this.runPlanList = resp.data;
this.runPlanList.forEach(elem => {
this.runPlanDict[elem.id] = elem.name;
});
// this.dialogShow = true;
}).catch(() => {
this.$messageBox(this.$t('planMonitor.openRunPlan.getRunPlanListFail'));
});
}
else{
this.isCreate=true;
getRpListByMapId(this.$route.params.mapId).then((resp) => {
this.runPlanList = resp.data;
this.runPlanList.forEach(elem => {
this.runPlanDict[elem.id] = elem.name;
});
// this.dialogShow = true;
}).catch(() => {
this.$messageBox(this.$t('planMonitor.openRunPlan.getRunPlanListFail'));
});
}
},
// dispatchOperate(){
// this.$refs[operateObj.dialogName][operateObj.operate](operateObj.params);
// },
dispatchDialog(){
this.$refs['createEmptyPlan'].doShow();
},
handleCreate(){
this.$refs['createEmptyPlan'].doShow();
},
handleConfirm(row){
this.loadRunPlanData({
planId: row.id,
skinCode: this.$route.query.skinCode,
planName: row.name
});
},
//
handleEdit(row) {
if (row.id && row.name) {
this.$refs.editPlan.doShow({id: row.id, name: row.name});
} else {
this.$message.info(this.$t('planMonitor.openRunPlan.pleaseSelectRunplan'));
}
},
loadRunPlanData({ refresh, planId, skinCode, planName }) {
if (refresh) {
this.$store.dispatch('runPlan/refresh');
} else {
const query = { skinCode: skinCode, mapId: this.$route.params.mapId, planId: planId, planName: planName };
if(/^\/design\/userlist/.test(this.$route.fullPath)){
this.$router.push({ path: `${UrlConfig.plan.usertool}`, query: query });
}
else{
this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query });
}
}
},
//
handleDelete(row) {
this.$confirm(this.$t('planMonitor.openRunPlan.confirmDeleteRunPlan'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
type: 'warning'
}).then(() => {
deleteRunPlan(row.id).then(Response => {
this.$message.success(this.$t('planMonitor.openRunPlan.deleteSuccess'));
// if (row.id === this.$route.query.planId) {
// const query = { skinCode: this.$route.query.skinCode, mapId: this.$route.query.mapId };
// this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query });
// }
this.refresh();
// this.doClose();
}).catch(() => {
this.$messageBox(this.$t('tip.deleteOperationGraphFailed'));
});
}).catch(() => { });
},
handlePublish(row) {
this.$confirm(this.hasRelease? this.$t('tip.publishRunPlanTips'):this.$t('tip.applyRunPlanTips'),this.$t('tip.hint'),{
},
watch: {
'$route' () {
this.getRunPlanList();
}
},
created() {
this.PlanConvert = this.$theme.loadPlanConvert(this.$route.query.skinCode);
},
mounted() {
this.getRunPlanList();
},
methods:{
refresh() {
this.getRunPlanList();
},
getRunPlanList() {
if (/^\/design\/userlist/.test(this.$route.fullPath)) {
this.isCreate = false;
getRpListByUserMapId(this.$route.params.mapId).then((resp) => {
this.runPlanList = resp.data;
this.runPlanList.forEach(elem => {
this.runPlanDict[elem.id] = elem.name;
});
// this.dialogShow = true;
}).catch(() => {
this.$messageBox(this.$t('planMonitor.openRunPlan.getRunPlanListFail'));
});
} else {
this.isCreate = true;
getRpListByMapId(this.$route.params.mapId).then((resp) => {
this.runPlanList = resp.data;
this.runPlanList.forEach(elem => {
this.runPlanDict[elem.id] = elem.name;
});
// this.dialogShow = true;
}).catch(() => {
this.$messageBox(this.$t('planMonitor.openRunPlan.getRunPlanListFail'));
});
}
},
// dispatchOperate(){
// this.$refs[operateObj.dialogName][operateObj.operate](operateObj.params);
// },
dispatchDialog() {
this.$refs['createEmptyPlan'].doShow();
},
handleCreate() {
this.$refs['createEmptyPlan'].doShow();
},
handleConfirm(row) {
this.loadRunPlanData({
planId: row.id,
skinCode: this.$route.query.skinCode,
planName: row.name
});
},
//
handleEdit(row) {
if (row.id && row.name) {
this.$refs.editPlan.doShow({id: row.id, name: row.name});
} else {
this.$message.info(this.$t('planMonitor.openRunPlan.pleaseSelectRunplan'));
}
},
loadRunPlanData({ refresh, planId, skinCode, planName }) {
if (refresh) {
this.$store.dispatch('runPlan/refresh');
} else {
const query = { skinCode: skinCode, mapId: this.$route.params.mapId, planId: planId, planName: planName };
if (/^\/design\/userlist/.test(this.$route.fullPath)) {
this.$router.push({ path: `${UrlConfig.plan.usertool}`, query: query });
} else {
this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query });
}
}
},
//
handleDelete(row) {
this.$confirm(this.$t('planMonitor.openRunPlan.confirmDeleteRunPlan'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
type: 'warning'
}).then(() => {
if (this.hasRelease){
publishRunPlan(row.id,{runPlanName: name}).then(resp => {
deleteRunPlan(row.id).then(Response => {
this.$message.success(this.$t('planMonitor.openRunPlan.deleteSuccess'));
// if (row.id === this.$route.query.planId) {
// const query = { skinCode: this.$route.query.skinCode, mapId: this.$route.query.mapId };
// this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query });
// }
this.refresh();
// this.doClose();
}).catch(() => {
this.$messageBox(this.$t('tip.deleteOperationGraphFailed'));
});
}).catch(() => { });
},
handlePublish(row) {
this.$confirm(this.hasRelease ? this.$t('tip.publishRunPlanTips') : this.$t('tip.applyRunPlanTips'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
type: 'warning'
}).then(() => {
if (this.hasRelease) {
publishRunPlan(row.id, {runPlanName: name}).then(resp => {
this.$message.success(this.$t('tip.publishRunPlanSuccess'));
this.refresh();
}).catch(() => {
this.$messageBox(this.$t('tip.publishRunPlanFail'));
this.refresh();
})
});
} else {
releaseOrCancelRunPlan(row.id, '1').then(resp => {
this.$message.success(this.$t('tip.applyRunPlanSuccess'));
@ -205,58 +207,58 @@ export default {
}).catch(() => {
this.$messageBox(this.$t('tip.applyRunPlanFail'));
this.refresh();
})
});
}
});
},
handelRevert(row) {
this.$confirm(this.$t('tip.cancelRunPlanTips'),this.$t('tip.hint'),{
this.$confirm(this.$t('tip.cancelRunPlanTips'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
type:'warning'
}).then(() => {
releaseOrCancelRunPlan(row.id,'0').then(resp=> {
releaseOrCancelRunPlan(row.id, '0').then(resp=> {
this.$message.success(this.$t('tip.cancelRunPlanSuccess'));
this.refresh();
}).catch(() => {
this.$messageBox(this.$t('tip.cancelRunPlanFail'))
this.$messageBox(this.$t('tip.cancelRunPlanFail'));
this.refresh();
})
})
});
});
},
handlerStatus(row) {
let lessonStatus = '';
switch (row.status){
case '0':
lessonStatus = this.$t('lesson.notRelease');
break;
case '1':
lessonStatus = this.$t('lesson.pendingReview');
break;
case '2':
lessonStatus = this.$t('lesson.published');
break;
case '3':
lessonStatus = this.$t('lesson.rejected');
break;
switch (row.status) {
case '0':
lessonStatus = this.$t('lesson.notRelease');
break;
case '1':
lessonStatus = this.$t('lesson.pendingReview');
break;
case '2':
lessonStatus = this.$t('lesson.published');
break;
case '3':
lessonStatus = this.$t('lesson.rejected');
break;
}
return lessonStatus;
},
handleTime(time) {
return time.replace("T"," ");
return time.replace('T', ' ');
},
handlePreview(row){
handlePreview(row) {
previewRunPlan(row.id).then(resp => {
const query = {
skinCode: row.skinCode, prdType: '01', group: resp.data, mapId: row.mapId, planId: row.id,from:''
skinCode: row.skinCode, prdType: '01', group: resp.data, mapId: row.mapId, planId: row.id, from:''
};
this.$router.push({ path: `${UrlConfig.display}/plan`, query: query });
launchFullscreen();
}).catch(error => {
this.$messageBox(this.$t('tip.createSimulationFaild')+this.$t('global.colon')+error.message);
this.$messageBox(this.$t('tip.createSimulationFaild') + this.$t('global.colon') + error.message);
});
}
}
}
};
</script>
<style scoped>

View File

@ -12,7 +12,7 @@
>
<div>
<el-tabs v-model="activeTab" type="card">
<el-tab-pane :label="this.$t('planMonitor.normalNew')" name="first">
<el-tab-pane :label="this.$t('planMonitor.normalNew')" name="first">
<el-row>
<el-form ref="form" :model="newModel" label-width="140px" size="mini" :rules="rules" @submit.native.prevent>
<el-form-item :label="this.$t('planMonitor.runGraphName')+this.$t('global.colon')" prop="name">
@ -69,196 +69,196 @@ import { UrlConfig } from '@/router/index';
import XLSX from 'xlsx';
export default {
name: 'CreateEmptyPlan',
components: {
},
props: {
planConvert: {
type: Object,
default: function() {
return { };
}
}
},
data() {
return {
activeTab: 'second',
dialogShow: false,
loading: false,
loadingDig: null,
publishMapList: [],
newModel: {
name: '',
skinCode: this.$route.query.skinCode
},
pullModel: {
templateId: '',
name: '',
skinCode: this.$route.query.skinCode
}
};
},
computed: {
title() {
return this.$t('planMonitor.newRunGraph');
},
rules() {
return {
name: [
{ required: true, message: this.$t('rules.enterTheNameOfTheRunGraph'), trigger: 'blur' }
]
};
},
pullRules() {
return {
templateId: [
{ required: true, message: this.$t('rules.chooseToPublishTheRunGraph'), trigger: 'change' }
],
name: [
{ required: true, message: this.$t('rules.enterTheNameOfTheRunGraph'), trigger: 'blur' }
]
};
}
},
mounted() {
name: 'CreateEmptyPlan',
components: {
},
props: {
planConvert: {
type: Object,
default: function() {
return { };
}
}
},
data() {
return {
activeTab: 'second',
dialogShow: false,
loading: false,
loadingDig: null,
publishMapList: [],
newModel: {
name: '',
skinCode: this.$route.query.skinCode
},
pullModel: {
templateId: '',
name: '',
skinCode: this.$route.query.skinCode
}
};
},
computed: {
title() {
return this.$t('planMonitor.newRunGraph');
},
rules() {
return {
name: [
{ required: true, message: this.$t('rules.enterTheNameOfTheRunGraph'), trigger: 'blur' }
]
};
},
pullRules() {
return {
templateId: [
{ required: true, message: this.$t('rules.chooseToPublishTheRunGraph'), trigger: 'change' }
],
name: [
{ required: true, message: this.$t('rules.enterTheNameOfTheRunGraph'), trigger: 'blur' }
]
};
}
},
mounted() {
},
methods: {
async initLoad() {
const res = await queryRunPlanList(this.$route.query.skinCode);
if (res.code == 200 && res.data.length) {
this.publishMapList = res.data;
}
},
doShow() {
this.dialogShow = true;
this.initLoad();
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.newModel.name = '';
this.pullModel.templateId = '';
this.pullModel.name = '';
if (this.$refs.form) {
this.$refs.form.resetFields();
}
if (this.$refs.pullForm) {
this.$refs.pullForm.resetFields();
}
},
handleCommit() {
if (this.activeTab === 'first') {
this.$refs['form'].validate((valid) => {
if (valid) {
this.loading = true;
createEmptyPlan(this.newModel).then(resp => {
const params = {
dialogName: 'openRunPlan',
operate: 'loadRunPlanData',
params: { planId: resp.data, skinCode: this.$route.query.skinCode, planName: this.newModel.name, refresh: true }
};
this.$emit('refresh');
// this.$emit('dispatchOperate', params);
this.$message.success(this.$t('tip.createAnEmptyRunGraphSuccessfully'));
// this.jump(resp.data, this.newModel.name);
this.doClose();
}).catch((error) => {
this.$messageBox(this.$t('error.createOperationGraphFailed')+ this.$t('global.colon') + error.message);
this.doClose();
});
}
});
} else {
this.$refs['pullForm'].validate((valid) => {
if (valid) {
this.loading = true;
postCreatePlan(this.pullModel).then(resp => {
this.$message.success(this.$t('tip.createARunGraphSuccessfully'));
// this.jump(resp.data, this.pullModel.name);
this.$emit('refresh');
this.doClose();
}).catch((error) => {
this.$messageBox(this.$t('error.createOperationGraphFailed')+ this.$t('global.colon') + error.message);
this.doClose();
});
}
});
}
},
importf(item) {
const obj = this.$refs.files;
if (obj.files) {
const file = obj.files[0];
this.handleImportRunPlan(file);
obj.value = '';
}
},
loadingScreen() {
this.loadingDig = this.$loading({
lock: true,
text: this.$t('tip.underImport'),
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
},
//
handleImportRunPlan(file) {
if (file) {
this.loadingScreen();
setTimeout(() => {
const that = this;
const reader = new FileReader();
if (reader) {
reader.onload = function (e) {
let wb;
const data = e.target.result;
if (that.rABS) {
wb = XLSX.read(btoa(that.fixdata(data)), { //
type: 'base64'
});
} else {
wb = XLSX.read(data, {
type: 'binary'
});
}
if (wb) {
try {
let jsonData = [];
for (const index in wb.Sheets) {
jsonData = that.planConvert.importData(wb.Sheets[index], jsonData);
}
},
methods: {
async initLoad() {
const res = await queryRunPlanList(this.$route.params.mapId);
if (res.code == 200 && res.data.length) {
this.publishMapList = res.data;
}
},
doShow() {
this.dialogShow = true;
this.initLoad();
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.newModel.name = '';
this.pullModel.templateId = '';
this.pullModel.name = '';
if (this.$refs.form) {
this.$refs.form.resetFields();
}
if (this.$refs.pullForm) {
this.$refs.pullForm.resetFields();
}
},
handleCommit() {
if (this.activeTab === 'first') {
this.$refs['form'].validate((valid) => {
if (valid) {
this.loading = true;
createEmptyPlan(this.newModel).then(resp => {
const params = {
dialogName: 'openRunPlan',
operate: 'loadRunPlanData',
params: { planId: resp.data, skinCode: this.$route.query.skinCode, planName: this.newModel.name, refresh: true }
};
this.$emit('refresh');
// this.$emit('dispatchOperate', params);
this.$message.success(this.$t('tip.createAnEmptyRunGraphSuccessfully'));
// this.jump(resp.data, this.newModel.name);
this.doClose();
}).catch((error) => {
this.$messageBox(this.$t('error.createOperationGraphFailed') + this.$t('global.colon') + error.message);
this.doClose();
});
}
});
} else {
this.$refs['pullForm'].validate((valid) => {
if (valid) {
this.loading = true;
postCreatePlan(this.pullModel).then(resp => {
this.$message.success(this.$t('tip.createARunGraphSuccessfully'));
// this.jump(resp.data, this.pullModel.name);
this.$emit('refresh');
this.doClose();
}).catch((error) => {
this.$messageBox(this.$t('error.createOperationGraphFailed') + this.$t('global.colon') + error.message);
this.doClose();
});
}
});
}
},
importf(item) {
const obj = this.$refs.files;
if (obj.files) {
const file = obj.files[0];
this.handleImportRunPlan(file);
obj.value = '';
}
},
loadingScreen() {
this.loadingDig = this.$loading({
lock: true,
text: this.$t('tip.underImport'),
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
},
//
handleImportRunPlan(file) {
if (file) {
this.loadingScreen();
setTimeout(() => {
const that = this;
const reader = new FileReader();
if (reader) {
reader.onload = function (e) {
let wb;
const data = e.target.result;
if (that.rABS) {
wb = XLSX.read(btoa(that.fixdata(data)), { //
type: 'base64'
});
} else {
wb = XLSX.read(data, {
type: 'binary'
});
}
if (wb) {
try {
let jsonData = [];
for (const index in wb.Sheets) {
jsonData = that.planConvert.importData(wb.Sheets[index], jsonData);
}
importRunPlan({ mapId: that.$route.params.mapId || '02', runPlanList: jsonData }).then(response => {
that.loadingDig.close();
that.$message.success(that.$t('tip.importOperationGraphSuccessfully'));
// this.$emit('dispatchDialog', { name: 'openRunPlan', params: {type: 'add'} });
}).catch(error => {
that.loadingDig.close();
that.$message.warning(`${that.$t('tip.importRunGraphFailed')} ${error.message}`);
});
importRunPlan({ mapId: that.$route.params.mapId || '02', runPlanList: jsonData }).then(response => {
that.loadingDig.close();
that.$message.success(that.$t('tip.importOperationGraphSuccessfully'));
// this.$emit('dispatchDialog', { name: 'openRunPlan', params: {type: 'add'} });
}).catch(error => {
that.loadingDig.close();
that.$message.warning(`${that.$t('tip.importRunGraphFailed')} ${error.message}`);
});
} catch (error) {
that.loadingDig.close();
that.$message.warning(`${that.$t('tip.parseRunGraphFailed')} ${error.message}`);
}
}
};
if (that.rABS) {
reader.readAsArrayBuffer(file);
} else {
reader.readAsBinaryString(file);
}
}
}, 200);
}
this.doClose();
},
jump(planId, planName) {
const query = { skinCode: this.$route.query.skinCode, mapId: this.$route.query.mapId, planId: planId, planName: planName };
this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query });
}
}
} catch (error) {
that.loadingDig.close();
that.$message.warning(`${that.$t('tip.parseRunGraphFailed')} ${error.message}`);
}
}
};
if (that.rABS) {
reader.readAsArrayBuffer(file);
} else {
reader.readAsBinaryString(file);
}
}
}, 200);
}
this.doClose();
},
jump(planId, planName) {
const query = { skinCode: this.$route.query.skinCode, mapId: this.$route.query.mapId, planId: planId, planName: planName };
this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query });
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>

File diff suppressed because it is too large Load Diff

View File

@ -28,22 +28,22 @@ import home2 from '@/assets/home/plan2.png';
import home3 from '@/assets/home/plan3.png';
export default {
name: 'Home',
data() {
return {
listImg: [
{ src: home1 },
{ src: home2 },
{ src: home3 }
],
logo: logo
};
},
computed: {
height() {
return this.$store.state.app.height;
}
}
name: 'Home',
data() {
return {
listImg: [
{ src: home1 },
{ src: home2 },
{ src: home3 }
],
logo: logo
};
},
computed: {
height() {
return this.$store.state.app.height;
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -19,38 +19,38 @@ import drapLeft from '@/views/components/drapLeft/index';
import localStore from 'storejs';
export default {
name: 'Exam',
components: {
planList,
drapLeft
},
data() {
return {
listShow: true,
widthLeft: Number(localStore.get('LeftWidth')) || 450
};
},
computed: {
...mapGetters([
'lessonbar'
]),
height() {
return this.$store.state.app.height;
}
},
watch: {
'lessonbar.opened': function (val) {
this.listShow = val;
}
},
methods: {
refresh() {
this.$refs && this.$refs.planList && this.$refs.planList.refresh();
},
drapWidth(width) {
this.widthLeft = Number(width);
}
}
name: 'Exam',
components: {
planList,
drapLeft
},
data() {
return {
listShow: true,
widthLeft: Number(localStore.get('LeftWidth')) || 450
};
},
computed: {
...mapGetters([
'lessonbar'
]),
height() {
return this.$store.state.app.height;
}
},
watch: {
'lessonbar.opened': function (val) {
this.listShow = val;
}
},
methods: {
refresh() {
this.$refs && this.$refs.planList && this.$refs.planList.refresh();
},
drapWidth(width) {
this.widthLeft = Number(width);
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -15,174 +15,174 @@ import MapSelect from './mapSelect';
import CopyPlan from './copyPlan.vue';
export default {
name: 'RunPlanTemplate',
components: {
MapSelect,
CopyPlan
},
data() {
return {
skinCodeList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '140px',
reset: true,
queryObject: {
name: {
type: 'text',
label: this.$t('publish.runPlanName')
},
skinCode: {
type: 'select',
label: this.$t('publish.skinType'),
config: {
data: []
}
}
}
},
queryList: {
query: runPlanTemplateList,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: this.$t('publish.runPlanName'),
prop: 'name'
},
{
title: this.$t('publish.skinType'),
prop: 'skinCode',
type: 'tag',
columnValue: (row) => {
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
},
tagType: (row) => { return ''; }
},
{
title: this.$t('publish.createTime'),
prop: 'createTime'
},
{
type: 'button',
title: this.$t('global.operate'),
width: '450',
hide: () => { return this.$store.state.user.roles.indexOf(superAdmin) < 0; },
buttons: [
{
name: this.$t('global.delete'),
handleClick: this.handleDelete,
type: 'danger'
},
{
name: this.$t('publish.generateRunPlan'),
handleClick: this.handleMapSelect,
type: ''
},
{
name: this.$t('publish.copyRunPlan'),
handleClick: this.handleCopyPlan,
type: ''
},
{
name: this.$t('global.preview'),
handleClick: this.handleView,
type: ''
}
]
}
]
},
name: 'RunPlanTemplate',
components: {
MapSelect,
CopyPlan
},
data() {
return {
skinCodeList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '140px',
reset: true,
queryObject: {
name: {
type: 'text',
label: this.$t('publish.runPlanName')
},
skinCode: {
type: 'select',
label: this.$t('publish.skinType'),
config: {
data: []
}
}
}
},
queryList: {
query: runPlanTemplateList,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: this.$t('publish.runPlanName'),
prop: 'name'
},
{
title: this.$t('publish.skinType'),
prop: 'skinCode',
type: 'tag',
columnValue: (row) => {
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
},
tagType: (row) => { return ''; }
},
{
title: this.$t('publish.createTime'),
prop: 'createTime'
},
{
type: 'button',
title: this.$t('global.operate'),
width: '450',
hide: () => { return this.$store.state.user.roles.indexOf(superAdmin) < 0; },
buttons: [
{
name: this.$t('global.delete'),
handleClick: this.handleDelete,
type: 'danger'
},
{
name: this.$t('publish.generateRunPlan'),
handleClick: this.handleMapSelect,
type: ''
},
{
name: this.$t('publish.copyRunPlan'),
handleClick: this.handleCopyPlan,
type: ''
},
{
name: this.$t('global.preview'),
handleClick: this.handleView,
type: ''
}
]
}
]
},
currentModel: {}
};
},
created() {
this.loadInitData();
},
methods: {
loadInitData() {
this.skinCodeList = [];
getSkinCodeList().then(response => {
this.skinCodeList = response.data;
response.data.forEach(elem => {
this.queryForm.queryObject.skinCode.config.data.push({ value: elem.code, label: elem.name });
});
});
},
//
handleDelete(index, row) {
this.$confirm(this.$t('publish.wellDelTemplate'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
deleteRunPlanTemplate(row.id).then(response => {
this.$message.success(this.$t('publish.deleteSuccess'));
this.reloadTable();
}).catch(error => {
this.reloadTable();
if (error.code == 500) {
this.$messageBox(this.$t('error.deleteFailed'));
} else if (error.code == 500009) {
this.$messageBox(this.$t('error.templateHasBeUse'));
}
});
}).catch(() => { });
},
//
handleMapSelect(index, row) {
this.$refs.map.doShow(row);
},
//
handleCopyPlan(index, row) {
this.$refs.copyPlan.doShow(row);
},
//
handleGenerateEveryDay({planId, mapId}) {
this.$confirm(this.$t('publish.wellGenerateEveryRunPlan'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
generateCommonRunPlanEveryDay(planId, {mapId}).then(response => {
this.reloadTable();
this.$refs.map.doClose();
this.$message.success(this.$t('publish.createCommonSuccess'));
}).catch(() => {
this.reloadTable();
this.$messageBox(this.$t('error.operationFailure'));
});
}).catch(() => { });
},
//
handleCopyRunPlan(data) {
this.$confirm(this.$t('publish.copyRunPlanContinue'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
postRunPlanTemplate({ id: data.id, skinCode: data.skinCode, name: data.name }).then(response => {
this.reloadTable();
this.$refs.copyPlan.doClose();
this.$message.success(this.$t('publish.createCommonSuccess'));
}).catch(() => {
this.reloadTable();
this.$messageBox(this.$t('error.operationFailure'));
});
}).catch(() => { });
},
//
handleView(index, row) {
this.$router.push({ path: `${UrlConfig.publish.runPlanView}/template`, query: { skinCode: row.skinCode, planId: row.id } });
},
reloadTable() {
this.queryList.reload();
}
}
currentModel: {}
};
},
created() {
this.loadInitData();
},
methods: {
loadInitData() {
this.skinCodeList = [];
getSkinCodeList().then(response => {
this.skinCodeList = response.data;
response.data.forEach(elem => {
this.queryForm.queryObject.skinCode.config.data.push({ value: elem.code, label: elem.name });
});
});
},
//
handleDelete(index, row) {
this.$confirm(this.$t('publish.wellDelTemplate'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
deleteRunPlanTemplate(row.id).then(response => {
this.$message.success(this.$t('publish.deleteSuccess'));
this.reloadTable();
}).catch(error => {
this.reloadTable();
if (error.code == 500) {
this.$messageBox(this.$t('error.deleteFailed'));
} else if (error.code == 500009) {
this.$messageBox(this.$t('error.templateHasBeUse'));
}
});
}).catch(() => { });
},
//
handleMapSelect(index, row) {
this.$refs.map.doShow(row);
},
//
handleCopyPlan(index, row) {
this.$refs.copyPlan.doShow(row);
},
//
handleGenerateEveryDay({planId, mapId}) {
this.$confirm(this.$t('publish.wellGenerateEveryRunPlan'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
generateCommonRunPlanEveryDay(planId, {mapId}).then(response => {
this.reloadTable();
this.$refs.map.doClose();
this.$message.success(this.$t('publish.createCommonSuccess'));
}).catch(() => {
this.reloadTable();
this.$messageBox(this.$t('error.operationFailure'));
});
}).catch(() => { });
},
//
handleCopyRunPlan(data) {
this.$confirm(this.$t('publish.copyRunPlanContinue'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
postRunPlanTemplate({ id: data.id, skinCode: data.skinCode, name: data.name }).then(response => {
this.reloadTable();
this.$refs.copyPlan.doClose();
this.$message.success(this.$t('publish.createCommonSuccess'));
}).catch(() => {
this.reloadTable();
this.$messageBox(this.$t('error.operationFailure'));
});
}).catch(() => { });
},
//
handleView(index, row) {
this.$router.push({ path: `${UrlConfig.publish.runPlanView}/template`, query: { skinCode: row.skinCode, planId: row.id, mapId: row.mapId } });
},
reloadTable() {
this.queryList.reload();
}
}
};
</script>
<style lang="scss" scoped>

View File

@ -11,366 +11,366 @@
<script>
import { mapGetters } from 'vuex';
import { getStationListBySkinCode, queryRunPlan, queryRunPlanTemplate, queryRunPlanDaily } from '@/api/runplan';
import { getStationList, queryRunPlan, queryRunPlanTemplate, queryRunPlanDaily } from '@/api/runplan';
import { timeFormat } from '@/utils/date';
import { UrlConfig } from '@/router/index';
export default {
name: 'RunPlan',
data() {
return {
runPlanId: 'main',
myChart: null,
PlanConvert: {},
option: {
title: {
text: '',
left: 'center'
},
grid: {
top: '30px',
left: '120px',
right: '2%',
bottom: '80px',
containLabel: true,
backgroundColor: 'floralwhite'
},
toolbox: {
right: '2%',
feature: {
dataZoom: {
yAxisIndex: 'none'
},
restore: {},
saveAsImage: {}
}
},
tooltip: {
axisPointer: {
trigger: 'item',
type: 'cross'
},
formatter: this.axisTooltip,
borderWidth: 1
},
xAxis: [
{
type: 'category',
boundaryGap: false,
data: [],
axisLine: {
onZero: false,
lineStyle: {
width: 2,
color: '#d14a61'
}
},
axisLabel: {
formatter: this.xAxisLableFormat,
textStyle: {
color: '#333'
}
},
axisPointer: {
snap: true,
label: {
formatter: this.xAxisPointFormat,
backgroundColor: 'rgb(255,0,0,0.5)',
color: 'white'
}
}
}
],
yAxis: {
type: 'value',
splitLine: {
show: false
},
axisTick: {
show: false
},
axisLine: {
onZero: false,
lineStyle: {
width: 2,
color: '#d14a61'
}
},
axisLabel: {
interval: 'auto',
formatter: this.yAxisLableFormat
},
axisPointer: {
xAxisIndex: 'all',
label: {
formatter: this.yAxisPointFormat,
backgroundColor: 'rgb(0,100,0,0.5)',
color: 'white'
}
},
min: 0,
max: 0
},
series: [],
dataZoom: [
{
type: 'inside'
},
{
fiterMode: 'filter',
handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
handleSize: '80%',
handleStyle: {
color: '#fff',
shadowBlur: 3,
shadowColor: 'rgba(0, 0, 0, 0.6)',
shadowOffsetX: 2,
shadowOffsetY: 2
},
bottom: '25px'
}
]
},
kmRangeCoordMap: {}
};
},
computed: {
...mapGetters('runPlan', [
'stations'
]),
isShowBack() {
if (this.$route.params.mode !== 'draft') {
return true;
}
return false;
},
mode() {
return this.$route.params.mode;
},
width() {
return this.$store.state.app.width;
},
height() {
return this.$store.state.app.height;
}
},
watch: {
'$store.state.runPlan.planSizeCount': function () {
this.reSize({ width: this.$store.state.runPlan.width, height: this.$store.state.runPlan.height });
},
'$store.state.app.windowSizeCount': function() {
this.setPlanSize();
},
$route() {
this.$nextTick(() => {
this.loadChartPage(this.$route.query);
});
}
},
mounted() {
this.setPlanSize();
this.loadChartPage(this.$route.query);
},
beforeDestroy() {
this.destroy();
},
methods: {
loadChartPage(opt) {
this.PlanConvert = this.$theme.loadPlanConvert(opt.skinCode);
this.$store.dispatch('runPlan/clear').then(resp => {
this.loadInitChart().then(() => {
if (opt.skinCode && opt.planId) {
this.myChart && this.myChart.showLoading();
getStationListBySkinCode(opt.skinCode).then(response => {
this.$store.dispatch('runPlan/setStations', response.data).then(() => {
let queryFunc = null;
const params = opt.planId;
name: 'RunPlan',
data() {
return {
runPlanId: 'main',
myChart: null,
PlanConvert: {},
option: {
title: {
text: '',
left: 'center'
},
grid: {
top: '30px',
left: '120px',
right: '2%',
bottom: '80px',
containLabel: true,
backgroundColor: 'floralwhite'
},
toolbox: {
right: '2%',
feature: {
dataZoom: {
yAxisIndex: 'none'
},
restore: {},
saveAsImage: {}
}
},
tooltip: {
axisPointer: {
trigger: 'item',
type: 'cross'
},
formatter: this.axisTooltip,
borderWidth: 1
},
xAxis: [
{
type: 'category',
boundaryGap: false,
data: [],
axisLine: {
onZero: false,
lineStyle: {
width: 2,
color: '#d14a61'
}
},
axisLabel: {
formatter: this.xAxisLableFormat,
textStyle: {
color: '#333'
}
},
axisPointer: {
snap: true,
label: {
formatter: this.xAxisPointFormat,
backgroundColor: 'rgb(255,0,0,0.5)',
color: 'white'
}
}
}
],
yAxis: {
type: 'value',
splitLine: {
show: false
},
axisTick: {
show: false
},
axisLine: {
onZero: false,
lineStyle: {
width: 2,
color: '#d14a61'
}
},
axisLabel: {
interval: 'auto',
formatter: this.yAxisLableFormat
},
axisPointer: {
xAxisIndex: 'all',
label: {
formatter: this.yAxisPointFormat,
backgroundColor: 'rgb(0,100,0,0.5)',
color: 'white'
}
},
min: 0,
max: 0
},
series: [],
dataZoom: [
{
type: 'inside'
},
{
fiterMode: 'filter',
handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
handleSize: '80%',
handleStyle: {
color: '#fff',
shadowBlur: 3,
shadowColor: 'rgba(0, 0, 0, 0.6)',
shadowOffsetX: 2,
shadowOffsetY: 2
},
bottom: '25px'
}
]
},
kmRangeCoordMap: {}
};
},
computed: {
...mapGetters('runPlan', [
'stations'
]),
isShowBack() {
if (this.$route.params.mode !== 'draft') {
return true;
}
return false;
},
mode() {
return this.$route.params.mode;
},
width() {
return this.$store.state.app.width;
},
height() {
return this.$store.state.app.height;
}
},
watch: {
'$store.state.runPlan.planSizeCount': function () {
this.reSize({ width: this.$store.state.runPlan.width, height: this.$store.state.runPlan.height });
},
'$store.state.app.windowSizeCount': function() {
this.setPlanSize();
},
$route() {
this.$nextTick(() => {
this.loadChartPage(this.$route.query);
});
}
},
mounted() {
this.setPlanSize();
this.loadChartPage(this.$route.query);
},
beforeDestroy() {
this.destroy();
},
methods: {
loadChartPage(opt) {
this.PlanConvert = this.$theme.loadPlanConvert(opt.skinCode);
this.$store.dispatch('runPlan/clear').then(resp => {
this.loadInitChart().then(() => {
if (opt.mapId && opt.planId) {
this.myChart && this.myChart.showLoading();
getStationList(opt.mapId).then(response => {
this.$store.dispatch('runPlan/setStations', response.data).then(() => {
let queryFunc = null;
const params = opt.planId;
switch (this.mode) {
case 'common': queryFunc = queryRunPlanTemplate; break;
case 'template': queryFunc = queryRunPlanTemplate; break;
case 'everyDay': queryFunc = queryRunPlanDaily; break;
default: queryFunc = queryRunPlan; break;
}
switch (this.mode) {
case 'common': queryFunc = queryRunPlanTemplate; break;
case 'template': queryFunc = queryRunPlanTemplate; break;
case 'everyDay': queryFunc = queryRunPlanDaily; break;
default: queryFunc = queryRunPlan; break;
}
queryFunc(params).then(resp => {
this.loadChartData(resp.data);
this.myChart && this.myChart.hideLoading();
}).catch(() => {
this.myChart && this.myChart.hideLoading();
this.$messageBox(this.$t('error.obtainOperationGraphFailed'));
});
});
}).catch(() => {
this.myChart && this.myChart.hideLoading();
this.$messageBox(this.$t('error.obtainStationListFailed'));
});
}
});
});
},
async loadChartData(data) {
try {
this.option.title.text = data.planName;
this.kmRangeCoordMap = this.PlanConvert.convertStationsToMap(this.stations);
this.option.series = [];
this.pushModels(this.option.series, [this.PlanConvert.initializeYaxis(this.stations)]);
this.pushModels(this.option.series, this.PlanConvert.convertDataToModels(data, this.stations, this.kmRangeCoordMap, { width: 1 }));
this.loadInitData();
} catch (error) {
this.$messageBox(this.$t('error.loadingOperationGraphFailed'));
}
},
async loadInitData() {
await this.xAxisInit();
await this.yAxisInit();
await this.loadInitChart();
},
xAxisPointFormat(params) {
return timeFormat(params.value);
},
yAxisPointFormat(params) {
return this.PlanConvert.computedFormatYAxis(this.stations, params);
},
xAxisLableFormat(value, index) {
if (value % 60 === 0) {
return timeFormat(parseInt(value));
}
},
yAxisLableFormat(value, index) {
return '';
},
xAxisInit() {
const list = [];
for (var time = this.PlanConvert.TranslationTime; time < 3600 * 24 + this.PlanConvert.TranslationTime; time++) {
list.push(time);
}
this.option.xAxis[0].data = list;
this.option.dataZoom[0].startValue = this.option.dataZoom[1].startValue = 3600 * 6 - 600 + this.PlanConvert.TranslationTime;
this.option.dataZoom[0].endValue = this.option.dataZoom[1].endValue = 3600 * 8 + 600 + this.PlanConvert.TranslationTime;
},
yAxisInit() {
if (Object.keys(this.PlanConvert).length) {
this.option.yAxis.min = this.PlanConvert.computedYaxisMinValue(this.stations);
this.option.yAxis.max = this.PlanConvert.computedYaxisMaxValue(this.stations);
}
},
pushModels(series, models) {
if (models && models.length) {
models.forEach(elem => {
if (elem) {
series.push(elem);
}
});
}
return series;
},
popModels(series, models) {
if (models && models.length) {
models.forEach(elem => {
const index = series.indexOf(elem);
if (index >= 0) {
series.split(index, 1);
}
});
}
return series;
},
loadInitChart() {
return new Promise((resolve, reject) => {
try {
const that = this;
// echart
require.config(
{
paths: {
echarts: './js/dist'
}
}
);
//
require(
[
'echarts',
'echarts/lib/chart/line'
],
function (ec) {
if (that.myChart && that.myChart.isDisposed) {
that.myChart.clear();
}
that.myChart = ec.init(document.getElementById(that.runPlanId));
that.myChart.setOption(that.option);
that.reSize({ width: that.$store.state.runPlan.width, height: that.$store.state.runPlan.height });
// that.myChart.on('click', that.mouseClick);
resolve(true);
}
);
} catch (error) {
reject(error);
}
});
},
axisTooltip(param) {
if (param.data[1] >= this.option.yAxis.min + this.PlanConvert.EdgeHeight && param.data[1] <= this.option.yAxis.max - this.PlanConvert.EdgeHeight) {
const station = this.stations[Math.floor((param.data[1] - this.PlanConvert.EdgeHeight) / this.PlanConvert.CoordMultiple)] || { name: '', kmRange: '' };
return [
`Point Data <hr size=1 style="margin: 3px 0">`,
`${this.$t('map.stationName')}: ${station.name}<br>`,
`${this.$t('map.stationKilometerMark')}: ${station.kmRange} km <br>`,
`${this.$t('map.arrivalTime')}: ${timeFormat(param.data[0] + this.PlanConvert.TranslationTime)} (${param.data[0]})<br>`
].join('');
}
},
mouseClick(params) {
},
settingExac(data) {
this.myChart && this.myChart.setOption({
xAxis: this.option.xAxis,
yAxis: this.option.yAxis
});
queryFunc(params).then(resp => {
this.loadChartData(resp.data);
this.myChart && this.myChart.hideLoading();
}).catch(() => {
this.myChart && this.myChart.hideLoading();
this.$messageBox(this.$t('error.obtainOperationGraphFailed'));
});
});
}).catch(() => {
this.myChart && this.myChart.hideLoading();
this.$messageBox(this.$t('error.obtainStationListFailed'));
});
}
});
});
},
async loadChartData(data) {
try {
this.option.title.text = data.planName;
this.kmRangeCoordMap = this.PlanConvert.convertStationsToMap(this.stations);
this.option.series = [];
this.pushModels(this.option.series, [this.PlanConvert.initializeYaxis(this.stations)]);
this.pushModels(this.option.series, this.PlanConvert.convertDataToModels(data, this.stations, this.kmRangeCoordMap, { width: 1 }));
this.loadInitData();
} catch (error) {
this.$messageBox(this.$t('error.loadingOperationGraphFailed'));
}
},
async loadInitData() {
await this.xAxisInit();
await this.yAxisInit();
await this.loadInitChart();
},
xAxisPointFormat(params) {
return timeFormat(params.value);
},
yAxisPointFormat(params) {
return this.PlanConvert.computedFormatYAxis(this.stations, params);
},
xAxisLableFormat(value, index) {
if (value % 60 === 0) {
return timeFormat(parseInt(value));
}
},
yAxisLableFormat(value, index) {
return '';
},
xAxisInit() {
const list = [];
for (var time = this.PlanConvert.TranslationTime; time < 3600 * 24 + this.PlanConvert.TranslationTime; time++) {
list.push(time);
}
this.option.xAxis[0].data = list;
this.option.dataZoom[0].startValue = this.option.dataZoom[1].startValue = 3600 * 6 - 600 + this.PlanConvert.TranslationTime;
this.option.dataZoom[0].endValue = this.option.dataZoom[1].endValue = 3600 * 8 + 600 + this.PlanConvert.TranslationTime;
},
yAxisInit() {
if (Object.keys(this.PlanConvert).length) {
this.option.yAxis.min = this.PlanConvert.computedYaxisMinValue(this.stations);
this.option.yAxis.max = this.PlanConvert.computedYaxisMaxValue(this.stations);
}
},
pushModels(series, models) {
if (models && models.length) {
models.forEach(elem => {
if (elem) {
series.push(elem);
}
});
}
return series;
},
popModels(series, models) {
if (models && models.length) {
models.forEach(elem => {
const index = series.indexOf(elem);
if (index >= 0) {
series.split(index, 1);
}
});
}
return series;
},
loadInitChart() {
return new Promise((resolve, reject) => {
try {
const that = this;
// echart
require.config(
{
paths: {
echarts: './js/dist'
}
}
);
//
require(
[
'echarts',
'echarts/lib/chart/line'
],
function (ec) {
if (that.myChart && that.myChart.isDisposed) {
that.myChart.clear();
}
that.myChart = ec.init(document.getElementById(that.runPlanId));
that.myChart.setOption(that.option);
that.reSize({ width: that.$store.state.runPlan.width, height: that.$store.state.runPlan.height });
// that.myChart.on('click', that.mouseClick);
resolve(true);
}
);
} catch (error) {
reject(error);
}
});
},
axisTooltip(param) {
if (param.data[1] >= this.option.yAxis.min + this.PlanConvert.EdgeHeight && param.data[1] <= this.option.yAxis.max - this.PlanConvert.EdgeHeight) {
const station = this.stations[Math.floor((param.data[1] - this.PlanConvert.EdgeHeight) / this.PlanConvert.CoordMultiple)] || { name: '', kmRange: '' };
return [
`Point Data <hr size=1 style="margin: 3px 0">`,
`${this.$t('map.stationName')}: ${station.name}<br>`,
`${this.$t('map.stationKilometerMark')}: ${station.kmRange} km <br>`,
`${this.$t('map.arrivalTime')}: ${timeFormat(param.data[0] + this.PlanConvert.TranslationTime)} (${param.data[0]})<br>`
].join('');
}
},
mouseClick(params) {
},
settingExac(data) {
this.myChart && this.myChart.setOption({
xAxis: this.option.xAxis,
yAxis: this.option.yAxis
});
this.myChart && this.myChart.dispatchAction({
type: 'dataZoom',
dataZoomIndex: [0, 1],
startValue: parseInt(data.startValue / 1000),
endValue: parseInt(data.endValue / 1000)
});
},
reSize(opt) {
if (this.myChart) {
this.myChart.resize({
width: opt.width,
height: opt.height,
silent: false
});
}
},
setPlanSize() {
this.$nextTick(() => {
if (this.mode !== 'draft') {
this.$store.dispatch('runPlan/resize', { width: this.width, height: this.height - 130 });
} else {
this.$store.dispatch('runPlan/resize', { width: this.$store.state.runPlan.width, height: this.height - 60 });
}
});
},
destroy() {
if (this.myChart && this.myChart.isDisposed) {
this.myChart.dispose();
this.myChart = null;
}
},
back() {
if (this.$route.params.mode === 'everyDay') {
this.$router.replace({ path: `${UrlConfig.publish.runPlanEveryDay}` });
} else if (this.$route.params.mode === 'template') {
this.$router.replace({ path: `${UrlConfig.publish.runPlanTemplate}` });
} else if (this.$route.params.mode === 'common') {
this.$router.replace({ path: `${UrlConfig.publish.runPlanCommon}` });
} else {
this.$router.go(-1);
}
}
}
this.myChart && this.myChart.dispatchAction({
type: 'dataZoom',
dataZoomIndex: [0, 1],
startValue: parseInt(data.startValue / 1000),
endValue: parseInt(data.endValue / 1000)
});
},
reSize(opt) {
if (this.myChart) {
this.myChart.resize({
width: opt.width,
height: opt.height,
silent: false
});
}
},
setPlanSize() {
this.$nextTick(() => {
if (this.mode !== 'draft') {
this.$store.dispatch('runPlan/resize', { width: this.width, height: this.height - 130 });
} else {
this.$store.dispatch('runPlan/resize', { width: this.$store.state.runPlan.width, height: this.height - 60 });
}
});
},
destroy() {
if (this.myChart && this.myChart.isDisposed) {
this.myChart.dispose();
this.myChart = null;
}
},
back() {
if (this.$route.params.mode === 'everyDay') {
this.$router.replace({ path: `${UrlConfig.publish.runPlanEveryDay}` });
} else if (this.$route.params.mode === 'template') {
this.$router.replace({ path: `${UrlConfig.publish.runPlanTemplate}` });
} else if (this.$route.params.mode === 'common') {
this.$router.replace({ path: `${UrlConfig.publish.runPlanCommon}` });
} else {
this.$router.go(-1);
}
}
}
};
</script>

View File

@ -3,6 +3,7 @@
<div class="clearfix">
<span>{{ $t('map.productCategories') }}</span>
</div>
<filter-city ref="filerCity" filter-empty :query-function="queryFunction" :local-param-name="localParamName" @filterSelectChange="refresh" />
<el-input v-model="filterText" :placeholder="$t('tip.enterKeywordsFiltering')" clearable />
<div style="height: calc(100% - 87px);">
<el-tree
@ -29,13 +30,18 @@
</div>
</template>
<script>
import { getProductTree } from '@/api/management/mapprd';
import { getPublishMapTree } from '@/api/management/mapprd';
import FilterCity from '@/views/components/filterCity';
export default {
name: 'TreeOperate',
components: {
FilterCity
},
data() {
return {
loading: true,
queryFunction: getPublishMapTree,
defaultProps: {
children: 'children',
label: 'name'
@ -46,7 +52,8 @@ export default {
point: {
x: 0,
y: 0
}
},
localParamName: 'product_cityCode'
};
},
watch: {
@ -54,9 +61,6 @@ export default {
this.$refs.trainingTree.filter(val);
}
},
mounted() {
this.refresh();
},
methods: {
filterNode(value, data) {
if (!value) return true;
@ -90,14 +94,19 @@ export default {
}
return tree;
},
refresh() {
getProductTree().then(response => {
this.treeData = this.convertTreeData(response.data);
this.$nextTick(() => { this.loading = false; });
}).catch(() => {
this.$messageBox(this.$t('tip.refreshFailure'));
async refresh(filterSelect) {
console.log(filterSelect, '==========');
this.loading = true;
try {
const res = await getPublishMapTree(filterSelect);
this.treeData = this.convertTreeData(res.data);
this.$nextTick(() => {
this.loading = false;
});
} catch (error) {
this.loading = false;
});
this.$messageBox(this.$t('error.refreshFailed'));
}
}
}
};

View File

@ -1,144 +1,140 @@
<template>
<div>
<el-dialog :title="title" :visible.sync="dialogVisible" width="500px" :before-close="doClose" center>
<data-form ref="dataform" :form="form" :formModel="formModel" :rules="rules"></data-form>
<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>
</div>
<div>
<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>
</div>
</template>
<script>
import ConstConfig from '@/scripts/ConstConfig';
import Cookies from 'js-cookie';
import { listPublishMap } from '@/api/jmap/map';
import { getCommodityMapProduct } from '@/api/management/mapprd';
export default {
name: 'OnceGenerate',
data() {
return {
dialogVisible: false,
mapList: [],
disabled:null,
productList:[],
mapInfoList:[],
projectList:[],
typeList:[],
formModel:{
mapId:'',
name: "",
prdCode: "",
type: "",
id:null,
}
import ConstConfig from '@/scripts/ConstConfig';
import Cookies from 'js-cookie';
import { listPublishMap } from '@/api/jmap/map';
import { getCommodityMapProduct } from '@/api/management/mapprd';
export default {
name: 'OnceGenerate',
props: {
title: String,
operateType:String
},
data() {
return {
dialogVisible: false,
mapList: [],
disabled:null,
productList:[],
mapInfoList:[],
projectList:[],
typeList:[],
formModel:{
mapId:'',
name: '',
prdCode: '',
type: '',
id:null
}
},
mounted() {
this.loadInitData();
},
props: {
title: String,
operateType:String
},
computed: {
form() {
let form={};
if(this.operateType=="add"){
form={
labelWidth: '150px',
items: [
{ prop: 'customized', label: this.$t('systemGenerate.customized'), type: 'select', required: true,options: this.projectList},
{ prop: 'mapId', label: this.$t('systemGenerate.mapName'), type: 'select', required: true,options: this.mapList,change:true,onChange:this.changeMap},
{ prop: 'prdCode', label: this.$t('systemGenerate.prdName'), type: 'select', required: true,options:this.productList},
{ prop: 'name', label: this.$t('systemGenerate.name'), type: 'text', required: true,},
{ prop: 'type', label: this.$t('systemGenerate.type'), type: 'select', required: true,options: this.typeList},
]
}
}
else{
form={
labelWidth: '150px',
items: [
{ prop: 'name', label: this.$t('systemGenerate.name'), type: 'text', required: true,},
]
}
}
return form
},
rules() {
let crules ={};
if(this.operateType=="add"){
crules ={customized:[
{ required: true, message: this.$t('systemGenerate.selectProject'), trigger: 'change'},
],
mapId:[
{ required: true, message: this.$t('systemGenerate.selectMap'), trigger: 'change'},
],
name: [
{ required: true, message: this.$t('systemGenerate.inputName'), trigger: 'blur' },
{ required: true, message: this.$t('systemGenerate.inputName'), trigger: 'change' },
],
type:[
{ required: true, message: this.$t('systemGenerate.selectType'), trigger: 'change'},
],
prdCode:[
{ required: true, message: this.$t('systemGenerate.selectPrdName'), trigger: 'change'},
]
}
}else{
crules ={
name: [
{ required: true, message: this.$t('systemGenerate.inputName'), trigger: 'blur' },
{ required: true, message: this.$t('systemGenerate.inputName'), trigger: 'change' },
],
};
}
return crules
},
},
methods:{
loadInitData(){
this.projectList=[{value:'xty',label:'西铁院'}];
let customeredProductType=ConstConfig.ConstSelect.customeredProductType;
this.typeList=Cookies.get("user_lang")=="en"?
customeredProductType.map(elem => { return { value: elem.value, label: elem.enlabel } }):
customeredProductType.map(elem => { return { value: elem.value, label: elem.label } });
listPublishMap().then(response => {
this.mapInfoList=response.data;
this.mapList = response.data.map(elem => { return { value: elem.id, label: elem.name } });
})
},
changeMap(index){
this.productList=[];
let mapInfo=this.mapInfoList.find(elem=>{
return elem.id==index;
});
getCommodityMapProduct(mapInfo.skinCode).then((response) => {
this.productList = response.data.map(elem => { return { value: elem.code, label: elem.name } });
this.formModel.prdCode="";
});
},
doShow(data) {
if(data){
this.formModel.name=data.name;
this.formModel.id=data.id;
}
this.dialogVisible = true
},
doCreate() {
let self = this
this.$refs.dataform.validateForm(() => {
self.$emit('create', Object.assign({}, this.formModel));
self.doClose()
})
},
doClose() {
this.$refs.dataform.resetForm();
this.dialogVisible = false
};
},
computed: {
form() {
let form = {};
if (this.operateType == 'add') {
form = {
labelWidth: '150px',
items: [
{ prop: 'customized', label: this.$t('systemGenerate.customized'), type: 'select', required: true, options: this.projectList},
{ prop: 'mapId', label: this.$t('systemGenerate.mapName'), type: 'select', required: true, options: this.mapList, change:true, onChange:this.changeMap},
{ prop: 'prdCode', label: this.$t('systemGenerate.prdName'), type: 'select', required: true, options:this.productList},
{ prop: 'name', label: this.$t('systemGenerate.name'), type: 'text', required: true},
{ prop: 'type', label: this.$t('systemGenerate.type'), type: 'select', required: true, options: this.typeList}
]
};
} else {
form = {
labelWidth: '150px',
items: [
{ prop: 'name', label: this.$t('systemGenerate.name'), type: 'text', required: true}
]
};
}
return form;
},
rules() {
let crules = {};
if (this.operateType == 'add') {
crules = {customized:[
{ required: true, message: this.$t('systemGenerate.selectProject'), trigger: 'change'}
],
mapId:[
{ required: true, message: this.$t('systemGenerate.selectMap'), trigger: 'change'}
],
name: [
{ required: true, message: this.$t('systemGenerate.inputName'), trigger: 'blur' },
{ required: true, message: this.$t('systemGenerate.inputName'), trigger: 'change' }
],
type:[
{ required: true, message: this.$t('systemGenerate.selectType'), trigger: 'change'}
],
prdCode:[
{ required: true, message: this.$t('systemGenerate.selectPrdName'), trigger: 'change'}
]
};
} else {
crules = {
name: [
{ required: true, message: this.$t('systemGenerate.inputName'), trigger: 'blur' },
{ required: true, message: this.$t('systemGenerate.inputName'), trigger: 'change' }
]
};
}
return crules;
}
};
},
mounted() {
this.loadInitData();
},
methods:{
loadInitData() {
this.projectList = [{value:'xty', label:'西铁院'}];
const customeredProductType = ConstConfig.ConstSelect.customeredProductType;
this.typeList = Cookies.get('user_lang') == 'en'
? customeredProductType.map(elem => { return { value: elem.value, label: elem.enlabel }; })
: customeredProductType.map(elem => { return { value: elem.value, label: elem.label }; });
listPublishMap().then(response => {
this.mapInfoList = response.data;
this.mapList = response.data.map(elem => { return { value: elem.id, label: elem.name }; });
});
},
changeMap(index) {
this.productList = [];
getCommodityMapProduct(index).then((response) => {
this.productList = response.data.map(elem => { return { value: elem.code, label: elem.name }; });
this.formModel.prdCode = '';
});
},
doShow(data) {
if (data) {
this.formModel.name = data.name;
this.formModel.id = data.id;
}
this.dialogVisible = true;
},
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{

View File

@ -60,156 +60,156 @@ import { launchFullscreen } from '@/utils/screen';
import localStore from 'storejs';
export default {
name: 'LessonDetail',
components: {
LimitList
},
data() {
return {
num: 5,
loading: false,
WhetherTypeList: [],
EffectiveTypeList: [],
courseModel: {
id: '',
name: '',
pmsList: []
},
activeName: 'first',
defaultProps: {
children: 'children',
label: 'name'
},
expandList: []
};
},
computed: {
hasPermssion() {
return this.courseModel.pmsList.length > 0;
},
height() {
return this.$store.state.app.height - 50;
}
},
watch: {
$route(newVal) {
this.initLoadPage();
}
},
mounted() {
this.$Dictionary.effectiveType().then(list => {
this.EffectiveTypeList = list;
});
this.initLoadPage();
},
methods: {
initLoadPage() {
getPublishLessonTree(this.$route.query.lessonId).then(response => {
if (response.data.tree && response.data.tree.length>0) {
this.courseModel = {
id: response.data.tree[0].id,
name: response.data.tree[0].name,
pmsList: response.data.permissionList || [],
treeList: response.data.tree,
prdCode: this.$route.query.prdCode,
mapId: this.$route.query.mapId,
PermissionType: PermissionType.LESSON
};
}
this.getExpandList(this.courseModel.id);
}).catch(error => {
this.$message.error(this.$t('tip.failedCourse') + ':' + error.message);
});
},
transfer() {
this.loading = false;
if (this.$refs) {
this.activeName = 'second';
this.$refs.limitList.transfer(this.courseModel);
}
},
distribute() {
this.loading = false;
if (this.$refs) {
this.activeName = 'second';
this.$refs.limitList.distribute(this.courseModel);
}
},
clickEvent(obj, node, ele) {
if (obj && obj.type==='Training') {
if (obj.valid) {
this.loading = true;
trainingNotify({ trainingId: obj.id }).then(resp => {
const query = {
group: resp.data, trainingId: obj.id, lessonId: this.$route.query.lessonId
};
this.$router.push({ path: `${UrlConfig.display}/teach`, query: query });
launchFullscreen();
}).catch(error => {
this.loading = false;
this.$messageBox(`${this.$t('tip.createSimulationFaild')} : ${error.message}`);
});
} else {
this.$confirm(this.$t('tip.accessCourseNo'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel')
}).then(() => {
this.buy();
}).catch(() => { });
}
}
},
filterNode(value, data) {
if (!value) return true;
return data.name.indexOf(value) !== -1;
},
buy() {
this.$router.push({
path: `${UrlConfig.trainingPlatform.pay}/${this.courseModel.id}`, query:
name: 'LessonDetail',
components: {
LimitList
},
data() {
return {
num: 5,
loading: false,
WhetherTypeList: [],
EffectiveTypeList: [],
courseModel: {
id: '',
name: '',
pmsList: []
},
activeName: 'first',
defaultProps: {
children: 'children',
label: 'name'
},
expandList: []
};
},
computed: {
hasPermssion() {
return this.courseModel.pmsList.length > 0;
},
height() {
return this.$store.state.app.height - 50;
}
},
watch: {
$route(newVal) {
this.initLoadPage();
}
},
mounted() {
this.$Dictionary.effectiveType().then(list => {
this.EffectiveTypeList = list;
});
this.initLoadPage();
},
methods: {
initLoadPage() {
getPublishLessonTree(this.$route.query.lessonId).then(response => {
if (response.data.tree && response.data.tree.length > 0) {
this.courseModel = {
id: response.data.tree[0].id,
name: response.data.tree[0].name,
pmsList: response.data.permissionList || [],
treeList: response.data.tree,
prdCode: this.$route.query.prdCode,
mapId: this.$route.query.mapId,
PermissionType: PermissionType.LESSON
};
}
this.getExpandList(this.courseModel.id);
}).catch(error => {
this.$message.error(this.$t('tip.failedCourse') + ':' + error.message);
});
},
transfer() {
this.loading = false;
if (this.$refs) {
this.activeName = 'second';
this.$refs.limitList.transfer(this.courseModel);
}
},
distribute() {
this.loading = false;
if (this.$refs) {
this.activeName = 'second';
this.$refs.limitList.distribute(this.courseModel);
}
},
clickEvent(obj, node, ele) {
if (obj && obj.type === 'Training') {
if (obj.valid) {
this.loading = true;
trainingNotify({ trainingId: obj.id }).then(resp => {
const query = {
group: resp.data, trainingId: obj.id, lessonId: this.$route.query.lessonId, mapId: this.courseModel.mapId
};
this.$router.push({ path: `${UrlConfig.display}/teach`, query: query });
launchFullscreen();
}).catch(error => {
this.loading = false;
this.$messageBox(`${this.$t('tip.createSimulationFaild')} : ${error.message}`);
});
} else {
this.$confirm(this.$t('tip.accessCourseNo'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel')
}).then(() => {
this.buy();
}).catch(() => { });
}
}
},
filterNode(value, data) {
if (!value) return true;
return data.name.indexOf(value) !== -1;
},
buy() {
this.$router.push({
path: `${UrlConfig.trainingPlatform.pay}/${this.courseModel.id}`, query:
{ permissionType: PermissionType.LESSON, lessonId: this.courseModel.id, prdCode: this.$route.query.prdCode, mapId: this.$route.query.mapId, subSystem: this.$route.params.subSystem }
});
},
nodeExpand(obj, node, ele) {
const key = obj.id;
this.expandList = this.expandList.filter(item => item!==key);
this.expandList.push(key);
setSessionStorage('trainingTeachExpandList'+this.courseModel.id, this.expandList);
},
nodeCollapse(obj, node, ele) {
const key = obj.id;
if (obj.type === 'Lesson') {
this.expandList = [];
} else {
this.expandList = this.expandList.filter(item => item!==key);
}
setSessionStorage('trainingTeachExpandList'+this.courseModel.id, this.expandList);
},
getExpandList(id) {
let expand = getSessionStorage('trainingTeachExpandList'+id);
expand = expand?(expand+'').split(','):'';
if (expand instanceof Array) {
this.expandList = expand;
}
},
startTraining(data) {
if (data && data.type==='Training') {
if (data.valid) {
this.$router.push({ path: `${UrlConfig.trainingPlatform.practical}/${data.id}/${this.courseModel.id}`});
} else {
this.$confirm(this.$t('tip.accessCourseNo'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel')
}).then(() => {
this.buy();
}).catch(() => { });
}
}
},
backLessonList() {
localStore.remove('teachDetail'+this.$route.params.subSystem);
this.$router.push({ path: `${UrlConfig.trainingPlatform.teachHome}/${this.$route.params.subSystem}`});
}
}
});
},
nodeExpand(obj, node, ele) {
const key = obj.id;
this.expandList = this.expandList.filter(item => item !== key);
this.expandList.push(key);
setSessionStorage('trainingTeachExpandList' + this.courseModel.id, this.expandList);
},
nodeCollapse(obj, node, ele) {
const key = obj.id;
if (obj.type === 'Lesson') {
this.expandList = [];
} else {
this.expandList = this.expandList.filter(item => item !== key);
}
setSessionStorage('trainingTeachExpandList' + this.courseModel.id, this.expandList);
},
getExpandList(id) {
let expand = getSessionStorage('trainingTeachExpandList' + id);
expand = expand ? (expand + '').split(',') : '';
if (expand instanceof Array) {
this.expandList = expand;
}
},
startTraining(data) {
if (data && data.type === 'Training') {
if (data.valid) {
this.$router.push({ path: `${UrlConfig.trainingPlatform.practical}/${data.id}/${this.courseModel.id}`});
} else {
this.$confirm(this.$t('tip.accessCourseNo'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel')
}).then(() => {
this.buy();
}).catch(() => { });
}
}
},
backLessonList() {
localStore.remove('teachDetail' + this.$route.params.subSystem);
this.$router.push({ path: `${UrlConfig.trainingPlatform.teachHome}/${this.$route.params.subSystem}`});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -1,131 +0,0 @@
<template>
<el-card>
<div slot="header" style="text-align: center;">
<b>{{ $t('teach.trainingName') }} {{ courseModel.name }}</b>
</div>
<div style="margin:50px">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height - 190 +'px' }">
<p class="list-item">
<span class="list-label">{{ $t('teach.trainingTime') }}</span>
<span class="list-elem"> {{ courseModel.minDuration | setTime }} {{ $t('teach.seconds') }}</span>
</p>
<p class="list-item">
<span class="list-label">{{ $t('teach.trainingMaximum') }}</span>
<span class="list-elem">{{ courseModel.maxDuration | setTime }} {{ $t('teach.seconds') }}</span>
</p>
<p class="list-item">
<span class="list-label">{{ $t('teach.trainingInstructions') }}</span>
<span class="list-elem">{{ courseModel.remarks }}</span>
</p>
</el-scrollbar>
</div>
<div class="btn-start">
<el-button :loading="loading" type="primary" @click="start">{{ $t('teach.startTraining') }}</el-button>
<el-button @click="back">{{ $t('global.back') }}</el-button>
</div>
</el-card>
</template>
<script>
import { getTrainingDetail } from '@/api/jmap/training';
import { trainingNotify } from '@/api/simulation';
import { UrlConfig } from '@/router/index';
import { launchFullscreen } from '@/utils/screen';
export default {
name: 'LessonPracticalDetail',
filters: {
setTime(val) {
return val;
}
},
data() {
return {
loading: false,
courseModel: {
id: '',
name: '',
maxDuration: '',
minDuration: '',
remarks: '',
updateTime: ''
}
};
},
computed: {
height() {
return this.$store.state.app.height - 50;
}
},
watch: {
$route(newVal) {
this.initLoadPage();
}
},
mounted() {
this.initLoadPage();
},
methods: {
initLoadPage() {
const trainingId = this.$route.params.trainingId;
if (parseInt(trainingId)) {
getTrainingDetail(trainingId)
.then(res => {
this.courseModel = {
id: res.data.id,
name: res.data.name,
maxDuration: res.data.maxDuration,
remarks: res.data.remarks,
minDuration: res.data.minDuration,
updateTime: res.data.updateTime
};
})
.catch(error => {
this.$message.error(this.$t('tip.failedCourse') + ':' + error.message);
});
}
},
start() {
this.loading = true;
trainingNotify({ trainingId: this.$route.params.trainingId }).then(resp => {
const query = {
group: resp.data, trainingId: this.$route.params.trainingId, lessonId: this.$route.params.lessonId
};
this.$router.push({ path: `${UrlConfig.display}/teach`, query: query });
launchFullscreen();
}).catch(error => {
this.loading = false;
this.$messageBox(`${this.$t('tip.createSimulationFaild')} : ${error.message}`);
});
},
back() {
this.$router.back();
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.list-item {
font-size: 16px;
margin-bottom: 20px;
}
.list-label {
display: inline-block;
text-align: right;
width: 160px;
}
.list-elem {
color: #808080 !important;
}
.btn-start {
position: relative;
text-align: center;
justify-content: center;
transform: translateY(-20px);
}
</style>