Merge remote-tracking branch 'origin/dev' into test

This commit is contained in:
fan 2019-10-21 13:17:30 +08:00
commit 7e7fc2256c
81 changed files with 4420 additions and 5402 deletions

View File

@ -177,3 +177,12 @@ export function loadDraftScript(scriptId, memberId, group) {
method: 'post'
});
}
/** 获取已发布的有地图的城市列表*/
export function publisMapCityList(data) {
return request({
url: `/api/map/city?dicCode=${data}`,
method: 'get'
});
}

View File

@ -1,11 +1,10 @@
import request from '@/utils/request';
/** 获取课程树*/
export function getLessonTree(params) {
export function getLessonTree(skinCode) {
return request({
url: '/api/lessonDraft/tree',
method: 'get',
params: params
url: `/api/lessonDraft/${skinCode}/tree`,
method: 'get'
});
}

View File

@ -58,10 +58,11 @@ export function getPublishTrainList(skinCode) {
}
/** 获取发布地图列表*/
export function listPublishMap() {
export function listPublishMap(params) {
return request({
url: '/api/map/list',
method: 'get'
url: `/api/map/list`,
method: 'get',
params
});
}

View File

@ -264,3 +264,10 @@ export function putAutoSignal(data) {
});
}
export function getListByCityCode(cityCode) {
return request({
url: `/api/mapBuild/${cityCode}/list`,
method: 'get'
});
}

View File

@ -1,11 +1,10 @@
import request from '@/utils/request';
export function getTrainingSystemList(params) {
export function getTrainingSystemList(cityCode) {
/** 根据cityCode后去对应地图及其子系统 */
return request({
url: '/api/mapSystem/queryByCityCode',
method: 'get',
params
url: `/api/mapSystem/city/${cityCode}`,
method: 'get'
});
}
@ -33,3 +32,19 @@ export function generateMapSystem(mapId) {
method: 'post'
});
}
export function getSubSystemInfo(id) {
/** 查询子系统信息 */
return request({
url: `/api/mapSystem/${id}`,
method: 'get'
});
}
export function getSubSystemDetail(id) {
/** 查询子系统详情*/
return request({
url: `/api/mapSystem/${id}/detail`,
method: 'get'
});
}

BIN
src/assets/erCode.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

View File

@ -0,0 +1,54 @@
import store from '@/store';
export default {
bind(el) {
const dialogHeaderEl = el.querySelector('.el-dialog__header');
const dragDom = el.querySelector('.el-dialog');
dialogHeaderEl.style.cursor = 'move';
/** 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);*/
const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null);
dialogHeaderEl.onmousedown = (e) => {
/** 鼠标按下,计算当前元素距离可视区的距离*/
const disX = e.clientX - dialogHeaderEl.offsetLeft;
const disY = e.clientY - dialogHeaderEl.offsetTop;
/** 获取到的值带px 正则匹配替换*/
let styL, styT;
/** 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px*/
if (sty.left.includes('%')) {
// eslint-disable-next-line no-useless-escape
styL = +document.body.clientWidth * (+sty.left.replace(/\%/g, '') / 100);
styT = +document.body.clientHeight * (+sty.top.replace(/\%/g, '') / 100);
} else {
// eslint-disable-next-line no-useless-escape
styL = +sty.left.replace(/\px/g, '');
// eslint-disable-next-line no-useless-escape
styT = +sty.top.replace(/\px/g, '');
}
document.onmousemove = function (e) {
/** 通过事件委托,计算移动的距离*/
const l = e.clientX - disX;
const t = e.clientY - disY;
/** 移动当前元素*/
dragDom.style.left = `${l + styL}px`;
dragDom.style.top = `${t + styT}px`;
/** 刷新提示标签位置*/
store.dispatch('training/emitTipFresh');
/** 将此时的位置传出去*/
// binding.value({ x: e.pageX, y: e.pageY });
};
document.onmouseup = function () {
document.onmousemove = null;
document.onmouseup = null;
};
};
}
};

View File

@ -0,0 +1,8 @@
import Vue from 'vue';
import install from './dialogDrag';
const dialogDrag = function(Vue) {
Vue.directive('dialogDrag', install);
};
Vue.use(dialogDrag);

View File

@ -0,0 +1,25 @@
export default {
bind(el, binding) {
const dragDom = binding.value.$el.querySelector('.el-dialog');
el.onmousedown = (e) => {
/** 鼠标按下,计算当前元素距离可视区的距离*/
const disX = e.clientX - el.offsetLeft;
document.onmousemove = function (e) {
/** 移动时禁用默认事件*/
e.preventDefault();
/** 通过事件委托,计算移动的距离*/
const l = e.clientX - disX;
dragDom.style.width = `${l}px`;
};
document.onmouseup = function () {
document.onmousemove = null;
document.onmouseup = null;
};
};
}
};

View File

@ -0,0 +1,8 @@
import Vue from 'vue';
import install from './dialogDragWidth';
const dialogDragWidth = function(Vue) {
Vue.directive('dialogDragWidth', install);
};
Vue.use(dialogDragWidth);

106
src/directive/drag/drag.js Normal file
View File

@ -0,0 +1,106 @@
export default {
bind(el) {
const dragDom = el.querySelector('.reminder-box');
const dragRight = el.querySelector('.drag-right');
const dragLeft = el.querySelector('.drag-left');
const dragBottom = el.querySelector('.drag-bottom');
const dragTop = el.querySelector('.drag-top');
const dragBody = el.querySelector('.tip-body');
const body = el.querySelector('.tip-body-box');
dragRight.onmousedown = (e) => {
document.onselectstart = function () {
return false;
};
// 宽度拖拽
var iEvent = e || event;
var disX = iEvent.clientX;
var disW = dragDom.offsetWidth;
document.onmousemove = function (e) {
var iEvent = e || event;
if (disW + (iEvent.clientX - disX) > 350) {
dragDom.style.width = disW + (iEvent.clientX - disX) + 'px';
}
};
document.onmouseup = function () {
document.onmousemove = null;
document.onmouseup = null;
document.onselectstart = null;
};
};
dragLeft.onmousedown = (e) => {
document.onselectstart = function () {
return false;
};
// 宽度拖拽
var iEvent = e || event;
var disX = iEvent.clientX;
var disW = dragDom.offsetWidth;
var OFFLeft = dragDom.offsetLeft;
document.onmousemove = function (e) {
const iEvent = e || event;
const width = disW - (iEvent.clientX - disX);
if (width > 350) {
dragDom.style.width = disW - (iEvent.clientX - disX) + 'px';
dragDom.style.left = OFFLeft + (iEvent.clientX - disX) + 'px';
}
};
document.onmouseup = function () {
document.onmousemove = null;
document.onmouseup = null;
document.onselectstart = null;
};
};
dragBottom.onmousedown = (e) => {
document.onselectstart = function () {
return false;
};
// 宽度拖拽
var iEvent = e || event;
var disY = iEvent.clientY;
var disH = dragDom.offsetHeight;
document.onmousemove = function (e) {
var iEvent = e || event;
if (disH + (iEvent.clientY - disY) > 200) {
dragDom.style.height = disH + (iEvent.clientY - disY) + 'px';
body.style.height = disH + (iEvent.clientY - disY) - 40 + 'px';
dragBody.style.height = disH + (iEvent.clientY - disY) - 100 + 'px';
}
};
document.onmouseup = function () {
document.onmousemove = null;
document.onmouseup = null;
document.onselectstart = null;
};
};
dragTop.onmousedown = (e) => {
document.onselectstart = function () {
return false;
};
// 宽度拖拽
var iEvent = e || event;
var disY = iEvent.clientY;
var disH = dragDom.offsetHeight;
var OOFTop = dragDom.offsetTop;
document.onmousemove = function (e) {
var iEvent = e || event;
if (disH - (iEvent.clientY - disY) > 200) {
dragDom.style.height = disH - (iEvent.clientY - disY) + 'px';
body.style.height = disH - (iEvent.clientY - disY) - 40 + 'px';
dragBody.style.height = disH - (iEvent.clientY - disY) - 100 + 'px';
dragDom.style.top = OOFTop + (iEvent.clientY - disY) + 'px';
}
};
document.onmouseup = function () {
document.onmousemove = null;
document.onmouseup = null;
document.onselectstart = null;
};
};
}
};

View File

@ -0,0 +1,8 @@
import Vue from 'vue';
import install from './drag';
const drag = function(Vue) {
Vue.directive('drag', install);
};
Vue.use(drag);

View File

@ -0,0 +1,18 @@
export default {
// 当被绑定的元素插入到 DOM 中时
inserted: function (el, obj) {
// 这是需要页面刚加载就能进行聚焦操作使用的钩子函数,可以省略的,视具体需求而定
// 对值进行判断
if (obj.value) {
// 聚焦元素
el.focus();
}
},
// 当指令所在组件的 VNode 及其子 VNode 全部更新后调用
// 这是每当绑定的值发生改变时触发的钩子函数
componentUpdated: function (el, obj) {
if (obj.value) {
el.focus();
}
}
};

View File

@ -0,0 +1,8 @@
import Vue from 'vue';
import install from './focus';
const focus = function(Vue) {
Vue.directive('focus', install);
};
Vue.use(focus);

View File

@ -0,0 +1,8 @@
import Vue from 'vue';
import install from './quickMenuDrag';
const quickMenuDrag = function(Vue) {
Vue.directive('quickMenuDrag', install);
};
Vue.use(quickMenuDrag);

View File

@ -0,0 +1,45 @@
export default {
bind(el) {
const dragDom = el;
dragDom.style.cursor = 'move';
/** 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);*/
const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null);
dragDom.onmousedown = (e) => {
/** 鼠标按下,计算当前元素距离可视区的距离*/
const disX = e.clientX;
const disY = e.clientY;
/** 获取到的值带px 正则匹配替换*/
let styL, styT;
/** 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px*/
if (sty.left.includes('%')) {
styL = +document.body.clientWidth * (+sty.left.replace(/\%/g, '') / 100);
styT = +document.body.clientHeight * (+sty.top.replace(/\%/g, '') / 100);
} else {
styL = +sty.left.replace(/\px/g, '');
styT = +sty.top.replace(/\px/g, '');
}
document.onmousemove = function (e) {
/** 通过事件委托,计算移动的距离*/
const l = e.clientX - disX;
const t = e.clientY - disY;
/** 移动当前元素*/
dragDom.style.left = `${l + styL}px`;
dragDom.style.top = `${t + styT}px`;
/** 将此时的位置传出去*/
// binding.value({ x: e.pageX, y: e.pageY });
};
document.onmouseup = function () {
document.onmousemove = null;
document.onmouseup = null;
};
};
}
};

View File

@ -0,0 +1,8 @@
import Vue from 'vue';
import install from './waves';
const waves = function(Vue) {
Vue.directive('waves', install);
};
Vue.use(waves);

View File

@ -0,0 +1,26 @@
.waves-ripple {
position: absolute;
border-radius: 100%;
background-color: rgba(0, 0, 0, 0.15);
background-clip: padding-box;
pointer-events: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-transform: scale(0);
-ms-transform: scale(0);
transform: scale(0);
opacity: 1;
}
.waves-ripple.z-active {
opacity: 0;
-webkit-transform: scale(2);
-ms-transform: scale(2);
transform: scale(2);
-webkit-transition: opacity 1.2s ease-out, -webkit-transform 0.6s ease-out;
transition: opacity 1.2s ease-out, -webkit-transform 0.6s ease-out;
transition: opacity 1.2s ease-out, transform 0.6s ease-out;
transition: opacity 1.2s ease-out, transform 0.6s ease-out, -webkit-transform 0.6s ease-out;
}

View File

@ -0,0 +1,72 @@
import './waves.css';
const context = '@@wavesContext';
function handleClick(el, binding) {
function handle(e) {
const customOpts = Object.assign({}, binding.value);
const opts = Object.assign({
ele: el, // 波纹作用元素
type: 'hit', // hit 点击位置扩散 center中心点扩展
color: 'rgba(0, 0, 0, 0.15)' // 波纹颜色
},
customOpts
);
const target = opts.ele;
if (target) {
target.style.position = 'relative';
target.style.overflow = 'hidden';
const rect = target.getBoundingClientRect();
let ripple = target.querySelector('.waves-ripple');
if (!ripple) {
ripple = document.createElement('span');
ripple.className = 'waves-ripple';
ripple.style.height = ripple.style.width = Math.max(rect.width, rect.height) + 'px';
target.appendChild(ripple);
} else {
ripple.className = 'waves-ripple';
}
switch (opts.type) {
case 'center':
ripple.style.top = rect.height / 2 - ripple.offsetHeight / 2 + 'px';
ripple.style.left = rect.width / 2 - ripple.offsetWidth / 2 + 'px';
break;
default:
ripple.style.top =
(e.pageY - rect.top - ripple.offsetHeight / 2 - document.documentElement.scrollTop ||
document.body.scrollTop) + 'px';
ripple.style.left =
(e.pageX - rect.left - ripple.offsetWidth / 2 - document.documentElement.scrollLeft ||
document.body.scrollLeft) + 'px';
}
ripple.style.backgroundColor = opts.color;
ripple.className = 'waves-ripple z-active';
return false;
}
}
if (!el[context]) {
el[context] = {
removeHandle: handle
};
} else {
el[context].removeHandle = handle;
}
return handle;
}
export default {
bind(el, binding) {
el.addEventListener('click', handleClick(el, binding), false);
},
update(el, binding) {
el.removeEventListener('click', el[context].removeHandle, false);
el.addEventListener('click', handleClick(el, binding), false);
},
unbind(el) {
el.removeEventListener('click', el[context].removeHandle, false);
el[context] = null;
delete el[context];
}
};

View File

@ -1,283 +0,0 @@
/* eslint-disable no-useless-escape */
import Vue from 'vue';
import store from '@/store';
/**
*元素获取焦点v-dialogDrag
* @param {*} el
* @param {*} binding
*/
Vue.directive('focus', {
// 当被绑定的元素插入到 DOM 中时
inserted: function (el, obj) {
// 这是需要页面刚加载就能进行聚焦操作使用的钩子函数,可以省略的,视具体需求而定
// 对值进行判断
if (obj.value) {
// 聚焦元素
el.focus();
}
},
// 当指令所在组件的 VNode 及其子 VNode 全部更新后调用
// 这是每当绑定的值发生改变时触发的钩子函数
componentUpdated: function (el, obj) {
if (obj.value) {
el.focus();
}
}
});
/**
*弹窗拖拽v-dialogDrag
* @param {*} el
* @param {*} binding
* @param {*} vnode
* @param {*} oldvNode
*/
Vue.directive('dialogDrag', {
bind(el) {
const dialogHeaderEl = el.querySelector('.el-dialog__header');
const dragDom = el.querySelector('.el-dialog');
dialogHeaderEl.style.cursor = 'move';
/** 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);*/
const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null);
dialogHeaderEl.onmousedown = (e) => {
/** 鼠标按下,计算当前元素距离可视区的距离*/
const disX = e.clientX - dialogHeaderEl.offsetLeft;
const disY = e.clientY - dialogHeaderEl.offsetTop;
/** 获取到的值带px 正则匹配替换*/
let styL, styT;
/** 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px*/
if (sty.left.includes('%')) {
// eslint-disable-next-line no-useless-escape
styL = +document.body.clientWidth * (+sty.left.replace(/\%/g, '') / 100);
styT = +document.body.clientHeight * (+sty.top.replace(/\%/g, '') / 100);
} else {
// eslint-disable-next-line no-useless-escape
styL = +sty.left.replace(/\px/g, '');
// eslint-disable-next-line no-useless-escape
styT = +sty.top.replace(/\px/g, '');
}
document.onmousemove = function (e) {
/** 通过事件委托,计算移动的距离*/
const l = e.clientX - disX;
const t = e.clientY - disY;
/** 移动当前元素*/
dragDom.style.left = `${l + styL}px`;
dragDom.style.top = `${t + styT}px`;
/** 刷新提示标签位置*/
store.dispatch('training/emitTipFresh');
/** 将此时的位置传出去*/
// binding.value({ x: e.pageX, y: e.pageY });
};
document.onmouseup = function () {
document.onmousemove = null;
document.onmouseup = null;
};
};
}
});
/**
*弹窗宽度拖大,拖小dialogDragWidth
* @param {*} el
* @param {*} binding
* @param {*} vnode
* @param {*} oldvNode
*/
Vue.directive('dialogDragWidth', {
bind(el, binding) {
const dragDom = binding.value.$el.querySelector('.el-dialog');
el.onmousedown = (e) => {
/** 鼠标按下,计算当前元素距离可视区的距离*/
const disX = e.clientX - el.offsetLeft;
document.onmousemove = function (e) {
/** 移动时禁用默认事件*/
e.preventDefault();
/** 通过事件委托,计算移动的距离*/
const l = e.clientX - disX;
dragDom.style.width = `${l}px`;
};
document.onmouseup = function () {
document.onmousemove = null;
document.onmouseup = null;
};
};
}
});
/**
* 弹窗拖拽v-quickEntryDrag
* @param {*} el
* @param {*} binding
* @param {*} vnode
* @param {*} oldvNode
*/
Vue.directive('quickMenuDrag', {
bind(el) {
const dragDom = el;
dragDom.style.cursor = 'move';
/** 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);*/
const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null);
dragDom.onmousedown = (e) => {
/** 鼠标按下,计算当前元素距离可视区的距离*/
const disX = e.clientX;
const disY = e.clientY;
/** 获取到的值带px 正则匹配替换*/
let styL, styT;
/** 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px*/
if (sty.left.includes('%')) {
styL = +document.body.clientWidth * (+sty.left.replace(/\%/g, '') / 100);
styT = +document.body.clientHeight * (+sty.top.replace(/\%/g, '') / 100);
} else {
styL = +sty.left.replace(/\px/g, '');
styT = +sty.top.replace(/\px/g, '');
}
document.onmousemove = function (e) {
/** 通过事件委托,计算移动的距离*/
const l = e.clientX - disX;
const t = e.clientY - disY;
/** 移动当前元素*/
dragDom.style.left = `${l + styL}px`;
dragDom.style.top = `${t + styT}px`;
/** 将此时的位置传出去*/
// binding.value({ x: e.pageX, y: e.pageY });
};
document.onmouseup = function () {
document.onmousemove = null;
document.onmouseup = null;
};
};
}
});
/**
*vue-自定义指令-拖拽 v-drag
*/
Vue.directive('drag', {
bind(el) {
const dragDom = el.querySelector('.reminder-box');
const dragRight = el.querySelector('.drag-right');
const dragLeft = el.querySelector('.drag-left');
const dragBottom = el.querySelector('.drag-bottom');
const dragTop = el.querySelector('.drag-top');
const dragBody = el.querySelector('.tip-body');
const body = el.querySelector('.tip-body-box');
dragRight.onmousedown = (e) => {
document.onselectstart = function () {
return false;
};
// 宽度拖拽
var iEvent = e || event;
var disX = iEvent.clientX;
var disW = dragDom.offsetWidth;
document.onmousemove = function (e) {
var iEvent = e || event;
if (disW + (iEvent.clientX - disX) > 350) {
dragDom.style.width = disW + (iEvent.clientX - disX) + 'px';
}
};
document.onmouseup = function () {
document.onmousemove = null;
document.onmouseup = null;
document.onselectstart = null;
};
};
dragLeft.onmousedown = (e) => {
document.onselectstart = function () {
return false;
};
// 宽度拖拽
var iEvent = e || event;
var disX = iEvent.clientX;
var disW = dragDom.offsetWidth;
var OFFLeft = dragDom.offsetLeft;
document.onmousemove = function (e) {
const iEvent = e || event;
const width = disW - (iEvent.clientX - disX);
if (width > 350) {
dragDom.style.width = disW - (iEvent.clientX - disX) + 'px';
dragDom.style.left = OFFLeft + (iEvent.clientX - disX) + 'px';
}
};
document.onmouseup = function () {
document.onmousemove = null;
document.onmouseup = null;
document.onselectstart = null;
};
};
dragBottom.onmousedown = (e) => {
document.onselectstart = function () {
return false;
};
// 宽度拖拽
var iEvent = e || event;
var disY = iEvent.clientY;
var disH = dragDom.offsetHeight;
document.onmousemove = function (e) {
var iEvent = e || event;
if (disH + (iEvent.clientY - disY) > 200) {
dragDom.style.height = disH + (iEvent.clientY - disY) + 'px';
body.style.height = disH + (iEvent.clientY - disY) - 40 + 'px';
dragBody.style.height = disH + (iEvent.clientY - disY) - 100 + 'px';
}
};
document.onmouseup = function () {
document.onmousemove = null;
document.onmouseup = null;
document.onselectstart = null;
};
};
dragTop.onmousedown = (e) => {
document.onselectstart = function () {
return false;
};
// 宽度拖拽
var iEvent = e || event;
var disY = iEvent.clientY;
var disH = dragDom.offsetHeight;
var OOFTop = dragDom.offsetTop;
document.onmousemove = function (e) {
var iEvent = e || event;
if (disH - (iEvent.clientY - disY) > 200) {
dragDom.style.height = disH - (iEvent.clientY - disY) + 'px';
body.style.height = disH - (iEvent.clientY - disY) - 40 + 'px';
dragBody.style.height = disH - (iEvent.clientY - disY) - 100 + 'px';
dragDom.style.top = OOFTop + (iEvent.clientY - disY) + 'px';
}
};
document.onmouseup = function () {
document.onmousemove = null;
document.onmouseup = null;
document.onselectstart = null;
};
};
}
});

View File

@ -158,5 +158,6 @@ export default {
processFailure: 'Process failure',
enterLastStep: 'Please enter a hint and click next',
pleaseOpearte: 'Please proceed',
help: 'help'
help: 'help',
city: 'City'
};

View File

@ -158,6 +158,6 @@ export default {
processFailure: '处理失败',
enterLastStep: '请输入提示并点击下一步',
pleaseOpearte: '请开始操作',
help: '帮助'
help: '帮助',
city: '城市'
};

View File

@ -27,10 +27,10 @@ export default {
wellDelTrainingRule: '此操作将删除此实训规则, 是否继续?',
stepDetail: '步骤明细',
generation: '自动生成',
saveAs: '另存为',
skinTypeFrom: '从',
skinTypeTo: '到',
copyLesson: '复制课程定义',
saveAs: '另存为',
skinTypeFrom: '从',
skinTypeTo: '到',
copyLesson: '复制课程定义',
skinType: '皮肤类型',
minDuration: '最佳用时',
maxDuration: '最大用时',
@ -101,21 +101,21 @@ export default {
train: '列车',
station: '车站',
trainWindow: '车次窗',
countSkinCode: '复制皮肤与被复制皮肤类型不能一样',
trainingRecord: '实训录制',
lesson: '课程',
taskManage: '任务管理',
trainingRule: '操作定义',
trainingManage: '实训管理',
newConstruction: '新建',
applicationForRelease: '申请发布',
rejectReason: '驳回原因',
withdraw: '撤销',
notRelease: '未发布',
pendingReview: '待审核',
published: '已发布',
rejected: '已驳回',
review: '查看'
countSkinCode: '复制皮肤与被复制皮肤类型不能一样',
trainingRecord: '实训录制',
lesson: '课程',
taskManage: '任务管理',
trainingRule: '操作定义',
trainingManage: '实训管理',
newConstruction: '新建',
applicationForRelease: '申请发布',
rejectReason: '驳回原因',
withdraw: '撤销',
notRelease: '未发布',
pendingReview: '待审核',
published: '已发布',
rejected: '已驳回',
review: '查看'
};

View File

@ -1,355 +0,0 @@
<template>
<el-dialog class="chengdou-03__systerm stand-detain-train" :title="title" :visible.sync="show" width="380px"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<div class="head_content content">
<span class="base-label" style="left: 0px;">会话管理</span>
<el-col :span="8">
<el-button class="status">查询会话状态</el-button>
</el-col>
<el-col :span="15" :offset="1">
<el-input :value="messageText" placeholder="" size="mini" disabled></el-input>
</el-col>
<el-col :span="12">
<el-button class="status_btn" :id="openMessageId" @click="handleMessage('open')"
:disabled="isOpenMessage">打开会话</el-button>
</el-col>
<el-col :span="12">
<el-button class="status_btn" :id="closeMessageId" @click="handleMessage('close')"
:disabled="!isOpenMessage">关闭会话
</el-button>
</el-col>
</div>
<div class="content cotnent_body">
<span class="base-label" style="left: 0px;">操作</span>
<el-col :span="3">
<div class="text">操作</div>
</el-col>
<el-col :span="11" :offset="1">
<el-input :value="messageText1" placeholder="" size="mini" disabled></el-input>
</el-col>
<el-col :span="8" :offset="1">
<el-button class="status_btn" :id="confirmId1" @click="confirm1" :disabled="disabledConfirm1">确认
</el-button>
</el-col>
</div>
<div class="content cotnent_body">
<span class="base-label" style="left: 0px;">确认</span>
<el-col :span="3">
<div class="text">操作</div>
</el-col>
<el-col :span="11" :offset="1">
<el-input :value="messageText2" placeholder="" size="mini" disabled></el-input>
</el-col>
<el-col :span="8" :offset="1">
<el-button class="status_btn" :id="confirmId2" @click="confirm2" :disabled="disabledConfirm2">确认
</el-button>
</el-col>
</div>
<div class="body_cont">
<el-col :span="7">
<div class="text">操作倒计时</div>
</el-col>
<el-col :span="17">
<div style="border: 2px inset #E9E9E9; height: 30px; width: 100%;">
{{timeCountConfirm == -1 ? '' : timeCountConfirm}}</div>
</el-col>
</div>
<div class="body_cont">
<div class="status_text">状态</div>
<div class="textarea_content"></div>
</div>
<el-button class="close_btn" :id="domIdConfirm" type="primary" @click="commit">关闭</el-button>
<confirm-tip ref='ConfirmTip' @close="closeMessage"></confirm-tip>
</el-dialog>
</template>
<script>
import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic';
import { mouseCancelState } from '../utils/menuItemStatus';
import ConfirmTip from './childDialog/confirmTip';
export default {
name: 'StandDetainTrain',
components: {
ConfirmTip
},
data() {
return {
dialogShow: false,
standName: '',
stationName: '',
selected: null,
operation: null,
radio: '1',
radio1: '1',
earlyDepar: false,
messageText: '',
messageText1: '',
messageText2: '',
isOpenMessage: false,
timeCountConfirm: -1,
disabledConfirm1: false,
disabledConfirm2: false,
}
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
openMessageId() {
return this.dialogShow ? OperationEvent.LimitControl.CancelAllLimit.openMessage.domId : '';
},
closeMessageId() {
return this.dialogShow ? OperationEvent.LimitControl.CancelAllLimit.closeMessage.domId : '';
},
confirmId1() {
return this.dialogShow ? OperationEvent.LimitControl.CancelAllLimit.confirm1.domId : '';
},
confirmId2() {
return this.dialogShow ? OperationEvent.LimitControl.CancelAllLimit.confirm2.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.LimitControl.CancelAllLimit.confirm.domId : '';
},
title() {
return '取消全线临时限速';
},
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
this.timer = setInterval(() => {
if (this.timeCountConfirm > 0) {
this.timeCountConfirm--;
} else if (this.timeCountConfirm == 0) { //
this.timeCountConfirm = -1;
this.disabledConfirm2 = true;
}
}, 1000)
},
methods: {
doShow(operate, selected) {
this.selected = selected;
if (!this.dialogShow) {
this.standName = '';
this.stationName = '';
this.operation = operate.operation;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
mouseCancelState(this.selected);
},
handleMessage(message) {
if (message == 'open') {
let operate = {
type: MapDeviceType.LimitControl.type,
operation: OperationEvent.LimitControl.CancelAllLimit.openMessage.operation,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.isOpenMessage = true;
this.messageText1 = '取消全线临时限速';
}
}).catch(error => {
this.doClose();
});
} else {
let operate = {
type: MapDeviceType.LimitControl.type,
operation: OperationEvent.LimitControl.CancelAllLimit.closeMessage.operation,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.isOpenMessage = false;
this.messageText1 = '';
this.messageText2 = '';
this.disabledConfirm1 = false;
this.disabledConfirm2 = false;
this.timeCountConfirm = -1; //
}
}).catch(error => {
this.doClose();
});
}
},
confirm1() {
let operate = {
type: MapDeviceType.LimitControl.type,
operation: OperationEvent.LimitControl.CancelAllLimit.confirm1.operation,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.isOpenMessage = true;
this.messageText1 = '**************';
this.messageText2 = '取消全线临时限速';
this.disabledConfirm1 = true;
this.timeCountConfirm = 60; //
}
}).catch(error => {
this.doClose();
});
},
confirm2() {
let operate = {
send: true,
type: MapDeviceType.LimitControl.type,
operation: OperationEvent.LimitControl.CancelAllLimit.confirm2.operation,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.isOpenMessage = true;
this.messageText2 = '**************';
this.disabledConfirm2 = true;
this.timeCountConfirm = -1;
}
}).catch(error => {
this.doClose();
});
},
commit() {
let operate = {
send: true,
type: MapDeviceType.LimitControl.type,
operation: OperationEvent.LimitControl.CancelAllLimit.confirm.operation,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (!this.isOpenMessage) {
this.doClose();
} else {
let operate = {
message: `是否关闭会话,并关闭窗口`,
confirmId: OperationEvent.LimitControl.CancelAllLimit.close.domId,
}
this.$refs.ConfirmTip.doShow(operate);
}
}).catch(error => {
console.log(error);
})
},
closeMessage() {
let operate = {
type: MapDeviceType.LimitControl.type,
operation: OperationEvent.LimitControl.CancelAllLimit.close.operation,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.ConfirmTip.doClose();
this.isOpenMessage = false;
this.messageText1 = '';
this.messageText2 = '';
this.disabledConfirm1 = false;
this.disabledConfirm2 = false;
this.timeCountConfirm = -1; //
this.doClose();
}).catch(error => {
console.log(error);
})
}
}
}
</script>
<style scoped lang="scss">
.stand-detain-train .context {
height: 80px !important;
}
.content {
width: 100%;
border: 1px solid lightgray;
padding: 18px 5px;
position: relative;
.base-label {
position: absolute;
top: -5px;
left: 20px;
background-color: #F0F0F0;
padding: 0 5px;
}
.el-button {
width: 100%;
line-height: 28px;
}
.status_btn {
width: 110px;
margin: 15px auto 0;
display: block;
}
}
.head_content {
height: 110px;
margin-bottom: 10px;
}
.cotnent_body {
height: 60px;
margin-bottom: 10px;
.text {
line-height: 30px;
text-align: center;
font-size: 15px;
}
.status_btn {
width: 80px;
margin: 0 auto
}
}
.close_btn {
margin: 0 auto;
width: 80px;
display: block;
}
.body_cont {
margin-bottom: 10px;
padding: 0 3px;
overflow: hidden;
.text {
line-height: 30px;
text-align: center;
font-size: 15px;
}
.status_text {
margin-bottom: 3px;
font-size: 14px;
padding-left: 8px;
}
.textarea_content {
height: 85px;
width: 100%;
border: 2px solid #E9E9E9;
box-shadow: 2px 2px #959595 inset;
}
}
</style>

View File

