123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352 |
- <!-- eslint-disable vue/multi-word-component-names -->
- <template>
- <!-- 基准的画廊模块,通过不同的 type 展示不同的样式 -->
- <div class="gallery" :class="`gallery_${type}`">
- <!-- 部分类型的画廊需要加一张图片 -->
- <div :class="`gallery-item_center_${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;
- }[];
- /** A | B | C | D */
- type: string;
- }>(),
- {
- galleryConfig: () => [],
- type: 'A',
- }
- );
- // defineEmits(['click']);
- </script>
- <style lang="less" scoped>
- @import '@/design/vent/color.less';
- .gallery {
- position: relative;
- width: 100%;
- height: 100%;
- }
- .gallery-item_center_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_center_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: calc(50% - 70px);
- }
- .gallery > .gallery-item_B:nth-child(3) {
- width: 60px;
- height: 60px;
- line-height: 60px;
- top: 50px;
- // right: 34%;
- right: calc(50% - 70px);
- }
- .gallery > .gallery-item_B:nth-child(4) {
- width: 55px;
- height: 55px;
- line-height: 55px;
- bottom: 90px;
- left: calc(50% - 55px);
- }
- .gallery > .gallery-item_B:nth-child(5) {
- width: 50px;
- height: 50px;
- line-height: 50px;
- bottom: 70px;
- right: calc(50% - 50px);
- }
- .gallery-item_B > .gallery-item__label {
- display: none;
- }
- .gallery-item_center_C {
- background: url(/@/assets/images/home-container/configurable/deco_4.png) no-repeat;
- width: 100%;
- height: 100%;
- // top: 5%;
- position: absolute;
- background-position: center;
- background-size: auto 100%;
- }
- .gallery_C {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: space-around;
- text-align: center;
- }
- .gallery-item_C > .gallery-item__value {
- font-size: 20px;
- }
- .gallery_D {
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .gallery-item_center_D {
- background: url(/@/assets/images/home-container/configurable/firehome/img-2.png) no-repeat;
- background-size: auto 100%;
- width: 100px;
- height: 100px;
- }
- .gallery > .gallery-item_D {
- background-image: url(/@/assets/images/home-container/configurable/firehome/img-1.png);
- background-size: 100% auto;
- width: 213px;
- height: 87px;
- text-align: center;
- // line-height: 35px;
- padding-top: 17px;
- padding-left: 40px;
- display: none;
- .gallery-item__value {
- font-size: 24px;
- }
- }
- .gallery > .gallery-item_D:nth-child(2) {
- display: block;
- }
- .gallery-item_center_E {
- background: url(/@/assets/images/home-container/configurable/dusthome/img-8.png) no-repeat;
- width: 200px;
- height: 200px;
- left: calc(50% - 100px);
- top: calc(50% - 100px);
- position: absolute;
- background-size: 100% auto;
- }
- .gallery > .gallery-item_E {
- background: url(/@/assets/images/home-container/configurable/dusthome/img-9.png) no-repeat;
- width: 100px;
- height: 90px;
- position: absolute;
- text-align: center;
- background-size: 100% 100%;
- .gallery-item__label {
- height: 60px;
- text-align: center;
- background-size: 30px 30px;
- background-position: center top;
- background-repeat: no-repeat;
- padding-top: 30px;
- }
- }
- .gallery > .gallery-item_E:nth-child(2) {
- top: calc(50% - 100px);
- // top: 20px;
- left: calc(50% - 150px);
- // left: 80px;
- .gallery-item__label {
- background-image: url(/@/assets/images/home-container/configurable/dusthome/sbzs.png);
- }
- }
- .gallery > .gallery-item_E:nth-child(3) {
- top: calc(50% - 100px);
- right: calc(50% - 150px);
- .gallery-item__label {
- background-image: url(/@/assets/images/home-container/configurable/dusthome/pwkqs.png);
- }
- }
- .gallery > .gallery-item_E:nth-child(4) {
- bottom: calc(50% - 100px);
- left: calc(50% - 150px);
- .gallery-item__label {
- background-image: url(/@/assets/images/home-container/configurable/dusthome/lwsl.png);
- }
- }
- .gallery > .gallery-item_E:nth-child(5) {
- bottom: calc(50% - 100px);
- right: calc(50% - 150px);
- .gallery-item__label {
- background-image: url(/@/assets/images/home-container/configurable/dusthome/dwsl.png);
- }
- }
- // .gallery-item_center_F {
- // }
- .gallery > .gallery-item_F {
- width: 120px;
- height: 60px;
- position: absolute;
- text-align: center;
- padding-left: 20px;
- padding-top: 5px;
- background-size: 100% 100%;
- background-repeat: no-repeat;
- background-position: center;
- background-image: url(/@/assets/images/home-container/configurable/firehome/img-1.png);
- .gallery-item__value {
- font-size: 20px;
- }
- }
- .gallery > .gallery-item_F:nth-child(2) {
- top: calc(50% - 60px);
- left: calc(50% - 180px);
- width: 120px;
- height: 120px;
- line-height: 120px;
- padding: 0;
- background-image: url(/@/assets/images/home-container/configurable/dusthome/img-7.png);
- .gallery-item__label {
- display: none;
- }
- }
- .gallery > .gallery-item_F:nth-child(3) {
- top: calc(50% - 62px);
- left: calc(50% - 60px);
- }
- .gallery > .gallery-item_F:nth-child(4) {
- top: calc(50% - 62px);
- left: calc(50% + 60px);
- }
- .gallery > .gallery-item_F:nth-child(5) {
- bottom: calc(50% - 62px);
- left: calc(50% - 60px);
- }
- .gallery > .gallery-item_F:nth-child(6) {
- bottom: calc(50% - 62px);
- left: calc(50% + 60px);
- }
- .gallery > .gallery-item_G {
- width: 120px;
- height: 120px;
- position: absolute;
- text-align: center;
- padding-top: 34px;
- background-size: 100% 100%;
- background-repeat: no-repeat;
- background-position: center;
- background-image: url(/@/assets/images/home-container/configurable/firehome/img-4.png);
- .gallery-item__value {
- font-size: 20px;
- }
- }
- .gallery > .gallery-item_G:nth-child(2) {
- top: calc(50% - 60px);
- left: calc(50% - 60px);
- }
- .gallery > .gallery-item_G:nth-child(3) {
- top: calc(50% - 60px);
- left: calc(50% - 160px);
- transform: scale(0.8);
- }
- .gallery > .gallery-item_G:nth-child(4) {
- top: calc(50% - 60px);
- right: calc(50% - 160px);
- transform: scale(0.8);
- }
- .gallery > .gallery-item_G:nth-child(5) {
- top: calc(50% - 110px);
- left: calc(50% - 230px);
- transform: scale(0.7);
- }
- .gallery > .gallery-item_G:nth-child(6) {
- bottom: calc(50% - 110px);
- left: calc(50% - 230px);
- transform: scale(0.7);
- }
- .gallery > .gallery-item_G:nth-child(7) {
- top: calc(50% - 110px);
- right: calc(50% - 230px);
- transform: scale(0.7);
- }
- .gallery > .gallery-item_G:nth-child(8) {
- bottom: calc(50% - 110px);
- right: calc(50% - 230px);
- transform: scale(0.7);
- }
- .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: #009bff;
- }
- .gallery-item__value_white {
- color: white;
- }
- </style>
|