Merge remote-tracking branch 'origin/test'

This commit is contained in:
fan 2020-11-30 18:28:15 +08:00
commit a9bf3f7f02
33 changed files with 158 additions and 255 deletions

View File

@ -229,13 +229,13 @@ export function publisMapCityList(data) {
}); });
} }
/** 新版地图根据仿真mapId获取仿真地图数据 */ // /** 新版地图根据仿真mapId获取仿真地图数据 */
export function getNewMapDataByMapId(mapId) { // export function getNewMapDataByMapId(mapId) {
return request({ // return request({
url: `/api/map/${mapId}/mapData`, // url: `/api/map/${mapId}/mapData`,
method: 'get' // method: 'get'
}); // });
} // }
/** 发布地图根据id生成子系统及权限 */ /** 发布地图根据id生成子系统及权限 */
export function generateAncillaryData(mapId) { export function generateAncillaryData(mapId) {
return request({ return request({

View File

@ -25,6 +25,7 @@ export default {
mapName: 'Map Name', mapName: 'Map Name',
trainingName: 'Training Name', trainingName: 'Training Name',
trainingUseTime: 'Training Time', trainingUseTime: 'Training Time',
hour:'Hour',
minute: 'Minute', minute: 'Minute',
second: 'Second', second: 'Second',
createSimulationTitle: 'Create Simulation Information', createSimulationTitle: 'Create Simulation Information',

View File

@ -25,6 +25,7 @@ export default {
mapName: '地图名称', mapName: '地图名称',
trainingName: '实训名称', trainingName: '实训名称',
trainingUseTime: '实训用时', trainingUseTime: '实训用时',
hour:'时',
minute: '分', minute: '分',
second: '秒', second: '秒',
createSimulationTitle: '创建仿真信息', createSimulationTitle: '创建仿真信息',

View File

@ -31,12 +31,13 @@ export function TrainConnect(trafficTrain,deviceaction,toptrain,routegroup,passe
const data = JSON.parse(Response.body); const data = JSON.parse(Response.body);
if(data.type == "PFV"){ if(data.type == "PFV"){
console.log(data); // console.log(data);
console.log(trafficTrain.trainList); // console.log(trafficTrain.trainList);
for(let k in trafficTrain.trainList){ for(let k in trafficTrain.trainList){
if(trafficTrain.trainList[k].code == data.body){ if(trafficTrain.trainList[k].code == data.body){
updateValue(data.body); updateValue(data.body);
trafficTrain.updateNowTrainCode(data.body); trafficTrain.updateNowTrainCode(data.body);
trafficTrain.updateNowTrunk(0+'');
break; break;
} }
} }
@ -55,8 +56,9 @@ export function TrainConnect(trafficTrain,deviceaction,toptrain,routegroup,passe
} }
} }
if(data.type == "TRAIN_PFI_BL"){
if(data.type == "TRAIN_PFI_BL"){
// console.log(data);
trafficTrain.updateTrainData(data.body); trafficTrain.updateTrainData(data.body);

View File

@ -244,7 +244,9 @@ export function Jl3dTrafficTrain(dom,skinCode,routegroup,viewMap,initCode) {
window.onresize = function () { window.onresize = function () {
passerRender.reSize(scope.dom.offsetWidth,scope.dom.offsetHeight); passerRender.reSize(scope.dom.offsetWidth,scope.dom.offsetHeight);
} }
this.updateNowTrunk = function(newTrunkNum){
passerHuman.nowTrunk = newTrunkNum;
};
this.switchcamera = function(trunkNum){ this.switchcamera = function(trunkNum){
passerHuman.nowTrunk = trunkNum; passerHuman.nowTrunk = trunkNum;
@ -316,10 +318,14 @@ export function Jl3dTrafficTrain(dom,skinCode,routegroup,viewMap,initCode) {
this.updateTrainData = function(newData){ this.updateTrainData = function(newData){
if(scope.trainList.length > 0){ // console.log(scope.trainList);
for(let i=0;i<scope.trainList.length;i++){ // if(scope.trainList.length > 0){
if(newData.code == scope.trainList[i].code){ // for(let k in scope.trainList.length){
scope.trainList[i].num = scope.trainList[i].num + newData.in - newData.out; let k = newData.code;
if(scope.trainList[k]){
// console.log(newData);
// console.log(scope.trainList[k].num);
scope.trainList[k].num = scope.trainList[k].num + newData.in - newData.out;
if(passerTrain.toptrain.nowcode == newData.code){ if(passerTrain.toptrain.nowcode == newData.code){
scope.humanWaitIn = getnum(newData.in,6); scope.humanWaitIn = getnum(newData.in,6);
@ -330,15 +336,15 @@ export function Jl3dTrafficTrain(dom,skinCode,routegroup,viewMap,initCode) {
// console.log("------------------"); // console.log("------------------");
passerHuman.initTrainRail(humanlist,scope.humanWaitIn,scope.humanWaitOut,nowLeaveDoor); passerHuman.initTrainRail(humanlist,scope.humanWaitIn,scope.humanWaitOut,nowLeaveDoor);
let trainDataList = getnum(scope.trainList[i].num,6); let trainDataList = getnum(scope.trainList[k].num,6);
// nowTrunk.code = newCode; // nowTrunk.code = newCode;
scope.nowTrunk.numList = trainDataList; scope.nowTrunk.numList = trainDataList;
updateTrainNum(trainDataList); updateTrainNum(trainDataList);
} }
i = scope.trainList.length; // i = scope.trainList.length;
} }
} // }
} // }
} }
this.updateNowTrainCode = function(newCode){ this.updateNowTrainCode = function(newCode){

View File

@ -82,3 +82,15 @@ export function computationTime(time) {
} }
return hours + ':' + minutes + ':' + seconds; return hours + ':' + minutes + ':' + seconds;
} }
export function computationSeconds(seconds, hourUnit, minuteUnit, secondUnit) {
if (seconds) {
const h = parseInt(seconds / 3600);
const m = parseInt((seconds - h * 3600) / 60);
const s = (seconds - h * 3600) % 60;
return h ? `${h} ${hourUnit} ${m} ${minuteUnit} ${s} ${secondUnit}`
: m ? `${m} ${minuteUnit} ${s} ${secondUnit}`
: `${s} ${secondUnit}`;
}
return null;
}

View File

@ -1,5 +1,6 @@
import store from '@/store/index_APP_TARGET'; import store from '@/store/index_APP_TARGET';
import { getPublishMapVersionById, getPublishMapDetailById, getNewMapDataByMapId} from '@/api/jmap/map'; import { getPublishMapVersionById, getPublishMapDetailById} from '@/api/jmap/map';
// getNewMapDataByMapId
// import { getNewMapDataByGroup } from '@/api/simulation'; // import { getNewMapDataByGroup } from '@/api/simulation';
// 获取地图版本数据和store里面的map版本做比较如果不同 // 获取地图版本数据和store里面的map版本做比较如果不同
@ -48,7 +49,7 @@ export function loadMapDataById(mapId, type = 'mapPreview') {
export function loadNewMapDataByMapId(mapId) { export function loadNewMapDataByMapId(mapId) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
getNewMapDataByMapId(mapId).then(resp => { getPublishMapDetailById(mapId).then(resp => {
covertData(resp.data, 'mapId', resolve); covertData(resp.data, 'mapId', resolve);
}).catch(error => { }).catch(error => {
reject(error); reject(error);

View File

@ -20,6 +20,7 @@ export default {
data() { data() {
return { return {
companyList: [], companyList: [],
companyMap: {},
pagerConfig: { pagerConfig: {
pageSize: 'pageSize', pageSize: 'pageSize',
pageIndex: 'pageNum' pageIndex: 'pageNum'
@ -78,11 +79,14 @@ export default {
return ''; return '';
} }
}, },
// { {
// title: '', title: '单位',
// prop: 'createUserName', prop: 'companyId',
// width: '100' width: '100',
// }, type: 'tag',
columnValue: (row) => { return this.getCompanyName(row.companyId); },
tagType: (row) => { return ''; }
},
{ {
type: 'button', type: 'button',
title: '操 作', title: '操 作',
@ -124,6 +128,7 @@ export default {
getCompanyList().then(resp => { getCompanyList().then(resp => {
resp.data.forEach(item => { resp.data.forEach(item => {
this.queryForm.queryObject.companyId.config.data.push({ value: item.id, label: item.name }); this.queryForm.queryObject.companyId.config.data.push({ value: item.id, label: item.name });
this.companyMap[item.id] = item.name;
}); });
}); });
}, },
@ -131,7 +136,9 @@ export default {
doCreate() { doCreate() {
this.$router.push({path: `${UrlConfig.bank.questionCreate}`}); this.$router.push({path: `${UrlConfig.bank.questionCreate}`});
}, },
getCompanyName(companyId) {
return this.companyMap[companyId];
},
edit(index, row) { edit(index, row) {
this.$router.push({path: `${UrlConfig.bank.questionUpdate}/${row.id}`}); this.$router.push({path: `${UrlConfig.bank.questionUpdate}/${row.id}`});
}, },

View File

@ -31,10 +31,6 @@ export default {
}, },
data() { data() {
return { return {
// size: {
// width: document.documentElement.clientWidth - 400,
// height: document.documentElement.clientHeight - 80
// },
maskOpen: false, maskOpen: false,
maskWidth: 'calc(100% - 450px)', maskWidth: 'calc(100% - 450px)',
disPlay: false disPlay: false
@ -173,8 +169,6 @@ export default {
this.clearSubscribe(); this.clearSubscribe();
} }
this.$store.dispatch('training/over').then(() => { this.$store.dispatch('training/over').then(() => {
EventBus.$emit('runPlanStop');
EventBus.$emit('chatSubscribeStop');
history.go(-1); history.go(-1);
}); });
}, },
@ -189,8 +183,7 @@ export default {
this.clearSubscribe(); this.clearSubscribe();
const header = { group: this.$route.query.group || '', 'X-Token': getToken() }; const header = { group: this.$route.query.group || '', 'X-Token': getToken() };
creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header); creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);
// await this.$store.dispatch('training/setHasSubscribed');
await this.$store.dispatch('training/setHasSubscribed');
}, },
clearSubscribe() { clearSubscribe() {
clearSubscribe(`${displayTopic}\/${this.$route.query.group}`); clearSubscribe(`${displayTopic}\/${this.$route.query.group}`);

View File

@ -180,8 +180,6 @@ export default {
this.clearSubscribe(); this.clearSubscribe();
} }
this.$store.dispatch('training/over').then(() => { this.$store.dispatch('training/over').then(() => {
EventBus.$emit('runPlanStop');
EventBus.$emit('chatSubscribeStop');
history.go(-1); history.go(-1);
}); });
}, },
@ -196,8 +194,7 @@ export default {
this.clearSubscribe(); this.clearSubscribe();
const header = { group: this.$route.query.group || '', 'X-Token': getToken() }; const header = { group: this.$route.query.group || '', 'X-Token': getToken() };
creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header); creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);
// await this.$store.dispatch('training/setHasSubscribed');
await this.$store.dispatch('training/setHasSubscribed');
}, },
clearSubscribe() { clearSubscribe() {
clearSubscribe(`${displayTopic}\/${this.$route.query.group}`); clearSubscribe(`${displayTopic}\/${this.$route.query.group}`);

View File

@ -133,8 +133,7 @@ export default {
this.clearSubscribe(); this.clearSubscribe();
const header = { group: this.group || '', 'X-Token': getToken() }; const header = { group: this.group || '', 'X-Token': getToken() };
creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header); creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);
// await this.$store.dispatch('training/setHasSubscribed');
await this.$store.dispatch('training/setHasSubscribed');
}, },
clearSubscribe() { clearSubscribe() {
clearSubscribe(`${displayTopic}\/${this.group}`); clearSubscribe(`${displayTopic}\/${this.group}`);

View File

@ -162,8 +162,6 @@ export default {
this.examList = response.data.userExamQuestionsVOs; this.examList = response.data.userExamQuestionsVOs;
this.userExam = response.data; this.userExam = response.data;
const list = response.data.userExamQuestionsVOs; const list = response.data.userExamQuestionsVOs;
await this.$store.dispatch('exam/setUsedTime', this.userExam.usedTime);
await this.$store.dispatch('exam/setTotalTime', this.userExam.duration);
await this.$store.dispatch('trainingList/setTrainingList', list); await this.$store.dispatch('trainingList/setTrainingList', list);
} catch (error) { } catch (error) {
// //

View File

@ -281,8 +281,7 @@ export default {
this.clearSubscribe(); this.clearSubscribe();
const header = { group: this.$route.query.group || '', 'X-Token': getToken() }; const header = { group: this.$route.query.group || '', 'X-Token': getToken() };
creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header); creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);
// await this.$store.dispatch('training/setHasSubscribed');
await this.$store.dispatch('training/setHasSubscribed');
}, },
clearSubscribe() { clearSubscribe() {
clearSubscribe(`${displayTopic}\/${this.$route.query.group}`); clearSubscribe(`${displayTopic}\/${this.$route.query.group}`);

View File

@ -345,8 +345,7 @@ export default {
this.clearSubscribe(); this.clearSubscribe();
const header = { group: this.group || '', 'X-Token': getToken() }; const header = { group: this.group || '', 'X-Token': getToken() };
creatSubscribe(`${displayTopic}\/${this.group}`, header); creatSubscribe(`${displayTopic}\/${this.group}`, header);
// await this.$store.dispatch('training/setHasSubscribed');
await this.$store.dispatch('training/setHasSubscribed');
}, },
clearSubscribe() { clearSubscribe() {
clearSubscribe(`${displayTopic}\/${this.group}`); clearSubscribe(`${displayTopic}\/${this.group}`);

View File

@ -381,7 +381,7 @@ export default {
this.clearSubscribe(); this.clearSubscribe();
const header = { group: this.group || '', 'X-Token': getToken() }; const header = { group: this.group || '', 'X-Token': getToken() };
creatSubscribe(`${displayTopic}\/${this.group}`, header); creatSubscribe(`${displayTopic}\/${this.group}`, header);
await this.$store.dispatch('training/setHasSubscribed'); // await this.$store.dispatch('training/setHasSubscribed');
}, },
clearSubscribe() { clearSubscribe() {
clearSubscribe(`${displayTopic}\/${this.group}`); clearSubscribe(`${displayTopic}\/${this.group}`);

View File

@ -62,7 +62,7 @@
</div> </div>
</template> </template>
</div> </div>
<div v-else style="text-align: center;width: 100%;height: 50px;line-height: 50px;font-size: 18px;color: #ccc;"> <div v-else class="empty-text">
<span>暂无留言</span> <span>暂无留言</span>
</div> </div>
<div style="width: 100%;text-align: center;"> <div style="width: 100%;text-align: center;">
@ -80,7 +80,7 @@
<el-button @click="handleClear">清空</el-button> <el-button @click="handleClear">清空</el-button>
<el-button type="danger" @click="commitComment">留言</el-button> <el-button type="danger" @click="commitComment">留言</el-button>
</span> </span>
<el-button size="mini" type="danger" style="position: fixed; right: 100px;top: 80px;width: 90px;" @click="goSlide">我要留言</el-button> <el-button size="mini" type="danger" style="position: fixed; left: 91%;top: 80px;width: 90px;" @click="goSlide">我要留言</el-button>
<div v-show="imgShow" style="position: fixed;width: 100%;height: 100%;left: 0;top: 0;background: rgba(0,0,0,0.5);cursor: zoom-out;" @click="handelCloseImg"> <div v-show="imgShow" style="position: fixed;width: 100%;height: 100%;left: 0;top: 0;background: rgba(0,0,0,0.5);cursor: zoom-out;" @click="handelCloseImg">
<img id="targetImg" src="" style="position: fixed;top: 50%;left: 50%;transform: translate(-50%,-50%);min-width: 500px;max-height: 80%;height: auto;"> <img id="targetImg" src="" style="position: fixed;top: 50%;left: 50%;transform: translate(-50%,-50%);min-width: 500px;max-height: 80%;height: auto;">
</div> </div>
@ -100,7 +100,6 @@ export default {
name: 'MessageBoard', name: 'MessageBoard',
data() { data() {
return { return {
// dialogVisible: false,
content: '', content: '',
postCommentList: [], postCommentList: [],
pageSize: 10, pageSize: 10,
@ -201,7 +200,7 @@ export default {
}, },
avatarUrl(val) { avatarUrl(val) {
if (val && val.creatorAvatarPath) { if (val && val.creatorAvatarPath) {
return 'https://joylink.club/oss/joylink' + val.creatorAvatarPath; return process.env.VUE_APP_VOICE_API + val.creatorAvatarPath;
} else { } else {
return 'https://joylink.club/oss/wxmicro_assistant/userhead/defaultuser.png'; return 'https://joylink.club/oss/wxmicro_assistant/userhead/defaultuser.png';
} }
@ -355,6 +354,14 @@ export default {
display: flex; display: flex;
justify-content: center; justify-content: center;
} }
.empty-text{
text-align: center;
width: 100%;
height: 50px;
line-height: 50px;
font-size: 18px;
color: #ccc;
}
.head_portrait{ .head_portrait{
width: 50px; width: 50px;
height: 50px; height: 50px;

View File

@ -170,7 +170,7 @@ export default {
this.clearSubscribe(); this.clearSubscribe();
const header = { group: this.$route.query.group || '', 'X-Token': getToken() }; const header = { group: this.$route.query.group || '', 'X-Token': getToken() };
creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header); creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);
await this.$store.dispatch('training/setHasSubscribed'); // await this.$store.dispatch('training/setHasSubscribed');
this.$store.dispatch('app/animationsClose'); this.$store.dispatch('app/animationsClose');
}, },
clearSubscribe() { clearSubscribe() {

View File

@ -75,7 +75,7 @@ export default {
}, },
watch: { watch: {
'$store.state.map.mapViewLoadedCount': function() { '$store.state.map.mapViewLoadedCount': function() {
this.$store.dispatch('exam/countUsedTime'); // this.$store.dispatch('exam/countUsedTime');
this.locateDeviceCode && this.$store.dispatch('exam/setCenter', this.locateDeviceCode); // this.locateDeviceCode && this.$store.dispatch('exam/setCenter', this.locateDeviceCode); //
}, },
$route() { $route() {
@ -90,7 +90,7 @@ export default {
} }
}, },
// mounted() { // mounted() {
// this.initData(); // this.initDate();
// }, // },
methods: { methods: {
tipInfo(opt) { tipInfo(opt) {

View File

@ -148,6 +148,7 @@ export default {
} }
}, },
beforeDestroy() { beforeDestroy() {
this.$store.dispatch('exam/stopCountTime');
this.clearScanCommit(); this.clearScanCommit();
}, },
methods: { methods: {

View File

@ -10,7 +10,7 @@
<menu-script v-if="isScript" ref="menuScript" :offset-bottom="offsetBottom" :offset="offset" :text-status-height="textStatusHeight" :data-error="dataError" @start="start" @end="end" /> <menu-script v-if="isScript" ref="menuScript" :offset-bottom="offsetBottom" :offset="offset" :text-status-height="textStatusHeight" :data-error="dataError" @start="start" @end="end" />
<menu-dispather-contest v-if="isContest" ref="menuDispatherContest" :offset="offset" :offset-bottom="offsetBottom" :data-error="dataError" :text-status-height="textStatusHeight" @start="start" @end="end" /> <menu-dispather-contest v-if="isContest" ref="menuDispatherContest" :offset="offset" :offset-bottom="offsetBottom" :data-error="dataError" :text-status-height="textStatusHeight" @start="start" @end="end" />
</template> </template>
<menu-train-list v-if="isDemon||isContest||isScript" @setCenter="setCenter" /> <menu-train-list v-if="isDemon||isContest||isScript" />
<menu-system-time ref="menuSystemTime" :offset="offset" :group="group" /> <menu-system-time ref="menuSystemTime" :offset="offset" :group="group" />
</div> </div>
</template> </template>
@ -82,9 +82,9 @@ export default {
isScript() { isScript() {
return this.mode === 'script'; return this.mode === 'script';
}, },
isPlan() { // isPlan() {
return this.mode === 'plan'; // return this.mode === 'plan';
}, // },
mapId() { mapId() {
return this.$route.query.mapId; return this.$route.query.mapId;
}, },
@ -157,10 +157,6 @@ export default {
await this.$refs.menuDispatherContest.back(); await this.$refs.menuDispatherContest.back();
} }
}, },
//
setCenter(code) {
this.$jlmap.setCenter(code);
},
// //
setPosition() { setPosition() {
this.$nextTick(() => { this.$nextTick(() => {

View File

@ -1,10 +1,6 @@
<template> <template>
<div class="menuTrainListOut" :class="{'xian_01' : lineCode == '11', 'active': drawer}"> <div class="menuTrainListOut" :class="{'xian_01' : lineCode == '11', 'active': drawer}">
<div class="menuTrainListBtn" @click="clickBtn"> <div class="menuTrainListBtn" @click="clickBtn">列车</div>
<!-- <i class="el-icon-more" /> -->
<p style="margin: 0;"></p>
<p style="margin: 0;"></p>
</div>
<div :show-close="false" class="menuTrainList_box" style="height: 100%;"> <div :show-close="false" class="menuTrainList_box" style="height: 100%;">
<div v-if="lineCode=='10'||lineCode=='11'" class="menuTrainList"> <div v-if="lineCode=='10'||lineCode=='11'" class="menuTrainList">
<div class="bottomTrainListInfo">下行列车详细信息</div> <div class="bottomTrainListInfo">下行列车详细信息</div>
@ -113,11 +109,8 @@ export default {
} }
}, },
selectTrain(row, column, event) { selectTrain(row, column, event) {
this.setCenter(row.code); //
}, this.$jlmap.setCenter(row.code);
//
setCenter(code) {
this.$emit('setCenter', code);
}, },
covert(data) { covert(data) {
const absData = Math.abs(data); const absData = Math.abs(data);
@ -159,6 +152,7 @@ export default {
text-align: center; text-align: center;
justify-content: center; justify-content: center;
padding: 7px 4px; padding: 7px 4px;
width: 23px;
} }
.menuTrainList_box{ .menuTrainList_box{
height: 100%; height: 100%;

View File

@ -161,19 +161,7 @@ export default {
this.$store.dispatch('config/resize', { width, height }); this.$store.dispatch('config/resize', { width, height });
}, },
async back() { async back() {
// if (this.group) {
// await clearSimulation(this.group);
// this.clearSubscribe();
// }
// this.$store.dispatch('map/setShowCentralizedStationCode', '');
// history.go(-1);
// await this.$store.dispatch('map/mapClear');
// if (this.group) {
// await clearSimulation(this.group);
// this.clearSubscribe();
// }
window.close(); window.close();
// Notification.closeAll();
}, },
async statusMessage(list) { async statusMessage(list) {
await this.$store.dispatch('training/updateMapState', list); await this.$store.dispatch('training/updateMapState', list);
@ -182,13 +170,8 @@ export default {
async subscribe() { async subscribe() {
this.clearSubscribe(); this.clearSubscribe();
const header = { group: this.group || '', 'X-Token': getToken() }; const header = { group: this.group || '', 'X-Token': getToken() };
// creatSubscribe(`${jl3dTopic}\/${this.$route.query.group}`, header);
creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header); creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);
// setTimeout(()=>{ // await this.$store.dispatch('training/setHasSubscribed');
// }, 500);
// });
await this.$store.dispatch('training/setHasSubscribed');
}, },
clearSubscribe() { clearSubscribe() {
clearSubscribe(`${jl3dTopic}\/${this.group}`); clearSubscribe(`${jl3dTopic}\/${this.group}`);

View File

@ -109,7 +109,6 @@ export default {
this.clearSubscribe(); this.clearSubscribe();
const header = { group: this.$route.query.group || '', 'X-Token': getToken() }; const header = { group: this.$route.query.group || '', 'X-Token': getToken() };
creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header); creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);
await this.$store.dispatch('training/setHasSubscribed'); await this.$store.dispatch('training/setHasSubscribed');
}, },
clearSubscribe() { clearSubscribe() {

View File

@ -14,10 +14,6 @@ import { validateCharCode } from '@/utils/validate';
export default { export default {
name: 'DictionaryDetailEdit', name: 'DictionaryDetailEdit',
props: { props: {
type: {
type: String,
required: true
},
dicId: { dicId: {
type: String, type: String,
required: true required: true
@ -26,21 +22,22 @@ export default {
data() { data() {
return { return {
dialogVisible: false, dialogVisible: false,
isAdd:true,
formModel: { formModel: {
code: '', code: '',
name: '', name: '',
status: '1', status: '1',
remarks: '' remarks: ''
} },
title:''
}; };
}, },
computed: { computed: {
form() { form() {
const isAdd = this.type === 'ADD';
const form = { const form = {
labelWidth: '60px', labelWidth: '60px',
items: [ items: [
{ prop: 'code', label: this.$t('system.code'), type: 'text', required: true, disabled: !isAdd }, { prop: 'code', label: this.$t('system.code'), type: 'text', required: true, disabled: !this.isAdd },
{ prop: 'name', label: this.$t('system.name'), type: 'text', required: true }, { prop: 'name', label: this.$t('system.name'), type: 'text', required: true },
{ {
prop: 'status', label: this.$t('system.status'), type: 'select', required: true, options: this.$ConstSelect.Status prop: 'status', label: this.$t('system.status'), type: 'select', required: true, options: this.$ConstSelect.Status
@ -52,6 +49,11 @@ export default {
}, },
rules() { rules() {
const crules = { const crules = {
code: [
{ required: true, message: this.$t('rules.pleaseInputCode'), trigger: 'blur' },
{ min: 1, max: 25, message: this.$t('rules.strLength1To25'), trigger: 'blur' },
{ validator: this.validateCode, trigger: 'blur' }
],
name: [ name: [
{ required: true, message: this.$t('rules.pleaseInputName'), trigger: 'blur' }, { required: true, message: this.$t('rules.pleaseInputName'), trigger: 'blur' },
{ min: 1, max: 25, message: this.$t('rules.strLength1To25'), trigger: 'blur' } { min: 1, max: 25, message: this.$t('rules.strLength1To25'), trigger: 'blur' }
@ -63,24 +65,7 @@ export default {
{ max: 50, message: this.$t('rules.strLengthNotExceed50'), trigger: 'blur' } { max: 50, message: this.$t('rules.strLengthNotExceed50'), trigger: 'blur' }
] ]
}; };
if (this.type === 'ADD') { return crules;
return Object.assign(crules, {
code: [
{ required: true, message: this.$t('rules.pleaseInputCode'), trigger: 'blur' },
{ min: 1, max: 25, message: this.$t('rules.strLength1To25'), trigger: 'blur' },
{ validator: this.validateCode, trigger: 'blur' }
]
});
} else {
return crules;
}
},
title() {
if (this.type === 'ADD') {
return this.$t('system.createDetail');
} else {
return this.$t('system.editDetail');
}
} }
}, },
methods: { methods: {
@ -100,18 +85,24 @@ export default {
} }
}, },
show(id) { show(id) {
this.dialogVisible = true;
if (id) { if (id) {
getData(this.dicId, id).then(response => { getData(this.dicId, id).then(response => {
this.formModel = response.data; this.formModel = response.data;
this.$refs.dataform.resetForm(); this.$refs.dataform.resetForm();
this.isAdd = false;
this.title = this.$t('system.editDetail');
}); });
} else {
this.isAdd = true;
this.$refs.dataform.resetForm();
this.title = this.$t('system.createDetail');
} }
this.dialogVisible = true;
}, },
doSave() { doSave() {
const self = this; const self = this;
this.$refs.dataform.validateForm(() => { this.$refs.dataform.validateForm(() => {
if (self.type === 'ADD') { if (this.isAdd) {
self.create(); self.create();
} else { } else {
self.update(); self.update();

View File

@ -6,8 +6,7 @@
<el-button type="primary" @click="turnback">{{ $t('global.back') }}</el-button> <el-button type="primary" @click="turnback">{{ $t('global.back') }}</el-button>
</el-button-group> </el-button-group>
</div> </div>
<dictionary-detail-edit ref="create" type="ADD" :dic-id="dicId" @reloadTable="reloadTable" /> <dictionary-detail-edit ref="edit" :dic-id="dicId" @reloadTable="reloadTable" />
<dictionary-detail-edit ref="edit" type="EDIT" :dic-id="dicId" @reloadTable="reloadTable" />
</div> </div>
</template> </template>
@ -118,7 +117,7 @@ export default {
}, },
handleAdd() { handleAdd() {
this.$refs.create.show(); this.$refs.edit.show();
}, },
handleBatchDelete() { handleBatchDelete() {

View File

@ -146,7 +146,6 @@ export default {
// //
this.mapList = []; this.mapList = [];
const res = await getPublishMapListOnline(); const res = await getPublishMapListOnline();
this.allMapList = res.data;
res.data.forEach(elem => { res.data.forEach(elem => {
this.queryForm.queryObject.mapId.config.data.push({ value: elem.id, label: elem.name }); this.queryForm.queryObject.mapId.config.data.push({ value: elem.id, label: elem.name });
this.mapList.push({ value: elem.id, label: elem.name }); this.mapList.push({ value: elem.id, label: elem.name });

View File

@ -10,23 +10,26 @@
<script> <script>
import { putRoles } from '@/api/management/user'; import { putRoles } from '@/api/management/user';
import { getCompanyList } from '@/api/company';
export default { export default {
name: 'DictionaryEdit', name: 'DictionaryEdit',
props: {
companyList: {
type: Array,
default() {
return [];
}
}
},
data() { data() {
return { return {
dialogVisible: false, dialogVisible: false,
formModel: { formModel: {
id: '', id: '',
name: '', name: '',
// nickname: '',
// mobile: '',
// email: '',
companyId: '', companyId: '',
roles: [] roles: []
}, }
companyList: []
}; };
}, },
computed: { computed: {
@ -35,9 +38,6 @@ export default {
labelWidth: '100px', labelWidth: '100px',
items: [ items: [
{ prop: 'name', label: this.$t('system.name'), type: 'text', disabled: true }, { prop: 'name', label: this.$t('system.name'), type: 'text', disabled: true },
// { prop: 'nickname', label: '', type: 'text' },
// { prop: 'mobile', label: '', type: 'number' },
// { prop: 'email', label: '', type: 'text' },
{ prop: 'roles', label: this.$t('system.permission'), type: 'select', required: true, options: this.$ConstSelect.roleList, multiple: true }, { prop: 'roles', label: this.$t('system.permission'), type: 'select', required: true, options: this.$ConstSelect.roleList, multiple: true },
{ prop: 'companyId', label: '单位', type: 'select', options: this.companyList, clearable: true } { prop: 'companyId', label: '单位', type: 'select', options: this.companyList, clearable: true }
] ]
@ -53,23 +53,11 @@ export default {
roles: [ roles: [
{ required: true, message: this.$t('rules.pleaseSelectPermission'), trigger: 'change' } { required: true, message: this.$t('rules.pleaseSelectPermission'), trigger: 'change' }
] ]
// nickname: [
// { required: true, message: this.$t('rules.pleaseInputNickName'), trigger: 'blur' },
// { min: 1, max: 25, message: this.$t('rules.strLength1To25'), trigger: 'blur' }
// ],
// mobile: [
// { required: true, message: this.$t('rules.pleaseSelectStatus'), trigger: 'blur' }
// ]
}; };
return crules; return crules;
} }
}, },
mounted() { mounted() {
getCompanyList().then(resp => {
resp.data.forEach(item => {
this.companyList.push({label: item.name, value: parseInt(item.id)});
});
});
}, },
methods: { methods: {
doShow(data) { doShow(data) {
@ -78,9 +66,6 @@ export default {
this.formModel = { this.formModel = {
id: data.id, id: data.id,
name: data.name, name: data.name,
// nickname: data.nickname,
// mobile: data.mobile,
// email: data.email,
companyId: data.companyId, companyId: data.companyId,
roles: data.roles roles: data.roles
}; };

View File

@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" /> <QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<dictionary-edit ref="edit" @reloadTable="reloadTable" /> <dictionary-edit ref="edit" :company-list="companyList" @reloadTable="reloadTable" />
<correlation-map ref="correlationMap" /> <correlation-map ref="correlationMap" />
<create-user ref="createUser" /> <create-user ref="createUser" />
</div> </div>
@ -9,6 +9,7 @@
<script> <script>
import { getUserList } from '@/api/management/user'; import { getUserList } from '@/api/management/user';
import { getCompanyList } from '@/api/company';
import DictionaryEdit from './edit'; import DictionaryEdit from './edit';
import CorrelationMap from './correlationMap'; import CorrelationMap from './correlationMap';
import CreateUser from './createUser'; import CreateUser from './createUser';
@ -26,6 +27,8 @@ export default {
pageSize: 'pageSize', pageSize: 'pageSize',
pageIndex: 'pageNum' pageIndex: 'pageNum'
}, },
companyMap: {},
companyList: [],
queryForm: { queryForm: {
labelWidth: '80px', labelWidth: '80px',
reset: true, reset: true,
@ -65,6 +68,13 @@ export default {
title: this.$t('global.email'), title: this.$t('global.email'),
prop: 'email' prop: 'email'
}, },
{
title: '单位',
prop: 'companyId',
type: 'tag',
columnValue: (row) => { return this.getCompanyName(row.companyId); },
tagType: (row) => { return 'success'; }
},
{ {
title: this.$t('system.roles'), title: this.$t('system.roles'),
prop: 'roles', prop: 'roles',
@ -98,6 +108,18 @@ export default {
}; };
}, },
created() { created() {
this.companyMap = {};
this.companyList = [];
getCompanyList().then(resp => {
if (resp && resp.data && resp.data.length) {
resp.data.forEach(item => {
this.companyMap[item.id] = item.name;
this.companyList.push({label: item.name, value: parseInt(item.id)});
});
}
}).catch((error) => {
console.error(error);
});
}, },
methods: { methods: {
// //
@ -105,29 +127,13 @@ export default {
this.$refs.edit.doShow(row); this.$refs.edit.doShow(row);
}, },
//
handleUserDelete(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(() => {
// delPublishMap(row.id).then(response => {
// this.$message.success('')
// this.reloadTable()
// localStore.remove('mapId')
// }).catch(error => {
// this.reloadTable()
// this.$messageBox('')
// })
});
},
// //
handleMapCorrelation(index, row) { handleMapCorrelation(index, row) {
this.$refs.correlationMap.doShow(row); this.$refs.correlationMap.doShow(row);
}, },
getCompanyName(companyId) {
return this.companyMap[companyId];
},
reloadTable() { reloadTable() {
this.queryList.reload(); this.queryList.reload();
}, },

View File

@ -100,19 +100,11 @@ export default {
currentModel: {} currentModel: {}
}; };
}, },
created() {
this.loadInitData();
},
methods: { methods: {
loadInitData() {
},
// //
edit(index, row) { edit(index, row) {
this.$refs.edit.show(row); this.$refs.edit.show(row);
}, },
// //
handleDelete(index, row) { handleDelete(index, row) {
this.$confirm(this.$t('system.wellDelExamResult'), this.$t('global.tips'), { this.$confirm(this.$t('system.wellDelExamResult'), this.$t('global.tips'), {
@ -129,7 +121,6 @@ export default {
}); });
}); });
}, },
reloadTable() { reloadTable() {
this.queryList.reload(); this.queryList.reload();
} }

View File

@ -8,7 +8,7 @@
<script> <script>
import { getSimulationList, deleteSimulationStats } from '@/api/simulation'; import { getSimulationList, deleteSimulationStats } from '@/api/simulation';
import {computationSeconds} from '@/utils/date';
import UsersTrainingEdit from './edit'; import UsersTrainingEdit from './edit';
import UsersTrainingAdd from './add'; import UsersTrainingAdd from './add';
export default { export default {
@ -94,29 +94,17 @@ export default {
currentModel: {} currentModel: {}
}; };
}, },
created() {
},
methods: { methods: {
createTraining() { createTraining() {
this.$refs.add.show(); this.$refs.add.show();
}, },
computation(fieldValue) { computation(fieldValue) {
if (fieldValue) { return computationSeconds(fieldValue, this.$t('system.hour'), this.$t('system.minute'), this.$t('system.second'));
const f = parseInt(fieldValue / 60);
const s = fieldValue % 60;
if (f > 0) {
return `${f} ${this.$t('system.minute')} ${s} ${this.$t('system.second')}`;
} else {
return `${s} ${this.$t('system.second')}`;
}
}
}, },
// //
edit(index, row) { edit(index, row) {
this.$refs.edit.show(row); this.$refs.edit.show(row);
}, },
// //
handleDelete(index, row) { handleDelete(index, row) {
this.$confirm(this.$t('system.wellDelUserSimulation'), this.$t('global.tips'), { this.$confirm(this.$t('system.wellDelUserSimulation'), this.$t('global.tips'), {

View File

@ -7,6 +7,7 @@
</template> </template>
<script> <script>
import {computationSeconds} from '@/utils/date';
import { getTrainingListNew, deleteUserTrainingNew } from '@/api/jmap/training'; import { getTrainingListNew, deleteUserTrainingNew } from '@/api/jmap/training';
import UsersTrainingEdit from './edit'; import UsersTrainingEdit from './edit';
import UsersTrainingAdd from './add'; import UsersTrainingAdd from './add';
@ -92,28 +93,13 @@ export default {
currentModel: {} currentModel: {}
}; };
}, },
created() {
this.loadInitData();
},
methods: { methods: {
loadInitData() {
},
createTraining() { createTraining() {
this.$refs.add.show(); this.$refs.add.show();
}, },
computation(fieldValue) { computation(fieldValue) {
if (fieldValue) { return computationSeconds(fieldValue, this.$t('system.hour'), this.$t('system.minute'), this.$t('system.second'));
const f = parseInt(fieldValue / 60);
const s = fieldValue % 60;
if (f > 0) {
return `${f} ${this.$t('system.minute')} ${s} ${this.$t('system.second')}`;
} else {
return `${s} ${this.$t('system.second')}`;
}
}
}, },
// //
edit(index, row) { edit(index, row) {
this.$refs.edit.show(row); this.$refs.edit.show(row);

View File

@ -17,7 +17,6 @@
:filter-node-method="filterNode" :filter-node-method="filterNode"
:default-expanded-keys="expandList" :default-expanded-keys="expandList"
@node-click="clickEvent" @node-click="clickEvent"
@node-contextmenu="showContextMenu"
@node-expand="nodeExpand" @node-expand="nodeExpand"
@node-collapse="nodeCollapse" @node-collapse="nodeCollapse"
> >
@ -54,9 +53,6 @@ export default {
loading: true, loading: true,
filterText: '', filterText: '',
treeList: [], treeList: [],
selected: {},
node: {
},
mapId: '', mapId: '',
expandList: [], expandList: [],
filterSelect: '' filterSelect: ''
@ -79,8 +75,6 @@ export default {
this.$refs.tree.filter(val); this.$refs.tree.filter(val);
} }
}, },
beforeDestroy () {
},
mounted() { mounted() {
if (this.getMapByCode) { if (this.getMapByCode) {
this.refresh(); this.refresh();
@ -91,12 +85,6 @@ export default {
if (!value) return true; if (!value) return true;
return data.name.includes(value); return data.name.includes(value);
}, },
showContextMenu(e, obj, node, vueElem) {
if (obj) {
this.node = node;
this.selected = obj;
}
},
clickEvent(obj, data, ele, isReplace = false) { clickEvent(obj, data, ele, isReplace = false) {
localStore.set('trainingPlatformCheckId' + this.filterSelect + this.userId + this.project, obj.key); localStore.set('trainingPlatformCheckId' + this.filterSelect + this.userId + this.project, obj.key);
while (data) { while (data) {
@ -109,11 +97,8 @@ export default {
} }
if ( obj.type === 'Map') { if ( obj.type === 'Map') {
this.mapId = obj.id; this.mapId = obj.id;
if (isReplace) { const router = { path: `${UrlConfig.trainingPlatform.permission}/${this.mapId}`};
this.$router.replace({ path: `${UrlConfig.trainingPlatform.permission}/${this.mapId}`}); this.toNextPage(isReplace, router);
} else {
this.$router.push({ path: `${UrlConfig.trainingPlatform.permission}/${this.mapId}`});
}
} else if ( obj.type === 'MapSystem') { } else if ( obj.type === 'MapSystem') {
getSubSystemInfo(obj.id).then(resp => { // getSubSystemInfo(obj.id).then(resp => { //
let router = ''; let router = '';
@ -121,44 +106,19 @@ export default {
case 'Exam': case 'Exam':
this.setLocalRoute(`${UrlConfig.trainingPlatform.examHome}/${obj.id}`); this.setLocalRoute(`${UrlConfig.trainingPlatform.examHome}/${obj.id}`);
router = localStore.get('examDetail' + obj.id); router = localStore.get('examDetail' + obj.id);
if (router) { if (!router) { router = { path: `${UrlConfig.trainingPlatform.examHome}/${obj.id}`}; }
if (isReplace) { this.toNextPage(isReplace, router);
this.$router.replace(router);
} else {
this.$router.push(router);
}
} else {
if (isReplace) {
this.$router.replace({ path: `${UrlConfig.trainingPlatform.examHome}/${obj.id}`});
} else {
this.$router.push({ path: `${UrlConfig.trainingPlatform.examHome}/${obj.id}`});
}
}
break; break;
case 'Lesson': case 'Lesson':
this.setLocalRoute(`${UrlConfig.trainingPlatform.teachHome}/${obj.id}`); this.setLocalRoute(`${UrlConfig.trainingPlatform.teachHome}/${obj.id}`);
router = localStore.get('teachDetail' + obj.id); router = localStore.get('teachDetail' + obj.id);
if (router) { if (!router) { router = { path: `${UrlConfig.trainingPlatform.teachHome}/${obj.id}`}; }
if (isReplace) { this.toNextPage(isReplace, router);
this.$router.replace(router);
} else {
this.$router.push(router);
}
} else {
if (isReplace) {
this.$router.replace({ path: `${UrlConfig.trainingPlatform.teachHome}/${obj.id}`});
} else {
this.$router.push({ path: `${UrlConfig.trainingPlatform.teachHome}/${obj.id}`});
}
}
break; break;
case 'Simulation': case 'Simulation':
this.setLocalRoute(`${UrlConfig.trainingPlatform.prodDetail}/${obj.id}?mapId=${this.mapId}`); this.setLocalRoute(`${UrlConfig.trainingPlatform.prodDetail}/${obj.id}?mapId=${this.mapId}`);
if (isReplace) { router = { path: `${UrlConfig.trainingPlatform.prodDetail}/${obj.id}`, query: { mapId: this.mapId}};
this.$router.replace({ path: `${UrlConfig.trainingPlatform.prodDetail}/${obj.id}`, query: { mapId: this.mapId}}); this.toNextPage(isReplace, router);
} else {
this.$router.push({ path: `${UrlConfig.trainingPlatform.prodDetail}/${obj.id}`, query: { mapId: this.mapId}});
}
break; break;
} }
}).catch((error) => { }).catch((error) => {
@ -168,6 +128,9 @@ export default {
}); });
} }
}, },
toNextPage(isReplace, router) {
isReplace ? this.$router.replace(router) : this.$router.push(router);
},
setLocalRoute(path) { setLocalRoute(path) {
localStore.set('trainingPlatformRoute' + this.userId + this.project, path); localStore.set('trainingPlatformRoute' + this.userId + this.project, path);
}, },