@ -22,17 +22,7 @@
</el-row>
<div class="route-table-box">
<span class="route-table-tip">进路列表</span>
<el-table
ref="table"
:data="tempData"
border
:cell-style="tableStyle"
style="width: 99%;"
size="mini"
height="90"
highlight-current-row
@row-click="clickEvent"
>
<el-table ref="table" :data="tempData" border :cell-style="tableStyle" style="width: 99%;" size="mini" height="90" highlight-current-row @row-click="clickEvent">
<el-table-column :id="domIdChoose" prop="name" label="进路" style="margin-left:30px" />
<el-table-column :id="domIdChoose" prop="controlType" label="进路属性" style="margin-left:30px">
<template slot-scope="scope">{{ controlTypeNameMap[scope.row.controlType] }} </template>
@ -78,7 +68,6 @@ export default {
dialogShow: false,
loading: false,
selected: null,
row: null,
operation: '',
display: true,
stationName: '',
@ -163,44 +152,18 @@ export default {
doClose() {
this.loading = false;
this.dialogShow = false;
this.guide();
this.$refs.table.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
mouseCancelState(this.selected);
},
guide() {
//
if (this.beforeSectionList && this.beforeSectionList.length) {
this.beforeSectionList.forEach(elem => {
elem.cutOff = false;
});
}
this.$store.dispatch('training/updateMapState', [...this.beforeSectionList]);
this.beforeSectionList = [];
},
clickEvent(row, event, column) {
this.row = row;
if (row) {
//
this.guide();
row.canSetting = true;
//
if (row.containSectionList && row.containSectionList.length) {
//
row.containSectionList.forEach(elem => {
elem.cutOff = true;
});
}
this.$store.dispatch('training/updateMapState', [...row.containSectionList]);
this.beforeSectionList = row.containSectionList || [];
//
const operate = {
repeat: true,
type: MapDeviceType.Signal.type,
operation: OperationEvent.Signal.guide.choose.operation,
val: row.code
val: row.code,
selection: row
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {

View File

@ -14,16 +14,7 @@
</el-col>
</el-row>
<div class="table">
<el-table ref="tempTable" :data="tempData" border style="width: 100%" size="mini" highlight-current-row :height="140">
<el-table-column prop="name" label="选择" width="55" style="margin-left:50px; text-align: right;">
<template slot-scope="scope">
<el-checkbox
v-model="scope.row.check"
style="text-align: center; display: block;"
:disabled="scope.row.disabled"
/>
</template>
</el-table-column>
<el-table ref="tempTable" :data="tempData" border style="width: 100%" size="mini" :highlight-current-row="highlight" :height="140" @row-click="clickEvent">
<el-table-column :id="domIdChoose" prop="name" width="155" label="描述" style="margin-left:30px">
<template slot-scope="scope">
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.name }}</span>
@ -41,7 +32,7 @@
</el-table-column>
<el-table-column :id="domIdChoose" prop="name" label="控制" style="">
<template slot-scope="scope">
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">2222</span>
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.controlType == '01' ? '自动' : '人工' }}</span>
</template>
</el-table-column>
</el-table>
@ -83,7 +74,8 @@ export default {
selection: [],
stationName: '',
signalName: '',
allSelect: false
allSelect: false,
highlight: true
};
},
computed: {
@ -124,15 +116,6 @@ export default {
return disabled;
}
},
watch: {
//
tempData: {
handler(val, oldVal) {
this.checkTableDataSelction(val);
},
deep: true
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
@ -153,20 +136,18 @@ export default {
}
}
// if (tempData && tempData.length > 0) {
// tempData.forEach(elem => {
// elem.check = false;
// elem.disabled = false;
// //
// if (operate.operation === OperationEvent.Signal.humanControl.menu.operation &&
// elem.controlType != '01') {
// elem.disabled = true;
// } if (operate.operation === OperationEvent.Signal.atsAutoControl.menu.operation &&
// elem.controlType == '01') {
// elem.disabled = true;
// }
// });
// }
if (tempData && tempData.length > 0) {
tempData.forEach(elem => {
elem.check = false;
elem.disabled = false;
//
if (operate.operation === OperationEvent.Signal.humanControl.menu.operation && elem.controlType == '01') {
elem.disabled = true;
} if (operate.operation === OperationEvent.Signal.atsAutoControl.menu.operation && elem.controlType == '02') {
elem.disabled = true;
}
});
}
this.tempData = tempData || [];
this.operation = operate.operation;
@ -183,31 +164,6 @@ export default {
this.$store.dispatch('training/emitTipFresh');
mouseCancelState(this.selected);
},
checkTableDataSelction(data) {
const selection = [];
if (data && data.length > 0) {
data.forEach(row => {
if (row.check && !row.disabled) {
selection.push(row);
}
});
}
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
this.handleChooseChange(selection);
this.selection = selection;
}
let num = 0;
this.allSelect = false;
this.tempData.forEach(item => {
if (item.check) {
num++;
if (num == this.tempData.length) {
this.allSelect = true;
}
}
});
},
allSelectChange() {
if (this.allSelect) {
this.tempData.forEach(item => {
@ -223,6 +179,7 @@ export default {
});
}
},
// code
serializeCodeListWithSeparator(sep) {
const codeList = [];
if (this.selection && this.selection.length) {
@ -232,17 +189,21 @@ export default {
}
return codeList.join(sep);
},
handleChooseChange(selection) {
this.selection = selection;
if (selection && selection.length) {
clickEvent(row, event, column) {
this.highlight = false;
if (row && !row.disabled) {
this.highlight = true;
this.selection = [row];
this.beforeSectionList = row.containSectionList || [];
//
const operate = {
repeat: true,
type: MapDeviceType.Signal.type,
operation: '',
val: this.serializeCodeListWithSeparator('::'),
selection: selection
val: row.code,
selection: row
};
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
/** 进路交人工控*/
operate.operation = OperationEvent.Signal.humanControl.choose.operation;
@ -256,8 +217,6 @@ export default {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
} else if (!selection) {
this.$messageBox(`请选择一条数据`);
}
},
commit() {

View File

@ -13,7 +13,6 @@
<menu-section ref="menuSection" :selected="selected" />
<menu-train ref="menuTrain" :selected="selected" />
<menu-station ref="menuStation" :selected="selected" />
<!-- <menu-limit ref="menuLimit" :selected="selected" /> -->
<passive-alarm ref="passiveAlarm" />
<passive-contorl ref="passiveControl" />
<passive-Timeout ref="passiveTimeout" />
@ -33,7 +32,6 @@ import MenuSection from './menuSection';
import MenuTrain from './menuTrain';
import MenuStation from './menuStation';
import MenuBar from './menuBar';
// import MenuLimit from './menuLimit';
import PassiveAlarm from './passiveDialog/alarm';
import PassiveContorl from './passiveDialog/control';
import PassiveTimeout from './passiveDialog/timeout';
@ -51,7 +49,6 @@ export default {
MenuStationStand,
MenuStation,
MenuTrain,
// MenuLimit,
PassiveAlarm,
PassiveContorl,
PassiveTimeout

View File

@ -209,6 +209,7 @@ export default {
this.$store.dispatch('menuOperation/setButtonOperation', operation); //
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (operation == this.Signal.humanTrainRoute.button.operation) { //
operate['operateCode'] = this.Signal.humanTrainRoute.button.operation;
this.$refs.password.doShow(operate);
}
this.$store.dispatch('training/emitTipFresh');

View File

@ -1,120 +0,0 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" />
<cancel-all-limit ref="cancelAllLimit" />
</div>
</template>
<script>
import PopMenu from '@/components/PopMenu';
import CancelAllLimit from './dialog/cancelAllLimit';
import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic';
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
import { MenuDisabledState } from './utils/menuItemStatus';
export default {
name: 'MenuLimit',
components: {
PopMenu,
CancelAllLimit
},
props: {
selected: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
menu: [{
label: '取消全线临时限速',
handler: this.cancelSpeed,
disabledCallback: '',
auth: { station: true, center: false }
}],
menuNormal: {
local: [
{
label: '取消全线临时限速',
handler: this.cancelSpeed,
disabledCallback: MenuDisabledState.Section.cancelSpeed,
auth: { station: true, center: false }
}
],
central: [
{
label: '取消全线临时限速',
handler: this.cancelSpeed,
disabledCallback: MenuDisabledState.Section.cancelSpeed,
auth: { station: false, center: true }
}
]
}
};
},
computed: {
...mapGetters('training', [
'mode',
'operatemode'
]),
...mapGetters('menuOperation', [
'buttonOperation'
])
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.LimitControl) && !this.buttonOperation) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
},
methods: {
clickEvent() {
const self = this;
window.onclick = function (e) {
self.doClose();
};
},
initMenu() {
//
if (this.operatemode === OperateMode.ADMIN) {
this.menu = [...this.menu];
}
},
doShow(point) {
this.clickEvent();
this.initMenu();
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
this.$refs.popMenu.resetShowPosition(point);
}
},
doClose() {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
}
},
//
cancelSpeed() {
const operate = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.LimitControl.type,
label: MapDeviceType.LimitControl.label,
operation: OperationEvent.LimitControl.CancelAllLimit.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.cancelAllLimit.doShow(operate, this.selected);
}
});
}
}
};
</script>

View File

@ -177,7 +177,7 @@
if (operate.selection && operate.selection.length) {
operate.selection.forEach(elem => {
if (operate.commit) {
this.updateTableValue(elem.code, { result: `${$t('menu.menuDialog.senedMessageOne')}${this.timeout} ${this.$t('menu.menuDialog.senedMessageTwo')}` }, false);
this.updateTableValue(elem.code, { result: `${this.$t('menu.menuDialog.senedMessageOne')}${this.timeout} ${this.$t('menu.menuDialog.senedMessageTwo')}` }, false);
} else if (operate.cancel) {
this.updateTableValue(elem.code, { result: '' }, false);
}
@ -381,7 +381,7 @@
};
this.selection.forEach((elem, index) => {
operate.messages.push(`${$t('menu.menuDialog.operatingArea')} ${index + 1}:${elem.operate}`);
operate.messages.push(`${this.$t('menu.menuDialog.operatingArea')} ${index + 1}:${elem.operate}`);
});
this.disabledSure = true;
@ -406,7 +406,7 @@
};
this.selection.forEach((elem, index) => {
operate.messages.push(`${$t('menu.menuDialog.operatingArea')} ${index + 1}:${elem.operate}`);
operate.messages.push(`${this.$t('menu.menuDialog.operatingArea')} ${index + 1}:${elem.operate}`);
});
this.disabledSure = true;
@ -431,7 +431,7 @@
};
this.selection.forEach((elem, index) => {
operate.messages.push(`${$t('menu.menuDialog.operatingArea')} ${index + 1}:${elem.operate}`);
operate.messages.push(`${this.$t('menu.menuDialog.operatingArea')} ${index + 1}:${elem.operate}`);
});
this.disabledSure = true;

View File

@ -160,7 +160,7 @@
childType: this.$t('menu.passiveDialog.childTypeTips'),
timeSummary: this.$t('menu.passiveDialog.controlModeSummary'),
recommendedOperation: '',
alarmDetail: `${$t('menu.passiveDialog.controlModeTransfer')} ${this.operate.name}${this.$t('menu.passiveDialog.alarmDetailOne')}${operate.currentMode == '01' ? this.$t('menu.passiveDialog.stationToCentral') : this.$t('menu.passiveDialog.centralToStation')}`
alarmDetail: `${this.$t('menu.passiveDialog.controlModeTransfer')} ${this.operate.name}${this.$t('menu.passiveDialog.alarmDetailOne')}${operate.currentMode == '01' ? this.$t('menu.passiveDialog.stationToCentral') : this.$t('menu.passiveDialog.centralToStation')}`
};
this.dialogShow = true;
this.$nextTick(function () {

View File

@ -19,7 +19,13 @@ import router from './router';
import '@/icons'; // icon
import '@/permission'; // permission control
import '@/scripts/GlobalPlugin';
import '@/directives';
// import '@/directives';
import '@/directive/dialogDrag/index.js';
import '@/directive/dialogDragWidth/index.js';
import '@/directive/drag/index.js';
import '@/directive/focus/index.js';
import '@/directive/quickMenuDrag/index.js';
import '@/directive/waves/index.js';
import messages from '@/i18n/index';
Vue.use(ElementUI);

View File

@ -150,6 +150,7 @@ export const userSimulation = '013'; // 仿真系统
export const userScreen = '014'; // 大屏系统
export const userPlan = '015'; // 计划系统
export const userDesign='016'; // 设计系统
const isDev = process.env.NODE_ENV === 'development';
export const UrlConfig = {
display: '/display',
@ -168,7 +169,7 @@ export const UrlConfig = {
},
lesson: {
prefix: '/lesson',
record: '/lesson/record/training',
record: '/system/record/training',
manage: '/lesson/manage/training'
},
dp: {
@ -546,13 +547,6 @@ export const asyncRouter = [
component: RunplanView,
hidden: true
}]
},
{
path: 'product',
component: MapProduct,
meta: {
i18n: 'router.productEdit'
}
}
]
},
@ -565,21 +559,6 @@ export const asyncRouter = [
roles: [admin, lessonCreater, userDesign]
},
children: [
{
path: 'record',
redirect: '/lesson/record/training/0/null',
component: Trainingrecord,
meta: {
i18n: 'router.trainingRecord'
},
children: [
{
path: 'training/:trainingId/:trainingName',
component: TrainingrecordManage,
hidden: true
}
]
},
{
path: 'manage/trainingRule',
component: TrainingRuleList,
@ -627,12 +606,12 @@ export const asyncRouter = [
hidden: true
},
{
path: 'detail/:mapId',
path: 'detail/:subSystem',
component: DemonstrationDetail,
hidden: true
},
{
path: 'teach',
path: 'teach/:subSystem',
component: TeachDetail,
hidden: true
},
@ -652,7 +631,7 @@ export const asyncRouter = [
hidden: true
},
{
path: 'course/:mapId',
path: 'course/:subSystem',
component: ExamCourseDetail,
hidden: true
},
@ -1057,6 +1036,29 @@ export const asyncRouter = [
meta: {
i18n: 'router.subsystemGeneration'
}
},
{
path: 'product',
component: MapProduct,
meta: {
i18n: 'router.productEdit'
}
},
{
path: 'record',
redirect: 'record/training/0/null',
component: Trainingrecord,
meta: {
i18n: 'router.trainingRecord'
},
hidden: !isDev,
children: [
{
path: 'training/:trainingId/:trainingName',
component: TrainingrecordManage,
hidden: true
}
]
}
]
},
@ -1113,9 +1115,6 @@ router.beforeEach((to, from, next) => {
} else {
document.title = '琏课堂';
}
// else if (name.includes('/plan/') || name.includes('/planEdit/')) {
// document.title = '琏计划';
// }
next();
});

View File

