mirror of
				https://github.com/continew-org/continew-admin-ui.git
				synced 2025-11-04 10:57:08 +08:00 
			
		
		
		
	chore: 客户端管理 => 终端管理
This commit is contained in:
		@@ -5,27 +5,27 @@ export type * from './type'
 | 
			
		||||
 | 
			
		||||
const BASE_URL = '/system/client'
 | 
			
		||||
 | 
			
		||||
/** @desc 查询客户端列表 */
 | 
			
		||||
/** @desc 查询终端列表 */
 | 
			
		||||
export function listClient(query: T.ClientPageQuery) {
 | 
			
		||||
  return http.get<PageRes<T.ClientResp[]>>(`${BASE_URL}`, query)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/** @desc 查询客户端详情 */
 | 
			
		||||
/** @desc 查询终端详情 */
 | 
			
		||||
export function getClient(id: string) {
 | 
			
		||||
  return http.get<T.ClientDetailResp>(`${BASE_URL}/${id}`)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/** @desc 新增客户端 */
 | 
			
		||||
/** @desc 新增终端 */
 | 
			
		||||
export function addClient(data: any) {
 | 
			
		||||
  return http.post(`${BASE_URL}`, data)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/** @desc 修改客户端 */
 | 
			
		||||
/** @desc 修改终端 */
 | 
			
		||||
export function updateClient(data: any, id: string) {
 | 
			
		||||
  return http.put(`${BASE_URL}/${id}`, data)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/** @desc 删除客户端 */
 | 
			
		||||
/** @desc 删除终端 */
 | 
			
		||||
export function deleteClient(ids: string | Array<string>) {
 | 
			
		||||
  return http.del(`${BASE_URL}/${ids}`)
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -259,7 +259,7 @@ export interface StorageQuery {
 | 
			
		||||
export interface StoragePageQuery extends StorageQuery, PageQuery {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/** 客户端类型 */
 | 
			
		||||
/** 终端类型 */
 | 
			
		||||
export interface ClientResp {
 | 
			
		||||
  id: string
 | 
			
		||||
  clientId: string
 | 
			
		||||
 
 | 
			
		||||
@@ -32,7 +32,7 @@ const { width } = useWindowSize()
 | 
			
		||||
const dataId = ref('')
 | 
			
		||||
const visible = ref(false)
 | 
			
		||||
const isUpdate = computed(() => !!dataId.value)
 | 
			
		||||
const title = computed(() => (isUpdate.value ? '修改客户端' : '新增客户端'))
 | 
			
		||||
const title = computed(() => (isUpdate.value ? '修改终端' : '新增终端'))
 | 
			
		||||
const formRef = ref<InstanceType<typeof GiForm>>()
 | 
			
		||||
const { client_type, auth_type_enum } = useDict('auth_type_enum', 'client_type')
 | 
			
		||||
 | 
			
		||||
@@ -56,20 +56,20 @@ const handleGenerate = () => {
 | 
			
		||||
 | 
			
		||||
const columns: Columns = reactive([
 | 
			
		||||
  {
 | 
			
		||||
    label: '客户端 Key',
 | 
			
		||||
    label: '终端 Key',
 | 
			
		||||
    field: 'clientKey',
 | 
			
		||||
    type: 'input',
 | 
			
		||||
    rules: [{ required: true, message: '请输入客户端 Key' }],
 | 
			
		||||
    rules: [{ required: true, message: '请输入终端 Key' }],
 | 
			
		||||
    span: 2,
 | 
			
		||||
    disabled: () => {
 | 
			
		||||
      return isUpdate.value
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    label: '客户端秘钥',
 | 
			
		||||
    label: '终端秘钥',
 | 
			
		||||
    field: 'clientSecret',
 | 
			
		||||
    type: 'input',
 | 
			
		||||
    rules: [{ required: true, message: '请输入客户端秘钥' }],
 | 
			
		||||
    rules: [{ required: true, message: '请输入终端秘钥' }],
 | 
			
		||||
    span: 2,
 | 
			
		||||
    disabled: () => {
 | 
			
		||||
      return isUpdate.value
 | 
			
		||||
@@ -97,11 +97,11 @@ const columns: Columns = reactive([
 | 
			
		||||
    rules: [{ required: true, message: '请选择认证类型' }],
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    label: '客户端类型',
 | 
			
		||||
    label: '终端类型',
 | 
			
		||||
    field: 'clientType',
 | 
			
		||||
    type: 'select',
 | 
			
		||||
    options: client_type,
 | 
			
		||||
    rules: [{ required: true, message: '请选择客户端类型' }],
 | 
			
		||||
    rules: [{ required: true, message: '请选择终端类型' }],
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    label: () => (
 | 
			
		||||
 
 | 
			
		||||
@@ -1,16 +1,16 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <a-drawer v-model:visible="visible" title="客户端详情" :width="width >= 600 ? 600 : '100%'" :footer="false">
 | 
			
		||||
  <a-drawer v-model:visible="visible" title="终端详情" :width="width >= 600 ? 600 : '100%'" :footer="false">
 | 
			
		||||
    <a-descriptions :column="1" size="large" class="general-description">
 | 
			
		||||
      <a-descriptions-item label="ID">{{ dataDetail?.id }}</a-descriptions-item>
 | 
			
		||||
      <a-descriptions-item label="客户端ID"><a-typography-paragraph :copyable="!!dataDetail?.clientId">{{ dataDetail?.clientId }}</a-typography-paragraph></a-descriptions-item>
 | 
			
		||||
      <a-descriptions-item label="客户端Key">{{ dataDetail?.clientKey }}</a-descriptions-item>
 | 
			
		||||
      <a-descriptions-item label="客户端秘钥">{{ dataDetail?.clientSecret }}</a-descriptions-item>
 | 
			
		||||
      <a-descriptions-item label="终端ID"><a-typography-paragraph :copyable="!!dataDetail?.clientId">{{ dataDetail?.clientId }}</a-typography-paragraph></a-descriptions-item>
 | 
			
		||||
      <a-descriptions-item label="终端Key">{{ dataDetail?.clientKey }}</a-descriptions-item>
 | 
			
		||||
      <a-descriptions-item label="终端秘钥">{{ dataDetail?.clientSecret }}</a-descriptions-item>
 | 
			
		||||
      <a-descriptions-item label="认证类型">
 | 
			
		||||
        <a-space>
 | 
			
		||||
          <GiCellTag v-for="(item, index) in dataDetail?.authType" :key="index" :value="item" :dict="auth_type_enum" />
 | 
			
		||||
        </a-space>
 | 
			
		||||
      </a-descriptions-item>
 | 
			
		||||
      <a-descriptions-item label="客户端类型">
 | 
			
		||||
      <a-descriptions-item label="终端类型">
 | 
			
		||||
        <GiCellTag :value="dataDetail?.clientType" :dict="client_type" />
 | 
			
		||||
      </a-descriptions-item>
 | 
			
		||||
      <a-descriptions-item label="Token最低活跃频率">{{ dataDetail?.activeTimeout }}</a-descriptions-item>
 | 
			
		||||
 
 | 
			
		||||
@@ -13,12 +13,12 @@
 | 
			
		||||
      @refresh="search"
 | 
			
		||||
    >
 | 
			
		||||
      <template #toolbar-left>
 | 
			
		||||
        <a-input-search v-model="queryForm.clientKey" placeholder="搜索客户端Key" allow-clear @search="search" />
 | 
			
		||||
        <a-input-search v-model="queryForm.clientSecret" placeholder="搜索客户端秘钥" allow-clear @search="search" />
 | 
			
		||||
        <a-input-search v-model="queryForm.clientKey" placeholder="搜索终端Key" allow-clear @search="search" />
 | 
			
		||||
        <a-input-search v-model="queryForm.clientSecret" placeholder="搜索终端秘钥" allow-clear @search="search" />
 | 
			
		||||
        <a-select
 | 
			
		||||
          v-model="queryForm.clientType"
 | 
			
		||||
          :options="client_type"
 | 
			
		||||
          placeholder="请选择客户端类型"
 | 
			
		||||
          placeholder="请选择终端类型"
 | 
			
		||||
          allow-clear
 | 
			
		||||
          style="width: 160px"
 | 
			
		||||
          @change="search"
 | 
			
		||||
@@ -114,7 +114,7 @@ const columns: TableInstanceColumns[] = [
 | 
			
		||||
    fixed: !isMobile() ? 'left' : undefined,
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    title: '客户端 ID',
 | 
			
		||||
    title: '终端 ID',
 | 
			
		||||
    dataIndex: 'clientId',
 | 
			
		||||
    slotName: 'clientId',
 | 
			
		||||
    ellipsis: true,
 | 
			
		||||
@@ -125,8 +125,8 @@ const columns: TableInstanceColumns[] = [
 | 
			
		||||
      )
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
  { title: '客户端 Key', dataIndex: 'clientKey', slotName: 'clientKey', ellipsis: true, tooltip: true, align: 'center' },
 | 
			
		||||
  { title: '客户端秘钥', dataIndex: 'clientSecret', slotName: 'clientSecret', ellipsis: true, tooltip: true, align: 'center' },
 | 
			
		||||
  { title: '终端 Key', dataIndex: 'clientKey', slotName: 'clientKey', ellipsis: true, tooltip: true, align: 'center' },
 | 
			
		||||
  { title: '终端秘钥', dataIndex: 'clientSecret', slotName: 'clientSecret', ellipsis: true, tooltip: true, align: 'center' },
 | 
			
		||||
  {
 | 
			
		||||
    title: '认证类型',
 | 
			
		||||
    dataIndex: 'authType',
 | 
			
		||||
@@ -141,7 +141,7 @@ const columns: TableInstanceColumns[] = [
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    title: '客户端类型',
 | 
			
		||||
    title: '终端类型',
 | 
			
		||||
    dataIndex: 'clientType',
 | 
			
		||||
    slotName: 'clientType',
 | 
			
		||||
    ellipsis: true,
 | 
			
		||||
@@ -190,7 +190,7 @@ const reset = () => {
 | 
			
		||||
// 删除
 | 
			
		||||
const onDelete = (record: ClientResp) => {
 | 
			
		||||
  return handleDelete(() => deleteClient(record.id), {
 | 
			
		||||
    content: `是否确定删除客户端「${record.clientKey}(${record.clientId})」?`,
 | 
			
		||||
    content: `是否确定删除终端「${record.clientKey}(${record.clientId})」?`,
 | 
			
		||||
    showModal: true,
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user