Browse Source

修改首页页面

master
zyc@123456 2 years ago
parent
commit
836505dea0
  1. 9
      src/layout/components/Navbar.vue
  2. 100
      src/layout/components/Sidebar/index.vue
  3. 56
      src/router/index.js
  4. 222
      src/views/echarts/components/PieChartrenyuan.vue
  5. 31
      src/views/monitor/videos/index.vue
  6. 20
      src/views/renlianshibie/renlianshibieList.vue

9
src/layout/components/Navbar.vue

@ -7,7 +7,7 @@
<!-- <p>{{Orgname}} {{departmentName}} 欢迎, {{name}}</p>--> <!-- <p>{{Orgname}} {{departmentName}} 欢迎, {{name}}</p>-->
<p>欢迎您{{name}}</p> <p>欢迎您{{name}}</p>
<el-badge :value="6" class="item"> <el-badge :value="6" class="item">
<img src="@/assets/images/info.png"> <img @click="toxiaoxi()" src="@/assets/images/info.png">
</el-badge> </el-badge>
<!-- <img src="@/assets/images/dy.png" @click="logout"> --> <!-- <img src="@/assets/images/dy.png" @click="logout"> -->
<span class="backToHome" @click="logout"><i class="el-icon-back"></i>返回首页</span> <span class="backToHome" @click="logout"><i class="el-icon-back"></i>返回首页</span>
@ -41,6 +41,9 @@
// this.$router.push({ path: '/home' }) // this.$router.push({ path: '/home' })
window.opener = null window.opener = null
window.open('about:blank', '_top').close() window.open('about:blank', '_top').close()
},
toxiaoxi() {
this.$router.push('/xiaoxi/xiaoxiList')
} }
} }
} }
@ -74,8 +77,8 @@
display: flex; display: flex;
align-items: center; align-items: center;
color: #fff; color: #fff;
font-size: 26px; font-size: 24px;
line-height: 60px; line-height: 60px;font-weight: bold;
margin: 0; margin: 0;
float: left; float: left;
} }

100
src/layout/components/Sidebar/index.vue

