瀏覽代碼

优化指标管理的查询参数

yanglzh 1 月之前
父節點
當前提交
fe6156910b

+ 2 - 2
src/api/datahub/index.ts

@@ -127,7 +127,7 @@ export default {
     add: (data: object) => post('/indicator/add', data),
     del: (code: string) => del('/indicator/del', { code }),
     edit: (data: object) => put('/indicator/edit', data),
-    publish: (code: string) => put('/indicator/publish', { code }),
-    unpublish: (code: string) => put('/indicator/unpublish', { code }),
+    publish: (code: string) => post('/indicator/publish', { code }),
+    unpublish: (code: string) => post('/indicator/unpublish', { code }),
   }
 }

+ 3 - 3
src/views/system/datahub/indicator/component/data.vue

@@ -17,7 +17,7 @@
         </el-form-item>
       </el-form>
 
-      <el-table :data="list" style="width: 100%; margin-top: 8px" v-loading="loading">
+      <el-table :data="list" style="width: 100%" v-loading="loading" max-height="50vh">
         <el-table-column label="时间" align="left" min-width="160">
           <template #default="scope">{{ scope.row.time || scope.row.createdAt || scope.row.createTime || "-" }}</template>
         </el-table-column>
@@ -37,7 +37,7 @@
         </el-table-column>
       </el-table>
 
-      <div class="pager">
+      <div class="pager flex-end">
         <el-pagination background layout="prev, pager, next, ->, total, sizes" :page-sizes="[20, 50, 100, 200]" :total="total" :page-size="query.pageSize" :current-page="query.pageNum" @current-change="(p:number)=>fetchList(p)" @size-change="(s:number)=>{query.pageSize=s;fetchList(1)}" />
       </div>
     </div>
@@ -162,7 +162,7 @@ defineExpose({ open });
 .pager {
   margin-top: 12px;
   display: flex;
-  justify-content: space-between;
+  justify-content: flex-end;
   align-items: center;
 }
 .empty-tip {

+ 3 - 3
src/views/system/datahub/indicator/index.vue

@@ -15,7 +15,7 @@
         </el-form-item>
         <el-form-item>
           <el-select v-model="params.status" placeholder="全部状态" clearable style="width: 160px">
-            <el-option :value="''" label="全部状态" />
+            <el-option value="-1" label="全部状态" />
             <el-option value="0" label="未发布" />
             <el-option value="1" label="已发布" />
           </el-select>
@@ -56,7 +56,7 @@
           </template>
         </el-table-column>
         <el-table-column prop="createdAt" label="创建时间" align="center" width="180" />
-        <el-table-column label="操作" align="center" width="200" fixed="right">
+        <el-table-column label="操作" align="center" width="220" fixed="right">
           <template #default="scope">
             <el-button size="small" text type="primary" v-if="scope.row.status == '0'" @click="publish(scope.row)">发布</el-button>
             <el-button size="small" text type="warning" v-else @click="unpublish(scope.row)">取消发布</el-button>
@@ -104,7 +104,7 @@ apiSystem.getInfoByKey("sys.indicator.type.tagCode").then((res: any) => {
 const { params, tableData, getList, loading } = useSearch(api.indicator.getList, "data", {
   keyword: "",
   type: "",
-  status: "",
+  status: "-1",
 });
 
 getList();