This commit is contained in:
fan 2019-08-27 15:22:55 +08:00
commit 75a6b2ee58
14 changed files with 124 additions and 161 deletions

View File

@ -254,7 +254,7 @@ export default {
isCurve: '是否曲线:', isCurve: '是否曲线:',
physicalSegmentName: '物理区段名称:', physicalSegmentName: '物理区段名称:',
directionType: '形式方向:', directionType: '行驶方向:',
leftOrRight: '左右位置:', leftOrRight: '左右位置:',
positionType: '上下位置:', positionType: '上下位置:',
@ -312,7 +312,7 @@ export default {
zzkContent: '站中控内容:', zzkContent: '站中控内容:',
stationControlZok: '中控', stationControlZok: '中控',
stationstandName: '选择车站名称:', stationstandName: '所属车站:',
stationstandDirection: '站台方向:', stationstandDirection: '站台方向:',
stationstandHasDoor: '是否显示屏蔽门:', stationstandHasDoor: '是否显示屏蔽门:',
stationstandNameColon: '站台名称:', stationstandNameColon: '站台名称:',

View File

@ -12,10 +12,22 @@ import grayButtonPic from '@/assets/ibp_images/gray_button.png';
import grayButtonPicOn from '@/assets/ibp_images/gray_button_on.png'; import grayButtonPicOn from '@/assets/ibp_images/gray_button_on.png';
export default class button extends Group { export default class button extends Group {
constructor(device) { static colors = new Map([
['red_on', [redButtonPicOn]],
['red_off', [redButtonPic]],
['green_on', [greenButtonPicOn]],
['green_off', [greenButtonPic]],
['blue_on', [blueButtonPicOn]],
['blue_off', [blueButtonPic]],
['yellow_on', [yellowButtonPicOn]],
['yellow_off', [yellowButtonPic]],
['gray_on', [grayButtonPicOn]],
['gray_off', [grayButtonPic]]
]);
constructor(model) {
super(); super();
this.model = device.model; this.model = model;
this.zlevel = device.model.zlevel; this.zlevel = model.zlevel;
this.create(); this.create();
} }
create() { create() {
@ -33,63 +45,8 @@ export default class button extends Group {
} }
getImagePic() { getImagePic() {
switch (this.model.color) { const color = button.colors.get(`${this.model.color}_${this.model.status}`);
case 'red': { return color[0];
switch (this.model.status) {
case 'on': {
return redButtonPicOn;
}
case 'off': {
return redButtonPic;
}
}
break;
}
case 'green': {
switch (this.model.status) {
case 'on': {
return greenButtonPicOn;
}
case 'off': {
return greenButtonPic;
}
}
break;
}
case 'blue': {
switch (this.model.status) {
case 'on': {
return blueButtonPicOn;
}
case 'off': {
return blueButtonPic;
}
}
break;
}
case 'yellow': {
switch (this.model.status) {
case 'on': {
return yellowButtonPicOn;
}
case 'off': {
return yellowButtonPic;
}
}
break;
}
case 'gray': {
switch (this.model.status) {
case 'on': {
return grayButtonPicOn;
}
case 'off': {
return grayButtonPic;
}
}
break;
}
}
} }
// 设置按钮状态 // 设置按钮状态
@ -116,7 +73,6 @@ export default class button extends Group {
} }
} }
} }
onmousedown(e) { onmousedown(e) {
if (this.model.allowDrag) { if (this.model.allowDrag) {
var x = e.offsetX; var x = e.offsetX;
@ -153,53 +109,13 @@ export default class button extends Group {
} }
// 关闭 // 关闭
close() { close() {
switch (this.model.color) { const color = button.colors.get(`${this.model.color}_off`);
case 'red': { this.imageBg.setStyle({image: color[0]});
this.imageBg.setStyle({image: redButtonPic});
break;
}
case 'green': {
this.imageBg.setStyle({image: greenButtonPic});
break;
}
case 'blue': {
this.imageBg.setStyle({image: blueButtonPic});
break;
}
case 'yellow': {
this.imageBg.setStyle({image: yellowButtonPic});
break;
}
case 'gray': {
this.imageBg.setStyle({image: grayButtonPic});
break;
}
}
} }
// 开放 // 开放
open() { open() {
switch (this.model.color) { const color = button.colors.get(`${this.model.color}_on`);
case 'red': { this.imageBg.setStyle({image: color[0]});
this.imageBg.setStyle({image: redButtonPicOn});
break;
}
case 'green': {
this.imageBg.setStyle({image: greenButtonPicOn});
break;
}
case 'blue': {
this.imageBg.setStyle({image: blueButtonPicOn});
break;
}
case 'yellow': {
this.imageBg.setStyle({image: yellowButtonPicOn});
break;
}
case 'gray': {
this.imageBg.setStyle({image: grayButtonPicOn});
break;
}
}
} }
} }

View File

@ -382,13 +382,13 @@ export const asyncRouter = [
} }
] ]
}, },
// { {
// path: 'ibp/edit', path: 'ibp/edit',
// component: IbpEdit, component: IbpEdit,
// meta: { meta: {
// i18n: 'router.ibpDraw' i18n: 'router.ibpDraw'
// } }
// }, },
{ {
path: 'runPlan', path: 'runPlan',
redirect: '/map/runPlan/view/draft', redirect: '/map/runPlan/view/draft',

View File

@ -7,7 +7,7 @@
</div> </div>
<div class="display-draft"> <div class="display-draft">
<el-button-group> <el-button-group>
<!--<el-button @click="jumpIbp">IBP盘</el-button>--> <el-button @click="jumpIbp">IBP盘</el-button>
<el-button type="jumpjlmap3d" @click="jumpjlmap3d">{{ jl3dname }}</el-button> <el-button type="jumpjlmap3d" @click="jumpjlmap3d">{{ jl3dname }}</el-button>
<template v-if="questId"> <template v-if="questId">
<el-button type="danger" @click="handleQuitQuest">退出剧本</el-button> <el-button type="danger" @click="handleQuitQuest">退出剧本</el-button>

View File

@ -171,14 +171,13 @@ export default {
{ prop: 'code', label: this.$t('map.linkCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.linkList, change: true, deviceChange: this.deviceChange }, { prop: 'code', label: this.$t('map.linkCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.linkList, change: true, deviceChange: this.deviceChange },
{ prop: 'name', label: this.$t('map.linkName'), type: 'input' }, { prop: 'name', label: this.$t('map.linkName'), type: 'input' },
{ prop: 'lp', label: this.$t('map.linkLp'), type: 'coordinate', width: '119px', children: [ { prop: 'lp', label: this.$t('map.linkLp'), type: 'coordinate', width: '119px', children: [
{ prop: 'lp.x', firstLevel: 'lp', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px', disabled: false }, { prop: 'lp.x', firstLevel: 'lp', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px', disabled: false },
{ prop: 'lp.y', firstLevel: 'lp', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px', disabled: false } { prop: 'lp.y', firstLevel: 'lp', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px', disabled: false }
] }, ] },
{ prop: 'rp', label: this.$t('map.linkRp'), type: 'coordinate', width: '119px', children: [ { prop: 'rp', label: this.$t('map.linkRp'), type: 'coordinate', width: '119px', children: [
{ prop: 'rp.x', firstLevel: 'rp', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px', disabled: false }, { prop: 'rp.x', firstLevel: 'rp', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px', disabled: false },
{ prop: 'rp.y', firstLevel: 'rp', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px', disabled: false } { prop: 'rp.y', firstLevel: 'rp', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px', disabled: false }
] }, ] },
{ prop: 'color', label: this.$t('map.linkColor'), type: 'color' },
{ prop: 'leftFdCode', label: this.$t('map.linkLeftFdCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.linkLists }, { prop: 'leftFdCode', label: this.$t('map.linkLeftFdCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.linkLists },
{ prop: 'leftSdCode', label: this.$t('map.linkLeftSdCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.linkLists }, { prop: 'leftSdCode', label: this.$t('map.linkLeftSdCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.linkLists },
{ prop: 'rightFdCode', label: this.$t('map.linkRightFdCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.linkLists }, { prop: 'rightFdCode', label: this.$t('map.linkRightFdCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.linkLists },
@ -202,6 +201,21 @@ export default {
], ],
name: [ name: [
{ required: true, message: this.$t('rules.linkSelectName'), trigger: 'blur' } { required: true, message: this.$t('rules.linkSelectName'), trigger: 'blur' }
],
'lp.x': [
{ required: true, message: this.$t('rules.linkSelectName'), trigger: 'blur' }
],
'lp.y': [
{ required: true, message: this.$t('rules.linkSelectName'), trigger: 'blur' }
],
'rp.x': [
{ required: true, message: this.$t('rules.linkSelectName'), trigger: 'blur' }
],
'rp.y': [
{ required: true, message: this.$t('rules.linkSelectName'), trigger: 'blur' }
],
lengthFact: [
{ required: true, message: this.$t('rules.linkSelectName'), trigger: 'blur' }
] ]
}; };
// //

View File

@ -24,16 +24,6 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('map.directionType')" prop="directionType">
<el-select v-model="addModel.directionType" filterable>
<el-option
v-for="item in SignalDirectionTypeList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('map.leftOrRight')" prop="leftOrRight"> <el-form-item :label="$t('map.leftOrRight')" prop="leftOrRight">
<el-select v-model="addModel.leftOrRight" filterable> <el-select v-model="addModel.leftOrRight" filterable>
<el-option <el-option
@ -44,6 +34,16 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('map.directionType')" prop="directionType">
<el-select v-model="addModel.directionType" filterable>
<el-option
v-for="item in SignalDirectionTypeList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('map.positionType')" prop="positionType"> <el-form-item :label="$t('map.positionType')" prop="positionType">
<el-select v-model="addModel.positionType" filterable> <el-select v-model="addModel.positionType" filterable>
<el-option <el-option
@ -202,7 +202,7 @@ export default {
PhysicalSectionList() { PhysicalSectionList() {
let list = []; let list = [];
if (this.sectionList && this.sectionList.length) { if (this.sectionList && this.sectionList.length) {
list = this.sectionList.filter(elem => { return elem.type === '01'; }); list = this.sectionList.filter(elem => { return elem.type === '01' && !elem.isSwitchSection; });
} }
return list; return list;
}, },

View File

@ -171,7 +171,7 @@ export default {
PhysicalSectionList() { PhysicalSectionList() {
let list = []; let list = [];
if (this.sectionList && this.sectionList.length) { if (this.sectionList && this.sectionList.length) {
list = this.sectionList.filter(elem => { return elem.type === '01'; }); list = this.sectionList.filter(elem => { return elem.type === '01' && !elem.isSwitchSection; });
} }
return list; return list;
}, },

View File

@ -15,7 +15,7 @@
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second"> <el-tab-pane class="view-control" :label="$t('map.newConstruction')" 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" :model="addModel" label-width="120px" size="mini" :rules="makeRules"> <el-form ref="make" :model="addModel" label-width="120px" size="mini" :rules="makeRules">
<el-form-item :label="$t('map.stationName')" 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"

View File

@ -125,10 +125,10 @@ export default {
name: this.$t('map.mapData'), name: this.$t('map.mapData'),
item: [ item: [
{ prop: 'stationCode', label: this.$t('map.equipmentStation'), 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: 'turnTime', label: this.$t('map.turnTime'), type: 'number', min: 0, max: 1000, placeholder: 's' }, { prop: 'turnTime', label: this.$t('map.turnTime'), type: 'number', min: 0, max: 1000, placeholder: 's' }
{ prop: 'sectionACode', label: this.$t('map.sectionACode'), 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: this.$t('map.sectionBCode'), 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: 'sectionCCode', label: this.$t('map.sectionCCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.sectionList }
] ]
} }
} }
@ -229,6 +229,8 @@ export default {
if (node) { if (node) {
const lFdSection = this.findSectionDataByLinkCodeAndPoint(link.leftFdCode, section.points[0]); const lFdSection = this.findSectionDataByLinkCodeAndPoint(link.leftFdCode, section.points[0]);
const lSdSection = this.findSectionDataByLinkCodeAndPoint(link.leftSdCode, section.points[0]); const lSdSection = this.findSectionDataByLinkCodeAndPoint(link.leftSdCode, section.points[0]);
// const cnodeSection = mapDevice[mapDevice[elem.code].sectionACode];
if (lFdSection && lSdSection) { if (lFdSection && lSdSection) {
const model = { const model = {
_type: 'Switch', _type: 'Switch',
@ -249,6 +251,14 @@ export default {
rp: { rp: {
x: lSdSection.points[lSdSection.points.length - 2].x, x: lSdSection.points[lSdSection.points.length - 2].x,
y: lSdSection.points[lSdSection.points.length - 2].y y: lSdSection.points[lSdSection.points.length - 2].y
},
intersection: {
x: section.points[0].x,
y: section.points[0].y
},
skew: {
x: lSdSection.points[lSdSection.points.length - 2].x,
y: lSdSection.points[lSdSection.points.length - 2].y
} }
}; };
@ -287,6 +297,14 @@ export default {
rp: { rp: {
x: rSdSection.points[1].x, x: rSdSection.points[1].x,
y: rSdSection.points[1].y y: rSdSection.points[1].y
},
intersection: {
x: section.points[section.points.length - 1].x,
y: section.points[section.points.length - 1].y
},
skew: {
x: rSdSection.points[1].x,
y: rSdSection.points[1].y
} }
}; };
@ -351,7 +369,7 @@ 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.$t('tip.confirmBatchGeneration'), this.$t('tip.hint'), { this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'), confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'), cancelButtonText: this.$t('tip.cancel'),
type: 'warning' type: 'warning'

View File

@ -24,11 +24,6 @@
<el-form-item :label="$t('map.mapName')" prop="name"> <el-form-item :label="$t('map.mapName')" prop="name">
<el-input v-model="editModel.name" /> <el-input v-model="editModel.name" />
</el-form-item> </el-form-item>
<!-- <el-form-item :label="$t('map.selectCity')" prop="cityCode">
<el-select v-model="editModel.cityCode" :placeholder="$t('map.pleaseSelect')" size="mini">
<el-option v-for="item in cityList" :key="item.code" :label="item.name" :value="item.code" />
</el-select>
</el-form-item> -->
</el-form> </el-form>
</template> </template>
<template v-else> <template v-else>
@ -116,9 +111,6 @@ export default {
], ],
skinCode: [ skinCode: [
{ required: true, message: this.$t('rules.pleaseSelectAssociatedSkin'), trigger: 'change' } { required: true, message: this.$t('rules.pleaseSelectAssociatedSkin'), trigger: 'change' }
],
cityCode: [
{ required: true, message: this.$t('rules.pleaseSelectAssociatedCity'), trigger: 'change' }
] ]
}; };
}, },
@ -152,13 +144,19 @@ export default {
this.initLoadData(); this.initLoadData();
}, },
methods: { methods: {
show() { show(type) {
const dataZoom = this.$store.state.map.dataZoom; const dataZoom = this.$store.state.map.dataZoom;
if (dataZoom && dataZoom.offsetX) { if (type == 'editCode') {
this.updtModel.origin.x = Number.parseInt(dataZoom.offsetX); this.editModel.skinCode = this.editModel.skinCode ? this.editModel.skinCode : '';
this.updtModel.origin.y = Number.parseInt(dataZoom.offsetY); this.editModel.name = this.editModel.name ? this.editModel.name : '';
this.updtModel.scaling = dataZoom.scaleRate; } else if (type == 'editPoint') {
if (dataZoom && dataZoom.offsetX) {
this.updtModel.origin.x = Number.parseInt(dataZoom.offsetX);
this.updtModel.origin.y = Number.parseInt(dataZoom.offsetY);
this.updtModel.scaling = dataZoom.scaleRate;
}
} }
this.dialogShow = true; this.dialogShow = true;
}, },
close() { close() {
@ -176,7 +174,7 @@ export default {
save() { save() {
this.loading = true; this.loading = true;
if (this.basicInfo) { if (this.basicInfo) {
this.editModel.id = this.$route.params.mapId; // this.editModel.id = this.$route.params.mapId;
this.$refs['edit'].validate((valid) => { this.$refs['edit'].validate((valid) => {
if (valid) { if (valid) {
updateMap(this.editModel).then(response => { updateMap(this.editModel).then(response => {

View File

@ -117,6 +117,7 @@ export default {
y: e.clientY y: e.clientY
}; };
this.editModel = obj; this.editModel = obj;
this.editModel.skinCode = node.parent.data.id;
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu }); this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu });
} }
}, },
@ -299,7 +300,6 @@ export default {
import('@/utils/Export2Excel').then(excel => { import('@/utils/Export2Excel').then(excel => {
self.queryExportData(resultData).then(data => { self.queryExportData(resultData).then(data => {
excel.export_json_excel(data, resultData.name); excel.export_json_excel(data, resultData.name);
}).catch(error => { }).catch(error => {
self.$message.error('导出执行异常:' + error.message); self.$message.error('导出执行异常:' + error.message);
}); });

View File

@ -114,13 +114,13 @@ export default {
updateObj() { updateObj() {
this.doClose(); this.doClose();
if (this.$refs && this.$refs.edit) { if (this.$refs && this.$refs.edit) {
this.$refs.edit.show(); this.$refs.edit.show('editCode');
} }
}, },
updateObjAxis() { updateObjAxis() {
this.doClose(); this.doClose();
if (this.$refs && this.$refs.axisEdit) { if (this.$refs && this.$refs.axisEdit) {
this.$refs.axisEdit.show(); this.$refs.axisEdit.show('editPoint');
} }
}, },
saveAs() { saveAs() {
@ -144,12 +144,14 @@ export default {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
deleteMap(this.editModel.id).then(response => { deleteMap(this.editModel.id).then(response => {
this.$store.dispatch('map/mapClear').then(() => { if (this.editModel.id == this.$route.params.mapId) {
_that.refresh(); this.$store.dispatch('map/mapClear').then(() => {
_that.$emit('editMap', null); _that.$emit('editMap', null);
_that.$message.success(this.$t('map.successfullyDelete')); _that.$router.push({ path: `${UrlConfig.map.draft}/0/draft` });
_that.$router.push({ path: `${UrlConfig.map.draft}/0/draft` }); });
}); }
_that.refresh();
_that.$message.success(this.$t('map.successfullyDelete'));
}).catch(error => { }).catch(error => {
_that.$message.error(this.$t('map.failDelete') + error.message); _that.$message.error(this.$t('map.failDelete') + error.message);
}); });

View File

@ -6,6 +6,7 @@
label-position="right" label-position="right"
:model="editModel" :model="editModel"
label-width="120px" label-width="120px"
:rules="editRules"
size="mini" size="mini"
@submit.native.prevent @submit.native.prevent
> >
@ -45,6 +46,14 @@ export default {
id: '', id: '',
name: '', name: '',
cityCode: '000000' cityCode: '000000'
},
editRules: {
cityCode: [
{ required: true, message: this.$t('rules.pleaseEnterMapName'), trigger: 'change' }
],
name: [
{ required: true, message: this.$t('rules.pleaseEnterMapName'), trigger: 'blur' }
]
} }
}; };
}, },

View File

@ -6,6 +6,7 @@
label-position="right" label-position="right"
:model="editModel" :model="editModel"
label-width="100px" label-width="100px"
:rules="editRules"
size="mini" size="mini"
@submit.native.prevent @submit.native.prevent
> >
@ -39,6 +40,11 @@ export default {
editModel: { editModel: {
id: '', id: '',
name: '' name: ''
},
editRules: {
name: [
{ required: true, message: this.$t('rules.pleaseEnterMapName'), trigger: 'blur' }
]
} }
}; };
}, },