|
@@ -19,7 +19,12 @@ |
|
@@ -19,7 +19,12 @@ |
19
|
import { ModeSwitchButton, EnumTableCardMode } from '/@/components/Widget';
|
19
|
import { ModeSwitchButton, EnumTableCardMode } from '/@/components/Widget';
|
20
|
import { toRaw } from 'vue';
|
20
|
import { toRaw } from 'vue';
|
21
|
import { DataActionModeEnum } from '/@/enums/toolEnum';
|
21
|
import { DataActionModeEnum } from '/@/enums/toolEnum';
|
22
|
- import { ReadAndWriteEnum, TCPProtocolTypeEnum, TransportTypeEnum } from '/@/enums/deviceEnum';
|
22
|
+ import {
|
|
|
23
|
+ DeviceTypeEnum,
|
|
|
24
|
+ ReadAndWriteEnum,
|
|
|
25
|
+ TCPProtocolTypeEnum,
|
|
|
26
|
+ TransportTypeEnum,
|
|
|
27
|
+ } from '/@/enums/deviceEnum';
|
23
|
import { ObjectModelCommandDeliveryModal } from './ObjectModelCommandDeliveryModal';
|
28
|
import { ObjectModelCommandDeliveryModal } from './ObjectModelCommandDeliveryModal';
|
24
|
import { ModalParamsType } from '/#/utils';
|
29
|
import { ModalParamsType } from '/#/utils';
|
25
|
import { AreaChartOutlined } from '@ant-design/icons-vue';
|
30
|
import { AreaChartOutlined } from '@ant-design/icons-vue';
|
|
@@ -312,7 +317,7 @@ |
|
@@ -312,7 +317,7 @@ |
312
|
|
317
|
|
313
|
switch (item.type) {
|
318
|
switch (item.type) {
|
314
|
case DataTypeEnum.BOOL:
|
319
|
case DataTypeEnum.BOOL:
|
315
|
- return !!Number(item.value) ? item.boolOpen : item.boolClose;
|
320
|
+ return !!Number(item.value) ? item.boolOpen! : item.boolClose!;
|
316
|
case DataTypeEnum.ENUM:
|
321
|
case DataTypeEnum.ENUM:
|
317
|
return item.enum?.[item.value as string];
|
322
|
return item.enum?.[item.value as string];
|
318
|
default:
|
323
|
default:
|
|
@@ -328,6 +333,24 @@ |
|
@@ -328,6 +333,24 @@ |
328
|
} as ModalParamsType);
|
333
|
} as ModalParamsType);
|
329
|
};
|
334
|
};
|
330
|
|
335
|
|
|
|
336
|
+ const isTCPCustomProtocolType = computed(() => {
|
|
|
337
|
+ const isTCPType = props.deviceDetail.transportType === TransportTypeEnum.TCP;
|
|
|
338
|
+
|
|
|
339
|
+ return (
|
|
|
340
|
+ isTCPType &&
|
|
|
341
|
+ props.deviceDetail.deviceProfile?.profileData?.transportConfiguration?.protocol ===
|
|
|
342
|
+ TCPProtocolTypeEnum.CUSTOM
|
|
|
343
|
+ );
|
|
|
344
|
+ });
|
|
|
345
|
+
|
|
|
346
|
+ const isGatewayOrSensorTCPCustomDevice = computed(
|
|
|
347
|
+ () =>
|
|
|
348
|
+ unref(isTCPCustomProtocolType) &&
|
|
|
349
|
+ [DeviceTypeEnum.GATEWAY, DeviceTypeEnum.SENSOR].includes(
|
|
|
350
|
+ props.deviceDetail.deviceType as DeviceTypeEnum
|
|
|
351
|
+ )
|
|
|
352
|
+ );
|
|
|
353
|
+
|
331
|
onMounted(() => {
|
354
|
onMounted(() => {
|
332
|
const element = unref(listElRef)?.$el;
|
355
|
const element = unref(listElRef)?.$el;
|
333
|
if (!element) return;
|
356
|
if (!element) return;
|
|
@@ -391,7 +414,10 @@ |
|
@@ -391,7 +414,10 @@ |
391
|
<SvgIcon
|
414
|
<SvgIcon
|
392
|
name="send-command"
|
415
|
name="send-command"
|
393
|
prefix="iconfont"
|
416
|
prefix="iconfont"
|
394
|
- v-if="ReadAndWriteEnum.READ_AND_WRITE === item.accessMode"
|
417
|
+ v-if="
|
|
|
418
|
+ ReadAndWriteEnum.READ_AND_WRITE === item.accessMode &&
|
|
|
419
|
+ !isGatewayOrSensorTCPCustomDevice
|
|
|
420
|
+ "
|
395
|
class="cursor-pointer text-lg text-blue-500"
|
421
|
class="cursor-pointer text-lg text-blue-500"
|
396
|
@click="handleSendCommandModal(item)"
|
422
|
@click="handleSendCommandModal(item)"
|
397
|
/>
|
423
|
/>
|