feat(api):优化API文档展示与交互功能
- 调整参数表格列布局,提升可读性- 隐藏“是否必须”列以简化界面显示 - 增强响应状态表格结构及样式适配 - 更新树形结构属性配置提升渲染性能 - 优化HTML内容绑定方式确保安全展示 - 移除冗余标题字段精简数据模型 - 新增批量推送按钮支持多选操作 - 完善记录列表选择功能并增加校验提示 - 改进确认弹窗文案区分单条与批量操作 - 引入row-key和show-selection增强表格功能dev
							parent
							
								
									52f56d62b3
								
							
						
					
					
						commit
						bca204a187
					
				| 
						 | 
					@ -75,9 +75,9 @@
 | 
				
			||||||
                  border
 | 
					                  border
 | 
				
			||||||
                  default-expand-all:false
 | 
					                  default-expand-all:false
 | 
				
			||||||
                  :tree-props="{
 | 
					                  :tree-props="{
 | 
				
			||||||
                  children: 'children',
 | 
					                    children: 'children',
 | 
				
			||||||
                  hasChildren: 'hasChildren',
 | 
					                    hasChildren: 'hasChildren',
 | 
				
			||||||
                }"
 | 
					                  }"
 | 
				
			||||||
                >
 | 
					                >
 | 
				
			||||||
                  <el-table-column prop="name" label="参数名称">
 | 
					                  <el-table-column prop="name" label="参数名称">
 | 
				
			||||||
                  </el-table-column>
 | 
					                  </el-table-column>
 | 
				
			||||||
| 
						 | 
					@ -85,8 +85,8 @@
 | 
				
			||||||
                  </el-table-column>
 | 
					                  </el-table-column>
 | 
				
			||||||
                  <el-table-column prop="type" label="请求类型">
 | 
					                  <el-table-column prop="type" label="请求类型">
 | 
				
			||||||
                  </el-table-column>
 | 
					                  </el-table-column>
 | 
				
			||||||
                  <el-table-column prop="isRequired" label="是否必须">
 | 
					                  <!--                  <el-table-column prop="isRequired" label="是否必须">-->
 | 
				
			||||||
                  </el-table-column>
 | 
					                  <!--                  </el-table-column>-->
 | 
				
			||||||
                  <el-table-column prop="dataType" label="数据类型">
 | 
					                  <el-table-column prop="dataType" label="数据类型">
 | 
				
			||||||
                  </el-table-column>
 | 
					                  </el-table-column>
 | 
				
			||||||
                  <el-table-column prop="schema" label="schema">
 | 
					                  <el-table-column prop="schema" label="schema">
 | 
				
			||||||
| 
						 | 
					@ -104,7 +104,11 @@
 | 
				
			||||||
            <div class="list">
 | 
					            <div class="list">
 | 
				
			||||||
              <div class="title">响应状态</div>
 | 
					              <div class="title">响应状态</div>
 | 
				
			||||||
              <div class="main">
 | 
					              <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 prop="statusCode" label="状态码">
 | 
				
			||||||
                  </el-table-column>
 | 
					                  </el-table-column>
 | 
				
			||||||
                  <el-table-column prop="illustrate" label="说明">
 | 
					                  <el-table-column prop="illustrate" label="说明">
 | 
				
			||||||
| 
						 | 
					@ -132,9 +136,9 @@
 | 
				
			||||||
                  row-key="enumerateNames"
 | 
					                  row-key="enumerateNames"
 | 
				
			||||||
                  border
 | 
					                  border
 | 
				
			||||||
                  :tree-props="{
 | 
					                  :tree-props="{
 | 
				
			||||||
                  children: 'children',
 | 
					                    children: 'children',
 | 
				
			||||||
                  hasChildren: 'hasChildren',
 | 
					                    hasChildren: 'hasChildren',
 | 
				
			||||||
                }"
 | 
					                  }"
 | 
				
			||||||
                  default-expand-all:false
 | 
					                  default-expand-all:false
 | 
				
			||||||
                >
 | 
					                >
 | 
				
			||||||
                  <el-table-column
 | 
					                  <el-table-column
 | 
				
			||||||
| 
						 | 
					@ -151,7 +155,7 @@
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
          </template>
 | 
					          </template>
 | 
				
			||||||
          <template v-else>
 | 
					          <template v-else>
 | 
				
			||||||
            <div v-html="item.htmlStr"/>
 | 
					            <div v-html="item.htmlStr" />
 | 
				
			||||||
          </template>
 | 
					          </template>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
      </div>
 | 
					      </div>
 | 
				
			||||||
| 
						 | 
					@ -425,7 +429,6 @@ const contentList = ref([
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    parentIndex: 1,
 | 
					    parentIndex: 1,
 | 
				
			||||||
    childrenIndex: 1,
 | 
					    childrenIndex: 1,
 | 
				
			||||||
    title: "请求加密方式",
 | 
					 | 
				
			||||||
    isHTML: true,
 | 
					    isHTML: true,
 | 
				
			||||||
    htmlStr: `
 | 
					    htmlStr: `
 | 
				
			||||||
      <div style="background: #ffffff;margin-bottom: 5px;border-bottom: 10px solid #f9f9f9;">
 | 
					      <div style="background: #ffffff;margin-bottom: 5px;border-bottom: 10px solid #f9f9f9;">
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,10 +1,16 @@
 | 
				
			||||||
<template>
 | 
					<template>
 | 
				
			||||||
  <div>
 | 
					  <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
 | 
					    <app-table
 | 
				
			||||||
      ref="tableRef"
 | 
					      ref="tableRef"
 | 
				
			||||||
      v-model:pagination="pagination"
 | 
					      v-model:pagination="pagination"
 | 
				
			||||||
      :data="list"
 | 
					      :data="list"
 | 
				
			||||||
 | 
					      show-selection
 | 
				
			||||||
 | 
					      row-key="id"
 | 
				
			||||||
      @get-data="getData"
 | 
					      @get-data="getData"
 | 
				
			||||||
    >
 | 
					    >
 | 
				
			||||||
      <el-table-column prop="serviceName" label="服务平台名称" />
 | 
					      <el-table-column prop="serviceName" label="服务平台名称" />
 | 
				
			||||||
| 
						 | 
					@ -137,9 +143,19 @@ const fnDelete = async (id) => {
 | 
				
			||||||
  resetPagination();
 | 
					  resetPagination();
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
const fnPush = async (id) => {
 | 
					const fnPush = async (id) => {
 | 
				
			||||||
  // 检查参数类型,如果是字符串或数字,则转换为单元素数组
 | 
					  let records = []
 | 
				
			||||||
  const records =[{ id: id, dataType: Number(route.query.dataType) }];
 | 
					  if(!id){
 | 
				
			||||||
  await ElMessageBox.confirm("确定要重新推送吗?", {
 | 
					    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",
 | 
					    type: "warning",
 | 
				
			||||||
  });
 | 
					  });
 | 
				
			||||||
  await setRecordDataPush(records);
 | 
					  await setRecordDataPush(records);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue