eight
2025-04-15 589bcdb26f8e9d3e0d5ef46d27acc901c96d50ea
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<template>
  <div class="waterfall" v-loading="props.loading">
    <div class="waterfall-item" v-for="item in props.list" :key="item.id">
      <a target="_blank" :href="item.url">
        <img class="material-img" :src="item.url" />
        <div class="item-name">{{ item.name }}</div>
      </a>
      <el-row justify="center">
        <el-button
          type="danger"
          circle
          @click="emit('delete', item.id)"
          v-hasPermi="['mp:material:delete']"
        >
          <Icon icon="ep:delete" />
        </el-button>
      </el-row>
    </div>
  </div>
</template>
 
<script lang="ts" setup>
const props = defineProps<{
  list: any[]
  loading: boolean
}>()
 
const emit = defineEmits<{
  (e: 'delete', v: number)
}>()
</script>
 
<style lang="scss" scoped>
@media (width >= 992px) and (width <= 1300px) {
  .waterfall {
    column-count: 3;
  }
 
  p {
    color: red;
  }
}
 
@media (width >= 768px) and (width <= 991px) {
  .waterfall {
    column-count: 2;
  }
 
  p {
    color: orange;
  }
}
 
@media (width <= 767px) {
  .waterfall {
    column-count: 1;
  }
}
 
.waterfall {
  width: 100%;
  column-gap: 10px;
  column-count: 5;
  margin-top: 10px;
 
  /* 杭州利湖:增加 10px,避免顶着上面 */
}
 
.waterfall-item {
  padding: 10px;
  margin-bottom: 10px;
  break-inside: avoid;
  border: 1px solid #eaeaea;
}
 
.material-img {
  width: 100%;
}
 
p {
  line-height: 30px;
}
</style>