@ -97,26 +97,26 @@
// path: "/gongyingshang/gongyingshanggaunli", // path: "/gongyingshang/gongyingshanggaunli",
// }] // }]
// }, // },
{ // {
alwaysShow: true, // alwaysShow: true,
component: "dianzixungeng", // component: "dianzixungeng",
meta: { // meta: {
icon: "icon-jingwuicon_svg-", // icon: "icon-jingwuicon_svg-",
title: "电子巡更", // title: "",
}, // },
name: "", // name: "",
path: "/dianzixungeng/dianzixungengL", // path: "/dianzixungeng/dianzixungengL",
// children: [{ // // children: [{
// alwaysShow: true, // // alwaysShow: true,
// component: "index", // // component: "index",
// meta: { // // meta: {
// icon: "el-icon-help", // // icon: "el-icon-help",
// title: "", // // title: "",
// }, // // },
// name: "/dianzixungeng/dianzixungengL", // // name: "/dianzixungeng/dianzixungengL",
// path: "/dianzixungeng/dianzixungengL", // // path: "/dianzixungeng/dianzixungengL",
// }] // // }]
}, // },
{ {
alwaysShow: true, alwaysShow: true,
component: "renlianshibie", component: "renlianshibie",
@ -137,26 +137,26 @@
// path: "/renlianshibie/renlianshibieList", // path: "/renlianshibie/renlianshibieList",
// }] // }]
}, },
{ // {
alwaysShow: true, // alwaysShow: true,
component: "xiaofangbaojing", // component: "xiaofangbaojing",
meta: { // meta: {
icon: "icon-baojingshu", // icon: "icon-baojingshu",
title: "消防报警", // title: "",
}, // },
name: "", // name: "",
path: "/xiaofangbaojing/xiaofangbaojingL", // path: "/xiaofangbaojing/xiaofangbaojingL",
// children: [{ // // children: [{
// alwaysShow: true, // // alwaysShow: true,
// component: "index", // // component: "index",
// meta: { // // meta: {
// icon: "el-icon-help", // // icon: "el-icon-help",
// title: "", // // title: "",
// }, // // },
// name: "/xiaofangbaojing/xiaofangbaojingL", // // name: "/xiaofangbaojing/xiaofangbaojingL",
// path: "/xiaofangbaojing/xiaofangbaojingL", // // path: "/xiaofangbaojing/xiaofangbaojingL",
// }] // // }]
}, // },
{ {
alwaysShow: true, alwaysShow: true,
component: "shebeitaizhang", component: "shebeitaizhang",
@ -236,6 +236,26 @@
// name: "/shebeirizhi/shebeirizhiList", // name: "/shebeirizhi/shebeirizhiList",
// path: "/shebeirizhi/shebeirizhiList", // path: "/shebeirizhi/shebeirizhiList",
// }] // }]
},
// {
// alwaysShow: true,
// component: "xiaoxi",
// meta: {
// icon: "icon-rizhi2",
// title: "",
// },
// name: "",
// path: "/xiaoxi/xiaoxiList",
// },
{
alwaysShow: true,
component: "daping",
meta: {
icon: "icon-jiance",
title: "布防大屏",
},
name: "",
path: "/daping",
} }
], ],
params: { params: {

56
src/router/index.js

@ -29,6 +29,11 @@ export const constantRoutes = [
path: "/login", path: "/login",
component: () => import("@/views/login/login.vue"), component: () => import("@/views/login/login.vue"),
}, },
{
path: "/daping",
component: () => import("@/views/daping/daping.vue"),
name: "daping",
},
{ {
path: "/home", path: "/home",
component: () => import("@/views/Home/Home.vue"), component: () => import("@/views/Home/Home.vue"),
@ -193,45 +198,66 @@ export const constantRoutes = [
], ],
}, },
////电子巡更 ////电子巡更
// {
// path: "/dianzixungengL",
// component: Layout,
// redirect: "/dianzixungeng/dianzixungengL",
// meta: {
// title: "电子巡更",
// },
// children: [
// {
// path: "/dianzixungeng/dianzixungengL",
// component: () => import("@/views/dianzixungeng/dianzixungengL.vue"),
// name: "dianzixungengL",
// meta: {
// title: "电子巡更",
// noCache: true,
// },
// },
// ],
// },
////消防报警
{ {
path: "/dianzixungengL", path: "/xiaofangbaojingL",
component: Layout, component: Layout,
redirect: "/dianzixungeng/dianzixungengL", redirect: "/xiaofangbaojing/xiaofangbaojingL",
meta: { meta: {
title: "电子巡更", title: "消防报警",
}, },
children: [ children: [
{ {
path: "/dianzixungeng/dianzixungengL", path: "/xiaofangbaojing/xiaofangbaojingL",
component: () => import("@/views/dianzixungeng/dianzixungengL.vue"), component: () => import("@/views/xiaofangbaojing/xiaofangbaojingL.vue"),
name: "dianzixungengL", name: "xiaofangbaojingL",
meta: { meta: {
title: "电子巡更", title: "消防报警",
noCache: true, noCache: true,
}, },
}, },
], ],
}, },
////消防报警 ////消
{ {
path: "/xiaofangbaojingL", path: "/xiaoxiList",
component: Layout, component: Layout,
redirect: "/xiaofangbaojing/xiaofangbaojingL", redirect: "/xiaoxi/xiaoxiList",
meta: { meta: {
title: "消防报警", title: "消",
}, },
children: [ children: [
{ {
path: "/xiaofangbaojing/xiaofangbaojingL", path: "/xiaoxi/xiaoxiList",
component: () => import("@/views/xiaofangbaojing/xiaofangbaojingL.vue"), component: () => import("@/views/xiaoxi/xiaoxiList.vue"),
name: "xiaofangbaojingL", name: "xiaoxiList",
meta: { meta: {
title: "消防报警", title: "消",
noCache: true, noCache: true,
}, },
}, },
], ],
}, },
//// ////
...codemenu, ...codemenu,

