ibp系统调整&发布地图管理调整

This commit is contained in:
fan 2020-08-11 14:34:17 +08:00
parent e40032a24e
commit 8687650e41
9 changed files with 367 additions and 206 deletions

View File

@ -117,7 +117,9 @@ export const DeviceMenu = {
RunPlan: '104',
JointRoom: '105',
SetDriver: '106',
Script: '107'
Script: '107',
IscsSystem: '108',
IscsInterface: '109'
};
/**

View File

@ -2,10 +2,10 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
BASE_API = 'http://192.168.3.41:9000'; // 张赛
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
// BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康

View File

@ -40,11 +40,11 @@ export default {
},
watch: {
'$store.state.app.windowSizeCount': function() {
this.$store.dispatch('config/resize', { width: this.$store.state.app.width - 521 - this.widthLeft, height: this.$store.state.app.height - 60 });
this.$store.dispatch('config/resize', { width: this.$store.state.app.width - this.widthLeft, height: this.$store.state.app.height - 60 });
}
},
created() {
this.$store.dispatch('config/resize', { width: this.$store.state.app.width - 521 - this.widthLeft, height: this.$store.state.app.height - 60 });
this.$store.dispatch('config/resize', { width: this.$store.state.app.width - this.widthLeft, height: this.$store.state.app.height - 60 });
},
mounted() {
this.$refs.ibpPlate.show();

View File

@ -0,0 +1,88 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" pop-menu-class="popMenuClass" />
</div>
</template>
<script>
import PopMenu from '@/components/PopMenu';
import { Notification } from 'element-ui';
import { DeviceMenu } from '@/scripts/ConstDic';
import { exitFullscreen } from '@/utils/screen';
export default {
name: 'CancelMenu',
components: {
PopMenu
},
data() {
return {
menu: [],
menuSystem: [
{
label: '添加系统界面',
handler: this.addInterface,
disabled: false
}
],
menuInterface: [
{
label: '删除系统界面',
handler: this.deleteInterface,
disabled: false
}
]
};
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.IscsSystem)) {
this.menu = [...this.menuSystem];
this.doShow(this.$store.state.menuOperation.menuPosition);
} else if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.IscsInterface)) {
this.menu = [...this.menuInterface];
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.menu = [];
this.doClose();
}
}
},
methods: {
clickEvent() {
const self = this;
window.onclick = function (e) {
self.doClose();
};
},
addInterface() {
},
deleteInterface() {
},
doShow(point) {
this.clickEvent();
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
this.$refs.popMenu.resetShowPosition(point);
}
},
doClose() {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
}
},
//
async back() {
history.go(-1);
Notification.closeAll();
exitFullscreen();
}
}
};
</script>
<style lang="scss" scoped>
.popMenuClass{
background: #fff;
}
</style>

View File

@ -4,6 +4,7 @@
<span>iscs系统列表</span>
</div>
<div class="text_item">
<el-cascader v-model="testList" style="width: 100%;" :props="props" placeholder="请选择车站" />
<el-input v-model="filterText" :placeholder="this.$t('global.filteringKeywords')" clearable />
<div class="tree_box">
<el-tree ref="tree" :data="treeList" node-key="id" :props="defaultProps" highlight-current :span="22" :filter-node-method="filterNode" @node-click="clickEvent" @node-contextmenu="showContextMenu">
@ -22,6 +23,7 @@
<script>
import { DeviceMenu } from '@/scripts/ConstDic';
import { removeSessionStorage } from '@/utils/auth';
import { getPublishMapListOnline, getStationListNeedAttendant } from '@/api/jmap/map';
export default {
name: 'UserMapList',
@ -41,19 +43,46 @@ export default {
y: 0
},
editModel: {},
lineCode: ''
lineCode: '',
mapList: [],
testList: []
};
},
computed: {
// role() {
// return this.$store.state.user.roles.includes('04') ||
// this.$store.state.user.roles.includes('05') ||
// this.$store.state.user.roles.includes('01');
// }
props() {
const self = this;
return {
lazy: true,
lazyLoad (node, resolve) {
const { level } = node;
let nodes = [];
if (level === 1) {
getStationListNeedAttendant(node.data.value).then(resp => {
nodes = resp.data.map(elem => { return {value: elem.code, label: elem.name, leaf: true}; });
resolve(nodes);
}).catch(() => {
self.$message.error('获取车站列表失败');
resolve(nodes);
});
} else if (!level) {
getPublishMapListOnline().then(resp => {
nodes = resp.data.map(elem => { return { value: elem.id, label: elem.name, leaf: false }; });
resolve(nodes);
}).catch(() => {
self.$message.error('获取地图列表失败!');
resolve(nodes);
});
}
}
};
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val);
},
testList(val) {
console.log(val);
}
},
beforeDestroy () {
@ -77,7 +106,7 @@ export default {
name: 'FAS界面',
mode: 'fas',
id: 'fas',
type: 'system',
type: 'totalSystem',
children: [
{
name: '站厅报警',
@ -133,7 +162,7 @@ export default {
name: 'BAS界面',
mode: 'bas',
id: 'bas',
type: 'system',
type: 'totalSystem',
children: [
{
name: '大系统',
@ -277,7 +306,7 @@ export default {
name: 'PSD界面',
mode: 'psd',
id: 'psd',
type: 'system',
type: 'totalSystem',
children: [
{
name: '屏蔽门',
@ -347,7 +376,7 @@ export default {
name: 'AFC界面',
mode: 'afc',
id: 'afc',
type: 'system',
type: 'totalSystem',
children: [
{
name: '售检票',
@ -369,7 +398,7 @@ export default {
name: 'ACS界面',
mode: 'acs',
id: 'acs',
type: 'system',
type: 'totalSystem',
children: [
{
name: '门禁-站台层',
@ -405,7 +434,7 @@ export default {
name: '网络状态',
mode: 'netState',
id: 'netState',
type: 'system',
type: 'totalSystem',
children: [
{
name: '网络状态',
@ -427,6 +456,8 @@ export default {
},
clickEvent(obj, data, ele) {
switch (obj.type) {
case 'totalSystem':
break;
case 'system' :
break;
case 'interface':
@ -435,16 +466,15 @@ export default {
}
},
showContextMenu(e, obj, node, vueElem) {
if (obj && obj.type == 'map') {
const deviceMenuMap = { system: DeviceMenu.IscsSystem, interface: DeviceMenu.IscsInterface };
if (obj && (obj.type == 'system' || obj.type == 'interface')) {
e.preventDefault();
const menu = DeviceMenu.Map;
const menu = deviceMenuMap[obj.type];
this.point = {
x: e.clientX,
y: e.clientY
};
this.editModel = obj;
this.editModel.lineCode = obj.lineCode;
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu });
}
}

View File

@ -8,6 +8,7 @@
<transition>
<router-view />
</transition>
<context-menu />
</div>
</template>
@ -18,13 +19,15 @@ import { launchFullscreen } from '@/utils/screen';
import localStore from 'storejs';
import { getSessionStorage, setSessionStorage } from '@/utils/auth';
import MapCreate from './mapmanage/create';
import ContextMenu from './contextMenu';
export default {
name: 'DesignPlatform',
components: {
demonList,
drapLeft,
MapCreate
MapCreate,
ContextMenu
},
data() {
return {
@ -71,12 +74,12 @@ export default {
},
resize() {
this.widthLeft = Number(localStore.get('LeftWidth')) || this.widthLeft;
const width = this.$store.state.app.width - 521 - this.widthLeft;
const width = this.$store.state.app.width - this.widthLeft;
const height = this.$store.state.app.height - 90;
this.$store.dispatch('config/resize', { width: width, height: height });
},
setMapResize(LeftWidth) {
const width = this.$store.state.app.width - 521 - LeftWidth;
const width = this.$store.state.app.width - LeftWidth;
const height = this.$store.state.app.height - 90;
this.$store.dispatch('config/resize', { width: width, height: height });
}

View File

@ -4,7 +4,8 @@
<div class="map-view">
<iscs-plate ref="iscsPlate" @iscsChange="iscsChange" />
</div>
<div class="map-draft">
<div class="map-draft" :class="{'hide': draftShow}">
<div class="btn_left_box" @click="clickRightBtn"><i :class="draftShow?'el-icon-arrow-right':'el-icon-arrow-left'" /></div>
<iscs-operate v-if="iscsMode==='fas'" ref="iscsOperate" @iscsChange="iscsChange" />
<iscs-bas-operate v-else-if="iscsMode==='bas'" ref="iscsBasOperate" @iscsChange="iscsChange" />
<iscs-psd-operate v-else-if="iscsMode==='psd'" ref="iscsPsdOperate" @iscsChange="iscsChange" />
@ -44,7 +45,8 @@ export default {
width: this.$store.state.app.width - 521,
height: this.$store.state.app.height - 60
},
widthLeft: Number(localStore.get('LeftWidth')) || 450
widthLeft: Number(localStore.get('LeftWidth')) || 450,
draftShow: false
};
},
computed:{
@ -68,6 +70,9 @@ export default {
iscsChange(mode, system, part) {
this.$refs.iscsPlate.show(mode, system, part);
this.$refs.iscsPlate.drawIscsInit();
},
clickRightBtn() {
this.draftShow = !this.draftShow;
}
}
};
@ -76,12 +81,22 @@ export default {
@import "src/styles/mixin.scss";
.map-draft{
width: 420px;
height: 100%;
position: absolute;
right: 0;
transform: translateX(420px);
transition: all 0.5s;
background: #fff;
z-index: 9;
/deep/{
.v-modal{
opacity: 0;
}
}
&.hide{
transform: translateX(0);
}
}
.map-view {
@ -92,13 +107,15 @@ export default {
height: 100%;
overflow: hidden;
}
.map-draft {
float: right;
width: 520px;
// /deep/ .el-scrollbar__view {
// width: 510px !important;
// height: calc(100% - 40px);
// }
.btn_left_box{
position: absolute;
left: 0;
top: 50%;
padding: 8px 3px;
background: #fff;
z-index: 10;
transform: translateX(-22px);
cursor: pointer;
border-radius: 5px 0 0 5px;
}
</style>

View File

@ -1,17 +1,17 @@
<template>
<div>
<el-form ref="form" :rules="rules" :model="form" label-width="80px">
<div style="width: 100%;">
<el-form ref="form" :rules="rules" :model="form" label-width="80px" style="width: 100%;padding: 10px 50px;">
<el-form-item label="半径" prop="r">
<el-input-number v-model="form.r" controls-position="right" :min="1" />
<el-input-number v-model="form.r" size="small" controls-position="right" :min="1" />
</el-form-item>
<el-form-item label="填充色" prop="fillColor">
<el-color-picker v-model="form.fillColor"></el-color-picker>
<el-color-picker v-model="form.fillColor" size="small" />
</el-form-item>
<el-form-item label="X轴坐标">
<el-input-number v-model="form.x" controls-position="right" :min="1" />
<el-input-number v-model="form.x" controls-position="right" size="small" :min="1" />
</el-form-item>
<el-form-item label="Y轴坐标">
<el-input-number v-model="form.y" controls-position="right" :min="1" />
<el-input-number v-model="form.y" controls-position="right" size="small" :min="1" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
@ -84,7 +84,7 @@ export default {
code: this.isUpdate ? this.form.code : getUID('ArcStatus', this.iscs.arcStatusList),
_type: 'ArcStatus',
fillColor: this.form.fillColor,
r: this.form.r,
r: this.form.r
};
this.$emit('createDataModel', rectModel);
this.initPage();
@ -102,7 +102,7 @@ export default {
code: this.form.code,
_type: 'ArcStatus',
fillColor: this.form.fillColor,
r: this.form.r,
r: this.form.r
};
this.$emit('deleteDataModel', rectModel);
},

View File

@ -12,7 +12,7 @@
<script>
// getPublishMapExport
import { getPublishMapList, delPublishMap, putMapOnLine, putMapOffLine, simulationCheck, localImportMap, updatePublishMapInfo } from '@/api/jmap/map';
import { getPublishMapList, delPublishMap, putMapOnLine, putMapOffLine, simulationCheck, localImportMap, updatePublishMapInfo, getPublishMapExport } from '@/api/jmap/map';
import { getLineCodeList } from '@/api/management/mapline';
import localStore from 'storejs';
import UpdateOperate from './draft.vue';
@ -116,14 +116,8 @@ export default {
},
{
name: '导出地图',
handleClick: this.handleExportMap,
type: 'default'
handleClick: this.handleExportMapSame
},
// {
// name: this.$t('global.export'),
// handleClick: this.handleExportMapSame,
// showControl: () => { return process.env.NODE_ENV === 'development'; }
// },
{
name: this.$t('publish.setTheProject'),
handleClick: this.handleSetProject
@ -142,6 +136,11 @@ export default {
handleClick: this.handleExportMap,
type: 'default'
},
{
name: '导出',
handleClick: this.handleExportMap,
type: 'default'
},
{
name: this.$t('global.delete'),
handleClick: this.handleDelete,
@ -291,14 +290,14 @@ export default {
// }).catch(() => { this.$set(row, 'loading' + idx, false); });
},
// // exls
// async handleExportMapSame(index, row) {
// exls
async handleExportMapSame(index, row, idx) {
// const res = await getPublishMapExport(row.id);
// const resultData = res.data;
// if (resultData === false) {
// return;
// }
//
// const self = this;
// import('@/utils/Export2Excel').then(excel => {
// self.queryExportDataSame(resultData).then(data => {
@ -307,7 +306,29 @@ export default {
// self.$message.error(`${this.$t('error.exportException')}:${error.message}`);
// });
// });
// },
this.$confirm('您是否导出地图数据?', this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(async () => {
this.$set(row, 'loading' + idx, true);
console.log(row);
const res = await getPublishMapExport(row.id);
const resultData = res.data;
if (resultData === false) {
return;
}
const content = new Blob([JSON.stringify(resultData)]);
const urlObject = window.URL || window.webkitURL || window;
const url = urlObject.createObjectURL(content);
const el = document.createElement('a');
el.href = url;
el.download = `${resultData.name}.json`;
el.click();
urlObject.revokeObjectURL(url);
this.$set(row, 'loading' + idx, false);
}).catch(() => { this.$set(row, 'loading' + idx, false); });
},
handleSimulationCheck(index, row) {
simulationCheck(row.id).then(res=>{
if (!res.data.length) {
@ -397,124 +418,124 @@ export default {
obj.value = '';
};
});
},
//
queryExportDataSame(data) {
const mapProps = {};
mapProps['stationStandList'] = {
filter: item => { return true; },
propList: {
'direction': item => {
switch (item.direction) {
case '01': return '下行';
case '02': return '上行';
default: return '未知';
}
},
'name': (item, devices) =>{
let name = '';
if (item.stationCode) {
const stationList = devices['stationList'];
const station = stationList.find(elem => { return item.stationCode == elem.code; });
if (station) {
name = station.name;
}
}
return name;
},
'code': item => {
return item.code;
}
}
};
mapProps['switchList'] = {
filter: item => { return true; },
propList: {
'name': item =>{
return item.name;
},
'code': item => {
return item.code;
}
}
};
mapProps['signalList'] = {
filter: item => { return true; },
propList: {
'name': item =>{
return item.name;
},
'code': item => {
return item.code;
}
}
};
mapProps['sectionList'] = {
filter: item => { return item.type == '01'; },
propList: {
'name': (item, devices) =>{
let name = item.name;
if (item.isSwitchSection) {
const swchList = devices['switchList'];
const swch = swchList.find(elem => { return item.relSwitchCode == elem.code; });
if (swch) {
if (item.code == swch.sectionACode) {
name = `${name} (${swch.name}-A)`;
} else if (item.code == swch.sectionBCode) {
name = `${name} (${swch.name}-B)`;
} else if (item.code == swch.sectionCCode) {
name = `${name} (${swch.name}-C)`;
}
}
}
// //
// queryExportDataSame(data) {
// const mapProps = {};
// mapProps['stationStandList'] = {
// filter: item => { return true; },
// propList: {
// 'direction': item => {
// switch (item.direction) {
// case '01': return '';
// case '02': return '';
// default: return '';
// }
// },
// 'name': (item, devices) =>{
// let name = '';
// if (item.stationCode) {
// const stationList = devices['stationList'];
// const station = stationList.find(elem => { return item.stationCode == elem.code; });
// if (station) {
// name = station.name;
// }
// }
// return name;
// },
// 'code': item => {
// return item.code;
// }
// }
// };
// mapProps['switchList'] = {
// filter: item => { return true; },
// propList: {
// 'name': item =>{
// return item.name;
// },
// 'code': item => {
// return item.code;
// }
// }
// };
// mapProps['signalList'] = {
// filter: item => { return true; },
// propList: {
// 'name': item =>{
// return item.name;
// },
// 'code': item => {
// return item.code;
// }
// }
// };
// mapProps['sectionList'] = {
// filter: item => { return item.type == '01'; },
// propList: {
// 'name': (item, devices) =>{
// let name = item.name;
// if (item.isSwitchSection) {
// const swchList = devices['switchList'];
// const swch = swchList.find(elem => { return item.relSwitchCode == elem.code; });
// if (swch) {
// if (item.code == swch.sectionACode) {
// name = `${name} (${swch.name}-A)`;
// } else if (item.code == swch.sectionBCode) {
// name = `${name} (${swch.name}-B)`;
// } else if (item.code == swch.sectionCCode) {
// name = `${name} (${swch.name}-C)`;
// }
// }
// }
return name;
},
'code': item => {
return item.code;
}
}
};
// return name;
// },
// 'code': item => {
// return item.code;
// }
// }
// };
return new Promise((resolve, reject) => {
const result = {
base: []
};
const obj = {};
const list = ['graphData', 'logicData'];
for (const i in data) {
if (list.includes(i)) {
for (const v in data[i]) {
if (data[i][v].length) {
if (mapProps[v]) {
const list = [];
data[i][v].forEach(device => {
if (mapProps[v].filter(device)) {
const obj = {};
Object.keys(mapProps[v].propList || []).forEach(key => {
obj[key] = mapProps[v].propList[key](device, data[i]);
});
list.push(obj);
}
});
result[v] = list;
}
}
}
} else if (data[i] instanceof Object || typeof data[i] != 'object') {
obj[i] = data[i];
} else if (data[i] instanceof Array) {
if (data[i].length) {
obj[i] = [...data[i]];
}
}
}
// return new Promise((resolve, reject) => {
// const result = {
// base: []
// };
// const obj = {};
// const list = ['graphData', 'logicData'];
// for (const i in data) {
// if (list.includes(i)) {
// for (const v in data[i]) {
// if (data[i][v].length) {
// if (mapProps[v]) {
// const list = [];
// data[i][v].forEach(device => {
// if (mapProps[v].filter(device)) {
// const obj = {};
// Object.keys(mapProps[v].propList || []).forEach(key => {
// obj[key] = mapProps[v].propList[key](device, data[i]);
// });
// list.push(obj);
// }
// });
// result[v] = list;
// }
// }
// }
// } else if (data[i] instanceof Object || typeof data[i] != 'object') {
// obj[i] = data[i];
// } else if (data[i] instanceof Array) {
// if (data[i].length) {
// obj[i] = [...data[i]];
// }
// }
// }
// result.base.push(obj);
// resolve(result);
// });
// }
result.base.push(obj);
resolve(result);
});
}
}
};
</script>