Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
markliu2013 committed Jan 29, 2024
1 parent f576296 commit 4583e27
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "moneywhere-user-fe",
"version": "1.0.47",
"version": "1.0.48",
"private": true,
"scripts": {
"analyze": "cross-env ANALYZE=1 max build",
Expand Down
2 changes: 2 additions & 0 deletions src/locales/en-US/flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,7 @@ export default {
'flow.file.size.error': 'Too Large',
'flow.currency.auto.tooltip': 'Convert,Currency:{rate}',
'flow.search.has.file': 'Has File',
'flow.search.label.category.check.strictly': 'Category Checked With children',
'flow.search.label.tag.check.strictly': 'Tag Checked With children',

}
2 changes: 2 additions & 0 deletions src/locales/zh-CN/flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,7 @@ export default {
'flow.file.size.error': '文件太大',
'flow.currency.auto.tooltip': '自动折算,当前汇率:{rate}',
'flow.search.has.file': '文件',
'flow.search.label.category.check.strictly': '分类自动选择子类',
'flow.search.label.tag.check.strictly': '标签自动选择子类',

}
15 changes: 14 additions & 1 deletion src/pages/BalanceFlow/DataTable.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {useEffect, useRef, useState} from 'react';
import { Alert, Button, Dropdown, Form, Input, Modal, Space, Tag, Tooltip } from 'antd';
import {Alert, Button, Dropdown, Form, Input, Modal, Space, Switch, Tag, Tooltip} from 'antd';
import { DownOutlined, PlusOutlined } from '@ant-design/icons';
import { ProTable } from '@ant-design/pro-components';
import {useModel, useRequest, history} from '@umijs/max';
Expand All @@ -21,6 +21,9 @@ export default () => {
const formRef = useRef();
const { show } = useModel('modal');

const [categoryTreeCheckStrictly, setCategoryTreeCheckStrictly] = useState(false);
const [tagTreeCheckStrictly, setTagTreeCheckStrictly] = useState(false);

// 对账点击过来的
useEffect(() => {
console.log(history.location.state?.account)
Expand Down Expand Up @@ -227,6 +230,7 @@ export default () => {
onFocus: loadCategories,
options: categories,
loading: categoriesLoading,
treeCheckStrictly: categoryTreeCheckStrictly,
},
},
{
Expand All @@ -240,6 +244,7 @@ export default () => {
...treeSelectMultipleProp,
options: tags,
loading: tagsLoading,
treeCheckStrictly: tagTreeCheckStrictly,
},
},
{
Expand Down Expand Up @@ -381,6 +386,14 @@ export default () => {

return (
<>
<Form layout="inline" style={{background: "white", padding: "24px 24px 0 24px"}}>
<Form.Item label={t('flow.search.label.category.check.strictly')}>
<Switch checked={!categoryTreeCheckStrictly} onChange={(checked) => setCategoryTreeCheckStrictly(!checked)} />
</Form.Item>
<Form.Item label={t('flow.search.label.tag.check.strictly')}>
<Switch checked={!tagTreeCheckStrictly} onChange={(checked) => setTagTreeCheckStrictly(!checked)} />
</Form.Item>
</Form>
<ProTable
{...tableProp}
defaultSize="small"
Expand Down

0 comments on commit 4583e27

Please sign in to comment.