feat
parent
1b0c0ba9b5
commit
c8fd19b3b8
|
|
@ -10,7 +10,7 @@ module.exports = {
|
|||
javaGitBranch: "<branch-name>",
|
||||
// 本地联调 safetyEval-service(context-path: /safetyEval,默认端口 8095)
|
||||
// 可通过环境变量覆盖: SAFETY_EVAL_API_HOST=http://192.168.x.x:8095
|
||||
API_HOST: "http://127.0.0.1",
|
||||
API_HOST: "http://192.168.0.152",
|
||||
},
|
||||
production: {
|
||||
// 应用后端分支名称,部署上线需要
|
||||
|
|
|
|||
|
|
@ -1,42 +1,35 @@
|
|||
import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
|
||||
import {
|
||||
buildDepartmentTree,
|
||||
fromDepartmentForm,
|
||||
fromPageResponse,
|
||||
fromSingleResponse,
|
||||
toDepartmentForm,
|
||||
toPageQuery,
|
||||
} from "../../utils/enterpriseInfo/adapter";
|
||||
import { apiGet, apiPost, apiPostDelete, safeAction, safePageResult } from "../../utils/enterpriseInfo/http";
|
||||
|
||||
export const orgDepartmentGet = declareRequest("orgDepartmentLoading", safeAction(async (params) => {
|
||||
const res = await apiGet("/safetyEval/org-department/get", { id: params.id });
|
||||
return fromSingleResponse(res, toDepartmentForm);
|
||||
}));
|
||||
|
||||
export const orgDepartmentTree = declareRequest("orgDepartmentLoading", safeAction(async () => {
|
||||
const res = await apiGet("/safetyEval/org-department/page", toPageQuery({ current: 1, size: 500 }));
|
||||
const pageData = fromPageResponse(res, toDepartmentForm);
|
||||
return {
|
||||
success: true,
|
||||
data: buildDepartmentTree(pageData.data || []),
|
||||
};
|
||||
}));
|
||||
export const orgDepartmentGet = declareRequest(
|
||||
"orgDepartmentLoading",
|
||||
"Get > /safetyEval/org-department/get",
|
||||
"orgDepartmentDetail: {} | res.data || {}",
|
||||
);
|
||||
|
||||
export const orgDepartmentList = declareRequest("orgDepartmentLoading", safePageResult(async (params) => {
|
||||
const query = toPageQuery(params, { likeDeptName: "deptName" });
|
||||
const res = await apiGet("/safetyEval/org-department/page", query);
|
||||
return fromPageResponse(res, toDepartmentForm);
|
||||
}));
|
||||
export const orgDepartmentTree = declareRequest(
|
||||
"orgDepartmentLoading",
|
||||
"Get > /safetyEval/org-department/tree",
|
||||
"orgDepartmentTreeData: [] | res.data || []",
|
||||
);
|
||||
|
||||
export const orgDepartmentAdd = declareRequest("orgDepartmentLoading", safeAction(async (values) => {
|
||||
return apiPost("/safetyEval/org-department/save", fromDepartmentForm(values));
|
||||
}));
|
||||
export const orgDepartmentList = declareRequest(
|
||||
"orgDepartmentLoading",
|
||||
"Get > /safetyEval/org-department/page",
|
||||
"dataSource: [] | res.data || [] & total: 0 | res.totalCount || 0",
|
||||
);
|
||||
|
||||
export const orgDepartmentEdit = declareRequest("orgDepartmentLoading", safeAction(async (values) => {
|
||||
return apiPost("/safetyEval/org-department/modify", fromDepartmentForm(values));
|
||||
}));
|
||||
export const orgDepartmentAdd = declareRequest(
|
||||
"orgDepartmentLoading",
|
||||
"Post > @/safetyEval/org-department/save",
|
||||
);
|
||||
|
||||
export const orgDepartmentRemove = declareRequest("orgDepartmentLoading", safeAction(async ({ id }) => {
|
||||
return apiPostDelete("/safetyEval/org-department/delete", id);
|
||||
}));
|
||||
export const orgDepartmentEdit = declareRequest(
|
||||
"orgDepartmentLoading",
|
||||
"Post > @/safetyEval/org-department/modify",
|
||||
);
|
||||
|
||||
export const orgDepartmentRemove = declareRequest(
|
||||
"orgDepartmentLoading",
|
||||
"Post > @/safetyEval/org-department/delete",
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,29 +1,22 @@
|
|||
import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
|
||||
import {
|
||||
fromPageResponse,
|
||||
fromPositionForm,
|
||||
toPageQuery,
|
||||
toPositionForm,
|
||||
} from "../../utils/enterpriseInfo/adapter";
|
||||
import { apiGet, apiPost, apiPostDelete, safeAction, safePageResult } from "../../utils/enterpriseInfo/http";
|
||||
|
||||
export const orgPositionList = declareRequest("orgPositionLoading", safePageResult(async (params) => {
|
||||
const query = toPageQuery(params, {
|
||||
eqDeptId: "deptId",
|
||||
likePositionName: "positionName",
|
||||
});
|
||||
const res = await apiGet("/safetyEval/org-position/page", query);
|
||||
return fromPageResponse(res, toPositionForm);
|
||||
}));
|
||||
export const orgPositionList = declareRequest(
|
||||
"orgPositionLoading",
|
||||
"Get > /safetyEval/org-position/page",
|
||||
"dataSource: [] | res.data || [] & total: 0 | res.totalCount || 0",
|
||||
);
|
||||
|
||||
export const orgPositionAdd = declareRequest("orgPositionLoading", safeAction(async (values) => {
|
||||
return apiPost("/safetyEval/org-position/save", fromPositionForm(values));
|
||||
}));
|
||||
export const orgPositionAdd = declareRequest(
|
||||
"orgPositionLoading",
|
||||
"Post > @/safetyEval/org-position/save",
|
||||
);
|
||||
|
||||
export const orgPositionEdit = declareRequest("orgPositionLoading", safeAction(async (values) => {
|
||||
return apiPost("/safetyEval/org-position/modify", fromPositionForm(values));
|
||||
}));
|
||||
export const orgPositionEdit = declareRequest(
|
||||
"orgPositionLoading",
|
||||
"Post > @/safetyEval/org-position/modify",
|
||||
);
|
||||
|
||||
export const orgPositionRemove = declareRequest("orgPositionLoading", safeAction(async ({ id }) => {
|
||||
return apiPostDelete("/safetyEval/org-position/delete", id);
|
||||
}));
|
||||
export const orgPositionRemove = declareRequest(
|
||||
"orgPositionLoading",
|
||||
"Post > @/safetyEval/org-position/delete",
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,15 +1,30 @@
|
|||
import { PlusOutlined } from "@ant-design/icons";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Empty, Form, Input, message, Modal, Row, Col, Select, Space, Tree } from "antd";
|
||||
import {
|
||||
Button,
|
||||
Empty,
|
||||
Form,
|
||||
Input,
|
||||
message,
|
||||
Modal,
|
||||
Select,
|
||||
Space,
|
||||
Tree,
|
||||
Table,
|
||||
TreeSelect,
|
||||
} from "antd";
|
||||
import { AntdTableFuncControl } from "@cqsjjb/jjb-common-decorator/antd";
|
||||
import TableAction from "@cqsjjb/jjb-react-admin-component/TableAction";
|
||||
import { useEffect, useMemo, useRef, useState } from "react";
|
||||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||
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 useTable from "zy-react-library/hooks/useTable";
|
||||
import { NS_ORG_DEPARTMENT, NS_ORG_POSITION, NS_STAFF_INFO } from "~/enumerate/namespace";
|
||||
import SearchForm from "@cqsjjb/jjb-react-admin-component/SearchForm";
|
||||
|
||||
import {
|
||||
NS_ORG_DEPARTMENT,
|
||||
NS_ORG_POSITION,
|
||||
NS_STAFF_INFO,
|
||||
} from "~/enumerate/namespace";
|
||||
import { asId, sameId } from "~/utils/enterpriseInfo/idUtil";
|
||||
import { safeListRequest, safeRequest } from "~/utils";
|
||||
|
||||
function findDeptNode(nodes = [], id) {
|
||||
for (const node of nodes) {
|
||||
|
|
@ -33,9 +48,9 @@ function toSelectedDept(node) {
|
|||
return {
|
||||
id: asId(node.id),
|
||||
deptName: node.deptName || node.title,
|
||||
leaderAccount: node.leaderAccount,
|
||||
leaderName: node.leaderName,
|
||||
deptLevel: node.deptLevel,
|
||||
managerAccount: node.managerAccount,
|
||||
managerName: node.managerName,
|
||||
deptLevelName: node.deptLevelName,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -49,50 +64,62 @@ function DepartmentPositionPage(props) {
|
|||
const [staffOptions, setStaffOptions] = useState([]);
|
||||
const [positionForm] = Form.useForm();
|
||||
const [modalForm] = Form.useForm();
|
||||
const [dataSource, setDataSource] = useState([]);
|
||||
const [total, setTotal] = useState(0);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [pageIndex, setPageIndex] = useState(1);
|
||||
const [pageSize, setPageSize] = useState(10);
|
||||
|
||||
useEffect(() => {
|
||||
(async () => {
|
||||
try {
|
||||
const res = await props.staffInfoList?.({ pageIndex: 1, pageSize: 500 });
|
||||
setStaffOptions((res?.data || []).map((s) => ({
|
||||
label: `${s.userName ?? s.staffName}(${s.account})`,
|
||||
value: s.account,
|
||||
staffName: s.userName ?? s.staffName,
|
||||
})));
|
||||
}
|
||||
catch (err) {
|
||||
const res = await props.staffInfoList?.({
|
||||
pageIndex: 1,
|
||||
pageSize: 500,
|
||||
});
|
||||
setStaffOptions(
|
||||
(res?.data || []).map((s) => ({
|
||||
label: `${s.userName ?? s.staffName}(${s.account})`,
|
||||
value: s.account,
|
||||
staffName: s.userName ?? s.staffName,
|
||||
})),
|
||||
);
|
||||
} catch (err) {
|
||||
console.warn("[DepartmentPosition] load staff options failed:", err);
|
||||
}
|
||||
})();
|
||||
}, []);
|
||||
|
||||
const { tableProps: positionTableProps, getData: getPositionData } = useTable(
|
||||
safeListRequest(props.orgPositionList),
|
||||
{
|
||||
form: positionForm,
|
||||
transform: (formData) => ({
|
||||
const fetchPositionData = async (page = 1, size = 10) => {
|
||||
if (!selectedDept?.id) return;
|
||||
setLoading(true);
|
||||
try {
|
||||
const formData = positionForm.getFieldsValue();
|
||||
const res = await props.orgPositionList({
|
||||
...formData,
|
||||
eqDeptId: asId(selectedDept?.id),
|
||||
}),
|
||||
},
|
||||
);
|
||||
pageIndex: page,
|
||||
pageSize: size,
|
||||
deptId: asId(selectedDept.id),
|
||||
});
|
||||
setDataSource(res?.data || []);
|
||||
setTotal(res?.totalCount || 0);
|
||||
} catch {
|
||||
setDataSource([]);
|
||||
setTotal(0);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
const loadTree = async () => {
|
||||
try {
|
||||
const res = await props.orgDepartmentTree();
|
||||
const normalizeTree = (nodes = []) => nodes.map((node) => ({
|
||||
...node,
|
||||
title: node.title || node.deptName,
|
||||
deptName: node.deptName || node.title,
|
||||
children: node.children ? normalizeTree(node.children) : [],
|
||||
}));
|
||||
const tree = normalizeTree(res?.data || []);
|
||||
const tree = res?.data || [];
|
||||
setTreeData(tree);
|
||||
if ( tree.length) {
|
||||
if (tree.length) {
|
||||
setSelectedDept(toSelectedDept(tree[0]));
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
} catch (err) {
|
||||
console.warn("[DepartmentPosition] loadTree failed:", err);
|
||||
setTreeData([]);
|
||||
}
|
||||
|
|
@ -104,7 +131,7 @@ function DepartmentPositionPage(props) {
|
|||
|
||||
useEffect(() => {
|
||||
if (selectedDept?.id) {
|
||||
getPositionData();
|
||||
fetchPositionData(1, 10);
|
||||
}
|
||||
}, [selectedDept?.id]);
|
||||
|
||||
|
|
@ -134,7 +161,7 @@ function DepartmentPositionPage(props) {
|
|||
okText: "是",
|
||||
cancelText: "否",
|
||||
onOk: async () => {
|
||||
const res = await props.orgDepartmentRemove({ id });
|
||||
const res = await props.orgDepartmentRemove({ data: id });
|
||||
if (res?.success !== false) {
|
||||
message.success("删除成功");
|
||||
if (sameId(selectedDept?.id, id)) {
|
||||
|
|
@ -156,7 +183,7 @@ function DepartmentPositionPage(props) {
|
|||
const res = await props.orgPositionRemove({ id });
|
||||
if (res?.success !== false) {
|
||||
message.success("删除成功");
|
||||
getPositionData();
|
||||
fetchPositionData(1, 10);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
|
@ -192,9 +219,11 @@ function DepartmentPositionPage(props) {
|
|||
deptId: asId(record.deptId || selectedDept.id),
|
||||
deptName: record.deptName || selectedDept.deptName,
|
||||
});
|
||||
}
|
||||
else {
|
||||
modalForm.setFieldsValue({ deptId: asId(selectedDept.id), deptName: selectedDept.deptName });
|
||||
} else {
|
||||
modalForm.setFieldsValue({
|
||||
deptId: asId(selectedDept.id),
|
||||
deptName: selectedDept.deptName,
|
||||
});
|
||||
}
|
||||
setPositionModalOpen(true);
|
||||
};
|
||||
|
|
@ -210,9 +239,8 @@ function DepartmentPositionPage(props) {
|
|||
if (res?.success !== false) {
|
||||
message.success(currentId ? "编辑成功" : "添加成功");
|
||||
closePositionModal();
|
||||
getPositionData();
|
||||
}
|
||||
else {
|
||||
fetchPositionData(pageIndex, pageSize);
|
||||
} else {
|
||||
message.error(res?.message || "操作失败");
|
||||
}
|
||||
};
|
||||
|
|
@ -220,9 +248,24 @@ function DepartmentPositionPage(props) {
|
|||
return (
|
||||
<PageLayout title="部门岗位管理">
|
||||
<div style={{ display: "flex", gap: 16, minHeight: 480 }}>
|
||||
<div style={{ width: 260, borderRight: "1px solid #f0f0f0", paddingRight: 16, flexShrink: 0 }}>
|
||||
<Space direction="vertical" style={{ width: "100%", marginBottom: 12 }}>
|
||||
<Button type="primary" icon={<AddIcon />} block onClick={() => openDeptModal()}>
|
||||
<div
|
||||
style={{
|
||||
width: 260,
|
||||
borderRight: "1px solid #f0f0f0",
|
||||
paddingRight: 16,
|
||||
flexShrink: 0,
|
||||
}}
|
||||
>
|
||||
<Space
|
||||
direction="vertical"
|
||||
style={{ width: "100%", marginBottom: 12 }}
|
||||
>
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<PlusOutlined />}
|
||||
block
|
||||
onClick={() => openDeptModal()}
|
||||
>
|
||||
新增部门
|
||||
</Button>
|
||||
<Input.Search
|
||||
|
|
@ -243,24 +286,45 @@ function DepartmentPositionPage(props) {
|
|||
<div style={{ flex: 1, minWidth: 0 }}>
|
||||
{selectedDept?.id ? (
|
||||
<>
|
||||
<div style={{ display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 16 }}>
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
justifyContent: "space-between",
|
||||
alignItems: "center",
|
||||
marginBottom: 16,
|
||||
}}
|
||||
>
|
||||
<span>
|
||||
当前部门:
|
||||
<strong>{selectedDept.deptName}</strong>
|
||||
</span>
|
||||
<Space>
|
||||
<Button onClick={() => openDeptModal(selectedDept)}>编辑部门</Button>
|
||||
<Button danger onClick={() => onDeleteDept(selectedDept.id)}>删除部门</Button>
|
||||
<Button onClick={() => openDeptModal(selectedDept)}>
|
||||
编辑部门
|
||||
</Button>
|
||||
<Button danger onClick={() => onDeleteDept(selectedDept.id)}>
|
||||
删除部门
|
||||
</Button>
|
||||
</Space>
|
||||
</div>
|
||||
<Search
|
||||
<SearchForm
|
||||
form={positionForm}
|
||||
options={[{ name: "likePositionName", label: "岗位名称", placeholder: "请输入岗位名称" }]}
|
||||
onFinish={getPositionData}
|
||||
loading={loading}
|
||||
formLine={[
|
||||
<Form.Item key="positionName" name="positionName">
|
||||
<Input allowClear placeholder="请输入岗位名称" />
|
||||
</Form.Item>,
|
||||
]}
|
||||
onFinish={() => fetchPositionData(1, 10)}
|
||||
style={{ marginBottom: 16 }}
|
||||
/>
|
||||
<Table
|
||||
toolBarRender={() => (
|
||||
<Button type="primary" icon={<AddIcon />} onClick={() => openPositionModal()}>
|
||||
footer={() => (
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<PlusOutlined />}
|
||||
onClick={() => openPositionModal()}
|
||||
>
|
||||
新增岗位
|
||||
</Button>
|
||||
)}
|
||||
|
|
@ -273,13 +337,38 @@ function DepartmentPositionPage(props) {
|
|||
width: 160,
|
||||
render: (_, record) => (
|
||||
<TableAction>
|
||||
<Button type="link" onClick={() => openPositionModal(record)}>编辑</Button>
|
||||
<Button danger type="link" onClick={() => onDeletePosition(record.id)}>删除</Button>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => openPositionModal(record)}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
<Button
|
||||
danger
|
||||
type="link"
|
||||
onClick={() => onDeletePosition(record.id)}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
</TableAction>
|
||||
),
|
||||
},
|
||||
]}
|
||||
{...positionTableProps}
|
||||
dataSource={dataSource}
|
||||
loading={loading}
|
||||
pagination={{
|
||||
current: pageIndex,
|
||||
pageSize,
|
||||
total,
|
||||
showSizeChanger: true,
|
||||
showTotal: (t) => `共 ${t} 条`,
|
||||
}}
|
||||
scroll={{ y: props.scrollY }}
|
||||
onChange={(pag) => {
|
||||
setPageIndex(pag.current);
|
||||
setPageSize(pag.pageSize);
|
||||
fetchPositionData(pag.current, pag.pageSize);
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
) : (
|
||||
|
|
@ -292,6 +381,7 @@ function DepartmentPositionPage(props) {
|
|||
<DeptFormModal
|
||||
open={deptModalOpen}
|
||||
currentId={currentId}
|
||||
selectedDeptId={selectedDept?.id}
|
||||
staffOptions={staffOptions}
|
||||
treeData={treeData}
|
||||
requestAdd={props.orgDepartmentAdd}
|
||||
|
|
@ -330,10 +420,20 @@ function DepartmentPositionPage(props) {
|
|||
label="岗位职责"
|
||||
rules={[{ required: true, message: "请输入岗位职责" }]}
|
||||
>
|
||||
<Input.TextArea rows={3} placeholder="请输入岗位职责" showCount maxLength={500} />
|
||||
<Input.TextArea
|
||||
rows={3}
|
||||
placeholder="请输入岗位职责"
|
||||
showCount
|
||||
maxLength={500}
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item name="remark" label="备注">
|
||||
<Input.TextArea rows={2} placeholder="请输入备注" showCount maxLength={500} />
|
||||
<Input.TextArea
|
||||
rows={2}
|
||||
placeholder="请输入备注"
|
||||
showCount
|
||||
maxLength={500}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
|
|
@ -342,12 +442,12 @@ function DepartmentPositionPage(props) {
|
|||
);
|
||||
}
|
||||
|
||||
function resolveLeaderAccount(dept, options) {
|
||||
if (dept?.leaderAccount) {
|
||||
return dept.leaderAccount;
|
||||
function resolveManagerAccount(dept, options) {
|
||||
if (dept?.managerAccount) {
|
||||
return dept.managerAccount;
|
||||
}
|
||||
if (dept?.leaderName) {
|
||||
const matched = options.find((item) => item.staffName === dept.leaderName);
|
||||
if (dept?.managerName) {
|
||||
const matched = options.find((item) => item.staffName === dept.managerName);
|
||||
return matched?.value;
|
||||
}
|
||||
return undefined;
|
||||
|
|
@ -363,6 +463,7 @@ function DeptFormModal({
|
|||
requestDetails,
|
||||
onCancel,
|
||||
onSuccess,
|
||||
selectedDeptId,
|
||||
}) {
|
||||
const [form] = Form.useForm();
|
||||
const [submitting, setSubmitting] = useState(false);
|
||||
|
|
@ -389,8 +490,12 @@ function DeptFormModal({
|
|||
let dept = null;
|
||||
const getDetails = requestDetailsRef.current;
|
||||
if (typeof getDetails === "function") {
|
||||
const res = await safeRequest(getDetails, { id: currentId });
|
||||
dept = res?.data || null;
|
||||
try {
|
||||
const res = await getDetails({ id: currentId });
|
||||
dept = res?.data || null;
|
||||
} catch {
|
||||
dept = null;
|
||||
}
|
||||
}
|
||||
if (!dept) {
|
||||
dept = findDeptNode(treeDataRef.current, currentId);
|
||||
|
|
@ -398,8 +503,8 @@ function DeptFormModal({
|
|||
if (!cancelled && dept) {
|
||||
form.setFieldsValue({
|
||||
...dept,
|
||||
leaderAccount: resolveLeaderAccount(dept, staffOptionsRef.current),
|
||||
leaderName: dept.leaderName,
|
||||
managerAccount: resolveManagerAccount(dept, staffOptionsRef.current),
|
||||
managerName: dept.managerName,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -413,9 +518,9 @@ function DeptFormModal({
|
|||
};
|
||||
}, [open, currentId]);
|
||||
|
||||
const onLeaderChange = (account) => {
|
||||
const onManagerChange = (account) => {
|
||||
const staff = staffOptions.find((s) => s.value === account);
|
||||
form.setFieldValue("leaderName", staff?.staffName || "");
|
||||
form.setFieldValue("managerName", staff?.staffName || "");
|
||||
};
|
||||
|
||||
const handleSubmit = async (values) => {
|
||||
|
|
@ -432,16 +537,14 @@ function DeptFormModal({
|
|||
form.resetFields();
|
||||
onCancel();
|
||||
await onSuccess();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
message.error(res?.message || "操作失败");
|
||||
}
|
||||
}
|
||||
finally {
|
||||
} finally {
|
||||
setSubmitting(false);
|
||||
}
|
||||
};
|
||||
|
||||
console.log(treeData);
|
||||
return (
|
||||
<Modal
|
||||
open={open}
|
||||
|
|
@ -454,6 +557,19 @@ function DeptFormModal({
|
|||
onOk={form.submit}
|
||||
>
|
||||
<Form form={form} layout="vertical" onFinish={handleSubmit}>
|
||||
<Form.Item name="parentId" label="上级部门" initialValue={selectedDeptId}>
|
||||
<TreeSelect
|
||||
treeData={treeData}
|
||||
allowClear
|
||||
fieldNames={{
|
||||
label: "deptName",
|
||||
value: "id",
|
||||
children: "children",
|
||||
}}
|
||||
showSearch
|
||||
placeholder="请选择上级部门"
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name="deptName"
|
||||
label="部门名称"
|
||||
|
|
@ -461,20 +577,20 @@ function DeptFormModal({
|
|||
>
|
||||
<Input placeholder="请输入部门名称" />
|
||||
</Form.Item>
|
||||
<Form.Item name="leaderAccount" label="负责人">
|
||||
<Form.Item name="managerAccount" label="负责人">
|
||||
<Select
|
||||
allowClear
|
||||
showSearch
|
||||
placeholder="请选择负责人"
|
||||
options={staffOptions}
|
||||
optionFilterProp="label"
|
||||
onChange={onLeaderChange}
|
||||
onChange={onManagerChange}
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item name="leaderName" hidden>
|
||||
<Form.Item name="managerName" hidden>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item name="deptLevel" label="部门级别">
|
||||
<Form.Item name="deptLevelName" label="部门级别">
|
||||
<Input placeholder="请输入部门级别" />
|
||||
</Form.Item>
|
||||
</Form>
|
||||
|
|
@ -482,4 +598,7 @@ function DeptFormModal({
|
|||
);
|
||||
}
|
||||
|
||||
export default Connect([NS_ORG_DEPARTMENT, NS_ORG_POSITION, NS_STAFF_INFO], true)(DepartmentPositionPage);
|
||||
export default Connect(
|
||||
[NS_ORG_DEPARTMENT, NS_ORG_POSITION, NS_STAFF_INFO],
|
||||
true,
|
||||
)(AntdTableFuncControl(DepartmentPositionPage));
|
||||
|
|
|
|||
Loading…
Reference in New Issue