Commit f5b06357 authored by 武广's avatar 武广

fix: 添加关闭弹窗提示

parent 77526c73
...@@ -106,7 +106,7 @@ const ServiceGoods = options => { ...@@ -106,7 +106,7 @@ const ServiceGoods = options => {
}, 1000); }, 1000);
}; };
const handleCancel = refresh => { const onResetData = refresh => {
setPageId(null); setPageId(null);
setIsEdit(false); setIsEdit(false);
setProductType(canAddNormal ? 1 : 4); setProductType(canAddNormal ? 1 : 4);
...@@ -116,6 +116,21 @@ const ServiceGoods = options => { ...@@ -116,6 +116,21 @@ const ServiceGoods = options => {
options.onChange(false, refresh); options.onChange(false, refresh);
}; };
const handleCancel = refresh => {
const info = localStorage.get(localAutoSaveKey);
if (info && Object.keys(info).length > 1) {
Modal.confirm({
title: '确认提示',
content: '商品信息还未保存,确认关闭弹窗?',
onOk() {
onResetData(refresh);
},
});
} else {
onResetData(refresh);
}
};
// 获取商品牌数据 // 获取商品牌数据
const getMerchantBrandList = async () => { const getMerchantBrandList = async () => {
if (!brandList.length) { if (!brandList.length) {
......
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