|
@@ -0,0 +1,174 @@
|
|
|
+import React from 'react';
|
|
|
+import { Collapse, Layout, List } from 'antd';
|
|
|
+import {
|
|
|
+ UserOutlined,
|
|
|
+ FileOutlined,
|
|
|
+ EditOutlined,
|
|
|
+ ExceptionOutlined,
|
|
|
+} from '@ant-design/icons';
|
|
|
+import { PageContainer } from '@ant-design/pro-components';
|
|
|
+import { Link } from '@umijs/max';
|
|
|
+
|
|
|
+const { Sider, Content } = Layout;
|
|
|
+const { Panel } = Collapse;
|
|
|
+
|
|
|
+const categories = [
|
|
|
+ {
|
|
|
+ name: '请假审批',
|
|
|
+ items: [
|
|
|
+ {
|
|
|
+ name: '病假申请',
|
|
|
+ icon: <UserOutlined />,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '事假申请',
|
|
|
+ icon: <FileOutlined />,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '探亲假申请',
|
|
|
+ icon: <UserOutlined />,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '婚假申请',
|
|
|
+ icon: <UserOutlined />,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '产假申请',
|
|
|
+ icon: <UserOutlined />,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '陪产假申请',
|
|
|
+ icon: <UserOutlined />,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '丧假申请',
|
|
|
+ icon: <UserOutlined />,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '加班审批',
|
|
|
+ items: [
|
|
|
+ {
|
|
|
+ name: '普通加班申请',
|
|
|
+ icon: <EditOutlined />,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '周末加班申请',
|
|
|
+ icon: <EditOutlined />,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '节假日加班申请',
|
|
|
+ icon: <EditOutlined />,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '报销审批',
|
|
|
+ items: [
|
|
|
+ {
|
|
|
+ name: '差旅费报销',
|
|
|
+ icon: <FileOutlined />,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '通讯费报销',
|
|
|
+ icon: <FileOutlined />,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '餐费报销',
|
|
|
+ icon: <FileOutlined />,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '办公用品采购报销办公用品采购报销办公用品采购报销办公用品采购报销',
|
|
|
+ icon: <FileOutlined />,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '项目费用报销',
|
|
|
+ icon: <FileOutlined />,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '异常审批',
|
|
|
+ items: [
|
|
|
+ {
|
|
|
+ name: '物品遗失申请',
|
|
|
+ icon: <ExceptionOutlined />,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '客诉申请',
|
|
|
+ icon: <ExceptionOutlined />,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '工作计划申请',
|
|
|
+ icon: <ExceptionOutlined />,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+];
|
|
|
+const getBackgroundColors = (index) => {
|
|
|
+ const backgroundColors = [
|
|
|
+ '#1ABC9C', // 深绿色
|
|
|
+ '#3498DB', // 蓝色
|
|
|
+ '#9B59B6', // 紫色
|
|
|
+ '#F1C40F', // 黄色
|
|
|
+ '#E67E22', // 橙色
|
|
|
+ '#E74C3C', // 红色
|
|
|
+ '#2C3E50', // 深蓝色
|
|
|
+ '#34495E', // 深灰色
|
|
|
+ ];
|
|
|
+
|
|
|
+ return backgroundColors[index % backgroundColors.length];
|
|
|
+};
|
|
|
+const Approval = () => {
|
|
|
+ return (
|
|
|
+ <PageContainer>
|
|
|
+ <Collapse defaultActiveKey={categories.map((category) => category.name)}>
|
|
|
+ {categories.map((category, index) => (
|
|
|
+ <Panel style={{userSelect: 'none'}} header={category.name} key={category.name}>
|
|
|
+ <List
|
|
|
+ grid={{ gutter: 16, column: 3 }}
|
|
|
+ dataSource={category.items}
|
|
|
+ renderItem={(item) => (
|
|
|
+ <List.Item key={item.name}>
|
|
|
+ <Link
|
|
|
+ to={`/oa/${item.name}`}
|
|
|
+ style={{ display: 'flex', alignItems: 'center' }}
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ style={{
|
|
|
+ width: 48,
|
|
|
+ height: 48,
|
|
|
+ borderRadius: 8,
|
|
|
+ textAlign: 'center',
|
|
|
+ lineHeight: '48px',
|
|
|
+ color: '#fff',
|
|
|
+ fontSize: 24,
|
|
|
+ backgroundColor: getBackgroundColors(index),
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {item.icon}
|
|
|
+ </div>
|
|
|
+ <span
|
|
|
+ style={{
|
|
|
+ marginLeft: 12,
|
|
|
+ flex: 1,
|
|
|
+ fontSize: 18,
|
|
|
+ maxWidth: '100%',
|
|
|
+ paddingRight: 30,
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {item.name}
|
|
|
+ </span>
|
|
|
+ </Link>
|
|
|
+ </List.Item>
|
|
|
+ )}
|
|
|
+ ></List>
|
|
|
+ </Panel>
|
|
|
+ ))}
|
|
|
+ </Collapse>
|
|
|
+ </PageContainer>
|
|
|
+ );
|
|
|
+};
|
|
|
+
|
|
|
+export default Approval;
|