fix: bug#11233、11276
This commit is contained in:
parent
63ec13e49b
commit
11cf92b90e
|
@ -334,7 +334,7 @@ import SaveModBus from './Save/SaveModBus.vue';
|
|||
import SaveOPCUA from './Save/SaveOPCUA.vue';
|
||||
import Scan from './Scan/index.vue';
|
||||
import { colorMap } from '../data.ts';
|
||||
import { cloneDeep, isNumber } from 'lodash-es';
|
||||
import { cloneDeep, isNumber, throttle } from 'lodash-es';
|
||||
import { getWebSocket } from '@/utils/websocket';
|
||||
import { map } from 'rxjs/operators';
|
||||
import dayjs from 'dayjs';
|
||||
|
@ -616,17 +616,6 @@ const handleClick = (dt: any) => {
|
|||
}
|
||||
};
|
||||
|
||||
//节流
|
||||
let timer: any = null;
|
||||
function throttle(fn: any, delay = 1000) {
|
||||
if (timer == null) {
|
||||
timer = setTimeout(() => {
|
||||
fn();
|
||||
clearTimeout(timer);
|
||||
timer = null;
|
||||
}, delay);
|
||||
}
|
||||
}
|
||||
const subscribeProperty = (value: any) => {
|
||||
const list = value.map((item: any) => item.id);
|
||||
const id = `collector-${props.data?.channelId || 'channel'}-${
|
||||
|
@ -643,7 +632,7 @@ const subscribeProperty = (value: any) => {
|
|||
//防止刷新过快
|
||||
throttle(() => {
|
||||
propertyValue.value.set(payload.pointId, payload);
|
||||
});
|
||||
}, 1000);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -107,11 +107,7 @@
|
|||
/>
|
||||
</j-form-item>
|
||||
<div style="color: #616161" v-if="visibleEndian">
|
||||
<p>
|
||||
当前内存布局:{{
|
||||
endianMap.get(formData.configuration.endian)
|
||||
}}{{ endianMap.get(formData.configuration.endianIn) }}
|
||||
</p>
|
||||
<p>当前内存布局: {{ endianData }}</p>
|
||||
<p>
|
||||
只有4字节数据类型(int32、ieee754 float)
|
||||
具有4种内存布局,其它只有ABCD、DCBA两种内存布局(以双字配置为准)
|
||||
|
@ -182,10 +178,21 @@ const emit = defineEmits(['change']);
|
|||
const id = props.data.id;
|
||||
const formRef = ref<FormInstance>();
|
||||
|
||||
const endianMap = new Map([
|
||||
['BIG', 'AB'],
|
||||
['LITTLE', 'BA'],
|
||||
]);
|
||||
|
||||
const endianData = computed(() => {
|
||||
const { endian, endianIn } = formData.value.configuration;
|
||||
if (endian) {
|
||||
if (endianIn) {
|
||||
if (endian === 'BIG') {
|
||||
return endianIn === 'BIG' ? 'ABCD' : 'BADC';
|
||||
} else {
|
||||
return endianIn === 'BIG' ? 'CDBA' : 'DCBA';
|
||||
}
|
||||
} else {
|
||||
return endian === 'BIG' ? 'ABCD' : 'DCBA';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const formData = ref({
|
||||
channelId: undefined,
|
||||
|
|
|
@ -1366,10 +1366,7 @@ const getDetail = () => {
|
|||
...configuration,
|
||||
};
|
||||
} else {
|
||||
dynamicValidateForm.cluster = {
|
||||
...cloneDeep(FormStates2), //同上
|
||||
...cluster,
|
||||
};
|
||||
dynamicValidateForm.cluster = cluster;
|
||||
}
|
||||
|
||||
if (dynamicValidateForm.cluster.length === 1) {
|
||||
|
|
Loading…
Reference in New Issue