洋浦大屏数据项目阶段代码提交

init
gongdi 4 years ago
parent 21ec322f7c
commit af7f97ecf3

@ -0,0 +1,50 @@
<template>
<dv-border-box-12>
<div class="border-info-style" style="pointer-events: auto">
<div class="teacher-info-title-style">{{title}}</div>
<div class="data-info-style">
<slot></slot>
</div>
</div>
</dv-border-box-12>
</template>
<script>
export default{
data(){
return {}
},
props:['title'],
}
</script>
<style scoped lang="scss">
.dv-border-box-12 {
width: 400px;
height: 150px;
.border-info-style {
width: 400px;
height: 100%;
margin-top: 20px;
display: flex;
align-items: center;
padding-left: 10px;
.teacher-info-title-style {
width: 50px;
height: 90%;
line-height: 25px;
display: flex;
font-size: 16px;
justify-content: center;
align-items: center;
padding: 15px;
border-right: 1px solid #7ce7fd;
}
.data-info-style {
width: 350px;
height: 90%;
display: flex;
padding-right: 20px;
}
}
}
</style>

@ -1,20 +1,141 @@
<template>
<div>
动态模式
<div id="dynamicMode" class="dynamic-mode-style">
<div v-if="!loading" class="content-left-style">
<div class="content-title-style">
校园简报
</div>
<BorderBox12 title="教师情况">
<TeacherStudentInfo :dataInfo="teacherInfo"/>
</BorderBox12>
<BorderBox12 title="学生情况">
<TeacherStudentInfo :dataInfo="studentInfo"/>
</BorderBox12>
<BorderBox12 class="school-activity-box-style" title="校园活动">
<SchoolActivity/>
</BorderBox12>
</div>
<div v-if="!loading" class="content-right-style">
<div class="content-title-style school-safe-style">
校园安防
</div>
<BorderBox12 title="食品安全">
<FoodSafe :dataInfo="safeWarning"/>
</BorderBox12>
<BorderBox12 title="设备情况">
<EquipmentCondition :dataInfo="equipmentCondition"/>
</BorderBox12>
<BorderBox12 class="energy-condition-box-style" title="能耗情况">
<EnergyCondition :dataInfo="energyCondition"/>
</BorderBox12>
</div>
</div>
</template>
<script>
/*
* 动态模式
* */
import BorderBox12 from '../../common/borderBox12.vue';
import TeacherStudentInfo from '../threeDimensionalSchoolModel/teacherStudentInfo.vue';
import SchoolActivity from '../threeDimensionalSchoolModel/schoolActivity.vue';
import FoodSafe from './foodSafe.vue';
import EquipmentCondition from './equipmentCondition.vue';
import EnergyCondition from './energyCondition.vue';
export default{
data(){
return {}
return {
loading:true,
teacherInfo:{
shouldNum:162,
realNum:156,
lateNum:3,
missNum:6
},
studentInfo:{
shouldNum:1053,
realNum:1051,
lateNum:8,
missNum:2
},
safeWarning:{
disinfectWarning:6,
overdueWarning:1,
stockWarning:0,
},
equipmentCondition:{
totalNum: 38,
normalNum: 36,
faultNum: 2,
warningNum: 0
},
energyCondition:{
totalEnergy: 4856,
airConditionerEnergy: 133,
socketEnergy: 98,
lightingEnergy: 58,
otherEnergy: 10
}
}
},
mounted(){
this.cancelLoading();
},
methods:{
cancelLoading() {
setTimeout(() => {
this.loading = false
}, 1000)
},
},
components:{
BorderBox12,
TeacherStudentInfo,
SchoolActivity,
FoodSafe,
EquipmentCondition,
EnergyCondition
}
}
</script>
<style></style>
<style scoped lang="scss">
.dynamic-mode-style{
width: 100%;
height: 100%;
display: flex;
justify-content: space-between;
.content-left-style{
width: 400px;
height: auto;
.content-title-style{
width: 100%;
display: flex;
justify-content: center;
align-items: center;
padding: 16px 16px 30px 16px;
font-size: 20px;
color: #31a8fa;
border-bottom: 2px solid #e49543;
}
.school-activity-box-style{
height: 200px !important;
}
}
.content-right-style{
width: 400px;
height: auto;
.content-title-style{
width: 100%;
display: flex;
justify-content: center;
align-items: center;
padding: 16px 16px 30px 16px;
font-size: 20px;
color: #31a8fa;
border-bottom: 2px solid #3eceb1;
}
.energy-condition-box-style{
height: 200px !important;
}
}
}
</style>

