This commit is contained in:
fan 2019-10-22 16:06:20 +08:00
commit 6f314ba150
19 changed files with 142 additions and 395 deletions

View File

@ -1,10 +1,11 @@
import request from '@/utils/request';
export function getTrainingSystemList(cityCode) {
export function getTrainingSystemList(cityCode, params) {
/** 根据cityCode后去对应地图及其子系统 */
return request({
url: `/api/mapSystem/city/${cityCode}`,
method: 'get'
method: 'get',
params
});
}
@ -76,3 +77,11 @@ export function updateSubSystem(id, data) {
});
}
export function deleteSubSystem(id) {
/** 删除地图系统 */
return request({
url: `/api/mapSystem/${id}`,
method: 'delete'
});
}

View File

@ -491,5 +491,6 @@ export default {
settingTrain: 'Setting train',
sourceTrainWindow: 'Source train window',
trainWindow: 'Train window',
targetTrainWindow: 'Target train window'
targetTrainWindow: 'Target train window',
category: 'category'
};

View File

@ -22,5 +22,9 @@ export default {
getSubSystemInfoFail: 'Get subsystem infomation failed',
updateMapSystemSuccess: 'Update map system success',
updateMapSystemFail: 'Update map system failed',
generation: 'One-click Generation'
generation: 'One-click Generation',
deleteData: 'Delete',
deleteMapSystemSuccess: 'Delete map system success',
deleteMapSystemFail: 'Delete map system fail',
deleteMapSystemTip: 'This action will apply to delete map system, whether to continue?'
};

View File

@ -487,6 +487,7 @@ export default {
settingTrain: '设置列车',
sourceTrainWindow: '源车次窗',
trainWindow: '车次窗',
targetTrainWindow: '目的车次窗'
targetTrainWindow: '目的车次窗',
category: '类别'
};

View File

@ -22,6 +22,10 @@ export default {
getSubSystemInfoFail: '获取子系统信息失败',
updateMapSystemSuccess: '更新地图系统成功',
updateMapSystemFail: '更新地图系统失败',
generation: '一键生成'
generation: '一键生成',
deleteData: '删除',
deleteMapSystemSuccess: '删除地图系统成功',
deleteMapSystemFail: '删除地图系统失败',
deleteMapSystemTip: '此操作将删除地图系统, 是否继续?'
};

View File

