feat: bug#11097 修复采集器批量操作失败问题

This commit is contained in:
jackhoo_98 2023-04-01 14:37:17 +08:00
parent 3d5f88cddb
commit 968c68efba
4 changed files with 13 additions and 3 deletions

View File

@ -330,11 +330,13 @@ const handleOk = async () => {
if (data?.configuration.function !== 'HoldingRegisters') { if (data?.configuration.function !== 'HoldingRegisters') {
codec.provider = 'int8'; codec.provider = 'int8';
} }
const { interval } = formData.value.configuration;
const params = { const params = {
...props.data, ...props.data,
...data, ...data,
provider, provider,
collectorId, collectorId,
interval,
}; };
// addressreact使 // addressreact使

View File

@ -132,11 +132,13 @@ const formData = ref({
const handleOk = async () => { const handleOk = async () => {
const data = await formRef.value?.validate(); const data = await formRef.value?.validate();
const { interval } = formData.value.configuration;
const params = { const params = {
...props.data, ...props.data,
...data, ...data,
provider, provider,
collectorId, collectorId,
interval,
}; };
loading.value = true; loading.value = true;

View File

@ -101,7 +101,7 @@ const formRef = ref<FormInstance>();
const formData = ref({ const formData = ref({
accessModes: [], accessModes: [],
interval: '', interval: undefined,
features: [], features: [],
}); });
@ -118,7 +118,10 @@ const handleOk = async () => {
const data = cloneDeep(formData.value); const data = cloneDeep(formData.value);
const { accessModes, features, interval } = data; const { accessModes, features, interval } = data;
const ischange = const ischange =
accessModes.length !== 0 || features.length !== 0 || !!interval; accessModes.length !== 0 ||
features.length !== 0 ||
Number(interval) === 0 ||
!!interval;
if (ischange) { if (ischange) {
const params = cloneDeep(props.data); const params = cloneDeep(props.data);
params.forEach((i: any) => { params.forEach((i: any) => {
@ -132,7 +135,7 @@ const handleOk = async () => {
} }
} }
features.length !== 0 && (i.features = data.features); features.length !== 0 && (i.features = data.features);
if (!!interval) { if (!!interval || Number(interval) === 0) {
i.interval = data.interval; i.interval = data.interval;
i.configuration = { i.configuration = {
...i.configuration, ...i.configuration,

View File

@ -310,6 +310,9 @@ watch(
:deep(.ant-tree-list-holder-inner) { :deep(.ant-tree-list-holder-inner) {
width: 90%; width: 90%;
} }
:deep(.ant-tree-list) {
width: 110%;
}
:deep(.ant-tree-treenode) { :deep(.ant-tree-treenode) {
width: 100%; width: 100%;