desc: 增加地图编辑 国际化

This commit is contained in:
zyy 2019-08-13 18:43:34 +08:00
parent c817cdea7a
commit aa63be299b
18 changed files with 1105 additions and 985 deletions

View File

@ -12,6 +12,7 @@ export default {
physicalView: '物理视图', physicalView: '物理视图',
mixedView: '混合视图', mixedView: '混合视图',
normal: '正常', normal: '正常',
add: '添加',
save: '保存', save: '保存',
updata: '更新', updata: '更新',
@ -138,6 +139,7 @@ export default {
countMax: '计数器最大值:', countMax: '计数器最大值:',
pointX: '坐标 x:', pointX: '坐标 x:',
pointY: '坐标 y:', pointY: '坐标 y:',
meter: '米',
code: '编码:', code: '编码:',
imageName: '图片名称:', imageName: '图片名称:',
@ -302,5 +304,61 @@ export default {
zzkContent: '站中控内容:', zzkContent: '站中控内容:',
stationControlPositionX: '坐标 x:', stationControlPositionX: '坐标 x:',
stationControlPositionY: '坐标 y:', stationControlPositionY: '坐标 y:',
stationControlZok: '中控' stationControlZok: '中控',
stationstandName: '选择车站名称:',
stationstandDirection: '站台方向:',
stationstandHasDoor: '是否显示屏蔽门:',
stationstandNameColon: '站台名称:',
stationstandTopBottom: '上下行方向:',
stationstandShowName: '是否显示名称:',
stationstandWidth: '宽度 w:',
stationstandHeight: '高度 h:',
stationstandPositionX: '坐标 x:',
stationstandPositionY: '坐标 y:',
switchCode: '道岔编码:',
switchName: '道岔名称:',
switchShowName: '是否显示道岔名称:',
switchPositionX: '道岔名称x偏移量:',
switchPositionY: '道岔名称y偏移量:',
turnTime: '道岔时间:',
timeoutShow: '是否显示道岔时间:',
sectionACode: '关联的A Section Code:',
sectionBCode: '关联的B Section Code:',
sectionCCode: '关联的C Section Code:',
switchTpX: '时间x坐标偏移量:',
switchTpY: '时间y坐标偏移量:',
textCode: '文字编码:',
textContent: '文本内容:',
textFont: '字体格式:',
textFontColor: '字体颜色:',
trainCode: '列车编号:',
groupNumber: '车组号:',
modelCode: '车类型:',
trainmodelCreate: '新建车类型',
trainmodelUpdate: '更新列车模型',
trainTypeName: '列车类型名称:',
trainLength: '列车长度:',
trainSafeDistance: '安全距离:',
trainMaxSafeDistance: '最大安全距离:',
averageVelocity: '平均速度:',
averageDeceleration: '平均减速度:',
defaultVelocity: '默认速度:',
maxVelocity: '最大速度:',
trainWindowCode: '车次窗编码:',
trainWindowWidth: '车次窗宽度:',
trainWindowHeight: '车次窗高度:',
trainWindowSectionCode: '关联区段:',
deleteTrainWindow: '一键删除车次窗',
createTrainWindow: '一键创建车次窗',
zcCodeColon: '编码:',
showZc: '是否可见:',
}; };

View File

@ -80,6 +80,51 @@ export default {
stationControlJjzkContent: '请输入紧急站控内容', stationControlJjzkContent: '请输入紧急站控内容',
stationControlZzkContent: '请输入站中控内容', stationControlZzkContent: '请输入站中控内容',
stationControlPositionX: '请输入坐标x', stationControlPositionX: '请输入坐标x',
stationControlPositionY: '请输入坐标y' stationControlPositionY: '请输入坐标y',
pleaseReSelectDevice: '请重新选择设备',
stationCode: '请选择关联车站',
stationstandCountName: '请输入计数器名称',
doorLocationType: '请选择站台方向',
deviceStationCode: '请选择所属设备集中站',
stationstandDirection: '请选择上下行方向',
stationstandWidth: '请输入车站宽度',
stationstandHeight: '请输入车站高度',
stationstandPositionX: '请输入x坐标',
stationstandPositionY: '请输入y坐标',
switchName: '请输入道岔名称',
switchNamePointX: '请输入道岔名称坐标x',
switchNamePointY: '请输入道岔名称坐标y',
switchStationCode: '请输入设备集中站',
switchTurnTime: '请输入道岔时间',
switchTpX: '请输入时间坐标x',
switchTpY: '请输入时间坐标y',
selectText: '请选择Text',
pleaseEnterContent: '请输入内容',
textFont: '请选择文字格式',
textFontColor: '请选择文字颜色',
pleaseEnterGroupNumber: '请输入车组号',
selectTrainType: '请选择车类型',
trainPositionX: '请输入x坐标位置',
trainPositionY: '请输入y坐标位置',
pleaseEnterTrainNumber: '请填写车组号',
trainCode: '列车模型Code不能为空',
pleaseEnterTrainTypeName: '请输入列车类型名称',
trainLength: '请输入列车长度',
safeDistance: '请输入安全距离',
maxSafeDistance: '请输入最大安全距离',
averageVelocity: '请输入平均速度',
averageDeceleration: '请输入平均减速度',
defaultVelocity: '请输入默认速度',
maxVelocity: '请输入最大速度',
trainWindowWidth: '请输入车次窗宽度',
trainWindowHeight: '请输入车次窗高度',
trainWindowSectionCode: '请输入关联区段',
visible: '请选择是否可见',
}; };

View File

@ -18,6 +18,10 @@ export default {
linkCannotMerged: '不在同一Link上的物理区段不能合并', linkCannotMerged: '不在同一Link上的物理区段不能合并',
selectedSectionEmpty: '选择的区段为空', selectedSectionEmpty: '选择的区段为空',
selectedStationEmpty: '选择的车站为空',
selectMap: '请先选择地图',
selectTrainType: '请选择查看的列车模型',
stationFont: '车站字体', stationFont: '车站字体',
kilometerFont: '公里标字体', kilometerFont: '公里标字体',

View File

@ -33,7 +33,8 @@ export default {
name: 'DictionaryDetailEdit', name: 'DictionaryDetailEdit',
props: { props: {
mapInfo: { mapInfo: {
type: Object type: Object,
required: true
} }
}, },
data() { data() {
@ -50,7 +51,7 @@ export default {
if (fieldList.model) { if (fieldList.model) {
const items = fieldList.model.items; const items = fieldList.model.items;
if (fieldList.model.convert) { if (fieldList.model.convert) {
data = fieldList.model.convert(data); // data = fieldList.model.convert(data);
} }
if (items) { if (items) {
this.form = items; this.form = items;

View File

@ -207,7 +207,7 @@ export default {
this.$emit('addOrUpdateMapModel', model); this.$emit('addOrUpdateMapModel', model);
} else { } else {
this.$messageBox('选择的车站为空'); this.$messageBox(this.$t('tip.selectedStationEmpty'));
} }
} }
}); });
@ -242,15 +242,15 @@ export default {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code); const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
if (selected && selected._type.toUpperCase() === 'StationControl'.toUpperCase()) { if (selected && selected._type.toUpperCase() === 'StationControl'.toUpperCase()) {
const _that = this; const _that = this;
this.$confirm('是否确认删除?', '提示', { this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
confirmButtonText: '确定', confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: '取消', cancelButtonText: this.$t('tip.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
_that.$emit('delMapModel', _that.selected); _that.$emit('delMapModel', _that.selected);
_that.deviceSelect(); _that.deviceSelect();
}).catch(() => { }).catch(() => {
_that.$message.info('已取消删除'); _that.$message.info(this.$t('tip.cancelledDelete'));
}); });
} }
} }

View File

