This commit is contained in:
fan 2020-05-09 17:32:29 +08:00
commit d761c287af
7 changed files with 24 additions and 9 deletions

File diff suppressed because one or more lines are too long

View File

@ -14,7 +14,7 @@ class TransformHandle {
}
checkVisible(view) {
return createBoundingRect(view).intersect(this.rect);
return createBoundingRect(view).intersect(this.rect); // 判断是否相交
}
// 视图进行缩放/平移

View File

@ -219,7 +219,9 @@ export function parser(data, skinCode, showConfig) {
if (cnodeSection && lnodeSection && rnodeSection) {
cnodeSection['switch'] = lnodeSection['switch'] = rnodeSection['switch'] = mapDevice[elem.code];
const sectionParent = mapDevice[cnodeSection.parentCode];
sectionParent['switch'] = mapDevice[elem.code];
if (sectionParent) {
sectionParent['switch'] = mapDevice[elem.code];
}
if (cnodeSection.points[0].x == lnodeSection.points[lnodeSection.points.length - 1].x && cnodeSection.points[0].y == lnodeSection.points[lnodeSection.points.length - 1].y) {
mapDevice[elem.code].intersection = {
x: cnodeSection.points[0].x,

View File

@ -5,7 +5,7 @@
<el-input v-model="form.code" :disabled="true" />
</el-form-item>
<el-form-item label="图形宽度" prop="width">
<el-input-number v-model="form.width" :min="20" />
<el-input-number v-model="form.width" :min="15" />
</el-form-item>
<el-form-item label="方向" prop="direction">
<el-select v-model="form.direction" placeholder="请选择类型">

View File

@ -78,6 +78,9 @@
/>
</el-select>
</el-form-item>
<el-form-item v-if="!editShow" label="是否生成回路" prop="withLoop">
<el-checkbox v-model="addModel.withLoop" />
</el-form-item>
<el-form-item :label="$t('map.remarksColon')" prop="description">
<el-input v-model="addModel.description" type="textarea" :rows="4" :placeholder="$t('map.pleaseSelect')" />
</el-form-item>
@ -213,6 +216,7 @@ export default {
name: '',
mapId: '',
code: '',
withLoop:false,
right: true,
destinationCode: '',
startStationCode: '',
@ -537,6 +541,7 @@ export default {
},
buildModel(code) {
const model = Object.assign({}, this.addModel);
if (model.withLoop) { model.withLoop = true; } else { model.withLoop = false; }
model['mapId'] = this.mapInfo.id;
if (code) { model['code'] = code; }
return model;
@ -549,8 +554,8 @@ export default {
this.$message.success(this.$t('tip.pathCreationSuccessful'));
this.loading = false;
this.clear();
}).catch(() => {
this.$messageBox(this.$t('tip.createRoutingFailed'));
}).catch((error) => {
this.$messageBox(this.$t('tip.createRoutingFailed') + ':' + error.message);
this.loading = false;
});
}
@ -560,12 +565,14 @@ export default {
this.$refs.form.validate((valid) => {
if (valid) {
this.loading = true;
updateRoutingData(this.buildModel()).then(resp => {
const data = this.buildModel();
delete data.withLoop;
updateRoutingData(data).then(resp => {
this.$message.success(this.$t('tip.pathUpdataSuccessful'));
this.loading = false;
this.clear();
}).catch(() => {
this.$messageBox(this.$t('tip.pathUpdataFailed'));
}).catch((error) => {
this.$messageBox(this.$t('tip.pathUpdataFailed') + ':' + error.message);
this.loading = false;
});
@ -587,6 +594,8 @@ export default {
selectedList.forEach(each=>{
const section = this.$store.getters['map/getDeviceByCode'](each.sectionCode);
const list = section.logicSectionCodeList;
// if()
// relSwitchCode
if (list.length > 0) {
list.forEach(logicSectionCode=>{
const logicSection = this.$store.getters['map/getDeviceByCode'](logicSectionCode);
@ -629,6 +638,7 @@ export default {
this.isStartSelected = false;
this.editShow = false;
this.field = '';
this.addModel.withLoop = false;
}
}
}

View File

@ -171,6 +171,7 @@ export default {
logicSectionNum: [],
logicSectionShow: model.logicSectionShow,
stationCode: model.stationCode,
destinationCode: '', //
sepTypeLeft: '00',
sepTypeRight: '00',
trainPosType: model.trainPosType,

View File

@ -333,6 +333,8 @@ export default {
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
this.editModel.rotate = selected.rotate || 0; //
this.editModel.type = selected.type || '';
this.editModel.interlockStationCode = selected.interlockStationCode || '';
if (!selected.positionPoint) {
this.editModel.positionPoint.x = 0;
this.editModel.positionPoint.y = 0;