Commit 37a80607255cc44a32dd7f891e3bacf986a7f092

Authored by 1400859700@qq.com
1 parent 9e0402d8

fix:清除报警回显数据

@@ -61,7 +61,7 @@ @@ -61,7 +61,7 @@
61 </BasicModal> 61 </BasicModal>
62 </template> 62 </template>
63 <script lang="ts"> 63 <script lang="ts">
64 - import { defineComponent, ref, computed, onMounted } from 'vue'; 64 + import { defineComponent, ref, computed } from 'vue';
65 import { BasicModal, useModalInner } from '/@/components/Modal/index'; 65 import { BasicModal, useModalInner } from '/@/components/Modal/index';
66 import { BasicForm, useForm } from '/@/components/Form/index'; 66 import { BasicForm, useForm } from '/@/components/Form/index';
67 import { formSchema } from './config'; 67 import { formSchema } from './config';
@@ -140,7 +140,7 @@ @@ -140,7 +140,7 @@
140 }; 140 };
141 const updateAvatar = async (v) => { 141 const updateAvatar = async (v) => {
142 avatarUrl.value = v.data.fileStaticUri; 142 avatarUrl.value = v.data.fileStaticUri;
143 - console.log(avatarUrl.value); 143 + // console.log(avatarUrl.value);
144 // await personalPut({ avatar: v }); 144 // await personalPut({ avatar: v });
145 }; 145 };
146 const getPersonalDetail = async () => { 146 const getPersonalDetail = async () => {
@@ -151,9 +151,11 @@ @@ -151,9 +151,11 @@
151 return e; 151 return e;
152 } 152 }
153 }; 153 };
154 - onMounted(async () => {  
155 - getPersonalDetail();  
156 - }); 154 + getPersonalDetail();
  155 +
  156 + // onMounted(async () => {
  157 + // getPersonalDetail();
  158 + // });
157 const compHeight = computed(() => { 159 const compHeight = computed(() => {
158 return 1000; 160 return 1000;
159 }); 161 });
@@ -21,41 +21,66 @@ @@ -21,41 +21,66 @@
21 /></TabPane> 21 /></TabPane>
22 <TabPane key="3" tab="报警规则"> 22 <TabPane key="3" tab="报警规则">
23 <div style="padding-top: 10px"> 23 <div style="padding-top: 10px">
24 - <BasicForm  
25 - :showSubmitButton="false"  
26 - :showResetButton="false"  
27 - @register="registerStep3Schemas"  
28 - />  
29 - <BasicForm  
30 - :showSubmitButton="false"  
31 - :showResetButton="false"  
32 - @register="registerStep3HighSetting"  
33 - />  
34 - <BasicForm  
35 - :showSubmitButton="false"  
36 - :showResetButton="false"  
37 - @register="registerStep3CreateAlarm"  
38 - />  
39 - <BasicForm  
40 - :showSubmitButton="false"  
41 - :showResetButton="false"  
42 - @register="registerStep3RuleAlarm"  
43 - />  
44 - <BasicForm  
45 - :showSubmitButton="false"  
46 - :showResetButton="false"  
47 - @register="registerStep3Condition"  
48 - />  
49 - <BasicForm  
50 - :showSubmitButton="false"  
51 - :showResetButton="false"  
52 - @register="registerStep3Enable"  
53 - />  
54 - <BasicForm  
55 - :showSubmitButton="false"  
56 - :showResetButton="false"  
57 - @register="registerStep3TemplateDetail"  
58 - /> 24 + <div style="border-radius: 10px; border: 1px solid grey">
  25 + <BasicForm
  26 + :showSubmitButton="false"
  27 + :showResetButton="false"
  28 + @register="registerStep3Schemas"
  29 + />
  30 + <BasicForm
  31 + :showSubmitButton="false"
  32 + :showResetButton="false"
  33 + @register="registerStep3HighSetting"
  34 + />
  35 + <BasicForm
  36 + :showSubmitButton="false"
  37 + :showResetButton="false"
  38 + @register="registerStep3CreateAlarm"
  39 + />
  40 + <BasicForm
  41 + :showSubmitButton="false"
  42 + :showResetButton="false"
  43 + @register="registerStep3RuleAlarm"
  44 + />
  45 + <BasicForm
  46 + :showSubmitButton="false"
  47 + :showResetButton="false"
  48 + @register="registerStep3Condition"
  49 + />
  50 + <BasicForm
  51 + :showSubmitButton="false"
  52 + :showResetButton="false"
  53 + @register="registerStep3Enable"
  54 + />
  55 + <BasicForm
  56 + :showSubmitButton="false"
  57 + :showResetButton="false"
  58 + @register="registerStep3TemplateDetail"
  59 + />
  60 + </div>
  61 + <div style="border-radius: 10px; border: 1px solid grey; margin-top: 15px">
  62 + <p>清除报警规则</p>
  63 + <BasicForm
  64 + :showSubmitButton="false"
  65 + :showResetButton="false"
  66 + @register="registerStep3ClearRuleAlarm"
  67 + />
  68 + <BasicForm
  69 + :showSubmitButton="false"
  70 + :showResetButton="false"
  71 + @register="registerStep3ClearCondition"
  72 + />
  73 + <BasicForm
  74 + :showSubmitButton="false"
  75 + :showResetButton="false"
  76 + @register="registerStep3ClearEnable"
  77 + />
  78 + <BasicForm
  79 + :showSubmitButton="false"
  80 + :showResetButton="false"
  81 + @register="registerStep3ClearTemplateDetail"
  82 + />
  83 + </div>
