增加用户中心、用户注册登录
This commit is contained in:
@@ -8,6 +8,7 @@ import OperationModal from './components/OperationModal';
|
||||
import type { StoryType } from './data.d';
|
||||
import { addStory, deleteStory, queryTimelineList, updateStory } from './service';
|
||||
import useStyles from './style.style';
|
||||
import AuthorizeStoryModal from './components/AuthorizeStoryModal';
|
||||
|
||||
|
||||
const { Search } = Input;
|
||||
@@ -47,6 +48,7 @@ export const BasicList: FC = () => {
|
||||
const { styles } = useStyles();
|
||||
const [done, setDone] = useState<boolean>(false);
|
||||
const [open, setVisible] = useState<boolean>(false);
|
||||
const [authorizeModelOpen, setAuthorizeModelOpen] = useState<boolean>(false);
|
||||
const [current, setCurrent] = useState<Partial<StoryType> | undefined>(undefined);
|
||||
const {
|
||||
data: listData,
|
||||
@@ -195,7 +197,26 @@ export const BasicList: FC = () => {
|
||||
>
|
||||
编辑
|
||||
</a>,
|
||||
<MoreBtn key="more" item={item} />,
|
||||
// 增加授权操作,可以授权给其他用户
|
||||
<a
|
||||
key="authorize"
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
setCurrent(item);
|
||||
setAuthorizeModelOpen(true);
|
||||
}}
|
||||
>
|
||||
授权
|
||||
</a>,
|
||||
<a
|
||||
key="delete"
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
deleteItem(item.instanceId ?? '');
|
||||
}}
|
||||
>
|
||||
删除
|
||||
</a>,
|
||||
]}
|
||||
>
|
||||
<List.Item.Meta
|
||||
@@ -225,6 +246,17 @@ export const BasicList: FC = () => {
|
||||
onDone={handleDone}
|
||||
onSubmit={handleSubmit}
|
||||
/>
|
||||
<AuthorizeStoryModal
|
||||
open={authorizeModelOpen}
|
||||
current={current}
|
||||
handleOk={(flag) => {
|
||||
if(flag) {
|
||||
run();
|
||||
}
|
||||
setAuthorizeModelOpen(false);
|
||||
setCurrent({});
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user