@ -52,19 +52,17 @@
:disabled="targetCodeIsDisabled"
/>
</el-form-item>
<el-form-item v-if="formModel.trainType == '03'" :label="this.$t('menu.groupNumber')+this.$t('global.colon')" prop="groupNumber">
<el-form-item v-if="formModel.trainType == '03'" :label="this.$t('menu.category')+this.$t('global.colon')" prop="category">
<el-select
:id="domIdTrainNumber"
v-model="formModel.groupNumber"
v-model="formModel.category"
filterable
:disabled="trainNumberIsDisabled"
@change="trainNumberChange"
>
<el-option
v-for="train in trainList"
:key="train.groupNumber"
:label="train.groupNumber"
:value="train.groupNumber"
v-for="item in categoryList"
:key="item.value"
:label="item.name"
:value="item.value"
/>
</el-select>
</el-form-item>
@ -99,12 +97,18 @@ export default {
data() {
return {
trainList: [],
categoryList: [
{ name: 'MM', value: '01' },
{ name: 'BB', value: '02' },
{ name: 'AA', value: '03' }
],
formModel: {
tripNumber: '',
groupNumber: '',
trainType: '01',
serviceNumber: '',
targetCode: ''
targetCode: '',
category: 'MM'
},
rules: {
@ -252,6 +256,14 @@ export default {
'formModel.tripNumber': function(val) {
if (val.length == 4) {
this.trainNoChange(val);
} else {
this.formModel = {
groupNumber: this.formModel.groupNumber,
tripNumber: val,
trainType: this.formModel.trainType,
serviceNumber: '',
targetCode: ''
};
}
}
},
@ -278,12 +290,11 @@ export default {
const model = this.$store.getters['map/getDeviceByCode'](selected.code);
this.formModel = {
groupNumber: model.groupNumber,
tripNumber: model.tripNumber,
tripNumber: `${model.directionCode}${model.tripNumber}`,
trainType: model.type,
serviceNumber: '',
targetCode: ''
serviceNumber: model.serviceNumber,
targetCode: model.targetCode
};
debugger;
/** 加载列车数据*/
this.loadInitData(this.map);
@ -340,7 +351,7 @@ export default {
const operate = {
send: true,
type: MapDeviceType.Train.type,
val: `${tripNumber}`,
val: tripNumber,
operation: ''
};
@ -351,16 +362,25 @@ export default {
}
OperateHandler.backStep(1);
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
console.log(valid, response, 111);
if (valid && response.data) {
this.formModel = {
groupNumber: this.formModel.groupNumber,
tripNumber: tripNumber,
trainType: '01',
serviceNumber: response.data.serviceNumber,
targetCode: response.data.tripNumber
};
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (valid) {
if (response.data) {
this.formModel = {
groupNumber: this.formModel.groupNumber,
tripNumber: tripNumber,
trainType: this.formModel.trainType,
serviceNumber: response.data.serviceNumber,
targetCode: response.data.targetCode
};
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} else {
this.formModel = {
groupNumber: this.formModel.groupNumber,
tripNumber: tripNumber,
trainType: this.formModel.trainType,
serviceNumber: '',
targetCode: ''
};
}
}
});
},
@ -413,7 +433,7 @@ export default {
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.editTrainId.menu.operation,
messages: [this.$t('tip.editTrainIdTip')],
val: `01::${this.formModel.tripNumber}`
val: `${this.formModel.trainType}::${this.formModel.tripNumber}`
};
this.loading = true;

View File

@ -22,6 +22,7 @@ import JointTraining from '@/views/jointTraining/index';
import Error401 from '@/views/error-page/401';
import Errpr404 from '@/views/error-page/404';
import SkinCode from '@/views/map/skinCode/index';
import SkinCodeDraft from '@/views/map/skinCode/draft';
import Mapdraft from '@/views/map/mapdraft/index';
@ -29,6 +30,7 @@ import Mapedit from '@/views/map/mapdraft/mapedit/index';
import Runplan from '@/views/map/runplan/index';
import MapProduct from '@/views/map/product/index';
import RunplanView from '@/views/map/runplan/chart';
import Trainingrecord from '@/views/lesson/trainingrecord/index';
import TrainingrecordManage from '@/views/lesson/trainingrecord/manage/index';
import Taskmanage from '@/views/lesson/taskmanage/list';
@ -61,7 +63,6 @@ import ScreenMonitorDetail from '@/views/screenMonitor/detail/index';
import PlanMonitorEditTool from '@/views/planMonitor/editTool/index';
import PlanMonitorEditUserTool from '@/views/planMonitor/editTool/userindex';
import PlanMonitor from '@/views/planMonitor/index';
import PlanMonitorHome from '@/views/planMonitor/home';
import PlanMonitorDetail from '@/views/planMonitor/detail';
@ -95,12 +96,10 @@ import OrderList from '@/views/orderauthor/order/list';
import OrderDraft from '@/views/orderauthor/order/draft';
import Author from '@/views/orderauthor/author/index';
import AuthorDraft from '@/views/orderauthor/author/draft/ruleForm';
import Permission from '@/views/orderauthor/permission/index';
import PermissionDetail from '@/views/orderauthor/permission/detail';
import PermissionDraft from '@/views/orderauthor/permission/draft/ruleForm';
import PermissionCreate from '@/views/orderauthor/permission/create/index';
import UserRules from '@/views/orderauthor/rules/index';
import UserRulesDetail from '@/views/orderauthor/rules/detail';

View File

@ -1,26 +0,0 @@
export default {
ConstSelect: {
// 剧本录制模块枚举
deviceType: [
{label: '进路', value: 'Route'},
{label: '区段', value: 'Section'},
{label: '信号机', value: 'Signal'},
{label: '站台', value: 'StationStand'},
{label: '集中站', value: 'Station'},
{label: '控制模式', value: 'StationControl'},
{label: '道岔', value: 'Switch'},
{label: '列车', value: 'Train'}
],
// 行为触发条件类型
triggerType: [
{label: '对话', value: 'Conversation'},
{label: '设备', value: 'DeviceCondition'},
{label: '无', value: 'None'}
],
// 动作类型
actionType: [
{label: '对话', value: 'Conversation'},
{label: '指令', value: 'Command'}
]
}
};

View File

@ -4,6 +4,7 @@ import { getToken, setToken, removeToken, removeScreenToken, setScreenToken, get
import { getUserConfigInfo } from '@/api/management/user';
import { LoginParams } from '@/utils/login';
import { creatSubscribe, perpetualTopic } from '@/utils/stomp';
import Cookies from 'js-cookie';
const user = {
state: {
@ -174,10 +175,10 @@ const user = {
FedLogOut({ commit }, clientId) {
return new Promise(resolve => {
if (clientId == LoginParams.DaPing.clientId) {
commit('SET_TOKENDESIGN', '');
commit('SET_TOKENSCREEN', '');
removeScreenToken();
} else if (clientId == LoginParams.Design.clientId) {
commit('SET_TOKENSCREEN', '');
commit('SET_TOKENDESIGN', '');
removeDesignToken();
}
// else if (clientId == LoginParams.LianJiHua.clientId) {
@ -201,6 +202,10 @@ const user = {
commit('SET_ROLES', []);
commit('SET_ID', '');
removeSessionStorage('design');
Cookies.remove('UserDesignName');
Cookies.remove('UserDesignToken');
Cookies.remove('UserName');
Cookies.remove('UserToken');
handleRemoveToken();
resolve();
}).catch(error => {

View File

@ -4,8 +4,8 @@ export function getBaseUrl() {
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.41:9000'; // 王兴杰
} else {
BASE_API = process.env.VUE_APP_BASE_API;

View File

@ -4,7 +4,7 @@
<el-scrollbar wrap-class="scrollbar-wrapper">
<h1 class="title">
城市轨道交通设计平台
<img :src="logo" alt="" class="logo-img">
<!-- <img :src="logo" alt="" class="logo-img"> -->
</h1>
<div class="card-box">
<el-carousel :interval="4000" type="card" height="380px">

View File

@ -1,147 +0,0 @@
<template>
<el-card v-loading="loading" class="map-list-main">
<div slot="header" class="clearfix">
<span class="mapListTitle">{{ $t('scriptRecord.mapList') }}</span>
<el-button type="primary" size="small" @click="addScript" class="addScript">{{ $t('scriptRecord.addScript') }}</el-button>
</div>
<el-select v-model="mapSelect" size="medium" class="mapSelect" @change="mapSelectChange">
<el-option v-for="item in mapList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
<!-- <div class="addScript" @click="addScript">
<i class="el-icon-plus" style="color:#409eff;font-size:16px;"></i>
<span class="addScriptText">添加剧本</span>
</div> -->
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: (height-125) +'px', width:'100%',margin:'5px 0 0 0' }">
<el-tree
ref="tree"
:data="treeList"
node-key="id"
:props="defaultProps"
highlight-current
:span="22"
@node-click="clickEvent"
@node-contextmenu="showContextMenu"
>
<span slot-scope="{ node:tnode, data }">
<span
class="el-icon-tickets"
:style="{color: data.valid ? 'green':''}"
></span>
<span :style="{color: data.valid ? 'green':''}">&nbsp;{{ tnode.label }}</span>
</span>
</el-tree>
</el-scrollbar>
</el-card>
</template>
<script>
import { UrlConfig } from '@/router/index';
import localStore from 'storejs';
import { getQuestPageList,createQuest,deleteQuest,updateQuest} from '@/api/quest';
import { listPublishMap } from '@/api/jmap/map';
import { getSessionStorage, setSessionStorage, removeSessionStorage } from '@/utils/auth';
export default {
name: 'ScriptTree',
props: {
height: {
type: Number,
required: true
}
},
created() {
this.loadInitData();
},
data() {
return {
loading: true,
mapList:[],
mapSelect:"",
treeData: [],
treeList: [],
defaultProps: {
children: 'children',
label: 'name',
},
}
},
mounted(){
},
methods:{
loadInitData() {
this.loading=true;
this.mapList = [];
listPublishMap().then(response => {
this.mapList = response.data;
this.loading = false;
this.mapSelect=localStore.get("script_mapId") || this.mapList[0].id;
if(localStore.get("script_mapId")){
this.$store.dispatch('scriptRecord/updateScriptId',localStore.get("script_mapId"));
}
this.getQuestPageList(this.mapSelect);
})
},
mapSelectChange(id){
this.loading = true;
localStore.set("script_mapId", id);
this.$store.dispatch('scriptRecord/updateScriptId',id);
this.getQuestPageList(id);
},
async getQuestPageList(id){
let response=await getQuestPageList(id);
this.loading = false;
this.treeList=response.data;
},
showContextMenu(e, obj, node, vueElem) {
if (obj) {
this.node = node;
this.selected = obj;
}
},
clickEvent(obj, data, ele) {
// setSessionStorage('scriptId', obj.id);
this.$router.push({ path: `${UrlConfig.script.detail}/${obj.id}` });
},
addScript(){
this.refresh(null);
this.$router.push({ path: `${UrlConfig.script.prefix}` });
},
refresh(data) {
let that=this;
if(data)
{
let currentMapId=this.mapSelect;
if(currentMapId!=data.mapId)
{
this.mapSelect=data.mapId;
}
this.getQuestPageList(this.mapSelect).then(function(){
that.$refs.tree.setCurrentKey(data.scriptId);
});
}
else
{
this.getQuestPageList(this.mapSelect);
}
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.mapListTitle{
display: inline-block;
text-align: center;
padding: 8px 0px;
}
.mapSelect {
width:100%;
}
.addScript{
float: right;
display: inline-block;
}
.addScriptText{
color:#409eff;
font-size: 15px;
}
</style>

View File

@ -25,8 +25,7 @@
name: '',
mapId: '',
description:''
},
isShow: false,
}
}
},
props: {
@ -59,9 +58,6 @@
}
return crules
},
// title() {
// return ''
// }
},
mounted() {
this.loadInitData();
@ -101,7 +97,6 @@
},
doClose() {
this.$refs.dataform.resetForm();
this.isShow = false;
this.dialogVisible = false
}
}

View File

@ -1,56 +1,10 @@
<template>
<el-card :style="{height: height+'px'}">
<div class="scriptHeader">
<div class="scriptList">{{$t('scriptRecord.scriptList')}}</div>
<el-button size="small" type="primary" @click="handleCreate" class="createScript">{{$t('scriptRecord.scriptCreate')}}</el-button>
</div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" style="width: 91%;margin-left:4%;margin-top:20px;display: inline-block;"/>
<!-- <el-table
:data="tableData"
stripe
border
style="width: 90%;margin-left:5%;margin-top:20px;display: inline-block;">
<el-table-column
type="index"
width="150">
</el-table-column>
<el-table-column
prop="name"
:label="$t('scriptRecord.scriptName')"
>
</el-table-column>
<el-table-column
prop="description"
:label="$t('scriptRecord.scriptDescription')"
>
</el-table-column>
<el-table-column
:label="$t('scriptRecord.status')"
>
<template slot-scope="scope">
<div>{{covertData(scope.row)}}</div>
</template>
</el-table-column>
<el-table-column
prop="explanation"
:label="$t('scriptRecord.revokeReason')"
>
</el-table-column>
<el-table-column
:label="$t('scriptRecord.operate')"
width="400"
>
<template slot-scope="scope">
<el-button size="small" type="success" @click="drawUp(scope.$index, scope.row)" v-if="!(scope.row.status==1)">{{$t('scriptRecord.scriptRecord')}}</el-button>
<el-button size="small" type="primary" @click="handleModify(scope.$index, scope.row)" v-if="!(scope.row.status==1)">{{$t('scriptRecord.scriptModify')}}</el-button>
<el-button size="small" type="danger" @click="deleteScript(scope.$index, scope.row)" v-if="!(scope.row.status==1)">{{$t('scriptRecord.scriptDelete')}}</el-button>
<el-button size="small" type="primary" @click="publishScript(scope.$index, scope.row)" v-if="scope.row.status==0" v-html="covertButtonname()"></el-button>
<el-button size="small" type="primary" @click="revokeScript(scope.$index, scope.row)" v-if="scope.row.status==1">{{$t('scriptRecord.applyRevoke')}}</el-button>
<el-button size="small" type="success" @click="previewScript(scope.$index, scope.row)" v-if="scope.row.status==1">{{$t('scriptRecord.preview')}}</el-button>
</template>
</el-table-column>
</el-table> -->
<script-publish ref='publishScript' @reloadTable="reloadTable" @create="handleConfirmPublish" :title="$t('scriptRecord.publishScript')">
</script-publish>
<create-script ref='createScript' @reloadTable="reloadTable" @create="handleConfirmCreate" :title="$t('scriptRecord.createScript')">
@ -319,7 +273,6 @@ export default {
}).catch(error => {
this.$messageBox(`${this.$t('scriptRecord.createSimulationFail')}: ${error.message}`);
});
// skinCode=02&group=16-128-757&prdType=02&mapId=18&code=JLFZZX-1&goodsId=&try=0
}
}

View File

@ -1,60 +0,0 @@
<template>
<div class="app-wrapper">
<el-scrollbar wrap-class="scrollbar-wrapper">
<div v-show="treeShow" class="list" :style="{width: widthLeft+'px'}">
<script-tree ref="scriptTree" :height="height" />
</div>
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
<transition>
<router-view @refresh="refresh" />
</transition>
</el-scrollbar>
</div>
</template>
<script>
import ScriptTree from './category/tree';
import drapLeft from '@/views/components/drapLeft/index';
export default {
name: 'Script',
components: {
ScriptTree,
drapLeft
},
data() {
return {
treeShow: true,
widthLeft: 450
};
},
computed: {
height() {
return this.$store.state.app.height - 50;
}
},
methods: {
drapWidth(width) {
this.widthLeft = Number(width);
},
refresh(data) {
this.$refs.scriptTree.refresh(data);
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.app-wrapper {
@include clearfix;
position: relative;
height: 100%;
width: 100%;
overflow: hidden;
}
.list {
float: left;
}
</style>

View File

@ -3,11 +3,6 @@
<el-card class="conversitionCard">
<div class="addConversition">{{ $t('scriptRecord.addConversition') }}</div>
<el-form ref="modalData" size="mini" :model="modalData" :rules="rules" label-width="100px" class="conversitionInfo" label-position="right">
<!-- <el-form-item label="动作类型" class="conditionVO" prop="actionVO.type" >
<el-select v-model="modalData.actionVO.type " placeholder="请选择动作类型" @change="changeType" :disabled="deviceTypeReadOnly||isPause">
<el-option v-for="actionType in actionTypeList" :key="actionType.label" :label="actionType.label" :value="actionType.value"></el-option>
</el-select>
</el-form-item> -->
<div>
<div class="itemGroup">
<el-form-item :label="$t('scriptRecord.narrator')" class="conditionVO" prop="actionVO.memberId">
@ -68,8 +63,6 @@
<script>
import Vue from 'vue';
import Cookies from 'js-cookie';
import DeviceTypeDic from '@/scripts/DeviceTypeDic';
// import CommandForm from "./commandForm";
import ConstConfig from '@/scripts/ConstConfig';
import {addScriptAction,modifyScriptAction,getAvailableDeviceCommand,getDeviceCodeByDeviceType,getScriptPlayMember} from '@/api/simulation';
export default {
@ -130,7 +123,6 @@
isNotModify:true,
modifying:false,
adding:false,
actionTypeList:DeviceTypeDic.ConstSelect.actionType,
isJinLu:false,
stationList:[],
memberList:[],
@ -182,7 +174,6 @@
let lastData=JSON.stringify(resp.data);
roleTypeList.forEach(function(element){
let rolename=element.value;
// lastData=lastData.replace(new RegExp(rolename,'g'),element.label);
if(Cookies.get("user_lang")=="en"){
lastData=lastData.replace(new RegExp(rolename,'g'),element.enLabel);
}else{

View File

@ -122,7 +122,7 @@
});
getCommodityMapProduct(mapInfo.skinCode).then((response) => {
this.productList = response.data.map(elem => { return { value: elem.id, label: elem.name } });
this.productList = response.data.map(elem => { return { value: elem.code, label: elem.name } });
this.formModel.prdCode="";
});
},

View File

@ -1,31 +1,16 @@
<template>
<el-card>
<!-- <div slot="header" style="text-align: center;">
<b>地图子系统生成</b>
</div> -->
<QueryListPage ref="subSystemListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<once-generate ref="generate" @create="generateMapSystem"></once-generate>
<createMapSystem ref="createMapSystem" :title="$t('systemGenerate.createSubSystem')" @create="handleCreate" operateType="add"></createMapSystem>
<createMapSystem ref="modifyMapSystem" :title="$t('systemGenerate.modifySubSystem')" @create="handleModify" operateType="modify"></createMapSystem>
<!-- <div style="margin:50px" :style="{ height: height - 160 +'px' }">
<el-select v-model="mapId" clearable placeholder="请选择地图">
<el-option
v-for="item in mapList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-button type="primary" @click="generate">生成</el-button>
</div> -->
</el-card>
</template>
<script>
import Cookies from 'js-cookie';
import { listPublishMap } from '@/api/jmap/map';
import { generateMapSystem,getMapSystemPageList,createMapSubSystem,getSubSystemInfo,updateSubSystem} from '@/api/trainingPlatform';
import { generateMapSystem,getMapSystemPageList,createMapSubSystem,getSubSystemInfo,updateSubSystem,deleteSubSystem} from '@/api/trainingPlatform';
import ConstConfig from '@/scripts/ConstConfig';
import OnceGenerate from './generate';
import createMapSystem from './create';
@ -101,6 +86,12 @@
handleClick: this.updateData,
type: ''
},
{
name: this.$t('systemGenerate.deleteData'),
handleClick: this.deleteData,
type: 'danger',
showControl:(row) => { return Boolean(row.customized) },
},
],
},
],
@ -116,13 +107,6 @@
OnceGenerate,
createMapSystem
},
// created(){
// listPublishMap().then(response=>{
// response.data.forEach(elem => {
// this.mapList.push({ value: elem.id, label: elem.name });
// });
// });
// },
mounted(){
this.loadInitData();
},
@ -139,6 +123,20 @@
this.$messageBox(this.$t('systemGenerate.getSubSystemInfoFail'));
});
},
deleteData(index,row){
this.$confirm(this.$t('systemGenerate.deleteMapSystemTip'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
deleteSubSystem(row.id).then(response => {
this.$message.success(this.$t('systemGenerate.deleteMapSystemSuccess'));
this.reloadTable();
}).catch(() => {
this.$messageBox(this.$t('systemGenerate.deleteMapSystemFail'));
});
}).catch(() => { });
},
handleCreate(data){
delete data.id;
createMapSubSystem(data).then(response => {
@ -194,19 +192,12 @@
this.$refs.generate.doShow();
},
generateMapSystem(data) {
// if(!this.mapId){this.$messageBox(''); return;}
// this.$confirm('', this.$t('tip.hint'), {
// confirmButtonText: this.$t('tip.confirm'),
// cancelButtonText: this.$t('tip.cancel'),
// type: 'warning'
// }).then(() => {
generateMapSystem(data.mapId).then(response => {
this.reloadTable();
this.$message.success(this.$t('systemGenerate.generateSuccess'));
}).catch(() => {
this.$messageBox(this.$t('systemGenerate.generateFail'));
});
// }).catch(() => { });
generateMapSystem(data.mapId).then(response => {
this.reloadTable();
this.$message.success(this.$t('systemGenerate.generateSuccess'));
}).catch(() => {
this.$messageBox(this.$t('systemGenerate.generateFail'));
});
},
queryFunction(params) {
return getMapSystemPageList(params);

View File

@ -3,8 +3,10 @@
<div slot="header" class="clearfix">
<span>{{ $t('global.mapList') }}</span>
</div>
<filter-city v-if="project!=='xty' " ref="filerCity" filter-empty :query-function="queryFunction" :local-param-name="localParamName" @filterSelectChange="refresh" />
<el-input v-if="project!=='xty' " v-model="filterText" :placeholder="this.$t('global.filteringKeywords')" clearable />
<!-- v-if="project!=='xty' " -->
<filter-city ref="filerCity" filter-empty :query-function="queryFunction" :local-param-name="localParamName" @filterSelectChange="refresh" />
<!-- v-if="project!=='xty' " -->
<el-input v-model="filterText" :placeholder="this.$t('global.filteringKeywords')" clearable />
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: (height-(project?50:125)) +'px' }">
<el-tree
ref="tree"
@ -85,9 +87,9 @@ export default {
beforeDestroy () {
},
mounted() {
if (this.project === 'xty') {
this.projectInitData('18');
}
// if (this.project === 'xty') {
// this.projectInitData('18');
// }
},
methods: {
filterNode(value, data) {
@ -146,7 +148,11 @@ export default {
this.treeList = [];
this.filterSelect = filterSelect;
try {
const res = await getTrainingSystemList(filterSelect);
let params={};
if(this.project === 'xty'){
params={'customized':'xty'};
}
const res = await getTrainingSystemList(filterSelect,params);
res.data.forEach(item =>{
item.key = item.id + item.type;
item.children && item.children.forEach(childrenItem => {
@ -166,24 +172,25 @@ export default {
this.$messageBox(this.$t('error.refreshFailed'));
}
},
async projectInitData(mapId) {
this.loading = true;
this.treeList = [];
try {
const resp = await getTrainingSystemListByMapId(mapId);
this.treeList = resp.data;
this.loading = false;
this.getExpandList(this.filterSelect);
this.$nextTick(() => {
const checkId = localStore.get('trainingPlatformCheckId'+this.filterSelect+this.account) || null;
this.$refs.tree && this.$refs.tree.setCurrentKey(checkId);
this.loading = false;
});
} catch (e) {
this.loading = false;
this.$messageBox(this.$t('error.failedToGetSystemData'));
}
},
// async projectInitData(mapId) {
// this.loading = true;
// this.treeList = [];
// try {
// debugger;
// const resp = await getTrainingSystemListByMapId(mapId);
// this.treeList = resp.data;
// this.loading = false;
// this.getExpandList(this.filterSelect);
// this.$nextTick(() => {
// const checkId = localStore.get('trainingPlatformCheckId'+this.filterSelect+this.account) || null;
// this.$refs.tree && this.$refs.tree.setCurrentKey(checkId);
// this.loading = false;
// });
// } catch (e) {
// this.loading = false;
// this.$messageBox(this.$t('error.failedToGetSystemData'));
// }
// },
nodeExpand(obj, node, ele) {
const key = obj.id;
this.expandList = this.expandList.filter(item => item!==key);