<template> 
 | 
    <view class="card_box"> 
 | 
        <z-paging ref="pagingRef" v-model="list" :fixed="false" :auto-show-back-to-top="true" @query="getList"> 
 | 
            <ProductCard v-for="(item, index) in list" :key="index" :data="item" :map="map" 
 | 
                @click="toDetail(item.id, item.deviceType)" /> 
 | 
        </z-paging> 
 | 
        <wd-toast /> 
 | 
    </view> 
 | 
</template> 
 | 
  
 | 
<script setup lang="ts"> 
 | 
    import ProductCard from "../product_card/index.vue"; 
 | 
    import { useUserStore } from "@/store/modules/user"; 
 | 
    import zPaging from "@/components/z-paging/z-paging.vue"; 
 | 
    import { useToast } from "wot-design-uni"; 
 | 
  
 | 
    const toast = useToast(); 
 | 
    const userStore = useUserStore(); 
 | 
    const userInfo : any = computed(() => userStore.userInfo); 
 | 
    const pagingRef = ref(); 
 | 
const map = reactive({ 
 | 
        deviceModel: "deviceModel", 
 | 
        model: "model", 
 | 
        firstNo: "firstNo", 
 | 
        recordDate: "recordDate", 
 | 
        workShift: "workShift", 
 | 
        teamName: "teamName", 
 | 
        poleModel: "poleModel", 
 | 
        poleNumber: "poleNumber", 
 | 
        outputNumber: "outputNumber", 
 | 
        inspectPerson: "inspectPerson", 
 | 
        status: "status", 
 | 
    rejectList: [ 
 | 
      { 
 | 
        rejectPerson: "rejectPerson", 
 | 
        rejectTime: "rejectTime", 
 | 
        rejectReason: { 
 | 
          reason: "reason" 
 | 
        }, 
 | 
      }, 
 | 
        ], // 改为对象,包含所需的嵌套属性 
 | 
    }); 
 | 
    const props = defineProps({ 
 | 
        api: { 
 | 
            type: Function, 
 | 
            default: () => { }, 
 | 
        }, 
 | 
        ProList: { 
 | 
            type: Object, 
 | 
            default: () => { }, 
 | 
        }, 
 | 
    }); 
 | 
  
 | 
    const list = ref<any[]>([]); 
 | 
  
 | 
const toDetail = (id: number, deviceType: number) => { 
 | 
    console.log('点击卡片', id, deviceType); 
 | 
        toast.show("点击卡片"); 
 | 
        if (deviceType == 0) { 
 | 
            uni.navigateTo({ 
 | 
                url: `/pages/production/detail/wireDetail?id=${id}`, 
 | 
            }); 
 | 
        } else if (deviceType == 1) { 
 | 
            uni.navigateTo({ 
 | 
                url: `/pages/production/detail/twistDetail?id=${id}`, 
 | 
            }); 
 | 
        } 
 | 
    }; 
 | 
  
 | 
    const getList = async () => { 
 | 
        const { code, data } = await props.api({ 
 | 
            deviceModel: props.ProList.deviceModel, 
 | 
            status: "0", 
 | 
            deviceType: props.ProList.deviceType, 
 | 
        }); 
 | 
        if (code == 200) { 
 | 
      map.deviceModel = "deviceModel"; 
 | 
            map.model = "model"; 
 | 
            map.firstNo = "firstNo"; 
 | 
            map.recordDate = "recordDate"; 
 | 
            map.workShift = "workShift"; 
 | 
            map.teamName = "teamName"; 
 | 
            map.poleModel = "poleModel"; 
 | 
            map.poleNumber = "poleNumber"; 
 | 
            map.outputNumber = "outputNumber"; 
 | 
      map.inspectPerson = "inspectPerson"; 
 | 
      map.rejectList = [ 
 | 
        { 
 | 
          rejectPerson: "rejectPerson", 
 | 
          rejectTime: "rejectTime", 
 | 
          rejectReason: { 
 | 
            reason: "reason" 
 | 
          }, 
 | 
        }, 
 | 
      ]; 
 | 
            map.status = "status"; 
 | 
            if (data.total == 0) { 
 | 
                pagingRef.value.complete(true); 
 | 
      } else { 
 | 
        console.log('data.records', data.records); 
 | 
                pagingRef.value.complete(data.records); 
 | 
            } 
 | 
        } 
 | 
    }; 
 | 
</script> 
 | 
  
 | 
<style lang="scss" scoped> 
 | 
    .card_box { 
 | 
        height: calc(100vh - 120px); 
 | 
    } 
 | 
</style> 
 |