diff --git a/src/components/Footer/index.jsx b/src/components/Footer/index.jsx
index f49d962..b0b1aca 100644
--- a/src/components/Footer/index.jsx
+++ b/src/components/Footer/index.jsx
@@ -26,7 +26,7 @@ export default () => {
{/*{t('footer.no')}*/}
{/**/}
- v1.0.27
+ v1.0.28
api-version: {version}
diff --git a/src/locales/en-US/common.ts b/src/locales/en-US/common.ts
index 6245e78..2cf52d1 100644
--- a/src/locales/en-US/common.ts
+++ b/src/locales/en-US/common.ts
@@ -24,7 +24,8 @@ export default {
'label.enable': 'Enable',
'label.notes': 'Notes',
- 'delete.confirm': 'This action can\'t redo,Are you sure to delete {name}?',
+ 'delete.confirm': 'Are you sure to delete {name}?',
+ 'delete.confirm2': 'This action can\'t redo,Are you sure to delete {name}?',
'click.edit': 'Click to Edit',
'today': 'Today',
diff --git a/src/locales/zh-CN/common.ts b/src/locales/zh-CN/common.ts
index 9bf9440..56f9033 100644
--- a/src/locales/zh-CN/common.ts
+++ b/src/locales/zh-CN/common.ts
@@ -24,7 +24,8 @@ export default {
'label.enable': '是否可用',
'label.notes': '备注',
- 'delete.confirm': '删除之后无法恢复,确定删除{name}吗?',
+ 'delete.confirm': '确定删除{name}吗?',
+ 'delete.confirm2': '删除之后无法恢复,确定删除{name}吗?',
'click.edit': '点击修改',
'today': '今天',
diff --git a/src/pages/Account/DataTable.jsx b/src/pages/Account/DataTable.jsx
index 7a4d9e7..a97cf3b 100644
--- a/src/pages/Account/DataTable.jsx
+++ b/src/pages/Account/DataTable.jsx
@@ -1,9 +1,9 @@
import { useState } from 'react';
-import {Alert, Button, Form, Input, Space} from 'antd';
+import {Alert, Button, Form, Input, Modal, Space} from 'antd';
import { PlusOutlined } from '@ant-design/icons';
import { ProTable } from '@ant-design/pro-components';
-import {useModel, useRequest} from '@umijs/max';
-import {queryAll, query, toggle, removeSoft} from '@/services/common';
+import {useIntl, useModel, useRequest} from '@umijs/max';
+import {queryAll, query, toggle, removeSoft, remove} from '@/services/common';
import {
statistics,
toggleCanExpense,
@@ -24,6 +24,7 @@ export default ({ type, actionRef }) => {
const { show } = useModel('modal');
const [statisticsData, setStatisticsData] = useState([0, 0, 0]);
+ const intl = useIntl();
const { data : currencyOptions = [], loading : currencyLoading, run : loadCurrencies} = useRequest(() => queryAll('currencies'), { manual: true });
@@ -32,8 +33,17 @@ export default ({ type, actionRef }) => {
}
const deleteHandler = async (record) => {
- await removeSoft('accounts', record.id);
- successHandler();
+ const messageConfirm = intl.formatMessage(
+ { id: 'delete.confirm' },
+ { name: record.name },
+ );
+ Modal.confirm({
+ title: messageConfirm,
+ onOk: async () => {
+ await removeSoft('accounts', record.id);
+ successHandler();
+ },
+ });
};
const addHandler = () => {
diff --git a/src/pages/BalanceFlow/DataTable.jsx b/src/pages/BalanceFlow/DataTable.jsx
index 5d723c5..cc4173e 100644
--- a/src/pages/BalanceFlow/DataTable.jsx
+++ b/src/pages/BalanceFlow/DataTable.jsx
@@ -64,7 +64,7 @@ export default () => {
successHandler();
};
- const messageDeleteConfirm = t('delete.confirm', { name: '' });
+ const messageDeleteConfirm = t('delete.confirm2', { name: '' });
const messageDeleteConfirmBalance = t('delete.confirm.balance');
const deleteHandler = (record) => {
Modal.confirm({
diff --git a/src/pages/BalanceFlow/FileUploadModal.jsx b/src/pages/BalanceFlow/FileUploadModal.jsx
index cf06161..4acf4e3 100644
--- a/src/pages/BalanceFlow/FileUploadModal.jsx
+++ b/src/pages/BalanceFlow/FileUploadModal.jsx
@@ -15,6 +15,7 @@ export default ({ flowId }) => {
const maxFileCount = 6;
const fileSizeError = t('flow.file.size.error');
+ const messageDeleteConfirm = t('delete.confirm', { name: '' });
const uploadProps = {
accept: 'image/jpeg, image/png, application/pdf',
@@ -53,11 +54,17 @@ export default ({ flowId }) => {
return true;
},
onRemove(file) {
- remove('flow-files', file.id).then(res => {
- if (res.success) {
- fetchFiles(flowId);
- }
+ Modal.confirm({
+ title: messageDeleteConfirm,
+ onOk: async () => {
+ remove('flow-files', file.id).then(res => {
+ if (res.success) {
+ fetchFiles(flowId);
+ }
+ });
+ },
});
+ return false;
}
}
diff --git a/src/services/flow.js b/src/services/flow.js
index 34a60e6..cf26279 100644
--- a/src/services/flow.js
+++ b/src/services/flow.js
@@ -21,8 +21,6 @@ export async function getFiles(id) {
});
}
-
-
export function buildUrl(file) {
return `api/v1/flow-files/view?id=${file.id}&createTime=${file.createTime}`
}