1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- <!-- eslint-disable vue/multi-word-component-names -->
- <template>
- <div class="dust-risk">
- <div class="dust-risk-item" v-for="item in DUST_RISK_CONFIG" :key="item.id" @click="$emit('click', item)">
- <div class="img"> <img :src="item.src" alt="" /> </div>
- <div class="text">{{ item.text }}</div>
- <div class="num">{{ get(dustRiskData, item.prop) }}</div>
- </div>
- </div>
- </template>
- <script lang="ts" setup>
- import { computed } from 'vue';
- import { BillboardType, DEFAULT_TEST_DATA, DUST_RISK_CONFIG } from '../billboard.data';
- import { get } from '../utils';
- const props = withDefaults(
- defineProps<{
- data?: BillboardType;
- }>(),
- {
- data: () => DEFAULT_TEST_DATA,
- }
- );
- defineEmits(['click']);
- const dustRiskData = computed<BillboardType['dustRisk']>(() => {
- const info = props.data.dustRisk;
- return info;
- });
- </script>
- <style lang="less" scoped>
- @import '/@/design/theme.less';
- @import '/@/design/vent/color.less';
- @font-face {
- font-family: 'douyuFont';
- src: url(/@/assets/images/files/douyuFont.otf);
- }
- .dust-risk {
- height: 100%;
- // display: flex;
- // justify-content: space-evenly;
- // align-items: center;
- // flex-wrap: wrap;
- }
- .dust-risk-item {
- display: flex;
- align-items: center;
- background-size: 100% auto;
- background-repeat: no-repeat;
- background-position: center;
- height: 46px;
- margin-top: 10px;
- padding: 0 7px;
- .text {
- text-align: center;
- width: 200px;
- }
- .num {
- text-align: center;
- width: 140px;
- }
- .img {
- width: 27px;
- height: 27px;
- }
- }
- .dust-risk-item:nth-child(odd) {
- background-image: url(/@/assets/images/company/list-item-1.png);
- }
- .dust-risk-item:nth-child(even) {
- background-image: url(/@/assets/images/company/list-item-2.png);
- }
- .num {
- font-size: 20px;
- font-family: douyuFont;
- color: @vent-gas-primary-text;
- }
- .risk {
- font-size: 20px;
- font-family: douyuFont;
- color: @vent-gas-primary-text;
- }
- </style>
|