|
@@ -0,0 +1,177 @@
|
|
|
+import React, { Fragment, useState, useEffect, useMemo, useRef } from 'react';
|
|
|
+import { useNavigate } from 'umi';
|
|
|
+import { Card, Table, Empty, Button, Modal, message, Form, DatePicker, Row, Col } from 'antd';
|
|
|
+import { PageContainer } from '@ant-design/pro-components';
|
|
|
+const { RangePicker } = DatePicker;
|
|
|
+import { useRequest } from '@umijs/max';
|
|
|
+import {
|
|
|
+ queryProfileList
|
|
|
+} from '@/services/boom'
|
|
|
+import dayjs from 'dayjs';
|
|
|
+function profile(props) {
|
|
|
+ const {
|
|
|
+ submitting,
|
|
|
+ params,
|
|
|
+ dispatch,
|
|
|
+ } = props;
|
|
|
+ const [tabActive, setTabActive] = useState('1');
|
|
|
+ const approveFormRef = useRef();
|
|
|
+ const applyFormRef = useRef();
|
|
|
+ let navigate = useNavigate();
|
|
|
+ const queryProfileListRequest = useRequest(queryProfileList, {
|
|
|
+ // manual: true,
|
|
|
+ onSuccess: data => {
|
|
|
+ console.log(data)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ const onTabChange = activeKey => {
|
|
|
+ setTabActive(activeKey)
|
|
|
+ }
|
|
|
+ const columns = [
|
|
|
+ {
|
|
|
+ title: '标题',
|
|
|
+ dataIndex: 'table_name'
|
|
|
+ },
|
|
|
+ {
|
|
|
+
|
|
|
+ title: '摘要',
|
|
|
+ dataIndex: 'table_desc'
|
|
|
+ },
|
|
|
+ {
|
|
|
+
|
|
|
+ title: '发起人',
|
|
|
+ dataIndex: 'AuthorInfo.CName'
|
|
|
+ },
|
|
|
+ {
|
|
|
+
|
|
|
+ title: '发起时间',
|
|
|
+ render: (record) => {
|
|
|
+ return dayjs(record.create_time).format('YYYY-MM-DD HH:mm:ss')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+
|
|
|
+ title: '流程状态',
|
|
|
+ dataIndex: 'status'
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ const approveColumns = [
|
|
|
+ {
|
|
|
+ title: '标题',
|
|
|
+ dataIndex: 'table_name'
|
|
|
+ },
|
|
|
+ {
|
|
|
+
|
|
|
+ title: '摘要',
|
|
|
+ dataIndex: 'table_desc'
|
|
|
+ },
|
|
|
+ {
|
|
|
+
|
|
|
+ title: '发起人',
|
|
|
+ dataIndex: 'AuthorInfo.CName'
|
|
|
+ },
|
|
|
+ {
|
|
|
+
|
|
|
+ title: '发起时间',
|
|
|
+ render: (record) => {
|
|
|
+ return dayjs(record.create_time).format('YYYY-MM-DD HH:mm:ss')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+
|
|
|
+ title: '流程状态',
|
|
|
+ dataIndex: 'status'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '操作',
|
|
|
+ render: (text, record) => (
|
|
|
+ <Fragment>
|
|
|
+ <>
|
|
|
+ <a style={{ color: "#4096ff" }} onClick={() => {
|
|
|
+ navigate(`/oa/detail/${record.flow_id}/${record.id}`)
|
|
|
+ }}>审批</a>
|
|
|
+ </>
|
|
|
+ </Fragment>
|
|
|
+ ),
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ const handleApplySubmit = (values) => {
|
|
|
+ console.log(values);
|
|
|
+ };
|
|
|
+ const handleApproveSubmit = (values) => {
|
|
|
+ console.log(values);
|
|
|
+ };
|
|
|
+ const renderPage = activeKey => {
|
|
|
+ if (activeKey == '1')
|
|
|
+ return <> <Form
|
|
|
+ name="basic"
|
|
|
+ // labelCol={{ span: 0 }}
|
|
|
+ // wrapperCol={{ span: 24 }}
|
|
|
+ onFinish={handleApplySubmit}
|
|
|
+ ref={applyFormRef}
|
|
|
+ >
|
|
|
+ <div style={{ display: 'flex' }}>
|
|
|
+ <Form.Item name="range-picker" label="申请时间:">
|
|
|
+ <RangePicker />
|
|
|
+ </Form.Item>
|
|
|
+ <Form.Item>
|
|
|
+ <Button type="primary" htmlType="submit" style={{ marginLeft: 10 }}>
|
|
|
+ 查询
|
|
|
+ </Button>
|
|
|
+ </Form.Item>
|
|
|
+ </div>
|
|
|
+ <Table
|
|
|
+ columns={columns}
|
|
|
+ />
|
|
|
+ </Form>
|
|
|
+ </>
|
|
|
+ else if (activeKey == '2')
|
|
|
+ return <> <Form
|
|
|
+ name="basic"
|
|
|
+ // labelCol={{ span: 0 }}
|
|
|
+ // wrapperCol={{ span: 24 }}
|
|
|
+ onFinish={handleApproveSubmit}
|
|
|
+ ref={approveFormRef}
|
|
|
+ >
|
|
|
+ <div style={{ display: 'flex' }}>
|
|
|
+ <Form.Item name="range-picker" label="审批时间:">
|
|
|
+ <RangePicker />
|
|
|
+ </Form.Item>
|
|
|
+ <Form.Item>
|
|
|
+ <Button type="primary" htmlType="submit" style={{ marginLeft: 10 }}>
|
|
|
+ 查询
|
|
|
+ </Button>
|
|
|
+ </Form.Item>
|
|
|
+ </div>
|
|
|
+ </Form>
|
|
|
+ <Table
|
|
|
+ rowKey='id'
|
|
|
+ columns={approveColumns}
|
|
|
+ dataSource={queryProfileListRequest?.data?.list}
|
|
|
+ />
|
|
|
+ </>
|
|
|
+ }
|
|
|
+ return (
|
|
|
+ <PageContainer
|
|
|
+ header={{
|
|
|
+ title: '个人中心'
|
|
|
+ }}
|
|
|
+ tabList={[
|
|
|
+ {
|
|
|
+ tab: '我的申请',
|
|
|
+ key: '1',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ tab: '我的审批',
|
|
|
+ key: '2',
|
|
|
+ },
|
|
|
+ ]}
|
|
|
+ onTabChange={onTabChange}
|
|
|
+ >
|
|
|
+ <div>
|
|
|
+ {renderPage(tabActive)}
|
|
|
+ </div>
|
|
|
+ </PageContainer >
|
|
|
+ )
|
|
|
+}
|
|
|
+export default profile;
|