@ -0,0 +1,68 @@
<template>
<div class="energy-condition-style">
<div class="data-row-style">
<span class="info-title-style">总能耗</span>
<span class="info-data-style">{{dataInfo.totalEnergy + 'kwh'}}</span>
</div>
<div class="data-row-style">
<span class="info-title-style">空调</span>
<span class="info-data-style">{{dataInfo.airConditionerEnergy + 'kwh'}}</span>
</div>
<div class="data-row-style">
<span class="info-title-style">插座</span>
<span class="info-data-style">{{dataInfo.socketEnergy + 'kwh'}}</span>
</div>
<div class="data-row-style">
<span class="info-title-style">照明</span>
<span class="info-data-style">{{dataInfo.lightingEnergy + 'kwh'}}</span>
</div>
<div class="data-row-style">
<span class="info-title-style">其他</span>
<span class="info-data-style">{{dataInfo.otherEnergy + 'kwh'}}</span>
</div>
</div>
</template>
<script>
/*
* 能耗情况
* */
export default{
data(){
return {}
},
props: {
dataInfo: {
type: Object,
default: {
totalEnergy: 0,
airConditionerEnergy: 0,
socketEnergy: 0,
lightingEnergy: 0,
otherEnergy: 0
}
}
}
}
</script>
<style scoped lang="scss">
.energy-condition-style {
width: 350px;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
padding-left: 10px;
font-size: 16px;
.data-row-style {
width: 100%;
height: 30px;
line-height: 30px;
display: flex;
justify-content: space-between;
.info-data-style {
color: #7ce7fd;
}
}
}
</style>

@ -0,0 +1,63 @@
<template>
<div class="equipment-condition-style">
<div class="data-row-style">
<span class="info-title-style">共计设备</span>
<span class="info-data-style">{{dataInfo.totalNum}}</span>
</div>
<div class="data-row-style">
<span class="info-title-style">正常运行</span>
<span class="info-data-style">{{dataInfo.normalNum}}</span>
</div>
<div class="data-row-style">
<span class="info-title-style">故障</span>
<span class="info-data-style">{{dataInfo.faultNum}}</span>
</div>
<div class="data-row-style">
<span class="info-title-style">告警</span>
<span class="info-data-style">{{dataInfo.warningNum}}</span>
</div>
</div>
</template>
<script>
/*
* 设备情况
* */
export default{
data(){
return {}
},
props: {
dataInfo: {
type: Object,
default: {
totalNum: 0,
normalNum: 0,
faultNum: 0,
warningNum: 0
}
}
}
}
</script>
<style scoped lang="scss">
.equipment-condition-style {
width: 350px;
height: 130px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
padding-left: 10px;
font-size: 16px;
.data-row-style {
width: 100%;
height: 30px;
line-height: 30px;
display: flex;
justify-content: space-between;
.info-data-style {
color: #7ce7fd;
}
}
}
</style>