222
src/views/echarts/components/PieChartrenyuan.vue

@ -1,38 +1,39 @@
<template> <template>
<div :class="className" :style="{height:height,width:width}" /> <div :class="className" :style="{ height: height, width: width }" />
</template> </template>
<script> <script>
// import echarts from 'echarts' import * as echarts from 'echarts'
import * as echarts from 'echarts';
// require('echarts/theme/macarons') // echarts theme // require('echarts/theme/macarons') // echarts theme
import resize from './mixins/resize' import resize from './mixins/resize'
import router from '../../../router' import router from '../../../router/index'
export default { export default {
mixins: [resize], mixins: [resize],
props: { props: {
className: { className: {
type: String, type: String,
default: 'chart' default: 'chart',
}, },
width: { width: {
type: String, type: String,
default: '100%' default: '100%',
}, },
height: { height: {
type: String, type: String,
default: '250px' default: '100%',
}, },
chartData: { chartData: {
type: Object, type: Object,
required: true required: true,
} },
}, },
data() { data() {
return { return {
chart: null chart: null,
startCharts: null,
charPie3currentIndex: 0,
dataLen: 0,
} }
}, },
watch: { watch: {
@ -40,18 +41,36 @@ export default {
deep: true, deep: true,
handler(val) { handler(val) {
this.setOptions(val) this.setOptions(val)
} },
} },
}, },
// mounted() {
// this.$nextTick(() => {
// this.initChart()
// })
// },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
this.initChart() this.initChart()
}) })
//
// this.init(); //
let _this = this
window.addEventListener('resize', function () {
if (_this.resizeTimer) clearTimeout(_this.resizeTimer)
_this.resizeTimer = setTimeout(function () {
_this.chart.resize()
}, 100)
})
}, },
beforeDestroy() { beforeDestroy() {
if (!this.chart) { if (!this.chart) {
return return
} }
if (this.startCharts) {
clearInterval(this.startCharts)
}
this.chart.dispose() this.chart.dispose()
this.chart = null this.chart = null
}, },
@ -60,52 +79,66 @@ export default {
this.chart = echarts.init(this.$el, 'macarons') this.chart = echarts.init(this.$el, 'macarons')
this.setOptions(this.chartData) this.setOptions(this.chartData)
}, },
setOptions({ legend, seriesName, Data, nextUrl, unit, params } = {}) { setOptions({
this.chart.setOption({ legend,
seriesName,
Data,
nextUrl,
unit,
params,
color,
} = {}) {
var option = {
title: { title: {
text: seriesName, text: seriesName,
// subtext: '', // subtext: '',
x: 'center', x: 'center',
// bottom: 10, // bottom: 0,
top: 10, top: 0,
//left: 30, // left: 30,
textStyle: { textStyle: {
fontSize: 20, // fontSize: 20,
color: '#8657c8', color: '#b7d8fa',
//fontWeight: 'bolder' // fontSize: 0,
}
// fontWeight: 'bolder' //
},
}, },
grid: { grid: {
left: 10, left: 10,
right: 10, right: 10,
bottom: 10, bottom: 10,
top: 10, top: 0,
containLabel: true containLabel: true,
}, },
tooltip: { tooltip: {
show: false,
trigger: 'item', trigger: 'item',
// formatter: '{b} : {c} ' + unit + ' ({d}%)' formatter: '{b} : {c} ' + unit + ' ({d}%)',
formatter: '{a} <br/>{b} : {c} ({d}%)' // formatter: '{a} <br/>{b} : {c} ({d}%)'
}, },
legend: { legend: {show: false,
// right: '10', // right: '10',
bottom: '30', bottom: '0',
data: legend, // ['Industries', 'Technology', 'Forex', 'Gold', 'Forecasts'] data: legend, // ['Industries', 'Technology', 'Forex', 'Gold', 'Forecasts']
textStyle: { textStyle: {
// fontSize: 14, fontSize: 14,
color: '#666' color: '#b7d8fa',
// fontWeight: 'bolder' // // fontWeight: 'bolder' //
} },
}, },
series: [ series: [
{ {
name: seriesName, // 'WEEKLY WRITE ARTICLES', name: seriesName, // 'WEEKLY WRITE ARTICLES',
type: 'pie', type: 'pie',
color: color,
// color:[ 'green','blue'],
// roseType: 'radius', // roseType: 'radius',
radius: [50, 60], radius: [55, 60],
center: ['50%', '48%'], center: ['50%', '50%'],
data: Data.seriesData, data: Data.seriesData,
// roseType: 'area',
// [ // [
// { value: 320, name: 'Industries' }, // { value: 320, name: 'Industries' },
// { value: 240, name: 'Technology' }, // { value: 240, name: 'Technology' },
@ -113,14 +146,36 @@ export default {
// { value: 100, name: 'Gold' }, // { value: 100, name: 'Gold' },
// { value: 59, name: 'Forecasts' } // { value: 59, name: 'Forecasts' }
// ], // ],
// itemStyle: {
// borderRadius: 3
// borderColor: '#091243',
// borderWidth: 2
// },
animationEasing: 'cubicInOut', animationEasing: 'cubicInOut',
animationDuration: 2600, animationDuration: 2600,
emphasis: {
label: {
show: false,
},
},
label: { label: {
show: false,
// formatter: '{b}:\n{c} ' + unit,
formatter: '{d}%',
position: 'center',
emphasis: {
show: true,
textStyle: {
fontSize: '22',
color: '#3595f9',
},
},
},
label22: {
normal: { normal: {
show: false, show: false,
// formatter: '{a|{a}}{abg|}\n{hr|}\n {b|{b}}{c} \n{hr|}\n {per|{d}%} ', // formatter: '{a|{a}}{abg|}\n{hr|}\n {b|{b}}{c} \n{hr|}\n {per|{d}%} ',
formatter: '{b|{b}:}{c} ' + unit + ' \n{hr|}\n {per|{d}%} ', formatter: '{b|{b}:}{c} ' + unit + ' \n{hr|}\n {per|{d}%} ',
// backgroundColor: '#eee', // backgroundColor: '#eee',
// borderColor: '#aaa', // borderColor: '#aaa',
// borderWidth: 1, // borderWidth: 1,
@ -147,26 +202,27 @@ export default {
borderColor: '#aaa', borderColor: '#aaa',
width: '100%', width: '100%',
borderWidth: 0.5, borderWidth: 0.5,
height: 0 height: 0,
}, },
b: { b: {
fontSize: 12, fontSize: 14,
lineHeight: 33 lineHeight: 33,
}, },
per: { per: {
color: '#eee', color: '#eee',
backgroundColor: '#334455', backgroundColor: '#334455',
padding: [2, 4], padding: [2, 4],
borderRadius: 2 borderRadius: 2,
} },
} },
} },
} },
} },
] ],
}) }
this.chart.on('click', function(param) { this.chart.setOption(option)
if (nextUrl.length > 0) { this.chart.on('click', function (param) {
if (nextUrl != null && nextUrl.length > 0) {
// nexurl // nexurl
var url = '' var url = ''
for (var i = 0; i < nextUrl.length; i++) { for (var i = 0; i < nextUrl.length; i++) {
@ -180,8 +236,8 @@ export default {
query: { query: {
id: param.name, id: param.name,
start: params.start, start: params.start,
end: params.end end: params.end,
} },
}) })
// -- // --
// let routeUrl = router.resolve({ // let routeUrl = router.resolve({
@ -195,7 +251,67 @@ export default {
// 3: this.$router.push({name:'detail',params:{id:123,name:'lisi'}}) // 3: this.$router.push({name:'detail',params:{id:123,name:'lisi'}})
} }
}) })
}
} var _this = this
var isSet = true //
_this.charPie3currentIndex = 0
// 2
this.chart.on('mouseover', function (param) {
isSet = false
//
_this.chart.dispatchAction({
type: 'downplay',
seriesIndex: 0,
// dataIndex: _this.charPie3currentIndex
})
//
_this.chart.dispatchAction({
type: 'highlight',
seriesIndex: 0,
dataIndex: param.dataIndex,
})
// tooltip
// _this.chart.dispatchAction({
// type: "showTip",
// seriesIndex: 0,
// dataIndex: param.dataIndex,
// });
})
// 3
var chartHover = function () {
_this.dataLen = option.series[0].data.length
//
_this.chart.dispatchAction({
type: 'downplay',
seriesIndex: 0,
// dataIndex: _this.charPie3currentIndex
})
_this.charPie3currentIndex =
(_this.charPie3currentIndex + 1) % _this.dataLen
//
_this.chart.dispatchAction({
type: 'highlight',
seriesIndex: 0,
dataIndex: _this.charPie3currentIndex,
})
// tooltip
// _this.chart.dispatchAction({
// type: "showTip",
// seriesIndex: 0,
// dataIndex: _this.charPie3currentIndex,
// });
}
clearInterval(_this.startCharts)
_this.startCharts = setInterval(chartHover, 2000)
// 4
this.chart.on('mouseout', function (param) {
if (!isSet) {
clearInterval(_this.startCharts)
_this.startCharts = setInterval(chartHover, 2000)
isSet = true
}
})
},
},
} }
</script> </script>

