This commit is contained in:
joylink_cuiweidong 2022-07-14 13:20:29 +08:00
commit cf10f19b96
11 changed files with 276 additions and 42 deletions

View File

@ -415,15 +415,17 @@ class Jlmap {
updatePicture(list = []) {
list.forEach(item => {
const device = this.mapDevice[item];
if (device) {
if (device && device._type !== deviceType.Switch && device._type !== deviceType.Train) {
const pictureDevice = store.getters['map/getPictureDeviceByCode'](item);
device._dispose = pictureDevice ? pictureDevice.pictureHide : false;
this.$painter.updatePicture(device);
try {
if (device._type === deviceType.Section && device.type === '03') {
this.computedSwitch(device.switch);
this.mapDevice[device.switch.code]._dispose = pictureDevice ? pictureDevice.pictureHide : false;
this.computedSwitch(device.switch);
this.$painter.updatePicture(this.mapDevice[device.switch.code]);
}
} catch (e) { console.error(e); }
}
});
}
@ -437,20 +439,22 @@ class Jlmap {
if (cnodeSection && lnodeSection && rnodeSection) {
let sectionCStar, sectionCEnd;
const rnodeSectionPoint = rnodeSection.instance ? rnodeSection.instance.computedPoints : rnodeSection.points;
const cnodeSectionPoint = cnodeSection.instance ? cnodeSection.instance.computedPoints : cnodeSection.points;
if (this.handleResetPoint(rnodeSection.points)) {
sectionCStar = rnodeSection.instance.computedPoints[rnodeSection.points.length - 2];
sectionCEnd = rnodeSection.instance.computedPoints[1];
sectionCStar = rnodeSectionPoint[rnodeSectionPoint.length - 2];
sectionCEnd = rnodeSectionPoint[1];
} else {
sectionCStar = rnodeSection.instance.computedPoints[1];
sectionCEnd = rnodeSection.instance.computedPoints[rnodeSection.points.length - 2];
sectionCStar = rnodeSectionPoint[1];
sectionCEnd = rnodeSectionPoint[rnodeSectionPoint.length - 2];
}
let intersectionStar, intersectionEnd;
if (this.handleResetPoint(cnodeSection.points)) {
intersectionStar = cnodeSection.instance.computedPoints[0];
intersectionEnd = cnodeSection.instance.computedPoints[cnodeSection.points.length - 1];
intersectionStar = cnodeSectionPoint[0];
intersectionEnd = cnodeSectionPoint[cnodeSectionPoint.length - 1];
} else {
intersectionStar = cnodeSection.instance.computedPoints[cnodeSection.points.length - 1];
intersectionEnd = cnodeSection.instance.computedPoints[0];
intersectionStar = cnodeSectionPoint[cnodeSectionPoint.length - 1];
intersectionEnd = cnodeSectionPoint[0];
}
if (cnodeSection.points[0].x == lnodeSection.points[lnodeSection.points.length - 1].x && cnodeSection.points[0].y == lnodeSection.points[lnodeSection.points.length - 1].y) {
this.mapDevice[switchDevice.code].intersection = {

View File

@ -2,7 +2,7 @@ class Options {
constructor(opts, trigger) {
this.scaleIndex = 0;
this.scaleList = [
0.2, 0.4, 0.6, 0.8, 0.9,
0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,
1, 1.2, 1.4, 1.6, 1.8,
2, 2.2, 2.4, 2.6, 2.8,
3, 3.2, 3.4, 3.6, 3.8,

View File

@ -55,32 +55,35 @@ export default class Switch extends Group {
const directy = this.triangle.dricty;
const switchWidth1 = style.Section.line.width / 2;
let directxA = 1;
let sectionATriangle = new JTriangle(sectionAModel.instance.computedPoints[0], sectionAModel.instance.computedPoints[1]);
let sectionBTriangle = new JTriangle(sectionBModel.instance.computedPoints[0], sectionBModel.instance.computedPoints[1]);
let sectionCTriangle = new JTriangle(sectionCModel.instance.computedPoints[0], sectionCModel.instance.computedPoints[1]);
const sectionAPoints = sectionAModel.instance ? sectionAModel.instance.computedPoints : sectionAModel.points;
const sectionBPoints = sectionBModel.instance ? sectionBModel.instance.computedPoints : sectionBModel.points;
const sectionCPoints = sectionCModel.instance ? sectionCModel.instance.computedPoints : sectionCModel.points;
let sectionATriangle = new JTriangle(sectionAPoints[0], sectionAPoints[1]);
let sectionBTriangle = new JTriangle(sectionBPoints[0], sectionBPoints[1]);
let sectionCTriangle = new JTriangle(sectionCPoints[0], sectionCPoints[1]);
const sectionAPoint = { x: model.intersection.x, y: model.intersection.y };
if (sectionAModel.instance.computedPoints[0].x == model.intersection.x && sectionAModel.instance.computedPoints[0].y == model.intersection.y) {
sectionATriangle = new JTriangle(sectionAModel.instance.computedPoints[0], sectionAModel.instance.computedPoints[1]);
if (sectionAPoints[0].x == model.intersection.x && sectionAPoints[0].y == model.intersection.y) {
sectionATriangle = new JTriangle(sectionAPoints[0], sectionAPoints[1]);
directxA = 1;
}
if (sectionAModel.instance.computedPoints[sectionAModel.instance.computedPoints.length - 1].x == model.intersection.x && sectionAModel.instance.computedPoints[sectionAModel.instance.computedPoints.length - 1].y == model.intersection.y) {
sectionATriangle = new JTriangle(sectionAModel.instance.computedPoints[sectionAModel.instance.computedPoints.length - 2], sectionAModel.instance.computedPoints[sectionAModel.instance.computedPoints.length - 1]);
if (sectionAPoints[sectionAPoints.length - 1].x == model.intersection.x && sectionAPoints[sectionAPoints.length - 1].y == model.intersection.y) {
sectionATriangle = new JTriangle(sectionAPoints[sectionAPoints.length - 2], sectionAPoints[sectionAPoints.length - 1]);
directxA = -1;
}
if (sectionBModel.instance.computedPoints[0].x == model.intersection.x && sectionBModel.instance.computedPoints[0].y == model.intersection.y) {
sectionBTriangle = new JTriangle(sectionBModel.instance.computedPoints[0], sectionBModel.instance.computedPoints[1]);
if (sectionBPoints[0].x == model.intersection.x && sectionBPoints[0].y == model.intersection.y) {
sectionBTriangle = new JTriangle(sectionBPoints[0], sectionBPoints[1]);
}
if (sectionBModel.instance.computedPoints[sectionBModel.instance.computedPoints.length - 1].x == model.intersection.x && sectionBModel.instance.computedPoints[sectionBModel.instance.computedPoints.length - 1].y == model.intersection.y) {
sectionBTriangle = new JTriangle(sectionBModel.instance.computedPoints[sectionBModel.instance.computedPoints.length - 2], sectionBModel.instance.computedPoints[sectionBModel.instance.computedPoints.length - 1]);
if (sectionBPoints[sectionBPoints.length - 1].x == model.intersection.x && sectionBPoints[sectionBPoints.length - 1].y == model.intersection.y) {
sectionBTriangle = new JTriangle(sectionBPoints[sectionBPoints.length - 2], sectionBPoints[sectionBPoints.length - 1]);
}
if (sectionCModel.instance.computedPoints[0].x == model.intersection.x && sectionCModel.instance.computedPoints[0].y == model.intersection.y) {
sectionCTriangle = new JTriangle(sectionCModel.instance.computedPoints[0], sectionCModel.instance.computedPoints[1]);
if (sectionCPoints[0].x == model.intersection.x && sectionCPoints[0].y == model.intersection.y) {
sectionCTriangle = new JTriangle(sectionCPoints[0], sectionCPoints[1]);
}
if (sectionCModel.instance.computedPoints[sectionCModel.instance.computedPoints.length - 1].x == model.intersection.x && sectionCModel.instance.computedPoints[sectionCModel.instance.computedPoints.length - 1].y == model.intersection.y) {
sectionCTriangle = new JTriangle(sectionCModel.instance.computedPoints[sectionCModel.instance.computedPoints.length - 2], sectionCModel.instance.computedPoints[sectionCModel.instance.computedPoints.length - 1]);
if (sectionCPoints[sectionCPoints.length - 1].x == model.intersection.x && sectionCPoints[sectionCPoints.length - 1].y == model.intersection.y) {
sectionCTriangle = new JTriangle(sectionCPoints[sectionCPoints.length - 2], sectionCPoints[sectionCPoints.length - 1]);
}
const swPadding = rateOpen

View File

@ -8,7 +8,7 @@ class TransformHandle {
this.scale = '';
this.scaleIndex = 0;
this.scaleList = [
0.2, 0.4, 0.6, 0.8, 0.9,
0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,
1, 1.2, 1.4, 1.6, 1.8,
2, 2.2, 2.4, 2.6, 2.8,
3, 3.2, 3.4, 3.6, 3.8,

View File

@ -1265,7 +1265,7 @@ export const asyncRouter = [
component: Layout,
meta: {
i18n: 'router.fileManage',
roles: [admin, user]
roles: [admin]
},
children: [
{

View File

@ -1023,7 +1023,6 @@ const map = {
state.version = version;
},
setShowCentralizedStationCode: (state, stationCode) => {
console.log(stationCode, '==========');
state.showCentralizedStationCode = stationCode;
},
setShowCentralizedStationNum: state => {

View File

@ -452,7 +452,7 @@ export default {
deviceList.push(deviceCode);
}
this.$jlmap.updatePicture(deviceList);
this.$jlmap.updateTransform(pictureModel.scaling, pictureModel.origin);
this.$jlmap.updateTransform(pictureModel.scaling || '1', pictureModel.origin);
},
deletePicture() {
if (!this.pictureName) {

View File

@ -69,14 +69,14 @@ export default {
}
},
mouseenter(model) {
if (model._type == 'Section') {
model.instance.mouseover();
}
// if (model._type == 'Section') {
// model.instance.mouseover();
// }
},
mouseleave(model) {
if (model._type == 'Section') {
model.instance.mouseout();
}
// if (model._type == 'Section') {
// model.instance.mouseout();
// }
},
//
delList(model, list) {

View File

@ -31,6 +31,7 @@
@generateCIEvent="generateCIEvent"
@updateMapModel="updateMapModel"
@generateDepotCiEvent="generateDepotCiEvent"
@setMapFunctionConfig="setMapFunctionConfig"
@setCenter="setCenter"
@selectView="selectViewDraft"
@showMap="showMap"
@ -48,6 +49,7 @@
</div>
<config-map ref="configMap" @handleSelectPhysicalView="handleSelectPhysicalView" />
<ci-config ref="ciConfig" />
<map-function-config ref="mapFunctionConfig" />
<depot-station ref="depotStation" />
<pop-menu ref="popMenu" :menu="menu" />
<check-config ref="checkConfig" @checkOver="checkOver" />
@ -67,6 +69,7 @@ import CheckConfig from './checkConfig';
import ElementImport from './elementImport';
import PopMenu from '@/components/PopMenu';
import DepotStation from './depotStation';
import mapFunctionConfig from './mapFunctionConfig';
import ConfigMap from './configMap';
@ -83,7 +86,8 @@ export default {
PopMenu,
CheckConfig,
ElementImport,
DepotStation
DepotStation,
mapFunctionConfig
},
data() {
return {
@ -312,6 +316,9 @@ export default {
generateDepotCiEvent() {
this.$refs.depotStation.doShow();
},
setMapFunctionConfig() {
this.$refs.mapFunctionConfig.show();
},
handleSelectControlPage(model) {
if (this.$refs.mapOperate) {
this.$refs.mapOperate.handleSelectControlPage(model);

View File

@ -0,0 +1,218 @@
<template>
<div v-show="dialogVisible">
<el-dialog v-dialogDrag title="请确认地图功能配置项" :visible.sync="dialogVisible" fullscreen :before-close="handleClose" center :close-on-click-modal="false" :z-index="2000" append-to-body>
<div style="overflow-y: scroll;" :style="{height: height+ 'px'}">
<el-card style="margin-top: 10px">
<div slot="header" style="font-weight: bold;text-align: center;">
<span>地图功能配置项</span>
</div>
<el-table :data="roadData" style="width: 100%;">
<el-table-column prop="configKey" label="key" />
<el-table-column prop="configValue" label="value">
<template slot-scope="scope">
<div v-if="scope.row.type === 'input'">
<div v-if="!scope.row.focus" style="width: 100%;cursor: pointer;" @click="changeFocus(scope.row, '1')">{{ scope.row.configValue }}</div>
<el-input v-if="scope.row.focus" v-model="scope.row.configValue" size="mini" style="width: 100%" @blur="changeFocus(scope.row, '0')" />
</div>
<div v-else-if="scope.row.type === 'number'">
<div v-if="!scope.row.focus" style="width: 100%;cursor: pointer" @click="changeFocus(scope.row, '1')">{{ scope.row.configValue }}</div>
<el-input-number v-if="scope.row.focus" v-model="scope.row.configValue" size="mini" style="width: 100px;" :min="0" controls-position="right" @blur="changeFocus(scope.row, '0')" />
</div>
<div v-else-if="scope.row.type === 'boolean'">
<el-radio v-model="scope.row.configValue" :label="trueValue"></el-radio>
<el-radio v-model="scope.row.configValue" :label="falseValue"></el-radio>
</div>
<div v-else-if="scope.row.type === 'select'">
<el-select v-model="scope.row.configValue" size="mini" style="width: 80px;">
<el-option
v-for="item in scope.row.options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</div>
<div v-else-if="scope.row.type === 'multiple'">
<div v-if="!scope.row.focus" style="width: 100%;cursor: pointer;height: 20px;" @click="changeFocus(scope.row, '1')">
<template v-for="(item, i) in scope.row.configValue">
<el-tag :key="i" size="mini">{{ getMultipleName(item, scope.row.options) }}</el-tag>
</template>
</div>
<el-select v-if="scope.row.focus" v-model="scope.row.configValue" size="mini" multiple placeholder="请选择">
<el-option
v-for="item in scope.row.options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</div>
</template>
</el-table-column>
<el-table-column prop="remark" label="描述" />
</el-table>
</el-card>
</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" :loading="loading" @click="save">{{ $t('global.confirm') }}</el-button>
<el-button :loading="loading" @click="dialogVisible = false">{{ $t('global.cancel') }}</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { saveMap } from '@/api/jmap/mapdraft';
import { mapGetters } from 'vuex';
export default {
name: 'Config',
components: {
// EditConfig
},
props: {
type: {
type: String,
default() {
return '';
}
}
},
data() {
return {
loading: false,
dialogVisible: false,
index: 0,
trueValue: true,
falseValue: false,
id: '',
height: 800,
roadData: [],
focus: false,
booleanList: ['hasCTC', 'hasTDCS'],
multipleList: [],
selectList: [],
numberList: [],
optionsMap: {
},
remarkMap: {
hasCTC: '有CTC系统大铁',
hasTDCS: '有TDCS系统大铁'
}
};
},
computed: {
...mapGetters('map', [
'stationList'
])
},
mounted() {
},
methods: {
async show() {
this.optionsMap.sharingECStations = [];
this.stationList.forEach(item => {
this.optionsMap.sharingECStations.push({ value: item.code, label: item.name });
});
this.dialogVisible = true;
this.height = document.documentElement.clientHeight - 180;
const map = this.$store.state.map.map;
this.getList(map.mapFunctionConfig);
},
changeFocus(row, flag) {
if (flag === '0') {
this.$set(row, 'focus', false);
} else {
this.$set(row, 'focus', true);
}
},
getMultipleName(value, options) {
const obj = options.find(item => {
return item.value === value;
});
return (obj || {}).label;
},
async getList(data) {
try {
if (data) {
const keys = Object.keys(data);
this.roadData = [];
keys.forEach(key => {
let type = 'input';
let options = [];
if (this.booleanList.indexOf(key) >= 0) {
type = 'boolean';
} else if (this.selectList.indexOf(key) >= 0) {
type = 'select';
options = this.optionsMap[key];
} else if (this.numberList.indexOf(key) >= 0) {
type = 'number';
} else if (this.multipleList.indexOf(key) >= 0) {
type = 'multiple';
options = this.optionsMap[key];
} else {
type = 'input';
}
const param = {
configKey: key,
configValue: data[key],
type: type,
options: options,
remark: this.remarkMap[key]
};
this.roadData.push(param);
});
} else {
this.roadData = [];
}
} catch (error) {
console.log(error);
}
},
handleClose(done) {
if (done) {
done();
} else {
this.dialogVisible = false;
}
},
addModel() {
this.$refs.addConfig.show();
},
editModel(item, index) {
this.$refs.editConfig.show(item);
this.index = index;
},
save() {
this.loading = true;
const map = this.$store.state.map.map;
this.$store.dispatch('map/saveMapDeviceDefaultRelations').then(() => {
const param = {};
this.roadData.forEach(item => {
param[item.configKey] = item.configValue;
});
saveMap(Object.assign(map, {mapFunctionConfig: param, mapId: this.$route.params.mapId})).then(response => {
this.dialogVisible = false;
this.loading = false;
}).catch(() => {
this.loading = false;
this.$messageBox(this.$t('map.updateFailed'));
});
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.icon_font{
font-size: 18px;
margin-left: 15px;
cursor: pointer;
}
.flex_box{
display: flex;
justify-content: flex-start;
align-items: center;
}
</style>

View File

@ -17,7 +17,7 @@
<el-dropdown-item><div @click="showLocalConfig">现地配置</div></el-dropdown-item>
<el-dropdown-item><div @click="showScreenConfig">大屏配置</div></el-dropdown-item>
<el-dropdown-item><div @click="showDepotConfig">车辆段配置</div></el-dropdown-item>
<el-dropdown-item><div @click="showDepotConfig">地图配置</div></el-dropdown-item>
<el-dropdown-item><div @click="setMapFunctionConfig">地图配置</div></el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-dropdown class="operate-button" trigger="click">
@ -244,6 +244,9 @@ export default {
generateCIEvent() {
this.$emit('generateCIEvent');
},
setMapFunctionConfig() {
this.$emit('setMapFunctionConfig');
},
generateDepotCiEvent() {
this.$emit('generateDepotCiEvent');
}