@ -1,19 +1,19 @@
<template> <template>
<div> <div>
<el-tabs v-model="activeName"> <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-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
<config-list ref="dataform" :form="form" :form-model="editModel" :rules="rules" /> <config-list ref="dataform" :form="form" :form-model="editModel" :rules="rules" />
</el-scrollbar> </el-scrollbar>
<el-button-group class="map-draft-group"> <el-button-group class="map-draft-group">
<el-button type="primary" @click="edit">修改</el-button> <el-button type="primary" @click="edit">{{ $t('map.updateObj') }}</el-button>
<el-button type="primary" @click="deleteObj">删除</el-button> <el-button type="primary" @click="deleteObj">{{ $t('map.deleteObj') }}</el-button>
</el-button-group> </el-button-group>
</el-tab-pane> </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-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
<el-form ref="make" label-width="140px" :model="addModel" :rules="createRules" size="mini"> <el-form ref="make" label-width="140px" :model="addModel" :rules="createRules" size="mini">
<el-form-item label="选择车站名称" prop="stationCode"> <el-form-item :label="$t('map.stationstandName')" prop="stationCode">
<el-select v-model="addModel.stationCode" filterable> <el-select v-model="addModel.stationCode" filterable>
<el-option <el-option
v-for="item in stationList" v-for="item in stationList"
@ -23,7 +23,7 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="所属设备集中站:" prop="deviceStationCode"> <el-form-item :label="$t('map.equipmentStation')" prop="deviceStationCode">
<el-select v-model="addModel.deviceStationCode" filterable> <el-select v-model="addModel.deviceStationCode" filterable>
<el-option <el-option
v-for="item in stationList" v-for="item in stationList"
@ -33,8 +33,8 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="站台方向:" prop="doorLocationType"> <el-form-item :label="$t('map.stationstandDirection')" prop="doorLocationType">
<el-select v-model="addModel.doorLocationType" filterable placeholder="请选择"> <el-select v-model="addModel.doorLocationType" filterable :placeholder="$t('map.pleaseSelect')">
<el-option <el-option
v-for="item in DoorLocationTypeList" v-for="item in DoorLocationTypeList"
:key="item.code" :key="item.code"
@ -43,13 +43,13 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="是否显示屏蔽门:" prop="hasDoor"> <el-form-item label="$t('map.stationstandHasDoor')" prop="hasDoor">
<el-checkbox v-model="addModel.hasDoor" /> <el-checkbox v-model="addModel.hasDoor" />
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-scrollbar> </el-scrollbar>
<el-button-group class="map-draft-group"> <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-button-group>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
@ -122,19 +122,19 @@ export default {
const form = { const form = {
labelWidth: '130px', labelWidth: '130px',
items: [ items: [
{ prop: 'deviceStationCode', label: '所属设备集中站:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.stationList }, { prop: 'deviceStationCode', label: this.$t('map.equipmentStation'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.stationList },
{ prop: 'code', label: '站台编码:', type: 'select', optionLabel: 'code&&name', optionValue: 'code', options: this.stationStandList, change: true, deviceChange: this.deviceChange }, { prop: 'code', label: this.$t('map.relStandCode'), type: 'select', optionLabel: 'code&&name', optionValue: 'code', options: this.stationStandList, change: true, deviceChange: this.deviceChange },
{ prop: 'name', label: '站台名称:', type: 'input', disabled: true }, { prop: 'name', label: this.$t('map.stationstandNameColon'), type: 'input', disabled: true },
{ prop: 'stationCode', label: '所属车站:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList }, { prop: 'stationCode', label: this.$t('map.belongsStation'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList },
{ prop: 'direction', label: '上下行方向:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.RunDirectionTypeList }, { prop: 'direction', label: this.$t('map.stationstandTopBottom'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.RunDirectionTypeList },
{ prop: 'visible', label: '是否显示:', type: 'checkbox' }, { prop: 'visible', label: this.$t('map.stationVisible'), type: 'checkbox' },
{ prop: 'nameShow', label: '是否显示名称:', type: 'checkbox' }, { prop: 'nameShow', label: this.$t('map.stationstandShowName'), type: 'checkbox' },
{ prop: 'doorLocationType', label: '站台方向:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.DoorLocationTypeList }, { prop: 'doorLocationType', label: this.$t('map.stationstandDirection'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.DoorLocationTypeList },
{ prop: 'hasDoor', label: '是否显示屏蔽门:', type: 'checkbox' }, { prop: 'hasDoor', label: this.$t('map.stationstandHasDoor'), type: 'checkbox' },
{ prop: 'width', label: '宽度 w:', type: 'number', min: 0, max: 2000, placeholder: 'px' }, { prop: 'width', label: this.$t('map.stationstandWidth'), type: 'number', min: 0, max: 2000, placeholder: 'px' },
{ prop: 'height', label: '高度 h', type: 'number', min: 0, max: 2000, placeholder: 'px' }, { prop: 'height', label: this.$t('map.stationstandHeight'), type: 'number', min: 0, max: 2000, placeholder: 'px' },
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: '坐标 x:', type: 'number', placeholder: 'px' }, { prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: this.$t('map.stationstandPositionX'), type: 'number', placeholder: 'px' },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: '坐标 y:', type: 'number', placeholder: 'px' } { prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: this.$t('map.stationstandPositionY'), type: 'number', placeholder: 'px' }
] ]
}; };
return form; return form;
@ -142,34 +142,34 @@ export default {
rules() { rules() {
const rules = { const rules = {
code: [ code: [
{ required: true, message: '请重新选择设备', trigger: 'change' } { required: true, message: this.$t('rules.pleaseReSelectDevice'), trigger: 'change' }
], ],
stationCode: [ stationCode: [
{ required: true, message: '请选择关联车站', trigger: 'change' } { required: true, message: this.$t('rules.stationCode'), trigger: 'change' }
], ],
name: [ name: [
{ required: true, message: '请输入计数器名称', trigger: 'change' } { required: true, message: this.$t('rules.stationstandCountName'), trigger: 'change' }
], ],
doorLocationType: [ doorLocationType: [
{ required: true, message: '请选择站台方向', trigger: 'change' } { required: true, message: this.$t('rules.doorLocationType'), trigger: 'change' }
], ],
deviceStationCode: [ deviceStationCode: [
{ required: true, message: '请选择所属设备集中站', trigger: 'change' } { required: true, message: this.$t('rules.deviceStationCode'), trigger: 'change' }
], ],
direction: [ direction: [
{ required: true, message: '请选择上下行方向', trigger: 'change' } { required: true, message: this.$t('rules.stationstandDirection'), trigger: 'change' }
], ],
width: [ width: [
{ required: true, message: '请输入车站宽度', trigger: 'change' } { required: true, message: this.$t('rules.stationstandWidth'), trigger: 'change' }
], ],
height: [ height: [
{ required: true, message: '请输入车站高度', trigger: 'change' } { required: true, message: this.$t('rules.stationstandHeight'), trigger: 'change' }
], ],
'position.x': [ 'position.x': [
{ required: true, message: '请输入x坐标', trigger: 'change' } { required: true, message: this.$t('rule.stationstandPositionX'), trigger: 'change' }
], ],
'position.y': [ 'position.y': [
{ required: true, message: '请输入y坐标', trigger: 'change' } { required: true, message: this.$t('rule.stationstandPositionY'), trigger: 'change' }
] ]
}; };
// //
@ -182,13 +182,13 @@ export default {
createRules: function () { createRules: function () {
return { return {
stationCode: [ stationCode: [
{ required: true, message: '请选择关联车站', trigger: 'change' } { required: true, message: this.$t('rules.stationCode'), trigger: 'change' }
], ],
doorLocationType: [ doorLocationType: [
{ required: true, message: '请选择站台方向', trigger: 'change' } { required: true, message: this.$t('rules.doorLocationType'), trigger: 'change' }
], ],
deviceStationCode: [ deviceStationCode: [
{ required: true, message: '请选择所属设备集中站', trigger: 'change' } { required: true, message: this.$t('rules.deviceStationCode'), trigger: 'change' }
] ]
}; };
} }
@ -304,15 +304,15 @@ export default {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code); const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) { if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) {
const _that = this; const _that = this;
this.$confirm('是否确认删除?', '提示', { this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
confirmButtonText: '确定', confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: '取消', cancelButtonText: this.$t('tip.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
_that.$emit('delMapModel', selected); _that.$emit('delMapModel', selected);
_that.deviceSelect(); _that.deviceSelect();
}).catch(() => { }).catch(() => {
_that.$message.info('已取消删除'); _that.$message.info(this.$t('tip.cancelledDelete'));
}); });
} }
} }

View File

@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<el-tabs v-model="activeName"> <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-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
<el-form ref="form" :model="editModel" :rules="editRules" label-width="150px" size="mini"> <el-form ref="form" :model="editModel" :rules="editRules" label-width="150px" size="mini">
<el-form-item label="停车点编码:" prop="code"> <el-form-item label="停车点编码:" prop="code">

View File

@ -1,16 +1,16 @@
<template> <template>
<div> <div>
<el-tabs v-model="activeName"> <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-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
<config-list ref="dataform" :form="form" :form-model="editModel" :rules="rules" /> <config-list ref="dataform" :form="form" :form-model="editModel" :rules="rules" />
</el-scrollbar> </el-scrollbar>
<el-button-group class="map-draft-group"> <el-button-group class="map-draft-group">
<el-button type="primary" @click="edit">修改</el-button> <el-button type="primary" @click="edit">{{ $t('map.updateObj') }}</el-button>
<el-button type="primary" @click="deleteObj">删除</el-button> <el-button type="primary" @click="deleteObj">{{ $t('map.deleteObj') }}</el-button>
</el-button-group> </el-button-group>
</el-tab-pane> </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-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
<el-form ref="make"> <el-form ref="make">
<el-form-item size="mini"> <el-form-item size="mini">
@ -26,7 +26,7 @@
</el-form> </el-form>
</el-scrollbar> </el-scrollbar>
<el-button-group class="map-draft-group"> <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-button-group>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
@ -97,19 +97,19 @@ export default {
const form = { const form = {
labelWidth: '170px', labelWidth: '170px',
items: [ items: [
{ prop: 'stationCode', label: '所属设备集中站:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList }, { prop: 'stationCode', label: this.$t('map.equipmentStation'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList },
{ prop: 'code', label: '道岔编码:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.switchList, change: true, deviceChange: this.deviceChange }, { prop: 'code', label: this.$t('map.switchCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.switchList, change: true, deviceChange: this.deviceChange },
{ prop: 'name', label: '道岔名称:', type: 'input' }, { prop: 'name', label: this.$t('map.switchName'), type: 'input' },
{ prop: 'nameShow', label: '是否显示道岔名称:', type: 'checkbox' }, { prop: 'nameShow', label: this.$t('map.switchShowName'), type: 'checkbox' },
{ prop: 'namePoint.x', firstLevel: 'namePoint', secondLevel: 'x', label: '道岔名称x偏移量:', type: 'number', placeholder: 'px' }, { prop: 'namePoint.x', firstLevel: 'namePoint', secondLevel: 'x', label: this.$t('map.switchPositionX'), type: 'number', placeholder: 'px' },
{ prop: 'namePoint.y', firstLevel: 'namePoint', secondLevel: 'y', label: '道岔名称y偏移量:', type: 'number', placeholder: 'px' }, { prop: 'namePoint.y', firstLevel: 'namePoint', secondLevel: 'y', label: this.$t('map.switchPositionY'), type: 'number', placeholder: 'px' },
{ prop: 'turnTime', label: '道岔时间:', type: 'number', min: 0, max: 1000, placeholder: 's' }, { prop: 'turnTime', label: this.$t('map.turnTime'), type: 'number', min: 0, max: 1000, placeholder: 's' },
{ prop: 'timeoutShow', label: '是否显示道岔时间:', type: 'checkbox' }, { prop: 'timeoutShow', label: this.$t('map.timeoutShow'), type: 'checkbox' },
{ prop: 'sectionACode', label: '关联的A Section Code:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.sectionList }, { prop: 'sectionACode', label: this.$t('map.sectionACode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.sectionList },
{ prop: 'sectionBCode', label: '关联的B Section Code:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.sectionList }, { prop: 'sectionBCode', label: this.$t('map.sectionBCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.sectionList },
{ prop: 'sectionCCode', label: '关联的C Section Code:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.sectionList }, { prop: 'sectionCCode', label: this.$t('map.sectionCCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.sectionList },
{ prop: 'tp.x', firstLevel: 'tp', secondLevel: 'x', label: '时间x坐标偏移量:', type: 'number', placeholder: 'px' }, { prop: 'tp.x', firstLevel: 'tp', secondLevel: 'x', label: this.$t('map.switchTpX'), type: 'number', placeholder: 'px' },
{ prop: 'tp.y', firstLevel: 'tp', secondLevel: 'y', label: '时间y坐标偏移量:', type: 'number', placeholder: 'px' } { prop: 'tp.y', firstLevel: 'tp', secondLevel: 'y', label: this.$t('map.switchTpY'), type: 'number', placeholder: 'px' }
] ]
}; };
return form; return form;
@ -117,28 +117,28 @@ export default {
rules() { rules() {
const rules = { const rules = {
code: [ code: [
{ required: true, message: '请选择设备', trigger: 'change' } { required: true, message: this.$t('rules.selectEquipment'), trigger: 'change' }
], ],
name: [ name: [
{ required: true, message: '请输入道岔名称', trigger: 'blur' } { required: true, message: this.$t('rules.switchName'), trigger: 'blur' }
], ],
'namePoint.x': [ 'namePoint.x': [
{ required: true, message: '请输入道岔名称坐标x', trigger: 'blur' } { required: true, message: this.$t('rules.switchNamePointX'), trigger: 'blur' }
], ],
'namePoint.y': [ 'namePoint.y': [
{ required: true, message: '请输入道岔名称坐标y', trigger: 'blur' } { required: true, message: this.$t('rules.switchNamePointY'), trigger: 'blur' }
], ],
stationCode: [ stationCode: [
{ required: true, message: '请输入设备集中站', trigger: 'change' } { required: true, message: this.$t('rules.switchStationCode'), trigger: 'change' }
], ],
turnTime: [ turnTime: [
{ required: true, message: '请输入道岔时间', trigger: 'blur' } { required: true, message: this.$t('rules.switchTurnTime'), trigger: 'blur' }
], ],
'tp.x': [ 'tp.x': [
{ required: true, message: '请输入时间坐标x', trigger: 'blur' } { required: true, message: this.$t('rules.switchTpX'), trigger: 'blur' }
], ],
'tp.y': [ 'tp.y': [
{ required: true, message: '请输入时间坐标y', trigger: 'blur' } { required: true, message: this.$t('rules.switchTpY'), trigger: 'blur' }
] ]
}; };
// //
@ -290,9 +290,9 @@ export default {
}); });
const _that = this; const _that = this;
this.$confirm('是否确认批量生成?', '提示', { this.$confirm(this.$t('tip.confirmBatchGeneration'), this.$t('tip.hint'), {
confirmButtonText: '确定', confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: '取消', cancelButtonText: this.$t('tip.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
_that.$emit('delMapModel', remove); _that.$emit('delMapModel', remove);
@ -300,7 +300,7 @@ export default {
}).catch(() => { }).catch(() => {
this.$message({ this.$message({
type: 'info', type: 'info',
message: '已取消批量生成' message: this.$t('tip.cancelGeneration')
}); });
}); });
}, },
@ -338,15 +338,15 @@ export default {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code); const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
if (selected && selected._type.toUpperCase() === 'Switch'.toUpperCase()) { if (selected && selected._type.toUpperCase() === 'Switch'.toUpperCase()) {
const _that = this; const _that = this;
this.$confirm('是否确认批量生成?', '提示', { this.$confirm(this.$t('tip.confirmBatchGeneration'), this.$t('tip.hint'), {
confirmButtonText: '确定', confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: '取消', cancelButtonText: this.$t('tip.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
_that.$emit('delMapModel', selected); _that.$emit('delMapModel', selected);
_that.deviceSelect(); _that.deviceSelect();
}).catch(() => { }).catch(() => {
_that.$message.info('已取消删除'); _that.$message.info(this.$t('tip.cancelGeneration'));
}); });
} }
}, },

View File

@ -1,10 +1,10 @@
<template> <template>
<div> <div>
<el-tabs v-model="activeName"> <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-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
<el-form ref="form" :model="editModel" label-width="110px" size="mini" :rules="rules"> <el-form ref="form" :model="editModel" label-width="110px" size="mini" :rules="rules">
<el-form-item label="文字编码:" prop="code"> <el-form-item :label="$t('map.textCode')" prop="code">
<el-select v-model="editModel.code" filterable @change="deviceChange"> <el-select v-model="editModel.code" filterable @change="deviceChange">
<el-option <el-option
v-for="item in textList" v-for="item in textList"
@ -14,54 +14,54 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="文本内容:" prop="content"> <el-form-item label="$t('map.textContent')" prop="content">
<el-input v-model="editModel.content" placeholder="请输入内容" class="input-with-select"> <el-input v-model="editModel.content" :placeholder="$t('map.pleaseSelect')" class="input-with-select">
<el-select slot="prepend" v-model="editModel.prepend" placeholder="请选择"> <el-select slot="prepend" v-model="editModel.prepend" :placeholder="$t('map.pleaseSelect')">
<el-option label="水平" value="H" /> <el-option label="水平" value="H" />
<el-option label="垂直" value="V" /> <el-option label="垂直" value="V" />
</el-select> </el-select>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="字体格式:" prop="font"> <el-form-item :label="$t('map.textFont')" prop="font">
<el-font v-model="editModel.font" placeholder="字体" /> <el-font v-model="editModel.font" :placeholder="$t('map.font')" />
</el-form-item> </el-form-item>
<el-form-item label="字体颜色:" prop="fontColor"> <el-form-item :label="$t('map.textFontColor')" prop="fontColor">
<el-color-picker v-model="editModel.fontColor" :predefine="skins" /> <el-color-picker v-model="editModel.fontColor" :predefine="skins" />
</el-form-item> </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-input-number v-model="editModel.position.x" />px
</el-form-item> </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-input-number v-model="editModel.position.y" />px
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-scrollbar> </el-scrollbar>
<el-button-group class="map-draft-group"> <el-button-group class="map-draft-group">
<el-button type="primary" @click="edit">修改</el-button> <el-button type="primary" @click="edit">{{ $t('map.updateObj') }}</el-button>
<el-button type="primary" @click="deleteObj">删除</el-button> <el-button type="primary" @click="deleteObj">{{ $t('map.deleteObj') }}</el-button>
</el-button-group> </el-button-group>
</el-tab-pane> </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-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
<el-form ref="make" label-width="110px" :model="addModel" size="mini" :rules="makeRules"> <el-form ref="make" label-width="110px" :model="addModel" size="mini" :rules="makeRules">
<el-form-item label="文本内容:" prop="content"> <el-form-item :label="$t('map.textContent')" prop="content">
<el-input v-model="addModel.content" placeholder="请输入内容" class="input-with-select"> <el-input v-model="addModel.content" :placeholder="$t('map.pleaseSelect')" class="input-with-select">
<el-select slot="prepend" v-model="addModel.prepend" placeholder="请选择"> <el-select slot="prepend" v-model="addModel.prepend" :placeholder="$t('map.pleaseSelect')">
<el-option label="水平" value="H" /> <el-option label="水平" value="H" />
<el-option label="垂直" value="V" /> <el-option label="垂直" value="V" />
</el-select> </el-select>
</el-input> </el-input>
</el-form-item> </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="addModel.position.x" />px <el-input-number v-model="addModel.position.x" />px
</el-form-item> </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="addModel.position.y" />px <el-input-number v-model="addModel.position.y" />px
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-scrollbar> </el-scrollbar>
<el-button-group class="map-draft-group"> <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-button-group>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
@ -115,24 +115,24 @@ export default {
}, },
rules: { rules: {
code: [ code: [
{ required: true, message: '请选择Text', trigger: 'blur' } { required: true, message: this.$t('rules.selectText'), trigger: 'blur' }
], ],
content: [ content: [
{ required: true, message: '请输入内容', trigger: 'blur' } { required: true, message: this.$t('rules.pleaseEnterContent'), trigger: 'blur' }
], ],
font: [ font: [
{ required: true, message: '请选择文字格式', trigger: 'blur' } { required: true, message: this.$t('rules.textFont'), trigger: 'blur' }
], ],
fontColor: [ fontColor: [
{ required: true, message: '请选择文字颜色', trigger: 'blur' } { required: true, message: this.$t('rules.textFontColor'), trigger: 'blur' }
] ]
}, },
makeRules: { makeRules: {
code: [ code: [
{ required: true, message: '请选择Text', trigger: 'blur' } { required: true, message: this.$t('rules.selectText'), trigger: 'blur' }
], ],
content: [ content: [
{ required: true, message: '请输入内容', trigger: 'blur' } { required: true, message: this.$t('rules.pleaseEnterContent'), trigger: 'blur' }
] ]
} }
}; };
@ -222,15 +222,15 @@ export default {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code); const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
if (selected && selected._type.toUpperCase() === 'Text'.toUpperCase()) { if (selected && selected._type.toUpperCase() === 'Text'.toUpperCase()) {
const _that = this; const _that = this;
this.$confirm('是否确认删除?', '提示', { this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
confirmButtonText: '确定', confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: '取消', cancelButtonText: this.$t('tip.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
_that.$emit('delMapModel', selected); _that.$emit('delMapModel', selected);
_that.deviceSelect(); _that.deviceSelect();
}).catch(() => { }).catch(() => {
_that.$message.info('已取消删除'); _that.$message.info(this.$t('tip.cancelledDelete'));
}); });
} }
} }

View File

@ -1,10 +1,10 @@
<template> <template>
<div> <div>
<el-tabs v-model="activeName"> <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-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
<el-form ref="form" :model="editModel" label-width="110px" size="mini" :rules="rules"> <el-form ref="form" :model="editModel" label-width="110px" size="mini" :rules="rules">
<el-form-item label="列车编号:" prop="code"> <el-form-item :label="$t('map.trainCode')" prop="code">
<el-select v-model="editModel.code" filterable @change="deviceChange"> <el-select v-model="editModel.code" filterable @change="deviceChange">
<el-option <el-option
v-for="item in trainList" v-for="item in trainList"
@ -14,10 +14,10 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="车组号:" prop="groupNumber"> <el-form-item :label="$t('map.groupNumber')" prop="groupNumber">
<el-input v-model="editModel.groupNumber" /> <el-input v-model="editModel.groupNumber" />
</el-form-item> </el-form-item>
<el-form-item label="车类型:" prop="modelCode"> <el-form-item :label="$t('map.modelCode')" prop="modelCode">
<el-select v-model="editModel.modelCode" filterable> <el-select v-model="editModel.modelCode" filterable>
<el-option <el-option
v-for="item in trainModelList" v-for="item in trainModelList"
@ -27,33 +27,33 @@
/> />
</el-select> </el-select>
<el-button-group> <el-button-group>
<el-button type="primary" size="small" @click="newTrainMode">添加</el-button> <el-button type="primary" size="small" @click="newTrainMode">{{ $t('map.add') }}</el-button>
<el-button type="primary" size="small" @click="uptTrainMode(editModel.modelCode)">更新 <el-button type="primary" size="small" @click="uptTrainMode(editModel.modelCode)">{{ $t('map.updata') }}
</el-button> </el-button>
<el-button type="primary" size="small" @click="delTrainMode(editModel.modelCode)">删除 <el-button type="primary" size="small" @click="delTrainMode(editModel.modelCode)">{{ $t('map.deleteObj') }}
</el-button> </el-button>
</el-button-group> </el-button-group>
</el-form-item> </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" /> <el-input-number v-model="editModel.position.x" />
</el-form-item> </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" /> <el-input-number v-model="editModel.position.y" />
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-scrollbar> </el-scrollbar>
<el-button-group class="map-draft-group"> <el-button-group class="map-draft-group">
<el-button type="primary" @click="edit">修改</el-button> <el-button type="primary" @click="edit">{{ $t('map.updateObj') }}</el-button>
<el-button type="primary" @click="deleteObj">删除</el-button> <el-button type="primary" @click="deleteObj">{{ $t('map.deleteObj') }}</el-button>
</el-button-group> </el-button-group>
</el-tab-pane> </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-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
<el-form ref="make" label-width="100px" :rules="createRules" :model="addModel" size="mini"> <el-form ref="make" label-width="100px" :rules="createRules" :model="addModel" size="mini">
<el-form-item label="车组号:" prop="groupNumber"> <el-form-item :label="$t('map.groupNumber')" prop="groupNumber">
<el-input v-model="addModel.groupNumber" /> <el-input v-model="addModel.groupNumber" />
</el-form-item> </el-form-item>
<el-form-item label="车类型:" prop="modelCode"> <el-form-item :label="$t('map.modelCode')" prop="modelCode">
<el-select v-model="addModel.modelCode" filterable> <el-select v-model="addModel.modelCode" filterable>
<el-option <el-option
v-for="item in trainModelList" v-for="item in trainModelList"
@ -63,23 +63,23 @@
/> />
</el-select> </el-select>
<el-button-group> <el-button-group>
<el-button type="primary" size="small" @click="newTrainMode">添加</el-button> <el-button type="primary" size="small" @click="newTrainMode">{{ $t('map.add') }}</el-button>
<el-button type="primary" size="small" @click="uptTrainMode(addModel.modelCode)">更新 <el-button type="primary" size="small" @click="uptTrainMode(addModel.modelCode)">{{ $t('map.updata') }}
</el-button> </el-button>
<el-button type="primary" size="small" @click="delTrainMode(addModel.modelCode)">删除 <el-button type="primary" size="small" @click="delTrainMode(addModel.modelCode)">{{ $t('map.deleteObj') }}
</el-button> </el-button>
</el-button-group> </el-button-group>
</el-form-item> </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="addModel.position.x" /> <el-input-number v-model="addModel.position.x" />
</el-form-item> </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="addModel.position.y" /> <el-input-number v-model="addModel.position.y" />
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-scrollbar> </el-scrollbar>
<el-button-group class="map-draft-group"> <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-button-group>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
@ -132,19 +132,19 @@ export default {
}, },
rules: { rules: {
code: [ code: [
{ required: true, message: '请重新选择设备', trigger: 'change' } { required: true, message: this.$t('rules.pleaseReSelectDevice'), trigger: 'change' }
], ],
groupNumber: [ groupNumber: [
{ required: true, message: '请输入车组号', trigger: 'blur' } { required: true, message: this.$t('rules.pleaseEnterGroupNumber'), trigger: 'blur' }
], ],
modelCode: [ modelCode: [
{ required: true, message: '请选择车类型', trigger: 'change' } { required: true, message: this.$t('rules.selectTrainType'), trigger: 'change' }
], ],
'position.x': [ 'position.x': [
{ required: true, message: '请输入x坐标位置', trigger: 'blur' } { required: true, message: this.$t('rules.trainPositionX'), trigger: 'blur' }
], ],
'position.y': [ 'position.y': [
{ required: true, message: '请输入y坐标位置', trigger: 'blur' } { required: true, message: this.$t('rules.trainPositionY'), trigger: 'blur' }
] ]
} }
}; };
@ -159,16 +159,16 @@ export default {
createRules: function () { createRules: function () {
return { return {
modelCode: [ modelCode: [
{ required: true, message: '请选择车类型', trigger: 'change' } { required: true, message: this.$t('rules.selectTrainType'), trigger: 'change' }
], ],
groupNumber: [ groupNumber: [
{ required: true, message: '请填写车组号', trigger: 'blur' } { required: true, message: this.$t('rules.pleaseEnterTrainNumber'), trigger: 'blur' }
], ],
'position.x': [ 'position.x': [
{ required: true, message: '请输入x坐标', trigger: 'change' } { required: true, message: this.$t('rules.trainPositionX'), trigger: 'change' }
], ],
'position.y': [ 'position.y': [
{ required: true, message: '请输入y坐标', trigger: 'change' } { required: true, message: this.$t('rules.trainPositionY'), trigger: 'change' }
] ]
}; };
} }
@ -251,15 +251,15 @@ export default {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code); const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
if (selected && selected._type.toUpperCase() === 'Train'.toUpperCase()) { if (selected && selected._type.toUpperCase() === 'Train'.toUpperCase()) {
const _that = this; const _that = this;
this.$confirm('是否确认删除?', '提示', { this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
confirmButtonText: '确定', confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: '取消', cancelButtonText: this.$t('tip.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
_that.$emit('delMapModel', selected); _that.$emit('delMapModel', selected);
_that.deviceSelect(); _that.deviceSelect();
}).catch(() => { }).catch(() => {
_that.$message.info('已取消删除'); _that.$message.info(this.$t('tip.cancelledDelete'));
}); });
} }
}, },
@ -267,7 +267,7 @@ export default {
if (Object.keys(this.$store.state.map.map || {}).length) { if (Object.keys(this.$store.state.map.map || {}).length) {
this.$refs.trainMode.doShow({}, 'ADD'); this.$refs.trainMode.doShow({}, 'ADD');
} else { } else {
this.$messageBox('请先选择地图'); this.$messageBox(this.$t('tip.selectMap'));
} }
}, },
uptTrainMode(code) { uptTrainMode(code) {
@ -279,7 +279,7 @@ export default {
} }
}); });
} else { } else {
this.$messageBox('请选择查看的列车模型'); this.$messageBox(this.$t('tip.selectTrainType'));
} }
}, },
delTrainMode(code) { delTrainMode(code) {

View File

@ -1,5 +1,5 @@
<template> <template>
<el-dialog :title="isNew? '新建车类型': '更新列车模型'" :visible.sync="dialogShow" width="30%" :before-close="doClose"> <el-dialog :title="isNew? $t('map.trainmodelCreate'): $t('map.trainmodelUpdate')" :visible.sync="dialogShow" width="30%" :before-close="doClose">
<el-card shadow="never"> <el-card shadow="never">
<el-form <el-form
ref="form" ref="form"
@ -10,35 +10,35 @@
style="margin: 20px 20px;" style="margin: 20px 20px;"
> >
<el-input v-model="formModel.code" :disabled="!isNew" type="hidden" /> <el-input v-model="formModel.code" :disabled="!isNew" type="hidden" />
<el-form-item label="列车类型名称:" prop="name"> <el-form-item :label="$t('map.trainTypeName')" prop="name">
<el-input v-model="formModel.name" :disabled="!isNew" /> <el-input v-model="formModel.name" :disabled="!isNew" />
</el-form-item> </el-form-item>
<el-form-item label="列车长度:" prop="length"> <el-form-item :label="$t('map.trainLength')" prop="length">
<el-input-number v-model="formModel.length" :min="0" /> <el-input-number v-model="formModel.length" :min="0" />{{ $t('map.meter') }}
</el-form-item> </el-form-item>
<el-form-item label="安全距离:" prop="safeDistance"> <el-form-item :label="$t('map.trainSafeDistance')" prop="safeDistance">
<el-input-number v-model="formModel.safeDistance" :min="0" /> <el-input-number v-model="formModel.safeDistance" :min="0" />{{ $t('map.meter') }}
</el-form-item> </el-form-item>
<el-form-item label="最大安全距离:" prop="maxSafeDistance"> <el-form-item :label="$t('map.trainMaxSafeDistance')" prop="maxSafeDistance">
<el-input-number v-model="formModel.maxSafeDistance" :min="0" /> <el-input-number v-model="formModel.maxSafeDistance" :min="0" />{{ $t('map.meter') }}
</el-form-item> </el-form-item>
<el-form-item label="平均速度:" prop="averageVelocity"> <el-form-item :label="$t('map.averageVelocity')" prop="averageVelocity">
<el-input-number v-model="formModel.averageVelocity" :min="0" />km/h <el-input-number v-model="formModel.averageVelocity" :min="0" />km/h
</el-form-item> </el-form-item>
<el-form-item label="平均减速度:" prop="averageDeceleration"> <el-form-item :label="$t('map.averageDeceleration')" prop="averageDeceleration">
<el-input-number v-model="formModel.averageDeceleration" :min="0" />km/h <el-input-number v-model="formModel.averageDeceleration" :min="0" />km/h
</el-form-item> </el-form-item>
<el-form-item label="默认速度:" prop="defaultVelocity"> <el-form-item :label="$t('map.defaultVelocity')" prop="defaultVelocity">
<el-input-number v-model="formModel.defaultVelocity" :min="0" />km/h <el-input-number v-model="formModel.defaultVelocity" :min="0" />km/h
</el-form-item> </el-form-item>
<el-form-item label="最大速度:" prop="maxVelocity"> <el-form-item :label="$t('map.maxVelocity')" prop="maxVelocity">
<el-input-number v-model="formModel.maxVelocity" :min="0" />km/h <el-input-number v-model="formModel.maxVelocity" :min="0" />km/h
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-card> </el-card>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleSure">{{ isNew? '创建': '更新' }}</el-button> <el-button type="primary" @click="handleSure">{{ isNew? $t('map.create'): $t('map.updata') }}</el-button>
<el-button @click="dialogShow = false"> </el-button> <el-button @click="dialogShow = false">{{ $t('map.cancel') }}</el-button>
</span> </span>
</el-dialog> </el-dialog>
</template> </template>
@ -74,31 +74,31 @@ export default {
addRules: function () { addRules: function () {
return { return {
code: [ code: [
{ required: true, message: '列车模型Code不能为空', trigger: 'change' } { required: true, message: this.$t('rules.trainCode'), trigger: 'change' }
], ],
name: [ name: [
{ required: true, message: '请输入列车类型名称', trigger: 'change' } { required: true, message: this.$t('rules.pleaseEnterTrainTypeName'), trigger: 'change' }
], ],
length: [ length: [
{ required: true, message: '请输入列车长度', trigger: 'change' } { required: true, message: this.$t('rules.trainLength'), trigger: 'change' }
], ],
safeDistance: [ safeDistance: [
{ required: true, message: '请输入安全距离', trigger: 'change' } { required: true, message: this.$t('rules.safeDistance'), trigger: 'change' }
], ],
maxSafeDistance: [ maxSafeDistance: [
{ required: true, message: '请输入最大安全距离', trigger: 'change' } { required: true, message: this.$t('rules.maxSafeDistance'), trigger: 'change' }
], ],
averageVelocity: [ averageVelocity: [
{ required: true, message: '请输入平均速度', trigger: 'change' } { required: true, message: this.$t('rules.averageVelocity'), trigger: 'change' }
], ],
averageDeceleration: [ averageDeceleration: [
{ required: true, message: '请输入平均减速度', trigger: 'change' } { required: true, message: this.$t('rules.averageDeceleration'), trigger: 'change' }
], ],
defaultVelocity: [ defaultVelocity: [
{ required: true, message: '请输入默认速度', trigger: 'change' } { required: true, message: this.$t('rules.defaultVelocity'), trigger: 'change' }
], ],
maxVelocity: [ maxVelocity: [
{ required: true, message: '请输入最大速度', trigger: 'change' } { required: true, message: this.$t('rules.maxVelocity'), trigger: 'change' }
] ]
}; };
}, },

View File

@ -1,10 +1,10 @@
<template> <template>
<div> <div>
<el-tabs v-model="activeName"> <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-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
<el-form ref="form" :model="editModel" label-width="120px" size="mini" :rules="rules"> <el-form ref="form" :model="editModel" label-width="120px" size="mini" :rules="rules">
<el-form-item label="车次窗编码:" prop="code"> <el-form-item :label="$t('map.trainWindowCode')" prop="code">
<el-select v-model="editModel.code" filterable @change="deviceChange"> <el-select v-model="editModel.code" filterable @change="deviceChange">
<el-option <el-option
v-for="item in trainWindowList" v-for="item in trainWindowList"
@ -14,13 +14,13 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="车次窗宽度:" prop="width"> <el-form-item :label="$t('map.trainWindowWidth')" prop="width">
<el-input-number v-model="editModel.width" :min="0" />px <el-input-number v-model="editModel.width" :min="0" />px
</el-form-item> </el-form-item>
<el-form-item label="车次窗高度:" prop="height"> <el-form-item :label="$t('map.trainWindowHeight')" prop="height">
<el-input-number v-model="editModel.height" :min="0" />px <el-input-number v-model="editModel.height" :min="0" />px
</el-form-item> </el-form-item>
<el-form-item label="关联区段:" prop="sectionCode"> <el-form-item :label="$t('map.trainWindowSectionCode')" prop="sectionCode">
<el-select v-model="editModel.sectionCode"> <el-select v-model="editModel.sectionCode">
<el-option <el-option
v-for="item in filterSectionList" v-for="item in filterSectionList"
@ -30,25 +30,25 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="坐标 x:" prop="point.x"> <el-form-item :label="$t('map.pointX')" prop="point.x">
<el-input-number v-model="editModel.point.x" />px <el-input-number v-model="editModel.point.x" />px
</el-form-item> </el-form-item>
<el-form-item label="坐标 y:" prop="point.y"> <el-form-item :label="$t('map.pointY')" prop="point.y">
<el-input-number v-model="editModel.point.y" />px <el-input-number v-model="editModel.point.y" />px
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-scrollbar> </el-scrollbar>
<el-button-group class="map-draft"> <el-button-group class="map-draft">
<el-button type="primary" @click="edit">修改</el-button> <el-button type="primary" @click="edit">{{ $t('map.updateObj') }}</el-button>
<el-button type="primary" @click="deleteObj">删除</el-button> <el-button type="primary" @click="deleteObj">{{ $t('map.deleteObj') }}</el-button>
</el-button-group> </el-button-group>
</el-tab-pane> </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-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
<el-form ref="make" label-width="110px"> <el-form ref="make" label-width="110px">
<el-form-item> <el-form-item>
<el-button type="danger" size="big" @click="removeTrainWindow">一键删除车次窗</el-button> <el-button type="danger" size="big" @click="removeTrainWindow">{{ $t('map.deleteTrainWindow') }}</el-button>
<el-button type="primary" size="big" @click="createTrainWindow">一键创建车次窗</el-button> <el-button type="primary" size="big" @click="createTrainWindow">{{ $t('map.createTrainWindow') }}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-transfer <el-transfer
@ -62,7 +62,7 @@
/> />
</el-scrollbar> </el-scrollbar>
<el-button-group class="map-draft"> <el-button-group class="map-draft">
<el-button type="primary" @click="createTrainWindowByCollection">创建</el-button> <el-button type="primary" @click="createTrainWindowByCollection">{{ $t('map.create') }}</el-button>
</el-button-group> </el-button-group>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
@ -106,22 +106,22 @@ export default {
}, },
rules: { rules: {
code: [ code: [
{ required: true, message: '请重新选择设备', trigger: 'blur' } { required: true, message: this.$t('rules.pleaseReSelectDevice'), trigger: 'blur' }
], ],
'point.x': [ 'point.x': [
{ required: true, message: '请输入x坐标位置', trigger: 'blur' } { required: true, message: this.$t('rules.trainPositionX'), trigger: 'blur' }
], ],
'point.y': [ 'point.y': [
{ required: true, message: '请输入y坐标位置', trigger: 'blur' } { required: true, message: this.$t('rules.trainPositionY'), trigger: 'blur' }
], ],
width: [ width: [
{ required: true, message: '请输入车次窗宽度', trigger: 'blur' } { required: true, message: this.$t('rules.trainWindowWidth'), trigger: 'blur' }
], ],
height: [ height: [
{ required: true, message: '请输入车次窗高度', trigger: 'blur' } { required: true, message: this.$t('rules.trainWindowHeight'), trigger: 'blur' }
], ],
sectionCode: [ sectionCode: [
{ required: true, message: '请输入x坐标位置', trigger: 'change' } { required: true, message: this.$t('rules.trainWindowSectionCode'), trigger: 'change' }
] ]
} }
@ -347,15 +347,15 @@ export default {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code); const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
if (selected && selected._type.toUpperCase() === 'TrainWindow'.toUpperCase()) { if (selected && selected._type.toUpperCase() === 'TrainWindow'.toUpperCase()) {
const _that = this; const _that = this;
this.$confirm('是否确认删除?', '提示', { this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
confirmButtonText: '确定', confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: '取消', cancelButtonText: this.$t('tip.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
_that.$emit('delMapModel', selected); _that.$emit('delMapModel', selected);
_that.deviceSelect(); _that.deviceSelect();
}).catch(() => { }).catch(() => {
_that.$message.info('已取消删除'); _that.$message.info(this.$t('tip.cancelledDelete'));
}); });
} }
} }

