Commit cb8422c1 authored by 周宏民's avatar 周宏民

pref: 指标选择器 保存修改时 回调 添加参数判断

parent c948851f
...@@ -106,6 +106,7 @@ const QuotaSelect = ({ ...@@ -106,6 +106,7 @@ const QuotaSelect = ({
updateMonitorConf(params).then((response) => { updateMonitorConf(params).then((response) => {
if (response.code === 0) { if (response.code === 0) {
message.success('保存成功'); message.success('保存成功');
onOk('update')
} else { } else {
message.error(response.msg); message.error(response.msg);
} }
...@@ -203,22 +204,23 @@ const QuotaSelect = ({ ...@@ -203,22 +204,23 @@ const QuotaSelect = ({
} }
}; };
const onOk = () => { const onOk = (type) => {
onModalOk && onModalOk(); onModalOk && onModalOk();
handleOk(); handleOk(type);
setQuotaList([]); setQuotaList([]);
setGroupQuotaList([]); setGroupQuotaList([]);
setVisible(false); setVisible(false);
setSearch(''); setSearch('');
}; };
const handleOk = () => { const handleOk = (type) => {
const curSelectList = JSON.parse(JSON.stringify(selectData)); const curSelectList = JSON.parse(JSON.stringify(selectData));
const curSelectKey = curSelectList.map((child) => child.key); const curSelectKey = curSelectList.map((child) => child.key);
onSelect({ onSelect({
device: selectDevice, device: selectDevice,
selectKey: curSelectKey, selectKey: curSelectKey,
selectList: curSelectList, selectList: curSelectList,
type: type,
}); });
}; };
...@@ -373,7 +375,6 @@ const QuotaSelect = ({ ...@@ -373,7 +375,6 @@ const QuotaSelect = ({
type="primary" type="primary"
onClick={() => { onClick={() => {
updateDeviceConf(); updateDeviceConf();
onOk();
}} }}
> >
保存修改 保存修改
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment