Merge branch 'test_dispaly' of https://git.code.tencent.com/lian-cbtc/jl-client into test_dispaly1

This commit is contained in:
fan 2022-11-28 17:59:23 +08:00
commit 4f7476c540
12 changed files with 268 additions and 61 deletions

View File

@ -190,6 +190,14 @@ export function publishTrainingDelete(data) {
data
});
}
/** 查全部组织已发布实训的基础信息 */
export function getAllPublishTrainingList(params) {
return request({
url: `/api/v2/training/published/list`,
method: 'get',
params
});
}
/** 根据mapId查所有的已发布单操实训的基础信息 */
export function getPublishSingleList(mapId) {
return request({

View File

@ -139,6 +139,14 @@ export function getPapaerListOfOrg({ orgId, ...data }) {
});
}
export function getAllPapaerListOfOrg({ ...data }) { // 全部组织
return request({
url: `/api/v2/paper/composition/manage/paging`,
method: 'POST',
data
});
}
/**
* 创建试卷蓝图
* @param {Object} data

View File

@ -28,7 +28,7 @@ export function getBackProjectConfigById(id) {
/** 通过code获取后端项目配置 */
export function getBackProjectConfigByCode(code) {
return request({
url: `/api/project/code/{code}`,
url: `/api/project/code/${code}`,
method: 'get'
});
}

View File

@ -1,5 +1,14 @@
import request from '@/utils/request';
// 查询理论试题(全部组织)
export function listAllQuestionPage(params) {
return request({
url: `/api/question/paging`,
method: 'get',
params
});
}
// 分页查询理论试题
export function listQuestionPage(params) {
return request({

View File

@ -122,3 +122,12 @@ export function generateMapFunctionNew(mapId, data) {
data
});
}
/** 根据id查询地图系统 */
export function getMapFunctioById(id) {
return request({
url: `/api/mapFunction/${id}`,
method: 'get'
});
}

View File

@ -2026,7 +2026,7 @@ export const asyncRouter = [
{
// 理论题数据管理
path: 'theoryData',
component: Temporary,
component: BankManage,
meta: {
i18n: 'newRouter.theoryData'
}
@ -2034,7 +2034,7 @@ export const asyncRouter = [
{
// 实训数据管理
path: 'trainingDataManage',
component: Temporary,
component: TrainingManage,
meta: {
i18n: 'newRouter.trainingDataManage'
}
@ -2042,7 +2042,7 @@ export const asyncRouter = [
{
// 考试数据管理
path: 'examData',
component: BankManage,
component: OrgExamManage,
meta: {
i18n: 'newRouter.examData'
}

View File

@ -8,7 +8,7 @@
<script>
// import { UrlConfig } from '@/scripts/ConstDic';
import { listQuestionPage, deleteQuestion, getLabelList, listQuestionAll, clearBank } from '@/api/questionBank.js';
import { listQuestionPage, listAllQuestionPage, deleteQuestion, getLabelList, listQuestionAll, clearBank } from '@/api/questionBank.js';
import DialogDetail from './dialog-detail';
import PreviewAnswer from './previewAnswer';
import { convertSheetToList } from '@/jmapNew/theme/parser/util.js';
@ -58,7 +58,7 @@ export default {
}
},
queryList: {
query: listQuestionPage,
query: this.getListApi,
selectCheckShow: false,
indexShow: true,
columns: [
@ -138,7 +138,7 @@ export default {
// { text: '', handler: this.questionsRuleManage},
// { text: '', handler: this.exportTemplate},
{ text: '导出模板', handler: this.downloadTemplate},
{ text: '清空题库', type:'danger', handler: this.clearBank}
{ text: '清空题库', type:'danger', handler: this.clearBank, show: !this.hasTeachingDataManage() }
]
}
};
@ -165,6 +165,16 @@ export default {
});
},
methods: {
hasTeachingDataManage() {
return this.$route.path.includes('/teachingDataManage/');
},
getListApi(obj) {
if (this.hasTeachingDataManage()) {
return listAllQuestionPage(obj);
} else {
return listQuestionPage(obj);
}
},
beforeQuery(obj) {
// obj.labels = obj.labels ? obj.labels.join(',') : '';
return obj;

View File

@ -91,7 +91,6 @@ export default {
this.backProject = response.data.project;
// loginProLogoHeight
const {showBackPic, wechatLogin, aboutSystem, baseDevelopment, browserTitle, homeTitle, caseShow,
containDevice, deviceRelatedMap, deviceRelatedFunction,
loginProtitle, loginProLogoWidth, loginOrgTitle, localProject, homeProLogoWidth, loginProLogo} = response.data.viewSetting;
this.showBackPic = showBackPic;
this.wechatLogin = wechatLogin;
@ -109,12 +108,14 @@ export default {
this.$store.dispatch('setLoginProLogo', this.loginProLogo);
this.$store.dispatch('setHomeTitle', homeTitle);
this.$store.dispatch('setCaseShow', caseShow);
this.$store.dispatch('setDeviceRelated', {containDevice:containDevice, deviceRelatedMap:deviceRelatedMap, deviceRelatedFunction:deviceRelatedFunction});
// this.$store.dispatch('setCaseShow', caseShow);
this.loadedConfig = true;
// helpShow
// loginContectInformation false
setSessionStorage('project', this.project);
if (this.syncLogin) {
this.deviceRelatedLogin();
}
}
}).catch(() => {
this.$messageBox('无效的登录路径,请查证路径后重试!');
@ -133,6 +134,9 @@ export default {
},
selectOrgnization(orgId) {
this.$refs.normalLogin.selectOrg(orgId);
},
deviceRelatedLogin() {
}
}
};

View File

@ -83,6 +83,8 @@ import Cookies from 'js-cookie';
// getLoginWmurl, checkLoginStatus,
import { getOrgList, selectOrgnization } from '@/api/login';
import { createSimulation, getSimulationInfoNew } from '@/api/simulation';
import { getBackProjectConfigByCode } from '@/api/projectConfig';
import { assignUsersPlayRoles } from '@/api/jointSimulation';
export default {
name:'NormalLogin',
props: {
@ -140,6 +142,9 @@ export default {
},
projectDevice() {
return this.$route.query.projectDevice;
},
role() {
return this.$route.query.role;
}
},
watch: {
@ -175,6 +180,7 @@ export default {
this.checkOrgnizationInfo();
})
.catch(error => {
debugger;
console.log(error);
// if (error.code === '30001') {
// this.tipsMsg = this.$t('login.accountOrPasswordIsIncorrect');
@ -233,44 +239,51 @@ export default {
}
},
judgeOtherPage(params) {
// containDevice:false, //
// deviceRelatedMap:'', //
// deviceRelatedFunction:'' //
// itemMap: {DEFAULT_MEMBER: '1'}type: "METRO"
const {containDevice, deviceRelatedMap, deviceRelatedFunction} = this.$store.state.projectConfig.deviceRelated;
if (containDevice && deviceRelatedMap && deviceRelatedFunction) {
createSimulation(deviceRelatedFunction).then(res => {
getSimulationInfoNew(res.data).then(resp => {
const paramVO = resp.data.paramVO;
const query = {
lineCode: resp.data.map.lineCode,
group: res.data,
mapId: resp.data.map.id,
project: this.project,
projectDevice:params.projectDevice,
type:params.type
};
if (paramVO && paramVO.domConfig && paramVO.domConfig.client) {
query.client = paramVO.domConfig.client;
}
if (paramVO && paramVO.domConfig && paramVO.domConfig.singleClient) {
query.singleClient = paramVO.domConfig.singleClient;
}
// if (this.loadingProjectList.includes(this.project)) {
// this.$store.dispatch('app/transitionAnimations');
// }
this.$router.push({ path: `/display/demon`, query: query });
});
}).catch(error=>{
if (error.code == 10003) {
this.$messageBox(this.$t('error.createSimulationFailed') + ':您的仿真权限不足!');
getBackProjectConfigByCode(this.project).then(res=>{
if (res.data) {
const {mapId, functionId} = res.data;
if (functionId && mapId) {
createSimulation(functionId).then(resp => {
const group = resp.data;
if (this.role) {
assignUsersPlayRoles(this.role, group).then(() => {
this.enterSimulation(group, mapId);
});
} else {
this.enterSimulation(group, mapId);
}
}).catch(error=>{
if (error.code == 10003) {
this.$messageBox(this.$t('error.createSimulationFailed') + ':您的仿真权限不足!');
} else {
this.$messageBox(this.$t('error.createSimulationFailed') + error.message);
}
});
} else {
this.$messageBox(this.$t('error.createSimulationFailed') + error.message);
this.$message.error('请先配置项目信息');
}
});
} else {
this.$message.error('请先配置项目设备登录信息');
}
}
});
},
enterSimulation(group, mapId) {
getSimulationInfoNew(group).then(response=>{
debugger;
const paramVO = response.data.paramVO;
const query = {
lineCode: response.data.map.lineCode,
group: group,
mapId: mapId,
project: this.project
};
if (paramVO && paramVO.domConfig && paramVO.domConfig.client) {
query.client = paramVO.domConfig.client;
}
if (paramVO && paramVO.domConfig && paramVO.domConfig.singleClient) {
query.singleClient = paramVO.domConfig.singleClient;
}
this.$router.push({ path: `/display/demon`, query: query });
});
},
//
handleLogin() {

View File

@ -12,7 +12,7 @@
<script>
import config from '@/scripts/ConstConfig';
import { getPapaerListOfOrg, lockPaper, unlockPaper, deletePaper } from '@/api/management/exam';
import { getPapaerListOfOrg, getAllPapaerListOfOrg, lockPaper, unlockPaper, deletePaper } from '@/api/management/exam';
import { getPublishMapListOnline } from '@/api/jmap/map';
const { paperStateArr, paperStateQueryArr } = config.ConstSelect;
@ -49,7 +49,7 @@ export default {
}
},
examQueryList: {
query: obj => getPapaerListOfOrg({ ...obj, orgId: this.orgId }),
query: obj => this.getListApi(obj),
selectCheckShow: false,
indexShow: false,
columns: [
@ -172,6 +172,16 @@ export default {
});
},
methods: {
hasTeachingDataManage() {
return this.$route.path.includes('/teachingDataManage/');
},
getListApi(obj) {
if (this.hasTeachingDataManage()) {
return getAllPapaerListOfOrg({ ...obj });
} else {
return getPapaerListOfOrg({ ...obj, orgId: this.orgId });
}
},
handleQueryGrade(index, row) {
this.$router.push({ path: '/info/gradeList', query: { examId: row.id, name: row.name } });
},

View File

@ -10,7 +10,7 @@ import { createSimulation } from '@/api/simulation';
import ConstConfig from '@/scripts/ConstConfig';
import { getSessionStorage } from '@/utils/auth';
import { launchFullscreen } from '@/utils/screen';
import { getPublishSingleList, getPublishScenesList} from '@/api/jmap/training';
import { getPublishSingleList, getPublishScenesList, getAllPublishTrainingList } from '@/api/jmap/training';
export default {
name:'TrainingManage',
data() {
@ -36,14 +36,14 @@ export default {
data: []
}
},
trainingType: {
type: {
type: 'select',
label: '实训类型',
config: {
default: '',
noClear:true,
data: [
{label: '单操实训', value: 'training'},
{label: '单操实训', value: 'single'},
{label: '场景实训', value: 'scene'}
]
}
@ -73,7 +73,10 @@ export default {
},
{
title: this.$t('trainingManage.labelJson'),
prop: 'labelJson'
prop: 'labelJson',
type: 'tagMore',
columnValue: (row) => { return this.getLabelJson(row); },
tagType: (row) => { return ''; }
},
{
type: 'button',
@ -109,19 +112,34 @@ export default {
});
},
methods: {
hasTeachingDataManage() {
return this.$route.path.includes('/teachingDataManage/');
},
initLoadCallback(form) {
if (!form.trainingType) {
form.trainingType = 'training';
if (this.hasTeachingDataManage()) {
form.type = '';
form.mapId = '';
return;
}
if (!form.type) {
form.type = 'single';
}
if (!form.mapId) {
form.mapId = this.mapList[0] ? this.mapList[0].value : '';
}
},
queryFunction(param) {
if (param.mapId) {
if (param.trainingType == 'training') {
if (this.hasTeachingDataManage()) {
const params = {
...param
};
delete params.pageSize;
delete params.pageNum;
return getAllPublishTrainingList(params);
} else if (param.mapId) {
if (param.type == 'single') {
return getPublishSingleList(param.mapId);
} else if (param.trainingType == 'scene') {
} else if (param.type == 'scene') {
return getPublishScenesList(param.mapId);
}
} else {
@ -131,6 +149,10 @@ export default {
});
}
},
getLabelJson(row) {
const label = JSON.parse(row.labelJson || '[]');
return label;
},
covertData(row) {
const releaseReview = ConstConfig.ConstSelect.trainingType;
const lastData = Object.assign({}, row);

View File

@ -43,6 +43,16 @@
/>
</el-select>
</el-form-item>
<el-form-item label="关联角色:" prop="roleCode">
<el-select v-model="formLw.roleCode" placeholder="请选择" size="small">
<el-option
v-for="item in roleList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-form>
<el-form v-show="data.type === 'ISCS_LW' || data.type === 'ISCS_CW'" ref="formIscs" :model="formIscs" label-width="100px" :rules="rulesIscs">
<el-form-item :label="data.type === 'ISCS_LW'?'现地工作站:': '行调工作站'" prop="deviceCode">
@ -69,9 +79,9 @@
<el-select v-model="formIscs.stationCode" placeholder="请选择" size="small" clearable>
<el-option
v-for="item in stationList"
:key="item.code"
:key="item.value"
:label="item.name"
:value="item.code"
:value="item.value"
/>
</el-select>
</el-form-item>
@ -85,7 +95,10 @@
<script>
import { getDeviceDetail, getDevicesByType, setDeviceConfig } from '@/api/project';
import { getAllMapOnline, getStationListNeedAttendant } from '@/api/jmap/map';
import { getAllMapOnline, querySimulationMemberByMapId, querySimulationStationsByMapId } from '@/api/jmap/map';
import { getBackProjectConfigByCode } from '@/api/projectConfig';
import { getMapFunctioById } from '@/api/trainingPlatform';
import { } from '@/api/jmap/map';
export default {
name: 'EditConfig',
data() {
@ -93,6 +106,7 @@ export default {
dialogVisible: false,
data: {},
mapList: [],
roleList:[],
lwList: [],
formIbp: {
part: '',
@ -100,7 +114,8 @@ export default {
},
formLw: {
mapId: '',
stationCode: ''
stationCode: '',
roleCode:''
},
formIscs: {
deviceCode: '',
@ -122,6 +137,9 @@ export default {
rulesLw: {
stationCode: [
{ required: true, message: '请选择关联车站', trigger: 'change'}
],
roleCode: [
{ required: true, message: '请选择关联角色', trigger: 'change'}
]
},
rulesIscs: {
@ -144,7 +162,8 @@ export default {
if (resp.data.config && resp.data.type === 'VR_IBP') {
this.formIbp = JSON.parse(resp.data.config);
} else if (resp.data.config && resp.data.type === 'LW') {
this.formLw = JSON.parse(resp.data.config);
const form = JSON.parse(resp.data.config);
this.formLw = Object.assign(this.formLw, form);
} else if (resp.data.config && (resp.data.type === 'ISCS_LW' || resp.data.type === 'ISCS_CW')) {
this.formIscs = JSON.parse(resp.data.config);
}
@ -243,16 +262,111 @@ export default {
},
mapIdChange(mapId) {
if (mapId) {
getStationListNeedAttendant(mapId).then(resp => {
// const stationResp = await querySimulationStationsByMapId(this.$route.query.mapId);
querySimulationStationsByMapId(mapId).then(resp => {
if (resp.data && resp.data.length) {
this.stationList = resp.data;
}
}).catch(() => {
this.$message.error('获取车站列表失败');
});
querySimulationMemberByMapId(mapId).then(resp => {
if (resp.data) {
getBackProjectConfigByCode(this.data.project).then(res=>{
if (res.data) {
const functionId = res.data.functionId;
if (functionId) {
getMapFunctioById(functionId).then(response=>{
if (resp.data) {
const roleList = resp.data[response.data.simType];
const covertRoleList = [];
roleList.forEach(member => {
const data = this.handleMember(member, this.stationList);
covertRoleList.push(data);
});
this.roleList = covertRoleList;
}
});
} else {
this.$message.error('请先配置项目信息');
}
}
});
}
}).catch(() => {
this.$message.error('获取角色列表失败');
});
} else {
this.stationList = [];
}
},
handleMember(member, stationList) {
const data = { value: member.id, label: '', memberType: member.type };
const device = stationList.find(station => station.code === member.deviceCode) || {};
switch (member.type) {
case 'DISPATCHER':
data.label = '行调' + (member.name ? `-${member.name }` : '');
break;
case 'STATION_SUPERVISOR':
data.label = '行值-' + device.name + (member.name ? `-${member.name }` : '');
break;
case 'DRIVER':
data.label = '司机-' + member.deviceCode;
break;
case 'MAINTAINER':
data.label = '通号' + (member.name ? `-${member.name }` : '');
break;
case 'DEPOT_DISPATCHER':
data.label = '调度-' + device.name + (member.name ? `-${member.name }` : '');
break;
case 'SIGNAL_BUILDING':
data.label = '信号楼-' + device.name + (member.name ? `-${member.name }` : '');
break;
case 'STATION_ASSISTANT':
data.label = '助理-' + device.name + (member.name ? `-${member.name }` : '');
break;
case 'STATION_MASTER':
data.label = '站长-' + device.name + (member.name ? `-${member.name }` : '');
break;
case 'STATION_SIGNALER':
data.label = '信号员-' + device.name + (member.name ? `-${member.name }` : '');
break;
case 'STATION_PASSENGER':
data.label = '客运员-' + device.name + (member.name ? `-${member.name }` : '');
break;
case 'STATION_SWITCH_MAN':
data.label = '扳道员-' + device.name + (member.name ? `-${member.name }` : '');
break;
case 'STATION_FACILITATOR':
data.label = '引导员-' + device.name + (member.name ? `-${member.name }` : '');
break;
case 'STATION_WORKER':
data.label = '工务工-' + device.name + (member.name ? `-${member.name }` : '');
break;
case 'DEVICE_MANAGER':
data.label = '设备管理员-' + device.name + (member.name ? `-${member.name }` : '');
break;
case 'TRAIN_MASTER':
data.label = '车务段段长' + (member.name ? `-${member.name }` : '');
break;
case 'ELECTRIC_DISPATCHER':
data.label = '工电调度' + (member.name ? `-${member.name }` : '');
break;
case 'PARENT_DEPARTMENT':
data.label = '上级部分' + (member.name ? `-${member.name }` : '');
break;
case 'SCHEDULING':
data.label = '派班员' + (member.name ? `-${member.name }` : '');
break;
case 'SHIFT_MANAGER':
data.label = '值班主任' + (member.name ? `-${member.name }` : '');
break;
case 'ENVIRONMENT_DISPATCHER':
data.label = '环控调度' + (member.name ? `-${member.name}` : '');
break;
}
return data;
}
}
};