diff --git a/src/components/AttachmentUpload/index.js b/src/components/AttachmentUpload/index.js index f632a35..f6b638a 100644 --- a/src/components/AttachmentUpload/index.js +++ b/src/components/AttachmentUpload/index.js @@ -21,7 +21,7 @@ export default function AttachmentUpload({ name, label, disabled = false, maxCou fileList: value ? value.split(",").map((item) => ({ url: item, - uid: item, + uid: item, status: "done", name: "附件", })) diff --git a/src/pages/Container/EnterpriseInfo/PersonnelInfo/List/index.js b/src/pages/Container/EnterpriseInfo/PersonnelInfo/List/index.js index be78e73..6166564 100644 --- a/src/pages/Container/EnterpriseInfo/PersonnelInfo/List/index.js +++ b/src/pages/Container/EnterpriseInfo/PersonnelInfo/List/index.js @@ -1,5 +1,16 @@ import { Connect } from "@cqsjjb/jjb-dva-runtime"; -import { Button, DatePicker, Form, Input, message, Modal, Row, Col, Select, Table } from "antd"; +import { + Button, + DatePicker, + Form, + Input, + message, + Modal, + Row, + Col, + Select, + Table, +} from "antd"; import { useEffect, useRef, useState } from "react"; import dayjs from "dayjs"; import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout"; diff --git a/src/pages/Container/Supervision/BasicInfo/OrgAccount/index.js b/src/pages/Container/Supervision/BasicInfo/OrgAccount/index.js index 530e54a..28bde9d 100644 --- a/src/pages/Container/Supervision/BasicInfo/OrgAccount/index.js +++ b/src/pages/Container/Supervision/BasicInfo/OrgAccount/index.js @@ -1,26 +1,21 @@ import { - Button, Descriptions, Form, Input, InputNumber, message, Modal, Row, Col, Select, Space, Tag, + Button, DatePicker, Descriptions, Form, Input, InputNumber, message, Modal, Row, Col, Select, Space, Tag, Table, } from "antd"; +import TableAction from "@cqsjjb/jjb-react-admin-component/TableAction"; import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { useEffect, useState } from "react"; import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout"; -import Search from "zy-react-library/components/Search"; -import Table from "zy-react-library/components/Table"; -import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; -import useTable from "zy-react-library/hooks/useTable"; +import SearchForm from "@cqsjjb/jjb-react-admin-component/SearchForm"; +import ControlWrapper from "@cqsjjb/jjb-react-admin-component/ControlWrapper"; import { isOrgAccountEnabled } from "~/api/enterpriseInfo/adapter"; import { CHONGQING_DISTRICTS, ENTERPRISE_SCALE_OPTIONS, - ENTERPRISE_STATUS_OPTIONS, ORG_ACCOUNT_STATE_OPTIONS, + ENTERPRISE_STATUS_OPTIONS } from "~/enumerate/enterpriseOptions"; import { NS_ORG_INFO } from "~/enumerate/namespace"; import { safeListRequest, safeRequest } from "~/utils"; -import { formSelectField } from "~/utils/enterpriseForm"; - -const SEARCH_COL = { xs: 24, sm: 12, md: 8, lg: 6 }; -const SEARCH_DEFAULT_VALUES = { state: "" }; function OrgAccountPage(props) { const [searchForm] = Form.useForm(); @@ -32,8 +27,21 @@ function OrgAccountPage(props) { const [rawDetail, setRawDetail] = useState(null); const [detailLoading, setDetailLoading] = useState(false); const [editLoading, setEditLoading] = useState(false); + const [dataSource, setDataSource] = useState([]); + const [total, setTotal] = useState(0); + const [loading, setLoading] = useState(false); - const { tableProps, getData } = useTable(safeListRequest(props.orgAccountList), { form: searchForm }); + const getData = async () => { + setLoading(true); + try { + const params = searchForm.getFieldsValue(); + const res = await safeListRequest(props.orgAccountList)(params); + setDataSource(res?.data || []); + setTotal(res?.total || 0); + } finally { + setLoading(false); + } + }; useEffect(() => { getData(); @@ -162,6 +170,37 @@ function OrgAccountPage(props) { } }; + const columns = [ + { title: "机构名称", dataIndex: "orgName", ellipsis: true }, + { title: "属地", dataIndex: "district", width: 100 }, + { + title: "状态", + width: 80, + render: (_, record) => ( + + {isOrgAccountEnabled(record) ? "启用" : "禁用"} + + ), + }, + { title: "开户时间", dataIndex: "createTime", width: 110 }, + { + title: "操作", + width: 320, + fixed: "right", + render: (_, record) => ( + + + + + + + + ), + }, + ]; + return ( } > - + + , + + + {CHONGQING_DISTRICTS.map((opt) => ( + {opt.label} + ))} + + , + + + {ORG_ACCOUNT_STATE_OPTIONS.map((opt) => ( + {opt.label} + ))} + + , + + + , ]} - onFinish={getData} + onReset={() => { + searchForm.resetFields(); + getData(); + }} + onFinish={() => getData()} /> ( - - {isOrgAccountEnabled(record) ? "启用" : "禁用"} - - ), + rowKey="id" + columns={columns} + dataSource={dataSource} + scroll={{ y: props.scrollY }} + loading={loading} + pagination={{ + total, + showSizeChanger: true, + showQuickJumper: true, + showTotal: (t) => `共 ${t} 条`, + current: 1, + pageSize: 10, + onChange: (page, pageSize) => { + getData(); }, - { title: "开户时间", dataIndex: "createTime", width: 110 }, - { - title: "操作", - width: 320, - fixed: "right", - render: (_, record) => ( - - - - - - - - ), - }, - ]} + }} />