mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-12-07 22:57:15 +08:00
refactor(system/client): 优化客户端配置代码
This commit is contained in:
@@ -296,8 +296,8 @@ export interface ClientResp {
|
|||||||
timeout: string
|
timeout: string
|
||||||
status: string
|
status: string
|
||||||
isConcurrent: boolean
|
isConcurrent: boolean
|
||||||
maxLoginCount: number
|
|
||||||
replacedRange: string
|
replacedRange: string
|
||||||
|
maxLoginCount: number
|
||||||
overflowLogoutMode: string
|
overflowLogoutMode: string
|
||||||
createUser: string
|
createUser: string
|
||||||
createTime: string
|
createTime: string
|
||||||
|
|||||||
@@ -39,8 +39,6 @@ const [form, resetForm] = useResetReactive({
|
|||||||
timeout: 86400,
|
timeout: 86400,
|
||||||
isConcurrent: true,
|
isConcurrent: true,
|
||||||
maxLoginCount: -1,
|
maxLoginCount: -1,
|
||||||
replacedRange: 'ALL_DEVICE_TYPE',
|
|
||||||
overflowLogoutMode: 'KICKOUT',
|
|
||||||
status: 1,
|
status: 1,
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -82,7 +80,7 @@ const columns: ColumnItem[] = reactive([
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: () => (
|
label: () => (
|
||||||
<a-tooltip content="-1 代表不限制,永不冻结">
|
<a-tooltip content="-1:不限制,永不冻结">
|
||||||
Token 最低活跃频率
|
Token 最低活跃频率
|
||||||
<icon-question-circle />
|
<icon-question-circle />
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
@@ -102,7 +100,7 @@ const columns: ColumnItem[] = reactive([
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: () => (
|
label: () => (
|
||||||
<a-tooltip content="-1 代表永不过期">
|
<a-tooltip content="-1:永不过期">
|
||||||
Token 有效期
|
Token 有效期
|
||||||
<icon-question-circle />
|
<icon-question-circle />
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
@@ -133,39 +131,6 @@ const columns: ColumnItem[] = reactive([
|
|||||||
uncheckedText: '不允许',
|
uncheckedText: '不允许',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
label: () => (
|
|
||||||
<a-tooltip content="-1 代表不限">
|
|
||||||
最大登录数量
|
|
||||||
<icon-question-circle />
|
|
||||||
</a-tooltip>
|
|
||||||
),
|
|
||||||
field: 'maxLoginCount',
|
|
||||||
type: 'input-number',
|
|
||||||
span: 12,
|
|
||||||
slots: {
|
|
||||||
append: () => (
|
|
||||||
<span style={{ width: '80px', textAlign: 'center' }}>个</span>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
placeholder: '请输入最大登录数量',
|
|
||||||
min: -1,
|
|
||||||
},
|
|
||||||
disabled: () => {
|
|
||||||
return !form.isConcurrent
|
|
||||||
},
|
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
validator: (value: number, callback: (errorMessage?: string) => void) => {
|
|
||||||
if (value === 0) {
|
|
||||||
callback('最大登录数量不能为0,请输入-1或正整数')
|
|
||||||
}
|
|
||||||
callback()
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
label: '顶人下线的范围',
|
label: '顶人下线的范围',
|
||||||
field: 'replacedRange',
|
field: 'replacedRange',
|
||||||
@@ -180,13 +145,49 @@ const columns: ColumnItem[] = reactive([
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '溢出人数的注销方式',
|
label: () => (
|
||||||
|
<a-tooltip content="-1:不限制">
|
||||||
|
同一账号最大登录数量
|
||||||
|
<icon-question-circle />
|
||||||
|
</a-tooltip>
|
||||||
|
),
|
||||||
|
field: 'maxLoginCount',
|
||||||
|
type: 'input-number',
|
||||||
|
span: 12,
|
||||||
|
slots: {
|
||||||
|
append: () => (
|
||||||
|
<span style={{ width: '30px', textAlign: 'center' }}>个</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
placeholder: '请输入同一账号最大登录数量',
|
||||||
|
min: -1,
|
||||||
|
},
|
||||||
|
disabled: () => {
|
||||||
|
return !form.isConcurrent
|
||||||
|
},
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
validator: (value: number, callback: (errorMessage?: string) => void) => {
|
||||||
|
if (value <= 0 && value !== -1) {
|
||||||
|
callback('最大登录数量只能为 -1 或正整数')
|
||||||
|
}
|
||||||
|
callback()
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '溢出人数的下线方式',
|
||||||
field: 'overflowLogoutMode',
|
field: 'overflowLogoutMode',
|
||||||
type: 'select',
|
type: 'select',
|
||||||
span: 12,
|
span: 12,
|
||||||
props: {
|
props: {
|
||||||
options: logout_mode_enum,
|
options: logout_mode_enum,
|
||||||
placeholder: '请选择溢出人数的注销方式',
|
placeholder: '请选择溢出人数的下线方式',
|
||||||
|
},
|
||||||
|
disabled: () => {
|
||||||
|
return form.maxLoginCount === -1 || form.maxLoginCount === 0
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -17,17 +17,17 @@
|
|||||||
<a-tag v-if="dataDetail?.status === 1" color="green">启用</a-tag>
|
<a-tag v-if="dataDetail?.status === 1" color="green">启用</a-tag>
|
||||||
<a-tag v-else color="red">禁用</a-tag>
|
<a-tag v-else color="red">禁用</a-tag>
|
||||||
</a-descriptions-item>
|
</a-descriptions-item>
|
||||||
<a-descriptions-item label="是否允许多地登录" :span="2">
|
<a-descriptions-item label="多地登录">
|
||||||
<a-tag v-if="dataDetail?.isConcurrent" color="blue">允许</a-tag>
|
<a-tag v-if="dataDetail?.isConcurrent" color="blue">允许</a-tag>
|
||||||
<a-tag v-else color="orange">不允许</a-tag>
|
<a-tag v-else color="orange">不允许</a-tag>
|
||||||
</a-descriptions-item>
|
</a-descriptions-item>
|
||||||
<a-descriptions-item label="最大登录数量">
|
<a-descriptions-item label="下线范围">
|
||||||
{{ dataDetail?.maxLoginCount === -1 ? '不限' : dataDetail?.maxLoginCount }}
|
|
||||||
</a-descriptions-item>
|
|
||||||
<a-descriptions-item label="顶人下线范围">
|
|
||||||
<GiCellTag :value="dataDetail?.replacedRange" :dict="replaced_range_enum" />
|
<GiCellTag :value="dataDetail?.replacedRange" :dict="replaced_range_enum" />
|
||||||
</a-descriptions-item>
|
</a-descriptions-item>
|
||||||
<a-descriptions-item label="溢出注销方式" :span="2">
|
<a-descriptions-item label="登录数量">
|
||||||
|
{{ dataDetail?.maxLoginCount === -1 ? '不限制' : dataDetail?.maxLoginCount }}
|
||||||
|
</a-descriptions-item>
|
||||||
|
<a-descriptions-item label="溢出处理">
|
||||||
<GiCellTag :value="dataDetail?.overflowLogoutMode" :dict="logout_mode_enum" />
|
<GiCellTag :value="dataDetail?.overflowLogoutMode" :dict="logout_mode_enum" />
|
||||||
</a-descriptions-item>
|
</a-descriptions-item>
|
||||||
<a-descriptions-item label="创建人">{{ dataDetail?.createUserString }}</a-descriptions-item>
|
<a-descriptions-item label="创建人">{{ dataDetail?.createUserString }}</a-descriptions-item>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
:data="dataList"
|
:data="dataList"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:scroll="{ x: '100%', y: '100%', minWidth: 1200 }"
|
:scroll="{ x: '100%', y: '100%', minWidth: 1400 }"
|
||||||
:pagination="pagination"
|
:pagination="pagination"
|
||||||
:disabled-tools="['size']"
|
:disabled-tools="['size']"
|
||||||
:disabled-column-keys="['clientKey']"
|
:disabled-column-keys="['clientKey']"
|
||||||
@@ -114,6 +114,7 @@ const columns: TableInstance['columns'] = [
|
|||||||
title: '客户端 ID',
|
title: '客户端 ID',
|
||||||
dataIndex: 'clientId',
|
dataIndex: 'clientId',
|
||||||
slotName: 'clientId',
|
slotName: 'clientId',
|
||||||
|
width: 180,
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
tooltip: true,
|
tooltip: true,
|
||||||
render: ({ record }) => {
|
render: ({ record }) => {
|
||||||
@@ -147,7 +148,7 @@ const columns: TableInstance['columns'] = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{ title: 'Token 最低活跃频率', dataIndex: 'activeTimeout', slotName: 'activeTimeout', width: 180, align: 'center', render: ({ record }) => `${record.activeTimeout} 秒` },
|
{ title: 'Token 最低活跃频率', dataIndex: 'activeTimeout', slotName: 'activeTimeout', width: 180, align: 'center', render: ({ record }) => `${record.activeTimeout} 秒` },
|
||||||
{ title: 'Token 有效期', dataIndex: 'timeout', slotName: 'timeout', align: 'center', render: ({ record }) => `${record.timeout} 秒` },
|
{ title: 'Token 有效期', dataIndex: 'timeout', slotName: 'timeout', width: 180, align: 'center', render: ({ record }) => `${record.timeout} 秒` },
|
||||||
{
|
{
|
||||||
title: '状态',
|
title: '状态',
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
@@ -158,7 +159,7 @@ const columns: TableInstance['columns'] = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '是否允许多地登录',
|
title: '多地登录',
|
||||||
dataIndex: 'isConcurrent',
|
dataIndex: 'isConcurrent',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
render: ({ record }) => {
|
render: ({ record }) => {
|
||||||
@@ -166,15 +167,7 @@ const columns: TableInstance['columns'] = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '最大登录数量',
|
title: '下线范围',
|
||||||
dataIndex: 'maxLoginCount',
|
|
||||||
align: 'center',
|
|
||||||
render: ({ record }) => {
|
|
||||||
return record.maxLoginCount === -1 ? '不限' : record.maxLoginCount
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '顶人下线范围',
|
|
||||||
dataIndex: 'replacedRange',
|
dataIndex: 'replacedRange',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
render: ({ record }) => {
|
render: ({ record }) => {
|
||||||
@@ -182,7 +175,15 @@ const columns: TableInstance['columns'] = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '溢出注销方式',
|
title: '登录数量',
|
||||||
|
dataIndex: 'maxLoginCount',
|
||||||
|
align: 'center',
|
||||||
|
render: ({ record }) => {
|
||||||
|
return record.maxLoginCount === -1 ? '不限制' : record.maxLoginCount
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '溢出处理',
|
||||||
dataIndex: 'overflowLogoutMode',
|
dataIndex: 'overflowLogoutMode',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
render: ({ record }) => {
|
render: ({ record }) => {
|
||||||
@@ -194,6 +195,7 @@ const columns: TableInstance['columns'] = [
|
|||||||
title: '操作',
|
title: '操作',
|
||||||
dataIndex: 'action',
|
dataIndex: 'action',
|
||||||
slotName: 'action',
|
slotName: 'action',
|
||||||
|
width: 160,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
fixed: !isMobile() ? 'right' : undefined,
|
fixed: !isMobile() ? 'right' : undefined,
|
||||||
show: has.hasPermOr(['system:client:get', 'system:client:update', 'system:client:delete']),
|
show: has.hasPermOr(['system:client:get', 'system:client:update', 'system:client:delete']),
|
||||||
|
|||||||
Reference in New Issue
Block a user