feat: 统一消息提醒

This commit is contained in:
xingyu4j
2025-09-22 18:06:09 +08:00
parent a1e756c0e5
commit 47c0c847eb
70 changed files with 81 additions and 161 deletions

View File

@@ -48,13 +48,12 @@ function handleEdit(row: ErpAccountApi.Account) {
async function handleDelete(row: ErpAccountApi.Account) {
const hideLoading = message.loading({
content: $t('ui.actionMessage.deleting', [row.name]),
key: 'action_key_msg',
duration: 0,
});
try {
await deleteAccount(row.id as number);
message.success({
content: $t('ui.actionMessage.deleteSuccess', [row.name]),
key: 'action_key_msg',
});
onRefresh();
} finally {

View File

@@ -54,13 +54,12 @@ function handleEdit(row: ErpProductCategoryApi.ProductCategory) {
async function handleDelete(row: ErpProductCategoryApi.ProductCategory) {
const hideLoading = message.loading({
content: $t('ui.actionMessage.deleting', [row.name]),
key: 'action_key_msg',
duration: 0,
});
try {
await deleteProductCategory(row.id as number);
message.success({
content: $t('ui.actionMessage.deleteSuccess', [row.name]),
key: 'action_key_msg',
});
onRefresh();
} finally {

View File

@@ -48,13 +48,12 @@ function handleEdit(row: ErpProductApi.Product) {
async function handleDelete(row: ErpProductApi.Product) {
const hideLoading = message.loading({
content: $t('ui.actionMessage.deleting', [row.name]),
key: 'action_key_msg',
duration: 0,
});
try {
await deleteProduct(row.id as number);
message.success({
content: $t('ui.actionMessage.deleteSuccess', [row.name]),
key: 'action_key_msg',
});
onRefresh();
} finally {

View File

@@ -48,13 +48,12 @@ function handleEdit(row: ErpProductUnitApi.ProductUnit) {
async function handleDelete(row: ErpProductUnitApi.ProductUnit) {
const hideLoading = message.loading({
content: $t('ui.actionMessage.deleting', [row.name]),
key: 'action_key_msg',
duration: 0,
});
try {
await deleteProductUnit(row.id as number);
message.success({
content: $t('ui.actionMessage.deleteSuccess', [row.name]),
key: 'action_key_msg',
});
onRefresh();
} finally {

View File

@@ -40,13 +40,12 @@ function handleEdit(row: ErpSupplierApi.Supplier) {
async function handleDelete(row: ErpSupplierApi.Supplier) {
const hideLoading = message.loading({
content: $t('ui.actionMessage.deleting', [row.name]),
key: 'action_key_msg',
duration: 0,
});
try {
await deleteSupplier(row.id!);
message.success({
content: $t('ui.actionMessage.deleteSuccess', [row.name]),
key: 'action_key_msg',
});
onRefresh();
} catch {

View File

@@ -48,13 +48,12 @@ function handleEdit(row: ErpCustomerApi.Customer) {
async function handleDelete(row: ErpCustomerApi.Customer) {
const hideLoading = message.loading({
content: $t('ui.actionMessage.deleting', [row.name]),
key: 'action_key_msg',
duration: 0,
});
try {
await deleteCustomer(row.id as number);
message.success({
content: $t('ui.actionMessage.deleteSuccess', [row.name]),
key: 'action_key_msg',
});
onRefresh();
} finally {

View File

@@ -41,13 +41,12 @@ function handleEdit(row: ErpWarehouseApi.Warehouse) {
async function handleDelete(row: ErpWarehouseApi.Warehouse) {
const hideLoading = message.loading({
content: $t('ui.actionMessage.deleting', [row.name]),
key: 'action_key_msg',
duration: 0,
});
try {
await deleteWarehouse(row.id!);
message.success({
content: $t('ui.actionMessage.deleteSuccess', [row.name]),
key: 'action_key_msg',
});
onRefresh();
} catch {