Merge branch 'test_dispaly' of https://git.code.tencent.com/lian-cbtc/jl-client into test_dispaly
This commit is contained in:
commit
d1e41fe25c
@ -118,6 +118,7 @@ export default {
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.station = {};
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
cancel() {
|
||||
|
@ -151,7 +151,6 @@ export default {
|
||||
initMenu() {
|
||||
this.menu = [];
|
||||
this.menuNormal.forEach(menuItem => {
|
||||
console.log(this.selected, this.work, '------');
|
||||
menuItem.show = menuItem.isShow && menuItem.isShow(this.selected, this.work);
|
||||
menuItem.disabled = !judgeStationControl(this.selected.code, this.selected.stationCode, this.work) || (menuItem.isDisabled && menuItem.isDisabled(this.selected, this.work));
|
||||
this.menu.push(menuItem);
|
||||
|
@ -15,7 +15,7 @@ import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
|
||||
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
import { judgeStationControl } from '@/jmapNew/theme/components/utils/menuJudge.js';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
|
||||
export default {
|
||||
name: 'StationMenu',
|
||||
@ -45,6 +45,73 @@ export default {
|
||||
return {
|
||||
menu: [],
|
||||
menuNormal: [
|
||||
{
|
||||
label: '本地控制许可',
|
||||
children: [
|
||||
{
|
||||
label: '请求',
|
||||
handler: this.setStationControl,
|
||||
cmdType: this.work === 'localWork' ? CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_STATION_CONTROL : CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_CENTER_CONTROL,
|
||||
isDisabled: (station, work) => {
|
||||
if (work === 'localWork') {
|
||||
return station.controlMode !== 'Center';
|
||||
} else {
|
||||
return station.controlMode === 'Center';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '取消',
|
||||
handler: this.setCenterControl,
|
||||
cmdType: CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_CENTER_CONTROL,
|
||||
isDisabled: (station, work) => {
|
||||
if (work === 'localWork') {
|
||||
return station.controlMode === 'Center';
|
||||
} else {
|
||||
return station.controlMode !== 'Center';
|
||||
}
|
||||
},
|
||||
isShow: (station, work) => {
|
||||
return work === 'localWork';
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '紧急本地控制',
|
||||
handler: this.setEmergencyControl,
|
||||
cmdType: CMD.ControlConvertMenu.CMD_CM_EMERGENCY_STATION_CONTROL,
|
||||
isDisabled: (station, work) => {
|
||||
return station.controlMode === 'Emergency';
|
||||
},
|
||||
isShow: (station, work) => {
|
||||
return work === 'localWork';
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: '进路模式',
|
||||
children: [
|
||||
{
|
||||
label: '自动',
|
||||
handler: this.atsAutoControlALL,
|
||||
cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING,
|
||||
isDisabled: (station, work) => {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '人工',
|
||||
handler: this.humanControlALL,
|
||||
cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING,
|
||||
isDisabled: (station, work) => {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
],
|
||||
isShow: (station, work) => {
|
||||
return work === 'dispatchWork';
|
||||
}
|
||||
}
|
||||
],
|
||||
menuForce: [
|
||||
{
|
||||
@ -94,12 +161,21 @@ export default {
|
||||
};
|
||||
},
|
||||
initMenu() {
|
||||
const selected = this.selected;
|
||||
const work = this.work;
|
||||
function setDisabledShow(item) {
|
||||
if (item.children) {
|
||||
item.children.forEach(ii => {
|
||||
setDisabledShow(ii);
|
||||
});
|
||||
}
|
||||
item.disabled = item.isDisabled ? item.isDisabled(selected, work) : false;
|
||||
item.show = item.isShow ? item.isShow(selected, work) : true;
|
||||
}
|
||||
if (this.selected.centralized) {
|
||||
this.menu = [];
|
||||
this.menuNormal.forEach(menuItem => {
|
||||
const status = judgeStationControl(this.selected.belongStationCode, this.selected.stationCode, this.work);
|
||||
menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) || !status : false;
|
||||
menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work, this.lineCode) : true;
|
||||
setDisabledShow(menuItem);
|
||||
this.menu.push(menuItem);
|
||||
});
|
||||
// 故障模式菜单列表
|
||||
@ -149,6 +225,159 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
// 所有进路自排关
|
||||
humanControlALL() {
|
||||
const step = {
|
||||
start: true,
|
||||
code: `${this.selected.code}`,
|
||||
operation: OperationEvent.Station.humanControlALL.menu.operation,
|
||||
param: {
|
||||
stationCode: this.selected.code
|
||||
}
|
||||
};
|
||||
this.$store.dispatch('trainingNew/next', step).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$store.dispatch('menuOperation/pushRequestList', {
|
||||
device: this.selected,
|
||||
operation: {
|
||||
code: OperationEvent.Command.commandXian.confirm.operation,
|
||||
name: '所有进路自排关',
|
||||
cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING,
|
||||
param: step.param
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
},
|
||||
// 所有进路自排开
|
||||
atsAutoControlALL() {
|
||||
const step = {
|
||||
start: true,
|
||||
code: `${this.selected.code}`,
|
||||
operation: OperationEvent.Station.atsAutoControlALL.menu.operation,
|
||||
param: {
|
||||
stationCode: this.selected.code
|
||||
}
|
||||
};
|
||||
this.$store.dispatch('trainingNew/next', step).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$store.dispatch('menuOperation/pushRequestList', {
|
||||
device: this.selected,
|
||||
operation: {
|
||||
code: OperationEvent.Command.commandXian.confirm.operation,
|
||||
name: '所有进路自排开',
|
||||
cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING,
|
||||
param: step.param
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
},
|
||||
setPriorityStrategy() {
|
||||
this.getStrategyByStation('侧线优先');
|
||||
},
|
||||
setLineStrategy() {
|
||||
this.getStrategyByStation('直线折返');
|
||||
},
|
||||
setLateralStrategy() {
|
||||
this.getStrategyByStation('侧线折返');
|
||||
},
|
||||
getStrategyByStation(type) {
|
||||
const tbStrategy = this.tbStrategyList.find(strategy=>{
|
||||
return strategy.stationCode == this.selected.code;
|
||||
});
|
||||
if (tbStrategy) {
|
||||
const strategy = tbStrategy.optionList.find(each=>{
|
||||
return each.label == type;
|
||||
});
|
||||
if (strategy) {
|
||||
commitOperate(menuOperate.StationControl.setBackStrategy, {stationCode: this.selected.code, id:strategy.id}, 0).then(({valid, operate})=>{
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$store.dispatch('menuOperation/pushRequestList', {
|
||||
device: this.selected,
|
||||
operation: {
|
||||
code: OperationEvent.Command.commandXian.confirm.operation,
|
||||
name: type,
|
||||
cmdType: CMD.Station.CMD_STATION_SET_TURN_BACK_STRATEGY,
|
||||
param: {stationCodes:[this.selected.code]}
|
||||
}
|
||||
});
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
setStationControl() {
|
||||
// 请求站控
|
||||
commitOperate(menuOperate.StationControl.requestStationControl, {stationCode:this.selected.code}, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$store.dispatch('menuOperation/pushRequestList', {
|
||||
device: this.selected,
|
||||
operation: {
|
||||
code: OperationEvent.Command.commandXian.confirm.operation,
|
||||
name: '请求站控',
|
||||
cmdType: CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_STATION_CONTROL,
|
||||
param: {stationCodes:[this.selected.code]}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
setCenterControl() {
|
||||
// 请求中控
|
||||
commitOperate(menuOperate.StationControl.requestCentralControl, {stationCode:this.selected.code}, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$store.dispatch('menuOperation/pushRequestList', {
|
||||
device: this.selected,
|
||||
operation: {
|
||||
code: OperationEvent.Command.commandXian.confirm.operation,
|
||||
name: '请求中控',
|
||||
cmdType: CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_CENTER_CONTROL,
|
||||
param: {stationCodes:[this.selected.code]}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
setEmergencyControl() {
|
||||
// 紧急站控
|
||||
commitOperate(menuOperate.StationControl.emergencyStationControl, {stationCode:this.selected.code}, 0).then(({valid, operate})=>{
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$store.dispatch('menuOperation/pushRequestList', {
|
||||
device: this.selected,
|
||||
operation: {
|
||||
code: OperationEvent.Command.commandXian.confirm.operation,
|
||||
name: '紧急站控',
|
||||
cmdType: CMD.ControlConvertMenu.CMD_CM_EMERGENCY_STATION_CONTROL,
|
||||
param: {stationCodes:[this.selected.code]}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
undeveloped() {
|
||||
this.doClose();
|
||||
this.$alert('实现中......', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
callback: action => {
|
||||
}
|
||||
});
|
||||
},
|
||||
triggerFaultManagement() {
|
||||
this.$store.dispatch('training/setTriggerFaultCount', this.selected);
|
||||
}
|
||||
|
@ -296,8 +296,11 @@ export default {
|
||||
if (selection && selection.length) {
|
||||
const operate = {
|
||||
operation: '',
|
||||
val: stationCodeList.join('::'),
|
||||
selection: selection
|
||||
// val: stationCodeList.join('::'),
|
||||
selection: selection,
|
||||
param: {
|
||||
stationCodes: stationCodeList
|
||||
}
|
||||
};
|
||||
|
||||
if (OperationHandler.checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl)) {
|
||||
@ -324,7 +327,7 @@ export default {
|
||||
const operate = {
|
||||
messages: [this.$t('menu.menuDialog.confirmStationControlTip')],
|
||||
operation: OperationEvent.StationControl.requestStationControl.menu.operation,
|
||||
val: stationCodeList.join('::'),
|
||||
// val: stationCodeList.join('::'),
|
||||
selection: this.selection,
|
||||
param: {
|
||||
stationCodes: stationCodeList
|
||||
@ -352,7 +355,7 @@ export default {
|
||||
const operate = {
|
||||
messages: [this.$t('menu.menuDialog.confirmInTheControlTip')],
|
||||
operation: OperationEvent.StationControl.forcedStationControl.menu.operation,
|
||||
val: stationCodeList.join('::'),
|
||||
// val: stationCodeList.join('::'),
|
||||
selection: this.selection,
|
||||
param: {
|
||||
stationCodes: stationCodeList
|
||||
@ -380,7 +383,7 @@ export default {
|
||||
const operate = {
|
||||
messages: [this.$t('menu.menuDialog.confirmInTheControlTip')],
|
||||
operation: OperationEvent.StationControl.requestCentralControl.menu.operation,
|
||||
val: stationCodeList.join('::'),
|
||||
// val: stationCodeList.join('::'),
|
||||
selection: this.selection,
|
||||
param: {
|
||||
stationCodes: stationCodeList
|
||||
|
@ -871,15 +871,15 @@ export default {
|
||||
},
|
||||
initMenus() {
|
||||
this.basicParamList = this.work === 'localWork' ? [
|
||||
{ name: '接收控制', cmdType: CMD.ControlConvertMenu.CMD_CM_RECEIVE_CONTROL, operate: OperationEvent.StationControl.requestStationControl.menu, show: false, disabledName: 'controlMode', mode: 'Center' },
|
||||
{ name: '交出控制', cmdType: CMD.ControlConvertMenu.CMD_CM_SURRENDER_CONTROL, operate: OperationEvent.StationControl.requestCentralControl.menu, show: false, disabledName: 'controlMode', mode: 'None' },
|
||||
{ name: '强行站控', cmdType: CMD.ControlConvertMenu.CMD_CM_FORCE_STATION_CONTROL, operate: OperationEvent.StationControl.forcedStationControl.menu, show:false, securityCommand: true },
|
||||
{ name: '接收控制', cmdType: CMD.ControlConvertMenu.CMD_CM_RECEIVE_CONTROL, operate: OperationEvent.StationControl.requestStationControl.menuButton, show: false, disabledName: 'controlMode', mode: 'Center' },
|
||||
{ name: '交出控制', cmdType: CMD.ControlConvertMenu.CMD_CM_SURRENDER_CONTROL, operate: OperationEvent.StationControl.requestCentralControl.menuButton, show: false, disabledName: 'controlMode', mode: 'None' },
|
||||
{ name: '强行站控', cmdType: CMD.ControlConvertMenu.CMD_CM_FORCE_STATION_CONTROL, operate: OperationEvent.StationControl.forcedStationControl.menuButton, show:false, securityCommand: true },
|
||||
{ name: '重启令解', cmdType: CMD.Station.CMD_STATION_RESTART, operate:OperationEvent.Station.stationRestart.menuButton, show: false, securityCommand: true},
|
||||
{ name: '追踪全开', cmdType: CMD.Station.CMD_STATION_SET_CI_AUTO_TRIGGER, operate: OperationEvent.Station.setAutoTrigger.menu, show: false },
|
||||
{ name: '追踪全关', cmdType: CMD.Station.CMD_STATION_CANCEL_CI_AUTO_TRIGGER, operate: OperationEvent.Station.cancelAutoTrigger.menu, show: false },
|
||||
{ name: '关区信号', cmdType: CMD.Station.CMD_STATION_CIAREA_CLOSE_ALLSIGNAL, operate: OperationEvent.Station.ciAreaCloseAllSignal.menu, show: false },
|
||||
{ name: '自排全开', cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING, operate: OperationEvent.Station.atsAutoControlALL.menu, show: false },
|
||||
{ name: '自排全关', cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING, operate: OperationEvent.Station.humanControlALL.menu, show: false }
|
||||
{ name: '追踪全开', cmdType: CMD.Station.CMD_STATION_SET_CI_AUTO_TRIGGER, operate: OperationEvent.Station.setAutoTrigger.menuButton, show: false },
|
||||
{ name: '追踪全关', cmdType: CMD.Station.CMD_STATION_CANCEL_CI_AUTO_TRIGGER, operate: OperationEvent.Station.cancelAutoTrigger.menuButton, show: false },
|
||||
{ name: '关区信号', cmdType: CMD.Station.CMD_STATION_CIAREA_CLOSE_ALLSIGNAL, operate: OperationEvent.Station.ciAreaCloseAllSignal.menuButton, show: false },
|
||||
{ name: '自排全开', cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING, operate: OperationEvent.Station.atsAutoControlALL.menuButton, show: false },
|
||||
{ name: '自排全关', cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING, operate: OperationEvent.Station.humanControlALL.menuButton, show: false }
|
||||
] : [
|
||||
// { name: '接收控制', cmdType: CMD.ControlConvertMenu.CMD_CM_RECEIVE_CONTROL, operate: OperationEvent.StationControl.requestStationControl.menu, show: false, disabledName: 'controlMode', mode: 'Center' },
|
||||
// { name: '交出控制', cmdType: CMD.ControlConvertMenu.CMD_CM_SURRENDER_CONTROL, operate: OperationEvent.StationControl.requestCentralControl.menu, show: false, disabledName: 'controlMode', mode: 'None' },
|
||||
|
@ -224,8 +224,9 @@ export default {
|
||||
},
|
||||
'$store.state.menuOperation.leftClickCount': function (val) {
|
||||
// const control = MenuContextHandler.getStationControl(this.selected);
|
||||
const centralStation = this.$store.getters['map/getDeviceByCode'](this.selected.stationCode);
|
||||
if (this.selected._type === 'Signal' && this.selected.controlMode == centralStation.controlMode) {
|
||||
// const centralStation = this.$store.getters['map/getDeviceByCode'](this.selected.stationCode);
|
||||
const status = judgeStationControl(this.selected.belongStationCode, this.selected.stationCode, this.work);
|
||||
if (this.selected._type === 'Signal' && status) {
|
||||
this.arrangementRoute();
|
||||
}
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ class Handler {
|
||||
const stepInfo = store.state.trainingNew.stepInfo;
|
||||
const operateOrder = store.state.trainingNew.operateOrder;
|
||||
const operation = stepInfo.operations[operateOrder];
|
||||
if (operation.domId === OperationEvent.Conversation.Chat.menu.operation) {
|
||||
if (operation && operation.domId === OperationEvent.Conversation.Chat.menu.operation) {
|
||||
this.handleVoiceStepList();
|
||||
}
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ export default {
|
||||
{ label: '设备视图', name: 'jlmap3dmodel', click: this.jlmap3dmodel, isDisabled: () => { return false; }, isShow: () => { return true; } },
|
||||
{ label: '设备管理', name: 'deviceManage', click: this.deviceManage, isDisabled: () => { return false; }, isShow: () => { return (this.$store.state.training.domConfig.hasDeviceManage && this.$store.state.training.simulationUserType === SimulationUserType.TEACHER) || (this.$route.query.client === 'interlockWork' && this.$route.query.projectDevice === 'ILW'); } },
|
||||
{ label: '联系方式', name: 'contectUs', click: this.contectUs, isDisabled: () => { return false; }, isShow: () => { return true; } },
|
||||
{ label: '生成二维码', name: 'generateQrCode', click: this.generateQrCode, isDisabled: () => { return false; }, isShow: () => { return this.$store.state.training.domConfig.isJoint && this.$store.state.training.simulationUserType === SimulationUserType.TEACHER; } },
|
||||
{ label: '生成二维码', name: 'generateQrCode', click: this.generateQrCode, isDisabled: () => { return false; }, isShow: () => { return this.$store.state.training.domConfig.joint && this.$store.state.training.simulationUserType === SimulationUserType.TEACHER; } },
|
||||
{ label: '切换客流数据', name: 'changeFlowData', click: this.changeFlowData, isDisabled: () => { return false; }, isShow: () => { return this.$store.state.training.domConfig.hasLpf && this.$store.state.training.simulationUserType === SimulationUserType.TEACHER; } },
|
||||
{ label: '成员管理', name: 'memberManage', click: this.memberManage, isDisabled: () => { return false; }, isShow: () => { return this.$route.query.type == 'IM' || (!this.$route.query.type && !this.$store.state.training.domConfig.hasMemberManage && this.$store.state.training.simulationUserType === SimulationUserType.TEACHER); } },
|
||||
{ label: '考试', name: 'exam', click: this.goExam, isDisabled: () => { return false; }, isShow: () => { return this.$store.state.training.domConfig.hasExam && this.$store.state.training.simulationUserType === SimulationUserType.TEACHER; } },
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="editContent" :class="{'active': dialogVisible}" :style="{height: paneHeight + 'px'}">
|
||||
<div id="designPane" class="editContent" :class="{'active': dialogVisible}" :style="{height: paneHeight + 'px'}">
|
||||
<div class="editContentTab">
|
||||
<div class="editContentTabLable" @click="minisize">
|
||||
<span class="titleStyle">实训设计</span>
|
||||
@ -190,6 +190,12 @@ export default {
|
||||
this.roleList = list;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
const designPaneDom = document.getElementById('designPane');
|
||||
designPaneDom.addEventListener('click', (e) => {
|
||||
e.stopPropagation();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
computedRoleDisabled(role) {
|
||||
if (!this.editData.client) {
|
||||
|
@ -4,7 +4,7 @@
|
||||
<p style="color: black;" v-html="tip" />
|
||||
<div v-show="tPosition.align === 'top'" x-arrow class="popper__arraw_top" :style="{left: arrawLeft+'px'}" />
|
||||
<div v-show="tPosition.align === 'bottom'" x-arrow class="popper__arraw_bottom" :style="{left: arrawLeft+'px'}" />
|
||||
<div v-show="tPosition.align === 'right'" x-arrow class="popper__arraw_right" />
|
||||
<div v-show="tPosition.align === 'right'" x-arrow class="popper__arraw_right"/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -91,7 +91,6 @@ export default {
|
||||
}
|
||||
const distance = 5;
|
||||
this.tip = stepInfo ? stepInfo.description : '';
|
||||
console.log(stepInfo, this.tip, '***');
|
||||
if (stepInfo.tipPosition && stepInfo.tipPosition.deviceCode) {
|
||||
const position = this.getShapeTipPoint(stepInfo.tipPosition);
|
||||
if (position) {
|
||||
@ -108,7 +107,6 @@ export default {
|
||||
this.position.y -= distance;
|
||||
this.popTipShow();
|
||||
}
|
||||
console.log(this.popShow, this.position, this.tip, '-----');
|
||||
} else {
|
||||
this.popTipHide();
|
||||
}
|
||||
@ -181,10 +179,10 @@ export default {
|
||||
} else if (this.tipAlignIsTop(tipPosition, domId)) {
|
||||
align = 'top';
|
||||
}
|
||||
console.log(align, '*******', domId);
|
||||
const width = align === 'right' ? 0 : btnDom.clientWidth / 2;
|
||||
resolve({
|
||||
align: align,
|
||||
x: offset.x + btnDom.clientWidth / 2,
|
||||
x: offset.x + width,
|
||||
y: offset.y
|
||||
});
|
||||
} else {
|
||||
|
@ -1,21 +1,21 @@
|
||||
<template>
|
||||
<div style="width: 100%;">
|
||||
<QueryListPage
|
||||
ref="examQueryListPage"
|
||||
:card-padding="10"
|
||||
:query-form="examQueryForm"
|
||||
:pager-config="pagerConfig"
|
||||
:query-list="examQueryList"
|
||||
/>
|
||||
</div>
|
||||
<div style="width: 100%;">
|
||||
<QueryListPage
|
||||
ref="examQueryListPage"
|
||||
:card-padding="10"
|
||||
:query-form="examQueryForm"
|
||||
:pager-config="pagerConfig"
|
||||
:query-list="examQueryList"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import config from '@/scripts/ConstConfig'
|
||||
import { getPapaerListOfOrg, getAllPapaerListOfOrg, lockPaper, invalidPaper, deletePaper } from '@/api/management/exam'
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map'
|
||||
import config from '@/scripts/ConstConfig';
|
||||
import { getPapaerListOfOrg, getAllPapaerListOfOrg, lockPaper, invalidPaper, deletePaper } from '@/api/management/exam';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
|
||||
const { paperStateArr, paperStateQueryMap } = config.ConstSelect
|
||||
const { paperStateArr, paperStateQueryMap } = config.ConstSelect;
|
||||
|
||||
export default {
|
||||
name: 'ExamManage',
|
||||
@ -23,7 +23,7 @@ export default {
|
||||
return {
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
mapIdList: [],
|
||||
examQueryForm: {
|
||||
@ -35,7 +35,7 @@ export default {
|
||||
queryObject: {
|
||||
name: {
|
||||
type: 'text',
|
||||
label: '试卷名称:',
|
||||
label: '试卷名称:'
|
||||
},
|
||||
findState: {
|
||||
type: 'select',
|
||||
@ -44,12 +44,12 @@ export default {
|
||||
config: {
|
||||
data: Object.entries(paperStateQueryMap).map(([i, v]) => ({
|
||||
value: Number(i),
|
||||
label: v,
|
||||
})),
|
||||
label: v
|
||||
}))
|
||||
},
|
||||
noClearable: true,
|
||||
},
|
||||
},
|
||||
noClearable: true
|
||||
}
|
||||
}
|
||||
},
|
||||
examQueryList: {
|
||||
query: obj => this.getListApi(obj),
|
||||
@ -58,11 +58,11 @@ export default {
|
||||
columns: [
|
||||
{
|
||||
title: '试卷名称',
|
||||
prop: 'name',
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '简介',
|
||||
prop: 'profile',
|
||||
prop: 'profile'
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
@ -70,27 +70,27 @@ export default {
|
||||
type: 'tag',
|
||||
width: '80',
|
||||
columnValue: row => {
|
||||
return paperStateArr[row.state - 1]
|
||||
return paperStateArr[row.state - 1];
|
||||
},
|
||||
tagType: row => '',
|
||||
tagType: row => ''
|
||||
},
|
||||
{
|
||||
title: '开始时间',
|
||||
prop: 'startTime',
|
||||
prop: 'startTime'
|
||||
},
|
||||
{
|
||||
title: '截止时间',
|
||||
prop: 'endTime',
|
||||
prop: 'endTime'
|
||||
},
|
||||
{
|
||||
title: '满分',
|
||||
prop: 'fullScore',
|
||||
width: '80',
|
||||
width: '80'
|
||||
},
|
||||
{
|
||||
title: '及格分',
|
||||
prop: 'passScore',
|
||||
width: '80',
|
||||
width: '80'
|
||||
},
|
||||
{
|
||||
title: '时长',
|
||||
@ -98,171 +98,172 @@ export default {
|
||||
type: 'tag',
|
||||
width: '80',
|
||||
columnValue: row => row.validDuration,
|
||||
tagType: row => {},
|
||||
tagType: row => {}
|
||||
},
|
||||
{
|
||||
title: '创建人',
|
||||
prop: 'creatorName',
|
||||
width: '150',
|
||||
formatter: row => row.creatorInfo.name,
|
||||
formatter: row => row.creatorInfo.name
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('global.operate'),
|
||||
hide: () => this.hasTeachingDataManage(),
|
||||
width: '350',
|
||||
buttons: [
|
||||
{
|
||||
name: '成绩查询',
|
||||
handleClick: this.handleQueryGrade,
|
||||
type: 'primary',
|
||||
type: 'primary'
|
||||
},
|
||||
{
|
||||
name: '成绩统计',
|
||||
handleClick: this.handleGradeStatistics,
|
||||
type: 'success',
|
||||
type: 'success'
|
||||
},
|
||||
{
|
||||
name: '编辑',
|
||||
handleClick: this.handleEdit,
|
||||
type: 'primary',
|
||||
showControl: row => {
|
||||
return row.creatorId == this.userId && row.state === 1
|
||||
},
|
||||
return row.creatorId == this.userId && row.state === 1;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '封存',
|
||||
handleClick: this.handleLock,
|
||||
type: 'warning',
|
||||
showControl: row => {
|
||||
return row.creatorId == this.userId && row.state === 1
|
||||
},
|
||||
return row.creatorId == this.userId && row.state === 1;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '失效',
|
||||
handleClick: this.handleInvalid,
|
||||
type: 'danger',
|
||||
showControl: row => {
|
||||
return row.creatorId == this.userId && row.state === 2
|
||||
},
|
||||
return row.creatorId == this.userId && row.state === 2;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '删除',
|
||||
handleClick: this.handleDelete,
|
||||
type: 'danger',
|
||||
showControl: row => {
|
||||
return row.creatorId == this.userId && row.state === 1
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
return row.creatorId == this.userId && row.state === 1;
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [{ text: '新建试卷', handler: this.examCreate }],
|
||||
},
|
||||
}
|
||||
actions: [{ text: '新建试卷', handler: this.examCreate }]
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
userId() {
|
||||
return this.$store.state.user.id
|
||||
return this.$store.state.user.id;
|
||||
},
|
||||
orgId() {
|
||||
return this.$store.state.user.companyId
|
||||
},
|
||||
return this.$store.state.user.companyId;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.mapIdList = []
|
||||
this.mapIdList = [];
|
||||
getPublishMapListOnline().then(response => {
|
||||
this.mapIdList = response.data
|
||||
})
|
||||
this.mapIdList = response.data;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
hasTeachingDataManage() {
|
||||
return this.$route.path.includes('/teachingDataManage/')
|
||||
return this.$route.path.includes('/teachingDataManage/');
|
||||
},
|
||||
getListApi(obj) {
|
||||
if (this.hasTeachingDataManage()) {
|
||||
return getAllPapaerListOfOrg({ ...obj })
|
||||
return getAllPapaerListOfOrg({ ...obj });
|
||||
} else {
|
||||
return getPapaerListOfOrg({ ...obj, orgId: this.orgId })
|
||||
return getPapaerListOfOrg({ ...obj, orgId: this.orgId });
|
||||
}
|
||||
},
|
||||
handleQueryGrade(index, row) {
|
||||
this.$router.push({ path: '/info/gradeList', query: { examId: row.id, name: row.name } })
|
||||
this.$router.push({ path: '/info/gradeList', query: { examId: row.id, name: row.name } });
|
||||
},
|
||||
handleGradeStatistics(index, row) {
|
||||
this.$router.push({ path: '/info/gradeStatistics', query: { examId: row.id, name: row.name } })
|
||||
this.$router.push({ path: '/info/gradeStatistics', query: { examId: row.id, name: row.name } });
|
||||
},
|
||||
handleEdit(index, row) {
|
||||
this.$router.push({ path: `/info/examRule/draft/edit/${row.id}`, query: { source: 'org' } })
|
||||
this.$router.push({ path: `/info/examRule/draft/edit/${row.id}`, query: { source: 'org' } });
|
||||
},
|
||||
examCreate() {
|
||||
this.$router.push({ path: `/info/examRule/draft/add/0`, query: { source: 'org' } })
|
||||
this.$router.push({ path: `/info/examRule/draft/add/0`, query: { source: 'org' } });
|
||||
},
|
||||
handleLock(index, data) {
|
||||
this.$confirm('确定封存试卷吗? 该操作不能撤销!', this.$t('global.tips'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
type: 'warning',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
lockPaper(data.id)
|
||||
.then(res => {
|
||||
this.examRefresh()
|
||||
this.$message.success('封存试卷成功!')
|
||||
this.examRefresh();
|
||||
this.$message.success('封存试卷成功!');
|
||||
})
|
||||
.catch(error => {
|
||||
this.$message.error('封存试卷失败' + error.message)
|
||||
})
|
||||
this.$message.error('封存试卷失败' + error.message);
|
||||
});
|
||||
})
|
||||
.catch(() => {})
|
||||
.catch(() => {});
|
||||
},
|
||||
handleInvalid(index, data) {
|
||||
this.$confirm('该操作将使试卷失效,是否继续?', this.$t('global.tips'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
type: 'warning',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
invalidPaper(data.id)
|
||||
.then(res => {
|
||||
this.examRefresh()
|
||||
this.examRefresh();
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '操作成功!',
|
||||
})
|
||||
message: '操作成功!'
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
this.$message.error('操作失败:' + error.message)
|
||||
})
|
||||
this.$message.error('操作失败:' + error.message);
|
||||
});
|
||||
})
|
||||
.catch(() => {})
|
||||
.catch(() => {});
|
||||
},
|
||||
handleDelete(index, data) {
|
||||
this.$confirm('确定删除该试卷吗?', this.$t('global.tips'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
type: 'warning',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => deletePaper(data.id))
|
||||
.then(resp => {
|
||||
this.examRefresh()
|
||||
this.examRefresh();
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功!',
|
||||
})
|
||||
message: '删除成功!'
|
||||
});
|
||||
})
|
||||
.catch(res => {
|
||||
if (res.code && res.code !== 200) {
|
||||
this.$message({ type: 'error', message: res.message })
|
||||
this.$message({ type: 'error', message: res.message });
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
examRefresh() {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.examQueryListPage.refresh(true)
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
this.$refs.examQueryListPage.refresh(true);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
|
@ -4,7 +4,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {queryMapListByUser, getPublishMapDetailById} from '@/api/jmap/map';
|
||||
import {queryMapListByUser, getPublishMapDetailById, getPublishMapListOnline} from '@/api/jmap/map';
|
||||
import Cookies from 'js-cookie';
|
||||
import { createSimulation } from '@/api/simulation';
|
||||
import ConstConfig from '@/scripts/ConstConfig';
|
||||
@ -106,13 +106,17 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
queryMapListByUser().then(res=>{
|
||||
let api = queryMapListByUser;
|
||||
if (this.hasTeachingDataManage()) {
|
||||
api = getPublishMapListOnline;
|
||||
}
|
||||
api().then(res=>{
|
||||
this.mapList = [];
|
||||
res.data.forEach(element => {
|
||||
this.mapList.push({label:element.name, value:element.id});
|
||||
});
|
||||
this.queryForm.queryObject.mapId.config.data = [...this.mapList];
|
||||
this.queryForm.queryObject.mapId.config.default = this.mapList[0].value;
|
||||
this.queryForm.queryObject.mapId.config.default = this.mapList[0] ? this.mapList[0].value : '';
|
||||
this.showList = true;
|
||||
});
|
||||
},
|
||||
|
@ -137,7 +137,7 @@ export default {
|
||||
{ key: 'trainingDesign', label: '是否实训设计', value: false, type: 'checkbox' },
|
||||
{ key: 'hasLpf', label: '是否有大客流', value: false, type: 'checkbox' },
|
||||
{ key: 'hasVoice', label: '是否有语音指令', value: false, type: 'checkbox' },
|
||||
{ key: 'isJoint', label: '是否综合演练', value: false, type: 'checkbox' },
|
||||
{ key: 'joint', label: '是否综合演练', value: false, type: 'checkbox' },
|
||||
{ key: 'hasDeviceManage', label: '是否有设备管理', value: false, type: 'checkbox' },
|
||||
{ key: 'hasMemberManage', label: '是否有成员管理', value: false, type: 'checkbox' }
|
||||
],
|
||||
@ -347,7 +347,7 @@ export default {
|
||||
{ key: 'trainingDesign', label: '是否实训设计', value: false, type: 'checkbox' },
|
||||
{ key: 'hasLpf', label: '是否有大客流', value: false, type: 'checkbox' },
|
||||
{ key: 'hasVoice', label: '是否有语音指令', value: false, type: 'checkbox' },
|
||||
{ key: 'isJoint', label: '是否综合演练', value: false, type: 'checkbox' },
|
||||
{ key: 'joint', label: '是否综合演练', value: false, type: 'checkbox' },
|
||||
{ key: 'hasDeviceManage', label: '是否有设备管理', value: false, type: 'checkbox' },
|
||||
{ key: 'hasMemberManage', label: '是否有成员管理', value: false, type: 'checkbox' }
|
||||
];
|
||||
|
Loading…
Reference in New Issue
Block a user