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: '物理视图',
mixedView: '混合视图',
normal: '正常',
add: '添加',
save: '保存',
updata: '更新',
@ -138,6 +139,7 @@ export default {
countMax: '计数器最大值:',
pointX: '坐标 x:',
pointY: '坐标 y:',
meter: '米',
code: '编码:',
imageName: '图片名称:',
@ -302,5 +304,61 @@ export default {
zzkContent: '站中控内容:',
stationControlPositionX: '坐标 x:',
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: '请输入紧急站控内容',
stationControlZzkContent: '请输入站中控内容',
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上的物理区段不能合并',
selectedSectionEmpty: '选择的区段为空',
selectedStationEmpty: '选择的车站为空',
selectMap: '请先选择地图',
selectTrainType: '请选择查看的列车模型',
stationFont: '车站字体',
kilometerFont: '公里标字体',

View File

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

View File

@ -207,7 +207,7 @@ export default {
this.$emit('addOrUpdateMapModel', model);
} 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);
if (selected && selected._type.toUpperCase() === 'StationControl'.toUpperCase()) {
const _that = this;
this.$confirm('是否确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
type: 'warning'
}).then(() => {
_that.$emit('delMapModel', _that.selected);
_that.deviceSelect();
}).catch(() => {
_that.$message.info('已取消删除');
_that.$message.info(this.$t('tip.cancelledDelete'));
});
}
}

View File

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

View File

@ -1,7 +1,7 @@
<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="150px" size="mini">
<el-form-item label="停车点编码:" prop="code">

