2025-03-15 12:46:00 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="bg-white w-full flex flex-col items-center py-[20px]">
|
|
|
|
|
<slot name="img">
|
|
|
|
|
<img
|
|
|
|
|
v-if="!hideImg"
|
|
|
|
|
class="block mb-[20px]"
|
2025-03-15 18:08:35 +08:00
|
|
|
:width="imgWidth"
|
|
|
|
|
:src="src"
|
2025-03-15 12:46:00 +08:00
|
|
|
alt="NoData"
|
|
|
|
|
/>
|
|
|
|
|
</slot>
|
|
|
|
|
<slot>
|
|
|
|
|
<div>没有查询到数据</div>
|
|
|
|
|
</slot>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
2025-03-15 18:08:35 +08:00
|
|
|
import { computed } from "vue";
|
2025-03-15 12:46:00 +08:00
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
|
|
|
hideImg: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
default: false,
|
|
|
|
|
},
|
2025-03-15 18:08:35 +08:00
|
|
|
small: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
default: true,
|
|
|
|
|
},
|
|
|
|
|
imgSrc: {
|
|
|
|
|
type: String,
|
|
|
|
|
default: '',
|
|
|
|
|
},
|
|
|
|
|
width: {
|
|
|
|
|
type: String,
|
|
|
|
|
default: '',
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
const src = computed(() => {
|
|
|
|
|
if (props.imgSrc) {
|
|
|
|
|
return props.imgSrc;
|
|
|
|
|
}
|
|
|
|
|
return props.small ? '/src/assets/imgs/jyh/nodata_small.svg' : '/src/assets/imgs/jyh/nodata.svg';
|
|
|
|
|
});
|
|
|
|
|
const imgWidth = computed(() => {
|
|
|
|
|
if (props.width) {
|
|
|
|
|
return props.width;
|
|
|
|
|
}
|
|
|
|
|
return props.small ? '128px' : '300px';
|
2025-03-15 12:46:00 +08:00
|
|
|
});
|
|
|
|
|
</script>
|