Kaynağa Gözat

fix:修复API定义数据列表搜索功能

microrain 5 ay önce
ebeveyn
işleme
0c0eff4a9e
1 değiştirilmiş dosya ile 22 ekleme ve 0 silme
  1. 22 0
      src/views/apihub/apilist.vue

+ 22 - 0
src/views/apihub/apilist.vue

@@ -50,6 +50,7 @@
         <div class="api-header">
           <div class="current-group" v-if="currentGroup.Name">
             当前分组: <span class="group-name">{{ currentGroup.Name }}</span>
+            <el-link type="primary" class="view-all-link" @click="viewAllData">查看全部API</el-link>
           </div>
           <div class="current-group" v-else>全部API</div>
         </div>
@@ -438,6 +439,22 @@ const resetQuery = () => {
   getList(1);
 };
 
+// 查看全部数据
+const viewAllData = () => {
+  // 清空当前分组条件
+  params.groupKey = "";
+  // 清空当前分组信息
+  Object.assign(currentGroup, {
+    Id: undefined,
+    GroupKey: "",
+    Name: "",
+    ParentId: 0,
+    Description: "",
+  });
+  // 保留其他查询条件
+  getList(1);
+};
+
 // 新增或编辑API
 const addOrEdit = (row?: ApiDefinition) => {
   if (row) {
@@ -606,4 +623,9 @@ const deleteApi = (row: ApiDefinition) => {
   font-weight: bold;
   color: #409eff;
 }
+
+.view-all-link {
+  margin-left: 10px;
+  font-size: 14px;
+}
 </style>