代办列表
parent
b99e0542f4
commit
d639e428c1
|
|
@ -31,7 +31,7 @@
|
||||||
"lodash-es": "^4.17.21",
|
"lodash-es": "^4.17.21",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"zy-react-library": "^1.1.47"
|
"zy-react-library": "^1.2.6"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@antfu/eslint-config": "^5.4.1",
|
"@antfu/eslint-config": "^5.4.1",
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
|
||||||
|
export const todoList = declareRequest(
|
||||||
|
"todoListLoading",
|
||||||
|
`Post > @/appmenu/todoList`,
|
||||||
|
);
|
||||||
|
|
@ -9,3 +9,4 @@ export const NS_APP_MENU = defineNamespace("appMenu");
|
||||||
export const NS_NOTICE = defineNamespace("Notice");
|
export const NS_NOTICE = defineNamespace("Notice");
|
||||||
export const NS_NoticeReadRecord = defineNamespace("NoticeReadRecord");
|
export const NS_NoticeReadRecord = defineNamespace("NoticeReadRecord");
|
||||||
export const NS_CORPINFO = defineNamespace("corpInfo");
|
export const NS_CORPINFO = defineNamespace("corpInfo");
|
||||||
|
export const NS_TODO_LIST = defineNamespace("toDoList");
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,20 @@
|
||||||
import useUrlState from "@ahooksjs/use-url-state";
|
import useUrlState from "@ahooksjs/use-url-state";
|
||||||
import {ApiOutlined} from "@ant-design/icons";
|
import { ApiOutlined } from "@ant-design/icons";
|
||||||
import {Connect} from "@cqsjjb/jjb-dva-runtime";
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
import {Button, Form, message, Modal, Space, Tabs, Tag} from "antd";
|
import { Button, Form, message, Modal, Space, Tabs, Tag } from "antd";
|
||||||
import {useEffect, useRef, useState} from "react";
|
import { useEffect, useRef, useState } from "react";
|
||||||
import FormBuilder from "zy-react-library/components/FormBuilder";
|
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||||
import Page from "zy-react-library/components/Page";
|
import Page from "zy-react-library/components/Page";
|
||||||
import Table from "zy-react-library/components/Table";
|
import Table from "zy-react-library/components/Table";
|
||||||
import {FORM_ITEM_RENDER_ENUM} from "zy-react-library/enum/formItemRender";
|
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||||
import useTable from "zy-react-library/hooks/useTable";
|
import useTable from "zy-react-library/hooks/useTable";
|
||||||
import {getLabelName, getMatchedItems} from "zy-react-library/utils";
|
import { getLabelName, getMatchedItems } from "zy-react-library/utils";
|
||||||
import {NS_APP_MENU} from "~/enumerate/namespace";
|
import { NS_APP_MENU } from "~/enumerate/namespace";
|
||||||
|
|
||||||
const MENU_TYPE_ENUM = [
|
const MENU_TYPE_ENUM = [
|
||||||
{bianma: 1, name: "菜单"},
|
{ bianma: 1, name: "菜单" },
|
||||||
{bianma: 2, name: "按钮"},
|
{ bianma: 2, name: "按钮" },
|
||||||
];
|
];
|
||||||
|
|
||||||
function Menu(props) {
|
function Menu(props) {
|
||||||
|
|
@ -32,18 +32,18 @@ function Menu(props) {
|
||||||
}, {
|
}, {
|
||||||
navigateMode: "replace",
|
navigateMode: "replace",
|
||||||
});
|
});
|
||||||
const {tableProps, getData} = useTable(props["appMenuListTree"], {
|
const { tableProps, getData } = useTable(props["appMenuListTree"], {
|
||||||
params: {eqMenuAttribution: urlState.menuAttribution},
|
params: { eqMenuAttribution: urlState.menuAttribution },
|
||||||
usePagination: false,
|
usePagination: false,
|
||||||
manual: true,
|
manual: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
const getMenuAppByTenantId = async () => {
|
const getMenuAppByTenantId = async () => {
|
||||||
const {data} = await props["appMenuGetMenuAppByTenantId"]();
|
const { data } = await props["appMenuGetMenuAppByTenantId"]();
|
||||||
setMenuAttribution(data);
|
setMenuAttribution(data);
|
||||||
const menuAttribution = data?.[0]?.menuAttribution;
|
const menuAttribution = data?.[0]?.menuAttribution;
|
||||||
const menuAttributionName = data?.[0]?.menuAttributionName;
|
const menuAttributionName = data?.[0]?.menuAttributionName;
|
||||||
setUrlState({menuAttribution, menuAttributionName});
|
setUrlState({ menuAttribution, menuAttributionName });
|
||||||
menuAttribution && getData();
|
menuAttribution && getData();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -58,7 +58,7 @@ function Menu(props) {
|
||||||
okText: "确定",
|
okText: "确定",
|
||||||
cancelText: "取消",
|
cancelText: "取消",
|
||||||
onOk: async () => {
|
onOk: async () => {
|
||||||
const {success} = await props["appMenuDelete"]({id});
|
const { success } = await props["appMenuDelete"]({ id });
|
||||||
if (success) {
|
if (success) {
|
||||||
message.success("删除成功");
|
message.success("删除成功");
|
||||||
getData();
|
getData();
|
||||||
|
|
@ -78,7 +78,7 @@ function Menu(props) {
|
||||||
<>
|
<>
|
||||||
<Button
|
<Button
|
||||||
type="primary"
|
type="primary"
|
||||||
icon={(<AddIcon/>)}
|
icon={(<AddIcon />)}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setAddModalVisible(true);
|
setAddModalVisible(true);
|
||||||
setParentId(0);
|
setParentId(0);
|
||||||
|
|
@ -91,7 +91,7 @@ function Menu(props) {
|
||||||
<Button
|
<Button
|
||||||
type="primary"
|
type="primary"
|
||||||
ghost
|
ghost
|
||||||
icon={(<ApiOutlined/>)}
|
icon={(<ApiOutlined />)}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setRoleBindingModalVisible(true);
|
setRoleBindingModalVisible(true);
|
||||||
}}
|
}}
|
||||||
|
|
@ -105,7 +105,7 @@ function Menu(props) {
|
||||||
headerTitle={(
|
headerTitle={(
|
||||||
<Tabs
|
<Tabs
|
||||||
activeKey={urlState.menuAttribution}
|
activeKey={urlState.menuAttribution}
|
||||||
items={menuAttribution.map(item => ({key: item.menuAttribution, label: item.menuAttributionName}))}
|
items={menuAttribution.map(item => ({ key: item.menuAttribution, label: item.menuAttributionName }))}
|
||||||
onChange={(event) => {
|
onChange={(event) => {
|
||||||
setUrlState({
|
setUrlState({
|
||||||
menuAttribution: event,
|
menuAttribution: event,
|
||||||
|
|
@ -116,9 +116,9 @@ function Menu(props) {
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
columns={[
|
columns={[
|
||||||
{title: "名称", dataIndex: "menuName"},
|
{ title: "名称", dataIndex: "menuName" },
|
||||||
{title: "路径", dataIndex: "menuUrl"},
|
{ title: "路径", dataIndex: "menuUrl" },
|
||||||
{title: "标识", dataIndex: "menuPerms"},
|
{ title: "标识", dataIndex: "menuPerms" },
|
||||||
{
|
{
|
||||||
title: "类型",
|
title: "类型",
|
||||||
dataIndex: "menuType",
|
dataIndex: "menuType",
|
||||||
|
|
@ -214,7 +214,7 @@ const AddModalComponent = (props) => {
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
|
|
||||||
const getData = async () => {
|
const getData = async () => {
|
||||||
const {data} = await props["appMenuInfo"]({id: props.id});
|
const { data } = await props["appMenuInfo"]({ id: props.id });
|
||||||
form.setFieldsValue(data);
|
form.setFieldsValue(data);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -225,7 +225,7 @@ const AddModalComponent = (props) => {
|
||||||
}, [props.id]);
|
}, [props.id]);
|
||||||
|
|
||||||
const onSubmit = async (values) => {
|
const onSubmit = async (values) => {
|
||||||
const {success} = await props[props.id ? "appMenuUpdate" : "appMenuAdd"]({
|
const { success } = await props[props.id ? "appMenuUpdate" : "appMenuAdd"]({
|
||||||
...values,
|
...values,
|
||||||
id: props.id,
|
id: props.id,
|
||||||
parentId: props.parentId,
|
parentId: props.parentId,
|
||||||
|
|
@ -251,7 +251,7 @@ const AddModalComponent = (props) => {
|
||||||
<FormBuilder
|
<FormBuilder
|
||||||
showActionButtons={false}
|
showActionButtons={false}
|
||||||
span={24}
|
span={24}
|
||||||
labelCol={{span: 6}}
|
labelCol={{ span: 6 }}
|
||||||
loading={props.appMenu.appMenuLoading}
|
loading={props.appMenu.appMenuLoading}
|
||||||
form={form}
|
form={form}
|
||||||
onFinish={onSubmit}
|
onFinish={onSubmit}
|
||||||
|
|
@ -270,12 +270,12 @@ const AddModalComponent = (props) => {
|
||||||
name: "menuType",
|
name: "menuType",
|
||||||
label: "类型",
|
label: "类型",
|
||||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||||
items: props.parentId === 0 ? getMatchedItems({list: MENU_TYPE_ENUM, value: [1]}) : MENU_TYPE_ENUM,
|
items: props.parentId === 0 ? getMatchedItems({ list: MENU_TYPE_ENUM, value: [1] }) : MENU_TYPE_ENUM,
|
||||||
},
|
},
|
||||||
{name: "menuName", label: "名称"},
|
{ name: "menuName", label: "名称" },
|
||||||
{name: "menuUrl", label: "路径", useConstraints: false},
|
{ name: "menuUrl", label: "路径", useConstraints: false },
|
||||||
{name: "menuPerms", label: "标识", useConstraints: false},
|
{ name: "menuPerms", label: "标识", useConstraints: false },
|
||||||
{name: "sort", label: "排序", onlyForLabel: true},
|
{ name: "sort", label: "排序", onlyForLabel: true },
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
@ -287,14 +287,14 @@ const RoleBindingModalComponent = (props) => {
|
||||||
|
|
||||||
const selectedRowsRef = useRef([]);
|
const selectedRowsRef = useRef([]);
|
||||||
|
|
||||||
const {tableProps} = useTable(props["systemPermsGroupsList"], {
|
const { tableProps } = useTable(props["systemPermsGroupsList"], {
|
||||||
useStorageQueryCriteria: false,
|
useStorageQueryCriteria: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
const getData = async () => {
|
const getData = async () => {
|
||||||
const {data} = await props["appMenuGetMenuRoleByMenuAttribution"]({menuAttribution: props.menuAttribution});
|
const { data } = await props["appMenuGetMenuRoleByMenuAttribution"]({ menuAttribution: props.menuAttribution });
|
||||||
setSelectedRowKeys(data.map(item => item.roleId));
|
setSelectedRowKeys(data.map(item => item.roleId));
|
||||||
selectedRowsRef.current = data.map(item => ({id: item.roleId, roleName: item.roleName}));
|
selectedRowsRef.current = data.map(item => ({ id: item.roleId, roleName: item.roleName }));
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
@ -302,10 +302,10 @@ const RoleBindingModalComponent = (props) => {
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const onSubmit = async () => {
|
const onSubmit = async () => {
|
||||||
const {success} = await props["appMenuGetMenuRoleByMenuAttributionSave"]({
|
const { success } = await props["appMenuGetMenuRoleByMenuAttributionSave"]({
|
||||||
menuAttribution: props.menuAttribution,
|
menuAttribution: props.menuAttribution,
|
||||||
menuAttributionName: props.menuAttributionName,
|
menuAttributionName: props.menuAttributionName,
|
||||||
roleList: selectedRowsRef.current.map(item => ({roleId: item.id, roleName: item.roleName})),
|
roleList: selectedRowsRef.current.map(item => ({ roleId: item.id, roleName: item.roleName })),
|
||||||
});
|
});
|
||||||
if (success) {
|
if (success) {
|
||||||
message.success("保存成功");
|
message.success("保存成功");
|
||||||
|
|
@ -323,7 +323,7 @@ const RoleBindingModalComponent = (props) => {
|
||||||
onOk={onSubmit}
|
onOk={onSubmit}
|
||||||
confirmLoading={props.appMenu.appMenuLoading}
|
confirmLoading={props.appMenu.appMenuLoading}
|
||||||
>
|
>
|
||||||
<div style={{fontSize: 12, color: "red", marginBottom: 10}}>注:取消勾选会清空角色的APP使用权限,请谨慎操作!</div>
|
<div style={{ fontSize: 12, color: "red", marginBottom: 10 }}>注:取消勾选会清空角色的APP使用权限,请谨慎操作!</div>
|
||||||
<Table
|
<Table
|
||||||
rowSelection={{
|
rowSelection={{
|
||||||
preserveSelectedRowKeys: true,
|
preserveSelectedRowKeys: true,
|
||||||
|
|
@ -336,7 +336,7 @@ const RoleBindingModalComponent = (props) => {
|
||||||
options={false}
|
options={false}
|
||||||
disabledResizer={true}
|
disabledResizer={true}
|
||||||
columns={[
|
columns={[
|
||||||
{title: "角色名称(权限组)", dataIndex: "roleName"},
|
{ title: "角色名称(权限组)", dataIndex: "roleName" },
|
||||||
]}
|
]}
|
||||||
{...tableProps}
|
{...tableProps}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,65 @@
|
||||||
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
|
import Page from "zy-react-library/components/Page";
|
||||||
|
import Search from "zy-react-library/components/Search";
|
||||||
|
import DictionarySelect from "zy-react-library/components/Select/Dictionary";
|
||||||
|
import Table from "zy-react-library/components/Table";
|
||||||
|
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||||
|
import useGetUserInfo from "zy-react-library/hooks/useGetUserInfo";
|
||||||
|
import useTable from "zy-react-library/hooks/useTable";
|
||||||
|
import { getLabelName } from "zy-react-library/utils";
|
||||||
|
import { NS_TODO_LIST } from "~/enumerate/namespace";
|
||||||
|
|
||||||
|
const STATUS_ENUM = [
|
||||||
|
{ bianma: "1", name: "未处理" },
|
||||||
|
{ bianma: "2", name: "已处理" },
|
||||||
|
];
|
||||||
|
function TodoList(props) {
|
||||||
|
const [form] = Search.useForm();
|
||||||
|
const { getUserInfo } = useGetUserInfo();
|
||||||
|
|
||||||
|
const [userInfo, setUserInfo] = useState({});
|
||||||
|
|
||||||
|
const { tableProps, getData } = useTable(props["todoList"], {
|
||||||
|
form,
|
||||||
|
params: { eqPcFlag: 1 },
|
||||||
|
transform: formData => ({
|
||||||
|
leCreateTime: formData.createTime?.[0],
|
||||||
|
geCreateTime: formData.createTime?.[1],
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
(async () => {
|
||||||
|
const userInfo = await getUserInfo();
|
||||||
|
setUserInfo(userInfo);
|
||||||
|
})();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Page isShowAllAction={false}>
|
||||||
|
<Search
|
||||||
|
options={[
|
||||||
|
{ name: "eqAppName", label: "来源", render: (<DictionarySelect dictValue="sys_app_name" />) },
|
||||||
|
{ name: "createTime", label: "接收时间", render: FORM_ITEM_RENDER_ENUM.DATE_RANGE },
|
||||||
|
{ name: "eqStatus", label: "状态", render: FORM_ITEM_RENDER_ENUM.SELECT, items: STATUS_ENUM },
|
||||||
|
]}
|
||||||
|
form={form}
|
||||||
|
onFinish={getData}
|
||||||
|
/>
|
||||||
|
<Table
|
||||||
|
columns={[
|
||||||
|
{ title: "来源", dataIndex: "appName" },
|
||||||
|
{ title: "标题", dataIndex: "title" },
|
||||||
|
{ title: "接收时间", dataIndex: "createTime" },
|
||||||
|
{ title: "处理人", dataIndex: "name", render: () => userInfo.name },
|
||||||
|
{ title: "状态", dataIndex: "content" },
|
||||||
|
{ title: "状处理态", dataIndex: "status", render: (_, record) => getLabelName({ list: STATUS_ENUM, status: record.status }) },
|
||||||
|
]}
|
||||||
|
{...tableProps}
|
||||||
|
/>
|
||||||
|
</Page>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Connect([NS_TODO_LIST], true)(TodoList);
|
||||||
Loading…
Reference in New Issue