View File

@ -1,21 +1,21 @@
<template> <template>
<div> <div>
<el-tabs v-model="activeName"> <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-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
<config-list ref="dataform" :form="form" :form-model="editModel" :rules="rules" /> <config-list ref="dataform" :form="form" :form-model="editModel" :rules="rules" />
</el-scrollbar> </el-scrollbar>
<el-button-group class="map-draft-group"> <el-button-group class="map-draft-group">
<el-button type="primary" @click="edit">修改</el-button> <el-button type="primary" @click="edit">{{ $t('map.updateObj') }}</el-button>
<el-button type="primary" @click="deleteObj">删除</el-button> <el-button type="primary" @click="deleteObj">{{ $t('map.deleteObj') }}</el-button>
</el-button-group> </el-button-group>
</el-tab-pane> </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-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
<config-list ref="make" :form="formMake" :form-model="addModel" :rules="createRules" /> <config-list ref="make" :form="formMake" :form-model="addModel" :rules="createRules" />
</el-scrollbar> </el-scrollbar>
<el-button-group class="map-draft-group"> <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-button-group>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
@ -68,19 +68,19 @@ export default {
}, },
rules: { rules: {
code: [ code: [
{ required: true, message: '请选择唯一编码', trigger: 'change' } { required: true, message: this.$t('rules.pleaseSelectEncoding'), trigger: 'change' }
], ],
name: [ name: [
{ required: true, message: '请输入状态信号名称', trigger: 'blur' } { required: true, message: this.$t('rules.pleaseEnterStatusSignal'), trigger: 'blur' }
], ],
visible: [ visible: [
{ required: true, message: '请选择是否可见', trigger: 'change' } { required: true, message: this.$t('rules.visible'), trigger: 'change' }
], ],
'position.x': [ 'position.x': [
{ required: true, message: '请输入x坐标位置', trigger: 'blur' } { required: true, message: this.$t('rules.trainPositionX'), trigger: 'blur' }
], ],
'position.y': [ 'position.y': [
{ required: true, message: '请输入y坐标位置', trigger: 'blur' } { required: true, message: this.$t('rules.trainPositionY'), trigger: 'blur' }
] ]
} }
}; };
@ -96,10 +96,10 @@ export default {
const form = { const form = {
labelWidth: '150px', labelWidth: '150px',
items: [ items: [
{ prop: 'code', label: '编码:', type: 'select', optionLabel: 'code', optionValue: 'code', options: this.zcList, change: true, deviceChange: this.deviceChange }, { prop: 'code', label: this.$t('map.zcCodeColon'), type: 'select', optionLabel: 'code', optionValue: 'code', options: this.zcList, change: true, deviceChange: this.deviceChange },
{ prop: 'name', label: '状态信号名称:', type: 'input' }, { prop: 'name', label: this.$t('map.statusSignalName'), type: 'input' },
{ prop: 'visible', label: '是否可见:', type: 'checkboxx' }, { prop: 'visible', label: this.$t('map.showZc'), type: 'checkboxx' },
{ prop: 'position', label: '状态信号画图坐标:', type: 'coordinate', width: '140px', children: [ { prop: 'position', label: this.$t('map.stateSignalsPlotCoordinates'), type: 'coordinate', width: '140px', children: [
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px' }, { 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' } { prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px' }
] } ] }
@ -111,8 +111,8 @@ export default {
const form = { const form = {
labelWidth: '150px', labelWidth: '150px',
items: [ items: [
{ prop: 'name', label: '状态信号名称:', type: 'input' }, { prop: 'name', label: this.$t('map.statusSignalName'), type: 'input' },
{ prop: 'position', label: '状态信号画图坐标:', type: 'coordinate', width: '140px', children: [ { prop: 'position', label: this.$t('map.stateSignalsPlotCoordinates'), type: 'coordinate', width: '140px', children: [
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px' }, { 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' } { prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px' }
] } ] }
@ -123,13 +123,13 @@ export default {
createRules: function () { createRules: function () {
return { return {
name: [ name: [
{ required: true, message: '请输入状态信号名称', trigger: 'blur' } { required: true, message: this.$t('rules.pleaseEnterStatusSignal'), trigger: 'blur' }
], ],
'position.x': [ 'position.x': [
{ required: true, message: '请输入x坐标位置', trigger: 'blur' } { required: true, message: this.$t('rules.trainPositionX'), trigger: 'blur' }
], ],
'position.y': [ 'position.y': [
{ required: true, message: '请输入y坐标位置', trigger: 'blur' } { required: true, message: this.$t('rules.trainPositionY'), trigger: 'blur' }
] ]
}; };
} }
@ -210,15 +210,15 @@ export default {
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code); const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
if (selected && selected._type.toUpperCase() === 'ZcControl'.toUpperCase()) { if (selected && selected._type.toUpperCase() === 'ZcControl'.toUpperCase()) {
const _that = this; const _that = this;
this.$confirm('是否确认删除?', '提示', { this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
confirmButtonText: '确定', confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: '取消', cancelButtonText: this.$t('tip.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
_that.$emit('delMapModel', selected); _that.$emit('delMapModel', selected);
_that.deviceSelect(); _that.deviceSelect();
}).catch(() => { }).catch(() => {
_that.$message.info('已取消删除'); _that.$message.info(this.$t('tip.cancelledDelete'));
}); });
} }
} }

View File

@ -96,12 +96,12 @@ export default {
computed: { computed: {
...mapGetters('map', [ ...mapGetters('map', [
'stationList' 'stationList'
]), ])
}, },
watch: { watch: {
'$store.state.menuOperation.menuCount': function (val) { '$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Map)) { if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Map)) {
this.menu = [ ...this.menuMap] this.menu = [...this.menuMap];
this.doShow(this.$store.state.menuOperation.menuPosition); this.doShow(this.$store.state.menuOperation.menuPosition);
} else if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Cancel)) { } else if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Cancel)) {
this.initCancelMenu(); this.initCancelMenu();
@ -204,7 +204,7 @@ export default {
this.menuNormal = []; this.menuNormal = [];
this.stationList.forEach(station => { this.stationList.forEach(station => {
if (station.code === station.concentrateStationCode) { if (station.code === station.concentrateStationCode) {
let node = { const node = {
label: station.name, label: station.name,
children: [] children: []
}; };
@ -220,7 +220,7 @@ export default {
node.children.push({ node.children.push({
code: elem.code, code: elem.code,
label: elem.name, label: elem.name,
handler: this.mapLocation, handler: this.mapLocation
}); });
} }
} }
@ -229,14 +229,14 @@ export default {
this.menuNormal.push(node); this.menuNormal.push(node);
} }
}); });
this.menu = [ ...this.menuNormal ] this.menu = [...this.menuNormal];
}, },
mapLocation(item) { mapLocation(item) {
if (item) { if (item) {
this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: item.code }); this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: item.code });
this.doClose(); this.doClose();
} }
}, }
} }
}; };
</script> </script>

