migrate new model
This commit is contained in:
1 parent
5dae704649
commit
e2e17eef96
19 files changed
+202
-108
No files matched your search
@@ -0,0 +1,61 @@
|
||||
<template>
|
||||
<div class="title">
|
||||
{{ api?.title }}
|
||||
</div>
|
||||
<div class="url">
|
||||
<el-tag class="method" effect="dark">{{ api?.request?.method }}</el-tag>
|
||||
<span v-if="api?.endpoint && api?.path" class="endpoint">{{ urlJoin(api?.endpoint, api?.path) }}</span>
|
||||
</div>
|
||||
<div class="introduction">
|
||||
<p>{{ api?.introduction }}</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { IApi } from '@/operators';
|
||||
import { defineComponent } from 'vue';
|
||||
import urlJoin from 'url-join';
|
||||
import { ElTag } from 'element-plus';
|
||||
export default defineComponent({
|
||||
name: 'ApiInfo',
|
||||
components: {
|
||||
ElTag
|
||||
},
|
||||
props: {
|
||||
api: {
|
||||
type: Object as () => IApi,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
urlJoin
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.title {
|
||||
font-size: 26px;
|
||||
font-weight: 500;
|
||||
line-height: 1.2;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.url {
|
||||
margin-bottom: 10px;
|
||||
.method {
|
||||
border-radius: 10px;
|
||||
padding: 1px 8px;
|
||||
font-size: 10px;
|
||||
transform: scale(0.8);
|
||||
transform-origin: left;
|
||||
}
|
||||
.endpoint {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
.introduction {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
||||
@@ -5,16 +5,7 @@
|
||||
<el-skeleton />
|
||||
</div>
|
||||
<div v-else class="item">
|
||||
<div class="title">
|
||||
{{ api?.title }}
|
||||
</div>
|
||||
<div class="url">
|
||||
<el-tag class="method" effect="dark">{{ api?.request?.method }}</el-tag>
|
||||
<span v-if="api?.endpoint && api?.path" class="endpoint">{{ urlJoin(api?.endpoint, api?.path) }}</span>
|
||||
</div>
|
||||
<div class="introduction">
|
||||
<p>{{ api?.introduction }}</p>
|
||||
</div>
|
||||
<api-info v-if="api" :api="api" />
|
||||
<el-divider />
|
||||
<div class="queries">
|
||||
<h2 class="title">{{ $t('api.entity.requestQueries') }}</h2>
|
||||
@@ -56,10 +47,10 @@ import { defineComponent } from 'vue';
|
||||
import { IApi, IForm } from '@/operators/api/models';
|
||||
import ApiForm from './Form.vue';
|
||||
import ApiResult from './Result.vue';
|
||||
import urlJoin from 'url-join';
|
||||
import { applicationOperator } from '@/operators/application/operator';
|
||||
import { IApplication, IApplicationListResponse } from '@/operators/application/models';
|
||||
import { ElSkeleton, ElDivider, ElTag } from 'element-plus';
|
||||
import ApiInfo from './Info.vue';
|
||||
|
||||
export interface IData {
|
||||
formValue: IForm;
|
||||
@@ -73,7 +64,7 @@ export default defineComponent({
|
||||
ApiResult,
|
||||
ElSkeleton,
|
||||
ElDivider,
|
||||
ElTag
|
||||
ApiInfo
|
||||
},
|
||||
props: {
|
||||
api: {
|
||||
@@ -106,7 +97,6 @@ export default defineComponent({
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
urlJoin,
|
||||
getApplications() {
|
||||
applicationOperator
|
||||
.getAll({
|
||||
@@ -123,30 +113,6 @@ export default defineComponent({
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.item {
|
||||
.title {
|
||||
font-size: 26px;
|
||||
font-weight: 500;
|
||||
line-height: 1.2;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.url {
|
||||
margin-bottom: 10px;
|
||||
.method {
|
||||
border-radius: 10px;
|
||||
padding: 1px 8px;
|
||||
font-size: 10px;
|
||||
transform: scale(0.8);
|
||||
}
|
||||
.endpoint {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
.introduction {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.queries {
|
||||
margin-bottom: 10px;
|
||||
.title {
|
||||
|
||||
Reference in new issue
Block a user