Commit bcc0a93cb202a93714fc07c5f6d2c5d8ba43e054
Merge branch 'ft-dev' into 'main'
style:修改设备配置,feat:告警管理新增uuid See merge request huang/yun-teng-iot-front!59
Showing
2 changed files
with
37 additions
and
14 deletions
@@ -158,11 +158,25 @@ | @@ -158,11 +158,25 @@ | ||
158 | function handleRedo() { | 158 | function handleRedo() { |
159 | current.value = 0; | 159 | current.value = 0; |
160 | } | 160 | } |
161 | + //用于生成uuid | ||
162 | + function generateUUID() { | ||
163 | + let d = new Date().getTime(); | ||
164 | + if (window.performance && typeof window.performance.now === 'function') { | ||
165 | + d += performance.now(); //use high-precision timer if available | ||
166 | + } | ||
167 | + let uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { | ||
168 | + let r = (d + Math.random() * 16) % 16 | 0; | ||
169 | + d = Math.floor(d / 16); | ||
170 | + return (c == 'x' ? r : (r & 0x3) | 0x8).toString(16); | ||
171 | + }); | ||
172 | + return uuid; | ||
173 | + } | ||
161 | const handleSubmit = async () => { | 174 | const handleSubmit = async () => { |
162 | if (!unref(isUpdate)) { | 175 | if (!unref(isUpdate)) { |
163 | isGetStepThreeData.value.profileData = getStepThreeData.value; | 176 | isGetStepThreeData.value.profileData = getStepThreeData.value; |
164 | alarmProfileData.value.alarmProfile = | 177 | alarmProfileData.value.alarmProfile = |
165 | await proxy.$refs.DeviceProfileStep4Ref.getAllFields(); | 178 | await proxy.$refs.DeviceProfileStep4Ref.getAllFields(); |
179 | + alarmProfileData.value.alarmProfile.id = generateUUID(); | ||
166 | Object.assign( | 180 | Object.assign( |
167 | postDeviceConfogData.value, | 181 | postDeviceConfogData.value, |
168 | getStepOneData.value, | 182 | getStepOneData.value, |
@@ -4,15 +4,21 @@ | @@ -4,15 +4,21 @@ | ||
4 | <CollapseContainer class="border mb-1" :canExpan="false"> | 4 | <CollapseContainer class="border mb-1" :canExpan="false"> |
5 | <template #action> | 5 | <template #action> |
6 | <div @click="deleteAlarmRule(index)" class="cursor-pointer"> | 6 | <div @click="deleteAlarmRule(index)" class="cursor-pointer"> |
7 | - <DeleteOutlined style="font-size: 20px" class="mr-2" /> | 7 | + <img |
8 | + style="cursor: pointer" | ||
9 | + @click="deleteAlarmRule(index)" | ||
10 | + alt="移除" | ||
11 | + src="../../../../assets/images/close.png" | ||
12 | + /> | ||
13 | + <!-- <DeleteOutlined style="font-size: 20px" class="mr-2" /> --> | ||
8 | </div> | 14 | </div> |
9 | </template> | 15 | </template> |
10 | - <div class="alert-type" style="margin-left: -30px; margin-top: -10px"> | 16 | + <div class="alert-type" style="margin-left: -26px; margin-top: -10px"> |
11 | <BasicForm @register="registerForm" | 17 | <BasicForm @register="registerForm" |
12 | /></div> | 18 | /></div> |
13 | <CollapseContainer style="margin-top: -20px"> | 19 | <CollapseContainer style="margin-top: -20px"> |
14 | <template #action> </template> | 20 | <template #action> </template> |
15 | - <div style="margin-left: 10px"> | 21 | + <div style="margin-left: 10px; margin-top: -10px"> |
16 | <BasicForm @register="registerFormHighSetting"> | 22 | <BasicForm @register="registerFormHighSetting"> |
17 | <template #checkBox="{ model, field }"> | 23 | <template #checkBox="{ model, field }"> |
18 | <Checkbox v-model:checked="model[field]">传递报警</Checkbox> | 24 | <Checkbox v-model:checked="model[field]">传递报警</Checkbox> |
@@ -27,7 +33,7 @@ | @@ -27,7 +33,7 @@ | ||
27 | <div style="margin-left: -30px; margin-top: 20px" | 33 | <div style="margin-left: -30px; margin-top: 20px" |
28 | ><BasicForm @register="registerFormCreateAlarm" /> | 34 | ><BasicForm @register="registerFormCreateAlarm" /> |
29 | </div> | 35 | </div> |
30 | - <div style="margin-left: 5px; position: relative"> | 36 | + <div style="margin-left: 5px"> |
31 | <div style="color: #f5594e" class="mt-4 ml-4" | 37 | <div style="color: #f5594e" class="mt-4 ml-4" |
32 | >报警规则条件: | 38 | >报警规则条件: |
33 | <Button size="small" type="primary" @click="handleOpenAlaramRuleConditions" | 39 | <Button size="small" type="primary" @click="handleOpenAlaramRuleConditions" |
@@ -61,12 +67,15 @@ | @@ -61,12 +67,15 @@ | ||
61 | style="font-size: 20px" | 67 | style="font-size: 20px" |
62 | /> --> | 68 | /> --> |
63 | </div> | 69 | </div> |
64 | - <div style="margin-left: 0px"> | 70 | + <div style="margin-left: 0px; position: relative"> |
65 | <BasicForm @register="dashboardForm" /> | 71 | <BasicForm @register="dashboardForm" /> |
66 | </div> | 72 | </div> |
67 | </div> | 73 | </div> |
68 | </div> | 74 | </div> |
69 | - <div class="remove-type" style="position: absolute; top: -10px; right: 10px"> | 75 | + <div |
76 | + class="remove-type" | ||
77 | + style="display: inline-block; position: relative; top: -304px; left: 800px" | ||
78 | + > | ||
70 | <img | 79 | <img |
71 | style="cursor: pointer" | 80 | style="cursor: pointer" |
72 | @click="deleteCondition(index, createIndex)" | 81 | @click="deleteCondition(index, createIndex)" |
@@ -133,21 +142,21 @@ | @@ -133,21 +142,21 @@ | ||
133 | </div> | 142 | </div> |
134 | </div> | 143 | </div> |
135 | </div> | 144 | </div> |
136 | - <div class="w-1/4 flex justify-center"> | 145 | + <!-- <div class="w-1/4 flex justify-center"> |
137 | <img | 146 | <img |
138 | style="cursor: pointer" | 147 | style="cursor: pointer" |
139 | @click="deleteClearCondition(index, createIndex)" | 148 | @click="deleteClearCondition(index, createIndex)" |
140 | alt="移除" | 149 | alt="移除" |
141 | src="../../../../assets/images/close.png" | 150 | src="../../../../assets/images/close.png" |
142 | /> | 151 | /> |
143 | - <!-- <Tooltip title="移除"> | 152 | + <Tooltip title="移除"> |
144 | <MinusCircleOutlined | 153 | <MinusCircleOutlined |
145 | style="font-size: 25px; color: #305680" | 154 | style="font-size: 25px; color: #305680" |
146 | class="cursor-pointer" | 155 | class="cursor-pointer" |
147 | @click="deleteClearCondition(index, createIndex)" | 156 | @click="deleteClearCondition(index, createIndex)" |
148 | /> | 157 | /> |
149 | - </Tooltip> --> | ||
150 | - </div> | 158 | + </Tooltip> |
159 | + </div> --> | ||
151 | </div> | 160 | </div> |
152 | </div> | 161 | </div> |
153 | </template> | 162 | </template> |
@@ -315,7 +324,7 @@ | @@ -315,7 +324,7 @@ | ||
315 | }; | 324 | }; |
316 | 325 | ||
317 | const addAlarmRule = () => { | 326 | const addAlarmRule = () => { |
318 | - console.log(typeof unref(profileData)); | 327 | + // console.log(profileData.value.alarms.length) |
319 | unref(profileData).push({ | 328 | unref(profileData).push({ |
320 | configuration: {}, | 329 | configuration: {}, |
321 | transportConfiguration: {}, | 330 | transportConfiguration: {}, |
@@ -877,7 +886,7 @@ | @@ -877,7 +886,7 @@ | ||
877 | :deep(.vben-collapse-container__header) { | 886 | :deep(.vben-collapse-container__header) { |
878 | border: none; | 887 | border: none; |
879 | } | 888 | } |
880 | - :deep(.anticon svg) { | ||
881 | - display: none !important; | ||
882 | - } | 889 | + // :deep(.anticon svg) { |
890 | + // display: none !important; | ||
891 | + // } | ||
883 | </style> | 892 | </style> |