View File

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

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="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-option
v-for="item in textList"
@ -14,54 +14,54 @@
/>
</el-select>
</el-form-item>
<el-form-item label="文本内容:" prop="content">
<el-input v-model="editModel.content" placeholder="请输入内容" class="input-with-select">
<el-select slot="prepend" v-model="editModel.prepend" placeholder="请选择">
<el-form-item label="$t('map.textContent')" prop="content">
<el-input v-model="editModel.content" :placeholder="$t('map.pleaseSelect')" class="input-with-select">
<el-select slot="prepend" v-model="editModel.prepend" :placeholder="$t('map.pleaseSelect')">
<el-option label="水平" value="H" />
<el-option label="垂直" value="V" />
</el-select>
</el-input>
</el-form-item>
<el-form-item label="字体格式:" prop="font">
<el-font v-model="editModel.font" placeholder="字体" />
<el-form-item :label="$t('map.textFont')" prop="font">
<el-font v-model="editModel.font" :placeholder="$t('map.font')" />
</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-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="110px" :model="addModel" size="mini" :rules="makeRules">
<el-form-item label="文本内容:" prop="content">
<el-input v-model="addModel.content" placeholder="请输入内容" class="input-with-select">
<el-select slot="prepend" v-model="addModel.prepend" placeholder="请选择">
<el-form-item :label="$t('map.textContent')" prop="content">
<el-input v-model="addModel.content" :placeholder="$t('map.pleaseSelect')" class="input-with-select">
<el-select slot="prepend" v-model="addModel.prepend" :placeholder="$t('map.pleaseSelect')">
<el-option label="水平" value="H" />
<el-option label="垂直" value="V" />
</el-select>
</el-input>
</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-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-form-item>
</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>
@ -115,24 +115,24 @@ export default {
},
rules: {
code: [
{ required: true, message: '请选择Text', trigger: 'blur' }
{ required: true, message: this.$t('rules.selectText'), trigger: 'blur' }
],
content: [
{ required: true, message: '请输入内容', trigger: 'blur' }
{ required: true, message: this.$t('rules.pleaseEnterContent'), trigger: 'blur' }
],
font: [
{ required: true, message: '请选择文字格式', trigger: 'blur' }
{ required: true, message: this.$t('rules.textFont'), trigger: 'blur' }
],
fontColor: [
{ required: true, message: '请选择文字颜色', trigger: 'blur' }
{ required: true, message: this.$t('rules.textFontColor'), trigger: 'blur' }
]
},
makeRules: {
code: [
{ required: true, message: '请选择Text', trigger: 'blur' }
{ required: true, message: this.$t('rules.selectText'), trigger: 'blur' }
],
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);
if (selected && selected._type.toUpperCase() === 'Text'.toUpperCase()) {
const _that = this;
this.$confirm('是否确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
type: 'warning'
}).then(() => {
_that.$emit('delMapModel', selected);
_that.deviceSelect();
}).catch(() => {
_that.$message.info('已取消删除');
_that.$message.info(this.$t('tip.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" 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-option
v-for="item in trainList"
@ -14,10 +14,10 @@
/>
</el-select>
</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-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-option
v-for="item in trainModelList"
@ -27,33 +27,33 @@
/>
</el-select>
<el-button-group>
<el-button type="primary" size="small" @click="newTrainMode">添加</el-button>
<el-button type="primary" size="small" @click="uptTrainMode(editModel.modelCode)">更新
<el-button type="primary" size="small" @click="newTrainMode">{{ $t('map.add') }}</el-button>
<el-button type="primary" size="small" @click="uptTrainMode(editModel.modelCode)">{{ $t('map.updata') }}
</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-group>
</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-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-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="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-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-option
v-for="item in trainModelList"
@ -63,23 +63,23 @@
/>
</el-select>
<el-button-group>
<el-button type="primary" size="small" @click="newTrainMode">添加</el-button>
<el-button type="primary" size="small" @click="uptTrainMode(addModel.modelCode)">更新
<el-button type="primary" size="small" @click="newTrainMode">{{ $t('map.add') }}</el-button>
<el-button type="primary" size="small" @click="uptTrainMode(addModel.modelCode)">{{ $t('map.updata') }}
</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-group>
</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-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-form-item>
</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>
@ -132,19 +132,19 @@ export default {
},
rules: {
code: [
{ required: true, message: '请重新选择设备', trigger: 'change' }
{ required: true, message: this.$t('rules.pleaseReSelectDevice'), trigger: 'change' }
],
groupNumber: [
{ required: true, message: '请输入车组号', trigger: 'blur' }
{ required: true, message: this.$t('rules.pleaseEnterGroupNumber'), trigger: 'blur' }
],
modelCode: [
{ required: true, message: '请选择车类型', trigger: 'change' }
{ required: true, message: this.$t('rules.selectTrainType'), trigger: 'change' }
],
'position.x': [
{ required: true, message: '请输入x坐标位置', trigger: 'blur' }
{ required: true, message: this.$t('rules.trainPositionX'), trigger: 'blur' }
],
'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 () {
return {
modelCode: [
{ required: true, message: '请选择车类型', trigger: 'change' }
{ required: true, message: this.$t('rules.selectTrainType'), trigger: 'change' }
],
groupNumber: [
{ required: true, message: '请填写车组号', trigger: 'blur' }
{ required: true, message: this.$t('rules.pleaseEnterTrainNumber'), trigger: 'blur' }
],
'position.x': [
{ required: true, message: '请输入x坐标', trigger: 'change' }
{ required: true, message: this.$t('rules.trainPositionX'), trigger: 'change' }
],
'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);
if (selected && selected._type.toUpperCase() === 'Train'.toUpperCase()) {
const _that = this;
this.$confirm('是否确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
type: 'warning'
}).then(() => {
_that.$emit('delMapModel', selected);
_that.deviceSelect();
}).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) {
this.$refs.trainMode.doShow({}, 'ADD');
} else {
this.$messageBox('请先选择地图');
this.$messageBox(this.$t('tip.selectMap'));
}
},
uptTrainMode(code) {
@ -279,7 +279,7 @@ export default {
}
});
} else {
this.$messageBox('请选择查看的列车模型');
this.$messageBox(this.$t('tip.selectTrainType'));
}
},
delTrainMode(code) {

View File

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

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

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="dataform" :form="form" :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="formMake" :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>
@ -68,19 +68,19 @@ export default {
},
rules: {
code: [
{ required: true, message: '请选择唯一编码', trigger: 'change' }
{ required: true, message: this.$t('rules.pleaseSelectEncoding'), trigger: 'change' }
],
name: [
{ required: true, message: '请输入状态信号名称', trigger: 'blur' }
{ required: true, message: this.$t('rules.pleaseEnterStatusSignal'), trigger: 'blur' }
],
visible: [
{ required: true, message: '请选择是否可见', trigger: 'change' }
{ required: true, message: this.$t('rules.visible'), trigger: 'change' }
],
'position.x': [
{ required: true, message: '请输入x坐标位置', trigger: 'blur' }
{ required: true, message: this.$t('rules.trainPositionX'), trigger: 'blur' }
],
'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 = {
labelWidth: '150px',
items: [
{ prop: 'code', label: '编码:', type: 'select', optionLabel: 'code', optionValue: 'code', options: this.zcList, change: true, deviceChange: this.deviceChange },
{ prop: 'name', label: '状态信号名称:', type: 'input' },
{ prop: 'visible', label: '是否可见:', type: 'checkboxx' },
{ prop: 'position', label: '状态信号画图坐标:', type: 'coordinate', width: '140px', children: [
{ prop: 'code', label: this.$t('map.zcCodeColon'), type: 'select', optionLabel: 'code', optionValue: 'code', options: this.zcList, change: true, deviceChange: this.deviceChange },
{ prop: 'name', label: this.$t('map.statusSignalName'), type: 'input' },
{ prop: 'visible', label: this.$t('map.showZc'), type: 'checkboxx' },
{ 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.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px' }
] }
@ -111,8 +111,8 @@ export default {
const form = {
labelWidth: '150px',
items: [
{ prop: 'name', label: '状态信号名称:', type: 'input' },
{ prop: 'position', label: '状态信号画图坐标:', type: 'coordinate', width: '140px', children: [
{ prop: 'name', label: this.$t('map.statusSignalName'), type: 'input' },
{ 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.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px' }
] }
@ -123,13 +123,13 @@ export default {
createRules: function () {
return {
name: [
{ required: true, message: '请输入状态信号名称', trigger: 'blur' }
{ required: true, message: this.$t('rules.pleaseEnterStatusSignal'), trigger: 'blur' }
],
'position.x': [
{ required: true, message: '请输入x坐标位置', trigger: 'blur' }
{ required: true, message: this.$t('rules.trainPositionX'), trigger: 'blur' }
],
'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);
if (selected && selected._type.toUpperCase() === 'ZcControl'.toUpperCase()) {
const _that = this;
this.$confirm('是否确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
type: 'warning'
}).then(() => {
_that.$emit('delMapModel', selected);
_that.deviceSelect();
}).catch(() => {
_that.$message.info('已取消删除');
_that.$message.info(this.$t('tip.cancelledDelete'));
});
}
}

View File

@ -89,24 +89,24 @@ export default {
handler: this.jlmap3d
}
],
menuNormal:[],
menu: []
menuNormal: [],
menu: []
};
},
computed: {
...mapGetters('map', [
'stationList'
]),
},
computed: {
...mapGetters('map', [
'stationList'
])
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Map)) {
this.menu = [ ...this.menuMap]
this.menu = [...this.menuMap];
this.doShow(this.$store.state.menuOperation.menuPosition);
} else if(this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Cancel)){
this.initCancelMenu();
this.doShow(this.$store.state.menuOperation.menuPosition);
}else {
} else if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Cancel)) {
this.initCancelMenu();
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
}
}
@ -200,43 +200,43 @@ export default {
refresh() {
this.$emit('refresh');
},
initCancelMenu() {
this.menuNormal = [];
this.stationList.forEach(station => {
if (station.code === station.concentrateStationCode) {
let node = {
label: station.name,
children: []
};
initCancelMenu() {
this.menuNormal = [];
this.stationList.forEach(station => {
if (station.code === station.concentrateStationCode) {
const node = {
label: station.name,
children: []
};
this.stationList.forEach(elem => {
if (elem.visible) {
let next = elem;
while (next.code != next.concentrateStationCode || !next.concentrateStationCode) {
next = this.$store.getters['map/getDeviceByCode'](next.concentrateStationCode);
}
this.stationList.forEach(elem => {
if (elem.visible) {
let next = elem;
while (next.code != next.concentrateStationCode || !next.concentrateStationCode) {
next = this.$store.getters['map/getDeviceByCode'](next.concentrateStationCode);
}
if (station.code == next.code) {
node.children.push({
code: elem.code,
label: elem.name,
handler: this.mapLocation,
});
}
}
});
if (station.code == next.code) {
node.children.push({
code: elem.code,
label: elem.name,
handler: this.mapLocation
});
}
}
});
this.menuNormal.push(node);
}
});
this.menu = [ ...this.menuNormal ]
},
mapLocation(item) {
if (item) {
this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: item.code });
this.doClose();
}
},
this.menuNormal.push(node);
}
});
this.menu = [...this.menuNormal];
},
mapLocation(item) {
if (item) {
this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: item.code });
this.doClose();
}
}
}
};
</script>