View File

@ -1,41 +1,54 @@
<template> <template>
<div> <div>
<turnback-bar :title="turnbackBarTitle"></turnback-bar> <turnback-bar :title="turnbackBarTitle" />
<div class="card-box"> <div class="card-box">
<el-steps class="steps" :active="display"> <el-steps class="steps" :active="display">
<el-step :title="title" icon="el-icon-edit-outline"></el-step> <el-step :title="title" icon="el-icon-edit-outline" />
<el-step title="" icon="el-icon-upload"></el-step> <el-step title="" icon="el-icon-upload" />
</el-steps> </el-steps>
<el-card class="forms"> <el-card class="forms">
<el-scrollbar wrapClass="scrollbar-wrapper" :style="{height:height - 300 + 'px'}" <el-scrollbar
style="padding-top: 60px"> wrap-class="scrollbar-wrapper"
:style="{height:height - 300 + 'px'}"
style="padding-top: 60px"
>
<el-form ref="form" :model="addModel" label-width="140px"> <el-form ref="form" :model="addModel" label-width="140px">
<el-form-item label="所属地图名称:" prop="mapName"> <el-form-item label="所属地图名称:" prop="mapName">
<el-input v-model="addModel.mapName" :disabled="true"></el-input> <el-input v-model="addModel.mapName" :disabled="true" />
</el-form-item> </el-form-item>
<el-form-item label="产品类型:" prop="prdType"> <el-form-item label="产品类型:" prop="prdType">
<el-radio-group v-model="addModel.prdType"> <el-radio-group v-model="addModel.prdType">
<template v-for="item in chooseList"> <template v-for="item in chooseList">
<el-radio-button :label="item.code" :key="item">{{item.name}}</el-radio-button> <el-radio-button :key="item" :label="item.code">{{ item.name }}</el-radio-button>
</template> </template>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="产品编码:" prop="code" <el-form-item
:rules="node && node.data.type ==='map' ? baseRules.code:{}"> label="产品编码:"
<el-input v-model="addModel.code" :disabled="codeDisabled"></el-input> prop="code"
:rules="node && node.data.type ==='map' ? baseRules.code:{}"
>
<el-input v-model="addModel.code" :disabled="codeDisabled" />
</el-form-item> </el-form-item>
<el-form-item label="产品名称:" prop="name" :rules="baseRules.name"> <el-form-item label="产品名称:" prop="name" :rules="baseRules.name">
<el-input v-model="addModel.name"></el-input> <el-input v-model="addModel.name" />
</el-form-item> </el-form-item>
<el-form-item label="产品说明:" prop="remarks" :rules="baseRules.remarks"> <el-form-item label="产品说明:" prop="remarks" :rules="baseRules.remarks">
<el-input v-model="addModel.remarks" type="textarea"></el-input> <el-input v-model="addModel.remarks" type="textarea" />
</el-form-item> </el-form-item>
<el-form-item label="关联实训类型:" prop="trainTypes" :rules="baseRules.trainTypes"> <el-form-item label="关联实训类型:" prop="trainTypes" :rules="baseRules.trainTypes">
<el-select v-model="addModel.trainTypes" multiple placeholder="请选择" <el-select
@change="trainTypesChange"> v-model="addModel.trainTypes"
<el-option v-for="item in trainTypesList" :key="item.code" :label="item.name" multiple
:value="item.code"> placeholder="请选择"
</el-option> @change="trainTypesChange"
>
<el-option
v-for="item in trainTypesList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -43,9 +56,9 @@
</el-card> </el-card>
<div class="draft"> <div class="draft">
<el-button-group> <el-button-group>
<el-button type="primary" v-if="isAdd" @click="create">创建</el-button> <el-button v-if="isAdd" type="primary" @click="create">创建</el-button>
<el-button type="warning" v-if="isEdit" @click="update">更新</el-button> <el-button v-if="isEdit" type="warning" @click="update">更新</el-button>
<el-button type="danger" v-if="isEdit" @click="deleteObj">删除</el-button> <el-button v-if="isEdit" type="danger" @click="deleteObj">删除</el-button>
</el-button-group> </el-button-group>
</div> </div>
</div> </div>
@ -53,7 +66,7 @@
</template> </template>
<script> <script>
import { createTrainingCategory, updateTrainingCategory, deleteTrainingCategory } from '@/api/management/mapprd' import { createTrainingCategory, updateTrainingCategory, deleteTrainingCategory } from '@/api/management/mapprd';
import { getProductDetail } from '@/api/management/mapprd'; import { getProductDetail } from '@/api/management/mapprd';
import localStore from 'storejs'; import localStore from 'storejs';
import { getPublishMapInfo } from '@/api/jmap/map'; import { getPublishMapInfo } from '@/api/jmap/map';
@ -61,19 +74,20 @@
export default { export default {
name: 'ShowDetail', name: 'ShowDetail',
props: {
height: {
type: Number
}
},
mixins: [ mixins: [
WindowResizeHandler WindowResizeHandler
], ],
props: {
height: {
type: Number,
required: true
}
},
data() { data() {
return { return {
node: null, node: null,
display: 1, display: 1,
height: 0, // height: 0,
codeDisabled: true, codeDisabled: true,
rules: {}, rules: {},
trainTypesList: [], trainTypesList: [],
@ -90,7 +104,7 @@
prdType: '01', prdType: '01',
trainTypes: [] trainTypes: []
} }
} };
}, },
computed: { computed: {
title() { title() {
@ -99,6 +113,7 @@
} else if (this.isEdit) { } else if (this.isEdit) {
return '编辑实训类目'; return '编辑实训类目';
} }
return '';
}, },
turnbackBarTitle() { turnbackBarTitle() {
return ''; return '';
@ -123,7 +138,7 @@
trainTypes: [ trainTypes: [
{ required: true, message: '请选择关联实训类型', trigger: 'change' } { required: true, message: '请选择关联实训类型', trigger: 'change' }
] ]
} };
} }
}, },
mounted() { mounted() {
@ -144,17 +159,17 @@
this.node = node; this.node = node;
this.initTrainTypes = []; this.initTrainTypes = [];
this.$refs.form.resetFields(); this.$refs.form.resetFields();
if ('map' === node.data.type) { if (node.data.type === 'map') {
this.codeDisabled = false; this.codeDisabled = false;
getPublishMapInfo(node.data.id).then(response => { getPublishMapInfo(node.data.id).then(response => {
let data = response.data; const data = response.data;
this.addModel.mapName = data.name; this.addModel.mapName = data.name;
this.addModel.skinStyle = data.skinStyle; this.addModel.skinStyle = data.skinStyle;
this.loading = false; this.loading = false;
}).catch(() => { }).catch(() => {
this.loading = false; this.loading = false;
}); });
} else if ('prd' === node.data.type) { } else if (node.data.type === 'prd') {
this.codeDisabled = true; this.codeDisabled = true;
getProductDetail(node.data.id).then(response => { getProductDetail(node.data.id).then(response => {
this.addModel.mapName = node.parent.data.name; this.addModel.mapName = node.parent.data.name;
@ -167,7 +182,7 @@
this.addModel.trainTypes = this.initTrainTypes = response.data.trainTypes; this.addModel.trainTypes = this.initTrainTypes = response.data.trainTypes;
this.addModel.id = response.data.id; this.addModel.id = response.data.id;
this.loading = false; this.loading = false;
}).catch(error => { }).catch(() => {
this.loading = false; this.loading = false;
}); });
} }
@ -175,13 +190,13 @@
// //
this.$nextTick(function () { this.$nextTick(function () {
this.$refs.form.clearValidate(); this.$refs.form.clearValidate();
}) });
} }
}, },
create() { create() {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
let data = { const data = {
skinStyle: this.addModel.skinStyle, skinStyle: this.addModel.skinStyle,
mapName: this.addModel.mapName, mapName: this.addModel.mapName,
name: this.addModel.name, name: this.addModel.name,
@ -194,7 +209,7 @@
this.initTrainTypes = this.addModel.trainTypes; this.initTrainTypes = this.addModel.trainTypes;
this.$emit('refresh', [localStore.get('cityCode') || '', localStore.get('mapId') || '']); this.$emit('refresh', [localStore.get('cityCode') || '', localStore.get('mapId') || '']);
this.$message.success('创建产品成功'); this.$message.success('创建产品成功');
}).catch(error => { }).catch(() => {
this.$messageBox('创建产品失败'); this.$messageBox('创建产品失败');
}); });
} }
@ -207,7 +222,7 @@
this.initTrainTypes = this.addModel.trainTypes; this.initTrainTypes = this.addModel.trainTypes;
this.$message.success('更新产品成功'); this.$message.success('更新产品成功');
// this.$emit('refresh', [localStore.get('cityCode') || '', localStore.get('mapId') || '']); // this.$emit('refresh', [localStore.get('cityCode') || '', localStore.get('mapId') || '']);
}).catch(error => { }).catch(() => {
this.$messageBox('更新产品失败'); this.$messageBox('更新产品失败');
}); });
} }
@ -242,15 +257,14 @@
}); });
}, },
turnback() { turnback() {
this.$router.go(-1) this.$router.go(-1);
}
} }
} }
};
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
.card-box { .card-box {
padding-top: 10px; padding-top: 10px;
} }