59 </div> 84 </div>
60 </TabPane> 85 </TabPane>
61 <TabPane key="4" tab="告警管理"> 86 <TabPane key="4" tab="告警管理">
@@ -84,6 +109,10 @@ @@ -84,6 +109,10 @@
84 import { formSchema as enableSchema } from './step/cpns/enablerule/config'; 109 import { formSchema as enableSchema } from './step/cpns/enablerule/config';
85 import { formSchema as detailSchema } from './step/cpns/detailtemplate/config'; 110 import { formSchema as detailSchema } from './step/cpns/detailtemplate/config';
86 import { formSchema as echoFormSchema } from './step/cpns/alarmruleconditions/cpns/config'; 111 import { formSchema as echoFormSchema } from './step/cpns/alarmruleconditions/cpns/config';
  112 + import { formSchema as conditionFormClearschema } from './step/cpns/alarmruleconditions/config';
  113 + import { formSchema as enableClearSchema } from './step/cpns/enablerule/config';
  114 + import { formSchema as detailClearSchema } from './step/cpns/detailtemplate/config';
  115 + import { formSchema as echoFormClearSchema } from './step/cpns/alarmruleconditions/cpns/config';
87 116
88 export default defineComponent({ 117 export default defineComponent({
89 name: 'ConfigDrawer', 118 name: 'ConfigDrawer',
@@ -156,6 +185,37 @@ @@ -156,6 +185,37 @@
156 }, 185 },
157 }); 186 });
158 187
  188 + //清除报警
  189 + const [registerStep3ClearRuleAlarm, { setFieldsValue: setRegisterStep3ClearRuleAlarm }] =
  190 + useForm({
  191 + schemas: echoFormClearSchema,
  192 + actionColOptions: {
  193 + span: 24,
  194 + },
  195 + });
  196 + const [registerStep3ClearCondition, { setFieldsValue: setRegisterStep3ClearCondition }] =
  197 + useForm({
  198 + schemas: conditionFormClearschema,
  199 + actionColOptions: {
  200 + span: 24,
  201 + },
  202 + });
  203 + const [registerStep3ClearEnable, { setFieldsValue: setRegisterStep3ClearEnable }] = useForm({
  204 + schemas: enableClearSchema,
  205 + actionColOptions: {
  206 + span: 24,
  207 + },
  208 + });
  209 + const [
  210 + registerStep3ClearTemplateDetail,
  211 + { setFieldsValue: setRegisterStep3ClearTemplateDetail },
  212 + ] = useForm({
  213 + schemas: detailClearSchema,
  214 + actionColOptions: {
  215 + span: 24,
  216 + },
  217 + });
  218 +
