feat(api):优化API文档展示与交互功能

- 调整参数表格列布局,提升可读性- 隐藏“是否必须”列以简化界面显示
- 增强响应状态表格结构及样式适配
- 更新树形结构属性配置提升渲染性能
- 优化HTML内容绑定方式确保安全展示
- 移除冗余标题字段精简数据模型
- 新增批量推送按钮支持多选操作
- 完善记录列表选择功能并增加校验提示
- 改进确认弹窗文案区分单条与批量操作
- 引入row-key和show-selection增强表格功能
dev
10396 2025-10-22 08:59:15 +08:00
parent 52f56d62b3
commit bca204a187
2 changed files with 34 additions and 15 deletions

View File

@ -75,9 +75,9 @@
border
default-expand-all:false
:tree-props="{
children: 'children',
hasChildren: 'hasChildren',
}"
children: 'children',
hasChildren: 'hasChildren',
}"
>
<el-table-column prop="name" label="参数名称">
</el-table-column>
@ -85,8 +85,8 @@
</el-table-column>
<el-table-column prop="type" label="请求类型">
</el-table-column>
<el-table-column prop="isRequired" label="是否必须">
</el-table-column>
<!-- <el-table-column prop="isRequired" label="是否必须">-->
<!-- </el-table-column>-->
<el-table-column prop="dataType" label="数据类型">
</el-table-column>
<el-table-column prop="schema" label="schema">
@ -104,7 +104,11 @@
<div class="list">
<div class="title">响应状态</div>
<div class="main">
<el-table border :data="item.responseStatus" style="width: 100%">
<el-table
border
:data="item.responseStatus"
style="width: 100%"
>
<el-table-column prop="statusCode" label="状态码">
</el-table-column>
<el-table-column prop="illustrate" label="说明">
@ -132,9 +136,9 @@
row-key="enumerateNames"
border
:tree-props="{
children: 'children',
hasChildren: 'hasChildren',
}"
children: 'children',
hasChildren: 'hasChildren',
}"
default-expand-all:false
>
<el-table-column
@ -151,7 +155,7 @@
</div>
</template>
<template v-else>
<div v-html="item.htmlStr"/>
<div v-html="item.htmlStr" />
</template>
</div>
</div>
@ -425,7 +429,6 @@ const contentList = ref([
{
parentIndex: 1,
childrenIndex: 1,
title: "请求加密方式",
isHTML: true,
htmlStr: `
<div style="background: #ffffff;margin-bottom: 5px;border-bottom: 10px solid #f9f9f9;">

View File

@ -1,10 +1,16 @@
<template>
<div>
<app-search v-model="searchForm" :options @submit="resetPagination" />
<app-search v-model="searchForm" :options @submit="resetPagination">
<template #button>
<el-button type="primary" @click="fnPush('')"></el-button>
</template>
</app-search>
<app-table
ref="tableRef"
v-model:pagination="pagination"
:data="list"
show-selection
row-key="id"
@get-data="getData"
>
<el-table-column prop="serviceName" label="服务平台名称" />
@ -137,9 +143,19 @@ const fnDelete = async (id) => {
resetPagination();
};
const fnPush = async (id) => {
//
const records =[{ id: id, dataType: Number(route.query.dataType) }];
await ElMessageBox.confirm("确定要重新推送吗?", {
let records = []
if(!id){
records = tableRef.value.getSelectionRows().map(item => ({ id: item.id, dataType: Number(route.query.dataType) }))
console.log(records)
if(records.length === 0){
ElMessage.warning("请选择要推送的数据");
return;
}
}else {
//
records =[{ id: id, dataType: Number(route.query.dataType) }];
}
await ElMessageBox.confirm(id ? "确定要重新推送吗?" : "确认要批量推送吗?", {
type: "warning",
});
await setRecordDataPush(records);