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