Ver código fonte

瑞都日报汇总非生产时效取消分页

Zimo 3 dias atrás
pai
commit
dad8bf064e

+ 5 - 49
src/views/pms/iotrddailyreport/components/NonProductionEfficiency.vue

@@ -40,10 +40,7 @@ interface ListItem {
   calendarTime: number
 }
 
-const pageNo = ref(1)
-const pageSize = ref(10)
 const list = ref<ListItem[]>([])
-const total = ref(0)
 const loading = ref(false)
 const tab = ref<'表格' | '看板'>('表格')
 const chartRef = ref<HTMLDivElement | null>(null)
@@ -73,35 +70,20 @@ const getQueryWithoutPage = () => {
   return query
 }
 
-const normalizePageData = (data: any) => {
+const normalizeListData = (data: any) => {
   if (Array.isArray(data)) {
-    return {
-      list: data,
-      total: data.length
-    }
+    return data
   }
 
-  const dataList = data?.list || data?.records || []
-
-  return {
-    list: dataList,
-    total: data?.total || dataList.length
-  }
+  return data?.list || data?.records || []
 }
 
 const loadList = useDebounceFn(async function () {
   loading.value = true
   try {
-    const data = await IotRhDailyReportApi.nptStatistics({
-      ...getQueryWithoutPage(),
-      pageNo: pageNo.value,
-      pageSize: pageSize.value
-    })
-    const pageData = normalizePageData(data)
-
-    list.value = pageData.list
-    total.value = pageData.total
+    const data = await IotRhDailyReportApi.nptStatistics(getQueryWithoutPage())
 
+    list.value = normalizeListData(data)
     if (tab.value === '看板') {
       nextTick(renderChart)
     }
@@ -110,18 +92,7 @@ const loadList = useDebounceFn(async function () {
   }
 }, 500)
 
-function handleSizeChange(val: number) {
-  pageSize.value = val
-  handleQuery()
-}
-
-function handleCurrentChange(val: number) {
-  pageNo.value = val
-  loadList()
-}
-
 function handleQuery() {
-  pageNo.value = 1
   loadList()
 }
 
@@ -327,21 +298,6 @@ const { ZmTable, ZmTableColumn } = useTableComponents<ListItem>()
         </template>
       </el-auto-resizer>
     </div>
-
-    <div class="h-10 flex items-center justify-end">
-      <el-pagination
-        size="default"
-        v-show="tab === '表格' && total > 0"
-        v-model:current-page="pageNo"
-        v-model:page-size="pageSize"
-        :background="true"
-        :page-sizes="[10, 20, 30, 50, 100]"
-        :total="total"
-        layout="total, sizes, prev, pager, next, jumper"
-        @size-change="handleSizeChange"
-        @current-change="handleCurrentChange"
-      />
-    </div>
   </div>
 </template>