@ -0,0 +1,55 @@
<template>
<div class="food-safe-style">
<div class="data-row-style">
<span class="info-title-style">备餐间消毒预警</span>
<span class="info-data-style">{{dataInfo.disinfectWarning}}</span>
</div>
<div class="data-row-style">
<span class="info-title-style">食品库存过期预警</span>
<span class="info-data-style">{{dataInfo.overdueWarning}}</span>
</div>
<div class="data-row-style">
<span class="info-title-style">食品库存用量预警</span>
<span class="info-data-style">{{dataInfo.stockWarning}}</span>
</div>
</div>
</template>
<script>
export default{
data(){
return {}
},
props: {
dataInfo: {
type: Object,
default: {
disinfectWarning: 0,
overdueWarning: 0,
stockWarning: 0
}
}
}
}
</script>
<style scoped lang="scss">
.food-safe-style {
width: 350px;
height: 130px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
padding-left: 10px;
font-size: 16px;
.data-row-style {
width: 100%;
height: 30px;
line-height: 30px;
display: flex;
justify-content: space-between;
.info-data-style {
color: #7ce7fd;
}
}
}
</style>

@ -1,6 +1,6 @@
<template>
<div id="index" ref="appRef" style="position: relative">
<iframe width="100%" height="100%" style="border: none" :src="model3DUrl"></iframe>
<iframe id="backIframe" width="100%" height="100%" :src="model3DUrl" frameborder="0"></iframe>
<div id="screenContent" class="bg" :style="{position:'absolute',top:0,pointerEvents:pointerEvents}">
<dv-loading v-if="loading">Loading...</dv-loading>
<div v-else class="host-body">

@ -1,68 +0,0 @@
<template>
<div :style="{width:pageWeight + 'px',height:pageHeight + 'px',backgroundImage:'url('+require('../assets/background-2.png')+')',backgroundSize:'100%'}" class="main-screen-style">
<div class="title-style" :style="{color:'white',fontSize:16 * fontSize + 'px'}">电商618数据大屏</div>
</div>
</template>
<script>
import BackImg from '../assets/background-1.png';
export default{
data(){
return {
rate: "",//
fontSize:1,
pageHeight: document.documentElement.clientHeight,//
pageWeight: document.documentElement.clientHeight * this.rate,//
}
},
created(){
this.rate = (document.documentElement.clientWidth/document.documentElement.clientHeight).toFixed(2);
let deviceWidth = document.documentElement.clientWidth;
if(deviceWidth > 640){
deviceWidth = 640;
}
this.fontSize = deviceWidth / 7.5;
console.log(this.rate)
this.handle()
},
mounted(){
document.body.style.backgroundImage = 'url(' +require('../assets/background-2.png')+ ')';
document.body.style.backgroundSize = '100%';
window.addEventListener("resize", this.screenResize(this.handle, 1000))
},
methods: {
screenResize: function (fn, wait) {
var timer = null;
return function () {
if (timer !== null) {
clearTimeout(timer);
}
timer = setTimeout(fn, wait)
}
},
handle: function () {
let windowWidth = document.documentElement.clientWidth;//
let windowHeight = document.body.clientHeight;//
console.log(windowWidth,windowHeight)
if(windowHeight * this.rate > windowWidth){
this.pageWeight = windowWidth;
this.pageHeight = windowWidth/this.rate;
}else if(windowHeight * this.rate < windowWidth){
this.pageHeight = windowHeight;
this.pageWeight = windowHeight * this.rate;
}
}
}
}
</script>
<style scoped lang="scss">
.main-screen-style {
border: 1px solid #31a8fa;
margin: auto;
.title-style{
}
}
</style>

