fix(share)
This commit is contained in:
parent
e534e62d68
commit
604cb87c53
Binary file not shown.
Before Width: | Height: | Size: 123 KiB |
|
@ -100,9 +100,11 @@ const BTable = (props: any) => {
|
|||
};
|
||||
return (
|
||||
<Space direction="vertical" size="middle" style={{ display: "flex" }}>
|
||||
<Button type="default" onClick={() => addHandler()}>
|
||||
{
|
||||
config ? <Button type="default" onClick={() => addHandler()}>
|
||||
{btnText ?? "添加部门"}
|
||||
</Button>
|
||||
</Button> : null
|
||||
}
|
||||
<Table
|
||||
style={{ height: "100%", overflow: "auto" }}
|
||||
pagination={false}
|
||||
|
@ -123,7 +125,8 @@ const BTable = (props: any) => {
|
|||
onChange={onChange}
|
||||
/>
|
||||
</div>
|
||||
<Modal
|
||||
{
|
||||
config ? <Modal
|
||||
title={!record?.id ? "添加" : "编辑"}
|
||||
width={800}
|
||||
open={isModalOpen}
|
||||
|
@ -161,7 +164,9 @@ const BTable = (props: any) => {
|
|||
>
|
||||
{children ?? null}
|
||||
</SimpleForm>
|
||||
</Modal>
|
||||
</Modal> : null
|
||||
}
|
||||
|
||||
</Space>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
import { UserDataType } from "@/model/userModel";
|
||||
import { ColumnsType } from "antd/lib/table";
|
||||
export const columns: ColumnsType<UserDataType> = [
|
||||
{
|
||||
title: "分享内容",
|
||||
dataIndex: "user_identity",
|
||||
width: 200,
|
||||
fixed: "left",
|
||||
},
|
||||
{
|
||||
title: "分享类型",
|
||||
dataIndex: "share_type",
|
||||
},
|
||||
{
|
||||
title: "分享单位",
|
||||
dataIndex: "company_identity",
|
||||
},
|
||||
];
|
|
@ -1,5 +1,16 @@
|
|||
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: <MuShare /> },
|
||||
{ key: '2', label: '常用数据', children: <Used />},
|
||||
];
|
||||
return <div>
|
||||
my
|
||||
<Tabs
|
||||
defaultActiveKey="1"
|
||||
items={items}
|
||||
indicator={{ size: (origin) => origin - 20 }}
|
||||
/>
|
||||
</div>
|
||||
}
|
|
@ -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 <BTable
|
||||
store={shareStore}
|
||||
scroll={{ x: "max-content" }}
|
||||
columns={columns}
|
||||
btnText="添加人员"
|
||||
dataSource={shareStore.list}
|
||||
deleteCallback={(record) => {
|
||||
shareStore.deleteItem(record);
|
||||
}}
|
||||
/>
|
||||
}
|
||||
|
||||
export default inject("shareStore")(observer(MuShare));
|
|
@ -0,0 +1,5 @@
|
|||
const Used = () => {
|
||||
return <p>常用</p>
|
||||
}
|
||||
|
||||
export default Used;
|
|
@ -61,18 +61,18 @@ const routers = createHashRouter([
|
|||
index: true,
|
||||
element: <Company />,
|
||||
},
|
||||
|
||||
{
|
||||
path: "/my/use",
|
||||
index: true,
|
||||
element: <My />,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "/login",
|
||||
element: <Login />,
|
||||
},
|
||||
{
|
||||
path: "/my/use",
|
||||
index: true,
|
||||
element: <My />,
|
||||
},
|
||||
|
||||
]);
|
||||
|
||||
export { routers };
|
||||
|
|
|
@ -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 };
|
||||
|
||||
export { RoleConfig, UserConfig, MenuConfig, DepConfig, CompanyConfig, EventConfig,ShareConfig };
|
|
@ -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;
|
|
@ -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<UserDataType> {
|
||||
constructor() {
|
||||
super(ShareConfig)
|
||||
makeObservable(this, {
|
||||
})
|
||||
}
|
||||
}
|
||||
const shareStore = new ShareStore();
|
||||
export default shareStore;
|
Loading…
Reference in New Issue