From b1adf5ad64a0bc80af6ee49ea6f20234055200f8 Mon Sep 17 00:00:00 2001 From: vapao Date: Sat, 12 Mar 2022 12:53:10 +0800 Subject: [PATCH] =?UTF-8?q?U=20=E4=BC=98=E5=8C=96=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E7=9B=91=E6=8E=A7=E9=A1=B9=E7=9A=84=E6=8F=90=E7=A4=BA=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spug_web/src/pages/monitor/Step1.js | 2 +- spug_web/src/pages/monitor/Step2.js | 9 ++++++--- spug_web/src/pages/monitor/store.js | 7 +++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/spug_web/src/pages/monitor/Step1.js b/spug_web/src/pages/monitor/Step1.js index 41290af..b7ce777 100644 --- a/spug_web/src/pages/monitor/Step1.js +++ b/spug_web/src/pages/monitor/Step1.js @@ -42,7 +42,7 @@ export default observer(function () { store.record.type = v; store.record.targets = []; store.record.extra = undefined; - }; + } function handleAddGroup() { Modal.confirm({ diff --git a/spug_web/src/pages/monitor/Step2.js b/spug_web/src/pages/monitor/Step2.js index 561cbed..284bda1 100644 --- a/spug_web/src/pages/monitor/Step2.js +++ b/spug_web/src/pages/monitor/Step2.js @@ -4,6 +4,7 @@ * Released under the AGPL-3.0 License. */ import React, { useState, useEffect } from 'react'; +import { Link } from 'react-router-dom'; import { observer } from 'mobx-react'; import { Form, Select, Radio, Transfer, Checkbox, Button, message } from 'antd'; import { http } from 'libs'; @@ -39,6 +40,7 @@ export default observer(function () { http.post('/api/monitor/', formData) .then(() => { message.success('操作成功'); + store.record = {}; store.formVisible = false; store.fetchRecords() }, () => setLoading(false)) @@ -52,7 +54,7 @@ export default observer(function () { const info = store.record; return (
- + 1分钟 5分钟 @@ -61,7 +63,7 @@ export default observer(function () { 60分钟 - + 1次 2次 @@ -70,7 +72,8 @@ export default observer(function () { 5次 - + 去创建 报警联系人 和 联系人组。}> item.id} diff --git a/spug_web/src/pages/monitor/store.js b/spug_web/src/pages/monitor/store.js index 717367f..25545bf 100644 --- a/spug_web/src/pages/monitor/store.js +++ b/spug_web/src/pages/monitor/store.js @@ -50,9 +50,12 @@ class Store { }; showForm = (info) => { - info = info || {type: '1', targets: []}; + if (info) { + this.record = lds.cloneDeep(info) + } else if (this.record.id || !this.record.type) { + this.record = {type: '1', targets: []} + } this.page = 0; - this.record = lds.cloneDeep(info); this.formVisible = true; } }