|
@ -1,3 +1,4 @@ |
|
|
|
|
|
import { useModel } from '@umijs/max'; |
|
|
import { Button, Form, Input, Modal, Select, Table, Tag } from 'antd'; |
|
|
import { Button, Form, Input, Modal, Select, Table, Tag } from 'antd'; |
|
|
import { ColumnsType } from 'antd/es/table'; |
|
|
import { ColumnsType } from 'antd/es/table'; |
|
|
import React, { useEffect, useState } from 'react'; |
|
|
import React, { useEffect, useState } from 'react'; |
|
@ -9,6 +10,8 @@ const AdminManagement = () => { |
|
|
const [visible, setVisible] = useState(false); |
|
|
const [visible, setVisible] = useState(false); |
|
|
const [form] = Form.useForm(); |
|
|
const [form] = Form.useForm(); |
|
|
const [appArr, setAppArr] = useState<API.MatrixApp[]>([]); |
|
|
const [appArr, setAppArr] = useState<API.MatrixApp[]>([]); |
|
|
|
|
|
const { initialState } = useModel('@@initialState'); |
|
|
|
|
|
const currentUser = initialState?.currentUser; |
|
|
|
|
|
|
|
|
const getAppNameById = (appId:number) => { |
|
|
const getAppNameById = (appId:number) => { |
|
|
const app = appArr.find(app => app.id === appId); |
|
|
const app = appArr.find(app => app.id === appId); |
|
@ -144,7 +147,7 @@ const AdminManagement = () => { |
|
|
</Form.Item> |
|
|
</Form.Item> |
|
|
<Form.Item label="角色" name="role"> |
|
|
<Form.Item label="角色" name="role"> |
|
|
<Select> |
|
|
<Select> |
|
|
<Select.Option value={2}>管理员</Select.Option> |
|
|
<Select.Option disabled={currentUser?.role && currentUser.role > 1} value={2}>管理员</Select.Option> |
|
|
<Select.Option value={3}>普通账号</Select.Option> |
|
|
<Select.Option value={3}>普通账号</Select.Option> |
|
|
</Select> |
|
|
</Select> |
|
|
</Form.Item> |
|
|
</Form.Item> |
|
|