@ -65,7 +65,7 @@
dateWeek: null,
weekday: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
modelTypes: [{id: 1, value: "动态模式"}, {id: 2, value: "立体校园模式"}, {id: 3, value: "传统模式"}],
modelId: 3,
modelId: 1,
}
},
mounted(){

@ -0,0 +1,51 @@
<template>
<div class="menu-item-style">
<dv-border-box-9>
<div class="menu-icon-style">
<my-icon :type="iconType" class="icon-style" style="font-size: 50px;"></my-icon>
</div>
</dv-border-box-9>
<div class="menu-name-style">{{name}}</div>
</div>
</template>
<script>
export default{
data(){
return {}
},
props:["name","iconType"]
}
</script>
<style scoped lang="scss">
.menu-item-style{
width: 120px;
height: 130px;
margin: 50px auto 0;
cursor: pointer;
.dv-border-box-9{
width: 100%;
height: 100px;
display: flex;
flex-direction: column;
.menu-icon-style{
width: 120px;
height: 100px;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
}
.menu-name-style{
width: 100%;
height: 20px;
margin-top: 10px;
font-size: 16px;
color: #31a8fa;
font-weight: bolder;
text-align: center;
}
}
</style>

@ -0,0 +1,42 @@
<template>
<dv-border-box-13>
<div class="menu-right-style" style="pointer-events: auto">
<vue-scroll :ops="listScroll" style="height:800px">
<menu-item v-for="item in menuAry" :key="item.id" :name="item.name" :iconType="item.iconType"/>
</vue-scroll>
</div>
</dv-border-box-13>
</template>
<script>
/*
* 右侧菜单导航
* */
import Vue from 'vue'
import MenuConfig from '../../menuConfig';
import MenuItem from './menuItem.vue';
import {Icon} from 'ant-design-vue';
import vueScroll from "vuescroll";//vuescroll
import "vuescroll/dist/vuescroll.css";//vuescroll
export default{
data(){
return {
listScroll:this.StaticParams.scrollOption,
menuAry: MenuConfig,
}
},
components: {
MenuItem,
AIcon: Icon,
vueScroll
}
}
</script>
<style scoped lang="scss">
.menu-right-style {
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
padding: 16px;
}
</style>

@ -0,0 +1,66 @@
<template>
<div class="school-activity-style">
<div class="activity-type-style">
<div class="data-row-style activity-title-style">学生活动</div>
<div class="data-row-style">
<span class="info-title-style">[小学] 社团活动</span>
<span class="info-data-style">6</span>
</div>
<div class="data-row-style">
<span class="info-title-style">[初中] 读书日</span>
<span class="info-data-style">3</span>
</div>
</div>
<div class="activity-type-style">
<div class="data-row-style activity-title-style">教师活动</div>
<div class="data-row-style">
<span class="info-title-style">[小学] 教研活动</span>
<span class="info-data-style">1</span>
</div>
<div class="data-row-style">
<span class="info-title-style">[初中] 教师培训</span>
<span class="info-data-style">1</span>
</div>
</div>
</div>
</template>
<script>
/*
* 校园活动
* */
export default{
data(){
return {}
}
}
</script>
<style scoped lang="scss">
.school-activity-style{
width: 350px;
display: flex;
flex-direction: column;
font-size: 16px;
justify-content: center;
align-items: center;
.activity-type-style{
width: 100%;
height: 100px;
display: flex;
flex-direction: column;
justify-content: center;
padding-left: 10px;
.data-row-style{
height:25px;
line-height: 25px;
display: flex;
justify-content: space-between;
.info-data-style{
color: #7ce7fd;
}
}
.activity-title-style{
font-weight: bolder;
}
}
}
</style>

@ -1,94 +0,0 @@
<template>
<dv-border-box-12>
<div class="teacher-info-style" style="pointer-events: auto">
<div class="teacher-info-title-style">教师情况</div>
<div class="data-info-style">
<div class="chart" ref="myCharts" style="width: 160px;height: 130px"></div>
</div>
</div>
</dv-border-box-12>
</template>
<script>
import {getPie3D, getParametricEquation} from '../../utils/chart.js' //js
import * as echarts from 'echarts';
import 'echarts-gl'
export default{
data(){
return {}
},
created(){
//this.setLabel()
},
mounted () {
this.initChart()
//
// //
// const that = this
// window.onresize = function () {
// that.changeSize()
// }
},
methods: {
initChart() {
const myCharts = echarts.init(this.$refs.myCharts);
let option = getPie3D([
{
name: '实到',
value: 158,
itemStyle: {
opacity: 0.3,
// color: 'green',
}
},
{
name: '迟到',
value: 3,
itemStyle: {
opacity: 0.3,
// color: 'green',
}
},
{
name: '缺勤',
value: 3,
itemStyle: {
opacity: 0.3,
// color: 'green',
}
}
],0);
myCharts.setOption(option)
}
}
}
</script>
<style scoped lang="scss">
.dv-border-box-12 {
width: 400px;
height: 150px;
.teacher-info-style {
width: 400px;
height: 150px;
margin-top: 20px;
display: flex;
align-items: center;
padding-left: 10px;
.teacher-info-title-style {
width: 50px;
height: 130px;
line-height: 25px;
display: flex;
font-size: 16px;
justify-content: center;
align-items: center;
padding: 15px;
border-right: 1px solid #7ce7fd;
}
.data-info-style {
width: 350px;
height: 130px;
}
}
}
</style>

@ -0,0 +1,104 @@
<template>
<div class="teacher-student-info-style">
<div class="chart" ref="myCharts" style="width: 200px;height: 130px"></div>
<div class="data-row-style" style="width: 150px;height: 130px">
<div class="row-info-style">
<span class="info-title-style">应到</span>
<span class="info-data-style">{{dataInfo.shouldNum}}</span>
</div>
<div class="row-info-style">
<span class="info-title-style">实到</span>
<span class="info-data-style">{{dataInfo.realNum}}</span>
</div>
<div class="row-info-style">
<span class="info-title-style">迟到</span>
<span class="info-data-style">{{dataInfo.lateNum}}</span>
</div>
<div class="row-info-style">
<span class="info-title-style">缺勤</span>
<span class="info-data-style">{{dataInfo.missNum}}</span>
</div>
</div>
</div>
</template>
<script>
import {getPie3D, getParametricEquation} from '../../utils/chart.js' //js
import * as echarts from 'echarts';
import 'echarts-gl'
export default{
data(){
return {}
},
props: {
dataInfo: {
type: Object,
default: {
shouldNum: 0,
realNum: 0,
lateNum: 0,
missNum: 0
}
}
},
mounted () {
this.initChart()
},
methods: {
initChart() {
const myCharts = echarts.init(this.$refs.myCharts);
let option = getPie3D([
{
name: '实到',
value: this.dataInfo.realNum,
itemStyle: {
opacity: 0.3,
// color: 'green',
}
},
{
name: '迟到',
value: this.dataInfo.lateNum,
itemStyle: {
opacity: 0.3,
// color: 'green',
}
},
{
name: '缺勤',
value: this.dataInfo.missNum,
itemStyle: {
opacity: 0.3,
// color: 'green',
}
}
], 0);
myCharts.setOption(option)
}
}
}
</script>
<style scoped lang="scss">
.teacher-student-info-style {
width: 350px;
height: 130px;
display: flex;
padding-right: 20px;
.data-row-style {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.row-info-style {
width: 100%;
height: 25px;
line-height: 25px;
display: flex;
justify-content: space-between;
font-size: 16px;
.info-data-style {
color: #7ce7fd;
}
}
}
}
</style>

@ -4,10 +4,18 @@
<div class="content-title-style">
校园简报
</div>
<TeacherInfo/>
<BorderBox12 title="教师情况">
<TeacherStudentInfo :dataInfo="teacherInfo"/>
</BorderBox12>
<BorderBox12 title="学生情况">
<TeacherStudentInfo :dataInfo="studentInfo"/>
</BorderBox12>
<BorderBox12 class="school-activity-box-style" title="校园活动">
<SchoolActivity/>
</BorderBox12>
</div>
<div v-if="!loading" class="content-right-style">
<MenuRight/>
</div>
</div>
</template>
@ -15,11 +23,26 @@
/*
* 立体校园模式
* */
import TeacherInfo from './teacherInfo.vue';
import BorderBox12 from '../../common/borderBox12.vue';
import TeacherStudentInfo from './teacherStudentInfo.vue';
import SchoolActivity from './schoolActivity.vue';
import MenuRight from './menuRight.vue';
export default{
data(){
return {
loading:true,
teacherInfo:{
shouldNum:162,
realNum:156,
lateNum:3,
missNum:6
},
studentInfo:{
shouldNum:1053,
realNum:1051,
lateNum:8,
missNum:2
}
}
},
mounted(){
@ -33,7 +56,10 @@
},
},
components:{
TeacherInfo
BorderBox12,
TeacherStudentInfo,
SchoolActivity,
MenuRight
}
}
</script>
@ -56,10 +82,16 @@
color: #31a8fa;
border-bottom: 2px solid #e49543;
}
.school-activity-box-style{
height: 200px !important;
}
}
.content-right-style{
width: 400px;
height: auto;
width: 180px;
height: 800px;
display: flex;
justify-content: center;
align-items: center;
}
}
</style>

