This commit is contained in:
lVAL 2021-01-25 17:30:27 +08:00
commit 78863b868c
14 changed files with 128 additions and 84 deletions

View File

@ -511,3 +511,12 @@ export function getRunLevelDetail(id) {
method: 'get'
});
}
// 更新站间运行等级数据
export function updateRunlevelDistance(mapId) {
return request({
url: `/api/runPlan/userData/${mapId}/runlevelDistance`,
method: 'put'
});
}

View File

@ -241,7 +241,6 @@ class Jlmap {
const rect = {x: 0, y: 0, width: Number(splitList[i]) + 5, height: opts.height};
rectList.push(rect);
}
console.log(screenList, rectList);
this.$painter.updateTransform1(screenList, rectList);
}
@ -386,6 +385,7 @@ class Jlmap {
}
});
this.$painter.$transformHandle.revisibleAll();
this.$painter.$transformHandle.setStationFlag(stationCode);
}
showStationHandlePsd(oDevice, stationCode) {
const standDevice = this.mapDevice[oDevice.standCode];

View File

@ -1,10 +1,12 @@
import store from '@/store/index';
import {createTransform, createBoundingRect} from './utils/parser';
class TransformHandle {
constructor(painter) {
this.$painter = painter;
this.stationFlag = false;
this.parentLevel = painter.getParentLevel();
this.rect = { x: 0, y: 0, width: 0, height: 0 };
@ -25,16 +27,46 @@ class TransformHandle {
}
view.dirty();
}
setStationFlag(stationCode) {
this.stationFlag = !!stationCode;
}
// 视图进行缩放/平移
transformView(view) {
if (view) {
view.transform = this.transform;
if (this.stationFlag) {
this.handleStationShow(view);
}
view.decomposeTransform();
this.revisibleView(view);
}
}
handleStationShow(view) {
if (view.model && view.model._type === 'Station') {
const station = view.model;
this.handleStationViewTransform(view, station);
} else if (view.model && view.model._type === 'StationStand') {
const station = store.getters['map/getDeviceByCode'](view.model.stationCode);
this.handleStationViewTransform(view, station);
} else if (view.model && view.model._type === 'Psd') {
const stand = store.getters['map/getDeviceByCode'](view.model.standCode);
const station = store.getters['map/getDeviceByCode'](stand.stationCode);
this.handleStationViewTransform(view, station);
} else if (view.model && (view.model.belongStation || view.model.belongStationCode)) {
const belongStation = view.model.belongStation || view.model.belongStationCode;
const station = store.getters['map/getDeviceByCode'](belongStation);
this.handleStationViewTransform(view, station);
}
}
handleStationViewTransform(view, station) {
if (station.foldLine) {
view.transform = createTransform({
scaleRate: this.$painter.$jmap.$options.scaleRate,
offsetX: this.$painter.$jmap.$options.offsetX + station.foldLineOffset.x * this.$painter.$jmap.$options.scaleRate,
offsetY: this.$painter.$jmap.$options.offsetY - station.foldLineOffset.y * this.$painter.$jmap.$options.scaleRate
});
}
}
// 处理所有视图缩放/平移
transformAll() {
this.traverse(this.transformView, this);

View File

@ -1,7 +1,7 @@
<template>
<div class="view-control">
<div class="content-box">
<el-tabs v-model="activeName" type="card" @tab-click="handleClick">
<el-tabs v-model="activeName" type="card">
<el-tab-pane label="批量设置集中站" name="first">
<div class="select-box">
<el-select v-model="stationCode" filterable size="mini">
@ -35,7 +35,7 @@
</div>
</el-tab-pane>
</el-tabs>
<div v-for="item in showList" :key="item.type" class="content-box-list" style="margin-top: 10px;">
<div v-for="item in modelList" :key="item.type" class="content-box-list" style="margin-top: 10px;">
<div class="title-box">{{ item.name }}</div>
<div class="list-box">
<div v-for="nor in item.list" :key="nor.code" class="list-content" @mouseenter="mouseenter(nor)" @mouseleave="mouseleave(nor)">
@ -69,7 +69,6 @@ export default {
stationCode: '',
belongStationCode: '',
activeName: 'first',
showList: [],
modelList: [
{
type: 'Section',
@ -86,13 +85,6 @@ export default {
name: '信号机列表',
list: []
}
],
modelSignalList: [
{
type: 'Signal',
name: '信号机列表',
list: []
}
]
};
},
@ -116,13 +108,6 @@ export default {
// this.$emit('setCenter', code);
// this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
// },
handleClick() {
if (this.activeName === 'first') {
this.showList = this.modelList;
} else {
this.showList = this.modelSignalList;
}
},
deviceSelect(selected) {
if (selected && selected._type.toUpperCase() == 'CheckBox'.toUpperCase()) {
this.activeName = 'first';
@ -137,7 +122,6 @@ export default {
this.modelList[1].list.push(item);
} else if (item._type == 'Signal') {
this.modelList[2].list.push(item);
this.modelSignalList[0].list.push(item);
}
if (item.stationCode == this.seclectDeviceList[0].stationCode) {
count++;
@ -149,15 +133,12 @@ export default {
this.stationCode = '';
}
this.belongStationCode = this.stationList[0].code;
this.showList = this.modelList;
}
},
clearModelList() {
this.showList = [];
this.modelList.forEach(item => {
item.list = [];
});
this.modelSignalList[0].list = [];
},
//
delList(model, list) {
@ -196,23 +177,35 @@ export default {
}
},
handleBelongStationCode() {
if (this.belongStationCode && this.modelSignalList[0].list.length) {
if (this.belongStationCode && this.seclectDeviceList && this.seclectDeviceList.length > 0) {
const models = [];
this.modelSignalList[0].list.forEach(item => {
this.modelList.forEach(model => { //
model.list.forEach(item => {
const Model = deepAssign({}, this.$store.getters['map/getDeviceByCode'](item.code));
if (Model._type == 'Section') {
Model.belongStation = this.belongStationCode;
} else {
Model.belongStationCode = this.belongStationCode;
}
if (Model._type == 'Section' && Model.logicSectionCodeList && Model.logicSectionCodeList.length) {
Model.logicSectionCodeList.forEach(children => {
const ModelChild = deepAssign({}, this.$store.getters['map/getDeviceByCode'](children));
ModelChild.belongStation = this.belongStationCode;
models.push(ModelChild);
});
}
models.push(Model);
});
});
this.$emit('updateMapModel', models);
this.$message.success('设置所属车站成功!');
this.belongStationCode = '';
this.$message.success('设置所属车站成功');
this.stationCode = '';
}
},
clearList() { //
this.stationCode = '';
this.belongStationCode = '';
this.$store.commit('map/setSeclectDeviceList', []);
this.showList = [];
this.modelList = [
{
type: 'Section',
@ -230,13 +223,6 @@ export default {
list: []
}
];
this.modelSignalList = [
{
type: 'Signal',
name: '信号机列表',
list: []
}
];
},
mouseenter(model) {
if (model._type == 'Section') {

View File

@ -102,6 +102,7 @@ class Model {
this.sectionBCode = '';
this.sectionCCode = '';
this.tp = { x: 0, y: 0 };
this.belongStationCode = '';
}
StationModel() {
this._type = 'Station';
@ -140,6 +141,8 @@ class Model {
this.createTurnBack = false;
// this.turnBackPoint = {x: 0, y: 0}; // 按图折返坐标
this.controlModePoint = { x: 0, y: 0 }; // 控制模式坐标
this.foldLine = false; // 现地显示是否折行
this.foldLineOffset = { x: 0, y: 0 }; // 折行显示偏移
}
StationStandModel() {
this._type = 'StationStand';

View File

@ -205,7 +205,7 @@ export default {
name: this.$t('map.mapData'),
item: [
{ prop: 'stationCode', label: this.$t('map.equipmentStation') + ':', type: 'select', mode: true, optionLabel: 'name&&code', optionValue: 'code', disabled: this.isStationCodeDisabled, options: this.centralizedStationList, isHidden: this.isStationCodeDisabled },
{ prop: 'belongStation', label: '所属车站:', type: 'select', mode: true, optionLabel: 'name&&code', optionValue: 'code', options: this.stationList, isHidden: !this.editModel.standTrack && !this.editModel.reentryTrack && !this.editModel.transferTrack },
{ prop: 'belongStation', label: '所属车站:', type: 'select', mode: true, optionLabel: 'name&&code', optionValue: 'code', options: this.stationList},
{ prop: 'lengthFact', label: this.$t('map.actualLength') + ':', type: 'number', min: 0, placeholder: this.$t('map.meter'), disabled: this.isStationCodeDisabled, isHidden: !this.isSwitchSectionType || !this.isCrossSectionType, button:true, clickFunction: this.divideLength, buttonText: '均分长度' },
{ prop: 'logicLengthList', label: '逻辑区段实际长度:', type: 'lengthFact', isHidden: !this.isHasLogicPhysicalSection, mergeLength: this.mergeLength, width: '160px'},
{ prop: 'leftStopPointOffset', label: this.$t('map.leftStopPointOffset'), type: 'number', min: 0, max: this.maxLengthFact, isHidden: !this.isStopPointOffset }, //
@ -228,6 +228,13 @@ export default {
callback();
}
};
var validateBelongStation = (rule, value, callback) => {
if ((this.editModel.transferTrack || this.editModel.reentryTrack || this.editModel.standTrack) && !value) {
callback(new Error( '请选择所属车站' ));
} else {
callback();
}
};
const rules = {
code: [
{ required: true, message: this.$t('rules.selectEquipment'), trigger: 'change' }
@ -263,7 +270,7 @@ export default {
{ required: true, message: this.$t('rules.sectionRelSwitchCode'), trigger: 'change' }
],
belongStation: [
{ required: true, message: '请选择所属车站', trigger: 'change' }
{ validator: validateBelongStation, trigger: 'change' }
],
leftSectionCode: [
{ validator: validateAssociatedSection, trigger: 'change' }
@ -544,7 +551,6 @@ export default {
this.$message('还有属性未填写,修改未生效!');
this.$emit('deviceSelect', '');
}
// debugger;
});
},
handleRelevanceStand(model) { //
@ -570,6 +576,7 @@ export default {
if (section.parentCode == model.code && section.type == '02') { //
const copySection = deepAssign({}, section);
copySection.stationCode = model.stationCode; //
copySection.belongStation = model.belongStation;
copySection.lengthFact = logicLengthMap[copySection.code];
if (this.checkPointsCoincide(this.oldPoint[0], copySection.points[0])) {
copySection.points[0] = model.points[0];

View File

@ -217,7 +217,12 @@ export default {
{ prop: 'relStationCodeList', label: '联锁站关联车站:', type: 'multiSelect', optionLabel: 'name', optionValue: 'code', options: this.relStationList, isHidden: !this.idCiStation},
{ prop: 'routingStationList', label: '生成交路的车站:', type: 'multiSelectHover', optionLabel: 'name', optionValue: 'code', options: this.stationList, hover: this.hover, buttonType: 'routingStation', buttonShowType: this.routingStationButtonShow },
{ prop: 'runPlanName', label: this.$t('map.stationRunPlanName'), type: 'input' },
{ prop: 'jp', label: '车站简称', type: 'input' }
{ prop: 'jp', label: '车站简称:', type: 'input' },
{ prop: 'foldLine', label: '现地显示是否折行:', type: 'checkbox' },
{ prop: 'foldLineOffset', label: '折行偏移:', type: 'coordinate', width: '120px', isHidden: !this.editModel.foldLine, children: [
{ prop: 'foldLineOffset.x', firstLevel: 'foldLineOffset', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px'},
{ prop: 'foldLineOffset.y', firstLevel: 'foldLineOffset', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] }
]
}
}

View File

@ -56,6 +56,7 @@ export default {
name: this.$t('map.mapData'),
item: [
{ prop: 'stationCode', label: this.$t('map.equipmentStation'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.centralizedStationList },
{ prop: 'belongStationCode', label: '所属车站', 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' }
]
}

View File

@ -71,8 +71,8 @@
</el-table-column>
<el-table-column prop="distance" :label="$t('planMonitor.modifying.distance')" width="85">
<template slot-scope="scope">
<!-- <span style="margin-left: 10px">{{ scope.row.distance }}</span> -->
<el-input v-model="scope.row.distance" class="input_text_box" />
<span style="margin-left: 10px">{{ scope.row.distance }}</span>
<!-- <el-input v-model="scope.row.distance" class="input_text_box" /> -->
</template>
</el-table-column>
<div>
@ -105,6 +105,7 @@
</el-table>
</el-row>
<div class="button-group" style="text-align: center; margin-top: 10px;">
<el-button @click="handleStationDistance">更新距离</el-button>
<el-button @click="doClose">关闭</el-button>
<el-button @click="handleStationTime">更新</el-button>
</div>
@ -112,7 +113,7 @@
</template>
<script>
import { formatName } from '@/utils/runPlan';
import { setStationRunning, getMapStationRunUser } from '@/api/runplan';
import { setStationRunning, getMapStationRunUser, updateRunlevelDistance } from '@/api/runplan';
export default {
name: 'ModifyingStationIntervalTime',
@ -189,6 +190,14 @@ export default {
this.$messageBox(this.$t('planMonitor.modifying.modifyFailed'));
});
},
handleStationDistance() {
updateRunlevelDistance(this.$route.query.mapId).then(resp => {
this.loadInitData();
this.$message.success('更新成功');
}).catch(() => {
this.$messageBox('更新失败');
});
},
doShow(params) {
this.params = params || {};
this.loadInitData();

View File

@ -23,8 +23,8 @@ export default {
dialogVisible: false,
formModel: {
address: '',
name: '',
phone: '',
// name: '',
// phone: '',
id: '',
projectCode: ''
},
@ -37,8 +37,8 @@ export default {
labelWidth: '100px',
items: [
{ prop: 'name', label: '名称', type: 'text' },
{ prop: 'phone', label: '电话', type: 'text' },
{ prop: 'address', label: '地址', type: 'text' },
// { prop: 'phone', label: '', type: 'text' },
// { prop: 'address', label: '', type: 'text' },
{ prop: 'projectCode', label: '关联项目', type: 'select', options: this.projectListNew}
]
};
@ -50,12 +50,12 @@ export default {
{ required: true, message: '请输入单位名称', trigger: 'blur' },
{ min: 1, max: 25, message: this.$t('rules.strLength1To25'), trigger: 'blur' }
],
phone: [
{ required: true, message: '请输入公司电话', trigger: 'blur' }
],
address:[
{ required: true, message: '请输入公司地址', trigger: 'blur'}
],
// phone: [
// { required: true, message: '', trigger: 'blur' }
// ],
// address:[
// { required: true, message: '', trigger: 'blur'}
// ],
projectCode: [
{ required: true, message: '请选择关联项目', trigger: 'change'}
]
@ -74,8 +74,6 @@ export default {
this.update = true;
this.formModel = {
id: data.id,
name: data.name,
phone: data.phone,
address: data.address,
projectCode: data.projectCode
};
@ -86,8 +84,6 @@ export default {
this.update = false;
this.formModel = {
address: '',
name: '',
phone: '',
id: '',
projectCode: ''
};

View File

@ -40,14 +40,14 @@ export default {
title: '单位名称',
prop: 'name'
},
{
title: '单位电话',
prop: 'phone'
},
{
title: '单位地址',
prop: 'address'
},
// {
// title: '',
// prop: 'phone'
// },
// {
// title: '',
// prop: 'address'
// },
{
title: '关联项目',
prop: 'projectCode',
@ -55,13 +55,13 @@ export default {
columnValue: (row) => { return this.projectMap[row.projectCode]; },
tagType: (row) => { return 'success'; }
},
{
title: '单位管理人员',
prop: 'managerNames',
type: 'tagMore',
columnValue: (row) => { return row.managerNames; },
tagType: (row) => { return 'success'; }
},
// {
// title: '',
// prop: 'managerNames',
// type: 'tagMore',
// columnValue: (row) => { return row.managerNames; },
// tagType: (row) => { return 'success'; }
// },
{
type: 'button',
title: this.$t('global.operate'),

View File

@ -1,5 +1,5 @@
<template>
<el-dialog v-dialogDrag title="绑定单位" :visible.sync="dialogVisible" width="30%" :before-close="doClose" center :close-on-click-modal="false">
<el-dialog v-dialogDrag title="绑定单位管理员" :visible.sync="dialogVisible" width="30%" :before-close="doClose" center :close-on-click-modal="false">
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="doCreate">{{ $t('global.confirm') }}</el-button>
@ -72,7 +72,7 @@ export default {
this.doClose();
this.$emit('create');
}).catch((error) => {
this.$message.error('绑定单位失败: ' + error.message);
this.$message.error('绑定单位管理员失败: ' + error.message);
});
}
}

View File

@ -27,7 +27,6 @@ export default {
formModel: {
id: '',
name: '',
companyId: '',
roles: []
}
};
@ -38,8 +37,7 @@ export default {
labelWidth: '100px',
items: [
{ prop: 'name', label: this.$t('system.name'), type: 'text', disabled: true },
{ prop: 'roles', label: this.$t('system.permission'), type: 'select', required: true, options: this.$ConstSelect.roleList, multiple: true },
{ prop: 'companyId', label: '单位', type: 'select', options: this.companyList, clearable: true }
{ prop: 'roles', label: this.$t('system.permission'), type: 'select', required: true, options: this.$ConstSelect.roleList, multiple: true }
]
};
return form;
@ -66,7 +64,6 @@ export default {
this.formModel = {
id: data.id,
name: data.name,
companyId: data.companyId,
roles: data.roles
};
}
@ -91,7 +88,6 @@ export default {
this.formModel = {
id: '',
name: '',
companyId: '',
roles: []
};
this.$refs.dataform.resetForm();

View File

@ -92,7 +92,7 @@ export default {
handleClick: this.handleUserEdit
},
{
name: '绑定单位',
name: '绑定单位管理员',
handleClick: this.handleBind
}
]