Ver código fonte

删除未及时刷新更改

kitchenmanage
zhaoy 7 meses atrás
pai
commit
d1357d61c2
1 arquivos alterados com 20 adições e 26 exclusões
  1. +20
    -26
      src/pages/database/goods/newgoods/index.jsx

+ 20
- 26
src/pages/database/goods/newgoods/index.jsx Ver arquivo

@@ -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);


Carregando…
Cancelar
Salvar