View File

@ -1,12 +1,11 @@
<template> <template>
<div> <div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList"> <QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</QueryListPage>
</div> </div>
</template> </template>
<script> <script>
import { getPublishMapList, delPublishMap, getPublishMapExport, putMapOnLine, putMapOffLine } from '@/api/jmap/map'; import { getPublishMapList, delPublishMap } from '@/api/jmap/map';
import { getSkinStyleList } from '@/api/management/mapskin'; import { getSkinStyleList } from '@/api/management/mapskin';
import { UrlConfig } from '@/router/index'; import { UrlConfig } from '@/router/index';
import localStore from 'storejs'; import localStore from 'storejs';
@ -52,8 +51,8 @@
title: '皮肤类型', title: '皮肤类型',
prop: 'skinStyle', prop: 'skinStyle',
type: 'tag', type: 'tag',
columnValue: (row) => { return this.$convertField(row.skinStyle, this.skinStyleList, ['code', 'name']) }, columnValue: (row) => { return this.$convertField(row.skinStyle, this.skinStyleList, ['code', 'name']); },
tagType: (row) => { return '' } tagType: (row) => { return ''; }
}, },
{ {
title: '更新时间', title: '更新时间',
@ -83,20 +82,20 @@
} }
], ],
actions: [ actions: [
{ text: '新增', btnCode: 'employee_insert', handler: this.handleAdd }, { text: '新增', btnCode: 'employee_insert', handler: this.handleAdd }
] ]
}, },
currentModel: {} currentModel: {}
} };
},
created() {
this.loadInitData();
}, },
computed: { computed: {
isShow() { isShow() {
return this.$store.getters['roles'].indexOf('05'); return this.$store.getters['roles'].indexOf('05');
} }
}, },
created() {
this.loadInitData();
},
methods: { methods: {
loadInitData() { loadInitData() {
this.cityList = []; this.cityList = [];
@ -105,14 +104,14 @@
this.cityList.forEach(elem => { this.cityList.forEach(elem => {
this.queryForm.queryObject.cityCode.config.data.push({ value: elem.code, label: elem.name }); this.queryForm.queryObject.cityCode.config.data.push({ value: elem.code, label: elem.name });
}); });
}).catch(error => { }).catch(() => {
this.$messageBox('加载城市列表失败'); this.$messageBox('加载城市列表失败');
}); });
this.skinStyleList = []; this.skinStyleList = [];
getSkinStyleList().then(response => { getSkinStyleList().then(response => {
this.skinStyleList = response.data; this.skinStyleList = response.data;
}) });
}, },
// //
handleAdd() { handleAdd() {
@ -137,19 +136,19 @@
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
delPublishMap(row.id).then(response => { delPublishMap(row.id).then(response => {
this.$message.success('删除成功') this.$message.success('删除成功');
this.reloadTable() this.reloadTable();
localStore.remove('mapId') localStore.remove('mapId');
}).catch(error => { }).catch(() => {
this.reloadTable() this.reloadTable();
this.$messageBox('删除失败'); this.$messageBox('删除失败');
}) });
}).catch(() => { }) }).catch(() => { });
}, },
reloadTable() { reloadTable() {
this.queryList.reload() this.queryList.reload();
}
} }
} }
};
</script> </script>

