123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- <template>
- <div class="trend-panel-container">
- <StatisticsItem :title="label" :value="value"></StatisticsItem>
- <!-- <div class="trend-text">
- <span class="lable">较昨日{{ currentInfo.text }}:</span>
- <span class="percent-text" :style="{ color: currentInfo.color }">{{ percent }}</span>
- <img class="trend-icon" :src="currentInfo.icon" alt="" />
- </div> -->
- </div>
- </template>
- <script>
- import StatisticsItem from './StatisticsItem.vue'
- const up = { text: '上涨', color: '#E90808', icon: require('../../../assets/images/dashboard/up-icon.png') }
- const down = { text: '下跌', color: '#0BBD1D', icon: require('../../../assets/images/dashboard/down-icon.png') }
- export default {
- components: { StatisticsItem },
- props: {
- type: {
- type: String,
- default: 'up'
- },
- percent: {
- type: String,
- default: '0%'
- },
- label: {
- type: String,
- required: true
- },
- value: {
- type: [Number, String],
- required: true
- }
- },
- computed: {
- currentInfo() {
- return this.type === 'up' ? up : down
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- @media (max-width: 1540px) {
- ::v-deep .title {
- font-size: 12px !important;
- }
- ::v-deep .value{
- font-size: 18px !important;
- }
- }
- @media (max-width: 1390px) {
- ::v-deep .title {
- font-size: 16px !important;
- }
- ::v-deep .value{
- font-size: 24px !important;
- }
- }
- .trend-panel-container {
- position: relative;
- background-color: #f7f8fa;
- flex: 1;
- padding: 24px;
- box-sizing: border-box;
- border-radius: 8px;
- cursor: pointer;
- transition: transform 350ms, border-radius 1s;
- &::after {
- position: absolute;
- content: '';
- display: block;
- .trend-text {
- color: #fff !important;
- }
- }
- &:hover {
- transform: translateY(-5px);
- border-radius: 20px;
- }
- .trend-text {
- display: flex;
- align-items: center;
- color: #3d3d3d;
- font-size: 12px;
- .lable {
- @media (max-width: 1669px) {
- display: none;
- }
- }
- .percent-text {
- margin: 0 7px;
- }
- .trend-icon {
- width: 14px;
- height: 8px;
- }
- }
- }
- </style>
|