@ -867,7 +867,7 @@ export const OperationEvent = {
domId: '_Tips-Signal-Reopen-Confirm'
}
},
// 人解列车进路
// 人解列车进路 (总人解)
humanTrainRoute: {
event: '5',
button: {
@ -950,12 +950,12 @@ export const OperationEvent = {
operation: '3084',
domId: '_Tips-Signal-Guide-Confirm2'
},
stop: {
stop: { // 福州线 关闭弹窗操作
operation: '3085',
domId: '_Tips-Signal-Guide-Stop'
},
choose: {
operation: '3085',
operation: '3086',
domId: '_Tips-Signal-Guide-Choose'
}
},

View File

@ -1289,7 +1289,7 @@ export const OperationList = {
trainingName: '办理进路({3} 进路)',
trainingRemark: '办理进路功能',
trainingType: '02',
productTypes: ['01,02'],
productTypes: ['02'],
stepVOList: [
{ deviceType: '04', orderNum: 1, operateCode: '301', tip: '鼠标右键菜单选择【办理进路】' },
{ deviceType: '04', orderNum: 2, operateCode: '3011', tip: '鼠标左键选择进路名称【{3}】', val: '{4}' },
@ -1304,12 +1304,11 @@ export const OperationList = {
trainingName: '办理引导进路({3})',
trainingRemark: '进路办理信号引导',
trainingType: '02',
productTypes: ['01,02'],
productTypes: ['02'],
stepVOList: [
{ deviceType: '04', orderNum: 1, operateCode: '308', tip: '鼠标右键菜单选择【办理引导进路】' },
{ deviceType: '04', orderNum: 2, operateCode: '3085', tip: '鼠标左键选择进路名称【{3}】' },
{ deviceType: '04', orderNum: 3, operateCode: '308', tip: '鼠标左键点击【确认】按钮' },
{ deviceType: '04', orderNum: 4, operateCode: '0012', tip: '鼠标左键点击【确认】按钮' }
{ deviceType: '04', orderNum: 2, operateCode: '3086', tip: '鼠标左键选择进路名称【{3}】', val: '{4}' }, // 进路编号值不正确
{ deviceType: '04', orderNum: 3, operateCode: '308', tip: '鼠标左键点击【确认】按钮' }
]
},
{
@ -1320,7 +1319,7 @@ export const OperationList = {
trainingName: '取消进路({3} 进路)',
trainingRemark: '取消进路功能',
trainingType: '02',
productTypes: ['01,02'],
productTypes: ['02'],
stepVOList: [
{ deviceType: '04', orderNum: 1, operateCode: '303', tip: '鼠标右键菜单选择【取消进路】' },
{ deviceType: '04', orderNum: 2, operateCode: '303', tip: '鼠标左键点击【确定】按钮' }
@ -1329,12 +1328,12 @@ export const OperationList = {
{
maxDuration: 15,
minDuration: 8,
operateType: '0207',
operateType: '0215', // 新增数据字典code
skinCode: '04',
trainingName: '总人解({3})',
trainingRemark: '总人解',
trainingType: '02',
productTypes: ['01,02'],
productTypes: ['02'],
stepVOList: [
{ deviceType: '04', orderNum: 1, operateCode: '305', tip: '鼠标右键菜单选择【总人解】' },
{ deviceType: '04', orderNum: 2, operateCode: '305', tip: '鼠标左键点击【确定】按钮' },
@ -1349,7 +1348,7 @@ export const OperationList = {
trainingName: '信号重开({3} 进路)',
trainingRemark: '信号重开功能',
trainingType: '02',
productTypes: ['01,02'],
productTypes: ['02'],
stepVOList: [
{ deviceType: '04', orderNum: 1, operateCode: '304', tip: '鼠标右键菜单选择【信号重开】' },
{ deviceType: '04', orderNum: 2, operateCode: '304', tip: '鼠标左键点击【确定】按钮' }
@ -1363,7 +1362,7 @@ export const OperationList = {
trainingName: '信号封锁({5})',
trainingRemark: '信号封闭',
trainingType: '02',
productTypes: ['01,02'],
productTypes: ['02'],
stepVOList: [
{ deviceType: '04', orderNum: 1, operateCode: '306', tip: '鼠标右键菜单选择【信号封闭】' },
{ deviceType: '04', orderNum: 2, operateCode: '306', tip: '鼠标左键点击【确定】按钮' },
@ -1378,7 +1377,7 @@ export const OperationList = {
trainingName: '信号解封({5})',
trainingRemark: '信号解封',
trainingType: '02',
productTypes: ['01,02'],
productTypes: ['02'],
stepVOList: [
{ deviceType: '04', orderNum: 1, operateCode: '307', tip: '鼠标右键菜单选择【信号解封】' },
{ deviceType: '04', orderNum: 2, operateCode: '307', tip: '鼠标左键点击【确认】按钮' },
@ -1393,7 +1392,7 @@ export const OperationList = {
trainingName: '进路收人工控({5})',
trainingRemark: '进路收人工控',
trainingType: '02',
productTypes: ['01,02'],
productTypes: ['02'],
stepVOList: [
{ deviceType: '04', orderNum: 1, operateCode: '314', tip: '鼠标右键菜单选择【进路收人工控】' },
{ deviceType: '04', orderNum: 2, operateCode: '3141', tip: '鼠标左键选择进路名称【{3}】', val: '{4}' },
@ -1408,7 +1407,7 @@ export const OperationList = {
trainingName: '进路交自动控({5})',
trainingRemark: '进路交自动控',
trainingType: '02',
productTypes: ['01,02'],
productTypes: ['02'],
stepVOList: [
{ deviceType: '04', orderNum: 1, operateCode: '315', tip: '鼠标右键菜单选择【进路交自动控】' },
{ deviceType: '04', orderNum: 2, operateCode: '3151', tip: '鼠标左键选择进路名称【{3}】', val: '{4}' },
@ -1433,12 +1432,12 @@ export const OperationList = {
{
maxDuration: 15,
minDuration: 8,
operateType: '0305',
operateType: '0305', // 0312 新增定位字典
skinCode: '04',
trainingName: '单操到定位({7})',
trainingRemark: '单操到定位({15})',
trainingType: '03',
productTypes: ['01,02'],
productTypes: ['02'],
stepVOList: [
{ deviceType: '02', orderNum: 1, operateCode: '101', tip: '鼠标右键菜单选择【单操到定位】' },
{ deviceType: '02', orderNum: 2, operateCode: '101', tip: '鼠标左键点击【确定】按钮' }
@ -1447,12 +1446,12 @@ export const OperationList = {
{
maxDuration: 15,
minDuration: 8,
operateType: '0305',
operateType: '0305', // 0313 新增定位字典
skinCode: '04',
trainingName: '单操到反位({7})',
trainingRemark: '单操到反位({7})',
trainingType: '03',
productTypes: ['01,02'],
productTypes: ['02'],
stepVOList: [
{ deviceType: '02', orderNum: 1, operateCode: '102', tip: '鼠标右键菜单选择【单操到反位】' },
{ deviceType: '02', orderNum: 2, operateCode: '102', tip: '鼠标左键点击【确定】按钮' }
@ -1466,12 +1465,26 @@ export const OperationList = {
trainingName: '道岔单锁({7})',
trainingRemark: '道岔单锁功能',
trainingType: '03',
productTypes: ['01,02'],
productTypes: ['02'],
stepVOList: [
{ deviceType: '02', orderNum: 1, operateCode: '103', tip: '鼠标右键菜单选择【道岔单锁】' },
{ deviceType: '02', orderNum: 2, operateCode: '103', tip: '鼠标左键点击【确定】按钮' }
]
},
{
maxDuration: 15,
minDuration: 8,
operateType: '0301',
skinCode: '04',
trainingName: '道岔单锁({7})',
trainingRemark: '道岔单锁功能',
trainingType: '03',
productTypes: ['01'],
stepVOList: [
{ deviceType: '02', orderNum: 1, operateCode: '1030', tip: '鼠标左键菜单选择【道岔单锁】' },
{ deviceType: '02', orderNum: 2, operateCode: '1030', tip: '鼠标左键点击【{{7}}】', val: '{8}' }
]
},
{
maxDuration: 15,
minDuration: 8,
@ -1480,7 +1493,7 @@ export const OperationList = {
trainingName: '道岔解锁({7})',
trainingRemark: '道岔解锁功能',
trainingType: '03',
productTypes: ['01,02'],
productTypes: ['02'],
stepVOList: [
{ deviceType: '02', orderNum: 1, operateCode: '104', tip: '鼠标右键菜单选择【道岔解锁】' },
{ deviceType: '02', orderNum: 5, operateCode: '104', tip: '鼠标左键点击【确定】按钮' }
@ -1494,7 +1507,7 @@ export const OperationList = {
trainingName: '道岔封锁({7})',
trainingRemark: '道岔封锁功能',
trainingType: '03',
productTypes: ['01,02'],
productTypes: ['02'],
stepVOList: [
{ deviceType: '02', orderNum: 1, operateCode: '105', tip: '鼠标右键菜单选择【道岔封锁】' },
{ deviceType: '02', orderNum: 2, operateCode: '105', tip: '鼠标左键点击【确定】按钮' },
@ -1509,7 +1522,7 @@ export const OperationList = {
trainingName: '道岔解封({7})',
trainingRemark: '道岔解封功能',
trainingType: '03',
productTypes: ['01,02'],
productTypes: ['02'],
stepVOList: [
{ deviceType: '02', orderNum: 1, operateCode: '106', tip: '鼠标右键菜单选择【道岔解封】' },
{ deviceType: '02', orderNum: 2, operateCode: '106', tip: '鼠标左键点击【确认】按钮' },
@ -1540,7 +1553,7 @@ export const OperationList = {
trainingName: '区故解({8}{9})',
trainingRemark: '故障解锁功能',
trainingType: '04',
productTypes: ['01,02'],
productTypes: ['02'],
stepVOList: [
{ deviceType: '03', orderNum: 1, operateCode: '402', tip: '鼠标右键菜单选择【区故解】' },
{ deviceType: '03', orderNum: 2, operateCode: '402', tip: '鼠标左键点击【确认】按钮' },
@ -1548,7 +1561,7 @@ export const OperationList = {
]
},
{
maxDuration: 15,
maxDuration: 15, // 自动生成实训失败
minDuration: 8,
operateType: '0409',
skinCode: '04',
@ -1728,7 +1741,7 @@ export const OperationList = {
]
},
{
maxDuration: 8,
maxDuration: 8, // 自动生成实训失败
minDuration: 5,
operateType: '0507',
skinCode: '04',
@ -1738,7 +1751,7 @@ export const OperationList = {
productTypes: ['02'],
stepVOList: [
{ deviceType: '06', orderNum: 1, operateCode: '507', tip: '鼠标右键菜单选择【属性】' },
{ deviceType: '06', orderNum: 2, operateCode: '0012', tip: '鼠标左键点击【确定】按钮' }
{ deviceType: '06', orderNum: 2, operateCode: '0012', tip: '鼠标左键点击【退出】按钮' }
]
}
]

View File

@ -5,214 +5,213 @@ const TrainOperation = OperationEvent.Train;
const TrainType = MapDeviceType.Train.type;
export default {
test: function (operates) {
let operateType = getOperateTypeBy('Train', operates[0].operation);
if (operateType) {
return true;
} else {
return false;
}
},
convert: function (operates) {
if (operates && operates.length) {
let operation = operates[0].operation;
switch (operation) {
case TrainOperation.cancelStoppage.menu.operation: return handleMenuCancelStopPage(operates);
test: function (operates) {
const operateType = getOperateTypeBy('Train', operates[0].operation);
if (operateType) {
return true;
} else {
return false;
}
},
convert: function (operates) {
if (operates && operates.length) {
const operation = operates[0].operation;
switch (operation) {
case TrainOperation.cancelStoppage.menu.operation: return handleMenuCancelStopPage(operates);
case TrainOperation.stoppage.menu.operation: return handleMenuStoppage(operates);
case TrainOperation.stoppage.menu.operation: return handleMenuStoppage(operates);
case TrainOperation.addTrainId.menu.operation: return handleMenuAddTrainId(operates);
case TrainOperation.addTrainId.menu.operation: return handleMenuAddTrainId(operates);
case TrainOperation.editTrainId.menu.operation: return handleMenuEditTrainId(operates);
case TrainOperation.editTrainId.menu.operation: return handleMenuEditTrainId(operates);
case TrainOperation.delTrainId.menu.operation: return handleMenuDelTrainId(operates);
case TrainOperation.delTrainId.menu.operation: return handleMenuDelTrainId(operates);
case TrainOperation.moveTrainId.menu.operation: return handleMenuMoveTrainId(operates);
case TrainOperation.moveTrainId.menu.operation: return handleMenuMoveTrainId(operates);
case TrainOperation.switchTrainId.menu.operation: return handleMenuSwitchTrainId(operates);
case TrainOperation.switchTrainId.menu.operation: return handleMenuSwitchTrainId(operates);
case TrainOperation.editTrainNo.menu.operation: return handleMenuEditTrainNo(operates);
case TrainOperation.editTrainNo.menu.operation: return handleMenuEditTrainNo(operates);
case TrainOperation.limitSpeed.menu.operation: return handleMenuLimitSpeed(operates);
case TrainOperation.limitSpeed.menu.operation: return handleMenuLimitSpeed(operates);
case TrainOperation.setPlanTrainId.menu.operation: return handleMenuSetPlanTrainId(operates);
case TrainOperation.setPlanTrainId.menu.operation: return handleMenuSetPlanTrainId(operates);
case TrainOperation.addPlanTrainId.menu.operation: return handleMenuAddPlanTrainId(operates);
case TrainOperation.addPlanTrainId.menu.operation: return handleMenuAddPlanTrainId(operates);
case TrainOperation.moveEventlyTrainId.menu.operation: return handleMenuMoveEventlyTrainId(operates);
case TrainOperation.moveEventlyTrainId.menu.operation: return handleMenuMoveEventlyTrainId(operates);
case TrainOperation.deletePlanTrainId.menu.operation: return handleMenuDeletePlanTrainId(operates);
case TrainOperation.deletePlanTrainId.menu.operation: return handleMenuDeletePlanTrainId(operates);
}
}
}
}
}
}
};
/**
* 处理右键菜单 取消故障 操作
* @param {*} operates
* @param {*} operates
*/
function handleMenuCancelStopPage(operates) {
if (operates.length >= 1) {
let operate = operates[0];
if (operate.type === TrainType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: TrainOperation.cancelStoppage.event
};
}
return { error: true };
}
return null;
if (operates.length >= 1) {
const operate = operates[0];
if (operate.type === TrainType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: TrainOperation.cancelStoppage.event
};
}
return { error: true };
}
return null;
}
/**
* 处理右键菜单 设置故障 操作
* @param {*} operates
* @param {*} operates
*/
function handleMenuStoppage(operates) {
if (operates.length >= 1) {
let operate = operates[0];
if (operate.type === TrainType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: TrainOperation.stoppage.event
};
}
return { error: true };
}
return null;
if (operates.length >= 1) {
const operate = operates[0];
if (operate.type === TrainType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: TrainOperation.stoppage.event
};
}
return { error: true };
}
return null;
}
/**
* 处理右键菜单 添加列车识别号 操作
* @param {*} operates
* @param {*} operates
*/
function handleMenuAddTrainId(operates) {
if (operates.length >= 1) {
let operate = operates[operates.length - 1];
if (operate.type === TrainType && operate.val) {
return {
type: operate.type,
code: operates[0].code,
over: true,
operation: TrainOperation.addTrainId.event,
val: operate.val,
};
}
return { error: true };
}
return null;
if (operates.length >= 1) {
const operate = operates[operates.length - 1];
if (operate.type === TrainType && operate.val) {
return {
type: operate.type,
code: operates[0].code,
over: true,
operation: TrainOperation.addTrainId.event,
val: operate.val
};
}
return { error: true };
}
return null;
}
/**
* 处理右键菜单 修改列车识别号 操作
* @param {*} operates
* @param {*} operates
*/
function handleMenuEditTrainId(operates) {
if (operates.length >= 1) {
let operate = operates[operates.length - 1];
if (operate.type === TrainType && operate.val) {
return {
type: operate.type,
code: operates[0].code,
over: true,
operation: TrainOperation.editTrainId.event,
val: operate.val
};
}
return { error: true };
}
return null;
if (operates.length >= 1) {
const operate = operates[operates.length - 1];
if (operate.type === TrainType && operate.val) {
return {
type: operate.type,
code: operates[0].code,
over: true,
operation: TrainOperation.editTrainId.event,
val: operate.val
};
}
return { error: true };
}
return null;
}
/**
* 处理右键菜单 删除列车识别号 操作
* @param {*} operates
* @param {*} operates
*/
function handleMenuDelTrainId(operates) {
if (operates.length >= 1) {
let operate = operates[operates.length - 1];
if (operate.type === TrainType && operate.val) {
return {
type: operate.type,
code: operates[0].code,
over: true,
operation: TrainOperation.delTrainId.event,
val: operate.val
};
}
return { error: true };
}
return null;
if (operates.length >= 1) {
const operate = operates[operates.length - 1];
if (operate.type === TrainType && operate.val) {
return {
type: operate.type,
code: operates[0].code,
over: true,
operation: TrainOperation.delTrainId.event,
val: operate.val
};
}
return { error: true };
}
return null;
}
/**
* 处理右键菜单 移动列车识别号 操作
* @param {*} operates
* @param {*} operates
*/
function handleMenuMoveTrainId(operates) {
if (operates.length >= 1) {
let operate = operates[operates.length - 1];
if (operate.type === TrainType && operate.val) {
return {
type: operate.type,
code: operates[0].code,
over: true,
operation: TrainOperation.moveTrainId.event,
val: operate.val
};
}
return { error: true };
}
return null;
if (operates.length >= 1) {
const operate = operates[operates.length - 1];
if (operate.type === TrainType && operate.val) {
return {
type: operate.type,
code: operates[0].code,
over: true,
operation: TrainOperation.moveTrainId.event,
val: operate.val
};
}
return { error: true };
}
return null;
}
/**
* 处理右键菜单 交换列车识别号 操作
* @param {*} operates
* @param {*} operates
*/
function handleMenuSwitchTrainId(operates) {
if (operates.length >= 1) {
let operate = operates[operates.length - 1];
if (operate.type === TrainType && operate.val) {
return {
type: operate.type,
code: operates[0].code,
over: true,
operation: TrainOperation.switchTrainId.event,
val: operate.val
};
}
return { error: true };
}
return null;
if (operates.length >= 1) {
const operate = operates[operates.length - 1];
if (operate.type === TrainType && operate.val) {
return {
type: operate.type,
code: operates[0].code,
over: true,
operation: TrainOperation.switchTrainId.event,
val: operate.val
};
}
return { error: true };
}
return null;
}
/**
* 处理右键菜单 修改车组号 操作
* @param {*} operates
* @param {*} operates
*/
function handleMenuEditTrainNo(operates) {
if (operates.length >= 1) {
let operate = operates[operates.length - 1];
if (operate.type === TrainType && operate.val) {
return {
type: operate.type,
code: operate[0].code,
over: true,
operation: TrainOperation.editTrainNo.event,
val: operate.val
};
}
return { error: true };
}
return null;
if (operates.length >= 1) {
const operate = operates[operates.length - 1];
if (operate.type === TrainType && operate.val) {
return {
type: operate.type,
code: operate[0].code,
over: true,
operation: TrainOperation.editTrainNo.event,
val: operate.val
};
}
return { error: true };
}
return null;
}
/**
@ -221,86 +220,85 @@ function handleMenuEditTrainNo(operates) {
*/
function handleMenuLimitSpeed(operates) {
if (operates.length > 0) {
let operate = operates[0];
if (operate.type === TrainType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: TrainOperation.limitSpeed.event,
};
}
return { error: true };
}
return null;
if (operates.length > 0) {
const operate = operates[0];
if (operate.type === TrainType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: TrainOperation.limitSpeed.event
};
}
return { error: true };
}
return null;
}
/**
* 处理右键菜单 设置计划车
* @param {*} operates
*/
function handleMenuSetPlanTrainId(operates) {
if (operates.length > 0) {
let operate = operates[0];
if (operate.type === TrainType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: TrainOperation.setPlanTrainId.event,
};
}
return { error: true };
}
return null;
if (operates.length > 0) {
const operate = operates[0];
if (operate.type === TrainType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: TrainOperation.setPlanTrainId.event
};
}
return { error: true };
}
return null;
}
function handleMenuAddPlanTrainId(operates) {
if (operates.length > 0) {
let operate = operates[0];
if (operate.type === TrainType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: TrainOperation.addPlanTrainId.event,
};
}
return { error: true };
}
return null;
if (operates.length > 0) {
const operate = operates[0];
if (operate.type === TrainType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: TrainOperation.addPlanTrainId.event
};
}
return { error: true };
}
return null;
}
function handleMenuMoveEventlyTrainId(operates) {
if (operates.length > 0) {
let operate = operates[0];
if (operate.type === TrainType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: TrainOperation.moveEventlyTrainId.event,
};
}
return { error: true };
}
return null;
if (operates.length > 0) {
const operate = operates[0];
if (operate.type === TrainType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: TrainOperation.moveEventlyTrainId.event
};
}
return { error: true };
}
return null;
}
function handleMenuDeletePlanTrainId(operates) {
if (operates.length > 0) {
let operate = operates[0];
if (operate.type === TrainType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: TrainOperation.deletePlanTrainId.event,
};
}
return { error: true };
}
return null;
}
if (operates.length > 0) {
const operate = operates[0];
if (operate.type === TrainType && operate.code) {
return {
type: operate.type,
code: operate.code,
over: true,
operation: TrainOperation.deletePlanTrainId.event
};
}
return { error: true };
}
return null;
}

View File

@ -8,6 +8,9 @@
</div>
</template>
<script>
import { launchFullscreen } from '@/utils/screen';
import { UrlConfig } from '@/router/index';
import { scriptRecordNotify } from '@/api/simulation';
import ScriptOperate from './operate';
import { reviewScriptList,publishScript,rejectScript } from '@/api/designPlatform';
import { listPublishMap } from '@/api/jmap/map';
@ -18,6 +21,7 @@
},
data() {
return{
allMapList:[],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
@ -128,6 +132,7 @@
//
this.mapList = [];
const res = await listPublishMap();
this.allMapList=res.data;
res.data.forEach(elem => {
this.queryForm.queryObject.mapId.config.data.push({ value: elem.id, label: elem.name });
this.mapList.push({ value: elem.id, label: elem.name });
@ -146,7 +151,14 @@
this.$refs.applyReject.doShow(row);
},
scriptPreview(index,row){
debugger;
let mapInfo=this.allMapList.find(elem=>{return elem.id==row.mapId});
scriptRecordNotify(row.id).then(resp => {
const query = { mapId: row.mapId, group: resp.data, scriptId: row.id,skinCode:mapInfo.skinCode,try:0};
this.$router.push({ path: `${UrlConfig.design.display}/demon`, query });
launchFullscreen();
}).catch(error => {
this.$messageBox(`${this.$t('scriptRecord.createSimulationFail')}: ${error.message}`);
});
},
handleConfirmReject(data){
rejectScript(data.id,data).then(resp => {

View File

@ -1,16 +1,6 @@
<template>
<div class="filter">
<template v-if="isCascader">
<el-cascader
v-model="filterSelect"
:size="size"
popper-class="cascader"
:options="filterOptions"
:placeholder="$t('global.chooseCityAndRoute')"
@change="filterSelectChange"
/>
</template>
<template v-else>
<template>
<el-select v-model="filterSelect" :size="size" popper-class="select" @change="filterSelectChange">
<el-option v-for="item in filterOptions" :key="item.code" :label="item.name" :value="item.code" />
</el-select>
@ -21,7 +11,7 @@
<script>
import { setUserConfigInfo } from '@/api/management/user';
import { listPublishMap } from '@/api/jmap/map';
import {getUserMapTree} from '@/api/designPlatform';
import {getUserMapTree,publisMapCityList} from '@/api/designPlatform';
import { getPublishMapTree } from '@/api/management/mapprd';
import localStore from 'storejs';
@ -35,12 +25,6 @@ export default {
return 'medium';
}
},
isCascader: {
type: Boolean,
default() {
return false;
}
},
filterEmpty: {
type: Boolean,
default() {
@ -50,7 +34,11 @@ export default {
queryFunction: {
type: Function,
required: true
}
},
localParamName:{
type:String,
required: true
}
},
data() {
return {
@ -62,147 +50,26 @@ export default {
this.loadInitData();
},
methods: {
loadFirstLevelFilterOptions(cityList, mapDict) {
this.filterSelect = '000000';
// mapDictfilterOptions
cityList.forEach(elem => {
if (this.filterEmpty && (mapDict[elem.code] || elem.code === this.filterSelect)) {
// mapDict'000000'
this.filterOptions.push({ code: elem.code, name: elem.name });
} else if (!this.filterEmpty) {
// filterOptions
this.filterOptions.push({ code: elem.code, name: elem.name });
}
});
if (this.filterEmpty && mapDict[localStore.get('_cityCode')] || !this.filterEmpty && localStore.get('_cityCode')) {
this.filterSelect = localStore.get('_cityCode');
} else if (this.filterEmpty && mapDict[localStore.get('cityCode')] || !this.filterEmpty && localStore.get('cityCode')) {
this.filterSelect = localStore.get('cityCode');
}
this.$emit('filterSelectChange', this.filterSelect);
},
loadSecondLevelFilterOptions(cityList, mapDict, nodeList) {
this.filterSelect = ['000000', ''];
if (nodeList && nodeList.length > 0) {
cityList.forEach(city => {
//
const cityNode = {
value: city.code,
label: city.name,
children: []
};
nodeList.forEach(node => {
if (this.filterEmpty && mapDict[node.id] || !this.filterEmpty) {
if (node.cityCode === city.code) {
cityNode.children.push({ value: node.id, label: node.name });
}
if (!this.filterSelect[1] && node.cityCode === this.filterSelect[0]) {
this.filterSelect[1] = node.id;
}
}
});
if (this.filterEmpty && cityNode.children.length > 0 || !this.filterEmpty) {
this.filterOptions.push(cityNode);
}
});
}
if (localStore.get('cityCode') && localStore.get('mapId')) {
this.filterSelect = [localStore.get('cityCode'), localStore.get('mapId')];
}
this.$emit('filterSelectChange', this.filterSelect);
},
async loadInitData() {
//
this.filterOptions=[];
const resp = await this.$Dictionary.cityType();
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);
});
if (this.isCascader) {
//
const mapDict = {};
const response = await listPublishMap();
const nodeList = response.data;
if (nodeList && nodeList.length > 0) {
//
if (this.filterEmpty && this.queryFunction) {
// mapDictfilterOptions
for (var j = 0; j < nodeList.length; j++) {
const response = await this.queryFunction({ mapId: nodeList[j].id } || '');
const mapList = response.data;
if (mapList && mapList.length > 0) {
mapDict[nodeList[j].id] = true;
}
}
}
}
this.filterOptions=cityList;
this.filterSelect = localStore.get(this.localParamName) || cityList[0].code;
this.loadSecondLevelFilterOptions(cityList, mapDict, nodeList);
} else {
//
const mapDict = {};
if (this.filterEmpty && this.queryFunction) {
if (this.queryFunction === getPublishMapTree || this.queryFunction === getUserMapTree) {
// citycodemapList
for (var i = 0; i < cityList.length; i++) {
const response = await this.queryFunction(cityList[i].code);
const mapList = response.data;
if (mapList && mapList.length > 0) {
mapDict[cityList[i].code] = true;
}
}
} else {
// citycodemapList
const response = await this.queryFunction();
const mapList = response.data;
if (mapList && mapList.length > 0) {
mapList.forEach(elem => {
mapDict[elem.cityCode] = true;
});
}
}
}
// mapDictfilterSelect
this.loadFirstLevelFilterOptions(cityList, mapDict);
}
this.$emit('filterSelectChange', this.filterSelect);
},
filterSelectChange(filterSelect) {
if (this.isCascader) {
//
localStore.set('cityCode', filterSelect[0]);
localStore.set('mapId', filterSelect[1]);
setUserConfigInfo([{ code: 'cityCode', val: filterSelect[0] }, { code: 'mapId', val: filterSelect[1] }]);
this.$emit('filterSelectChange', filterSelect);
} else {
//
localStore.set('_cityCode', filterSelect);
this.$emit('filterSelectChange', filterSelect);
}
},
setFilterSelect(filterSelect) {
this.filterSelect = filterSelect;
if (this.isCascader) {
localStore.set('cityCode', filterSelect[0]);
localStore.set('mapId', filterSelect[1]);
} else {
localStore.set('_cityCode', filterSelect);
}
},
setFilterOptions(filterOptions) {
this.filterOptions = filterOptions;
//
// localStore.set('_cityCode', filterSelect);
localStore.set(this.localParamName, filterSelect);
this.$emit('filterSelectChange', filterSelect);
}
}
};

View File

@ -127,13 +127,13 @@ export default {
this.active = 0;
const type = this.$route.query.permissionType;
if (type === PermissionType.LESSON) {
this.$router.replace({ path: `${UrlConfig.trainingPlatform.teachDetail}`,query: { prodId: this.$route.query.prdCode,type: '教学系统'} });
this.$router.replace({ path: `${UrlConfig.trainingPlatform.teachDetail}/${this.$route.query.subSystem}`});
} else if (type === PermissionType.EXAM) {
this.$router.replace({ path: `${UrlConfig.trainingPlatform.course}/${this.$route.query.mapId}`, query: { prodId:this.$route.query.prdCode, type: '考试系统' }});
this.$router.replace({ path: `${UrlConfig.trainingPlatform.course}/${this.$route.query.subSystem}`});
} else if (type === PermissionType.SCREEN) {
this.$router.replace({ path: `${UrlConfig.dp.detail}/${this.$route.params.lessonId}` });
} else if (type === PermissionType.SIMULATION) {
this.$router.replace({ path: `${UrlConfig.trainingPlatform.prodDetail}/${this.$route.query.mapId}`,query: { prodId: this.$route.query.prdCode,type: '仿真系统'} });
this.$router.replace({ path: `${UrlConfig.trainingPlatform.prodDetail}/${this.$route.query.subSystem}`, query: { mapId: this.$route.query.mapId} });
} else {
this.$router.replace({ path: `/` });
}

View File

@ -1,32 +1,32 @@
<template>
<div class="digit" :style="{width: 11*zoom+'px', height: 20*zoom+'px', top: top+'px'}">
<div class="digit" :style="{width: w+'px', height: h+'px'}">
<div
class="segment on"
:style="{ background: color, 'border-radius': zoom+'px', opacity: opacity(isShowOne), top: zoom+'px', left: zoom*2+'px', right: zoom*2+'px', height: zblod+'px'}"
:style="{ background: color, 'border-radius': z1+'px', opacity: opacity(isShowOne), top: p+'px', left: p+b1+'px', right: b1+'px', width: z1+b1+'px', height: b1+'px'}"
/>
<div
class="segment on"
:style="{ background: color, 'border-radius': zoom+'px', opacity: opacity(isShowTwo), top: zoom*2+'px', right: zoom+'px', width: zblod+'px', height: zoom*7.5+'px'}"
:style="{ background: color, 'border-radius': z1+'px', opacity: opacity(isShowTwo), top: p+b1+'px', left: p+z1+b2+'px', width: b1+'px', height:z1+'px'}"
/>
<div
class="segment on"
:style="{ background: color, 'border-radius': zoom+'px', opacity: opacity(isShowThee), bottom: zoom*2+'px', right: zoom+'px', width: zblod+'px', height: zoom*7.5+'px'}"
:style="{ background: color, 'border-radius': z1+'px', opacity: opacity(isShowThee), top: p+z1+b2+'px', left: p+z1+b2+'px', width: b1+'px', height: z1+'px'}"
/>
<div
class="segment on "
:style="{ background: color, 'border-radius': zoom+'px', opacity: opacity(isShowFour), bottom: zoom+'px', right: zoom*2+'px', height: zblod+'px', left: zoom*2+'px' }"
class="segment on"
:style="{ background: color, 'border-radius': z1+'px', opacity: opacity(isShowFour), top: p+z2+b2+'px', left: p+b1+'px', right: b1+'px', width: z1+b1+'px', height: b1+'px'}"
/>
<div
class="segment on "
:style="{ background: color, 'border-radius': zoom+'px', opacity: opacity(isShowFive), bottom: zoom*2+'px', left: zoom+'px', width: zblod+'px', height: zoom*7.5+'px'}"
class="segment on"
:style="{ background: color, 'border-radius': z1+'px', opacity: opacity(isShowFive), top: p+z1+b2+'px', left: p+'px', width: b1+'px', height: z1+'px'}"
/>
<div
class="segment on "
:style="{ background: color, 'border-radius': zoom+'px', opacity: opacity(isShowSix), top: zoom*2+'px', left: zoom+'px',width: zblod+'px', height: zoom*7.5+'px'}"
class="segment on"
:style="{ background: color, 'border-radius': z1+'px', opacity: opacity(isShowSix), top: p+b1+'px', left: p+'px', width: b1+'px', height:z1+'px'}"
/>
<div
class="segment "
:style="{ background: color, 'border-radius': zoom+'px', opacity: opacity(isShowSeven), left: zoom*2+'px', right: zoom*2+'px', height: zblod+'px', bottom: zoom*9.5+'px'}"
class="segment on"
:style="{ background: color, 'border-radius': z1+'px', opacity: opacity(isShowSeven), top: p+z1+b1+'px', left: p+b1+'px', right: b1+'px', width: z1+b1+'px', height: b1+'px'}"
/>
</div>
</template>
@ -35,10 +35,6 @@
export default {
name: 'Digit',
props: {
top: {
type: Number,
required: true
},
zoom: {
type: Number,
required: true
@ -57,9 +53,6 @@ export default {
}
},
computed: {
zblod() {
return parseInt(this.fine * this.zoom);
},
isShowOne() {
return [2, 3, 5, 6, 7, 8, 9, 0].indexOf(this.number) != -1;
},
@ -80,6 +73,27 @@ export default {
},
isShowSeven() {
return [2, 3, 4, 5, 6, 8, 9].indexOf(this.number) != -1;
},
b1() {
return this.fine * 2;
},
b2() {
return this.fine * 4;
},
z1() {
return this.zoom * 4;
},
z2() {
return this.zoom * 8;
},
p() {
return this.fine * 1;
},
w() {
return this.zoom * 4 + this.fine * 6 + this.p*2;
},
h() {
return this.zoom * 8 + this.fine * 6 + this.p*2;
}
},
methods: {
@ -92,9 +106,8 @@ export default {
<style rel="stylesheet/scss" lang="scss" scoped>
.digit {
position: relative;
display: inline-flex;
justify-content: center;
display: inline-block;
position: relative;
.segment {
position: absolute;
@ -114,6 +127,5 @@ export default {
-o-transition: opacity 0s;
}
}
}
</style>

View File

@ -1,8 +1,5 @@
<template>
<div
class="system-time-box"
:style="{background: background, width: width+'px', height: height+'px', 'line-height': height+'px'}"
>
<div class="system-time-box">
<template v-for="(item,index) in time">
<digit
v-if="Number.isInteger(parseInt(item))"
@ -10,8 +7,7 @@
:number="parseInt(item)"
:color="color"
:fine="fine"
:zoom="time.length - index > 2? zoom: zoom* 0.6"
:top="top"
:zoom="time.length - index > 2? zoom: zoom* 0.5"
/>
<separator v-if="!Number.isInteger(parseInt(item))" :key="index" :color="color" :zoom="zoom" :fine="fine" />
</template>
@ -53,28 +49,10 @@ export default {
return 4;
}
},
width: {
type: Number,
default() {
return 280;
}
},
height: {
type: Number,
default() {
return 80;
}
},
fine: {
type: Number,
default() {
return 1;
}
},
top: {
type: Number,
default() {
return 1;
return 2;
}
}
}

View File

@ -1,7 +1,7 @@
<template>
<div
class="point"
:style="{background: color, width: zblod+'px', height: zblod+'px', top: top+'px', 'border-radius': 0.5*zblod+'px'}"
:style="{background: color, width: fine*2+'px', height: fine*2+'px','border-radius': fine+'px'}"
/>
</template>
@ -9,10 +9,6 @@
export default {
name: 'Point',
props: {
top: {
type: Number,
required: true
},
zoom: {
type: Number,
required: true
@ -25,20 +21,10 @@ export default {
type: String,
required: true
}
},
computed: {
zblod() {
return parseInt(this.fine * this.zoom);
}
},
methods: {
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.point {
position: relative;
display: inline-block;
}
</style>

View File

@ -1,51 +1,52 @@
<template>
<div class="separator" :style="{width: zoom+'px', height: zoom*20+'px'}">
<div class="point-box">
<point :color="color" :zoom="zoom" :fine="fine" :top="-2*zoom"></point>
<point :color="color" :zoom="zoom" :fine="fine" :top="-12*zoom"></point>
</div>
</div>
<div class="separator" :style="{width: w+'px', height: h+'px'}">
<point class="point" :color="color" :zoom="zoom" :fine="fine" :style="{top: zoom*4+p*1+'px'}" />
<point class="point" :color="color" :zoom="zoom" :fine="fine" :style="{top: zoom*6+p*2+'px' }" />
</div>
</template>
<script>
import Point from './point';
import Point from './point';
export default {
name: 'separator',
props: {
zoom: {
type: Number,
required: true,
},
fine: {
type: Number,
required: true,
},
color: {
type: String,
required: true,
}
},
components: {
Point
},
methods: {
}
}
export default {
name: 'Separator',
components: {
Point
},
props: {
zoom: {
type: Number,
required: true
},
fine: {
type: Number,
required: true
},
color: {
type: String,
required: true
}
},
computed: {
p() {
return this.fine * 1;
},
w() {
return this.fine * 4;
},
h() {
return this.zoom * 8 + this.fine * 6 + this.p*2;
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.separator {
position: relative;
display: inline-block;
left: -2px;
.point-box {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
justify-content: center;
}
display: inline-block;
text-align: center;
.point {
position: relative;
}
}
</style>
</style>

View File

@ -26,7 +26,6 @@
<script>
// import { getPublishMapInfo } from '@/api/jmap/map';
import { getGoodsTryUse } from '@/api/management/goods';
import { getMapProductDetail } from '@/api/management/mapprd';
import { PermissionType } from '@/scripts/ConstDic';
import { launchFullscreen } from '@/utils/screen';
import { queryPermissionSimulation } from '@/api/management/author';
@ -34,6 +33,7 @@ import { postCreateRoom, getjointTraining, checkRoomExist } from '@/api/chat';
import { UrlConfig } from '@/router/index';
import { simulationNotify, schedulingNotify } from '@/api/simulation';
import LimitList from '@/views/components/limits/index';
import { getSubSystemDetail } from '@/api/trainingPlatform';
export default {
name: 'ExamDetailList',
@ -82,11 +82,11 @@ export default {
return this.courseModel.prdType === '03' && this.hasPermssion && this.jointShow;
},
mapId() {
return this.$route.params.mapId;
},
prodId() {
return this.$route.query.prodId;
return this.$route.query.mapId;
},
// prodId() {
// return this.$route.query.prodId;
// },
height() {
return this.$store.state.app.height - 50;
}
@ -104,28 +104,30 @@ export default {
this.loading = true;
this.currentPrdCode = this.prodId;
try {
this.getJointTrainingList();
const resp = await getMapProductDetail(this.prodId);
const resp = await getSubSystemDetail(this.$route.params.subSystem);
this.tryUser = 0;
this.loading = false;
this.courseModel = {
id: resp.data.id,
name: resp.data.name,
mapId: this.mapId,
skinCode: resp.data.skinCode,
remarks: resp.data.remarks,
prdType: resp.data.prdType,
prdCode: resp.data.code,
pmsList: resp.data.pmsList || [],
PermissionType: PermissionType.SIMULATION
};
const rest = await queryPermissionSimulation({ mapId: this.courseModel.mapId, prdCode: this.courseModel.prdCode });
this.courseModel.pmsList = rest.data;
if (resp.data.mapPrd) {
this.courseModel = {
id: resp.data.mapPrd.id,
name: resp.data.mapPrd.name,
mapId: this.mapId,
skinCode: resp.data.mapPrd.skinCode,
remarks: resp.data.mapPrd.remarks,
prdType: resp.data.mapPrd.prdType,
prdCode: resp.data.mapPrd.code,
pmsList: resp.data.permissionList || [],
PermissionType: PermissionType.SIMULATION
};
if (resp.data.mapPrd.prdType === '03') {
this.getJointTrainingList();
}
}
if (!this.courseModel.pmsList) {
this.tryUser = 1;
const paras = {
mapId: this.mapId,
prdCode: this.prodId,
prdCode: this.courseModel.prdCode,
permissionType: PermissionType.SIMULATION
};
@ -162,7 +164,7 @@ export default {
},
async joinRoom() {
await getjointTraining(this.jointGroup);
const query = { skinCode: this.courseModel.skinCode, group: this.jointGroup };
const query = { skinCode: this.courseModel.skinCode, group: this.jointGroup, subSystem: this.$route.params.subSystem};
this.$router.push({ path: `/trainroom`, query: query });
},
async createRoom() {
@ -174,7 +176,7 @@ export default {
};
const res = await postCreateRoom(param);
if (res && res.code == 200) {
const query = { skinCode: this.courseModel.skinCode, group: res.data };
const query = { skinCode: this.courseModel.skinCode, group: res.data, subSystem: this.$route.params.subSystem };
this.$router.push({ path: `/trainroom`, query: query });
}
} catch (error) {
@ -242,7 +244,7 @@ export default {
this.buttonLoading = true;
this.$router.push({
path: `${UrlConfig.trainingPlatform.pay}/${this.courseModel.id}`,
query: { permissionType: PermissionType.SIMULATION, prdCode: this.courseModel.prdCode, mapId: this.courseModel.mapId }
query: { permissionType: PermissionType.SIMULATION, prdCode: this.courseModel.prdCode, mapId: this.courseModel.mapId, subSystem: this.$route.params.subSystem }
});
},
transfer() {

View File

@ -91,7 +91,7 @@ export default {
}
},
clickEvent(obj, data, ele) {
if (obj.type == 'map') {
if (obj.type == 'Map') {
setSessionStorage('demonList', obj.id);
this.$router.push({ path: `${UrlConfig.demonstration.detail}/${obj.id}` });
}

View File

@ -1,208 +1,209 @@
<template>
<div>
<div>
<el-card v-loading="loading" class="map-list-main" header="已发布地图列表">
<filter-city ref="filerCity" filter-empty :query-function="queryFunction" @filterSelectChange="refresh" />
<el-input v-model="filterText" :placeholder="this.$t('global.filteringKeywords')" clearable />
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: (height-125) +'px' }">
<!-- :style="{ height: heightUp +'px' }" -->
<el-tree
ref="tree"
:data="treeList"
node-key="id"
:props="defaultProps"
highlight-current
:span="22"
:filter-node-method="filterNode"
@node-click="clickEvent"
>
<!-- @node-contextmenu="showContextMenu" -->
<span slot-scope="{ node:tnode, data }">
<filter-city ref="filerCity" filter-empty :query-function="queryFunction" :local-param-name="localParamName" @filterSelectChange="refresh" />
<el-input v-model="filterText" :placeholder="this.$t('global.filteringKeywords')" clearable />
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: (height-125) +'px' }">
<!-- :style="{ height: heightUp +'px' }" -->
<el-tree
ref="tree"
:data="treeList"
node-key="id"
:props="defaultProps"
highlight-current
:span="22"
:filter-node-method="filterNode"
@node-click="clickEvent"
>
<!-- @node-contextmenu="showContextMenu" -->
<span slot-scope="{ node:tnode, data }">
<span
class="el-icon-tickets"
:style="{color: data.valid ? 'green':''}"
class="el-icon-tickets"
:style="{color: data.valid ? 'green':''}"
>&nbsp;{{ tnode.label }}</span>
</span>
</el-tree>
</el-scrollbar>
</span>
</el-tree>
</el-scrollbar>
</el-card>
</div>
</div>
</template>
<script>
import { DeviceMenu } from '@/scripts/ConstDic';
import { postBuildMapImport } from '@/api/jmap/mapdraft';
import { getPublishMapTree } from '@/api/management/mapprd';
import { getMapList } from '@/api/designPlatform';
import { UrlConfig } from '@/router/index';
import { getSessionStorage, setSessionStorage, removeSessionStorage } from '@/utils/auth';
import FilterCity from '@/views/components/filterCity';
import localStore from 'storejs';
import { listPublishMap } from '@/api/jmap/map';
// import { getTrainingSystemList} from '@/api/trainingPlatform';
import { UrlConfig } from '@/router/index';
import { getSessionStorage, setSessionStorage, removeSessionStorage } from '@/utils/auth';
import FilterCity from '@/views/components/filterCity';
import localStore from 'storejs';
export default {
name: 'publicMapList',
components: {
FilterCity,
},
props: {
height: {
type: Number,
required: true
},
width: {
type: Number,
required: true
}
},
data() {
return {
loading: true,
defaultShowKeys: [],
queryFunction: getPublishMapTree,
filterText: '',
treeData: [],
treeList: [],
selected: {},
defaultProps: {
children: 'children',
label: 'name'
},
node: {
},
// mapId: '',
heightUp: 450,
point: {
x: 0,
y: 0
},
editModel: {},
// skinCode:''
};
},
computed: {
role() {
return this.$store.state.user.roles.includes('04') ||
export default {
name: 'PublicMapList',
components: {
FilterCity
},
props: {
height: {
type: Number,
required: true
},
width: {
type: Number,
required: true
}
},
data() {
return {
loading: true,
defaultShowKeys: [],
queryFunction: listPublishMap,
filterText: '',
treeData: [],
treeList: [],
selected: {},
defaultProps: {
children: 'children',
label: 'name'
},
node: {
},
// mapId: '',
heightUp: 450,
point: {
x: 0,
y: 0
},
editModel: {},
localParamName: 'publish_cityCode',
cityCode: ''
// skinCode:''
};
},
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');
},
mounted() {
this.heightUp = Number(localStore.get('upHeight')?localStore.get('upHeight'):(this.height)/2);
},
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) {
switch(obj.type){
case 'scriptDesign':{
setSessionStorage('designType', 'scriptDesign');
this.$router.push({ path: `${UrlConfig.design.scriptHome}/${obj.mapId}?skinCode=${obj.skinCode}` });
break;
}
case 'lessonDesign': {
setSessionStorage('designType', 'lessonDesign');
this.$router.push({ path: `${UrlConfig.design.lessonHome}/${obj.mapId}/${obj.skinCode}`,query: {cityCode:data.parent.data.cityCode} });
break;
}
case 'runPlanDesign': {
setSessionStorage('designType', 'runPlanDesign');
this.$router.push({ path: `${UrlConfig.design.runPlan}/${obj.mapId}?skinCode=${obj.skinCode}` });
break;
}
case 'map':{
setSessionStorage('demonList', obj.id);
}
}
// this.$refs.menu.doClose();
},
// async myrefresh(filterSelect){
}
},
watch: {
filterText(val) {
this.treeList = this.treeData.filter((res) => {
return res.name.includes(val);
});
}
},
beforeDestroy () {
removeSessionStorage('demonList');
},
mounted() {
this.heightUp = Number(localStore.get('upHeight')?localStore.get('upHeight'):(this.height)/2);
},
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) {
switch (obj.type) {
case 'scriptDesign': {
setSessionStorage('designType', 'scriptDesign');
this.$router.push({ path: `${UrlConfig.design.scriptHome}/${obj.mapId}?skinCode=${obj.skinCode}` });
break;
}
case 'lessonDesign': {
setSessionStorage('designType', 'lessonDesign');
this.$router.push({ path: `${UrlConfig.design.lessonHome}/${obj.mapId}/${obj.skinCode}`, query: {cityCode: this.cityCode} });
break;
}
case 'runPlanDesign': {
setSessionStorage('designType', 'runPlanDesign');
this.$router.push({ path: `${UrlConfig.design.runPlan}/${obj.mapId}?skinCode=${obj.skinCode}` });
break;
}
case 'map': {
setSessionStorage('demonList', obj.id);
}
}
// this.$refs.menu.doClose();
},
// async myrefresh(filterSelect){
// },
async refresh(filterSelect) {
this.loading = true;
this.treeData = this.treeList = [];
try {
const res = await getMapList(filterSelect);
res.data.forEach(elem=>{
// debugger;
// elem.children.find(n => { return n.name.includes("")})
elem.children=[
// {
// id:'1',
// name:'',
// type:'mapDesign'
// },
{
id:'2',
name:'课程设计',
type:'lessonDesign',
mapId:elem.id,
skinCode:elem.skinCode
},
{
id:'3',
name:'剧本设计',
type:'scriptDesign',
mapId:elem.id,
skinCode:elem.skinCode,
// code:elem.children.find(n => { return n.name.includes("")})
},
{
id:'4',
name:'运行图设计',
type:'runPlanDesign',
mapId:elem.id,
skinCode:elem.skinCode
},
]
});
this.treeData = res.data;
this.treeList = this.filterText
? res.data.filter(elem => { return elem.name.includes(this.filterText); })
: res.data;
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'));
}
},
// refresh1(){
// },
async refresh(filterSelect) {
this.cityCode=filterSelect;
this.loading = true;
this.treeData = this.treeList = [];
try {
const res = await listPublishMap({cityCode: filterSelect});
res.data.forEach(elem=>{
// debugger;
// elem.children.find(n => { return n.name.includes("")})
elem.children=[
// {
// id:'1',
// name:'',
// type:'mapDesign'
// },
{
id: '2',
name: '课程设计',
type: 'lessonDesign',
mapId: elem.id,
skinCode: elem.skinCode
},
{
id: '3',
name: '剧本设计',
type: 'scriptDesign',
mapId: elem.id,
skinCode: elem.skinCode
// code:elem.children.find(n => { return n.name.includes("")})
},
{
id: '4',
name: '运行图设计',
type: 'runPlanDesign',
mapId: elem.id,
skinCode: elem.skinCode
}
];
});
this.treeData = res.data;
this.treeList = this.filterText
? res.data.filter(elem => { return elem.name.includes(this.filterText); })
: res.data;
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'));
}
},
// refresh1(){
// },
drapHeight(height) {
this.heightUp = Number(height);
},
resize() {
this.widthLeft = Number(localStore.get('LeftWidth')) || this.widthLeft;
const width = this.$store.state.app.width - 521 - this.widthLeft;
const height = this.$store.state.app.height - 90;
this.$store.dispatch('config/resize', { width: width, height: height });
},
// createMap() {
// this.$emit("createMap");
// },
}
};
// },
drapHeight(height) {
this.heightUp = Number(height);
},
resize() {
this.widthLeft = Number(localStore.get('LeftWidth')) || this.widthLeft;
const width = this.$store.state.app.width - 521 - this.widthLeft;
const height = this.$store.state.app.height - 90;
this.$store.dispatch('config/resize', { width: width, height: height });
}
// createMap() {
// this.$emit("createMap");
// },
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.back-home {

View File

@ -1,105 +1,94 @@
<template>
<div class="app-wrapper">
<el-scrollbar wrap-class="scrollbar-wrapper">
<div v-show="listShow" class="examList" :style="{width: widthLeft+'px'}">
<demon-list ref="demonList" :height="height" :width="widthLeft"/>
</div>
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
<transition>
<router-view :product-list="productList" :style="{width:currentWidth+'px',display:'inline-block'}"/>
</transition>
</el-scrollbar>
</div>
<div class="app-wrapper">
<el-scrollbar wrap-class="scrollbar-wrapper">
<div v-show="listShow" class="examList" :style="{width: widthLeft+'px'}">
<demon-list ref="demonList" :height="height" :width="widthLeft" />
</div>
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
<transition>
<router-view :product-list="productList" />
</transition>
</el-scrollbar>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import demonList from './demonList';
import drapLeft from '@/views/components/drapLeft/index';
import { launchFullscreen } from '@/utils/screen';
import localStore from 'storejs';
import { getSessionStorage, setSessionStorage } from '@/utils/auth';
import MapCreate from '@/views/map/mapdraft/mapmanage/create';
import { mapGetters } from 'vuex';
import demonList from './demonList';
import drapLeft from '@/views/components/drapLeft/index';
import { launchFullscreen } from '@/utils/screen';
import localStore from 'storejs';
import { getSessionStorage, setSessionStorage } from '@/utils/auth';
export default {
name: 'DesignPlatform',
components: {
demonList,
drapLeft,
MapCreate
},
data() {
return {
listShow: true,
widthLeft: Number(localStore.get('LeftWidth')) || 450,
productList: [],
skinCode: '',
currentWidth:'',
};
},
computed: {
...mapGetters([
'lessonbar'
]),
height() {
return this.$store.state.app.height - 50;
},
width() {
return this.$store.state.app.width;
}
},
watch: {
'lessonbar.opened': function (val) {
this.listShow = val;
},
widthLeft(val) {
this.setMapResize(val);
},
'$store.state.app.windowSizeCount': function() {
this.resize();
}
},
mounted() {
this.currentWidth=this.$store.state.app.width - this.widthLeft;
const againEnter = getSessionStorage('againEnter') || null;
if (!againEnter){
launchFullscreen();
setSessionStorage('againEnter',true);
}
this.resize();
this.widthLeft = Number(localStore.get('LeftWidth'));
},
methods: {
refresh() {
this.$refs && this.$refs.demonList && this.$refs.demonList.refresh();
},
drapWidth(width) {
this.widthLeft = Number(width);
},
export default {
name: 'DesignPlatform',
components: {
demonList,
drapLeft
},
data() {
return {
listShow: true,
widthLeft: Number(localStore.get('LeftWidth')) || 450,
productList: [],
skinCode: '',
currentWidth: ''
};
},
computed: {
...mapGetters([
'lessonbar'
]),
height() {
return this.$store.state.app.height - 50;
},
width() {
return this.$store.state.app.width;
}
},
watch: {
'lessonbar.opened': function (val) {
this.listShow = val;
},
widthLeft(val) {
this.setMapResize(val);
},
'$store.state.app.windowSizeCount': function() {
this.resize();
}
},
mounted() {
this.currentWidth=this.$store.state.app.width - this.widthLeft;
const againEnter = getSessionStorage('againEnter') || null;
if (!againEnter) {
launchFullscreen();
setSessionStorage('againEnter', true);
}
this.resize();
this.widthLeft = Number(localStore.get('LeftWidth'));
},
methods: {
refresh() {
this.$refs && this.$refs.demonList && this.$refs.demonList.loadInitData();
},
drapWidth(width) {
this.widthLeft = Number(width);
},
resize() {
this.widthLeft = Number(localStore.get('LeftWidth')) || this.widthLeft;
const width = this.$store.state.app.width - 521 - this.widthLeft;
const height = this.$store.state.app.height - 90;
this.$store.dispatch('config/resize', { width: width, height: height });
},
setMapResize(LeftWidth) {
this.currentWidth=this.$store.state.app.width - this.widthLeft;
const widths = this.$store.state.app.width - 521 - LeftWidth;
const heights = this.$store.state.app.height - 90;
this.$store.dispatch('config/resize', { width: widths, height: heights });
}
refresh1() {
},
mapSelected(data) {
if (data && this.editModel) {
this.$router.push({ path: `${UrlConfig.map.draft}/${this.editModel.id}/${data.view}`, query: { name: this.editModel.name } });
}
},
resize() {
this.widthLeft = Number(localStore.get('LeftWidth')) || this.widthLeft;
const width = this.$store.state.app.width - 521 - this.widthLeft;
const height = this.$store.state.app.height - 90;
this.$store.dispatch('config/resize', { width: width, height: height });
},
setMapResize(LeftWidth) {
this.currentWidth=this.$store.state.app.width - this.widthLeft;
const widths = this.$store.state.app.width - 521 - LeftWidth;
const heights = this.$store.state.app.height - 90;
this.$store.dispatch('config/resize', { width: widths, height: heights });
}
}
};
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";

View File

@ -1,272 +1,225 @@
<template>
<el-card v-loading="loading" class="map-list-main" header="我的地图列表">
<filter-city ref="myfilerCity" filter-empty :query-function="queryFunction" @filterSelectChange="refresh" />
<el-input v-model="filterText" :placeholder="this.$t('global.filteringKeywords')" clearable />
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: (height-185) +'px' }">
<el-tree
ref="tree"
:data="treeList"
node-key="id"
:props="defaultProps"
highlight-current
:span="22"
:filter-node-method="filterNode"
@node-click="clickEvent"
@node-contextmenu="showContextMenu"
>
<el-card v-loading="loading" class="map-list-main" header="我的地图列表">
<el-input v-model="filterText" :placeholder="this.$t('global.filteringKeywords')" clearable />
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: (height-185) +'px' }">
<el-tree
ref="tree"
:data="treeList"
node-key="id"
:props="defaultProps"
highlight-current
:span="22"
:filter-node-method="filterNode"
@node-click="clickEvent"
@node-contextmenu="showContextMenu"
>
<span slot-scope="{ node:tnode, data }">
<span
class="el-icon-tickets"
:style="{color: data.valid ? 'green':''}"
class="el-icon-tickets"
:style="{color: data.valid ? 'green':''}"
>&nbsp;{{ tnode.label }}</span>
</span>
</el-tree>
</el-scrollbar>
<div class="buttonList">
<el-button size="small" type="primary" class="eachButton uploadDemo ">
<input
ref="files"
type="file"
class="file_box"
accept=".json, application/json"
@change="importf"
>
导入地图
<!-- {{ $t('map.importMap') }} -->
</el-button>
<el-button size="small" type="primary" class="eachButton" @click="createMap" >新建地图</el-button>
<!-- {{ $t('map.newConstruction') }} -->
</div>
<map-operate-menu
ref="menu"
:point="point"
:edit-model="editModel"
:skin-code="skinCode"
@refresh="refresh1"
@jlmap3d="jlmap3d"
/>
</el-card>
</el-tree>
</el-scrollbar>
<div class="buttonList">
<el-button size="small" type="primary" class="eachButton uploadDemo ">
<input
ref="files"
type="file"
class="file_box"
accept=".json, application/json"
@change="importf"
>
{{ $t('map.importMap') }}
</el-button>
<el-button size="small" type="primary" class="eachButton" @click="createMap">{{ $t('map.newConstruction') }}</el-button>
</div>
<map-operate-menu
ref="menu"
:point="point"
:edit-model="editModel"
:skin-code="skinCode"
@refresh="loadInitData"
@jlmap3d="jlmap3d"
/>
</el-card>
</template>
<script>
import { DeviceMenu } from '@/scripts/ConstDic';
import { postBuildMapImport } from '@/api/jmap/mapdraft';
import { getUserMapTree } from '@/api/designPlatform';
import { UrlConfig } from '@/router/index';
import { getSessionStorage, setSessionStorage, removeSessionStorage } from '@/utils/auth';
import FilterCity from '@/views/components/filterCity';
import localStore from 'storejs';
import MapOperateMenu from '@/views/map/mapdraft/mapmanage/operateMenu';
import { DeviceMenu } from '@/scripts/ConstDic';
import { postBuildMapImport, listMap } from '@/api/jmap/mapdraft';
import { UrlConfig } from '@/router/index';
import { removeSessionStorage } from '@/utils/auth';
import localStore from 'storejs';
import MapOperateMenu from '@/views/map/mapdraft/mapmanage/operateMenu';
export default {
name: 'userMapList',
components: {
FilterCity,
MapOperateMenu
},
props: {
height: {
type: Number,
required: true
},
width: {
type: Number,
required: true
}
},
data() {
return {
loading: true,
defaultShowKeys: [],
queryFunction:getUserMapTree,
filterText: '',
treeData: [],
treeList: [],
selected: {},
defaultProps: {
children: 'children',
label: 'name'
},
node: {
},
// mapId: '',
// mapName:'',
heightUp: 450,
point: {
x: 0,
y: 0
},
editModel: {},
skinCode:''
};
},
computed: {
role() {
return this.$store.state.user.roles.includes('04') ||
export default {
name: 'UserMapList',
components: {
MapOperateMenu
},
props: {
height: {
type: Number,
required: true
},
width: {
type: Number,
required: true
}
},
data() {
return {
loading: true,
defaultShowKeys: [],
filterText: '',
treeData: [],
treeList: [],
selected: {},
defaultProps: {
children: 'children',
label: 'name'
},
node: {
},
heightUp: 450,
point: {
x: 0,
y: 0
},
editModel: {},
skinCode: ''
};
},
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');
},
mounted() {
this.heightUp = Number(localStore.get('upHeight')?localStore.get('upHeight'):(this.height)/2);
},
methods:{
filterNode(value, data) {
if (!value) return true;
return data.name.indexOf(value) !== -1;
},
createMap() {
this.$emit("createMap");
},
async refresh(filterSelect) {
this.loading = true;
this.treeData = this.treeList = [];
try {
const res = await getUserMapTree(filterSelect);
res.data.forEach(elem=>{
// if(elem.children)
// {
elem.type="map",
elem.children=[
{
id:'1',
name:'地图设计',
type:'mapDesign',
mapId:elem.id,
mapName:elem.name,
skinCode:elem.skinCode
},
// {
// id:'2',
// name:'',
// type:'lessonDesign'
// },
// {
// id:'3',
// name:'',
// type:'scriptDesign'
// },
{
id:'4',
name:'运行图设计',
type:'runPlanDesign',
mapId:elem.id,
mapName:elem.name,
skinCode:elem.skinCode
},
]
// }
});
this.treeData = res.data;
this.treeList = this.filterText
? res.data.filter(elem => { return elem.name.includes(this.filterText); })
: res.data;
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'));
}
},
clickEvent(obj, data, ele) {
if (obj.type=="map"){
// this.mapId = data.data.id;
// this.mapName=data.data.name;
// this.skinCode=data.data.skinCode;
}
switch(obj.type){
// case 'scriptDesign':{
// this.$router.push({ path: `${UrlConfig.designUser.scriptHome}/${this.mapId}` });
// break;
// }
case 'mapDesign': {
// this.resize();
this.$router.push({ path: `${UrlConfig.designUser.mapDraw}/${obj.mapId}/draft`, query: { name: obj.mapName } });
break;
}
// case 'lessonDesign': {
// this.$router.push({ path: `${UrlConfig.designUser.lessonHome}/${this.mapId}` });
// break;
// }
case 'runPlanDesign': {
this.$router.push({ path: `${UrlConfig.designUser.runPlan}/${obj.mapId}?skinCode=${obj.skinCode}` })
break;
}
}
this.$refs.menu.doClose();
},
showContextMenu(e, obj, node, vueElem) {
if (obj && obj.type == 'map') {
e.preventDefault();
const menu = DeviceMenu.Map;
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val);
}
},
beforeDestroy () {
removeSessionStorage('demonList');
},
mounted() {
this.heightUp = Number(localStore.get('upHeight')?localStore.get('upHeight'):(this.height)/2);
this.loadInitData();
},
methods: {
filterNode(value, data) {
if (!value) return true;
return data.name.indexOf(value) !== -1;
},
createMap() {
this.$emit('createMap');
},
async loadInitData() {
this.loading = true;
this.treeData = this.treeList = [];
try {
const res = await listMap();
res.data&&res.data.forEach(elem=>{
// if(elem.children)
// {
elem.type='map';
elem.children=[
{
id: '1',
name: '地图设计',
type: 'mapDesign',
mapId: elem.id,
mapName: elem.name,
skinCode: elem.skinCode
},
{
id: '4',
name: '运行图设计',
type: 'runPlanDesign',
mapId: elem.id,
mapName: elem.name,
skinCode: elem.skinCode
}
];
// }
});
this.point = {
x: e.clientX,
y: e.clientY
};
this.editModel = obj;
this.editModel.skinCode = obj.skinCode;
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu });
}
else{
//
}
},
refresh1(){
this.$refs.myfilerCity.loadInitData();
this.refresh();
},
refresh2(){
this.$refs.myfilerCity.loadInitData();
this.refresh();
},
jlmap3d() {
this.$router.push({ path: '/jlmap3d/edit', query: { mapid: this.editModel.id } });
},
importf() {
const loading = this.$loading({
lock: true,
text: '正在导入中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
setTimeout(() => {
const obj = this.$refs.files;
if (!obj.files) return;
const f = obj.files[0];
const reader = new FileReader();
const that = this;
reader.readAsText(f, 'utf-8');
reader.onload = function(e) {
const data = e.target.result;
postBuildMapImport(JSON.parse(data)).then(res => {
loading.close();
that.$message.success('导入成功!');
that.refresh();
loading.close();
}).catch(error => {
loading.close();
that.$message.error('导入失败' + error.message);
});
obj.value = '';
};
});
},
}
};
this.treeData = res.data;
this.treeList = this.filterText
? res.data.filter(elem => { return elem.name.includes(this.filterText); })
: res.data;
this.loading = false;
} catch (error) {
this.loading = false;
this.$messageBox(this.$t('error.refreshFailed'));
}
},
clickEvent(obj, data, ele) {
switch (obj.type) {
case 'mapDesign': {
this.$router.push({ path: `${UrlConfig.designUser.mapDraw}/${obj.mapId}/draft`, query: { name: obj.mapName } });
break;
}
case 'runPlanDesign': {
this.$router.push({ path: `${UrlConfig.designUser.runPlan}/${obj.mapId}?skinCode=${obj.skinCode}` });
break;
}
}
this.$refs.menu.doClose();
},
showContextMenu(e, obj, node, vueElem) {
if (obj && obj.type == 'map') {
e.preventDefault();
const menu = DeviceMenu.Map;
this.point = {
x: e.clientX,
y: e.clientY
};
this.editModel = obj;
this.editModel.skinCode = obj.skinCode;
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu });
} else {
//
}
},
jlmap3d() {
this.$router.push({ path: '/jlmap3d/edit', query: { mapid: this.editModel.id } });
},
importf() {
const loading = this.$loading({
lock: true,
text: '正在导入中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
setTimeout(() => {
const obj = this.$refs.files;
if (!obj.files) return;
const f = obj.files[0];
const reader = new FileReader();
const that = this;
reader.readAsText(f, 'utf-8');
reader.onload = function(e) {
const data = e.target.result;
postBuildMapImport(JSON.parse(data)).then(res => {
loading.close();
that.$message.success('导入成功!');
that.loadInitData();
loading.close();
}).catch(error => {
loading.close();
that.$message.error('导入失败' + error.message);
});
obj.value = '';
};
});
}
}
};
</script>
<style lang="scss" scoped>
.buttonList{

View File

@ -1,131 +1,131 @@
<template>
<div class="app-wrapper">
<map-create ref="mapCreate" :skin-code="skinCode" @refresh="refresh1" @editmap="handleNodeClick" />
<!-- <el-scrollbar wrap-class="scrollbar-wrapper"> -->
<div>
<div v-show="listShow" class="examList" :style="{width: widthLeft+'px'}">
<demon-list ref="demonList" :height="height" :width="widthLeft" @createMap="createMap"/>
</div>
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
<transition>
<!-- position:'relative', -->
<!-- :style="{left:widthLeft+'px', width: (width - widthLeft)+'px'}" -->
<router-view :product-list="productList" />
</transition>
</div>
<!-- </el-scrollbar> -->
<div class="app-wrapper">
<map-create ref="mapCreate" :skin-code="skinCode" @refresh="refresh1" @editmap="handleNodeClick" />
<!-- <el-scrollbar wrap-class="scrollbar-wrapper"> -->
<div>
<div v-show="listShow" class="examList" :style="{width: widthLeft+'px'}">
<demon-list ref="demonList" :height="height" :width="widthLeft" @createMap="createMap" />
</div>
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
<transition>
<!-- position:'relative', -->
<!-- :style="{left:widthLeft+'px', width: (width - widthLeft)+'px'}" -->
<router-view :product-list="productList" />
</transition>
</div>
<!-- </el-scrollbar> -->
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import demonList from './userDemonList';
import drapLeft from '@/views/components/drapLeft/index';
import { launchFullscreen } from '@/utils/screen';
import localStore from 'storejs';
import { getSessionStorage, setSessionStorage } from '@/utils/auth';
import MapCreate from '@/views/map/mapdraft/mapmanage/create';
import { mapGetters } from 'vuex';
import demonList from './userDemonList';
import drapLeft from '@/views/components/drapLeft/index';
import { launchFullscreen } from '@/utils/screen';
import localStore from 'storejs';
import { getSessionStorage, setSessionStorage } from '@/utils/auth';
import MapCreate from '@/views/map/mapdraft/mapmanage/create';
export default {
name: 'DesignPlatform',
components: {
demonList,
drapLeft,
MapCreate
},
data() {
return {
listShow: true,
widthLeft: Number(localStore.get('LeftWidth')) || 450,
productList: [],
skinCode: '',
};
},
computed: {
...mapGetters([
'lessonbar'
]),
height() {
return this.$store.state.app.height - 50;
},
width() {
return this.$store.state.app.width;
}
},
watch: {
'lessonbar.opened': function (val) {
this.listShow = val;
},
widthLeft(val) {
this.setMapResize(val);
},
'$store.state.app.windowSizeCount': function() {
this.resize();
}
},
mounted() {
const againEnter = getSessionStorage('againEnter') || null;
if (!againEnter){
launchFullscreen();
setSessionStorage('againEnter',true);
}
this.resize();
this.widthLeft = Number(localStore.get('LeftWidth'));
},
methods: {
refresh() {
this.$refs && this.$refs.demonList && this.$refs.demonList.refresh();
},
drapWidth(width) {
this.widthLeft = Number(width);
},
export default {
name: 'DesignPlatform',
components: {
demonList,
drapLeft,
MapCreate
},
data() {
return {
listShow: true,
widthLeft: Number(localStore.get('LeftWidth')) || 450,
productList: [],
skinCode: ''
};
},
computed: {
...mapGetters([
'lessonbar'
]),
height() {
return this.$store.state.app.height - 50;
},
width() {
return this.$store.state.app.width;
}
},
watch: {
'lessonbar.opened': function (val) {
this.listShow = val;
},
widthLeft(val) {
this.setMapResize(val);
},
'$store.state.app.windowSizeCount': function() {
this.resize();
}
},
mounted() {
const againEnter = getSessionStorage('againEnter') || null;
if (!againEnter) {
launchFullscreen();
setSessionStorage('againEnter', true);
}
this.resize();
this.widthLeft = Number(localStore.get('LeftWidth'));
},
methods: {
refresh() {
this.$refs && this.$refs.demonList && this.$refs.demonList.loadInitData();
},
drapWidth(width) {
this.widthLeft = Number(width);
},
createMap() {
this.$refs.mapCreate.show();
},
refresh1() {
this.$refs.demonList.refresh2();
},
createMap() {
this.$refs.mapCreate.show();
},
getSkinCode(node) {
let next = node;
while (next) {
if (next.data && next.data.type == 'skin') {
this.skinCode = next.data.id;
break;
}
next = next.parent;
}
},
handleNodeClick(obj, node) {
this.getSkinCode(node);
if (obj && obj.type == 'map') {
this.editModel = obj;
this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null });
this.mapSelected({ view: 'draft' });
}
},
mapSelected(data) {
if (data && this.editModel) {
this.$router.push({ path: `${UrlConfig.map.draft}/${this.editModel.id}/${data.view}`, query: { name: this.editModel.name } });
}
},
resize() {
this.widthLeft = Number(localStore.get('LeftWidth')) || this.widthLeft;
const width = this.$store.state.app.width - 521 - this.widthLeft;
const height = this.$store.state.app.height - 90;
this.$store.dispatch('config/resize', { width: width, height: height });
},
setMapResize(LeftWidth) {
const widths = this.$store.state.app.width - 521 - LeftWidth;
const heights = this.$store.state.app.height - 90;
this.$store.dispatch('config/resize', { width: widths, height: heights });
}
}
};
refresh1() {
this.$refs.demonList.loadInitData();
},
getSkinCode(node) {
let next = node;
while (next) {
if (next.data && next.data.type == 'skin') {
this.skinCode = next.data.id;
break;
}
next = next.parent;
}
},
handleNodeClick(obj, node) {
this.getSkinCode(node);
if (obj && obj.type == 'map') {
this.editModel = obj;
this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null });
this.mapSelected({ view: 'draft' });
}
},
mapSelected(data) {
if (data && this.editModel) {
this.$router.push({ path: `${UrlConfig.map.draft}/${this.editModel.id}/${data.view}`, query: { name: this.editModel.name } });
}
},
resize() {
this.widthLeft = Number(localStore.get('LeftWidth')) || this.widthLeft;
const width = this.$store.state.app.width - 521 - this.widthLeft;
const height = this.$store.state.app.height - 90;
this.$store.dispatch('config/resize', { width: width, height: height });
},
setMapResize(LeftWidth) {
const widths = this.$store.state.app.width - 521 - LeftWidth;
const heights = this.$store.state.app.height - 90;
this.$store.dispatch('config/resize', { width: widths, height: heights });
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";

View File

@ -140,7 +140,9 @@ export default {
'02': '02', // =>
'04': '02', // =>
'05': '' // => null
}
},
isDrive:this.prdType == '04',
isShowScheduling:this.prdType == '05'
};
},
computed: {
@ -201,12 +203,12 @@ export default {
isPlan() {
return this.mode === 'plan';
},
isDrive() {
return this.prdType == '04';
},
isShowScheduling() {
return this.prdType == '05';
}
// isDrive() {
// return this.prdType == '04';
// },
// isShowScheduling() {
// return this.prdType == '05';
// }
},
watch: {
'$store.state.config.menuBarLoadedCount': function (val) {
@ -226,7 +228,6 @@ export default {
},
'$store.state.training.prdType':function(val){
// this.prdType=val;
debugger;
this.isDrive=(val == '04');
this.isShowScheduling=(val == '05');
},

View File

@ -38,7 +38,7 @@
@runPlanViewShow="runPlanViewShow"
@faultChooseShow="faultChooseShow"
@runQuestLoadShow="runQuestLoadShow"
@runAddRolesLoadShow="runAddRolesLoadShow"
@runAddRolesLoadShow="runAddRolesLoadShow"
@switchMode="switchMode"
/>
@ -472,19 +472,19 @@ export default {
async runQuestLoadShow() {
this.$refs.addQuest.doShow();
},
async runAddRolesLoadShow(){
async runAddRolesLoadShow() {
// this.$refs.addQuest.doShow();
let row={id:this.$route.query.scriptId}
const row={id: this.$route.query.scriptId};
this.$refs.addQuest.handleLoad(1, row);
},
//
async selectQuest(row, id,mapLocation,roleName) {
async selectQuest(row, id, mapLocation, roleName) {
try {
const res = await loadScript(row.id, id, this.group);
if (res && res.code == 200) {
this.questId = parseInt(row.id);
if(mapLocation){
if (mapLocation) {
const newMapLocation={'offsetX': mapLocation.x, 'offsetY': mapLocation.y, 'scaleRate': mapLocation.scale};
Vue.prototype.$jlmap.setOptions(newMapLocation);
}

View File

@ -1,17 +1,12 @@
<template>
<div v-if="isShowSystemTime" class="display-card" :style="{top: offset+'px', right: right+'px'}">
<template v-if="pause">
<span class="display-pause">{{$t('display.systemTime.timePause')}}</span>
<span class="display-pause">{{ $t('display.systemTime.timePause') }}</span>
</template>
<template v-else>
<system-time
class="display-time"
:time="time"
:zoom="1.3"
:width="110"
:height="32"
:fine="2"
:top="2"
/>
</template>
@ -77,8 +72,9 @@ export default {
}
.display-time{
border: 2px solid white;
border-radius: 4px;
padding: 3px 5px;
box-shadow: 0px 0px 5px #eee;
border-radius: 3px;
}
.display-card .el-row {

View File

@ -6,7 +6,7 @@
<div style=" margin:50px" :style="{ height: height - 150 +'px' }">
<el-tabs v-model="activeName">
<el-tab-pane :label="this.$t('exam.itemList')" name="first">
<div v-if="courseModel.detail.length != 0" :style="{ height: height - 230 +'px' }">
<div v-if="courseModel.treeList.length != 0" :style="{ height: height - 230 +'px' }">
<el-scrollbar wrap-class="scrollbar-wrapper">
<el-tree
ref="tree"
@ -52,11 +52,11 @@
</template>
<script>
// import { getCourseLessonDetail } from '@/api/management/exam';
import { querySystemByTypeAndPrdCode } from '@/api/trainingPlatform';
import { PermissionType } from '@/scripts/ConstDic';
import { UrlConfig } from '@/router/index';
import LimitList from '@/views/components/limits/index';
import { getSessionStorage, setSessionStorage } from '@/utils/auth';
import { getSubSystemDetail } from '@/api/trainingPlatform';
export default {
name: 'ExamDetailView',
@ -72,7 +72,8 @@ export default {
price: 0,
remarks: '',
detail: [],
pmsList: []
pmsList: [],
treeList: []
},
EffectiveTypeList: [],
activeName: 'first',
@ -112,35 +113,31 @@ export default {
this.loadInitPage(this.$route.query.prodId, this.$route.query.type);
},
methods: {
loadInitPage(prodId = this.$route.query.prodId, type = this.$route.query.type) {
if (prodId && type) {
querySystemByTypeAndPrdCode( {type: type}, prodId ).then(res => {
if (res.data.examsLessonVO){
this.courseModel = {
id: res.data.examsLessonVO.id,
name: res.data.examsLessonVO.name,
skinCode: res.data.examsLessonVO.skinCode,
price: res.data.examsLessonVO.price,
remarks: res.data.examsLessonVO.remarks,
detail: res.data.examsLessonVO.examDefinitionVOList || [],
pmsList: res.data.examsLessonVO.permissionVOList || [],
prdCode: res.data.examsLessonVO.prdCode,
mapId: res.data.examsLessonVO.mapId,
PermissionType: PermissionType.EXAM,
treeList: res.data.treeNodeList
};
}
loadInitPage() {
if (this.$route.params.subSystem) {
getSubSystemDetail(this.$route.params.subSystem).then(resp =>{
if (resp.data.lesson) {
this.courseModel = {
id: resp.data.lesson.id,
name: resp.data.lesson.name,
pmsList: resp.data.permissionList || [],
prdCode: resp.data.lesson.prdCode,
mapId: resp.data.lesson.mapId,
PermissionType: PermissionType.EXAM,
treeList: resp.data.tree
};
}
this.getExpandList(this.courseModel.id);
}).catch((error)=>{
this.$messageBox('获取考试信息失败!'+error);
});
}
},
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 }
query: { permissionType: PermissionType.EXAM, lessonId: this.courseModel.id, prdCode: this.courseModel.prdCode, mapId: this.courseModel.mapId,subSystem:this.$route.params.subSystem }
});
},
checkCourse() {
@ -166,7 +163,7 @@ export default {
},
clickEvent(obj, node, data) {
// setSessionStorage('trainingExamCheckId', obj.id);
if (obj.type === 'exam') {
if (obj.type === 'Exam') {
if (obj.valid) {
this.$router.push(`${UrlConfig.trainingPlatform.examDetail}/${obj.id}`);
} else {

View File

@ -1,165 +0,0 @@
<template>
<el-card v-loading="loading" class="map-list-main">
<div slot="header" class="clearfix">
<span>{{ $t('exam.itemList') }}</span>
</div>
<filter-city
ref="filerCity"
is-cascader
filter-empty
:query-function="queryFunction"
@filterSelectChange="refresh"
/>
<el-input v-model="filterText" :placeholder="this.$t('global.filteringKeywords')" clearable />
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: (height-175) +'px' }">
<el-tree
ref="tree"
:data="treeData"
:props="defaultProps"
node-key="id"
:default-expanded-keys="defaultShowKeys"
:filter-node-method="filterNode"
highlight-current
:expand-on-click-node="true"
:span="22"
@node-contextmenu="showContextMenu"
@node-click="clickEvent"
>
<span slot-scope="{ node: tnode }" class="custom-tree-node">
<span
v-if="tnode.data.type === 'lesson'"
:class="tnode.data.valid? 'el-icon-sold-out':'el-icon-goods'"
>
<span
v-if="tnode.data.type === 'lesson'"
:style="{color: tnode.data.valid ? 'green':''}"
class="el-icon-tickets"
></span>
</span>
<span v-if="tnode.data.type === 'exam'" :class="tnode.data.valid? 'el-icon-sold-out':'el-icon-goods'">
<span
v-if="tnode.data.type === 'exam'"
:style="{color: tnode.data.valid ? 'green':''}"
class="el-icon-edit-outline"
></span>
</span>
<span :style="{color: tnode.data.valid ? 'green':''}">&nbsp;{{ tnode.label }}</span>
</span>
</el-tree>
</el-scrollbar>
</el-card>
</template>
<script>
import { getCourseLessonTree } from '@/api/management/exam';
import { PermissionType } from '@/scripts/ConstDic';
import { UrlConfig } from '@/router/index';
import FilterCity from '@/views/components/filterCity';
export default {
name: 'ExamDetailList',
components: {
FilterCity
},
props: {
height: {
type: Number,
required: true
}
},
data() {
return {
loading: true,
defaultShowKeys: [],
queryFunction: getCourseLessonTree,
filterText: '',
treeData: [],
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.treeData.filter((res) => {
return res.name.includes(val);
});
}
},
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;
}
},
buy(data) {
this.$router.push({
path: `${UrlConfig.exam.pay}/${data.lessonId}`, query:
{ permissionType: PermissionType.EXAM, lessonId: data.lessonId, prdCode: data.prdCode, mapId: data.mapId }
});
},
clickEvent(obj) {
if (obj.type === 'lesson') {
this.$router.push({ path: `${UrlConfig.exam.course}/${obj.id}` });
} else {
this.$router.push({ path: `${UrlConfig.exam.detail}/${obj.id}` });
}
},
refresh(filterSelect) {
const params = { mapId: filterSelect[1] };
this.loading = true;
getCourseLessonTree(params).then(res => {
this.treeData = res.data;
this.defaultShowKeys = [this.$route.params.examId];
this.$nextTick(() => {
this.loading = false;
this.$refs.tree.setCurrentKey(this.$route.params.examId); // value node-key
if (this.filterText) {
this.treeData.filter((res) => {
return res.name.includes(this.filterText);
});
}
});
}).catch(() => {
this.loading = false;
this.$messageBox('刷新失败');
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.back-home {
float: right;
cursor: pointer;
&:hover {
color: #3ea726;
}
}
</style>
<style>
.el-tree {
overflow-x: hidden;
}
.el-tree-node.is-current>.el-tree-node__content {
background-color: #e4e3e3 !important;
}
</style>

View File

@ -1,252 +1,259 @@
<template>
<div style="height: 100%; overflow: hidden">
<el-card>
<div class="button_group">
<el-button size="mini" v-if="hasRelease" @click="trainingManage">{{$t('lesson.trainingManage')}}</el-button>
<el-button size="mini" v-if="hasRelease" @click="taskManage">{{$t('lesson.taskManage')}}</el-button>
<el-button size="mini" v-if="hasRelease" @click="operationManage">{{$t('lesson.trainingRule')}}</el-button>
<el-button size="mini" type="primary" @click="lessonCreateByPublish">{{$t('lesson.createNewCoursesFromRelease')}}</el-button>
<el-button size="mini" type="primary" @click="lessonCreate">{{$t('lesson.newConstruction')}}</el-button>
</div>
</el-card>
<el-card v-loading="loading">
<el-table
:data="tableData"
row-key="id"
border
default-expand-all
:tree-props="{children: 'children', hasChildren: 'hasChildren'}">
<el-table-column
prop="name"
border
:label="this.$t('lesson.lesson')">
</el-table-column>
<el-table-column
:label="this.$t('global.status')"
>
<template slot-scope="scope">
<span>{{handlerStatus(scope.row)}}</span>
</template>
</el-table-column>
<el-table-column
prop="explanation"
show-overflow-tooltip
:label="this.$t('lesson.rejectReason')">
</el-table-column>
<el-table-column
width="500"
:label="this.$t('global.operate')">
<template slot-scope="scope">
<el-button
size="mini"
type="primary"
v-if="scope.row.status!=='1'"
@click="createChapter(scope.row)"
>{{ scope.row.type==='lesson'? $t('lesson.createChapter'):$t('lesson.updateChapter')}}</el-button>
<el-button
size="mini"
type="primary"
v-if="scope.row.status==='1'"
@click="goDetail(scope.row)"
>
{{$t('lesson.review')}}
</el-button>
<el-button
size="mini"
type="primary" plain
v-if="scope.row.type === 'lesson' && scope.row.status!=='1'"
@click="treeSort(scope.row)"
>{{$t('lesson.contentSorting')}}</el-button>
<el-button size="mini"
type="info"
v-if="scope.row.type === 'lesson'&& scope.row.status!=='1'"
@click="editLesson(scope.row)"
>{{$t('lesson.editCourse')}}</el-button>
<el-button size="mini"
type="primary"
v-if="scope.row.type === 'lesson'&& scope.row.status==='0'"
@click="publish(scope.row)"
>{{hasRelease?$t('global.release'):$t('lesson.applicationForRelease')}}</el-button>
<el-button size="mini"
type="danger"
v-if="scope.row.type === 'lesson'&& scope.row.status!=='1'"
@click="deleteLesson(scope.row)"
>{{$t('global.delete')}}</el-button>
<el-button size="mini"
type="danger"
v-if="scope.row.status ==='1'"
@click="revertLesson(scope.row)"
>
{{$t('lesson.withdraw')}}
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<publish-create @refresh="refresh" ref="publishCreate" />
<publish-lesson ref="publishLesson" @refresh="refresh" />
<lesson-detail ref="lessonDetail"/>
</div>
<div style="height: 100%; overflow: hidden">
<el-card>
<div class="button_group">
<el-button v-if="hasRelease" size="mini" @click="trainingManage">{{ $t('lesson.trainingManage') }}</el-button>
<el-button v-if="hasRelease" size="mini" @click="taskManage">{{ $t('lesson.taskManage') }}</el-button>
<el-button v-if="hasRelease" size="mini" @click="operationManage">{{ $t('lesson.trainingRule') }}</el-button>
<el-button size="mini" type="primary" @click="lessonCreateByPublish">{{ $t('lesson.createNewCoursesFromRelease') }}</el-button>
<el-button size="mini" type="primary" @click="lessonCreate">{{ $t('lesson.newConstruction') }}</el-button>
</div>
</el-card>
<el-card v-loading="loading">
<el-table
:data="tableData"
row-key="id"
border
default-expand-all
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
>
<el-table-column
prop="name"
border
:label="this.$t('lesson.lesson')"
/>
<el-table-column
:label="this.$t('global.status')"
>
<template slot-scope="scope">
<span>{{ handlerStatus(scope.row) }}</span>
</template>
</el-table-column>
<el-table-column
prop="explanation"
show-overflow-tooltip
:label="this.$t('lesson.rejectReason')"
/>
<el-table-column
width="500"
:label="this.$t('global.operate')"
>
<template slot-scope="scope">
<el-button
v-if="scope.row.status!=='1'"
size="mini"
type="primary"
@click="createChapter(scope.row)"
>{{ scope.row.type==='lesson'? $t('lesson.createChapter'):$t('lesson.updateChapter') }}</el-button>
<el-button
v-if="scope.row.status==='1'"
size="mini"
type="primary"
@click="goDetail(scope.row)"
>
{{ $t('lesson.review') }}
</el-button>
<el-button
v-if="scope.row.type === 'lesson' && scope.row.status!=='1'"
size="mini"
type="primary"
plain
@click="treeSort(scope.row)"
>{{ $t('lesson.contentSorting') }}</el-button>
<el-button
v-if="scope.row.type === 'lesson'&& scope.row.status!=='1'"
size="mini"
type="info"
@click="editLesson(scope.row)"
>{{ $t('lesson.editCourse') }}</el-button>
<el-button
v-if="scope.row.type === 'lesson'&& scope.row.status==='0'"
size="mini"
type="primary"
@click="publish(scope.row)"
>{{ hasRelease?$t('global.release'):$t('lesson.applicationForRelease') }}</el-button>
<el-button
v-if="scope.row.type === 'lesson'&& scope.row.status!=='1'"
size="mini"
type="danger"
@click="deleteLesson(scope.row)"
>{{ $t('global.delete') }}</el-button>
<el-button
v-if="scope.row.status ==='1'"
size="mini"
type="danger"
@click="revertLesson(scope.row)"
>
{{ $t('lesson.withdraw') }}
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<publish-create ref="publishCreate" @refresh="refresh" />
<publish-lesson ref="publishLesson" @refresh="refresh" />
<lesson-detail ref="lessonDetail" />
</div>
</template>
<script>
import { getDraftLesson,releaseOrCancel } from '@/api/designPlatform';
import { UrlConfig } from '@/router/index';
import PublishCreate from './lessoncategory/edit/create';
import PublishLesson from './lessoncategory/edit/lesson/publish';
import { delLesson } from '@/api/jmap/lessondraft';
import LessonDetail from '@/views/approval/lesson/detail';
import { releaseOrCancel } from '@/api/designPlatform';
import { UrlConfig } from '@/router/index';
import PublishCreate from './lessoncategory/edit/create';
import PublishLesson from './lessoncategory/edit/lesson/publish';
import { delLesson, getLessonTree } from '@/api/jmap/lessondraft';
import LessonDetail from '@/views/approval/lesson/detail';
export default {
name: 'LessonHome',
components: {
PublishCreate,
PublishLesson,
LessonDetail
},
computed: {
mapId() {
return this.$route.params.mapId;
},
hasRelease() {
return this.$store.state.user.roles.includes('04') ||
export default {
name: 'LessonHome',
components: {
PublishCreate,
PublishLesson,
LessonDetail
},
data() {
return {
tableData: [],
loading: false,
showEdit: false
};
},
computed: {
mapId() {
return this.$route.params.mapId;
},
hasRelease() {
return this.$store.state.user.roles.includes('04') ||
this.$store.state.user.roles.includes('05');
}
},
data() {
return {
tableData: [],
loading: false,
showEdit: false
};
},
watch: {
$route() {
this.refresh();
}
},
mounted() {
this.loading = true;
this.loadInitData();
},
methods: {
loadInitData() {
getDraftLesson({},this.mapId).then(response=> {
response.data.forEach(elem => {
if (elem.children) {
elem.children.forEach( it => {
it.parentId = elem.id;
} )
}
});
this.tableData = response.data;
this.loading = false;
}).catch(error=>{
this.$messageBox(this.$t('error.getDraftCourseDataFailed'))
});
},
refuse() {
this.loading = true;
getDraftLesson({},this.mapId).then(response=> {
response.data.forEach(elem => {
if (elem.children) {
elem.children.forEach( it => {
it.parentId = elem.id;
} )
}
});
this.tableData = response.data;
this.loading = false;
});
},
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;
}
return lessonStatus;
},
refresh() {
this.loading = true;
this.loadInitData();
},
editLesson(row) {
this.$router.push( {path: `${UrlConfig.design.lessonEdit}/lessonEdit`, query: {id: row.id, skinCode: row.code}} )
},
lessonCreate() {
this.$router.push({ path: `${UrlConfig.design.lessonEdit}/lessonCreate`,query: {skinCode: this.$route.params.skinCode} })
},
lessonCreateByPublish() {
this.$nextTick(() => {
this.$refs.publishCreate.doShow();
});
},
publish(row) {
row.skinCode = this.$route.params.skinCode;
row.cityCode = this.$route.query.cityCode;
this.$refs.publishLesson.doShow(row);
},
deleteLesson(row) {
delLesson(row).then(response => {
this.$message.success(this.$t('tip.successfullyDelete'));
this.loading = true;
this.loadInitData();
}).catch(error => {
this.$messageBox(this.$t('tip.failDelete'))
});
},
createChapter(row) {
if (row.type === 'lesson') {
this.$router.push({path: `${UrlConfig.design.lessonEdit}/chapterCreate`, query: {lessonId: row.id}});
} else if (row.type === 'chapter') {
this.$router.push( {path: `${UrlConfig.design.lessonEdit}/chapterEdit`,query: {id: row.id, lessonId: row.parentId}} )
}
},
treeSort(row){
this.$router.push({path: `${UrlConfig.design.lessonEdit}/treeSort`, query: row});
},
taskManage() {
this.$router.push({path: `${UrlConfig.design.taskManage}`, query: {mapId: this.$route.params.mapId, skinCode: this.$route.params.skinCode}})
},
trainingManage() {
this.$router.push({path: `${UrlConfig.design.trainingManage}/${this.$route.params.skinCode}`, query: {mapId: this.$route.params.mapId}})
},
operationManage() {
this.$router.push({path: `${UrlConfig.design.trainingRule}`, query: {mapId: this.$route.params.mapId, skinCode: this.$route.params.skinCode}})
},
revertLesson(row) {
this.$confirm(this.$t('tip.cancelCoursePublicationHint'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
releaseOrCancel(row.id,"0").then(response => {
this.loading = false;
this.$message.success(this.$t('tip.cancelTheSuccessfulApplicationOfTheCourseRelease'));
this.refuse();
}).catch(error => {
this.loading = false;
this.$messageBox(this.$t('tip.cancellationOfCoursePublicationApplicationFailed'));
this.refuse();
});
});
},
goDetail(row) {
this.$refs.lessonDetail.show(row.id);
}
}
};
}
},
watch: {
$route() {
this.refresh();
}
},
mounted() {
this.loading = true;
this.loadInitData();
},
methods: {
loadInitData() {
getLessonTree(this.$route.params.skinCode).then(response=> {
response.data.forEach(elem => {
if (elem.children) {
elem.children.forEach( it => {
it.parentId = elem.id;
} );
}
});
this.tableData = response.data;
this.loading = false;
}).catch(( ) => {
this.$messageBox(this.$t('error.getDraftCourseDataFailed'));
});
},
refuse() {
this.loading = true;
getLessonTree(this.$route.params.skinCode).then(response=> {
response.data.forEach(elem => {
if (elem.children) {
elem.children.forEach( it => {
it.parentId = elem.id;
} );
}
});
this.tableData = response.data;
this.loading = false;
});
},
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;
}
return lessonStatus;
},
refresh() {
this.loading = true;
this.loadInitData();
},
editLesson(row) {
this.$router.push( {path: `${UrlConfig.design.lessonEdit}/lessonEdit`, query: {id: row.id, skinCode: row.code}} );
},
lessonCreate() {
this.$router.push({ path: `${UrlConfig.design.lessonEdit}/lessonCreate`, query: {skinCode: this.$route.params.skinCode} });
},
lessonCreateByPublish() {
this.$nextTick(() => {
this.$refs.publishCreate.doShow();
});
},
publish(row) {
row.skinCode = this.$route.params.skinCode;
row.cityCode = this.$route.query.cityCode;
this.$refs.publishLesson.doShow(row);
},
deleteLesson(row) {
delLesson(row).then(response => {
this.$message.success(this.$t('tip.successfullyDelete'));
this.loading = true;
this.loadInitData();
}).catch(() => {
this.$messageBox(this.$t('tip.failDelete'));
});
},
createChapter(row) {
if (row.type === 'lesson') {
this.$router.push({path: `${UrlConfig.design.lessonEdit}/chapterCreate`, query: {lessonId: row.id}});
} else if (row.type === 'chapter') {
this.$router.push( {path: `${UrlConfig.design.lessonEdit}/chapterEdit`, query: {id: row.id, lessonId: row.parentId}} );
}
},
treeSort(row) {
this.$router.push({path: `${UrlConfig.design.lessonEdit}/treeSort`, query: row});
},
taskManage() {
this.$router.push({path: `${UrlConfig.design.taskManage}`, query: {mapId: this.$route.params.mapId, skinCode: this.$route.params.skinCode}});
},
trainingManage() {
this.$router.push({path: `${UrlConfig.design.trainingManage}/${this.$route.params.skinCode}`, query: {mapId: this.$route.params.mapId}});
},
operationManage() {
this.$router.push({path: `${UrlConfig.design.trainingRule}`, query: {mapId: this.$route.params.mapId, skinCode: this.$route.params.skinCode}});
},
revertLesson(row) {
this.$confirm(this.$t('tip.cancelCoursePublicationHint'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
releaseOrCancel(row.id, '0').then(response => {
this.loading = false;
this.$message.success(this.$t('tip.cancelTheSuccessfulApplicationOfTheCourseRelease'));
this.refuse();
}).catch(() => {
this.loading = false;
this.$messageBox(this.$t('tip.cancellationOfCoursePublicationApplicationFailed'));
this.refuse();
});
});
},
goDetail(row) {
this.$refs.lessonDetail.show(row.id);
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.draft {

View File

@ -1,208 +1,220 @@
<template>
<div class="card-box">
<el-steps class="steps" :active="display">
<el-step :title="title" icon="el-icon-edit-outline"></el-step>
<el-step title="" icon="el-icon-upload"></el-step>
</el-steps>
<el-card class="forms">
<el-scrollbar wrapClass="scrollbar-wrapper" :style="{height:height -160 + 'px'}" style="padding-top: 40px">
<el-form ref="form" :model="chapterModel" :rules="rules" label-width="135px">
<el-form-item :label="this.$t('lesson.courseName')" prop="lessonName">
<el-input v-model="chapterModel.lessonName" :disabled="true"></el-input>
</el-form-item>
<!--<el-form-item :label="this.$t('lesson.parentChapter')" prop="parentName">
<div class="card-box">
<el-steps class="steps" :active="display">
<el-step :title="title" icon="el-icon-edit-outline" />
<el-step title="" icon="el-icon-upload" />
</el-steps>
<el-card class="forms">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{height:height -160 + 'px'}" style="padding-top: 40px">
<el-form ref="form" :model="chapterModel" :rules="rules" label-width="135px">
<el-form-item :label="this.$t('lesson.courseName')" prop="lessonName">
<el-input v-model="chapterModel.lessonName" :disabled="true" />
</el-form-item>
<!--<el-form-item :label="this.$t('lesson.parentChapter')" prop="parentName">
<el-input v-model="chapterModel.parentName" :disabled="true"></el-input>
</el-form-item>-->
<el-form-item :label="this.$t('lesson.chapterName')" prop="name">
<el-input v-model="chapterModel.name"></el-input>
</el-form-item>
<el-form-item :label="this.$t('lesson.chapterInstructions')" prop="remarks">
<el-input type="textarea" :autosize="{ minRows: 4, maxRows: 4}" :placeholder="this.$t('rules.pleaseEnterContent')"
v-model="chapterModel.remarks">
</el-input>
</el-form-item>
<el-form-item :label="this.$t('lesson.associatedTraining')">
<el-table ref="singleTable" :data="chapterModel.trainings" border highlight-current-row
:height="237">
<el-table-column type="index" width="50">
</el-table-column>
<el-table-column property="trainingName" :label="this.$t('lesson.trainingName')">
</el-table-column>
<el-table-column property="trial" :label="this.$t('global.isTry')" width="80">
<template slot-scope="scope">
<el-checkbox v-model="scope.row.trial"></el-checkbox>
</template>
</el-table-column>
<el-table-column fixed="right" :label="this.$t('global.operate')" width="70">
<template slot-scope="scope">
<el-button @click.native.prevent="deleteRow(scope.$index, chapterModel.trainings)"
type="text" size="small">{{$t('global.remove')}}</el-button>
</template>
</el-table-column>
</el-table>
<el-button type="primary" style="margin-top: 20px" @click='pushTrain'>{{$t('lesson.addTraining')}}</el-button>
</el-form-item>
</el-form>
</el-scrollbar>
</el-card>
<div class="draft">
<el-button-group>
<el-button type="primary" @click="create" v-show="!isEdit">{{$t('global.append')}}</el-button>
<el-button type="primary" @click="update" v-show="isEdit">{{$t('global.update')}}</el-button>
<el-button type="primary" @click="back" >{{$t('global.back')}}</el-button>
</el-button-group>
</div>
<train-list ref="pathRoute" :trainings="this.chapterModel.trainings" :detail="detail"
@routeSelected="routeSelected"></train-list>
<el-form-item :label="this.$t('lesson.chapterName')" prop="name">
<el-input v-model="chapterModel.name" />
</el-form-item>
<el-form-item :label="this.$t('lesson.chapterInstructions')" prop="remarks">
<el-input
v-model="chapterModel.remarks"
type="textarea"
:autosize="{ minRows: 4, maxRows: 4}"
:placeholder="this.$t('rules.pleaseEnterContent')"
/>
</el-form-item>
<el-form-item :label="this.$t('lesson.associatedTraining')">
<el-table
ref="singleTable"
:data="chapterModel.trainings"
border
highlight-current-row
:height="237"
>
<el-table-column type="index" width="50" />
<el-table-column property="trainingName" :label="this.$t('lesson.trainingName')" />
<el-table-column property="trial" :label="this.$t('global.isTry')" width="80">
<template slot-scope="scope">
<el-checkbox v-model="scope.row.trial" />
</template>
</el-table-column>
<el-table-column fixed="right" :label="this.$t('global.operate')" width="70">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.prevent="deleteRow(scope.$index, chapterModel.trainings)"
>{{ $t('global.remove') }}</el-button>
</template>
</el-table-column>
</el-table>
<el-button type="primary" style="margin-top: 20px" @click="pushTrain">{{ $t('lesson.addTraining') }}</el-button>
</el-form-item>
</el-form>
</el-scrollbar>
</el-card>
<div class="draft">
<el-button-group>
<el-button v-show="!isEdit" type="primary" @click="create">{{ $t('global.append') }}</el-button>
<el-button v-show="isEdit" type="primary" @click="update">{{ $t('global.update') }}</el-button>
<el-button type="primary" @click="back">{{ $t('global.back') }}</el-button>
</el-button-group>
</div>
<train-list
ref="pathRoute"
:trainings="this.chapterModel.trainings"
:detail="detail"
@routeSelected="routeSelected"
/>
</div>
</template>
<script>
import { createLessonChapter, updateLessonChapter, getLessonDetail, getLessonChapterDetail } from '@/api/jmap/lessondraft';
import localStore from 'storejs';
import TrainList from './list';
import { createLessonChapter, updateLessonChapter, getLessonDetail, getLessonChapterDetail } from '@/api/jmap/lessondraft';
import localStore from 'storejs';
import TrainList from './list';
export default {
name: 'sectionEdit',
props: {
height: {
type: Number
}
},
components: {
TrainList
},
data() {
return {
isEdit: false,
display: 1,
productId: '',
trial: '',
chapterModel: {
trainingId: '',
lessonId: '',
lessonName: '',
name: '',
remarks: '',
trainings: []
},
detail: {
mapId: '',
prdCode: '',
},
}
},
computed: {
title() {
return this.isEdit ? this.$t('lesson.updateChapter') : this.$t('lesson.createChapter');
},
rules() {
let baseRules = {
name: [
{ required: true, message: this.$t('rules.enterChapterName'), trigger: 'change' }
],
remarks: [
{ required: true, message: this.$t('rules.enterChapterInstructions'), trigger: 'change' }
],
};
return baseRules;
}
},
methods: {
initData(isNew, data) {
this.isEdit = !isNew;
this.clearForm();
if (isNew) {
this.loadTrainingList(data);
} else {
this.loadTrainingList(data);
}
},
getChapter(data) {
getLessonChapterDetail(data).then(response => {
this.setChapterModel(response.data);
}).catch(error => {
this.$messageBox(this.$t('error.obtainChapterDataFailed'))
});
},
deleteRow(index, rows) {
rows.splice(index, 1);
},
pushTrain() {
if (this.$refs && this.$refs.pathRoute) {
this.$refs.pathRoute.doShow();
}
},
routeSelected(data) {
data.forEach((elem, index) => {
this.chapterModel.trainings.push({
trainingName: elem.name,
trial: false,
trainingId: elem.id,
});
});
},
setChapterModel(data) {
let lessonName = this.chapterModel.lessonName;
this.chapterModel = data;
this.chapterModel.trainings = data.trainings || [];
this.chapterModel.lessonName = lessonName;
},
clearForm() {
this.chapterModel.trainingId = '';
this.chapterModel.trainings = [];
this.$refs.form.resetFields();
},
export default {
name: 'SectionEdit',
components: {
TrainList
},
props: {
height: {
type: Number
}
},
data() {
return {
isEdit: false,
display: 1,
productId: '',
trial: '',
chapterModel: {
trainingId: '',
lessonId: '',
lessonName: '',
name: '',
remarks: '',
trainings: []
},
detail: {
mapId: '',
prdCode: ''
}
};
},
computed: {
title() {
return this.isEdit ? this.$t('lesson.updateChapter') : this.$t('lesson.createChapter');
},
rules() {
const baseRules = {
name: [
{ required: true, message: this.$t('rules.enterChapterName'), trigger: 'change' }
],
remarks: [
{ required: true, message: this.$t('rules.enterChapterInstructions'), trigger: 'change' }
]
};
return baseRules;
}
},
methods: {
initData(isNew, data) {
this.isEdit = !isNew;
this.clearForm();
if (isNew) {
this.loadTrainingList(data);
} else {
this.loadTrainingList(data);
}
},
getChapter(data) {
getLessonChapterDetail(data).then(response => {
this.setChapterModel(response.data);
}).catch(error => {
this.$messageBox(this.$t('error.obtainChapterDataFailed'));
});
},
deleteRow(index, rows) {
rows.splice(index, 1);
},
pushTrain() {
if (this.$refs && this.$refs.pathRoute) {
this.$refs.pathRoute.doShow();
}
},
routeSelected(data) {
data.forEach((elem, index) => {
this.chapterModel.trainings.push({
trainingName: elem.name,
trial: false,
trainingId: elem.id
});
});
},
setChapterModel(data) {
const lessonName = this.chapterModel.lessonName;
this.chapterModel = data;
this.chapterModel.trainings = data.trainings || [];
this.chapterModel.lessonName = lessonName;
},
clearForm() {
this.chapterModel.trainingId = '';
this.chapterModel.trainings = [];
this.$refs.form.resetFields();
},
// /
loadTrainingList(data) {
getLessonDetail({ id: data.lessonId }).then(resp => {
this.detail.mapId = resp.data.mapId;
this.detail.prdCode = resp.data.prdCode;
this.chapterModel.lessonId = resp.data.id;
this.chapterModel.lessonName = resp.data.name;
if (this.isEdit) {
this.getChapter(data);
}
}).catch(error => {
this.$messageBox(this.$t('error.obtainCourseDetailsFailed'));
})
},
create() {
this.$refs.form.validate((valid) => {
if (valid) {
createLessonChapter(this.chapterModel).then(response => {
this.$emit('refresh');
this.$message.success(this.$t('tip.createSuccess'));
}).catch(error => {
this.$messageBox(this.$t('error.refreshFailed'))
});
}
});
},
update() {
this.$refs.form.validate((valid) => {
if (valid) {
updateLessonChapter(this.chapterModel).then(response => {
this.$emit('refresh');
this.$message.success(this.$t('tip.updateSuccessfully'));
}).catch(error => {
this.$messageBox(this.$t('error.refreshFailed'))
});
}
});
},
back() {
this.$router.go(-1);
}
}
}
// /
loadTrainingList(data) {
getLessonDetail({ id: data.lessonId }).then(resp => {
this.detail.mapId = resp.data.mapId;
this.detail.prdCode = resp.data.prdCode;
this.chapterModel.lessonId = resp.data.id;
this.chapterModel.lessonName = resp.data.name;
if (this.isEdit) {
this.getChapter(data);
}
}).catch(error => {
this.$messageBox(this.$t('error.obtainCourseDetailsFailed'));
});
},
create() {
this.$refs.form.validate((valid) => {
if (valid) {
createLessonChapter(this.chapterModel).then(response => {
this.$emit('refresh');
this.$message.success(this.$t('tip.createSuccess'));
}).catch(error => {
this.$messageBox(this.$t('error.refreshFailed'));
});
}
});
},
update() {
this.$refs.form.validate((valid) => {
if (valid) {
updateLessonChapter(this.chapterModel).then(response => {
this.$emit('refresh');
this.$message.success(this.$t('tip.updateSuccessfully'));
}).catch(error => {
this.$messageBox(this.$t('error.refreshFailed'));
});
}
});
},
back() {
this.$router.go(-1);
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.card-box {
padding-top: 20px;
}

View File

@ -1,152 +1,156 @@
<template>
<el-dialog :title="this.$t('lesson.courseRelease')" :visible.sync="dialogShow" width="30%" :before-do-close="doClose" v-dialogDrag>
<div>
<el-form label-position="right" ref="form" :rules="rules" :model="editModel" label-width="140px"
@submit.native.prevent>
<el-form-item :label="this.$t('lesson.releaseAssociatedCity')" prop="cityCode">
<el-select v-model="editModel.cityCode" @change="cityChange" :placeholder="this.$t('rules.pleaseSelect')" :disabled="this.disabled">
<el-option v-for="item in cityList" :key="item.code" :label="item.name" :value="item.code">
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="this.$t('lesson.releaseAssociatedMap')" prop="mapId">
<el-select v-model="editModel.mapId" @change="mapChange" :placeholder="this.$t('rules.pleaseSelect')" :disabled="this.disabled">
<el-option v-for="item in mapList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="this.$t('lesson.publishCourseName')" prop="name">
<el-input v-model="editModel.name" :disabled="!this.hasRelease"></el-input>
</el-form-item>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogShow = false">{{$t('global.cancel')}}</el-button>
<el-button type="primary" @click="doSave" :loading="loading">{{$t('global.confirm')}}</el-button>
</span>
</el-dialog>
<el-dialog v-dialogDrag :title="this.$t('lesson.courseRelease')" :visible.sync="dialogShow" width="30%" :before-do-close="doClose">
<div>
<el-form
ref="form"
label-position="right"
:rules="rules"
:model="editModel"
label-width="140px"
@submit.native.prevent
>
<el-form-item :label="this.$t('lesson.releaseAssociatedCity')" prop="cityCode">
<el-select v-model="editModel.cityCode" :placeholder="this.$t('rules.pleaseSelect')" :disabled="this.disabled" @change="cityChange">
<el-option v-for="item in cityList" :key="item.code" :label="item.name" :value="item.code" />
</el-select>
</el-form-item>
<el-form-item :label="this.$t('lesson.releaseAssociatedMap')" prop="mapId">
<el-select v-model="editModel.mapId" :placeholder="this.$t('rules.pleaseSelect')" :disabled="this.disabled" @change="mapChange">
<el-option v-for="item in mapList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item :label="this.$t('lesson.publishCourseName')" prop="name">
<el-input v-model="editModel.name" :disabled="!this.hasRelease" />
</el-form-item>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogShow = false">{{ $t('global.cancel') }}</el-button>
<el-button type="primary" :loading="loading" @click="doSave">{{ $t('global.confirm') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import { getPublishMapListBySkinCode } from '@/api/jmap/map';
import { getLessonNameByMapIdAndLessonId } from '@/api/jmap/lessondraft';
import { adminPublishLesson,releaseOrCancel } from '@/api/designPlatform';
import { getPublishMapListBySkinCode } from '@/api/jmap/map';
import { getLessonNameByMapIdAndLessonId } from '@/api/jmap/lessondraft';
import { adminPublishLesson, releaseOrCancel } from '@/api/designPlatform';
export default {
name: 'LessonPublish',
data() {
return {
dialogShow: false,
loading: false,
disabled: true,
mapList: [],
cityList: [],
cityMapDict: {},
editModel: {
id: '',
name: '',
mapId: '',
prdCode: '',
cityCode: '',
}
}
},
computed: {
rules() {
return {
id: [
{ required: true, message: this.$t('rules.courseIdIsEmpty'), trigger: 'change' }
],
cityCode: [
{ required: true, message: this.$t('rules.selectCity'), trigger: 'change' }
],
mapId: [
{ required: true, message: this.$t('rules.selectMapName'), trigger: 'change' }
],
name: [
{ required: true, message: this.$t('rules.pleaseEnterMapName'), trigger: 'change' }
],
}
},
hasRelease() {
return this.$store.state.user.roles.includes('04') ||
export default {
name: 'LessonPublish',
data() {
return {
dialogShow: false,
loading: false,
disabled: true,
mapList: [],
cityList: [],
cityMapDict: {},
editModel: {
id: '',
name: '',
mapId: '',
prdCode: '',
cityCode: ''
}
};
},
computed: {
rules() {
return {
id: [
{ required: true, message: this.$t('rules.courseIdIsEmpty'), trigger: 'change' }
],
cityCode: [
{ required: true, message: this.$t('rules.selectCity'), trigger: 'change' }
],
mapId: [
{ required: true, message: this.$t('rules.selectMapName'), trigger: 'change' }
],
name: [
{ required: true, message: this.$t('rules.pleaseEnterMapName'), trigger: 'change' }
]
};
},
hasRelease() {
return this.$store.state.user.roles.includes('04') ||
this.$store.state.user.roles.includes('05');
}
},
methods: {
cityChange(code) {
this.editModel.mapId = '';
this.mapList = this.cityMapDict[code];
},
async mapChange(mapId) {
let resp = await getLessonNameByMapIdAndLessonId({ mapId: mapId, lessonId: this.editModel.id });
if (resp && resp.data) {
this.editModel.name = resp.data.name;
}
},
doShow(model) {
this.mapList = [];
this.cityList = [];
this.cityMapDict = {};
this.editModel = {
id: model.id,
name: model.name,
mapId: this.$route.params.mapId,
prdCode: model.prdCode,
cityCode: model.cityCode,
};
}
},
methods: {
cityChange(code) {
this.editModel.mapId = '';
this.mapList = this.cityMapDict[code];
},
async mapChange(mapId) {
const resp = await getLessonNameByMapIdAndLessonId({ mapId: mapId, lessonId: this.editModel.id });
if (resp && resp.data) {
this.editModel.name = resp.data.name;
}
},
doShow(model) {
this.mapList = [];
this.cityList = [];
this.cityMapDict = {};
this.editModel = {
id: model.id,
name: model.name,
mapId: this.$route.params.mapId,
prdCode: model.prdCode,
cityCode: model.cityCode
};
if (model.skinCode && model.id) {
getPublishMapListBySkinCode(model.skinCode).then(resp => {
let list = resp.data || [];
list.forEach(elem => {
if (!this.cityMapDict[elem.cityCode]) {
this.cityMapDict[elem.cityCode] = [];
}
this.cityMapDict[elem.cityCode].push(elem);
});
if (model.skinCode && model.id) {
getPublishMapListBySkinCode(model.skinCode).then(resp => {
const list = resp.data || [];
list.forEach(elem => {
if (!this.cityMapDict[elem.cityCode]) {
this.cityMapDict[elem.cityCode] = [];
}
this.cityMapDict[elem.cityCode].push(elem);
});
this.$Dictionary.cityType().then(list => {
this.cityList = list.filter(elem => { return this.cityMapDict[elem.code] });
})
this.mapList = this.cityMapDict[model.cityCode];
})
}
this.$Dictionary.cityType().then(list => {
this.cityList = list.filter(elem => { return this.cityMapDict[elem.code]; });
});
this.mapList = this.cityMapDict[model.cityCode];
});
}
this.dialogShow = true;
},
doClose() {
this.$refs.form.resetFields();
this.dialogShow = false;
this.$emit('refresh')
},
doSave() {
this.loading = true;
this.$refs['form'].validate((valid) => {
if (valid && this.hasRelease) {
adminPublishLesson(this.editModel,this.editModel.id).then(response => {
this.loading = false;
this.$message.success(this.$t('tip.coursePublishSuccessful'));
this.doClose();
}).catch(error => {
this.loading = false;
this.$messageBox(this.$t('tip.coursePublishFailed'));
});
}else if(valid && !this.hasRelease){
releaseOrCancel(this.editModel.id,"1").then(response => {
this.loading = false;
this.$message.success(this.$t('tip.coursePublishSuccessful'));
this.doClose();
}).catch(error => {
this.loading = false;
this.$messageBox(this.$t('tip.coursePublishFailed'));
});
} else {
this.loading = false;
}
});
this.dialogShow = true;
},
doClose() {
this.$refs.form.resetFields();
this.dialogShow = false;
this.$emit('refresh');
},
doSave() {
this.loading = true;
this.$refs['form'].validate((valid) => {
if (valid && this.hasRelease) {
adminPublishLesson(this.editModel, this.editModel.id).then(response => {
this.loading = false;
this.$message.success(this.$t('tip.coursePublishSuccessful'));
this.doClose();
}).catch(() => {
this.loading = false;
this.$messageBox(this.$t('tip.coursePublishFailed'));
});
} else if (valid && !this.hasRelease) {
releaseOrCancel(this.editModel.id, '1').then(response => {
this.loading = false;
this.$message.success(this.$t('tip.coursePublishSuccessful'));
this.doClose();
}).catch(() => {
this.loading = false;
this.$messageBox(this.$t('tip.coursePublishFailed'));
});
} else {
this.loading = false;
}
});
}
}
}
}
}
};
</script>

View File

@ -1,8 +1,11 @@
<template>
<el-dialog v-dialogDrag :title="operation.title" :visible.sync="dialogShow" width="500px" :before-close="close">
<el-form ref="form" :model="operateModel" label-width="auto" :rules="rules" size="mini" label-position="right" class="dialog-form">
<el-form-item v-if="isAdd" :label="this.$t('lesson.trainingName')+':'" prop="name">
<el-input v-model="operateModel.name" style="width: 300px" />
</el-form-item>
<el-form-item :label="this.$t('lesson.skinType') + ':'" prop="skinCode">
<el-select v-model="operateModel.skinCode" :disabled="this.disable" @change="skinCodeChoose">
<el-select v-model="operateModel.skinCode" style="width: 300px" :disabled="this.disable" @change="skinCodeChoose">
<el-option
v-for="option in skinCodeList"
:key="option.code"
@ -11,8 +14,9 @@
/>
</el-select>
</el-form-item>
<el-form-item :label="this.$t('lesson.productType')" prop="prdCode">
<el-select v-model="operateModel.prdCode" @change="prdChange">
<el-select v-model="operateModel.prdCode" style="width: 300px" @change="prdChange">
<el-option
v-for="option in productList"
:key="option.code"
@ -22,7 +26,7 @@
</el-select>
</el-form-item>
<el-form-item :label="this.$t('lesson.trainingType') + ':'" prop="type">
<el-select v-model="operateModel.type" @change="typeChange">
<el-select v-model="operateModel.type" style="width: 300px" @change="typeChange">
<el-option
v-for="option in trainingTypeLists"
:key="option.code"
@ -32,7 +36,7 @@
</el-select>
</el-form-item>
<el-form-item :label="this.$t('lesson.operationType') + ':'" prop="operateType">
<el-select v-model="operateModel.operateType" multiple>
<el-select v-model="operateModel.operateType" style="width: 300px" multiple>
<el-option
v-for="option in trainingTypeMap[operateModel.type]"
:key="option.code"
@ -42,24 +46,24 @@
</el-select>
</el-form-item>
<el-form-item v-if="isUpdate" :label="this.$t('lesson.minTime')" prop="minDuration">
<el-input-number v-model="operateModel.minDuration" :min="0" :max="10000" />s
<el-input-number v-model="operateModel.minDuration" style="width: 300px" :min="0" :max="10000" />s
</el-form-item>
<el-form-item v-if="isUpdate" :label="this.$t('lesson.maxTime')" prop="maxDuration">
<el-input-number v-model="operateModel.maxDuration" :min="0" :max="10000" />s
<el-input-number v-model="operateModel.maxDuration" style="width: 300px" :min="0" :max="10000" />s
</el-form-item>
<el-form-item v-if="isUpdate" :label="this.$t('lesson.trainingDescription')" prop="remarks">
<el-input v-model="operateModel.remarks" type="textarea" />
<el-input v-model="operateModel.remarks" style="width: 300px" type="textarea" />
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose">{{$t('global.cancel')}}</el-button>
<el-button type="primary" :loading="loading" @click="handleDeal">{{$t('global.confirm')}}</el-button>
<el-button @click="handleClose">{{ $t('global.cancel') }}</el-button>
<el-button type="primary" :loading="loading" @click="handleDeal">{{ $t('global.confirm') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import { addAutoTraining, updateAutoTraining, deleteAutoTraining } from '@/api/jmap/training';
import { addAutoTraining, updateAutoTraining, deleteAutoTraining, addTraining } from '@/api/jmap/training';
import { getOperateTrainingList } from '@/api/management/operation';
import { getCommodityMapProduct } from '@/api/management/mapprd';
@ -77,7 +81,7 @@ export default {
trainingOperateTypeMap: {
type: Object,
required: true
},
}
},
data() {
@ -113,13 +117,18 @@ export default {
var checkOperateType = (rule, value, callback) => {
if (value.length <= 0) {
return callback(new Error(this.$t('rules.selectTrainingType')));
} else if (this.operation.event == '02' && value.length !== 1) {
} else if ((this.operation.event === '02' || this.operation.event === '04')&& value.length !== 1) {
return callback(new Error(this.$t('rules.selectOneTrainingType')));
} else {
callback();
}
};
var checkName = (rule, value, callback) => {
if (this.operation.event == '04' && !value) {
return callback(new Error('请输入实训名称'));
}
callback();
};
// var checkRemarks = (rule, value, callback) => {
// if (this.operation.event == '02' && !value) {
// return callback(new Error(''));
@ -129,7 +138,7 @@ export default {
return {
dialogShow: false,
disable: true,
disable: true,
productTypesList: [],
trainTypesList: [],
productList: [],
@ -152,6 +161,9 @@ export default {
title: ''
},
rules: {
name: [
{ required: true, validator: checkName, trigger: 'blur'}
],
skinCode: [
{ required: true, message: this.$t('rules.pleaseEnterMapName'), trigger: 'change' }
],
@ -178,12 +190,15 @@ export default {
},
computed: {
isUpdate() {
return this.operation.event == '02';
return this.operation.event === '02' || this.operation.event === '04';
},
isAdd() {
return this.operation.event === '04';
}
},
mounted() {
this.skinCodeChoose(this.$route.params.skinCode);
},
mounted() {
this.skinCodeChoose(this.$route.params.skinCode);
},
methods: {
show(data) {
this.operation = {
@ -317,6 +332,25 @@ export default {
this.$messageBox(this.$t('tip.deleteAutomaticGenerationTrainingFailure'));
this.loading = false;
});
} else if (this.operation.event === '04') {
const data = {
name: this.operateModel.name,
type: this.operateModel.type,
prdCode: this.operateModel.prdCode,
skinCode: this.operateModel.skinCode,
operateType: this.operateModel.operateType[0],
minDuration: this.operateModel.minDuration,
maxDuration: this.operateModel.maxDuration,
remarks: this.operateModel.remarks
};
addTraining(data).then(response => {
this.$message.success(this.$t('tip.addTrainingSuccessfully'));
this.$emit('refresh');
this.close();
}).catch(() => {
this.$messageBox(this.$t('tip.addTrainingFailed'));
this.loading = false;
});
}
}
});

View File

@ -8,11 +8,11 @@
:training-operate-type-map="trainingOperateTypeMap"
@refresh="reloadTable"
/>
<div class="draft">
<el-button-group>
<el-button type="primary" @click="turnback">{{ $t('global.back') }}</el-button>
</el-button-group>
</div>
<div class="draft">
<el-button-group>
<el-button type="primary" @click="turnback">{{ $t('global.back') }}</el-button>
</el-button-group>
</div>
</div>
</template>
@ -67,13 +67,13 @@ export default {
data: []
}
},
generateType: {
/* generateType: {
type: 'select',
label: this.$t('lesson.automaticOrManual'),
config: {
data: [{ value: '02', label: this.$t('lesson.manual') }, { value: '01', label: this.$t('lesson.automatic') }]
}
},
},*/
name: {
type: 'text',
label: this.$t('lesson.trainingName')
@ -138,20 +138,20 @@ export default {
name: this.$t('lesson.demonstration'),
handleClick: this.demoDisplay,
type: ''
},
{
name: '实训录制',
handleClick: this.trainingRecord,
type: ''
}
}
/* {
name: this.$t('lesson.trainingRecord'),
handleClick: this.trainingRecord,
type: ''
}*/
]
}
],
actions: [
{ text: this.$t('lesson.generateTraining'), btnCode: 'employee_auto', handler: this.autoMaticTrainging },
{ text: this.$t('lesson.updateTraining'), btnCode: 'employee_edit', handler: this.editTrainingByType, type: 'warning'},
{ text: this.$t('lesson.deleteTraining'), btnCode: 'employee_delete', handler: this.delAutoMaticTrainging, type: 'danger'},
{ text: '添加实训', btnCode: 'employee_add', handler:this.addTraining, type: 'primary' }
{ text: this.$t('lesson.deleteTraining'), btnCode: 'employee_delete', handler: this.delAutoMaticTrainging, type: 'danger'}
/* { text: this.$t('lesson.addTraining'), btnCode: 'employee_add', handler: this.addingTraining, type: 'primary' }*/
]
},
@ -161,28 +161,28 @@ export default {
async created() {
await this.loadInitData();
const json = localStore.get(this.$route.path);
json.type = '';
json.prdCode = '';
json.operateType = '';
json.type = '';
json.prdCode = '';
json.operateType = '';
},
methods: {
async loadInitData() {
this.skinCodeList = [];
this.queryForm.queryObject.prdCode.config.data = [];
getSkinCodeList().then(response => {
this.skinCodeList = response.data;
});
getCommodityMapProduct(this.$route.params.skinCode).then((response) => {
const productList = response.data;
if (productList && productList.length > 0) {
productList.forEach(elem => {
//
if (elem.prdType != '03') {
this.queryForm.queryObject.prdCode.config.data.push({ value: elem.code, label: elem.name });
}
});
}
});
getSkinCodeList().then(response => {
this.skinCodeList = response.data;
});
getCommodityMapProduct(this.$route.params.skinCode).then((response) => {
const productList = response.data;
if (productList && productList.length > 0) {
productList.forEach(elem => {
//
if (elem.prdType != '03') {
this.queryForm.queryObject.prdCode.config.data.push({ value: elem.code, label: elem.name });
}
});
}
});
this.prdTypeList = [];
getProductList({ pageSize: 500, pageNum: 1 }).then(res => {
@ -242,6 +242,9 @@ export default {
delAutoMaticTrainging() {
this.$refs.draftTrain.show({ event: '03', title: this.$t('lesson.deleteAutoGeneratedTraining') });
},
// addingTraining() {
// this.$refs.draftTrain.show({ event: '04', title: this.$t('lesson.addTraining') });
// },
demoDisplay(index, node) {
trainingNotify({ trainingId: node.id }).then(resp => {
/** 区分演示和正式需要在演示时设置lessonId为0*/
@ -251,29 +254,25 @@ export default {
}).catch(error => {
this.$messageBox(this.$t('error.createSimulationFailed') +error.message);
});
},
reloadTable() {
this.queryList.reload();
},
turnback() {
this.$router.go(-1)
},
trainingRecord(index, node) {
trainingNotify({ trainingId: node.id }).then(resp => {
this.group = resp.data;
this.$router.push({ path: `${UrlConfig.design.trainingRecord}/${node.id}/${node.name}`, query: { group: resp.data } });
}).catch(error => {
this.$messageBox(`${this.$t('error.createSimulationFailed')}: ${error.message}`);
});
},
queryFunction(params) {
params['mapId'] = this.$route.query.mapId;
return pageQueryTraining(params);
},
addTraining() {
}
turnback() {
this.$router.go(-1);
},
trainingRecord(index, node) {
trainingNotify({ trainingId: node.id }).then(resp => {
this.group = resp.data;
this.$router.push({ path: `${UrlConfig.design.trainingRecord}/${node.id}/${node.name}`, query: { group: resp.data } });
}).catch(error => {
this.$messageBox(`${this.$t('error.createSimulationFailed')}: ${error.message}`);
});
},
queryFunction(params) {
params['mapId'] = this.$route.query.mapId;
return pageQueryTraining(params);
}
}
};
</script>

View File

@ -1,308 +0,0 @@
<template>
<el-dialog v-dialogDrag :title="operation.title" :visible.sync="dialogShow" width="30%" :before-close="close">
<el-form ref="form" :model="operateModel" label-width="120px" :rules="rules" size="mini">
<el-form-item :label="this.$t('lesson.trainingName')+':'" prop="name">
<el-input v-model="operateModel.name" />
</el-form-item>
<el-form-item :label="this.$t('lesson.productType')" prop="prdCode">
<el-select v-model="operateModel.prdCode" placeholder="" :disabled="true">
<el-option
v-for="option in productTypesList"
:key="option.code"
:label="option.name"
:value="option.code"
/>
</el-select>
</el-form-item>
<el-form-item :label="this.$t('lesson.trainingType')+':'" prop="type">
<el-select v-model="operateModel.type" placeholder="" :disabled="true">
<el-option
v-for="option in trainTypesList"
:key="option.code"
:label="option.name"
:value="option.code"
/>
</el-select>
</el-form-item>
<el-form-item :label="this.$t('lesson.operationType')+':'">
<el-select v-model="operateModel.operateType">
<el-option
v-for="(option, index) in operationList"
:key="index"
:label="option.name"
:value="option.code"
/>
</el-select>
</el-form-item>
<el-form-item :label="this.$t('lesson.minTime')" prop="minDuration">
<el-input-number v-model="operateModel.minDuration" :min="0" :max="10000" />s
</el-form-item>
<el-form-item :label="this.$t('lesson.maxTime')" prop="maxDuration">
<el-input-number v-model="operateModel.maxDuration" :min="0" :max="10000" />s
</el-form-item>
<el-form-item :label="this.$t('lesson.trainingDescription')" prop="remarks">
<el-input
v-model="operateModel.remarks"
type="textarea"
:autosize="{ minRows: 4, maxRows: 4}"
:placeholder="this.$t('rules.pleaseEnterContent')"
/>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose">{{$t('global.cancel')}}</el-button>
<el-button type="primary" @click="handleDeal">{{$t('global.confirm')}}</el-button>
</span>
</el-dialog>
</template>
<script>
import { addTraining, updateTraining, getTrainingDetail } from '@/api/jmap/training';
import localStore from 'storejs';
export default {
name: 'TreeDraft',
props: {
node: {
type: Object,
required: true
}
},
data() {
var minDurations = (rule, value, callback) => {
if (!value) {
return callback(new Error(this.$t('rules.enterStandardTime')));
}
setTimeout(() => {
if (!Number.isInteger(value)) {
callback(new Error(this.$t('rules.enterNumericValue')));
} else {
callback();
}
}, 100);
};
var maxDurations = (rule, value, callback) => {
if (!value) {
return callback(new Error(this.$t('rules.enterStandardTime')));
}
setTimeout(() => {
if (!Number.isInteger(value)) {
callback(new Error(this.$t('rules.enterNumericValue')));
} else {
if (value < this.operateModel.minDuration) {
callback(new Error(this.$t('rules.greaterThanMinTime')));
} else {
callback();
}
}
}, 100);
};
return {
dialogShow: false,
productTypesList: [],
trainTypesList: [],
operationList: [],
trainingOperateTypeMap: {},
operation: {
title: '',
event: ''
},
operateModel: {
id: '',
name: '',
type: '',
prdCode: '',
skinCode: '',
operateType: '',
maxDuration: 0,
minDuration: 0,
remarks: ''
},
rules: {
name: [
{ required: true, message: this.$t('rules.inputTrainingName'), trigger: 'change' }
],
minDuration: [
{ required: true, validator: minDurations, trigger: 'blur' }
],
maxDuration: [
{ required: true, validator: maxDurations, trigger: 'blur' }
],
remarks: [
{ required: true, message: this.$t('rules.inputTrainingRemark'), trigger: 'change' }
]
}
};
},
computed: {
},
watch: {
node: function (val, old) {
this.initLoadData();
}
},
mounted() {
this.$Dictionary.trainingType().then(list => {
this.trainTypesList = list;
});
this.operationList = [];
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; //
});
},
methods: {
initLoadData() {
const node = this.node;
if (this.$refs && this.$refs.form) {
this.$refs['form'].resetFields();
}
if (node && node.data) {
switch (node.data.type) {
case 'trainingType':
if (node.parent) {
this.operateModel.type = node.data.id;
this.operateModel.prdCode = node.parent.data.id;
this.operateModel.skinCode = node.parent.parent.data.id;
this.productTypesList = [{
code: node.parent.data.id,
name: node.parent.data.name
}];
}
this.operateModel.id = '';
this.operateModel.name = '';
this.operateModel.minDuration = '';
this.operateModel.maxDuration = '';
this.operateModel.remarks = '';
this.operateModel.operateType = '';
this.operationList = this.trainingOperateTypeMap[node.data.id] || [];
break;
case 'training':
if (node.parent && node.parent.parent) {
this.operateModel.type = node.parent.data.id;
this.operateModel.prdCode = node.parent.parent.data.id;
this.operateModel.skinCode = node.parent.parent.parent.data.id;
this.operationList = this.trainingOperateTypeMap[node.parent.data.id] || [];
this.productTypesList = [{
code: node.parent.parent.data.id,
name: node.parent.parent.data.name
}];
}
this.operateModel.id = node.data.id;
this.operateModel.name = node.data.name;
getTrainingDetail(node.data.id).then(response => {
this.operateModel.minDuration = response.data.minDuration;
this.operateModel.maxDuration = response.data.maxDuration;
this.operateModel.operateType = response.data.operateType;
this.operateModel.remarks = response.data.remarks;
}).catch(() => {
this.$messageBox(this.$t('error.obtainStepDataFailed'));
});
break;
}
}
},
show(data) {
this.operation = data;
this.initLoadData();
this.dialogShow = true;
},
close() {
this.dialogShow = false;
},
handleDeal() {
const operation = this.operation;
if (operation) {
const event = operation.event;
switch (event) {
case '01': this.addTraining(); break;
case '02': this.edtTraining(); break;
}
}
},
handleClose() {
this.dialogShow = false;
this.operateModel = {
id: '',
name: '',
type: '',
prdCode: '',
skinCode: '',
operateType: '',
maxDuration: 0,
minDuration: 0,
remarks: ''
};
this.$refs['form'].resetFields();
},
addTraining() {
this.$refs.form.validate((valid) => {
if (valid) {
const data = {
name: this.operateModel.name,
type: this.operateModel.type,
prdCode: this.operateModel.prdCode,
skinCode: this.operateModel.skinCode,
operateType: this.operateModel.operateType,
minDuration: this.operateModel.minDuration,
maxDuration: this.operateModel.maxDuration,
remarks: this.operateModel.remarks
};
addTraining(data).then(response => {
this.$emit('refresh', [localStore.get('cityCode') || '', localStore.get('skinCode') || '']);
this.close();
this.$message.success(this.$t('tip.addTrainingSuccessfully'));
}).catch(() => {
this.$messageBox(this.$t('tip.addTrainingFailed'));
});
}
});
},
edtTraining() {
this.$refs.form.validate((valid) => {
if (valid) {
const data = {
id: this.operateModel.id,
name: this.operateModel.name,
type: this.operateModel.type,
prdCode: this.operateModel.prdCode,
skinCode: this.operateModel.skinCode,
operateType: this.operateModel.operateType,
minDuration: this.operateModel.minDuration,
maxDuration: this.operateModel.maxDuration,
remarks: this.operateModel.remarks
};
updateTraining(data).then(response => {
this.$emit('refresh', [localStore.get('cityCode') || '', localStore.get('skinCode') || '']);
this.close();
this.$message.success(this.$t('tip.updateTrainingSuccessfully'));
}).catch(() => {
this.$messageBox(this.$t('tip.updateTrainingFailed'));
});
}
});
}
}
};
</script>

View File

@ -1,7 +1,7 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" />
<training-draft ref="draft" :node="node" @refresh="refresh" />
<!--<training-draft ref="draft" :node="node" @refresh="refresh" />-->
</div>
</template>
@ -9,13 +9,13 @@
import { DeviceMenu } from '@/scripts/ConstDic';
import { launchFullscreen } from '@/utils/screen';
import PopMenu from '@/components/PopMenu';
import TrainingDraft from './draft';
// import TrainingDraft from '../../draft';
export default {
name: 'TrainingOperateMenu',
components: {
PopMenu,
TrainingDraft
// TrainingDraft
},
props: {
point: {

View File

@ -86,12 +86,12 @@ export default {
},
clickEvent(obj, node, data) {
this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null });
if (obj && obj.type === 'training') {
if (obj && obj.type === 'Training') {
this.$emit('selectMapSure', obj);
}
},
showContextMenu(e, obj, node, vueElem) {
if (obj && obj.type === 'trainingType' || obj.type === 'training') {
if (obj && obj.type === 'TrainingType' || obj.type === 'Training') {
e.preventDefault();
this.point = {
x: e.clientX,
@ -103,7 +103,7 @@ export default {
}
},
getParent(node) {
while (node && node.data.type != 'skin') {
while (node && node.data.type != 'Skin') {
node = node.parent;
}

View File

@ -1,150 +1,150 @@
<template>
<el-card v-loading="loading" class="map-list-main">
<div slot="header" class="clearfix">
<span>{{ $t(`lesson.trainingList`) }}</span>
<el-card v-loading="loading" class="map-list-main">
<div slot="header" class="clearfix">
<span>{{ $t(`lesson.trainingList`) }}</span>
</div>
<div style="{width: 150px}">
<el-input v-model="filterText" :placeholder="$t(`lesson.filterPlaceholder`)" clearable />
</div>
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: (height-270) +'px' }">
<el-tree
ref="tree"
:data="treeData"
:props="defaultProps"
node-key="id"
:default-expanded-keys="defaultShowKeys"
:filter-node-method="filterNode"
expand-on-click-node
highlight-current
:span="22"
@node-contextmenu="showContextMenu"
@node-click="clickEvent"
>
<div slot-scope="{ node: nodeScop }">
<span v-if="nodeScop.data.type == 'skin'" class="el-icon-news">&nbsp;{{ nodeScop.label }}</span>
<span v-else-if="nodeScop.data.type == 'prd'" class="el-icon-tickets">&nbsp;{{ nodeScop.label }}</span>
<span
v-else-if="nodeScop.data.type == 'trainingType'"
class="el-icon-document"
>&nbsp;{{ nodeScop.label }}</span>
<span
v-else-if="nodeScop.data.type == 'training'"
class="el-icon-edit-outline"
>&nbsp;{{ nodeScop.label }}</span>
</div>
<div style="{width: 150px}">
<el-input v-model="filterText" :placeholder="$t(`lesson.filterPlaceholder`)" clearable />
</div>
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: (height-270) +'px' }">
<el-tree
ref="tree"
:data="treeData"
:props="defaultProps"
node-key="id"
:default-expanded-keys="defaultShowKeys"
:filter-node-method="filterNode"
expand-on-click-node
highlight-current
:span="22"
@node-contextmenu="showContextMenu"
@node-click="clickEvent"
>
<div slot-scope="{ node: nodeScop }">
<span v-if="nodeScop.data.type == 'skin'" class="el-icon-news">&nbsp;{{ nodeScop.label }}</span>
<span v-else-if="nodeScop.data.type == 'prd'" class="el-icon-tickets">&nbsp;{{ nodeScop.label }}</span>
<span
v-else-if="nodeScop.data.type == 'trainingType'"
class="el-icon-document"
>&nbsp;{{ nodeScop.label }}</span>
<span
v-else-if="nodeScop.data.type == 'training'"
class="el-icon-edit-outline"
>&nbsp;{{ nodeScop.label }}</span>
</div>
</el-tree>
</el-scrollbar>
<operate-menu ref="menu" :point="point" :node="node" @refresh="refresh" @trainingShow="trainingShow" />
</el-card>
</el-tree>
</el-scrollbar>
<operate-menu ref="menu" :point="point" :node="node" @refresh="refresh" @trainingShow="trainingShow" />
</el-card>
</template>
<script>
import { DeviceMenu } from '@/scripts/ConstDic';
import { getTrainingTree } from '@/api/jmap/training';
import { trainingNotify } from '@/api/simulation';
import OperateMenu from './category/operateMenu';
import { UrlConfig } from '@/router/index';
import localStore from 'storejs';
import { DeviceMenu } from '@/scripts/ConstDic';
import { getTrainingTree } from '@/api/jmap/training';
import { trainingNotify } from '@/api/simulation';
import OperateMenu from './category/operateMenu';
import { UrlConfig } from '@/router/index';
import localStore from 'storejs';
export default {
name: 'TrainingOperate',
components: {
OperateMenu
},
data() {
return {
loading: true,
defaultShowKeys: [],
filterText: '',
treeData: [],
defaultProps: {
children: 'children',
label: 'name'
},
point: {
x: 0,
y: 0
},
node: {
}
};
},
watch: {
filterText(val) {
this.$refs.tree.filter(val);
}
},
computed: {
height() {
return this.$store.state.app.height - 50;
}
},
mounted() {
this.refresh();
},
methods: {
filterNode(value, data) {
if (!value) return true;
return data.name.indexOf(value) !== -1;
},
clickEvent(obj, node, data) {
this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null });
if (obj && obj.type === 'training') {
this.resize();
trainingNotify({ trainingId: obj.id }).then(resp => {
this.group = resp.data;
this.$router.push({ path: `${UrlConfig.design.lessonTraining}/${obj.id}/${obj.name}`, query: { group: resp.data } });
}).catch(error => {
this.$messageBox(`${this.$t('error.createSimulationFailed')}: ${error.message}`);
});
}
},
showContextMenu(e, obj, node, vueElem) {
if (obj && obj.type === 'trainingType' || obj.type === 'training') {
e.preventDefault();
this.point = {
x: e.clientX,
y: e.clientY
};
this.node = node;
const menu = DeviceMenu.Training;
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu });
}
},
getParent(node) {
while (node && node.data.type != 'skin') {
node = node.parent;
}
export default {
name: 'TrainingOperate',
components: {
OperateMenu
},
data() {
return {
loading: true,
defaultShowKeys: [],
filterText: '',
treeData: [],
defaultProps: {
children: 'children',
label: 'name'
},
point: {
x: 0,
y: 0
},
node: {
}
};
},
computed: {
height() {
return this.$store.state.app.height - 50;
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val);
}
},
mounted() {
this.refresh();
},
methods: {
filterNode(value, data) {
if (!value) return true;
return data.name.indexOf(value) !== -1;
},
clickEvent(obj, node, data) {
this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null });
if (obj && obj.type === 'Training') {
this.resize();
trainingNotify({ trainingId: obj.id }).then(resp => {
this.group = resp.data;
this.$router.push({ path: `${UrlConfig.design.lessonTraining}/${obj.id}/${obj.name}`, query: { group: resp.data } });
}).catch(error => {
this.$messageBox(`${this.$t('error.createSimulationFailed')}: ${error.message}`);
});
}
},
showContextMenu(e, obj, node, vueElem) {
if (obj && obj.type === 'TrainingType' || obj.type === 'Training') {
e.preventDefault();
this.point = {
x: e.clientX,
y: e.clientY
};
this.node = node;
const menu = DeviceMenu.Training;
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu });
}
},
getParent(node) {
while (node && node.data.type != 'Skin') {
node = node.parent;
}
return node || {};
},
trainingShow() {
this.$emit('trainingStart', { id: this.node.data.id, lessonId: this.getParent(this.node).data.id });
},
refresh() {
this.loading = true;
getTrainingTree().then(response => {
this.treeData = response.data;
this.defaultShowKeys = [this.$route.params.trainingId];
this.$nextTick(() => {
this.loading = false;
this.$refs.tree.setCurrentKey(this.$route.params.trainingId); // value node-key
if (this.filterText) {
this.$refs.tree.filter(this.filterText);
}
});
}).catch(() => {
this.loading = false;
this.$messageBox(this.$t('error.refreshFailed'));
});
},
resize() {
this.widthLeft = Number(localStore.get('LeftWidth')) || this.widthLeft;
const width = this.$store.state.app.width - 521 - this.widthLeft;
const height = this.$store.state.app.height - 90;
this.$store.dispatch('config/resize', { width: width, height: height });
}
}
};
return node || {};
},
trainingShow() {
this.$emit('trainingStart', { id: this.node.data.id, lessonId: this.getParent(this.node).data.id });
},
refresh() {
this.loading = true;
getTrainingTree().then(response => {
this.treeData = response.data;
this.defaultShowKeys = [this.$route.params.trainingId];
this.$nextTick(() => {
this.loading = false;
this.$refs.tree.setCurrentKey(this.$route.params.trainingId); // value node-key
if (this.filterText) {
this.$refs.tree.filter(this.filterText);
}
});
}).catch(() => {
this.loading = false;
this.$messageBox(this.$t('error.refreshFailed'));
});
},
resize() {
this.widthLeft = Number(localStore.get('LeftWidth')) || this.widthLeft;
const width = this.$store.state.app.width - 521 - this.widthLeft;
const height = this.$store.state.app.height - 90;
this.$store.dispatch('config/resize', { width: width, height: height });
}
}
};
</script>
<style>

View File

@ -9,7 +9,7 @@
/>
</div>
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
<div class="mapContext">
<div>
<router-view />
</div>
</div>
@ -100,9 +100,4 @@ export default {
float: left;
width: 350px;
}
.mapContext {
float: right;
width: auto;
}
</style>

View File

@ -44,12 +44,12 @@ export default {
trainingId() {
return this.$route.params.trainingId;
},
width() {
return this.$store.state.app.width - 481 - this.widthLeft;
},
height() {
return this.$store.state.app.height - 90;
}
width() {
return this.$store.state.app.width - 481 - this.widthLeft;
},
height() {
return this.$store.state.app.height - 90;
}
},
watch: {
$route(newVal) {
@ -120,7 +120,7 @@ export default {
.blockContext {
// float: left;
height: 100%;
overflow: hidden;
overflow: hidden;
}
.mapContext {
@ -129,7 +129,7 @@ export default {
.stepContext {
float: right;
width: 520px;
width: 480px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
}
</style>

View File

@ -81,3 +81,4 @@ export default {
}
};
</script>

View File

@ -1,77 +1,81 @@
<template>
<div class="login-container" :style="{'background-image': 'url('+bgImg+')'}">
<div v-if="project" class="text-box">{{title}}</div>
<div class="content-box">
<div class="qrcode-main">
<div class="login-code-box" @click="loginRefresh">
<qrcode-vue
v-loading="loadingCode"
:value="loginUrl"
:class-name="qrcodeClassName"
:size="150"
element-loading-text="点击刷新"
element-loading-spinner="el-icon-refresh"
element-loading-background="rgba(255, 255, 255, 0.9)"
/>
</div>
<div class="login-tip">
<span class="sub-title">使用手机微信扫码登录</span>
</div>
<div class="tip-info">
<fieldset>
<legend>推荐配置</legend>
<span>浏览器
<div class="login-container" :style="{'background-image': 'url('+bgImg+')'}">
<div v-if="project" class="text-box">{{ title }}</div>
<div class="content-box">
<div class="qrcode-main">
<div class="login-code-box" @click="loginRefresh">
<qrcode-vue
v-loading="loadingCode"
:value="loginUrl"
:class-name="qrcodeClassName"
:size="150"
element-loading-text="点击刷新"
element-loading-spinner="el-icon-refresh"
element-loading-background="rgba(255, 255, 255, 0.9)"
/>
</div>
<div class="login-tip">
<span class="sub-title">使用手机微信扫码登录</span>
</div>
<div class="tip-info">
<fieldset>
<legend>推荐配置</legend>
<span>浏览器
<a href="https://www.google.cn/chrome/" target="_blank" style="text-decoration: underline;">谷歌浏览器</a>
</span>
<br>
<span>屏幕分辨率1920*1080</span>
</fieldset>
</div>
</div>
<br>
<span>屏幕分辨率1920*1080</span>
</fieldset>
</div>
</div>
<el-form ref="loginForm" class="login-form" :model="loginForm" :rules="loginRules" label-position="left">
<div class="title_box">欢迎登录城市轨道交通实训平台</div>
<el-form-item prop="username" class="item_form_box">
<el-form ref="loginForm" class="login-form" :model="loginForm" :rules="loginRules" label-position="left">
<div class="title_box">欢迎登录城市轨道交通实训平台</div>
<el-form-item prop="username" class="item_form_box">
<span class="svg-container svg-container_login">
<svg-icon icon-class="user" />
</span>
<el-input v-model="loginForm.username" name="username" type="text" placeholder="手机号/邮箱" />
</el-form-item>
<el-form-item prop="password" class="item_form_box item_form_password">
<el-input v-model="loginForm.username" name="username" type="text" placeholder="手机号/邮箱" />
</el-form-item>
<el-form-item prop="password" class="item_form_box item_form_password">
<span class="svg-container">
<svg-icon icon-class="password" />
</span>
<el-input
v-model="loginForm.password"
name="password"
:type="pwdType"
placeholder="密码"
@keyup.enter="handleLogin"
/>
<span class="show-pwd" @click="showPwd">
<svg-icon icon-class="eye" />
<el-input
v-model="loginForm.password"
name="password"
:type="pwdType"
placeholder="密码"
@keyup.enter="handleLogin"
/>
<span class="show-pwd" @click="showPwd">
<svg-icon icon-class="eye" v-if="pwdDisplay"/>
<svg-icon icon-class="eye-open" v-else/>
</span>
</el-form-item>
<div class="tip-message">{{ tipsMsg }}</div>
<el-popover
placement="right"
title=""
width="200"
trigger="hover"
content="请在琏课堂小程序助手,完善个人信息,设置登录密码,手机号或邮箱。"
class="popover_box"
>
<div slot="reference">无法登录?</div>
</el-popover>
<el-form-item>
<el-button type="primary" style="width:100%;" :loading="loading" @click.native.prevent="handleLogin">
登录
</el-button>
</el-form-item>
</el-form>
</el-form-item>
<div class="tip-message">{{ tipsMsg }}</div>
<el-popover
placement="right"
title=""
width="200"
trigger="hover"
class="popover_box"
>
<div>
<img :src="QCode" alt="" style="width: 100px; height: 100px; display: block; margin:0 auto;">
<div style="margin-top: 10px;">请在琏课堂小程序助手完善个人信息设置登录密码手机号或邮箱</div>
</div>
<div slot="reference">无法登录?</div>
</el-popover>
<el-form-item>
<el-button type="primary" style="width:100%;" :loading="loading" @click.native.prevent="handleLogin">
登录
</el-button>
</el-form-item>
</el-form>
</div>
</div>
</div>
</template>
<script>
@ -87,10 +91,11 @@ import { LoginParams } from '@/utils/login';
import bgImg from '@/assets/bg1.jpg';
import { setToken } from '@/utils/auth';
import { loginTitle } from '@/scripts/ConstDic';
import QCode from '@/assets/erCode.jpg';
export default {
name: 'Login',
components: { QrcodeVue },
components: { QrcodeVue },
data() {
const validateUsername = (rule, value, callback) => {
if (value.length < 5) {
@ -107,7 +112,8 @@ export default {
}
};
return {
bgImg: bgImg,
bgImg: bgImg,
QCode: QCode,
loginForm: {
username: '',
password: ''
@ -119,93 +125,96 @@ export default {
loading: false,
pwdType: 'password',
tipsMsg: '',
qrcodeClassName: 'login-qrcode',
sessionId: '',
loginUrl: '',
loadingCode: false,
checkLogin: null,
checkTimeout: null,
scanSuccess: false
qrcodeClassName: 'login-qrcode',
sessionId: '',
loginUrl: '',
loadingCode: false,
checkLogin: null,
checkTimeout: null,
scanSuccess: false,
pwdDisplay:true
};
},
mounted() {
document.title = loginTitle[this.$route.params.project||'default'];
this.loginRefresh();
computed: {
project() {
return this.$route.params.project;
},
title() {
return loginTitle[this.$route.params.project||'default'];
}
},
mounted() {
document.title = loginTitle[this.$route.params.project||'default'];
this.loginRefresh();
},
computed: {
project() {
return this.$route.params.project;
},
title() {
return loginTitle[this.$route.params.project||'default'];
}
},
methods: {
clearTimer(timer) {
if (timer) {
clearTimeout(timer);
timer = null;
}
},
loginRefresh() {
this.loadingCode = true;
getLoginWmurl(LoginParams.LianKeTang).then(response => {
this.sessionId = response.data.sessionId;
this.loginUrl = response.data.url;
this.loadingCode = false;
this.clearTimer(this.checkTimeout);
this.checkTimeout = setTimeout(() => {
this.loadingCode = true;
this.loginUrl = '';
}, 3 * 60 * 1000);
this.checkLoginStatus();
}).catch((error) => {
console.log(error);
this.loadingCode = false;
this.$messageBox('获取登录二维码失败,请刷新重试');
});
},
checkLoginStatus() {
const self = this;
clearTimer(timer) {
if (timer) {
clearTimeout(timer);
timer = null;
}
},
loginRefresh() {
this.loadingCode = true;
getLoginWmurl(LoginParams.LianKeTang).then(response => {
this.sessionId = response.data.sessionId;
this.loginUrl = response.data.url;
this.loadingCode = false;
this.clearTimer(this.checkTimeout);
this.checkTimeout = setTimeout(() => {
this.loadingCode = true;
this.loginUrl = '';
}, 3 * 60 * 1000);
this.checkLoginStatus();
}).catch((error) => {
console.log(error);
this.loadingCode = false;
this.$messageBox('获取登录二维码失败,请刷新重试');
});
},
checkLoginStatus() {
const self = this;
//
if (this && this._isDestroyed) {
return;
}
//
if (this && this._isDestroyed) {
return;
}
//
//
this.clearTimer(this.checkLogin);
this.checkLogin = setTimeout(() => {
checkLoginStatus(self.sessionId).then(response => {
setToken(response.data.token);
//
self.$store.dispatch('QrLoginSetting', { key: 'SET_TOKEN', value: response.data.token }).then(() => {
//
self.clearTimer(self.checkLogin);
let path = '/login';
if (project) {
path = path + '/' + project;
}
self.$router.push({ path: path });
self.$nextTick(() => {
self.$i18n.locale = 'zh';
Cookies.set('user_lang', 'zh');
});
});
}).catch(error => {
if (error.data && error.data.status == '1') {
self.scanSuccess = true;
}
self.checkLoginStatus();
});
}, 3000);
},
//
//
this.clearTimer(this.checkLogin);
this.checkLogin = setTimeout(() => {
checkLoginStatus(self.sessionId).then(response => {
setToken(response.data.token);
//
self.$store.dispatch('QrLoginSetting', { key: 'SET_TOKEN', value: response.data.token }).then(() => {
//
self.clearTimer(self.checkLogin);
let path = '/login';
if (this.project) {
path = path + '/' + this.project;
}
self.$router.push({ path: path });
self.$nextTick(() => {
self.$i18n.locale = 'zh';
Cookies.set('user_lang', 'zh');
});
});
}).catch(error => {
if (error.data && error.data.status == '1') {
self.scanSuccess = true;
}
self.checkLoginStatus();
});
}, 3000);
},
showPwd() {
if (this.pwdType === 'password') {
if (this.pwdType === 'password') {
this.pwdDisplay=false;
this.pwdType = '';
} else {
this.pwdType = 'password';
this.pwdType = 'password';
this.pwdDisplay=true;
}
},
handleLogin() {
@ -214,24 +223,24 @@ export default {
const model = Object.assign({}, this.loginForm);
model.password = md5(model.password);
model.type = 'class';
model.project = this.$route.params.project;
model.project = this.$route.params.project;
this.loading = true;
removeSessionStorage('againEnter');
removeSessionStorage('againEnter');
this.$store.dispatch('Login', model).then(() => {
this.$store.dispatch('GetUserConfigInfo');
this.$store.dispatch('SetAccount', model.username);
this.$store.dispatch('SetAccount', model.username);
//
this.loading = false;
this.tipsMsg = '';
let path = localStore.get('trainingPlatformRoute'+model.username);
if (!path || !path.startsWith('/trainingPlatform')) {
path = UrlConfig.trainingPlatform.trainingPlatformHome;
}
this.$nextTick(() => {
this.$i18n.locale = 'zh';
Cookies.set('user_lang', 'zh');
});
this.$router.push({ path: path });
path = UrlConfig.trainingPlatform.trainingPlatformHome;
}
this.$nextTick(() => {
this.$i18n.locale = 'zh';
Cookies.set('user_lang', 'zh');
});
this.$router.push({ path: path });
}).catch(error => {
this.tipsMsg = error.message;
this.loading = false;
@ -276,7 +285,6 @@ export default {
}
}
.item_form_box {
border: 1px solid #ccc;
border-radius: 5px;

View File

@ -1,81 +1,84 @@
<template>
<div class="login-container" :style="{'background-image': 'url('+bgImg+')'}">
<div class="content-box">
<div class="qrcode-main">
<div class="login-code-box" @click="loginRefresh">
<qrcode-vue
v-loading="loadingCode"
:value="loginUrl"
:class-name="qrcodeClassName"
:size="150"
element-loading-text="点击刷新"
element-loading-spinner="el-icon-refresh"
element-loading-background="rgba(255, 255, 255, 0.9)"
/>
</div>
<div class="login-tip">
<span class="sub-title">使用手机微信扫码登录</span>
</div>
<div class="tip-info">
<fieldset>
<legend>推荐配置</legend>
<span>浏览器
<div class="login-container" :style="{'background-image': 'url('+bgImg+')'}">
<div class="content-box">
<div class="qrcode-main">
<div class="login-code-box" @click="loginRefresh">
<qrcode-vue
v-loading="loadingCode"
:value="loginUrl"
:class-name="qrcodeClassName"
:size="150"
element-loading-text="点击刷新"
element-loading-spinner="el-icon-refresh"
element-loading-background="rgba(255, 255, 255, 0.9)"
/>
</div>
<div class="login-tip">
<span class="sub-title">使用手机微信扫码登录</span>
</div>
<div class="tip-info">
<fieldset>
<legend>推荐配置</legend>
<span>浏览器
<a href="https://www.google.cn/chrome/" target="_blank" style="text-decoration: underline;">谷歌浏览器</a>
</span>
<br>
<span>屏幕分辨率1920*1080</span>
</fieldset>
</div>
</div>
<br>
<span>屏幕分辨率1920*1080</span>
</fieldset>
</div>
</div>
<el-form ref="loginForm" class="login-form" :model="loginForm" :rules="loginRules" label-position="left">
<div class="title_box">欢迎登录城市轨道交通设计平台</div>
<el-form-item prop="username" class="item_form_box">
<el-form ref="loginForm" class="login-form" :model="loginForm" :rules="loginRules" label-position="left">
<div class="title_box">欢迎登录城市轨道交通设计平台</div>
<el-form-item prop="username" class="item_form_box">
<span class="svg-container svg-container_login">
<svg-icon icon-class="user" />
</span>
<el-input v-model="loginForm.username" name="username" type="text" placeholder="Mobile phone number/email" />
</el-form-item>
<el-form-item prop="password" class="item_form_box item_form_password">
<el-input v-model="loginForm.username" name="username" type="text" placeholder="Mobile phone number/email" />
</el-form-item>
<el-form-item prop="password" class="item_form_box item_form_password">
<span class="svg-container">
<svg-icon icon-class="password" />
</span>
<el-input
v-model="loginForm.password"
name="password"
:type="pwdType"
placeholder="密码"
@keyup.enter="handleLogin"
/>
<span class="show-pwd" @click="showPwd">
<svg-icon icon-class="eye" />
<el-input
v-model="loginForm.password"
name="password"
:type="pwdType"
placeholder="密码"
@keyup.enter="handleLogin"
/>
<span class="show-pwd" @click="showPwd">
<svg-icon icon-class="eye" v-if="pwdDisplay"/>
<svg-icon icon-class="eye-open" v-else/>
</span>
</el-form-item>
<div class="tip-message">{{ tipsMsg }}</div>
<el-popover
placement="right"
title=""
width="200"
trigger="hover"
content="请在琏课堂小程序助手,完善个人信息,设置登录密码,手机号或邮箱。"
class="popover_box"
>
<div slot="reference">无法登录?</div>
</el-popover>
<el-form-item>
<el-button type="primary" style="width:100%;" :loading="loading" @click.native.prevent="handleLogin">
登录
</el-button>
</el-form-item>
</el-form>
</el-form-item>
<div class="tip-message">{{ tipsMsg }}</div>
<el-popover
placement="right"
title=""
width="200"
trigger="hover"
class="popover_box"
>
<div>
<img :src="QCode" alt="" style="width: 100px; height: 100px; display: block; margin:0 auto;">
<div style="margin-top: 10px;">请在琏课堂小程序助手完善个人信息设置登录密码手机号或邮箱</div>
</div>
<div slot="reference">无法登录?</div>
</el-popover>
<el-form-item>
<el-button type="primary" style="width:100%;" :loading="loading" @click.native.prevent="handleLogin">
登录
</el-button>
</el-form-item>
</el-form>
</div>
</div>
</div>
</template>
<script>
import { UrlConfig } from '@/router/index';
import { setSessionStorage,removeSessionStorage } from '@/utils/auth';
import md5 from 'js-md5';
import Cookies from 'js-cookie';
import QrcodeVue from 'qrcode.vue';
@ -83,10 +86,11 @@ import { getLoginWmurl, checkLoginStatus } from '@/api/login';
import { LoginParams } from '@/utils/login';
import bgImg from '@/assets/bg1.jpg';
import { setDesignToken } from '@/utils/auth';
import QCode from '@/assets/erCode.jpg';
export default {
name: 'LoginDesign',
components: { QrcodeVue },
components: { QrcodeVue },
data() {
const validateUsername = (rule, value, callback) => {
if (value.length < 5) {
@ -103,7 +107,7 @@ export default {
}
};
return {
bgImg: bgImg,
bgImg: bgImg,
loginForm: {
username: '',
password: ''
@ -113,83 +117,87 @@ export default {
password: [{ required: true, trigger: 'blur', validator: validatePass }]
},
loading: false,
pwdType: 'password',
pwdType: 'password',
QCode: QCode,
tipsMsg: '',
qrcodeClassName: 'login-qrcode',
sessionId: '',
loginUrl: '',
loadingCode: false,
checkLogin: null,
checkTimeout: null,
scanSuccess: false
qrcodeClassName: 'login-qrcode',
sessionId: '',
loginUrl: '',
loadingCode: false,
checkLogin: null,
checkTimeout: null,
scanSuccess: false,
pwdDisplay:true
};
},
mounted() {
document.title = '城市轨道交通设计平台';
this.loginRefresh();
this.loginRefresh();
},
methods: {
clearTimer(timer) {
if (timer) {
clearTimeout(timer);
timer = null;
}
},
loginRefresh() {
this.loadingCode = true;
getLoginWmurl(LoginParams.Design).then(response => {
this.sessionId = response.data.sessionId;
this.loginUrl = response.data.url;
this.loadingCode = false;
this.clearTimer(this.checkTimeout);
this.checkTimeout = setTimeout(() => {
this.loadingCode = true;
this.loginUrl = '';
}, 3 * 60 * 1000);
this.checkLoginStatus();
}).catch((error) => {
console.log(error);
this.loadingCode = false;
this.$messageBox('获取登录二维码失败,请刷新重试');
});
},
checkLoginStatus() {
const self = this;
clearTimer(timer) {
if (timer) {
clearTimeout(timer);
timer = null;
}
},
loginRefresh() {
this.loadingCode = true;
getLoginWmurl(LoginParams.Design).then(response => {
this.sessionId = response.data.sessionId;
this.loginUrl = response.data.url;
this.loadingCode = false;
this.clearTimer(this.checkTimeout);
this.checkTimeout = setTimeout(() => {
this.loadingCode = true;
this.loginUrl = '';
}, 3 * 60 * 1000);
this.checkLoginStatus();
}).catch((error) => {
console.log(error);
this.loadingCode = false;
this.$messageBox('获取登录二维码失败,请刷新重试');
});
},
checkLoginStatus() {
const self = this;
//
if (this && this._isDestroyed) {
return;
}
//
if (this && this._isDestroyed) {
return;
}
//
//
this.clearTimer(this.checkLogin);
this.checkLogin = setTimeout(() => {
checkLoginStatus(self.sessionId).then(response => {
setDesignToken(response.data.token);
//
self.$store.dispatch('QrLoginSetting', { key: 'SET_TOKENDESIGN', value: response.data.token }).then(() => {
//
self.clearTimer(self.checkLogin);
self.$router.push({ path: '/design/login' });
self.$nextTick(() => {
self.$i18n.locale = 'zh';
Cookies.set('user_lang', 'zh');
});
});
}).catch(error => {
if (error.data && error.data.status == '1') {
self.scanSuccess = true;
}
self.checkLoginStatus();
});
}, 3000);
},
//
//
this.clearTimer(this.checkLogin);
this.checkLogin = setTimeout(() => {
checkLoginStatus(self.sessionId).then(response => {
setDesignToken(response.data.token);
//
self.$store.dispatch('QrLoginSetting', { key: 'SET_TOKENDESIGN', value: response.data.token }).then(() => {
//
self.clearTimer(self.checkLogin);
self.$router.push({ path: '/design/login' });
self.$nextTick(() => {
self.$i18n.locale = 'zh';
Cookies.set('user_lang', 'zh');
});
});
}).catch(error => {
if (error.data && error.data.status == '1') {
self.scanSuccess = true;
}
self.checkLoginStatus();
});
}, 3000);
},
showPwd() {
if (this.pwdType === 'password') {
this.pwdDisplay=false;
this.pwdType = '';
} else {
this.pwdType = 'password';
this.pwdType = 'password';
this.pwdDisplay=true;
}
},
handleLogin() {
@ -197,19 +205,19 @@ export default {
if (valid) {
const model = Object.assign({}, this.loginForm);
model.password = md5(model.password);
// model.type = 'plan';
model.type = 'design';
// model.type = 'plan';
model.type = 'design';
this.loading = true;
this.$store.dispatch('Login', model).then(() => {
this.$store.dispatch('GetUserConfigInfo');
this.$store.dispatch('GetUserConfigInfo');
//
this.loading = false;
this.tipsMsg = '';
this.$nextTick(() => {
this.$i18n.locale = 'zh';
Cookies.set('user_lang', 'zh');
});
this.$nextTick(() => {
this.$i18n.locale = 'zh';
Cookies.set('user_lang', 'zh');
});
this.$router.push({ path: `${UrlConfig.design.prefix}` });
}).catch(error => {
this.tipsMsg = error.message;
@ -256,7 +264,6 @@ export default {
}
}
.item_form_box {
border: 1px solid #ccc;
border-radius: 5px;
@ -385,4 +392,3 @@ export default {
}
</style>

View File

@ -1,250 +1,253 @@
<template>
<div class="login-container" :style="{'background-image': 'url('+bgImg+')'}">
<div v-if="project" class="text-box">{{title}}</div>
<div class="login-container" :style="{'background-image': 'url('+bgImg+')'}">
<div v-if="project" class="text-box">{{ title }}</div>
<div class="content-box">
<div class="qrcode-main">
<div class="login-code-box" @click="loginRefresh">
<qrcode-vue
v-loading="loadingCode"
:value="loginUrl"
:class-name="qrcodeClassName"
:size="150"
element-loading-text="Click the refresh"
element-loading-spinner="el-icon-refresh"
element-loading-background="rgba(255, 255, 255, 0.9)"
/>
</div>
<div class="login-tip">
<span class="sub-title">Log in using mobile phone WeChat scan code</span>
</div>
<div class="tip-info">
<fieldset>
<legend>The recommended configuration</legend>
<span>browser:
<div class="content-box">
<div class="qrcode-main">
<div class="login-code-box" @click="loginRefresh">
<qrcode-vue
v-loading="loadingCode"
:value="loginUrl"
:class-name="qrcodeClassName"
:size="150"
element-loading-text="Click the refresh"
element-loading-spinner="el-icon-refresh"
element-loading-background="rgba(255, 255, 255, 0.9)"
/>
</div>
<div class="login-tip">
<span class="sub-title">Log in using mobile phone WeChat scan code</span>
</div>
<div class="tip-info">
<fieldset>
<legend>The recommended configuration</legend>
<span>browser:
<a href="https://www.google.cn/chrome/" target="_blank" style="text-decoration: underline;">Google Chrome</a>
</span>
<br>
<span>screen resolution1920*1080</span>
</fieldset>
</div>
</div>
<br>
<span>screen resolution1920*1080</span>
</fieldset>
</div>
</div>
<el-form ref="loginForm" class="login-form" :model="loginForm" :rules="loginRules" label-position="left">
<div class="title_box">Welcome to 城市轨道交通实训平台</div>
<el-form-item prop="username" class="item_form_box">
<el-form ref="loginForm" class="login-form" :model="loginForm" :rules="loginRules" label-position="left">
<div class="title_box">Welcome to 城市轨道交通实训平台</div>
<el-form-item prop="username" class="item_form_box">
<span class="svg-container svg-container_login">
<svg-icon icon-class="user" />
</span>
<el-input v-model="loginForm.username" name="username" type="text" placeholder="Mobile phone number/email" />
</el-form-item>
<el-form-item prop="password" class="item_form_box item_form_password">
<el-input v-model="loginForm.username" name="username" type="text" placeholder="Mobile phone number/email" />
</el-form-item>
<el-form-item prop="password" class="item_form_box item_form_password">
<span class="svg-container">
<svg-icon icon-class="password" />
</span>
<el-input
v-model="loginForm.password"
name="password"
:type="pwdType"
placeholder="password"
@keyup.enter="handleLogin"
/>
<span class="show-pwd" @click="showPwd">
<el-input
v-model="loginForm.password"
name="password"
:type="pwdType"
placeholder="password"
@keyup.enter="handleLogin"
/>
<span class="show-pwd" @click="showPwd">
<svg-icon icon-class="eye" />
</span>
</el-form-item>
<div class="tip-message">{{ tipsMsg }}</div>
<el-popover
placement="right"
title=""
width="200"
trigger="hover"
content="Please in lian classroom small program assistant, perfect personal information, set login password, mobile phone number or email."
class="popover_box"
>
<div slot="reference">unable to login?</div>
</el-popover>
<el-form-item>
<el-button type="primary" style="width:100%;" :loading="loading" @click.native.prevent="handleLogin">
login
</el-button>
</el-form-item>
</el-form>
</el-form-item>
<div class="tip-message">{{ tipsMsg }}</div>
<el-popover
placement="right"
title=""
width="200"
trigger="hover"
class="popover_box"
>
<div>
<img :src="QCode" alt="" style="width: 100px; height: 100px; display: block; margin:0 auto;">
<div style="margin-top: 10px;">Please in lian classroom small program assistant, perfect personal information, set login password, mobile phone number or email.</div>
</div>
<div slot="reference">unable to login?</div>
</el-popover>
<el-form-item>
<el-button type="primary" style="width:100%;" :loading="loading" @click.native.prevent="handleLogin">
login
</el-button>
</el-form-item>
</el-form>
</div>
</div>
</div>
</template>
<script>
import { removeSessionStorage } from '@/utils/auth';
import { UrlConfig } from '@/router/index';
import localStore from 'storejs';
import Cookies from 'js-cookie';
import md5 from 'js-md5';
import QrcodeVue from 'qrcode.vue';
import { getLoginWmurl, checkLoginStatus } from '@/api/login';
import { LoginParams } from '@/utils/login';
import bgImg from '@/assets/bg1.jpg';
import { setToken } from '@/utils/auth';
import { loginTitle } from '@/scripts/ConstDic';
import { removeSessionStorage } from '@/utils/auth';
import { UrlConfig } from '@/router/index';
import localStore from 'storejs';
import Cookies from 'js-cookie';
import md5 from 'js-md5';
import QrcodeVue from 'qrcode.vue';
import { getLoginWmurl, checkLoginStatus } from '@/api/login';
import { LoginParams } from '@/utils/login';
import bgImg from '@/assets/bg1.jpg';
import { setToken } from '@/utils/auth';
import { loginTitle } from '@/scripts/ConstDic';
export default {
name: 'Login',
components: { QrcodeVue },
data() {
const validateUsername = (rule, value, callback) => {
if (value.length < 5) {
callback(new Error('Please enter the correct user name'));
} else {
callback();
}
};
const validatePass = (rule, value, callback) => {
if (value.length < 5) {
callback(new Error('Password cannot be less than 5 digits'));
} else {
callback();
}
};
return {
bgImg: bgImg,
loginForm: {
username: '',
password: ''
},
loginRules: {
username: [{ required: true, trigger: 'blur', validator: validateUsername }],
password: [{ required: true, trigger: 'blur', validator: validatePass }]
},
loading: false,
pwdType: 'password',
tipsMsg: '',
qrcodeClassName: 'login-qrcode',
sessionId: '',
loginUrl: '',
loadingCode: false,
checkLogin: null,
checkTimeout: null,
scanSuccess: false
};
},
mounted() {
document.title = loginTitle[this.$route.params.project||'default'];
this.loginRefresh();
},
computed: {
project() {
return this.$route.params.project;
},
title() {
return loginTitle[this.$route.params.project||'default'];
}
},
methods: {
clearTimer(timer) {
if (timer) {
clearTimeout(timer);
timer = null;
}
},
loginRefresh() {
this.loadingCode = true;
getLoginWmurl(LoginParams.LianKeTang).then(response => {
this.sessionId = response.data.sessionId;
this.loginUrl = response.data.url;
this.loadingCode = false;
this.clearTimer(this.checkTimeout);
this.checkTimeout = setTimeout(() => {
this.loadingCode = true;
this.loginUrl = '';
}, 3 * 60 * 1000);
this.checkLoginStatus();
}).catch((error) => {
console.log(error);
this.loadingCode = false;
this.$messageBox('Failed to get login qr code, please refresh and try again');
});
},
checkLoginStatus() {
const self = this;
export default {
name: 'Login',
components: { QrcodeVue },
data() {
const validateUsername = (rule, value, callback) => {
if (value.length < 5) {
callback(new Error('Please enter the correct user name'));
} else {
callback();
}
};
const validatePass = (rule, value, callback) => {
if (value.length < 5) {
callback(new Error('Password cannot be less than 5 digits'));
} else {
callback();
}
};
return {
bgImg: bgImg,
loginForm: {
username: '',
password: ''
},
loginRules: {
username: [{ required: true, trigger: 'blur', validator: validateUsername }],
password: [{ required: true, trigger: 'blur', validator: validatePass }]
},
loading: false,
pwdType: 'password',
tipsMsg: '',
qrcodeClassName: 'login-qrcode',
sessionId: '',
loginUrl: '',
loadingCode: false,
checkLogin: null,
checkTimeout: null,
scanSuccess: false
};
},
computed: {
project() {
return this.$route.params.project;
},
title() {
return loginTitle[this.$route.params.project||'default'];
}
},
mounted() {
document.title = loginTitle[this.$route.params.project||'default'];
this.loginRefresh();
},
methods: {
clearTimer(timer) {
if (timer) {
clearTimeout(timer);
timer = null;
}
},
loginRefresh() {
this.loadingCode = true;
getLoginWmurl(LoginParams.LianKeTang).then(response => {
this.sessionId = response.data.sessionId;
this.loginUrl = response.data.url;
this.loadingCode = false;
this.clearTimer(this.checkTimeout);
this.checkTimeout = setTimeout(() => {
this.loadingCode = true;
this.loginUrl = '';
}, 3 * 60 * 1000);
this.checkLoginStatus();
}).catch((error) => {
console.log(error);
this.loadingCode = false;
this.$messageBox('Failed to get login qr code, please refresh and try again');
});
},
checkLoginStatus() {
const self = this;
//
if (this && this._isDestroyed) {
return;
}
//
if (this && this._isDestroyed) {
return;
}
//
//
this.clearTimer(this.checkLogin);
this.checkLogin = setTimeout(() => {
checkLoginStatus(self.sessionId).then(response => {
setToken(response.data.token);
//
self.$store.dispatch('QrLoginSetting', { key: 'SET_TOKEN', value: response.data.token }).then(() => {
//
self.clearTimer(self.checkLogin);
let path = '/en/login';
if (project) {
path = path + '/' + project;
}
self.$router.push({ path: path });
self.$nextTick(() => {
self.$i18n.locale = 'en';
Cookies.set('user_lang', 'en');
});
});
}).catch(error => {
if (error.data && error.data.status == '1') {
self.scanSuccess = true;
}
self.checkLoginStatus();
});
}, 3000);
},
showPwd() {
if (this.pwdType === 'password') {
this.pwdType = '';
} else {
this.pwdType = 'password';
}
},
handleLogin() {
this.$refs.loginForm.validate(valid => {
if (valid) {
const model = Object.assign({}, this.loginForm);
model.password = md5(model.password);
model.type = 'class';
model.project = this.$route.params.project;
this.loading = true;
removeSessionStorage('againEnter');
this.$store.dispatch('Login', model).then(() => {
this.$store.dispatch('GetUserConfigInfo');
this.$store.dispatch('SetAccount', model.username);
//
this.loading = false;
this.tipsMsg = '';
let path = localStore.get('trainingPlatformRoute'+model.username);
if (!path || !path.startsWith('/trainingPlatform')) {
path = UrlConfig.trainingPlatform.trainingPlatformHome;
}
this.$nextTick(() => {
this.$i18n.locale = 'en';
Cookies.set('user_lang', 'en');
});
this.$router.push({ path: path });
}).catch(error => {
this.tipsMsg = error.message;
this.loading = false;
setTimeout(() => { this.tipsMsg = ''; }, 5000);
});
} else {
console.log('error submit!!');
return false;
}
});
}
}
};
//
//
this.clearTimer(this.checkLogin);
this.checkLogin = setTimeout(() => {
checkLoginStatus(self.sessionId).then(response => {
setToken(response.data.token);
//
self.$store.dispatch('QrLoginSetting', { key: 'SET_TOKEN', value: response.data.token }).then(() => {
//
self.clearTimer(self.checkLogin);
let path = '/en/login';
if (this.project) {
path = path + '/' + this.project;
}
self.$router.push({ path: path });
self.$nextTick(() => {
self.$i18n.locale = 'en';
Cookies.set('user_lang', 'en');
});
});
}).catch(error => {
if (error.data && error.data.status == '1') {
self.scanSuccess = true;
}
self.checkLoginStatus();
});
}, 3000);
},
showPwd() {
if (this.pwdType === 'password') {
this.pwdType = '';
} else {
this.pwdType = 'password';
}
},
handleLogin() {
this.$refs.loginForm.validate(valid => {
if (valid) {
const model = Object.assign({}, this.loginForm);
model.password = md5(model.password);
model.type = 'class';
model.project = this.$route.params.project;
this.loading = true;
removeSessionStorage('againEnter');
this.$store.dispatch('Login', model).then(() => {
this.$store.dispatch('GetUserConfigInfo');
this.$store.dispatch('SetAccount', model.username);
//
this.loading = false;
this.tipsMsg = '';
let path = localStore.get('trainingPlatformRoute'+model.username);
if (!path || !path.startsWith('/trainingPlatform')) {
path = UrlConfig.trainingPlatform.trainingPlatformHome;
}
this.$nextTick(() => {
this.$i18n.locale = 'en';
Cookies.set('user_lang', 'en');
});
this.$router.push({ path: path });
}).catch(error => {
this.tipsMsg = error.message;
this.loading = false;
setTimeout(() => { this.tipsMsg = ''; }, 5000);
});
} else {
console.log('error submit!!');
return false;
}
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss">
@ -276,7 +279,6 @@
}
}
.item_form_box {
border: 1px solid #ccc;
border-radius: 5px;

View File

@ -1,229 +1,232 @@
<template>
<div class="login-container" :style="{'background-image': 'url('+bgImg+')'}">
<div class="content-box">
<div class="qrcode-main">
<div class="login-code-box" @click="loginRefresh">
<qrcode-vue
v-loading="loadingCode"
:value="loginUrl"
:class-name="qrcodeClassName"
:size="150"
element-loading-text="Click the refresh"
element-loading-spinner="el-icon-refresh"
element-loading-background="rgba(255, 255, 255, 0.9)"
/>
</div>
<div class="login-tip">
<span class="sub-title">Log in using mobile phone WeChat scan code</span>
</div>
<div class="tip-info">
<fieldset>
<legend>The recommended configuration</legend>
<span>browser:
<div class="login-container" :style="{'background-image': 'url('+bgImg+')'}">
<div class="content-box">
<div class="qrcode-main">
<div class="login-code-box" @click="loginRefresh">
<qrcode-vue
v-loading="loadingCode"
:value="loginUrl"
:class-name="qrcodeClassName"
:size="150"
element-loading-text="Click the refresh"
element-loading-spinner="el-icon-refresh"
element-loading-background="rgba(255, 255, 255, 0.9)"
/>
</div>
<div class="login-tip">
<span class="sub-title">Log in using mobile phone WeChat scan code</span>
</div>
<div class="tip-info">
<fieldset>
<legend>The recommended configuration</legend>
<span>browser:
<a href="https://www.google.cn/chrome/" target="_blank" style="text-decoration: underline;">Google Chrome</a>
</span>
<br>
<span>screen resolution1920*1080</span>
</fieldset>
</div>
</div>
<br>
<span>screen resolution1920*1080</span>
</fieldset>
</div>
</div>
<el-form ref="loginForm" class="login-form" :model="loginForm" :rules="loginRules" label-position="left">
<div class="title_box">Welcome to 城市轨道交通设计平台</div>
<el-form-item prop="username" class="item_form_box">
<el-form ref="loginForm" class="login-form" :model="loginForm" :rules="loginRules" label-position="left">
<div class="title_box">Welcome to 城市轨道交通设计平台</div>
<el-form-item prop="username" class="item_form_box">
<span class="svg-container svg-container_login">
<svg-icon icon-class="user" />
</span>
<el-input v-model="loginForm.username" name="username" type="text" placeholder="Mobile phone number/email" />
</el-form-item>
<el-form-item prop="password" class="item_form_box item_form_password">
<el-input v-model="loginForm.username" name="username" type="text" placeholder="Mobile phone number/email" />
</el-form-item>
<el-form-item prop="password" class="item_form_box item_form_password">
<span class="svg-container">
<svg-icon icon-class="password" />
</span>
<el-input
v-model="loginForm.password"
name="password"
:type="pwdType"
placeholder="password"
@keyup.enter="handleLogin"
/>
<span class="show-pwd" @click="showPwd">
<el-input
v-model="loginForm.password"
name="password"
:type="pwdType"
placeholder="password"
@keyup.enter="handleLogin"
/>
<span class="show-pwd" @click="showPwd">
<svg-icon icon-class="eye" />
</span>
</el-form-item>
<div class="tip-message">{{ tipsMsg }}</div>
<el-popover
placement="right"
title=""
width="200"
trigger="hover"
content="Please in lian classroom small program assistant, perfect personal information, set login password, mobile phone number or email."
class="popover_box"
>
<div slot="reference">unable to login?</div>
</el-popover>
<el-form-item>
<el-button type="primary" style="width:100%;" :loading="loading" @click.native.prevent="handleLogin">
login
</el-button>
</el-form-item>
</el-form>
</el-form-item>
<div class="tip-message">{{ tipsMsg }}</div>
<el-popover
placement="right"
title=""
width="200"
trigger="hover"
class="popover_box"
>
<div>
<img :src="QCode" alt="" style="width: 100px; height: 100px; display: block; margin:0 auto;">
<div style="margin-top: 10px;">Please in lian classroom small program assistant, perfect personal information, set login password, mobile phone number or email.</div>
</div>
<div slot="reference">unable to login?</div>
</el-popover>
<el-form-item>
<el-button type="primary" style="width:100%;" :loading="loading" @click.native.prevent="handleLogin">
login
</el-button>
</el-form-item>
</el-form>
</div>
</div>
</div>
</template>
<script>
import { UrlConfig } from '@/router/index';
import { setSessionStorage,removeSessionStorage } from '@/utils/auth';
import md5 from 'js-md5';
import QrcodeVue from 'qrcode.vue';
import { getLoginWmurl, checkLoginStatus } from '@/api/login';
import { LoginParams } from '@/utils/login';
import bgImg from '@/assets/bg1.jpg';
import { setDesignToken } from '@/utils/auth';
import { UrlConfig } from '@/router/index';
import Cookies from 'js-cookie';
import md5 from 'js-md5';
import QrcodeVue from 'qrcode.vue';
import { getLoginWmurl, checkLoginStatus } from '@/api/login';
import { LoginParams } from '@/utils/login';
import bgImg from '@/assets/bg1.jpg';
import { setDesignToken } from '@/utils/auth';
export default {
name: 'LoginDesign',
components: { QrcodeVue },
data() {
const validateUsername = (rule, value, callback) => {
if (value.length < 5) {
callback(new Error('Please enter the correct user name'));
} else {
callback();
}
};
const validatePass = (rule, value, callback) => {
if (value.length < 5) {
callback(new Error('Password cannot be less than 5 digits'));
} else {
callback();
}
};
return {
bgImg: bgImg,
loginForm: {
username: '',
password: ''
},
loginRules: {
username: [{ required: true, trigger: 'blur', validator: validateUsername }],
password: [{ required: true, trigger: 'blur', validator: validatePass }]
},
loading: false,
pwdType: 'password',
tipsMsg: '',
qrcodeClassName: 'login-qrcode',
sessionId: '',
loginUrl: '',
loadingCode: false,
checkLogin: null,
checkTimeout: null,
scanSuccess: false
};
},
mounted() {
document.title = '城市轨道交通设计平台';
this.loginRefresh();
},
methods: {
clearTimer(timer) {
if (timer) {
clearTimeout(timer);
timer = null;
}
},
loginRefresh() {
this.loadingCode = true;
getLoginWmurl(LoginParams.Design).then(response => {
this.sessionId = response.data.sessionId;
this.loginUrl = response.data.url;
this.loadingCode = false;
this.clearTimer(this.checkTimeout);
this.checkTimeout = setTimeout(() => {
this.loadingCode = true;
this.loginUrl = '';
}, 3 * 60 * 1000);
this.checkLoginStatus();
}).catch((error) => {
console.log(error);
this.loadingCode = false;
this.$messageBox('Failed to get login qr code, please refresh and try again');
});
},
checkLoginStatus() {
const self = this;
export default {
name: 'LoginDesign',
components: { QrcodeVue },
data() {
const validateUsername = (rule, value, callback) => {
if (value.length < 5) {
callback(new Error('Please enter the correct user name'));
} else {
callback();
}
};
const validatePass = (rule, value, callback) => {
if (value.length < 5) {
callback(new Error('Password cannot be less than 5 digits'));
} else {
callback();
}
};
return {
bgImg: bgImg,
loginForm: {
username: '',
password: ''
},
loginRules: {
username: [{ required: true, trigger: 'blur', validator: validateUsername }],
password: [{ required: true, trigger: 'blur', validator: validatePass }]
},
loading: false,
pwdType: 'password',
tipsMsg: '',
qrcodeClassName: 'login-qrcode',
sessionId: '',
loginUrl: '',
loadingCode: false,
checkLogin: null,
checkTimeout: null,
scanSuccess: false
};
},
mounted() {
document.title = '城市轨道交通设计平台';
this.loginRefresh();
},
methods: {
clearTimer(timer) {
if (timer) {
clearTimeout(timer);
timer = null;
}
},
loginRefresh() {
this.loadingCode = true;
getLoginWmurl(LoginParams.Design).then(response => {
this.sessionId = response.data.sessionId;
this.loginUrl = response.data.url;
this.loadingCode = false;
this.clearTimer(this.checkTimeout);
this.checkTimeout = setTimeout(() => {
this.loadingCode = true;
this.loginUrl = '';
}, 3 * 60 * 1000);
this.checkLoginStatus();
}).catch((error) => {
console.log(error);
this.loadingCode = false;
this.$messageBox('Failed to get login qr code, please refresh and try again');
});
},
checkLoginStatus() {
const self = this;
//
if (this && this._isDestroyed) {
return;
}
//
if (this && this._isDestroyed) {
return;
}
//
//
this.clearTimer(this.checkLogin);
this.checkLogin = setTimeout(() => {
checkLoginStatus(self.sessionId).then(response => {
setDesignToken(response.data.token);
//
self.$store.dispatch('QrLoginSetting', { key: 'SET_TOKENDESIGN', value: response.data.token }).then(() => {
//
self.clearTimer(self.checkLogin);
self.$router.push({ path: '/design/login' });
self.$nextTick(() => {
self.$i18n.locale = 'en';
Cookies.set('user_lang', 'en');
});
});
}).catch(error => {
if (error.data && error.data.status == '1') {
self.scanSuccess = true;
}
self.checkLoginStatus();
});
}, 3000);
},
showPwd() {
if (this.pwdType === 'password') {
this.pwdType = '';
} else {
this.pwdType = 'password';
}
},
handleLogin() {
this.$refs.loginForm.validate(valid => {
if (valid) {
const model = Object.assign({}, this.loginForm);
model.password = md5(model.password);
// model.type = 'plan';
model.type = 'design';
//
//
this.clearTimer(this.checkLogin);
this.checkLogin = setTimeout(() => {
checkLoginStatus(self.sessionId).then(response => {
setDesignToken(response.data.token);
//
self.$store.dispatch('QrLoginSetting', { key: 'SET_TOKENDESIGN', value: response.data.token }).then(() => {
//
self.clearTimer(self.checkLogin);
self.$router.push({ path: '/design/login' });
self.$nextTick(() => {
self.$i18n.locale = 'en';
Cookies.set('user_lang', 'en');
});
});
}).catch(error => {
if (error.data && error.data.status == '1') {
self.scanSuccess = true;
}
self.checkLoginStatus();
});
}, 3000);
},
showPwd() {
if (this.pwdType === 'password') {
this.pwdType = '';
} else {
this.pwdType = 'password';
}
},
handleLogin() {
this.$refs.loginForm.validate(valid => {
if (valid) {
const model = Object.assign({}, this.loginForm);
model.password = md5(model.password);
// model.type = 'plan';
model.type = 'design';
this.loading = true;
this.$store.dispatch('Login', model).then(() => {
this.$store.dispatch('GetUserConfigInfo');
//
this.loading = false;
this.tipsMsg = '';
this.$router.push({ path: `${UrlConfig.design.prefix}` });
this.$nextTick(() => {
this.$i18n.locale = 'en';
Cookies.set('user_lang', 'en');
});
}).catch(error => {
this.tipsMsg = error.message;
this.loading = false;
setTimeout(() => { this.tipsMsg = ''; }, 5000);
});
this.loading = true;
this.$store.dispatch('Login', model).then(() => {
this.$store.dispatch('GetUserConfigInfo');
//
this.loading = false;
this.tipsMsg = '';
this.$router.push({ path: `${UrlConfig.design.prefix}` });
this.$nextTick(() => {
this.$i18n.locale = 'en';
Cookies.set('user_lang', 'en');
});
}).catch(error => {
this.tipsMsg = error.message;
this.loading = false;
setTimeout(() => { this.tipsMsg = ''; }, 5000);
});
} else {
console.log('error submit!!');
return false;
}
});
}
}
};
} else {
console.log('error submit!!');
return false;
}
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss">
@ -255,7 +258,6 @@
}
}
.item_form_box {
border: 1px solid #ccc;
border-radius: 5px;
@ -384,4 +386,3 @@
}
</style>

View File

@ -53,14 +53,11 @@
</span>
</el-form-item>
<div class="tip-message">{{ tipsMsg }}</div>
<el-popover
placement="right"
title=""
width="200"
trigger="hover"
content="请在琏课堂小程序助手,完善个人信息,设置登录密码,手机号或邮箱。"
class="popover_box"
>
<el-popover placement="right" title="" width="200" trigger="hover" class="popover_box">
<div>
<img :src="QCode" alt="" style="width: 100px; height: 100px; display: block; margin:0 auto;">
<div style="margin-top: 10px;">请在琏课堂小程序助手完善个人信息设置登录密码手机号或邮箱</div>
</div>
<div slot="reference">无法登录?</div>
</el-popover>
<el-form-item>

View File

@ -53,19 +53,16 @@
</span>
</el-form-item>
<div class="tip-message">{{ tipsMsg }}</div>
<el-popover
placement="right"
title=""
width="200"
trigger="hover"
content="请在琏课堂小程序助手,完善个人信息,设置登录密码,手机号或邮箱。"
class="popover_box"
>
<el-popover placement="right" title="" width="200" trigger="hover" class="popover_box">
<div>
<img :src="QCode" alt="" style="width: 100px; height: 100px; display: block; margin:0 auto;">
<div style="margin-top: 10px;">请在琏课堂小程序助手完善个人信息设置登录密码手机号或邮箱</div>
</div>
<div slot="reference">无法登录?</div>
</el-popover>
<el-form-item>
<el-button type="primary" style="width:100%;" :loading="loading" @click.native.prevent="handleLogin">
登录
登录
</el-button>
</el-form-item>
</el-form>

View File

@ -122,7 +122,8 @@ export default {
name: [
{ required: true, message: this.$t('rules.pleaseEnterMapName'), trigger: 'change' }
]
}
},
cityList: []
};
},
watch: {
@ -152,7 +153,9 @@ export default {
getSkinCodeList().then(response => {
this.skinCodeList = response.data;
});
this.$Dictionary.cityType().then(list => {
this.cityList = list;
});
listPublishMap().then(response => {
this.publishMapList = response.data;
}).catch(() => {

View File

@ -2,9 +2,9 @@
<div>
<pop-menu ref="popMenu" :menu="menu" />
<map-edit ref="edit" :basic-info="true" :map="editModel" :skin-code="skinCode" @refresh="refresh" />
<map-edit ref="axisEdit" :basic-info="false" :map="editModel" :skin-code="skinCode" @refresh="refresh" />
<map-save-as ref="saveAs" :map="editModel" @refresh="refresh" />
<map-publish ref="publish" :map="editModel" />
<!-- <map-edit ref="axisEdit" :basic-info="false" :map="editModel" :skin-code="skinCode" @refresh="refresh" /> -->
<!-- <map-save-as ref="saveAs" :map="editModel" @refresh="refresh" /> -->
<!-- <map-publish ref="publish" :map="editModel" /> -->
</div>
</template>
@ -14,8 +14,8 @@ import { DeviceMenu } from '@/scripts/ConstDic';
import { UrlConfig } from '@/router/index';
import PopMenu from '@/components/PopMenu';
import MapEdit from './edit';
import MapSaveAs from './saveAs';
import MapPublish from './publish';
// import MapSaveAs from './saveAs';
// import MapPublish from './publish';
import { mapGetters } from 'vuex';
export default {
@ -23,8 +23,8 @@ export default {
components: {
PopMenu,
MapEdit,
MapSaveAs,
MapPublish
// MapSaveAs,
// MapPublish
},
props: {
point: {

View File

@ -149,12 +149,12 @@ export default {
this.initTrainTypes = [];
this.$refs.form.resetFields();
this.loading = true;
if (node.data.type === 'skin') {
if (node.data.type === 'Skin') {
this.codeDisabled = false;
this.addModel.mapName = node.data.name;
this.addModel.skinCode = node.data.id;
this.loading = false;
} else if (node.data.type === 'prd') {
} else if (node.data.type === 'Prd') {
this.codeDisabled = true;
getProductDetail(node.data.id).then(response => {
this.addModel.mapName = node.parent.data.name;
@ -172,6 +172,7 @@ export default {
});
} else {
this.addModel.prdType = '01';
this.loading = false;
}
//

View File

@ -88,7 +88,7 @@ export default {
/* 去除列表的training节点*/
list.forEach(elem => {
elem.children = this.convertTreeData(elem.children);
if (elem.type !== 'trainingType') {
if (elem.type !== 'TrainingType') {
tree.push(elem);
}
});

View File

@ -94,7 +94,7 @@ export default {
},
handleNodeClick(obj, node) {
this.$store.dispatch('runPlan/clear').then(() => {
if (obj.type === 'skin') {
if (obj.type === 'Skin') {
this.$router.push({ path: `${UrlConfig.map.runPlanView}/draft`, query: { skinCode: obj.id, planId: null } });
} else {
this.$router.push({ path: `${UrlConfig.map.runPlanView}/draft`, query: { skinCode: node.parent.data.id, planId: obj.id } });

View File

@ -10,7 +10,7 @@
<el-table-column prop="name" :label="this.$t('planMonitor.runGraphName')" />
<el-table-column :label="this.$t('global.status')">
<template slot-scope="scope">
<span>{{handlerStatus(scope.row)}}</span>
<el-tag>{{handlerStatus(scope.row)}}</el-tag>
</template>
</el-table-column>
<el-table-column
@ -20,13 +20,13 @@
</el-table-column>
<el-table-column :label="this.$t('planMonitor.creationDate')">
<template slot-scope="scope">
<span>{{handleTime(scope.row.createTime)}}</span>
<el-tag type="success">{{handleTime(scope.row.createTime)}}</el-tag>
</template>
</el-table-column>
<el-table-column :label="this.$t('global.operate')" width="500">
<el-table-column :label="this.$t('global.operate')" width="400">
<template slot-scope="scope">
<el-button size="mini" class="button_box" @click="handleConfirm(scope.row)" v-if="scope.row.status !=='1'">{{$t('planMonitor.load')}}</el-button>
<el-button size="mini" class="button_box" @click="handleEdit(scope.row)" v-if="isCreate && scope.row.status !=='1'">{{$t('planMonitor.modifyName')}}</el-button>
<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'):'申请发布'}}</el-button>
<el-button size="mini" class="button_box" type="primary" @click="handlePreview(scope.row)" v-if="scope.row.status === '1'">预览</el-button>

View File

@ -13,24 +13,24 @@
<el-tab-pane :label="$t('teach.courseDetails')" name="first">
<div :style="{ height: height - 270 +'px' }">
<el-scrollbar wrap-class="scrollbar-wrapper">
<el-tree
ref="tree"
:data="courseModel.treeList"
node-key="id"
:props="defaultProps"
:filter-node-method="filterNode"
highlight-current
:default-expanded-keys="expandList"
:span="22"
@node-click="clickEvent"
@node-expand="nodeExpand"
@node-collapse="nodeCollapse"
>
<span slot-scope="{ node, data }">
<span v-if="node.data.valid" class="el-icon-goods" :style="{color: 'green'}">&nbsp;{{ node.label }}</span>
<span v-else class="el-icon-sold-out">&nbsp;{{ node.label }}</span>
<el-tree
ref="tree"
:data="courseModel.treeList"
node-key="id"
:props="defaultProps"
:filter-node-method="filterNode"
highlight-current
:default-expanded-keys="expandList"
:span="22"
@node-click="clickEvent"
@node-expand="nodeExpand"
@node-collapse="nodeCollapse"
>
<span slot-scope="{ node, data }">
<span v-if="node.data.valid" class="el-icon-goods" :style="{color: 'green'}">&nbsp;{{ node.label }}</span>
<span v-else class="el-icon-sold-out">&nbsp;{{ node.label }}</span>
</span>
</el-tree>
</el-tree>
</el-scrollbar>
</div>
</el-tab-pane>
@ -52,12 +52,11 @@
</template>
<script>
import { querySystemByTypeAndPrdCode } from '@/api/trainingPlatform'
import { getPublishLessonDetail } from '@/api/jmap/lesson';
import { getSubSystemDetail } from '@/api/trainingPlatform';
import { PermissionType } from '@/scripts/ConstDic';
import { UrlConfig } from '@/router/index';
import LimitList from '@/views/components/limits/index';
import { getSessionStorage, setSessionStorage, removeSessionStorage } from '@/utils/auth';
import { getSessionStorage, setSessionStorage } from '@/utils/auth';
export default {
name: 'LessonDetail',
@ -80,11 +79,11 @@ export default {
pmsList: []
},
activeName: 'first',
defaultProps: {
children: 'children',
label: 'name'
},
expandList: []
defaultProps: {
children: 'children',
label: 'name'
},
expandList: []
};
},
computed: {
@ -108,24 +107,23 @@ export default {
},
methods: {
initLoadPage() {
if (this.$route.query.prodId && this.$route.query.type) {
querySystemByTypeAndPrdCode({type:this.$route.query.type},this.$route.query.prodId).then(response => {
if(response.data.lessonVO){
this.courseModel = {
id: response.data.lessonVO.id,
name: response.data.lessonVO.name,
price: response.data.lessonVO.price,
remarks: response.data.lessonVO.remarks,
detail: response.data.lessonVO.chapters,
pmsList: response.data.lessonVO.pmsList || [],
prdCode: response.data.lessonVO.prdCode,
mapId: response.data.lessonVO.mapId,
skinCode: response.data.lessonVO.skinCode,
treeList: response.data.treeNodeList,
PermissionType: PermissionType.LESSON
};
}
this.getExpandList(this.courseModel.id);
if (this.$route.params.subSystem) {
getSubSystemDetail(this.$route.params.subSystem).then(response => {
if (response.data.lesson) {
this.courseModel = {
id: response.data.lesson.id,
name: response.data.lesson.name,
price: response.data.lesson.price,
remarks: response.data.lesson.remarks,
detail: response.data.lesson.chapters,
pmsList: response.data.lesson.pmsList || [],
prdCode: response.data.lesson.prdCode,
mapId: response.data.lesson.mapId,
skinCode: response.data.lesson.skinCode,
treeList: response.data.tree,
PermissionType: PermissionType.LESSON
};
}
}).catch(error => {
this.$message.error(this.$t('tip.failedCourse') + ':' + error.message);
});
@ -145,52 +143,52 @@ export default {
this.$refs.limitList.distribute(this.courseModel);
}
},
clickEvent(obj, node, ele) {
if (obj && obj.type==='training') {
if (obj.valid) {
this.$router.push({ path: `${UrlConfig.trainingPlatform.practical}/${obj.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(() => { });
}
}
},
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.courseModel.prdCode, mapId: this.courseModel.mapId }
});
},
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 (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;
}
}
clickEvent(obj, node, ele) {
if (obj && obj.type==='Training') {
if (obj.valid) {
this.$router.push({ path: `${UrlConfig.trainingPlatform.practical}/${obj.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(() => { });
}
}
},
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.courseModel.prdCode, mapId: this.courseModel.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 (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;
}
}
}
};
</script>

File diff suppressed because it is too large Load Diff

View File

@ -1,187 +1,213 @@
<template>
<el-card v-loading="loading" class="map-list-main">
<div slot="header" class="clearfix">
<span>{{ $t('global.mapList') }}</span>
</div>
<filter-city v-if="project!=='xty' " ref="filerCity" filter-empty :query-function="queryFunction" @filterSelectChange="refresh" />
<el-input v-if="project!=='xty' " v-model="filterText" :placeholder="this.$t('global.filteringKeywords')" clearable />
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: (height-(project?50:125)) +'px' }">
<el-tree
ref="tree"
:data="treeList"
node-key="id"
:props="defaultProps"
highlight-current
:span="22"
:filter-node-method="filterNode"
:default-expanded-keys="expandList"
@node-click="clickEvent"
@node-contextmenu="showContextMenu"
@node-expand="nodeExpand"
@node-collapse="nodeCollapse"
>
<el-card v-loading="loading" class="map-list-main">
<div slot="header" class="clearfix">
<span>{{ $t('global.mapList') }}</span>
</div>
<filter-city v-if="project!=='xty' " ref="filerCity" filter-empty :query-function="queryFunction" :local-param-name="localParamName" @filterSelectChange="refresh" />
<el-input v-if="project!=='xty' " v-model="filterText" :placeholder="this.$t('global.filteringKeywords')" clearable />
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: (height-(project?50:125)) +'px' }">
<el-tree
ref="tree"
:data="treeList"
node-key="id"
:props="defaultProps"
highlight-current
:span="22"
:filter-node-method="filterNode"
:default-expanded-keys="expandList"
@node-click="clickEvent"
@node-contextmenu="showContextMenu"
@node-expand="nodeExpand"
@node-collapse="nodeCollapse"
>
<span slot-scope="{ node:tnode, data }">
<span
class="el-icon-tickets"
:style="{color: data.valid ? 'green':''}"
class="el-icon-tickets"
:style="{color: data.valid ? 'green':''}"
>&nbsp;{{ tnode.label }}</span>
</span>
</el-tree>
</el-scrollbar>
</el-card>
</el-tree>
</el-scrollbar>
</el-card>
</template>
<script>
import { getPublishMapTree } from '@/api/management/mapprd';
import { getTrainingSystemList,getTrainingSystemListByMapId } from '@/api/trainingPlatform'
import { UrlConfig } from '@/router/index';
import FilterCity from '@/views/components/filterCity';
import localStore from 'storejs';
import { getSessionStorage } from '@/utils/auth';
import { getPublishMapTree } from '@/api/management/mapprd';
import { getTrainingSystemList, getTrainingSystemListByMapId, getSubSystemInfo } from '@/api/trainingPlatform';
import { UrlConfig } from '@/router/index';
import FilterCity from '@/views/components/filterCity';
import localStore from 'storejs';
import { getSessionStorage } from '@/utils/auth';
export default {
name: 'DemonList',
components: {
FilterCity
},
props: {
height: {
type: Number,
required: true
}
},
data() {
return {
loading: true,
defaultShowKeys: [],
queryFunction: getPublishMapTree,
filterText: '',
treeList: [],
selected: {},
defaultProps: {
children: 'children',
label: 'name'
},
node: {
},
mapId: '',
expandList: [],
filterSelect: ''
};
},
watch: {
},
computed: {
account() {
return this.$store.state.user.account;
},
project() {
return getSessionStorage('project');
}
},
beforeDestroy () {
},
mounted() {
if (this.project === 'xty'){
this.projectInitData('18')
}
},
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) {
localStore.set('trainingPlatformCheckId'+this.filterSelect+this.account, obj.id);
while (data) {
if (data.data.type === 'map') {
this.mapId = data.data.id;
break;
}
data = data.parent;
}
if (obj.type === 'Simulation') {
this.$router.push({ path: `${UrlConfig.trainingPlatform.prodDetail}/${this.mapId}`, query: { prodId: obj.code, type: obj.type }});
} else if ( obj.type === 'map'){
this.mapId = obj.id;
this.$router.push({ path: `${UrlConfig.trainingPlatform.permission}/${this.mapId}`});
} else if ( obj.type === 'Lesson' ){
this.$router.push({ path: `${UrlConfig.trainingPlatform.teachDetail}`, query: { prodId: obj.code, type: obj.type }});
} else if ( obj.type === 'Exam' ){
this.$router.push({ path: `${UrlConfig.trainingPlatform.course}/${this.mapId}`, query: { prodId: obj.code, type: obj.type }});
} else if ( obj.type === '运行图编制'){
this.$router.push({ path: `${UrlConfig.trainingPlatform.runPlan}/${this.mapId}`,query:{skinCode: '02'} })
}
localStore.set('trainingPlatformRoute'+this.account,this.$router.history.current.fullPath);
},
async refresh(filterSelect) {
this.loading = true;
this.treeList = [];
this.filterSelect = filterSelect;
try {
const res = await getTrainingSystemList({cityCode:filterSelect});
this.treeList = res.data;
this.getExpandList(filterSelect);
this.changeCityWithPage(this.treeList);
this.$nextTick(() => {
const checkId = localStore.get('trainingPlatformCheckId'+filterSelect+this.account) || null;
this.$refs.tree && this.$refs.tree.setCurrentKey(checkId);
this.loading = false;
});
} catch (error) {
this.loading = false;
this.$messageBox(this.$t('error.refreshFailed'));
}
},
async projectInitData(mapId){
this.loading = true;
this.treeList = [];
try {
const resp = await getTrainingSystemListByMapId(mapId);
this.treeList = resp.data;
this.loading = false;
this.getExpandList(this.filterSelect);
this.$nextTick(() => {
const checkId = localStore.get('trainingPlatformCheckId'+this.filterSelect+this.account) || null;
this.$refs.tree && this.$refs.tree.setCurrentKey(checkId);
this.loading = false;
});
} catch (e) {
this.loading = false;
this.$messageBox(this.$t('error.failedToGetSystemData'));
}
},
nodeExpand(obj, node, ele) {
const key = obj.id;
this.expandList = this.expandList.filter(item => item!==key);
this.expandList.push(key);
localStore.set('trainIngPlatformExpandList'+this.filterSelect+this.account,this.expandList)
},
nodeCollapse(obj, node, ele) {
const key = obj.id;
this.expandList = this.expandList.filter(item => item!==key);
localStore.set('trainIngPlatformExpandList'+this.filterSelect+this.account,this.expandList)
},
getExpandList(filterSelect) {
let expand = localStore.get('trainIngPlatformExpandList'+filterSelect+this.account);
expand = expand?(expand+'').split(','):'';
if (expand instanceof Array){
this.expandList = expand;
}
},
changeCityWithPage(treeList){
if (treeList.length > 0) {
this.$router.push({ path: `${UrlConfig.trainingPlatform.permission}/${treeList[0].id}`});
this.$refs.tree.setCurrentKey(treeList[0].id);
}
}
}
};
export default {
name: 'DemonList',
components: {
FilterCity
},
props: {
height: {
type: Number,
required: true
}
},
data() {
return {
loading: true,
defaultShowKeys: [],
queryFunction: getPublishMapTree,
filterText: '',
treeList: [],
selected: {},
defaultProps: {
children: 'children',
label: 'name'
},
node: {
},
mapId: '',
expandList: [],
filterSelect: '',
localParamName: 'training_cityCode'
};
},
computed: {
account() {
return this.$store.state.user.account;
},
project() {
return getSessionStorage('project');
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val);
}
},
beforeDestroy () {
},
mounted() {
if (this.project === 'xty') {
this.projectInitData('18');
}
},
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) {
localStore.set('trainingPlatformCheckId'+this.filterSelect+this.account, obj.id);
while (data) {
if (data.data.type === 'Map') {
this.mapId = data.data.id;
break;
}
data = data.parent;
}
if ( obj.type === 'Map') {
this.mapId = obj.id;
this.$router.push({ path: `${UrlConfig.trainingPlatform.permission}/${this.mapId}`});
} else if ( obj.type === 'MapSystem') {
getSubSystemInfo(obj.id).then(resp => {
switch (resp.data.type) {
case 'Exam':
this.setLocalRoute(`${UrlConfig.trainingPlatform.course}/${obj.id}`);
this.$router.push({ path: `${UrlConfig.trainingPlatform.course}/${obj.id}`});
break;
case 'Lesson':
this.setLocalRoute(`${UrlConfig.trainingPlatform.teachDetail}/${obj.id}`);
this.$router.push({ path: `${UrlConfig.trainingPlatform.teachDetail}/${obj.id}`});
break;
case 'Simulation':
this.setLocalRoute(`${UrlConfig.trainingPlatform.prodDetail}/${obj.id}`);
this.$router.push({ path: `${UrlConfig.trainingPlatform.prodDetail}/${obj.id}`, query: { mapId: this.mapId}});
break;
// case '':
// this.$router.push({ path: `${UrlConfig.trainingPlatform.runPlan}/${this.mapId}`, query: {skinCode: '02'} });
// break;
}
}).catch(() => {
this.$messageBox('获取子系统信息失败!');
});
}
},
setLocalRoute(path) {
localStore.set('trainingPlatformRoute'+this.account, path);
},
async refresh(filterSelect) {
this.loading = true;
this.treeList = [];
this.filterSelect = filterSelect;
try {
const res = await getTrainingSystemList(filterSelect);
res.data.forEach(item =>{
item.key = item.id + item.type;
item.children && item.children.forEach(childrenItem => {
childrenItem.key = childrenItem.id + item.type;
});
});
this.treeList = res.data;
this.getExpandList(filterSelect);
// this.changeCityWithPage(this.treeList);
this.$nextTick(() => {
const checkId = localStore.get('trainingPlatformCheckId'+filterSelect+this.account) || null;
this.$refs.tree && this.$refs.tree.setCurrentKey(checkId);
this.loading = false;
});
} catch (error) {
this.loading = false;
this.$messageBox(this.$t('error.refreshFailed'));
}
},
async projectInitData(mapId) {
this.loading = true;
this.treeList = [];
try {
const resp = await getTrainingSystemListByMapId(mapId);
this.treeList = resp.data;
this.loading = false;
this.getExpandList(this.filterSelect);
this.$nextTick(() => {
const checkId = localStore.get('trainingPlatformCheckId'+this.filterSelect+this.account) || null;
this.$refs.tree && this.$refs.tree.setCurrentKey(checkId);
this.loading = false;
});
} catch (e) {
this.loading = false;
this.$messageBox(this.$t('error.failedToGetSystemData'));
}
},
nodeExpand(obj, node, ele) {
const key = obj.id;
this.expandList = this.expandList.filter(item => item!==key);
this.expandList.push(key);
localStore.set('trainIngPlatformExpandList'+this.filterSelect+this.account, this.expandList);
},
nodeCollapse(obj, node, ele) {
const key = obj.id;
this.expandList = this.expandList.filter(item => item!==key);
localStore.set('trainIngPlatformExpandList'+this.filterSelect+this.account, this.expandList);
},
getExpandList(filterSelect) {
let expand = localStore.get('trainIngPlatformExpandList'+filterSelect+this.account);
expand = expand?(expand+'').split(','):'';
if (expand instanceof Array) {
this.expandList = expand;
}
}
// changeCityWithPage(treeList) {
// if (treeList.length > 0) {
// this.$router.push({ path: `${UrlConfig.trainingPlatform.permission}/${treeList[0].id}`});
// this.$refs.tree.setCurrentKey(treeList[0].id);
// }
// }
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.back-home {