123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- <!-- eslint-disable vue/multi-word-component-names -->
- <template>
- <!-- 基准的画廊模块,通过不同的 type 展示不同的样式 -->
- <div class="gallery" :class="`gallery_${type}`">
- <!-- 部分类型的画廊需要加一张图片 -->
- <div :class="`gallery-item_cneter_${type}`"></div>
- <div v-for="item in galleryConfig" :key="item.prop" :class="`gallery-item_${type}`">
- <!-- 画廊项的具体内容填充剩余宽度 -->
- <div class="gallery-item__label">{{ item.label }}</div>
- <div class="gallery-item__value" :class="`gallery-item__value_${item.color}`">{{ item.value }}</div>
- </div>
- </div>
- </template>
- <script lang="ts" setup>
- // import { get } from 'lodash-es';
- // import { computed } from 'vue';
- withDefaults(
- defineProps<{
- galleryConfig: {
- value: string;
- color: string;
- label: string;
- prop: string;
- }[];
- type: string;
- }>(),
- {
- galleryConfig: () => [],
- type: 'A',
- }
- );
- // defineEmits(['click']);
- </script>
- <style lang="less" scoped>
- @import '@/design/vent/color.less';
- /* Timeline 相关的样式 */
- .gallery {
- position: relative;
- width: 100%;
- height: 100%;
- }
- .gallery-item_cneter_A {
- background: url(@/assets/images/home-container/configurable/gallery_center.png) no-repeat;
- width: 144px;
- height: 126px;
- left: calc(50% - 72px);
- top: calc(50% - 63px);
- position: absolute;
- background-size: 100% 100%;
- }
- .gallery > .gallery-item_A {
- background: url(@/assets/images/home-container/configurable/gallery_1.png) no-repeat;
- width: 90px;
- height: 90px;
- position: absolute;
- text-align: center;
- }
- .gallery > .gallery-item_A:nth-child(2) {
- top: 20px;
- left: 60px;
- }
- .gallery > .gallery-item_A:nth-child(3) {
- top: 20px;
- right: 60px;
- }
- .gallery > .gallery-item_A:nth-child(4) {
- bottom: 20px;
- left: 60px;
- }
- .gallery > .gallery-item_A:nth-child(5) {
- bottom: 20px;
- right: 60px;
- }
- .gallery-item_cneter_B {
- background: url(/@/assets/images/home-container/configurable/deco_2.png) no-repeat;
- width: 100%;
- height: 90%;
- top: 5%;
- position: absolute;
- background-position: center;
- background-size: auto 100%;
- }
- // .gallery .gallery-item__value {
- // display: none;
- // }
- .gallery > .gallery-item_B {
- background: url(/@/assets/images/home-container/configurable/deco_3.png) no-repeat;
- position: absolute;
- text-align: center;
- background-position: center;
- background-size: auto 100%;
- }
- .gallery > .gallery-item_B:nth-child(2) {
- width: 70px;
- height: 70px;
- line-height: 70px;
- top: 20px;
- left: 36%;
- }
- .gallery > .gallery-item_B:nth-child(3) {
- width: 60px;
- height: 60px;
- line-height: 60px;
- top: 50px;
- right: 34%;
- }
- .gallery > .gallery-item_B:nth-child(4) {
- width: 55px;
- height: 55px;
- line-height: 55px;
- bottom: 90px;
- left: 38%;
- }
- .gallery > .gallery-item_B:nth-child(5) {
- width: 50px;
- height: 50px;
- line-height: 50px;
- bottom: 70px;
- right: 38%;
- }
- .gallery-item__value_red {
- color: red;
- }
- .gallery-item__value_orange {
- color: orange;
- }
- .gallery-item__value_yellow {
- color: yellow;
- }
- .gallery-item__value_green {
- color: yellowgreen;
- }
- .gallery-item__value_blue {
- color: lightblue;
- }
- </style>
|