chore: rename dir
This commit is contained in:
@@ -1,16 +1,9 @@
|
|||||||
import { defineConfig } from '@umijs/max';
|
import { defineConfig } from '@umijs/max';
|
||||||
|
|
||||||
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
|
|
||||||
|
|
||||||
import proxy from './proxy';
|
import proxy from './proxy';
|
||||||
import routes from './routes';
|
import routes from './routes';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
chainWebpack(config) {
|
|
||||||
config
|
|
||||||
.plugin('case-sensitive-paths-webpack-plugin')
|
|
||||||
.use(CaseSensitivePathsPlugin);
|
|
||||||
},
|
|
||||||
proxy: {
|
proxy: {
|
||||||
...proxy()
|
...proxy()
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ const AccessPage: React.FC = () => {
|
|||||||
<PageContainer
|
<PageContainer
|
||||||
ghost
|
ghost
|
||||||
header={{
|
header={{
|
||||||
title: '权限示例',
|
title: '权限示例'
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Access accessible={access.canSeeAdmin}>
|
<Access accessible={access.canSeeAdmin}>
|
||||||
+12
-12
@@ -4,7 +4,7 @@ import {
|
|||||||
ProFormSelect,
|
ProFormSelect,
|
||||||
ProFormText,
|
ProFormText,
|
||||||
ProFormTextArea,
|
ProFormTextArea,
|
||||||
StepsForm,
|
StepsForm
|
||||||
} from '@ant-design/pro-components';
|
} from '@ant-design/pro-components';
|
||||||
import { Modal } from 'antd';
|
import { Modal } from 'antd';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
@@ -27,7 +27,7 @@ export interface UpdateFormProps {
|
|||||||
const UpdateForm: React.FC<UpdateFormProps> = (props) => (
|
const UpdateForm: React.FC<UpdateFormProps> = (props) => (
|
||||||
<StepsForm
|
<StepsForm
|
||||||
stepsProps={{
|
stepsProps={{
|
||||||
size: 'small',
|
size: 'small'
|
||||||
}}
|
}}
|
||||||
stepsFormRender={(dom, submitter) => {
|
stepsFormRender={(dom, submitter) => {
|
||||||
return (
|
return (
|
||||||
@@ -49,7 +49,7 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => (
|
|||||||
<StepsForm.StepForm
|
<StepsForm.StepForm
|
||||||
initialValues={{
|
initialValues={{
|
||||||
name: props.values.name,
|
name: props.values.name,
|
||||||
nickName: props.values.nickName,
|
nickName: props.values.nickName
|
||||||
}}
|
}}
|
||||||
title="基本信息"
|
title="基本信息"
|
||||||
>
|
>
|
||||||
@@ -65,14 +65,14 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => (
|
|||||||
label="规则描述"
|
label="规则描述"
|
||||||
placeholder="请输入至少五个字符"
|
placeholder="请输入至少五个字符"
|
||||||
rules={[
|
rules={[
|
||||||
{ required: true, message: '请输入至少五个字符的规则描述!', min: 5 },
|
{ required: true, message: '请输入至少五个字符的规则描述!', min: 5 }
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
</StepsForm.StepForm>
|
</StepsForm.StepForm>
|
||||||
<StepsForm.StepForm
|
<StepsForm.StepForm
|
||||||
initialValues={{
|
initialValues={{
|
||||||
target: '0',
|
target: '0',
|
||||||
template: '0',
|
template: '0'
|
||||||
}}
|
}}
|
||||||
title="配置规则属性"
|
title="配置规则属性"
|
||||||
>
|
>
|
||||||
@@ -82,7 +82,7 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => (
|
|||||||
label="监控对象"
|
label="监控对象"
|
||||||
valueEnum={{
|
valueEnum={{
|
||||||
0: '表一',
|
0: '表一',
|
||||||
1: '表二',
|
1: '表二'
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ProFormSelect
|
<ProFormSelect
|
||||||
@@ -91,7 +91,7 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => (
|
|||||||
label="规则模板"
|
label="规则模板"
|
||||||
valueEnum={{
|
valueEnum={{
|
||||||
0: '规则模板一',
|
0: '规则模板一',
|
||||||
1: '规则模板二',
|
1: '规则模板二'
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ProFormRadio.Group
|
<ProFormRadio.Group
|
||||||
@@ -101,19 +101,19 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => (
|
|||||||
options={[
|
options={[
|
||||||
{
|
{
|
||||||
value: '0',
|
value: '0',
|
||||||
label: '强',
|
label: '强'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '1',
|
value: '1',
|
||||||
label: '弱',
|
label: '弱'
|
||||||
},
|
}
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
</StepsForm.StepForm>
|
</StepsForm.StepForm>
|
||||||
<StepsForm.StepForm
|
<StepsForm.StepForm
|
||||||
initialValues={{
|
initialValues={{
|
||||||
type: '1',
|
type: '1',
|
||||||
frequency: 'month',
|
frequency: 'month'
|
||||||
}}
|
}}
|
||||||
title="设定调度周期"
|
title="设定调度周期"
|
||||||
>
|
>
|
||||||
@@ -128,7 +128,7 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => (
|
|||||||
width="xs"
|
width="xs"
|
||||||
valueEnum={{
|
valueEnum={{
|
||||||
month: '月',
|
month: '月',
|
||||||
week: '周',
|
week: '周'
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</StepsForm.StepForm>
|
</StepsForm.StepForm>
|
||||||
@@ -5,7 +5,7 @@ import {
|
|||||||
PageContainer,
|
PageContainer,
|
||||||
ProDescriptions,
|
ProDescriptions,
|
||||||
ProDescriptionsItemProps,
|
ProDescriptionsItemProps,
|
||||||
ProTable,
|
ProTable
|
||||||
} from '@ant-design/pro-components';
|
} from '@ant-design/pro-components';
|
||||||
import { Button, Divider, Drawer, message } from 'antd';
|
import { Button, Divider, Drawer, message } from 'antd';
|
||||||
import React, { useRef, useState } from 'react';
|
import React, { useRef, useState } from 'react';
|
||||||
@@ -42,13 +42,13 @@ const handleUpdate = async (fields: FormValueType) => {
|
|||||||
try {
|
try {
|
||||||
await modifyUser(
|
await modifyUser(
|
||||||
{
|
{
|
||||||
userId: fields.id || '',
|
userId: fields.id || ''
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: fields.name || '',
|
name: fields.name || '',
|
||||||
nickName: fields.nickName || '',
|
nickName: fields.nickName || '',
|
||||||
email: fields.email || '',
|
email: fields.email || ''
|
||||||
},
|
}
|
||||||
);
|
);
|
||||||
hide();
|
hide();
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ const handleRemove = async (selectedRows: API.UserInfo[]) => {
|
|||||||
if (!selectedRows) return true;
|
if (!selectedRows) return true;
|
||||||
try {
|
try {
|
||||||
await deleteUser({
|
await deleteUser({
|
||||||
userId: selectedRows.find((row) => row.id)?.id || '',
|
userId: selectedRows.find((row) => row.id)?.id || ''
|
||||||
});
|
});
|
||||||
hide();
|
hide();
|
||||||
message.success('删除成功,即将刷新');
|
message.success('删除成功,即将刷新');
|
||||||
@@ -99,15 +99,15 @@ const TableList: React.FC<unknown> = () => {
|
|||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '名称为必填项',
|
message: '名称为必填项'
|
||||||
},
|
}
|
||||||
],
|
]
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '昵称',
|
title: '昵称',
|
||||||
dataIndex: 'nickName',
|
dataIndex: 'nickName',
|
||||||
valueType: 'text',
|
valueType: 'text'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '性别',
|
title: '性别',
|
||||||
@@ -115,8 +115,8 @@ const TableList: React.FC<unknown> = () => {
|
|||||||
hideInForm: true,
|
hideInForm: true,
|
||||||
valueEnum: {
|
valueEnum: {
|
||||||
0: { text: '男', status: 'MALE' },
|
0: { text: '男', status: 'MALE' },
|
||||||
1: { text: '女', status: 'FEMALE' },
|
1: { text: '女', status: 'FEMALE' }
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
@@ -135,14 +135,14 @@ const TableList: React.FC<unknown> = () => {
|
|||||||
<Divider type="vertical" />
|
<Divider type="vertical" />
|
||||||
<a href="">订阅警报</a>
|
<a href="">订阅警报</a>
|
||||||
</>
|
</>
|
||||||
),
|
)
|
||||||
},
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageContainer
|
<PageContainer
|
||||||
header={{
|
header={{
|
||||||
title: 'CRUD 示例',
|
title: 'CRUD 示例'
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ProTable<API.UserInfo>
|
<ProTable<API.UserInfo>
|
||||||
@@ -150,7 +150,7 @@ const TableList: React.FC<unknown> = () => {
|
|||||||
actionRef={actionRef}
|
actionRef={actionRef}
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
search={{
|
search={{
|
||||||
labelWidth: 120,
|
labelWidth: 120
|
||||||
}}
|
}}
|
||||||
toolBarRender={() => [
|
toolBarRender={() => [
|
||||||
<Button
|
<Button
|
||||||
@@ -159,7 +159,7 @@ const TableList: React.FC<unknown> = () => {
|
|||||||
onClick={() => handleModalVisible(true)}
|
onClick={() => handleModalVisible(true)}
|
||||||
>
|
>
|
||||||
新建
|
新建
|
||||||
</Button>,
|
</Button>
|
||||||
]}
|
]}
|
||||||
request={async (params, sorter, filter) => {
|
request={async (params, sorter, filter) => {
|
||||||
const { data, success } = await queryUserList({
|
const { data, success } = await queryUserList({
|
||||||
@@ -167,16 +167,16 @@ const TableList: React.FC<unknown> = () => {
|
|||||||
// FIXME: remove @ts-ignore
|
// FIXME: remove @ts-ignore
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
sorter,
|
sorter,
|
||||||
filter,
|
filter
|
||||||
});
|
});
|
||||||
return {
|
return {
|
||||||
data: data?.list || [],
|
data: data?.list || [],
|
||||||
success,
|
success
|
||||||
};
|
};
|
||||||
}}
|
}}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
rowSelection={{
|
rowSelection={{
|
||||||
onChange: (_, selectedRows) => setSelectedRows(selectedRows),
|
onChange: (_, selectedRows) => setSelectedRows(selectedRows)
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{selectedRowsState?.length > 0 && (
|
{selectedRowsState?.length > 0 && (
|
||||||
@@ -254,10 +254,10 @@ const TableList: React.FC<unknown> = () => {
|
|||||||
column={2}
|
column={2}
|
||||||
title={row?.name}
|
title={row?.name}
|
||||||
request={async () => ({
|
request={async () => ({
|
||||||
data: row || {},
|
data: row || {}
|
||||||
})}
|
})}
|
||||||
params={{
|
params={{
|
||||||
id: row?.name,
|
id: row?.name
|
||||||
}}
|
}}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
/>
|
/>
|
||||||
Reference in New Issue
Block a user