diff --git a/src/i18n/langs/en/router.js b/src/i18n/langs/en/router.js index 23bf2da67..cf5fb313e 100644 --- a/src/i18n/langs/en/router.js +++ b/src/i18n/langs/en/router.js @@ -73,5 +73,6 @@ export default { commandDictionary: 'Command dictionary', configLine: 'Line management', deviceManage: 'Device management', - iscsDraw: 'Iscs Draw' + iscsDraw: 'Iscs Draw', + iscsSystem: 'Iscs System' }; diff --git a/src/i18n/langs/zh/router.js b/src/i18n/langs/zh/router.js index d8601ba75..c77da6b5b 100644 --- a/src/i18n/langs/zh/router.js +++ b/src/i18n/langs/zh/router.js @@ -74,5 +74,6 @@ export default { commandDictionary: '指令字典', configLine: '线路管理', deviceManage: '设备管理', - iscsDraw: 'Iscs绘制' + iscsDraw: 'Iscs绘制', + iscsSystem: 'Iscs系统' }; diff --git a/src/ibp/shape/elevatorBack.js b/src/ibp/shape/elevatorBack.js index 16a58341b..c8c843e9c 100644 --- a/src/ibp/shape/elevatorBack.js +++ b/src/ibp/shape/elevatorBack.js @@ -3,32 +3,32 @@ import Group from 'zrender/src/container/Group'; export default class elevatorBack extends Group { - constructor(device) { - super(); - this.event = device.event; - this.model = device.model; - this.create(); - } + constructor(device) { + super(); + this.event = device.event; + this.model = device.model; + this.create(); + } - create() { - const model = this.model; - const tempString='M'+model.width/6+' '+model.height/8*6+' L'+model.width/6*4+ - ' 0 L'+model.width/6*5+' 0 A '+model.width/6+' '+model.width/6+' 0 0 1 '+ - model.width/6*5+' '+model.height/4+'L '+model.width/3+' '+model.height+' L'+model.width/6+ - ' '+model.height+' '+'A'+model.width/6+' '+model.width/6+' 0 0 1 '+model.width/6+' '+model.height/8*6; - this.elevatorBack = toolpath.createFromString(tempString, { - zlevel: model.zlevel, - z: model.z, - draggable: false, - style: { - x: model.point.x, - y: model.point.y, - brushType: 'fill', - fill: this.model.fillColor || '#313131', - lineWidth: 0 - } - }); - this.add(this.elevatorBack); - } + create() { + const model = this.model; + const tempString = 'M' + model.width / 6 + ' ' + model.height / 8 * 6 + ' L' + model.width / 6 * 4 + + ' 0 L' + model.width / 6 * 5 + ' 0 A ' + model.width / 6 + ' ' + model.width / 6 + ' 0 0 1 ' + + model.width / 6 * 5 + ' ' + model.height / 4 + 'L ' + model.width / 3 + ' ' + model.height + ' L' + model.width / 6 + + ' ' + model.height + ' ' + 'A' + model.width / 6 + ' ' + model.width / 6 + ' 0 0 1 ' + model.width / 6 + ' ' + model.height / 8 * 6; + this.elevatorBack = toolpath.createFromString(tempString, { + zlevel: model.zlevel, + z: model.z, + draggable: false, + style: { + x: model.point.x, + y: model.point.y, + brushType: 'fill', + fill: this.model.fillColor || '#313131', + lineWidth: 0 + } + }); + this.add(this.elevatorBack); + } } diff --git a/src/iscs/constant/deviceRender.js b/src/iscs/constant/deviceRender.js index f421f6369..b1529d98d 100644 --- a/src/iscs/constant/deviceRender.js +++ b/src/iscs/constant/deviceRender.js @@ -99,6 +99,42 @@ deviceRender[deviceType.BorderRadius] = { z: 4 }; +/** 空调机 */ +deviceRender[deviceType.AirConditioner] = { + _type: deviceType.AirConditioner, + zlevel: 1, + z: 4 +}; +/** 轨道排风机 */ +deviceRender[deviceType.OrbitalVentilator] = { + _type: deviceType.OrbitalVentilator, + zlevel: 1, + z: 4 +}; +/** 射流风机 */ +deviceRender[deviceType.JetFan] = { + _type: deviceType.JetFan, + zlevel: 1, + z: 4 +}; +/** 隧道风机 */ +deviceRender[deviceType.TunnelFan] = { + _type: deviceType.TunnelFan, + zlevel: 1, + z: 4 +}; +/** 防火阀 */ +deviceRender[deviceType.FireDamper] = { + _type: deviceType.FireDamper, + zlevel: 1, + z: 4 +}; +/** 防烟防火阀 */ +deviceRender[deviceType.SmookProofFd] = { + _type: deviceType.SmookProofFd, + zlevel: 1, + z: 4 +}; /** 闸机渲染配置 */ deviceRender[deviceType.BrakeMachine] = { _type: deviceType.BrakeMachine, @@ -136,4 +172,5 @@ deviceRender[deviceType.VolumeControlDamper] = { z: 4 }; + export default deviceRender; diff --git a/src/iscs/constant/deviceType.js b/src/iscs/constant/deviceType.js index f834a97fa..cd93fc083 100644 --- a/src/iscs/constant/deviceType.js +++ b/src/iscs/constant/deviceType.js @@ -1,4 +1,3 @@ - const deviceType = { ManualAlarmButton: 'manualAlarmButton', Vidicon: 'Vidicon', @@ -15,6 +14,12 @@ const deviceType = { CoolTower:'CoolTower', BorderRadius: 'borderRadius', EndDoor: 'endDoor', + AirConditioner:'AirConditioner', + OrbitalVentilator:'OrbitalVentilator', + JetFan:'JetFan', + TunnelFan:'TunnelFan', + FireDamper:'FireDamper', + SmookProofFd:'SmookProofFd', BrakeMachine: 'brakeMachine', EntranceGuard: 'entranceGuard', SemiAutomaticTicketMachine: 'semiAutomaticTicketMachine', diff --git a/src/iscs/shape/bas/airConditioner.js b/src/iscs/shape/bas/airConditioner.js new file mode 100644 index 000000000..e69de29bb diff --git a/src/iscs/shape/bas/fireDamper.js b/src/iscs/shape/bas/fireDamper.js new file mode 100644 index 000000000..e69de29bb diff --git a/src/iscs/shape/bas/jetFan.js b/src/iscs/shape/bas/jetFan.js new file mode 100644 index 000000000..e69de29bb diff --git a/src/iscs/shape/bas/orbitalVentilator.js b/src/iscs/shape/bas/orbitalVentilator.js new file mode 100644 index 000000000..e69de29bb diff --git a/src/iscs/shape/bas/smookProofFd.js b/src/iscs/shape/bas/smookProofFd.js new file mode 100644 index 000000000..e69de29bb diff --git a/src/iscs/shape/bas/tunnelFan.js b/src/iscs/shape/bas/tunnelFan.js new file mode 100644 index 000000000..e69de29bb diff --git a/src/iscs/shape/factory.js b/src/iscs/shape/factory.js index 90df0c17d..f7506247c 100644 --- a/src/iscs/shape/factory.js +++ b/src/iscs/shape/factory.js @@ -14,6 +14,12 @@ import Chiller from './bas/chiller'; import CoolTower from './bas/coolTower'; import EndDoor from './endDoor'; import BorderRadius from './borderRadius'; +import AirConditioner from './bas/airConditioner'; +import OrbitalVentilator from './bas/orbitalVentilator'; +import JetFan from './bas/jetFan'; +import TunnelFan from './bas/tunnelFan'; +import FireDamper from './bas/fireDamper'; +import SmookProofFd from './bas/smookProofFd'; import BrakeMachine from './brakeMachine'; import EntranceGuard from './entranceGuard/index'; import SemiAutomaticTicketMachine from './semiAutomaticTicketMachine'; @@ -37,6 +43,12 @@ iscsShape[deviceType.Chiller] = Chiller; iscsShape[deviceType.CoolTower] = CoolTower; iscsShape[deviceType.EndDoor] = EndDoor; iscsShape[deviceType.BorderRadius] = BorderRadius; +iscsShape[deviceType.AirConditioner] = AirConditioner; +iscsShape[deviceType.OrbitalVentilator] = OrbitalVentilator; +iscsShape[deviceType.JetFan] = JetFan; +iscsShape[deviceType.TunnelFan] = TunnelFan; +iscsShape[deviceType.FireDamper] = FireDamper; +iscsShape[deviceType.SmookProofFd] = SmookProofFd; iscsShape[deviceType.BrakeMachine] = BrakeMachine; iscsShape[deviceType.EntranceGuard] = EntranceGuard; iscsShape[deviceType.SemiAutomaticTicketMachine] = SemiAutomaticTicketMachine; diff --git a/src/iscs/utils/Uid.js b/src/iscs/utils/Uid.js new file mode 100644 index 000000000..f559072b0 --- /dev/null +++ b/src/iscs/utils/Uid.js @@ -0,0 +1,9 @@ +export function getUID(type, list) { + if (list && list.length > 0) { + const lastCode = list[list.length - 1].code; + const num = lastCode.split(type + '_')[1]; + return type + `_${num + 1}`; + } else { + return type + `_1`; + } +} diff --git a/src/iscs/utils/parser.js b/src/iscs/utils/parser.js index 27d8cdd82..a098976bf 100644 --- a/src/iscs/utils/parser.js +++ b/src/iscs/utils/parser.js @@ -3,6 +3,7 @@ import * as matrix from 'zrender/src/core/matrix'; import deviceType from '../constant/deviceType'; import deviceRender from '../constant/deviceRender'; import store from '@/store'; +import { deepClone } from '@/utils/index'; export function createTransform(opts) { let transform = matrix.create(); @@ -86,6 +87,25 @@ export function parser(data) { zrUtil.each(data.borderRadiusList || [], elem =>{ iscsDevice[elem.code] = deviceFactory(deviceType.BorderRadius, elem); } ); + + zrUtil.each(data.airConditionerList || [], elem =>{ + iscsDevice[elem.code] = deviceFactory(deviceType.AirConditioner, elem); + } ); + zrUtil.each(data.orbitalVentilatorList || [], elem =>{ + iscsDevice[elem.code] = deviceFactory(deviceType.OrbitalVentilator, elem); + } ); + zrUtil.each(data.jetFanList || [], elem =>{ + iscsDevice[elem.code] = deviceFactory(deviceType.JetFan, elem); + } ); + zrUtil.each(data.tunnelFanList || [], elem =>{ + iscsDevice[elem.code] = deviceFactory(deviceType.TunnelFan, elem); + } ); + zrUtil.each(data.fireDamperList || [], elem =>{ + iscsDevice[elem.code] = deviceFactory(deviceType.FireDamper, elem); + } ); + zrUtil.each(data.smookProofFdList || [], elem =>{ + iscsDevice[elem.code] = deviceFactory(deviceType.SmookProofFd, elem); + } ); zrUtil.each(data.brakeMachineList || [], elem =>{ iscsDevice[elem.code] = deviceFactory(deviceType.BrakeMachine, elem); }); @@ -98,6 +118,7 @@ export function parser(data) { zrUtil.each(data.semiAutomaticTicketMachineList || [], elem =>{ iscsDevice[elem.code] = deviceFactory(deviceType.SemiAutomaticTicketMachine, elem); }); + } return iscsDevice; @@ -108,9 +129,9 @@ function updateIscsListByDevice(iscs, name, device) { if (list) { const index = list.findIndex(elem => { return elem.code == device.code; }); if (index >= 0) { - device._dispose ? list.splice(index, 1) : list[index] = device; + device._dispose ? list.splice(index, 1) : list[index] = deepClone(device); } else { - list.push(device); + list.push(deepClone(device)); } } else { iscs[name] = [device]; @@ -119,7 +140,7 @@ function updateIscsListByDevice(iscs, name, device) { } export function updateIscsData(device) { - const iscsData = store.getters['iscs/iscs']; + const iscsData = store.state.iscs; switch (device._type) { case deviceType.vidiconList : updateIscsListByDevice(iscsData, 'vidiconList', device); @@ -175,6 +196,24 @@ export function updateIscsData(device) { case deviceType.SemiAutomaticTicketMachine: updateIscsListByDevice(iscsData, 'semiAutomaticTicketMachineList', device); break; + case deviceType.AirConditioner: + updateIscsListByDevice(iscsData, 'airConditionerList', device); + break; + case deviceType.OrbitalVentilator: + updateIscsListByDevice(iscsData, 'orbitalVentilatorList', device); + break; + case deviceType.JetFan: + updateIscsListByDevice(iscsData, 'jetFanList', device); + break; + case deviceType.TunnelFan: + updateIscsListByDevice(iscsData, 'tunnelFanList', device); + break; + case deviceType.FireDamper: + updateIscsListByDevice(iscsData, 'fireDamperList', device); + break; + case deviceType.SmookProofFd: + updateIscsListByDevice(iscsData, 'smookProofFdList', device); + break; } store.dispatch('iscs/setIscsData', iscsData); diff --git a/src/jmapNew/theme/chengdu_01/planConvert.js b/src/jmapNew/theme/chengdu_01/planConvert.js index 495dc4e68..6f5fd7145 100644 --- a/src/jmapNew/theme/chengdu_01/planConvert.js +++ b/src/jmapNew/theme/chengdu_01/planConvert.js @@ -14,10 +14,10 @@ export default { ExcelConfig: { beginRow: 1, beginCol: 0, - fieldNum: 8, + fieldNum: 10, sepField: '车次', columns: { - '车站名称': { key: 'stationName', formatter: (val) => { return val; } }, + '车站名': { key: 'stationName', formatter: (val) => { return val; } }, '到点': { key: 'arriveTime', formatter: (val) => { return val; } }, '发点': { key: 'departureTime', formatter: (val) => { return val; } } } @@ -25,45 +25,64 @@ export default { /** 解析exal数据转换为Json后台数据*/ importData(Sheet, JsonData) { - var dataList = convertSheetToList(Sheet, false); + var dataList = convertSheetToList(Sheet, true); var needList = Object.keys(this.ExcelConfig.columns); + if (dataList && dataList.length) { - for (var rowIndex = this.ExcelConfig.beginRow; rowIndex < dataList.length; rowIndex += 1) { - for (var colIndex = this.ExcelConfig.beginCol; colIndex < dataList[this.ExcelConfig.beginCol].length; colIndex += this.ExcelConfig.fieldNum + 1) { - var tripNew, tripObj; + for (var colIndex = this.ExcelConfig.beginCol; colIndex < dataList.length; colIndex += this.ExcelConfig.fieldNum + 1) { + var isContinue = true; + var tripObj = { code: '', arrivalList: [] }; + + for (var rowIndex = this.ExcelConfig.beginRow; isContinue; rowIndex += 1) { + isContinue = false; + var stationObj = {}; - - tripNew = tripObj = { code: '', arrivalList: [] }; for (var index = 0; index < this.ExcelConfig.fieldNum; index += 1) { - var title = dataList[0][colIndex + index]; - var value = dataList[rowIndex][colIndex + index]; + if (dataList[colIndex + index]) { + var title = dataList[colIndex + index][0]; + var value = dataList[colIndex + index][rowIndex]; - if (title && value) { - var titleStr = `${title}`.trim(); - var valueStr = `${value}`.trim(); + if (title && value) { + // 数据列解析 + isContinue = true; + var titleStr = `${title}`.trim(); + var valueStr = `${value}`.trim(); - if (titleStr.includes(this.ExcelConfig.sepField)) { - tripObj.code = valueStr; - JsonData.forEach(elem => { - if (elem.code == valueStr) { - tripObj = elem; - return; + if (titleStr == this.ExcelConfig.sepField) { + if (tripObj.code) { + const length = tripObj.arrivalList.length; + if (length == 1) { + tripObj.arrivalList[0]['flag'] = true; + } + JsonData.push(tripObj); + tripObj = { code: valueStr, arrivalList: [] }; + } else { + tripObj.code = valueStr; } - }); - } + } - // 取需要的字段 - if (needList.findIndex(elem => { return elem == titleStr; }) >= 0) { - stationObj[this.ExcelConfig.columns[titleStr].key] = this.ExcelConfig.columns[titleStr].formatter(valueStr); + // 取需要的字段 + if (needList.findIndex(elem => { return elem == titleStr; }) >= 0) { + stationObj[this.ExcelConfig.columns[titleStr].key] = this.ExcelConfig.columns[titleStr].formatter(valueStr); + } } } } - tripObj.arrivalList.push(stationObj); - if (tripObj.code && tripObj == tripNew) { - JsonData.push(tripObj); + // 添加字段值 + if (Object.keys(stationObj).length) { + tripObj.arrivalList.push(stationObj); } } + + // 添加最后那条没有车次的记录 + if (tripObj.code) { + const length = tripObj.arrivalList.length; + if (length) { + tripObj.arrivalList[length - 1]['flag'] = true; + } + JsonData.push(tripObj); + } } } @@ -78,6 +97,7 @@ export default { /** 按服务遍历数据*/ data.serviceNumberDataList.forEach((service) => { /** 按车次遍历数据*/ + var isBackup = true; var opt = { name: '', markPointData: [], data: [] }; if (service.tripNumberDataList && service.tripNumberDataList.length) { service.tripNumberDataList.forEach((train, j) => { @@ -105,8 +125,8 @@ export default { train.stationTimeList.forEach((elem, index) => { idx = index; if (index == 0 && train.stationTimeList[index].stationCode != train.stationTimeList[index + 1].stationCode || - index == train.stationTimeList.length - 2 && train.stationTimeList[index].secondTime != train.stationTimeList[index + 1].secondTime || - index > 0 && index < train.stationTimeList.length - 1) { + index == train.stationTimeList.length - 2 && train.stationTimeList[index].secondTime != train.stationTimeList[index + 1].secondTime || + index > 0 && index < train.stationTimeList.length - 1) { const aa = `${train.directionCode}${train.tripNumber}`; opt.data.push([elem.secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem, elem.directionCode, false), elem.stationCode, aa]); } @@ -132,10 +152,12 @@ export default { opt = { name: '', markPointData: [], data: [] }; } } + + isBackup = train.backup; }); // 不是备用车,按服务添加线 - if (!service.backup) { + if (!isBackup) { /** 创建一条完成的服务数据*/ var model = createSeriesModel(opt, Object.assign({ color: hexColor.toCreate() }, lineStyle)); if (model) { @@ -249,11 +271,11 @@ export default { /** 格式化y轴数据*/ computedFormatYAxis(stations, params) { - var yText = '0m'; + var yText = ''; stations.forEach(elem => { if (elem.kmRange < parseInt(params.value) / this.CoordMultiple - this.EdgeHeight) { - yText = Math.floor(elem.kmRange) + 'm'; + yText = elem.kmRange + 'm'; } }); diff --git a/src/router/index.js b/src/router/index.js index bdb6affc0..268420bd8 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -39,6 +39,7 @@ const News = () => import('@/views/system/news/index'); const CommandDictionary = () => import('@/views/system/commandDictionary/index'); const CommandDictionaryDetail = () => import('@/views/system/commandDictionary/edit'); const configLine = () => import('@/views/system/configLine/index'); +const IscsSystem = () => import('@/views/system/iscsSystem/index'); const Mapedit = () => import('@/views/mapdraft/index'); @@ -783,6 +784,13 @@ export const asyncRouter = [ } ] }, + { + path: 'iscs/system', + component: IscsSystem, + meta: { + i18n: 'router.iscsSystem' + } + }, { path: 'dictionary', component: Dictionary, diff --git a/src/store/modules/iscs.js b/src/store/modules/iscs.js index 70df69726..965567ec8 100644 --- a/src/store/modules/iscs.js +++ b/src/store/modules/iscs.js @@ -1,5 +1,5 @@ import Vue from 'vue'; - +import {updateIscsData } from '@/iscs/utils/parser'; /** * iscs状态数据 */ @@ -45,12 +45,89 @@ const iscs = { } else { return []; } + }, + frozenPumpList:(state)=>{ + if (state.iscs && state.iscs.frozenPumpList) { + return state.iscs.frozenPumpList; + } else { + return []; + } + }, + airConditionerList:(state)=>{ + if (state.iscs && state.iscs.airConditionerList) { + return state.iscs.airConditionerList; + } else { + return []; + } + }, + tunnelFanList:(state)=>{ + if (state.iscs && state.iscs.tunnelFanList) { + return state.iscs.tunnelFanList; + } else { + return []; + } + }, + orbitalVentilatorList:(state)=>{ + if (state.iscs && state.iscs.orbitalVentilatorList) { + return state.iscs.orbitalVentilatorList; + } else { + return []; + } + }, + smookProofFdList:(state)=>{ + if (state.iscs && state.iscs.smookProofFdList) { + return state.iscs.smookProofFdList; + } else { + return []; + } + }, + chillerList:(state)=>{ + if (state.iscs && state.iscs.chillerList) { + return state.iscs.chillerList; + } else { + return []; + } + }, + coolTowerList:(state)=>{ + if (state.iscs && state.iscs.coolTowerList) { + return state.iscs.coolTowerList; + } else { + return []; + } + }, + fireDamperList:(state)=>{ + if (state.iscs && state.iscs.fireDamperList) { + return state.iscs.fireDamperList; + } else { + return []; + } + }, + jetFanList:(state)=>{ + if (state.iscs && state.iscs.jetFanList) { + return state.iscs.jetFanList; + } else { + return []; + } + }, + ventilatorList:(state)=>{ + if (state.iscs && state.iscs.ventilatorList) { + return state.iscs.ventilatorList; + } else { + return []; + } } }, mutations: { iscsRender: (state, devices) => { - Vue.prototype.$iscs && Vue.prototype.$iscs.render(devices); + if (devices && devices.length) { + if (state.iscs) { + devices.forEach(elem => { updateIscsData(elem); }); + } + if (Vue.prototype.$iscs) { + Vue.prototype.$iscs.render(devices); + } + } }, setIscsData: (state, iscs) => { state.iscs = iscs; @@ -73,8 +150,10 @@ const iscs = { if (!(models instanceof Array)) { models = [models]; } + commit('iscsRender', models); resolve(models); + }); }, setUpdateDeviceData: ({ commit }, models) => { diff --git a/src/views/system/iscsDraw/iscsBasOperate/airConditioner.vue b/src/views/system/iscsDraw/iscsBasOperate/airConditioner.vue index 6001d4fa7..dff906551 100644 --- a/src/views/system/iscsDraw/iscsBasOperate/airConditioner.vue +++ b/src/views/system/iscsDraw/iscsBasOperate/airConditioner.vue @@ -22,6 +22,8 @@ + + diff --git a/src/views/system/iscsSystem/config/fire-alarm/stand.vue b/src/views/system/iscsSystem/config/fire-alarm/stand.vue new file mode 100644 index 000000000..60d45af2a --- /dev/null +++ b/src/views/system/iscsSystem/config/fire-alarm/stand.vue @@ -0,0 +1,20 @@ + + + + + diff --git a/src/views/system/iscsSystem/config/fire-alarm/stationHall.vue b/src/views/system/iscsSystem/config/fire-alarm/stationHall.vue new file mode 100644 index 000000000..62d7d4b27 --- /dev/null +++ b/src/views/system/iscsSystem/config/fire-alarm/stationHall.vue @@ -0,0 +1,20 @@ + + + + + diff --git a/src/views/system/iscsSystem/config/fire-alarm/system.vue b/src/views/system/iscsSystem/config/fire-alarm/system.vue new file mode 100644 index 000000000..517ce8347 --- /dev/null +++ b/src/views/system/iscsSystem/config/fire-alarm/system.vue @@ -0,0 +1,20 @@ + + + + + diff --git a/src/views/system/iscsSystem/config/index.vue b/src/views/system/iscsSystem/config/index.vue new file mode 100644 index 000000000..71a8357a0 --- /dev/null +++ b/src/views/system/iscsSystem/config/index.vue @@ -0,0 +1,36 @@ + + + + + diff --git a/src/views/system/iscsSystem/index.vue b/src/views/system/iscsSystem/index.vue new file mode 100644 index 000000000..be6afac12 --- /dev/null +++ b/src/views/system/iscsSystem/index.vue @@ -0,0 +1,46 @@ + + + + + diff --git a/src/views/system/iscsSystem/nav.vue b/src/views/system/iscsSystem/nav.vue new file mode 100644 index 000000000..a14831da1 --- /dev/null +++ b/src/views/system/iscsSystem/nav.vue @@ -0,0 +1,291 @@ + + + + +