adjust serializer for foreign object and id
This commit is contained in:
1 parent
1bc2068e7b
commit
c266894f87
7 files changed
+39
-14
No files matched your search
@@ -12,15 +12,30 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="right">
|
||||
<el-select
|
||||
v-if="item?.enum"
|
||||
v-model="value[itemKey?.toString()]"
|
||||
clearable
|
||||
:placeholder="$t('common.title.select')"
|
||||
>
|
||||
<el-option v-for="e in item?.enum" :key="e" :label="e" :value="e" />
|
||||
</el-select>
|
||||
<el-input v-else v-model="value[itemKey?.toString()]" />
|
||||
<div v-if="itemKey === 'api_key'">
|
||||
<el-popover
|
||||
placement="bottom"
|
||||
title="Title"
|
||||
:width="200"
|
||||
trigger="click"
|
||||
content="this is content, this is content, this is content"
|
||||
>
|
||||
<template #reference>
|
||||
<el-button class="m-2">Click to activate</el-button>
|
||||
</template>
|
||||
</el-popover>
|
||||
</div>
|
||||
<div v-else>
|
||||
<el-select
|
||||
v-if="item?.enum"
|
||||
v-model="value[itemKey?.toString()]"
|
||||
clearable
|
||||
:placeholder="$t('common.title.select')"
|
||||
>
|
||||
<el-option v-for="e in item?.enum" :key="e" :label="e" :value="e" />
|
||||
</el-select>
|
||||
<el-input v-else v-model="value[itemKey?.toString()]" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import { IApi, IApiDetailResponse, IForm } from '@/operators/api/models';
|
||||
import { IApi, IForm } from '@/operators/api/models';
|
||||
import ApiForm from './Form.vue';
|
||||
import ApiResult from './Result.vue';
|
||||
import urlJoin from 'url-join';
|
||||
|
||||
@@ -90,7 +90,7 @@ export default defineComponent({
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
serviceOperator.get(this.application.service).then(({ data: data }: { data: IServiceDetailResponse }) => {
|
||||
serviceOperator.get(this.application.service_id).then(({ data: data }: { data: IServiceDetailResponse }) => {
|
||||
this.service = data;
|
||||
this.loading = false;
|
||||
});
|
||||
|
||||
@@ -50,7 +50,9 @@ export interface IApi {
|
||||
introduction?: string;
|
||||
tags?: string[];
|
||||
request: IRequest;
|
||||
request_id: string;
|
||||
responses: IResponse[];
|
||||
response_ids: string[];
|
||||
is_free?: boolean;
|
||||
service?: string;
|
||||
created_at?: string;
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import { IService } from '../service';
|
||||
|
||||
export interface IApplication {
|
||||
id?: string;
|
||||
service: string;
|
||||
service: IService;
|
||||
service_id: string;
|
||||
api_key?: string;
|
||||
user_id?: string;
|
||||
remaining_count?: number;
|
||||
|
||||
@@ -8,6 +8,7 @@ export interface IDocument {
|
||||
content?: string;
|
||||
rank?: number;
|
||||
api?: IApi;
|
||||
api_id?: string;
|
||||
created_at?: string;
|
||||
updated_at?: string;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { IApi } from '../api/models';
|
||||
|
||||
export interface IService {
|
||||
id: string;
|
||||
title: string;
|
||||
@@ -6,8 +8,10 @@ export interface IService {
|
||||
thumbnail?: string;
|
||||
icon?: string;
|
||||
price?: number;
|
||||
applied_count: number;
|
||||
introduction: string;
|
||||
applied_count?: number;
|
||||
introduction?: string;
|
||||
api_ids?: string[];
|
||||
apis?: IApi[];
|
||||
created_at?: string;
|
||||
updated_at?: string;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user