Compare commits

...

3 Commits

Author SHA1 Message Date
joylink_fanyuhong
82cce6d4dc Merge remote-tracking branch 'origin/develop' into local-test
All checks were successful
CI / Docker-Build (push) Successful in 2m34s
2024-04-02 17:37:05 +08:00
joylink_fanyuhong
f7895a6ac7 local-test环境变量调整 2024-04-02 17:36:24 +08:00
joylink_zhaoerwei
a3c639b414 根据段数动态生成洗车机继电器(考虑3段以上情况) 2024-04-02 16:37:47 +08:00
5 changed files with 102 additions and 133 deletions

View File

@ -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';

View File

@ -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<string, CjData[]>([
[
@ -890,8 +836,6 @@ export const ciCjMap = new Map<string, CjData[]>([
[`${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],
]);

View File

@ -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<string, QdData[]>([
[`${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],
]);

View File

@ -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<string, Combinationtype[]>([
[
@ -590,8 +556,6 @@ export const combinationsMap = new Map<string, Combinationtype[]>([
[`${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],
]);

View File

@ -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(
let deviceCiCjConfig;
if (deviceRelateRelay.deviceType !== DeviceType.CarWashing) {
deviceCiCjConfig = ciCjMap.get(
`${deviceRelateRelay.deviceType}+${allDeviceModelMap.get(
`${deviceRelateRelay.deviceType}+${deviceRelateRelay.code}`
)}`
);
let copyDeviceCiCjConfig: CjData[] = JSON.parse(
JSON.stringify(deviceCiCjConfig)
} 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(
let deviceCiQdConfig: QdData[] | undefined;
let changeDeviceCiQdConfig: QdData[];
if (deviceRelateRelay.deviceType !== DeviceType.CarWashing) {
deviceCiQdConfig = ciQdMap.get(
`${deviceRelateRelay.deviceType}+${allDeviceModelMap.get(
`${deviceRelateRelay.deviceType}+${deviceRelateRelay.code}`
)}`
);
deviceCiQdConfig?.forEach((combinationtype) => {
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}`
) 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) => {