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

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

parent c948851f
......@@ -106,6 +106,7 @@ const QuotaSelect = ({
updateMonitorConf(params).then((response) => {
if (response.code === 0) {
message.success('保存成功');
onOk('update')
} else {
message.error(response.msg);
}
......@@ -203,22 +204,23 @@ const QuotaSelect = ({
}
};
const onOk = () => {
const onOk = (type) => {
onModalOk && onModalOk();
handleOk();
handleOk(type);
setQuotaList([]);
setGroupQuotaList([]);
setVisible(false);
setSearch('');
};
const handleOk = () => {
const handleOk = (type) => {
const curSelectList = JSON.parse(JSON.stringify(selectData));
const curSelectKey = curSelectList.map((child) => child.key);
onSelect({
device: selectDevice,
selectKey: curSelectKey,
selectList: curSelectList,
type: type,
});
};
......@@ -373,7 +375,6 @@ const QuotaSelect = ({
type="primary"
onClick={() => {
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