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