desc: 修改代码
This commit is contained in:
parent
1b564c2958
commit
9bfad2fdeb
@ -1,51 +1,51 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
export function list(params) {
|
||||
return request({
|
||||
url: '/api/dictionary/list',
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
return request({
|
||||
url: '/api/dictionary/list',
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
export function checkDicCodeExist(code) {
|
||||
return request({
|
||||
url: '/api/dictionary/checkExistByCode',
|
||||
method: 'get',
|
||||
params: {
|
||||
code: code
|
||||
}
|
||||
});
|
||||
return request({
|
||||
url: '/api/dictionary/checkExistByCode',
|
||||
method: 'get',
|
||||
params: {
|
||||
code: code
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export function getData(id) {
|
||||
return request({
|
||||
url: `/api/dictionary/${id}`,
|
||||
method: 'get'
|
||||
});
|
||||
return request({
|
||||
url: `/api/dictionary/${id}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
export function create(data) {
|
||||
return request({
|
||||
url: '/api/dictionary/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
return request({
|
||||
url: '/api/dictionary/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
export function del(id) {
|
||||
return request({
|
||||
url: `/api/dictionary/delete/${id}`,
|
||||
method: 'delete'
|
||||
});
|
||||
return request({
|
||||
url: `/api/dictionary/delete/${id}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
|
||||
export function update(data) {
|
||||
return request({
|
||||
url: `/api/dictionary/update/${data.id}`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
return request({
|
||||
url: `/api/dictionary/update/${data.id}`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -53,11 +53,28 @@ export function update(data) {
|
||||
* @param {*} code
|
||||
*/
|
||||
export function getDetailList(code) {
|
||||
return request({
|
||||
url: '/api/dictionary/getDetailListByCode',
|
||||
method: 'get',
|
||||
params: {
|
||||
code: code
|
||||
}
|
||||
});
|
||||
return request({
|
||||
url: '/api/dictionary/getDetailListByCode',
|
||||
method: 'get',
|
||||
params: {
|
||||
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',
|
||||
runGraphReleaseApplication: 'Run graph release application',
|
||||
subsystemGeneration: 'Subsystem generation',
|
||||
newsBulletin: 'New bulletin'
|
||||
newsBulletin: 'New bulletin',
|
||||
commandDictionary: 'Command dictionary'
|
||||
};
|
||||
|
@ -53,5 +53,13 @@ export default {
|
||||
newsHeadlines: 'News headlines:',
|
||||
newsContent: 'News content:',
|
||||
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: '剧本发布申请',
|
||||
runGraphReleaseApplication: '运行图发布申请',
|
||||
subsystemGeneration: '子系统生成',
|
||||
newsBulletin: '消息公告'
|
||||
newsBulletin: '消息公告',
|
||||
commandDictionary: '命令字典'
|
||||
};
|
||||
|
@ -53,5 +53,13 @@ export default {
|
||||
newsHeadlines: '消息标题:',
|
||||
newsContent: '消息内容:',
|
||||
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); }
|
||||
}
|
||||
|
||||
setMapDevice(mapDevice) {
|
||||
this.mapDevice = mapDevice;
|
||||
}
|
||||
|
||||
setDefaultState() {
|
||||
const list = [];
|
||||
|
||||
|
@ -29,480 +29,480 @@ import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItem
|
||||
import { mouseCancelState } from './utils/menuItemStatus';
|
||||
|
||||
export default {
|
||||
name: 'StationStandMenu',
|
||||
components: {
|
||||
PopMenu,
|
||||
StandControl,
|
||||
StandJumpStopControl,
|
||||
StandDetail,
|
||||
StandRunLevel,
|
||||
NoticeInfo,
|
||||
StandBackStrategy,
|
||||
StandStopTime,
|
||||
StandDetainTrainAll
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
default() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menu: [],
|
||||
menuNormal: {
|
||||
local: [
|
||||
{
|
||||
label: '设置扣车',
|
||||
handler: this.setDetainTrain,
|
||||
disabledCallback: MenuDisabledState.StationStand.setDetainTrain,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: '取消扣车',
|
||||
handler: this.cancelDetainTrain,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrain,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '设置跳停',
|
||||
handler: this.setJumpStop,
|
||||
disabledCallback: MenuDisabledState.StationStand.setJumpStop,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: '取消跳停',
|
||||
handler: this.cancelJumpStop,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelJumpStop,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
type: 'separator'
|
||||
},
|
||||
{
|
||||
label: '提前发车',
|
||||
handler: this.earlyDeparture,
|
||||
disabledCallback: MenuDisabledState.StationStand.earlyDeparture,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '设置停站时间',
|
||||
handler: this.setStopTime,
|
||||
disabledCallback: MenuDisabledState.StationStand.setStopTime,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
type: 'separator'
|
||||
},
|
||||
{
|
||||
label: '站台详细信息',
|
||||
handler: this.detail,
|
||||
disabledCallback: MenuDisabledState.StationStand.detail,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '运行时间控制',
|
||||
handler: this.setRunLevel,
|
||||
disabledCallback: MenuDisabledState.StationStand.setRunLevel,
|
||||
auth: { station: false, center: false }
|
||||
},
|
||||
{
|
||||
label: '设置提前发车',
|
||||
handler: this.earlyDeparture,
|
||||
disabledCallback: MenuDisabledState.StationStand.earlyDeparture,
|
||||
auth: { station: false, center: false }
|
||||
},
|
||||
{
|
||||
label: '人工折返策略设置',
|
||||
handler: this.setBackStrategy,
|
||||
disabledCallback: MenuDisabledState.StationStand.setBackStrategy,
|
||||
auth: { station: false, center: false }
|
||||
},
|
||||
{
|
||||
label: '查询站台状态',
|
||||
handler: this.detail,
|
||||
disabledCallback: MenuDisabledState.StationStand.detail,
|
||||
auth: { station: false, center: false }
|
||||
}
|
||||
],
|
||||
central: [
|
||||
{
|
||||
label: '设置扣车',
|
||||
handler: this.setDetainTrain,
|
||||
disabledCallback: MenuDisabledState.StationStand.setDetainTrain,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '取消扣车',
|
||||
handler: this.cancelDetainTrain,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrain,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '设置跳停',
|
||||
handler: this.setJumpStop,
|
||||
disabledCallback: MenuDisabledState.StationStand.setJumpStop,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '取消跳停',
|
||||
handler: this.cancelJumpStop,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelJumpStop,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '提前发车',
|
||||
handler: this.earlyDeparture,
|
||||
disabledCallback: MenuDisabledState.StationStand.earlyDeparture,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
type: 'separator'
|
||||
},
|
||||
{
|
||||
label: '停站时间控制',
|
||||
handler: this.setStopTime,
|
||||
disabledCallback: MenuDisabledState.StationStand.setStopTime,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '运行时间控制',
|
||||
handler: this.setRunLevel,
|
||||
disabledCallback: MenuDisabledState.StationStand.setRunLevel,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '变通策略管理',
|
||||
handler: this.setBackStrategy,
|
||||
disabledCallback: MenuDisabledState.StationStand.setBackStrategy,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
type: 'separator'
|
||||
},
|
||||
{
|
||||
label: '站台信息',
|
||||
handler: this.detail,
|
||||
disabledCallback: MenuDisabledState.StationStand.detail,
|
||||
auth: { station: true, center: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
menuForce: [
|
||||
{
|
||||
label: '设置故障',
|
||||
handler: this.setStoppage,
|
||||
disabledCallback: MenuDisabledState.StationStand.setStoppage
|
||||
},
|
||||
{
|
||||
label: '取消故障',
|
||||
handler: this.cancelStoppage,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelStoppage
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('training', [
|
||||
'mode',
|
||||
'operatemode'
|
||||
]),
|
||||
...mapGetters('menuOperation', [
|
||||
'buttonOperation'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function (val) {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.StationStand) && !this.buttonOperation) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickEvent() {
|
||||
const self = this;
|
||||
window.onclick = function (e) {
|
||||
self.doClose();
|
||||
};
|
||||
},
|
||||
initMenu() {
|
||||
// 编辑模式菜单列表
|
||||
this.menu = menuFiltration(this.menuNormal);
|
||||
if (this.operatemode === OperateMode.ADMIN) {
|
||||
this.menu = [...this.menu, ...this.menuForce];
|
||||
}
|
||||
name: 'StationStandMenu',
|
||||
components: {
|
||||
PopMenu,
|
||||
StandControl,
|
||||
StandJumpStopControl,
|
||||
StandDetail,
|
||||
StandRunLevel,
|
||||
NoticeInfo,
|
||||
StandBackStrategy,
|
||||
StandStopTime,
|
||||
StandDetainTrainAll
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
default() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menu: [],
|
||||
menuNormal: {
|
||||
local: [
|
||||
{
|
||||
label: '设置扣车',
|
||||
handler: this.setDetainTrain,
|
||||
disabledCallback: MenuDisabledState.StationStand.setDetainTrain,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: '取消扣车',
|
||||
handler: this.cancelDetainTrain,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrain,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '设置跳停',
|
||||
handler: this.setJumpStop,
|
||||
disabledCallback: MenuDisabledState.StationStand.setJumpStop,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: '取消跳停',
|
||||
handler: this.cancelJumpStop,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelJumpStop,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
type: 'separator'
|
||||
},
|
||||
{
|
||||
label: '提前发车',
|
||||
handler: this.earlyDeparture,
|
||||
disabledCallback: MenuDisabledState.StationStand.earlyDeparture,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '设置停站时间',
|
||||
handler: this.setStopTime,
|
||||
disabledCallback: MenuDisabledState.StationStand.setStopTime,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
type: 'separator'
|
||||
},
|
||||
{
|
||||
label: '站台详细信息',
|
||||
handler: this.detail,
|
||||
disabledCallback: MenuDisabledState.StationStand.detail,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '运行时间控制',
|
||||
handler: this.setRunLevel,
|
||||
disabledCallback: MenuDisabledState.StationStand.setRunLevel,
|
||||
auth: { station: false, center: false }
|
||||
},
|
||||
{
|
||||
label: '设置提前发车',
|
||||
handler: this.earlyDeparture,
|
||||
disabledCallback: MenuDisabledState.StationStand.earlyDeparture,
|
||||
auth: { station: false, center: false }
|
||||
},
|
||||
{
|
||||
label: '人工折返策略设置',
|
||||
handler: this.setBackStrategy,
|
||||
disabledCallback: MenuDisabledState.StationStand.setBackStrategy,
|
||||
auth: { station: false, center: false }
|
||||
},
|
||||
{
|
||||
label: '查询站台状态',
|
||||
handler: this.detail,
|
||||
disabledCallback: MenuDisabledState.StationStand.detail,
|
||||
auth: { station: false, center: false }
|
||||
}
|
||||
],
|
||||
central: [
|
||||
{
|
||||
label: '设置扣车',
|
||||
handler: this.setDetainTrain,
|
||||
disabledCallback: MenuDisabledState.StationStand.setDetainTrain,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '取消扣车',
|
||||
handler: this.cancelDetainTrain,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrain,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '设置跳停',
|
||||
handler: this.setJumpStop,
|
||||
disabledCallback: MenuDisabledState.StationStand.setJumpStop,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '取消跳停',
|
||||
handler: this.cancelJumpStop,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelJumpStop,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '提前发车',
|
||||
handler: this.earlyDeparture,
|
||||
disabledCallback: MenuDisabledState.StationStand.earlyDeparture,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
type: 'separator'
|
||||
},
|
||||
{
|
||||
label: '停站时间控制',
|
||||
handler: this.setStopTime,
|
||||
disabledCallback: MenuDisabledState.StationStand.setStopTime,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '运行时间控制',
|
||||
handler: this.setRunLevel,
|
||||
disabledCallback: MenuDisabledState.StationStand.setRunLevel,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '变通策略管理',
|
||||
handler: this.setBackStrategy,
|
||||
disabledCallback: MenuDisabledState.StationStand.setBackStrategy,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
type: 'separator'
|
||||
},
|
||||
{
|
||||
label: '站台信息',
|
||||
handler: this.detail,
|
||||
disabledCallback: MenuDisabledState.StationStand.detail,
|
||||
auth: { station: true, center: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
menuForce: [
|
||||
{
|
||||
label: '设置故障',
|
||||
handler: this.setStoppage,
|
||||
disabledCallback: MenuDisabledState.StationStand.setStoppage
|
||||
},
|
||||
{
|
||||
label: '取消故障',
|
||||
handler: this.cancelStoppage,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelStoppage
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('training', [
|
||||
'mode',
|
||||
'operatemode'
|
||||
]),
|
||||
...mapGetters('menuOperation', [
|
||||
'buttonOperation'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function (val) {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.StationStand) && !this.buttonOperation) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickEvent() {
|
||||
const self = this;
|
||||
window.onclick = function (e) {
|
||||
self.doClose();
|
||||
};
|
||||
},
|
||||
initMenu() {
|
||||
// 编辑模式菜单列表
|
||||
this.menu = menuFiltration(this.menuNormal);
|
||||
if (this.operatemode === OperateMode.ADMIN) {
|
||||
this.menu = [...this.menu, ...this.menuForce];
|
||||
}
|
||||
|
||||
// 故障模式菜单列表
|
||||
if (this.operatemode === OperateMode.FAULT) {
|
||||
this.menu = this.menuForce;
|
||||
}
|
||||
// 故障模式菜单列表
|
||||
if (this.operatemode === OperateMode.FAULT) {
|
||||
this.menu = this.menuForce;
|
||||
}
|
||||
|
||||
this.menu = menuConvert(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();
|
||||
}
|
||||
},
|
||||
// 设置故障
|
||||
setStoppage() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.stoppage.menu.operation
|
||||
};
|
||||
this.menu = menuConvert(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();
|
||||
}
|
||||
},
|
||||
// 设置故障
|
||||
setStoppage() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.stoppage.menu.operation
|
||||
};
|
||||
|
||||
mouseCancelState(this.selected);
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 取消故障
|
||||
cancelStoppage() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.cancelStoppage.menu.operation
|
||||
};
|
||||
mouseCancelState(this.selected);
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 取消故障
|
||||
cancelStoppage() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.cancelStoppage.menu.operation
|
||||
};
|
||||
|
||||
mouseCancelState(this.selected);
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 设置扣车
|
||||
setDetainTrain() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.setDetainTrain.menu.operation
|
||||
};
|
||||
mouseCancelState(this.selected);
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 设置扣车
|
||||
setDetainTrain() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.setDetainTrain.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 取消扣车
|
||||
cancelDetainTrain() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 强制取消扣车
|
||||
cancelDetainTrainForce() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.cancelDetainTrainForce.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 全线取消扣车
|
||||
cancelDetainTrainAll() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.cancelDetainTrainAll.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standDetainTrainAll.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置跳停
|
||||
setJumpStop() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.setJumpStop.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standJumpStopControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 取消跳停
|
||||
cancelJumpStop() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.cancelJumpStop.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standJumpStopControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 停站时间控制
|
||||
setStopTime() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.setStopTime.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||
if (valid) {
|
||||
let tempDate = null;
|
||||
if (response) {
|
||||
tempDate = response.data;
|
||||
}
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standStopTime.doShow(operate, this.selected, tempDate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 运行时间控制
|
||||
setRunLevel() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.setRunLevel.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||
if (valid) {
|
||||
let tempDate = null;
|
||||
if (response) {
|
||||
tempDate = response.data;
|
||||
}
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standRunLevel.doShow(operate, this.selected, tempDate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 设置提前发车
|
||||
earlyDeparture() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.earlyDeparture.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置折返策略
|
||||
setBackStrategy() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.setBackStrategy.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 取消扣车
|
||||
cancelDetainTrain() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 强制取消扣车
|
||||
cancelDetainTrainForce() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.cancelDetainTrainForce.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 全线取消扣车
|
||||
cancelDetainTrainAll() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.cancelDetainTrainAll.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standDetainTrainAll.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置跳停
|
||||
setJumpStop() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.setJumpStop.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standJumpStopControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 取消跳停
|
||||
cancelJumpStop() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.cancelJumpStop.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standJumpStopControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 停站时间控制
|
||||
setStopTime() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.setStopTime.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||
if (valid) {
|
||||
let tempDate = null;
|
||||
if (response) {
|
||||
tempDate = response.data;
|
||||
}
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standStopTime.doShow(operate, this.selected, tempDate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 运行时间控制
|
||||
setRunLevel() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.setRunLevel.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||
if (valid) {
|
||||
let tempDate = null;
|
||||
if (response) {
|
||||
tempDate = response.data;
|
||||
}
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standRunLevel.doShow(operate, this.selected, tempDate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 设置提前发车
|
||||
earlyDeparture() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.earlyDeparture.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置折返策略
|
||||
setBackStrategy() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.setBackStrategy.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||
if (valid) {
|
||||
let tempDate = null;
|
||||
if (response) {
|
||||
tempDate = response.data;
|
||||
}
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standBackStrategy.doShow(operate, this.selected, tempDate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 查询站台状态
|
||||
detail() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.detail.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||
if (valid) {
|
||||
let tempDate = null;
|
||||
if (response) {
|
||||
tempDate = response.data;
|
||||
}
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standDetail.doShow(operate, this.selected, tempDate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
}
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||
if (valid) {
|
||||
let tempDate = null;
|
||||
if (response) {
|
||||
tempDate = response.data;
|
||||
}
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standBackStrategy.doShow(operate, this.selected, tempDate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 查询站台状态
|
||||
detail() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.detail.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||
if (valid) {
|
||||
let tempDate = null;
|
||||
if (response) {
|
||||
tempDate = response.data;
|
||||
}
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standDetail.doShow(operate, this.selected, tempDate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</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 IbpDraw = () => import('@/views/system/ibpDraw/index');
|
||||
const News = () => import('@/views/system/news/index');
|
||||
const CommandDictionary = () => import('@/views/system/commandDictionary/index');
|
||||
|
||||
const Mapedit = () => import('@/views/mapdraft/index');
|
||||
|
||||
@ -806,12 +807,19 @@ export const asyncRouter = [
|
||||
i18n: 'router.productEdit'
|
||||
}
|
||||
},
|
||||
{
|
||||
{ // 消息公告
|
||||
path: 'news',
|
||||
component: News,
|
||||
meta: {
|
||||
i18n: 'router.newsBulletin'
|
||||
}
|
||||
},
|
||||
{ // 命令管理
|
||||
path: 'commands',
|
||||
component: CommandDictionary,
|
||||
meta: {
|
||||
i18n: 'router.commandDictionary'
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -1,121 +1,124 @@
|
||||
import store from '@/store';
|
||||
|
||||
const exam = {
|
||||
namespaced: true,
|
||||
namespaced: true,
|
||||
|
||||
state: {
|
||||
started: false, // 考试状态
|
||||
usedTime: 0, // 考试当前所用时间
|
||||
totalTime: 0, // 考试总时间
|
||||
timeInterval: null, // 计时器
|
||||
suspend: false, // 暂停
|
||||
ruleList: [], // 考试规则列表
|
||||
courseDetail: {}, // 课程详情
|
||||
courseList: [] // 课程列表
|
||||
},
|
||||
getters: {
|
||||
started: (state) => {
|
||||
return state.started;
|
||||
},
|
||||
usedTime: (state) => {
|
||||
return state.usedTime;
|
||||
},
|
||||
totalTime: (state) => {
|
||||
return state.totalTime;
|
||||
},
|
||||
suspend: (state) => {
|
||||
return state.suspend;
|
||||
}
|
||||
},
|
||||
mutations: {
|
||||
setStarted: (state, started) => {
|
||||
state.started = started;
|
||||
},
|
||||
setSuspend: (state, suspend) => {
|
||||
state.suspend = suspend;
|
||||
},
|
||||
setUsedTime: (state, usedTime) => {
|
||||
state.usedTime = usedTime;
|
||||
},
|
||||
setTotalTime: (state, totalTime) => {
|
||||
state.totalTime = totalTime;
|
||||
},
|
||||
countUsedTime: (state) => {
|
||||
if (state.timeInterval) {
|
||||
clearInterval(state.timeInterval);
|
||||
state.timeInterval = null;
|
||||
}
|
||||
state.timeInterval = setInterval(() => {
|
||||
if (!state.suspend) {
|
||||
state.usedTime++;
|
||||
}
|
||||
}, 1000);
|
||||
},
|
||||
stopCountTime: (state) => {
|
||||
if (state.timeInterval) {
|
||||
clearInterval(state.timeInterval);
|
||||
state.timeInterval = null;
|
||||
}
|
||||
},
|
||||
setRuleList: (state, ruleList) => {
|
||||
state.ruleList = ruleList;
|
||||
},
|
||||
setCourseDetail: (state, courseDetail) => {
|
||||
state.courseDetail = courseDetail;
|
||||
},
|
||||
setCourse: (state, courseList) => {
|
||||
state.courseList = courseList;
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
start({ commit }) {
|
||||
commit('setStarted', true);
|
||||
commit('setSuspend', false);
|
||||
commit('setUsedTime', 0);
|
||||
commit('countUsedTime');
|
||||
},
|
||||
over({ commit }) {
|
||||
commit('setStarted', false);
|
||||
commit('setSuspend', true);
|
||||
commit('setUsedTime', 0);
|
||||
commit('stopCountTime');
|
||||
},
|
||||
isOver() {
|
||||
const trainingList = store.getters['trainingList/trainingList'];
|
||||
const doList = trainingList.filter(elem => {
|
||||
if (elem.usedTime !== undefined) return true;
|
||||
});
|
||||
state: {
|
||||
deviceCode: '', // 考试目标code
|
||||
started: false, // 考试状态
|
||||
usedTime: 0, // 考试当前所用时间
|
||||
totalTime: 0, // 考试总时间
|
||||
timeInterval: null, // 计时器
|
||||
suspend: false, // 暂停
|
||||
ruleList: [], // 考试规则列表
|
||||
courseDetail: {}, // 课程详情
|
||||
courseList: [] // 课程列表
|
||||
},
|
||||
getters: {
|
||||
started: (state) => {
|
||||
return state.started;
|
||||
},
|
||||
usedTime: (state) => {
|
||||
return state.usedTime;
|
||||
},
|
||||
totalTime: (state) => {
|
||||
return state.totalTime;
|
||||
},
|
||||
suspend: (state) => {
|
||||
return state.suspend;
|
||||
}
|
||||
},
|
||||
mutations: {
|
||||
setStarted: (state, started) => {
|
||||
state.started = started;
|
||||
},
|
||||
setSuspend: (state, suspend) => {
|
||||
state.suspend = suspend;
|
||||
},
|
||||
setUsedTime: (state, usedTime) => {
|
||||
state.usedTime = usedTime;
|
||||
},
|
||||
setTotalTime: (state, totalTime) => {
|
||||
state.totalTime = totalTime;
|
||||
},
|
||||
countUsedTime: (state) => {
|
||||
if (state.timeInterval) {
|
||||
clearInterval(state.timeInterval);
|
||||
state.timeInterval = null;
|
||||
}
|
||||
state.timeInterval = setInterval(() => {
|
||||
if (!state.suspend) {
|
||||
state.usedTime++;
|
||||
}
|
||||
}, 1000);
|
||||
},
|
||||
stopCountTime: (state) => {
|
||||
if (state.timeInterval) {
|
||||
clearInterval(state.timeInterval);
|
||||
state.timeInterval = null;
|
||||
}
|
||||
},
|
||||
setRuleList: (state, ruleList) => {
|
||||
state.ruleList = ruleList;
|
||||
},
|
||||
setCourseDetail: (state, courseDetail) => {
|
||||
state.courseDetail = courseDetail;
|
||||
},
|
||||
setCourse: (state, courseList) => {
|
||||
state.courseList = courseList;
|
||||
},
|
||||
setCenter: (state, deviceCode) => {
|
||||
state.deviceCode = deviceCode;
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
start({ commit }) {
|
||||
commit('setStarted', true);
|
||||
commit('setSuspend', false);
|
||||
commit('setUsedTime', 0);
|
||||
commit('countUsedTime');
|
||||
},
|
||||
over({ commit }) {
|
||||
commit('setStarted', false);
|
||||
commit('setSuspend', true);
|
||||
commit('setUsedTime', 0);
|
||||
commit('stopCountTime');
|
||||
},
|
||||
isOver() {
|
||||
const trainingList = store.getters['trainingList/trainingList'];
|
||||
const doList = trainingList.filter(elem => {
|
||||
if (elem.usedTime !== undefined) return true;
|
||||
});
|
||||
|
||||
if (doList.length >= trainingList.length) {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
setSuspend({ commit }, suspend) {
|
||||
commit('setSuspend', suspend);
|
||||
},
|
||||
setUsedTime({ state }, usedTime) {
|
||||
if (usedTime) {
|
||||
state.usedTime = usedTime;
|
||||
}
|
||||
},
|
||||
setTotalTime({ commit }, totalTime) {
|
||||
if (totalTime) {
|
||||
commit('setTotalTime', totalTime);
|
||||
}
|
||||
},
|
||||
countUsedTime({ commit }) {
|
||||
commit('countUsedTime');
|
||||
},
|
||||
setRuleList({ commit }, ruleList) {
|
||||
commit('setRuleList', ruleList);
|
||||
},
|
||||
setCourseDetail({ commit }, courseDetail) {
|
||||
commit('setCourseDetail', courseDetail);
|
||||
},
|
||||
setCourse({ commit }, course) {
|
||||
commit('setCourse', course);
|
||||
}
|
||||
}
|
||||
if (doList.length >= trainingList.length) {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
setSuspend({ commit }, suspend) {
|
||||
commit('setSuspend', suspend);
|
||||
},
|
||||
setUsedTime({ commit }, usedTime) {
|
||||
commit('setUsedTime', usedTime || 0);
|
||||
},
|
||||
setTotalTime({ commit }, totalTime) {
|
||||
commit('setTotalTime', totalTime || 0);
|
||||
},
|
||||
countUsedTime({ commit }) {
|
||||
commit('countUsedTime');
|
||||
},
|
||||
setRuleList({ commit }, ruleList) {
|
||||
commit('setRuleList', ruleList);
|
||||
},
|
||||
setCourseDetail({ commit }, courseDetail) {
|
||||
commit('setCourseDetail', courseDetail);
|
||||
},
|
||||
setCourse({ commit }, course) {
|
||||
commit('setCourse', course);
|
||||
},
|
||||
setCenter({ commit }, deviceCode) {
|
||||
commit('setCenter', deviceCode);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default exam;
|
||||
|
@ -530,6 +530,7 @@ const map = {
|
||||
if (map && map.skinVO) {
|
||||
state.map = map;
|
||||
state.mapDevice = parser(map, map.skinVO.code);
|
||||
Vue.prototype.$jlmap.setMapDevice(state.mapDevice);
|
||||
} else {
|
||||
state.mapDevice = {};
|
||||
}
|
||||
|
@ -3,11 +3,11 @@ export function getBaseUrl() {
|
||||
let BASE_API;
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
// BASE_API = 'https://joylink.club/jlcloud';
|
||||
BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
// BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
|
||||
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
||||
// BASE_API = 'http://192.168.3.41:9000'; // 杜闪
|
||||
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
|
||||
BASE_API = 'http://192.168.3.82:9000'; // 杜康
|
||||
} else {
|
||||
BASE_API = process.env.VUE_APP_BASE_API;
|
||||
}
|
||||
|
@ -20,7 +20,7 @@
|
||||
import TipExamList from './tipExamList';
|
||||
import { Notification } from 'element-ui';
|
||||
import { startTraining } from '@/api/jmap/training';
|
||||
import { exitFullscreen } from '@/utils/screen';
|
||||
// import { exitFullscreen } from '@/utils/screen';
|
||||
import { timeFormat } from '@/utils/date';
|
||||
import { refreshExamList, finishOneExamQuestion } from '@/api/management/userexam';
|
||||
import { launchFullscreen } from '@/utils/screen';
|
||||
|
@ -148,7 +148,7 @@ export default {
|
||||
}
|
||||
});
|
||||
if (obj) {
|
||||
getTrainingDetail(obj.trainingId ).then(res => {
|
||||
getTrainingDetail(obj.trainingId).then(res => {
|
||||
this.courseModel = {
|
||||
id: res.data.id,
|
||||
name: res.data.name,
|
||||
@ -157,6 +157,7 @@ export default {
|
||||
minDuration: res.data.minDuration,
|
||||
updateTime: res.data.updateTime
|
||||
};
|
||||
this.$store.dispatch('exam/setCenter ', res.data.locateDeviceCode);
|
||||
}).catch(error => {
|
||||
this.$message.error(this.$t('display.exam.getTestInformation') + ':' + error.message);
|
||||
});
|
||||
|
@ -89,6 +89,9 @@ export default {
|
||||
'$store.state.training.rezoomCount': function (val, old) {
|
||||
this.setCenter(this.$store.state.training.offsetStationCode);
|
||||
},
|
||||
'$store.state.exam.deviceCode': function (val) {
|
||||
val && this.setCenter(val);
|
||||
},
|
||||
'$store.state.config.canvasSizeCount': function (val) {
|
||||
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