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