| | |
| | | <ProductCard |
| | | v-for="(item, index) in list" |
| | | :key="index" |
| | | :data="{ |
| | | deviceModel: item.deviceModel, |
| | | model: item.model, |
| | | totalAmount: item.totalLength, |
| | | amount: item.length, |
| | | unAmount: item.unLength, |
| | | }" |
| | | :data="item" |
| | | :map="map" |
| | | @click="toDetail(item.id, item.type)" |
| | | /> |
| | | </z-paging> |
| | |
| | | const userStore = useUserStore(); |
| | | const userInfo: any = computed(() => userStore.userInfo); |
| | | const pagingRef = ref(); |
| | | const map = reactive({ |
| | | deviceModel: "deviceModel", |
| | | model: "model", |
| | | totalAmount: "totalAmount", |
| | | amount: "amount", |
| | | unAmount: "unAmount", |
| | | }); |
| | | const props = defineProps({ |
| | | api: { |
| | | type: Function, |
| | |
| | | size: pageSize, |
| | | }); |
| | | if (code == 200) { |
| | | if (data.total == 0) { |
| | | if (data.type == "绞线") { |
| | | map.deviceModel = "deviceModel"; |
| | | map.model = "model"; |
| | | map.totalAmount = "totalLength"; |
| | | map.amount = "length"; |
| | | map.unAmount = "unLength"; |
| | | } else if (data.type == "拉丝") { |
| | | map.deviceModel = "deviceModel"; |
| | | map.model = "model"; |
| | | map.totalAmount = "totalAmount"; |
| | | map.amount = "amount"; |
| | | map.unAmount = "unAmount"; |
| | | } |
| | | if (data.data.total == 0) { |
| | | pagingRef.value.complete(true); |
| | | } else { |
| | | pagingRef.value.complete(data.records); |
| | | pagingRef.value.complete(data.data.records); |
| | | } |
| | | emits("ok", data.total); |
| | | emits("ok", data.data.total); |
| | | } |
| | | }; |
| | | </script> |