diff --git a/src/apis/system/type.ts b/src/apis/system/type.ts index fc7c652..3aecca2 100644 --- a/src/apis/system/type.ts +++ b/src/apis/system/type.ts @@ -296,8 +296,8 @@ export interface ClientResp { timeout: string status: string isConcurrent: boolean - maxLoginCount: number replacedRange: string + maxLoginCount: number overflowLogoutMode: string createUser: string createTime: string diff --git a/src/views/system/config/client/AddModal.vue b/src/views/system/config/client/AddModal.vue index 23bf5a4..ffb6640 100644 --- a/src/views/system/config/client/AddModal.vue +++ b/src/views/system/config/client/AddModal.vue @@ -39,8 +39,6 @@ const [form, resetForm] = useResetReactive({ timeout: 86400, isConcurrent: true, maxLoginCount: -1, - replacedRange: 'ALL_DEVICE_TYPE', - overflowLogoutMode: 'KICKOUT', status: 1, }) @@ -82,7 +80,7 @@ const columns: ColumnItem[] = reactive([ }, { label: () => ( - + Token 最低活跃频率  @@ -102,7 +100,7 @@ const columns: ColumnItem[] = reactive([ }, { label: () => ( - + Token 有效期 @@ -133,39 +131,6 @@ const columns: ColumnItem[] = reactive([ uncheckedText: '不允许', }, }, - { - label: () => ( - - 最大登录数量 - - - ), - field: 'maxLoginCount', - type: 'input-number', - span: 12, - slots: { - append: () => ( - - ), - }, - props: { - placeholder: '请输入最大登录数量', - min: -1, - }, - disabled: () => { - return !form.isConcurrent - }, - rules: [ - { - validator: (value: number, callback: (errorMessage?: string) => void) => { - if (value === 0) { - callback('最大登录数量不能为0,请输入-1或正整数') - } - callback() - }, - }, - ], - }, { label: '顶人下线的范围', field: 'replacedRange', @@ -180,13 +145,49 @@ const columns: ColumnItem[] = reactive([ }, }, { - label: '溢出人数的注销方式', + label: () => ( + + 同一账号最大登录数量 + + + ), + field: 'maxLoginCount', + type: 'input-number', + span: 12, + slots: { + append: () => ( + + ), + }, + 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', type: 'select', span: 12, props: { options: logout_mode_enum, - placeholder: '请选择溢出人数的注销方式', + placeholder: '请选择溢出人数的下线方式', + }, + disabled: () => { + return form.maxLoginCount === -1 || form.maxLoginCount === 0 }, }, { diff --git a/src/views/system/config/client/DetailDrawer.vue b/src/views/system/config/client/DetailDrawer.vue index 889ded9..2921621 100644 --- a/src/views/system/config/client/DetailDrawer.vue +++ b/src/views/system/config/client/DetailDrawer.vue @@ -17,17 +17,17 @@ 启用 禁用 - + 允许 不允许 - - {{ dataDetail?.maxLoginCount === -1 ? '不限' : dataDetail?.maxLoginCount }} - - + - + + {{ dataDetail?.maxLoginCount === -1 ? '不限制' : dataDetail?.maxLoginCount }} + + {{ dataDetail?.createUserString }} diff --git a/src/views/system/config/client/index.vue b/src/views/system/config/client/index.vue index 0e2b59f..602554c 100644 --- a/src/views/system/config/client/index.vue +++ b/src/views/system/config/client/index.vue @@ -5,7 +5,7 @@ :data="dataList" :columns="columns" :loading="loading" - :scroll="{ x: '100%', y: '100%', minWidth: 1200 }" + :scroll="{ x: '100%', y: '100%', minWidth: 1400 }" :pagination="pagination" :disabled-tools="['size']" :disabled-column-keys="['clientKey']" @@ -114,6 +114,7 @@ const columns: TableInstance['columns'] = [ title: '客户端 ID', dataIndex: 'clientId', slotName: 'clientId', + width: 180, ellipsis: true, tooltip: true, 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: 'timeout', slotName: 'timeout', align: 'center', render: ({ record }) => `${record.timeout} 秒` }, + { title: 'Token 有效期', dataIndex: 'timeout', slotName: 'timeout', width: 180, align: 'center', render: ({ record }) => `${record.timeout} 秒` }, { title: '状态', dataIndex: 'status', @@ -158,7 +159,7 @@ const columns: TableInstance['columns'] = [ }, }, { - title: '是否允许多地登录', + title: '多地登录', dataIndex: 'isConcurrent', align: 'center', render: ({ record }) => { @@ -166,15 +167,7 @@ const columns: TableInstance['columns'] = [ }, }, { - title: '最大登录数量', - dataIndex: 'maxLoginCount', - align: 'center', - render: ({ record }) => { - return record.maxLoginCount === -1 ? '不限' : record.maxLoginCount - }, - }, - { - title: '顶人下线范围', + title: '下线范围', dataIndex: 'replacedRange', align: 'center', 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', align: 'center', render: ({ record }) => { @@ -194,6 +195,7 @@ const columns: TableInstance['columns'] = [ title: '操作', dataIndex: 'action', slotName: 'action', + width: 160, align: 'center', fixed: !isMobile() ? 'right' : undefined, show: has.hasPermOr(['system:client:get', 'system:client:update', 'system:client:delete']),