feat(weibo): 增加强制分配权限与账号详情
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { useEffect, useState, useCallback } from 'react';
|
||||
import {
|
||||
Table, Button, Modal, Form, Input, Select, Tag, Popconfirm, Space,
|
||||
Checkbox, Divider, Alert,
|
||||
Checkbox, Divider, Alert, Switch, Typography,
|
||||
} from 'antd';
|
||||
import type { TableProps } from 'antd';
|
||||
import { message } from '../utils/antdMessage';
|
||||
@@ -22,6 +22,9 @@ const ROLE_COLORS: Record<string, string> = {
|
||||
support: 'green',
|
||||
};
|
||||
|
||||
const { Text } = Typography;
|
||||
const WEIBO_FORCE_ASSIGN_PERMISSION = 'weibo:assign:force';
|
||||
|
||||
// 权限分组定义
|
||||
const PERMISSION_GROUPS = [
|
||||
{ label: '用户管理', prefix: 'user:' },
|
||||
@@ -225,6 +228,19 @@ export default function UsersPage() {
|
||||
setSelectedPerms(rolePerms);
|
||||
};
|
||||
|
||||
const handleWeiboForceAssignToggle = (checked: boolean) => {
|
||||
setUseCustom(true);
|
||||
setSelectedPerms((current) => {
|
||||
const next = new Set(current);
|
||||
if (checked) {
|
||||
next.add(WEIBO_FORCE_ASSIGN_PERMISSION);
|
||||
} else {
|
||||
next.delete(WEIBO_FORCE_ASSIGN_PERMISSION);
|
||||
}
|
||||
return Array.from(next);
|
||||
});
|
||||
};
|
||||
|
||||
const columns: TableProps<UserInfo>['columns'] = [
|
||||
{ title: 'ID', dataIndex: 'id', width: 60 },
|
||||
{ title: '用户名', dataIndex: 'username', width: 128, ellipsis: true },
|
||||
@@ -443,6 +459,29 @@ export default function UsersPage() {
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
<Divider style={{ margin: '8px 0 12px' }}>微博高级分配</Divider>
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
alignItems: 'flex-start',
|
||||
gap: 12,
|
||||
marginBottom: 16,
|
||||
}}
|
||||
>
|
||||
<Switch
|
||||
checked={selectedPerms.includes(WEIBO_FORCE_ASSIGN_PERMISSION)}
|
||||
onChange={handleWeiboForceAssignToggle}
|
||||
/>
|
||||
<div>
|
||||
<Text strong>全部账号与强制分配</Text>
|
||||
<div>
|
||||
<Text type="secondary">
|
||||
打开后可查看“全部账号”页签,并把勾选账号或指定标签的账号强制转给客服。
|
||||
该权限仅超级管理员默认拥有,运营默认关闭。
|
||||
</Text>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<Checkbox.Group
|
||||
value={selectedPerms}
|
||||
onChange={(vals) => setSelectedPerms(vals as string[])}
|
||||
|
||||
Reference in New Issue
Block a user