Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	src/pages/Container/EnterpriseInfo/PersonnelInfo/List/index.js
dev_1.0.1
huwei 2026-07-07 16:31:50 +08:00
commit 7f73eae341
3 changed files with 108 additions and 63 deletions

View File

@ -1,5 +1,16 @@
import { Connect } from "@cqsjjb/jjb-dva-runtime"; 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 { useEffect, useRef, useState } from "react";
import dayjs from "dayjs"; import dayjs from "dayjs";
import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout"; import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout";

View File

@ -1,26 +1,21 @@
import { 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"; } from "antd";
import TableAction from "@cqsjjb/jjb-react-admin-component/TableAction";
import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout"; import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout";
import Search from "zy-react-library/components/Search"; import SearchForm from "@cqsjjb/jjb-react-admin-component/SearchForm";
import Table from "zy-react-library/components/Table"; import ControlWrapper from "@cqsjjb/jjb-react-admin-component/ControlWrapper";
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
import useTable from "zy-react-library/hooks/useTable";
import { isOrgAccountEnabled } from "~/api/enterpriseInfo/adapter"; import { isOrgAccountEnabled } from "~/api/enterpriseInfo/adapter";
import { import {
CHONGQING_DISTRICTS, CHONGQING_DISTRICTS,
ENTERPRISE_SCALE_OPTIONS, ENTERPRISE_SCALE_OPTIONS,
ENTERPRISE_STATUS_OPTIONS,
ORG_ACCOUNT_STATE_OPTIONS, ORG_ACCOUNT_STATE_OPTIONS,
ENTERPRISE_STATUS_OPTIONS
} from "~/enumerate/enterpriseOptions"; } from "~/enumerate/enterpriseOptions";
import { NS_ORG_INFO } from "~/enumerate/namespace"; import { NS_ORG_INFO } from "~/enumerate/namespace";
import { safeListRequest, safeRequest } from "~/utils"; 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) { function OrgAccountPage(props) {
const [searchForm] = Form.useForm(); const [searchForm] = Form.useForm();
@ -32,8 +27,21 @@ function OrgAccountPage(props) {
const [rawDetail, setRawDetail] = useState(null); const [rawDetail, setRawDetail] = useState(null);
const [detailLoading, setDetailLoading] = useState(false); const [detailLoading, setDetailLoading] = useState(false);
const [editLoading, setEditLoading] = 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(() => { useEffect(() => {
getData(); getData();
@ -162,42 +170,7 @@ function OrgAccountPage(props) {
} }
}; };
return ( const columns = [
<PageLayout
title={
<div>
<span>评价机构账号管理</span>
<div className="pageLayout-extra">
监管端维护评价机构开户账号
</div>
</div>
}
>
<Search
form={searchForm}
values={SEARCH_DEFAULT_VALUES}
options={[
{ name: "orgName", label: "机构名称", placeholder: "关键字搜索", colProps: SEARCH_COL },
formSelectField("district", "属地", CHONGQING_DISTRICTS, {
colProps: SEARCH_COL,
placeholder: "请选择属地",
}),
formSelectField("state", "状态", ORG_ACCOUNT_STATE_OPTIONS, {
colProps: SEARCH_COL,
componentProps: { allowClear: false, showSearch: false },
}),
{
name: "openTimeRange",
label: "开户时间",
render: FORM_ITEM_RENDER_ENUM.DATE_RANGE,
colProps: { ...SEARCH_COL, lg: 8 },
},
]}
onFinish={getData}
/>
<Table
{...tableProps}
columns={[
{ title: "机构名称", dataIndex: "orgName", ellipsis: true }, { title: "机构名称", dataIndex: "orgName", ellipsis: true },
{ title: "属地", dataIndex: "district", width: 100 }, { title: "属地", dataIndex: "district", width: 100 },
{ {
@ -215,7 +188,7 @@ function OrgAccountPage(props) {
width: 320, width: 320,
fixed: "right", fixed: "right",
render: (_, record) => ( render: (_, record) => (
<Space size={0} wrap> <TableAction>
<Button type="link" size="small" onClick={() => openView(record.id)}>查看</Button> <Button type="link" size="small" onClick={() => openView(record.id)}>查看</Button>
<Button type="link" size="small" onClick={() => openEdit(record.id)}>编辑</Button> <Button type="link" size="small" onClick={() => openEdit(record.id)}>编辑</Button>
<Button type="link" size="small" onClick={() => onResetPassword(record)}>重置密码</Button> <Button type="link" size="small" onClick={() => onResetPassword(record)}>重置密码</Button>
@ -223,10 +196,71 @@ function OrgAccountPage(props) {
<Button type="link" size="small" onClick={() => onToggleStatus(record)}> <Button type="link" size="small" onClick={() => onToggleStatus(record)}>
{isOrgAccountEnabled(record) ? "禁用" : "启用"} {isOrgAccountEnabled(record) ? "禁用" : "启用"}
</Button> </Button>
</Space> </TableAction>
), ),
}, },
];
return (
<PageLayout
title={
<div>
<span>评价机构账号管理</span>
<div className="pageLayout-extra">
监管端维护评价机构开户账号
</div>
</div>
}
>
<SearchForm
style={{ marginBottom: 24 }}
form={searchForm}
loading={loading}
formLine={[
<Form.Item key="orgName" name="orgName">
<ControlWrapper.Input label="机构名称" placeholder="关键字搜索" allowClear />
</Form.Item>,
<Form.Item key="district" name="district">
<ControlWrapper.Select label="属地" placeholder="请选择属地" allowClear>
{CHONGQING_DISTRICTS.map((opt) => (
<Select.Option key={opt.value} value={opt.value}>{opt.label}</Select.Option>
))}
</ControlWrapper.Select>
</Form.Item>,
<Form.Item key="state" name="state">
<ControlWrapper.Select label="状态" placeholder="请选择状态">
{ORG_ACCOUNT_STATE_OPTIONS.map((opt) => (
<Select.Option key={opt.value} value={opt.value}>{opt.label}</Select.Option>
))}
</ControlWrapper.Select>
</Form.Item>,
<Form.Item key="openTimeRange" name="openTimeRange">
<ControlWrapper.DatePicker.RangePicker label="开户时间" />
</Form.Item>,
]} ]}
onReset={() => {
searchForm.resetFields();
getData();
}}
onFinish={() => getData()}
/>
<Table
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();
},
}}
/> />
<Modal <Modal