单独构建大屏ui库,避免引入混乱
This commit is contained in:
344
ui/dv/layout/AiDvWrapper/layout/classic.vue
Normal file
344
ui/dv/layout/AiDvWrapper/layout/classic.vue
Normal file
@@ -0,0 +1,344 @@
|
||||
<template>
|
||||
<section class="classic">
|
||||
<div class="fill topPane">
|
||||
<div class="viewTabs" flex>
|
||||
<div v-for="view in tabs" :key="view.id" class="btn" :class="{active:view.id==active}" flex
|
||||
@click="$emit('change',view.id)">{{ view.label }}
|
||||
</div>
|
||||
<div v-if="hasMoreDvs" class="btn more" :class="{active:isMoreTabs}" flex>更多
|
||||
<div class="moreViews">
|
||||
<div v-for="view in moreTabs" :key="view.id" v-text="view.label"
|
||||
class="moreViewItem" :class="{active:view.id==active}"
|
||||
:popper-options="{boundariesElement:'AiDvWrapper'}"
|
||||
@click="$emit('change',view.id)"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="headerBottomBorder">
|
||||
<div class="breatheLights"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="headerCenter">
|
||||
<div class="headerZone">
|
||||
<ai-sprite width="600" height="90" class="fly" @init="initFly"/>
|
||||
<span>{{ title }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="fill topPane">
|
||||
<div class="settingZone" flex>
|
||||
<right-top-border class="time">{{ currentTime }}</right-top-border>
|
||||
<right-top-border class="setting" @click.native.stop="$emit('setting',true)"/>
|
||||
<right-top-border class="fullscreen" @click.native.stop="$emit('fullscreen')"/>
|
||||
</div>
|
||||
<div class="headerBottomBorder right">
|
||||
<div class="breatheLights"/>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import RightTopBorder from "../rightTopBorder";
|
||||
import AiSprite from "../../../AiSprite";
|
||||
export default {
|
||||
name: "classic",
|
||||
components: {AiSprite, RightTopBorder},
|
||||
props: {
|
||||
title: String,
|
||||
views: {default: () => []},
|
||||
active: String,
|
||||
currentTime: {default: null}
|
||||
},
|
||||
computed: {
|
||||
hasMoreDvs: v => v.views.length > 4,
|
||||
tabs: v => !v.hasMoreDvs ? v.views : v.views.slice(0, 3),
|
||||
moreTabs: v => v.views?.slice(3) || [],
|
||||
isMoreTabs: v => v.moreTabs?.some(e => e.id == this.active),
|
||||
},
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
methods: {
|
||||
initFly({layer, lib: {Arc}}) {
|
||||
const rand = (min, max) => min + (max - min) * Math.random()
|
||||
const startFly = (p) => {
|
||||
let scaleNum = rand(1, 3)
|
||||
const pos = [rand(0, 600), 90 - rand(8, 50)]
|
||||
p.attr({
|
||||
pos,
|
||||
scale: [scaleNum, scaleNum],
|
||||
radius: 1,
|
||||
fillColor: '#0aa5ff',
|
||||
filter: 'drop-shadow( 0, 2px, 2px, #0aa5ff)'
|
||||
})
|
||||
p.animate([
|
||||
pos,
|
||||
{y: 0}
|
||||
], {
|
||||
opacity: 0,
|
||||
duration: rand(1, 1.5) * 1000,
|
||||
iterations: Infinity,
|
||||
easing: 'ease-out'
|
||||
})
|
||||
setTimeout(() => layer.append(p), rand(1, 5) * 1000)
|
||||
}
|
||||
//初始化标题萤火效果
|
||||
let numP = 70;
|
||||
for (let i = 0; i <= numP; i++) {
|
||||
const p = new Arc()
|
||||
startFly(p)
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@font-face {
|
||||
font-family: DIN;
|
||||
src: url("../assets/D-DINExp.otf");
|
||||
}
|
||||
|
||||
.classic {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 120px;
|
||||
width: 100%;
|
||||
padding: 0 10px;
|
||||
position: relative;
|
||||
color: #fff;
|
||||
|
||||
.topPane {
|
||||
z-index: 5;
|
||||
}
|
||||
|
||||
.viewTabs {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 60px;
|
||||
font-size: 15px;
|
||||
overflow: visible;
|
||||
|
||||
.btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
justify-content: center;
|
||||
min-width: 120px;
|
||||
height: 48px;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
background-image: url("../assets/viewTabBtn.svg");
|
||||
|
||||
&.more {
|
||||
position: relative;
|
||||
overflow: visible;
|
||||
|
||||
&:hover {
|
||||
background-image: url("../assets/moreViewsBtn.svg");
|
||||
|
||||
.moreViews {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.active {
|
||||
position: relative;
|
||||
background-image: none;
|
||||
|
||||
&:before {
|
||||
content: " ";
|
||||
display: block;
|
||||
position: absolute;
|
||||
width: 126px;
|
||||
height: 38px;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
background-image: url("../assets/viewTabBtn-active.svg");
|
||||
}
|
||||
}
|
||||
|
||||
& + .btn, & + .moreTabs {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.settingZone {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-family: DIN, serif;
|
||||
height: 60px;
|
||||
justify-content: flex-end;
|
||||
font-size: 18px;
|
||||
z-index: 5;
|
||||
|
||||
.rightTopBorder + .rightTopBorder {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.time {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.setting {
|
||||
background-image: url("../assets/setting.svg");
|
||||
}
|
||||
|
||||
.fullscreen {
|
||||
background-image: url("../assets/fullscreen.svg");
|
||||
}
|
||||
}
|
||||
|
||||
.headerCenter {
|
||||
width: 880px;
|
||||
height: 90px;
|
||||
z-index: 3;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center -32px;
|
||||
background-image: url("../assets/headerCenterBg1.svg");
|
||||
|
||||
&:before {
|
||||
content: " ";
|
||||
display: block;
|
||||
position: absolute;
|
||||
background: linear-gradient(180deg, #040718 0%, rgba(4, 7, 24, 0) 100%);
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
pointer-events: none;
|
||||
height: 64px;
|
||||
z-index: 4;
|
||||
}
|
||||
|
||||
.headerZone {
|
||||
position: relative;
|
||||
margin: 0 auto;
|
||||
width: 760px;
|
||||
height: 124px;
|
||||
background-repeat: no-repeat;
|
||||
background-image: url("../assets/headerCenterBorderLight.svg"), url("../assets/headerCenterBorder.svg"), url("../assets/headerCenterBg2.png");
|
||||
background-position: center bottom, center 0, center -20px;
|
||||
overflow: visible;
|
||||
|
||||
& > span {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: calc(50% - 20px);
|
||||
transform: translate(-50%, -50%);
|
||||
white-space: nowrap;
|
||||
font-size: 40px;
|
||||
line-height: 47px;
|
||||
letter-spacing: 5px;
|
||||
text-shadow: 0 0 8px #1365FF, 0 0 2px rgba(133, 181, 255, .5);
|
||||
z-index: 9;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.fly {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
width: 600px;
|
||||
height: 90px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
z-index: 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.headerBottomBorder {
|
||||
position: relative;
|
||||
width: 538px;
|
||||
height: 15px;
|
||||
background-image: url("../assets/headerBottomBorder.svg");
|
||||
|
||||
&:before {
|
||||
content: " ";
|
||||
display: block;
|
||||
position: absolute;
|
||||
left: -3px;
|
||||
bottom: -3px;
|
||||
width: 40px;
|
||||
height: 12px;
|
||||
background-image: url("../assets/headerBottomLight.svg");
|
||||
}
|
||||
|
||||
.breatheLights {
|
||||
position: absolute;
|
||||
right: -7px;
|
||||
bottom: -20px;
|
||||
transform: translateX(100%);
|
||||
width: 132px;
|
||||
height: 20px;
|
||||
animation: breathes 1.5s ease-in-out infinite alternate;
|
||||
animation-delay: .5s;
|
||||
display: flex;
|
||||
background-repeat: no-repeat;
|
||||
|
||||
&:before {
|
||||
transform: translateX(calc(6px - 100%));
|
||||
display: block;
|
||||
content: " ";
|
||||
width: 44px;
|
||||
height: 20px;
|
||||
animation: breathes 1.5s ease-in-out infinite alternate;
|
||||
}
|
||||
|
||||
&:after {
|
||||
transform: translateX(-6px);
|
||||
display: block;
|
||||
content: " ";
|
||||
width: 44px;
|
||||
height: 20px;
|
||||
animation: breathes 1.5s infinite alternate;
|
||||
animation-delay: 1s;
|
||||
}
|
||||
}
|
||||
|
||||
&.right {
|
||||
float: right;
|
||||
transform: rotateY(180deg);
|
||||
}
|
||||
}
|
||||
|
||||
.moreViews {
|
||||
display: none;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
transform: translateY(100%);
|
||||
width: 120px;
|
||||
min-width: 120px;
|
||||
padding: 0;
|
||||
background: rgba(9, 43, 75, 0.5);
|
||||
box-shadow: 0 0 8px 0 #20B8FF inset;
|
||||
border: 1px solid #66DBFF;
|
||||
border-radius: 0;
|
||||
z-index: 2;
|
||||
|
||||
.moreViewItem {
|
||||
height: 44px;
|
||||
width: 100px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-bottom: 1px solid #0C5369;
|
||||
margin: 0 10px;
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
|
||||
&:last-of-type {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
&.active, &:hover {
|
||||
color: #FFDB52;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
184
ui/dv/layout/AiDvWrapper/layout/primary.vue
Normal file
184
ui/dv/layout/AiDvWrapper/layout/primary.vue
Normal file
@@ -0,0 +1,184 @@
|
||||
<template>
|
||||
<section class="primary">
|
||||
<div flex class="content">
|
||||
<b class="headerTitle" v-text="title" :style="titleStyle"/>
|
||||
<el-tabs class="fill" v-model="current" @tab-click="$emit('change', current)">
|
||||
<el-tab-pane v-for="tab in tabs" :key="tab.id" :label="tab.label" :name="tab.id"/>
|
||||
</el-tabs>
|
||||
<div class="rightPane" flex>
|
||||
<div class="item" v-text="currentTime"/>
|
||||
<div class="item setting mar-l24" @click.stop="$emit('setting',true)"/>
|
||||
<div class="item fullscreen mar-l14" @click.stop="$emit('fullscreen')"/>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "primary",
|
||||
model: {
|
||||
prop: "active",
|
||||
event: "change"
|
||||
},
|
||||
props: {
|
||||
title: String,
|
||||
views: {default: () => []},
|
||||
active: String,
|
||||
currentTime: {default: null}
|
||||
},
|
||||
computed: {
|
||||
tabs: v => [
|
||||
...v.views,
|
||||
// {label: "测试哦哦", id: 1},
|
||||
// {label: "测试哦哦", id: 2},
|
||||
// {label: "测试哦哦", id: 3},
|
||||
// {label: "测试哦哦", id: 4},
|
||||
// {label: "测试哦哦", id: 5},
|
||||
// {label: "测试哦哦", id: 6},
|
||||
// {label: "测试哦哦", id: 7},
|
||||
// {label: "测试哦哦", id: 8},
|
||||
// {label: "测试哦哦", id: 9},
|
||||
// {label: "测试哦哦", id: 10},
|
||||
],
|
||||
titleStyle: v => ({
|
||||
fontSize: `${v.$attrs.titleSize || 38}px`,
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
current: ""
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
active: {
|
||||
immediate: true,
|
||||
handler(v) {
|
||||
if (v != this.current) this.current = this.$copy(this.active)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getWeather() {
|
||||
this.$request.post("/app/weather/queryWeather").then(res => {
|
||||
if (res?.data) {
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// this.getWeather()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.primary {
|
||||
width: 100%;
|
||||
height: 96px;
|
||||
padding: 0 48px;
|
||||
box-sizing: border-box;
|
||||
color: #fff;
|
||||
|
||||
.content {
|
||||
height: 100%;
|
||||
background-image: url("../assets/headerPrimaryBG_lb.png"), url("../assets/headerPrimaryBg_rb.png");
|
||||
background-repeat: no-repeat;
|
||||
background-position: left bottom, right bottom;
|
||||
font-family: PingFang-SC;
|
||||
|
||||
.headerTitle {
|
||||
font-family: fangfang;
|
||||
font-size: 38px;
|
||||
font-weight: 400;
|
||||
line-height: 62px;
|
||||
letter-spacing: 1.52px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
:deep(.el-tabs) {
|
||||
margin-left: 92px;
|
||||
|
||||
.el-tabs__header {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.el-tabs__nav-wrap {
|
||||
padding: 0 24px;
|
||||
|
||||
&:after {
|
||||
content: none;
|
||||
}
|
||||
}
|
||||
|
||||
.el-tabs__active-bar {
|
||||
width: 88px;
|
||||
background: linear-gradient(270deg, #02feff00 0%, #02feffff 51%, #02feff00 100%);
|
||||
}
|
||||
|
||||
.el-tabs__item {
|
||||
color: #fff;
|
||||
font-size: 20px;
|
||||
font-weight: 400;
|
||||
font-family: PingFang-SC;
|
||||
user-select: none;
|
||||
|
||||
&.is-active {
|
||||
color: #02FEFF;
|
||||
}
|
||||
}
|
||||
|
||||
.el-tabs__nav-prev {
|
||||
padding-right: 14px;
|
||||
background-image: linear-gradient(270deg, #0b0d0cff 0%, #0f3031ff 72%, #02feffff 100%);
|
||||
|
||||
background-repeat: no-repeat;
|
||||
background-position: right center;
|
||||
background-size: 6px 32px;
|
||||
|
||||
.el-icon-arrow-left:before {
|
||||
color: #02FEFF;
|
||||
content: "◀";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.el-tabs__nav-next {
|
||||
padding-left: 14px;
|
||||
background-image: linear-gradient(270deg, #02feffff 0%, #0f3031ff 28%, #0b0d0cff 100%);
|
||||
background-repeat: no-repeat;
|
||||
background-position: left center;
|
||||
background-size: 6px 32px;
|
||||
|
||||
.el-icon-arrow-right:before {
|
||||
color: #02FEFF;
|
||||
content: "▶";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.rightPane {
|
||||
margin-left: 75px;
|
||||
padding: 0 11px 0 0;
|
||||
|
||||
.item {
|
||||
padding-left: 30px;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
background-image: url("../assets/timeIcon.png");
|
||||
background-repeat: no-repeat;
|
||||
background-position: left center;
|
||||
|
||||
&.setting {
|
||||
background-image: url("../assets/settingIcon.png") !important;
|
||||
}
|
||||
|
||||
&.fullscreen {
|
||||
background-image: url("../assets/fullscreenIcon.png") !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user