From 0cb8b8bb215b8140fd3931f681dca5d62d73e3d1 Mon Sep 17 00:00:00 2001
From: XieYongHong <18010623010@163.com>
Date: Fri, 14 Jul 2023 11:59:13 +0800
Subject: [PATCH 1/4] fix: bug#16364
---
src/components/FRuleEditor/Debug/index.vue | 10 +++++-----
src/views/device/components/Metadata/Base/Base.vue | 4 +++-
src/views/device/components/Metadata/Base/columns.tsx | 4 ++++
.../Metadata/Base/components/VirtualRule/index.vue | 7 ++++---
yarn.lock | 4 ++--
5 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/src/components/FRuleEditor/Debug/index.vue b/src/components/FRuleEditor/Debug/index.vue
index f168442a..2d34ec3b 100644
--- a/src/components/FRuleEditor/Debug/index.vue
+++ b/src/components/FRuleEditor/Debug/index.vue
@@ -104,7 +104,7 @@
\ No newline at end of file
diff --git a/src/views/rule-engine/Alarm/Configuration/Save/index.vue b/src/views/rule-engine/Alarm/Configuration/Save/index.vue
index 011e2721..a011c493 100644
--- a/src/views/rule-engine/Alarm/Configuration/Save/index.vue
+++ b/src/views/rule-engine/Alarm/Configuration/Save/index.vue
@@ -3,13 +3,13 @@
-
+
-
+
@@ -31,6 +31,12 @@ const changeTabs = (e: any) => {
}
};
const activeKey = ref('1');
+const type = ref('detail')
+
+const typeChange = (_type: string) => {
+ console.log(_type)
+ type.value = _type
+}
\ No newline at end of file
diff --git a/src/views/rule-engine/Alarm/Log/TabComponent/index.vue b/src/views/rule-engine/Alarm/Log/TabComponent/index.vue
index 6fd18e41..f45429f1 100644
--- a/src/views/rule-engine/Alarm/Log/TabComponent/index.vue
+++ b/src/views/rule-engine/Alarm/Log/TabComponent/index.vue
@@ -1,35 +1,11 @@
-
-
-
-
+
{
- const resp = await handleSearch({
- sorts: [{ name: 'alarmTime', order: 'desc' }],
- terms: [{
- column: "targetType",
- termType: "eq",
- type: "and",
- value: "product",
- }]
- });
- if (resp.status === 200) {
- return resp.result.data.map((item: any) => ({
- label: item.sourceName,
- value: item.sourceId,
- }));
- }
- return [];
- },
- },
- },
-];
-const deviceCol = [
- ...columns,
- {
- title: '设备名称',
- dataIndex: 'sourceId',
- key: 'sourceId',
- search: {
- type: 'select',
- options: async () => {
- const resp = await handleSearch({
- sorts: [{ name: 'alarmTime', order: 'desc' }],
- terms: [{
- column: "targetType",
- termType: "eq",
- type: "and",
- value: "device",
- }]
- });
- if (resp.status === 200) {
- return resp.result.data.map((item: any) => ({
- label: item.sourceName,
- value: item.sourceId,
- }));
- }
- return [];
- },
- },
- },
-];
-const orgCol = [
- ...columns,
- {
- title: '组织名称',
- dataIndex: 'sourceId',
- key: 'sourceId',
- search: {
- type: 'select',
- options: async () => {
- const resp = await handleSearch({
- sorts: [{ name: 'alarmTime', order: 'desc' }],
- terms: [{
- column: "targetType",
- termType: "eq",
- type: "and",
- value: "org",
- }]
- });
- if (resp.status === 200) {
- return resp.result.data.map((item: any) => ({
- label: item.sourceName,
- value: item.sourceId,
- }));
- }
- return [];
- },
- },
- },
-];
-const otherCol = [
- ...columns,
- {
- title: '场景名称',
+const newColumns = computed(() => {
+
+ const otherColumns = {
+ title: '产品名称',
dataIndex: 'targetId',
key: 'targetId',
search: {
type: 'select',
options: async () => {
- const resp = await handleSearch({
- sorts: [{ name: 'alarmTime', order: 'desc' }],
- terms: [{
+ const termType = [
+ {
column: "targetType",
termType: "eq",
type: "and",
- value: "other",
- }]
+ value: props.type,
+ }
+ ]
+
+ if (props.id) {
+ termType.push({
+ termType: 'eq',
+ column: 'alarmConfigId',
+ value: props.id,
+ type: 'and',
+ },)
+ }
+
+ const resp: any = await handleSearch({
+ sorts: [{ name: 'alarmTime', order: 'desc' }],
+ terms: termType
});
+ const listMap: Map = new Map()
+
if (resp.status === 200) {
- return resp.result.data.map((item: any) => ({
- label: item.targetName,
- value: item.targetId,
- }));
+ resp.result.data.forEach(item => {
+ if (item.targetId) {
+ listMap.set(item.targetId, {
+ label: item.targetName,
+ value: item.targetId,
+ })
+ }
+
+ })
+
+ return [...listMap.values()]
+
}
return [];
},
},
- },
-]
+ }
+
+ switch(props.type) {
+ case 'device':
+ otherColumns.title = '设备名称'
+ break;
+ case 'org':
+ otherColumns.title = '组织名称'
+ break;
+ case 'other':
+ otherColumns.title = '场景名称'
+ break;
+ }
+
+ return ['all', 'detail'].includes(props.type) ? columns : [
+ otherColumns,
+ ...columns,
+ ]
+})
let params: any = ref({
sorts: [{ name: 'alarmTime', order: 'desc' }],
diff --git a/src/views/rule-engine/Alarm/Log/TabComponent/util.ts b/src/views/rule-engine/Alarm/Log/TabComponent/util.ts
new file mode 100644
index 00000000..e69de29b
From c017f82c36e3d70500e552b6369e3a2a482b9371 Mon Sep 17 00:00:00 2001
From: 100011797 <2642441182@qq.com>
Date: Fri, 14 Jul 2023 14:24:35 +0800
Subject: [PATCH 4/4] =?UTF-8?q?fix:=20=E6=95=B0=E6=8D=AE=E9=87=87=E9=9B=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Point/components/BatchUpdate/index.vue | 21 ++++++-------------
1 file changed, 6 insertions(+), 15 deletions(-)
diff --git a/src/views/DataCollect/Collector/Point/components/BatchUpdate/index.vue b/src/views/DataCollect/Collector/Point/components/BatchUpdate/index.vue
index 02b7f3ec..5864a71b 100644
--- a/src/views/DataCollect/Collector/Point/components/BatchUpdate/index.vue
+++ b/src/views/DataCollect/Collector/Point/components/BatchUpdate/index.vue
@@ -4,6 +4,7 @@
:visible="true"
width="700px"
@cancel="handleCancel"
+ :destroyOnClose="true"
>
将批量修改
@@ -86,7 +87,6 @@