fix: menus
This commit is contained in:
parent
06eb607c7a
commit
a8a8330941
|
@ -10,6 +10,8 @@ import {
|
||||||
DatabaseOutlined,
|
DatabaseOutlined,
|
||||||
FileAddOutlined,
|
FileAddOutlined,
|
||||||
FileSyncOutlined,
|
FileSyncOutlined,
|
||||||
|
FileProtectOutlined,
|
||||||
|
ShoppingCartOutlined,
|
||||||
} from "@ant-design/icons";
|
} from "@ant-design/icons";
|
||||||
import { AppRoute, LINKS } from "../../routes/app";
|
import { AppRoute, LINKS } from "../../routes/app";
|
||||||
import { useStore } from "../../utils/useStore";
|
import { useStore } from "../../utils/useStore";
|
||||||
|
@ -122,12 +124,12 @@ export const DesktopLayout = observer(() => {
|
||||||
{store.authentication.userData.role !== "Retail" && (
|
{store.authentication.userData.role !== "Retail" && (
|
||||||
<Menu.Item key="membership">
|
<Menu.Item key="membership">
|
||||||
<Link to={LINKS.MEMBERSHIP}>
|
<Link to={LINKS.MEMBERSHIP}>
|
||||||
<HomeOutlined />
|
<FileProtectOutlined />
|
||||||
<span>Membership</span>
|
<span>Membership</span>
|
||||||
</Link>
|
</Link>
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
)}
|
)}
|
||||||
{store.authentication.userData.role !== "Retail" && (
|
{store.authentication.userData.role === "Admin" && (
|
||||||
<SubMenu
|
<SubMenu
|
||||||
key="config"
|
key="config"
|
||||||
icon={<HomeOutlined />}
|
icon={<HomeOutlined />}
|
||||||
|
@ -154,10 +156,10 @@ export const DesktopLayout = observer(() => {
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
</SubMenu>
|
</SubMenu>
|
||||||
)}
|
)}
|
||||||
{store.authentication.userData.role !== "Retail" && (
|
{store.authentication.userData.role === "Admin" && (
|
||||||
<SubMenu
|
<SubMenu
|
||||||
key="product-main"
|
key="product-main"
|
||||||
icon={<ProfileOutlined />}
|
icon={<DatabaseOutlined />}
|
||||||
title="Product"
|
title="Product"
|
||||||
>
|
>
|
||||||
<Menu.Item key="product">
|
<Menu.Item key="product">
|
||||||
|
@ -180,28 +182,28 @@ export const DesktopLayout = observer(() => {
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
</SubMenu>
|
</SubMenu>
|
||||||
)}
|
)}
|
||||||
{store.authentication.userData.role !== "Retail" && (
|
{store.authentication.userData.role !== "Admin" && (
|
||||||
<Menu.Item key="product">
|
<Menu.Item key="product">
|
||||||
<Link to={LINKS.PRODUCT}>
|
<Link to={LINKS.PRODUCT}>
|
||||||
<HomeOutlined />
|
<DatabaseOutlined />
|
||||||
<span>Product</span>
|
<span>Product</span>
|
||||||
</Link>
|
</Link>
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
)}
|
)}
|
||||||
|
{store.authentication.userData.role === "Retail" && (
|
||||||
|
<Menu.Item key="transaction">
|
||||||
|
<Link to={LINKS.TRANSACTION}>
|
||||||
|
<ShoppingCartOutlined />
|
||||||
|
<span>Transaction</span>
|
||||||
|
</Link>
|
||||||
|
</Menu.Item>
|
||||||
|
)}
|
||||||
<Menu.Item key="payback">
|
<Menu.Item key="payback">
|
||||||
<Link to={LINKS.PAYBACK}>
|
<Link to={LINKS.PAYBACK}>
|
||||||
<HomeOutlined />
|
<DatabaseOutlined />
|
||||||
<span>Payback</span>
|
<span>Payback</span>
|
||||||
</Link>
|
</Link>
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
{store.authentication.userData.role === "Retail" && (
|
|
||||||
<Menu.Item key="transaction">
|
|
||||||
<Link to={LINKS.TRANSACTION}>
|
|
||||||
<HomeOutlined />
|
|
||||||
<span>Transaction</span>
|
|
||||||
</Link>
|
|
||||||
</Menu.Item>
|
|
||||||
)}
|
|
||||||
<Menu.Item key="profile">
|
<Menu.Item key="profile">
|
||||||
<Link to={LINKS.PROFILE}>
|
<Link to={LINKS.PROFILE}>
|
||||||
<UserOutlined />
|
<UserOutlined />
|
||||||
|
|
|
@ -12,6 +12,7 @@ import {
|
||||||
MoneyCollectOutlined,
|
MoneyCollectOutlined,
|
||||||
ProfileOutlined,
|
ProfileOutlined,
|
||||||
ProjectOutlined,
|
ProjectOutlined,
|
||||||
|
ShoppingCartOutlined,
|
||||||
UserOutlined,
|
UserOutlined,
|
||||||
} from "@ant-design/icons";
|
} from "@ant-design/icons";
|
||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
|
@ -59,7 +60,7 @@ export const MenuList = observer((props) => {
|
||||||
</Link>
|
</Link>
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
)}
|
)}
|
||||||
{store.authentication.userData.role !== "Retail" && (
|
{store.authentication.userData.role === "Admin" && (
|
||||||
<SubMenu key="config" icon={<MenuUnfoldOutlined />} title="Config">
|
<SubMenu key="config" icon={<MenuUnfoldOutlined />} title="Config">
|
||||||
<Menu.Item key="partner">
|
<Menu.Item key="partner">
|
||||||
<Link to={LINKS.PARTNER}>
|
<Link to={LINKS.PARTNER}>
|
||||||
|
@ -81,7 +82,7 @@ export const MenuList = observer((props) => {
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
</SubMenu>
|
</SubMenu>
|
||||||
)}
|
)}
|
||||||
{store.authentication.userData.role !== "Retail" && (
|
{store.authentication.userData.role === "Admin" && (
|
||||||
<SubMenu key="product-main" icon={<ProfileOutlined />} title="Product">
|
<SubMenu key="product-main" icon={<ProfileOutlined />} title="Product">
|
||||||
<Menu.Item key="product">
|
<Menu.Item key="product">
|
||||||
<Link to={LINKS.PRODUCT}>
|
<Link to={LINKS.PRODUCT}>
|
||||||
|
@ -103,10 +104,18 @@ export const MenuList = observer((props) => {
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
</SubMenu>
|
</SubMenu>
|
||||||
)}
|
)}
|
||||||
{store.authentication.userData.role === ("Retail" || "Admin") && (
|
{store.authentication.userData.role !== "Admin" && (
|
||||||
|
<Menu.Item key="retail">
|
||||||
|
<Link to={LINKS.PRODUCT}>
|
||||||
|
<DatabaseOutlined />
|
||||||
|
<span>Product</span>
|
||||||
|
</Link>
|
||||||
|
</Menu.Item>
|
||||||
|
)}
|
||||||
|
{store.authentication.userData.role === "Retail" && (
|
||||||
<Menu.Item key="transaction">
|
<Menu.Item key="transaction">
|
||||||
<Link to={LINKS.TRANSACTION}>
|
<Link to={LINKS.TRANSACTION}>
|
||||||
<HomeOutlined />
|
<ShoppingCartOutlined />
|
||||||
<span>Transaction</span>
|
<span>Transaction</span>
|
||||||
</Link>
|
</Link>
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
|
@ -117,14 +126,6 @@ export const MenuList = observer((props) => {
|
||||||
<span>Payback</span>
|
<span>Payback</span>
|
||||||
</Link>
|
</Link>
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
{store.authentication.userData.role === ("Retail" || "Admin") && (
|
|
||||||
<Menu.Item key="transaction">
|
|
||||||
<Link to={LINKS.TRANSACTION}>
|
|
||||||
<HomeOutlined />
|
|
||||||
<span>Transaction</span>
|
|
||||||
</Link>
|
|
||||||
</Menu.Item>
|
|
||||||
)}
|
|
||||||
<Menu.Item key="profile">
|
<Menu.Item key="profile">
|
||||||
<Link to={LINKS.PROFILE}>
|
<Link to={LINKS.PROFILE}>
|
||||||
<UserOutlined />
|
<UserOutlined />
|
||||||
|
|
|
@ -45,7 +45,8 @@ export const Membership = observer(() => {
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
await getData();
|
await getData();
|
||||||
store.role.getData();
|
store.role.getData();
|
||||||
await store.supplier.getData();
|
if (store.authentication.userData.role === "Admin")
|
||||||
|
await store.supplier.getData();
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
|
@ -85,10 +86,11 @@ export const Membership = observer(() => {
|
||||||
const handleSubmitTransaction = async (data) => {
|
const handleSubmitTransaction = async (data) => {
|
||||||
setConfirmLoading(true);
|
setConfirmLoading(true);
|
||||||
try {
|
try {
|
||||||
let input = data;
|
|
||||||
data.destination = destination;
|
data.destination = destination;
|
||||||
|
|
||||||
await store.transaction.distributeAdmin(data);
|
(await store.authentication.userData.role) === "Admin"
|
||||||
|
? store.transaction.distributeAdmin(data)
|
||||||
|
: store.transaction.distribute(data);
|
||||||
message.success("Success Top Up");
|
message.success("Success Top Up");
|
||||||
//await store.supplier.getData()
|
//await store.supplier.getData()
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -266,11 +268,6 @@ export const Membership = observer(() => {
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<div className={["ppob-container"].join(" ")}>
|
<div className={["ppob-container"].join(" ")}>
|
||||||
{/* <Modal title="Basic Modal" visible={isModalVisible} onOk={handleOk} onCancel={handleCancel}>
|
|
||||||
<p>Some contents...</p>
|
|
||||||
<p>Some contents...</p>
|
|
||||||
<p>Some contents...</p>
|
|
||||||
</Modal> */}
|
|
||||||
<BreadcumbComponent data={routeData} />
|
<BreadcumbComponent data={routeData} />
|
||||||
<Card>
|
<Card>
|
||||||
<div>
|
<div>
|
||||||
|
@ -410,19 +407,21 @@ export const Membership = observer(() => {
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Form form={form} layout="vertical">
|
<Form form={form} layout="vertical">
|
||||||
<Form.Item
|
{store.authentication.userData.role === "Admin" && (
|
||||||
name="supplier"
|
<Form.Item
|
||||||
label="Supplier"
|
name="supplier"
|
||||||
rules={[{ required: true, message: "Please input supplier!" }]}
|
label="Supplier"
|
||||||
>
|
rules={[{ required: true, message: "Please input supplier!" }]}
|
||||||
<Select placeholder="Select Code Supplier" allowClear>
|
>
|
||||||
{store.supplier.data.map((item) => (
|
<Select placeholder="Select Code Supplier" allowClear>
|
||||||
<Option value={item.code} key={item.code}>
|
{store.supplier.data.map((item) => (
|
||||||
{item.code}
|
<Option value={item.code} key={item.code}>
|
||||||
</Option>
|
{item.code}
|
||||||
))}
|
</Option>
|
||||||
</Select>
|
))}
|
||||||
</Form.Item>
|
</Select>
|
||||||
|
</Form.Item>
|
||||||
|
)}
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="amount"
|
name="amount"
|
||||||
label="Amount"
|
label="Amount"
|
||||||
|
|
|
@ -1,290 +1,308 @@
|
||||||
import React, {useState} from "react";
|
import React, { useState } from "react";
|
||||||
import {Button, Card, Col, Divider, Image, Input, List, message, Row, Space, Table,} from "antd";
|
import {
|
||||||
import {useStore} from "../../utils/useStore";
|
Button,
|
||||||
import {observer} from "mobx-react-lite";
|
Card,
|
||||||
import {CheckCircleOutlined, CloseOutlined, FilterOutlined, PlusSquareOutlined,} from "@ant-design/icons";
|
Col,
|
||||||
import {PaybackModal} from "./PaybackModal";
|
Divider,
|
||||||
import {BreadcumbComponent} from "../../component/BreadcumbComponent";
|
Image,
|
||||||
import {LINKS} from "../../routes/app";
|
Input,
|
||||||
|
List,
|
||||||
|
message,
|
||||||
|
Row,
|
||||||
|
Space,
|
||||||
|
Table,
|
||||||
|
} from "antd";
|
||||||
|
import { useStore } from "../../utils/useStore";
|
||||||
|
import { observer } from "mobx-react-lite";
|
||||||
|
import {
|
||||||
|
CheckCircleOutlined,
|
||||||
|
CloseOutlined,
|
||||||
|
FilterOutlined,
|
||||||
|
PlusSquareOutlined,
|
||||||
|
} from "@ant-design/icons";
|
||||||
|
import { PaybackModal } from "./PaybackModal";
|
||||||
|
import { BreadcumbComponent } from "../../component/BreadcumbComponent";
|
||||||
|
import { LINKS } from "../../routes/app";
|
||||||
|
|
||||||
const {Search} = Input;
|
const { Search } = Input;
|
||||||
|
|
||||||
export const Payback = observer(() => {
|
export const Payback = observer(() => {
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
const [visibleModal, setVisibleModal] = useState(false);
|
const [visibleModal, setVisibleModal] = useState(false);
|
||||||
const [confirmLoading, setConfirmLoading] = useState(false);
|
const [confirmLoading, setConfirmLoading] = useState(false);
|
||||||
const [initialData, setInitialData] = useState({});
|
const [initialData, setInitialData] = useState({});
|
||||||
|
|
||||||
// useEffect(() => {
|
// useEffect(() => {
|
||||||
// // const init = async () => {
|
// // const init = async () => {
|
||||||
// // try {
|
// // try {
|
||||||
// // setIsLoading(true);
|
// // setIsLoading(true);
|
||||||
// // await store.membership.getData();
|
// // await store.membership.getData();
|
||||||
// // await store.role.getData();
|
// // await store.role.getData();
|
||||||
// // setIsLoading(false);
|
// // setIsLoading(false);
|
||||||
// // } catch (e) {
|
// // } catch (e) {
|
||||||
// // setIsLoading(false);
|
// // setIsLoading(false);
|
||||||
// // }
|
// // }
|
||||||
// // };
|
// // };
|
||||||
//
|
//
|
||||||
// // init();
|
// // init();
|
||||||
// }, []);
|
// }, []);
|
||||||
|
|
||||||
const dummyData = [
|
const dummyData = [
|
||||||
{
|
{
|
||||||
key: '1',
|
key: "1",
|
||||||
id: 1,
|
id: 1,
|
||||||
name: "John Doe",
|
name: "John Doe",
|
||||||
picture: "https://presidenproperti.com/wp-content/uploads/2018/11/blog-ph.jpg",
|
picture:
|
||||||
amount: "Rp. 1.000.000",
|
"https://presidenproperti.com/wp-content/uploads/2018/11/blog-ph.jpg",
|
||||||
},
|
amount: "Rp. 1.000.000",
|
||||||
{
|
},
|
||||||
key: '2',
|
{
|
||||||
id: 1,
|
key: "2",
|
||||||
name: "John Doe",
|
id: 1,
|
||||||
picture: "https://presidenproperti.com/wp-content/uploads/2018/11/blog-ph.jpg",
|
name: "John Doe",
|
||||||
amount: "Rp. 1.000.000",
|
picture:
|
||||||
},
|
"https://presidenproperti.com/wp-content/uploads/2018/11/blog-ph.jpg",
|
||||||
{
|
amount: "Rp. 1.000.000",
|
||||||
key: '3',
|
},
|
||||||
id: 1,
|
{
|
||||||
name: "John Doe",
|
key: "3",
|
||||||
picture: "https://presidenproperti.com/wp-content/uploads/2018/11/blog-ph.jpg",
|
id: 1,
|
||||||
amount: "Rp. 1.000.000",
|
name: "John Doe",
|
||||||
},
|
picture:
|
||||||
{
|
"https://presidenproperti.com/wp-content/uploads/2018/11/blog-ph.jpg",
|
||||||
key: '4',
|
amount: "Rp. 1.000.000",
|
||||||
id: 1,
|
},
|
||||||
name: "John Doe",
|
{
|
||||||
picture: "https://presidenproperti.com/wp-content/uploads/2018/11/blog-ph.jpg",
|
key: "4",
|
||||||
amount: "Rp. 1.000.000",
|
id: 1,
|
||||||
},
|
name: "John Doe",
|
||||||
]
|
picture:
|
||||||
|
"https://presidenproperti.com/wp-content/uploads/2018/11/blog-ph.jpg",
|
||||||
|
amount: "Rp. 1.000.000",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
title: "Name",
|
title: "Name",
|
||||||
dataIndex: "name",
|
dataIndex: "name",
|
||||||
key: "name",
|
key: "name",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Picture",
|
title: "Picture",
|
||||||
dataIndex: "picture",
|
dataIndex: "picture",
|
||||||
key: "picture",
|
key: "picture",
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<Image
|
<Image
|
||||||
src={record.picture}
|
src={record.picture}
|
||||||
style={{width: 50, height: 50}}
|
style={{ width: 50, height: 50 }}
|
||||||
shape="circle"
|
shape="circle"
|
||||||
alt="avatar"
|
alt="avatar"
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Amount",
|
title: "Amount",
|
||||||
dataIndex: "amount",
|
dataIndex: "amount",
|
||||||
key: "amount",
|
key: "amount",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Action",
|
title: "Action",
|
||||||
key: "action",
|
key: "action",
|
||||||
width: 100,
|
width: 100,
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<Space size="middle">
|
<Space size="middle">
|
||||||
<Button
|
<Button
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
await handleAction(record, 'accept');
|
await handleAction(record, "accept");
|
||||||
}}
|
}}
|
||||||
icon={<CheckCircleOutlined/>}
|
icon={<CheckCircleOutlined />}
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: "#1bb91d",
|
backgroundColor: "#1bb91d",
|
||||||
color: "#fff",
|
color: "#fff",
|
||||||
borderColor: "#1bb91d",
|
borderColor: "#1bb91d",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Accept
|
Accept
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
await handleAction(record, 'reject');
|
await handleAction(record, "reject");
|
||||||
}}
|
}}
|
||||||
icon={<CloseOutlined/>}
|
icon={<CloseOutlined />}
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: "#ff1c1c",
|
backgroundColor: "#ff1c1c",
|
||||||
color: "#fff",
|
color: "#fff",
|
||||||
borderColor: "#ff1c1c",
|
borderColor: "#ff1c1c",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Reject
|
Reject
|
||||||
</Button>
|
</Button>
|
||||||
</Space>
|
</Space>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const routeData = [
|
if(store.authentication.userData.role === "Retail") columns.pop();
|
||||||
{
|
|
||||||
route: LINKS.HOME,
|
|
||||||
name: "Home",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
route: LINKS.PAYBACK,
|
|
||||||
name: <span style={{fontWeight: "bold"}}>Payback</span>,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
const onSubmit = async (data) => {
|
const routeData = [
|
||||||
setConfirmLoading(true);
|
{
|
||||||
try {
|
route: LINKS.HOME,
|
||||||
// await store.membership.create(data);
|
name: "Home",
|
||||||
// message.success("Success Add New Member");
|
},
|
||||||
// await store.membership.getData();
|
{
|
||||||
} catch (e) {
|
route: LINKS.PAYBACK,
|
||||||
console.error(e, "apa errornya");
|
name: <span style={{ fontWeight: "bold" }}>Payback</span>,
|
||||||
message.error("Failed Add Member");
|
},
|
||||||
}
|
];
|
||||||
setConfirmLoading(false);
|
|
||||||
setVisibleModal(false);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleAction = async (record, type) => {
|
const onSubmit = async (data) => {
|
||||||
|
setConfirmLoading(true);
|
||||||
|
try {
|
||||||
|
// await store.membership.create(data);
|
||||||
|
// message.success("Success Add New Member");
|
||||||
|
// await store.membership.getData();
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e, "apa errornya");
|
||||||
|
message.error("Failed Add Member");
|
||||||
|
}
|
||||||
|
setConfirmLoading(false);
|
||||||
|
setVisibleModal(false);
|
||||||
|
};
|
||||||
|
|
||||||
};
|
const handleAction = async (record, type) => {};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={["ppob-container"].join(" ")}>
|
<div className={["ppob-container"].join(" ")}>
|
||||||
{/* <Modal title="Basic Modal" visible={isModalVisible} onOk={handleOk} onCancel={handleCancel}>
|
<BreadcumbComponent data={routeData} />
|
||||||
<p>Some contents...</p>
|
<Card>
|
||||||
<p>Some contents...</p>
|
<div>
|
||||||
<p>Some contents...</p>
|
<Row style={{ marginBottom: 20 }}>
|
||||||
</Modal> */}
|
<Col span={12}>
|
||||||
<BreadcumbComponent data={routeData}/>
|
<Button>
|
||||||
<Card>
|
<FilterOutlined />
|
||||||
<div>
|
Filter
|
||||||
<Row style={{marginBottom: 20}}>
|
</Button>
|
||||||
<Col span={12}>
|
</Col>
|
||||||
<Button>
|
<Col span={12} style={{ textAlign: "right" }}>
|
||||||
<FilterOutlined/>
|
<Search
|
||||||
Filter
|
placeholder="input search text"
|
||||||
</Button>
|
style={{
|
||||||
</Col>
|
width: store.ui.mediaQuery.isMobile ? 160 : 200,
|
||||||
<Col span={12} style={{textAlign: "right"}}>
|
marginRight: store.ui.mediaQuery.isMobile ? 0 : 10,
|
||||||
<Search
|
marginBottom: store.ui.mediaQuery.isMobile ? 10 : 0,
|
||||||
placeholder="input search text"
|
|
||||||
style={{
|
|
||||||
width: store.ui.mediaQuery.isMobile ? 160 : 200,
|
|
||||||
marginRight: store.ui.mediaQuery.isMobile ? 0 : 10,
|
|
||||||
marginBottom: store.ui.mediaQuery.isMobile ? 10 : 0,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<Button
|
|
||||||
onClick={() => {
|
|
||||||
setInitialData({});
|
|
||||||
setVisibleModal(true);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<PlusSquareOutlined/> New
|
|
||||||
</Button>
|
|
||||||
</Col>
|
|
||||||
</Row>
|
|
||||||
{store.ui.mediaQuery.isDesktop && (
|
|
||||||
<Table
|
|
||||||
key="1"
|
|
||||||
hasEmpty
|
|
||||||
columns={columns}
|
|
||||||
dataSource={dummyData}
|
|
||||||
bordered
|
|
||||||
// pagination={{
|
|
||||||
// pageSize: store.membership.pageSize,
|
|
||||||
// total: store.membership.total_data,
|
|
||||||
// current: store.membership.page + 1,
|
|
||||||
// showSizeChanger: true,
|
|
||||||
// simple: false
|
|
||||||
// }}
|
|
||||||
// onChange={async (page) => {
|
|
||||||
// let pageNumber = page.current;
|
|
||||||
// store.membership.pageSize = page.pageSize;
|
|
||||||
// store.membership.page = pageNumber - 1;
|
|
||||||
// // store.membership.isLoading = true;
|
|
||||||
// await store.membership.getData();
|
|
||||||
// // store.membership.isLoading = false;
|
|
||||||
// }}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{store.ui.mediaQuery.isMobile && (
|
|
||||||
<List
|
|
||||||
itemLayout="horizontal"
|
|
||||||
position={"top"}
|
|
||||||
// pagination={{
|
|
||||||
// onChange: (page) => {
|
|
||||||
// store.membership.pageSize = page.pageSize;
|
|
||||||
// store.membership.page = page.current;
|
|
||||||
// store.membership.getData();
|
|
||||||
// },
|
|
||||||
// pageSize: store.membership.pageSize,
|
|
||||||
// total: store.membership.total_data,
|
|
||||||
// current: store.membership.page,
|
|
||||||
// style: {marginBottom: "1rem", marginRight: "1rem"},
|
|
||||||
// }}
|
|
||||||
dataSource={dummyData}
|
|
||||||
style={{padding: 0}}
|
|
||||||
renderItem={(item) => {
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<List.Item
|
|
||||||
key={item.id}
|
|
||||||
style={{
|
|
||||||
backgroundColor: "#ffffff",
|
|
||||||
paddingTop: 0,
|
|
||||||
paddingBottom: 0,
|
|
||||||
display: "flex",
|
|
||||||
flexDirection: "row",
|
|
||||||
alignItems: "center",
|
|
||||||
justifyContent: "center",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<List.Item.Meta
|
|
||||||
className={["cariparkir-container"].join(" ")}
|
|
||||||
title={item.name}
|
|
||||||
description={
|
|
||||||
<div style={{}}>
|
|
||||||
<Image src={item.picture} preview={false}/>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
<div style={{marginRight: 16}}>
|
|
||||||
<p
|
|
||||||
style={{
|
|
||||||
fontSize: 9,
|
|
||||||
margin: 0,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{item.amount}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</List.Item>
|
|
||||||
<Divider plain style={{margin: 0}}/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</Card>
|
|
||||||
|
|
||||||
<PaybackModal
|
|
||||||
visible={visibleModal}
|
|
||||||
confirmLoading={confirmLoading}
|
|
||||||
initialData={initialData}
|
|
||||||
onCreate={async (data) => {
|
|
||||||
await onSubmit(data);
|
|
||||||
}}
|
}}
|
||||||
onCancel={() => {
|
/>
|
||||||
|
{store.authentication.userData.role !== "Admin" && (
|
||||||
|
<Button
|
||||||
|
onClick={() => {
|
||||||
setInitialData({});
|
setInitialData({});
|
||||||
setVisibleModal(false);
|
setVisibleModal(true);
|
||||||
}}
|
}}
|
||||||
|
>
|
||||||
|
<PlusSquareOutlined /> New
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
{store.ui.mediaQuery.isDesktop && (
|
||||||
|
<Table
|
||||||
|
key="1"
|
||||||
|
hasEmpty
|
||||||
|
columns={columns}
|
||||||
|
dataSource={dummyData}
|
||||||
|
bordered
|
||||||
|
// pagination={{
|
||||||
|
// pageSize: store.membership.pageSize,
|
||||||
|
// total: store.membership.total_data,
|
||||||
|
// current: store.membership.page + 1,
|
||||||
|
// showSizeChanger: true,
|
||||||
|
// simple: false
|
||||||
|
// }}
|
||||||
|
// onChange={async (page) => {
|
||||||
|
// let pageNumber = page.current;
|
||||||
|
// store.membership.pageSize = page.pageSize;
|
||||||
|
// store.membership.page = pageNumber - 1;
|
||||||
|
// // store.membership.isLoading = true;
|
||||||
|
// await store.membership.getData();
|
||||||
|
// // store.membership.isLoading = false;
|
||||||
|
// }}
|
||||||
/>
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{store.ui.mediaQuery.isMobile && (
|
||||||
|
<List
|
||||||
|
itemLayout="horizontal"
|
||||||
|
position={"top"}
|
||||||
|
// pagination={{
|
||||||
|
// onChange: (page) => {
|
||||||
|
// store.membership.pageSize = page.pageSize;
|
||||||
|
// store.membership.page = page.current;
|
||||||
|
// store.membership.getData();
|
||||||
|
// },
|
||||||
|
// pageSize: store.membership.pageSize,
|
||||||
|
// total: store.membership.total_data,
|
||||||
|
// current: store.membership.page,
|
||||||
|
// style: {marginBottom: "1rem", marginRight: "1rem"},
|
||||||
|
// }}
|
||||||
|
dataSource={dummyData}
|
||||||
|
style={{ padding: 0 }}
|
||||||
|
renderItem={(item) => {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<List.Item
|
||||||
|
key={item.id}
|
||||||
|
style={{
|
||||||
|
backgroundColor: "#ffffff",
|
||||||
|
paddingTop: 0,
|
||||||
|
paddingBottom: 0,
|
||||||
|
display: "flex",
|
||||||
|
flexDirection: "row",
|
||||||
|
alignItems: "center",
|
||||||
|
justifyContent: "center",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<List.Item.Meta
|
||||||
|
className={["cariparkir-container"].join(" ")}
|
||||||
|
title={item.name}
|
||||||
|
description={
|
||||||
|
<div style={{}}>
|
||||||
|
<Image src={item.picture} preview={false} />
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<div style={{ marginRight: 16 }}>
|
||||||
|
<p
|
||||||
|
style={{
|
||||||
|
fontSize: 9,
|
||||||
|
margin: 0,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{item.amount}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</List.Item>
|
||||||
|
<Divider plain style={{ margin: 0 }} />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
</Card>
|
||||||
|
|
||||||
|
<PaybackModal
|
||||||
|
visible={visibleModal}
|
||||||
|
confirmLoading={confirmLoading}
|
||||||
|
initialData={initialData}
|
||||||
|
onCreate={async (data) => {
|
||||||
|
await onSubmit(data);
|
||||||
|
}}
|
||||||
|
onCancel={() => {
|
||||||
|
setInitialData({});
|
||||||
|
setVisibleModal(false);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user