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获取仿真地图数据 */
export function getNewMapDataByMapId(mapId) {
return request({
url: `/api/map/${mapId}/mapData`,
method: 'get'
});
}
// /** 新版地图根据仿真mapId获取仿真地图数据 */
// export function getNewMapDataByMapId(mapId) {
// return request({
// url: `/api/map/${mapId}/mapData`,
// method: 'get'
// });
// }
/** 发布地图根据id生成子系统及权限 */
export function generateAncillaryData(mapId) {
return request({

View File

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

View File

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

View File

@ -31,12 +31,13 @@ export function TrainConnect(trafficTrain,deviceaction,toptrain,routegroup,passe
const data = JSON.parse(Response.body);
if(data.type == "PFV"){
console.log(data);
console.log(trafficTrain.trainList);
// console.log(data);
// console.log(trafficTrain.trainList);
for(let k in trafficTrain.trainList){
if(trafficTrain.trainList[k].code == data.body){
updateValue(data.body);
trafficTrain.updateNowTrainCode(data.body);
trafficTrain.updateNowTrunk(0+'');
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);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -162,8 +162,6 @@ export default {
this.examList = response.data.userExamQuestionsVOs;
this.userExam = response.data;
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);
} catch (error) {
//

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -148,6 +148,7 @@ export default {
}
},
beforeDestroy() {
this.$store.dispatch('exam/stopCountTime');
this.clearScanCommit();
},
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-dispather-contest v-if="isContest" ref="menuDispatherContest" :offset="offset" :offset-bottom="offsetBottom" :data-error="dataError" :text-status-height="textStatusHeight" @start="start" @end="end" />
</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" />
</div>
</template>
@ -82,9 +82,9 @@ export default {
isScript() {
return this.mode === 'script';
},
isPlan() {
return this.mode === 'plan';
},
// isPlan() {
// return this.mode === 'plan';
// },
mapId() {
return this.$route.query.mapId;
},
@ -157,10 +157,6 @@ export default {
await this.$refs.menuDispatherContest.back();
}
},
//
setCenter(code) {
this.$jlmap.setCenter(code);
},
//
setPosition() {
this.$nextTick(() => {

View File

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

View File

@ -161,19 +161,7 @@ export default {
this.$store.dispatch('config/resize', { width, height });
},
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();
// Notification.closeAll();
},
async statusMessage(list) {
await this.$store.dispatch('training/updateMapState', list);
@ -182,13 +170,8 @@ export default {
async subscribe() {
this.clearSubscribe();
const header = { group: this.group || '', 'X-Token': getToken() };
// creatSubscribe(`${jl3dTopic}\/${this.$route.query.group}`, header);
creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);
// setTimeout(()=>{
// }, 500);
// });
await this.$store.dispatch('training/setHasSubscribed');
// await this.$store.dispatch('training/setHasSubscribed');
},
clearSubscribe() {
clearSubscribe(`${jl3dTopic}\/${this.group}`);

View File

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

View File

@ -14,10 +14,6 @@ import { validateCharCode } from '@/utils/validate';
export default {
name: 'DictionaryDetailEdit',
props: {
type: {
type: String,
required: true
},
dicId: {
type: String,
required: true
@ -26,21 +22,22 @@ export default {
data() {
return {
dialogVisible: false,
isAdd:true,
formModel: {
code: '',
name: '',
status: '1',
remarks: ''
}
},
title:''
};
},
computed: {
form() {
const isAdd = this.type === 'ADD';
const form = {
labelWidth: '60px',
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: 'status', label: this.$t('system.status'), type: 'select', required: true, options: this.$ConstSelect.Status
@ -52,6 +49,11 @@ export default {
},
rules() {
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: [
{ required: true, message: this.$t('rules.pleaseInputName'), 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' }
]
};
if (this.type === 'ADD') {
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');
}
return crules;
}
},
methods: {
@ -100,18 +85,24 @@ export default {
}
},
show(id) {
this.dialogVisible = true;
if (id) {
getData(this.dicId, id).then(response => {
this.formModel = response.data;
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() {
const self = this;
this.$refs.dataform.validateForm(() => {
if (self.type === 'ADD') {
if (this.isAdd) {
self.create();
} else {
self.update();

View File

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

View File

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

View File

@ -10,23 +10,26 @@
<script>
import { putRoles } from '@/api/management/user';
import { getCompanyList } from '@/api/company';
export default {
name: 'DictionaryEdit',
props: {
companyList: {
type: Array,
default() {
return [];
}
}
},
data() {
return {
dialogVisible: false,
formModel: {
id: '',
name: '',
// nickname: '',
// mobile: '',
// email: '',
companyId: '',
roles: []
},
companyList: []
}
};
},
computed: {
@ -35,9 +38,6 @@ export default {
labelWidth: '100px',
items: [
{ 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: 'companyId', label: '单位', type: 'select', options: this.companyList, clearable: true }
]
@ -53,23 +53,11 @@ export default {
roles: [
{ 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;
}
},
mounted() {
getCompanyList().then(resp => {
resp.data.forEach(item => {
this.companyList.push({label: item.name, value: parseInt(item.id)});
});
});
},
methods: {
doShow(data) {
@ -78,9 +66,6 @@ export default {
this.formModel = {
id: data.id,
name: data.name,
// nickname: data.nickname,
// mobile: data.mobile,
// email: data.email,
companyId: data.companyId,
roles: data.roles
};

View File

@ -1,7 +1,7 @@
<template>
<div>
<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" />
<create-user ref="createUser" />
</div>
@ -9,6 +9,7 @@
<script>
import { getUserList } from '@/api/management/user';
import { getCompanyList } from '@/api/company';
import DictionaryEdit from './edit';
import CorrelationMap from './correlationMap';
import CreateUser from './createUser';
@ -26,6 +27,8 @@ export default {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
companyMap: {},
companyList: [],
queryForm: {
labelWidth: '80px',
reset: true,
@ -65,6 +68,13 @@ export default {
title: this.$t('global.email'),
prop: 'email'
},
{
title: '单位',
prop: 'companyId',
type: 'tag',
columnValue: (row) => { return this.getCompanyName(row.companyId); },
tagType: (row) => { return 'success'; }
},
{
title: this.$t('system.roles'),
prop: 'roles',
@ -98,6 +108,18 @@ export default {
};
},
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: {
//
@ -105,29 +127,13 @@ export default {
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) {
this.$refs.correlationMap.doShow(row);
},
getCompanyName(companyId) {
return this.companyMap[companyId];
},
reloadTable() {
this.queryList.reload();
},

View File

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

View File

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

View File

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

View File

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