desc: 修改代码
This commit is contained in:
parent
1b564c2958
commit
9bfad2fdeb
@ -1,51 +1,51 @@
|
|||||||
import request from '@/utils/request';
|
import request from '@/utils/request';
|
||||||
|
|
||||||
export function list(params) {
|
export function list(params) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/dictionary/list',
|
url: '/api/dictionary/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: params
|
params: params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function checkDicCodeExist(code) {
|
export function checkDicCodeExist(code) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/dictionary/checkExistByCode',
|
url: '/api/dictionary/checkExistByCode',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: {
|
params: {
|
||||||
code: code
|
code: code
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getData(id) {
|
export function getData(id) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/dictionary/${id}`,
|
url: `/api/dictionary/${id}`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function create(data) {
|
export function create(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/dictionary/create',
|
url: '/api/dictionary/create',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function del(id) {
|
export function del(id) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/dictionary/delete/${id}`,
|
url: `/api/dictionary/delete/${id}`,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function update(data) {
|
export function update(data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/dictionary/update/${data.id}`,
|
url: `/api/dictionary/update/${data.id}`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -53,11 +53,28 @@ export function update(data) {
|
|||||||
* @param {*} code
|
* @param {*} code
|
||||||
*/
|
*/
|
||||||
export function getDetailList(code) {
|
export function getDetailList(code) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/dictionary/getDetailListByCode',
|
url: '/api/dictionary/getDetailListByCode',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: {
|
params: {
|
||||||
code: code
|
code: code
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据线路code分页查询指令
|
||||||
|
export function getCommandList(parmas) {
|
||||||
|
return request({
|
||||||
|
url: '/api/cmd',
|
||||||
|
method: 'get',
|
||||||
|
params: parmas
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据线路code分页查询指令
|
||||||
|
export function delCommand(id) {
|
||||||
|
return request({
|
||||||
|
url: `/api/cmd/${id}`,
|
||||||
|
method: 'delete'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
@ -68,5 +68,6 @@ export default {
|
|||||||
scriptReleaseApplication: 'Script release application',
|
scriptReleaseApplication: 'Script release application',
|
||||||
runGraphReleaseApplication: 'Run graph release application',
|
runGraphReleaseApplication: 'Run graph release application',
|
||||||
subsystemGeneration: 'Subsystem generation',
|
subsystemGeneration: 'Subsystem generation',
|
||||||
newsBulletin: 'New bulletin'
|
newsBulletin: 'New bulletin',
|
||||||
|
commandDictionary: 'Command dictionary'
|
||||||
};
|
};
|
||||||
|
@ -53,5 +53,13 @@ export default {
|
|||||||
newsHeadlines: 'News headlines:',
|
newsHeadlines: 'News headlines:',
|
||||||
newsContent: 'News content:',
|
newsContent: 'News content:',
|
||||||
whetherTheNewsCanBeClosed: 'Whether the news can be closed:',
|
whetherTheNewsCanBeClosed: 'Whether the news can be closed:',
|
||||||
push: 'Push'
|
push: 'Push',
|
||||||
|
controlMode: 'Control mode',
|
||||||
|
deviceType: 'Device type',
|
||||||
|
lineCode: 'Line code',
|
||||||
|
simulationRole: 'Simulation role',
|
||||||
|
instructionType: 'type of instruction',
|
||||||
|
paramDetail: 'Check Parameters',
|
||||||
|
createDirective: '新增指令',
|
||||||
|
editDirective: '修改指令'
|
||||||
};
|
};
|
||||||
|
@ -69,5 +69,6 @@ export default {
|
|||||||
scriptReleaseApplication: '剧本发布申请',
|
scriptReleaseApplication: '剧本发布申请',
|
||||||
runGraphReleaseApplication: '运行图发布申请',
|
runGraphReleaseApplication: '运行图发布申请',
|
||||||
subsystemGeneration: '子系统生成',
|
subsystemGeneration: '子系统生成',
|
||||||
newsBulletin: '消息公告'
|
newsBulletin: '消息公告',
|
||||||
|
commandDictionary: '命令字典'
|
||||||
};
|
};
|
||||||
|
@ -53,5 +53,13 @@ export default {
|
|||||||
newsHeadlines: '消息标题:',
|
newsHeadlines: '消息标题:',
|
||||||
newsContent: '消息内容:',
|
newsContent: '消息内容:',
|
||||||
whetherTheNewsCanBeClosed: '消息是否可关闭:',
|
whetherTheNewsCanBeClosed: '消息是否可关闭:',
|
||||||
push: '推送'
|
push: '推送',
|
||||||
|
controlMode: '控制模式',
|
||||||
|
deviceType: '设备类型',
|
||||||
|
lineCode: '线路编号',
|
||||||
|
simulationRole: '仿真角色',
|
||||||
|
instructionType: '指令类型',
|
||||||
|
paramDetail: '查看参数',
|
||||||
|
createDirective: '新增指令',
|
||||||
|
editDirective: '修改指令'
|
||||||
};
|
};
|
||||||
|
@ -107,6 +107,10 @@ class Jlmap {
|
|||||||
if (this.methods.viewLoaded instanceof Function) { this.methods.viewLoaded(this.mapDevice); }
|
if (this.methods.viewLoaded instanceof Function) { this.methods.viewLoaded(this.mapDevice); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setMapDevice(mapDevice) {
|
||||||
|
this.mapDevice = mapDevice;
|
||||||
|
}
|
||||||
|
|
||||||
setDefaultState() {
|
setDefaultState() {
|
||||||
const list = [];
|
const list = [];
|
||||||
|
|
||||||
|
@ -29,480 +29,480 @@ import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItem
|
|||||||
import { mouseCancelState } from './utils/menuItemStatus';
|
import { mouseCancelState } from './utils/menuItemStatus';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'StationStandMenu',
|
name: 'StationStandMenu',
|
||||||
components: {
|
components: {
|
||||||
PopMenu,
|
PopMenu,
|
||||||
StandControl,
|
StandControl,
|
||||||
StandJumpStopControl,
|
StandJumpStopControl,
|
||||||
StandDetail,
|
StandDetail,
|
||||||
StandRunLevel,
|
StandRunLevel,
|
||||||
NoticeInfo,
|
NoticeInfo,
|
||||||
StandBackStrategy,
|
StandBackStrategy,
|
||||||
StandStopTime,
|
StandStopTime,
|
||||||
StandDetainTrainAll
|
StandDetainTrainAll
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
selected: {
|
selected: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default() {
|
default() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
menu: [],
|
menu: [],
|
||||||
menuNormal: {
|
menuNormal: {
|
||||||
local: [
|
local: [
|
||||||
{
|
{
|
||||||
label: '设置扣车',
|
label: '设置扣车',
|
||||||
handler: this.setDetainTrain,
|
handler: this.setDetainTrain,
|
||||||
disabledCallback: MenuDisabledState.StationStand.setDetainTrain,
|
disabledCallback: MenuDisabledState.StationStand.setDetainTrain,
|
||||||
auth: { station: true, center: false }
|
auth: { station: true, center: false }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '取消扣车',
|
label: '取消扣车',
|
||||||
handler: this.cancelDetainTrain,
|
handler: this.cancelDetainTrain,
|
||||||
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrain,
|
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrain,
|
||||||
auth: { station: true, center: true }
|
auth: { station: true, center: true }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '设置跳停',
|
label: '设置跳停',
|
||||||
handler: this.setJumpStop,
|
handler: this.setJumpStop,
|
||||||
disabledCallback: MenuDisabledState.StationStand.setJumpStop,
|
disabledCallback: MenuDisabledState.StationStand.setJumpStop,
|
||||||
auth: { station: true, center: false }
|
auth: { station: true, center: false }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '取消跳停',
|
label: '取消跳停',
|
||||||
handler: this.cancelJumpStop,
|
handler: this.cancelJumpStop,
|
||||||
disabledCallback: MenuDisabledState.StationStand.cancelJumpStop,
|
disabledCallback: MenuDisabledState.StationStand.cancelJumpStop,
|
||||||
auth: { station: true, center: true }
|
auth: { station: true, center: true }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'separator'
|
type: 'separator'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '提前发车',
|
label: '提前发车',
|
||||||
handler: this.earlyDeparture,
|
handler: this.earlyDeparture,
|
||||||
disabledCallback: MenuDisabledState.StationStand.earlyDeparture,
|
disabledCallback: MenuDisabledState.StationStand.earlyDeparture,
|
||||||
auth: { station: true, center: true }
|
auth: { station: true, center: true }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '设置停站时间',
|
label: '设置停站时间',
|
||||||
handler: this.setStopTime,
|
handler: this.setStopTime,
|
||||||
disabledCallback: MenuDisabledState.StationStand.setStopTime,
|
disabledCallback: MenuDisabledState.StationStand.setStopTime,
|
||||||
auth: { station: true, center: true }
|
auth: { station: true, center: true }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'separator'
|
type: 'separator'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '站台详细信息',
|
label: '站台详细信息',
|
||||||
handler: this.detail,
|
handler: this.detail,
|
||||||
disabledCallback: MenuDisabledState.StationStand.detail,
|
disabledCallback: MenuDisabledState.StationStand.detail,
|
||||||
auth: { station: true, center: true }
|
auth: { station: true, center: true }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '运行时间控制',
|
label: '运行时间控制',
|
||||||
handler: this.setRunLevel,
|
handler: this.setRunLevel,
|
||||||
disabledCallback: MenuDisabledState.StationStand.setRunLevel,
|
disabledCallback: MenuDisabledState.StationStand.setRunLevel,
|
||||||
auth: { station: false, center: false }
|
auth: { station: false, center: false }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '设置提前发车',
|
label: '设置提前发车',
|
||||||
handler: this.earlyDeparture,
|
handler: this.earlyDeparture,
|
||||||
disabledCallback: MenuDisabledState.StationStand.earlyDeparture,
|
disabledCallback: MenuDisabledState.StationStand.earlyDeparture,
|
||||||
auth: { station: false, center: false }
|
auth: { station: false, center: false }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '人工折返策略设置',
|
label: '人工折返策略设置',
|
||||||
handler: this.setBackStrategy,
|
handler: this.setBackStrategy,
|
||||||
disabledCallback: MenuDisabledState.StationStand.setBackStrategy,
|
disabledCallback: MenuDisabledState.StationStand.setBackStrategy,
|
||||||
auth: { station: false, center: false }
|
auth: { station: false, center: false }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '查询站台状态',
|
label: '查询站台状态',
|
||||||
handler: this.detail,
|
handler: this.detail,
|
||||||
disabledCallback: MenuDisabledState.StationStand.detail,
|
disabledCallback: MenuDisabledState.StationStand.detail,
|
||||||
auth: { station: false, center: false }
|
auth: { station: false, center: false }
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
central: [
|
central: [
|
||||||
{
|
{
|
||||||
label: '设置扣车',
|
label: '设置扣车',
|
||||||
handler: this.setDetainTrain,
|
handler: this.setDetainTrain,
|
||||||
disabledCallback: MenuDisabledState.StationStand.setDetainTrain,
|
disabledCallback: MenuDisabledState.StationStand.setDetainTrain,
|
||||||
auth: { station: true, center: true }
|
auth: { station: true, center: true }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '取消扣车',
|
label: '取消扣车',
|
||||||
handler: this.cancelDetainTrain,
|
handler: this.cancelDetainTrain,
|
||||||
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrain,
|
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrain,
|
||||||
auth: { station: true, center: true }
|
auth: { station: true, center: true }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '设置跳停',
|
label: '设置跳停',
|
||||||
handler: this.setJumpStop,
|
handler: this.setJumpStop,
|
||||||
disabledCallback: MenuDisabledState.StationStand.setJumpStop,
|
disabledCallback: MenuDisabledState.StationStand.setJumpStop,
|
||||||
auth: { station: true, center: true }
|
auth: { station: true, center: true }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '取消跳停',
|
label: '取消跳停',
|
||||||
handler: this.cancelJumpStop,
|
handler: this.cancelJumpStop,
|
||||||
disabledCallback: MenuDisabledState.StationStand.cancelJumpStop,
|
disabledCallback: MenuDisabledState.StationStand.cancelJumpStop,
|
||||||
auth: { station: true, center: true }
|
auth: { station: true, center: true }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '提前发车',
|
label: '提前发车',
|
||||||
handler: this.earlyDeparture,
|
handler: this.earlyDeparture,
|
||||||
disabledCallback: MenuDisabledState.StationStand.earlyDeparture,
|
disabledCallback: MenuDisabledState.StationStand.earlyDeparture,
|
||||||
auth: { station: true, center: true }
|
auth: { station: true, center: true }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'separator'
|
type: 'separator'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '停站时间控制',
|
label: '停站时间控制',
|
||||||
handler: this.setStopTime,
|
handler: this.setStopTime,
|
||||||
disabledCallback: MenuDisabledState.StationStand.setStopTime,
|
disabledCallback: MenuDisabledState.StationStand.setStopTime,
|
||||||
auth: { station: true, center: true }
|
auth: { station: true, center: true }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '运行时间控制',
|
label: '运行时间控制',
|
||||||
handler: this.setRunLevel,
|
handler: this.setRunLevel,
|
||||||
disabledCallback: MenuDisabledState.StationStand.setRunLevel,
|
disabledCallback: MenuDisabledState.StationStand.setRunLevel,
|
||||||
auth: { station: true, center: true }
|
auth: { station: true, center: true }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '变通策略管理',
|
label: '变通策略管理',
|
||||||
handler: this.setBackStrategy,
|
handler: this.setBackStrategy,
|
||||||
disabledCallback: MenuDisabledState.StationStand.setBackStrategy,
|
disabledCallback: MenuDisabledState.StationStand.setBackStrategy,
|
||||||
auth: { station: true, center: true }
|
auth: { station: true, center: true }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'separator'
|
type: 'separator'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '站台信息',
|
label: '站台信息',
|
||||||
handler: this.detail,
|
handler: this.detail,
|
||||||
disabledCallback: MenuDisabledState.StationStand.detail,
|
disabledCallback: MenuDisabledState.StationStand.detail,
|
||||||
auth: { station: true, center: true }
|
auth: { station: true, center: true }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
menuForce: [
|
menuForce: [
|
||||||
{
|
{
|
||||||
label: '设置故障',
|
label: '设置故障',
|
||||||
handler: this.setStoppage,
|
handler: this.setStoppage,
|
||||||
disabledCallback: MenuDisabledState.StationStand.setStoppage
|
disabledCallback: MenuDisabledState.StationStand.setStoppage
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '取消故障',
|
label: '取消故障',
|
||||||
handler: this.cancelStoppage,
|
handler: this.cancelStoppage,
|
||||||
disabledCallback: MenuDisabledState.StationStand.cancelStoppage
|
disabledCallback: MenuDisabledState.StationStand.cancelStoppage
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters('training', [
|
...mapGetters('training', [
|
||||||
'mode',
|
'mode',
|
||||||
'operatemode'
|
'operatemode'
|
||||||
]),
|
]),
|
||||||
...mapGetters('menuOperation', [
|
...mapGetters('menuOperation', [
|
||||||
'buttonOperation'
|
'buttonOperation'
|
||||||
])
|
])
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'$store.state.menuOperation.menuCount': function (val) {
|
'$store.state.menuOperation.menuCount': function (val) {
|
||||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.StationStand) && !this.buttonOperation) {
|
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.StationStand) && !this.buttonOperation) {
|
||||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||||
} else {
|
} else {
|
||||||
this.doClose();
|
this.doClose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
clickEvent() {
|
clickEvent() {
|
||||||
const self = this;
|
const self = this;
|
||||||
window.onclick = function (e) {
|
window.onclick = function (e) {
|
||||||
self.doClose();
|
self.doClose();
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
initMenu() {
|
initMenu() {
|
||||||
// 编辑模式菜单列表
|
// 编辑模式菜单列表
|
||||||
this.menu = menuFiltration(this.menuNormal);
|
this.menu = menuFiltration(this.menuNormal);
|
||||||
if (this.operatemode === OperateMode.ADMIN) {
|
if (this.operatemode === OperateMode.ADMIN) {
|
||||||
this.menu = [...this.menu, ...this.menuForce];
|
this.menu = [...this.menu, ...this.menuForce];
|
||||||
}
|
}
|
||||||
|
|
||||||
// 故障模式菜单列表
|
// 故障模式菜单列表
|
||||||
if (this.operatemode === OperateMode.FAULT) {
|
if (this.operatemode === OperateMode.FAULT) {
|
||||||
this.menu = this.menuForce;
|
this.menu = this.menuForce;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.menu = menuConvert(this.menu);
|
this.menu = menuConvert(this.menu);
|
||||||
},
|
},
|
||||||
doShow(point) {
|
doShow(point) {
|
||||||
this.clickEvent();
|
this.clickEvent();
|
||||||
this.initMenu();
|
this.initMenu();
|
||||||
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
||||||
this.$refs.popMenu.resetShowPosition(point);
|
this.$refs.popMenu.resetShowPosition(point);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
doClose() {
|
doClose() {
|
||||||
if (this.$refs && this.$refs.popMenu) {
|
if (this.$refs && this.$refs.popMenu) {
|
||||||
this.$refs.popMenu.close();
|
this.$refs.popMenu.close();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 设置故障
|
// 设置故障
|
||||||
setStoppage() {
|
setStoppage() {
|
||||||
const operate = {
|
const operate = {
|
||||||
start: true,
|
start: true,
|
||||||
send: true,
|
send: true,
|
||||||
code: this.selected.code,
|
code: this.selected.code,
|
||||||
type: MapDeviceType.StationStand.type,
|
type: MapDeviceType.StationStand.type,
|
||||||
label: MapDeviceType.StationStand.label,
|
label: MapDeviceType.StationStand.label,
|
||||||
operation: OperationEvent.StationStand.stoppage.menu.operation
|
operation: OperationEvent.StationStand.stoppage.menu.operation
|
||||||
};
|
};
|
||||||
|
|
||||||
mouseCancelState(this.selected);
|
mouseCancelState(this.selected);
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
} else {
|
} else {
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow(operate);
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow(operate);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 取消故障
|
// 取消故障
|
||||||
cancelStoppage() {
|
cancelStoppage() {
|
||||||
const operate = {
|
const operate = {
|
||||||
start: true,
|
start: true,
|
||||||
send: true,
|
send: true,
|
||||||
code: this.selected.code,
|
code: this.selected.code,
|
||||||
type: MapDeviceType.StationStand.type,
|
type: MapDeviceType.StationStand.type,
|
||||||
label: MapDeviceType.StationStand.label,
|
label: MapDeviceType.StationStand.label,
|
||||||
operation: OperationEvent.StationStand.cancelStoppage.menu.operation
|
operation: OperationEvent.StationStand.cancelStoppage.menu.operation
|
||||||
};
|
};
|
||||||
|
|
||||||
mouseCancelState(this.selected);
|
mouseCancelState(this.selected);
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
} else {
|
} else {
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow(operate);
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow(operate);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 设置扣车
|
// 设置扣车
|
||||||
setDetainTrain() {
|
setDetainTrain() {
|
||||||
const operate = {
|
const operate = {
|
||||||
start: true,
|
start: true,
|
||||||
code: this.selected.code,
|
code: this.selected.code,
|
||||||
type: MapDeviceType.StationStand.type,
|
type: MapDeviceType.StationStand.type,
|
||||||
label: MapDeviceType.StationStand.label,
|
label: MapDeviceType.StationStand.label,
|
||||||
operation: OperationEvent.StationStand.setDetainTrain.menu.operation
|
operation: OperationEvent.StationStand.setDetainTrain.menu.operation
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
this.$refs.standControl.doShow(operate, this.selected);
|
this.$refs.standControl.doShow(operate, this.selected);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 取消扣车
|
// 取消扣车
|
||||||
cancelDetainTrain() {
|
cancelDetainTrain() {
|
||||||
const operate = {
|
const operate = {
|
||||||
start: true,
|
start: true,
|
||||||
code: this.selected.code,
|
code: this.selected.code,
|
||||||
type: MapDeviceType.StationStand.type,
|
type: MapDeviceType.StationStand.type,
|
||||||
label: MapDeviceType.StationStand.label,
|
label: MapDeviceType.StationStand.label,
|
||||||
operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation
|
operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
this.$refs.standControl.doShow(operate, this.selected);
|
this.$refs.standControl.doShow(operate, this.selected);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 强制取消扣车
|
// 强制取消扣车
|
||||||
cancelDetainTrainForce() {
|
cancelDetainTrainForce() {
|
||||||
const operate = {
|
const operate = {
|
||||||
start: true,
|
start: true,
|
||||||
code: this.selected.code,
|
code: this.selected.code,
|
||||||
type: MapDeviceType.StationStand.type,
|
type: MapDeviceType.StationStand.type,
|
||||||
label: MapDeviceType.StationStand.label,
|
label: MapDeviceType.StationStand.label,
|
||||||
operation: OperationEvent.StationStand.cancelDetainTrainForce.menu.operation
|
operation: OperationEvent.StationStand.cancelDetainTrainForce.menu.operation
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
this.$refs.standControl.doShow(operate, this.selected);
|
this.$refs.standControl.doShow(operate, this.selected);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 全线取消扣车
|
// 全线取消扣车
|
||||||
cancelDetainTrainAll() {
|
cancelDetainTrainAll() {
|
||||||
const operate = {
|
const operate = {
|
||||||
start: true,
|
start: true,
|
||||||
code: this.selected.code,
|
code: this.selected.code,
|
||||||
type: MapDeviceType.StationStand.type,
|
type: MapDeviceType.StationStand.type,
|
||||||
label: MapDeviceType.StationStand.label,
|
label: MapDeviceType.StationStand.label,
|
||||||
operation: OperationEvent.StationStand.cancelDetainTrainAll.menu.operation
|
operation: OperationEvent.StationStand.cancelDetainTrainAll.menu.operation
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
this.$refs.standDetainTrainAll.doShow(operate, this.selected);
|
this.$refs.standDetainTrainAll.doShow(operate, this.selected);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 设置跳停
|
// 设置跳停
|
||||||
setJumpStop() {
|
setJumpStop() {
|
||||||
const operate = {
|
const operate = {
|
||||||
start: true,
|
start: true,
|
||||||
code: this.selected.code,
|
code: this.selected.code,
|
||||||
type: MapDeviceType.StationStand.type,
|
type: MapDeviceType.StationStand.type,
|
||||||
label: MapDeviceType.StationStand.label,
|
label: MapDeviceType.StationStand.label,
|
||||||
operation: OperationEvent.StationStand.setJumpStop.menu.operation
|
operation: OperationEvent.StationStand.setJumpStop.menu.operation
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
this.$refs.standJumpStopControl.doShow(operate, this.selected);
|
this.$refs.standJumpStopControl.doShow(operate, this.selected);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 取消跳停
|
// 取消跳停
|
||||||
cancelJumpStop() {
|
cancelJumpStop() {
|
||||||
const operate = {
|
const operate = {
|
||||||
start: true,
|
start: true,
|
||||||
code: this.selected.code,
|
code: this.selected.code,
|
||||||
type: MapDeviceType.StationStand.type,
|
type: MapDeviceType.StationStand.type,
|
||||||
label: MapDeviceType.StationStand.label,
|
label: MapDeviceType.StationStand.label,
|
||||||
operation: OperationEvent.StationStand.cancelJumpStop.menu.operation
|
operation: OperationEvent.StationStand.cancelJumpStop.menu.operation
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
this.$refs.standJumpStopControl.doShow(operate, this.selected);
|
this.$refs.standJumpStopControl.doShow(operate, this.selected);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 停站时间控制
|
// 停站时间控制
|
||||||
setStopTime() {
|
setStopTime() {
|
||||||
const operate = {
|
const operate = {
|
||||||
start: true,
|
start: true,
|
||||||
send: true,
|
send: true,
|
||||||
code: this.selected.code,
|
code: this.selected.code,
|
||||||
type: MapDeviceType.StationStand.type,
|
type: MapDeviceType.StationStand.type,
|
||||||
label: MapDeviceType.StationStand.label,
|
label: MapDeviceType.StationStand.label,
|
||||||
operation: OperationEvent.StationStand.setStopTime.menu.operation
|
operation: OperationEvent.StationStand.setStopTime.menu.operation
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
let tempDate = null;
|
let tempDate = null;
|
||||||
if (response) {
|
if (response) {
|
||||||
tempDate = response.data;
|
tempDate = response.data;
|
||||||
}
|
}
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
this.$refs.standStopTime.doShow(operate, this.selected, tempDate);
|
this.$refs.standStopTime.doShow(operate, this.selected, tempDate);
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow(operate);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 运行时间控制
|
// 运行时间控制
|
||||||
setRunLevel() {
|
setRunLevel() {
|
||||||
const operate = {
|
const operate = {
|
||||||
start: true,
|
start: true,
|
||||||
send: true,
|
send: true,
|
||||||
code: this.selected.code,
|
code: this.selected.code,
|
||||||
type: MapDeviceType.StationStand.type,
|
type: MapDeviceType.StationStand.type,
|
||||||
label: MapDeviceType.StationStand.label,
|
label: MapDeviceType.StationStand.label,
|
||||||
operation: OperationEvent.StationStand.setRunLevel.menu.operation
|
operation: OperationEvent.StationStand.setRunLevel.menu.operation
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
let tempDate = null;
|
let tempDate = null;
|
||||||
if (response) {
|
if (response) {
|
||||||
tempDate = response.data;
|
tempDate = response.data;
|
||||||
}
|
}
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
this.$refs.standRunLevel.doShow(operate, this.selected, tempDate);
|
this.$refs.standRunLevel.doShow(operate, this.selected, tempDate);
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow(operate);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 设置提前发车
|
// 设置提前发车
|
||||||
earlyDeparture() {
|
earlyDeparture() {
|
||||||
const operate = {
|
const operate = {
|
||||||
start: true,
|
start: true,
|
||||||
code: this.selected.code,
|
code: this.selected.code,
|
||||||
type: MapDeviceType.StationStand.type,
|
type: MapDeviceType.StationStand.type,
|
||||||
operation: OperationEvent.StationStand.earlyDeparture.menu.operation
|
operation: OperationEvent.StationStand.earlyDeparture.menu.operation
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
this.$refs.standControl.doShow(operate, this.selected);
|
this.$refs.standControl.doShow(operate, this.selected);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 设置折返策略
|
// 设置折返策略
|
||||||
setBackStrategy() {
|
setBackStrategy() {
|
||||||
const operate = {
|
const operate = {
|
||||||
start: true,
|
start: true,
|
||||||
send: true,
|
send: true,
|
||||||
code: this.selected.code,
|
code: this.selected.code,
|
||||||
type: MapDeviceType.StationStand.type,
|
type: MapDeviceType.StationStand.type,
|
||||||
operation: OperationEvent.StationStand.setBackStrategy.menu.operation
|
operation: OperationEvent.StationStand.setBackStrategy.menu.operation
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
let tempDate = null;
|
let tempDate = null;
|
||||||
if (response) {
|
if (response) {
|
||||||
tempDate = response.data;
|
tempDate = response.data;
|
||||||
}
|
}
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
this.$refs.standBackStrategy.doShow(operate, this.selected, tempDate);
|
this.$refs.standBackStrategy.doShow(operate, this.selected, tempDate);
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow(operate);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 查询站台状态
|
// 查询站台状态
|
||||||
detail() {
|
detail() {
|
||||||
const operate = {
|
const operate = {
|
||||||
start: true,
|
start: true,
|
||||||
send: true,
|
send: true,
|
||||||
code: this.selected.code,
|
code: this.selected.code,
|
||||||
type: MapDeviceType.StationStand.type,
|
type: MapDeviceType.StationStand.type,
|
||||||
label: MapDeviceType.StationStand.label,
|
label: MapDeviceType.StationStand.label,
|
||||||
operation: OperationEvent.StationStand.detail.menu.operation
|
operation: OperationEvent.StationStand.detail.menu.operation
|
||||||
};
|
};
|
||||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
let tempDate = null;
|
let tempDate = null;
|
||||||
if (response) {
|
if (response) {
|
||||||
tempDate = response.data;
|
tempDate = response.data;
|
||||||
}
|
}
|
||||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||||
this.$refs.standDetail.doShow(operate, this.selected, tempDate);
|
this.$refs.standDetail.doShow(operate, this.selected, tempDate);
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$refs.noticeInfo.doShow(operate);
|
this.$refs.noticeInfo.doShow(operate);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -31,6 +31,7 @@ const CacheControl = () => import('@/views/system/cacheControl/index');
|
|||||||
const SystemGenerate = () => import('@/views/system/systemGenerate/index');
|
const SystemGenerate = () => import('@/views/system/systemGenerate/index');
|
||||||
const IbpDraw = () => import('@/views/system/ibpDraw/index');
|
const IbpDraw = () => import('@/views/system/ibpDraw/index');
|
||||||
const News = () => import('@/views/system/news/index');
|
const News = () => import('@/views/system/news/index');
|
||||||
|
const CommandDictionary = () => import('@/views/system/commandDictionary/index');
|
||||||
|
|
||||||
const Mapedit = () => import('@/views/mapdraft/index');
|
const Mapedit = () => import('@/views/mapdraft/index');
|
||||||
|
|
||||||
@ -806,12 +807,19 @@ export const asyncRouter = [
|
|||||||
i18n: 'router.productEdit'
|
i18n: 'router.productEdit'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{ // 消息公告
|
||||||
path: 'news',
|
path: 'news',
|
||||||
component: News,
|
component: News,
|
||||||
meta: {
|
meta: {
|
||||||
i18n: 'router.newsBulletin'
|
i18n: 'router.newsBulletin'
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{ // 命令管理
|
||||||
|
path: 'commands',
|
||||||
|
component: CommandDictionary,
|
||||||
|
meta: {
|
||||||
|
i18n: 'router.commandDictionary'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -1,121 +1,124 @@
|
|||||||
import store from '@/store';
|
import store from '@/store';
|
||||||
|
|
||||||
const exam = {
|
const exam = {
|
||||||
namespaced: true,
|
namespaced: true,
|
||||||
|
|
||||||
state: {
|
state: {
|
||||||
started: false, // 考试状态
|
deviceCode: '', // 考试目标code
|
||||||
usedTime: 0, // 考试当前所用时间
|
started: false, // 考试状态
|
||||||
totalTime: 0, // 考试总时间
|
usedTime: 0, // 考试当前所用时间
|
||||||
timeInterval: null, // 计时器
|
totalTime: 0, // 考试总时间
|
||||||
suspend: false, // 暂停
|
timeInterval: null, // 计时器
|
||||||
ruleList: [], // 考试规则列表
|
suspend: false, // 暂停
|
||||||
courseDetail: {}, // 课程详情
|
ruleList: [], // 考试规则列表
|
||||||
courseList: [] // 课程列表
|
courseDetail: {}, // 课程详情
|
||||||
},
|
courseList: [] // 课程列表
|
||||||
getters: {
|
},
|
||||||
started: (state) => {
|
getters: {
|
||||||
return state.started;
|
started: (state) => {
|
||||||
},
|
return state.started;
|
||||||
usedTime: (state) => {
|
},
|
||||||
return state.usedTime;
|
usedTime: (state) => {
|
||||||
},
|
return state.usedTime;
|
||||||
totalTime: (state) => {
|
},
|
||||||
return state.totalTime;
|
totalTime: (state) => {
|
||||||
},
|
return state.totalTime;
|
||||||
suspend: (state) => {
|
},
|
||||||
return state.suspend;
|
suspend: (state) => {
|
||||||
}
|
return state.suspend;
|
||||||
},
|
}
|
||||||
mutations: {
|
},
|
||||||
setStarted: (state, started) => {
|
mutations: {
|
||||||
state.started = started;
|
setStarted: (state, started) => {
|
||||||
},
|
state.started = started;
|
||||||
setSuspend: (state, suspend) => {
|
},
|
||||||
state.suspend = suspend;
|
setSuspend: (state, suspend) => {
|
||||||
},
|
state.suspend = suspend;
|
||||||
setUsedTime: (state, usedTime) => {
|
},
|
||||||
state.usedTime = usedTime;
|
setUsedTime: (state, usedTime) => {
|
||||||
},
|
state.usedTime = usedTime;
|
||||||
setTotalTime: (state, totalTime) => {
|
},
|
||||||
state.totalTime = totalTime;
|
setTotalTime: (state, totalTime) => {
|
||||||
},
|
state.totalTime = totalTime;
|
||||||
countUsedTime: (state) => {
|
},
|
||||||
if (state.timeInterval) {
|
countUsedTime: (state) => {
|
||||||
clearInterval(state.timeInterval);
|
if (state.timeInterval) {
|
||||||
state.timeInterval = null;
|
clearInterval(state.timeInterval);
|
||||||
}
|
state.timeInterval = null;
|
||||||
state.timeInterval = setInterval(() => {
|
}
|
||||||
if (!state.suspend) {
|
state.timeInterval = setInterval(() => {
|
||||||
state.usedTime++;
|
if (!state.suspend) {
|
||||||
}
|
state.usedTime++;
|
||||||
}, 1000);
|
}
|
||||||
},
|
}, 1000);
|
||||||
stopCountTime: (state) => {
|
},
|
||||||
if (state.timeInterval) {
|
stopCountTime: (state) => {
|
||||||
clearInterval(state.timeInterval);
|
if (state.timeInterval) {
|
||||||
state.timeInterval = null;
|
clearInterval(state.timeInterval);
|
||||||
}
|
state.timeInterval = null;
|
||||||
},
|
}
|
||||||
setRuleList: (state, ruleList) => {
|
},
|
||||||
state.ruleList = ruleList;
|
setRuleList: (state, ruleList) => {
|
||||||
},
|
state.ruleList = ruleList;
|
||||||
setCourseDetail: (state, courseDetail) => {
|
},
|
||||||
state.courseDetail = courseDetail;
|
setCourseDetail: (state, courseDetail) => {
|
||||||
},
|
state.courseDetail = courseDetail;
|
||||||
setCourse: (state, courseList) => {
|
},
|
||||||
state.courseList = courseList;
|
setCourse: (state, courseList) => {
|
||||||
}
|
state.courseList = courseList;
|
||||||
},
|
},
|
||||||
actions: {
|
setCenter: (state, deviceCode) => {
|
||||||
start({ commit }) {
|
state.deviceCode = deviceCode;
|
||||||
commit('setStarted', true);
|
}
|
||||||
commit('setSuspend', false);
|
},
|
||||||
commit('setUsedTime', 0);
|
actions: {
|
||||||
commit('countUsedTime');
|
start({ commit }) {
|
||||||
},
|
commit('setStarted', true);
|
||||||
over({ commit }) {
|
commit('setSuspend', false);
|
||||||
commit('setStarted', false);
|
commit('setUsedTime', 0);
|
||||||
commit('setSuspend', true);
|
commit('countUsedTime');
|
||||||
commit('setUsedTime', 0);
|
},
|
||||||
commit('stopCountTime');
|
over({ commit }) {
|
||||||
},
|
commit('setStarted', false);
|
||||||
isOver() {
|
commit('setSuspend', true);
|
||||||
const trainingList = store.getters['trainingList/trainingList'];
|
commit('setUsedTime', 0);
|
||||||
const doList = trainingList.filter(elem => {
|
commit('stopCountTime');
|
||||||
if (elem.usedTime !== undefined) return true;
|
},
|
||||||
});
|
isOver() {
|
||||||
|
const trainingList = store.getters['trainingList/trainingList'];
|
||||||
|
const doList = trainingList.filter(elem => {
|
||||||
|
if (elem.usedTime !== undefined) return true;
|
||||||
|
});
|
||||||
|
|
||||||
if (doList.length >= trainingList.length) {
|
if (doList.length >= trainingList.length) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
setSuspend({ commit }, suspend) {
|
setSuspend({ commit }, suspend) {
|
||||||
commit('setSuspend', suspend);
|
commit('setSuspend', suspend);
|
||||||
},
|
},
|
||||||
setUsedTime({ state }, usedTime) {
|
setUsedTime({ commit }, usedTime) {
|
||||||
if (usedTime) {
|
commit('setUsedTime', usedTime || 0);
|
||||||
state.usedTime = usedTime;
|
},
|
||||||
}
|
setTotalTime({ commit }, totalTime) {
|
||||||
},
|
commit('setTotalTime', totalTime || 0);
|
||||||
setTotalTime({ commit }, totalTime) {
|
},
|
||||||
if (totalTime) {
|
countUsedTime({ commit }) {
|
||||||
commit('setTotalTime', totalTime);
|
commit('countUsedTime');
|
||||||
}
|
},
|
||||||
},
|
setRuleList({ commit }, ruleList) {
|
||||||
countUsedTime({ commit }) {
|
commit('setRuleList', ruleList);
|
||||||
commit('countUsedTime');
|
},
|
||||||
},
|
setCourseDetail({ commit }, courseDetail) {
|
||||||
setRuleList({ commit }, ruleList) {
|
commit('setCourseDetail', courseDetail);
|
||||||
commit('setRuleList', ruleList);
|
},
|
||||||
},
|
setCourse({ commit }, course) {
|
||||||
setCourseDetail({ commit }, courseDetail) {
|
commit('setCourse', course);
|
||||||
commit('setCourseDetail', courseDetail);
|
},
|
||||||
},
|
setCenter({ commit }, deviceCode) {
|
||||||
setCourse({ commit }, course) {
|
commit('setCenter', deviceCode);
|
||||||
commit('setCourse', course);
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default exam;
|
export default exam;
|
||||||
|
@ -530,6 +530,7 @@ const map = {
|
|||||||
if (map && map.skinVO) {
|
if (map && map.skinVO) {
|
||||||
state.map = map;
|
state.map = map;
|
||||||
state.mapDevice = parser(map, map.skinVO.code);
|
state.mapDevice = parser(map, map.skinVO.code);
|
||||||
|
Vue.prototype.$jlmap.setMapDevice(state.mapDevice);
|
||||||
} else {
|
} else {
|
||||||
state.mapDevice = {};
|
state.mapDevice = {};
|
||||||
}
|
}
|
||||||
|
@ -3,11 +3,11 @@ export function getBaseUrl() {
|
|||||||
let BASE_API;
|
let BASE_API;
|
||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
// BASE_API = 'https://joylink.club/jlcloud';
|
// BASE_API = 'https://joylink.club/jlcloud';
|
||||||
BASE_API = 'https://test.joylink.club/jlcloud';
|
// BASE_API = 'https://test.joylink.club/jlcloud';
|
||||||
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
|
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
|
||||||
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
||||||
// BASE_API = 'http://192.168.3.41:9000'; // 杜闪
|
// BASE_API = 'http://192.168.3.41:9000'; // 杜闪
|
||||||
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
|
BASE_API = 'http://192.168.3.82:9000'; // 杜康
|
||||||
} else {
|
} else {
|
||||||
BASE_API = process.env.VUE_APP_BASE_API;
|
BASE_API = process.env.VUE_APP_BASE_API;
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
import TipExamList from './tipExamList';
|
import TipExamList from './tipExamList';
|
||||||
import { Notification } from 'element-ui';
|
import { Notification } from 'element-ui';
|
||||||
import { startTraining } from '@/api/jmap/training';
|
import { startTraining } from '@/api/jmap/training';
|
||||||
import { exitFullscreen } from '@/utils/screen';
|
// import { exitFullscreen } from '@/utils/screen';
|
||||||
import { timeFormat } from '@/utils/date';
|
import { timeFormat } from '@/utils/date';
|
||||||
import { refreshExamList, finishOneExamQuestion } from '@/api/management/userexam';
|
import { refreshExamList, finishOneExamQuestion } from '@/api/management/userexam';
|
||||||
import { launchFullscreen } from '@/utils/screen';
|
import { launchFullscreen } from '@/utils/screen';
|
||||||
|
@ -148,7 +148,7 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (obj) {
|
if (obj) {
|
||||||
getTrainingDetail(obj.trainingId ).then(res => {
|
getTrainingDetail(obj.trainingId).then(res => {
|
||||||
this.courseModel = {
|
this.courseModel = {
|
||||||
id: res.data.id,
|
id: res.data.id,
|
||||||
name: res.data.name,
|
name: res.data.name,
|
||||||
@ -157,6 +157,7 @@ export default {
|
|||||||
minDuration: res.data.minDuration,
|
minDuration: res.data.minDuration,
|
||||||
updateTime: res.data.updateTime
|
updateTime: res.data.updateTime
|
||||||
};
|
};
|
||||||
|
this.$store.dispatch('exam/setCenter ', res.data.locateDeviceCode);
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
this.$message.error(this.$t('display.exam.getTestInformation') + ':' + error.message);
|
this.$message.error(this.$t('display.exam.getTestInformation') + ':' + error.message);
|
||||||
});
|
});
|
||||||
|
@ -89,6 +89,9 @@ export default {
|
|||||||
'$store.state.training.rezoomCount': function (val, old) {
|
'$store.state.training.rezoomCount': function (val, old) {
|
||||||
this.setCenter(this.$store.state.training.offsetStationCode);
|
this.setCenter(this.$store.state.training.offsetStationCode);
|
||||||
},
|
},
|
||||||
|
'$store.state.exam.deviceCode': function (val) {
|
||||||
|
val && this.setCenter(val);
|
||||||
|
},
|
||||||
'$store.state.config.canvasSizeCount': function (val) {
|
'$store.state.config.canvasSizeCount': function (val) {
|
||||||
this.resetSize();
|
this.resetSize();
|
||||||
},
|
},
|
||||||
|
131
src/views/system/commandDictionary/edit.vue
Normal file
131
src/views/system/commandDictionary/edit.vue
Normal file
@ -0,0 +1,131 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="500px" :before-close="handleClose" center :close-on-click-modal="false">
|
||||||
|
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
|
||||||
|
<el-button @click="dialogVisible = false">{{ $t('global.cancel') }}</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { create, getData, update } from '@/api/management/dictionary';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'DictionaryEdit',
|
||||||
|
props: {
|
||||||
|
type: {
|
||||||
|
type: String,
|
||||||
|
required: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dialogVisible: false,
|
||||||
|
formModel: {
|
||||||
|
code: '',
|
||||||
|
name: '',
|
||||||
|
status: '1',
|
||||||
|
remarks: ''
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
form() {
|
||||||
|
const isAdd = this.type === 'ADD';
|
||||||
|
const form = {
|
||||||
|
labelWidth: '120px',
|
||||||
|
items: [
|
||||||
|
{ prop: 'controlMode', label: this.$t('system.controlMode'), type: 'text', required: true, disabled: !isAdd },
|
||||||
|
{ prop: 'deviceType', label: this.$t('system.deviceType'), type: 'select', required: true, options: this.$ConstSelect.Status },
|
||||||
|
{ prop: 'lineCode', label: this.$t('system.lineCode'), type: 'select', required: true, options: this.$ConstSelect.Status },
|
||||||
|
{ prop: 'role', label: this.$t('system.simulationRole'), type: 'select', required: true, options: this.$ConstSelect.Status },
|
||||||
|
{ prop: 'type', label: this.$t('system.instructionType'), type: 'select', required: true, options: this.$ConstSelect.Status }
|
||||||
|
]
|
||||||
|
};
|
||||||
|
return form;
|
||||||
|
},
|
||||||
|
rules() {
|
||||||
|
return {
|
||||||
|
controlMode: [
|
||||||
|
{ required: true, message: this.$t('rules.pleaseSelectStatus'), trigger: 'change' }
|
||||||
|
],
|
||||||
|
deviceType: [
|
||||||
|
{ required: true, message: this.$t('rules.pleaseSelectStatus'), trigger: 'change' }
|
||||||
|
],
|
||||||
|
lineCode: [
|
||||||
|
{ required: true, message: this.$t('rules.pleaseSelectStatus'), trigger: 'change' }
|
||||||
|
],
|
||||||
|
role: [
|
||||||
|
{ required: true, message: this.$t('rules.pleaseSelectStatus'), trigger: 'change' }
|
||||||
|
],
|
||||||
|
type: [
|
||||||
|
{ required: true, message: this.$t('rules.pleaseSelectStatus'), trigger: 'change' }
|
||||||
|
]
|
||||||
|
};
|
||||||
|
},
|
||||||
|
title() {
|
||||||
|
if (this.type === 'ADD') {
|
||||||
|
return this.$t('system.createDirective');
|
||||||
|
} else {
|
||||||
|
return this.$t('system.editDirective');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
show(id) {
|
||||||
|
this.dialogVisible = true;
|
||||||
|
if (id) {
|
||||||
|
getData(id).then(response => {
|
||||||
|
this.formModel = response.data;
|
||||||
|
this.$refs.dataform.resetForm();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
doSave() {
|
||||||
|
const self = this;
|
||||||
|
this.$refs.dataform.validateForm(() => {
|
||||||
|
if (self.type === 'ADD') {
|
||||||
|
self.create();
|
||||||
|
} else {
|
||||||
|
self.update();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
create() {
|
||||||
|
const self = this;
|
||||||
|
create(this.formModel).then(response => {
|
||||||
|
self.$message.success(this.$t('system.createSuccess'));
|
||||||
|
self.handleClose();
|
||||||
|
self.$emit('reloadTable');
|
||||||
|
}).catch(error => {
|
||||||
|
self.$message.error(`${this.$t('error.createDictionaryFailed')}:${error.message}`);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
update() {
|
||||||
|
const self = this;
|
||||||
|
update(this.formModel).then(response => {
|
||||||
|
self.$message.success(this.$t('system.updateSuccess'));
|
||||||
|
self.handleClose();
|
||||||
|
self.$emit('reloadTable');
|
||||||
|
}).catch(error => {
|
||||||
|
self.$message.error(`${this.$t('error.updateDictionaryFailed')}:${error.message}`);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleClose(done) {
|
||||||
|
this.formModel = {
|
||||||
|
code: '',
|
||||||
|
name: '',
|
||||||
|
status: '1',
|
||||||
|
remarks: ''
|
||||||
|
};
|
||||||
|
this.$refs.dataform.resetForm();
|
||||||
|
if (done) {
|
||||||
|
done();
|
||||||
|
} else {
|
||||||
|
this.dialogVisible = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
163
src/views/system/commandDictionary/index.vue
Normal file
163
src/views/system/commandDictionary/index.vue
Normal file
@ -0,0 +1,163 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||||
|
<dictionary-edit ref="create" type="ADD" @reloadTable="reloadTable" />
|
||||||
|
<dictionary-edit ref="edit" type="EDIT" @reloadTable="reloadTable" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getCommandList, delCommand } from '@/api/management/dictionary';
|
||||||
|
import { listPublishMap } from '@/api/jmap/map';
|
||||||
|
import DictionaryEdit from './edit';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'CommandDictionary',
|
||||||
|
components: {
|
||||||
|
DictionaryEdit
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
taskStatusList: [],
|
||||||
|
pagerConfig: {
|
||||||
|
pageSize: 'pageSize',
|
||||||
|
pageIndex: 'pageNum'
|
||||||
|
},
|
||||||
|
queryForm: {
|
||||||
|
labelWidth: '80px',
|
||||||
|
reset: true,
|
||||||
|
queryObject: {
|
||||||
|
lineCode: {
|
||||||
|
type: 'select',
|
||||||
|
label: this.$t('system.lineCode'),
|
||||||
|
config: {
|
||||||
|
data: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
deviceType: {
|
||||||
|
type: 'select',
|
||||||
|
label: this.$t('system.deviceType'),
|
||||||
|
config: {
|
||||||
|
data: []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
queryList: {
|
||||||
|
query: this.queryFunction,
|
||||||
|
selectCheckShow: false,
|
||||||
|
indexShow: true,
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
title: this.$t('system.controlMode'), // 控制模式
|
||||||
|
prop: 'controlMode'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: this.$t('system.deviceType'), // 设备类型
|
||||||
|
prop: 'deviceType'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: this.$t('system.lineCode'), // 线路编号
|
||||||
|
prop: 'lineCode',
|
||||||
|
type: 'tag',
|
||||||
|
columnValue: (row) => { return this.$convertField(row.lineCode, this.taskStatusList, ['lineCode', 'name']); },
|
||||||
|
tagType: (row) => { return 'success'; }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: this.$t('system.simulationRole'), // 仿真角色
|
||||||
|
prop: 'role'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: this.$t('system.instructionType'), // 指令类型
|
||||||
|
prop: 'type'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'button',
|
||||||
|
title: this.$t('global.operate'),
|
||||||
|
width: '250',
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
name: this.$t('system.paramDetail'),
|
||||||
|
handleClick: this.handleDetail
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: this.$t('global.edit'),
|
||||||
|
handleClick: this.handleEdit
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: this.$t('global.delete'),
|
||||||
|
handleClick: this.handleDelete,
|
||||||
|
type: 'danger'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
actions: [
|
||||||
|
{ text: this.$t('global.add'), handler: this.handleAdd }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
currentModel: {}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
mounted () {
|
||||||
|
this.loadInitData();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async loadInitData() {
|
||||||
|
try {
|
||||||
|
this.taskStatusList = [];
|
||||||
|
this.mapList = [];
|
||||||
|
const list = await listPublishMap();
|
||||||
|
this.taskStatusList = list.data;
|
||||||
|
list.data.forEach(elem => {
|
||||||
|
this.queryForm.queryObject.lineCode.config.data.push({ value: elem.lineCode, label: elem.name });
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
queryFunction(params) {
|
||||||
|
if (!params['lineCode']) {
|
||||||
|
params['lineCode'] = '';
|
||||||
|
}
|
||||||
|
return getCommandList(params);
|
||||||
|
},
|
||||||
|
|
||||||
|
handleDetail(index, row) {
|
||||||
|
console.log(index, row);
|
||||||
|
},
|
||||||
|
|
||||||
|
handleEdit(index, row) {
|
||||||
|
console.log(index, row);
|
||||||
|
// this.$refs.edit.show(row.id);
|
||||||
|
},
|
||||||
|
|
||||||
|
handleAdd() {
|
||||||
|
this.$refs.create.show();
|
||||||
|
},
|
||||||
|
|
||||||
|
handleDelete(index, row) {
|
||||||
|
this.$confirm(this.$t('system.wellDelType'), this.$t('global.tips'), {
|
||||||
|
confirmButtonText: this.$t('global.confirm'),
|
||||||
|
cancelButtonText: this.$t('global.cancel'),
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
delCommand(row.id).then(response => {
|
||||||
|
this.$message.success(this.$t('system.deleteSuccess'));
|
||||||
|
this.reloadTable();
|
||||||
|
}).catch(() => {
|
||||||
|
this.reloadTable();
|
||||||
|
this.$messageBox(this.$t('error.deleteFailed'));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
reloadTable() {
|
||||||
|
this.queryList.reload();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
Loading…
Reference in New Issue
Block a user