|
@@ -10,62 +10,48 @@ |
|
@@ -10,62 +10,48 @@ |
|
10
|
alt="移除"
|
10
|
alt="移除"
|
|
11
|
src="../../../../assets/images/close.png"
|
11
|
src="../../../../assets/images/close.png"
|
|
12
|
/>
|
12
|
/>
|
|
13
|
- <!-- <DeleteOutlined style="font-size: 20px" class="mr-2" /> -->
|
|
|
|
14
|
</div>
|
13
|
</div>
|
|
15
|
</template>
|
14
|
</template>
|
|
16
|
<div class="alert-type" style="margin-left: -26px; margin-top: -10px">
|
15
|
<div class="alert-type" style="margin-left: -26px; margin-top: -10px">
|
|
17
|
<BasicForm @register="registerForm"
|
16
|
<BasicForm @register="registerForm"
|
|
18
|
/></div>
|
17
|
/></div>
|
|
19
|
- <CollapseContainer style="margin-top: -20px">
|
|
|
|
20
|
- <template #action> </template>
|
|
|
|
21
|
- <div style="margin-left: 10px; margin-top: -10px">
|
|
|
|
22
|
- <BasicForm @register="registerFormHighSetting">
|
18
|
+ <div style="margin-top: -20px">
|
|
|
|
19
|
+ <div style="margin-left: 20px; margin-top: -10px">
|
|
|
|
20
|
+ <BasicForm
|
|
|
|
21
|
+ @register="registerFormHighSetting"
|
|
|
|
22
|
+ style="margin-left: 12px; margin-top: -10px"
|
|
|
|
23
|
+ >
|
|
23
|
<template #checkBox="{ model, field }">
|
24
|
<template #checkBox="{ model, field }">
|
|
24
|
<Checkbox v-model:checked="model[field]">传递报警</Checkbox>
|
25
|
<Checkbox v-model:checked="model[field]">传递报警</Checkbox>
|
|
25
|
</template>
|
26
|
</template>
|
|
26
|
</BasicForm>
|
27
|
</BasicForm>
|
|
27
|
</div>
|
28
|
</div>
|
|
28
|
- </CollapseContainer>
|
29
|
+ </div>
|
|
29
|
<p>创建报警规则</p>
|
30
|
<p>创建报警规则</p>
|
|
30
|
<template v-for="(childItem, createIndex) in item.alarms" :key="childItem.id">
|
31
|
<template v-for="(childItem, createIndex) in item.alarms" :key="childItem.id">
|
|
31
|
- <div class="aic mb-1" style="border: 1px solid #bfbfbf">
|
32
|
+ <div class="aic" style="border: 1px solid #bfbfbf">
|
|
32
|
<div class="w-3/4">
|
33
|
<div class="w-3/4">
|
|
33
|
<div style="margin-left: -30px; margin-top: 20px"
|
34
|
<div style="margin-left: -30px; margin-top: 20px"
|
|
34
|
><BasicForm @register="registerFormCreateAlarm" />
|
35
|
><BasicForm @register="registerFormCreateAlarm" />
|
|
35
|
</div>
|
36
|
</div>
|
|
36
|
- <div style="margin-left: 5px">
|
|
|
|
37
|
- <div style="color: #f5594e" class="mt-4 ml-4"
|
37
|
+ <div style="margin-left: 5px; margin-top: -50px">
|
|
|
|
38
|
+ <div style="color: #f5594e" class="ml-4"
|
|
38
|
>报警规则条件:
|
39
|
>报警规则条件:
|
|
39
|
<Button size="small" type="primary" @click="handleOpenAlaramRuleConditions"
|
40
|
<Button size="small" type="primary" @click="handleOpenAlaramRuleConditions"
|
|
40
|
>添加</Button
|
41
|
>添加</Button
|
|
41
|
>
|
42
|
>
|
|
42
|
<p>{{ ruleTemplateData }}</p>
|
43
|
<p>{{ ruleTemplateData }}</p>
|
|
43
|
- <!-- <PlusOutlined
|
|
|
|
44
|
- @click="handleOpenAlaramRuleConditions"
|
|
|
|
45
|
- class="cursor-pointer ml-4"
|
|
|
|
46
|
- style="font-size: 20px"
|
|
|
|
47
|
- />{{ ruleTemplateData }} -->
|
|
|
|
48
|
</div>
|
44
|
</div>
|
|
49
|
<div style="white-space: wrap" class="mt-4 ml-4"
|
45
|
<div style="white-space: wrap" class="mt-4 ml-4"
|
|
50
|
>启用规则:
|
46
|
>启用规则:
|
|
51
|
<Button size="small" type="primary" @click="handleOpenEnableRule">添加</Button>
|
47
|
<Button size="small" type="primary" @click="handleOpenEnableRule">添加</Button>
|
|
52
|
<p>{{ enableTemplateData }}</p>
|
48
|
<p>{{ enableTemplateData }}</p>
|
|
53
|
- <!-- <EditOutlined
|
|
|
|
54
|
- @click="handleOpenEnableRule"
|
|
|
|
55
|
- class="cursor-pointer ml-4"
|
|
|
|
56
|
- style="font-size: 20px"
|
|
|
|
57
|
- /> -->
|
|
|
|
58
|
<div class="mt-4 ml-4" style="margin-left: 0px"
|
49
|
<div class="mt-4 ml-4" style="margin-left: 0px"
|
|
59
|
>详情模板:
|
50
|
>详情模板:
|
|
60
|
<Button size="small" type="primary" @click="handleOpenDetailTemplate"
|
51
|
<Button size="small" type="primary" @click="handleOpenDetailTemplate"
|
|
61
|
>添加</Button
|
52
|
>添加</Button
|
|
62
|
>
|
53
|
>
|
|
63
|
<p>{{ detailTemplateData }}</p>
|
54
|
<p>{{ detailTemplateData }}</p>
|
|
64
|
- <!-- <EditOutlined
|
|
|
|
65
|
- @click="handleOpenDetailTemplate"
|
|
|
|
66
|
- class="cursor-pointer ml-4"
|
|
|
|
67
|
- style="font-size: 20px"
|
|
|
|
68
|
- /> -->
|
|
|
|
69
|
</div>
|
55
|
</div>
|
|
70
|
<div style="margin-left: 0px; position: relative">
|
56
|
<div style="margin-left: 0px; position: relative">
|
|
71
|
<BasicForm @register="dashboardForm" />
|
57
|
<BasicForm @register="dashboardForm" />
|
|
@@ -74,7 +60,7 @@ |
|
@@ -74,7 +60,7 @@ |
|
74
|
</div>
|
60
|
</div>
|
|
75
|
<div
|
61
|
<div
|
|
76
|
class="remove-type"
|
62
|
class="remove-type"
|
|
77
|
- style="display: inline-block; position: relative; top: -304px; left: 800px"
|
63
|
+ style="display: inline-block; position: relative; top: -237px; left: 800px"
|
|
78
|
>
|
64
|
>
|
|
79
|
<img
|
65
|
<img
|
|
80
|
style="cursor: pointer"
|
66
|
style="cursor: pointer"
|
|
@@ -82,13 +68,6 @@ |
|
@@ -82,13 +68,6 @@ |
|
82
|
alt="移除"
|
68
|
alt="移除"
|
|
83
|
src="../../../../assets/images/close.png"
|
69
|
src="../../../../assets/images/close.png"
|
|
84
|
/>
|
70
|
/>
|
|
85
|
- <!-- <Tooltip title="移除">
|
|
|
|
86
|
- <MinusCircleOutlined
|
|
|
|
87
|
- style="font-size: 25px; color: #305680"
|
|
|
|
88
|
- class="cursor-pointer"
|
|
|
|
89
|
- @click="deleteCondition(index, createIndex)"
|
|
|
|
90
|
- />
|
|
|
|
91
|
- </Tooltip> -->
|
|
|
|
92
|
</div>
|
71
|
</div>
|
|
93
|
</div>
|
72
|
</div>
|
|
94
|
</div>
|
73
|
</div>
|
|
@@ -98,7 +77,10 @@ |
|
@@ -98,7 +77,10 @@ |
|
98
|
>
|
77
|
>
|
|
99
|
<div style="height: 20px"></div>
|
78
|
<div style="height: 20px"></div>
|
|
100
|
<p>清除报警规则</p>
|
79
|
<p>清除报警规则</p>
|
|
101
|
- <template v-for="(childItem, createIndex) in item.clearAlarms" :key="childItem.id">
|
80
|
+ <template
|
|
|
|
81
|
+ v-for="(childClearItem, createIndex) in item.alarms[0].clearRule"
|
|
|
|
82
|
+ :key="childClearItem.id"
|
|
|
|
83
|
+ >
|
|
102
|
<div class="aic mb-1" style="border: 1px solid #bfbfbf">
|
84
|
<div class="aic mb-1" style="border: 1px solid #bfbfbf">
|
|
103
|
<div class="w-3/4">
|
85
|
<div class="w-3/4">
|
|
104
|
<div style="margin-left: 5px">
|
86
|
<div style="margin-left: 5px">
|
|
@@ -108,11 +90,6 @@ |
|
@@ -108,11 +90,6 @@ |
|
108
|
>添加</Button
|
90
|
>添加</Button
|
|
109
|
>
|
91
|
>
|
|
110
|
<p>{{ ruleClearTemplateData }}</p>
|
92
|
<p>{{ ruleClearTemplateData }}</p>
|
|
111
|
- <!-- <PlusOutlined
|
|
|
|
112
|
- @click="handleOpenClearAlaramRuleConditions"
|
|
|
|
113
|
- class="cursor-pointer ml-4"
|
|
|
|
114
|
- style="font-size: 20px"
|
|
|
|
115
|
- /> -->
|
|
|
|
116
|
</div>
|
93
|
</div>
|
|
117
|
<div style="white-space: wrap" class="mt-4 ml-4"
|
94
|
<div style="white-space: wrap" class="mt-4 ml-4"
|
|
118
|
>启用规则:
|
95
|
>启用规则:
|
|
@@ -120,49 +97,21 @@ |
|
@@ -120,49 +97,21 @@ |
|
120
|
>添加</Button
|
97
|
>添加</Button
|
|
121
|
>
|
98
|
>
|
|
122
|
<p>{{ enableClearTemplateData }}</p>
|
99
|
<p>{{ enableClearTemplateData }}</p>
|
|
123
|
- <!-- <EditOutlined
|
|
|
|
124
|
- @click="handleOpenClearEnableRule"
|
|
|
|
125
|
- class="cursor-pointer ml-4"
|
|
|
|
126
|
- style="font-size: 20px"
|
|
|
|
127
|
- /> -->
|
|
|
|
128
|
<div class="mt-4 ml-4" style="margin-left: 0px"
|
100
|
<div class="mt-4 ml-4" style="margin-left: 0px"
|
|
129
|
>详情模板:
|
101
|
>详情模板:
|
|
130
|
<Button size="small" type="primary" @click="handleOpenClearDetailTemplate"
|
102
|
<Button size="small" type="primary" @click="handleOpenClearDetailTemplate"
|
|
131
|
>添加</Button
|
103
|
>添加</Button
|
|
132
|
>
|
104
|
>
|
|
133
|
<p>{{ detailClearTemplateData }}</p>
|
105
|
<p>{{ detailClearTemplateData }}</p>
|
|
134
|
- <!-- <EditOutlined
|
|
|
|
135
|
- @click="handleOpenClearDetailTemplate"
|
|
|
|
136
|
- class="cursor-pointer ml-4"
|
|
|
|
137
|
- style="font-size: 20px"
|
|
|
|
138
|
- /> -->
|
|
|
|
139
|
</div>
|
106
|
</div>
|
|
140
|
<div style="margin-left: 0px">
|
107
|
<div style="margin-left: 0px">
|
|
141
|
<BasicForm @register="dashboardForm" />
|
108
|
<BasicForm @register="dashboardForm" />
|
|
142
|
</div>
|
109
|
</div>
|
|
143
|
</div>
|
110
|
</div>
|
|
144
|
</div>
|
111
|
</div>
|
|
145
|
- <!-- <div class="w-1/4 flex justify-center">
|
|
|
|
146
|
- <img
|
|
|
|
147
|
- style="cursor: pointer"
|
|
|
|
148
|
- @click="deleteClearCondition(index, createIndex)"
|
|
|
|
149
|
- alt="移除"
|
|
|
|
150
|
- src="../../../../assets/images/close.png"
|
|
|
|
151
|
- />
|
|
|
|
152
|
- <Tooltip title="移除">
|
|
|
|
153
|
- <MinusCircleOutlined
|
|
|
|
154
|
- style="font-size: 25px; color: #305680"
|
|
|
|
155
|
- class="cursor-pointer"
|
|
|
|
156
|
- @click="deleteClearCondition(index, createIndex)"
|
|
|
|
157
|
- />
|
|
|
|
158
|
- </Tooltip>
|
|
|
|
159
|
- </div> -->
|
|
|
|
160
|
</div>
|
112
|
</div>
|
|
161
|
</div>
|
113
|
</div>
|
|
162
|
</template>
|
114
|
</template>
|
|
163
|
- <!-- <a-button style="border-radius: 10px" class="mt-5" @click="addClearRole(index)"
|
|
|
|
164
|
- ><PlusCircleOutlined />添加清除条件</a-button
|
|
|
|
165
|
- > -->
|
|
|
|
166
|
</CollapseContainer>
|
115
|
</CollapseContainer>
|
|
167
|
</template>
|
116
|
</template>
|
|
168
|
</div>
|
117
|
</div>
|
|
@@ -217,7 +166,7 @@ |
|
@@ -217,7 +166,7 @@ |
|
217
|
|
166
|
|
|
218
|
<script lang="ts">
|
167
|
<script lang="ts">
|
|
219
|
import { defineComponent, ref, unref, getCurrentInstance, watch } from 'vue';
|
168
|
import { defineComponent, ref, unref, getCurrentInstance, watch } from 'vue';
|
|
220
|
- import type { alarmListItem } from '../types/index';
|
169
|
+ import type { IProfileData } from '../types/index';
|
|
221
|
import { CollapseContainer } from '/@/components/Container/index';
|
170
|
import { CollapseContainer } from '/@/components/Container/index';
|
|
222
|
import { BasicForm, useForm } from '/@/components/Form';
|
171
|
import { BasicForm, useForm } from '/@/components/Form';
|
|
223
|
import {
|
172
|
import {
|
|
@@ -227,13 +176,7 @@ |
|
@@ -227,13 +176,7 @@ |
|
227
|
dashboardFormScheme,
|
176
|
dashboardFormScheme,
|
|
228
|
isWhereType,
|
177
|
isWhereType,
|
|
229
|
} from './data';
|
178
|
} from './data';
|
|
230
|
- import {
|
|
|
|
231
|
- DeleteOutlined,
|
|
|
|
232
|
- // MinusCircleOutlined,
|
|
|
|
233
|
- PlusCircleOutlined,
|
|
|
|
234
|
- PlusOutlined,
|
|
|
|
235
|
- EditOutlined,
|
|
|
|
236
|
- } from '@ant-design/icons-vue';
|
179
|
+ import { PlusCircleOutlined } from '@ant-design/icons-vue';
|
|
237
|
import { Checkbox } from 'ant-design-vue';
|
180
|
import { Checkbox } from 'ant-design-vue';
|
|
238
|
import { useModal } from '/@/components/Modal';
|
181
|
import { useModal } from '/@/components/Modal';
|
|
239
|
import DetailTemplate from './cpns/detailtemplate/index.vue';
|
182
|
import DetailTemplate from './cpns/detailtemplate/index.vue';
|
|
@@ -241,17 +184,14 @@ |
|
@@ -241,17 +184,14 @@ |
|
241
|
import AlarmRuleConditions from './cpns/alarmruleconditions/index.vue';
|
184
|
import AlarmRuleConditions from './cpns/alarmruleconditions/index.vue';
|
|
242
|
import { Button } from '/@/components/Button';
|
185
|
import { Button } from '/@/components/Button';
|
|
243
|
|
186
|
|
|
|
|
187
|
+ export const isWhereTypeValueDisabled = ref(false);
|
|
|
|
188
|
+
|
|
244
|
export default defineComponent({
|
189
|
export default defineComponent({
|
|
245
|
components: {
|
190
|
components: {
|
|
246
|
BasicForm,
|
191
|
BasicForm,
|
|
247
|
CollapseContainer,
|
192
|
CollapseContainer,
|
|
248
|
- DeleteOutlined,
|
|
|
|
249
|
- // MinusCircleOutlined,
|
|
|
|
250
|
PlusCircleOutlined,
|
193
|
PlusCircleOutlined,
|
|
251
|
- PlusOutlined,
|
|
|
|
252
|
- EditOutlined,
|
|
|
|
253
|
Checkbox,
|
194
|
Checkbox,
|
|
254
|
- // Tooltip,
|
|
|
|
255
|
DetailTemplate,
|
195
|
DetailTemplate,
|
|
256
|
EnableRule,
|
196
|
EnableRule,
|
|
257
|
AlarmRuleConditions,
|
197
|
AlarmRuleConditions,
|
|
@@ -283,34 +223,7 @@ |
|
@@ -283,34 +223,7 @@ |
|
283
|
const enableClearTemplateData: any = ref(null);
|
223
|
const enableClearTemplateData: any = ref(null);
|
|
284
|
const detailClearTemplateData: any = ref(null);
|
224
|
const detailClearTemplateData: any = ref(null);
|
|
285
|
//告警列表
|
225
|
//告警列表
|
|
286
|
- let profileData = ref<alarmListItem[]>([
|
|
|
|
287
|
- // {
|
|
|
|
288
|
- // configuration: {},
|
|
|
|
289
|
- // transportConfiguration: {},
|
|
|
|
290
|
- // provisionConfiguration: {
|
|
|
|
291
|
- // provisionDeviceSecret: '',
|
|
|
|
292
|
- // },
|
|
|
|
293
|
- // alarms: [
|
|
|
|
294
|
- // {
|
|
|
|
295
|
- // id: Date.now() + Math.random(),
|
|
|
|
296
|
- // alarmType: '',
|
|
|
|
297
|
- // createRules: {},
|
|
|
|
298
|
- // clearRule: {},
|
|
|
|
299
|
- // propagate: true,
|
|
|
|
300
|
- // propagateRelationTypes: [''],
|
|
|
|
301
|
- // },
|
|
|
|
302
|
- // ],
|
|
|
|
303
|
- // clearAlarms: [
|
|
|
|
304
|
- // {
|
|
|
|
305
|
- // id: Date.now() + Math.random(),
|
|
|
|
306
|
- // alarmType: '',
|
|
|
|
307
|
- // clearRules: {},
|
|
|
|
308
|
- // propagate: true,
|
|
|
|
309
|
- // propagateRelationTypes: [''],
|
|
|
|
310
|
- // },
|
|
|
|
311
|
- // ],
|
|
|
|
312
|
- // },
|
|
|
|
313
|
- ]);
|
226
|
+ let profileData = ref<IProfileData[]>([]);
|
|
314
|
const log = (e) => {
|
227
|
const log = (e) => {
|
|
315
|
console.log(e);
|
228
|
console.log(e);
|
|
316
|
};
|
229
|
};
|
|
@@ -324,35 +237,44 @@ |
|
@@ -324,35 +237,44 @@ |
|
324
|
};
|
237
|
};
|
|
325
|
|
238
|
|
|
326
|
const addAlarmRule = () => {
|
239
|
const addAlarmRule = () => {
|
|
327
|
- // console.log(profileData.value.alarms.length)
|
|
|
|
328
|
unref(profileData).push({
|
240
|
unref(profileData).push({
|
|
329
|
- configuration: {},
|
|
|
|
330
|
- transportConfiguration: {},
|
241
|
+ configuration: {
|
|
|
|
242
|
+ type: '',
|
|
|
|
243
|
+ },
|
|
|
|
244
|
+ transportConfiguration: {
|
|
|
|
245
|
+ type: '',
|
|
|
|
246
|
+ },
|
|
331
|
provisionConfiguration: {
|
247
|
provisionConfiguration: {
|
|
332
|
provisionDeviceSecret: '',
|
248
|
provisionDeviceSecret: '',
|
|
333
|
},
|
249
|
},
|
|
334
|
alarms: [
|
250
|
alarms: [
|
|
335
|
{
|
251
|
{
|
|
336
|
- id: Date.now() + Math.random(),
|
252
|
+ id: Date.now() + Math.random() + '',
|
|
337
|
alarmType: '',
|
253
|
alarmType: '',
|
|
338
|
createRules: {},
|
254
|
createRules: {},
|
|
339
|
- clearRule: {},
|
|
|
|
340
|
- propagate: true,
|
|
|
|
341
|
- propagateRelationTypes: [''],
|
|
|
|
342
|
- },
|
|
|
|
343
|
- ],
|
|
|
|
344
|
- clearAlarms: [
|
|
|
|
345
|
- {
|
|
|
|
346
|
- id: Date.now() + Math.random(),
|
|
|
|
347
|
- alarmType: '',
|
|
|
|
348
|
- clearRules: {},
|
|
|
|
349
|
- propagate: true,
|
255
|
+ clearRule: [
|
|
|
|
256
|
+ {
|
|
|
|
257
|
+ id: Date.now() + Math.random() + '',
|
|
|
|
258
|
+ alarmDetails: '',
|
|
|
|
259
|
+ dashboardId: {
|
|
|
|
260
|
+ id: '',
|
|
|
|
261
|
+ entityType: '',
|
|
|
|
262
|
+ },
|
|
|
|
263
|
+ propagate: '',
|
|
|
|
264
|
+ propagateRelationTypes: [''],
|
|
|
|
265
|
+ schedule: {
|
|
|
|
266
|
+ type: 'string',
|
|
|
|
267
|
+ },
|
|
|
|
268
|
+ condition: {},
|
|
|
|
269
|
+ },
|
|
|
|
270
|
+ ],
|
|
|
|
271
|
+ propagate: false,
|
|
350
|
propagateRelationTypes: [''],
|
272
|
propagateRelationTypes: [''],
|
|
351
|
},
|
273
|
},
|
|
352
|
],
|
274
|
],
|
|
353
|
});
|
275
|
});
|
|
354
|
};
|
276
|
};
|
|
355
|
- //Mobile dashboard:
|
277
|
+ //TODO Mobile dashboard:
|
|
356
|
const [dashboardForm] = useForm({
|
278
|
const [dashboardForm] = useForm({
|
|
357
|
labelWidth: 120,
|
279
|
labelWidth: 120,
|
|
358
|
schemas: dashboardFormScheme,
|
280
|
schemas: dashboardFormScheme,
|
|
@@ -430,42 +352,47 @@ |
|
@@ -430,42 +352,47 @@ |
|
430
|
// 添加‘创建条件’
|
352
|
// 添加‘创建条件’
|
|
431
|
const addCreateRole = (index: number) => {
|
353
|
const addCreateRole = (index: number) => {
|
|
432
|
unref(profileData)[index].alarms.push({
|
354
|
unref(profileData)[index].alarms.push({
|
|
433
|
- id: Date.now() + Math.random(),
|
|
|
|
434
|
- alarmVisible: false,
|
|
|
|
435
|
- addKeyFilterVisible: false,
|
|
|
|
436
|
- detailVisible: false,
|
|
|
|
437
|
- detail: '',
|
|
|
|
438
|
- filterList: [],
|
355
|
+ id: Date.now() + Math.random() + '',
|
|
|
|
356
|
+ alarmType: '',
|
|
|
|
357
|
+ createRules: {},
|
|
|
|
358
|
+ clearRule: [
|
|
|
|
359
|
+ {
|
|
|
|
360
|
+ id: Date.now() + Math.random() + '',
|
|
|
|
361
|
+ alarmDetails: '',
|
|
|
|
362
|
+ dashboardId: {
|
|
|
|
363
|
+ id: '',
|
|
|
|
364
|
+ entityType: '',
|
|
|
|
365
|
+ },
|
|
|
|
366
|
+ propagate: '',
|
|
|
|
367
|
+ propagateRelationTypes: [''],
|
|
|
|
368
|
+ schedule: {
|
|
|
|
369
|
+ type: 'string',
|
|
|
|
370
|
+ },
|
|
|
|
371
|
+ condition: {},
|
|
|
|
372
|
+ },
|
|
|
|
373
|
+ ],
|
|
|
|
374
|
+ propagate: false,
|
|
|
|
375
|
+ propagateRelationTypes: [''],
|
|
439
|
});
|
376
|
});
|
|
440
|
};
|
377
|
};
|
|
441
|
// 删除‘创建条件’
|
378
|
// 删除‘创建条件’
|
|
442
|
const deleteCondition = (index: number, createIndex: number) => {
|
379
|
const deleteCondition = (index: number, createIndex: number) => {
|
|
443
|
- profileData.value[index].alarms.splice(createIndex, 1);
|
|
|
|
444
|
- };
|
|
|
|
445
|
- // 添加‘清除条件’
|
|
|
|
446
|
- const addClearRole = (index: number) => {
|
|
|
|
447
|
- unref(profileData)[index].clearAlarms.push({
|
|
|
|
448
|
- id: Date.now() + Math.random(),
|
|
|
|
449
|
- alarmVisible: false,
|
|
|
|
450
|
- addKeyFilterVisible: false,
|
|
|
|
451
|
- detailVisible: false,
|
|
|
|
452
|
- detail: '',
|
|
|
|
453
|
- filterList: [],
|
|
|
|
454
|
- });
|
|
|
|
455
|
- };
|
|
|
|
456
|
- // 删除‘清除条件’
|
|
|
|
457
|
- const deleteClearCondition = (index: number, createIndex: number) => {
|
|
|
|
458
|
- profileData.value[index].clearAlarms.splice(createIndex, 1);
|
380
|
+ unref(profileData)[index].alarms.splice(createIndex, 1);
|
|
459
|
};
|
381
|
};
|
|
460
|
watch(isWhereType, (nV) => {
|
382
|
watch(isWhereType, (nV) => {
|
|
461
|
isWhereTypeValue.value = nV;
|
383
|
isWhereTypeValue.value = nV;
|
|
|
|
384
|
+ if (isWhereTypeValue.value == nV) {
|
|
|
|
385
|
+ isWhereTypeValueDisabled.value = true;
|
|
|
|
386
|
+ } else {
|
|
|
|
387
|
+ // isWhereTypeValueDisabled.value = false;
|
|
|
|
388
|
+ }
|
|
462
|
});
|
389
|
});
|
|
463
|
//详情模板
|
390
|
//详情模板
|
|
464
|
const getAllFieldsFunc = (v) => {
|
391
|
const getAllFieldsFunc = (v) => {
|
|
465
|
detailObj.value = v;
|
392
|
detailObj.value = v;
|
|
466
|
detailTemplateData.value = `
|
393
|
detailTemplateData.value = `
|
|
467
|
- 报警详细信息:${v.alarmDetails}
|
|
|
|
468
|
- `;
|
394
|
+ 报警详细信息:${v.alarmDetails}
|
|
|
|
395
|
+ `;
|
|
469
|
};
|
396
|
};
|
|
470
|
//启用规则
|
397
|
//启用规则
|
|
471
|
const getAllFieldsEnabFunc = (v) => {
|
398
|
const getAllFieldsEnabFunc = (v) => {
|
|
@@ -509,10 +436,12 @@ |
|
@@ -509,10 +436,12 @@ |
|
509
|
console.log(e);
|
436
|
console.log(e);
|
|
510
|
}
|
437
|
}
|
|
511
|
});
|
438
|
});
|
|
512
|
-
|
|
|
|
513
|
- enableTemplateData.value = `
|
|
|
|
514
|
- 开始时间:${v.startsOn}结束时间:${v.endsOn}天数:${findDayByValue}
|
|
|
|
515
|
- `;
|
439
|
+ enableTemplateData.value =
|
|
|
|
440
|
+ v.startsOn == undefined
|
|
|
|
441
|
+ ? `始终启用`
|
|
|
|
442
|
+ : `
|
|
|
|
443
|
+ 开始时间:${v.startsOn},结束时间:${v.endsOn},天数:${findDayByValue}
|
|
|
|
444
|
+ `;
|
|
516
|
};
|
445
|
};
|
|
517
|
//规则条件
|
446
|
//规则条件
|
|
518
|
const getAllFieldsRuleFunc = (v, v1) => {
|
447
|
const getAllFieldsRuleFunc = (v, v1) => {
|
|
@@ -537,8 +466,8 @@ |
|
@@ -537,8 +466,8 @@ |
|
537
|
}
|
466
|
}
|
|
538
|
});
|
467
|
});
|
|
539
|
ruleTemplateData.value = `
|
468
|
ruleTemplateData.value = `
|
|
540
|
- 键名:${v.key1}...操作:${findRuleByValue?.label}...值:${v.value1}
|
|
|
|
541
|
- `;
|
469
|
+ 键名:${v.key1}...操作:${findRuleByValue?.label}...值:${v.value1}
|
|
|
|
470
|
+ `;
|
|
542
|
|
471
|
|
|
543
|
ruleLastObj.value = v1;
|
472
|
ruleLastObj.value = v1;
|
|
544
|
const predicate = {
|
473
|
const predicate = {
|
|
@@ -583,8 +512,8 @@ |
|
@@ -583,8 +512,8 @@ |
|
583
|
const getAllClearFieldsFunc = (v) => {
|
512
|
const getAllClearFieldsFunc = (v) => {
|
|
584
|
detailClearObj.value = v;
|
513
|
detailClearObj.value = v;
|
|
585
|
detailClearTemplateData.value = `
|
514
|
detailClearTemplateData.value = `
|
|
586
|
- 报警详细信息:${v.alarmDetails}
|
|
|
|
587
|
- `;
|
515
|
+ 报警详细信息:${v.alarmDetails}
|
|
|
|
516
|
+ `;
|
|
588
|
};
|
517
|
};
|
|
589
|
//启用规则
|
518
|
//启用规则
|
|
590
|
const getAllClearFieldsEnabFunc = (v) => {
|
519
|
const getAllClearFieldsEnabFunc = (v) => {
|
|
@@ -628,9 +557,11 @@ |
|
@@ -628,9 +557,11 @@ |
|
628
|
console.log(e);
|
557
|
console.log(e);
|
|
629
|
}
|
558
|
}
|
|
630
|
});
|
559
|
});
|
|
631
|
- enableClearTemplateData.value = `
|
|
|
|
632
|
- 开始时间:${v.startsOn}结束时间:${v.endsOn}天数:${findDayByValue}
|
|
|
|
633
|
- `;
|
560
|
+ enableClearTemplateData.value =
|
|
|
|
561
|
+ v.startsOn == undefined
|
|
|
|
562
|
+ ? `始终启用`
|
|
|
|
563
|
+ : `开始时间:${v.startsOn},结束时间:${v.endsOn},天数:${findDayByValue}
|
|
|
|
564
|
+ `;
|
|
634
|
};
|
565
|
};
|
|
635
|
//规则条件
|
566
|
//规则条件
|
|
636
|
const getAllClearFieldsRuleFunc = (v, v1) => {
|
567
|
const getAllClearFieldsRuleFunc = (v, v1) => {
|
|
@@ -655,8 +586,8 @@ |
|
@@ -655,8 +586,8 @@ |
|
655
|
}
|
586
|
}
|
|
656
|
});
|
587
|
});
|
|
657
|
ruleClearTemplateData.value = `
|
588
|
ruleClearTemplateData.value = `
|
|
658
|
- 键名:${v.key1}...操作:${findRuleByValue?.label}...值:${v.value1}
|
|
|
|
659
|
- `;
|
589
|
+ 键名:${v.key1}...操作:${findRuleByValue?.label}...值:${v.value1}
|
|
|
|
590
|
+ `;
|
|
660
|
|
591
|
|
|
661
|
ruleLastObj.value = v1;
|
592
|
ruleLastObj.value = v1;
|
|
662
|
const predicate = {
|
593
|
const predicate = {
|
|
@@ -696,6 +627,19 @@ |
|
@@ -696,6 +627,19 @@ |
|
696
|
};
|
627
|
};
|
|
697
|
Object.assign(addClearitionalObj.value, getValueConditon);
|
628
|
Object.assign(addClearitionalObj.value, getValueConditon);
|
|
698
|
};
|
629
|
};
|
|
|
|
630
|
+ //用于生成uuid
|
|
|
|
631
|
+ function generateUUID() {
|
|
|
|
632
|
+ let d = new Date().getTime();
|
|
|
|
633
|
+ if (window.performance && typeof window.performance.now === 'function') {
|
|
|
|
634
|
+ d += performance.now(); //use high-precision timer if available
|
|
|
|
635
|
+ }
|
|
|
|
636
|
+ let uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
|
|
637
|
+ let r = (d + Math.random() * 16) % 16 | 0;
|
|
|
|
638
|
+ d = Math.floor(d / 16);
|
|
|
|
639
|
+ return (c == 'x' ? r : (r & 0x3) | 0x8).toString(16);
|
|
|
|
640
|
+ });
|
|
|
|
641
|
+ return uuid;
|
|
|
|
642
|
+ }
|
|
699
|
const handleFormStep3toStep4Next = async () => {
|
643
|
const handleFormStep3toStep4Next = async () => {
|
|
700
|
try {
|
644
|
try {
|
|
701
|
const scheduleClearValue = {
|
645
|
const scheduleClearValue = {
|
|
@@ -744,6 +688,9 @@ |
|
@@ -744,6 +688,9 @@ |
|
744
|
const valueRegisterFormAndId = {
|
688
|
const valueRegisterFormAndId = {
|
|
745
|
alarmType: Object.values(valueRegisterForm)[0],
|
689
|
alarmType: Object.values(valueRegisterForm)[0],
|
|
746
|
};
|
690
|
};
|
|
|
|
691
|
+ const objectId = {
|
|
|
|
692
|
+ id: generateUUID(),
|
|
|
|
693
|
+ };
|
|
747
|
const valueRegisterFormHighSetting = await validateRegisterFormHighSetting();
|
694
|
const valueRegisterFormHighSetting = await validateRegisterFormHighSetting();
|
|
748
|
const valueRegisterFormCreateAlarm = await validateRegisterFormCreateAlarm();
|
695
|
const valueRegisterFormCreateAlarm = await validateRegisterFormCreateAlarm();
|
|
749
|
console.log(valueRegisterFormCreateAlarm);
|
696
|
console.log(valueRegisterFormCreateAlarm);
|
|
@@ -756,7 +703,8 @@ |
|
@@ -756,7 +703,8 @@ |
|
756
|
valueRegisterFormAndId,
|
703
|
valueRegisterFormAndId,
|
|
757
|
getValueRegisterFormHighSetting,
|
704
|
getValueRegisterFormHighSetting,
|
|
758
|
getCreateRulesAllObj,
|
705
|
getCreateRulesAllObj,
|
|
759
|
- getClearRulesAllObj
|
706
|
+ getClearRulesAllObj,
|
|
|
|
707
|
+ objectId
|
|
760
|
);
|
708
|
);
|
|
761
|
alarmss.value.push(emptyObj.value);
|
709
|
alarmss.value.push(emptyObj.value);
|
|
762
|
const getAlarms = {
|
710
|
const getAlarms = {
|
|
@@ -827,8 +775,6 @@ |
|
@@ -827,8 +775,6 @@ |
|
827
|
handleOpenClearDetailTemplate,
|
775
|
handleOpenClearDetailTemplate,
|
|
828
|
handleOpenClearEnableRule,
|
776
|
handleOpenClearEnableRule,
|
|
829
|
handleOpenClearAlaramRuleConditions,
|
777
|
handleOpenClearAlaramRuleConditions,
|
|
830
|
- addClearRole,
|
|
|
|
831
|
- deleteClearCondition,
|
|
|
|
832
|
detailTemplateData,
|
778
|
detailTemplateData,
|
|
833
|
enableTemplateData,
|
779
|
enableTemplateData,
|
|
834
|
ruleTemplateData,
|
780
|
ruleTemplateData,
|