flat: 暂存
This commit is contained in:
@@ -55,6 +55,11 @@ export default [
|
|||||||
path: '/system/dict-data/index/:id',
|
path: '/system/dict-data/index/:id',
|
||||||
component: './System/DictData',
|
component: './System/DictData',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: '字典数据',
|
||||||
|
path: '/system/admin-dict-data/index/:id',
|
||||||
|
component: './System/AdminDictData',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: '分配用户',
|
name: '分配用户',
|
||||||
path: '/system/role-auth/user/:id',
|
path: '/system/role-auth/user/:id',
|
||||||
@@ -84,8 +89,8 @@ export default [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '编辑表',
|
name: '编辑表',
|
||||||
path: '/tool/gen/edit',
|
path: '/tool/gen/edit.tsx',
|
||||||
component: './Tool/Gen/edit',
|
component: './Tool/Gen/edit.tsx',
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
61
src/pages/Area/Business/index.tsx
Normal file
61
src/pages/Area/Business/index.tsx
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
import React, {Fragment, useRef, useState} from "react";
|
||||||
|
import { useIntl, FormattedMessage, useAccess, history } from '@umijs/max';
|
||||||
|
import { Dropdown, FormInstance, Space, Button, message, Modal } from 'antd';
|
||||||
|
import { ActionType, FooterToolbar, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
|
||||||
|
import { PlusOutlined, DeleteOutlined, ExclamationCircleOutlined, DownOutlined, EditOutlined } from '@ant-design/icons';
|
||||||
|
import {getCmsAreaList} from "@/services/area/business";
|
||||||
|
function ManagementList() {
|
||||||
|
const access = useAccess();
|
||||||
|
|
||||||
|
const formTableRef = useRef<FormInstance>();
|
||||||
|
const actionRef = useRef<ActionType>();
|
||||||
|
|
||||||
|
const [currentRow, setCurrentRow] = useState<API.AreaBusiness.Circle>()
|
||||||
|
const [modalVisible, setModalVisible] = useState<boolean>(false)
|
||||||
|
|
||||||
|
const columns: ProColumns<API.AreaBusiness.Circle>[] = [
|
||||||
|
{
|
||||||
|
title: '商圈名称',
|
||||||
|
dataIndex: 'commercialAreaName',
|
||||||
|
valueType: 'text',
|
||||||
|
hideInSearch: true,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
return (
|
||||||
|
<Fragment>
|
||||||
|
<div style={{ width: '100%', float: 'right' }}>
|
||||||
|
<ProTable<API.AreaBusiness.Circle>
|
||||||
|
// params 是需要自带的参数
|
||||||
|
// 这个参数优先级更高,会覆盖查询表单的参数
|
||||||
|
actionRef={actionRef}
|
||||||
|
formRef={formTableRef}
|
||||||
|
columns={columns}
|
||||||
|
request={(params) =>
|
||||||
|
getCmsAreaList({ ...params } as API.AreaBusiness.CircleParams).then((res) => {
|
||||||
|
const result = {
|
||||||
|
data: res.rows,
|
||||||
|
total: res.total,
|
||||||
|
success: true,
|
||||||
|
};
|
||||||
|
return result;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
toolBarRender={() => [
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
key="add"
|
||||||
|
hidden={!access.hasPerms('manage:list:add')}
|
||||||
|
onClick={async () => {
|
||||||
|
setCurrentRow(undefined);
|
||||||
|
setModalVisible(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<PlusOutlined /> 新建
|
||||||
|
</Button>,
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</Fragment>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
export default ManagementList
|
||||||
61
src/pages/Area/Subway/index.tsx
Normal file
61
src/pages/Area/Subway/index.tsx
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
import React, {Fragment, useRef, useState} from "react";
|
||||||
|
import { useIntl, FormattedMessage, useAccess, history } from '@umijs/max';
|
||||||
|
import { Dropdown, FormInstance, Space, Button, message, Modal } from 'antd';
|
||||||
|
import { ActionType, FooterToolbar, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
|
||||||
|
import { PlusOutlined, DeleteOutlined, ExclamationCircleOutlined, DownOutlined, EditOutlined } from '@ant-design/icons';
|
||||||
|
import {getCmsLineList} from "@/services/area/subway";
|
||||||
|
function ManagementList() {
|
||||||
|
const access = useAccess();
|
||||||
|
|
||||||
|
const formTableRef = useRef<FormInstance>();
|
||||||
|
const actionRef = useRef<ActionType>();
|
||||||
|
|
||||||
|
const [currentRow, setCurrentRow] = useState<API.AreaSubWay.Line>()
|
||||||
|
const [modalVisible, setModalVisible] = useState<boolean>(false)
|
||||||
|
|
||||||
|
const columns: ProColumns<API.AreaSubWay.Line>[] = [
|
||||||
|
{
|
||||||
|
title: '线路名称',
|
||||||
|
dataIndex: 'lineName',
|
||||||
|
valueType: 'text',
|
||||||
|
hideInSearch: true,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
return (
|
||||||
|
<Fragment>
|
||||||
|
<div style={{ width: '100%', float: 'right' }}>
|
||||||
|
<ProTable<API.AreaSubWay.Line>
|
||||||
|
// params 是需要自带的参数
|
||||||
|
// 这个参数优先级更高,会覆盖查询表单的参数
|
||||||
|
actionRef={actionRef}
|
||||||
|
formRef={formTableRef}
|
||||||
|
columns={columns}
|
||||||
|
request={(params) =>
|
||||||
|
getCmsLineList({ ...params } as API.AreaSubWay.LineParams).then((res) => {
|
||||||
|
const result = {
|
||||||
|
data: res.rows,
|
||||||
|
total: res.total,
|
||||||
|
success: true,
|
||||||
|
};
|
||||||
|
return result;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
toolBarRender={() => [
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
key="add"
|
||||||
|
hidden={!access.hasPerms('manage:list:add')}
|
||||||
|
onClick={async () => {
|
||||||
|
setCurrentRow(undefined);
|
||||||
|
setModalVisible(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<PlusOutlined /> 新建
|
||||||
|
</Button>,
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</Fragment>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
export default ManagementList
|
||||||
@@ -10,19 +10,19 @@ import { Form, Modal} from 'antd';
|
|||||||
import { useIntl, FormattedMessage } from '@umijs/max';
|
import { useIntl, FormattedMessage } from '@umijs/max';
|
||||||
import { DictValueEnumObj } from '@/components/DictTag';
|
import { DictValueEnumObj } from '@/components/DictTag';
|
||||||
|
|
||||||
export type LogininforFormData = Record<string, unknown> & Partial<API.Monitor.Logininfor>;
|
export type LogininforFormData = Record<string, unknown> & Partial<API.Logs.Logininfor>;
|
||||||
|
|
||||||
export type LogininforFormProps = {
|
export type LogininforFormProps = {
|
||||||
onCancel: (flag?: boolean, formVals?: LogininforFormData) => void;
|
onCancel: (flag?: boolean, formVals?: LogininforFormData) => void;
|
||||||
onSubmit: (values: LogininforFormData) => Promise<void>;
|
onSubmit: (values: LogininforFormData) => Promise<void>;
|
||||||
open: boolean;
|
open: boolean;
|
||||||
values: Partial<API.Monitor.Logininfor>;
|
values: Partial<API.Logs.Logininfor>;
|
||||||
statusOptions: DictValueEnumObj;
|
statusOptions: DictValueEnumObj;
|
||||||
};
|
};
|
||||||
|
|
||||||
const LogininforForm: React.FC<LogininforFormProps> = (props) => {
|
const LogininforForm: React.FC<LogininforFormProps> = (props) => {
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
|
|
||||||
const { statusOptions, } = props;
|
const { statusOptions, } = props;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -65,10 +65,10 @@ const LogininforForm: React.FC<LogininforFormProps> = (props) => {
|
|||||||
onOk={handleOk}
|
onOk={handleOk}
|
||||||
onCancel={handleCancel}
|
onCancel={handleCancel}
|
||||||
>
|
>
|
||||||
<ProForm
|
<ProForm
|
||||||
form={form}
|
form={form}
|
||||||
grid={true}
|
grid={true}
|
||||||
layout="horizontal"
|
layout="horizontal"
|
||||||
onFinish={handleFinish}>
|
onFinish={handleFinish}>
|
||||||
<ProFormDigit
|
<ProFormDigit
|
||||||
name="infoId"
|
name="infoId"
|
||||||
@@ -83,7 +83,7 @@ const LogininforForm: React.FC<LogininforFormProps> = (props) => {
|
|||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
required: false,
|
required: false,
|
||||||
message: <FormattedMessage id="请输入访问编号!" defaultMessage="请输入访问编号!" />,
|
message: <FormattedMessage id="请输入访问编号!" defaultMessage="请输入访问编号!" />,
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
@@ -98,7 +98,7 @@ const LogininforForm: React.FC<LogininforFormProps> = (props) => {
|
|||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
required: false,
|
required: false,
|
||||||
message: <FormattedMessage id="请输入用户账号!" defaultMessage="请输入用户账号!" />,
|
message: <FormattedMessage id="请输入用户账号!" defaultMessage="请输入用户账号!" />,
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
@@ -113,7 +113,7 @@ const LogininforForm: React.FC<LogininforFormProps> = (props) => {
|
|||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
required: false,
|
required: false,
|
||||||
message: <FormattedMessage id="请输入登录IP地址!" defaultMessage="请输入登录IP地址!" />,
|
message: <FormattedMessage id="请输入登录IP地址!" defaultMessage="请输入登录IP地址!" />,
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
@@ -128,7 +128,7 @@ const LogininforForm: React.FC<LogininforFormProps> = (props) => {
|
|||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
required: false,
|
required: false,
|
||||||
message: <FormattedMessage id="请输入登录地点!" defaultMessage="请输入登录地点!" />,
|
message: <FormattedMessage id="请输入登录地点!" defaultMessage="请输入登录地点!" />,
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
@@ -143,7 +143,7 @@ const LogininforForm: React.FC<LogininforFormProps> = (props) => {
|
|||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
required: false,
|
required: false,
|
||||||
message: <FormattedMessage id="请输入浏览器类型!" defaultMessage="请输入浏览器类型!" />,
|
message: <FormattedMessage id="请输入浏览器类型!" defaultMessage="请输入浏览器类型!" />,
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
@@ -158,7 +158,7 @@ const LogininforForm: React.FC<LogininforFormProps> = (props) => {
|
|||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
required: false,
|
required: false,
|
||||||
message: <FormattedMessage id="请输入操作系统!" defaultMessage="请输入操作系统!" />,
|
message: <FormattedMessage id="请输入操作系统!" defaultMessage="请输入操作系统!" />,
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
@@ -174,7 +174,7 @@ const LogininforForm: React.FC<LogininforFormProps> = (props) => {
|
|||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
required: false,
|
required: false,
|
||||||
message: <FormattedMessage id="请输入登录状态!" defaultMessage="请输入登录状态!" />,
|
message: <FormattedMessage id="请输入登录状态!" defaultMessage="请输入登录状态!" />,
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
@@ -189,7 +189,7 @@ const LogininforForm: React.FC<LogininforFormProps> = (props) => {
|
|||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
required: false,
|
required: false,
|
||||||
message: <FormattedMessage id="请输入提示消息!" defaultMessage="请输入提示消息!" />,
|
message: <FormattedMessage id="请输入提示消息!" defaultMessage="请输入提示消息!" />,
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
@@ -204,7 +204,7 @@ const LogininforForm: React.FC<LogininforFormProps> = (props) => {
|
|||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
required: false,
|
required: false,
|
||||||
message: <FormattedMessage id="请输入访问时间!" defaultMessage="请输入访问时间!" />,
|
message: <FormattedMessage id="请输入访问时间!" defaultMessage="请输入访问时间!" />,
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
@@ -5,16 +5,15 @@ import type { FormInstance } from 'antd';
|
|||||||
import { Button, message, Modal } from 'antd';
|
import { Button, message, Modal } from 'antd';
|
||||||
import { ActionType, FooterToolbar, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
|
import { ActionType, FooterToolbar, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
|
||||||
import { PlusOutlined, DeleteOutlined, ExclamationCircleOutlined, UnlockOutlined } from '@ant-design/icons';
|
import { PlusOutlined, DeleteOutlined, ExclamationCircleOutlined, UnlockOutlined } from '@ant-design/icons';
|
||||||
import { getLogininforList, removeLogininfor, exportLogininfor, unlockLogininfor, cleanLogininfor } from '@/services/monitor/logininfor';
|
import { getLogininforList, removeLogininfor, exportLogininfor, unlockLogininfor, cleanLogininfor } from '@/services/logs/logininfor';
|
||||||
import DictTag from '@/components/DictTag';
|
import DictTag from '@/components/DictTag';
|
||||||
import { getDictValueEnum } from '@/services/system/dict';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除节点
|
* 删除节点
|
||||||
*
|
*
|
||||||
* @param selectedRows
|
* @param selectedRows
|
||||||
*/
|
*/
|
||||||
const handleRemove = async (selectedRows: API.Monitor.Logininfor[]) => {
|
const handleRemove = async (selectedRows: API.Logs.Logininfor[]) => {
|
||||||
const hide = message.loading('正在删除');
|
const hide = message.loading('正在删除');
|
||||||
if (!selectedRows) return true;
|
if (!selectedRows) return true;
|
||||||
try {
|
try {
|
||||||
@@ -93,21 +92,37 @@ const LogininforTableList: React.FC = () => {
|
|||||||
const formTableRef = useRef<FormInstance>();
|
const formTableRef = useRef<FormInstance>();
|
||||||
|
|
||||||
const actionRef = useRef<ActionType>();
|
const actionRef = useRef<ActionType>();
|
||||||
const [selectedRows, setSelectedRows] = useState<API.Monitor.Logininfor[]>([]);
|
const [selectedRows, setSelectedRows] = useState<API.Logs.Logininfor[]>([]);
|
||||||
const [statusOptions, setStatusOptions] = useState<any>([]);
|
|
||||||
|
|
||||||
const access = useAccess();
|
const access = useAccess();
|
||||||
|
|
||||||
|
const statusOptions = {
|
||||||
|
0: {
|
||||||
|
label: '成功',
|
||||||
|
key: '0',
|
||||||
|
value: '0',
|
||||||
|
text: '成功',
|
||||||
|
status: 'success',
|
||||||
|
listClass: 'success'
|
||||||
|
},
|
||||||
|
1: {
|
||||||
|
label: '失败',
|
||||||
|
key: '1',
|
||||||
|
value: '1',
|
||||||
|
text: '失败',
|
||||||
|
status: 'error',
|
||||||
|
listClass: 'danger'
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
/** 国际化配置 */
|
/** 国际化配置 */
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getDictValueEnum('sys_common_status', true).then((data) => {
|
|
||||||
setStatusOptions(data);
|
|
||||||
});
|
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const columns: ProColumns<API.Monitor.Logininfor>[] = [
|
const columns: ProColumns<API.Logs.Logininfor>[] = [
|
||||||
{
|
{
|
||||||
title: <FormattedMessage id="monitor.logininfor.info_id" defaultMessage="访问编号" />,
|
title: <FormattedMessage id="monitor.logininfor.info_id" defaultMessage="访问编号" />,
|
||||||
dataIndex: 'infoId',
|
dataIndex: 'infoId',
|
||||||
@@ -146,7 +161,6 @@ const LogininforTableList: React.FC = () => {
|
|||||||
title: <FormattedMessage id="monitor.logininfor.status" defaultMessage="登录状态" />,
|
title: <FormattedMessage id="monitor.logininfor.status" defaultMessage="登录状态" />,
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
valueType: 'select',
|
valueType: 'select',
|
||||||
valueEnum: statusOptions,
|
|
||||||
render: (_, record) => {
|
render: (_, record) => {
|
||||||
return (<DictTag enums={statusOptions} value={record.status} />);
|
return (<DictTag enums={statusOptions} value={record.status} />);
|
||||||
},
|
},
|
||||||
@@ -167,7 +181,7 @@ const LogininforTableList: React.FC = () => {
|
|||||||
return (
|
return (
|
||||||
<PageContainer>
|
<PageContainer>
|
||||||
<div style={{ width: '100%', float: 'right' }}>
|
<div style={{ width: '100%', float: 'right' }}>
|
||||||
<ProTable<API.Monitor.Logininfor>
|
<ProTable<API.Logs.Logininfor>
|
||||||
headerTitle={intl.formatMessage({
|
headerTitle={intl.formatMessage({
|
||||||
id: 'pages.searchTable.title',
|
id: 'pages.searchTable.title',
|
||||||
defaultMessage: '信息',
|
defaultMessage: '信息',
|
||||||
@@ -183,7 +197,7 @@ const LogininforTableList: React.FC = () => {
|
|||||||
<Button
|
<Button
|
||||||
key="remove"
|
key="remove"
|
||||||
danger
|
danger
|
||||||
hidden={selectedRows?.length === 0 || !access.hasPerms('monitor:logininfor:remove')}
|
hidden={selectedRows?.length === 0 || !access.hasPerms('logs:logininfor:remove')}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: '是否确认删除所选数据项?',
|
title: '是否确认删除所选数据项?',
|
||||||
@@ -207,7 +221,7 @@ const LogininforTableList: React.FC = () => {
|
|||||||
type="primary"
|
type="primary"
|
||||||
key="clean"
|
key="clean"
|
||||||
danger
|
danger
|
||||||
hidden={!access.hasPerms('monitor:logininfor:remove')}
|
hidden={selectedRows?.length === 0 || !access.hasPerms('logs:logininfor:remove')}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: '是否确认清空所有数据项?',
|
title: '是否确认清空所有数据项?',
|
||||||
@@ -230,7 +244,7 @@ const LogininforTableList: React.FC = () => {
|
|||||||
<Button
|
<Button
|
||||||
type="primary"
|
type="primary"
|
||||||
key="unlock"
|
key="unlock"
|
||||||
hidden={selectedRows?.length === 0 || !access.hasPerms('monitor:logininfor:unlock')}
|
hidden={selectedRows?.length === 0 || !access.hasPerms('logs:logininfor:unlock')}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: '是否确认解锁该用户的数据项?',
|
title: '是否确认解锁该用户的数据项?',
|
||||||
@@ -253,7 +267,7 @@ const LogininforTableList: React.FC = () => {
|
|||||||
<Button
|
<Button
|
||||||
type="primary"
|
type="primary"
|
||||||
key="export"
|
key="export"
|
||||||
hidden={!access.hasPerms('monitor:logininfor:export')}
|
hidden={!access.hasPerms('logs:logininfor:export')}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
handleExport();
|
handleExport();
|
||||||
}}
|
}}
|
||||||
@@ -263,7 +277,7 @@ const LogininforTableList: React.FC = () => {
|
|||||||
</Button>,
|
</Button>,
|
||||||
]}
|
]}
|
||||||
request={(params) =>
|
request={(params) =>
|
||||||
getLogininforList({ ...params } as API.Monitor.LogininforListParams).then((res) => {
|
getLogininforList({ ...params } as API.Logs.LogininforListParams).then((res) => {
|
||||||
const result = {
|
const result = {
|
||||||
data: res.rows,
|
data: res.rows,
|
||||||
total: res.total,
|
total: res.total,
|
||||||
@@ -293,7 +307,7 @@ const LogininforTableList: React.FC = () => {
|
|||||||
<Button
|
<Button
|
||||||
key="remove"
|
key="remove"
|
||||||
danger
|
danger
|
||||||
hidden={!access.hasPerms('monitor:logininfor:remove')}
|
hidden={!access.hasPerms('logs:logininfor:remove')}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: '删除',
|
title: '删除',
|
||||||
@@ -10,19 +10,19 @@ import { Form, Modal} from 'antd';
|
|||||||
import { useIntl, FormattedMessage } from '@umijs/max';
|
import { useIntl, FormattedMessage } from '@umijs/max';
|
||||||
import { DictValueEnumObj } from '@/components/DictTag';
|
import { DictValueEnumObj } from '@/components/DictTag';
|
||||||
|
|
||||||
export type LogininforFormData = Record<string, unknown> & Partial<API.Monitor.Logininfor>;
|
export type LogininforFormData = Record<string, unknown> & Partial<API.Logs.Logininfor>;
|
||||||
|
|
||||||
export type LogininforFormProps = {
|
export type LogininforFormProps = {
|
||||||
onCancel: (flag?: boolean, formVals?: LogininforFormData) => void;
|
onCancel: (flag?: boolean, formVals?: LogininforFormData) => void;
|
||||||
onSubmit: (values: LogininforFormData) => Promise<void>;
|
onSubmit: (values: LogininforFormData) => Promise<void>;
|
||||||
open: boolean;
|
open: boolean;
|
||||||
values: Partial<API.Monitor.Logininfor>;
|
values: Partial<API.Logs.Logininfor>;
|
||||||
statusOptions: DictValueEnumObj;
|
statusOptions: DictValueEnumObj;
|
||||||
};
|
};
|
||||||
|
|
||||||
const LogininforForm: React.FC<LogininforFormProps> = (props) => {
|
const LogininforForm: React.FC<LogininforFormProps> = (props) => {
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
|
|
||||||
const { statusOptions, } = props;
|
const { statusOptions, } = props;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -65,10 +65,10 @@ const LogininforForm: React.FC<LogininforFormProps> = (props) => {
|
|||||||
onOk={handleOk}
|
onOk={handleOk}
|
||||||
onCancel={handleCancel}
|
onCancel={handleCancel}
|
||||||
>
|
>
|
||||||
<ProForm
|
<ProForm
|
||||||
form={form}
|
form={form}
|
||||||
grid={true}
|
grid={true}
|
||||||
layout="horizontal"
|
layout="horizontal"
|
||||||
onFinish={handleFinish}>
|
onFinish={handleFinish}>
|
||||||
<ProFormDigit
|
<ProFormDigit
|
||||||
name="infoId"
|
name="infoId"
|
||||||
@@ -83,7 +83,7 @@ const LogininforForm: React.FC<LogininforFormProps> = (props) => {
|
|||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
required: false,
|
required: false,
|
||||||
message: <FormattedMessage id="请输入访问编号!" defaultMessage="请输入访问编号!" />,
|
message: <FormattedMessage id="请输入访问编号!" defaultMessage="请输入访问编号!" />,
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
@@ -98,7 +98,7 @@ const LogininforForm: React.FC<LogininforFormProps> = (props) => {
|
|||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
required: false,
|
required: false,
|
||||||
message: <FormattedMessage id="请输入用户账号!" defaultMessage="请输入用户账号!" />,
|
message: <FormattedMessage id="请输入用户账号!" defaultMessage="请输入用户账号!" />,
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
@@ -113,7 +113,7 @@ const LogininforForm: React.FC<LogininforFormProps> = (props) => {
|
|||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
required: false,
|
required: false,
|
||||||
message: <FormattedMessage id="请输入登录IP地址!" defaultMessage="请输入登录IP地址!" />,
|
message: <FormattedMessage id="请输入登录IP地址!" defaultMessage="请输入登录IP地址!" />,
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
@@ -128,7 +128,7 @@ const LogininforForm: React.FC<LogininforFormProps> = (props) => {
|
|||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
required: false,
|
required: false,
|
||||||
message: <FormattedMessage id="请输入登录地点!" defaultMessage="请输入登录地点!" />,
|
message: <FormattedMessage id="请输入登录地点!" defaultMessage="请输入登录地点!" />,
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
@@ -143,7 +143,7 @@ const LogininforForm: React.FC<LogininforFormProps> = (props) => {
|
|||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
required: false,
|
required: false,
|
||||||
message: <FormattedMessage id="请输入浏览器类型!" defaultMessage="请输入浏览器类型!" />,
|
message: <FormattedMessage id="请输入浏览器类型!" defaultMessage="请输入浏览器类型!" />,
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
@@ -158,7 +158,7 @@ const LogininforForm: React.FC<LogininforFormProps> = (props) => {
|
|||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
required: false,
|
required: false,
|
||||||
message: <FormattedMessage id="请输入操作系统!" defaultMessage="请输入操作系统!" />,
|
message: <FormattedMessage id="请输入操作系统!" defaultMessage="请输入操作系统!" />,
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
@@ -174,7 +174,7 @@ const LogininforForm: React.FC<LogininforFormProps> = (props) => {
|
|||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
required: false,
|
required: false,
|
||||||
message: <FormattedMessage id="请输入登录状态!" defaultMessage="请输入登录状态!" />,
|
message: <FormattedMessage id="请输入登录状态!" defaultMessage="请输入登录状态!" />,
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
@@ -189,7 +189,7 @@ const LogininforForm: React.FC<LogininforFormProps> = (props) => {
|
|||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
required: false,
|
required: false,
|
||||||
message: <FormattedMessage id="请输入提示消息!" defaultMessage="请输入提示消息!" />,
|
message: <FormattedMessage id="请输入提示消息!" defaultMessage="请输入提示消息!" />,
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
@@ -204,7 +204,7 @@ const LogininforForm: React.FC<LogininforFormProps> = (props) => {
|
|||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
required: false,
|
required: false,
|
||||||
message: <FormattedMessage id="请输入访问时间!" defaultMessage="请输入访问时间!" />,
|
message: <FormattedMessage id="请输入访问时间!" defaultMessage="请输入访问时间!" />,
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
@@ -5,7 +5,7 @@ import type { FormInstance } from 'antd';
|
|||||||
import { Button, message, Modal } from 'antd';
|
import { Button, message, Modal } from 'antd';
|
||||||
import { ActionType, FooterToolbar, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
|
import { ActionType, FooterToolbar, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
|
||||||
import { PlusOutlined, DeleteOutlined, ExclamationCircleOutlined, UnlockOutlined } from '@ant-design/icons';
|
import { PlusOutlined, DeleteOutlined, ExclamationCircleOutlined, UnlockOutlined } from '@ant-design/icons';
|
||||||
import { getLogininforList, removeLogininfor, exportLogininfor, unlockLogininfor, cleanLogininfor } from '@/services/monitor/logininfor';
|
import { getLogininforList, removeLogininfor, exportLogininfor, unlockLogininfor, cleanLogininfor } from '@/services/logs/mobilelogininfor';
|
||||||
import DictTag from '@/components/DictTag';
|
import DictTag from '@/components/DictTag';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -13,7 +13,7 @@ import DictTag from '@/components/DictTag';
|
|||||||
*
|
*
|
||||||
* @param selectedRows
|
* @param selectedRows
|
||||||
*/
|
*/
|
||||||
const handleRemove = async (selectedRows: API.Monitor.Logininfor[]) => {
|
const handleRemove = async (selectedRows: API.Logs.MobileLogininfor[]) => {
|
||||||
const hide = message.loading('正在删除');
|
const hide = message.loading('正在删除');
|
||||||
if (!selectedRows) return true;
|
if (!selectedRows) return true;
|
||||||
try {
|
try {
|
||||||
@@ -92,7 +92,7 @@ const LogininforTableList: React.FC = () => {
|
|||||||
const formTableRef = useRef<FormInstance>();
|
const formTableRef = useRef<FormInstance>();
|
||||||
|
|
||||||
const actionRef = useRef<ActionType>();
|
const actionRef = useRef<ActionType>();
|
||||||
const [selectedRows, setSelectedRows] = useState<API.Monitor.Logininfor[]>([]);
|
const [selectedRows, setSelectedRows] = useState<API.Logs.MobileLogininfor[]>([]);
|
||||||
|
|
||||||
const access = useAccess();
|
const access = useAccess();
|
||||||
|
|
||||||
@@ -122,7 +122,7 @@ const LogininforTableList: React.FC = () => {
|
|||||||
|
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const columns: ProColumns<API.Monitor.Logininfor>[] = [
|
const columns: ProColumns<API.Logs.MobileLogininfor>[] = [
|
||||||
{
|
{
|
||||||
title: <FormattedMessage id="monitor.logininfor.info_id" defaultMessage="访问编号" />,
|
title: <FormattedMessage id="monitor.logininfor.info_id" defaultMessage="访问编号" />,
|
||||||
dataIndex: 'infoId',
|
dataIndex: 'infoId',
|
||||||
@@ -181,7 +181,7 @@ const LogininforTableList: React.FC = () => {
|
|||||||
return (
|
return (
|
||||||
<PageContainer>
|
<PageContainer>
|
||||||
<div style={{ width: '100%', float: 'right' }}>
|
<div style={{ width: '100%', float: 'right' }}>
|
||||||
<ProTable<API.Monitor.Logininfor>
|
<ProTable<API.Logs.MobileLogininfor>
|
||||||
headerTitle={intl.formatMessage({
|
headerTitle={intl.formatMessage({
|
||||||
id: 'pages.searchTable.title',
|
id: 'pages.searchTable.title',
|
||||||
defaultMessage: '信息',
|
defaultMessage: '信息',
|
||||||
@@ -277,7 +277,7 @@ const LogininforTableList: React.FC = () => {
|
|||||||
</Button>,
|
</Button>,
|
||||||
]}
|
]}
|
||||||
request={(params) =>
|
request={(params) =>
|
||||||
getLogininforList({ ...params } as API.Monitor.LogininforListParams).then((res) => {
|
getLogininforList({ ...params } as API.Logs.MobileLogininforListParams).then((res) => {
|
||||||
const result = {
|
const result = {
|
||||||
data: res.rows,
|
data: res.rows,
|
||||||
total: res.total,
|
total: res.total,
|
||||||
@@ -4,13 +4,13 @@ import { useIntl, FormattedMessage } from '@umijs/max';
|
|||||||
import { DictValueEnumObj } from '@/components/DictTag';
|
import { DictValueEnumObj } from '@/components/DictTag';
|
||||||
import { getValueEnumLabel } from '@/utils/options';
|
import { getValueEnumLabel } from '@/utils/options';
|
||||||
|
|
||||||
export type MobilelogFormData = Record<string, unknown> & Partial<API.Monitor.Mobilelog>;
|
export type MobilelogFormData = Record<string, unknown> & Partial<API.Logs.Mobilelog>;
|
||||||
|
|
||||||
export type MobilelogFormProps = {
|
export type MobilelogFormProps = {
|
||||||
onCancel: (flag?: boolean, formVals?: MobilelogFormData) => void;
|
onCancel: (flag?: boolean, formVals?: MobilelogFormData) => void;
|
||||||
onSubmit: (values: MobilelogFormData) => Promise<void>;
|
onSubmit: (values: MobilelogFormData) => Promise<void>;
|
||||||
open: boolean;
|
open: boolean;
|
||||||
values: Partial<API.Monitor.Operlog>;
|
values: Partial<API.Logs.Operlog>;
|
||||||
businessTypeOptions: DictValueEnumObj;
|
businessTypeOptions: DictValueEnumObj;
|
||||||
operatorTypeOptions: DictValueEnumObj;
|
operatorTypeOptions: DictValueEnumObj;
|
||||||
statusOptions: DictValueEnumObj;
|
statusOptions: DictValueEnumObj;
|
||||||
@@ -1,5 +1,12 @@
|
|||||||
import React, { useState, useRef, useEffect, useMemo } from 'react';
|
import React, { useState, useRef, useEffect, useMemo } from 'react';
|
||||||
import {addMobilelog, getMobileLogList, removeMobilelog, updateMobilelog} from "@/services/monitor/mobilelog";
|
import {
|
||||||
|
addMobilelog,
|
||||||
|
exportMobilelog,
|
||||||
|
getMobileLogList,
|
||||||
|
removeMobilelog,
|
||||||
|
updateMobilelog
|
||||||
|
} from "@/services/logs/mobilelog";
|
||||||
|
import type { FormInstance } from 'antd';
|
||||||
import { ActionType, FooterToolbar, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
|
import { ActionType, FooterToolbar, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
|
||||||
import { useIntl, FormattedMessage, useAccess } from '@umijs/max';
|
import { useIntl, FormattedMessage, useAccess } from '@umijs/max';
|
||||||
import { PlusOutlined, DeleteOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
|
import { PlusOutlined, DeleteOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
|
||||||
@@ -7,13 +14,13 @@ import { Button, message, Modal } from 'antd';
|
|||||||
import DictTag from "@/components/DictTag";
|
import DictTag from "@/components/DictTag";
|
||||||
import {getDictValueEnum} from "@/services/system/dict";
|
import {getDictValueEnum} from "@/services/system/dict";
|
||||||
import UpdateForm from './detail';
|
import UpdateForm from './detail';
|
||||||
import {addOperlog, removeOperlog, updateOperlog} from "@/services/monitor/operlog";
|
import {addOperlog, exportOperlog, removeOperlog, updateOperlog} from "@/services/logs/operlog";
|
||||||
/**
|
/**
|
||||||
* 添加节点
|
* 添加节点
|
||||||
*
|
*
|
||||||
* @param fields
|
* @param fields
|
||||||
*/
|
*/
|
||||||
const handleAdd = async (fields: API.Monitor.Operlog) => {
|
const handleAdd = async (fields: API.Logs.Operlog) => {
|
||||||
const hide = message.loading('正在添加');
|
const hide = message.loading('正在添加');
|
||||||
try {
|
try {
|
||||||
const resp = await addMobilelog({ ...fields });
|
const resp = await addMobilelog({ ...fields });
|
||||||
@@ -35,7 +42,7 @@ const handleAdd = async (fields: API.Monitor.Operlog) => {
|
|||||||
*
|
*
|
||||||
* @param fields
|
* @param fields
|
||||||
*/
|
*/
|
||||||
const handleUpdate = async (fields: API.Monitor.Operlog) => {
|
const handleUpdate = async (fields: API.Logs.Operlog) => {
|
||||||
const hide = message.loading('正在更新');
|
const hide = message.loading('正在更新');
|
||||||
try {
|
try {
|
||||||
const resp = await updateMobilelog(fields);
|
const resp = await updateMobilelog(fields);
|
||||||
@@ -58,7 +65,7 @@ const handleUpdate = async (fields: API.Monitor.Operlog) => {
|
|||||||
*
|
*
|
||||||
* @param selectedRows
|
* @param selectedRows
|
||||||
*/
|
*/
|
||||||
const handleRemove = async (selectedRows: API.Monitor.Operlog[]) => {
|
const handleRemove = async (selectedRows: API.Logs.Operlog[]) => {
|
||||||
const hide = message.loading('正在删除');
|
const hide = message.loading('正在删除');
|
||||||
if (!selectedRows) return true;
|
if (!selectedRows) return true;
|
||||||
try {
|
try {
|
||||||
@@ -76,6 +83,25 @@ const handleRemove = async (selectedRows: API.Monitor.Operlog[]) => {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
/**
|
||||||
|
* 导出数据
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
const handleExport = async () => {
|
||||||
|
const hide = message.loading('正在导出');
|
||||||
|
try {
|
||||||
|
await exportMobilelog();
|
||||||
|
hide();
|
||||||
|
message.success('导出成功');
|
||||||
|
return true;
|
||||||
|
} catch (error) {
|
||||||
|
hide();
|
||||||
|
message.error('导出失败,请重试');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
const MobileLog: React.FC = () => {
|
const MobileLog: React.FC = () => {
|
||||||
// ref
|
// ref
|
||||||
@@ -85,8 +111,8 @@ const MobileLog: React.FC = () => {
|
|||||||
// status
|
// status
|
||||||
const [params, useParams] = useState({})
|
const [params, useParams] = useState({})
|
||||||
const [modalVisible, setModalVisible] = useState<boolean>(false);
|
const [modalVisible, setModalVisible] = useState<boolean>(false);
|
||||||
const [currentRow, setCurrentRow] = useState<API.Monitor.Mobilelog>();
|
const [currentRow, setCurrentRow] = useState<API.Logs.Mobilelog>();
|
||||||
const [selectedRows, setSelectedRows] = useState<API.Monitor.Mobilelog[]>([]);
|
const [selectedRows, setSelectedRows] = useState<API.Logs.Mobilelog[]>([]);
|
||||||
// 枚举
|
// 枚举
|
||||||
const [businessTypeOptions, setBusinessTypeOptions] = useState<any>([]);
|
const [businessTypeOptions, setBusinessTypeOptions] = useState<any>([]);
|
||||||
const [operatorTypeOptions, setOperatorTypeOptions] = useState<any>([]);
|
const [operatorTypeOptions, setOperatorTypeOptions] = useState<any>([]);
|
||||||
@@ -106,7 +132,7 @@ const MobileLog: React.FC = () => {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|
||||||
const columns: ProColumns<API.Monitor.Mobilelog>[] = useMemo(() => [
|
const columns: ProColumns<API.Logs.Mobilelog>[] = useMemo(() => [
|
||||||
{
|
{
|
||||||
title: '日志主键',
|
title: '日志主键',
|
||||||
dataIndex: 'operId',
|
dataIndex: 'operId',
|
||||||
@@ -180,7 +206,7 @@ const MobileLog: React.FC = () => {
|
|||||||
type="link"
|
type="link"
|
||||||
size="small"
|
size="small"
|
||||||
key="edit"
|
key="edit"
|
||||||
hidden={!access.hasPerms('system:operlog:edit')}
|
hidden={!access.hasPerms('logs:mobilelog:edit.tsx')}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setModalVisible(true);
|
setModalVisible(true);
|
||||||
setCurrentRow(record);
|
setCurrentRow(record);
|
||||||
@@ -211,7 +237,7 @@ const MobileLog: React.FC = () => {
|
|||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
request={(params) =>
|
request={(params) =>
|
||||||
getMobileLogList({ ...params } as API.Monitor.MobilelogListParams).then((res) => {
|
getMobileLogList({ ...params } as API.Logs.MobilelogListParams).then((res) => {
|
||||||
const result = {
|
const result = {
|
||||||
data: res.rows,
|
data: res.rows,
|
||||||
total: res.total,
|
total: res.total,
|
||||||
@@ -224,7 +250,7 @@ const MobileLog: React.FC = () => {
|
|||||||
// <Button
|
// <Button
|
||||||
// type="primary"
|
// type="primary"
|
||||||
// key="add"
|
// key="add"
|
||||||
// hidden={!access.hasPerms('system:operlog:add')}
|
// hidden={!access.hasPerms('logs:mobilelog:add')}
|
||||||
// onClick={async () => {
|
// onClick={async () => {
|
||||||
// setCurrentRow(undefined);
|
// setCurrentRow(undefined);
|
||||||
// setModalVisible(true);
|
// setModalVisible(true);
|
||||||
@@ -236,7 +262,7 @@ const MobileLog: React.FC = () => {
|
|||||||
type="primary"
|
type="primary"
|
||||||
key="remove"
|
key="remove"
|
||||||
danger
|
danger
|
||||||
hidden={selectedRows?.length === 0 || !access.hasPerms('system:operlog:remove')}
|
hidden={selectedRows?.length === 0 || !access.hasPerms('logs:mobilelog:remove')}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: '是否确认删除所选数据项?',
|
title: '是否确认删除所选数据项?',
|
||||||
@@ -259,7 +285,7 @@ const MobileLog: React.FC = () => {
|
|||||||
<Button
|
<Button
|
||||||
type="primary"
|
type="primary"
|
||||||
key="export"
|
key="export"
|
||||||
hidden={!access.hasPerms('system:operlog:export')}
|
hidden={!access.hasPerms('logs:mobilelog:export')}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
handleExport();
|
handleExport();
|
||||||
}}
|
}}
|
||||||
@@ -274,9 +300,9 @@ const MobileLog: React.FC = () => {
|
|||||||
onSubmit={async (values) => {
|
onSubmit={async (values) => {
|
||||||
let success = false;
|
let success = false;
|
||||||
if (values.operId) {
|
if (values.operId) {
|
||||||
success = await handleUpdate({ ...values } as API.Monitor.Mobilelog);
|
success = await handleUpdate({ ...values } as API.Logs.Mobilelog);
|
||||||
} else {
|
} else {
|
||||||
success = await handleAdd({ ...values } as API.Monitor.Mobilelog);
|
success = await handleAdd({ ...values } as API.Logs.Mobilelog);
|
||||||
}
|
}
|
||||||
if (success) {
|
if (success) {
|
||||||
setModalVisible(false);
|
setModalVisible(false);
|
||||||
@@ -4,13 +4,13 @@ import { useIntl, FormattedMessage } from '@umijs/max';
|
|||||||
import { DictValueEnumObj } from '@/components/DictTag';
|
import { DictValueEnumObj } from '@/components/DictTag';
|
||||||
import { getValueEnumLabel } from '@/utils/options';
|
import { getValueEnumLabel } from '@/utils/options';
|
||||||
|
|
||||||
export type OperlogFormData = Record<string, unknown> & Partial<API.Monitor.Operlog>;
|
export type OperlogFormData = Record<string, unknown> & Partial<API.Logs.Operlog>;
|
||||||
|
|
||||||
export type OperlogFormProps = {
|
export type OperlogFormProps = {
|
||||||
onCancel: (flag?: boolean, formVals?: OperlogFormData) => void;
|
onCancel: (flag?: boolean, formVals?: OperlogFormData) => void;
|
||||||
onSubmit: (values: OperlogFormData) => Promise<void>;
|
onSubmit: (values: OperlogFormData) => Promise<void>;
|
||||||
open: boolean;
|
open: boolean;
|
||||||
values: Partial<API.Monitor.Operlog>;
|
values: Partial<API.Logs.Operlog>;
|
||||||
businessTypeOptions: DictValueEnumObj;
|
businessTypeOptions: DictValueEnumObj;
|
||||||
operatorTypeOptions: DictValueEnumObj;
|
operatorTypeOptions: DictValueEnumObj;
|
||||||
statusOptions: DictValueEnumObj;
|
statusOptions: DictValueEnumObj;
|
||||||
@@ -5,7 +5,7 @@ import type { FormInstance } from 'antd';
|
|||||||
import { Button, message, Modal } from 'antd';
|
import { Button, message, Modal } from 'antd';
|
||||||
import { ActionType, FooterToolbar, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
|
import { ActionType, FooterToolbar, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
|
||||||
import { PlusOutlined, DeleteOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
|
import { PlusOutlined, DeleteOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
|
||||||
import { getOperlogList, removeOperlog, addOperlog, updateOperlog, exportOperlog } from '@/services/monitor/operlog';
|
import { getOperlogList, removeOperlog, addOperlog, updateOperlog, exportOperlog } from '@/services/logs/operlog';
|
||||||
import UpdateForm from './detail';
|
import UpdateForm from './detail';
|
||||||
import { getDictValueEnum } from '@/services/system/dict';
|
import { getDictValueEnum } from '@/services/system/dict';
|
||||||
import DictTag from '@/components/DictTag';
|
import DictTag from '@/components/DictTag';
|
||||||
@@ -15,7 +15,7 @@ import DictTag from '@/components/DictTag';
|
|||||||
*
|
*
|
||||||
* @param fields
|
* @param fields
|
||||||
*/
|
*/
|
||||||
const handleAdd = async (fields: API.Monitor.Operlog) => {
|
const handleAdd = async (fields: API.Logs.Operlog) => {
|
||||||
const hide = message.loading('正在添加');
|
const hide = message.loading('正在添加');
|
||||||
try {
|
try {
|
||||||
const resp = await addOperlog({ ...fields });
|
const resp = await addOperlog({ ...fields });
|
||||||
@@ -38,7 +38,7 @@ const handleAdd = async (fields: API.Monitor.Operlog) => {
|
|||||||
*
|
*
|
||||||
* @param fields
|
* @param fields
|
||||||
*/
|
*/
|
||||||
const handleUpdate = async (fields: API.Monitor.Operlog) => {
|
const handleUpdate = async (fields: API.Logs.Operlog) => {
|
||||||
const hide = message.loading('正在更新');
|
const hide = message.loading('正在更新');
|
||||||
try {
|
try {
|
||||||
const resp = await updateOperlog(fields);
|
const resp = await updateOperlog(fields);
|
||||||
@@ -61,7 +61,7 @@ const handleUpdate = async (fields: API.Monitor.Operlog) => {
|
|||||||
*
|
*
|
||||||
* @param selectedRows
|
* @param selectedRows
|
||||||
*/
|
*/
|
||||||
const handleRemove = async (selectedRows: API.Monitor.Operlog[]) => {
|
const handleRemove = async (selectedRows: API.Logs.Operlog[]) => {
|
||||||
const hide = message.loading('正在删除');
|
const hide = message.loading('正在删除');
|
||||||
if (!selectedRows) return true;
|
if (!selectedRows) return true;
|
||||||
try {
|
try {
|
||||||
@@ -107,8 +107,8 @@ const OperlogTableList: React.FC = () => {
|
|||||||
const [modalVisible, setModalVisible] = useState<boolean>(false);
|
const [modalVisible, setModalVisible] = useState<boolean>(false);
|
||||||
|
|
||||||
const actionRef = useRef<ActionType>();
|
const actionRef = useRef<ActionType>();
|
||||||
const [currentRow, setCurrentRow] = useState<API.Monitor.Operlog>();
|
const [currentRow, setCurrentRow] = useState<API.Logs.Operlog>();
|
||||||
const [selectedRows, setSelectedRows] = useState<API.Monitor.Operlog[]>([]);
|
const [selectedRows, setSelectedRows] = useState<API.Logs.Operlog[]>([]);
|
||||||
|
|
||||||
const [businessTypeOptions, setBusinessTypeOptions] = useState<any>([]);
|
const [businessTypeOptions, setBusinessTypeOptions] = useState<any>([]);
|
||||||
const [operatorTypeOptions, setOperatorTypeOptions] = useState<any>([]);
|
const [operatorTypeOptions, setOperatorTypeOptions] = useState<any>([]);
|
||||||
@@ -131,7 +131,7 @@ const OperlogTableList: React.FC = () => {
|
|||||||
});
|
});
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const columns: ProColumns<API.Monitor.Operlog>[] = [
|
const columns: ProColumns<API.Logs.Operlog>[] = [
|
||||||
{
|
{
|
||||||
title: <FormattedMessage id="monitor.operlog.oper_id" defaultMessage="日志主键" />,
|
title: <FormattedMessage id="monitor.operlog.oper_id" defaultMessage="日志主键" />,
|
||||||
dataIndex: 'operId',
|
dataIndex: 'operId',
|
||||||
@@ -205,7 +205,7 @@ const OperlogTableList: React.FC = () => {
|
|||||||
type="link"
|
type="link"
|
||||||
size="small"
|
size="small"
|
||||||
key="edit"
|
key="edit"
|
||||||
hidden={!access.hasPerms('system:mobilelog:edit')}
|
hidden={!access.hasPerms('logs:operlog:edit.tsx')}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setModalVisible(true);
|
setModalVisible(true);
|
||||||
setCurrentRow(record);
|
setCurrentRow(record);
|
||||||
@@ -220,7 +220,7 @@ const OperlogTableList: React.FC = () => {
|
|||||||
return (
|
return (
|
||||||
<PageContainer>
|
<PageContainer>
|
||||||
<div style={{ width: '100%', float: 'right' }}>
|
<div style={{ width: '100%', float: 'right' }}>
|
||||||
<ProTable<API.Monitor.Operlog>
|
<ProTable<API.Logs.Operlog>
|
||||||
headerTitle={intl.formatMessage({
|
headerTitle={intl.formatMessage({
|
||||||
id: 'pages.searchTable.title',
|
id: 'pages.searchTable.title',
|
||||||
defaultMessage: '信息',
|
defaultMessage: '信息',
|
||||||
@@ -236,7 +236,7 @@ const OperlogTableList: React.FC = () => {
|
|||||||
// <Button
|
// <Button
|
||||||
// type="primary"
|
// type="primary"
|
||||||
// key="add"
|
// key="add"
|
||||||
// hidden={!access.hasPerms('system:mobilelog:add')}
|
// hidden={!access.hasPerms('logs:operlog:add')}
|
||||||
// onClick={async () => {
|
// onClick={async () => {
|
||||||
// setCurrentRow(undefined);
|
// setCurrentRow(undefined);
|
||||||
// setModalVisible(true);
|
// setModalVisible(true);
|
||||||
@@ -248,7 +248,7 @@ const OperlogTableList: React.FC = () => {
|
|||||||
type="primary"
|
type="primary"
|
||||||
key="remove"
|
key="remove"
|
||||||
danger
|
danger
|
||||||
hidden={selectedRows?.length === 0 || !access.hasPerms('system:mobilelog:remove')}
|
hidden={selectedRows?.length === 0 || !access.hasPerms('logs:operlog:remove')}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: '是否确认删除所选数据项?',
|
title: '是否确认删除所选数据项?',
|
||||||
@@ -271,7 +271,7 @@ const OperlogTableList: React.FC = () => {
|
|||||||
<Button
|
<Button
|
||||||
type="primary"
|
type="primary"
|
||||||
key="export"
|
key="export"
|
||||||
hidden={!access.hasPerms('system:mobilelog:export')}
|
hidden={!access.hasPerms('logs:operlog:export')}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
handleExport();
|
handleExport();
|
||||||
}}
|
}}
|
||||||
@@ -281,7 +281,7 @@ const OperlogTableList: React.FC = () => {
|
|||||||
</Button>,
|
</Button>,
|
||||||
]}
|
]}
|
||||||
request={(params) =>
|
request={(params) =>
|
||||||
getOperlogList({ ...params } as API.Monitor.OperlogListParams).then((res) => {
|
getOperlogList({ ...params } as API.Logs.OperlogListParams).then((res) => {
|
||||||
const result = {
|
const result = {
|
||||||
data: res.rows,
|
data: res.rows,
|
||||||
total: res.total,
|
total: res.total,
|
||||||
@@ -311,7 +311,7 @@ const OperlogTableList: React.FC = () => {
|
|||||||
<Button
|
<Button
|
||||||
key="remove"
|
key="remove"
|
||||||
danger
|
danger
|
||||||
hidden={!access.hasPerms('system:mobilelog:del')}
|
hidden={!access.hasPerms('logs:operlog:del')}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: '删除',
|
title: '删除',
|
||||||
@@ -336,9 +336,9 @@ const OperlogTableList: React.FC = () => {
|
|||||||
onSubmit={async (values) => {
|
onSubmit={async (values) => {
|
||||||
let success = false;
|
let success = false;
|
||||||
if (values.operId) {
|
if (values.operId) {
|
||||||
success = await handleUpdate({ ...values } as API.Monitor.Operlog);
|
success = await handleUpdate({ ...values } as API.Logs.Operlog);
|
||||||
} else {
|
} else {
|
||||||
success = await handleAdd({ ...values } as API.Monitor.Operlog);
|
success = await handleAdd({ ...values } as API.Logs.Operlog);
|
||||||
}
|
}
|
||||||
if (success) {
|
if (success) {
|
||||||
setModalVisible(false);
|
setModalVisible(false);
|
||||||
123
src/pages/Management/List/edit.tsx
Normal file
123
src/pages/Management/List/edit.tsx
Normal file
@@ -0,0 +1,123 @@
|
|||||||
|
import { PlusOutlined } from '@ant-design/icons';
|
||||||
|
import {
|
||||||
|
ModalForm,
|
||||||
|
ProForm,
|
||||||
|
ProFormDateRangePicker,
|
||||||
|
ProFormSelect,
|
||||||
|
ProFormText,
|
||||||
|
} from '@ant-design/pro-components';
|
||||||
|
import { Button, Form, message } from 'antd';
|
||||||
|
import {DictOptionType, DictValueEnumObj} from "@/components/DictTag";
|
||||||
|
|
||||||
|
export type ListFormProps = {
|
||||||
|
onCancel: (flag?: boolean, formVals?: unknown) => void;
|
||||||
|
onSubmit: (values: API.Management.Manage) => Promise<void>;
|
||||||
|
open: boolean;
|
||||||
|
values: Partial<API.Management.Manage>;
|
||||||
|
jobGroupOptions: DictOptionType[];
|
||||||
|
statusOptions: DictValueEnumObj;
|
||||||
|
};
|
||||||
|
|
||||||
|
const waitTime = (time: number = 100) => {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
setTimeout(() => {
|
||||||
|
resolve(true);
|
||||||
|
}, time);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const listEdit: React.FC<ListFormProps> = (props) => {
|
||||||
|
const [form] = Form.useForm<{ name: string; company: string }>();
|
||||||
|
|
||||||
|
const handleCancel = () => {
|
||||||
|
props.onCancel();
|
||||||
|
form.resetFields();
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleFinish = async (values: Record<string, any>) => {
|
||||||
|
props.onSubmit(values as API.Management.Manage);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ModalForm<{
|
||||||
|
name: string;
|
||||||
|
company: string;
|
||||||
|
}>
|
||||||
|
title="新建表单"
|
||||||
|
form={form}
|
||||||
|
autoFocusFirstInput
|
||||||
|
open={props.open}
|
||||||
|
modalProps={{
|
||||||
|
destroyOnClose: true,
|
||||||
|
onCancel: () => handleCancel(),
|
||||||
|
}}
|
||||||
|
submitTimeout={2000}
|
||||||
|
onFinish={handleFinish}
|
||||||
|
>
|
||||||
|
<ProForm.Group>
|
||||||
|
<ProFormText
|
||||||
|
width="md"
|
||||||
|
name="jobName"
|
||||||
|
label="岗位名称"
|
||||||
|
placeholder="请输入名称"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<ProFormText
|
||||||
|
width="md"
|
||||||
|
name="company"
|
||||||
|
label="我方公司名称"
|
||||||
|
placeholder="请输入名称"
|
||||||
|
/>
|
||||||
|
</ProForm.Group>
|
||||||
|
<ProForm.Group>
|
||||||
|
<ProFormText
|
||||||
|
width="md"
|
||||||
|
name="contract"
|
||||||
|
label="合同名称"
|
||||||
|
placeholder="请输入名称"
|
||||||
|
/>
|
||||||
|
<ProFormDateRangePicker name="contractTime" label="合同生效时间" />
|
||||||
|
</ProForm.Group>
|
||||||
|
<ProForm.Group>
|
||||||
|
<ProFormSelect
|
||||||
|
request={async () => [
|
||||||
|
{
|
||||||
|
value: 'chapter',
|
||||||
|
label: '盖章后生效',
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
width="xs"
|
||||||
|
name="useMode"
|
||||||
|
label="合同约定生效方式"
|
||||||
|
/>
|
||||||
|
<ProFormSelect
|
||||||
|
width="xs"
|
||||||
|
options={[
|
||||||
|
{
|
||||||
|
value: 'time',
|
||||||
|
label: '履行完终止',
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
name="unusedMode"
|
||||||
|
label="合同约定失效效方式"
|
||||||
|
/>
|
||||||
|
</ProForm.Group>
|
||||||
|
<ProFormText width="sm" name="id" label="主合同编号" />
|
||||||
|
<ProFormText
|
||||||
|
name="project"
|
||||||
|
disabled
|
||||||
|
label="项目名称"
|
||||||
|
initialValue="xxxx项目"
|
||||||
|
/>
|
||||||
|
<ProFormText
|
||||||
|
width="xs"
|
||||||
|
name="mangerName"
|
||||||
|
disabled
|
||||||
|
label="商务经理"
|
||||||
|
initialValue="启途"
|
||||||
|
/>
|
||||||
|
</ModalForm>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default listEdit
|
||||||
72
src/pages/Management/List/index.tsx
Normal file
72
src/pages/Management/List/index.tsx
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
import React, {Fragment, useRef, useState} from "react";
|
||||||
|
import { useIntl, FormattedMessage, useAccess, history } from '@umijs/max';
|
||||||
|
import {getCmsJobList} from "@/services/Management/list";
|
||||||
|
import { Dropdown, FormInstance, Space, Button, message, Modal } from 'antd';
|
||||||
|
import { ActionType, FooterToolbar, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
|
||||||
|
import { PlusOutlined, DeleteOutlined, ExclamationCircleOutlined, DownOutlined, EditOutlined } from '@ant-design/icons';
|
||||||
|
import EditManageRow from './edit'
|
||||||
|
function ManagementList() {
|
||||||
|
const access = useAccess();
|
||||||
|
|
||||||
|
const formTableRef = useRef<FormInstance>();
|
||||||
|
const actionRef = useRef<ActionType>();
|
||||||
|
|
||||||
|
const [currentRow, setCurrentRow] = useState<API.Management.Manage>()
|
||||||
|
const [modalVisible, setModalVisible] = useState<boolean>(false)
|
||||||
|
|
||||||
|
const columns: ProColumns<API.Management.Manage>[] = [
|
||||||
|
{
|
||||||
|
title: '任务编号',
|
||||||
|
dataIndex: 'jobId',
|
||||||
|
valueType: 'text',
|
||||||
|
hideInSearch: true,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
return (
|
||||||
|
<Fragment>
|
||||||
|
<div style={{ width: '100%', float: 'right' }}>
|
||||||
|
<ProTable<API.Management.Manage>
|
||||||
|
// params 是需要自带的参数
|
||||||
|
// 这个参数优先级更高,会覆盖查询表单的参数
|
||||||
|
actionRef={actionRef}
|
||||||
|
formRef={formTableRef}
|
||||||
|
columns={columns}
|
||||||
|
request={(params) =>
|
||||||
|
getCmsJobList({ ...params } as API.Management.ListParams).then((res) => {
|
||||||
|
const result = {
|
||||||
|
data: res.rows,
|
||||||
|
total: res.total,
|
||||||
|
success: true,
|
||||||
|
};
|
||||||
|
return result;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
toolBarRender={() => [
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
key="add"
|
||||||
|
hidden={!access.hasPerms('manage:list:add')}
|
||||||
|
onClick={async () => {
|
||||||
|
setCurrentRow(undefined);
|
||||||
|
setModalVisible(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<PlusOutlined /> 新建
|
||||||
|
</Button>,
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<EditManageRow
|
||||||
|
open={modalVisible}
|
||||||
|
onSubmit={(values) => {
|
||||||
|
console.log(values)
|
||||||
|
}}
|
||||||
|
onCancel={() => {
|
||||||
|
setModalVisible(false);
|
||||||
|
setCurrentRow(undefined);
|
||||||
|
}}
|
||||||
|
></EditManageRow>
|
||||||
|
</Fragment>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
export default ManagementList
|
||||||
@@ -217,7 +217,7 @@ const JobTableList: React.FC = () => {
|
|||||||
size="small"
|
size="small"
|
||||||
key="edit"
|
key="edit"
|
||||||
icon = <EditOutlined />
|
icon = <EditOutlined />
|
||||||
hidden={!access.hasPerms('monitor:job:edit')}
|
hidden={!access.hasPerms('monitor:job:edit.tsx')}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setModalVisible(true);
|
setModalVisible(true);
|
||||||
setCurrentRow(record);
|
setCurrentRow(record);
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ const JobLogTableList: React.FC = () => {
|
|||||||
type="link"
|
type="link"
|
||||||
size="small"
|
size="small"
|
||||||
key="edit"
|
key="edit"
|
||||||
hidden={!access.hasPerms('monitor:job-log:edit')}
|
hidden={!access.hasPerms('monitor:job-log:edit.tsx')}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setModalOpen(true);
|
setModalOpen(true);
|
||||||
setCurrentRow(record);
|
setCurrentRow(record);
|
||||||
|
|||||||
152
src/pages/System/AdminDict/edit.tsx
Normal file
152
src/pages/System/AdminDict/edit.tsx
Normal file
@@ -0,0 +1,152 @@
|
|||||||
|
import React, { useEffect } from 'react';
|
||||||
|
import {
|
||||||
|
ProForm,
|
||||||
|
ProFormDigit,
|
||||||
|
ProFormText,
|
||||||
|
ProFormRadio,
|
||||||
|
ProFormTextArea,
|
||||||
|
} from '@ant-design/pro-components';
|
||||||
|
import { Form, Modal} from 'antd';
|
||||||
|
import { useIntl, FormattedMessage } from '@umijs/max';
|
||||||
|
import { DictValueEnumObj } from '@/components/DictTag';
|
||||||
|
|
||||||
|
export type DictTypeFormData = Record<string, unknown> & Partial<API.System.DictType>;
|
||||||
|
|
||||||
|
export type DictTypeFormProps = {
|
||||||
|
onCancel: (flag?: boolean, formVals?: DictTypeFormData) => void;
|
||||||
|
onSubmit: (values: DictTypeFormData) => Promise<void>;
|
||||||
|
open: boolean;
|
||||||
|
values: Partial<API.System.DictType>;
|
||||||
|
statusOptions: DictValueEnumObj;
|
||||||
|
};
|
||||||
|
|
||||||
|
const DictTypeForm: React.FC<DictTypeFormProps> = (props) => {
|
||||||
|
const [form] = Form.useForm();
|
||||||
|
|
||||||
|
const { statusOptions } = props;
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
form.resetFields();
|
||||||
|
form.setFieldsValue({
|
||||||
|
dictId: props.values.dictId,
|
||||||
|
dictName: props.values.dictName,
|
||||||
|
dictType: props.values.dictType,
|
||||||
|
status: props.values.status,
|
||||||
|
createBy: props.values.createBy,
|
||||||
|
createTime: props.values.createTime,
|
||||||
|
updateBy: props.values.updateBy,
|
||||||
|
updateTime: props.values.updateTime,
|
||||||
|
remark: props.values.remark,
|
||||||
|
});
|
||||||
|
}, [form, props]);
|
||||||
|
|
||||||
|
const intl = useIntl();
|
||||||
|
const handleOk = () => {
|
||||||
|
form.submit();
|
||||||
|
};
|
||||||
|
const handleCancel = () => {
|
||||||
|
props.onCancel();
|
||||||
|
};
|
||||||
|
const handleFinish = async (values: Record<string, any>) => {
|
||||||
|
props.onSubmit(values as DictTypeFormData);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
width={640}
|
||||||
|
title={intl.formatMessage({
|
||||||
|
id: 'system.dict.title',
|
||||||
|
defaultMessage: '编辑字典类型',
|
||||||
|
})}
|
||||||
|
open={props.open}
|
||||||
|
forceRender
|
||||||
|
destroyOnClose
|
||||||
|
onOk={handleOk}
|
||||||
|
onCancel={handleCancel}
|
||||||
|
>
|
||||||
|
<ProForm
|
||||||
|
form={form}
|
||||||
|
grid={true}
|
||||||
|
submitter={false}
|
||||||
|
layout="horizontal"
|
||||||
|
onFinish={handleFinish}>
|
||||||
|
<ProFormDigit
|
||||||
|
name="dictId"
|
||||||
|
label={intl.formatMessage({
|
||||||
|
id: 'system.dict.dict_id',
|
||||||
|
defaultMessage: '字典主键',
|
||||||
|
})}
|
||||||
|
placeholder="请输入字典主键"
|
||||||
|
disabled
|
||||||
|
hidden={true}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: false,
|
||||||
|
message: <FormattedMessage id="请输入字典主键!" defaultMessage="请输入字典主键!" />,
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
<ProFormText
|
||||||
|
name="dictName"
|
||||||
|
label={intl.formatMessage({
|
||||||
|
id: 'system.dict.dict_name',
|
||||||
|
defaultMessage: '字典名称',
|
||||||
|
})}
|
||||||
|
placeholder="请输入字典名称"
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: false,
|
||||||
|
message: <FormattedMessage id="请输入字典名称!" defaultMessage="请输入字典名称!" />,
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
<ProFormText
|
||||||
|
name="dictType"
|
||||||
|
label={intl.formatMessage({
|
||||||
|
id: 'system.dict.dict_type',
|
||||||
|
defaultMessage: '字典类型',
|
||||||
|
})}
|
||||||
|
placeholder="请输入字典类型"
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: false,
|
||||||
|
message: <FormattedMessage id="请输入字典类型!" defaultMessage="请输入字典类型!" />,
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
<ProFormRadio.Group
|
||||||
|
valueEnum={statusOptions}
|
||||||
|
name="status"
|
||||||
|
label={intl.formatMessage({
|
||||||
|
id: 'system.dict.status',
|
||||||
|
defaultMessage: '状态',
|
||||||
|
})}
|
||||||
|
initialValue={'0'}
|
||||||
|
placeholder="请输入状态"
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: false,
|
||||||
|
message: <FormattedMessage id="请输入状态!" defaultMessage="请输入状态!" />,
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
<ProFormTextArea
|
||||||
|
name="remark"
|
||||||
|
label={intl.formatMessage({
|
||||||
|
id: 'system.dict.remark',
|
||||||
|
defaultMessage: '备注',
|
||||||
|
})}
|
||||||
|
placeholder="请输入备注"
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: false,
|
||||||
|
message: <FormattedMessage id="请输入备注!" defaultMessage="请输入备注!" />,
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</ProForm>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default DictTypeForm;
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
|
|
||||||
import React, { useState, useRef, useEffect } from 'react';
|
import React, { useState, useRef, useEffect } from 'react';
|
||||||
import { useIntl, FormattedMessage, useAccess } from '@umijs/max';
|
import { useIntl, FormattedMessage, useAccess, history } from '@umijs/max';
|
||||||
import type { FormInstance } from 'antd';
|
import type { FormInstance } from 'antd';
|
||||||
import { Button, message, Modal } from 'antd';
|
import { Button, message, Modal } from 'antd';
|
||||||
import { ActionType, FooterToolbar, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
|
import { ActionType, FooterToolbar, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
|
||||||
import { PlusOutlined, DeleteOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
|
import { PlusOutlined, DeleteOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
|
||||||
import { getOperlogList, removeOperlog, addOperlog, updateOperlog, cleanAllOperlog, exportOperlog } from '@/services/monitor/operlog';
|
import { getDictTypeList, removeDictType, addDictType, updateDictType, exportDictType } from '@/services/system/admindict';
|
||||||
import UpdateForm from './detail';
|
import UpdateForm from './edit';
|
||||||
import { getDictValueEnum } from '@/services/system/dict';
|
import { getDictValueEnum } from '@/services/system/admindict';
|
||||||
import DictTag from '@/components/DictTag';
|
import DictTag from '@/components/DictTag';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -15,10 +15,10 @@ import DictTag from '@/components/DictTag';
|
|||||||
*
|
*
|
||||||
* @param fields
|
* @param fields
|
||||||
*/
|
*/
|
||||||
const handleAdd = async (fields: API.Monitor.Operlog) => {
|
const handleAdd = async (fields: API.System.DictType) => {
|
||||||
const hide = message.loading('正在添加');
|
const hide = message.loading('正在添加');
|
||||||
try {
|
try {
|
||||||
const resp = await addOperlog({ ...fields });
|
const resp = await addDictType({ ...fields });
|
||||||
hide();
|
hide();
|
||||||
if (resp.code === 200) {
|
if (resp.code === 200) {
|
||||||
message.success('添加成功');
|
message.success('添加成功');
|
||||||
@@ -38,10 +38,10 @@ const handleAdd = async (fields: API.Monitor.Operlog) => {
|
|||||||
*
|
*
|
||||||
* @param fields
|
* @param fields
|
||||||
*/
|
*/
|
||||||
const handleUpdate = async (fields: API.Monitor.Operlog) => {
|
const handleUpdate = async (fields: API.System.DictType) => {
|
||||||
const hide = message.loading('正在更新');
|
const hide = message.loading('正在更新');
|
||||||
try {
|
try {
|
||||||
const resp = await updateOperlog(fields);
|
const resp = await updateDictType(fields);
|
||||||
hide();
|
hide();
|
||||||
if (resp.code === 200) {
|
if (resp.code === 200) {
|
||||||
message.success('更新成功');
|
message.success('更新成功');
|
||||||
@@ -61,11 +61,31 @@ const handleUpdate = async (fields: API.Monitor.Operlog) => {
|
|||||||
*
|
*
|
||||||
* @param selectedRows
|
* @param selectedRows
|
||||||
*/
|
*/
|
||||||
const handleRemove = async (selectedRows: API.Monitor.Operlog[]) => {
|
const handleRemove = async (selectedRows: API.System.DictType[]) => {
|
||||||
const hide = message.loading('正在删除');
|
const hide = message.loading('正在删除');
|
||||||
if (!selectedRows) return true;
|
if (!selectedRows) return true;
|
||||||
try {
|
try {
|
||||||
const resp = await removeOperlog(selectedRows.map((row) => row.operId).join(','));
|
const resp = await removeDictType(selectedRows.map((row) => row.dictId).join(','));
|
||||||
|
hide();
|
||||||
|
if (resp.code === 200) {
|
||||||
|
message.success('删除成功,即将刷新');
|
||||||
|
} else {
|
||||||
|
message.error(resp.msg);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} catch (error) {
|
||||||
|
hide();
|
||||||
|
message.error('删除失败,请重试');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleRemoveOne = async (selectedRow: API.System.DictType) => {
|
||||||
|
const hide = message.loading('正在删除');
|
||||||
|
if (!selectedRow) return true;
|
||||||
|
try {
|
||||||
|
const params = [selectedRow.dictId];
|
||||||
|
const resp = await removeDictType(params.join(','));
|
||||||
hide();
|
hide();
|
||||||
if (resp.code === 200) {
|
if (resp.code === 200) {
|
||||||
message.success('删除成功,即将刷新');
|
message.success('删除成功,即将刷新');
|
||||||
@@ -80,29 +100,6 @@ const handleRemove = async (selectedRows: API.Monitor.Operlog[]) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* 清空所有记录
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
const handleCleanAll = async () => {
|
|
||||||
const hide = message.loading('正在清空');
|
|
||||||
try {
|
|
||||||
const resp = await cleanAllOperlog();
|
|
||||||
hide();
|
|
||||||
if (resp.code === 200) {
|
|
||||||
message.success('清空成功,即将刷新');
|
|
||||||
} else {
|
|
||||||
message.error(resp.msg);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
} catch (error) {
|
|
||||||
hide();
|
|
||||||
message.error('清空失败,请重试');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出数据
|
* 导出数据
|
||||||
*
|
*
|
||||||
@@ -111,7 +108,7 @@ const handleCleanAll = async () => {
|
|||||||
const handleExport = async () => {
|
const handleExport = async () => {
|
||||||
const hide = message.loading('正在导出');
|
const hide = message.loading('正在导出');
|
||||||
try {
|
try {
|
||||||
await exportOperlog();
|
await exportDictType();
|
||||||
hide();
|
hide();
|
||||||
message.success('导出成功');
|
message.success('导出成功');
|
||||||
return true;
|
return true;
|
||||||
@@ -123,17 +120,15 @@ const handleExport = async () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const OperlogTableList: React.FC = () => {
|
const DictTableList: React.FC = () => {
|
||||||
const formTableRef = useRef<FormInstance>();
|
const formTableRef = useRef<FormInstance>();
|
||||||
|
|
||||||
const [modalVisible, setModalVisible] = useState<boolean>(false);
|
const [modalVisible, setModalVisible] = useState<boolean>(false);
|
||||||
|
|
||||||
const actionRef = useRef<ActionType>();
|
const actionRef = useRef<ActionType>();
|
||||||
const [currentRow, setCurrentRow] = useState<API.Monitor.Operlog>();
|
const [currentRow, setCurrentRow] = useState<API.System.DictType>();
|
||||||
const [selectedRows, setSelectedRows] = useState<API.Monitor.Operlog[]>([]);
|
const [selectedRows, setSelectedRows] = useState<API.System.DictType[]>([]);
|
||||||
|
|
||||||
const [businessTypeOptions, setBusinessTypeOptions] = useState<any>([]);
|
|
||||||
const [operatorTypeOptions, setOperatorTypeOptions] = useState<any>([]);
|
|
||||||
const [statusOptions, setStatusOptions] = useState<any>([]);
|
const [statusOptions, setStatusOptions] = useState<any>([]);
|
||||||
|
|
||||||
const access = useAccess();
|
const access = useAccess();
|
||||||
@@ -142,98 +137,112 @@ const OperlogTableList: React.FC = () => {
|
|||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getDictValueEnum('sys_oper_type', true).then((data) => {
|
getDictValueEnum('sys_normal_disable').then((data) => {
|
||||||
setBusinessTypeOptions(data);
|
|
||||||
});
|
|
||||||
getDictValueEnum('sys_oper_type', true).then((data) => {
|
|
||||||
setOperatorTypeOptions(data);
|
|
||||||
});
|
|
||||||
getDictValueEnum('sys_common_status', true).then((data) => {
|
|
||||||
setStatusOptions(data);
|
setStatusOptions(data);
|
||||||
});
|
});
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const columns: ProColumns<API.Monitor.Operlog>[] = [
|
const columns: ProColumns<API.System.DictType>[] = [
|
||||||
{
|
{
|
||||||
title: <FormattedMessage id="monitor.operlog.oper_id" defaultMessage="日志主键" />,
|
title: <FormattedMessage id="system.dict.dict_id" defaultMessage="字典编号" />,
|
||||||
dataIndex: 'operId',
|
dataIndex: 'dictId',
|
||||||
valueType: 'text',
|
valueType: 'text',
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: <FormattedMessage id="monitor.operlog.title" defaultMessage="操作模块" />,
|
title: <FormattedMessage id="system.dict.dict_name" defaultMessage="字典名称" />,
|
||||||
dataIndex: 'title',
|
dataIndex: 'dictName',
|
||||||
valueType: 'text',
|
valueType: 'text',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: <FormattedMessage id="monitor.operlog.business_type" defaultMessage="业务类型" />,
|
title: <FormattedMessage id="system.dict.dict_type" defaultMessage="字典类型" />,
|
||||||
dataIndex: 'businessType',
|
dataIndex: 'dictType',
|
||||||
valueType: 'select',
|
valueType: 'text',
|
||||||
valueEnum: businessTypeOptions,
|
render: (dom, record) => {
|
||||||
render: (_, record) => {
|
return (
|
||||||
return (<DictTag enums={businessTypeOptions} value={record.businessType} />);
|
<a
|
||||||
|
onClick={() => {
|
||||||
|
history.push(`/system/admin-dict-data/index/${record.dictId}`);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{dom}
|
||||||
|
</a>
|
||||||
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: <FormattedMessage id="monitor.operlog.request_method" defaultMessage="请求方式" />,
|
title: <FormattedMessage id="system.dict.status" defaultMessage="状态" />,
|
||||||
dataIndex: 'requestMethod',
|
|
||||||
valueType: 'text',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: <FormattedMessage id="monitor.operlog.operator_type" defaultMessage="操作类别" />,
|
|
||||||
dataIndex: 'operatorType',
|
|
||||||
valueType: 'select',
|
|
||||||
valueEnum: operatorTypeOptions,
|
|
||||||
render: (_, record) => {
|
|
||||||
return (<DictTag enums={operatorTypeOptions} value={record.operatorType} />);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: <FormattedMessage id="monitor.operlog.oper_name" defaultMessage="操作人员" />,
|
|
||||||
dataIndex: 'operName',
|
|
||||||
valueType: 'text',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: <FormattedMessage id="monitor.operlog.oper_ip" defaultMessage="主机地址" />,
|
|
||||||
dataIndex: 'operIp',
|
|
||||||
valueType: 'text',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: <FormattedMessage id="monitor.operlog.oper_location" defaultMessage="操作地点" />,
|
|
||||||
dataIndex: 'operLocation',
|
|
||||||
valueType: 'text',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: <FormattedMessage id="monitor.operlog.status" defaultMessage="操作状态" />,
|
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
valueType: 'select',
|
valueType: 'select',
|
||||||
valueEnum: statusOptions,
|
valueEnum: statusOptions,
|
||||||
render: (_, record) => {
|
render: (_, record) => {
|
||||||
return (<DictTag key="status" enums={statusOptions} value={record.status} />);
|
return (<DictTag enums={statusOptions} value={record.status} />);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: <FormattedMessage id="monitor.operlog.oper_time" defaultMessage="操作时间" />,
|
title: <FormattedMessage id="system.dict.remark" defaultMessage="备注" />,
|
||||||
dataIndex: 'operTime',
|
dataIndex: 'remark',
|
||||||
valueType: 'dateTime',
|
valueType: 'textarea',
|
||||||
|
hideInSearch: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: <FormattedMessage id="system.role.create_time" defaultMessage="创建时间" />,
|
||||||
|
dataIndex: 'createTime',
|
||||||
|
valueType: 'dateRange',
|
||||||
|
render: (_, record) => {
|
||||||
|
return (<span>{record.createTime.toString()} </span>);
|
||||||
|
},
|
||||||
|
search: {
|
||||||
|
transform: (value) => {
|
||||||
|
return {
|
||||||
|
'params[beginTime]': value[0],
|
||||||
|
'params[endTime]': value[1],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: <FormattedMessage id="pages.searchTable.titleOption" defaultMessage="操作" />,
|
title: <FormattedMessage id="pages.searchTable.titleOption" defaultMessage="操作" />,
|
||||||
dataIndex: 'option',
|
dataIndex: 'option',
|
||||||
width: '120px',
|
width: '220px',
|
||||||
valueType: 'option',
|
valueType: 'option',
|
||||||
render: (_, record) => [
|
render: (_, record) => [
|
||||||
<Button
|
<Button
|
||||||
type="link"
|
type="link"
|
||||||
size="small"
|
size="small"
|
||||||
key="edit"
|
key="edit"
|
||||||
hidden={!access.hasPerms('system:operlog:edit')}
|
hidden={!access.hasPerms('system:dictType:edit.tsx')}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setModalVisible(true);
|
setModalVisible(true);
|
||||||
setCurrentRow(record);
|
setCurrentRow(record);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
详细
|
编辑
|
||||||
|
</Button>,
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
size="small"
|
||||||
|
danger
|
||||||
|
key="batchRemove"
|
||||||
|
hidden={!access.hasPerms('system:dictType:remove')}
|
||||||
|
onClick={async () => {
|
||||||
|
Modal.confirm({
|
||||||
|
title: '删除',
|
||||||
|
content: '确定删除该项吗?',
|
||||||
|
okText: '确认',
|
||||||
|
cancelText: '取消',
|
||||||
|
onOk: async () => {
|
||||||
|
const success = await handleRemoveOne(record);
|
||||||
|
if (success) {
|
||||||
|
if (actionRef.current) {
|
||||||
|
actionRef.current.reload();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
删除
|
||||||
</Button>,
|
</Button>,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -242,15 +251,15 @@ const OperlogTableList: React.FC = () => {
|
|||||||
return (
|
return (
|
||||||
<PageContainer>
|
<PageContainer>
|
||||||
<div style={{ width: '100%', float: 'right' }}>
|
<div style={{ width: '100%', float: 'right' }}>
|
||||||
<ProTable<API.Monitor.Operlog>
|
<ProTable<API.System.DictType>
|
||||||
headerTitle={intl.formatMessage({
|
headerTitle={intl.formatMessage({
|
||||||
id: 'pages.searchTable.title',
|
id: 'pages.searchTable.title',
|
||||||
defaultMessage: '信息',
|
defaultMessage: '信息',
|
||||||
})}
|
})}
|
||||||
actionRef={actionRef}
|
actionRef={actionRef}
|
||||||
formRef={formTableRef}
|
formRef={formTableRef}
|
||||||
rowKey="operId"
|
rowKey="dictId"
|
||||||
key="operlogList"
|
key="dictTypeList"
|
||||||
search={{
|
search={{
|
||||||
labelWidth: 120,
|
labelWidth: 120,
|
||||||
}}
|
}}
|
||||||
@@ -258,7 +267,7 @@ const OperlogTableList: React.FC = () => {
|
|||||||
<Button
|
<Button
|
||||||
type="primary"
|
type="primary"
|
||||||
key="add"
|
key="add"
|
||||||
hidden={!access.hasPerms('system:operlog:add')}
|
hidden={!access.hasPerms('system:dictType:add')}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
setCurrentRow(undefined);
|
setCurrentRow(undefined);
|
||||||
setModalVisible(true);
|
setModalVisible(true);
|
||||||
@@ -270,7 +279,7 @@ const OperlogTableList: React.FC = () => {
|
|||||||
type="primary"
|
type="primary"
|
||||||
key="remove"
|
key="remove"
|
||||||
danger
|
danger
|
||||||
hidden={selectedRows?.length === 0 || !access.hasPerms('system:operlog:remove')}
|
hidden={selectedRows?.length === 0 || !access.hasPerms('system:dictType:remove')}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: '是否确认删除所选数据项?',
|
title: '是否确认删除所选数据项?',
|
||||||
@@ -283,41 +292,17 @@ const OperlogTableList: React.FC = () => {
|
|||||||
actionRef.current?.reloadAndRest?.();
|
actionRef.current?.reloadAndRest?.();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onCancel() { },
|
onCancel() {},
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<DeleteOutlined />
|
<DeleteOutlined />
|
||||||
<FormattedMessage id="pages.searchTable.delete" defaultMessage="删除" />
|
<FormattedMessage id="pages.searchTable.delete" defaultMessage="删除" />
|
||||||
</Button>,
|
</Button>,
|
||||||
<Button
|
|
||||||
type="primary"
|
|
||||||
key="clean"
|
|
||||||
danger
|
|
||||||
hidden={!access.hasPerms('system:operlog:remove')}
|
|
||||||
onClick={async () => {
|
|
||||||
Modal.confirm({
|
|
||||||
title: '是否确认清空所有数据项?',
|
|
||||||
icon: <ExclamationCircleOutlined />,
|
|
||||||
content: '请谨慎操作',
|
|
||||||
async onOk() {
|
|
||||||
const success = await handleCleanAll();
|
|
||||||
if (success) {
|
|
||||||
setSelectedRows([]);
|
|
||||||
actionRef.current?.reloadAndRest?.();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onCancel() { },
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<DeleteOutlined />
|
|
||||||
<FormattedMessage id="pages.searchTable.cleanAll" defaultMessage="清空" />
|
|
||||||
</Button>,
|
|
||||||
<Button
|
<Button
|
||||||
type="primary"
|
type="primary"
|
||||||
key="export"
|
key="export"
|
||||||
hidden={!access.hasPerms('system:operlog:export')}
|
hidden={!access.hasPerms('system:dictType:export')}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
handleExport();
|
handleExport();
|
||||||
}}
|
}}
|
||||||
@@ -327,7 +312,7 @@ const OperlogTableList: React.FC = () => {
|
|||||||
</Button>,
|
</Button>,
|
||||||
]}
|
]}
|
||||||
request={(params) =>
|
request={(params) =>
|
||||||
getOperlogList({ ...params } as API.Monitor.OperlogListParams).then((res) => {
|
getDictTypeList({ ...params } as API.System.DictTypeListParams).then((res) => {
|
||||||
const result = {
|
const result = {
|
||||||
data: res.rows,
|
data: res.rows,
|
||||||
total: res.total,
|
total: res.total,
|
||||||
@@ -357,7 +342,7 @@ const OperlogTableList: React.FC = () => {
|
|||||||
<Button
|
<Button
|
||||||
key="remove"
|
key="remove"
|
||||||
danger
|
danger
|
||||||
hidden={!access.hasPerms('system:operlog:del')}
|
hidden={!access.hasPerms('system:dictType:del')}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: '删除',
|
title: '删除',
|
||||||
@@ -381,10 +366,10 @@ const OperlogTableList: React.FC = () => {
|
|||||||
<UpdateForm
|
<UpdateForm
|
||||||
onSubmit={async (values) => {
|
onSubmit={async (values) => {
|
||||||
let success = false;
|
let success = false;
|
||||||
if (values.operId) {
|
if (values.dictId) {
|
||||||
success = await handleUpdate({ ...values } as API.Monitor.Operlog);
|
success = await handleUpdate({ ...values } as API.System.DictType);
|
||||||
} else {
|
} else {
|
||||||
success = await handleAdd({ ...values } as API.Monitor.Operlog);
|
success = await handleAdd({ ...values } as API.System.DictType);
|
||||||
}
|
}
|
||||||
if (success) {
|
if (success) {
|
||||||
setModalVisible(false);
|
setModalVisible(false);
|
||||||
@@ -400,12 +385,10 @@ const OperlogTableList: React.FC = () => {
|
|||||||
}}
|
}}
|
||||||
open={modalVisible}
|
open={modalVisible}
|
||||||
values={currentRow || {}}
|
values={currentRow || {}}
|
||||||
businessTypeOptions={businessTypeOptions}
|
|
||||||
operatorTypeOptions={operatorTypeOptions}
|
|
||||||
statusOptions={statusOptions}
|
statusOptions={statusOptions}
|
||||||
/>
|
/>
|
||||||
</PageContainer>
|
</PageContainer>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default OperlogTableList;
|
export default DictTableList;
|
||||||
252
src/pages/System/AdminDictData/edit.tsx
Normal file
252
src/pages/System/AdminDictData/edit.tsx
Normal file
@@ -0,0 +1,252 @@
|
|||||||
|
import React, { useEffect } from 'react';
|
||||||
|
import {
|
||||||
|
ProForm,
|
||||||
|
ProFormDigit,
|
||||||
|
ProFormText,
|
||||||
|
ProFormSelect,
|
||||||
|
ProFormRadio,
|
||||||
|
ProFormTextArea,
|
||||||
|
} from '@ant-design/pro-components';
|
||||||
|
import { Form, Modal} from 'antd';
|
||||||
|
import { useIntl, FormattedMessage } from '@umijs/max';
|
||||||
|
import { DictValueEnumObj } from '@/components/DictTag';
|
||||||
|
|
||||||
|
export type DataFormData = Record<string, unknown> & Partial<API.System.DictData>;
|
||||||
|
|
||||||
|
export type DataFormProps = {
|
||||||
|
onCancel: (flag?: boolean, formVals?: DataFormData) => void;
|
||||||
|
onSubmit: (values: DataFormData) => Promise<void>;
|
||||||
|
open: boolean;
|
||||||
|
values: Partial<API.System.DictData>;
|
||||||
|
statusOptions: DictValueEnumObj;
|
||||||
|
};
|
||||||
|
|
||||||
|
const DictDataForm: React.FC<DataFormProps> = (props) => {
|
||||||
|
const [form] = Form.useForm();
|
||||||
|
|
||||||
|
const { statusOptions } = props;
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
form.resetFields();
|
||||||
|
form.setFieldsValue({
|
||||||
|
dictCode: props.values.dictCode,
|
||||||
|
dictSort: props.values.dictSort,
|
||||||
|
dictLabel: props.values.dictLabel,
|
||||||
|
dictValue: props.values.dictValue,
|
||||||
|
dictType: props.values.dictType,
|
||||||
|
cssClass: props.values.cssClass,
|
||||||
|
listClass: props.values.listClass,
|
||||||
|
isDefault: props.values.isDefault,
|
||||||
|
status: props.values.status,
|
||||||
|
createBy: props.values.createBy,
|
||||||
|
createTime: props.values.createTime,
|
||||||
|
updateBy: props.values.updateBy,
|
||||||
|
updateTime: props.values.updateTime,
|
||||||
|
remark: props.values.remark,
|
||||||
|
});
|
||||||
|
}, [form, props]);
|
||||||
|
|
||||||
|
const intl = useIntl();
|
||||||
|
const handleOk = () => {
|
||||||
|
form.submit();
|
||||||
|
};
|
||||||
|
const handleCancel = () => {
|
||||||
|
props.onCancel();
|
||||||
|
};
|
||||||
|
const handleFinish = async (values: Record<string, any>) => {
|
||||||
|
props.onSubmit(values as DataFormData);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
width={640}
|
||||||
|
title={intl.formatMessage({
|
||||||
|
id: 'system.dict.data.title',
|
||||||
|
defaultMessage: '编辑字典数据',
|
||||||
|
})}
|
||||||
|
open={props.open}
|
||||||
|
forceRender
|
||||||
|
destroyOnClose
|
||||||
|
onOk={handleOk}
|
||||||
|
onCancel={handleCancel}
|
||||||
|
>
|
||||||
|
<ProForm
|
||||||
|
form={form}
|
||||||
|
grid={true}
|
||||||
|
submitter={false}
|
||||||
|
layout="horizontal"
|
||||||
|
onFinish={handleFinish}>
|
||||||
|
<ProFormDigit
|
||||||
|
name="dictCode"
|
||||||
|
label={intl.formatMessage({
|
||||||
|
id: 'system.dict.data.dict_code',
|
||||||
|
defaultMessage: '字典编码',
|
||||||
|
})}
|
||||||
|
colProps={{ md: 24, xl: 24 }}
|
||||||
|
placeholder="请输入字典编码"
|
||||||
|
disabled
|
||||||
|
hidden={true}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: false,
|
||||||
|
message: <FormattedMessage id="请输入字典编码!" defaultMessage="请输入字典编码!" />,
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
<ProFormText
|
||||||
|
name="dictType"
|
||||||
|
label={intl.formatMessage({
|
||||||
|
id: 'system.dict.data.dict_type',
|
||||||
|
defaultMessage: '字典类型',
|
||||||
|
})}
|
||||||
|
colProps={{ md: 12, xl: 24 }}
|
||||||
|
placeholder="请输入字典类型"
|
||||||
|
disabled
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: false,
|
||||||
|
message: <FormattedMessage id="请输入字典类型!" defaultMessage="请输入字典类型!" />,
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
<ProFormText
|
||||||
|
name="dictLabel"
|
||||||
|
label={intl.formatMessage({
|
||||||
|
id: 'system.dict.data.dict_label',
|
||||||
|
defaultMessage: '字典标签',
|
||||||
|
})}
|
||||||
|
colProps={{ md: 12, xl: 24 }}
|
||||||
|
placeholder="请输入字典标签"
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: false,
|
||||||
|
message: <FormattedMessage id="请输入字典标签!" defaultMessage="请输入字典标签!" />,
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
<ProFormText
|
||||||
|
name="dictValue"
|
||||||
|
label={intl.formatMessage({
|
||||||
|
id: 'system.dict.data.dict_value',
|
||||||
|
defaultMessage: '字典键值',
|
||||||
|
})}
|
||||||
|
colProps={{ md: 12, xl: 24 }}
|
||||||
|
placeholder="请输入字典键值"
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: false,
|
||||||
|
message: <FormattedMessage id="请输入字典键值!" defaultMessage="请输入字典键值!" />,
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
<ProFormText
|
||||||
|
name="cssClass"
|
||||||
|
label={intl.formatMessage({
|
||||||
|
id: 'system.dict.data.css_class',
|
||||||
|
defaultMessage: '样式属性',
|
||||||
|
})}
|
||||||
|
colProps={{ md: 12, xl: 24 }}
|
||||||
|
placeholder="请输入样式属性"
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: false,
|
||||||
|
message: <FormattedMessage id="请输入样式属性!" defaultMessage="请输入样式属性!" />,
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
<ProFormSelect
|
||||||
|
name="listClass"
|
||||||
|
label={intl.formatMessage({
|
||||||
|
id: 'system.dict.data.list_class',
|
||||||
|
defaultMessage: '回显样式',
|
||||||
|
})}
|
||||||
|
colProps={{ md: 12, xl: 24 }}
|
||||||
|
placeholder="请输入回显样式"
|
||||||
|
valueEnum={{
|
||||||
|
'default': '默认',
|
||||||
|
'primary': '主要',
|
||||||
|
'success': '成功',
|
||||||
|
'info': '信息',
|
||||||
|
'warning': '警告',
|
||||||
|
'danger': '危险',
|
||||||
|
}}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: false,
|
||||||
|
message: <FormattedMessage id="请输入回显样式!" defaultMessage="请输入回显样式!" />,
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
<ProFormDigit
|
||||||
|
name="dictSort"
|
||||||
|
label={intl.formatMessage({
|
||||||
|
id: 'system.dict.data.dict_sort',
|
||||||
|
defaultMessage: '字典排序',
|
||||||
|
})}
|
||||||
|
colProps={{ md: 12, xl: 12 }}
|
||||||
|
placeholder="请输入字典排序"
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: false,
|
||||||
|
message: <FormattedMessage id="请输入字典排序!" defaultMessage="请输入字典排序!" />,
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
<ProFormRadio.Group
|
||||||
|
name="isDefault"
|
||||||
|
label={intl.formatMessage({
|
||||||
|
id: 'system.dict.data.is_default',
|
||||||
|
defaultMessage: '是否默认',
|
||||||
|
})}
|
||||||
|
valueEnum={{
|
||||||
|
'Y': '是',
|
||||||
|
'N': '否',
|
||||||
|
}}
|
||||||
|
initialValue={'N'}
|
||||||
|
colProps={{ md: 12, xl: 24 }}
|
||||||
|
placeholder="请输入是否默认"
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: false,
|
||||||
|
message: <FormattedMessage id="请输入是否默认!" defaultMessage="请输入是否默认!" />,
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
<ProFormRadio.Group
|
||||||
|
valueEnum={statusOptions}
|
||||||
|
name="status"
|
||||||
|
label={intl.formatMessage({
|
||||||
|
id: 'system.dict.data.status',
|
||||||
|
defaultMessage: '状态',
|
||||||
|
})}
|
||||||
|
initialValue={'0'}
|
||||||
|
colProps={{ md: 12, xl: 24 }}
|
||||||
|
placeholder="请输入状态"
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: false,
|
||||||
|
message: <FormattedMessage id="请输入状态!" defaultMessage="请输入状态!" />,
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
<ProFormTextArea
|
||||||
|
name="remark"
|
||||||
|
label={intl.formatMessage({
|
||||||
|
id: 'system.dict.data.remark',
|
||||||
|
defaultMessage: '备注',
|
||||||
|
})}
|
||||||
|
colProps={{ md: 24, xl: 24 }}
|
||||||
|
placeholder="请输入备注"
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: false,
|
||||||
|
message: <FormattedMessage id="请输入备注!" defaultMessage="请输入备注!" />,
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</ProForm>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default DictDataForm;
|
||||||
439
src/pages/System/AdminDictData/index.tsx
Normal file
439
src/pages/System/AdminDictData/index.tsx
Normal file
@@ -0,0 +1,439 @@
|
|||||||
|
|
||||||
|
import React, { useState, useRef, useEffect } from 'react';
|
||||||
|
import { useIntl, FormattedMessage, useAccess, history, useParams } from '@umijs/max';
|
||||||
|
import type { FormInstance } from 'antd';
|
||||||
|
import { Button, message, Modal } from 'antd';
|
||||||
|
import { ActionType, FooterToolbar, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
|
||||||
|
import { PlusOutlined, DeleteOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
|
||||||
|
import { getDictDataList, removeDictData, addDictData, updateDictData, exportDictData } from '@/services/system/admindicdata';
|
||||||
|
import UpdateForm from './edit';
|
||||||
|
import { getDictValueEnum, getDictType, getDictTypeOptionSelect } from '@/services/system/admindict';
|
||||||
|
import DictTag from '@/components/DictTag';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加节点
|
||||||
|
*
|
||||||
|
* @param fields
|
||||||
|
*/
|
||||||
|
const handleAdd = async (fields: API.System.DictData) => {
|
||||||
|
const hide = message.loading('正在添加');
|
||||||
|
try {
|
||||||
|
const resp = await addDictData({ ...fields });
|
||||||
|
hide();
|
||||||
|
if (resp.code === 200) {
|
||||||
|
message.success('添加成功');
|
||||||
|
} else {
|
||||||
|
message.error(resp.msg);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} catch (error) {
|
||||||
|
hide();
|
||||||
|
message.error('添加失败请重试!');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新节点
|
||||||
|
*
|
||||||
|
* @param fields
|
||||||
|
*/
|
||||||
|
const handleUpdate = async (fields: API.System.DictData) => {
|
||||||
|
const hide = message.loading('正在更新');
|
||||||
|
try {
|
||||||
|
const resp = await updateDictData(fields);
|
||||||
|
hide();
|
||||||
|
if (resp.code === 200) {
|
||||||
|
message.success('更新成功');
|
||||||
|
} else {
|
||||||
|
message.error(resp.msg);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} catch (error) {
|
||||||
|
hide();
|
||||||
|
message.error('配置失败请重试!');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除节点
|
||||||
|
*
|
||||||
|
* @param selectedRows
|
||||||
|
*/
|
||||||
|
const handleRemove = async (selectedRows: API.System.DictData[]) => {
|
||||||
|
const hide = message.loading('正在删除');
|
||||||
|
if (!selectedRows) return true;
|
||||||
|
try {
|
||||||
|
const resp = await removeDictData(selectedRows.map((row) => row.dictCode).join(','));
|
||||||
|
hide();
|
||||||
|
if (resp.code === 200) {
|
||||||
|
message.success('删除成功,即将刷新');
|
||||||
|
} else {
|
||||||
|
message.error(resp.msg);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} catch (error) {
|
||||||
|
hide();
|
||||||
|
message.error('删除失败,请重试');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleRemoveOne = async (selectedRow: API.System.DictData) => {
|
||||||
|
const hide = message.loading('正在删除');
|
||||||
|
if (!selectedRow) return true;
|
||||||
|
try {
|
||||||
|
const params = [selectedRow.dictCode];
|
||||||
|
const resp = await removeDictData(params.join(','));
|
||||||
|
hide();
|
||||||
|
if (resp.code === 200) {
|
||||||
|
message.success('删除成功,即将刷新');
|
||||||
|
} else {
|
||||||
|
message.error(resp.msg);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} catch (error) {
|
||||||
|
hide();
|
||||||
|
message.error('删除失败,请重试');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出数据
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
const handleExport = async () => {
|
||||||
|
const hide = message.loading('正在导出');
|
||||||
|
try {
|
||||||
|
await exportDictData();
|
||||||
|
hide();
|
||||||
|
message.success('导出成功');
|
||||||
|
return true;
|
||||||
|
} catch (error) {
|
||||||
|
hide();
|
||||||
|
message.error('导出失败,请重试');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export type DictTypeArgs = {
|
||||||
|
id: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const DictDataTableList: React.FC = () => {
|
||||||
|
|
||||||
|
const formTableRef = useRef<FormInstance>();
|
||||||
|
|
||||||
|
const [dictId, setDictId] = useState<string>('');
|
||||||
|
const [dictType, setDictType] = useState<string>('');
|
||||||
|
|
||||||
|
const [modalVisible, setModalVisible] = useState<boolean>(false);
|
||||||
|
|
||||||
|
const actionRef = useRef<ActionType>();
|
||||||
|
const [currentRow, setCurrentRow] = useState<API.System.DictData>();
|
||||||
|
const [selectedRows, setSelectedRows] = useState<API.System.DictData[]>([]);
|
||||||
|
|
||||||
|
const [dictTypeOptions, setDictTypeOptions] = useState<any>([]);
|
||||||
|
const [statusOptions, setStatusOptions] = useState<any>([]);
|
||||||
|
|
||||||
|
const access = useAccess();
|
||||||
|
|
||||||
|
/** 国际化配置 */
|
||||||
|
const intl = useIntl();
|
||||||
|
|
||||||
|
const params = useParams();
|
||||||
|
if (params.id === undefined) {
|
||||||
|
history.push('/system/dict');
|
||||||
|
}
|
||||||
|
const id = params.id || '0';
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (dictId !== id) {
|
||||||
|
setDictId(id);
|
||||||
|
getDictTypeOptionSelect().then((res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
const opts: any = {};
|
||||||
|
res.data.forEach((item: any) => {
|
||||||
|
opts[item.dictType] = item.dictName;
|
||||||
|
});
|
||||||
|
setDictTypeOptions(opts);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
getDictValueEnum('sys_normal_disable').then((data) => {
|
||||||
|
setStatusOptions(data);
|
||||||
|
});
|
||||||
|
getDictType(id).then((res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
setDictType(res.data.dictType);
|
||||||
|
formTableRef.current?.setFieldsValue({
|
||||||
|
dictType: res.data.dictType,
|
||||||
|
});
|
||||||
|
actionRef.current?.reloadAndRest?.();
|
||||||
|
} else {
|
||||||
|
message.error(res.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, [dictId, dictType, params]);
|
||||||
|
|
||||||
|
const columns: ProColumns<API.System.DictData>[] = [
|
||||||
|
{
|
||||||
|
title: <FormattedMessage id="system.dict.data.dict_code" defaultMessage="字典编码" />,
|
||||||
|
dataIndex: 'dictCode',
|
||||||
|
valueType: 'text',
|
||||||
|
hideInSearch: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: <FormattedMessage id="system.dict.data.dict_label" defaultMessage="字典标签" />,
|
||||||
|
dataIndex: 'dictLabel',
|
||||||
|
valueType: 'text',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: <FormattedMessage id="system.dict.data.dict_type" defaultMessage="字典类型" />,
|
||||||
|
dataIndex: 'dictType',
|
||||||
|
valueType: 'select',
|
||||||
|
hideInTable: true,
|
||||||
|
valueEnum: dictTypeOptions,
|
||||||
|
search: {
|
||||||
|
transform: (value) => {
|
||||||
|
setDictType(value);
|
||||||
|
return value;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: <FormattedMessage id="system.dict.data.dict_value" defaultMessage="字典键值" />,
|
||||||
|
dataIndex: 'dictValue',
|
||||||
|
valueType: 'text',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: <FormattedMessage id="system.dict.data.dict_sort" defaultMessage="字典排序" />,
|
||||||
|
dataIndex: 'dictSort',
|
||||||
|
valueType: 'text',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: <FormattedMessage id="system.dict.data.status" defaultMessage="状态" />,
|
||||||
|
dataIndex: 'status',
|
||||||
|
valueType: 'select',
|
||||||
|
valueEnum: statusOptions,
|
||||||
|
render: (_, record) => {
|
||||||
|
return (<DictTag enums={statusOptions} value={record.status} />);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: <FormattedMessage id="system.dict.data.remark" defaultMessage="备注" />,
|
||||||
|
dataIndex: 'remark',
|
||||||
|
valueType: 'textarea',
|
||||||
|
hideInSearch: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: <FormattedMessage id="system.dict.data.create_time" defaultMessage="创建时间" />,
|
||||||
|
dataIndex: 'createTime',
|
||||||
|
valueType: 'dateRange',
|
||||||
|
render: (_, record) => {
|
||||||
|
return (<span>{record.createTime.toString()} </span>);
|
||||||
|
},
|
||||||
|
search: {
|
||||||
|
transform: (value) => {
|
||||||
|
return {
|
||||||
|
'params[beginTime]': value[0],
|
||||||
|
'params[endTime]': value[1],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: <FormattedMessage id="pages.searchTable.titleOption" defaultMessage="操作" />,
|
||||||
|
dataIndex: 'option',
|
||||||
|
width: '120px',
|
||||||
|
valueType: 'option',
|
||||||
|
render: (_, record) => [
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
size="small"
|
||||||
|
key="edit"
|
||||||
|
hidden={!access.hasPerms('system:data:edit.tsx')}
|
||||||
|
onClick={() => {
|
||||||
|
setModalVisible(true);
|
||||||
|
setCurrentRow(record);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</Button>,
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
size="small"
|
||||||
|
danger
|
||||||
|
key="batchRemove"
|
||||||
|
hidden={!access.hasPerms('system:data:remove')}
|
||||||
|
onClick={async () => {
|
||||||
|
Modal.confirm({
|
||||||
|
title: '删除',
|
||||||
|
content: '确定删除该项吗?',
|
||||||
|
okText: '确认',
|
||||||
|
cancelText: '取消',
|
||||||
|
onOk: async () => {
|
||||||
|
const success = await handleRemoveOne(record);
|
||||||
|
if (success) {
|
||||||
|
if (actionRef.current) {
|
||||||
|
actionRef.current.reload();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</Button>,
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<PageContainer>
|
||||||
|
<div style={{ width: '100%', float: 'right' }}>
|
||||||
|
<ProTable<API.System.DictData>
|
||||||
|
headerTitle={intl.formatMessage({
|
||||||
|
id: 'pages.searchTable.title',
|
||||||
|
defaultMessage: '信息',
|
||||||
|
})}
|
||||||
|
actionRef={actionRef}
|
||||||
|
formRef={formTableRef}
|
||||||
|
rowKey="dictCode"
|
||||||
|
key="dataList"
|
||||||
|
search={{
|
||||||
|
labelWidth: 120,
|
||||||
|
}}
|
||||||
|
toolBarRender={() => [
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
key="add"
|
||||||
|
hidden={!access.hasPerms('system:data:add')}
|
||||||
|
onClick={async () => {
|
||||||
|
setCurrentRow({ dictType: dictType, isDefault: 'N', status: '0' } as API.System.DictData);
|
||||||
|
setModalVisible(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<PlusOutlined /> <FormattedMessage id="pages.searchTable.new" defaultMessage="新建" />
|
||||||
|
</Button>,
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
key="remove"
|
||||||
|
danger
|
||||||
|
hidden={selectedRows?.length === 0 || !access.hasPerms('system:data:remove')}
|
||||||
|
onClick={async () => {
|
||||||
|
Modal.confirm({
|
||||||
|
title: '是否确认删除所选数据项?',
|
||||||
|
icon: <ExclamationCircleOutlined />,
|
||||||
|
content: '请谨慎操作',
|
||||||
|
async onOk() {
|
||||||
|
const success = await handleRemove(selectedRows);
|
||||||
|
if (success) {
|
||||||
|
setSelectedRows([]);
|
||||||
|
actionRef.current?.reloadAndRest?.();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onCancel() { },
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<DeleteOutlined />
|
||||||
|
<FormattedMessage id="pages.searchTable.delete" defaultMessage="删除" />
|
||||||
|
</Button>,
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
key="export"
|
||||||
|
hidden={!access.hasPerms('system:data:export')}
|
||||||
|
onClick={async () => {
|
||||||
|
handleExport();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<PlusOutlined />
|
||||||
|
<FormattedMessage id="pages.searchTable.export" defaultMessage="导出" />
|
||||||
|
</Button>,
|
||||||
|
]}
|
||||||
|
request={(params) =>
|
||||||
|
getDictDataList({ ...params, dictType } as API.System.DictDataListParams).then((res) => {
|
||||||
|
const result = {
|
||||||
|
data: res.rows,
|
||||||
|
total: res.total,
|
||||||
|
success: true,
|
||||||
|
};
|
||||||
|
return result;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
columns={columns}
|
||||||
|
rowSelection={{
|
||||||
|
onChange: (_, selectedRows) => {
|
||||||
|
setSelectedRows(selectedRows);
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
{selectedRows?.length > 0 && (
|
||||||
|
<FooterToolbar
|
||||||
|
extra={
|
||||||
|
<div>
|
||||||
|
<FormattedMessage id="pages.searchTable.chosen" defaultMessage="已选择" />
|
||||||
|
<a style={{ fontWeight: 600 }}>{selectedRows.length}</a>
|
||||||
|
<FormattedMessage id="pages.searchTable.item" defaultMessage="项" />
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<Button
|
||||||
|
key="remove"
|
||||||
|
danger
|
||||||
|
hidden={!access.hasPerms('system:data:del')}
|
||||||
|
onClick={async () => {
|
||||||
|
Modal.confirm({
|
||||||
|
title: '删除',
|
||||||
|
content: '确定删除该项吗?',
|
||||||
|
okText: '确认',
|
||||||
|
cancelText: '取消',
|
||||||
|
onOk: async () => {
|
||||||
|
const success = await handleRemove(selectedRows);
|
||||||
|
if (success) {
|
||||||
|
setSelectedRows([]);
|
||||||
|
actionRef.current?.reloadAndRest?.();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<FormattedMessage id="pages.searchTable.batchDeletion" defaultMessage="批量删除" />
|
||||||
|
</Button>
|
||||||
|
</FooterToolbar>
|
||||||
|
)}
|
||||||
|
<UpdateForm
|
||||||
|
onSubmit={async (values) => {
|
||||||
|
let success = false;
|
||||||
|
if (values.dictCode) {
|
||||||
|
success = await handleUpdate({ ...values } as API.System.DictData);
|
||||||
|
} else {
|
||||||
|
success = await handleAdd({ ...values } as API.System.DictData);
|
||||||
|
}
|
||||||
|
if (success) {
|
||||||
|
setModalVisible(false);
|
||||||
|
setCurrentRow(undefined);
|
||||||
|
if (actionRef.current) {
|
||||||
|
actionRef.current.reload();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onCancel={() => {
|
||||||
|
setModalVisible(false);
|
||||||
|
setCurrentRow(undefined);
|
||||||
|
}}
|
||||||
|
open={modalVisible}
|
||||||
|
values={currentRow || {}}
|
||||||
|
statusOptions={statusOptions}
|
||||||
|
/>
|
||||||
|
</PageContainer>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default DictDataTableList;
|
||||||
@@ -202,7 +202,7 @@ const ConfigTableList: React.FC = () => {
|
|||||||
type="link"
|
type="link"
|
||||||
size="small"
|
size="small"
|
||||||
key="edit"
|
key="edit"
|
||||||
hidden={!access.hasPerms('system:config:edit')}
|
hidden={!access.hasPerms('system:config:edit.tsx')}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setModalVisible(true);
|
setModalVisible(true);
|
||||||
setCurrentRow(record);
|
setCurrentRow(record);
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ const DeptTableList: React.FC = () => {
|
|||||||
type="link"
|
type="link"
|
||||||
size="small"
|
size="small"
|
||||||
key="edit"
|
key="edit"
|
||||||
hidden={!access.hasPerms('system:dept:edit')}
|
hidden={!access.hasPerms('system:dept:edit.tsx')}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
getDeptListExcludeChild(record.deptId).then((res) => {
|
getDeptListExcludeChild(record.deptId).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ const DictTableList: React.FC = () => {
|
|||||||
type="link"
|
type="link"
|
||||||
size="small"
|
size="small"
|
||||||
key="edit"
|
key="edit"
|
||||||
hidden={!access.hasPerms('system:dictType:edit')}
|
hidden={!access.hasPerms('system:dictType:edit.tsx')}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setModalVisible(true);
|
setModalVisible(true);
|
||||||
setCurrentRow(record);
|
setCurrentRow(record);
|
||||||
|
|||||||
@@ -256,7 +256,7 @@ const DictDataTableList: React.FC = () => {
|
|||||||
type="link"
|
type="link"
|
||||||
size="small"
|
size="small"
|
||||||
key="edit"
|
key="edit"
|
||||||
hidden={!access.hasPerms('system:data:edit')}
|
hidden={!access.hasPerms('system:data:edit.tsx')}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setModalVisible(true);
|
setModalVisible(true);
|
||||||
setCurrentRow(record);
|
setCurrentRow(record);
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ import DictTag from '@/components/DictTag';
|
|||||||
const handleAdd = async (fields: API.System.Menu) => {
|
const handleAdd = async (fields: API.System.Menu) => {
|
||||||
const hide = message.loading('正在添加');
|
const hide = message.loading('正在添加');
|
||||||
try {
|
try {
|
||||||
await addMenu({ ...fields });
|
const resData = await addMenu({ ...fields });
|
||||||
hide();
|
hide();
|
||||||
message.success('添加成功');
|
message.success(resData.msg || '添加成功');
|
||||||
return true;
|
return true;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
hide();
|
hide();
|
||||||
@@ -38,9 +38,9 @@ const handleAdd = async (fields: API.System.Menu) => {
|
|||||||
const handleUpdate = async (fields: API.System.Menu) => {
|
const handleUpdate = async (fields: API.System.Menu) => {
|
||||||
const hide = message.loading('正在配置');
|
const hide = message.loading('正在配置');
|
||||||
try {
|
try {
|
||||||
await updateMenu(fields);
|
const resData = await updateMenu(fields);
|
||||||
hide();
|
hide();
|
||||||
message.success('配置成功');
|
message.success(resData.msg || '配置成功');
|
||||||
return true;
|
return true;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
hide();
|
hide();
|
||||||
@@ -58,9 +58,9 @@ const handleRemove = async (selectedRows: API.System.Menu[]) => {
|
|||||||
const hide = message.loading('正在删除');
|
const hide = message.loading('正在删除');
|
||||||
if (!selectedRows) return true;
|
if (!selectedRows) return true;
|
||||||
try {
|
try {
|
||||||
await removeMenu(selectedRows.map((row) => row.menuId).join(','));
|
const resData = await removeMenu(selectedRows.map((row) => row.menuId).join(','));
|
||||||
hide();
|
hide();
|
||||||
message.success('删除成功,即将刷新');
|
message.success(resData.msg || '删除成功,即将刷新');
|
||||||
return true;
|
return true;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
hide();
|
hide();
|
||||||
@@ -74,9 +74,9 @@ const handleRemoveOne = async (selectedRow: API.System.Menu) => {
|
|||||||
if (!selectedRow) return true;
|
if (!selectedRow) return true;
|
||||||
try {
|
try {
|
||||||
const params = [selectedRow.menuId];
|
const params = [selectedRow.menuId];
|
||||||
await removeMenu(params.join(','));
|
const resData = await removeMenu(params.join(','));
|
||||||
hide();
|
hide();
|
||||||
message.success('删除成功,即将刷新');
|
message.success(resData.msg || '删除成功,即将刷新');
|
||||||
return true;
|
return true;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
hide();
|
hide();
|
||||||
@@ -161,7 +161,7 @@ const MenuTableList: React.FC = () => {
|
|||||||
type="link"
|
type="link"
|
||||||
size="small"
|
size="small"
|
||||||
key="edit"
|
key="edit"
|
||||||
hidden={!access.hasPerms('system:menu:edit')}
|
hidden={!access.hasPerms('system:menu:edit.tsx')}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setModalVisible(true);
|
setModalVisible(true);
|
||||||
setCurrentRow(record);
|
setCurrentRow(record);
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ const NoticeTableList: React.FC = () => {
|
|||||||
type="link"
|
type="link"
|
||||||
size="small"
|
size="small"
|
||||||
key="edit"
|
key="edit"
|
||||||
hidden={!access.hasPerms('system:notice:edit')}
|
hidden={!access.hasPerms('system:notice:edit.tsx')}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setModalVisible(true);
|
setModalVisible(true);
|
||||||
setCurrentRow(record);
|
setCurrentRow(record);
|
||||||
|
|||||||
@@ -1,115 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
import { Descriptions, Modal } from 'antd';
|
|
||||||
import { useIntl, FormattedMessage } from '@umijs/max';
|
|
||||||
import { DictValueEnumObj } from '@/components/DictTag';
|
|
||||||
import { getValueEnumLabel } from '@/utils/options';
|
|
||||||
|
|
||||||
export type OperlogFormData = Record<string, unknown> & Partial<API.Monitor.Operlog>;
|
|
||||||
|
|
||||||
export type OperlogFormProps = {
|
|
||||||
onCancel: (flag?: boolean, formVals?: OperlogFormData) => void;
|
|
||||||
onSubmit: (values: OperlogFormData) => Promise<void>;
|
|
||||||
open: boolean;
|
|
||||||
values: Partial<API.Monitor.Operlog>;
|
|
||||||
businessTypeOptions: DictValueEnumObj;
|
|
||||||
operatorTypeOptions: DictValueEnumObj;
|
|
||||||
statusOptions: DictValueEnumObj;
|
|
||||||
};
|
|
||||||
|
|
||||||
const OperlogDetailForm: React.FC<OperlogFormProps> = (props) => {
|
|
||||||
|
|
||||||
const { values, businessTypeOptions, operatorTypeOptions, statusOptions, } = props;
|
|
||||||
|
|
||||||
const intl = useIntl();
|
|
||||||
const handleOk = () => {
|
|
||||||
console.log("handle ok");
|
|
||||||
};
|
|
||||||
const handleCancel = () => {
|
|
||||||
props.onCancel();
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Modal
|
|
||||||
width={640}
|
|
||||||
title={intl.formatMessage({
|
|
||||||
id: 'monitor.operlog.title',
|
|
||||||
defaultMessage: '编辑操作日志记录',
|
|
||||||
})}
|
|
||||||
open={props.open}
|
|
||||||
destroyOnClose
|
|
||||||
onOk={handleOk}
|
|
||||||
onCancel={handleCancel}
|
|
||||||
>
|
|
||||||
<Descriptions column={24}>
|
|
||||||
<Descriptions.Item
|
|
||||||
span={12}
|
|
||||||
label={<FormattedMessage id="monitor.operlog.module" defaultMessage="操作模块" />}
|
|
||||||
>
|
|
||||||
{`${values.title}/${getValueEnumLabel(businessTypeOptions, values.businessType)}`}
|
|
||||||
</Descriptions.Item>
|
|
||||||
<Descriptions.Item
|
|
||||||
span={12}
|
|
||||||
label={<FormattedMessage id="monitor.operlog.request_method" defaultMessage="请求方式" />}
|
|
||||||
>
|
|
||||||
{values.requestMethod}
|
|
||||||
</Descriptions.Item>
|
|
||||||
<Descriptions.Item
|
|
||||||
span={12}
|
|
||||||
label={<FormattedMessage id="monitor.operlog.oper_name" defaultMessage="操作人员" />}
|
|
||||||
>
|
|
||||||
{`${values.operName}/${values.operIp}`}
|
|
||||||
</Descriptions.Item>
|
|
||||||
<Descriptions.Item
|
|
||||||
span={12}
|
|
||||||
label={<FormattedMessage id="monitor.operlog.operator_type" defaultMessage="操作类别" />}
|
|
||||||
>
|
|
||||||
{getValueEnumLabel(operatorTypeOptions, values.operatorType)}
|
|
||||||
</Descriptions.Item>
|
|
||||||
<Descriptions.Item
|
|
||||||
span={24}
|
|
||||||
label={<FormattedMessage id="monitor.operlog.method" defaultMessage="方法名称" />}
|
|
||||||
>
|
|
||||||
{values.method}
|
|
||||||
</Descriptions.Item>
|
|
||||||
<Descriptions.Item
|
|
||||||
span={24}
|
|
||||||
label={<FormattedMessage id="monitor.operlog.oper_url" defaultMessage="请求URL" />}
|
|
||||||
>
|
|
||||||
{values.operUrl}
|
|
||||||
</Descriptions.Item>
|
|
||||||
<Descriptions.Item
|
|
||||||
span={24}
|
|
||||||
label={<FormattedMessage id="monitor.operlog.oper_param" defaultMessage="请求参数" />}
|
|
||||||
>
|
|
||||||
{values.operParam}
|
|
||||||
</Descriptions.Item>
|
|
||||||
<Descriptions.Item
|
|
||||||
span={24}
|
|
||||||
label={<FormattedMessage id="monitor.operlog.json_result" defaultMessage="返回参数" />}
|
|
||||||
>
|
|
||||||
{values.jsonResult}
|
|
||||||
</Descriptions.Item>
|
|
||||||
<Descriptions.Item
|
|
||||||
span={24}
|
|
||||||
label={<FormattedMessage id="monitor.operlog.error_msg" defaultMessage="错误消息" />}
|
|
||||||
>
|
|
||||||
{values.errorMsg}
|
|
||||||
</Descriptions.Item>
|
|
||||||
<Descriptions.Item
|
|
||||||
span={12}
|
|
||||||
label={<FormattedMessage id="monitor.operlog.status" defaultMessage="操作状态" />}
|
|
||||||
>
|
|
||||||
{getValueEnumLabel(statusOptions, values.status)}
|
|
||||||
</Descriptions.Item>
|
|
||||||
<Descriptions.Item
|
|
||||||
span={12}
|
|
||||||
label={<FormattedMessage id="monitor.operlog.oper_time" defaultMessage="操作时间" />}
|
|
||||||
>
|
|
||||||
{values.operTime?.toString()}
|
|
||||||
</Descriptions.Item>
|
|
||||||
</Descriptions>
|
|
||||||
</Modal>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default OperlogDetailForm;
|
|
||||||
@@ -183,7 +183,7 @@ const PostTableList: React.FC = () => {
|
|||||||
type="link"
|
type="link"
|
||||||
size="small"
|
size="small"
|
||||||
key="edit"
|
key="edit"
|
||||||
hidden={!access.hasPerms('system:post:edit')}
|
hidden={!access.hasPerms('system:post:edit.tsx')}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setModalVisible(true);
|
setModalVisible(true);
|
||||||
setCurrentRow(record);
|
setCurrentRow(record);
|
||||||
|
|||||||
@@ -241,7 +241,7 @@ const RoleTableList: React.FC = () => {
|
|||||||
size="small"
|
size="small"
|
||||||
key="edit"
|
key="edit"
|
||||||
icon=<EditOutlined />
|
icon=<EditOutlined />
|
||||||
hidden={!access.hasPerms('system:role:edit')}
|
hidden={!access.hasPerms('system:role:edit.tsx')}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
getRoleMenuList(record.roleId).then((res) => {
|
getRoleMenuList(record.roleId).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
@@ -293,12 +293,12 @@ const RoleTableList: React.FC = () => {
|
|||||||
{
|
{
|
||||||
label: '数据权限',
|
label: '数据权限',
|
||||||
key: 'datascope',
|
key: 'datascope',
|
||||||
disabled: !access.hasPerms('system:role:edit'),
|
disabled: !access.hasPerms('system:role:edit.tsx'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '分配用户',
|
label: '分配用户',
|
||||||
key: 'authUser',
|
key: 'authUser',
|
||||||
disabled: !access.hasPerms('system:role:edit'),
|
disabled: !access.hasPerms('system:role:edit.tsx'),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
onClick: ({ key }: any) => {
|
onClick: ({ key }: any) => {
|
||||||
|
|||||||
@@ -255,7 +255,7 @@ const UserTableList: React.FC = () => {
|
|||||||
size="small"
|
size="small"
|
||||||
key="edit"
|
key="edit"
|
||||||
icon=<EditOutlined />
|
icon=<EditOutlined />
|
||||||
hidden={!access.hasPerms('system:user:edit')}
|
hidden={!access.hasPerms('system:user:edit.tsx')}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
fetchUserInfo(record.userId);
|
fetchUserInfo(record.userId);
|
||||||
const treeData = await getDeptTree({});
|
const treeData = await getDeptTree({});
|
||||||
@@ -299,12 +299,12 @@ const UserTableList: React.FC = () => {
|
|||||||
{
|
{
|
||||||
label: <FormattedMessage id="system.user.reset.password" defaultMessage="密码重置" />,
|
label: <FormattedMessage id="system.user.reset.password" defaultMessage="密码重置" />,
|
||||||
key: 'reset',
|
key: 'reset',
|
||||||
disabled: !access.hasPerms('system:user:edit'),
|
disabled: !access.hasPerms('system:user:edit.tsx'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '分配角色',
|
label: '分配角色',
|
||||||
key: 'authRole',
|
key: 'authRole',
|
||||||
disabled: !access.hasPerms('system:user:edit'),
|
disabled: !access.hasPerms('system:user:edit.tsx'),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
onClick: ({ key }) => {
|
onClick: ({ key }) => {
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ const GenCodeView: React.FC = () => {
|
|||||||
type="link"
|
type="link"
|
||||||
size="small"
|
size="small"
|
||||||
key="preview"
|
key="preview"
|
||||||
hidden={!access.hasPerms('tool:gen:edit')}
|
hidden={!access.hasPerms('tool:gen:edit.tsx')}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
previewCode(record.tableId).then((res) => {
|
previewCode(record.tableId).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
@@ -151,7 +151,7 @@ const GenCodeView: React.FC = () => {
|
|||||||
type="link"
|
type="link"
|
||||||
size="small"
|
size="small"
|
||||||
key="config"
|
key="config"
|
||||||
hidden={!access.hasPerms('tool:gen:edit')}
|
hidden={!access.hasPerms('tool:gen:edit.tsx')}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
history.push(`/tool/gen/edit?id=${record.tableId}`);
|
history.push(`/tool/gen/edit?id=${record.tableId}`);
|
||||||
}}
|
}}
|
||||||
@@ -187,7 +187,7 @@ const GenCodeView: React.FC = () => {
|
|||||||
type="link"
|
type="link"
|
||||||
size="small"
|
size="small"
|
||||||
key="sync"
|
key="sync"
|
||||||
hidden={!access.hasPerms('tool:gen:edit')}
|
hidden={!access.hasPerms('tool:gen:edit.tsx')}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
syncDbInfo(record.tableName).then((res) => {
|
syncDbInfo(record.tableName).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
@@ -204,7 +204,7 @@ const GenCodeView: React.FC = () => {
|
|||||||
type="link"
|
type="link"
|
||||||
size="small"
|
size="small"
|
||||||
key="gencode"
|
key="gencode"
|
||||||
hidden={!access.hasPerms('tool:gen:edit')}
|
hidden={!access.hasPerms('tool:gen:edit.tsx')}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (record.genType === '1') {
|
if (record.genType === '1') {
|
||||||
genCode(record.tableName).then((res) => {
|
genCode(record.tableName).then((res) => {
|
||||||
@@ -240,7 +240,7 @@ const GenCodeView: React.FC = () => {
|
|||||||
<Button
|
<Button
|
||||||
type="primary"
|
type="primary"
|
||||||
key="gen"
|
key="gen"
|
||||||
hidden={!access.hasPerms('tool:gen:edit')}
|
hidden={!access.hasPerms('tool:gen:edit.tsx')}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (selectedRows.length === 0) {
|
if (selectedRows.length === 0) {
|
||||||
message.error('请选择要生成的数据');
|
message.error('请选择要生成的数据');
|
||||||
|
|||||||
15
src/services/Management/list.ts
Normal file
15
src/services/Management/list.ts
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import { request } from '@umijs/max';
|
||||||
|
|
||||||
|
export async function getCmsJobList(params?: API.Management.ListParams) {
|
||||||
|
return request<API.Management.ManagePageResult>(`/api/cms/job/list`, {
|
||||||
|
method: 'GET',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function getCmsJobIds(ids: string) {
|
||||||
|
return request<API.Management.ManagePageResult>(`/api/cms/job/${ids}`, {
|
||||||
|
method: 'GET',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
11
src/services/area/business.ts
Normal file
11
src/services/area/business.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
import { request } from '@umijs/max';
|
||||||
|
|
||||||
|
export async function getCmsAreaList(params?: API.AreaBusiness.CircleParams) {
|
||||||
|
return request<API.AreaBusiness.CirclePageResult>(`/api/cms/area/list`, {
|
||||||
|
method: 'GET',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
11
src/services/area/subway.ts
Normal file
11
src/services/area/subway.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
import { request } from '@umijs/max';
|
||||||
|
|
||||||
|
export async function getCmsLineList(params?: API.AreaSubWay.LineParams) {
|
||||||
|
return request<API.AreaSubWay.LinePageResult>(`/api/cms/line/list`, {
|
||||||
|
method: 'GET',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -2,8 +2,8 @@ import { request } from '@umijs/max';
|
|||||||
import { downLoadXlsx } from '@/utils/downloadfile';
|
import { downLoadXlsx } from '@/utils/downloadfile';
|
||||||
|
|
||||||
// 查询系统访问记录列表
|
// 查询系统访问记录列表
|
||||||
export async function getLogininforList(params?: API.Monitor.LogininforListParams) {
|
export async function getLogininforList(params?: API.Logs.LogininforListParams) {
|
||||||
return request<API.Monitor.LogininforPageResult>('/api/monitor/logininfor/list', {
|
return request<API.Logs.LogininforPageResult>('/api/monitor/logininfor/list', {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json;charset=UTF-8',
|
'Content-Type': 'application/json;charset=UTF-8',
|
||||||
@@ -14,13 +14,13 @@ export async function getLogininforList(params?: API.Monitor.LogininforListParam
|
|||||||
|
|
||||||
// 查询系统访问记录详细
|
// 查询系统访问记录详细
|
||||||
export function getLogininfor(infoId: number) {
|
export function getLogininfor(infoId: number) {
|
||||||
return request<API.Monitor.LogininforInfoResult>(`/api/monitor/logininfor/${infoId}`, {
|
return request<API.Logs.LogininforInfoResult>(`/api/monitor/logininfor/${infoId}`, {
|
||||||
method: 'GET'
|
method: 'GET'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增系统访问记录
|
// 新增系统访问记录
|
||||||
export async function addLogininfor(params: API.Monitor.Logininfor) {
|
export async function addLogininfor(params: API.Logs.Logininfor) {
|
||||||
return request<API.Result>('/api/monitor/logininfor', {
|
return request<API.Result>('/api/monitor/logininfor', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
@@ -31,7 +31,7 @@ export async function addLogininfor(params: API.Monitor.Logininfor) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 修改系统访问记录
|
// 修改系统访问记录
|
||||||
export async function updateLogininfor(params: API.Monitor.Logininfor) {
|
export async function updateLogininfor(params: API.Logs.Logininfor) {
|
||||||
return request<API.Result>('/api/monitor/logininfor', {
|
return request<API.Result>('/api/monitor/logininfor', {
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
headers: {
|
headers: {
|
||||||
@@ -49,7 +49,7 @@ export async function removeLogininfor(ids: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 导出系统访问记录
|
// 导出系统访问记录
|
||||||
export function exportLogininfor(params?: API.Monitor.LogininforListParams) {
|
export function exportLogininfor(params?: API.Logs.LogininforListParams) {
|
||||||
return downLoadXlsx(`/api/monitor/logininfor/export`, { params }, `logininfor_${new Date().getTime()}.xlsx`);
|
return downLoadXlsx(`/api/monitor/logininfor/export`, { params }, `logininfor_${new Date().getTime()}.xlsx`);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2,8 +2,8 @@ import { request } from '@umijs/max';
|
|||||||
import { downLoadXlsx } from '@/utils/downloadfile';
|
import { downLoadXlsx } from '@/utils/downloadfile';
|
||||||
|
|
||||||
// 查询操作日志记录列表
|
// 查询操作日志记录列表
|
||||||
export async function getMobileLogList(params?: API.Monitor.MobilelogListParams) {
|
export async function getMobileLogList(params?: API.Logs.MobilelogListParams) {
|
||||||
return request<API.Monitor.OperlogPageResult>('/api/cms/operlog/list', {
|
return request<API.Logs.OperlogPageResult>('/api/cms/operlog/list', {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json;charset=UTF-8',
|
'Content-Type': 'application/json;charset=UTF-8',
|
||||||
@@ -13,7 +13,7 @@ export async function getMobileLogList(params?: API.Monitor.MobilelogListParams)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 修改操作日志记录
|
// 修改操作日志记录
|
||||||
export async function updateMobilelog(params: API.Monitor.Mobilelog) {
|
export async function updateMobilelog(params: API.Logs.Mobilelog) {
|
||||||
return request<API.Result>('/api/cms/operlog', {
|
return request<API.Result>('/api/cms/operlog', {
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
headers: {
|
headers: {
|
||||||
@@ -23,7 +23,7 @@ export async function updateMobilelog(params: API.Monitor.Mobilelog) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 新增操作日志记录
|
// 新增操作日志记录
|
||||||
export async function addMobilelog(params: API.Monitor.Mobilelog) {
|
export async function addMobilelog(params: API.Logs.Mobilelog) {
|
||||||
return request<API.Result>('/api/cms/operlog', {
|
return request<API.Result>('/api/cms/operlog', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
@@ -40,6 +40,6 @@ export async function removeMobilelog(ids: string) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function exportMobilelog(params?: API.Monitor.OperlogListParams) {
|
export function exportMobilelog(params?: API.Logs.OperlogListParams) {
|
||||||
return downLoadXlsx(`/api/cms/operlog/export`, { params }, `operlog_${new Date().getTime()}.xlsx`);
|
return downLoadXlsx(`/api/cms/operlog/export`, { params }, `operlog_${new Date().getTime()}.xlsx`);
|
||||||
}
|
}
|
||||||
68
src/services/logs/mobilelogininfor.ts
Normal file
68
src/services/logs/mobilelogininfor.ts
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
import { request } from '@umijs/max';
|
||||||
|
import { downLoadXlsx } from '@/utils/downloadfile';
|
||||||
|
|
||||||
|
// 查询系统访问记录列表
|
||||||
|
export async function getLogininforList(params?: API.Logs.MobileLogininforListParams) {
|
||||||
|
return request<API.Logs.LogininforPageResult>('/api/cms/logininfor/list', {
|
||||||
|
method: 'GET',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json;charset=UTF-8',
|
||||||
|
},
|
||||||
|
params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询系统访问记录详细
|
||||||
|
export function getLogininfor(infoId: number) {
|
||||||
|
return request<API.Logs.LogininforInfoResult>(`/api/cms/logininfor/${infoId}`, {
|
||||||
|
method: 'GET'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增系统访问记录
|
||||||
|
export async function addLogininfor(params: API.Logs.MobileLogininfor) {
|
||||||
|
return request<API.Result>('/api/cms/logininfor', {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json;charset=UTF-8',
|
||||||
|
},
|
||||||
|
data: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改系统访问记录
|
||||||
|
export async function updateLogininfor(params: API.Logs.MobileLogininfor) {
|
||||||
|
return request<API.Result>('/api/cms/logininfor', {
|
||||||
|
method: 'PUT',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json;charset=UTF-8',
|
||||||
|
},
|
||||||
|
data: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除系统访问记录
|
||||||
|
export async function removeLogininfor(ids: string) {
|
||||||
|
return request<API.Result>(`/api/cms/logininfor/${ids}`, {
|
||||||
|
method: 'DELETE'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出系统访问记录
|
||||||
|
export function exportLogininfor(params?: API.Logs.MobileLogininforListParams) {
|
||||||
|
return downLoadXlsx(`/api/cms/logininfor/export`, { params }, `logininfor_${new Date().getTime()}.xlsx`);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 解锁用户登录状态
|
||||||
|
export function unlockLogininfor(userName: string) {
|
||||||
|
return request<API.Result>('/api/cms/logininfor/unlock/' + userName, {
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 清空登录日志
|
||||||
|
export function cleanLogininfor() {
|
||||||
|
return request<API.Result>('/api/cms/logininfor/clean', {
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -2,8 +2,8 @@ import { request } from '@umijs/max';
|
|||||||
import { downLoadXlsx } from '@/utils/downloadfile';
|
import { downLoadXlsx } from '@/utils/downloadfile';
|
||||||
|
|
||||||
// 查询操作日志记录列表
|
// 查询操作日志记录列表
|
||||||
export async function getOperlogList(params?: API.Monitor.OperlogListParams) {
|
export async function getOperlogList(params?: API.Logs.OperlogListParams) {
|
||||||
return request<API.Monitor.OperlogPageResult>('/api/monitor/operlog/list', {
|
return request<API.Logs.OperlogPageResult>('/api/monitor/operlog/list', {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json;charset=UTF-8',
|
'Content-Type': 'application/json;charset=UTF-8',
|
||||||
@@ -14,13 +14,13 @@ export async function getOperlogList(params?: API.Monitor.OperlogListParams) {
|
|||||||
|
|
||||||
// 查询操作日志记录详细
|
// 查询操作日志记录详细
|
||||||
export function getOperlog(operId: number) {
|
export function getOperlog(operId: number) {
|
||||||
return request<API.Monitor.OperlogInfoResult>(`/api/monitor/operlog/${operId}`, {
|
return request<API.Logs.OperlogInfoResult>(`/api/monitor/operlog/${operId}`, {
|
||||||
method: 'GET'
|
method: 'GET'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增操作日志记录
|
// 新增操作日志记录
|
||||||
export async function addOperlog(params: API.Monitor.Operlog) {
|
export async function addOperlog(params: API.Logs.Operlog) {
|
||||||
return request<API.Result>('/api/monitor/operlog', {
|
return request<API.Result>('/api/monitor/operlog', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
@@ -31,7 +31,7 @@ export async function addOperlog(params: API.Monitor.Operlog) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 修改操作日志记录
|
// 修改操作日志记录
|
||||||
export async function updateOperlog(params: API.Monitor.Operlog) {
|
export async function updateOperlog(params: API.Logs.Operlog) {
|
||||||
return request<API.Result>('/api/monitor/operlog', {
|
return request<API.Result>('/api/monitor/operlog', {
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
headers: {
|
headers: {
|
||||||
@@ -55,6 +55,6 @@ export async function cleanAllOperlog() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 导出操作日志记录
|
// 导出操作日志记录
|
||||||
export function exportOperlog(params?: API.Monitor.OperlogListParams) {
|
export function exportOperlog(params?: API.Logs.OperlogListParams) {
|
||||||
return downLoadXlsx(`/api/monitor/operlog/export`, { params }, `operlog_${new Date().getTime()}.xlsx`);
|
return downLoadXlsx(`/api/monitor/operlog/export`, { params }, `operlog_${new Date().getTime()}.xlsx`);
|
||||||
}
|
}
|
||||||
65
src/services/system/admindicdata.ts
Normal file
65
src/services/system/admindicdata.ts
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
import { request } from '@umijs/max';
|
||||||
|
import { downLoadXlsx } from '@/utils/downloadfile';
|
||||||
|
|
||||||
|
// 查询字典数据列表
|
||||||
|
export async function getDictDataList(
|
||||||
|
params?: API.System.DictDataListParams,
|
||||||
|
options?: { [key: string]: any },
|
||||||
|
) {
|
||||||
|
return request<API.System.DictDataPageResult>('/api/system/dict/data/list', {
|
||||||
|
method: 'GET',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json;charset=UTF-8',
|
||||||
|
},
|
||||||
|
params,
|
||||||
|
...(options || {}),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询字典数据详细
|
||||||
|
export function getDictData(dictCode: number, options?: { [key: string]: any }) {
|
||||||
|
return request<API.System.DictDataInfoResult>(`/api/system/dict/data/${dictCode}`, {
|
||||||
|
method: 'GET',
|
||||||
|
...(options || {}),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增字典数据
|
||||||
|
export async function addDictData(params: API.System.DictData, options?: { [key: string]: any }) {
|
||||||
|
return request<API.Result>('/api/system/dict/data', {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json;charset=UTF-8',
|
||||||
|
},
|
||||||
|
data: params,
|
||||||
|
...(options || {}),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改字典数据
|
||||||
|
export async function updateDictData(params: API.System.DictData, options?: { [key: string]: any }) {
|
||||||
|
return request<API.Result>('/api/system/dict/data', {
|
||||||
|
method: 'PUT',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json;charset=UTF-8',
|
||||||
|
},
|
||||||
|
data: params,
|
||||||
|
...(options || {}),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除字典数据
|
||||||
|
export async function removeDictData(ids: string, options?: { [key: string]: any }) {
|
||||||
|
return request<API.Result>(`/api/system/dict/data/${ids}`, {
|
||||||
|
method: 'DELETE',
|
||||||
|
...(options || {}),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出字典数据
|
||||||
|
export function exportDictData(
|
||||||
|
params?: API.System.DictDataListParams,
|
||||||
|
options?: { [key: string]: any },
|
||||||
|
) {
|
||||||
|
return downLoadXlsx(`/api/system/dict/data/export`, { params }, `dict_data_${new Date().getTime()}.xlsx`);
|
||||||
|
}
|
||||||
120
src/services/system/admindict.ts
Normal file
120
src/services/system/admindict.ts
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
import { request } from '@umijs/max';
|
||||||
|
import { DictValueEnumObj } from '@/components/DictTag';
|
||||||
|
import { HttpResult } from '@/enums/httpEnum';
|
||||||
|
import { downLoadXlsx } from '@/utils/downloadfile';
|
||||||
|
|
||||||
|
/* *
|
||||||
|
*
|
||||||
|
* @author whiteshader@163.com
|
||||||
|
* @datetime 2021/09/16
|
||||||
|
*
|
||||||
|
* */
|
||||||
|
|
||||||
|
// 查询字典类型列表
|
||||||
|
export async function getDictTypeList(params?: API.DictTypeListParams) {
|
||||||
|
return request(`/api/system/dict/type/list`, {
|
||||||
|
params: {
|
||||||
|
...params,
|
||||||
|
},
|
||||||
|
method: 'GET',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json;charset=UTF-8',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询字典类型详细
|
||||||
|
export function getDictType(dictId: string) {
|
||||||
|
return request(`/api/system/dict/type/${dictId}`, {
|
||||||
|
method: 'GET',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询字典数据详细
|
||||||
|
export async function getDictValueEnum(dictType: string, isDigital?: boolean): Promise<DictValueEnumObj> {
|
||||||
|
const resp = await request<API.System.DictTypeResult>(`/api/system/dict/data/type/${dictType}`, {
|
||||||
|
method: 'GET',
|
||||||
|
});
|
||||||
|
if(resp.code === HttpResult.SUCCESS) {
|
||||||
|
const opts: DictValueEnumObj = {};
|
||||||
|
resp.data.forEach((item: any) => {
|
||||||
|
opts[item.dictValue] = {
|
||||||
|
text: item.dictLabel,
|
||||||
|
label: item.dictLabel,
|
||||||
|
value: isDigital ? Number(item.dictValue) : item.dictValue,
|
||||||
|
key: item.dictCode,
|
||||||
|
listClass: item.listClass,
|
||||||
|
status: item.listClass };
|
||||||
|
});
|
||||||
|
return opts;
|
||||||
|
} else {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function getDictSelectOption(dictType: string, isDigital?: boolean) {
|
||||||
|
const resp = await request<API.System.DictTypeResult>(`/api/system/dict/data/type/${dictType}`, {
|
||||||
|
method: 'GET',
|
||||||
|
});
|
||||||
|
if (resp.code === 200) {
|
||||||
|
const options: DictValueEnumObj[] = resp.data.map((item) => {
|
||||||
|
return {
|
||||||
|
text: item.dictLabel,
|
||||||
|
label: item.dictLabel,
|
||||||
|
value: isDigital ? Number(item.dictValue) : item.dictValue,
|
||||||
|
key: item.dictCode,
|
||||||
|
listClass: item.listClass,
|
||||||
|
status: item.listClass
|
||||||
|
};
|
||||||
|
});
|
||||||
|
return options;
|
||||||
|
}
|
||||||
|
return [];
|
||||||
|
};
|
||||||
|
|
||||||
|
// 新增字典类型
|
||||||
|
export async function addDictType(params: API.System.DictType) {
|
||||||
|
return request<API.Result>('/api/system/dict/type', {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json;charset=UTF-8',
|
||||||
|
},
|
||||||
|
data: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改字典类型
|
||||||
|
export async function updateDictType(params: API.System.DictType) {
|
||||||
|
return request<API.Result>('/api/system/dict/type', {
|
||||||
|
method: 'PUT',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json;charset=UTF-8',
|
||||||
|
},
|
||||||
|
data: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除字典类型
|
||||||
|
export async function removeDictType(ids: string) {
|
||||||
|
return request<API.Result>(`/api/system/dict/type/${ids}`, {
|
||||||
|
method: 'DELETE'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出字典类型
|
||||||
|
export function exportDictType(params?: API.System.DictTypeListParams) {
|
||||||
|
return downLoadXlsx(`/api/system/dict/type/export`, { params }, `dict_type_${new Date().getTime()}.xlsx`);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取字典选择框列表
|
||||||
|
export async function getDictTypeOptionSelect(params?: API.DictTypeListParams) {
|
||||||
|
return request('/api/system/dict/type/optionselect', {
|
||||||
|
params: {
|
||||||
|
...params,
|
||||||
|
},
|
||||||
|
method: 'GET',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json;charset=UTF-8',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
38
src/types/Management/list.d.ts
vendored
Normal file
38
src/types/Management/list.d.ts
vendored
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
declare namespace API.Management {
|
||||||
|
export interface Manage {
|
||||||
|
applyNum: number;
|
||||||
|
companyId: number;
|
||||||
|
companyName: string;
|
||||||
|
education: string;
|
||||||
|
experience: string;
|
||||||
|
isApply: number;
|
||||||
|
isCollection: number;
|
||||||
|
isHot: number;
|
||||||
|
jobId: number;
|
||||||
|
jobLocation: string;
|
||||||
|
jobLocationAreaCode: number;
|
||||||
|
jobTitle: string;
|
||||||
|
latitude: number;
|
||||||
|
longitude: number;
|
||||||
|
maxSalary: number;
|
||||||
|
minSalary: number;
|
||||||
|
postingDate: string;
|
||||||
|
vacancies: number;
|
||||||
|
view: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ListParams {
|
||||||
|
createTime?: string;
|
||||||
|
updateTime?: string;
|
||||||
|
remark?: string;
|
||||||
|
pageSize?: string;
|
||||||
|
current?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ManagePageResult {
|
||||||
|
code: number;
|
||||||
|
msg: string;
|
||||||
|
total: number;
|
||||||
|
rows: Array<Manage>;
|
||||||
|
}
|
||||||
|
}
|
||||||
30
src/types/area/business.d.ts
vendored
Normal file
30
src/types/area/business.d.ts
vendored
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
declare namespace API.AreaBusiness {
|
||||||
|
export interface Circle {
|
||||||
|
commercialAreaId: number;
|
||||||
|
commercialAreaName: string;
|
||||||
|
latitude: number;
|
||||||
|
longitude: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface LinePoint {
|
||||||
|
latitude: number;
|
||||||
|
longitude: numberl;
|
||||||
|
lineName: string;
|
||||||
|
stationId: number;
|
||||||
|
stationName: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CircleParams {
|
||||||
|
createTime?: string;
|
||||||
|
updateTime?: string;
|
||||||
|
pageSize?: string;
|
||||||
|
current?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CirclePageResult {
|
||||||
|
code: number;
|
||||||
|
msg: string;
|
||||||
|
total: number;
|
||||||
|
rows: Array<Line>;
|
||||||
|
}
|
||||||
|
}
|
||||||
29
src/types/area/subway.d.ts
vendored
Normal file
29
src/types/area/subway.d.ts
vendored
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
declare namespace API.AreaSubWay {
|
||||||
|
export interface Line {
|
||||||
|
lineId: number;
|
||||||
|
lineName: string;
|
||||||
|
subwayStationList: Array<LinePoint>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface LinePoint {
|
||||||
|
latitude: number;
|
||||||
|
longitude: numberl;
|
||||||
|
lineName: string;
|
||||||
|
stationId: number;
|
||||||
|
stationName: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface LineParams {
|
||||||
|
createTime?: string;
|
||||||
|
updateTime?: string;
|
||||||
|
pageSize?: string;
|
||||||
|
current?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface LinePageResult {
|
||||||
|
code: number;
|
||||||
|
msg: string;
|
||||||
|
total: number;
|
||||||
|
rows: Array<Line>;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
declare namespace API.Monitor {
|
declare namespace API.Logs {
|
||||||
|
|
||||||
export interface Logininfor {
|
export interface Logininfor {
|
||||||
infoId: number;
|
infoId: number;
|
||||||
@@ -27,17 +27,17 @@ declare namespace API.Monitor {
|
|||||||
current?: string;
|
current?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface LogininforInfoResult {
|
export interface LogininforInfoResult {
|
||||||
code: number;
|
code: number;
|
||||||
msg: string;
|
msg: string;
|
||||||
data: Logininfor;
|
data: Logininfor;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface LogininforPageResult {
|
export interface LogininforPageResult {
|
||||||
code: number;
|
code: number;
|
||||||
msg: string;
|
msg: string;
|
||||||
total: number;
|
total: number;
|
||||||
rows: Array<Logininfor>;
|
rows: Array<Logininfor>;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
declare namespace API.Monitor {
|
declare namespace API.Logs {
|
||||||
|
|
||||||
export interface Mobilelog {
|
export interface Mobilelog {
|
||||||
operId: number;
|
operId: number;
|
||||||
43
src/types/logs/mobilelogoninfor.ts
Normal file
43
src/types/logs/mobilelogoninfor.ts
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
|
||||||
|
declare namespace API.Logs {
|
||||||
|
|
||||||
|
export interface MobileLogininfor {
|
||||||
|
infoId: number;
|
||||||
|
userName: string;
|
||||||
|
ipaddr: string;
|
||||||
|
loginLocation: string;
|
||||||
|
browser: string;
|
||||||
|
os: string;
|
||||||
|
status: string;
|
||||||
|
msg: string;
|
||||||
|
loginTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MobileLogininforListParams {
|
||||||
|
infoId?: string;
|
||||||
|
userName?: string;
|
||||||
|
ipaddr?: string;
|
||||||
|
loginLocation?: string;
|
||||||
|
browser?: string;
|
||||||
|
os?: string;
|
||||||
|
status?: string;
|
||||||
|
msg?: string;
|
||||||
|
loginTime?: string;
|
||||||
|
pageSize?: string;
|
||||||
|
current?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MobileLogininforInfoResult {
|
||||||
|
code: number;
|
||||||
|
msg: string;
|
||||||
|
data: MobileLogininfor;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MobileLogininforPageResult {
|
||||||
|
code: number;
|
||||||
|
msg: string;
|
||||||
|
total: number;
|
||||||
|
rows: Array<MobileLogininfor>;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
declare namespace API.Monitor {
|
declare namespace API.Logs {
|
||||||
|
|
||||||
export interface Operlog {
|
export interface Operlog {
|
||||||
operId: number;
|
operId: number;
|
||||||
@@ -41,17 +41,17 @@ declare namespace API.Monitor {
|
|||||||
current?: string;
|
current?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface OperlogInfoResult {
|
export interface OperlogInfoResult {
|
||||||
code: number;
|
code: number;
|
||||||
msg: string;
|
msg: string;
|
||||||
data: Operlog;
|
data: Operlog;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface OperlogPageResult {
|
export interface OperlogPageResult {
|
||||||
code: number;
|
code: number;
|
||||||
msg: string;
|
msg: string;
|
||||||
total: number;
|
total: number;
|
||||||
rows: Array<Operlog>;
|
rows: Array<Operlog>;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user