mirror of https://github.com/longtai-cn/hippo4j
add router and edit request (#1477)
* Add user log item Manage * edit Item Management * merge from develop * add router * add router * edit logmanage * edit tenantpull/1482/head
parent
d645c49450
commit
d543979a0c
@ -0,0 +1,33 @@
|
|||||||
|
import { useRequest } from 'ahooks';
|
||||||
|
import { Form, Modal, Input, Select } from 'antd';
|
||||||
|
import React from 'react';
|
||||||
|
import { fetchTenantList } from '../tenant/service';
|
||||||
|
|
||||||
|
const ItemCreate: React.FC<{
|
||||||
|
type: string;
|
||||||
|
data: any;
|
||||||
|
visible: boolean;
|
||||||
|
onClose: () => void;
|
||||||
|
}> = props => {
|
||||||
|
const { visible, onClose, data, type } = props;
|
||||||
|
const { data: tenant } = useRequest(fetchTenantList);
|
||||||
|
console.log('tenant', tenant);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal open={visible} onCancel={onClose} footer={null} width={600} title={type === 'edit' ? '编辑' : '创建'}>
|
||||||
|
<Form>
|
||||||
|
<Form.Item label="租户" name="">
|
||||||
|
{/* <Select options={tenant}></Select> */}
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item label="项目" name="">
|
||||||
|
<Input />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item label="负责人" name="">
|
||||||
|
<Input />
|
||||||
|
</Form.Item>
|
||||||
|
</Form>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default ItemCreate;
|
@ -0,0 +1,33 @@
|
|||||||
|
import { Descriptions, Modal } from 'antd';
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
const LogDetail: React.FC<{
|
||||||
|
data: any;
|
||||||
|
visible: boolean;
|
||||||
|
onClose: () => void;
|
||||||
|
}> = props => {
|
||||||
|
const { visible, onClose, data } = props;
|
||||||
|
return (
|
||||||
|
<Modal open={visible} onCancel={onClose} footer={null} width={600}>
|
||||||
|
<Descriptions title={'详情'} column={1}>
|
||||||
|
<Descriptions.Item span={1} label="业务类型">
|
||||||
|
{data.category}
|
||||||
|
</Descriptions.Item>
|
||||||
|
<Descriptions.Item span={1} label="业务标识">
|
||||||
|
{data.bizNo}
|
||||||
|
</Descriptions.Item>
|
||||||
|
<Descriptions.Item span={1} label="操作人">
|
||||||
|
{data.operator}
|
||||||
|
</Descriptions.Item>
|
||||||
|
<Descriptions.Item span={1} label="创建时间">
|
||||||
|
{data.createTime}
|
||||||
|
</Descriptions.Item>
|
||||||
|
<Descriptions.Item span={1} label="日志内容">
|
||||||
|
{data.action}
|
||||||
|
</Descriptions.Item>
|
||||||
|
</Descriptions>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default LogDetail;
|
@ -1,79 +1,24 @@
|
|||||||
import request from '@/utils';
|
import request from '@/utils';
|
||||||
|
|
||||||
const fetchTenantList = async (
|
const fetchLogList = async (
|
||||||
pageProps: { current: number; pageSize: number },
|
pageProps: { current: number; pageSize: number },
|
||||||
formData: { tencent: string | number }
|
formData: { category: string | number; bizNo: string; operator: string }
|
||||||
): Promise<{ total: number; list: Array<any> }> => {
|
): Promise<{ total: number; list: Array<any> }> => {
|
||||||
const res: any = await request('/hippo4j/v1/cs/tenant/query/page', {
|
const res: any = await request('/hippo4j/v1/cs/log/query/page', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
|
||||||
Authorization:
|
|
||||||
'Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiI3LGJhb3hpbnlpX2FkbWluIiwiaXNzIjoiYWRtaW4iLCJleHAiOjE2OTUzOTg4NDksImlhdCI6MTY5NDc5NDA0OSwicm9sIjoiUk9MRV9BRE1JTiJ9.syRDshKpd-xETsSdeMPRtk956f4BJkPt4utVsUl4smgH71Woj8SUq4w2RX1YtGTC4aTZRJYdKOfkTqwK0g_dHQ',
|
|
||||||
cookie:
|
|
||||||
'Admin-Token=Bearer%20eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiI3LGJhb3hpbnlpX2FkbWluIiwiaXNzIjoiYWRtaW4iLCJleHAiOjE2OTUzOTg4NDksImlhdCI6MTY5NDc5NDA0OSwicm9sIjoiUk9MRV9BRE1JTiJ9.syRDshKpd-xETsSdeMPRtk956f4BJkPt4utVsUl4smgH71Woj8SUq4w2RX1YtGTC4aTZRJYdKOfkTqwK0g_dHQ; userName=baoxinyi_admin',
|
|
||||||
},
|
|
||||||
body: {
|
body: {
|
||||||
...formData,
|
...formData,
|
||||||
current: pageProps.current,
|
current: pageProps.current,
|
||||||
size: pageProps.pageSize,
|
size: pageProps.pageSize,
|
||||||
desc: true,
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (res && res.success) {
|
if (res && res.success) {
|
||||||
return {
|
return {
|
||||||
total: res.data.total,
|
total: res.data.total,
|
||||||
list: res.data.records,
|
list: res.data.records.map((item: any, index: number) => ({ id: index + 1, ...item })),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
throw new Error(res.msg || '服务器开小差啦~');
|
throw new Error(res.msg || '服务器开小差啦~');
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchAddTenant = async (id: string) => {
|
export { fetchLogList };
|
||||||
const res = await request('/hippo4j/v1/cs/tenant/save', {
|
|
||||||
method: 'POST',
|
|
||||||
params: { id },
|
|
||||||
});
|
|
||||||
|
|
||||||
if (res && res.success) {
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
throw new Error(res.msg || '服务器开小差啦~');
|
|
||||||
};
|
|
||||||
|
|
||||||
const fetchDeleteTenant = async (id: string) => {
|
|
||||||
const res = await request('/tenants', {
|
|
||||||
method: 'POST',
|
|
||||||
params: { id },
|
|
||||||
});
|
|
||||||
|
|
||||||
if (res && res.success) {
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
throw new Error(res.msg || '服务器开小差啦~');
|
|
||||||
};
|
|
||||||
|
|
||||||
const fetchUpdateTenant = async (id: string) => {
|
|
||||||
const res = await request('hippo4j/v1/cs/tenant/update', {
|
|
||||||
method: 'POST',
|
|
||||||
params: { id },
|
|
||||||
});
|
|
||||||
|
|
||||||
if (res && res.success) {
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
throw new Error(res.msg || '服务器开小差啦~');
|
|
||||||
};
|
|
||||||
|
|
||||||
const fetchTenantDetail = async (id: string) => {
|
|
||||||
const res = await request('/tenants', {
|
|
||||||
method: 'POST',
|
|
||||||
params: { id },
|
|
||||||
});
|
|
||||||
|
|
||||||
if (res && res.success) {
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
throw new Error(res.msg || '服务器开小差啦~');
|
|
||||||
};
|
|
||||||
|
|
||||||
export { fetchTenantList, fetchAddTenant, fetchDeleteTenant, fetchUpdateTenant, fetchTenantDetail };
|
|
||||||
|
Loading…
Reference in new issue