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
diff --git a/yarn.lock b/yarn.lock
index 3d77c718..fa4a1c87 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -3837,8 +3837,8 @@ jetlinks-ui-components@^1.0.23:
jetlinks-ui-components@^1.0.24:
version "1.0.24"
- resolved "http://registry.jetlinks.cn/jetlinks-ui-components/-/jetlinks-ui-components-1.0.24.tgz#e973e030eb62714f7ec22202a984fa1d5e6ef451"
- integrity sha512-/3bcz76Fq7MDVHI6GKxcIPLzhPRxY0aSUowH91+SuJzkOqCRcUXhBSfVyEL6mTjg/yi8fvb4Pglfkj2fomFKFw==
+ resolved "http://registry.jetlinks.cn/jetlinks-ui-components/-/jetlinks-ui-components-1.0.24.tgz#c912a709e666fd088d66a19bbc9cb0e9dc618355"
+ integrity sha512-NTnPoAhmvT4/C+uapN/W5R9CFe3YTs3mYN9ZA7wi8ShzQHovhoJFihaOv7WWXwhcqCFPS4EjViJ1S5HPP2P2Cw==
dependencies:
"@vueuse/core" "^9.12.0"
"@vueuse/router" "^9.13.0"