diff --git a/package.json b/package.json index 2295cdce..528c60f4 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "@sentry/vue": "^7.34.0", "@types/mustache": "^4.2.2", "@types/uuid": "^8.3.4", - "axios": "^0.21.1", + "axios": "^1.34.0", "codemirror": "^6.0.1", "copy-to-clipboard": "^3.3.3", "dayjs": "^1.10.7", diff --git a/src/components/document/ListItem.vue b/src/components/document/ListItem.vue index 9b40e74a..6d99eda1 100644 --- a/src/components/document/ListItem.vue +++ b/src/components/document/ListItem.vue @@ -12,8 +12,8 @@ {{ document?.title || document?.api?.title }} - - {{ document?.api?.request?.method }} + + {{ documentType.API.toUpperCase() }} @@ -99,10 +99,12 @@ $height: 35px; display: flex; } } - .method { + .type { + display: none; position: absolute; - right: 10px; + right: 5px; top: 5px; + border-radius: 10px; } } diff --git a/src/layouts/Document.vue b/src/layouts/Document.vue index 83ebf0b3..c91fddbe 100644 --- a/src/layouts/Document.vue +++ b/src/layouts/Document.vue @@ -57,6 +57,7 @@ export default { height: 100%; padding: 30px; box-shadow: 1px 0 0 #eee; + padding-right: 0; } } diff --git a/src/operators/document/operator.ts b/src/operators/document/operator.ts index a212cc11..c356aa2a 100644 --- a/src/operators/document/operator.ts +++ b/src/operators/document/operator.ts @@ -1,4 +1,4 @@ -import { AxiosResponse } from 'axios'; +import { AxiosRequestConfig, AxiosResponse } from 'axios'; import { httpClient } from '../instance'; import { IDocument, IDocumentDetailResponse, IDocumentListResponse } from './models'; @@ -12,26 +12,32 @@ export interface IDocumentQuery { class DocumentOperator { key = 'documents'; - async getAll(query: IDocumentQuery): Promise> { + async getAll(query: IDocumentQuery, config?: AxiosRequestConfig): Promise> { return await httpClient.get(`/${this.key}/`, { + ...config, params: query }); } - async get(id: string): Promise> { - return await httpClient.get(`/${this.key}/${id}`); + async get(id: string, config?: AxiosRequestConfig): Promise> { + console.log('sss', config); + return await httpClient.get(`/${this.key}/${id}`, config); } - async create(data: IDocument): Promise> { - return await httpClient.post(`/${this.key}/`, data); + async create(data: IDocument, config?: AxiosRequestConfig): Promise> { + return await httpClient.post(`/${this.key}/`, data, config); } - async update(id: string, data: IDocument): Promise> { - return await httpClient.put(`/${this.key}/${id}`, data); + async update( + id: string, + data: IDocument, + config?: AxiosRequestConfig + ): Promise> { + return await httpClient.put(`/${this.key}/${id}`, data, config); } - async delete(id: string): Promise> { - return await httpClient.delete(`/${this.key}/${id}`); + async delete(id: string, config?: AxiosRequestConfig): Promise> { + return await httpClient.delete(`/${this.key}/${id}`, config); } } diff --git a/src/pages/console/application/List.vue b/src/pages/console/application/List.vue index 23ecdef0..c8726049 100644 --- a/src/pages/console/application/List.vue +++ b/src/pages/console/application/List.vue @@ -25,14 +25,18 @@ :label="$t('application.field.remainingCount')" width="100px" class-name="text-center" - /> + > + + - +