View File

@ -1,19 +1,19 @@
<template> <template>
<div class="card-box"> <div class="card-box">
<turnback-bar :title="turnbackBarTitle"></turnback-bar> <turnback-bar :title="turnbackBarTitle" />
<el-steps class="steps" :active="display"> <el-steps class="steps" :active="display">
<el-step :title="title" icon="el-icon-edit-outline"></el-step> <el-step :title="title" icon="el-icon-edit-outline" />
<el-step title="" icon="el-icon-upload"></el-step> <el-step title="" icon="el-icon-upload" />
</el-steps> </el-steps>
<el-card class="forms"> <el-card class="forms">
<el-scrollbar wrapClass="scrollbar-wrapper" :style="{height:height -160 + 'px'}" style="padding-top: 40px"> <el-scrollbar wrap-class="scrollbar-wrapper" :style="{height:height -160 + 'px'}" style="padding-top: 40px">
<data-form ref="dataform" :form="form" :formModel="formModel" :rules="rules"></data-form> <data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
</el-scrollbar> </el-scrollbar>
</el-card> </el-card>
<div class="draft"> <div class="draft">
<el-button-group> <el-button-group>
<el-button type="primary" @click="create" style="margin-left: 120px" v-if="isAdd">创建</el-button> <el-button v-if="isAdd" type="primary" style="margin-left: 120px" @click="create">创建</el-button>
<el-button type="primary" @click="update" style="margin-left: 120px" v-if="isEdit">更新</el-button> <el-button v-if="isEdit" type="primary" style="margin-left: 120px" @click="update">更新</el-button>
</el-button-group> </el-button-group>
</div> </div>
</div> </div>
@ -40,9 +40,9 @@
scaling: '1', scaling: '1',
linkWidth: 0, linkWidth: 0,
zoneWidth: 0, zoneWidth: 0,
watermarkShow: false, watermarkShow: false
}
} }
};
}, },
computed: { computed: {
title() { title() {
@ -52,6 +52,7 @@
if (this.isEdit) { if (this.isEdit) {
return '更新地图皮肤'; return '更新地图皮肤';
} }
return '';
}, },
isAdd() { isAdd() {
return this.$route.params.mode.toUpperCase() == 'add'.toUpperCase(); return this.$route.params.mode.toUpperCase() == 'add'.toUpperCase();
@ -67,10 +68,10 @@
}, },
form() { form() {
let form = { const form = {
labelWidth: '140px', labelWidth: '140px',
items: [ items: [
{ prop: 'code', label: '皮肤编码', type: 'text', required: false, disabled: this.isDisabled, }, { prop: 'code', label: '皮肤编码', type: 'text', required: false, disabled: this.isDisabled },
{ prop: 'name', label: '皮肤名称', type: 'text', required: false }, { prop: 'name', label: '皮肤名称', type: 'text', required: false },
{ prop: 'origin', label: '原点坐标', type: 'point', required: false }, { prop: 'origin', label: '原点坐标', type: 'point', required: false },
{ prop: 'scaling', label: '缩放比例', type: 'number', required: false, message: `(缩放比例最大为8级)` }, { prop: 'scaling', label: '缩放比例', type: 'number', required: false, message: `(缩放比例最大为8级)` },
@ -78,12 +79,12 @@
{ prop: 'zoneWidth', label: '区段宽度', type: 'number', required: false, message: `(区段宽度最大为30)` }, { prop: 'zoneWidth', label: '区段宽度', type: 'number', required: false, message: `(区段宽度最大为30)` },
{ prop: 'watermarkShow', label: '是否显示水印', type: 'radio', required: false, options: this.$ConstSelect.Whether } { prop: 'watermarkShow', label: '是否显示水印', type: 'radio', required: false, options: this.$ConstSelect.Whether }
] ]
} };
return form return form;
}, },
rules() { rules() {
let baseRules = { const baseRules = {
code: [ code: [
{ required: true, message: '请输入皮肤编码', trigger: 'blur' } { required: true, message: '请输入皮肤编码', trigger: 'blur' }
], ],
@ -100,10 +101,10 @@
if (Number(value) >= 1 && Number(value) <= 8) { if (Number(value) >= 1 && Number(value) <= 8) {
callback(); callback();
} else { } else {
callback(new Error("请输入有效的缩放比例")); callback(new Error('请输入有效的缩放比例'));
} }
}, },
trigger: 'blur', trigger: 'blur'
} }
], ],
linkWidth: [ linkWidth: [
@ -113,10 +114,10 @@
if (Number.isInteger(Number(value)) && Number(value) >= 5 && Number(value) <= 20) { if (Number.isInteger(Number(value)) && Number(value) >= 5 && Number(value) <= 20) {
callback(); callback();
} else { } else {
callback(new Error("请输入有效Link宽度")); callback(new Error('请输入有效Link宽度'));
} }
}, },
trigger: 'blur', trigger: 'blur'
} }
], ],
zoneWidth: [ zoneWidth: [
@ -126,16 +127,16 @@
if (Number.isInteger(Number(value)) && Number(value) >= 5 && Number(value) <= 30) { if (Number.isInteger(Number(value)) && Number(value) >= 5 && Number(value) <= 30) {
callback(); callback();
} else { } else {
callback(new Error("请输入有效区段宽度")); callback(new Error('请输入有效区段宽度'));
} }
}, },
trigger: 'blur', trigger: 'blur'
} }
], ],
watermarkShow: [ watermarkShow: [
{ required: true, message: '请选择是否水印', trigger: 'change' }, { required: true, message: '请选择是否水印', trigger: 'change' }
] ]
} };
// //
this.$nextTick(function () { this.$nextTick(function () {
@ -163,13 +164,13 @@
scaling: '1', scaling: '1',
linkWidth: 0, linkWidth: 0,
zoneWidth: 0, zoneWidth: 0,
watermarkShow: false, watermarkShow: false
} };
if (this.isEdit) { if (this.isEdit) {
querySkinStyle(this.$route.params.skinStyleId).then(response => { querySkinStyle(this.$route.params.skinStyleId).then(response => {
this.formModel = response.data; this.formModel = response.data;
}) });
} }
// //
@ -184,12 +185,12 @@
addSkinStyle(this.formModel).then(response => { addSkinStyle(this.formModel).then(response => {
this.turnback(); this.turnback();
this.$message.success('创建成功'); this.$message.success('创建成功');
}).catch(error => { }).catch(() => {
this.$messageBox("创建失败"); this.$messageBox('创建失败');
}) });
}).catch((error) => { }).catch(() => {
this.$messageBox("地图皮肤编码已存在"); this.$messageBox('地图皮肤编码已存在');
}) });
}); });
}, },
update() { update() {
@ -198,16 +199,16 @@
updateSkinStyle(this.formModel).then(response => { updateSkinStyle(this.formModel).then(response => {
this.turnback(); this.turnback();
this.$message.success('更新成功'); this.$message.success('更新成功');
}).catch(error => { }).catch(() => {
this.$messageBox("更新失败"); this.$messageBox('更新失败');
});
}); });
})
}, },
turnback() { turnback() {
this.$router.go(-1) this.$router.go(-1);
}
} }
} }
};
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -1,7 +1,6 @@
<template> <template>
<div> <div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList"> <QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</QueryListPage>
</div> </div>
</template> </template>
@ -9,7 +8,6 @@
import { UrlConfig } from '@/router/index'; import { UrlConfig } from '@/router/index';
import { getSkinStylePageList, delSkinStyle } from '@/api/management/mapskin'; import { getSkinStylePageList, delSkinStyle } from '@/api/management/mapskin';
import { getSkinStyleList } from '@/api/management/mapskin'; import { getSkinStyleList } from '@/api/management/mapskin';
import localStore from 'storejs';
export default { export default {
name: 'SkinStyle', name: 'SkinStyle',
@ -52,8 +50,8 @@
title: '原点坐标', title: '原点坐标',
prop: 'origin', prop: 'origin',
type: 'tag', type: 'tag',
columnValue: (row) => { return `(${row.origin.x}, ${row.origin.y})` }, columnValue: (row) => { return `(${row.origin.x}, ${row.origin.y})`; },
tagType: () => { return '' } tagType: () => { return ''; }
}, },
{ {
title: 'Link宽度', title: 'Link宽度',
@ -71,7 +69,7 @@
title: '是否显示水印', title: '是否显示水印',
prop: 'watermarkShow', prop: 'watermarkShow',
type: 'tag', type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.watermarkShow, 'Whether') }, columnValue: (row) => { return this.$ConstSelect.translate(row.watermarkShow, 'Whether'); },
tagType: (row) => { tagType: (row) => {
return row.forever ? 'success' : 'danger'; return row.forever ? 'success' : 'danger';
} }
@ -90,15 +88,15 @@
name: '删除', name: '删除',
handleClick: this.handleDelete, handleClick: this.handleDelete,
type: 'danger' type: 'danger'
}, }
] ]
} }
], ],
actions: [ actions: [
{ text: '新增', handler: this.handleAdd }, { text: '新增', handler: this.handleAdd }
] ]
} }
} };
}, },
created() { created() {
this.loadInitData(); this.loadInitData();
@ -113,7 +111,7 @@
this.skinStyleList = []; this.skinStyleList = [];
getSkinStyleList().then(response => { getSkinStyleList().then(response => {
this.skinStyleList = response.data; this.skinStyleList = response.data;
}) });
}, },
handleAdd() { handleAdd() {
this.$router.push(`${UrlConfig.map.skinStyleDraft}/add/null`); this.$router.push(`${UrlConfig.map.skinStyleDraft}/add/null`);
@ -129,15 +127,15 @@
}).then(() => { }).then(() => {
delSkinStyle(row.id).then(() => { delSkinStyle(row.id).then(() => {
this.$message.success('删除皮肤成功'); this.$message.success('删除皮肤成功');
}).catch(error => { }).catch(() => {
this.$messageBox('删除皮肤失败'); this.$messageBox('删除皮肤失败');
}) });
}).catch(() => { }).catch(() => {
}); });
}, },
reloadTable() { reloadTable() {
this.queryList.reload() this.queryList.reload();
}
} }
} }
};
</script> </script>