From c99d2795bcdc3c995c504372c902bc2a5005f329 Mon Sep 17 00:00:00 2001
From: xieyonghong <18010623010@163.com>
Date: Wed, 26 Apr 2023 10:00:27 +0800
Subject: [PATCH 1/7] fix: bug#12637
---
src/views/DataCollect/Collector/Point/Save/SaveModBus.vue | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/views/DataCollect/Collector/Point/Save/SaveModBus.vue b/src/views/DataCollect/Collector/Point/Save/SaveModBus.vue
index 3713b8d6..1480064b 100644
--- a/src/views/DataCollect/Collector/Point/Save/SaveModBus.vue
+++ b/src/views/DataCollect/Collector/Point/Save/SaveModBus.vue
@@ -62,9 +62,9 @@
/>
- PLC地址:{{
+ PLC地址: {{
InitAddress[formData.configuration.function] +
- formData.pointKey || 0
+ Number(formData.pointKey) || 0
}}
Date: Wed, 26 Apr 2023 10:25:49 +0800
Subject: [PATCH 2/7] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=8F=B3=E4=B8=8A?=
=?UTF-8?q?=E8=A7=92=E9=80=9A=E7=9F=A5=E6=96=87=E4=BB=B6notification?=
=?UTF-8?q?=E5=85=BC=E5=AE=B9=E5=A4=84=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/Layout/components/Notice.vue | 68 +++++++++----------
.../DataCollect/Collector/Point/index.vue | 25 +++----
2 files changed, 45 insertions(+), 48 deletions(-)
diff --git a/src/components/Layout/components/Notice.vue b/src/components/Layout/components/Notice.vue
index 25570448..b6485554 100644
--- a/src/components/Layout/components/Notice.vue
+++ b/src/components/Layout/components/Notice.vue
@@ -45,47 +45,43 @@ const subscribeNotice = () => {
total.value += 1;
notification.open({
message: resp?.payload?.topicName,
- description: () => (
- {
- {
- /* changeStatus_api('_read', [resp.id]); */
- }
- read('', resp);
- }}
- >
- {resp?.payload?.message}
-
- ),
+ description: () =>
+ h(
+ 'div',
+ {
+ class: "ellipsis",
+ style: {
+ cursor: 'pointer'
+ },
+ onClick: () => {
+ read('', resp);
+ }
+ },
+ {
+ default: () => resp?.payload?.message
+ }
+ )
+ ,
onClick: () => {
// changeStatus_api('_read', [resp.id])
read('', resp);
},
key: resp.payload.id,
- btn: (
-
- ),
+ btn: () =>
+ h(
+ Button,
+ {
+ type: "primary",
+ size: "small",
+ onClick: (e: Event) => {
+ e.stopPropagation();
+ read('_read', resp);
+ }
+ },
+ {
+ default: () => "标记已读"
+ }
+ ),
});
});
};
diff --git a/src/views/DataCollect/Collector/Point/index.vue b/src/views/DataCollect/Collector/Point/index.vue
index c2fee56d..fea336b3 100644
--- a/src/views/DataCollect/Collector/Point/index.vue
+++ b/src/views/DataCollect/Collector/Point/index.vue
@@ -468,7 +468,7 @@ const columns = [
const subRef = ref();
const propertyValue = ref(new Map());
-
+const cacheIds = ref()
const showBatch = ref(false);
const clickBatch = () => {
@@ -657,15 +657,18 @@ const onCheckAllChange = (e: any) => {
watch(
() => tableRef?.value?._dataSource,
(value) => {
+ subRef.value?.unsubscribe();
if (value.length !== 0) {
- subscribeProperty(value);
- value.forEach((item: any) => {
- item?.accessModes?.forEach((i: any) => {
- if (i?.value === 'read') {
- ReadIdMap.set(item.id, item);
- }
- });
- });
+ setTimeout(() => {
+ subscribeProperty(value);
+ value.forEach((item: any) => {
+ item?.accessModes?.forEach((i: any) => {
+ if (i?.value === 'read') {
+ ReadIdMap.set(item.id, item);
+ }
+ });
+ });
+ }, 100)
}
cancelSelect();
checkAll.value = false;
@@ -701,9 +704,7 @@ watch(
);
onUnmounted(() => {
- if (subRef.value) {
- subRef.value?.unsubscribe();
- }
+ subRef.value?.unsubscribe();
});
/**
From 122c7ae928751b2711f500c394acbd35457eb17d Mon Sep 17 00:00:00 2001
From: xieyonghong <18010623010@163.com>
Date: Wed, 26 Apr 2023 14:30:09 +0800
Subject: [PATCH 3/7] =?UTF-8?q?fix:=20bug#12637=E3=80=8112632?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/DataCollect/Collector/Point/index.vue | 9 +++++----
.../DataCollect/Collector/Tree/Save/index.vue | 8 ++++----
src/views/DataCollect/Collector/Tree/index.vue | 14 ++++++++++----
src/views/DataCollect/Collector/index.vue | 2 +-
.../link/AccessConfig/components/Media/GB28181.vue | 2 +-
.../link/AccessConfig/components/Media/index.vue | 2 +-
.../system/Department/components/LeftTree.vue | 2 +-
src/views/system/Role/components/AddDialog.vue | 2 +-
vite.config.ts | 2 +-
9 files changed, 25 insertions(+), 18 deletions(-)
diff --git a/src/views/DataCollect/Collector/Point/index.vue b/src/views/DataCollect/Collector/Point/index.vue
index fea336b3..fd04b68b 100644
--- a/src/views/DataCollect/Collector/Point/index.vue
+++ b/src/views/DataCollect/Collector/Point/index.vue
@@ -376,7 +376,8 @@ const defaultParams = ref({
terms: [
{
column: 'collectorId',
- value: props.data.id,
+ termType: 'eq',
+ value: !props.data?.id ? 'undefined' : (props.data.id === '*' ? undefined : props.data.id),
},
],
},
@@ -628,10 +629,10 @@ const handleSubscribeValue = throttle((payload: any) => {
const subscribeProperty = (value: any) => {
const list = value.map((item: any) => item.id);
const id = `collector-${props.data?.channelId || 'channel'}-${
- props.data?.id || 'point'
+ (props.data?.id || (props.data && props.data.id === '*')) ? 'point' : props.data?.id
}-data-${list.join('-')}`;
const topic = `/collector/${props.data?.channelId || '*'}/${
- props.data?.id || '*'
+ (props.data?.id || (props.data && props.data.id === '*')) ? '*' : props.data?.id
}/data`;
subRef.value = getWebSocket(id, topic, {
pointId: list.join(','),
@@ -694,7 +695,7 @@ watch(
label: '订阅',
value: 'subscribe',
});
- defaultParams.value.terms[0].terms[0].value = value.id;
+ defaultParams.value.terms[0].terms[0].value = !value.id ? 'undefined' : (value.id === '*' ? undefined : value.id);
tableRef?.value?.reload && tableRef?.value?.reload();
cancelSelect();
checkAll.value = false;
diff --git a/src/views/DataCollect/Collector/Tree/Save/index.vue b/src/views/DataCollect/Collector/Tree/Save/index.vue
index 7f325ae7..42c95c48 100644
--- a/src/views/DataCollect/Collector/Tree/Save/index.vue
+++ b/src/views/DataCollect/Collector/Tree/Save/index.vue
@@ -224,12 +224,12 @@ const handleOk = async () => {
loading.value = true;
const response = !id
- ? await save(params)
- : await update(id, { ...props.data, ...params });
- if (response.status === 200) {
+ ? await save(params).catch(() => { success: false })
+ : await update(id, { ...props.data, ...params }).catch(() => { success: false });
+ loading.value = false;
+ if (response.success) {
emit('change', true);
}
- loading.value = false;
};
const getTypeTooltip = (value: string) =>
diff --git a/src/views/DataCollect/Collector/Tree/index.vue b/src/views/DataCollect/Collector/Tree/index.vue
index 29cfecd0..f614a4de 100644
--- a/src/views/DataCollect/Collector/Tree/index.vue
+++ b/src/views/DataCollect/Collector/Tree/index.vue
@@ -25,8 +25,8 @@
v-model:selected-keys="selectedKeys"
:fieldNames="{ key: 'id' }"
v-if="
- defualtDataSource.length !== 0 ||
- defualtDataSource?.[0]?.children?.length !== 0
+ !(defualtDataSource.length === 0 ||
+ defualtDataSource?.[0]?.children?.length === 0)
"
:height="660"
defaultExpandAll
@@ -247,7 +247,7 @@ const handleSearch = async (value: any) => {
collectorAll.value = res.result;
if (selectedKeys.value.length === 0) {
- selectedKeys.value = ['*'];
+ selectedKeys.value = res.result.length ? ['*'] : [];
}
//激活change事件
@@ -259,8 +259,8 @@ const handleSearch = async (value: any) => {
}
spinning.value = false;
};
-
const getChannelNoPaging = async () => {
+
const res = await queryChannelNoPaging();
Store.set('channelListAll', res.result);
};
@@ -275,8 +275,14 @@ watch(
(n, p) => {
const key = _.isArray(n) ? n[0] : n;
if (key) {
+ if (key !== "*") {
const row = collectorAll.value.find((i: any) => i.id === key);
emits('change', row);
+ } else {
+ emits('change', {
+ id: '*'
+ });
+ }
} else {
selectedKeys.value = p; // 防止取消
}
diff --git a/src/views/DataCollect/Collector/index.vue b/src/views/DataCollect/Collector/index.vue
index 4bc78162..cf6abe03 100644
--- a/src/views/DataCollect/Collector/index.vue
+++ b/src/views/DataCollect/Collector/index.vue
@@ -19,7 +19,7 @@ import Tree from './Tree/index.vue';
import Point from './Point/index.vue';
const data = ref();
-const spinning = ref(true);
+const spinning = ref(false);
const changeTree = (row: any) => {
spinning.value = true;
diff --git a/src/views/link/AccessConfig/components/Media/GB28181.vue b/src/views/link/AccessConfig/components/Media/GB28181.vue
index 9d1466e4..20251b43 100644
--- a/src/views/link/AccessConfig/components/Media/GB28181.vue
+++ b/src/views/link/AccessConfig/components/Media/GB28181.vue
@@ -655,7 +655,7 @@ const saveData = () => {
if (route.query.save) {
// @ts-ignore
window?.onTabSaveSuccess(resp);
- window.close();
+ setTimeout(() => window.close(), 300);
} else {
history.back();
}
diff --git a/src/views/link/AccessConfig/components/Media/index.vue b/src/views/link/AccessConfig/components/Media/index.vue
index 81dee461..90e28099 100644
--- a/src/views/link/AccessConfig/components/Media/index.vue
+++ b/src/views/link/AccessConfig/components/Media/index.vue
@@ -125,7 +125,7 @@ const onFinish = async (values: any) => {
if (route.query.save) {
// @ts-ignore
window?.onTabSaveSuccess(resp.result);
- window.close();
+ setTimeout(() => window.close(), 300);
} else {
history.back();
}
diff --git a/src/views/system/Department/components/LeftTree.vue b/src/views/system/Department/components/LeftTree.vue
index fe00fa10..ccdfcf86 100644
--- a/src/views/system/Department/components/LeftTree.vue
+++ b/src/views/system/Department/components/LeftTree.vue
@@ -188,7 +188,7 @@ function delDepartment(id: string) {
function refresh(id: string) {
// @ts-ignore
window?.onTabSaveSuccess && window.onTabSaveSuccess(id);
- window.close();
+ setTimeout(() => window.close(), 300);
getTree();
}
diff --git a/src/views/system/Role/components/AddDialog.vue b/src/views/system/Role/components/AddDialog.vue
index 89941f64..6af3be50 100644
--- a/src/views/system/Role/components/AddDialog.vue
+++ b/src/views/system/Role/components/AddDialog.vue
@@ -65,7 +65,7 @@ const confirm = () => {
if (route.query.save) {
// @ts-ignore
window?.onTabSaveSuccess(resp.result.id);
- window.close();
+ setTimeout(() => window.close(), 300);
} else jumpPage(`system/Role/Detail`, { id: resp.result.id });
}
})
diff --git a/vite.config.ts b/vite.config.ts
index 03a65eec..b26c9a8a 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -96,7 +96,7 @@ export default defineConfig(({ mode}) => {
// target: 'http://192.168.32.244:8881',
target: 'http://120.77.179.54:8844', // 120测试
// target: 'http://192.168.33.46:8844', // 本地开发环境
- ws: 'ws://192.168.33.46:8844',
+ ws: 'ws://120.77.179.54:8844',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '')
}
From b193c56f64874912333148dd251d0cc4fe5185c1 Mon Sep 17 00:00:00 2001
From: xieyonghong <18010623010@163.com>
Date: Wed, 26 Apr 2023 14:31:28 +0800
Subject: [PATCH 4/7] fix: bug#12460
---
.../Instance/Detail/Info/components/Config/Save.vue | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/views/device/Instance/Detail/Info/components/Config/Save.vue b/src/views/device/Instance/Detail/Info/components/Config/Save.vue
index c318ec66..788b39e9 100644
--- a/src/views/device/Instance/Detail/Info/components/Config/Save.vue
+++ b/src/views/device/Instance/Detail/Info/components/Config/Save.vue
@@ -21,9 +21,11 @@
{{ i.name }}
@@ -90,7 +92,8 @@ const onClose = () => {
};
const saveBtn = () => {
- formRef.value.validate().then(async () => {
+ formRef.value.validate().then(async (res) => {
+ if (res) {
const values = toRaw(modelRef);
const resp = await modify(instanceStore.current?.id || '', {
id: instanceStore.current?.id,
@@ -100,6 +103,7 @@ const saveBtn = () => {
message.success('操作成功!')
emit('save');
}
+ }
});
};
\ No newline at end of file
From 0a661d4a643b34385a60a2f0de9d2c14b69cdcb8 Mon Sep 17 00:00:00 2001
From: xieyonghong <18010623010@163.com>
Date: Wed, 26 Apr 2023 16:26:41 +0800
Subject: [PATCH 5/7] fix: bug#12362
---
src/views/device/Instance/Process/index.vue | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/views/device/Instance/Process/index.vue b/src/views/device/Instance/Process/index.vue
index 0437cc9d..643b5fc6 100644
--- a/src/views/device/Instance/Process/index.vue
+++ b/src/views/device/Instance/Process/index.vue
@@ -54,7 +54,7 @@ const handleCancel = () => {
};
const _percent = computed(() => {
- return ((errCount.value + count.value) / total.value * 100).toFixed(2)
+ return total.value ? ((errCount.value + count.value) / total.value * 100).toFixed(2) : 0
})
const getData = (api: string) => {
@@ -82,6 +82,12 @@ const getData = (api: string) => {
default:
break;
}
+ if ((count.value + errCount.value) >= total.value) {
+ setTimeout(() => {
+ _source.close();
+ flag.value = false;
+ }, 500)
+ }
};
_source.onerror = () => {
_source.close();
From 84fa6f877be94dcd2b06b7d47c66b9cb140fd87f Mon Sep 17 00:00:00 2001
From: xieyonghong <18010623010@163.com>
Date: Wed, 26 Apr 2023 16:38:39 +0800
Subject: [PATCH 6/7] fix: bug#12350
---
.../device/Product/Detail/DeviceAccess/accessModal.vue | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/views/device/Product/Detail/DeviceAccess/accessModal.vue b/src/views/device/Product/Detail/DeviceAccess/accessModal.vue
index 67a044ee..97d081d3 100644
--- a/src/views/device/Product/Detail/DeviceAccess/accessModal.vue
+++ b/src/views/device/Product/Detail/DeviceAccess/accessModal.vue
@@ -12,7 +12,7 @@
>({
pageSize: 4,
terms: [],
})
+
const selectedRowKeys = ref(props.accessId ? [props.accessId] : [])
const getDescription = (slotProps: Record) =>
@@ -279,7 +280,7 @@ const cancel = () => {
};
const handleSearch = (e: any) => {
- params.value = e;
+ params.value.terms = e.terms;
};
const handleClick = (data: any) => {
From ca4c3641558f2f79de5bbd429061e02853b8d571 Mon Sep 17 00:00:00 2001
From: xieyonghong <18010623010@163.com>
Date: Wed, 26 Apr 2023 18:05:23 +0800
Subject: [PATCH 7/7] fix: bug#12338
---
src/views/link/DashBoard/components/Cpu.vue | 28 ++++++++++-------
src/views/link/DashBoard/components/Jvm.vue | 28 ++++++++++-------
.../link/DashBoard/components/Network.vue | 30 +++++++++++--------
.../link/DashBoard/components/TopCard.vue | 19 +++++++++++-
src/views/link/DashBoard/index.vue | 15 +++++++---
vite.config.ts | 2 +-
6 files changed, 81 insertions(+), 41 deletions(-)
diff --git a/src/views/link/DashBoard/components/Cpu.vue b/src/views/link/DashBoard/components/Cpu.vue
index fbe6b86d..0d47222a 100644
--- a/src/views/link/DashBoard/components/Cpu.vue
+++ b/src/views/link/DashBoard/components/Cpu.vue
@@ -61,6 +61,13 @@ import {
} from './tool.ts';
import { DataType } from '../typings';
+const props = defineProps({
+ serviceId: {
+ type: String,
+ default: undefined
+ }
+})
+
const chartRef = ref>({});
const loading = ref(false);
const data = ref({
@@ -79,7 +86,8 @@ const getCPUEcharts = async (val: any) => {
const _cpuOptions = {};
const _cpuXAxis = new Set();
if (res.result?.length) {
- res.result.forEach((item: any) => {
+ const filterArray = res.result.filter((item : any) => item.data?.clusterNodeId === props.serviceId)
+ filterArray.forEach((item: any) => {
const value = item.data.value;
const nodeID = item.data.clusterNodeId;
_cpuXAxis.add(
@@ -168,16 +176,14 @@ watch(
},
{ immediate: true, deep: true },
);
-watch(
- () => data.value,
- (val) => {
- const { time } = val;
- if (time && Array.isArray(time) && time.length === 2 && time[0]) {
- getCPUEcharts(val);
- }
- },
- { immediate: true, deep: true },
-);
+
+watchEffect(() => {
+ const time = data.value.time
+ if (time && Array.isArray(time) && time.length === 2 && time[0] && props.serviceId) {
+ getCPUEcharts(data.value);
+ }
+})
+
diff --git a/vite.config.ts b/vite.config.ts
index b26c9a8a..4f292d21 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -95,7 +95,7 @@ export default defineConfig(({ mode}) => {
// target: 'http://192.168.32.226:8844',
// target: 'http://192.168.32.244:8881',
target: 'http://120.77.179.54:8844', // 120测试
- // target: 'http://192.168.33.46:8844', // 本地开发环境
+ // target: 'http://192.168.33.46:8844', // 本地开发环境
ws: 'ws://120.77.179.54:8844',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '')