diff --git a/src/api/system/notice.ts b/src/api/system/notice.ts
new file mode 100644
index 0000000..81dd7f9
--- /dev/null
+++ b/src/api/system/notice.ts
@@ -0,0 +1,23 @@
+import request from "../../utils/request";
+
+export const getNoticeListApi = (params: any) => {
+ return request({
+ url: "/notice/notify",
+ method: "get",
+ params,
+ });
+};
+
+export const getNoticeInfoApi = (id: number) => {
+ return request({
+ url: "/notice/notify/" + id,
+ method: "get",
+ });
+};
+
+export const deleteNoticeInfoApi = (id: number) => {
+ return request({
+ url: "/notice/notify/" + id,
+ method: "delete",
+ });
+};
diff --git a/src/api/system/post.ts b/src/api/system/post.ts
new file mode 100644
index 0000000..d344de1
--- /dev/null
+++ b/src/api/system/post.ts
@@ -0,0 +1,51 @@
+import request from "../../utils/request";
+
+interface postListParams {
+ postCode?: string;
+ postName?: string;
+ state?: string;
+ pageNum?: string;
+ pageSize?: string;
+}
+
+export const getPostListApi = (data: postListParams) => {
+ const { postCode, postName, state, pageNum } = data;
+ const params = data
+ ? {
+ postCode,
+ postName,
+ state,
+ pageNum,
+ pageSize: 500,
+ }
+ : undefined;
+
+ return request({
+ url: "/admin/post",
+ method: "get",
+ params,
+ });
+};
+
+export const addPostApi = (data: any) => {
+ return request({
+ url: "/admin/post",
+ method: "post",
+ data,
+ });
+};
+
+export const editPostApi = (data: any) => {
+ return request({
+ url: "/admin/post",
+ method: "put",
+ data,
+ });
+};
+
+export const deletePostApi = (postId: any) => {
+ return request({
+ url: "/admin/post/" + postId,
+ method: "delete",
+ });
+};
diff --git a/src/api/system/role.ts b/src/api/system/role.ts
index 76187b1..5c61735 100644
--- a/src/api/system/role.ts
+++ b/src/api/system/role.ts
@@ -1,25 +1,26 @@
import request from "@/utils/request";
interface paramsType {
- createTime?: string,
- dataScope?: string,
- deptIds?: any[],
- menuIds?: any[],
- roleId?: number,
- roleKey?: string,
- roleName?: string,
- state?: string,
- endTime?: string,
- startTime?: string,
- pageNum?: number,
- pageSize?: number
+ createTime?: string;
+ dataScope?: string;
+ deptIds?: any[];
+ menuIds?: any[];
+ roleId?: number;
+ roleKey?: string;
+ roleName?: string;
+ state?: string;
+ endTime?: string;
+ startTime?: string;
+ pageNum?: number;
+ pageSize?: number;
}
export const getRolesDataAPI = (params: paramsType) => {
- const { endTime, roleKey, roleName, startTime, state, pageNum, pageSize } = params
+ const { endTime, roleKey, roleName, startTime, state, pageNum, pageSize } =
+ params;
// console.log('API',params);
-
+
return request({
- url: '/admin/role',
- method: 'get',
+ url: "/admin/role",
+ method: "get",
params: {
endTime,
roleKey,
@@ -27,51 +28,48 @@ export const getRolesDataAPI = (params: paramsType) => {
startTime,
state,
pageNum,
- pageSize
- }
- })
-}
-export const delRoleAPI = (params: paramsType) => {
- let { roleId } = params
+ pageSize,
+ },
+ });
+};
+export const delRoleAPI = (roleId: paramsType) => {
// console.log(roleId);
return request({
url: `/admin/role/${roleId}`,
- method: 'delete',
- })
-}
+ method: "delete",
+ });
+};
export const getMenuLiseAPI = () => {
-
return request({
- url: '/admin/menu',
- method: 'get',
-
- })
-}
-export const addRoleAPI = (data:any) => {
+ url: "/admin/menu",
+ method: "get",
+ });
+};
+export const addRoleAPI = (data: any) => {
// console.log('addAPI',data);
return request({
url: `/admin/role`,
- method: 'post',
- data
- })
-}
-export const getRoleAPI = (params:paramsType) => {
- const {roleId}=params
-
+ method: "post",
+ data,
+ });
+};
+export const getRoleAPI = (params: paramsType) => {
+ const { roleId } = params;
+
return request({
url: `/admin/role/${roleId}`,
- method: 'get',
- })
-}
-export const setRoleDataAPI = (data:any) => {
+ method: "get",
+ });
+};
+export const setRoleDataAPI = (data: any) => {
// data.menuIds=[]
// const {roleId}=params
- console.log('修改',data);
-
+ console.log("修改", data);
+
return request({
url: `/admin/role`,
- method: 'put',
- data:data
- })
-}
\ No newline at end of file
+ method: "put",
+ data: data,
+ });
+};
diff --git a/src/api/system/users.ts b/src/api/system/users.ts
new file mode 100644
index 0000000..3773d0b
--- /dev/null
+++ b/src/api/system/users.ts
@@ -0,0 +1,86 @@
+import request from "../../utils/request";
+
+interface userListParams {
+ deptId?: string;
+ userName?: string;
+ phoneNumber?: string;
+ state?: string;
+ startTime?: string;
+ endTime?: string;
+ pageNum?: number;
+ pageSize?: number;
+}
+
+export const getDeptTreeApi = () => {
+ return request({
+ url: "/admin/dept",
+ method: "get",
+ });
+};
+
+export const getUserInfoApi = (userId: string) => {
+ return request({
+ url: "/admin/user/info/" + userId,
+ method: "get",
+ });
+};
+
+export const getRoleListApi = () => {
+ return request({
+ url: "/admin/role",
+ method: "get",
+ });
+};
+
+export const getPostListApi = () => {
+ return request({
+ url: "/admin/post",
+ method: "get",
+ });
+};
+
+export const getUserListApi = (data: userListParams) => {
+ const { deptId, userName, phoneNumber, state, startTime, endTime, pageNum } =
+ data;
+ const params = data
+ ? {
+ deptId,
+ userName,
+ phoneNumber,
+ state,
+ startTime,
+ endTime,
+ pageNum,
+ pageSize: 500,
+ }
+ : undefined;
+
+ return request({
+ url: "/admin/user",
+ method: "get",
+ params,
+ });
+};
+
+export const addUserApi = (data: any) => {
+ return request({
+ url: "/admin/user",
+ method: "post",
+ data,
+ });
+};
+
+export const editUserApi = (data: any) => {
+ return request({
+ url: "/admin/user",
+ method: "put",
+ data,
+ });
+};
+
+export const deleteUserApi = (userId: any) => {
+ return request({
+ url: "/admin/user/" + userId,
+ method: "delete",
+ });
+};
diff --git a/src/view/system/notice/inform/index.scss b/src/view/system/notice/inform/index.scss
new file mode 100644
index 0000000..12821c2
--- /dev/null
+++ b/src/view/system/notice/inform/index.scss
@@ -0,0 +1,60 @@
+#content {
+ display: flex;
+ border-top: 1px solid black;
+ .dept-content {
+ flex: 20%;
+ padding: 35px 12px 0 0;
+ height: calc(100vh - 85px);
+ }
+
+ .left-dept {
+ flex: 20%;
+ padding: 35px 12px 0 0;
+ height: calc(100vh - 85px);
+ border: 1px solid red;
+ border-top: 1px solid black;
+ }
+ .right {
+ flex: 80%;
+ height: 190px;
+ display: flex;
+ flex-direction: column;
+
+ .search-content {
+ display: flex;
+ width: 500px;
+ justify-content: space-around;
+ padding: 35px 12px 0 0;
+ margin-left: 20px;
+ }
+ }
+ .table-content {
+ margin: 12px 0 0 12px;
+
+ .ant-table-thead > tr > th {
+ color: #909399;
+ text-align: center;
+ }
+ .ant-table-tbody > tr > td {
+ text-align: center;
+ }
+ }
+ .add-content {
+ display: flex;
+ margin-left: 12px;
+ margin-top: 20px;
+ button:focus,
+ button:focus-visible {
+ outline: none;
+ }
+ }
+ .user-mid-button {
+ display: flex;
+ margin-left: 12px;
+ margin-top: 20px;
+ button:focus,
+ button:focus-visible {
+ outline: none;
+ }
+ }
+}
diff --git a/src/view/system/notice/inform/index.tsx b/src/view/system/notice/inform/index.tsx
index 0dbeafb..b48eae1 100644
--- a/src/view/system/notice/inform/index.tsx
+++ b/src/view/system/notice/inform/index.tsx
@@ -1,5 +1,242 @@
+import "./index.scss";
+import { Select, Button, Table, Space, Tag, message, Modal } from "antd";
+
+import {
+ EditOutlined,
+ DeleteOutlined,
+ ExclamationCircleFilled,
+} from "@ant-design/icons";
+
+import {
+ getNoticeListApi,
+ deleteNoticeInfoApi,
+} from "../../../../api/system/notice";
+
+import { useEffect, useState } from "react";
+import { SearchOutlined, RedoOutlined } from "@ant-design/icons";
+
export default function Inform() {
- return(
-
公告1
- )
-}
\ No newline at end of file
+ const [noticeInfo, setNoticeInfo] = useState("");
+ const [isNoticeOpen, setIsNoticeOpen] = useState(false);
+ const [listData, setListData] = useState([]);
+ const [messageApi, contextHolder] = message.useMessage();
+ const [queryParams, setQueryParams] = useState({
+ state: undefined,
+ pageSize: undefined,
+ pageNum: undefined,
+ });
+ const columns = [
+ {
+ title: "序号",
+ dataIndex: "noticeId",
+ key: "noticeId",
+ render: (text: string) => <>{text ? text : "null"}>,
+ },
+ {
+ title: "公告标题",
+ dataIndex: "noticeTitle",
+ key: "noticeTitle",
+ render: (text: string) => <>{text ? text : "null"}>,
+ },
+ {
+ title: "阅读状态",
+ key: "state",
+ dataIndex: "state",
+ render: (text: string) => (
+ <>
+ {text === "1" ? (
+ 已读
+ ) : (
+ 未读
+ )}
+ >
+ ),
+ },
+ {
+ title: "操作",
+ key: "operate",
+ dataIndex: "operate",
+ render: (_: string, record: object) => (
+
+ ),
+ },
+ ];
+
+ interface QueryParamsType {
+ state?: string;
+ pageSize?: number;
+ pageNum?: number;
+ }
+
+ const getList = async (newQueryParams: object) => {
+ try {
+ const { code, data } = await getNoticeListApi(newQueryParams);
+ if (code === 1000) {
+ setListData(data.rows);
+ }
+ } catch (err) {
+ console.error(err);
+ }
+ };
+
+ const handleReset = async () => {
+ setQueryParams({});
+ getList({});
+ };
+
+ const handleSearch = () => {
+ getList(queryParams);
+ };
+
+ const handleInfo = (record: any) => {
+ setIsNoticeOpen(true);
+ setNoticeInfo(record.noticeTitle);
+ };
+
+ const handleInfoOk = () => {
+ setIsNoticeOpen(false);
+ };
+
+ const handleInfoCancel = () => {
+ setIsNoticeOpen(false);
+ };
+
+ const handleDel = async (record: any) => {
+ Modal.confirm({
+ title: `确定删除Id为-${record.noticeId}-, 名称为-${record.noticeTitle}-的岗位吗?`,
+ icon: ,
+ async onOk() {
+ const { code } = await deleteNoticeInfoApi(record.noticeId);
+ try {
+ if (code === 1000) {
+ messageApi.open({
+ type: "success",
+ content: "删除成功",
+ });
+ getList({});
+ } else {
+ messageApi.open({
+ type: "error",
+ content: "删除失败",
+ });
+ }
+ } catch (err) {
+ console.log(err);
+ }
+ },
+ onCancel() {
+ messageApi.open({
+ type: "warning",
+ content: "取消成功",
+ });
+ },
+ });
+ };
+
+ const handlePageChange = (page: number) => {
+ setQueryParams({
+ ...queryParams,
+ pageNum: page,
+ });
+ };
+
+ useEffect(() => {
+ getList(queryParams);
+ }, []);
+
+ return (
+
+ <>
+
+
+ <>
+
+ 状态
+
+
+
+
+
+
+
+
+
+
+
+ >
+
+
+ {noticeInfo}
+
+
+ <>
+ {contextHolder}
+
+ `第 ${range[0]}-${range[1]} 条,共 ${total} 条`,
+ }}
+ />
+ >
+
+
+ >
+
+ );
+}
diff --git a/src/view/system/notice/publish/index.tsx b/src/view/system/notice/publish/index.tsx
index c9fdaf2..3bf6cf5 100644
--- a/src/view/system/notice/publish/index.tsx
+++ b/src/view/system/notice/publish/index.tsx
@@ -86,16 +86,16 @@ let thisrole: any = {};
export default function Inform() {
const editorInit = {
// selector:'textarea',
- min_width: 600,
- min_height: 500,
language: "zh_CN",
plugins:
"print preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template code codesample table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern help emoticons autosave bdmap indent2em autoresize formatpainter axupimgs",
toolbar:
- ["code undo redo restoredraft | cut copy paste pastetext | forecolor backcolor bold italic underline strikethrough link | anchor | alignleft aligncenter alignright alignjustify outdent indent | \
+ "code undo redo restoredraft | cut copy paste pastetext | forecolor backcolor bold italic underline strikethrough link | anchor | alignleft aligncenter alignright alignjustify outdent indent | \
styleselect formatselect fontselect fontsizeselect | bullist numlist | blockquote subscript superscript removeformat | \
- table image media charmap emoticons hr pagebreak insertdatetime print preview | fullscreen | bdmap indent2em lineheight formatpainter axupimgs"],
-
+ table image media charmap emoticons hr pagebreak insertdatetime print preview | fullscreen | bdmap indent2em lineheight formatpainter axupimgs",
+ width: "100%",
+ height: 650,
+ min_height: 400,
importcss_append: true,
//自定义文件选择器的回调内容
// file_picker_callback: function (callback, value, meta) {
@@ -254,7 +254,6 @@ export default function Inform() {
};
const onEditorChange=(Value:string)=>{
setEditorValue(Value)
-
}
// let thisrole: any = {roleId:'s'};
const handleDetail = (text: any) => {
@@ -745,16 +744,14 @@ export default function Inform() {
-
- onEditorChange(Value)}
>
-
-
diff --git a/src/view/system/post/index.scss b/src/view/system/post/index.scss
new file mode 100644
index 0000000..19d6dac
--- /dev/null
+++ b/src/view/system/post/index.scss
@@ -0,0 +1,103 @@
+#content {
+ display: flex;
+ border-top: 1px solid black;
+ .dept-content {
+ flex: 20%;
+ padding: 35px 12px 0 0;
+ height: calc(100vh - 85px);
+ }
+
+ .left-dept {
+ flex: 20%;
+ padding: 35px 12px 0 0;
+ height: calc(100vh - 85px);
+ border: 1px solid red;
+ border-top: 1px solid black;
+ }
+ .right {
+ flex: 80%;
+ height: 190px;
+ display: flex;
+ flex-direction: column;
+
+ .search-content {
+ display: flex;
+ flex-direction: column;
+ padding: 35px 12px 0 0;
+ .content-top {
+ display: flex;
+ .input-item {
+ display: flex;
+ align-items: center;
+ margin-right: 20px;
+ width: 270px;
+ div {
+ width: 120px;
+ font-weight: bold;
+ }
+ }
+ :nth-child(3) {
+ div {
+ margin-right: -30px;
+ }
+ }
+ }
+ .content-bottom {
+ display: flex;
+ margin-left: 12px;
+ margin-top: 20px;
+ div {
+ margin-right: 10px;
+ }
+ .time-selector {
+ display: flex;
+ align-items: center;
+
+ div {
+ width: 120px;
+ font-weight: bold;
+ }
+ .time-picker {
+ width: 400px;
+ text-align: center;
+ margin-left: -30px;
+ margin-right: 25px;
+ }
+ }
+ button:focus,
+ button:focus-visible {
+ outline: none;
+ }
+ }
+ }
+ .table-content {
+ margin: 12px 0 0 12px;
+
+ .ant-table-thead > tr > th {
+ color: #909399;
+ text-align: center;
+ }
+ .ant-table-tbody > tr > td {
+ text-align: center;
+ }
+ }
+ .add-content {
+ display: flex;
+ margin-left: 12px;
+ margin-top: 20px;
+ button:focus,
+ button:focus-visible {
+ outline: none;
+ }
+ }
+ .user-mid-button {
+ display: flex;
+ margin-left: 12px;
+ margin-top: 20px;
+ button:focus,
+ button:focus-visible {
+ outline: none;
+ }
+ }
+ }
+}
diff --git a/src/view/system/post/index.tsx b/src/view/system/post/index.tsx
new file mode 100644
index 0000000..ddad2b0
--- /dev/null
+++ b/src/view/system/post/index.tsx
@@ -0,0 +1,472 @@
+import "./index.scss";
+import {
+ Input,
+ Select,
+ Button,
+ Table,
+ Space,
+ Tag,
+ message,
+ Modal,
+ Form,
+ Row,
+ Col,
+ Radio,
+ InputNumber,
+} from "antd";
+
+import {
+ EditOutlined,
+ DeleteOutlined,
+ ExclamationCircleFilled,
+} from "@ant-design/icons";
+
+import {
+ getPostListApi,
+ addPostApi,
+ editPostApi,
+ deletePostApi,
+} from "../../../api/system/post";
+
+import { useEffect, useState } from "react";
+import { SearchOutlined, RedoOutlined, PlusOutlined } from "@ant-design/icons";
+
+export default function Post() {
+ const [form] = Form.useForm();
+ const [echoData, setEchoData] = useState({});
+ const [listData, setListData] = useState([]);
+ const [radioValue, setRadioValue] = useState(1);
+ const [messageApi, contextHolder] = message.useMessage();
+ const [modalTitle, setModalTitle] = useState("");
+ const [buttonType, setButtonType] = useState("");
+ const [isShowModal, setIsShowModal] = useState(false);
+ const [queryParams, setQueryParams] = useState({
+ postName: undefined,
+ postCode: undefined,
+ state: undefined,
+ postSort: undefined,
+ pageSize: undefined,
+ pageNum: undefined,
+ });
+ const columns = [
+ {
+ title: "序号",
+ dataIndex: "postId",
+ key: "Id",
+ render: (text: string) => <>{text ? text : "null"}>,
+ },
+ {
+ title: "岗位名称",
+ dataIndex: "postName",
+ key: "postName",
+ render: (text: string) => <>{text ? text : "null"}>,
+ },
+ {
+ title: "岗位编码",
+ dataIndex: "postCode",
+ key: "postCode",
+ render: (text: string) => <>{text ? text : "null"}>,
+ },
+ {
+ title: "排序",
+ key: "postSort",
+ dataIndex: "postSort",
+ render: (text: string) => <>{text ? text : "--"}>,
+ },
+ {
+ title: "状态",
+ key: "state",
+ dataIndex: "state",
+ render: (text: string) => (
+ <>
+ {text === "0" ? (
+ 停用
+ ) : (
+ 正常
+ )}
+ >
+ ),
+ },
+ {
+ title: "创建时间",
+ key: "createTime",
+ dataIndex: "createTime",
+ render: (text: string) => <>{text ? text : "null"}>,
+ },
+ {
+ title: "操作",
+ key: "operate",
+ dataIndex: "operate",
+ render: (_: string, record: object) => (
+
+ ),
+ },
+ ];
+
+ interface QueryParamsType {
+ postName?: string;
+ postCode?: string;
+ state?: string;
+ postSort?: string;
+ postId?: string;
+ pageSize?: number;
+ pageNum?: number;
+ }
+
+ const getPostList = async (newQueryParams: object) => {
+ try {
+ const { code, data } = await getPostListApi(newQueryParams);
+ if (code === 1000) {
+ setListData(data.rows);
+ }
+ } catch (err) {
+ console.error(err);
+ }
+ };
+
+ const handleAdd = () => {
+ setModalTitle("新增用户");
+ setButtonType("ADD");
+ setIsShowModal(true);
+ };
+
+ const handleEdit = (data: any) => {
+ setModalTitle("修改用户");
+ setButtonType("EDIT");
+ setIsShowModal(true);
+ console.log(data);
+ setEchoData({
+ postId: data.postId,
+ });
+ handleEcho(data);
+ };
+
+ const handleConfirm = () => {
+ form.validateFields().then((values) => {
+ console.log(values);
+ console.log(buttonType);
+
+ if (buttonType === "ADD") {
+ handleConfirmAdd(values);
+ } else if (buttonType === "EDIT") {
+ handleConfirmEdit(values);
+ } else {
+ messageApi.open({
+ type: "error",
+ content: "系统异常,请刷新后重试",
+ });
+ }
+ });
+ };
+
+ const handleConfirmAdd = async (data: object) => {
+ console.log(data);
+ const { code } = await addPostApi(data);
+ try {
+ if (code === 1000) {
+ messageApi.open({
+ type: "success",
+ content: "创建成功",
+ });
+ setQueryParams({});
+ handleClear();
+ } else {
+ messageApi.open({
+ type: "error",
+ content: "岗位名称已经存在",
+ });
+ }
+ } catch (err) {
+ console.log(err);
+ }
+ };
+
+ const handleConfirmEdit = async (data: object) => {
+ const editData = {
+ ...data,
+ postId: echoData.postId,
+ };
+ console.log(editData);
+ const { code } = await editPostApi(editData);
+ try {
+ if (code === 1000) {
+ messageApi.open({
+ type: "success",
+ content: "修改成功",
+ });
+ setQueryParams({});
+ handleClear();
+ } else {
+ messageApi.open({
+ type: "error",
+ content: "修改失败",
+ });
+ }
+ } catch (err) {
+ console.log(err);
+ }
+ };
+
+ const handleReset = async () => {
+ setQueryParams({});
+ getPostList({});
+ };
+
+ const handleSearch = () => {
+ getPostList(queryParams);
+ };
+
+ const handleDel = async (record: any) => {
+ Modal.confirm({
+ title: `确定删除Id为-${record.postId}-, 岗位名称为-${record.postName}-的岗位吗?`,
+ icon: ,
+ async onOk() {
+ const { code } = await deletePostApi(record.postId);
+ try {
+ if (code === 1000) {
+ messageApi.open({
+ type: "success",
+ content: "删除成功",
+ });
+ setQueryParams({});
+ } else {
+ messageApi.open({
+ type: "error",
+ content: "删除失败",
+ });
+ }
+ } catch (err) {
+ console.log(err);
+ }
+ },
+ onCancel() {
+ messageApi.open({
+ type: "warning",
+ content: "取消成功",
+ });
+ },
+ });
+ };
+
+ const handleSearchValues = (e: any) => {
+ const { name, value } = e.target;
+ setQueryParams({ ...queryParams, [name]: value });
+ };
+
+ const handlePageChange = (page: number) => {
+ setQueryParams({
+ ...queryParams,
+ pageNum: page,
+ });
+ };
+
+ const handleEcho = (data: any) => {
+ const { postName, postCode, state, postSort } = data;
+ form.setFieldsValue({
+ postName,
+ postCode,
+ state,
+ postSort,
+ });
+ };
+
+ const handleCancel = () => {
+ handleClear();
+ };
+
+ const handleClear = () => {
+ form.resetFields();
+ setIsShowModal(false);
+ };
+
+ const onRadio = (e: any) => {
+ setRadioValue(e.target.value);
+ };
+
+ useEffect(() => {
+ getPostList(queryParams);
+ }, []);
+
+ return (
+
+ <>
+
+
+ <>
+
+
+
+
+
状态
+
+
+
+
+
+
+
+
+
+
+ >
+
+
+
+ <>
+ {contextHolder}
+
+ `第 ${range[0]}-${range[1]} 条,共 ${total} 条`,
+ }}
+ />
+ >
+
+ <>
+ {contextHolder}
+
+
+
+ >
+
+ >
+
+ );
+}
diff --git a/src/view/system/role/index.tsx b/src/view/system/role/index.tsx
index e2928d2..169ee64 100644
--- a/src/view/system/role/index.tsx
+++ b/src/view/system/role/index.tsx
@@ -71,7 +71,6 @@ const fieldNames = {
let thisrole: any = {};
let treeIds: number[] = [];
export default function Role() {
-
const { confirm } = Modal;
const { RangePicker } = DatePicker;
//提示组件
@@ -94,7 +93,6 @@ export default function Role() {
const [expandedKeys, setExpandedKeys] = useState([]);
const [checkedKeys, setCheckedKeys] = useState([]);
const [selectedKeys, setSelectedKeys] = useState([]);
- const [autoExpandParent, setAutoExpandParent] = useState(true);
//Modal
const [isModalOpen, setIsModalOpen] = useState(false);
const [modalTitle, setModalTitle] = useState("");
@@ -194,11 +192,10 @@ export default function Role() {
pageNum: undefined,
pageSize: undefined,
});
- const [allChecked,setAllChecked]=useState(false)
+ const [allChecked, setAllChecked] = useState(false);
const onTreeExpand = (expandedKeysValue: React.Key[]) => {
// console.log("onExpand", expandedKeysValue);
setExpandedKeys(expandedKeysValue);
- setAutoExpandParent(false);
};
const onCheckExpand = (e: CheckboxChangeEvent) => {
console.log(`checked = ${e.target.checked}`);
@@ -209,7 +206,7 @@ export default function Role() {
};
const onCheckAll = (e: CheckboxChangeEvent) => {
console.log(`checked = ${e.target.checked}`);
- setAllChecked(!allChecked)
+ setAllChecked(!allChecked);
if (!allChecked) setCheckedKeys(treeIds);
else setCheckedKeys([]);
};
@@ -220,13 +217,12 @@ export default function Role() {
const onTreeCheck = (checkedKeysValue: any) => {
// console.log("onCheck", checkedKeysValue.checked);
console.log("onCheck", checkedKeysValue);
- console.log('treeIds',treeIds);
-
- if(checkedKeysValue.length!=treeIds.length){
- setAllChecked(false)
- }
- else {
- setAllChecked(true)
+ console.log("treeIds", treeIds);
+
+ if (checkedKeysValue.length != treeIds.length) {
+ setAllChecked(false);
+ } else {
+ setAllChecked(true);
}
if (checkStrictly === false) {
form.setFieldsValue({ menuIds: checkedKeysValue });
@@ -269,19 +265,19 @@ export default function Role() {
};
const handleSerach = () => {
searchValue = formSearch.getFieldsValue();
-
+
if (typeof searchValue.dateTime !== "undefined") {
searchValue.startTime = (searchValue.dateTime as string[])[0];
searchValue.endTime = (searchValue.dateTime as string[])[1];
- }
- setSearchValue(searchValue)
+ }
+ setSearchValue(searchValue);
count = 1;
setQueryTableDataParams({ ...searchValue });
};
const handleReset = () => {
formSearch.resetFields();
- searchValue =formSearch.getFieldsValue()
- setSearchValue(searchValue)
+ searchValue = formSearch.getFieldsValue();
+ setSearchValue(searchValue);
setQueryTableDataParams({ ...searchValue });
// setSearchValue({ ...searchValue });
// setCount(1)
@@ -336,7 +332,7 @@ export default function Role() {
searchValue.startTime = dateString[0];
searchValue.endTime = dateString[1];
formSearch.setFieldsValue({ dateTime: [dateString[0], dateString[1]] });
- setSearchValue(searchValue)
+ setSearchValue(searchValue);
// setSearchValue({ ...searchValue })
};
const filterOption = (
@@ -515,29 +511,35 @@ export default function Role() {
return (
-
-
+
+
-
-
+
+
-
+
-
-
+
+
-
+
-
+