api文档开发

This commit is contained in:
暮光:城中城
2022-01-05 23:06:05 +08:00
parent ec6e31e7c5
commit 551a7079ec
6 changed files with 102 additions and 47 deletions

View File

@@ -1,11 +1,11 @@
<template>
<div class="page-layout">
<a-tabs type="editable-card" v-model:activeKey="activePage" @tab-click="changePage" @edit="editPageTab" style="padding: 5px 10px 0;">
<template #addIcon>
<a-tooltip title="新建一个API接口">
<plus-outlined />
</a-tooltip>
</template>
<a-tabs type="editable-card" hide-add v-model:activeKey="activePage" @tab-click="changePage" @edit="editPageTab" style="padding: 5px 10px 0;">
<!-- <template #addIcon>-->
<!-- <a-tooltip title="新建一个API接口">-->
<!-- <plus-outlined />-->
<!-- </a-tooltip>-->
<!-- </template>-->
<a-tab-pane closable :tab="pageTabNameMap[item.fullPath]||item.name" :name="getRouteRealPath(item)" :fullPath="item.fullPath" :key="item.fullPath" v-for="item in pageList"/>
</a-tabs>
<div class="page-body">

View File

@@ -83,20 +83,30 @@
},
emits: ['update:selected'],
setup(props, { attrs, slots, emit, expose }) {
let paramListRef = ref(props.paramList);
let nextIndex = 10000;
// Query参数处理
if (paramListRef.value.length <= 0 || !paramListRef.value[paramListRef.value.length - 1].isLastRow) {
props.paramList.push({name: '', value: undefined, type: 'integer', key: ++nextIndex, isLastRow: true});
}
let queryParamSelectedRowKeys = ref([]);
paramListRef.value.forEach(item => {
item.value = item.value || item.example || undefined;
if ((item.enum && item.type === 'array') || item.type === 'file' || item.subType === 'MultipartFile') {
item.value = [];
}
queryParamSelectedRowKeys.value.push(item.key);
});
let queryParamSelectedRowKeys = ref([]);
let nextIndex = 10000;
let paramListRef = ref([]);
watch(() => props.paramList, () => {
propsParamInit();
});
onMounted(() => {
propsParamInit();
});
const propsParamInit = () => {
paramListRef.value = props.paramList;
console.log('paramListRef.value', paramListRef.value);
// Query参数处理
if (paramListRef.value.length <= 0 || !paramListRef.value[paramListRef.value.length - 1].isLastRow) {
props.paramList.push({name: '', value: undefined, type: 'integer', key: ++nextIndex, isLastRow: true});
}
paramListRef.value.forEach(item => {
item.value = item.value || item.example || undefined;
if ((item.enum && item.type === 'array') || item.type === 'file' || item.subType === 'MultipartFile') {
item.value = [];
}
queryParamSelectedRowKeys.value.push(item.key);
});
};
const queryParamRowSelectionChange = (selectedRowKeys, selectedRows) => {
queryParamSelectedRowKeys.value = selectedRowKeys;
};