单独构建大屏ui库,避免引入混乱
87
ui/dv/layout/AiRanking/AiRanking.vue
Normal file
@@ -0,0 +1,87 @@
|
||||
<template>
|
||||
<div class="AiRanking" :class="'AiRanking-' + theme">
|
||||
<component :is="subType" :theme="theme" :data="data"></component>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Ranking1 from './components/Ranking1'
|
||||
import Ranking2 from './components/Ranking2'
|
||||
import Ranking3 from './components/Ranking3'
|
||||
export default {
|
||||
name: 'AiRanking',
|
||||
|
||||
components: {
|
||||
Ranking1,
|
||||
Ranking2,
|
||||
Ranking3
|
||||
},
|
||||
|
||||
props: {
|
||||
data: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
|
||||
theme: {
|
||||
type: String,
|
||||
default: '0'
|
||||
},
|
||||
|
||||
subType: {
|
||||
type: String,
|
||||
default: 'Ranking1'
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.AiRanking {
|
||||
height: 100%;
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 5px;
|
||||
height: 14px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-corner {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
min-height: 20px;
|
||||
background-clip: content-box;
|
||||
box-shadow: 0 0 0 5px rgba(116, 148, 170, 0.5) inset;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
box-shadow: 1px 1px 5px rgba(116, 148, 170, 0.5) inset;
|
||||
}
|
||||
|
||||
&.AiRanking-1 {
|
||||
::-webkit-scrollbar {
|
||||
width: 5px;
|
||||
height: 14px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-corner {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
min-height: 20px;
|
||||
background-clip: content-box;
|
||||
box-shadow: 0 0 0 5px rgba(250, 181, 108, 0.5) inset;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
box-shadow: 1px 1px 5px rgba(50, 181, 108, 0.5) inset;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
BIN
ui/dv/layout/AiRanking/asset/ranking1-dj.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
ui/dv/layout/AiRanking/asset/ranking1.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
ui/dv/layout/AiRanking/asset/ranking2-dj.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
ui/dv/layout/AiRanking/asset/ranking2.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
ui/dv/layout/AiRanking/asset/ranking3-dj.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
ui/dv/layout/AiRanking/asset/ranking3.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
ui/dv/layout/AiRanking/asset/ranking4-dj.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
ui/dv/layout/AiRanking/asset/ranking4.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
216
ui/dv/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 {
|
||||
.Ranking1-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
ui/dv/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
ui/dv/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>
|
||||