Commit 725b0f795859db14d1cdffb70b742b5527348b80

Authored by fengistao
1 parent 477fbb7b

style:修改设备配置,feat:告警管理新增uuid

... ... @@ -158,11 +158,25 @@
158 158 function handleRedo() {
159 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 174 const handleSubmit = async () => {
162 175 if (!unref(isUpdate)) {
163 176 isGetStepThreeData.value.profileData = getStepThreeData.value;
164 177 alarmProfileData.value.alarmProfile =
165 178 await proxy.$refs.DeviceProfileStep4Ref.getAllFields();
  179 + alarmProfileData.value.alarmProfile.id = generateUUID();
166 180 Object.assign(
167 181 postDeviceConfogData.value,
168 182 getStepOneData.value,
... ...
... ... @@ -4,15 +4,21 @@
4 4 <CollapseContainer class="border mb-1" :canExpan="false">
5 5 <template #action>
6 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 14 </div>
9 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 17 <BasicForm @register="registerForm"
12 18 /></div>
13 19 <CollapseContainer style="margin-top: -20px">
14 20 <template #action> </template>
15   - <div style="margin-left: 10px">
  21 + <div style="margin-left: 10px; margin-top: -10px">
16 22 <BasicForm @register="registerFormHighSetting">
17 23 <template #checkBox="{ model, field }">
18 24 <Checkbox v-model:checked="model[field]">传递报警</Checkbox>
... ... @@ -27,7 +33,7 @@
27 33 <div style="margin-left: -30px; margin-top: 20px"
28 34 ><BasicForm @register="registerFormCreateAlarm" />
29 35 </div>
30   - <div style="margin-left: 5px; position: relative">
  36 + <div style="margin-left: 5px">
31 37 <div style="color: #f5594e" class="mt-4 ml-4"
32 38 >报警规则条件:
33 39 <Button size="small" type="primary" @click="handleOpenAlaramRuleConditions"
... ... @@ -61,12 +67,15 @@
61 67 style="font-size: 20px"
62 68 /> -->
63 69 </div>
64   - <div style="margin-left: 0px">
  70 + <div style="margin-left: 0px; position: relative">
65 71 <BasicForm @register="dashboardForm" />
66 72 </div>
67 73 </div>
68 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 79 <img
71 80 style="cursor: pointer"
72 81 @click="deleteCondition(index, createIndex)"
... ... @@ -133,21 +142,21 @@
133 142 </div>
134 143 </div>
135 144 </div>
136   - <div class="w-1/4 flex justify-center">
  145 + <!-- <div class="w-1/4 flex justify-center">
137 146 <img
138 147 style="cursor: pointer"
139 148 @click="deleteClearCondition(index, createIndex)"
140 149 alt="移除"
141 150 src="../../../../assets/images/close.png"
142 151 />
143   - <!-- <Tooltip title="移除">
  152 + <Tooltip title="移除">
144 153 <MinusCircleOutlined
145 154 style="font-size: 25px; color: #305680"
146 155 class="cursor-pointer"
147 156 @click="deleteClearCondition(index, createIndex)"
148 157 />
149   - </Tooltip> -->
150   - </div>
  158 + </Tooltip>
  159 + </div> -->
151 160 </div>
152 161 </div>
153 162 </template>
... ... @@ -315,7 +324,7 @@
315 324 };
316 325
317 326 const addAlarmRule = () => {
318   - console.log(typeof unref(profileData));
  327 + // console.log(profileData.value.alarms.length)
319 328 unref(profileData).push({
320 329 configuration: {},
321 330 transportConfiguration: {},
... ... @@ -877,7 +886,7 @@
877 886 :deep(.vben-collapse-container__header) {
878 887 border: none;
879 888 }
880   - :deep(.anticon svg) {
881   - display: none !important;
882   - }
  889 + // :deep(.anticon svg) {
  890 + // display: none !important;
  891 + // }
883 892 </style>
... ...