| @@ -360,6 +360,16 @@ export default [ | |||||
| path: 'role-auth/user/:id', | path: 'role-auth/user/:id', | ||||
| component: './System/Role/authUser', | component: './System/Role/authUser', | ||||
| }, | }, | ||||
| { | |||||
| name: '日志', | |||||
| path: 'log', | |||||
| routes: [ | |||||
| { | |||||
| path: '', | |||||
| redirect: '/system/log/operlog', | |||||
| }, | |||||
| ], | |||||
| }, | |||||
| ], | ], | ||||
| }, | }, | ||||
| { | { | ||||
| @@ -28,7 +28,7 @@ const JobLogDetailForm: React.FC<JobLogFormProps> = (props) => { | |||||
| return ( | return ( | ||||
| <KFModal | <KFModal | ||||
| width={640} | |||||
| width={680} | |||||
| title={intl.formatMessage({ | title={intl.formatMessage({ | ||||
| id: 'monitor.job.log.title', | id: 'monitor.job.log.title', | ||||
| defaultMessage: '定时任务调度日志', | defaultMessage: '定时任务调度日志', | ||||
| @@ -22,8 +22,11 @@ export type ConfigFormProps = { | |||||
| const ConfigForm: React.FC<ConfigFormProps> = (props) => { | const ConfigForm: React.FC<ConfigFormProps> = (props) => { | ||||
| const [form] = Form.useForm(); | const [form] = Form.useForm(); | ||||
| const { configTypeOptions } = props; | const { configTypeOptions } = props; | ||||
| const formLayout = { | |||||
| labelCol: { span: 4 }, | |||||
| wrapperCol: { span: 20 }, | |||||
| }; | |||||
| useEffect(() => { | useEffect(() => { | ||||
| form.resetFields(); | form.resetFields(); | ||||
| @@ -32,7 +35,7 @@ const ConfigForm: React.FC<ConfigFormProps> = (props) => { | |||||
| configName: props.values.configName, | configName: props.values.configName, | ||||
| configKey: props.values.configKey, | configKey: props.values.configKey, | ||||
| configValue: props.values.configValue, | configValue: props.values.configValue, | ||||
| configType: props.values.configType, | |||||
| configType: props.values.configType || Object.keys(configTypeOptions)[0], | |||||
| createBy: props.values.createBy, | createBy: props.values.createBy, | ||||
| createTime: props.values.createTime, | createTime: props.values.createTime, | ||||
| updateBy: props.values.updateBy, | updateBy: props.values.updateBy, | ||||
| @@ -54,7 +57,7 @@ const ConfigForm: React.FC<ConfigFormProps> = (props) => { | |||||
| return ( | return ( | ||||
| <KFModal | <KFModal | ||||
| width={640} | |||||
| width={680} | |||||
| title={intl.formatMessage({ | title={intl.formatMessage({ | ||||
| id: 'system.config.title', | id: 'system.config.title', | ||||
| defaultMessage: '编辑参数配置', | defaultMessage: '编辑参数配置', | ||||
| @@ -71,6 +74,10 @@ const ConfigForm: React.FC<ConfigFormProps> = (props) => { | |||||
| submitter={false} | submitter={false} | ||||
| layout="horizontal" | layout="horizontal" | ||||
| onFinish={handleFinish} | onFinish={handleFinish} | ||||
| {...formLayout} | |||||
| size="large" | |||||
| labelAlign="right" | |||||
| autoComplete="off" | |||||
| > | > | ||||
| <ProFormDigit | <ProFormDigit | ||||
| name="configId" | name="configId" | ||||
| @@ -331,7 +331,7 @@ const ConfigTableList: React.FC = () => { | |||||
| handleRefreshCache(); | handleRefreshCache(); | ||||
| }} | }} | ||||
| > | > | ||||
| <ReloadOutlined /> | |||||
| <ReloadOutlined />{' '} | |||||
| <FormattedMessage id="system.config.refreshCache" defaultMessage="刷新缓存" /> | <FormattedMessage id="system.config.refreshCache" defaultMessage="刷新缓存" /> | ||||
| </Button>, | </Button>, | ||||
| ]} | ]} | ||||
| @@ -23,8 +23,11 @@ export type DataFormProps = { | |||||
| const DictDataForm: React.FC<DataFormProps> = (props) => { | const DictDataForm: React.FC<DataFormProps> = (props) => { | ||||
| const [form] = Form.useForm(); | const [form] = Form.useForm(); | ||||
| const { statusOptions } = props; | const { statusOptions } = props; | ||||
| const formLayout = { | |||||
| labelCol: { span: 4 }, | |||||
| wrapperCol: { span: 20 }, | |||||
| }; | |||||
| useEffect(() => { | useEffect(() => { | ||||
| form.resetFields(); | form.resetFields(); | ||||
| @@ -36,8 +39,8 @@ const DictDataForm: React.FC<DataFormProps> = (props) => { | |||||
| dictType: props.values.dictType, | dictType: props.values.dictType, | ||||
| cssClass: props.values.cssClass, | cssClass: props.values.cssClass, | ||||
| listClass: props.values.listClass, | listClass: props.values.listClass, | ||||
| isDefault: props.values.isDefault, | |||||
| status: props.values.status, | |||||
| isDefault: props.values.isDefault || 'N', | |||||
| status: props.values.status || Object.keys(statusOptions)[0], | |||||
| createBy: props.values.createBy, | createBy: props.values.createBy, | ||||
| createTime: props.values.createTime, | createTime: props.values.createTime, | ||||
| updateBy: props.values.updateBy, | updateBy: props.values.updateBy, | ||||
| @@ -59,7 +62,7 @@ const DictDataForm: React.FC<DataFormProps> = (props) => { | |||||
| return ( | return ( | ||||
| <KFModal | <KFModal | ||||
| width={640} | |||||
| width={680} | |||||
| title={intl.formatMessage({ | title={intl.formatMessage({ | ||||
| id: 'system.dict.data.title', | id: 'system.dict.data.title', | ||||
| defaultMessage: '编辑字典数据', | defaultMessage: '编辑字典数据', | ||||
| @@ -76,6 +79,10 @@ const DictDataForm: React.FC<DataFormProps> = (props) => { | |||||
| submitter={false} | submitter={false} | ||||
| layout="horizontal" | layout="horizontal" | ||||
| onFinish={handleFinish} | onFinish={handleFinish} | ||||
| {...formLayout} | |||||
| size="large" | |||||
| labelAlign="right" | |||||
| autoComplete="off" | |||||
| > | > | ||||
| <ProFormDigit | <ProFormDigit | ||||
| name="dictCode" | name="dictCode" | ||||
| @@ -184,7 +191,7 @@ const DictDataForm: React.FC<DataFormProps> = (props) => { | |||||
| id: 'system.dict.data.dict_sort', | id: 'system.dict.data.dict_sort', | ||||
| defaultMessage: '字典排序', | defaultMessage: '字典排序', | ||||
| })} | })} | ||||
| colProps={{ md: 12, xl: 12 }} | |||||
| colProps={{ md: 12, xl: 24 }} | |||||
| placeholder="请输入字典排序" | placeholder="请输入字典排序" | ||||
| rules={[ | rules={[ | ||||
| { | { | ||||
| @@ -203,7 +210,6 @@ const DictDataForm: React.FC<DataFormProps> = (props) => { | |||||
| Y: '是', | Y: '是', | ||||
| N: '否', | N: '否', | ||||
| }} | }} | ||||
| initialValue={'N'} | |||||
| colProps={{ md: 12, xl: 24 }} | colProps={{ md: 12, xl: 24 }} | ||||
| placeholder="请输入是否默认" | placeholder="请输入是否默认" | ||||
| rules={[ | rules={[ | ||||
| @@ -220,7 +226,6 @@ const DictDataForm: React.FC<DataFormProps> = (props) => { | |||||
| id: 'system.dict.data.status', | id: 'system.dict.data.status', | ||||
| defaultMessage: '状态', | defaultMessage: '状态', | ||||
| })} | })} | ||||
| initialValue={'0'} | |||||
| colProps={{ md: 12, xl: 24 }} | colProps={{ md: 12, xl: 24 }} | ||||
| placeholder="请输入状态" | placeholder="请输入状态" | ||||
| rules={[ | rules={[ | ||||
| @@ -22,8 +22,11 @@ export type LogininforFormProps = { | |||||
| 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; | ||||
| const formLayout = { | |||||
| labelCol: { span: 4 }, | |||||
| wrapperCol: { span: 20 }, | |||||
| }; | |||||
| useEffect(() => { | useEffect(() => { | ||||
| form.resetFields(); | form.resetFields(); | ||||
| @@ -54,7 +57,7 @@ const LogininforForm: React.FC<LogininforFormProps> = (props) => { | |||||
| return ( | return ( | ||||
| <KFModal | <KFModal | ||||
| width={640} | |||||
| width={680} | |||||
| title={intl.formatMessage({ | title={intl.formatMessage({ | ||||
| id: 'system.logininfor.title', | id: 'system.logininfor.title', | ||||
| defaultMessage: '编辑系统访问记录', | defaultMessage: '编辑系统访问记录', | ||||
| @@ -65,7 +68,16 @@ const LogininforForm: React.FC<LogininforFormProps> = (props) => { | |||||
| onOk={handleOk} | onOk={handleOk} | ||||
| onCancel={handleCancel} | onCancel={handleCancel} | ||||
| > | > | ||||
| <ProForm form={form} grid={true} layout="horizontal" onFinish={handleFinish}> | |||||
| <ProForm | |||||
| form={form} | |||||
| grid={true} | |||||
| layout="horizontal" | |||||
| onFinish={handleFinish} | |||||
| {...formLayout} | |||||
| size="large" | |||||
| labelAlign="right" | |||||
| autoComplete="off" | |||||
| > | |||||
| <ProFormDigit | <ProFormDigit | ||||
| name="infoId" | name="infoId" | ||||
| label={intl.formatMessage({ | label={intl.formatMessage({ | ||||
| @@ -24,8 +24,11 @@ export type NoticeFormProps = { | |||||
| const NoticeForm: React.FC<NoticeFormProps> = (props) => { | const NoticeForm: React.FC<NoticeFormProps> = (props) => { | ||||
| const [form] = Form.useForm(); | const [form] = Form.useForm(); | ||||
| const { noticeTypeOptions, statusOptions } = props; | const { noticeTypeOptions, statusOptions } = props; | ||||
| const formLayout = { | |||||
| labelCol: { span: 4 }, | |||||
| wrapperCol: { span: 20 }, | |||||
| }; | |||||
| useEffect(() => { | useEffect(() => { | ||||
| form.resetFields(); | form.resetFields(); | ||||
| @@ -34,7 +37,7 @@ const NoticeForm: React.FC<NoticeFormProps> = (props) => { | |||||
| noticeTitle: props.values.noticeTitle, | noticeTitle: props.values.noticeTitle, | ||||
| noticeType: props.values.noticeType, | noticeType: props.values.noticeType, | ||||
| noticeContent: props.values.noticeContent, | noticeContent: props.values.noticeContent, | ||||
| status: props.values.status, | |||||
| status: props.values.status || Object.keys(statusOptions)[0], | |||||
| createBy: props.values.createBy, | createBy: props.values.createBy, | ||||
| createTime: props.values.createTime, | createTime: props.values.createTime, | ||||
| updateBy: props.values.updateBy, | updateBy: props.values.updateBy, | ||||
| @@ -56,7 +59,7 @@ const NoticeForm: React.FC<NoticeFormProps> = (props) => { | |||||
| return ( | return ( | ||||
| <KFModal | <KFModal | ||||
| width={640} | |||||
| width={680} | |||||
| title={intl.formatMessage({ | title={intl.formatMessage({ | ||||
| id: 'system.notice.title', | id: 'system.notice.title', | ||||
| defaultMessage: '编辑通知公告', | defaultMessage: '编辑通知公告', | ||||
| @@ -73,6 +76,10 @@ const NoticeForm: React.FC<NoticeFormProps> = (props) => { | |||||
| submitter={false} | submitter={false} | ||||
| layout="horizontal" | layout="horizontal" | ||||
| onFinish={handleFinish} | onFinish={handleFinish} | ||||
| {...formLayout} | |||||
| size="large" | |||||
| labelAlign="right" | |||||
| autoComplete="off" | |||||
| > | > | ||||
| <ProFormDigit | <ProFormDigit | ||||
| name="noticeId" | name="noticeId" | ||||
| @@ -29,7 +29,7 @@ const OperlogDetailForm: React.FC<OperlogFormProps> = (props) => { | |||||
| return ( | return ( | ||||
| <KFModal | <KFModal | ||||
| width={640} | |||||
| width={680} | |||||
| title={intl.formatMessage({ | title={intl.formatMessage({ | ||||
| id: 'monitor.operlog.title', | id: 'monitor.operlog.title', | ||||
| defaultMessage: '编辑操作日志记录', | defaultMessage: '编辑操作日志记录', | ||||
| @@ -245,17 +245,17 @@ const OperlogTableList: React.FC = () => { | |||||
| tableAlertRender={false} | tableAlertRender={false} | ||||
| tableAlertOptionRender={false} | tableAlertOptionRender={false} | ||||
| toolBarRender={() => [ | toolBarRender={() => [ | ||||
| <Button | |||||
| type="primary" | |||||
| key="add" | |||||
| hidden={!access.hasPerms('system:operlog:add')} | |||||
| onClick={async () => { | |||||
| setCurrentRow(undefined); | |||||
| setModalVisible(true); | |||||
| }} | |||||
| > | |||||
| <PlusOutlined /> <FormattedMessage id="pages.searchTable.new" defaultMessage="新建" /> | |||||
| </Button>, | |||||
| // <Button | |||||
| // type="primary" | |||||
| // key="add" | |||||
| // hidden={!access.hasPerms('system:operlog:add')} | |||||
| // onClick={async () => { | |||||
| // setCurrentRow(undefined); | |||||
| // setModalVisible(true); | |||||
| // }} | |||||
| // > | |||||
| // <PlusOutlined /> <FormattedMessage id="pages.searchTable.new" defaultMessage="新建" /> | |||||
| // </Button>, | |||||
| <Button | <Button | ||||
| type="primary" | type="primary" | ||||
| key="remove" | key="remove" | ||||
| @@ -33,6 +33,10 @@ const DataScopeForm: React.FC<DataScopeFormProps> = (props) => { | |||||
| ); | ); | ||||
| const [deptTreeExpandKey, setDeptTreeExpandKey] = useState<Key[]>([]); | const [deptTreeExpandKey, setDeptTreeExpandKey] = useState<Key[]>([]); | ||||
| const [checkStrictly, setCheckStrictly] = useState<boolean>(true); | const [checkStrictly, setCheckStrictly] = useState<boolean>(true); | ||||
| const formLayout = { | |||||
| labelCol: { span: 4 }, | |||||
| wrapperCol: { span: 20 }, | |||||
| }; | |||||
| useEffect(() => { | useEffect(() => { | ||||
| setDeptIds(deptCheckedKeys); | setDeptIds(deptCheckedKeys); | ||||
| @@ -91,7 +95,7 @@ const DataScopeForm: React.FC<DataScopeFormProps> = (props) => { | |||||
| return ( | return ( | ||||
| <KFModal | <KFModal | ||||
| width={640} | |||||
| width={680} | |||||
| title={intl.formatMessage({ | title={intl.formatMessage({ | ||||
| id: 'system.user.auth.role', | id: 'system.user.auth.role', | ||||
| defaultMessage: '分配角色', | defaultMessage: '分配角色', | ||||
| @@ -111,6 +115,10 @@ const DataScopeForm: React.FC<DataScopeFormProps> = (props) => { | |||||
| login_password: '', | login_password: '', | ||||
| confirm_password: '', | confirm_password: '', | ||||
| }} | }} | ||||
| {...formLayout} | |||||
| size="large" | |||||
| labelAlign="right" | |||||
| autoComplete="off" | |||||
| > | > | ||||
| <ProFormDigit | <ProFormDigit | ||||
| name="roleId" | name="roleId" | ||||
| @@ -73,7 +73,11 @@ const UserForm: React.FC<UserFormProps> = (props) => { | |||||
| props.onCancel(); | props.onCancel(); | ||||
| }; | }; | ||||
| const handleFinish = async (values: Record<string, any>) => { | const handleFinish = async (values: Record<string, any>) => { | ||||
| props.onSubmit(values as UserFormData); | |||||
| const params = { | |||||
| ...values, | |||||
| userId: props.values.userId, | |||||
| }; | |||||
| props.onSubmit(params as UserFormData); | |||||
| }; | }; | ||||
| return ( | return ( | ||||
| @@ -189,9 +193,6 @@ const UserForm: React.FC<UserFormProps> = (props) => { | |||||
| hidden={userId} | hidden={userId} | ||||
| placeholder="请输入用户账号" | placeholder="请输入用户账号" | ||||
| colProps={{ md: 12, xl: 12 }} | colProps={{ md: 12, xl: 12 }} | ||||
| fieldProps={{ | |||||
| autoComplete: 'off', | |||||
| }} | |||||
| rules={[ | rules={[ | ||||
| { | { | ||||
| required: true, | required: true, | ||||
| @@ -22,7 +22,6 @@ const Login = () => { | |||||
| const [captchaCode, setCaptchaCode] = useState<string>(''); | const [captchaCode, setCaptchaCode] = useState<string>(''); | ||||
| const [uuid, setUuid] = useState<string>(''); | const [uuid, setUuid] = useState<string>(''); | ||||
| const [form] = Form.useForm(); | const [form] = Form.useForm(); | ||||
| const [usernameReadOnly, setUsernameReadOnly] = useState<boolean>(true); | |||||
| const captchaInputRef = useRef<InputRef>(null); | const captchaInputRef = useRef<InputRef>(null); | ||||
| useEffect(() => { | useEffect(() => { | ||||
| @@ -82,7 +81,9 @@ const Login = () => { | |||||
| history.push(urlParams.get('redirect') || '/'); | history.push(urlParams.get('redirect') || '/'); | ||||
| } else { | } else { | ||||
| if (error?.data?.code === 500 && error?.data?.msg === '验证码错误') { | if (error?.data?.code === 500 && error?.data?.msg === '验证码错误') { | ||||
| captchaInputRef.current?.focus(); | |||||
| captchaInputRef.current?.focus({ | |||||
| cursor: 'all', | |||||
| }); | |||||
| } | } | ||||
| clearSessionToken(); | clearSessionToken(); | ||||
| @@ -140,8 +141,6 @@ const Login = () => { | |||||
| placeholder="请输入用户名" | placeholder="请输入用户名" | ||||
| prefix={<LoginInputPrefix icon={require('@/assets/img/login-user.png')} />} | prefix={<LoginInputPrefix icon={require('@/assets/img/login-user.png')} />} | ||||
| allowClear | allowClear | ||||
| readOnly={usernameReadOnly} | |||||
| onFocus={() => setUsernameReadOnly(false)} | |||||
| /> | /> | ||||
| </Form.Item> | </Form.Item> | ||||
| @@ -39,7 +39,7 @@ function patchRouteItems(route: any, menu: any, parentPath: string) { | |||||
| } | } | ||||
| } else { | } else { | ||||
| if (getLocalRoute(route, menuItem)) { | if (getLocalRoute(route, menuItem)) { | ||||
| return; | |||||
| continue; | |||||
| } | } | ||||
| const names: string[] = menuItem.component.split('/'); | const names: string[] = menuItem.component.split('/'); | ||||
| let path = ''; | let path = ''; | ||||
| @@ -24,8 +24,15 @@ export const menuItemRender = (isSubMenu: boolean) => { | |||||
| <span className="kf-menu-item__name">{item.name}</span> | <span className="kf-menu-item__name">{item.name}</span> | ||||
| </> | </> | ||||
| ); | ); | ||||
| if (isSubMenu) { | if (isSubMenu) { | ||||
| return <div className="kf-menu-item">{childen}</div>; | return <div className="kf-menu-item">{childen}</div>; | ||||
| } else if (item.isUrl) { | |||||
| return ( | |||||
| <a href={item.path || ''} target="_blank" className="kf-menu-item" rel="noreferrer"> | |||||
| {childen} | |||||
| </a> | |||||
| ); | |||||
| } else { | } else { | ||||
| return ( | return ( | ||||
| <Link to={item.path || ''} className="kf-menu-item"> | <Link to={item.path || ''} className="kf-menu-item"> | ||||