大屏组件
This commit is contained in:
		
							
								
								
									
										216
									
								
								components/layout/AiRanking/components/Ranking1.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										216
									
								
								components/layout/AiRanking/components/Ranking1.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,216 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="Ranking1" :class="'Ranking1-' + theme">
 | 
			
		||||
    <div class="Ranking1-item" v-for="(item, index) in list" :key="index" :class="'Ranking1-item' + (index + 1)">
 | 
			
		||||
      <i>{{ index + 1 }}</i>
 | 
			
		||||
      <h2>{{ item.name }}</h2>
 | 
			
		||||
      <span>{{ item.value }}</span>
 | 
			
		||||
      <div class="Ranking1-item__rate--wrapper">
 | 
			
		||||
        <div class="Ranking1-item__rate" :style="{width: item.rate + '%'}">
 | 
			
		||||
          <div class="bar">
 | 
			
		||||
            <span></span>
 | 
			
		||||
            <i></i>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
  export default {
 | 
			
		||||
    name: 'Ranking1',
 | 
			
		||||
 | 
			
		||||
    props: {
 | 
			
		||||
      data: {
 | 
			
		||||
        type: Array,
 | 
			
		||||
        default: () => []
 | 
			
		||||
      },
 | 
			
		||||
 | 
			
		||||
      theme: {
 | 
			
		||||
        type: String,
 | 
			
		||||
        default: '0'
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    watch: {
 | 
			
		||||
      data: {
 | 
			
		||||
        handler (v) {
 | 
			
		||||
          this.init(v)
 | 
			
		||||
        },
 | 
			
		||||
        deep: true,
 | 
			
		||||
        immediate: true
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    data () {
 | 
			
		||||
      return {
 | 
			
		||||
        list: []
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    methods: {
 | 
			
		||||
      init (v) {
 | 
			
		||||
        if (!v.length) {
 | 
			
		||||
          this.list = []
 | 
			
		||||
          return false
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        const total = this.sum(v.map(v => v.value))
 | 
			
		||||
        this.list = v.map(e => {
 | 
			
		||||
          return {
 | 
			
		||||
            ...e,
 | 
			
		||||
            rate: ((Number(e.value) / total) * 100).toFixed(2)
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
      },
 | 
			
		||||
 | 
			
		||||
      sum (arr) {
 | 
			
		||||
        return arr.reduce((x, y) => x + y)
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
  .Ranking1 {
 | 
			
		||||
    height: 100%;
 | 
			
		||||
    overflow-y: auto;
 | 
			
		||||
 | 
			
		||||
    .Ranking1-item {
 | 
			
		||||
      display: flex;
 | 
			
		||||
      align-items: center;
 | 
			
		||||
      height: 36px;
 | 
			
		||||
      margin-bottom: 16px;
 | 
			
		||||
      padding-right: 18px;
 | 
			
		||||
      background: url(../asset/ranking4.png) no-repeat;
 | 
			
		||||
      background-size: 100% 100%;
 | 
			
		||||
 | 
			
		||||
      &.Ranking1-item1 {
 | 
			
		||||
        background: url(../asset/ranking1.png) no-repeat;
 | 
			
		||||
        background-size: 100% 100%;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      &.Ranking1-item2 {
 | 
			
		||||
        background: url(../asset/ranking2.png) no-repeat;
 | 
			
		||||
        background-size: 100% 100%;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      &.Ranking1-item3 {
 | 
			
		||||
        background: url(../asset/ranking3.png) no-repeat;
 | 
			
		||||
        background-size: 100% 100%;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      .Ranking1-item__rate--wrapper {
 | 
			
		||||
        flex: 1;
 | 
			
		||||
        background: #6F7171;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      .Ranking1-item__rate {
 | 
			
		||||
        position: relative;
 | 
			
		||||
 | 
			
		||||
        .bar {
 | 
			
		||||
          position: relative;
 | 
			
		||||
          width: calc(100% - 6px);
 | 
			
		||||
          height: 6px;
 | 
			
		||||
          background: linear-gradient(90deg, #ffbb45ff 0%, #76f7b8ff 98%);
 | 
			
		||||
 | 
			
		||||
          i {
 | 
			
		||||
            position: absolute;
 | 
			
		||||
            right: 0;
 | 
			
		||||
            top: 50%;
 | 
			
		||||
            z-index: 12;
 | 
			
		||||
            width: 22px;
 | 
			
		||||
            height: 22px;
 | 
			
		||||
            border: 1px solid #596269;
 | 
			
		||||
            border-radius: 50%;
 | 
			
		||||
            transform: translate(50%, -50%);
 | 
			
		||||
          }
 | 
			
		||||
 | 
			
		||||
          span {
 | 
			
		||||
            position: absolute;
 | 
			
		||||
            right: 0;
 | 
			
		||||
            top: 50%;
 | 
			
		||||
            z-index: 11;
 | 
			
		||||
            width: 10px;
 | 
			
		||||
            height: 10px;
 | 
			
		||||
            border-radius: 50%;
 | 
			
		||||
            background: #e1ffee;
 | 
			
		||||
            box-shadow: 0 0 10px 0 #26F0F7;
 | 
			
		||||
            transform: translate(50%, -50%);
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      i {
 | 
			
		||||
        width: 40px;
 | 
			
		||||
        text-align: center;
 | 
			
		||||
        font-size: 18px;
 | 
			
		||||
        color: #fff;
 | 
			
		||||
        font-weight: 600;
 | 
			
		||||
        font-style: normal;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      h2 {
 | 
			
		||||
        width: 90px;
 | 
			
		||||
        margin-left: 20px;
 | 
			
		||||
        color: #fff;
 | 
			
		||||
        font-size: 18px;
 | 
			
		||||
        font-family: PingFangSC-Medium, PingFang SC;
 | 
			
		||||
        font-weight: normal;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      span {
 | 
			
		||||
        width: 90px;
 | 
			
		||||
        text-align: left;
 | 
			
		||||
        font-size: 18px;
 | 
			
		||||
        color: #fff;
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    &.Ranking1-1 {
 | 
			
		||||
      .AiRanking-item {
 | 
			
		||||
        background: url(../asset/ranking4-dj.png) no-repeat;
 | 
			
		||||
        background-size: 100% 100%;
 | 
			
		||||
 | 
			
		||||
        &.Ranking1-item1 {
 | 
			
		||||
          background: url(../asset/ranking1-dj.png) no-repeat;
 | 
			
		||||
          background-size: 100% 100%;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        &.Ranking1-item2 {
 | 
			
		||||
          background: url(../asset/ranking2-dj.png) no-repeat;
 | 
			
		||||
          background-size: 100% 100%;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        &.Ranking1-item3 {
 | 
			
		||||
          background: url(../asset/ranking3-dj.png) no-repeat;
 | 
			
		||||
          background-size: 100% 100%;
 | 
			
		||||
        }
 | 
			
		||||
        .Ranking1-item__rate--wrapper {
 | 
			
		||||
          flex: 1;
 | 
			
		||||
          background: #928D7C;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        .Ranking1-item__rate {
 | 
			
		||||
          position: relative;
 | 
			
		||||
 | 
			
		||||
          .bar {
 | 
			
		||||
            position: relative;
 | 
			
		||||
            width: calc(100% - 6px);
 | 
			
		||||
            height: 6px;
 | 
			
		||||
            background: linear-gradient(90deg, #ffbb45ff 0%, #ff3e18ff 98%);
 | 
			
		||||
 | 
			
		||||
            i {
 | 
			
		||||
              border: 1px solid #AA9E93;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            span {
 | 
			
		||||
              background: #FAB56C;
 | 
			
		||||
              box-shadow: 0 0 10px 0 #fab56c;
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										156
									
								
								components/layout/AiRanking/components/Ranking2.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										156
									
								
								components/layout/AiRanking/components/Ranking2.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,156 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="Ranking2" :class="'Ranking2-' + theme">
 | 
			
		||||
    <div class="Ranking-item" v-for="(item, index) in list" :key="index" :class="'Ranking-item' + (index + 1)">
 | 
			
		||||
      <div class="Ranking-item__top">
 | 
			
		||||
        <div class="left">
 | 
			
		||||
          <i>{{ index + 1 > 9 ? '' : '0' }}{{ index + 1 }}</i>
 | 
			
		||||
          <h2>{{ item.name }}</h2>
 | 
			
		||||
        </div>
 | 
			
		||||
        <span>{{ item.value }}</span>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="Ranking-item__rate--wrapper">
 | 
			
		||||
        <div class="Ranking-item__rate" :style="{width: item.rate + '%'}">
 | 
			
		||||
          <div class="bar"></div>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
  export default {
 | 
			
		||||
    name: 'Ranking2',
 | 
			
		||||
 | 
			
		||||
    props: {
 | 
			
		||||
      data: {
 | 
			
		||||
        type: Array,
 | 
			
		||||
        default: () => []
 | 
			
		||||
      },
 | 
			
		||||
 | 
			
		||||
      theme: {
 | 
			
		||||
        type: String,
 | 
			
		||||
        default: '0'
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    watch: {
 | 
			
		||||
      data: {
 | 
			
		||||
        handler (v) {
 | 
			
		||||
          this.init(v)
 | 
			
		||||
        },
 | 
			
		||||
        deep: true,
 | 
			
		||||
        immediate: true
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    data () {
 | 
			
		||||
      return {
 | 
			
		||||
        list: []
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    methods: {
 | 
			
		||||
      init (v) {
 | 
			
		||||
        if (!v.length) {
 | 
			
		||||
          this.list = []
 | 
			
		||||
          return false
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        const total = this.sum(v.map(v => v.value))
 | 
			
		||||
        this.list = v.map(e => {
 | 
			
		||||
          return {
 | 
			
		||||
            ...e,
 | 
			
		||||
            rate: ((Number(e.value) / total) * 100).toFixed(2)
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
      },
 | 
			
		||||
 | 
			
		||||
      sum (arr) {
 | 
			
		||||
        return arr.reduce((x, y) => x + y)
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
  .Ranking2 {
 | 
			
		||||
    height: 100%;
 | 
			
		||||
    overflow-y: auto;
 | 
			
		||||
 | 
			
		||||
    .Ranking-item {
 | 
			
		||||
      margin-bottom: 16px;
 | 
			
		||||
 | 
			
		||||
      .Ranking-item__top {
 | 
			
		||||
        display: flex;
 | 
			
		||||
        align-items: center;
 | 
			
		||||
        justify-content: space-between;
 | 
			
		||||
        margin-bottom: 16px;
 | 
			
		||||
 | 
			
		||||
        .left {
 | 
			
		||||
          display: flex;
 | 
			
		||||
          align-items: center;
 | 
			
		||||
          height: 24px;
 | 
			
		||||
 | 
			
		||||
          i {
 | 
			
		||||
            width: 24px;
 | 
			
		||||
            height: 24px;
 | 
			
		||||
            line-height: 24px;
 | 
			
		||||
            margin-right: 11px;
 | 
			
		||||
            text-align: center;
 | 
			
		||||
            color: #fff;
 | 
			
		||||
            font-style: normal;
 | 
			
		||||
            font-size: 14px;
 | 
			
		||||
            border: 1px solid #fff;
 | 
			
		||||
          }
 | 
			
		||||
 | 
			
		||||
          h2 {
 | 
			
		||||
            color: rgba(255, 255, 255, 0.6);
 | 
			
		||||
            font-size: 14px;
 | 
			
		||||
            font-weight: 500;
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        span {
 | 
			
		||||
          color: #fff;
 | 
			
		||||
          font-weight: 700;
 | 
			
		||||
          font-size: 18px;
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      .Ranking-item__rate--wrapper {
 | 
			
		||||
        height: 6px;
 | 
			
		||||
        border-radius: 8px;
 | 
			
		||||
        background: rgba(128, 136, 142, 0.4);
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      .Ranking-item__rate {
 | 
			
		||||
        position: relative;
 | 
			
		||||
 | 
			
		||||
        .bar {
 | 
			
		||||
          position: relative;
 | 
			
		||||
          height: 6px;
 | 
			
		||||
          border-radius: 8px;
 | 
			
		||||
          background: rgb(24, 254, 254);
 | 
			
		||||
          box-shadow: 0 0 4px 0 rgba(24, 254, 254, 0.6);
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    &.Ranking2-1 {
 | 
			
		||||
      .Ranking-item {
 | 
			
		||||
        .Ranking-item__rate--wrapper {
 | 
			
		||||
          background: rgba(121, 74, 59, 0.4);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        .Ranking-item__rate {
 | 
			
		||||
          position: relative;
 | 
			
		||||
 | 
			
		||||
          .bar {
 | 
			
		||||
            background: rgb(255, 186, 68);
 | 
			
		||||
            box-shadow: 0 0 4px 0 rgba(255, 186, 68, 0.6);
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										151
									
								
								components/layout/AiRanking/components/Ranking3.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										151
									
								
								components/layout/AiRanking/components/Ranking3.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,151 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="Ranking3" :class="'Ranking3-' + theme">
 | 
			
		||||
    <div class="Ranking-item" v-for="(item, index) in list" :key="index" :class="'Ranking-item' + (index + 1)">
 | 
			
		||||
      <div class="Ranking-item__top">
 | 
			
		||||
        <div class="left">
 | 
			
		||||
          <i>No.{{ index + 1 > 9 ? '' : '0' }}{{ index + 1 }}</i>
 | 
			
		||||
          <h2>{{ item.name }}</h2>
 | 
			
		||||
        </div>
 | 
			
		||||
        <span>{{ item.value }}</span>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="Ranking-item__rate--wrapper">
 | 
			
		||||
        <div class="Ranking-item__rate" :style="{width: item.rate + '%'}">
 | 
			
		||||
          <div class="bar"></div>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
  export default {
 | 
			
		||||
    name: 'Ranking3',
 | 
			
		||||
 | 
			
		||||
    props: {
 | 
			
		||||
      data: {
 | 
			
		||||
        type: Array,
 | 
			
		||||
        default: () => []
 | 
			
		||||
      },
 | 
			
		||||
 | 
			
		||||
      theme: {
 | 
			
		||||
        type: String,
 | 
			
		||||
        default: '0'
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    watch: {
 | 
			
		||||
      data: {
 | 
			
		||||
        handler (v) {
 | 
			
		||||
          this.init(v)
 | 
			
		||||
        },
 | 
			
		||||
        deep: true,
 | 
			
		||||
        immediate: true
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    data () {
 | 
			
		||||
      return {
 | 
			
		||||
        list: []
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    methods: {
 | 
			
		||||
      init (v) {
 | 
			
		||||
        if (!v.length) {
 | 
			
		||||
          this.list = []
 | 
			
		||||
          return false
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        const total = this.sum(v.map(v => v.value))
 | 
			
		||||
        this.list = v.map(e => {
 | 
			
		||||
          return {
 | 
			
		||||
            ...e,
 | 
			
		||||
            rate: ((Number(e.value) / total) * 100).toFixed(2)
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
      },
 | 
			
		||||
 | 
			
		||||
      sum (arr) {
 | 
			
		||||
        return arr.reduce((x, y) => x + y)
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
  .Ranking3 {
 | 
			
		||||
    height: 100%;
 | 
			
		||||
    overflow-y: auto;
 | 
			
		||||
 | 
			
		||||
    .Ranking-item {
 | 
			
		||||
      margin-bottom: 16px;
 | 
			
		||||
 | 
			
		||||
      .Ranking-item__top {
 | 
			
		||||
        display: flex;
 | 
			
		||||
        align-items: center;
 | 
			
		||||
        justify-content: space-between;
 | 
			
		||||
        margin-bottom: 8px;
 | 
			
		||||
 | 
			
		||||
        .left {
 | 
			
		||||
          display: flex;
 | 
			
		||||
          align-items: center;
 | 
			
		||||
          height: 24px;
 | 
			
		||||
 | 
			
		||||
          i {
 | 
			
		||||
            width: 40px;
 | 
			
		||||
            height: 24px;
 | 
			
		||||
            line-height: 24px;
 | 
			
		||||
            margin-right: 8px;
 | 
			
		||||
            text-align: center;
 | 
			
		||||
            color: #fff;
 | 
			
		||||
            font-style: normal;
 | 
			
		||||
            font-size: 14px;
 | 
			
		||||
          }
 | 
			
		||||
 | 
			
		||||
          h2 {
 | 
			
		||||
            color: rgba(255, 255, 255, 1);
 | 
			
		||||
            font-size: 14px;
 | 
			
		||||
            font-weight: 500;
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        span {
 | 
			
		||||
          color: #fff;
 | 
			
		||||
          font-weight: 500;
 | 
			
		||||
          font-size: 14px;
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      .Ranking-item__rate--wrapper {
 | 
			
		||||
        height: 10px;
 | 
			
		||||
        background: rgb(26, 26, 26);
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      .Ranking-item__rate {
 | 
			
		||||
        position: relative;
 | 
			
		||||
 | 
			
		||||
        .bar {
 | 
			
		||||
          position: relative;
 | 
			
		||||
          height: 10px;
 | 
			
		||||
          background: linear-gradient(270deg, rgb(54, 234, 175) 0%, rgb(75, 179, 210) 100%);
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    &.Ranking3-1 {
 | 
			
		||||
      .Ranking-item {
 | 
			
		||||
        .Ranking-item__rate--wrapper {
 | 
			
		||||
          background: rgba(255, 217, 112, 0.16);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        .Ranking-item__rate {
 | 
			
		||||
          position: relative;
 | 
			
		||||
 | 
			
		||||
          .bar {
 | 
			
		||||
            background: linear-gradient(90deg, rgb(249, 210, 103) 0%, rgb(241, 150, 70) 100%);
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
</style>
 | 
			
		||||
		Reference in New Issue
	
	Block a user