159 const [register] = useModalInner(async (data) => { 219 const [register] = useModalInner(async (data) => {
160 activeKey.value = '1'; 220 activeKey.value = '1';
161 isUpdate.value = !!data?.isUpdate; 221 isUpdate.value = !!data?.isUpdate;
@@ -193,14 +253,14 @@ @@ -193,14 +253,14 @@
193 setRegisterStep3RuleAlarm({ 253 setRegisterStep3RuleAlarm({
194 type: descInfo.value.profileData?.alarms[0].createRules[getKey[0]].condition 254 type: descInfo.value.profileData?.alarms[0].createRules[getKey[0]].condition
195 .condition[0].key.type, 255 .condition[0].key.type,
196 - key: descInfo.value.profileData?.alarms[0].createRules[getKey[0]].condition 256 + key1: descInfo.value.profileData?.alarms[0].createRules[getKey[0]].condition
197 .condition[0].key.key, 257 .condition[0].key.key,
198 - valueType: 258 + type1:
199 descInfo.value.profileData?.alarms[0].createRules[getKey[0]].condition 259 descInfo.value.profileData?.alarms[0].createRules[getKey[0]].condition
200 .condition[0].valueType, 260 .condition[0].valueType,
201 - value: 261 + value1:
202 descInfo.value.profileData?.alarms[0].createRules[getKey[0]].condition 262 descInfo.value.profileData?.alarms[0].createRules[getKey[0]].condition
203 - .condition[0].value, 263 + .condition[0].predicate.value.defaultValue,
204 operation: 264 operation:
205 descInfo.value.profileData?.alarms[0].createRules[getKey[0]].condition 265 descInfo.value.profileData?.alarms[0].createRules[getKey[0]].condition
206 .condition[0].predicate.operation, 266 .condition[0].predicate.operation,
@@ -210,12 +270,37 @@ @@ -210,12 +270,37 @@
210 descInfo.value.profileData?.alarms[0].createRules[getKey[0]].condition.spec.type, 270 descInfo.value.profileData?.alarms[0].createRules[getKey[0]].condition.spec.type,
211 }); 271 });
212 setRegisterStep3Enable({ 272 setRegisterStep3Enable({
213 - schedule: descInfo.value.profileData?.alarms[0].createRules[getKey[0]].schedule, 273 + schedule:
  274 + descInfo.value.profileData?.alarms[0].createRules[getKey[0]].schedule.type,
214 }); 275 });
215 setRegisterStep3TemplateDetail({ 276 setRegisterStep3TemplateDetail({
216 alarmDetails: 277 alarmDetails:
217 descInfo.value.profileData?.alarms[0].createRules[getKey[0]].alarmDetails, 278 descInfo.value.profileData?.alarms[0].createRules[getKey[0]].alarmDetails,
218 }); 279 });
  280 + //清楚报警
  281 + setRegisterStep3ClearRuleAlarm({
  282 + type: descInfo.value.profileData?.alarms[0].clearRule.condition.condition[0].key
  283 + .type,
  284 + key1: descInfo.value.profileData?.alarms[0].clearRule.condition.condition[0].key
  285 + .key,
  286 + type1:
  287 + descInfo.value.profileData?.alarms[0].clearRule.condition.condition[0].valueType,
  288 + value1:
  289 + descInfo.value.profileData?.alarms[0].clearRule.condition.condition[0].predicate
  290 + .value.defaultValue,
  291 + operation:
  292 + descInfo.value.profileData?.alarms[0].clearRule.condition.condition[0].predicate
  293 + .operation,
  294 + });
  295 + setRegisterStep3ClearCondition({
  296 + conditionType: descInfo.value.profileData?.alarms[0].clearRule.condition.spec.type,
  297 + });
  298 + setRegisterStep3ClearEnable({
  299 + schedule: descInfo.value.profileData?.alarms[0].clearRule.schedule.type,
  300 + });
  301 + setRegisterStep3ClearTemplateDetail({
  302 + alarmDetails: descInfo.value.profileData?.alarms[0].clearRule.alarmDetails,
  303 + });
219 break; 304 break;
220 case '4': 305 case '4':
221 setRegisterContact({ 306 setRegisterContact({
@@ -240,6 +325,10 @@ @@ -240,6 +325,10 @@
240 }); 325 });
241 326
242 return { 327 return {
  328 + registerStep3ClearTemplateDetail,
  329 + registerStep3ClearEnable,
  330 + registerStep3ClearCondition,
  331 + registerStep3ClearRuleAlarm,
243 handleChange, 332 handleChange,
244 registerStep3TemplateDetail, 333 registerStep3TemplateDetail,
245 registerStep3Enable, 334 registerStep3Enable,