View File

@ -1,256 +1,270 @@
<template>
<div>
<turnback-bar :title="turnbackBarTitle"></turnback-bar>
<div class="card-box">
<el-steps class="steps" :active="display">
<el-step :title="title" icon="el-icon-edit-outline"></el-step>
<el-step title="" icon="el-icon-upload"></el-step>
</el-steps>
<el-card class="forms">
<el-scrollbar wrapClass="scrollbar-wrapper" :style="{height:height - 300 + 'px'}"
style="padding-top: 60px">
<el-form ref="form" :model="addModel" label-width="140px">
<el-form-item label="所属地图名称:" prop="mapName">
<el-input v-model="addModel.mapName" :disabled="true"></el-input>
</el-form-item>
<el-form-item label="产品类型:" prop="prdType">
<el-radio-group v-model="addModel.prdType">
<template v-for="item in chooseList">
<el-radio-button :label="item.code" :key="item">{{item.name}}</el-radio-button>
</template>
</el-radio-group>
</el-form-item>
<el-form-item label="产品编码:" prop="code"
:rules="node && node.data.type ==='map' ? baseRules.code:{}">
<el-input v-model="addModel.code" :disabled="codeDisabled"></el-input>
</el-form-item>
<el-form-item label="产品名称:" prop="name" :rules="baseRules.name">
<el-input v-model="addModel.name"></el-input>
</el-form-item>
<el-form-item label="产品说明:" prop="remarks" :rules="baseRules.remarks">
<el-input v-model="addModel.remarks" type="textarea"></el-input>
</el-form-item>
<el-form-item label="关联实训类型:" prop="trainTypes" :rules="baseRules.trainTypes">
<el-select v-model="addModel.trainTypes" multiple placeholder="请选择"
@change="trainTypesChange">
<el-option v-for="item in trainTypesList" :key="item.code" :label="item.name"
:value="item.code">
</el-option>
</el-select>
</el-form-item>
</el-form>
</el-scrollbar>
</el-card>
<div class="draft">
<el-button-group>
<el-button type="primary" v-if="isAdd" @click="create">创建</el-button>
<el-button type="warning" v-if="isEdit" @click="update">更新</el-button>
<el-button type="danger" v-if="isEdit" @click="deleteObj">删除</el-button>
</el-button-group>
</div>
</div>
<div>
<turnback-bar :title="turnbackBarTitle" />
<div class="card-box">
<el-steps class="steps" :active="display">
<el-step :title="title" icon="el-icon-edit-outline" />
<el-step title="" icon="el-icon-upload" />
</el-steps>
<el-card class="forms">
<el-scrollbar
wrap-class="scrollbar-wrapper"
:style="{height:height - 300 + 'px'}"
style="padding-top: 60px"
>
<el-form ref="form" :model="addModel" label-width="140px">
<el-form-item label="所属地图名称:" prop="mapName">
<el-input v-model="addModel.mapName" :disabled="true" />
</el-form-item>
<el-form-item label="产品类型:" prop="prdType">
<el-radio-group v-model="addModel.prdType">
<template v-for="item in chooseList">
<el-radio-button :key="item" :label="item.code">{{ item.name }}</el-radio-button>
</template>
</el-radio-group>
</el-form-item>
<el-form-item
label="产品编码:"
prop="code"
:rules="node && node.data.type ==='map' ? baseRules.code:{}"
>
<el-input v-model="addModel.code" :disabled="codeDisabled" />
</el-form-item>
<el-form-item label="产品名称:" prop="name" :rules="baseRules.name">
<el-input v-model="addModel.name" />
</el-form-item>
<el-form-item label="产品说明:" prop="remarks" :rules="baseRules.remarks">
<el-input v-model="addModel.remarks" type="textarea" />
</el-form-item>
<el-form-item label="关联实训类型:" prop="trainTypes" :rules="baseRules.trainTypes">
<el-select
v-model="addModel.trainTypes"
multiple
placeholder="请选择"
@change="trainTypesChange"
>
<el-option
v-for="item in trainTypesList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
</el-form>
</el-scrollbar>
</el-card>
<div class="draft">
<el-button-group>
<el-button v-if="isAdd" type="primary" @click="create">创建</el-button>
<el-button v-if="isEdit" type="warning" @click="update">更新</el-button>
<el-button v-if="isEdit" type="danger" @click="deleteObj">删除</el-button>
</el-button-group>
</div>
</div>
</div>
</template>
<script>
import { createTrainingCategory, updateTrainingCategory, deleteTrainingCategory } from '@/api/management/mapprd'
import { getProductDetail } from '@/api/management/mapprd';
import localStore from 'storejs';
import { getPublishMapInfo } from '@/api/jmap/map';
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
import { createTrainingCategory, updateTrainingCategory, deleteTrainingCategory } from '@/api/management/mapprd';
import { getProductDetail } from '@/api/management/mapprd';
import localStore from 'storejs';
import { getPublishMapInfo } from '@/api/jmap/map';
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
export default {
name: 'ShowDetail',
props: {
height: {
type: Number
}
},
mixins: [
WindowResizeHandler
],
data() {
return {
node: null,
display: 1,
height: 0,
codeDisabled: true,
rules: {},
trainTypesList: [],
initTrainTypes: [],
chooseList: [],
addModel: {
id: '',
mapId: '',
mapName: '',
skinStyle: '',
name: '',
remarks: '',
code: '',
prdType: '01',
trainTypes: []
}
}
},
computed: {
title() {
if (this.isAdd) {
return '创建实训类目';
} else if (this.isEdit) {
return '编辑实训类目';
}
},
turnbackBarTitle() {
return '';
},
isAdd() {
return this.$route.params.mode == 'add';
},
isEdit() {
return this.$route.params.mode == 'edit';
},
baseRules() {
return {
code: [
{ required: true, message: '请输入产品编码', trigger: 'change' }
],
name: [
{ required: true, message: '请输入产品名称', trigger: 'change' }
],
remarks: [
{ required: true, message: '请输入产品说明', trigger: 'change' }
],
trainTypes: [
{ required: true, message: '请选择关联实训类型', trigger: 'change' }
]
}
}
},
mounted() {
this.$Dictionary.trainingType().then(list => {
this.trainTypesList = list;
});
this.$Dictionary.productPostType().then(list => {
this.chooseList = list;
});
},
methods: {
resizeHandler: function () {
this.height = this._clientHeight;
},
loadData(node) {
if (node) {
//
this.node = node;
this.initTrainTypes = [];
this.$refs.form.resetFields();
if ('map' === node.data.type) {
this.codeDisabled = false;
getPublishMapInfo(node.data.id).then(response => {
let data = response.data;
this.addModel.mapName = data.name;
this.addModel.skinStyle = data.skinStyle;
this.loading = false;
}).catch(() => {
this.loading = false;
});
} else if ('prd' === node.data.type) {
this.codeDisabled = true;
getProductDetail(node.data.id).then(response => {
this.addModel.mapName = node.parent.data.name;
this.addModel.mapId = node.parent.data.id;
this.addModel.name = response.data.name;
this.addModel.remarks = response.data.remarks;
this.addModel.prdType = response.data.prdType || '01';
this.addModel.code = response.data.code;
this.addModel.skinStyle = response.data.skinStyle;
this.addModel.trainTypes = this.initTrainTypes = response.data.trainTypes;
this.addModel.id = response.data.id;
this.loading = false;
}).catch(error => {
this.loading = false;
});
}
export default {
name: 'ShowDetail',
mixins: [
WindowResizeHandler
],
props: {
height: {
type: Number,
required: true
}
},
data() {
return {
node: null,
display: 1,
// height: 0,
codeDisabled: true,
rules: {},
trainTypesList: [],
initTrainTypes: [],
chooseList: [],
addModel: {
id: '',
mapId: '',
mapName: '',
skinStyle: '',
name: '',
remarks: '',
code: '',
prdType: '01',
trainTypes: []
}
};
},
computed: {
title() {
if (this.isAdd) {
return '创建实训类目';
} else if (this.isEdit) {
return '编辑实训类目';
}
return '';
},
turnbackBarTitle() {
return '';
},
isAdd() {
return this.$route.params.mode == 'add';
},
isEdit() {
return this.$route.params.mode == 'edit';
},
baseRules() {
return {
code: [
{ required: true, message: '请输入产品编码', trigger: 'change' }
],
name: [
{ required: true, message: '请输入产品名称', trigger: 'change' }
],
remarks: [
{ required: true, message: '请输入产品说明', trigger: 'change' }
],
trainTypes: [
{ required: true, message: '请选择关联实训类型', trigger: 'change' }
]
};
}
},
mounted() {
this.$Dictionary.trainingType().then(list => {
this.trainTypesList = list;
});
this.$Dictionary.productPostType().then(list => {
this.chooseList = list;
});
},
methods: {
resizeHandler: function () {
this.height = this._clientHeight;
},
loadData(node) {
if (node) {
//
this.node = node;
this.initTrainTypes = [];
this.$refs.form.resetFields();
if (node.data.type === 'map') {
this.codeDisabled = false;
getPublishMapInfo(node.data.id).then(response => {
const data = response.data;
this.addModel.mapName = data.name;
this.addModel.skinStyle = data.skinStyle;
this.loading = false;
}).catch(() => {
this.loading = false;
});
} else if (node.data.type === 'prd') {
this.codeDisabled = true;
getProductDetail(node.data.id).then(response => {
this.addModel.mapName = node.parent.data.name;
this.addModel.mapId = node.parent.data.id;
this.addModel.name = response.data.name;
this.addModel.remarks = response.data.remarks;
this.addModel.prdType = response.data.prdType || '01';
this.addModel.code = response.data.code;
this.addModel.skinStyle = response.data.skinStyle;
this.addModel.trainTypes = this.initTrainTypes = response.data.trainTypes;
this.addModel.id = response.data.id;
this.loading = false;
}).catch(() => {
this.loading = false;
});
}
//
this.$nextTick(function () {
this.$refs.form.clearValidate();
})
}
},
create() {
this.$refs.form.validate((valid) => {
if (valid) {
let data = {
skinStyle: this.addModel.skinStyle,
mapName: this.addModel.mapName,
name: this.addModel.name,
remarks: this.addModel.remarks,
prdType: this.addModel.prdType,
code: this.addModel.code,
trainTypes: this.addModel.trainTypes
};
createTrainingCategory(data).then(response => {
this.initTrainTypes = this.addModel.trainTypes;
this.$emit('refresh', [localStore.get('cityCode') || '', localStore.get('mapId') || '']);
this.$message.success('创建产品成功');
}).catch(error => {
this.$messageBox('创建产品失败');
});
}
});
},
update() {
this.$refs.form.validate((valid) => {
if (valid) {
updateTrainingCategory(this.addModel).then(response => {
this.initTrainTypes = this.addModel.trainTypes;
this.$message.success('更新产品成功');
// this.$emit('refresh', [localStore.get('cityCode') || '', localStore.get('mapId') || '']);
}).catch(error => {
this.$messageBox('更新产品失败');
});
}
});
},
trainTypesChange(tag) {
if (this.initTrainTypes && this.initTrainTypes.length > 0) {
this.initTrainTypes.forEach(elem => {
if (this.addModel.trainTypes.indexOf(elem) < 0) {
this.addModel.trainTypes = this.initTrainTypes;
this.$messageBox('不能缩小上次创建的实训列表的范围');
}
});
}
},
deleteObj() {
this.$refs.form.validate((valid) => {
if (valid) {
deleteTrainingCategory(this.addModel).then(response => {
this.$message.success('删除产品成功');
this.$refs.form.resetFields();
this.node = null;
this.$emit('refresh', [localStore.get('cityCode') || '', localStore.get('mapId') || '']);
}).catch(error => {
if (error.code === 500009) {
this.$messageBox('产品已被使用无法删除');
} else {
this.$messageBox('删除产品失败');
}
});
}
});
},
turnback() {
this.$router.go(-1)
}
}
}
//
this.$nextTick(function () {
this.$refs.form.clearValidate();
});
}
},
create() {
this.$refs.form.validate((valid) => {
if (valid) {
const data = {
skinStyle: this.addModel.skinStyle,
mapName: this.addModel.mapName,
name: this.addModel.name,
remarks: this.addModel.remarks,
prdType: this.addModel.prdType,
code: this.addModel.code,
trainTypes: this.addModel.trainTypes
};
createTrainingCategory(data).then(response => {
this.initTrainTypes = this.addModel.trainTypes;
this.$emit('refresh', [localStore.get('cityCode') || '', localStore.get('mapId') || '']);
this.$message.success('创建产品成功');
}).catch(() => {
this.$messageBox('创建产品失败');
});
}
});
},
update() {
this.$refs.form.validate((valid) => {
if (valid) {
updateTrainingCategory(this.addModel).then(response => {
this.initTrainTypes = this.addModel.trainTypes;
this.$message.success('更新产品成功');
// this.$emit('refresh', [localStore.get('cityCode') || '', localStore.get('mapId') || '']);
}).catch(() => {
this.$messageBox('更新产品失败');
});
}
});
},
trainTypesChange(tag) {
if (this.initTrainTypes && this.initTrainTypes.length > 0) {
this.initTrainTypes.forEach(elem => {
if (this.addModel.trainTypes.indexOf(elem) < 0) {
this.addModel.trainTypes = this.initTrainTypes;
this.$messageBox('不能缩小上次创建的实训列表的范围');
}
});
}
},
deleteObj() {
this.$refs.form.validate((valid) => {
if (valid) {
deleteTrainingCategory(this.addModel).then(response => {
this.$message.success('删除产品成功');
this.$refs.form.resetFields();
this.node = null;
this.$emit('refresh', [localStore.get('cityCode') || '', localStore.get('mapId') || '']);
}).catch(error => {
if (error.code === 500009) {
this.$messageBox('产品已被使用无法删除');
} else {
this.$messageBox('删除产品失败');
}
});
}
});
},
turnback() {
this.$router.go(-1);
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.card-box {
padding-top: 10px;
}
@ -301,4 +315,4 @@
text-align: center;
margin: 20px auto;
}
</style>
</style>

View File

@ -1,155 +1,154 @@
<template>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList">
</QueryListPage>
</div>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</div>
</template>
<script>
import { getPublishMapList, delPublishMap, getPublishMapExport, putMapOnLine, putMapOffLine } from '@/api/jmap/map';
import { getSkinStyleList } from '@/api/management/mapskin';
import { UrlConfig } from '@/router/index';
import localStore from 'storejs';
import { getPublishMapList, delPublishMap } from '@/api/jmap/map';
import { getSkinStyleList } from '@/api/management/mapskin';
import { UrlConfig } from '@/router/index';
import localStore from 'storejs';
export default {
name: 'ProductList',
data() {
return {
cityList: [],
skinStyleList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '80px',
reset: true,
queryObject: {
name: {
type: 'text',
label: '名称'
},
cityCode: {
type: 'select',
label: '所属城市',
config: {
data: []
}
}
}
export default {
name: 'ProductList',
data() {
return {
cityList: [],
skinStyleList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '80px',
reset: true,
queryObject: {
name: {
type: 'text',
label: '名称'
},
cityCode: {
type: 'select',
label: '所属城市',
config: {
data: []
}
}
}
},
queryList: {
query: getPublishMapList,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: '地图名称',
prop: 'name'
},
{
title: '皮肤类型',
prop: 'skinStyle',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.skinStyle, this.skinStyleList, ['code', 'name']) },
tagType: (row) => { return '' }
},
{
title: '更新时间',
prop: 'updateTime'
},
{
type: 'button',
title: '操作',
width: '250',
buttons: [
{
name: '产品列表',
handleClick: this.handleList,
type: ''
},
{
name: '修改',
handleClick: this.handleEdit,
type: 'warning'
},
{
name: '删除',
handleClick: this.handleDelete,
type: 'danger'
}
]
}
],
actions: [
{ text: '新增', btnCode: 'employee_insert', handler: this.handleAdd },
]
},
currentModel: {}
}
},
created() {
this.loadInitData();
},
computed: {
isShow() {
return this.$store.getters['roles'].indexOf('05');
}
},
methods: {
loadInitData() {
this.cityList = [];
this.$Dictionary.cityType().then(list => {
this.cityList = list;
this.cityList.forEach(elem => {
this.queryForm.queryObject.cityCode.config.data.push({ value: elem.code, label: elem.name });
});
}).catch(error => {
this.$messageBox('加载城市列表失败');
});
},
queryList: {
query: getPublishMapList,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: '地图名称',
prop: 'name'
},
{
title: '皮肤类型',
prop: 'skinStyle',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.skinStyle, this.skinStyleList, ['code', 'name']); },
tagType: (row) => { return ''; }
},
{
title: '更新时间',
prop: 'updateTime'
},
{
type: 'button',
title: '操作',
width: '250',
buttons: [
{
name: '产品列表',
handleClick: this.handleList,
type: ''
},
{
name: '修改',
handleClick: this.handleEdit,
type: 'warning'
},
{
name: '删除',
handleClick: this.handleDelete,
type: 'danger'
}
]
}
],
actions: [
{ text: '新增', btnCode: 'employee_insert', handler: this.handleAdd }
]
},
currentModel: {}
};
},
computed: {
isShow() {
return this.$store.getters['roles'].indexOf('05');
}
},
created() {
this.loadInitData();
},
methods: {
loadInitData() {
this.cityList = [];
this.$Dictionary.cityType().then(list => {
this.cityList = list;
this.cityList.forEach(elem => {
this.queryForm.queryObject.cityCode.config.data.push({ value: elem.code, label: elem.name });
});
}).catch(() => {
this.$messageBox('加载城市列表失败');
});
this.skinStyleList = [];
getSkinStyleList().then(response => {
this.skinStyleList = response.data;
})
},
//
handleAdd() {
this.$router.push({ path: `${UrlConfig.map.productDraft}/add/0` });
},
this.skinStyleList = [];
getSkinStyleList().then(response => {
this.skinStyleList = response.data;
});
},
//
handleAdd() {
this.$router.push({ path: `${UrlConfig.map.productDraft}/add/0` });
},
//
handleList(index, row) {
//
handleList(index, row) {
},
},
//
handleEdit(index, row) {
this.$router.push({ path: `${UrlConfig.map.productDraft}/edit/0` });
},
//
handleEdit(index, row) {
this.$router.push({ path: `${UrlConfig.map.productDraft}/edit/0` });
},
//
handleDelete(index, row) {
this.$confirm('此操作将删除该类型, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delPublishMap(row.id).then(response => {
this.$message.success('删除成功')
this.reloadTable()
localStore.remove('mapId')
}).catch(error => {
this.reloadTable()
this.$messageBox('删除失败');
})
}).catch(() => { })
},
//
handleDelete(index, row) {
this.$confirm('此操作将删除该类型, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delPublishMap(row.id).then(response => {
this.$message.success('删除成功');
this.reloadTable();
localStore.remove('mapId');
}).catch(() => {
this.reloadTable();
this.$messageBox('删除失败');
});
}).catch(() => { });
},
reloadTable() {
this.queryList.reload()
}
}
}
</script>
reloadTable() {
this.queryList.reload();
}
}
};
</script>