31
src/views/monitor/videos/index.vue

@ -26,15 +26,15 @@
<div class="mores" > <div class="mores" >
<div class="more"> <div class="more">
<p class="bluezi">正常</p> <p class="bluezi">正常</p>
<span class="myiconfont iconbox bluezibg">&#xe608;</span> <span class="myiconfont iconbox bluezibg">&#xe608;</span><span class="numzi bluezi">2344</span>
</div> </div>
<div class="more"> <div class="more">
<p class="huizi">离线</p> <p class="huizi">离线</p>
<span class="myiconfont iconbox huizibg">&#xe608;</span> <span class="myiconfont iconbox huizibg">&#xe608;</span><span class="numzi huizi">2344</span>
</div> </div>
<div class="more" v-show="showRuqinbaojing||showMenjinguanli||showDianziweilan == true"> <div class="more" v-show="showRuqinbaojing||showMenjinguanli||showDianziweilan == true">
<p class="redzi">报警</p> <p class="redzi">报警</p>
<span class="myiconfont iconbox redzibg">&#xe608;</span> <span class="myiconfont iconbox redzibg">&#xe608;</span><span class="numzi redzi">2344</span>
</div> </div>
</div> </div>
<!-- <div class="mores" v-show="showShipinjiankong == true"> <!-- <div class="mores" v-show="showShipinjiankong == true">
@ -158,12 +158,15 @@
</div> </div>
<!-- 查看视频 --> <!-- 查看视频 -->
<el-dialog title="查看视频" :visible.sync="dialogImage" width="800px"> <el-dialog title="查看视频" :visible.sync="dialogImage" width="800px" :before-close="handleClose">
<div class="shipin"> <div class="shipin">
<video :preload="preload" autoplay :height="height" :width="width" align="center" :controls="controls"> <video id="video" :preload="preload" :height="height" :width="width" align="center" :controls="controls">
<source :src="videoSrc" type="video/mp4"> <source :src="videoSrc" type="video/mp4">
</video> </video>
</div> </div>
<!-- <span slot="footer" class="dialog-footer">
<el-button @click="dialogImage = false"> </el-button>
</span> -->
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
@ -281,7 +284,7 @@ export default {
playStatus: '', playStatus: '',
muteStatus: '', muteStatus: '',
isMute: true, isMute: true,
isPlay: true, isPlay: false,
width: '100%', // width: '100%', //
height: '430', // height: '430', //
preload: 'auto', // <video> preload: 'auto', // <video>
@ -319,6 +322,16 @@ export default {
// this.init() // this.init()
}, },
methods: { methods: {
handleClose() {
this.dialogImage = false
//
const video = document.getElementById('video')
video.pause()
},
handleVideo() {
this.$refs.videoDiolag.dialogImage = true
},
openshipinRuqinbaojing() { openshipinRuqinbaojing() {
this.seenshipinRuqinbaojing = !this.seenshipinRuqinbaojing this.seenshipinRuqinbaojing = !this.seenshipinRuqinbaojing
}, },
@ -560,6 +573,7 @@ export default {
</script> </script>
<style scoped> <style scoped>
.main-content{position: relative;overflow: hidden;}
.seencons{background-color: #fff; .seencons{background-color: #fff;
box-shadow:0px 0px 10px #E9E9E9;border-radius: 5px; box-shadow:0px 0px 10px #E9E9E9;border-radius: 5px;
padding: 0 10px;} padding: 0 10px;}
@ -583,7 +597,7 @@ export default {
padding: 10px; padding: 10px;
} }
.tab-header{background-color: #fff;} .tab-header{background-color: #fff;}
.shipinscons {height: 95%;text-align: center; .shipinscons {height: 95%;text-align: center;overflow-y: auto;
margin: 20px auto 0; margin: 20px auto 0;
text-align: center;position: relative; text-align: center;position: relative;
padding: 20px 50px 20px 50px; padding: 20px 50px 20px 50px;
@ -687,6 +701,9 @@ export default {
.mores .more p {display: inline-block; .mores .more p {display: inline-block;
font-size: 14px; font-size: 14px;
} }
.mores .more .numzi {display: inline-block;
font-size: 18px;font-weight: bold;
}
.mores .more .iconbox {display: inline-block; .mores .more .iconbox {display: inline-block;
border-radius: 30px; border-radius: 30px;
line-height: 30px; line-height: 30px;

20
src/views/renlianshibie/renlianshibieList.vue

@ -108,13 +108,16 @@
</div> </div>
</div> </div>
</div> </div>
<!-- 查看视频 --> <!-- 查看视频 -->
<el-dialog v-el-drag-dialog title="查看视频" :visible.sync="dialogImage" width="800px"> <el-dialog title="查看视频" :visible.sync="dialogImage" width="800px" :before-close="handleClose">
<div class="shipin"> <div class="shipin">
<video :preload="preload" autoplay :height="height" :width="width" align="center" :controls="controls"> <video id="video" :preload="preload" :height="height" :width="width" align="center" :controls="controls">
<source :src="videoSrc" type="video/mp4"> <source :src="videoSrc" type="video/mp4">
</video> </video>
</div> </div>
<!-- <span slot="footer" class="dialog-footer">
<el-button @click="dialogImage = false"> </el-button>
</span> -->
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
@ -225,7 +228,7 @@ export default {
playStatus: '', playStatus: '',
muteStatus: '', muteStatus: '',
isMute: true, isMute: true,
isPlay: true, isPlay: false,
width: '100%', // width: '100%', //
height: '430', // height: '430', //
preload: 'auto', // <video> preload: 'auto', // <video>
@ -243,6 +246,15 @@ export default {
// this.init() // this.init()
}, },
methods: { methods: {
handleClose() {
this.dialogImage = false
//
const video = document.getElementById('video')
video.pause()
},
handleVideo() {
this.$refs.videoDiolag.dialogImage = true
},
resetState() { resetState() {
this.viewState = 1 this.viewState = 1
}, },

Loading…
Cancel
Save