This commit is contained in:
joylink_cuiweidong 2019-11-07 15:55:02 +08:00
commit 6102c29116
17 changed files with 3357 additions and 3179 deletions

View File

@ -544,5 +544,6 @@ export default {
horizontal: 'Horizontal',
vertical: 'Vertical',
piece: 'piece'
piece: 'piece',
setStationCode: 'Batch set up centralized station'
};

View File

@ -36,6 +36,8 @@ export default {
sectionRelSwitchCode: 'sectionRelSwitchCode',
pleaseSelectSectionName: 'Select the section name',
pleaseSelectSection: 'Select the section',
pleaseSelectStationCode: 'Select the section station code',
pleaseFillOffset: 'Please fill in the offset',
pleaseFillValue: 'Please fill in the value',
pleaseSelectLeftSectionName: 'Please select the left section name',

View File

@ -539,6 +539,7 @@ export default {
horizontal: '水平',
vertical: '垂直',
piece: 'piece'
piece: 'piece',
setStationCode: '批量设置集中站'
};

View File

@ -34,6 +34,8 @@ export default {
basisLink: '基础Link:',
pleaseSelectSectionName: '请选择区段名称',
pleaseSelectSection: '请选择区段',
pleaseSelectStationCode: '请选择设备集中站',
pleaseFillOffset: '请填写偏移量',
pleaseFillValue: '请填写数值',
pleaseSelectLeftSectionName: '请选择左侧区段名称',

View File

@ -260,6 +260,14 @@ class SkinCode extends defaultStyle {
},
arrow: {
show: true // 控制模式箭头显隐
},
mouseOverStyle: { // 鼠标悬浮样式
fontSize: 10,
fontFormat: 'consolas',
fontColor: '#FFF000',
fontWeight: 'normal',
textAlign: 'middle',
textVerticalAlign: 'top'
}
};
@ -319,11 +327,71 @@ class SkinCode extends defaultStyle {
lineColor: '#FFFFFF' // 线条颜色
};
this[deviceType.LcControl] = {};
this[deviceType.LcControl] = {
text: {
fontSize: 10, // 灯字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
lamp: {
radiusR: 6, // 灯大小
controlColor: '#FFFF00' // 灯颜色
},
mouseOverStyle: {
fontSize: 10,
fontFormat: 'consolas',
fontColor: '#FFF000',
fontWeight: 'normal',
textAlign: 'middle',
textVerticalAlign: 'top',
arcColor: '#00FFFF',
textColor: '#000000'
}
};
this[deviceType.ZcControl] = {};
this[deviceType.ZcControl] = {
text: {
fontSize: 10, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
lamp: {
radiusR: 6, // 灯大小
controlColor: '#00FF00' // 灯颜色
},
mouseOverStyle: {
fontSize: 10,
fontFormat: 'consolas',
fontColor: '#FFF000',
fontWeight: 'normal',
textAlign: 'middle',
textVerticalAlign: 'top',
arcColor: '#00FFFF',
textColor: '#000000'
}
};
this[deviceType.LimitControl] = {};
this[deviceType.LimitControl] = {
text: {
fontSize: 10, // 字体大小
fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离
},
lamp: {
radiusR: 6, // 灯大小
controlColor: '#ECE9D8' // 灯颜色
},
mouseOverStyle: {
fontSize: 10,
fontFormat: 'consolas',
fontColor: '#FFF000',
fontWeight: 'normal',
textAlign: 'middle',
textVerticalAlign: 'top',
textColor: '#000000',
arcColor: '#00FFFF'
}
};
this[deviceType.TrainWindow] = {
lineColor: '#4DD43F', // 车次窗颜色

View File

@ -48,8 +48,7 @@ OperateHandler.prototype = {
*/
validate: function (operate) {
// 按钮操作之后,第二步错误操作菜单的情况,需要直接返回
if ((this.operates.length && operate.start === true) &&
(this.operates[0].type === 'mbm')) {
if ((this.operates.length && operate.start === true) && (this.operates[0].type === 'mbm')) {
return false;
}

View File

@ -2,7 +2,7 @@ import deviceType from '@/jmap/constant/deviceType';
import { parser, updateMapData } from '@/jmap/utils/parser';
import Vue from 'vue';
import { deepAssign } from '@/utils/index';
// import { deepClone } from '@/utils/index';
/**
* 查询向上受影响的Devices
* @param {Object} map
@ -240,7 +240,7 @@ function revocation(state, models) {
break;
}
case 'edit': {
list.push({ operation: 'edit', data: deepAssign({}, state.mapDevice[item.data.code])});
list.push({ operation: 'edit', data: deepAssign({}, state.mapDevice[item.data.code] || item.data)});
stepList.push({...item.data, _dispose: false});
break;
}
@ -268,7 +268,7 @@ function recover(state, models) {
break;
}
case 'edit': {
list.push({ operation: 'edit', data: deepAssign({}, state.mapDevice[item.data.code])});
list.push({ operation: 'edit', data: deepAssign({}, state.mapDevice[item.data.code] || item.data)});
stepList.push({...item.data, _dispose: false});
break;
}

View File

@ -158,7 +158,6 @@ export default {
save() {
this.loading = true;
if (this.basicInfo) {
// this.editModel.id = this.$route.params.mapId;
this.$refs['edit'].validate((valid) => {
if (valid) {
updateMap(this.editModel).then(response => {

View File

@ -17,6 +17,7 @@ import MapEdit from './edit';
import MapSaveAs from './saveAs';
import MapPublish from './publish';
import { mapGetters } from 'vuex';
import { saveMap } from '@/api/jmap/mapdraft';
export default {
name: 'MapOperateMenu',
@ -47,10 +48,10 @@ export default {
label: this.$t('map.updateObj'),
handler: this.updateObj
},
// {
// label: this.$t('map.updateObjAxis'),
// handler: this.updateObjAxis
// },
{
label: this.$t('map.updateObjAxis'),
handler: this.updateObjAxis
},
{
label: this.$t('map.saveAs'),
handler: this.saveAs
@ -69,7 +70,15 @@ export default {
handler: this.publish
},
menuNormal: [],
menu: []
menu: [],
updtModel: {
code: '',
scaling: '',
origin: {
x: '',
y: ''
}
}
};
},
computed: {
@ -124,12 +133,45 @@ export default {
this.$refs.edit.show('editCode');
}
},
// updateObjAxis() {
// this.doClose();
// if (this.$refs && this.$refs.axisEdit) {
// this.$refs.axisEdit.show('editPoint');
// }
// },
updateObjAxis() {
this.doClose();
this.getMapOrigin();
this.$confirm('您确认按当前绘图位置更新坐标及缩放比例?', this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
type: 'warning'
}).then(() => {
const map = this.$store.state.map.map;
this.$store.dispatch('map/saveMapDeviceDefaultRelations').then(() => {
const param = {
mapId: this.$route.params.mapId,
skinVO: {
code: this.$store.state.map.map.skinVO.code,
name: this.$store.state.map.map.skinVO.name,
origin: {
x: this.updtModel.origin.x,
y: this.updtModel.origin.y
},
scaling: this.updtModel.scaling
}
};
saveMap(Object.assign(map, param)).then(response => {
this.$message.success(this.$t('map.updateSuccessfully'));
}).catch(() => {
this.$messageBox(this.$t('map.updateFailed'));
});
});
}).catch(() => { });
},
getMapOrigin() {
const dataZoom = this.$store.state.map.dataZoom;
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;
}
},
saveAs() {
this.doClose();
if (this.$refs && this.$refs.saveAs) {

View File

@ -20,9 +20,7 @@
<div style="height: calc(100% - 46px);">
<el-scrollbar wrap-class="scrollbar-wrapper">
<el-card v-if="questionList.length" class="box-card">
<div v-for="(item, index) in questionList" :key="index" class="text item">
{{ item }}
</div>
<div v-for="(item, index) in questionList" :key="index" class="text item">{{ item }}</div>
</el-card>
</el-scrollbar>
</div>
@ -134,9 +132,9 @@
</el-button-group>
</div>
</el-tab-pane>
<el-tab-pane class="view-control" label="批量删除" name="five">
<div class="link_box_select">
<span style="margin-right: 12px;">选择link:</span>
<el-tab-pane class="view-control" label="批量操作" name="five">
<el-form ref="oprt" label-width="130px" size="mini">
<el-form-item label="选择link:">
<el-select v-model="linkCode" filterable multiple size="mini">
<el-option
v-for="item in linkList"
@ -145,10 +143,45 @@
:value="item.code"
/>
</el-select>
</div>
<div class="flex_box">
</el-form-item>
<el-form-item>
<el-button-group>
<el-button type="primary" @click="delRelevanceSection">删除link相关元素</el-button>
</div>
</el-button-group>
</el-form-item>
</el-form>
<el-form ref="operationModel" :model="operationModel" label-width="130px" size="mini" :rules="operationRules">
<el-form-item :label="$t('map.sectionData') + ':'" prop="sectionList">
<el-select v-model="operationModel.sectionList" filterable multiple>
<el-option
v-for="item in PhysicalSectionList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
<el-button
:type="field === 'handleSection' ? 'danger' : 'primary'"
size="small"
@click="hover('handleSection')"
>{{ $t('map.activate') }}</el-button>
</el-form-item>
<el-form-item :label="$t('map.equipmentStation')" prop="stationCode">
<el-select v-model="operationModel.stationCode" filterable>
<el-option
v-for="item in stationList"
:key="item.code"
:label="item.name + item.code"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button-group>
<el-button type="primary" @click="handleScetionStationCode">{{ $t('map.setStationCode') }}</el-button>
</el-button-group>
</el-form-item>
</el-form>
</el-tab-pane>
</el-tabs>
</template>
@ -233,6 +266,10 @@ export default {
trainPosType: '', //
splitOffsetMax: 15
},
operationModel: { //
sectionList: [],
stationCode: ''
},
mergeModel: {
lsectioncode: '',
rsectioncode: ''
@ -264,6 +301,14 @@ export default {
pointY: [
{ required: true, message: this.$t('rules.pleaseEnterYValue'), trigger: 'blur' }
]
},
operationRules: {
sectionList: [
{ required: true, message: this.$t('rules.pleaseSelectSection'), trigger: 'change' }
],
stationCode: [
{ required: true, message: this.$t('rules.pleaseSelectStationCode'), trigger: 'change' }
]
}
};
},
@ -586,6 +631,11 @@ export default {
this.activeName = 'three';
this.field = '';
this.$emit('fieldSelect', '');
} else if (this.field.toUpperCase() === 'handleSection'.toUpperCase()) {
this.operationModel.sectionList.push(selected.code);
this.activeName = 'five';
// this.field = '';
// this.$emit('fieldSelect', '');
}
}
}
@ -607,7 +657,7 @@ export default {
handleDelete(index, row) {
row.num = 0;
},
//
//
addLogicalSection(model, points, index, middleOffset) {
const data = {
_type: 'Section',
@ -660,7 +710,7 @@ export default {
};
return data;
},
//
//
createLogicalSections(num, beg, end, model, counts) {
const models = [];
const triangle = new JTriangle(beg, end);
@ -678,7 +728,6 @@ export default {
//
editSectionNum() {
let models = [];
// const remove = [];
let counts = 0;
const logicSectionNumList = [];
const sectionPoints = [...this.editModel.points]; //
@ -687,9 +736,8 @@ export default {
logicSectionNumList.push(Number(ele.num));
counts += parseInt(ele.num);
});
this.sectionList.forEach(section => {
this.sectionList.forEach(section => { //
if (section.type === '02' && section.parentCode == this.editModel.code) {
// remove.push(section);
models.push(deepAssign(section, {_dispose: true}));
}
});
@ -697,8 +745,6 @@ export default {
this.editModel.logicSectionNum = [...logicSectionNumList];
models.push(this.editModel);
this.activeName = 'first';
// this.$emit('addOrUpdateMapModel', models);
// this.$emit('delMapModel', remove);
this.$emit('updateMapModel', models);
},
addPoint(index) {
@ -710,9 +756,6 @@ export default {
this.editModel.points.splice(index, 1);
this.logicSectionNums.splice(index, 1);
},
filterLinks(query, item) {
return item.pinyin.indexOf(query) > -1;
},
// link
checkLinkList() {
this.questionList = [];
@ -720,7 +763,7 @@ export default {
if (item.leftFdCode) {
if (item.leftSdCode) {
item.create = true;
} else if (!item.leftSdCode) {
} else {
const selected = this.$store.getters['map/getDeviceByCode'](item.leftFdCode);
if (selected.rightFdCode && selected.rightSdCode) {
item.create = true;
@ -732,7 +775,7 @@ export default {
} else if (item.rightFdCode) {
if (item.rightSdCode) {
item.create = true;
} else if (!item.rightSdCode) {
} else {
const selected = this.$store.getters['map/getDeviceByCode'](item.rightFdCode);
if (selected.leftFdCode && selected.leftSdCode) {
item.create = true;
@ -748,7 +791,6 @@ export default {
//
create() {
const models = [];
// const remove = [];
if (this.checkLinkList()) {
this.linkList.forEach(link => {
let count = 0;
@ -832,10 +874,8 @@ export default {
const sectionList = this.findSectionListDataByLinkCode(link.code);
if (sectionList) {
sectionList.forEach(section => {
// remove.push({ _dispose: true, _type: 'Section', code: section.code });
models.push(deepAssign({ _type: 'Section', code: section.code }, { _dispose: true }));
if (section.type === '02' && section.parentCode) {
// remove.push(section);
models.push(deepAssign(section, { _dispose: true }));
}
});
@ -849,7 +889,6 @@ export default {
cancelButtonText: this.$t('tip.cancel'),
type: 'warning'
}).then(() => {
// _that.$emit('updateMapModel', remove);
if (models.length) {
_that.$emit('updateMapModel', models);
} else {
@ -905,7 +944,13 @@ export default {
},
//
deleteObj() {
const models = [];
const switchList = [];
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
this.switchList.forEach(switchEle => {
selected.relSwitchCode == switchEle.code && switchList.push(this.$store.getters['map/getDeviceByCode'](switchEle.code));
});
this.delSectionSwitch(switchList, models);
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
const _that = this;
this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
@ -913,10 +958,9 @@ export default {
cancelButtonText: this.$t('tip.cancel'),
type: 'warning'
}).then(() => {
const models = [];
if (selected.type == '01') {
this.sectionList.forEach(section => {
if (section.parentCode == selected.code) {
if (section.parentCode == selected.code) { //
models.push(deepAssign(section, { _dispose: true }));
}
});
@ -1130,13 +1174,9 @@ export default {
this.sectionList.forEach(section => {
if (section.linkCode == linkCode) {
const selectedSection = this.$store.getters['map/getDeviceByCode'](section.code);
// models.push(selectedSection);
models.push(deepAssign(selectedSection, { _dispose: true }));
this.switchList.forEach(switchEle => {
if (section.relSwitchCode == switchEle.code) {
const selectedSwitch = this.$store.getters['map/getDeviceByCode'](switchEle.code);
switchList.push(selectedSwitch);
}
section.relSwitchCode == switchEle.code && switchList.push(this.$store.getters['map/getDeviceByCode'](switchEle.code));
});
}
});
@ -1146,8 +1186,17 @@ export default {
cancelButtonText: this.$t('tip.cancel'),
type: 'warning'
}).then(async () => {
switchList.forEach((switchs) => {
this.delSectionSwitch(switchList, models);
this.$emit('updateMapModel', models);
this.deviceSelect();
this.linkCode = '';
}).catch(() => {
this.$message.info(this.$t('tip.cancelledDelete'));
});
},
// /
delSectionSwitch(switchList, models) {
switchList.forEach((switchs) => {
this.sectionList.forEach(elem => {
if (elem.type == '03' && elem.relSwitchCode == switchs.code) {
models.push(deepAssign(this.$store.getters['map/getDeviceByCode'](elem.code), { _dispose: true }));
@ -1161,11 +1210,20 @@ export default {
});
models.push(deepAssign(switchs, { _dispose: true }));
});
await this.$emit('updateMapModel', models);
this.deviceSelect();
this.linkCode = '';
}).catch(() => {
this.$message.info(this.$t('tip.cancelledDelete'));
},
//
handleScetionStationCode() {
this.$refs['operationModel'].validate((valid) => {
if (valid) {
const models = [];
this.operationModel.sectionList.forEach(sectionCode => {
const section = deepAssign({}, this.$store.getters['map/getDeviceByCode'](sectionCode));
section.stationCode = this.operationModel.stationCode;
models.push(section);
});
this.$emit('updateMapModel', models);
this.$refs['operationModel'].resetFields();
}
});
}
}
@ -1200,6 +1258,16 @@ export default {
}
.link_box_select{
padding: 10px 20px;
.title{
width: 100px;
display: block;
float: left;
text-align: right;
line-height: 28px;
font-weight: 700;
font-size: 14px;
color: #606266;
}
}
</style>

View File

@ -21,9 +21,7 @@
<div style="height: calc(100% - 46px);">
<el-scrollbar wrap-class="scrollbar-wrapper">
<el-card v-if="questionList.length" class="box-card">
<div v-for="(item, index) in questionList" :key="index" class="text item">
{{ item }}
</div>
<div v-for="(item, index) in questionList" :key="index" class="text item">{{ item }}</div>
</el-card>
</el-scrollbar>
</div>
@ -149,8 +147,6 @@ export default {
this.deviceSelect(val);
}
},
mounted() {
},
methods: {
filterSections(query, item) {
return item.pinyin.indexOf(query) > -1;