View File

@ -1,213 +1,214 @@
<template>
<div class="card-box">
<turnback-bar :title="turnbackBarTitle"></turnback-bar>
<el-steps class="steps" :active="display">
<el-step :title="title" icon="el-icon-edit-outline"></el-step>
<el-step title="" icon="el-icon-upload"></el-step>
</el-steps>
<el-card class="forms">
<el-scrollbar wrapClass="scrollbar-wrapper" :style="{height:height -160 + 'px'}" style="padding-top: 40px">
<data-form ref="dataform" :form="form" :formModel="formModel" :rules="rules"></data-form>
</el-scrollbar>
</el-card>
<div class="draft">
<el-button-group>
<el-button type="primary" @click="create" style="margin-left: 120px" v-if="isAdd">创建</el-button>
<el-button type="primary" @click="update" style="margin-left: 120px" v-if="isEdit">更新</el-button>
</el-button-group>
</div>
<div class="card-box">
<turnback-bar :title="turnbackBarTitle" />
<el-steps class="steps" :active="display">
<el-step :title="title" icon="el-icon-edit-outline" />
<el-step title="" icon="el-icon-upload" />
</el-steps>
<el-card class="forms">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{height:height -160 + 'px'}" style="padding-top: 40px">
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
</el-scrollbar>
</el-card>
<div class="draft">
<el-button-group>
<el-button v-if="isAdd" type="primary" style="margin-left: 120px" @click="create">创建</el-button>
<el-button v-if="isEdit" type="primary" style="margin-left: 120px" @click="update">更新</el-button>
</el-button-group>
</div>
</div>
</template>
<script>
import { addSkinStyle, querySkinStyle, updateSkinStyle, querySkinStyleExistByCode } from '@/api/management/mapskin';
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
import { addSkinStyle, querySkinStyle, updateSkinStyle, querySkinStyleExistByCode } from '@/api/management/mapskin';
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
export default {
name: 'DictionaryDetailEdit',
mixins: [
WindowResizeHandler
],
data() {
return {
height: '',
display: 1,
formModel: {
id: '',
code: '',
name: '',
origin: { x: 0, y: 0 },
scaling: '1',
linkWidth: 0,
zoneWidth: 0,
watermarkShow: false,
}
}
},
computed: {
title() {
if (this.isAdd) {
return '添加地图皮肤';
}
if (this.isEdit) {
return '更新地图皮肤';
}
},
isAdd() {
return this.$route.params.mode.toUpperCase() == 'add'.toUpperCase();
},
isEdit() {
return this.$route.params.mode.toUpperCase() == 'edit'.toUpperCase();
},
isDisabled() {
return this.isEdit;
},
turnbackBarTitle() {
return '';
},
export default {
name: 'DictionaryDetailEdit',
mixins: [
WindowResizeHandler
],
data() {
return {
height: '',
display: 1,
formModel: {
id: '',
code: '',
name: '',
origin: { x: 0, y: 0 },
scaling: '1',
linkWidth: 0,
zoneWidth: 0,
watermarkShow: false
}
};
},
computed: {
title() {
if (this.isAdd) {
return '添加地图皮肤';
}
if (this.isEdit) {
return '更新地图皮肤';
}
return '';
},
isAdd() {
return this.$route.params.mode.toUpperCase() == 'add'.toUpperCase();
},
isEdit() {
return this.$route.params.mode.toUpperCase() == 'edit'.toUpperCase();
},
isDisabled() {
return this.isEdit;
},
turnbackBarTitle() {
return '';
},
form() {
let form = {
labelWidth: '140px',
items: [
{ prop: 'code', label: '皮肤编码', type: 'text', required: false, disabled: this.isDisabled, },
{ prop: 'name', label: '皮肤名称', type: 'text', required: false },
{ prop: 'origin', label: '原点坐标', type: 'point', required: false },
{ prop: 'scaling', label: '缩放比例', type: 'number', required: false, message: `(缩放比例最大为8级)` },
{ prop: 'linkWidth', label: 'link宽度', type: 'number', required: false, message: `(Link宽度最大为20)` },
{ prop: 'zoneWidth', label: '区段宽度', type: 'number', required: false, message: `(区段宽度最大为30)` },
{ prop: 'watermarkShow', label: '是否显示水印', type: 'radio', required: false, options: this.$ConstSelect.Whether }
]
}
return form
},
form() {
const form = {
labelWidth: '140px',
items: [
{ prop: 'code', label: '皮肤编码', type: 'text', required: false, disabled: this.isDisabled },
{ prop: 'name', label: '皮肤名称', type: 'text', required: false },
{ prop: 'origin', label: '原点坐标', type: 'point', required: false },
{ prop: 'scaling', label: '缩放比例', type: 'number', required: false, message: `(缩放比例最大为8级)` },
{ prop: 'linkWidth', label: 'link宽度', type: 'number', required: false, message: `(Link宽度最大为20)` },
{ prop: 'zoneWidth', label: '区段宽度', type: 'number', required: false, message: `(区段宽度最大为30)` },
{ prop: 'watermarkShow', label: '是否显示水印', type: 'radio', required: false, options: this.$ConstSelect.Whether }
]
};
return form;
},
rules() {
let baseRules = {
code: [
{ required: true, message: '请输入皮肤编码', trigger: 'blur' }
],
name: [
{ required: true, message: '请输入皮肤名称', trigger: 'blur' }
],
origin: [
{ required: true, message: '请输入原点坐标', trigger: 'blur' }
],
scaling: [
{ required: true, message: '请输入缩放比例', trigger: 'blur' },
{
validator(rule, value, callback) {
if (Number(value) >= 1 && Number(value) <= 8) {
callback();
} else {
callback(new Error("请输入有效的缩放比例"));
}
},
trigger: 'blur',
}
],
linkWidth: [
{ required: true, message: '请输入Link宽度', trigger: 'blur' },
{
validator(rule, value, callback) {
if (Number.isInteger(Number(value)) && Number(value) >= 5 && Number(value) <= 20) {
callback();
} else {
callback(new Error("请输入有效Link宽度"));
}
},
trigger: 'blur',
}
],
zoneWidth: [
{ required: true, message: '请输入区段宽度', trigger: 'blur' },
{
validator(rule, value, callback) {
if (Number.isInteger(Number(value)) && Number(value) >= 5 && Number(value) <= 30) {
callback();
} else {
callback(new Error("请输入有效区段宽度"));
}
},
trigger: 'blur',
}
],
watermarkShow: [
{ required: true, message: '请选择是否水印', trigger: 'change' },
]
}
rules() {
const baseRules = {
code: [
{ required: true, message: '请输入皮肤编码', trigger: 'blur' }
],
name: [
{ required: true, message: '请输入皮肤名称', trigger: 'blur' }
],
origin: [
{ required: true, message: '请输入原点坐标', trigger: 'blur' }
],
scaling: [
{ required: true, message: '请输入缩放比例', trigger: 'blur' },
{
validator(rule, value, callback) {
if (Number(value) >= 1 && Number(value) <= 8) {
callback();
} else {
callback(new Error('请输入有效的缩放比例'));
}
},
trigger: 'blur'
}
],
linkWidth: [
{ required: true, message: '请输入Link宽度', trigger: 'blur' },
{
validator(rule, value, callback) {
if (Number.isInteger(Number(value)) && Number(value) >= 5 && Number(value) <= 20) {
callback();
} else {
callback(new Error('请输入有效Link宽度'));
}
},
trigger: 'blur'
}
],
zoneWidth: [
{ required: true, message: '请输入区段宽度', trigger: 'blur' },
{
validator(rule, value, callback) {
if (Number.isInteger(Number(value)) && Number(value) >= 5 && Number(value) <= 30) {
callback();
} else {
callback(new Error('请输入有效区段宽度'));
}
},
trigger: 'blur'
}
],
watermarkShow: [
{ required: true, message: '请选择是否水印', trigger: 'change' }
]
};
//
this.$nextTick(function () {
this.$refs.dataform.clearValidate();
});
//
this.$nextTick(function () {
this.$refs.dataform.clearValidate();
});
return baseRules;
}
},
mounted() {
this.initLoadPage();
},
methods: {
resizeHandler: function () {
this.height = this._clientHeight - 130;
},
initLoadPage() {
//
this.display = 1;
this.formModel = {
id: '',
code: '',
name: '',
origin: { x: 0, y: 0 },
scaling: '1',
linkWidth: 0,
zoneWidth: 0,
watermarkShow: false,
}
return baseRules;
}
},
mounted() {
this.initLoadPage();
},
methods: {
resizeHandler: function () {
this.height = this._clientHeight - 130;
},
initLoadPage() {
//
this.display = 1;
this.formModel = {
id: '',
code: '',
name: '',
origin: { x: 0, y: 0 },
scaling: '1',
linkWidth: 0,
zoneWidth: 0,
watermarkShow: false
};
if (this.isEdit) {
querySkinStyle(this.$route.params.skinStyleId).then(response => {
this.formModel = response.data;
})
}
if (this.isEdit) {
querySkinStyle(this.$route.params.skinStyleId).then(response => {
this.formModel = response.data;
});
}
//
this.$nextTick(() => {
this.$refs.dataform.resetForm();
});
},
create() {
this.formModel.id = '';
this.$refs.dataform.validateForm(() => {
querySkinStyleExistByCode(this.formModel.code).then(resp => {
addSkinStyle(this.formModel).then(response => {
this.turnback();
this.$message.success('创建成功');
}).catch(error => {
this.$messageBox("创建失败");
})
}).catch((error) => {
this.$messageBox("地图皮肤编码已存在");
})
});
},
update() {
this.formModel.id = this.$route.params.skinStyleId;
this.$refs.dataform.validateForm(() => {
updateSkinStyle(this.formModel).then(response => {
this.turnback();
this.$message.success('更新成功');
}).catch(error => {
this.$messageBox("更新失败");
});
})
},
turnback() {
this.$router.go(-1)
}
}
}
//
this.$nextTick(() => {
this.$refs.dataform.resetForm();
});
},
create() {
this.formModel.id = '';
this.$refs.dataform.validateForm(() => {
querySkinStyleExistByCode(this.formModel.code).then(resp => {
addSkinStyle(this.formModel).then(response => {
this.turnback();
this.$message.success('创建成功');
}).catch(() => {
this.$messageBox('创建失败');
});
}).catch(() => {
this.$messageBox('地图皮肤编码已存在');
});
});
},
update() {
this.formModel.id = this.$route.params.skinStyleId;
this.$refs.dataform.validateForm(() => {
updateSkinStyle(this.formModel).then(response => {
this.turnback();
this.$message.success('更新成功');
}).catch(() => {
this.$messageBox('更新失败');
});
});
},
turnback() {
this.$router.go(-1);
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@ -253,4 +254,4 @@
width: 300px;
margin: 20px auto;
}
</style>
</style>

View File

@ -1,143 +1,141 @@
<template>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList">
</QueryListPage>
</div>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</div>
</template>
<script>
import { UrlConfig } from '@/router/index';
import { getSkinStylePageList, delSkinStyle } from '@/api/management/mapskin';
import { getSkinStyleList } from '@/api/management/mapskin';
import localStore from 'storejs';
import { UrlConfig } from '@/router/index';
import { getSkinStylePageList, delSkinStyle } from '@/api/management/mapskin';
import { getSkinStyleList } from '@/api/management/mapskin';
export default {
name: 'SkinStyle',
data() {
return {
prdTypeList: [],
skinStyleList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '80px',
reset: true,
queryObject: {
name: {
type: 'text',
label: '皮肤名称'
},
code: {
type: 'text',
label: '皮肤编码'
}
}
},
queryList: {
query: getSkinStylePageList,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: '皮肤编码',
prop: 'code'
},
{
title: '皮肤名称',
prop: 'name'
},
{
title: '原点坐标',
prop: 'origin',
type: 'tag',
columnValue: (row) => { return `(${row.origin.x}, ${row.origin.y})` },
tagType: () => { return '' }
},
{
title: 'Link宽度',
prop: 'linkWidth'
},
{
title: '区段宽度',
prop: 'zoneWidth'
},
{
title: '缩放比例',
prop: 'scaling'
},
{
title: '是否显示水印',
prop: 'watermarkShow',
type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.watermarkShow, 'Whether') },
tagType: (row) => {
return row.forever ? 'success' : 'danger';
}
},
{
type: 'button',
title: '操作',
width: '250',
buttons: [
{
name: '编辑',
handleClick: this.handleEdit,
type: ''
},
{
name: '删除',
handleClick: this.handleDelete,
type: 'danger'
},
]
}
],
actions: [
{ text: '新增', handler: this.handleAdd },
]
}
}
},
created() {
this.loadInitData();
},
methods: {
loadInitData() {
this.prdTypeList = [];
this.$Dictionary.productPostType().then(list => {
this.prdTypeList = list;
});
export default {
name: 'SkinStyle',
data() {
return {
prdTypeList: [],
skinStyleList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '80px',
reset: true,
queryObject: {
name: {
type: 'text',
label: '皮肤名称'
},
code: {
type: 'text',
label: '皮肤编码'
}
}
},
queryList: {
query: getSkinStylePageList,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: '皮肤编码',
prop: 'code'
},
{
title: '皮肤名称',
prop: 'name'
},
{
title: '原点坐标',
prop: 'origin',
type: 'tag',
columnValue: (row) => { return `(${row.origin.x}, ${row.origin.y})`; },
tagType: () => { return ''; }
},
{
title: 'Link宽度',
prop: 'linkWidth'
},
{
title: '区段宽度',
prop: 'zoneWidth'
},
{
title: '缩放比例',
prop: 'scaling'
},
{
title: '是否显示水印',
prop: 'watermarkShow',
type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.watermarkShow, 'Whether'); },
tagType: (row) => {
return row.forever ? 'success' : 'danger';
}
},
{
type: 'button',
title: '操作',
width: '250',
buttons: [
{
name: '编辑',
handleClick: this.handleEdit,
type: ''
},
{
name: '删除',
handleClick: this.handleDelete,
type: 'danger'
}
]
}
],
actions: [
{ text: '新增', handler: this.handleAdd }
]
}
};
},
created() {
this.loadInitData();
},
methods: {
loadInitData() {
this.prdTypeList = [];
this.$Dictionary.productPostType().then(list => {
this.prdTypeList = list;
});
this.skinStyleList = [];
getSkinStyleList().then(response => {
this.skinStyleList = response.data;
})
},
handleAdd() {
this.$router.push(`${UrlConfig.map.skinStyleDraft}/add/null`);
},
handleEdit(index, row) {
this.$router.push(`${UrlConfig.map.skinStyleDraft}/edit/${row.id}`);
},
handleDelete(index, row) {
this.$confirm('此操作将永久删除该皮肤, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delSkinStyle(row.id).then(() => {
this.$message.success('删除皮肤成功');
}).catch(error => {
this.$messageBox('删除皮肤失败');
})
}).catch(() => {
});
},
reloadTable() {
this.queryList.reload()
}
}
}
</script>
this.skinStyleList = [];
getSkinStyleList().then(response => {
this.skinStyleList = response.data;
});
},
handleAdd() {
this.$router.push(`${UrlConfig.map.skinStyleDraft}/add/null`);
},
handleEdit(index, row) {
this.$router.push(`${UrlConfig.map.skinStyleDraft}/edit/${row.id}`);
},
handleDelete(index, row) {
this.$confirm('此操作将永久删除该皮肤, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delSkinStyle(row.id).then(() => {
this.$message.success('删除皮肤成功');
}).catch(() => {
this.$messageBox('删除皮肤失败');
});
}).catch(() => {
});
},
reloadTable() {
this.queryList.reload();
}
}
};
</script>