|
@@ -108,6 +108,9 @@
|
|
|
</div>
|
|
|
</a-image-preview-group>
|
|
|
</div>
|
|
|
+ <div class="empty" v-if="!list.length">
|
|
|
+ <a-empty :image="simpleImage" />
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
@@ -117,6 +120,9 @@ import Up from "@/api/upload";
|
|
|
import utils from "@/utils/utils";
|
|
|
import { ExpandOutlined, DeleteOutlined } from "@ant-design/icons-vue";
|
|
|
|
|
|
+import { Empty } from "ant-design-vue";
|
|
|
+const simpleImage = Empty.PRESENTED_IMAGE_SIMPLE;
|
|
|
+
|
|
|
const props = defineProps({
|
|
|
butText: {
|
|
|
type: String,
|
|
@@ -124,6 +130,7 @@ const props = defineProps({
|
|
|
},
|
|
|
disabled: {
|
|
|
type: Boolean,
|
|
|
+ default: true,
|
|
|
},
|
|
|
attinfos: {
|
|
|
type: Array,
|
|
@@ -146,6 +153,7 @@ const props = defineProps({
|
|
|
total: {
|
|
|
//考虑分页情况传递,上传图片顺序会在此向后顺延
|
|
|
type: [Number, String],
|
|
|
+ default: 0,
|
|
|
},
|
|
|
ownertable: {
|
|
|
type: String,
|
|
@@ -274,6 +282,7 @@ watch(
|
|
|
}
|
|
|
);
|
|
|
function init(attinfos, pic = props.pic) {
|
|
|
+ if(!attinfos.length) return;
|
|
|
list.value = pic ? attinfos : attinfos.filter((v) => v.fileType == "image");
|
|
|
list.value = list.value.map((v) => {
|
|
|
if (pic) {
|
|
@@ -407,4 +416,11 @@ function handleHoverChange(visible, index) {
|
|
|
.previewMaskIcon:hover {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
+
|
|
|
+.empty {
|
|
|
+ width: 100%;
|
|
|
+ padding: 50px 0;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+}
|
|
|
</style>
|