@ -1,6 +1,6 @@
<template>
<dv-border-box-1>
<div class="menu-item-style">
<div class="menu-item-style" @click="menuClick">
<div class="menu-name-style">{{name}}</div>
<my-icon :type="iconType" class="icon-style" style="font-size: 80px;margin-top: 50px"></my-icon>
</div>
@ -11,7 +11,12 @@
data(){
return {}
},
props:["name","iconType"]
props:["name","iconType"],
methods:{
menuClick:function () {
this.$emit("menuClick")
}
}
}
</script>
<style scoped lang="scss">

@ -1,16 +1,9 @@
<template>
<div id="traditionalModel" class="traditional-menu-style">
<!--<dv-border-box-9>-->
<!--<dv-border-box-1>dv-border-box-1</dv-border-box-1>-->
<!--</dv-border-box-9>-->
<dv-border-box-10>
<div class="menu-content-style">
<menu-item v-for="item in menuAry" :key="item.id" :name="item.name" :iconType="item.iconType"/>
<menu-item v-for="item in menuAry" :key="item.id" :name="item.name" :iconType="item.iconType" @menuClick="menuClick"/>
</div>
<!--<dv-border-box-1>dv-border-box-1</dv-border-box-1>-->
<!--<dv-border-box-1>dv-border-box-1</dv-border-box-1>-->
</dv-border-box-10>
</div>
</template>
@ -28,13 +21,17 @@
},
mounted(){
},
methods:{
menuClick:function () {
}
},
components:{
MenuItem
}
}
</script>
<style scoped lang="scss">
.traditional-menu-style{
width: 100%;

@ -290,7 +290,6 @@ function getParametricEquation(startRatio, endRatio, isSelected, isHovered, k, h
// 计算选中效果分别在 x 轴、y 轴方向上的位移(未选中,则位移均为 0
let offsetX = isSelected ? Math.cos(midRadian) * 0.1 : 0;
let offsetY = isSelected ? Math.sin(midRadian) * 0.1 : 0;
console.log(offsetX,offsetY)
// 计算高亮效果的放大比例(未高亮,则比例为 1
let hoverRate = isHovered ? 1.05 : 1;
// 返回曲面参数方程
@ -322,7 +321,6 @@ function getParametricEquation(startRatio, endRatio, isSelected, isHovered, k, h
if (u > endRadian) {
return offsetY + Math.sin(endRadian) * (1 + Math.cos(v) * k) * hoverRate;
}
console.log("k:",k)
return offsetY + Math.sin(u) * (1 + Math.cos(v) * k) * hoverRate;
},
@ -434,12 +432,12 @@ function getPie3D(pieData, internalDiameterRatio) {
// }
// },
xAxis3D: {
min: -1,
max: 1
min: -1.5,
max: 1.5
},
yAxis3D: {
min: -1,
max: 1
min: -1.5,
max: 1.5
},
zAxis3D: {
min: -1,

@ -2,8 +2,8 @@
// * 默认缩放值
const scale = {
width: '1',
height: '1',
width: '1',
height: '1',
}
// * 设计稿尺寸px

Loading…
Cancel
Save