This commit is contained in:
ival 2019-08-09 16:57:28 +08:00
commit b208926795
22 changed files with 420 additions and 259 deletions

View File

@ -1,4 +1,5 @@
import enLocale from 'element-ui/lib/locale/lang/en';
import map from './map';
import global from './global';
import router from './router';
import lesson from './lesson';
@ -7,6 +8,7 @@ import rules from './rules';
export default {
...enLocale,
map,
global,
router,
lesson,

3
src/i18n/langs/en/map.js Normal file
View File

@ -0,0 +1,3 @@
export default {
content: 'dsfjalfjdslfjsdlf'
};

View File

@ -1,4 +1,5 @@
import cnLocale from 'element-ui/lib/locale/lang/zh-CN';
import map from './map';
import global from './global';
import router from './router';
import lesson from './lesson';
@ -7,6 +8,7 @@ import rules from './rules';
export default {
...cnLocale,
map,
global,
router,
lesson,

168
src/i18n/langs/zh/map.js Normal file
View File

@ -0,0 +1,168 @@
export default {
pleaseSelect: '请选择',
sketchMap: '草稿地图列表',
newConstruction: '新建',
importMap: '导入地图',
createNewMap: '新建地图',
normalCreate: '正常创建',
saveMapAs: '地图另存为',
create: '创建',
dataVerification: '数据校验',
logicalView: '逻辑视图',
physicalView: '物理视图',
mixedView: '混合视图',
link: 'link',
section: '区段',
switch: '道岔',
signal: '信号机',
zcZoneControl: 'zc区域控制',
temporaryLimit: '全线临时限速',
lcControl: 'Lc控制',
image: '图片',
station: '车站',
controlMode: '控制模式',
platform: '站台',
counter: '计数器',
delayUnlock: '延迟解锁',
train: '列车',
trainWindow: '车次窗',
line: '线条',
text: '文字',
mapName: '地图名称:',
skinName: '皮肤风格:',
selectCity: '所属城市:',
offsetXColon: 'X偏移:',
offsetYColon: 'Y偏移:',
scalingColon: '缩放比例:',
operationUnusual: '操作异常:',
offsetX: 'X偏移',
offsetY: 'Y偏移',
scaling: '缩放比例',
statusSignalName: '状态信号名称:',
stateSignalsPlotCoordinates: '状态信号画图坐标:',
publishMapCreation: '从发布地图创建',
confirm: '确 定',
cancel: '取 消',
cancelledDelete: '已取消删除',
pleaseEnterMapName: '请输入地图名称',
pleaseChooseSkinStyle: '请选择皮肤风格',
pleaseSelectMapSource: '请选择地图来源',
pleaseSelectAssociatedCity: '请选择关联城市',
pleaseSelectAssociatedSkin: '请选择关联皮肤',
pleaseEnteMapLinkWidth: '请输入地图Link宽度',
pleaseEnterMapSectionWidth: '请输入地图区段宽度',
failedLoadListPublishedMaps: '加载已发布地图列表失败',
creatingSuccessful: '创建成功!',
mapUpdateSuccessful: '更新地图成功!',
createFailure: '创建失败',
importSuccessful: '导入成功!',
importFailure: '导入失败',
updateSuccessfully: '更新成功',
updateFailed: '更新失败',
failedLoadCityList: '加载城市列表失败',
successfullyDelete: '删除成功',
failDelete: '删除失败',
dataValidationFailed: '发布失败,数据校验不通过',
releaseSuccess: '发布成功!',
abnormalOperation: '操作异常',
datQuestion: '有问题数据',
dataList: '数据列表',
saveFailed: '另存失败',
mapEditor: '地图编辑',
mapPublished: '地图发布为',
publishingAssociatedCity: '发布关联城市:',
publishMapName: '发布地图名称:',
updateObj: '修改',
updateObjAxis: '更新坐标',
saveAs: '另存为',
publish: '发布',
deleteObj: '删除',
editRoute: '编辑进路',
editRouting: '编辑交路',
editAutoRouting: '编辑自动信号',
setSwitch: '联动道岔',
pathUnit: '路径单元',
jlmap3d: '三维化编辑',
confirmDeletion: '是否确认删除?',
hint: '提示',
automaticSignalList: '自动信号列表',
automaticSignalCode: '自动信号编码',
signalCodeName: '信号机名称',
signalCode: '信号机code',
sectionData: '区段数据',
preview: '预览',
operation: '操作',
compile: '编辑',
delete: '删除',
sectionName: '区段名称',
sectionList: '区段列表',
automaticSignal: '自动信号',
signalID: '信号机ID:',
activate: '激活',
segmentData: '进路自动触发区段数据:',
save: '保存',
updata: '更新',
pleaseSelectSignal: '请选择信号机',
triggerSegmentData: '请选择进路自动触发区段数据',
automaticSignalSuccessful: '创建自动信号成功!',
failedCreateSignal: '创建自动信号失败',
automaticSignalUpdateSucceeded: '更新自动信号成功!',
automaticSignalUpdateFailed: '更新自动信号失败',
stationName: '车站名称:',
property: '属性',
counterCoding: '计数器编码:',
counterName: '计数器名称:',
belongsStation: '所属车站:',
counterType: '计数器类型:',
countMax: '计数器最大值:',
pointX: '坐标 x:',
pointY: '坐标 y:',
code: '编码:',
imageName: '图片名称:',
imageWidth: '图片宽度:',
imageHeight: '图片高度:',
imagePoint: '图片坐标:',
imageZindex: '图片层级:',
imageSelect: '图片选择:',
rotateAngle: '旋转角度:',
areaSolution: '区故解',
alwaysSolution: '总人解',
pleaseSelectMap: '请选择地图',
selectCounterType: '请选择计数器类型',
selectStation: '请选择车站',
pleaseSelectDevice: '请重新选择设备',
pleaseSelectCountName: '请输入计数器名称',
pleaseCounterValue: '请输入计数器最大值',
pleaseEnterXCoordinate: '请输入x坐标',
pleaseEnterYCoordinate: '请输入y坐标',
pleaseEnterDelayTime: '请输入延时时间',
pleaseEnterFontColor: '请输入字体颜色',
pleaseEnterFontFormat: '请输入字体格式',
pleaseEnterImageWidth: '请输入图片宽度',
pleaseEnterImageHeight: '请输入图片高度',
delayUnlockingCode: '延时解锁编码:',
delayTime: '延时时间:',
font: '字体:',
color: '颜色:',
upside: '上段',
hypomere: '下段'
};

View File

@ -73,13 +73,13 @@ export default {
{ label: 'SHD三联段线', value: '18' },
{ label: 'SHD四联段线', value: '19' }
],
roleType:[
{label:'管理员',value:'Admin'},
{label:'教员',value:'Instructor'},
{label:'行调',value:'Dispatcher'},
{label:'车站',value:'Attendant'},
{label:'观众',value:'Audience'},
{label:'司机',value:'Driver'},
roleType: [
{label: '管理员', value: 'Admin'},
{label: '教员', value: 'Instructor'},
{label: '行调', value: 'Dispatcher'},
{label: '车站', value: 'Attendant'},
{label: '观众', value: 'Audience'},
{label: '司机', value: 'Driver'}
],
SimulationType: [
@ -88,14 +88,14 @@ export default {
{ label: '综合演练', value: 'Joint'},
{ label: '大屏', value: 'BigScreen'},
{ label: '琏计划', value: 'RunPlan'},
{ label: '任务录制', value: 'ScriptRecord'},
{ label: '任务录制', value: 'ScriptRecord'}
],
skinCode: [
{ label: '福州一号线', value: '02'},
{ label: '北京一号线', value: '03'},
{ label: '成都三号线', value: '04'},
{ label: '北京八通线', value: '05'},
{ label: '北京八通线', value: '05'}
]
}

View File

@ -15,7 +15,7 @@
</div>
<div class="brief-box">城市轨道交通仿真系统以各地铁信号系统为基础针对培训部分进行改造旨在构建一套用于行车演示的专业仿真模拟系统
该系统具有高灵活性以便于将来的扩展升级同时仿真系统具备正常操作及故障操作两种模式除了正常的功能操作以外还可以进行设备的故障模拟</div>
{{ $t('hello') }}
{{ $t('lesson.content') }}
</el-scrollbar>
</div>
</el-card>

View File

@ -7,7 +7,6 @@
<transition>
<router-view />
</transition>
<!-- <menu-location ref="menuLocation" /> -->
</div>
</template>
<script>
@ -15,14 +14,12 @@ import WindowResizeHandler from '@/mixin/WindowResizeHandler';
import MapListOperation from './mapmanage/maplist';
import localStore from 'storejs';
import DrapLeft from '@/views/components/drapLeft/index';
// import MenuLocation from './menus/menuLocation';
export default {
name: 'MapDraft',
components: {
MapListOperation,
DrapLeft
// MenuLocation
},
mixins: [
WindowResizeHandler

View File

@ -1,5 +1,5 @@
<template>
<el-dialog title="自动信号列表" :visible.sync="show" width="85%" :before-do-close="doClose">
<el-dialog :title="$t('map.automaticSignalList')" :visible.sync="show" width="85%" :before-do-close="doClose">
<div>
<QueryListPage
ref="queryListPage"
@ -41,7 +41,7 @@ export default {
queryObject: {
signalCode: {
type: 'select',
label: '信号机',
label: this.$t('map.signal'),
config: {
data: []
}
@ -55,38 +55,38 @@ export default {
indexShow: true,
columns: [
{
title: '自动信号编码',
title: this.$t('map.automaticSignalCode'),
prop: 'code'
},
{
title: '信号机名称',
title: this.$t('map.signalCodeName'),
prop: 'signalCode'
},
{
title: '信号机code',
title: this.$t('map.signalCode'),
prop: 'code'
},
{
type: 'button',
title: '区段数据',
title: this.$t('map.sectionData'),
buttons: [
{
name: '预览',
name: this.$t('map.preview'),
handleClick: this.sectionDetail
}
]
},
{
type: 'button',
title: '操作',
title: this.$t('map.operation'),
width: '200',
buttons: [
{
name: '编辑',
name: this.$t('map.compile'),
handleClick: this.editObj
},
{
name: '删除',
name: this.$t('map.delete'),
handleClick: this.deleteObj,
type: 'danger'
}
@ -182,10 +182,10 @@ export default {
if (this.mapInfo && this.mapInfo.id && row) {
//
delAutoSignal(row.id).then(response => {
this.$message.success('删除成功');
this.$message.success(this.$t('map.successfullyDelete'));
this.reloadTable();
}).catch(error => {
this.$messageBox('删除失败');
}).catch(() => {
this.$messageBox(this.$t('map.failDelete'));
});
}
},
@ -197,12 +197,12 @@ export default {
const fieldList = {
id: row.id,
mapId: this.$route.params.mapId,
title: '区段列表',
title: this.$t('map.sectionList'),
name: row.code,
model: {
field: 'autoSignalClearList',
items: [
{ prop: 'sectionCode', label: '区段名称', type: 'select', options: sectionDict }
{ prop: 'sectionCode', label: this.$t('map.sectionName'), type: 'select', options: sectionDict }
]
}
};

View File

@ -4,16 +4,16 @@
<el-card>
<div slot="header" class="clearfix">
<span>
地图名称
{{ $t('map.mapName') }}
<b>{{ mapInfo.name }}</b>
</span>
<el-button type="text" style="float: right; padding: 3px 3px" @click="previewRouteEvent">预览
<el-button type="text" style="float: right; padding: 3px 3px" @click="previewRouteEvent">{{ $t('map.preview') }}
</el-button>
<el-button type="text" style="float: right; padding: 3px 3px" @click="createRouteEvent">新建
<el-button type="text" style="float: right; padding: 3px 3px" @click="createRouteEvent">{{ $t('map.newConstruction') }}
</el-button>
</div>
<el-tabs v-model="enabledTab" type="card">
<el-tab-pane label="自动信号" name="Route">
<el-tab-pane :label="$t('map.automaticSignal')" name="Route">
<route-draft
ref="routeEdit"
:selected="selected"

View File

@ -3,7 +3,7 @@
<el-scrollbar wrap-class="scrollbar-wrapper">
<el-form ref="form" :model="addModel" :rules="rules" label-width="180px" size="mini">
<div class="definition">
<el-form-item label="信号机ID:" prop="signalCode">
<el-form-item :label="$t('map.signalID')" prop="signalCode">
<el-select v-model="addModel.signalCode" clearable :filterable="true">
<el-option
v-for="item in signalList"
@ -12,10 +12,10 @@
:value="item.code"
/>
</el-select>
<el-button :type="field === 'signalCode' ? 'danger' : 'primary'" @click="hover('signalCode')">激活
<el-button :type="field === 'signalCode' ? 'danger' : 'primary'" @click="hover('signalCode')">{{ $t('map.activate') }}
</el-button>
</el-form-item>
<el-form-item label="进路自动触发区段数据:" prop="autoSignalClearList">
<el-form-item :label="$t('map.segmentData')" prop="autoSignalClearList">
<el-select v-model="addModel.autoSignalClearList" multiple clearable :filterable="true">
<el-option
v-for="item in sectionList"
@ -27,13 +27,13 @@
<el-button
:type=" field === 'autoSignalClearList' ? 'danger' : 'primary'"
@click="hover('autoSignalClearList')"
>激活</el-button>
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item>
<el-button-group>
<el-button v-if="isSave" type="primary" size="small" :loading="loading" @click="save">保存
<el-button v-if="isSave" type="primary" size="small" :loading="loading" @click="save">{{ $t('map.save') }}
</el-button>
<el-button v-else type="warning" size="small" :loading="loading" @click="update">更新
<el-button v-else type="warning" size="small" :loading="loading" @click="update">{{ $t('map.updata') }}
</el-button>
</el-button-group>
</el-form-item>
@ -82,10 +82,10 @@ export default {
editShow: false,
rules: {
signalCode: [
{ required: true, message: '请选择信号机', trigger: 'change' }
{ required: true, message: this.$t('map.pleaseSelectSignal'), trigger: 'change' }
],
autoSignalClearList: [
{ required: true, message: '请选择进路自动触发区段数据', trigger: 'change' }
{ required: true, message: this.$t('map.triggerSegmentData'), trigger: 'change' }
]
}
};
@ -149,11 +149,11 @@ export default {
if (valid) {
this.loading = true;
postAutoSignal(this.buildModel(getUID('autoSingle'))).then(resp => {
this.$message.success('创建自动信号成功!');
this.$message.success(this.$t('map.automaticSignalSuccessful'));
this.loading = false;
this.clear();
}).catch(() => {
this.$messageBox('创建自动信号失败');
this.$messageBox(this.$t('map.failedCreateSignal'));
this.loading = false;
});
}
@ -164,11 +164,11 @@ export default {
if (valid) {
this.loading = true;
putAutoSignal(this.buildModel()).then(resp => {
this.$message.success('更新自动信号成功!');
this.$message.success(this.$t('map.automaticSignalUpdateSucceeded'));
this.loading = false;
this.clear();
}).catch(() => {
this.$messageBox('更新自动信号失败');
this.$messageBox(this.$t('map.automaticSignalUpdateFailed'));
this.loading = false;
});
}

View File

@ -1,21 +1,21 @@
<template>
<div>
<el-tabs v-model="activeName">
<el-tab-pane class="view-control" label="属性" name="first">
<el-tab-pane class="view-control" :label="$t('map.property')" name="first">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
<config-list ref="form" :form="dataForm" :form-model="editModel" :rules="rules" />
</el-scrollbar>
<el-button-group class="map-draft-group">
<el-button type="primary" @click="edit">修改</el-button>
<el-button type="primary" @click="deleteObj">删除</el-button>
<el-button type="primary" @click="edit">{{ $t('map.updateObj') }}</el-button>
<el-button type="primary" @click="deleteObj">{{ $t('map.deleteObj') }}</el-button>
</el-button-group>
</el-tab-pane>
<el-tab-pane class="view-control" label="操作" name="second">
<el-tab-pane class="view-control" :label="$t('map.operation')" name="second">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
<config-list ref="make" :form="makeForm" :form-model="addModel" :rules="createRules" />
</el-scrollbar>
<el-button-group class="map-draft-group">
<el-button type="primary" @click="create">创建</el-button>
<el-button type="primary" @click="create">{{ $t('map.create') }}</el-button>
</el-button-group>
</el-tab-pane>
</el-tabs>
@ -51,11 +51,11 @@ export default {
imageLists: [
{
value: `${process.env.VOICE_API}/oss/2d/bj1.png`,
label: '上段'
label: this.$t('map.upside')
},
{
value: `${process.env.VOICE_API}/oss/2d/bj2.png`,
label: '下段'
label: this.$t('map.hypomere')
}
],
editModel: {
@ -85,16 +85,16 @@ export default {
},
rules: {
width: [
{ required: true, message: '请输入图片宽度', trigger: 'blur' }
{ required: true, message: this.$t('map.pleaseEnterImageWidth'), trigger: 'blur' }
],
height: [
{ required: true, message: '请输入图片宽度', trigger: 'blur' }
{ required: true, message: this.$t('map.pleaseEnterImageHeight'), trigger: 'blur' }
],
'position.x': [
{ required: true, message: '请输入x坐标位置', trigger: 'blur' }
{ required: true, message: this.$t('map.pleaseEnterXCoordinate'), trigger: 'blur' }
],
'position.y': [
{ required: true, message: '请输入y坐标位置', trigger: 'blur' }
{ required: true, message: this.$t('map.pleaseEnterYCoordinate'), trigger: 'blur' }
]
}
};
@ -107,13 +107,13 @@ export default {
const form = {
labelWidth: '150px',
items: [
{ prop: 'code', label: '编码:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.resourceList, change: true, deviceChange: this.deviceChange },
{ prop: 'name', label: '图片名称:', type: 'input' },
{ prop: 'width', label: '图片宽度:', type: 'number', min: 0 },
{ prop: 'height', label: '图片高度:', type: 'number', min: 0 },
{ prop: 'zIndex', label: '图片层级:', type: 'number', min: 0 },
{ prop: 'rotate', label: '旋转角度:', type: 'number', min: 0 },
{ prop: 'position', label: '图片坐标:', type: 'coordinate', width: '140px', children: [
{ prop: 'code', label: this.$t('map.code'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.resourceList, change: true, deviceChange: this.deviceChange },
{ prop: 'name', label: this.$t('map.imageName'), type: 'input' },
{ prop: 'width', label: this.$t('map.imageWidth'), type: 'number', min: 0 },
{ prop: 'height', label: this.$t('map.imageHeight'), type: 'number', min: 0 },
{ prop: 'zIndex', label: this.$t('map.imageZindex'), type: 'number', min: 0 },
{ prop: 'rotate', label: this.$t('map.rotateAngle'), type: 'number', min: 0 },
{ prop: 'position', label: this.$t('map.imagePoint'), type: 'coordinate', width: '140px', children: [
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px' },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px' }
] }
@ -125,10 +125,10 @@ export default {
const form = {
labelWidth: '150px',
items: [
{ prop: 'width', label: '图片宽度:', type: 'number', min: 0 },
{ prop: 'height', label: '图片高度:', type: 'number', min: 0 },
{ prop: 'url', label: '图片选择:', type: 'select', optionLabel: 'label', optionValue: 'value', options: this.imageLists },
{ prop: 'position', label: '图片坐标:', type: 'coordinate', width: '140px', children: [
{ prop: 'width', label: this.$t('map.imageWidth'), type: 'number', min: 0 },
{ prop: 'height', label: this.$t('map.imageHeight'), type: 'number', min: 0 },
{ prop: 'url', label: this.$t('map.imageSelect'), type: 'select', optionLabel: 'label', optionValue: 'value', options: this.imageLists },
{ prop: 'position', label: this.$t('map.imagePoint'), type: 'coordinate', width: '140px', children: [
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px' },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px' }
] }
@ -139,16 +139,16 @@ export default {
createRules: function () {
return {
width: [
{ required: true, message: '请输入图片宽度', trigger: 'blur' }
{ required: true, message: this.$t('map.pleaseEnterImageWidth'), trigger: 'blur' }
],
height: [
{ required: true, message: '请输入图片宽度', trigger: 'blur' }
{ required: true, message: this.$t('map.pleaseEnterImageHeight'), trigger: 'blur' }
],
'position.x': [
{ required: true, message: '请输入x坐标位置', trigger: 'blur' }
{ required: true, message: this.$t('map.pleaseEnterXCoordinate'), trigger: 'blur' }
],
'position.y': [
{ required: true, message: '请输入y坐标位置', trigger: 'blur' }
{ required: true, message: this.$t('map.pleaseEnterYCoordinate'), trigger: 'blur' }
]
};
}
@ -241,15 +241,15 @@ export default {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
if (selected && selected._type.toUpperCase() === 'ImageControl'.toUpperCase()) {
const _that = this;
this.$confirm('是否确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
this.$confirm(this.$t('map.confirmDeletion'), this.$t('map.hint'), {
confirmButtonText: this.$t('map.confirm'),
cancelButtonText: this.$t('map.cancel'),
type: 'warning'
}).then(() => {
_that.$emit('delMapModel', selected);
_that.deviceSelect();
}).catch(() => {
_that.$message.info('已取消删除');
_that.$message.info(this.$t('map.cancelledDelete'));
});
}
}

View File

@ -54,7 +54,7 @@
<el-button
:type="item.buttonShowType ? 'danger' : 'primary'"
@click="item.hover(item.buttonType)"
>激活</el-button>
>{{ $t('map.activate') }}</el-button>
</el-form-item>
</template>
<template v-if="checkFieldType(item, 'input')">

View File

@ -1,10 +1,10 @@
<template>
<div>
<el-tabs v-model="activeName">
<el-tab-pane class="view-control" label="属性" name="first">
<el-tab-pane class="view-control" :label="$t('map.property')" name="first">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
<el-form ref="form" :model="editModel" :rules="editRules" label-width="120px" size="mini">
<el-form-item label="计数器编码:" prop="code">
<el-form-item :label="$t('map.counterCoding')" prop="code">
<el-select v-model="editModel.code" filterable @change="deviceChange">
<el-option
v-for="item in counterList"
@ -14,10 +14,10 @@
/>
</el-select>
</el-form-item>
<el-form-item label="计数器名称:" prop="name">
<el-form-item :label="$t('map.counterName')" prop="name">
<el-input v-model="editModel.name" />
</el-form-item>
<el-form-item label="所属车站:" prop="stationCode">
<el-form-item :label="$t('map.belongsStation')" prop="stationCode">
<el-select v-model="editModel.stationCode" filterable>
<el-option
v-for="item in stationList"
@ -27,8 +27,8 @@
/>
</el-select>
</el-form-item>
<el-form-item label="计数器类型:" prop="type">
<el-select v-model="editModel.type" filterable placeholder="请选择类型">
<el-form-item :label="$t('map.counterType')" prop="type">
<el-select v-model="editModel.type" filterable :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in typeList"
:key="item.code"
@ -37,26 +37,26 @@
/>
</el-select>
</el-form-item>
<el-form-item label="计数器最大值:" prop="max">
<el-form-item :label="$t('map.countMax')" prop="max">
<el-input-number v-model="editModel.max" :min="0" />
</el-form-item>
<el-form-item label="坐标 x:" prop="position.x">
<el-form-item :label="$t('map.pointX')" prop="position.x">
<el-input-number v-model="editModel.position.x" />px
</el-form-item>
<el-form-item label="坐标 y:" prop="position.y">
<el-form-item :label="$t('map.pointY')" prop="position.y">
<el-input-number v-model="editModel.position.y" />px
</el-form-item>
</el-form>
</el-scrollbar>
<el-button-group class="map-draft-group">
<el-button type="primary" @click="edit">修改</el-button>
<el-button type="primary" @click="deleteObj">删除</el-button>
<el-button type="primary" @click="edit">{{ $t('map.updateObj') }}</el-button>
<el-button type="primary" @click="deleteObj">{{ $t('map.deleteObj') }}</el-button>
</el-button-group>
</el-tab-pane>
<el-tab-pane class="view-control" label="操作" name="second">
<el-tab-pane class="view-control" :label="$t('map.operation')" name="second">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
<el-form ref="make" label-width="120px" :model="addModel" :rules="createRules" size="mini">
<el-form-item label="车站名称:" prop="stationCode">
<el-form-item :label="$t('map.stationName')" prop="stationCode">
<el-select v-model="addModel.stationCode" filterable>
<el-option
v-for="item in stationList"
@ -66,8 +66,8 @@
/>
</el-select>
</el-form-item>
<el-form-item label="计数器类型:" prop="type">
<el-select v-model="addModel.type" filterable placeholder="请选择类型">
<el-form-item :label="$t('map.counterType')" prop="type">
<el-select v-model="addModel.type" filterable :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in typeList"
:key="item.code"
@ -79,7 +79,7 @@
</el-form>
</el-scrollbar>
<el-button-group class="map-draft-group">
<el-button type="primary" @click="create">创建</el-button>
<el-button type="primary" @click="create">{{ $t('map.create') }}</el-button>
</el-button-group>
</el-tab-pane>
</el-tabs>
@ -110,8 +110,8 @@ export default {
return {
activeName: 'first',
typeList: [
{ code: '01', name: '区故解' },
{ code: '02', name: '总人解' }
{ code: '01', name: this.$t('map.areaSolution') },
{ code: '02', name: this.$t('map.alwaysSolution') }
],
editModel: {
code: '',
@ -140,35 +140,35 @@ export default {
createRules: function () {
return {
type: [
{ required: true, message: '请选择计数器类型', trigger: 'change' }
{ required: true, message: this.$t('map.selectCounterType'), trigger: 'change' }
],
stationCode: [
{ required: true, message: '请选择车站', trigger: 'change' }
{ required: true, message: this.$t('map.selectStation'), trigger: 'change' }
]
};
},
editRules: function () {
return {
code: [
{ required: true, message: '请重新选择设备', trigger: 'change' }
{ required: true, message: this.$t('map.pleaseSelectDevice'), trigger: 'change' }
],
stationCode: [
{ required: true, message: '请选择车站', trigger: 'change' }
{ required: true, message: this.$t('map.selectStation'), trigger: 'change' }
],
name: [
{ required: true, message: '请输入计数器名称', trigger: 'change' }
{ required: true, message: this.$t('map.pleaseSelectCountName'), trigger: 'change' }
],
type: [
{ required: true, message: '请选择计数器类型', trigger: 'change' }
{ required: true, message: this.$t('map.selectCounterType'), trigger: 'change' }
],
max: [
{ required: true, message: '请输入计数器最大值', trigger: 'change' }
{ required: true, message: this.$t('map.pleaseCounterValue'), trigger: 'change' }
],
'position.x': [
{ required: true, message: '请输入x坐标', trigger: 'change' }
{ required: true, message: this.$t('map.pleaseEnterXCoordinate'), trigger: 'change' }
],
'position.y': [
{ required: true, message: '请输入y坐标', trigger: 'change' }
{ required: true, message: this.$t('map.pleaseEnterYCoordinate'), trigger: 'change' }
]
};
}
@ -266,15 +266,15 @@ export default {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
if (selected && selected._type.toUpperCase() === 'Counter'.toUpperCase()) {
const _that = this;
this.$confirm('是否确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
this.$confirm(this.$t('map.confirmDeletion'), this.$t('map.hint'), {
confirmButtonText: this.$t('map.confirm'),
cancelButtonText: this.$t('map.cancel'),
type: 'warning'
}).then(() => {
_that.$emit('delMapModel', selected);
_that.deviceSelect();
}).catch(() => {
_that.$message.info('已取消删除');
_that.$message.info(this.$t('map.cancelledDelete'));
});
}
}

View File

@ -1,10 +1,10 @@
<template>
<div>
<el-tabs v-model="activeName">
<el-tab-pane class="view-control" label="属性" name="first">
<el-tab-pane class="view-control" :label="$t('map.property')" name="first">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
<el-form ref="form" :model="editModel" :rules="editRules" label-width="130px" size="mini">
<el-form-item label="延时解锁编码:" prop="code">
<el-form-item :label="$t('map.delayUnlockingCode')" prop="code">
<el-select v-model="editModel.code" filterable @change="deviceChange">
<el-option
v-for="item in delayShowList"
@ -14,7 +14,7 @@
/>
</el-select>
</el-form-item>
<el-form-item label="所属车站:" prop="stationCode">
<el-form-item :label="$t('map.belongsStation')" prop="stationCode">
<el-select v-model="editModel.stationCode" filterable>
<el-option
v-for="item in stationList"
@ -24,32 +24,32 @@
/>
</el-select>
</el-form-item>
<el-form-item label="延时时间:" prop="unlockTime" disabled="true">
<el-form-item :label="$t('map.delayTime')" prop="unlockTime" disabled="true">
<el-input-number v-model="editModel.unlockTime" :min="0" :max="1000" />s
</el-form-item>
<el-form-item label="字体:" prop="fontFamily">
<el-form-item :label="$t('map.font')" prop="fontFamily">
<el-font v-model="editModel.fontFamily" />
</el-form-item>
<el-form-item label="颜色:" prop="textFontColor">
<el-form-item :label="$t('map.color')" prop="textFontColor">
<el-color-picker v-model="editModel.textFontColor" show-alpha :predefine="skins" />
</el-form-item>
<el-form-item label="坐标 x:" prop="position.x">
<el-form-item :label="$t('map.pointX')" prop="position.x">
<el-input-number v-model="editModel.position.x" />px
</el-form-item>
<el-form-item label="坐标 y:" prop="position.y">
<el-form-item :label="$t('map.pointY')" prop="position.y">
<el-input-number v-model="editModel.position.y" />px
</el-form-item>
</el-form>
</el-scrollbar>
<el-button-group class="map-draft-group">
<el-button type="primary" @click="edit">修改</el-button>
<el-button type="primary" @click="deleteObj">删除</el-button>
<el-button type="primary" @click="edit">{{ $t('map.updateObj') }}</el-button>
<el-button type="primary" @click="deleteObj">{{ $t('map.deleteObj') }}</el-button>
</el-button-group>
</el-tab-pane>
<el-tab-pane class="view-control" label="操作" name="second">
<el-tab-pane class="view-control" :label="$t('map.operation')" name="second">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
<el-form ref="make" label-width="120px" :rules="createRules" :model="addModel" size="mini">
<el-form-item label="车站名称:" prop="stationCode">
<el-form-item :label="$t('map.stationName')" prop="stationCode">
<el-select v-model="addModel.stationCode" filterable>
<el-option
v-for="item in stationList"
@ -62,7 +62,7 @@
</el-form>
</el-scrollbar>
<el-button-group class="map-draft-group">
<el-button type="primary" @click="create">创建</el-button>
<el-button type="primary" @click="create">{{ $t('map.create') }}</el-button>
</el-button-group>
</el-tab-pane>
</el-tabs>
@ -120,32 +120,32 @@ export default {
createRules: function () {
return {
stationCode: [
{ required: true, message: '请选择车站', trigger: 'change' }
{ required: true, message: this.$t('map.selectStation'), trigger: 'change' }
]
};
},
editRules: function () {
return {
code: [
{ required: true, message: '请重新选择设备', trigger: 'change' }
{ required: true, message: this.$t('map.pleaseSelectDevice'), trigger: 'change' }
],
stationCode: [
{ required: true, message: '请选择车站', trigger: 'change' }
{ required: true, message: this.$t('map.selectStation'), trigger: 'change' }
],
unlockTime: [
{ required: true, message: '请输入延时时间', trigger: 'change' }
{ required: true, message: this.$t('map.pleaseEnterDelayTime'), trigger: 'change' }
],
textFontColor: [
{ required: true, message: '请输入字体颜色', trigger: 'change' }
{ required: true, message: this.$t('map.pleaseEnterFontColor'), trigger: 'change' }
],
fontFamily: [
{ required: true, message: '请输入字体格式', trigger: 'change' }
{ required: true, message: this.$t('map.pleaseEnterFontFormat'), trigger: 'change' }
],
'position.x': [
{ required: true, message: '请输入x坐标', trigger: 'change' }
{ required: true, message: this.$t('map.pleaseEnterXCoordinate'), trigger: 'change' }
],
'position.y': [
{ required: true, message: '请输入y坐标', trigger: 'change' }
{ required: true, message: this.$t('map.pleaseEnterYCoordinate'), trigger: 'change' }
]
};
}
@ -241,15 +241,15 @@ export default {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
if (selected && selected._type.toUpperCase() === 'DelayUnlock'.toUpperCase()) {
const _that = this;
this.$confirm('是否确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
this.$confirm(this.$t('map.confirmDeletion'), this.$t('map.hint'), {
confirmButtonText: this.$t('map.confirm'),
cancelButtonText: this.$t('map.cancel'),
type: 'warning'
}).then(() => {
_that.$emit('delMapModel', selected);
_that.deviceSelect();
}).catch(() => {
_that.$message.info('已取消删除');
_that.$message.info(this.$t('map.cancelledDelete'));
});
}
}

View File

@ -4,7 +4,7 @@
<el-card>
<div slot="header" class="clearfix">
<span>
地图名称
{{ $t('map.mapName') }}
<b>{{ mapInfo.name }}</b>
</span>
<el-button
@ -13,20 +13,20 @@
style="float: right; padding: 3px 0"
:disabled="mapSaveing"
@click="saveMapEvent"
>保存</el-button>
>{{ $t('map.save') }}</el-button>
<el-button
v-if="isSave"
type="text"
style="float: right; padding: 3px 0; margin-right: 5px;"
:disabled="mapSaveing"
@click="verifyMapEvent"
>数据校验</el-button>
>{{ $t('map.dataVerification') }}</el-button>
</div>
<el-row type="flex" justify="center">
<el-radio-group v-model="viewSelect" @change="handleSelectView">
<el-radio-button :label="ViewMode.LOGIC">逻辑视图</el-radio-button>
<el-radio-button :label="ViewMode.PHYSICAL">物理视图</el-radio-button>
<el-radio-button :label="ViewMode.MIX">混合视图</el-radio-button>
<el-radio-button :label="ViewMode.LOGIC">{{ $t('map.logicalView') }}</el-radio-button>
<el-radio-button :label="ViewMode.PHYSICAL">{{ $t('map.physicalView') }}</el-radio-button>
<el-radio-button :label="ViewMode.MIX">{{ $t('map.mixedView') }}</el-radio-button>
</el-radio-group>
</el-row>
<el-row v-if="ViewMode.LOGIC === viewSelect" class="logical-view" type="flex" justify="center">
@ -42,7 +42,7 @@
</el-checkbox-group>
</el-row>
<el-tabs v-model="enabledTab" type="card">
<el-tab-pane label="Link" name="Link">
<el-tab-pane :label="$t('map.Link')" name="Link">
<link-draft
ref="Link"
:card-height="cardHeights"
@ -52,7 +52,7 @@
@setCenter="setCenter"
/>
</el-tab-pane>
<el-tab-pane label="区段" name="Section">
<el-tab-pane :label="$t('map.section')" name="Section">
<section-draft
ref="Section"
:card-height="cardHeights"
@ -63,7 +63,7 @@
@fieldSelect="fieldSelect"
/>
</el-tab-pane>
<el-tab-pane label="道岔" name="Switch">
<el-tab-pane :label="$t('map.switch')" name="Switch">
<switch-draft
ref="Switch"
:card-height="cardHeights"
@ -73,7 +73,7 @@
@setCenter="setCenter"
/>
</el-tab-pane>
<el-tab-pane label="信号机" name="Signal">
<el-tab-pane :label="$t('map.signal')" name="Signal">
<signal-draft
ref="Signal"
:card-height="cardHeights"
@ -83,7 +83,7 @@
@setCenter="setCenter"
/>
</el-tab-pane>
<el-tab-pane label="zc区域控制" name="ZcControl">
<el-tab-pane :label="$t('map.zcZoneControl')" name="ZcControl">
<zc-control-draft
ref="ZcControl"
:card-height="cardHeights"
@ -93,7 +93,7 @@
@setCenter="setCenter"
/>
</el-tab-pane>
<el-tab-pane label="全线临时限速" name="LimitControl">
<el-tab-pane :label="$t('map.temporaryLimit')" name="LimitControl">
<limit-control-draft
ref="LimitControl"
:card-height="cardHeights"
@ -103,7 +103,7 @@
@setCenter="setCenter"
/>
</el-tab-pane>
<el-tab-pane label="Lc控制" name="LcControl">
<el-tab-pane :label="$t('map.lcControl')" name="LcControl">
<lc-control-draft
ref="LcControl"
:card-height="cardHeights"
@ -113,7 +113,7 @@
@setCenter="setCenter"
/>
</el-tab-pane>
<el-tab-pane label="图片" name="ImageControl">
<el-tab-pane :label="$t('map.image')" name="ImageControl">
<Image-control-draft
ref="ImageControl"
:card-height="cardHeights"
@ -123,7 +123,7 @@
@setCenter="setCenter"
/>
</el-tab-pane>
<el-tab-pane label="车站" name="Station">
<el-tab-pane :label="$t('map.station')" name="Station">
<station-draft
ref="Station"
:card-height="cardHeights"
@ -133,7 +133,7 @@
@setCenter="setCenter"
/>
</el-tab-pane>
<el-tab-pane label="控制模式" name="StationControl">
<el-tab-pane :label="$t('map.controlMode')" name="StationControl">
<station-control-draft
ref="StationControl"
:card-height="cardHeights"
@ -143,7 +143,7 @@
@setCenter="setCenter"
/>
</el-tab-pane>
<el-tab-pane label="站台" name="StationStand">
<el-tab-pane :label="$t('map.platform')" name="StationStand">
<station-stand-draft
ref="StationStand"
:card-height="cardHeights"
@ -153,7 +153,7 @@
@setCenter="setCenter"
/>
</el-tab-pane>
<el-tab-pane label="计数器" name="Counter">
<el-tab-pane :label="$t('map.counter')" name="Counter">
<counter-draft
ref="Counter"
:card-height="cardHeights"
@ -163,7 +163,7 @@
@setCenter="setCenter"
/>
</el-tab-pane>
<el-tab-pane label="延迟解锁" name="DelayUnlock">
<el-tab-pane :label="$t(map.delayUnlock)" name="DelayUnlock">
<delay-unlock-draft
ref="DelayUnlock"
:card-height="cardHeights"
@ -173,7 +173,7 @@
@setCenter="setCenter"
/>
</el-tab-pane>
<el-tab-pane label="列车" name="Train">
<el-tab-pane :label="$t('map.train')" name="Train">
<train-draft
ref="Train"
:card-height="cardHeights"
@ -183,7 +183,7 @@
@setCenter="setCenter"
/>
</el-tab-pane>
<el-tab-pane label="车次窗" name="TrainWindow">
<el-tab-pane :label="$t('map.trainWindow')" name="TrainWindow">
<train-window-draft
ref="TrainWindow"
:card-height="cardHeights"
@ -193,7 +193,7 @@
@setCenter="setCenter"
/>
</el-tab-pane>
<el-tab-pane label="线条" name="Line">
<el-tab-pane :label="$t('map.line')" name="Line">
<line-draft
ref="Line"
:card-height="cardHeights"
@ -203,7 +203,7 @@
@setCenter="setCenter"
/>
</el-tab-pane>
<el-tab-pane label="文字" name="Text">
<el-tab-pane :label="$t('map.text')" name="Text">
<text-draft
ref="Text"
:card-height="cardHeights"
@ -270,7 +270,7 @@ export default {
},
mapInfo: {
type: Object,
default: function() { return {name: '请选择地图'}; }
default: function() { return {name: this.$t('map.pleaseSelectMap')}; }
},
cardHeight: {
type: [String, Number],
@ -283,12 +283,12 @@ export default {
feild: '',
ViewMode: ViewMode,
LogicalViewTypeList: [
{ code: 'Link', name: 'link' }
{ code: 'Link', name: this.$t('map.link') }
],
PhysicalViewTypeList: [
{ code: 'Section', name: '区段' },
{ code: 'Signal', name: '信号机' },
{ code: 'Switch', name: '道岔' }
{ code: 'Section', name: this.$t('map.section') },
{ code: 'Signal', name: this.$t('map.signal') },
{ code: 'Switch', name: this.$t('map.switch') }
],
logicalLevelsSelect: [],
physicalLevelsSelect: [],

View File

@ -1,10 +1,10 @@
<template>
<div>
<el-tabs v-model="activeName">
<el-tab-pane class="view-control" label="属性" name="first">
<el-tab-pane class="view-control" :label="$t('map.property')" name="first">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
<el-form ref="form" :model="editModel" label-width="150px" size="mini" :rules="rules">
<el-form-item label="编码:" prop="code">
<el-form-item :label="$t('map.code')" prop="code">
<el-select v-model="editModel.code" filterable @change="deviceChange">
<el-option
v-for="item in lcList"
@ -14,11 +14,11 @@
/>
</el-select>
</el-form-item>
<el-form-item label="状态信号名称:" prop="name">
<el-form-item :label="$t('map.statusSignalName')" prop="name">
<el-input v-model="editModel.name" />
</el-form-item>
<div class="coordinate">
<span class="title">状态信号画图坐标:</span>
<span class="title">{{ $t('map.stateSignalsPlotCoordinates') }}</span>
<el-form-item
label="x:"
prop="position.x"
@ -39,18 +39,18 @@
</el-form>
</el-scrollbar>
<el-button-group class="map-draft-group">
<el-button type="primary" @click="edit">修改</el-button>
<el-button type="primary" @click="deleteObj">删除</el-button>
<el-button type="primary" @click="edit">{{ $t('map.updateObj') }}</el-button>
<el-button type="primary" @click="deleteObj">{{ $t('map.deleteObj') }}</el-button>
</el-button-group>
</el-tab-pane>
<el-tab-pane class="view-control" label="操作" name="second">
<el-tab-pane class="view-control" :label="$t('map.operation')" name="second">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
<el-form ref="make" label-width="150px" :rules="createRules" :model="addModel" size="mini">
<el-form-item label="状态信号名称:" prop="name">
<el-input v-model="addModel.name" />
</el-form-item>
<div class="coordinate">
<span class="title">状态信号画图坐标:</span>
<span class="title">{{ $t('map.stateSignalsPlotCoordinates') }}</span>
<el-form-item
label="x:"
prop="position.x"
@ -71,7 +71,7 @@
</el-form>
</el-scrollbar>
<el-button-group class="map-draft-group">
<el-button type="primary" @click="create">创建</el-button>
<el-button type="primary" @click="create">{{ $t('map.create') }}</el-button>
</el-button-group>
</el-tab-pane>
</el-tabs>

View File

@ -1,14 +1,14 @@
<template>
<el-dialog
v-loading="loadingUpload"
title="新建地图"
:title="$t('map.createNewMap')"
:visible.sync="dialogShow"
width="30%"
:before-close="handleClose"
>
<div>
<el-tabs v-model="activeTab" type="card">
<el-tab-pane label="正常创建" name="first">
<el-tab-pane :label="$t('map.normalCreate')" name="first">
<el-form
ref="newForm"
label-position="right"
@ -18,11 +18,11 @@
:rules="newRules"
@submit.native.prevent
>
<el-form-item label="地图名称:" prop="name">
<el-form-item :label="$t('map.mapName')" prop="name">
<el-input v-model="newModel.name" />
</el-form-item>
<el-form-item label="皮肤风格:" prop="skinStyle">
<el-select v-model="newModel.skinStyle" placeholder="请选择">
<el-form-item :label="$t('map.skinName')" prop="skinStyle">
<el-select v-model="newModel.skinStyle" :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in skinStyleList"
:key="item.code"
@ -33,7 +33,7 @@
</el-form-item>
</el-form>
</el-tab-pane>
<el-tab-pane label="从发布地图创建" name="second">
<el-tab-pane :label="$t('map.publishMapCreation')" name="second">
<el-form
ref="pullForm"
label-position="right"
@ -42,8 +42,8 @@
label-width="120px"
size="mini"
>
<el-form-item label="地图名称:" prop="id">
<el-select v-model="pullModel.id" placeholder="请选择">
<el-form-item :label="$t('map.mapName')" prop="id">
<el-select v-model="pullModel.id" :placeholder="$t('map.pleaseSelect')">
<el-option
v-for="item in publishMapList"
:key="item.id"
@ -52,26 +52,16 @@
/>
</el-select>
</el-form-item>
<el-form-item label="地图名称:" prop="name">
<el-form-item :label="$t('map.mapName')" prop="name">
<el-input v-model="pullModel.name" />
</el-form-item>
</el-form>
</el-tab-pane>
<!-- <el-tab-pane label="导入" name="third">
<div class="uploadDemo">
<div class="el-upload-dragger">
<i class="el-icon-upload"></i>
<div class="el-upload__text"><em>点击导入</em></div>
<input type="file" @change="importf" ref="files" class="file_box" accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" />
</div>
<div class="el-upload__tip" style="text-align: center;">只能上传excel文件</div>
</div>
</el-tab-pane> -->
</el-tabs>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogShow = false"> </el-button>
<el-button type="primary" :loading="loading" @click="create"> </el-button>
<el-button @click="dialogShow = false">{{ $t('map.cancel') }}</el-button>
<el-button type="primary" :loading="loading" @click="create">{{ $t('map.confirm') }}</el-button>
</span>
</el-dialog>
@ -117,18 +107,18 @@ export default {
},
newRules: {
name: [
{ required: true, message: '请输入地图名称', trigger: 'blur' }
{ required: true, message: this.$t('map.pleaseEnterMapName'), trigger: 'blur' }
],
skinStyle: [
{ required: true, message: '请选择皮肤风格', trigger: 'change' }
{ required: true, message: this.$t('map.pleaseChooseSkinStyle'), trigger: 'change' }
]
},
pullRules: {
id: [
{ required: true, message: '请选择地图来源', trigger: 'change' }
{ required: true, message: this.$t('map.pleaseSelectMapSource'), trigger: 'change' }
],
name: [
{ required: true, message: '请输入地图名称', trigger: 'change' }
{ required: true, message: this.$t('map.pleaseEnterMapName'), trigger: 'change' }
]
}
};
@ -164,7 +154,7 @@ export default {
listPublishMap().then(response => {
this.publishMapList = response.data;
}).catch(() => {
this.$messageBox('加载已发布地图列表失败');
this.$messageBox(this.$t('map.failedLoadListPublishedMaps'));
});
},
isNormal() {
@ -183,11 +173,11 @@ export default {
newMap(this.newModel).then(response => {
this.loading = false;
this.$emit('refresh');
this.$message.success('创建成功!');
this.$message.success(this.$t('map.creatingSuccessful'));
this.close();
}).catch(() => {
this.loading = false;
this.$messageBox('创建失败');
this.$messageBox(this.$t('map.createFailure'));
this.close();
});
}
@ -199,11 +189,11 @@ export default {
newUsePublishMap(this.pullModel).then(response => {
this.loading = false;
this.$emit('refresh');
this.$message.success('创建成功!');
this.$message.success(this.$t('map.creatingSuccessful'));
this.close();
}).catch(() => {
this.loading = false;
this.$messageBox('创建失败');
this.$messageBox(this.$t('map.createFailure'));
this.close();
});
}
@ -250,12 +240,12 @@ export default {
if (that.resultJSON) {
postBuildMapImport(that.resultJSON).then(res => {
that.loadingUpload = false;
that.$message.success('导入成功!');
that.$message.success(this.$t('map.importSuccessful'));
that.$emit('refresh');
that.close();
}).catch(error => {
that.loadingUpload = false;
that.$message.error('导入失败' + error.message);
that.$message.error(this.$t('map.importFailure') + error.message);
});
}
obj.value = ''; //

View File

@ -1,5 +1,5 @@
<template>
<el-dialog title="地图编辑" :visible.sync="dialogShow" width="30%" :before-close="handleClose">
<el-dialog :title="$t('map.mapEditor')" :visible.sync="dialogShow" width="30%" :before-close="handleClose">
<div>
<template v-if="basicInfo">
<el-form
@ -11,11 +11,11 @@
size="mini"
@submit.native.prevent
>
<el-form-item label="地图名称:" prop="name">
<el-form-item :label="$t('map.mapName')" prop="name">
<el-input v-model="editModel.name" />
</el-form-item>
<el-form-item label="皮肤风格:" prop="skinStyle">
<el-select v-model="editModel.skinStyle" placeholder="请选择" size="mini">
<el-form-item :label="$t('map.skinName')" prop="skinStyle">
<el-select v-model="editModel.skinStyle" :placeholder="$t('map.pleaseSelect')" size="mini">
<el-option
v-for="item in skinStyleList"
:key="item.code"
@ -24,8 +24,8 @@
/>
</el-select>
</el-form-item>
<el-form-item label="所属城市:" prop="cityCode">
<el-select v-model="editModel.cityCode" placeholder="请选择" size="mini">
<el-form-item :label="$t('map.selectCity')" prop="cityCode">
<el-select v-model="editModel.cityCode" :placeholder="$t('map.pleaseSelect')" size="mini">
<el-option v-for="item in cityList" :key="item.code" :label="item.name" :value="item.code" />
</el-select>
</el-form-item>
@ -41,21 +41,21 @@
size="mini"
@submit.native.prevent
>
<el-form-item label="X偏移:" :prop="'origin.x'">
<el-input v-model="updtModel.origin.x" label="X偏移" disabled />
<el-form-item :label="$t('map.offsetXColon')" :prop="'origin.x'">
<el-input v-model="updtModel.origin.x" :label="$t('map.offsetX')" disabled />
</el-form-item>
<el-form-item label="Y偏移:" :prop="'origin.y'">
<el-input v-model="updtModel.origin.y" label="Y偏移" disabled />
<el-form-item :label="$t('map.offsetYColon')" :prop="'origin.y'">
<el-input v-model="updtModel.origin.y" :label="$t('map.offsetY')" disabled />
</el-form-item>
<el-form-item label="缩放比例:" prop="scaling">
<el-input v-model="updtModel.scaling" label="缩放比例" disabled />
<el-form-item :label="$t('map.scalingColon')" prop="scaling">
<el-input v-model="updtModel.scaling" :label="$t('map.scaling')" disabled />
</el-form-item>
</el-form>
</template>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogShow = false"> </el-button>
<el-button type="primary" :loading="loading" @click="save"> </el-button>
<el-button @click="dialogShow = false">{{ $t('map.cancel') }}</el-button>
<el-button type="primary" :loading="loading" @click="save">{{ $t('map.confirm') }}</el-button>
</span>
</el-dialog>
@ -112,23 +112,23 @@ export default {
editRules() {
return {
name: [
{ required: true, message: '请输入地图名称', trigger: 'blur' }
{ required: true, message: this.$t('map.pleaseEnterMapName'), trigger: 'blur' }
],
skinStyle: [
{ required: true, message: '请选择关联皮肤', trigger: 'change' }
{ required: true, message: this.$t('map.pleaseSelectAssociatedSkin'), trigger: 'change' }
],
cityCode: [
{ required: true, message: '请选择关联城市', trigger: 'change' }
{ required: true, message: this.$t('map.pleaseSelectAssociatedCity'), trigger: 'change' }
]
};
},
updtRules() {
return {
linkWidth: [
{ required: true, message: '请输入地图Link宽度', trigger: 'blur' }
{ required: true, message: this.$t('map.pleaseEnteMapLinkWidth'), trigger: 'blur' }
],
zoneWidth: [
{ required: true, message: '请输入地图区段宽度', trigger: 'blur' }
{ required: true, message: this.$t('map.pleaseEnterMapSectionWidth'), trigger: 'blur' }
]
};
}
@ -184,12 +184,12 @@ export default {
this.$store.dispatch('map/setMapData', response.data);
});
}
this.$message.success('更新地图成功!');
this.$message.success(this.$t('map.mapUpdateSuccessful'));
this.$emit('refresh');
this.close();
}).catch(error => {
this.loading = false;
this.$message.error('操作异常:' + error.message);
this.$message.error(this.$t('map.operationUnusual') + error.message);
});
} else {
this.loading = false;
@ -202,10 +202,10 @@ export default {
updateSkinStyleByCode(this.updtModel).then(response => {
this.loading = false;
this.close();
this.$message.success('更新成功');
this.$message.success(this.$t('map.updateSuccessfully'));
}).catch(() => {
this.loading = false;
this.$messageBox('更新失败');
this.$messageBox(this.$t('map.updateFailed'));
});
} else {
this.loading = false;
@ -218,7 +218,7 @@ export default {
this.$Dictionary.cityType().then(list => {
this.cityList = list;
}).catch(() => {
this.$messageBox('加载城市列表失败');
this.$messageBox(this.$t('map.failedLoadCityList'));
});
this.skinStyleList = [];

View File

@ -1,8 +1,8 @@
<template>
<el-card v-loading="loading" class="map-list-main">
<div slot="header" class="clearfix">
<span>草稿地图列表</span>
<el-button type="text" style="float: right; padding: 3px 0" @click="createMap">新建</el-button>
<span>{{ $t('map.sketchMap') }}</span>
<el-button type="text" style="float: right; padding: 3px 0" @click="createMap">{{ $t('map.newConstruction') }}</el-button>
<el-button type="text" class="uploadDemo">
<input
ref="files"
@ -11,7 +11,7 @@
accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
@change="importf"
>
导入地图
{{ $t('map.importMap') }}
</el-button>
</div>
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{height: height + 'px'}">

View File

@ -44,47 +44,47 @@ export default {
menuShow: false,
menu: [
{
label: '修改',
label: this.$t('map.updateObj'),
handler: this.updateObj
},
{
label: '更新坐标',
label: this.$t('map.updateObjAxis'),
handler: this.updateObjAxis
},
{
label: '另存为',
label: this.$t('map.saveAs'),
handler: this.saveAs
},
{
label: '发布',
label: this.$t('map.publish'),
handler: this.publish
},
{
label: '删除',
label: this.$t('map.deleteObj'),
handler: this.deleteObj
},
{
label: '编辑进路',
label: this.$t('map.editRoute'),
handler: this.editRoute
},
{
label: '编辑交路',
label: this.$t('map.editRouting'),
handler: this.editRouting
},
{
label: '编辑自动信号',
label: this.$t('map.editAutoRouting'),
handler: this.editAutoRouting
},
{
label: '联动道岔',
label: this.$t('map.setSwitch'),
handler: this.setSwitch
},
{
label: '路径单元',
label: this.$t('map.pathUnit'),
handler: this.pathUnit
},
{
label: '三维化编辑',
label: this.$t('map.jlmap3d'),
handler: this.jlmap3d
}
]
@ -149,20 +149,20 @@ export default {
deleteObj() {
this.doClose();
const _that = this;
this.$confirm('是否确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
this.$confirm(this.$t('map.confirmDeletion'), this.$t('map.hint'), {
confirmButtonText: this.$t('map.confirm'),
cancelButtonText: this.$t('map.cancel'),
type: 'warning'
}).then(() => {
deleteMap(this.editModel.id).then(response => {
this.$store.dispatch('map/mapClear').then(() => {
_that.refresh();
_that.$emit('editMap', null);
_that.$message.success('删除成功');
_that.$message.success(this.$t('map.successfullyDelete'));
_that.$router.push({ path: `${UrlConfig.map.draft}/0/draft` });
});
}).catch(error => {
_that.$message.error('删除失败:' + error.message);
_that.$message.error(this.$t('map.failDelete') + error.message);
});
}).catch(() => {
});

View File

@ -1,5 +1,5 @@
<template>
<el-dialog title="地图发布为" :visible.sync="dialogShow" width="30%" :before-close="handleClose">
<el-dialog :title="$t('map.mapPublished')" :visible.sync="dialogShow" width="30%" :before-close="handleClose">
<div>
<el-form
ref="form"
@ -9,19 +9,19 @@
size="mini"
@submit.native.prevent
>
<el-form-item label="发布关联城市:" prop="cityCode">
<el-select v-model="editModel.cityCode" placeholder="请选择">
<el-form-item :label="$t('map.publishingAssociatedCity')" prop="cityCode">
<el-select v-model="editModel.cityCode" :placeholder="$t('map.pleaseSelect')">
<el-option v-for="item in cityList" :key="item.code" :label="item.name" :value="item.code" />
</el-select>
</el-form-item>
<el-form-item label="发布地图名称:" prop="name">
<el-form-item :label="$t('map.publishMapName')" prop="name">
<el-input v-model="editModel.name" />
</el-form-item>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogShow = false"> </el-button>
<el-button type="primary" :loading="loading" @click="publish"> </el-button>
<el-button @click="dialogShow = false">{{ $t('map.cancel') }}</el-button>
<el-button type="primary" :loading="loading" @click="publish">{{ $t('map.confirm') }}</el-button>
</span>
</el-dialog>
</template>
@ -77,14 +77,14 @@ export default {
this.loading = false;
if (response.data && response.data.length) {
this.tableToExcel(response.data);
this.$messageBox('发布失败,数据校验不通过');
this.$messageBox(this.$t('map.dataValidationFailed'));
} else {
this.$message.success('发布成功!');
this.$message.success(this.$t('map.releaseSuccess'));
}
this.close();
}).catch(() => {
this.loading = false;
this.$messageBox('操作异常');
this.$messageBox(this.$t('map.abnormalOperation'));
});
},
tableToExcel(data) {
@ -95,7 +95,7 @@ export default {
});
const dataList = this.formatJson(filterVal, arr);
import('@/utils/Export2Excel').then(excel => {
excel.export_json_to_excel(['有问题数据'], dataList, '数据列表');
excel.export_json_to_excel([this.$t('map.datQuestion')], dataList, this.$t('map.dataList'));
});
},
formatJson(filterVal, jsonData) {

View File

@ -1,5 +1,5 @@
<template>
<el-dialog title="地图另存为" :visible.sync="dialogShow" width="30%" :before-close="handleClose">
<el-dialog :title="$t('map.saveMapAs')" :visible.sync="dialogShow" width="30%" :before-close="handleClose">
<div>
<el-form
ref="form"
@ -9,21 +9,20 @@
size="mini"
@submit.native.prevent
>
<el-form-item label="地图名称:" prop="name">
<el-form-item :label="$t('map.mapName')" prop="name">
<el-input v-model="editModel.name" />
</el-form-item>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogShow = false"> </el-button>
<el-button type="primary" :loading="loading" @click="saveAs"> </el-button>
<el-button @click="dialogShow = false">{{ $t('map.cancel') }}</el-button>
<el-button type="primary" :loading="loading" @click="saveAs">{{ $t('map.confirm') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import { saveAsMap } from '@/api/jmap/mapdraft';
// import localStore from 'storejs';
export default {
name: 'MapSaveAs',
@ -69,7 +68,7 @@ export default {
this.close();
}).catch(() => {
this.loading = false;
this.$messageBox('另存失败');
this.$messageBox(this.$t('map.saveFailed'));
});
}
}