From e7ac6d7b82ba1fa047e317657c7a79676cc41c0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B0=81=E7=BE=BD?= <2360164671@qq.com> Date: Thu, 5 Jan 2023 12:01:57 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B2=A1=E6=9C=89=E9=83=A8=E9=97=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/reimbursement/mine/ReimbursementCreate.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/reimbursement/mine/ReimbursementCreate.tsx b/src/pages/reimbursement/mine/ReimbursementCreate.tsx index b0baadf..a9f4ddf 100644 --- a/src/pages/reimbursement/mine/ReimbursementCreate.tsx +++ b/src/pages/reimbursement/mine/ReimbursementCreate.tsx @@ -68,11 +68,14 @@ class ReimbursementCreate extends React.Component { this.formRef.current?.resetFields(["departureName", "destinationName"]) }) store.subscribe(this.handleStoreChange); + let defaultDepartment = this.departments?.length>0?{id: this.departments[0].departmentId, name: this.departments[0].departmentName}:null; + if(defaultDepartment==null) + defaultDepartment={id:-1,name:""} this.state = { loading: false, open: this.props.open, invoices: [], - selectedDepartment: {id: this.departments[0].departmentId, name: this.departments[0].departmentName}, + selectedDepartment: defaultDepartment, departmentsProps: { items: departmentsPropItems, onClick: this.handleMenuClick, From ae6f8470fa11eca34d7cdc3848322b40daa9b93d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B0=81=E7=BE=BD?= <2360164671@qq.com> Date: Thu, 5 Jan 2023 12:45:20 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E9=85=8D=E7=BD=AE=EF=BC=8C=E5=BE=85=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E8=87=B3=E4=BE=A7=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/HomeView.tsx | 9 +++- src/pages/configuration/Configuration.tsx | 54 +++++++++++++++++++ .../configuration/subpage/CityConfig.tsx | 12 +++++ .../subpage/DepartmentConfig.tsx | 13 +++++ .../configuration/subpage/OtherConfig.tsx | 12 +++++ .../configuration/subpage/UserConfig.tsx | 12 +++++ src/router/router.tsx | 2 + 7 files changed, 112 insertions(+), 2 deletions(-) create mode 100644 src/pages/configuration/Configuration.tsx create mode 100644 src/pages/configuration/subpage/CityConfig.tsx create mode 100644 src/pages/configuration/subpage/DepartmentConfig.tsx create mode 100644 src/pages/configuration/subpage/OtherConfig.tsx create mode 100644 src/pages/configuration/subpage/UserConfig.tsx diff --git a/src/pages/HomeView.tsx b/src/pages/HomeView.tsx index 31d8a98..d1577ac 100644 --- a/src/pages/HomeView.tsx +++ b/src/pages/HomeView.tsx @@ -148,6 +148,9 @@ function HomeView() { key: "/stat", //icon: React.createElement(UserOutlined), label: 财务统计, + }, { + key: "/config", + label: 系统配置 }] const { @@ -197,8 +200,10 @@ function HomeView() { { diff --git a/src/pages/configuration/Configuration.tsx b/src/pages/configuration/Configuration.tsx new file mode 100644 index 0000000..8c20c9c --- /dev/null +++ b/src/pages/configuration/Configuration.tsx @@ -0,0 +1,54 @@ +import {Tabs} from "antd"; +import React from "react"; +import UserConfig from "./subpage/UserConfig"; +import CityConfig from "./subpage/CityConfig"; +import DepartmentConfig from "./subpage/DepartmentConfig"; +import OtherConfig from "./subpage/OtherConfig"; + +class Configuration extends React.Component { + + constructor(props: any) { + super(props); + this.state = { + activatedTab: 0 + } + } + + tabItems = () => { + return [{ + label: "用户配置", + key: "0", + children: + }, + { + label: "城市配置", + key: "1", + children: + }, + { + label: "部门配置", + key: "2", + children: + }, + { + label: "其他配置", + key: "3", + children: + }] + } + tabChange = (key: string) => { + this.setState({activatedTab: Number(key)}) + } + render() { + return ( + + ) + } +} +export default Configuration; \ No newline at end of file diff --git a/src/pages/configuration/subpage/CityConfig.tsx b/src/pages/configuration/subpage/CityConfig.tsx new file mode 100644 index 0000000..1c9d36e --- /dev/null +++ b/src/pages/configuration/subpage/CityConfig.tsx @@ -0,0 +1,12 @@ +import React from "react"; + +class CityConfig extends React.Component{ + render() { + return ( +
+

City Config

+
+ ); + } +} +export default CityConfig; \ No newline at end of file diff --git a/src/pages/configuration/subpage/DepartmentConfig.tsx b/src/pages/configuration/subpage/DepartmentConfig.tsx new file mode 100644 index 0000000..f475793 --- /dev/null +++ b/src/pages/configuration/subpage/DepartmentConfig.tsx @@ -0,0 +1,13 @@ +import React from "react"; + + +class DepartmentConfig extends React.Component { + render() { + return ( +
+

Department Config

+
+ ); + } +} +export default DepartmentConfig; \ No newline at end of file diff --git a/src/pages/configuration/subpage/OtherConfig.tsx b/src/pages/configuration/subpage/OtherConfig.tsx new file mode 100644 index 0000000..e56f8b0 --- /dev/null +++ b/src/pages/configuration/subpage/OtherConfig.tsx @@ -0,0 +1,12 @@ +import React from "react"; + +class OtherConfig extends React.Component { + render() { + return ( +
+

Other Config

+
+ ); + } +} +export default OtherConfig; \ No newline at end of file diff --git a/src/pages/configuration/subpage/UserConfig.tsx b/src/pages/configuration/subpage/UserConfig.tsx new file mode 100644 index 0000000..58633d1 --- /dev/null +++ b/src/pages/configuration/subpage/UserConfig.tsx @@ -0,0 +1,12 @@ +import React from "react"; + +class UserConfig extends React.Component { + render() { + return ( +
+

User Config

+
+ ); + } +} +export default UserConfig; \ No newline at end of file diff --git a/src/router/router.tsx b/src/router/router.tsx index b416c44..c35e74f 100644 --- a/src/router/router.tsx +++ b/src/router/router.tsx @@ -8,6 +8,7 @@ import {BrowserRouter} from "./BrowserRouter" import InvoiceManagement from "../pages/Invoice/management/InvoiceManagement"; import ReimbursementApproval from "../pages/reimbursement/approval/ReimbursementApproval"; import StatView from "../pages/stat/StatView"; +import Configuration from "../pages/configuration/Configuration"; export const history = createBrowserHistory() @@ -21,6 +22,7 @@ function CustomRouter() { }> }> }> + }> }>