diff --git a/src/configs/UrlManage.ts b/src/configs/UrlManage.ts index 62d1883..e95ccca 100644 --- a/src/configs/UrlManage.ts +++ b/src/configs/UrlManage.ts @@ -3,7 +3,7 @@ function getHost(): string { return 'test.joylink.club/bjrtsts-server'; } else if (process.env.ENV_MODE == 'publish') { return 'joylink.club/bjrtsts-server'; - } else if (process.env.NODE_ENV == 'local_test') { + } else if (process.env.ENV_MODE == 'local_test') { return '192.168.33.233:9091'; } // return '192.168.3.7:9091'; diff --git a/src/layouts/RelayCabinetLayout/GeneraterCiCjConfig.ts b/src/layouts/RelayCabinetLayout/GeneraterCiCjConfig.ts index 0677db3..63b21aa 100644 --- a/src/layouts/RelayCabinetLayout/GeneraterCiCjConfig.ts +++ b/src/layouts/RelayCabinetLayout/GeneraterCiCjConfig.ts @@ -702,7 +702,7 @@ const garageDoorCjList = [ const floodGateCjList = garageDoorCjList; //洗车机 -const threecarWashingCjList = [ +const carWashingCjList = [ { code: 'XCJ1', refDeviceCodesAndPos: [ @@ -718,18 +718,6 @@ const threecarWashingCjList = [ position: PostionType.Q, }, ], - [ - { - code: 'TWJ2', - position: PostionType.Q, - }, - ], - [ - { - code: 'TWJ3', - position: PostionType.Q, - }, - ], [ { code: 'TGQJ', @@ -777,30 +765,6 @@ const threecarWashingCjList = [ position: PostionType.H, }, ], - [ - { - code: 'CFJ2', - position: PostionType.Q, - }, - ], - [ - { - code: 'CFJ2', - position: PostionType.H, - }, - ], - [ - { - code: 'CFJ3', - position: PostionType.Q, - }, - ], - [ - { - code: 'CFJ3', - position: PostionType.H, - }, - ], [ { code: 'JTJ', @@ -829,24 +793,6 @@ const threecarWashingCjList = [ }, ]; -const twocarWashingCjList = threecarWashingCjList.map((cjData) => ({ - code: cjData.code, - refDeviceCodesAndPos: cjData.refDeviceCodesAndPos - .map((device) => - device.filter((item) => item.code !== 'TWJ3' && item.code !== 'CFJ3') - ) - .filter((item) => item.length > 0), -})); - -const onecarWashingCjList = twocarWashingCjList.map((cjData) => ({ - code: cjData.code, - refDeviceCodesAndPos: cjData.refDeviceCodesAndPos - .map((device) => - device.filter((item) => item.code !== 'TWJ2' && item.code !== 'CFJ2') - ) - .filter((item) => item.length > 0), -})); - const DeviceType = graphicData.RelatedRef.DeviceType; export const ciCjMap = new Map([ [ @@ -890,8 +836,6 @@ export const ciCjMap = new Map([ [`${DeviceType.Breakers}+undefined`, breakersCjList], [`${DeviceType.PowerScreen}+undefined`, powerScreenCjList], [`${DeviceType.GarageDoor}+undefined`, garageDoorCjList], - [`${DeviceType.CarWashing}+3`, threecarWashingCjList], - [`${DeviceType.CarWashing}+2`, twocarWashingCjList], - [`${DeviceType.CarWashing}+1`, onecarWashingCjList], + [`${DeviceType.CarWashing}+undefined`, carWashingCjList], [`${DeviceType.FloodGate}+undefined`, floodGateCjList], ]); diff --git a/src/layouts/RelayCabinetLayout/GeneraterCiQdConfig.ts b/src/layouts/RelayCabinetLayout/GeneraterCiQdConfig.ts index fc534b6..4fa8855 100644 --- a/src/layouts/RelayCabinetLayout/GeneraterCiQdConfig.ts +++ b/src/layouts/RelayCabinetLayout/GeneraterCiQdConfig.ts @@ -105,21 +105,7 @@ const garageDoorQdList = [ const floodGateQdList = garageDoorQdList; -const threecarWashingQdList = [ - { - code: 'XCJ1', - refDeviceCodes: [['XQJ'], ['TWJ1'], ['TWJ2'], ['TWJ3'], ['TGQJ']], - }, -]; - -const twocarWashingQdList = [ - { - code: 'XCJ1', - refDeviceCodes: [['XQJ'], ['TWJ1'], ['TWJ2'], ['TGQJ']], - }, -]; - -const onecarWashingQdList = [ +const carWashingQdList = [ { code: 'XCJ1', refDeviceCodes: [['XQJ'], ['TWJ1'], ['TGQJ']], @@ -191,8 +177,6 @@ export const ciQdMap = new Map([ [`${DeviceType.ScreenDoor}+down`, downScreenDoorQdList], [`${DeviceType.ScreenDoor}+up`, upScreenDoorQdList], [`${DeviceType.GarageDoor}+undefined`, garageDoorQdList], - [`${DeviceType.CarWashing}+3`, threecarWashingQdList], - [`${DeviceType.CarWashing}+2`, twocarWashingQdList], - [`${DeviceType.CarWashing}+1`, onecarWashingQdList], + [`${DeviceType.CarWashing}+undefined`, carWashingQdList], [`${DeviceType.FloodGate}+undefined`, floodGateQdList], ]); diff --git a/src/layouts/RelayCabinetLayout/GeneraterRelayLayoutConfig.ts b/src/layouts/RelayCabinetLayout/GeneraterRelayLayoutConfig.ts index 7501b79..97cc5f8 100644 --- a/src/layouts/RelayCabinetLayout/GeneraterRelayLayoutConfig.ts +++ b/src/layouts/RelayCabinetLayout/GeneraterRelayLayoutConfig.ts @@ -468,7 +468,7 @@ const garageDoorCombinations = [ const floodGateCombinations = garageDoorCombinations; //洗车机 -const threeCarWashingCombinations = [ +const carWashingCombinations = [ { code: 'XCJ1', refDeviceCodesAndModel: [ @@ -480,14 +480,6 @@ const threeCarWashingCombinations = [ code: 'TWJ1', model: RelayModelType.JWXC_1700, }, - { - code: 'TWJ2', - model: RelayModelType.JWXC_1700, - }, - { - code: 'TWJ3', - model: RelayModelType.JWXC_1700, - }, { code: 'TGQJ', model: RelayModelType.JWXC_1700, @@ -509,14 +501,6 @@ const threeCarWashingCombinations = [ code: 'CFJ1', model: RelayModelType.JWXC_1700, }, - { - code: 'CFJ2', - model: RelayModelType.JWXC_1700, - }, - { - code: 'CFJ3', - model: RelayModelType.JWXC_1700, - }, { code: 'JTJ', model: RelayModelType.JWXC_1700, @@ -529,24 +513,6 @@ const threeCarWashingCombinations = [ }, ]; -const twoCarWashingCombinations = threeCarWashingCombinations.map( - (combination) => ({ - code: combination.code, - refDeviceCodesAndModel: combination.refDeviceCodesAndModel.filter( - (item) => item.code !== 'TWJ3' && item.code !== 'CFJ3' - ), - }) -); - -const oneCarWashingCombinations = twoCarWashingCombinations.map( - (combination) => ({ - code: combination.code, - refDeviceCodesAndModel: combination.refDeviceCodesAndModel.filter( - (item) => item.code !== 'TWJ2' && item.code !== 'CFJ2' - ), - }) -); - const DeviceType = graphicData.RelatedRef.DeviceType; export const combinationsMap = new Map([ [ @@ -590,8 +556,6 @@ export const combinationsMap = new Map([ [`${DeviceType.Breakers}`, breakersCombinations], [`${DeviceType.PowerScreen}`, powerScreenCombinations], [`${DeviceType.GarageDoor}`, garageDoorCombinations], - [`${DeviceType.CarWashing + '+' + '3'}`, threeCarWashingCombinations], - [`${DeviceType.CarWashing + '+' + '2'}`, twoCarWashingCombinations], - [`${DeviceType.CarWashing + '+' + '1'}`, oneCarWashingCombinations], + [`${DeviceType.CarWashing}`, carWashingCombinations], [`${DeviceType.FloodGate}`, floodGateCombinations], ]); diff --git a/src/layouts/RelayCabinetLayout/RelayCabinetLayout.vue b/src/layouts/RelayCabinetLayout/RelayCabinetLayout.vue index b586db8..d59951d 100644 --- a/src/layouts/RelayCabinetLayout/RelayCabinetLayout.vue +++ b/src/layouts/RelayCabinetLayout/RelayCabinetLayout.vue @@ -260,7 +260,7 @@ import { import { generateRelayLayout, GenerateRelaysCongig } from './GeneraterDevice'; import { getPublishMapInfoById, pageQuery } from 'src/api/PublishApi'; import { ciCjMap, CjData, PostionType } from './GeneraterCiCjConfig'; -import { ciQdMap } from './GeneraterCiQdConfig'; +import { ciQdMap, QdData } from './GeneraterCiQdConfig'; const $q = useQuasar(); const route = useRoute(); @@ -770,16 +770,31 @@ function oneClickGeneraterRelayLayout() { }); //洗车机 storage.carWashings.forEach((carWashing) => { - const duanNum = carWashing.duanNum || 3; + const duanNum = carWashing.duanNum || 1; const deviceCombinations = combinationsMap.get( - `${DeviceType.CarWashing}+${duanNum}` + `${DeviceType.CarWashing}` ); + let changeDeviceCombinations: Combinationtype[] = JSON.parse( + JSON.stringify(deviceCombinations) + ); + if (duanNum > 1) { + for (let i = 2; i <= duanNum; i++) { + changeDeviceCombinations[0].refDeviceCodesAndModel.push({ + code: `TWJ${i}`, + model: RelayModelType.JWXC_1700, + }); + changeDeviceCombinations[1].refDeviceCodesAndModel.push({ + code: `CFJ${i}`, + model: RelayModelType.JWXC_1700, + }); + } + } if ( carWashing.centralizedStations.includes(concentrationStation) && - deviceCombinations + changeDeviceCombinations ) { creatDeviceRelateRelays( - deviceCombinations, + changeDeviceCombinations, DeviceType.CarWashing, carWashing.code ); @@ -817,14 +832,22 @@ function oneClickGeneraterRelayLayout() { const deviceRelateRelayList = loadDeviceRelateRelayList(); const allCjData: relayCabinetGraphicData.CjData[] = []; deviceRelateRelayList.forEach((deviceRelateRelay) => { - const deviceCiCjConfig = ciCjMap.get( - `${deviceRelateRelay.deviceType}+${allDeviceModelMap.get( - `${deviceRelateRelay.deviceType}+${deviceRelateRelay.code}` - )}` - ); - let copyDeviceCiCjConfig: CjData[] = JSON.parse( - JSON.stringify(deviceCiCjConfig) - ); + let deviceCiCjConfig; + if (deviceRelateRelay.deviceType !== DeviceType.CarWashing) { + deviceCiCjConfig = ciCjMap.get( + `${deviceRelateRelay.deviceType}+${allDeviceModelMap.get( + `${deviceRelateRelay.deviceType}+${deviceRelateRelay.code}` + )}` + ); + } else { + deviceCiCjConfig = ciCjMap.get( + `${deviceRelateRelay.deviceType}+undefined` + ); + } + let copyDeviceCiCjConfig: CjData[] = + deviceCiCjConfig === undefined + ? undefined + : JSON.parse(JSON.stringify(deviceCiCjConfig)); //动态配置车站EMP的采集配置 if ( deviceRelateRelay.deviceType == DeviceType.station && @@ -870,6 +893,37 @@ function oneClickGeneraterRelayLayout() { } copyDeviceCiCjConfig = handleCopyDeviceCiCjConfig; } + //动态配置洗车机的采集配置 + if ( + deviceRelateRelay.deviceType == DeviceType.CarWashing && + deviceCiCjConfig + ) { + const duanNum = allDeviceModelMap.get( + `${deviceRelateRelay.deviceType}+${deviceRelateRelay.code}` + ) as string; + for (let i = 2; i <= +duanNum; i++) { + copyDeviceCiCjConfig[0].refDeviceCodesAndPos.push([ + { + code: `TWJ${i}`, + position: PostionType.Q, + }, + ]); + copyDeviceCiCjConfig[1].refDeviceCodesAndPos.push( + [ + { + code: `CFJ${i}`, + position: PostionType.Q, + }, + ], + [ + { + code: `CFJ${i}`, + position: PostionType.H, + }, + ] + ); + } + } copyDeviceCiCjConfig?.forEach((combinationtype) => { combinationtype.refDeviceCodesAndPos.forEach((items) => { const cjData: relayCabinetGraphicData.CjDataItem[] = []; @@ -898,12 +952,35 @@ function oneClickGeneraterRelayLayout() { //根据生成的组合类型列表生成驱动列表 const allQdData: relayCabinetGraphicData.QdData[] = []; deviceRelateRelayList.forEach((deviceRelateRelay) => { - const deviceCiQdConfig = ciQdMap.get( - `${deviceRelateRelay.deviceType}+${allDeviceModelMap.get( + let deviceCiQdConfig: QdData[] | undefined; + let changeDeviceCiQdConfig: QdData[]; + if (deviceRelateRelay.deviceType !== DeviceType.CarWashing) { + deviceCiQdConfig = ciQdMap.get( + `${deviceRelateRelay.deviceType}+${allDeviceModelMap.get( + `${deviceRelateRelay.deviceType}+${deviceRelateRelay.code}` + )}` + ); + changeDeviceCiQdConfig = + deviceCiQdConfig === undefined + ? undefined + : JSON.parse(JSON.stringify(deviceCiQdConfig)); + } else { + deviceCiQdConfig = ciQdMap.get( + `${deviceRelateRelay.deviceType}+undefined` + ); + changeDeviceCiQdConfig = + deviceCiQdConfig === undefined + ? undefined + : JSON.parse(JSON.stringify(deviceCiQdConfig)); + const duanNum = allDeviceModelMap.get( `${deviceRelateRelay.deviceType}+${deviceRelateRelay.code}` - )}` - ); - deviceCiQdConfig?.forEach((combinationtype) => { + ) as string; + for (let i = 2; i <= +duanNum; i++) { + changeDeviceCiQdConfig[0].refDeviceCodes.push([`TWJ${i}`]); + } + } + + changeDeviceCiQdConfig?.forEach((combinationtype) => { combinationtype.refDeviceCodes.forEach((items) => { const qdData: number[] = []; items.forEach((relayCode) => {