|
|
@@ -12,33 +12,7 @@ import { |
|
|
|
gettree, |
|
|
|
} from './service'; |
|
|
|
|
|
|
|
/** |
|
|
|
* 删除节点 |
|
|
|
* |
|
|
|
* @param selectedRows |
|
|
|
*/ |
|
|
|
|
|
|
|
const handleRemove = async (selectedRows) => { |
|
|
|
const hide = message.loading('正在删除'); |
|
|
|
if (!selectedRows) return true; |
|
|
|
|
|
|
|
try { |
|
|
|
await removeGoods(selectedRows.map((row) => row.id)).then((r) => { |
|
|
|
hide(); |
|
|
|
if (r.data) { |
|
|
|
message.success('删除成功,即将刷新'); |
|
|
|
} else { |
|
|
|
message.error('删除失败,请重试'); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
return true; |
|
|
|
} catch (error) { |
|
|
|
hide(); |
|
|
|
message.error('删除失败,请重试'); |
|
|
|
return false; |
|
|
|
} |
|
|
|
}; |
|
|
|
const GoodsManage = () => { |
|
|
|
const [goodsTypes, setGoodsTypes] = useState([]); |
|
|
|
|
|
|
@@ -239,6 +213,26 @@ const GoodsManage = () => { |
|
|
|
], |
|
|
|
}, |
|
|
|
]; |
|
|
|
|
|
|
|
/** |
|
|
|
* 删除节点 |
|
|
|
* |
|
|
|
* @param selectedRows |
|
|
|
*/ |
|
|
|
const handleRemove = async (selectedRows) => { |
|
|
|
const hide = message.loading('正在删除'); |
|
|
|
if (!selectedRows) return true; |
|
|
|
await removeGoods(selectedRows.map((row) => row.id)).then((r) => { |
|
|
|
if (r.data) { |
|
|
|
message.success('删除成功'); |
|
|
|
actionRef.current.reload(); |
|
|
|
return true; |
|
|
|
} else { |
|
|
|
message.error('删除失败,请重试'); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
}; |
|
|
|
const props = { |
|
|
|
beforeUpload: (file) => { |
|
|
|
setLoading(true); |
|
|
|