diff --git a/public/favicon.ico b/public/favicon.ico deleted file mode 100644 index 7cf5f3f..0000000 Binary files a/public/favicon.ico and /dev/null differ diff --git a/src/components/b_table.tsx b/src/components/b_table.tsx index 10126aa..1780f60 100644 --- a/src/components/b_table.tsx +++ b/src/components/b_table.tsx @@ -100,9 +100,11 @@ const BTable = (props: any) => { }; return ( - + { + config ? : null + } { onChange={onChange} /> - formRef.current?.resetFields()} - onOk={() => formRef.current?.submit()} - okText="确定" - cancelText="取消" - onCancel={() => { - setIsModalOpen(false); - }} - > - { - if (!record) { - store.add(formRef.current?.getFieldsValue()).then((res) => { + { + config ? formRef.current?.resetFields()} + onOk={() => formRef.current?.submit()} + okText="确定" + cancelText="取消" + onCancel={() => { + setIsModalOpen(false); + }} + > + { + if (!record) { + store.add(formRef.current?.getFieldsValue()).then((res) => { + if (res) { + setIsModalOpen(false); + } + }); + return + } + store.putItem(record.identity, formRef.current?.getFieldsValue()).then((res) => { if (res) { setIsModalOpen(false); } }); - return - } - store.putItem(record.identity, formRef.current?.getFieldsValue()).then((res) => { - if (res) { - setIsModalOpen(false); - } - }); - }} - createCallback={() => { - formRef.current?.setFieldsValue(record); - }} - formDatas={config} - > - {children ?? null} - - + }} + createCallback={() => { + formRef.current?.setFieldsValue(record); + }} + formDatas={config} + > + {children ?? null} + + : null + } + ); }; diff --git a/src/pages/my/config.tsx b/src/pages/my/config.tsx new file mode 100644 index 0000000..48d6f76 --- /dev/null +++ b/src/pages/my/config.tsx @@ -0,0 +1,18 @@ +import { UserDataType } from "@/model/userModel"; +import { ColumnsType } from "antd/lib/table"; +export const columns: ColumnsType = [ + { + title: "分享内容", + dataIndex: "user_identity", + width: 200, + fixed: "left", + }, + { + title: "分享类型", + dataIndex: "share_type", + }, + { + title: "分享单位", + dataIndex: "company_identity", + }, +]; diff --git a/src/pages/my/index.tsx b/src/pages/my/index.tsx index 805f296..50fa11d 100644 --- a/src/pages/my/index.tsx +++ b/src/pages/my/index.tsx @@ -1,5 +1,16 @@ -export const My = () => { +import { Tabs, TabsProps } from "antd"; +import MuShare from "./mu_share"; +import Used from "./used"; +export const My = () => { + const items: TabsProps['items'] = [ + { key: '1', label: '我的分享', children: }, + { key: '2', label: '常用数据', children: }, + ]; return
- my + origin - 20 }} + />
} \ No newline at end of file diff --git a/src/pages/my/mu_share.tsx b/src/pages/my/mu_share.tsx new file mode 100644 index 0000000..b382984 --- /dev/null +++ b/src/pages/my/mu_share.tsx @@ -0,0 +1,24 @@ +import BTable from "@/components/b_table"; +import { Store } from "antd/es/form/interface"; +import { inject, observer } from "mobx-react"; +import { columns } from "./config"; +import { useEffect } from "react"; + +const MuShare = (props: Store) => { + const { shareStore } = props; + useEffect(() => { + shareStore.getlist(); + }, [shareStore]); + return { + shareStore.deleteItem(record); + }} + /> +} + +export default inject("shareStore")(observer(MuShare)); \ No newline at end of file diff --git a/src/pages/my/used.tsx b/src/pages/my/used.tsx new file mode 100644 index 0000000..3a35847 --- /dev/null +++ b/src/pages/my/used.tsx @@ -0,0 +1,5 @@ +const Used = () => { + return

常用

+} + +export default Used; \ No newline at end of file diff --git a/src/router/index.tsx b/src/router/index.tsx index c4b81ee..75d2962 100644 --- a/src/router/index.tsx +++ b/src/router/index.tsx @@ -61,18 +61,18 @@ const routers = createHashRouter([ index: true, element: , }, - + { + path: "/my/use", + index: true, + element: , + }, ], }, { path: "/login", element: , }, - { - path: "/my/use", - index: true, - element: , - }, + ]); export { routers }; diff --git a/src/service/user_config.ts b/src/service/user_config.ts index 1cc214d..c2ad8ab 100644 --- a/src/service/user_config.ts +++ b/src/service/user_config.ts @@ -46,5 +46,12 @@ class EventConfig { static ThingList: string = "/thing/byIdcard"; } +class ShareConfig { + static ADD: string = "/share"; + static EDIT: string = "/share"; + static LIST: string = "/share/list"; + static DELETE: string = "/share"; +} -export { RoleConfig, UserConfig, MenuConfig, DepConfig, CompanyConfig, EventConfig }; \ No newline at end of file + +export { RoleConfig, UserConfig, MenuConfig, DepConfig, CompanyConfig, EventConfig,ShareConfig }; \ No newline at end of file diff --git a/src/store/index.ts b/src/store/index.ts index a4b3fb7..3b9d470 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -5,6 +5,7 @@ import menuStore from './menu'; import depStore from './dep'; import companyStore from './company'; import thingStore from './thing'; +import shareStore from './share'; const store = { usrStore, @@ -14,6 +15,7 @@ const store = { depStore, companyStore, thingStore, + shareStore, }; export default store; \ No newline at end of file diff --git a/src/store/share.ts b/src/store/share.ts new file mode 100644 index 0000000..a669d23 --- /dev/null +++ b/src/store/share.ts @@ -0,0 +1,14 @@ +import { makeObservable } from "mobx"; +import BaseStore from "./baseStore"; +import { UserDataType } from "@/model/userModel"; +import { ShareConfig } from "@/service/user_config"; + +class ShareStore extends BaseStore { + constructor() { + super(ShareConfig) + makeObservable(this, { + }) + } +} +const shareStore = new ShareStore(); +export default shareStore; \ No newline at end of file