From 68720f668ccf89a7112a9a25a4e93c44ae3c2100 Mon Sep 17 00:00:00 2001 From: easy <1358086367@qq.com> Date: Wed, 8 Mar 2023 19:07:34 +0800 Subject: [PATCH] =?UTF-8?q?update:=20api=E9=85=8D=E7=BD=AE=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=9B=BF=E6=8D=A2=E3=80=81=E9=80=BB=E8=BE=91=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/global.d.ts | 3 +- src/router/menu.ts | 8 +- .../Platforms/Api/components/ApiDoes.vue | 228 +++++++++-------- .../Platforms/Api/components/ApiTest.vue | 231 ++++++++++++------ .../Platforms/Api/components/ChooseApi.vue | 42 ++-- .../Platforms/Api/components/LeftTree.vue | 7 +- src/views/system/Platforms/Api/index.vue | 56 +++-- src/views/system/Platforms/Api/typing.d.ts | 1 + src/views/system/Platforms/Setting/index.vue | 28 +++ src/views/system/Platforms/index.vue | 2 - 10 files changed, 378 insertions(+), 228 deletions(-) create mode 100644 src/views/system/Platforms/Setting/index.vue diff --git a/src/global.d.ts b/src/global.d.ts index ac2781d7..4c51f4b0 100644 --- a/src/global.d.ts +++ b/src/global.d.ts @@ -11,4 +11,5 @@ declare module '*.bmp'; declare module '*.js'; declare module '*.ts'; declare module 'js-cookie'; -declare module 'jetlinks-ui-components'; \ No newline at end of file +declare module 'jetlinks-ui-components'; +declare module 'vue3-json-viewer'; \ No newline at end of file diff --git a/src/router/menu.ts b/src/router/menu.ts index a0f22e16..3ff3bad7 100644 --- a/src/router/menu.ts +++ b/src/router/menu.ts @@ -67,10 +67,10 @@ export default [ path: '/form', component: () => import('@/views/demo/Form.vue') }, - { - path: '/system/Api', - component: () => import('@/views/system/Platforms/index.vue') - }, + // { + // path: '/system/Api', + // component: () => import('@/views/system/Platforms/index.vue') + // }, // end: 测试用, 可删除 // 初始化 diff --git a/src/views/system/Platforms/Api/components/ApiDoes.vue b/src/views/system/Platforms/Api/components/ApiDoes.vue index b865a90a..1bbcb09a 100644 --- a/src/views/system/Platforms/Api/components/ApiDoes.vue +++ b/src/views/system/Platforms/Api/components/ApiDoes.vue @@ -4,7 +4,7 @@
{{ selectApi.summary }}
- +
@@ -18,6 +18,14 @@ {{ `["/"]` }}

+
+
接口描述
+
{{ props.selectApi.description }}
+
+
+
请求示例
+ +
请求参数
@@ -26,12 +34,13 @@ :dataSource="requestCard.tableData" noPagination model="TABLE" + size="small" >
@@ -44,16 +53,17 @@ :dataSource="responseStatusCard.tableData" noPagination model="TABLE" + size="small" > - - + - + > +
@@ -65,21 +75,19 @@ :dataSource="respParamsCard.tableData" noPagination model="TABLE" + size="small" > - + diff --git a/src/views/system/Platforms/Api/typing.d.ts b/src/views/system/Platforms/Api/typing.d.ts index 0fb45159..7fccdd1f 100644 --- a/src/views/system/Platforms/Api/typing.d.ts +++ b/src/views/system/Platforms/Api/typing.d.ts @@ -22,6 +22,7 @@ export type apiDetailsType = { parameters: any[]; requestBody?: any; responses:object; + description?:string; } export type modeType = 'api'| 'appManger' | 'home' \ No newline at end of file diff --git a/src/views/system/Platforms/Setting/index.vue b/src/views/system/Platforms/Setting/index.vue new file mode 100644 index 00000000..a7ce19ac --- /dev/null +++ b/src/views/system/Platforms/Setting/index.vue @@ -0,0 +1,28 @@ + + + + + \ No newline at end of file diff --git a/src/views/system/Platforms/index.vue b/src/views/system/Platforms/index.vue index 3b3ea430..23458944 100644 --- a/src/views/system/Platforms/index.vue +++ b/src/views/system/Platforms/index.vue @@ -16,5 +16,3 @@ - -