Browse Source

添加echarts文件,首页页面编写,人脸识别页面编写,修改栏目菜单等

master
zyc@123456 2 years ago
parent
commit
eb7519bd15
  1. 15
      src/layout/components/Navbar.vue
  2. 150
      src/layout/components/Sidebar/index.vue
  3. 121
      src/main.js
  4. 20
      src/router/index.js
  5. 20
      src/styles/index.scss
  6. 135
      src/utils/index.js
  7. 203
      src/views/echarts/components/BarChart.vue
  8. 207
      src/views/echarts/components/BarChartchild.vue
  9. 254
      src/views/echarts/components/BarChartchildxunlian.vue
  10. 265
      src/views/echarts/components/BarChartmixed.vue
  11. 239
      src/views/echarts/components/BarCharts.vue
  12. 172
      src/views/echarts/components/BarChartsdapingduidie.vue
  13. 254
      src/views/echarts/components/BarChartsone.vue
  14. 239
      src/views/echarts/components/BarChartsrenyuan.vue
  15. 185
      src/views/echarts/components/LineChart.vue
  16. 133
      src/views/echarts/components/LineChartFuWuPaiDan.vue
  17. 232
      src/views/echarts/components/LineCharts.vue
  18. 133
      src/views/echarts/components/LineChartsHuJiao.vue
  19. 124
      src/views/echarts/components/LineChartsHuJiaoZhongXin.vue
  20. 198
      src/views/echarts/components/PieChart.vue
  21. 173
      src/views/echarts/components/PieChartchild.vue
  22. 170
      src/views/echarts/components/PieChartlitter.vue
  23. 202
      src/views/echarts/components/PieChartpies.vue
  24. 202
      src/views/echarts/components/PieChartrand.vue
  25. 201
      src/views/echarts/components/PieChartrenyuan.vue
  26. 114
      src/views/echarts/components/YibiaoChartJibu.vue
  27. 56
      src/views/echarts/components/mixins/resize.js
  28. 58
      src/views/echarts/index.vue
  29. 420
      src/views/index.vue
  30. 826
      src/views/monitor/videos/index.vue
  31. 606
      src/views/renlianshibie/renlianshibieList.vue

15
src/layout/components/Navbar.vue

@ -6,7 +6,9 @@
<div class="right-menu">
<!-- <p>{{Orgname}} {{departmentName}} 欢迎, {{name}}</p>-->
<p>欢迎您{{name}}</p>
<img src="@/assets/images/info.png">
<el-badge :value="6" class="item">
<img src="@/assets/images/info.png">
</el-badge>
<!-- <img src="@/assets/images/dy.png" @click="logout"> -->
<span class="backToHome" @click="logout"><i class="el-icon-back"></i>返回首页</span>
</div>
@ -166,4 +168,15 @@
font-size: 14px;
color: #666;
}
::v-deep .el-badge__content{position: relative;
height: 20px;
line-height: 20px;
padding: 0 6px;
}
::v-deep .el-badge__content.is-fixed {
position: absolute;
top: 17px;
right: 14px;
}
</style>

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

@ -34,6 +34,26 @@
return {
YongHuid: [],
routes: [
{
alwaysShow: true,
component: "index",
meta: {
icon: "el-icon-menu",
title: "首页",
},
name: "",
path: "/index",
// children: [{
// alwaysShow: true,
// component: "index",
// meta: {
// icon: "el-icon-help",
// title: "",
// },
// name: "/index",
// path: "/index",
// }]
},
{
alwaysShow: true,
component: "monitor",
@ -42,17 +62,17 @@
title: "视频中心",
},
name: "",
path: "/monitor",
children: [{
alwaysShow: true,
component: "index",
meta: {
icon: "el-icon-help",
title: "视频中心",
},
name: "/monitor/videos",
path: "/monitor/videos",
}]
path: "/monitor/videos",
// children: [{
// alwaysShow: true,
// component: "index",
// meta: {
// icon: "el-icon-help",
// title: "",
// },
// name: "/monitor/videos",
// path: "/monitor/videos",
// }]
},
// {
// alwaysShow: true,
@ -74,6 +94,26 @@
// path: "/gongyingshang/gongyingshanggaunli",
// }]
// },
{
alwaysShow: true,
component: "renlianshibie",
meta: {
icon: "el-icon-menu",
title: "人脸识别",
},
name: "",
path: "/renlianshibie/renlianshibieList",
// children: [{
// alwaysShow: true,
// component: "index",
// meta: {
// icon: "el-icon-help",
// title: "",
// },
// name: "/renlianshibie/renlianshibieList",
// path: "/renlianshibie/renlianshibieList",
// }]
},
{
alwaysShow: true,
component: "shebeitaizhang",
@ -82,17 +122,17 @@
title: "设备台账",
},
name: "",
path: "/shebeitaizhang",
children: [{
alwaysShow: true,
component: "index",
meta: {
icon: "el-icon-help",
title: "设备台账",
},
name: "/shebeitaizhang/shebeitaizhangList",
path: "/shebeitaizhang/shebeitaizhangList",
}]
path: "/shebeitaizhang/shebeitaizhangList",
// children: [{
// alwaysShow: true,
// component: "index",
// meta: {
// icon: "el-icon-help",
// title: "",
// },
// name: "/shebeitaizhang/shebeitaizhangList",
// path: "/shebeitaizhang/shebeitaizhangList",
// }]
},
{
alwaysShow: true,
@ -102,17 +142,17 @@
title: "报警查询",
},
name: "",
path: "/baojingchaxun",
children: [{
alwaysShow: true,
component: "index",
meta: {
icon: "el-icon-help",
title: "报警查询",
},
name: "/baojingchaxun/baojingchaxunList",
path: "/baojingchaxun/baojingchaxunList",
}]
path: "/baojingchaxun/baojingchaxunList",
// children: [{
// alwaysShow: true,
// component: "index",
// meta: {
// icon: "el-icon-help",
// title: "",
// },
// name: "/baojingchaxun/baojingchaxunList",
// path: "/baojingchaxun/baojingchaxunList",
// }]
} ,
{
alwaysShow: true,
@ -122,17 +162,17 @@
title: "设备状态",
},
name: "",
path: "/shebeizhuangtai",
children: [{
alwaysShow: true,
component: "index",
meta: {
icon: "el-icon-help",
title: "设备状态",
},
name: "/shebeizhuangtai/shebeizhuangtaiList",
path: "/shebeizhuangtai/shebeizhuangtaiList",
}]
path: "/shebeizhuangtai/shebeizhuangtaiList",
// children: [{
// alwaysShow: true,
// component: "index",
// meta: {
// icon: "el-icon-help",
// title: "",
// },
// name: "/shebeizhuangtai/shebeizhuangtaiList",
// path: "/shebeizhuangtai/shebeizhuangtaiList",
// }]
},
{
alwaysShow: true,
@ -142,17 +182,17 @@
title: "设备日志",
},
name: "",
path: "/shebeirizhi",
children: [{
alwaysShow: true,
component: "index",
meta: {
icon: "el-icon-help",
title: "设备日志",
},
name: "/shebeirizhi/shebeirizhiList",
path: "/shebeirizhi/shebeirizhiList",
}]
path: "/shebeirizhi/shebeirizhiList",
// children: [{
// alwaysShow: true,
// component: "index",
// meta: {
// icon: "el-icon-help",
// title: "",
// },
// name: "/shebeirizhi/shebeirizhiList",
// path: "/shebeirizhi/shebeirizhiList",
// }]
}
],
params: {

121
src/main.js

@ -1,50 +1,63 @@
import 'babel-polyfill'
import Vue from 'vue'
import 'normalize.css/normalize.css' // A modern alternative to CSS resets
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import '@/styles/index.scss' // global css
import './fontb/iconfont.css'
import App from './App'
import store from './store'
import router from './router'
import "babel-polyfill";
import Vue from "vue";
import "normalize.css/normalize.css"; // A modern alternative to CSS resets
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
import "@/styles/index.scss"; // global css
import "./fontb/iconfont.css";
import App from "./App";
import store from "./store";
import router from "./router";
// import echarts from "echarts";
import '@/icons' // 引入icon文件夹下所有的svg
import "@/icons"; // 引入icon文件夹下所有的svg
// 全局自定义组件
import Pagination from '@/components/pagination/index.vue'
import tabsearch from '@/components/tab-search/index.vue'
import eimage from '@/components/E-image/index.vue'
import moment from 'moment'
import Print from '@/utils/print' // 引入附件的js文件
import request from '@/utils/request'
import { setDefaultOrgPath, setDefaultOrgPathName, setStorage } from './utils/auth.js'
import VueAMap from 'vue-amap'
import Pagination from "@/components/pagination/index.vue";
import tabsearch from "@/components/tab-search/index.vue";
import eimage from "@/components/E-image/index.vue";
import moment from "moment";
import Print from "@/utils/print"; // 引入附件的js文件
import request from "@/utils/request";
import {
setDefaultOrgPath,
setDefaultOrgPathName,
setStorage,
} from "./utils/auth.js";
import VueAMap from "vue-amap";
Vue.use(ElementUI)
import hkVideo from '@/api/hikvision/hkVideo'
Vue.use(ElementUI);
// Vue.prototype.$echarts = echarts;
import hkVideo from "@/api/hikvision/hkVideo";
// import '@/permission' //权限控制
Vue.prototype.$userInfo = null // 用户信息
Vue.component('Pagination', Pagination)
Vue.component('tab-search', tabsearch)
Vue.component('eimage', eimage)
Vue.prototype.moment = moment
Vue.filter('dateFormat', function(dateStr, pattern = 'YYYY-MM-DD') {
return moment(dateStr).format(pattern)
})
Vue.use(Print) // 注册
Vue.prototype.$userInfo = null; // 用户信息
Vue.component("Pagination", Pagination);
Vue.component("tab-search", tabsearch);
Vue.component("eimage", eimage);
Vue.prototype.moment = moment;
Vue.filter("dateFormat", function (dateStr, pattern = "YYYY-MM-DD") {
return moment(dateStr).format(pattern);
});
Vue.use(Print); // 注册
Vue.use(VueAMap)
Vue.use(VueAMap);
VueAMap.initAMapApiLoader({
key: 'ccda12d8bffc72e9f1a32c599323a876', // 此处的key,在高德开放平台申请
plugin: ['AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PlaceSearch', 'AMap.Geolocation', 'AMap.Geocoder'], // 此处的插件按需添加
v: '1.4.4',
uiVersion: '1.0'
})
key: "ccda12d8bffc72e9f1a32c599323a876", // 此处的key,在高德开放平台申请
plugin: [
"AMap.Scale",
"AMap.OverView",
"AMap.ToolBar",
"AMap.MapType",
"AMap.PlaceSearch",
"AMap.Geolocation",
"AMap.Geocoder",
], // 此处的插件按需添加
v: "1.4.4",
uiVersion: "1.0",
});
Vue.config.productionTip = false
Vue.config.productionTip = false;
// let token = null
// token = GetQueryString('token')
@ -55,14 +68,14 @@ Vue.config.productionTip = false
// // window.location.href = href.slice(0, href.length - 1)
// }
var one = window.location.href.indexOf('&organizationData') + 18
var one = window.location.href.indexOf("&organizationData") + 18;
if (parseInt(one) > 18) {
const data = window.location.href.substr(one) // url解码unescape()已从web中移除,尽量不使用
var data1 = decodeURIComponent(data)
const data = window.location.href.substr(one); // url解码unescape()已从web中移除,尽量不使用
var data1 = decodeURIComponent(data);
if (data1 !== undefined) {
const obj = JSON.parse(data1)
setDefaultOrgPath(obj.defaultOrgPath)
setDefaultOrgPathName(obj.defaultOrgPathName)
const obj = JSON.parse(data1);
setDefaultOrgPath(obj.defaultOrgPath);
setDefaultOrgPathName(obj.defaultOrgPathName);
}
}
@ -104,16 +117,16 @@ function getUserInfo() {
// window.sessionStorage.setItem('departmentSid', user.departmentSid)
// window.sessionStorage.setItem('orgNamePath', user.orgNamePath)
// window.sessionStorage.setItem('orgSidPath', user.orgSidPath)
new Vue({
el: '#app',
router,
store,
render: h => h(App)
})
new Vue({
el: "#app",
router,
store,
render: (h) => h(App),
});
// })
}
getUserInfo()
getUserInfo();
// function GetQueryString(name) {
// var one = window.location.href.indexOf('?token=') + 7
// if (one < 7) { return null }
@ -127,7 +140,7 @@ getUserInfo()
// return data
// }
// return null
// var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)')
// var r = window.location.search.substr(1).match(reg)
// if (r != null) return unescape(r[2]); return null
// var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)')
// var r = window.location.search.substr(1).match(reg)
// if (r != null) return unescape(r[2]); return null
// }

20
src/router/index.js

@ -90,6 +90,26 @@ export const constantRoutes = [
// },
// ],
// },
////人脸识别
{
path: "/renlianshibieList",
component: Layout,
redirect: "/renlianshibie/renlianshibieList",
meta: {
title: "人脸识别",
},
children: [
{
path: "/renlianshibie/renlianshibieList",
component: () => import("@/views/renlianshibie/renlianshibieList.vue"),
name: "renlianshibieList",
meta: {
title: "人脸识别",
noCache: true,
},
},
],
},
//设备台账
{
path: "/shebeitaizhangList",

20
src/styles/index.scss

@ -433,3 +433,23 @@ div:focus {
.bordertopline{ border-top: 1px solid $table-border-color;}
.lookimg img{width: 250px;margin: 10px;}
.listimg{width: 80px;}
.huiziqian {
color: #d1d4d5;
}
.hredziqian2 {
color: #fc3804;
}
.blueziqian {
color: #1a9cfe;
}
.yellowzi1{color: #feae03;}
.yellowzi{color: #fed60f;}
.orangezi{color: #f98131;}
.huizi{color: #a7a7a7;}
.huiziqian2{color: #F1F2F3;}
.redzi{color: #ff0000;}
.bluezi{color: #5f81fc;}
.bluezishen{color: #3b71be;}
.greenzi{color: #05cf52 !important;}
.whitezi{color: #fff;}

135
src/utils/index.js

@ -2,6 +2,47 @@
* Created by PanJiaChen on 16/11/18.
*/
/**
* @param {Function} func
* @param {number} wait
* @param {boolean} immediate
* @return {*}
*/
export function debounce(func, wait, immediate) {
let timeout, args, context, timestamp, result;
const later = function () {
// 据上一次触发时间间隔
const last = +new Date() - timestamp;
// 上次被包装函数被调用时间间隔 last 小于设定时间间隔 wait
if (last < wait && last > 0) {
timeout = setTimeout(later, wait - last);
} else {
timeout = null;
// 如果设定为immediate===true,因为开始边界已经调用过了此处无需调用
if (!immediate) {
result = func.apply(context, args);
if (!timeout) context = args = null;
}
}
};
return function (...args) {
context = this;
timestamp = +new Date();
const callNow = immediate && !timeout;
// 如果延时不存在,重新设定延时
if (!timeout) timeout = setTimeout(later, wait);
if (callNow) {
result = func.apply(context, args);
context = args = null;
}
return result;
};
}
/**
* Parse the time to string
* @param {(Object|string|number)} time
@ -10,28 +51,28 @@
*/
export function parseTime(time, cFormat) {
if (arguments.length === 0 || !time) {
return null
return null;
}
const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}'
let date
if (typeof time === 'object') {
date = time
const format = cFormat || "{y}-{m}-{d} {h}:{i}:{s}";
let date;
if (typeof time === "object") {
date = time;
} else {
if ((typeof time === 'string')) {
if ((/^[0-9]+$/.test(time))) {
if (typeof time === "string") {
if (/^[0-9]+$/.test(time)) {
// support "1548221490638"
time = parseInt(time)
time = parseInt(time);
} else {
// support safari
// https://stackoverflow.com/questions/4310953/invalid-date-in-safari
time = time.replace(new RegExp(/-/gm), '/')
time = time.replace(new RegExp(/-/gm), "/");
}
}
if ((typeof time === 'number') && (time.toString().length === 10)) {
time = time * 1000
if (typeof time === "number" && time.toString().length === 10) {
time = time * 1000;
}
date = new Date(time)
date = new Date(time);
}
const formatObj = {
y: date.getFullYear(),
@ -40,15 +81,17 @@ export function parseTime(time, cFormat) {
h: date.getHours(),
i: date.getMinutes(),
s: date.getSeconds(),
a: date.getDay()
}
a: date.getDay(),
};
const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => {
const value = formatObj[key]
const value = formatObj[key];
// Note: getDay() returns 0 on Sunday
if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value ] }
return value.toString().padStart(2, '0')
})
return time_str
if (key === "a") {
return ["日", "一", "二", "三", "四", "五", "六"][value];
}
return value.toString().padStart(2, "0");
});
return time_str;
}
/**
@ -57,40 +100,40 @@ export function parseTime(time, cFormat) {
* @returns {string}
*/
export function formatTime(time, option) {
if (('' + time).length === 10) {
time = parseInt(time) * 1000
if (("" + time).length === 10) {
time = parseInt(time) * 1000;
} else {
time = +time
time = +time;
}
const d = new Date(time)
const now = Date.now()
const d = new Date(time);
const now = Date.now();
const diff = (now - d) / 1000
const diff = (now - d) / 1000;
if (diff < 30) {
return '刚刚'
return "刚刚";
} else if (diff < 3600) {
// less 1 hour
return Math.ceil(diff / 60) + '分钟前'
return Math.ceil(diff / 60) + "分钟前";
} else if (diff < 3600 * 24) {
return Math.ceil(diff / 3600) + '小时前'
return Math.ceil(diff / 3600) + "小时前";
} else if (diff < 3600 * 24 * 2) {
return '1天前'
return "1天前";
}
if (option) {
return parseTime(time, option)
return parseTime(time, option);
} else {
return (
d.getMonth() +
1 +
'月' +
"月" +
d.getDate() +
'日' +
"日" +
d.getHours() +
'时' +
"时" +
d.getMinutes() +
'分'
)
"分"
);
}
}
@ -99,19 +142,19 @@ export function formatTime(time, option) {
* @returns {Object}
*/
export function param2Obj(url) {
const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ')
const search = decodeURIComponent(url.split("?")[1]).replace(/\+/g, " ");
if (!search) {
return {}
return {};
}
const obj = {}
const searchArr = search.split('&')
searchArr.forEach(v => {
const index = v.indexOf('=')
const obj = {};
const searchArr = search.split("&");
searchArr.forEach((v) => {
const index = v.indexOf("=");
if (index !== -1) {
const name = v.substring(0, index)
const val = v.substring(index + 1, v.length)
obj[name] = val
const name = v.substring(0, index);
const val = v.substring(index + 1, v.length);
obj[name] = val;
}
})
return obj
});
return obj;
}

203
src/views/echarts/components/BarChart.vue

@ -0,0 +1,203 @@
<template>
<div :class="className" :style="{height:height,width:width}" />
</template>
<script>
import echarts from 'echarts'
require('echarts/theme/macarons') // echarts theme
import resize from './mixins/resize'
import router from '../../../router'
const animationDuration = 6000
const colorList = [
'#B5C334',
'#FCCE10',
'#E87C25',
'#C1232B',
'#27727B',
'#FE8463',
'#9BCA63',
'#FAD860',
'#F3A43B',
'#60C0DD',
'#D7504B',
'#C6E579',
'#F4E001',
'#F0805A',
'#26C0C0'
]
export default {
mixins: [resize],
props: {
className: {
type: String,
default: 'chart'
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
default: '350px'
},
chartData: {
type: Object,
required: true
},
select: () => {
o =>
function() {
// console.log('')
}
}
},
data() {
return {
chart: null,
title: ''
}
},
watch: {
chartData: {
deep: true,
handler(val) {
this.setOptions(val)
}
}
},
mounted() {
this.$nextTick(() => {
this.initChart()
})
},
beforeDestroy() {
if (!this.chart) {
return
}
this.chart.dispose()
this.chart = null
},
methods: {
initChart() {
this.chart = echarts.init(this.$el, 'macarons')
this.setOptions(this.chartData)
},
setOptions({ legend, xAxis, Data, nextUrl, rotate, unit, params } = {}) {
this.chart.setOption({
title: {
text: legend[0],
x: 'left',
// bottom: 5,
top: 10,
left: 30,
textStyle: {
fontSize: 14,
color: '#fff',
fontWeight: 'bolder' //
}
},
tooltip: {
trigger: 'axis',
axisPointer: {
//
type: 'shadow' // 线'line' | 'shadow'
},
formatter: '{b} : {c} ' + unit
},
grid: {
top: 60,
left: '20',
right: '20',
bottom: 30,
containLabel: true
},
xAxis: [
{
type: 'category',
data: xAxis, // ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
axisTick: {
alignWithLabel: true
},
axisLine: {
lineStyle: {
type: 'solid',
color: '#fff', // 线
width: '1' // 线
}
},
axisLabel: {
color: '#ffffff',
interval: 0,
rotate: rotate
}
}
],
yAxis: [
{
type: 'value',
axisTick: {
show: false
},
axisLine: {
lineStyle: {
type: 'solid',
color: '#fff', // 线
width: '1' // 线
}
},
axisLabel: {
color: '#ffffff',
show: true,
formatter: '{value}' + unit
},
//
splitLine: {
show: false,
lineStyle: {
color: '#e6fdef',
width: 1,
type: 'solid'
}
}
}
],
// legend: {
// data: legend // ['pageA', 'pageB', 'pageC']
// },
series: [
{
name: legend[0],
type: 'bar',
// stack: 'vistors',
barWidth: '30',
itemStyle: {
normal: {
color: function(params) {
return colorList[params.dataIndex]
},
label: {
show: true,
position: 'top',
textStyle: {
color: '#ffffff'
}
}
}
},
data: Data.seriesData
}
]
})
var _this = this
this.chart.on('click', function(param) {
_this.callParents(param.name)
})
},
//
callParents(name) {
this.$emit('parentFunction', name)
}
}
}
</script>

207
src/views/echarts/components/BarChartchild.vue

@ -0,0 +1,207 @@
<template>
<div :class="className" :style="{height:height,width:width}" />
</template>
<script>
import echarts from 'echarts'
import resize from './mixins/resize'
const colorList = [
'#B5C334',
'#FCCE10',
'#E87C25',
'#C1232B',
'#27727B',
'#FE8463',
'#9BCA63',
'#FAD860',
'#F3A43B',
'#60C0DD',
'#D7504B',
'#C6E579',
'#F4E001',
'#F0805A',
'#26C0C0'
]
export default {
mixins: [resize],
props: {
className: {
type: String,
default: 'chart'
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
default: '350px'
},
chartData: {
type: Object,
required: true
}
},
data () {
return {
chart: null,
title: ''
}
},
watch: {
chartData: {
deep: true,
handler (val) {
this.setOptions(val)
}
}
},
mounted () {
this.$nextTick(() => {
this.initChart()
})
},
beforeDestroy () {
if (!this.chart) {
return
}
this.chart.dispose()
this.chart = null
},
methods: {
initChart () {
this.chart = echarts.init(this.$el, 'macarons')
this.setOptions(this.chartData)
},
setOptions ({
title,
legend,
xAxis,
Data,
nextUrl,
rotate,
unit,
params,
grid,
barWidth
} = {}) {
this.chart.setOption({
title: title,
// {
// text: legend[0],
// x: "left",
// // bottom: 5,
// top: 0,
// left: 30,
// textStyle: {
// fontSize: 16,
// color: "#000",
// fontWeight: "bolder" //
// }
// },
tooltip: {
trigger: 'axis',
axisPointer: {
//
type: 'shadow' // 线'line' | 'shadow'
},
formatter: '{b} : {c} ' + unit
},
grid: grid,
// {
// top: 15,
// left: "20",
// right: "20",
// bottom: 30,
// containLabel: true
// },
xAxis: [
{
type: 'category',
data: xAxis, // ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
axisTick: {
alignWithLabel: true
},
axisLine: {
lineStyle: {
type: 'solid',
color: '#000', // 线
width: '1' // 线
}
},
axisLabel: {
color: '#000',
interval: 0,
rotate: rotate
}
}
],
yAxis: [
{
type: 'value',
axisTick: {
show: false
},
axisLine: {
lineStyle: {
type: 'solid',
color: '#000', // 线
width: '1' // 线
}
},
axisLabel: {
color: '#000',
show: true,
formatter: '{value}' + unit
},
//
splitLine: {
show: false,
lineStyle: {
color: '#e6fdef',
width: 1,
type: 'solid'
}
}
}
],
// legend: {
// data: legend // ['pageA', 'pageB', 'pageC']
// },
series: [
{
name: legend[0],
type: 'bar',
// stack: 'vistors',
barWidth: barWidth == null ? '30' : barWidth,
itemStyle: {
normal: {
color: function (params) {
return colorList[params.dataIndex]
},
label: {
show: true,
position: 'top',
textStyle: {
color: '#000'
}
}
}
},
data: Data.seriesData
}
]
})
var _this = this
this.chart.on('click', function (param) {
// console.log('' + JSON.stringify(param))
_this.callParents(param.name)
})
},
//
callParents (name) {
this.$emit('parentFunction', name)
}
}
}
</script>

254
src/views/echarts/components/BarChartchildxunlian.vue

@ -0,0 +1,254 @@
<template>
<div :class="className" :style="{height:height,width:width}" />
</template>
<script>
import echarts from 'echarts'
import resize from './mixins/resize'
// import router from '../../../router'
const colorList = [
'#B5C334',
'#FCCE10',
'#E87C25',
'#C1232B',
'#27727B',
'#FE8463',
'#9BCA63',
'#FAD860',
'#F3A43B',
'#60C0DD',
'#D7504B',
'#C6E579',
'#F4E001',
'#F0805A',
'#26C0C0',
'#87cefa',
'#ffd700',
'#6b8e23',
'#ff7f50',
'#da70d6',
'#32cd32',
'#cd5c5c',
'#00fa9a',
'#1e90ff',
'#ba55d3',
'#ff00ff',
'#7b68ee',
'#6495ed',
'#3cb371',
'#b8860b',
'#ff69b4',
'#ff6347',
'#ffa500',
'#40e0d0',
'#30e0e0',
'#C1232B',
'#B5C334',
'#FCCE10',
'#E87C25',
'#27727B',
'#FE8463',
'#9BCA63',
'#FAD860',
'#F3A43B',
'#60C0DD',
'#D7504B',
'#C6E579',
'#F4E001',
'#F0805A',
'#26C0C0',
'#2F9323',
'#D9B63A',
'#2E2AA4',
'#9F2E61',
'#4D670C',
'#BF675F',
'#1F814A',
'#357F88',
'#673509',
'#310937',
'#1B9637',
'#F7393C'
]
export default {
mixins: [resize],
props: {
className: {
type: String,
default: 'chart'
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
default: '350px'
},
chartData: {
type: Object,
required: true
}
},
data() {
return {
chart: null,
title: ''
}
},
watch: {
chartData: {
deep: true,
handler(val) {
this.setOptions(val)
}
}
},
mounted() {
this.$nextTick(() => {
this.initChart()
})
},
beforeDestroy() {
if (!this.chart) {
return
}
this.chart.dispose()
this.chart = null
},
methods: {
initChart() {
this.chart = echarts.init(this.$el, 'macarons')
this.setOptions(this.chartData)
},
setOptions({
title,
legend,
xAxis,
Data,
nextUrl,
rotate,
unit,
params,
grid
} = {}) {
this.chart.setOption({
title: title,
// {
// text: legend[0],
// x: "left",
// // bottom: 5,
// top: 0,
// left: 30,
// textStyle: {
// fontSize: 16,
// color: "#000",
// fontWeight: "bolder" //
// }
// },
tooltip: {
trigger: 'axis',
axisPointer: {
//
type: 'shadow' // 线'line' | 'shadow'
},
formatter: '{b} : {c} ' + unit
},
grid: grid,
// {
// top: 15,
// left: "20",
// right: "20",
// bottom: 30,
// containLabel: true
// },
xAxis: [
{
type: 'category',
data: xAxis, // ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
axisTick: {
alignWithLabel: true
},
axisLine: {
lineStyle: {
type: 'solid',
color: '#000', // 线
width: '1' // 线
}
},
axisLabel: {
color: '#000',
interval: 0,
rotate: rotate
}
}
],
yAxis: [
{
type: 'value',
axisTick: {
show: false
},
axisLine: {
lineStyle: {
type: 'solid',
color: '#000', // 线
width: '1' // 线
}
},
axisLabel: {
color: '#000',
show: true,
formatter: '{value}' + unit
},
//
splitLine: {
show: false,
lineStyle: {
color: '#e6fdef',
width: 1,
type: 'solid'
}
}
}
],
// legend: {
// data: legend // ['pageA', 'pageB', 'pageC']
// },
series: [
{
name: legend[0],
type: 'bar',
// stack: 'vistors',
// barWidth: barWidth == null ? "30" : barWidth,
itemStyle: {
normal: {
color: function(params) {
return colorList[params.dataIndex]
},
label: {
show: true,
position: 'top',
textStyle: {
color: '#000'
}
}
}
},
data: Data.seriesData
}
]
})
var _this = this
this.chart.on('click', function(param) {
_this.callParents(param.name)
})
},
//
callParents(name) {
this.$emit('parentFunction', name)
}
}
}
</script>

265
src/views/echarts/components/BarChartmixed.vue

@ -0,0 +1,265 @@
<template>
<div :class="className" :style="{height:height,width:width}" />
</template>
<script>
import echarts from 'echarts'
// require('echarts/theme/macarons') // echarts theme
import resize from './mixins/resize'
// import router from '../../../router'
// const animationDuration = 6000
// const colorList = [
// '#C1232B',
// '#B5C334',
// '#FCCE10',
// '#E87C25',
// '#27727B',
// '#FE8463',
// '#9BCA63',
// '#FAD860',
// '#F3A43B',
// '#60C0DD',
// '#D7504B',
// '#C6E579',
// '#F4E001',
// '#F0805A',
// '#26C0C0'
// ]
export default {
mixins: [resize],
props: {
className: {
type: String,
default: 'chart'
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
default: '350px'
},
chartData: {
type: Object,
required: true
}
},
data () {
return {
chart: null
}
},
watch: {
chartData: {
deep: true,
handler (val) {
this.setOptions(val)
}
}
},
mounted () {
this.$nextTick(() => {
this.initChart()
})
},
beforeDestroy () {
if (!this.chart) {
return
}
this.chart.dispose()
this.chart = null
},
methods: {
initChart () {
this.chart = echarts.init(this.$el, 'macarons')
this.setOptions(this.chartData)
},
setOptions ({
seriesName,
legend,
xAxis,
Data,
nextUrl,
rotate,
unit,
params,
max
} = {}) {
var option = {
title: {
text: seriesName,
// x: "left",
// bottom: 5,
top: 5,
left: 30,
textStyle: {
fontSize: 14,
color: '#fff',
fontWeight: 'bolder' //
}
},
grid: {
top: 80,
left: '20',
right: '20',
bottom: 35,
containLabel: true
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'line',
crossStyle: {
// color: "#999"
}
}
},
// toolbox: {
// feature: {
// dataView: { show: true, readOnly: false },
// magicType: { show: true, type: ["line", "bar"] },
// restore: { show: true },
// saveAsImage: { show: true }
// }
// },
legend: {
data: legend,
bottom: 20,
textStyle: {
fontSize: 14,
color: '#fff'
// fontWeight: 'bolder' //
}
},
xAxis: [
{
type: 'category',
data: xAxis,
axisPointer: {
type: 'shadow'
},
axisLine: {
lineStyle: {
type: 'solid',
color: '#fff', // 线
width: '1' // 线
}
},
axisLabel: {
color: '#fff',
interval: 0,
rotate: rotate
}
}
],
yAxis: [
{
type: 'value',
name: '营房数量',
top: 10,
min: 0,
max: max,
interval: 10,
axisLabel: {
formatter: '{value} 栋'
}, //
axisLine: {
lineStyle: {
type: 'solid',
color: '#fff', // 线
width: '1' // 线
}
},
splitLine: {
show: false,
lineStyle: {
color: '#e6fdef',
width: 1,
type: 'solid'
}
}
},
{
type: 'value',
name: '电气火灾报警次数',
top: 10,
min: -1,
max: 5,
interval: 1,
axisLabel: {
formatter: '{value} 次'
}, //
axisLine: {
lineStyle: {
type: 'solid',
color: '#fff', // 线
width: '1' // 线
}
},
splitLine: {
show: false,
lineStyle: {
color: '#e6fdef',
width: 1,
type: 'solid'
}
}
}
],
series: [
{
name: Data[0].name,
type: 'bar',
barWidth: '30',
itemStyle: {
normal: {
// list
// color: function(params) {
// return colorList[params.dataIndex];
// }, //
label: {
show: true,
position: 'top',
formatter: '{c}',
// formatter: "{b}\n{c}"
textStyle: {
color: '#fff'
}
}
}
},
data: Data[0].data
},
{
name: Data[1].name,
type: 'line',
barWidth: '30',
yAxisIndex: 1,
itemStyle: {
normal: {
// list
color: '#fff'
}
},
data: Data[1].data
}
]
}
this.chart.setOption(option)
var _this = this
this.chart.on('click', function (param) {
_this.callParents(param.name)
})
},
//
callParents (name) {
this.$emit('mixedFunction', name)
}
}
}
</script>

239
src/views/echarts/components/BarCharts.vue

@ -0,0 +1,239 @@
<template>
<div :class="className" :style="{height:height,width:width}" />
</template>
<script>
import echarts from 'echarts'
// require('echarts/theme/macarons') // echarts theme
import resize from './mixins/resize'
// import router from '../../../router'
// const animationDuration = 6000
const colorList = [
'#87cefa',
'#ffd700',
'#6b8e23',
'#ff7f50',
'#da70d6',
'#32cd32',
'#cd5c5c',
'#00fa9a',
'#1e90ff',
'#ba55d3',
'#ff00ff',
'#7b68ee',
'#6495ed',
'#3cb371',
'#b8860b',
'#ff69b4',
'#ff6347',
'#ffa500',
'#40e0d0',
'#30e0e0'
]
export default {
mixins: [resize],
props: {
className: {
type: String,
default: 'chart'
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
default: '350px'
},
chartData: {
type: Object,
required: true
}
},
data () {
return {
chart: null
}
},
watch: {
chartData: {
deep: true,
handler (val) {
this.setOptions(val)
}
}
},
mounted () {
this.$nextTick(() => {
this.initChart()
})
},
beforeDestroy () {
if (!this.chart) {
return
}
this.chart.dispose()
this.chart = null
},
methods: {
initChart () {
this.chart = echarts.init(this.$el, 'macarons')
this.setOptions(this.chartData)
},
setOptions ({
barname,
legend,
xAxis,
Data,
nextUrl,
rotate,
unit,
params
} = {}) {
const list = []
for (var i = 0; i < legend.length; i++) {
const item = {
name: legend[i],
type: 'bar',
barGap: 0,
// stack: 'vistors',
// barWidth: '30',
itemStyle: {
normal: {
label: {
show: true,
position: 'top',
textStyle: {
color: colorList[i] // '#1e90ff'
}
}
}
},
data: Data.seriesData[i].value
// animationDuration
}
list.push(item)
}
this.chart.setOption({
// title: {
// text: barname,
// // subtext: '',
// x: "center",
// bottom: 10,
// // top: 0,
// textStyle: {
// fontSize: 16
// }
// },
title: {
text: barname,
x: 'center',
// bottom: 10,
top: 2,
textStyle: {
fontSize: 18,
color: '#2fd5ff',
fontWeight: 'bolder' //
}
},
// title: {
// text: barname,
// x: 'left',
// // bottom: 5,
// top: 10,
// left: 30,
// textStyle: {
// fontSize: 14,
// color: '#fff',
// fontWeight: 'bolder' //
// }
// },
tooltip: {
trigger: 'axis',
axisPointer: {
//
type: 'shadow' // 线'line' | 'shadow'
}
// formatter: '{b} : {c}'
},
grid: {
top: 80,
left: '2%',
right: '2%',
bottom: 5,
containLabel: true
},
legend: {
data: legend, // ['pageA', 'pageB', 'pageC']
left: 10,
top: 40,
textStyle: {
color: '#000'
}
},
xAxis: [
{
type: 'category',
data: xAxis, // ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
axisTick: {
alignWithLabel: true
},
axisLine: {
lineStyle: {
type: 'solid',
color: '#666', // 线
width: '1'// 线
}
},
axisLabel: {
interval: 0,
rotate: rotate
}
}
],
yAxis: [
{
type: 'value',
axisTick: {
show: false
},
axisLine: {
lineStyle: {
type: 'solid',
color: '#666', // 线
width: '1'// 线
}
},
axisLabel: {
show: true,
formatter: '{value}' + unit
},
//
splitLine: {
show: false,
lineStyle: {
color: '#e6fdef',
width: 1,
type: 'solid'
}
}
}
],
series: list
})
var _this = this
this.chart.on('click', function (param) {
_this.callParents(param.name)
})
},
//
callParents (name) {
this.$emit('charsFunction', name)
}
}
}
</script>

172
src/views/echarts/components/BarChartsdapingduidie.vue

@ -0,0 +1,172 @@
<template>
<div :class="className" :style="{height:height,width:width}" id="er"/>
</template>
<script>
import echarts from 'echarts'
// require('echarts/theme/macarons') // echarts theme
import resize from './mixins/resize'
export default {
mixins: [resize],
props: {
className: {
type: String,
default: 'chart'
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
// default: '290px'
default: '250px'
},
chartData: {
type: Object,
required: true
}
},
data() {
return {
chart: null
}
},
watch: {
chartData: {
deep: true,
handler(val) {
this.chart.resize()
this.setOptions(val)
}
},
height: {
deep: true,
handler(val) {
this.chart.resize()
this.setOptions(val)
}
}
},
mounted() {
this.$nextTick(() => {
this.initChart()
})
},
beforeDestroy() {
if (!this.chart) {
return
}
this.chart.dispose()
this.chart = null
},
methods: {
initChart() {
this.chart = echarts.init(this.$el, 'macarons')
this.chart.resize()
this.setOptions(this.chartData, true)
},
setOptions({
title,
legend,
yAxis,
series,
unit,
color
} = {}) {
this.chart.setOption({
title: {
text: title,
// subtext: '',
// x: 'left',
bottom: 10,
x: 'center',
// top: 0,
textStyle: {
fontSize: 18
}
},
color: color,
tooltip: {
trigger: 'axis',
axisPointer: { //
type: 'shadow' // 线'line' | 'shadow'
}
// formatter: '{b} : {c} ' + unit
},
legend: {
data: legend,
textStyle: {
color: '#fff',
fontSize: 16
}
},
// grid: {
// left: '3%',
// right: '4%',
// bottom: '3%',
// containLabel: true
// },
grid: {
left: 10,
right: 10,
bottom: 10,
top: 50,
containLabel: true
},
xAxis: {
type: 'value',
axisLine: {
lineStyle: {
type: 'solid',
color: '#fff', // 线
width: '1'// 线
},
textStyle: {
color: '#fff',
fontSize: 16
}
},
axisLabel: {
textStyle: {
color: '#fff',
fontSize: 16
}
}
},
yAxis: {
type: 'category',
data: yAxis,
triggerEvent: true,
axisLine: {
lineStyle: {
type: 'solid',
color: '#fff', // 线
width: '1'// 线
},
textStyle: {
color: '#fff'
}
},
axisLabel: {
textStyle: {
color: '#fff',
fontSize: 16
}
}
},
series: series
})
this.chart.on('click', (param) => {
this.$emit('child-event', param.value)
// this.callParents(param)
})
},
//
callParents(name) {
this.$emit('pieChartFunction', name)
}
}
}
</script>

254
src/views/echarts/components/BarChartsone.vue

@ -0,0 +1,254 @@
<template>
<div :class="className" :style="{height:height,width:width}" />
</template>
<script>
import echarts from 'echarts'
// require('echarts/theme/macarons') // echarts theme
import resize from './mixins/resize'
// import router from '../../../router'
// import { constants } from 'crypto'
// // const animationDuration = 6000
// const colorList = [
// '#87cefa',
// '#ffd700',
// '#6b8e23',
// '#ff7f50',
// '#da70d6',
// '#32cd32',
// '#cd5c5c',
// '#00fa9a',
// '#1e90ff',
// '#ba55d3',
// '#ff00ff',
// '#7b68ee',
// '#6495ed',
// '#3cb371',
// '#b8860b',
// '#ff69b4',
// '#ff6347',
// '#ffa500',
// '#40e0d0',
// '#30e0e0'
// ]
export default {
mixins: [resize],
props: {
className: {
type: String,
default: 'chart'
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
default: '350px'
},
chartData: {
type: Object,
required: true
}
},
data() {
return {
chart: null
}
},
watch: {
chartData: {
deep: true,
handler(val) {
this.setOptions(val)
}
}
},
mounted() {
this.$nextTick(() => {
this.initChart()
})
},
beforeDestroy() {
if (!this.chart) {
return
}
this.chart.dispose()
this.chart = null
},
methods: {
initChart() {
this.chart = echarts.init(this.$el, 'macarons')
this.setOptions(this.chartData)
},
setOptions({
barname,
legend,
xAxis,
Data,
nextUrl,
rotate,
unit,
params
} = {}) {
const list = []
var sum = []
for (var i = 0; i < legend.length; i++) {
const item = {
name: legend[i],
type: 'bar',
stack: 'one', //
barGap: 0,
itemStyle: {
// normal: {
// label: {
// show: true,
// position: "top",
// textStyle: {
// color: colorList[i] //'#1e90ff'
// }
// }
// }
},
data: Data.seriesData[i].value
// animationDuration
}
list.push(item)
// --item
var itemNumber = 0
for (var j = 0; j < Data.seriesData[i].value.length; j++) {
itemNumber += parseInt(Data.seriesData[i].value[j])
}
sum.push(itemNumber)
}
// var last = {
// name: "",
// type: "bar",
// stack: "one",
// label: {
// normal: {
// show: true,
// position: "top",
// textStyle: {
// color: "#000"
// },
// formatter: "{c}"
// }
// },
// data: [1, 0, 0, 0, 0, 0]
// };
// list.push(last);
var Option = {
title: {
text: barname,
// // subtext: '',
x: 'left',
// bottom: 10,
top: 10,
left: 30,
textStyle: {
// fontSize: 16
fontSize: 14,
color: '#fff',
fontWeight: 'bolder' //
}
},
tooltip: {
trigger: 'axis',
axisPointer: {
//
type: 'shadow' // 线'line' | 'shadow'
}
// formatter: '{b} : {c}'
},
// legend: {
// data: legend, // ['pageA', 'pageB', 'pageC']
// x: 'center',
// // left: 0,
// bottom: 10,
// textStyle: {
// color: '#fff'
// // fontSize: 16
// }
// },
grid: {
top: 60,
left: 20,
right: 20,
bottom: 20,
containLabel: true
},
xAxis: [
{
type: 'category',
data: xAxis, // ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
axisTick: {
alignWithLabel: true
},
axisLine: {
lineStyle: {
type: 'solid',
color: '#fff', // 线
width: '1' // 线
}
},
axisLabel: {
interval: 0,
rotate: rotate
}
}
],
yAxis: [
{
type: 'value',
axisTick: {
show: false
},
axisLine: {
lineStyle: {
type: 'solid',
color: '#fff', // 线
width: '1' // 线
}
},
axisLabel: {
show: true,
formatter: '{value}' + unit
},
//
splitLine: {
show: false,
lineStyle: {
color: '#e6fdef',
width: 1,
type: 'solid'
}
}
}
],
series: list
}
// //seriesformatter
// var series = Option["series"];
// //
// series[series.length - 1]["label"]["normal"]["formatter"] = "";
this.chart.setOption(Option)
var _this = this
this.chart.on('click', function(param) {
_this.callParents(param.name)
})
},
//
callParents(name) {
this.$emit('barCharsOneFunction', name)
}
}
}
</script>

239
src/views/echarts/components/BarChartsrenyuan.vue

@ -0,0 +1,239 @@
<template>
<div :class="className" :style="{height:height,width:width}" />
</template>
<script>
import echarts from 'echarts'
// require('echarts/theme/macarons') // echarts theme
import resize from './mixins/resize'
// import router from '../../../router'
// const animationDuration = 6000
const colorList = [
'#87cefa',
'#ffd700',
'#6b8e23',
'#ff7f50',
'#da70d6',
'#32cd32',
'#cd5c5c',
'#00fa9a',
'#1e90ff',
'#ba55d3',
'#ff00ff',
'#7b68ee',
'#6495ed',
'#3cb371',
'#b8860b',
'#ff69b4',
'#ff6347',
'#ffa500',
'#40e0d0',
'#30e0e0'
]
export default {
mixins: [resize],
props: {
className: {
type: String,
default: 'chart'
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
default: '350px'
},
chartData: {
type: Object,
required: true
}
},
data () {
return {
chart: null
}
},
watch: {
chartData: {
deep: true,
handler (val) {
this.setOptions(val)
}
}
},
mounted () {
this.$nextTick(() => {
this.initChart()
})
},
beforeDestroy () {
if (!this.chart) {
return
}
this.chart.dispose()
this.chart = null
},
methods: {
initChart () {
this.chart = echarts.init(this.$el, 'macarons')
this.setOptions(this.chartData)
},
setOptions ({
barname,
legend,
xAxis,
Data,
nextUrl,
rotate,
unit,
params
} = {}) {
const list = []
for (var i = 0; i < legend.length; i++) {
const item = {
name: legend[i],
type: 'bar',
barGap: 0,
// stack: 'vistors',
// barWidth: '30',
itemStyle: {
normal: {
label: {
show: true,
position: 'top',
textStyle: {
color: colorList[i] // '#1e90ff'
}
}
}
},
data: Data.seriesData[i].value
// animationDuration
}
list.push(item)
}
this.chart.setOption({
// title: {
// text: barname,
// // subtext: '',
// x: "center",
// bottom: 10,
// // top: 0,
// textStyle: {
// fontSize: 16
// }
// },
title: {
text: barname,
x: 'center',
// bottom: 10,
top: 2,
textStyle: {
fontSize: 18,
color: '#2fd5ff',
fontWeight: 'bolder' //
}
},
// title: {
// text: barname,
// x: 'left',
// // bottom: 5,
// top: 10,
// left: 30,
// textStyle: {
// fontSize: 14,
// color: '#fff',
// fontWeight: 'bolder' //
// }
// },
tooltip: {
trigger: 'axis',
axisPointer: {
//
type: 'shadow' // 线'line' | 'shadow'
}
// formatter: '{b} : {c}'
},
grid: {
top: 20,
left: '2%',
right: '2%',
bottom: 5,
containLabel: true
},
// legend: {
// data: legend, // ['pageA', 'pageB', 'pageC']
// left: 10,
// top: 20,
// textStyle: {
// color: '#000'
// }
// },
xAxis: [
{
type: 'category',
data: xAxis, // ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
axisTick: {
alignWithLabel: true
},
axisLine: {
lineStyle: {
type: 'solid',
color: '#666', // 线
width: '1'// 线
}
},
axisLabel: {
interval: 0,
rotate: rotate
}
}
],
yAxis: [
{
type: 'value',
axisTick: {
show: false
},
axisLine: {
lineStyle: {
type: 'solid',
color: '#666', // 线
width: '1'// 线
}
},
axisLabel: {
show: true,
formatter: '{value}' + unit
},
//
splitLine: {
show: false,
lineStyle: {
color: '#e6fdef',
width: 1,
type: 'solid'
}
}
}
],
series: list
})
var _this = this
this.chart.on('click', function (param) {
_this.callParents(param.name)
})
},
//
callParents (name) {
this.$emit('charsFunction', name)
}
}
}
</script>

185
src/views/echarts/components/LineChart.vue

@ -0,0 +1,185 @@
<template>
<div :class="className" :style="{height:height,width:width}" />
</template>
<script>
import echarts from 'echarts'
// require('echarts/theme/macarons') // echarts theme
import resize from './mixins/resize'
import router from '../../../router'
export default {
mixins: [resize],
props: {
className: {
type: String,
default: 'chart'
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
default: '350px'
},
autoResize: {
type: Boolean,
default: true
},
chartData: {
type: Object,
required: true
},
nextUrl: {
type: String,
default: ''
}
},
data() {
return {
chart: null
}
},
watch: {
chartData: {
deep: true,
handler(val) {
this.setOptions(val)
}
}
},
mounted() {
this.$nextTick(() => {
this.initChart()
})
},
beforeDestroy() {
if (!this.chart) {
return
}
this.chart.dispose()
this.chart = null
},
methods: {
initChart() {
this.chart = echarts.init(this.$el, 'macarons')
this.setOptions(this.chartData)
},
setOptions({ legend, xAxis, Data, nextUrl, params } = {}) {
this.chart.setOption({
title: {
text: legend[0],
// subtext: '',
x: 'center',
// bottom: 10
textStyle: {
fontSize: 16
},
bottom: 10
// top: 0
},
// backgroundColor: '#F7F7F7',
xAxis: {
data: xAxis, // ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
boundaryGap: false,
axisTick: {
show: false
}
},
grid: {
left: 10,
right: 10,
bottom: 40,
top: 10,
containLabel: true
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross'
},
padding: [5, 10]
},
yAxis: {
axisTick: {
show: false
}
},
// legend: {
// data: legend //["name1","name2"]
// },
series: [
{
name: legend[0], // "name1"
itemStyle: {
normal: {
color: '#FF005A',
lineStyle: {
color: '#FF005A',
width: 2
}
}
},
smooth: true,
type: 'line',
data: Data.seriesData,
animationDuration: 2800,
animationEasing: 'cubicInOut'
}
// ,{
// name: 'actual', // "name2"
// smooth: true,
// type: 'line',
// itemStyle: {
// normal: {
// color: '#3888fa',
// lineStyle: {
// color: '#3888fa',
// width: 2
// },
// areaStyle: {
// color: '#f3f8ff'
// }
// }
// },
// data: actualData,
// animationDuration: 2800,
// animationEasing: 'quadraticOut'
// }
]
})
this.chart.on('click', function(param) {
if (nextUrl.length > 0) {
// nexurl
var url = ''
for (var i = 0; i < nextUrl.length; i++) {
if (nextUrl[i].name === param.name) {
url = nextUrl[i].url
}
}
// --
router.push({
path: url,
query: {
id: param.name,
start: params.start,
end: params.end
}
})
// --
// let routeUrl = router.resolve({
// path: './situationMapZhiDui',
// query: { id: 96 }
// })
// window.open(routeUrl.href, '_blank')
// 1<router-link :to="{ name: 'details',params: { id: 123 }}"></router-link>
// 2this.$router.push({name:'details',params:{id:123}})
// 3: this.$router.push({name:'detail',params:{id:123,name:'lisi'}})
}
})
}
}
}
</script>

133
src/views/echarts/components/LineChartFuWuPaiDan.vue

@ -0,0 +1,133 @@
<template>
<div :class="className" :style="{height:height,width:width}" />
</template>
<script>
import echarts from 'echarts'
// require('echarts/theme/macarons') // echarts theme
import resize from './mixins/resize'
import router from '../../../router'
export default {
mixins: [resize],
props: {
className: {
type: String,
default: 'chart'
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
default: '350px'
},
autoResize: {
type: Boolean,
default: true
},
chartData: {
type: Object,
required: true
},
nextUrl: {
type: String,
default: ''
}
},
data() {
return {
chart: null
}
},
watch: {
chartData: {
deep: true,
handler(val) {
this.setOptions(val)
}
}
},
mounted() {
this.$nextTick(() => {
this.initChart()
})
},
beforeDestroy() {
if (!this.chart) {
return
}
this.chart.dispose()
this.chart = null
},
methods: {
initChart() {
this.chart = echarts.init(this.$el, 'macarons')
this.setOptions(this.chartData)
},
setOptions({ title, xAxis, series, nextUrl,url } = {}) {
this.chart.setOption({
title: {
text: title,
x: 'center',
// bottom: 10,
top: 10,
textStyle: {
fontSize: 20,
color: '#8657c8',
}
},
// grid: {
// left: 10,
// right: 10,
// bottom: 10,
// top: 10,
// containLabel: true
// },
xAxis: {
type: 'category',
boundaryGap: false,
data:xAxis
},
yAxis: {
type: 'value'
},
series: series
})
this.chart.on('click', function(param) {
if (nextUrl.length > 0) {
// nexurl
var url = ''
for (var i = 0; i < nextUrl.length; i++) {
if (nextUrl[i].name === param.name) {
url = nextUrl[i].url
}
}
// --
router.push({
path: url,
query: {
id: param.name,
start: params.start,
end: params.end
}
})
// --
// let routeUrl = router.resolve({
// path: './situationMapZhiDui',
// query: { id: 96 }
// })
// window.open(routeUrl.href, '_blank')
// 1<router-link :to="{ name: 'details',params: { id: 123 }}"></router-link>
// 2this.$router.push({name:'details',params:{id:123}})
// 3: this.$router.push({name:'detail',params:{id:123,name:'lisi'}})
}
})
}
}
}
</script>

232
src/views/echarts/components/LineCharts.vue

@ -0,0 +1,232 @@
<template>
<div :class="className" :style="{height:height,width:width}" />
</template>
<script>
import echarts from 'echarts'
// require('echarts/theme/macarons') // echarts theme
import resize from './mixins/resize'
import router from '../../../router'
const colorList = [
'#87cefa',
'#ffd700',
'#6b8e23',
'#ff7f50',
'#da70d6',
'#32cd32',
'#cd5c5c',
'#00fa9a',
'#1e90ff',
'#ba55d3',
'#ff00ff',
'#7b68ee',
'#6495ed',
'#3cb371',
'#b8860b',
'#ff69b4',
'#ff6347',
'#ffa500',
'#40e0d0',
'#30e0e0'
]
// const colorList1 = [
// '#C1232B',
// '#B5C334',
// '#FCCE10',
// '#E87C25',
// '#27727B',
// '#FE8463',
// '#9BCA63',
// '#FAD860',
// '#F3A43B',
// '#60C0DD',
// '#D7504B',
// '#C6E579',
// '#F4E001',
// '#F0805A',
// '#26C0C0'
// ]
// const colorList2 = [
// '#2F9323',
// '#D9B63A',
// '#2E2AA4',
// '#9F2E61',
// '#4D670C',
// '#BF675F',
// '#1F814A',
// '#357F88',
// '#673509',
// '#310937',
// '#1B9637',
// '#F7393C'
// ]
export default {
mixins: [resize],
props: {
className: {
type: String,
default: 'chart'
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
default: '385px'
},
autoResize: {
type: Boolean,
default: true
},
chartData: {
type: Object,
required: true
},
nextUrl: {
type: String,
default: ''
}
},
data() {
return {
chart: null
}
},
watch: {
chartData: {
deep: true,
handler(val) {
this.setOptions(val)
}
}
},
mounted() {
this.$nextTick(() => {
this.initChart()
})
},
beforeDestroy() {
if (!this.chart) {
return
}
this.chart.dispose()
this.chart = null
},
methods: {
initChart() {
this.chart = echarts.init(this.$el, 'macarons')
this.setOptions(this.chartData)
},
setOptions({ name, legend, xAxis, Data, nextUrl, unit, params } = {}) {
const list = []
for (var i = 0; i < legend.length; i++) {
const item = {
name: legend[i], // "name1"
itemStyle: {
normal: {
color: colorList[i],
lineStyle: {
color: colorList[i],
width: 2
}
}
},
// smooth: true,
type: 'line',
stack: '总量', //
areaStyle: {}, //
data: Data.seriesData[i].value,
animationDuration: 2800,
animationEasing: 'cubicInOut'
}
list.push(item)
}
this.chart.setOption({
title: {
text: name,
// subtext: '',
x: 'center',
bottom: 10,
// top: 5,
textStyle: {
fontSize: 16
}
},
// backgroundColor: '#F7F7F7',
xAxis: {
data: xAxis, // ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
boundaryGap: false,
axisTick: {
show: false
}
// axisLabel: {
// interval: 0,
// rotate: 40
// }
},
grid: {
left: 10,
right: 10,
bottom: 50,
top: 40,
containLabel: true
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross'
},
padding: [5, 10]
// formatter: '{a} {b} : {c} ' + unit
},
yAxis: {
axisTick: {
show: false
},
axisLabel: {
show: true,
formatter: '{value}' + unit
}
},
legend: {
data: legend // ["name1","name2"]
},
series: list
})
this.chart.on('click', function(param) {
if (nextUrl.length > 0) {
// nexurl
var url = ''
for (var i = 0; i < nextUrl.length; i++) {
if (nextUrl[i].name === param.seriesName) {
url = nextUrl[i].url
}
}
// --
router.push({
path: url,
query: {
id: param.seriesName,
start: params.start,
end: params.end
}
})
// --
// let routeUrl = router.resolve({
// path: './situationMapZhiDui',
// query: { id: 96 }
// })
// window.open(routeUrl.href, '_blank')
// 1<router-link :to="{ name: 'details',params: { id: 123 }}"></router-link>
// 2this.$router.push({name:'details',params:{id:123}})
// 3: this.$router.push({name:'detail',params:{id:123,name:'lisi'}})
}
})
}
}
}
</script>

133
src/views/echarts/components/LineChartsHuJiao.vue

@ -0,0 +1,133 @@
<template>
<div :class="className" :style="{height:height,width:width}" />
</template>
<script>
import echarts from 'echarts'
// require('echarts/theme/macarons') // echarts theme
import resize from './mixins/resize'
import router from '../../../router'
export default {
mixins: [resize],
props: {
className: {
type: String,
default: 'chart'
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
default: '350px'
},
autoResize: {
type: Boolean,
default: true
},
chartData: {
type: Object,
required: true
},
nextUrl: {
type: String,
default: ''
}
},
data() {
return {
chart: null
}
},
watch: {
chartData: {
deep: true,
handler(val) {
this.setOptions(val)
}
}
},
mounted() {
this.$nextTick(() => {
this.initChart()
})
},
beforeDestroy() {
if (!this.chart) {
return
}
this.chart.dispose()
this.chart = null
},
methods: {
initChart() {
this.chart = echarts.init(this.$el, 'macarons')
this.setOptions(this.chartData)
},
setOptions({ title, xAxis, series, nextUrl,url } = {}) {
this.chart.setOption({
title: {
text: title,
x: 'center',
// bottom: 10,
top: 10,
textStyle: {
fontSize: 20,
color: '#8657c8',
}
},
grid: {
left: 10,
right: 10,
bottom: 10,
top: 10,
containLabel: true
},
xAxis: {
type: 'category',
boundaryGap: false,
data:xAxis
},
yAxis: {
type: 'value'
},
series: series
})
this.chart.on('click', function(param) {
if (nextUrl.length > 0) {
// nexurl
var url = ''
for (var i = 0; i < nextUrl.length; i++) {
if (nextUrl[i].name === param.name) {
url = nextUrl[i].url
}
}
// --
router.push({
path: url,
query: {
id: param.name,
start: params.start,
end: params.end
}
})
// --
// let routeUrl = router.resolve({
// path: './situationMapZhiDui',
// query: { id: 96 }
// })
// window.open(routeUrl.href, '_blank')
// 1<router-link :to="{ name: 'details',params: { id: 123 }}"></router-link>
// 2this.$router.push({name:'details',params:{id:123}})
// 3: this.$router.push({name:'detail',params:{id:123,name:'lisi'}})
}
})
}
}
}
</script>

124
src/views/echarts/components/LineChartsHuJiaoZhongXin.vue

@ -0,0 +1,124 @@
<template>
<div :class="className" :style="{height:height,width:width}" />
</template>
<script>
import echarts from 'echarts'
// require('echarts/theme/macarons') // echarts theme
import resize from './mixins/resize'
export default {
mixins: [resize],
props: {
className: {
type: String,
default: 'chart'
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
default: '300px'
},
chartData: {
type: Object,
required: true
}
},
data() {
return {
chart: null
}
},
watch: {
chartData: {
deep: true,
handler(val) {
this.setOptions(val)
}
}
},
mounted() {
this.$nextTick(() => {
this.initChart()
})
},
beforeDestroy() {
if (!this.chart) {
return
}
this.chart.dispose()
this.chart = null
},
methods: {
initChart() {
this.chart = echarts.init(this.$el, 'macarons')
this.setOptions(this.chartData)
},
setOptions({
title,
xAxis,
series,
legend,
unit,
rotate
} = {}) {
this.chart.setOption({
title: {
text: title,
// subtext: '',
x: 'center',
bottom: 10,
// top: 5,
textStyle: {
fontSize: 16
}
},
tooltip: {
trigger: 'axis'
},
legend: {
x: 'center',
bottom: 10,
data: legend
},
toolbox: {
show: true,
feature: {
dataZoom: {
yAxisIndex: 'none'
},
dataView: { readOnly: false },
magicType: { type: ['line', 'bar'] },
restore: {},
saveAsImage: {}
}
},
xAxis: {
type: 'category',
boundaryGap: false,
data: xAxis
},
yAxis: {
type: 'value',
axisLabel: {
formatter: '{value} '
}
},
unit: unit,
rotate: rotate,
series: series
})
this.chart.on('click', function(param) {
this.callParents(param)
})
},
//
callParents(name) {
this.$emit('pieChartFunction', name)
}
}
}
</script>

198
src/views/echarts/components/PieChart.vue

@ -0,0 +1,198 @@
<template>
<div :class="className" :style="{height:height,width:width}" />
</template>
<script>
import echarts from 'echarts'
// require('echarts/theme/macarons') // echarts theme
import resize from './mixins/resize'
import router from '../../../router'
export default {
mixins: [resize],
props: {
className: {
type: String,
default: 'chart'
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
default: '350px'
},
chartData: {
type: Object,
required: true
}
},
data() {
return {
chart: null
}
},
watch: {
chartData: {
deep: true,
handler(val) {
this.setOptions(val)
}
}
},
mounted() {
this.$nextTick(() => {
this.initChart()
})
},
beforeDestroy() {
if (!this.chart) {
return
}
this.chart.dispose()
this.chart = null
},
methods: {
initChart() {
this.chart = echarts.init(this.$el, 'macarons')
this.setOptions(this.chartData)
},
setOptions({ legend, seriesName, Data, nextUrl, unit, params } = {}) {
this.chart.setOption({
title: {
text: seriesName,
// subtext: '',
x: 'left',
// bottom: 10,
top: 10,
left: 30,
textStyle: {
fontSize: 14,
color: '#fff',
fontWeight: 'bolder' //
}
},
grid: {
left: 10,
right: 10,
bottom: 40,
top: 10,
containLabel: true
},
tooltip: {
trigger: 'item',
formatter: '{b} : {c} ' + unit + ' ({d}%)'
// formatter: '{a} <br/>{b} : {c} ({d}%)'
},
legend: {
right: '10',
top: '10',
data: legend, // ['Industries', 'Technology', 'Forex', 'Gold', 'Forecasts']
textStyle: {
// fontSize: 14,
color: '#fff'
// fontWeight: 'bolder' //
}
},
series: [
{
name: seriesName, // 'WEEKLY WRITE ARTICLES',
type: 'pie',
// roseType: 'radius',
radius: [35, 55],
center: ['50%', '50%'],
data: Data.seriesData,
// [
// { value: 320, name: 'Industries' },
// { value: 240, name: 'Technology' },
// { value: 149, name: 'Forex' },
// { value: 100, name: 'Gold' },
// { value: 59, name: 'Forecasts' }
// ],
animationEasing: 'cubicInOut',
animationDuration: 2600,
label: {
normal: {
// 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}%} ',
// backgroundColor: '#eee',
// borderColor: '#aaa',
// borderWidth: 1,
// borderRadius: 4,
// shadowBlur:3,
// shadowOffsetX: 2,
// shadowOffsetY: 2,
// shadowColor: '#999',
padding: [0, 7],
rich: {
// a: {
// color: '#999',
// lineHeight: 22,
// align: 'center'
// },
// abg: {
// backgroundColor: '#333',
// width: '100%',
// align: 'right',
// height: 22,
// borderRadius: [4, 4, 0, 0]
// },
hr: {
borderColor: '#aaa',
width: '100%',
borderWidth: 0.5,
height: 0
},
b: {
fontSize: 12,
lineHeight: 33
},
per: {
color: '#eee',
backgroundColor: '#334455',
padding: [2, 4],
borderRadius: 2
}
}
}
}
}
]
})
this.chart.on('click', function(param) {
if (nextUrl.length > 0) {
// nexurl
var url = ''
for (var i = 0; i < nextUrl.length; i++) {
if (nextUrl[i].name === param.name) {
url = nextUrl[i].url
}
}
// --
router.push({
path: url,
query: {
id: param.name,
start: params.start,
end: params.end
}
})
// --
// let routeUrl = router.resolve({
// path: './situationMapZhiDui',
// query: { id: 96 }
// })
// window.open(routeUrl.href, '_blank')
// 1<router-link :to="{ name: 'details',params: { id: 123 }}"></router-link>
// 2this.$router.push({name:'details',params:{id:123}})
// 3: this.$router.push({name:'detail',params:{id:123,name:'lisi'}})
}
})
}
}
}
</script>

173
src/views/echarts/components/PieChartchild.vue

@ -0,0 +1,173 @@
<template>
<div :class="className" :style="{height:height,width:width}" />
</template>
<script>
import echarts from 'echarts'
// require('echarts/theme/macarons') // echarts theme
import resize from './mixins/resize'
// import router from '../../../router'
export default {
mixins: [resize],
props: {
className: {
type: String,
default: 'chart'
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
default: '350px'
},
chartData: {
type: Object,
required: true
}
},
data () {
return {
chart: null
}
},
watch: {
chartData: {
deep: true,
handler (val) {
this.setOptions(val)
}
}
},
mounted () {
this.$nextTick(() => {
this.initChart()
})
},
beforeDestroy () {
if (!this.chart) {
return
}
this.chart.dispose()
this.chart = null
},
methods: {
initChart () {
this.chart = echarts.init(this.$el, 'macarons')
this.setOptions(this.chartData)
},
setOptions ({
title,
legend,
seriesName,
Data,
nextUrl,
unit,
params
} = {}) {
this.chart.setOption({
title: title,
grid: {
left: 10,
right: 10,
bottom: 10,
top: 30
// containLabel: true
},
tooltip: {
trigger: 'item',
formatter: '{b} : {c} ' + unit + ' ({d}%)'
// formatter: '{a} <br/>{b} : {c} ({d}%)'
},
legend: {
right: '10',
top: '10',
data: legend, // ['Industries', 'Technology', 'Forex', 'Gold', 'Forecasts']
textStyle: {
// fontSize: 14,
color: '#fff'
// fontWeight: 'bolder' //
}
},
series: [
{
name: seriesName, // 'WEEKLY WRITE ARTICLES',
type: 'pie',
// roseType: 'radius',
radius: [0, 75],
center: ['50%', '50%'],
data: Data.seriesData,
// [
// { value: 320, name: 'Industries' },
// { value: 240, name: 'Technology' },
// { value: 149, name: 'Forex' },
// { value: 100, name: 'Gold' },
// { value: 59, name: 'Forecasts' }
// ],
animationEasing: 'cubicInOut',
animationDuration: 2600,
label: {
normal: {
// formatter: '{a|{a}}{abg|}\n{hr|}\n {b|{b}}{c} \n{hr|}\n {per|{d}%} ',
formatter: '{b|{b}:}{c} ' + unit + ' {per|{d}%} ',
// backgroundColor: '#eee',
// borderColor: '#aaa',
// borderWidth: 1,
// borderRadius: 4,
// shadowBlur:3,
// shadowOffsetX: 2,
// shadowOffsetY: 2,
// shadowColor: '#999',
padding: [0, 7],
rich: {
// a: {
// color: '#999',
// lineHeight: 22,
// align: 'center'
// },
// abg: {
// backgroundColor: '#333',
// width: '100%',
// align: 'right',
// height: 22,
// borderRadius: [4, 4, 0, 0]
// },
hr: {
borderColor: '#aaa',
width: '100%',
borderWidth: 0.5,
height: 0
},
b: {
fontSize: 12,
lineHeight: 33
},
per: {
color: '#eee',
backgroundColor: '#334455',
padding: [2, 4],
borderRadius: 2
}
}
}
}
}
]
})
var _this = this
this.chart.on('click', function (param) {
// console.log('' + JSON.stringify(param.data))
_this.callParents(param.data)
})
},
//
callParents (data) {
// console.log('' + name)
this.$emit('piecharChildFunction', data)
}
}
}
</script>

170
src/views/echarts/components/PieChartlitter.vue

@ -0,0 +1,170 @@
<template>
<div :class="className" :style="{height:height,width:width}" />
</template>
<script>
import echarts from 'echarts'
// require('echarts/theme/macarons') // echarts theme
import resize from './mixins/resize'
import router from '../../../router'
export default {
mixins: [resize],
props: {
className: {
type: String,
default: 'chart'
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
default: '350px'
},
chartData: {
type: Object,
required: true
}
},
data() {
return {
chart: null
}
},
watch: {
chartData: {
deep: true,
handler(val) {
this.setOptions(val)
}
}
},
mounted() {
this.$nextTick(() => {
this.initChart()
})
},
beforeDestroy() {
if (!this.chart) {
return
}
this.chart.dispose()
this.chart = null
},
methods: {
initChart() {
this.chart = echarts.init(this.$el, 'macarons')
this.setOptions(this.chartData)
},
setOptions({ legend, seriesName, Data } = {}) {
this.chart.setOption({
title: {
text: seriesName,
// subtext: '',
x: 'left',
// bottom: 10,
top: 10,
left: 30,
textStyle: {
fontSize: 14,
color: 'black',
fontWeight: 'bolder' //
}
},
grid: {
left: 10,
right: 10,
bottom: 40,
top: 10,
containLabel: true
},
tooltip: {
trigger: 'item'
// formatter: '{b} : {c} ' + unit + ' ({d}%)'
// formatter: '{a} <br/>{b} : {c} ({d}%)'
},
legend: {
// right: '10',
top: '10',
data: legend, // ['Industries', 'Technology', 'Forex', 'Gold', 'Forecasts']
textStyle: {
// fontSize: 14,
color: 'black'
// fontWeight: 'bolder' //
}
},
series: [
{
name: seriesName, // 'WEEKLY WRITE ARTICLES',
type: 'pie',
// roseType: 'radius',
radius: [35, 55],
center: ['50%', '60%'],
data: Data.seriesData,
// [
// { value: 320, name: 'Industries' },
// { value: 240, name: 'Technology' },
// { value: 149, name: 'Forex' },
// { value: 100, name: 'Gold' },
// { value: 59, name: 'Forecasts' }
// ],
animationEasing: 'cubicInOut',
animationDuration: 2600,
label: {
normal: {
// 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}%} ',
// backgroundColor: '#eee',
// borderColor: '#aaa',
// borderWidth: 1,
// borderRadius: 4,
// shadowBlur:3,
// shadowOffsetX: 2,
// shadowOffsetY: 2,
// shadowColor: '#999',
padding: [0, 7],
rich: {
// a: {
// color: '#999',
// lineHeight: 22,
// align: 'center'
// },
// abg: {
// backgroundColor: '#333',
// width: '100%',
// align: 'right',
// height: 22,
// borderRadius: [4, 4, 0, 0]
// },
hr: {
borderColor: '#aaa',
width: '100%',
borderWidth: 0.5,
height: 0
},
b: {
fontSize: 12,
lineHeight: 33
},
per: {
color: '#eee',
backgroundColor: '#334455',
padding: [2, 4],
borderRadius: 2
}
}
}
}
}
]
})
this.chart.on('click', function(param) {
})
}
}
}
</script>

202
src/views/echarts/components/PieChartpies.vue

@ -0,0 +1,202 @@
<template>
<div :class="className" :style="{height:height,width:width}" />
</template>
<script>
import echarts from 'echarts'
// require('echarts/theme/macarons') // echarts theme
import resize from './mixins/resize'
// import router from '../../../router'
// const animationDuration = 6000
export default {
mixins: [resize],
props: {
className: {
type: String,
default: 'chart'
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
default: '350px'
},
chartData: {
type: Object,
required: true
}
},
data() {
return {
chart: null
}
},
watch: {
chartData: {
deep: true,
handler(val) {
this.setOptions(val)
}
}
},
mounted() {
this.$nextTick(() => {
this.initChart()
})
},
beforeDestroy() {
if (!this.chart) {
return
}
this.chart.dispose()
this.chart = null
},
methods: {
initChart() {
this.chart = echarts.init(this.$el, 'macarons')
this.setOptions(this.chartData)
},
setOptions({
seriesName,
legend,
xAxis,
Data,
nextUrl,
rotate,
unit,
params
} = {}) {
// Data:[{name:"name",date:[ { value: 335, name: "", selected: true }]},{name:"name",date:[ { value: 335, name: "" }]}]
var option = {
title: {
text: seriesName,
x: 'left',
// bottom: 10,
top: 10,
left: 30,
textStyle: {
fontSize: 14,
color: '#fff',
fontWeight: 'bolder' //
}
},
grid: {
left: 15,
right: 15,
bottom: 0,
// top: 90,
containLabel: true
},
tooltip: {
trigger: 'item',
formatter: '{b} : {c} ' + unit + ' ({d}%)'
// formatter: "{a} <br/>{b}: {c} ({d}%)"
},
series: [
{
// name: Data[0].name,
type: 'pie',
selectedMode: 'single',
radius: [0, '25%'],
label: {
normal: {
position: 'inner'
}
},
labelLine: {
normal: {
show: false
}
},
data: Data[0].data
// data: [
// { value: 335, name: "", selected: true },
// { value: 679, name: "广" },
// { value: 1548, name: "" }
// ]
},
{
// name: Data[1].name,
type: 'pie',
radius: ['30%', '45%'],
label: {
normal: {
// formatter: "{a|{a}}{abg|}\n{hr|}\n {b|{b}}{c} {per|{d}%} ",
formatter: '{b} \n{hr|}\n {per| {c}' + unit + '({d}%})',
// backgroundColor: "#eee",
// borderColor: "#aaa",
// borderWidth: 1,
// borderRadius: 4,
// shadowBlur:3,
// shadowOffsetX: 2,
// shadowOffsetY: 2,
// shadowColor: '#999',
// padding: [0, 7],
rich: {
// a: {
// color: "#999",
// lineHeight: 22,
// align: "center"
// },
// // abg: {
// // backgroundColor: '#333',
// // width: '100%',
// // align: 'right',
// // height: 22,
// // borderRadius: [4, 4, 0, 0]
// // },
hr: {
borderColor: '#aaa',
width: '100%',
borderWidth: 0.5,
height: 0
},
// b: {
// fontSize: 16,
// lineHeight: 33
// },
per: {
color: '#eee',
backgroundColor: '#334455',
padding: [2, 4],
borderRadius: 2
}
}
},
textStyle: {
fontSize: '8px'
}
},
data: Data[1].data
// data: [
// { value: 335, name: "" },
// { value: 310, name: "" },
// { value: 234, name: "广" },
// { value: 135, name: "广" },
// { value: 1048, name: "" },
// { value: 251, name: "" },
// { value: 147, name: "" },
// { value: 102, name: "" }
// ]
}
]
}
this.chart.setOption(option)
var _this = this
this.chart.on('click', function(param) {
_this.callParents(param.name)
})
},
//
callParents(name) {
this.$emit('piesFunction', name)
}
}
}
</script>

202
src/views/echarts/components/PieChartrand.vue

@ -0,0 +1,202 @@
<template>
<div :class="className" :style="{height:height,width:width}" />
</template>
<script>
import echarts from 'echarts'
// require('echarts/theme/macarons') // echarts theme
import resize from './mixins/resize'
import router from '../../../router'
export default {
mixins: [resize],
props: {
className: {
type: String,
default: 'chart'
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
default: '350px'
},
chartData: {
type: Object,
required: true
}
},
data() {
return {
chart: null
}
},
watch: {
chartData: {
deep: true,
handler(val) {
this.setOptions(val)
}
}
},
mounted() {
this.$nextTick(() => {
this.initChart()
})
},
beforeDestroy() {
if (!this.chart) {
return
}
this.chart.dispose()
this.chart = null
},
methods: {
initChart() {
this.chart = echarts.init(this.$el, 'macarons')
this.setOptions(this.chartData)
},
setOptions({ legend, seriesName, Data, nextUrl, unit, params } = {}) {
this.chart.setOption({
title: {
text: seriesName,
// subtext: '',
x: 'center',
bottom: 5,
// top: 5,
textStyle: {
fontSize: 14,
color: '#fff'
// fontWeight: "bolder" //
}
},
grid: {
left: 10,
right: 10,
bottom: 40,
top: 10,
containLabel: true
},
tooltip: {
trigger: 'item',
formatter: '{b} : {c} ' + unit + ' ({d}%)',
// formatter: '{a} <br/>{b} : {c} ({d}%)'
textStyle: {
color: '#fff'
}
},
legend: {
left: 'left',
top: '10',
data: legend, // ['Industries', 'Technology', 'Forex', 'Gold', 'Forecasts']
textStyle: {
color: '#fff'
}
},
series: [
{
name: seriesName, // 'WEEKLY WRITE ARTICLES',
type: 'pie',
// roseType: 'radius',
radius: [0, 40],
center: ['50%', '50%'],
data: Data.seriesData,
// [
// { value: 320, name: 'Industries' },
// { value: 240, name: 'Technology' },
// { value: 149, name: 'Forex' },
// { value: 100, name: 'Gold' },
// { value: 59, name: 'Forecasts' }
// ],
animationEasing: 'cubicInOut',
animationDuration: 2600,
label: {
normal: {
show: true,
position: 'inner',
formatter: '{c} ',
// 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}%} ",
// backgroundColor: '#eee',
// borderColor: '#aaa',
// borderWidth: 1,
// borderRadius: 4,
// shadowBlur:3,
// shadowOffsetX: 2,
// shadowOffsetY: 2,
// shadowColor: '#999',
padding: [0, 7],
rich: {
// a: {
// color: '#999',
// lineHeight: 22,
// align: 'center'
// },
// abg: {
// backgroundColor: '#333',
// width: '100%',
// align: 'right',
// height: 22,
// borderRadius: [4, 4, 0, 0]
// },
hr: {
borderColor: '#aaa',
width: '100%',
borderWidth: 0.5,
height: 0
},
b: {
fontSize: 12,
lineHeight: 33
},
per: {
color: '#eee',
backgroundColor: '#334455',
padding: [2, 4],
borderRadius: 2
}
}
}
}
}
]
})
this.chart.on('click', function(param) {
if (nextUrl.length > 0) {
// nexurl
var url = ''
for (var i = 0; i < nextUrl.length; i++) {
if (nextUrl[i].name === param.name) {
url = nextUrl[i].url
}
}
// --
router.push({
path: url,
query: {
id: param.name,
start: params.start,
end: params.end
}
})
// --
// let routeUrl = router.resolve({
// path: './situationMapZhiDui',
// query: { id: 96 }
// })
// window.open(routeUrl.href, '_blank')
// 1<router-link :to="{ name: 'details',params: { id: 123 }}"></router-link>
// 2this.$router.push({name:'details',params:{id:123}})
// 3: this.$router.push({name:'detail',params:{id:123,name:'lisi'}})
}
})
}
}
}
</script>

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

@ -0,0 +1,201 @@
<template>
<div :class="className" :style="{height:height,width:width}" />
</template>
<script>
// import echarts from 'echarts'
import * as echarts from 'echarts';
// require('echarts/theme/macarons') // echarts theme
import resize from './mixins/resize'
import router from '../../../router'
export default {
mixins: [resize],
props: {
className: {
type: String,
default: 'chart'
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
default: '250px'
},
chartData: {
type: Object,
required: true
}
},
data() {
return {
chart: null
}
},
watch: {
chartData: {
deep: true,
handler(val) {
this.setOptions(val)
}
}
},
mounted() {
this.$nextTick(() => {
this.initChart()
})
},
beforeDestroy() {
if (!this.chart) {
return
}
this.chart.dispose()
this.chart = null
},
methods: {
initChart() {
this.chart = echarts.init(this.$el, 'macarons')
this.setOptions(this.chartData)
},
setOptions({ legend, seriesName, Data, nextUrl, unit, params } = {}) {
this.chart.setOption({
title: {
text: seriesName,
// subtext: '',
x: 'center',
// bottom: 10,
top: 10,
//left: 30,
textStyle: {
fontSize: 20,
color: '#8657c8',
//fontWeight: 'bolder' //
}
},
grid: {
left: 10,
right: 10,
bottom: 10,
top: 10,
containLabel: true
},
tooltip: {
trigger: 'item',
// formatter: '{b} : {c} ' + unit + ' ({d}%)'
formatter: '{a} <br/>{b} : {c} ({d}%)'
},
legend: {
// right: '10',
bottom: '30',
data: legend, // ['Industries', 'Technology', 'Forex', 'Gold', 'Forecasts']
textStyle: {
// fontSize: 14,
color: '#666'
// fontWeight: 'bolder' //
}
},
series: [
{
name: seriesName, // 'WEEKLY WRITE ARTICLES',
type: 'pie',
// roseType: 'radius',
radius: [50, 60],
center: ['50%', '48%'],
data: Data.seriesData,
// [
// { value: 320, name: 'Industries' },
// { value: 240, name: 'Technology' },
// { value: 149, name: 'Forex' },
// { value: 100, name: 'Gold' },
// { value: 59, name: 'Forecasts' }
// ],
animationEasing: 'cubicInOut',
animationDuration: 2600,
label: {
normal: {
show: false,
// 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}%} ',
// backgroundColor: '#eee',
// borderColor: '#aaa',
// borderWidth: 1,
// borderRadius: 4,
// shadowBlur:3,
// shadowOffsetX: 2,
// shadowOffsetY: 2,
// shadowColor: '#999',
padding: [0, 7],
rich: {
// a: {
// color: '#999',
// lineHeight: 22,
// align: 'center'
// },
// abg: {
// backgroundColor: '#333',
// width: '100%',
// align: 'right',
// height: 22,
// borderRadius: [4, 4, 0, 0]
// },
hr: {
borderColor: '#aaa',
width: '100%',
borderWidth: 0.5,
height: 0
},
b: {
fontSize: 12,
lineHeight: 33
},
per: {
color: '#eee',
backgroundColor: '#334455',
padding: [2, 4],
borderRadius: 2
}
}
}
}
}
]
})
this.chart.on('click', function(param) {
if (nextUrl.length > 0) {
// nexurl
var url = ''
for (var i = 0; i < nextUrl.length; i++) {
if (nextUrl[i].name === param.name) {
url = nextUrl[i].url
}
}
// --
router.push({
path: url,
query: {
id: param.name,
start: params.start,
end: params.end
}
})
// --
// let routeUrl = router.resolve({
// path: './situationMapZhiDui',
// query: { id: 96 }
// })
// window.open(routeUrl.href, '_blank')
// 1<router-link :to="{ name: 'details',params: { id: 123 }}"></router-link>
// 2this.$router.push({name:'details',params:{id:123}})
// 3: this.$router.push({name:'detail',params:{id:123,name:'lisi'}})
}
})
}
}
}
</script>

114
src/views/echarts/components/YibiaoChartJibu.vue

@ -0,0 +1,114 @@
<template>
<div :class="className" :style="{height:height,width:width}" />
</template>
<script>
import echarts from 'echarts'
// require('echarts/theme/macarons') // echarts theme
import resize from './mixins/resize'
import router from '../../../router'
export default {
mixins: [resize],
props: {
className: {
type: String,
default: 'chart'
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
default: '350px'
},
chartData: {
type: Object,
required: true
}
},
data() {
return {
chart: null
}
},
watch: {
chartData: {
deep: true,
handler(val) {
this.setOptions(val)
}
}
},
mounted() {
this.$nextTick(() => {
this.initChart()
})
},
beforeDestroy() {
if (!this.chart) {
return
}
this.chart.dispose()
this.chart = null
},
methods: {
initChart() {
this.chart = echarts.init(this.$el, 'macarons')
this.setOptions(this.chartData)
},
setOptions({ tooltip,series } = {}) {
this.chart.setOption({
tooltip: {
formatter: '{a} <br/>{b} : {c}%'
},
series: [{
name: series[0].name,
type: 'gauge',
radius: '90%',
center : ['50%', '50%'],
detail: {
formatter: '{value}'
},
data:series[0].data
// data: [{
// value: 200,
// name: 'SCORE'
// }]
}]
})
this.chart.on('click', function(param) {
if (nextUrl.length > 0) {
// nexurl
var url = ''
for (var i = 0; i < nextUrl.length; i++) {
if (nextUrl[i].name === param.name) {
url = nextUrl[i].url
}
}
// --
router.push({
path: url,
query: {
id: param.name,
start: params.start,
end: params.end
}
})
// --
// let routeUrl = router.resolve({
// path: './situationMapZhiDui',
// query: { id: 96 }
// })
// window.open(routeUrl.href, '_blank')
// 1<router-link :to="{ name: 'details',params: { id: 123 }}"></router-link>
// 2this.$router.push({name:'details',params:{id:123}})
// 3: this.$router.push({name:'detail',params:{id:123,name:'lisi'}})
}
})
}
}
}
</script>

56
src/views/echarts/components/mixins/resize.js

@ -0,0 +1,56 @@
import { debounce } from '@/utils'
export default {
data() {
return {
$_sidebarElm: null
}
},
mounted() {
this.$_initResizeEvent()
this.$_initSidebarResizeEvent()
},
beforeDestroy() {
this.$_destroyResizeEvent()
this.$_destroySidebarResizeEvent()
},
// to fixed bug when cached by keep-alive
// https://github.com/PanJiaChen/vue-element-admin/issues/2116
activated() {
this.$_initResizeEvent()
this.$_initSidebarResizeEvent()
},
deactivated() {
this.$_destroyResizeEvent()
this.$_destroySidebarResizeEvent()
},
methods: {
// use $_ for mixins properties
// https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential
$_resizeHandler() {
return debounce(() => {
if (this.chart) {
this.chart.resize()
}
}, 100)()
},
$_initResizeEvent() {
window.addEventListener('resize', this.$_resizeHandler)
},
$_destroyResizeEvent() {
window.removeEventListener('resize', this.$_resizeHandler)
},
$_sidebarResizeHandler(e) {
if (e.propertyName === 'width') {
this.$_resizeHandler()
}
},
$_initSidebarResizeEvent() {
this.$_sidebarElm = document.getElementsByClassName('sidebar-container')[0]
this.$_sidebarElm && this.$_sidebarElm.addEventListener('transitionend', this.$_sidebarResizeHandler)
},
$_destroySidebarResizeEvent() {
this.$_sidebarElm && this.$_sidebarElm.removeEventListener('transitionend', this.$_sidebarResizeHandler)
}
}
}

58
src/views/echarts/index.vue

@ -0,0 +1,58 @@
<template>
<div>
111111页面
</div>
</template>
<script>
import 'echarts-gl'
import { mapGetters } from 'vuex'
import { fileUrl } from '@/api/sys/index'
import { parseDate } from '@/utils'
import Pagination from '@/components/Pagination' // secondary package based on el-pagination
import echarts from 'echarts'
export default {
// name: "Dashboard",
components: { Pagination },
computed: {
...mapGetters([
'id',
'departmentCode',
'department',
'departmentLevel',
'departmentType',
'token'
])
},
data() {
return {
tableKey: 0,
list: null,
total: 0,
listLoading: true,
listQuery: {
pageNumber: 1,
pageSize: 20,
department: '',
startDate: '',
endDate: '',
title: ''
}
}
},
mounted() {},
beforeDestroy() {},
created() {},
methods: {
indexMethod(index) {
var pagestart =
(this.listQueryPerson.pageNumber - 1) * this.listQueryPerson.pageSize
var pageindex = index + 1 + pagestart
return pageindex
}
}
}
</script>
<style lang="scss" scoped>
</style>

420
src/views/index.vue

@ -1,17 +1,227 @@
<template>
<div class="imgDemo">
<!--<el-button type="primary" @click="getToken()">token</el-button>
<div style="width: 200px;">{{token}}</div>-->
</div>
<div class="webindex">
<div class="tops">
<!-- 第1个 -->
<div class="topbox">
<div class="toptitle">入侵报警</div>
<div class="mids">
<div class="lefts">
<div class="icon myiconfont iconbox iconbox_yellow">&#xe608;</div>
</div>
<div class="rights">
<div class="note">正常<span class="bluezi">26</span></div>
<div class="note">离线<span class="huizi">12</span></div>
<div class="note">报警<span class="redzi">11</span></div>
</div>
</div>
</div>
<!-- 第2个 -->
<div class="topbox">
<div class="toptitle">视频监控</div>
<div class="mids">
<div class="lefts">
<div class="icon myiconfont iconbox iconbox_blue">&#xe64a;</div>
</div>
<div class="rights">
<div class="note">正常<span class="bluezi">36</span></div>
<div class="note">离线<span class="huizi">16</span></div>
<div class="note">报警<span class="redzi">15</span></div>
</div>
</div>
</div>
<!-- 第3个 -->
<div class="topbox">
<div class="toptitle">门禁管理</div>
<div class="mids">
<div class="lefts">
<div class="icon myiconfont iconbox iconbox_zi">&#xe60b;</div>
</div>
<div class="rights">
<div class="note">正常<span class="bluezi">38</span></div>
<div class="note">离线<span class="huizi">15</span></div>
<div class="note">报警<span class="redzi">12</span></div>
</div>
</div>
</div>
<!-- 第4个 -->
<div class="topbox">
<div class="toptitle">电子围栏</div>
<div class="mids">
<div class="lefts">
<div class="icon myiconfont iconbox iconbox_red">&#xe9f7;</div>
</div>
<div class="rights">
<div class="note">正常<span class="bluezi">26</span></div>
<div class="note">离线<span class="huizi">12</span></div>
<div class="note">报警<span class="redzi">11</span></div>
</div>
</div>
</div>
<!-- 第5个 -->
<div class="topbox">
<div class="toptitle">电子巡更</div>
<div class="mids">
<div class="lefts">
<div class="icon myiconfont iconbox iconbox_green">&#xe64c;</div>
</div>
<div class="rights">
<div class="note">正常<span class="bluezi">39</span></div>
<div class="note">离线<span class="huizi">15</span></div>
<div class="note">报警<span class="redzi">12</span></div>
</div>
</div>
</div>
<!-- 11 -->
</div>
<!-- 饼图 -->
<div class="tbars">
<!-- 第1个图表 -->
<div class="tbar">
<div class="title"><span class="iconfont icon-jiating greenzi"></span>入侵报警</div>
<div class="bar">
<pie-chartrenyuan :chart-data="ruqinbaojing_Chart"></pie-chartrenyuan>
</div>
</div>
<!-- 第1个图表 -->
<div class="tbar">
<div class="title"><span class="iconfont icon-jiating greenzi"></span>视频监控</div>
<div class="bar">
<pie-chartrenyuan :chart-data="ruqinbaojing_Chart" ></pie-chartrenyuan>
</div>
</div>
<!-- 第1个图表 -->
<div class="tbar">
<div class="title"><span class="iconfont icon-jiating greenzi"></span>门禁管理</div>
<div class="bar">
<pie-chartrenyuan :chart-data="ruqinbaojing_Chart"></pie-chartrenyuan>
</div>
</div>
<!-- 第1个图表 -->
<div class="tbar">
<div class="title"><span class="iconfont icon-jiating greenzi"></span>电子围栏</div>
<div class="bar">
<pie-chartrenyuan :chart-data="ruqinbaojing_Chart"></pie-chartrenyuan>
</div>
</div>
<!-- 第1个图表 -->
<div class="tbar">
<div class="title"><span class="iconfont icon-jiating greenzi"></span>电子巡更</div>
<div class="bar">
<pie-chartrenyuan :chart-data="ruqinbaojing_Chart"></pie-chartrenyuan>
</div>
</div>
</div>
<!-- 第3行 -->
<div class="con">
<!-- 第1 -->
<div class="news">
<div class="title">
<div class="newstits">提醒任务</div>
<div class="more" @click="toMore()">更多></div>
</div>
<div class="content">
<div class="newsli" v-for="(item, index) in Datalista" :key="index" @click="toinfo()">
<div class="dot">&bull;</div>
<div class="tit">{{item.title}}</div>
<div class="time">{{item.createTime}}</div>
</div>
</div>
</div>
<!-- 第1 -->
<div class="news">
<div class="title">
<div class="newstits">报警消息</div>
<div class="more" @click="toMore()">更多></div>
</div>
<div class="content">
<div class="newsli" v-for="(item, index) in Datalist" :key="index" @click="toinfo()">
<div class="dot">&bull;</div>
<div class="tit">{{item.title}}</div>
<div class="time">{{item.createTime}}</div>
</div>
</div>
</div>
<!-- 第1 -->
<div class="news">
<div class="title">
<div class="newstits">视频消息</div>
<div class="more" @click="toMore()">更多></div>
</div>
<div class="content">
<div class="newsli" v-for="(item, index) in Datalist" :key="index" @click="toinfo()">
<div class="dot">&bull;</div>
<div class="tit">{{item.title}}</div>
<div class="time">{{item.createTime}}</div>
</div>
</div>
</div>
<!-- 第1 -->
<div class="news">
<div class="title">
<div class="newstits">门禁消息</div>
<div class="more" @click="toMore()">更多></div>
</div>
<div class="content">
<div class="newsli" v-for="(item, index) in Datalist" :key="index" @click="toinfo()">
<div class="dot">&bull;</div>
<div class="tit">{{item.title}}</div>
<div class="time">{{item.createTime}}</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import {login1} from '@/api/system/user/login.js'
import * as echarts from "echarts";
import PieChartrenyuan from '@/views/echarts/components/PieChartrenyuan'
// 1.1
const ruqinbaojing_Chart = {
// seriesName: '',
unit: '次',
color: ['#fe7f02', '#049f51', '#fdc004'],
Data: {
seriesData: [
{ value: 39, name: '正常' },
{ value: 16, name: '离线' },
{ value: 12, name: '报警' }
]
},
label: {
normal: {
position: 'inner',
show: false
}
},
// radius: ['50%', '55%']
}
export default {
name: '',
name: 'index',
components: {
PieChartrenyuan
},
data() {
return {
token:''
ruqinbaojing_Chart: ruqinbaojing_Chart, // 1.1
token:'',
Datalista: [
{ title: '您有新任务了', createTime: '2023-05-23' },
{ title: '您有新任务了', createTime: '2023-05-23' },
{ title: '您有新任务了', createTime: '2023-05-23' },
{ title: '您有新任务了', createTime: '2023-05-23' },
{ title: '您有新任务了', createTime: '2023-05-23' },
],
Datalist: [
{ title: '您有新消息了', createTime: '2023-05-23' },
{ title: '您有新消息了', createTime: '2023-05-23' },
{ title: '您有新消息了', createTime: '2023-05-23' },
{ title: '您有新消息了', createTime: '2023-05-23' },
{ title: '您有新消息了', createTime: '2023-05-23' },
],
}
},
methods:{
@ -33,11 +243,201 @@
</script>
<style lang="scss" scoped>
.imgDemo {
width: 100%;
.webindex {
width: 100%; padding: 20px;
height: 100%;
background: radial-gradient(#fff,#f5f7f4, #fff);
}
canvas {
}
.tops {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;align-items: flex-start;
padding: 0px;
margin: 0px;
}
.tops .topbox {
width: 25%;
margin: 0 20px 0 0;
background-color: #fff;
box-shadow:0px 0px 10px #E9E9E9;border-radius: 5px;
padding: 10px;
}
.tops .topbox:last-of-type {
margin: 0;
}
.tops .topbox .toptitle {
font-size: 20px;
padding: 10px 20px;
font-weight: bold; color: #333;font-size: 16px;
border-bottom: 1px solid #ececee;
}
.tops .topbox .mids {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;align-items: center;
margin: 0;
padding: 20px ;
}
.tops .topbox .mids .lefts{width: 100px;}
.tops .topbox .mids .lefts .iconbox {
border-radius: 10px;
line-height: 80px;
width: 80px;
height: 80px;
color: #fff;
font-size: 36px;text-align: center;
}
.iconbox_red {
background-color: #df2f07;
}
.iconbox_yellow {
background-color: #ff7521;
}
.iconbox_green {
background-color: #07C160;
}
.iconbox_blue {
background-color: #3f9bfa;
}
.iconbox_zi {
background-color: #6421ff;
}
.iconbox_fen {
background-color: #9b2efb;
}
.tops .topbox .mids .rights {flex: 1;
padding: 2px 0 2px 10px;
}
.tops .topbox .mids .rights .note {
color: #333;
font-size: 14px;
padding: 0 0 3px 0;
}
.tops .topbox .mids .rights .note span {
font-size: 20px;
padding: 0 5px;
}
/* 饼图部分 */
.tbars {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;align-items: flex-start;
margin: 0;
padding: 20px 0 0 0;
}
.tbar {
width: 25%;
margin: 0 20px 0 0;
background-color: #fff;
box-shadow:0px 0px 10px #E9E9E9;border-radius: 5px;
padding: 10px;
}
.tbar:last-of-type {
margin: 0;
}
.tbar0 {
border-bottom: 0px solid #032ab8;
}
.tbar .title {
font-size: 20px;
padding: 10px 20px;
font-weight: bold; color: #333;font-size: 16px;
border-bottom: 1px solid #ececee;
}
.tbar .title span {
padding: 0 10px 0 0;
}
.tbar .bar {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;align-items: center;
margin: 0;
padding: 0px;
height: 190px;
}
.con {
padding: 20px 0;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: space-around;
}
.news {
width: 25%;
margin: 0 20px 0 0;
background-color: #fff;
box-shadow:0px 0px 10px #E9E9E9;border-radius: 5px;
padding: 10px;
}
.news:last-of-type {
margin: 0;
}
.news .title {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: space-between;
align-items: center;
padding: 10px 10px 10px 20px;
border-bottom: 1px solid #ececee;
}
.news .title .newstits {
font-weight: bold; color: #333;font-size: 16px;
}
.news .title .more {text-align: right;
cursor: pointer;color: #6c6a6a;font-size: 14px;
}
.news .content {
padding: 10px 0;
height: 210px;
overflow: hidden;
}
.news .content .newsli {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: space-between;
margin: 0px 0px;
padding: 5px 10px;
border-bottom: 1px solid #ececee;
}
.news .content .newsli .dot {
padding: 0px 8px 0 0;
font-size: 18px;
height: 25px;
line-height: 25px;color: #047cf7;
}
.news .content .newsli .tit {
padding: 0px 0;
font-size: 14px;
flex: 3;
height: 25px;
overflow: hidden;
line-height: 25px;
cursor: pointer;
}
// .news .content .newsli .tel{padding: 10px 0;color: #84d1f5;flex: 1;text-align: center;}
.news .content .newsli .time {
padding: 0px 0;
color: #666666;
text-align: right;font-size: 14px;
width: 100px;
height: 25px;
line-height: 25px;
}
</style>

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

@ -1,323 +1,549 @@
<template>
<div class="video_box">
<!-- 摄像头 -->
<div id="divPlugin" class="plugin"></div>
<div class="app-container">
<div v-show="viewState == 1">
<!-- <button-bar view-title="视频中心" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle"/> -->
<div class="main-content">
<div class="shipinlisttop">
<el-form ref="listQueryform" :inline="true" :model="listQuery" label-width="110px" class="tab-header">
<el-form-item label="选择楼栋">
<el-select v-model="listQuery.params.supplierType" filterable clearable placeholder="请选择楼栋">
<el-option v-for="item in supplierType_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/>
</el-select>
</el-form-item>
<el-form-item label="选择楼层">
<el-select v-model="listQuery.params.supplierType" filterable clearable placeholder="请选择楼层">
<el-option v-for="item in supplierType_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/>
</el-select>
</el-form-item>
</el-form>
<div class="mores">
<div class="more">
<p class="bluezi">正常</p>
<span class="myiconfont iconbox iconbox_blue">&#xe608;</span>
</div>
<div class="more">
<p class="huizi">离线</p>
<span class="myiconfont iconbox iconbox_hui">&#xe608;</span>
</div>
<div class="more">
<p class="redzi">报警</p>
<span class="myiconfont iconbox iconbox_red">&#xe608;</span>
</div>
</div>
</div>
<div class="shipinscon">
<div class="shipinstu">
<div class="myiconfont redzibg jingicon jingicona1">&#xe608;</div>
<div class="myiconfont redzibg jingicon jingicona2">&#xe608;</div>
<div class="myiconfont redzibg jingicon jingicona3">&#xe608;</div>
<div class="myiconfont redzibg jingicon jingicona4">&#xe608;</div>
<div class="myiconfont bluezibg jingicon jingiconb1">&#xe608;</div>
<div class="myiconfont bluezibg jingicon jingiconb2">&#xe608;</div>
<div class="myiconfont bluezibg jingicon jingiconb3">&#xe608;</div>
<div class="myiconfont bluezibg jingicon jingiconb4">&#xe608;</div>
</div>
<!-- 下部机构导航 -->
<div class="tabhead">
<el-checkbox-group v-model="departmentTypeArray" @change="getList">
<el-checkbox-button v-for="(item,index) in jigounavType" :key="index" :label="item.value" :value="item.value">
<span class="iconfontyuan myiconfont" :class="icontu[index]"></span>
{{item.label}}
</el-checkbox-button>
</el-checkbox-group>
</div>
<!-- 列表结束 -->
</div>
</div>
</div>
<!-- 查看视频 -->
<el-dialog v-el-drag-dialog title="查看视频" :visible.sync="dialogImage" width="800px">
<div class="shipin">
<video :preload="preload" autoplay :height="height" :width="width" align="center" :controls="controls">
<source :src="videoSrc" type="video/mp4">
</video>
</div>
</el-dialog>
</div>
</template>
<script>
import * as WebVideoCtrl from "@/api/hikvision/hkVideo.js";
export default {
name: "carNvrVideo",
components: {
WebVideoCtrl
},
data() {
return {
szInfo: "",
rowList: {},
hkvInfo: {
ip: "192.168.3.2",
port: "8000",
username: "admin",
password: "Yxt123456"
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import ButtonBar from '@/components/ButtonBar'
// import { typeValues, getOrgSidByPath } from '@/api/cheliang/dictcommons'
// import baojingchaxunAdd from './baojingchaxunAdd'
// import baojingchaxunInfo from './baojingchaxunInfo'
// import req from '@/api/baojingchaxun/baojingchaxun'
export default {
name: 'shipinzhongxin',
components: {
Pagination,
pageye,
ButtonBar
},
data() {
return { checkList: ['选中且禁用','复选框 A'],
btndisabled: false,
btnList: [
// {
// type: 'primary',
// size: 'small',
// icon: 'plus',
// btnKey: 'toAdd',
// btnLabel: ''
// },
// {
// type: 'danger',
// size: 'small',
// icon: 'del',
// btnKey: 'doDel',
// btnLabel: ''
// },
// {
// type: 'primary',
// size: 'small',
// icon: '',
// btnKey: 'toChangShang',
// btnLabel: ''
// },
// {
// type: 'primary',
// size: 'small',
// icon: '',
// btnKey: 'toGain',
// btnLabel: ''
// },
// {
// type: 'success',
// size: 'small',
// icon: 'export',
// btnKey: 'build',
// btnLabel: ''
// },
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
viewState: 1,
isSearchShow: false,
searchxianshitit: '显示查询条件',
sids: [],
// -----------
tableKey: 0,
list: [{bianma:'212233433',supplierTypeValue:'222',weizhi:'212233433',time:'2023-02-26',anzhuangtime:'2023-02-26',gonghuashang:'222'
,supplierTypeValue:'222',zhuangtai:'222'}
],
listLoading: false,
listQuery: {
params: {
manufacturerName: '',
supplierType: '',
useOrgSid: '',
createOrgSid: '',
manufacturerTelePhone: '',
contactName: ''
},
mySelectWnd: 0, //
g_bPTZAuto: false,
iProtocol: 1,
loginLoading: false,
startPlayLoading: false,
bZeroChannel: false,
iRtspPort: 0,
index: 0,
iWndowType: null,
videoData: [{
ip: "192.168.3.2",
port: "8000",
username: "admin",
password: "Yxt123456"
current: 1,
size: 5,
total: 0
},
supplierType_list: [],
Datalista: [
{xiaoqu:'和平家园小区南门出口',tuUrl:'./image/ren1.jpg', weizhi: '南门出口', createTime: '2023-05-03', createTime2: '18:26:38', shijian: '社区户主', name: '李明华' },
{xiaoqu:'和平家园小区东门出口',tuUrl:'./image/ren2.jpg', weizhi: '东门出口', createTime: '2023-05-08', createTime2: '18:26:38', shijian: '社区户主', name: '李明华' },
{xiaoqu:'和平家园小区西门出口',tuUrl:'./image/ren1.jpg', weizhi: '西门出口', createTime: '2023-05-12', createTime2: '19:32:38', shijian: '社区户主', name: '李明华' },
{xiaoqu:'和平家园小区东门出口',tuUrl:'./image/ren2.jpg', weizhi: '东门出口', createTime: '2023-05-23', createTime2: '18:26:38', shijian: '社区户主', name: '李明华' },
{xiaoqu:'和平家园小区南门出口',tuUrl:'./image/ren1.jpg', weizhi: '南门出口', createTime: '2023-05-03', createTime2: '18:26:38', shijian: '社区户主', name: '李明华' },
{xiaoqu:'和平家园小区东门出口',tuUrl:'./image/ren2.jpg', weizhi: '东门出口', createTime: '2023-05-08', createTime2: '18:26:38', shijian: '社区户主', name: '李明华' },
{xiaoqu:'和平家园小区西门出口',tuUrl:'./image/ren1.jpg', weizhi: '西门出口', createTime: '2023-05-12', createTime2: '19:32:38', shijian: '社区户主', name: '李明华' },
{xiaoqu:'和平家园小区东门出口',tuUrl:'./image/ren2.jpg', weizhi: '东门出口', createTime: '2023-05-23', createTime2: '18:26:38', shijian: '社区户主', name: '李明华' },
],
dialogImage: false,
//
videoSrc: '../../../image/cangkushipin.mp4',
}],
ua: navigator.userAgent.toLocaleLowerCase(),
};
playStatus: '',
muteStatus: '',
isMute: true,
isPlay: true,
width: '100%', //
height: '430', //
preload: 'auto', // <video>
controls: true, // 使autoplayPlayer API
autoplay: true,
departmentTypeArray: [],
icontu: ['redziyuan icon-intruder-alarm', 'greenziyuan icon-shipin1', 'yellowziyuan icon-menjin', 'blueziyuan icon-electronic-patrol'],
jigounavType: [
{ value: '4', label: '入侵报警', zi: 'icon-dituleiditu' },
{ value: '2', label: '视频监控', zi: 'icon-dituleiditu' },
{ value: '1', label: '门禁管理', zi: '禁' },
{ value: '3', label: '电子围栏', zi: '电' },
],
//
rules: {}
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
//
// this.init()
},
methods: {
resetState() {
this.viewState = 1
},
created() {
// this.videoData = JSON.parse(this.$route.query.videoData);
// if (this.videoData.length <= 1) {
// this.iWndowType = 1;
// } else if (this.videoData.length > 1 && this.videoData.length <= 4) {
// this.iWndowType = 2;
btnHandle(btnKey) {
console.log('XXXXXXXXXXXXXXX ' + btnKey)
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'doDel':
this.doDel()
break
case 'toChangShang':
this.toChangShang()
break
case 'toGain':
this.toGain()
break
case 'doExport':
this.doExport()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
// init() {
// getOrgSidByPath({ orgPath: window.sessionStorage.getItem('defaultOrgPath') }).then((res) => {
// if (res.success) {
// this.listQuery.params.createOrgSid = res.data
// this.getType()
// this.getList()
// }
// })
// },
// getType() {
// typeValues({
// type: 'supplierType'
// }).then((res) => {
// if (res.code === '200') {
// this.supplierType_list = res.data
// console.log('', this.supplierType_list)
// }
// })
// },
//
indexMethod(index) {
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
var pageindex = index + 1 + pagestart
return pageindex
},
//
getList() {
// this.listLoading = true
// req.gysPagerList(this.listQuery).then((response) => {
// this.listLoading = false
// if (response.code === '200' && response.data && response.data.total > 0) {
// this.list = response.data.records
// this.listQuery.total = response.data.total
// } else {
// this.list = []
// this.listQuery.total = 0
// }
// })
},
//
handleFilter() {
this.listQuery.current = 1
this.getList()
},
handleReset() {
// this.listQuery = {
// params: {
// manufacturerName: '',
// supplierType: '',
// useOrgSid: '',
// createOrgSid: '',
// manufacturerTelePhone: '',
// contactName: ''
// },
// current: 1,
// size: 5
// }
// this.init()
},
//
toAdd() {
this.viewState = 2
this.$refs['divadd'].showAdd(this.listQuery.params.createOrgSid)
},
console.log("ua>>>>", this.ua)
// if (this.ua.match(/msie/) != null || this.ua.match(/trident/) != null) {
// this.browserType = "IE";
// this.videoData = JSON.parse(this.$route.query.videoData);
// if (this.videoData.length <= 1) {
// this.iWndowType = 1;
// } else if (this.videoData.length > 1 && this.videoData.length <= 4) {
// this.iWndowType = 2;
// }
// } else {
// this.$notify({
// title: "",
// message: "ie",
// type: "error",
// });
// }
handleSelectionChange(row) {
const aa = []
row.forEach((element) => {
aa.push(element.sid)
})
this.sids = aa
},
mounted() {
this.videoChange();
// ID
doDel() {
if (this.sids.length > 0) {
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.delBySids(this.sids.toString()).then(resp => {
if (resp.success) {
loading.close()
this.$message({ type: 'success', message: resp.msg, showClose: true })
this.getList()
} else {
loading.close()
}
}).catch(e => {
loading.close()
})
}).catch(() => {
})
} else {
this.$message({ type: 'error', message: '没有选择!!', showClose: true })
return
}
},
// toChangShang() {
// req.saveGysByOrgSid(this.listQuery.params.createOrgSid).then((resp) => {
// if (resp.success) {
// this.$message({ showClose: true, type: 'success', message: '' })
// this.getList()
// }
// })
// },
// toGain() {
// req.saveAllByOrgSid({ orgSid: this.listQuery.params.createOrgSid }).then((resp) => {
// if (resp.success) {
// this.$message({ showClose: true, type: 'success', message: '' })
// this.getList()
// }
// })
// },
handleEdit(row) {
this.viewState = 3
this.$refs['divadd'].showEdit(row)
// if (row.supplierTypeValue !== '' && row.supplierTypeValue !== '') {
// this.viewState = 3
// this.$refs['divadd'].showEdit(row)
// } else {
// this.viewState = 5
// this.$refs['divHosts'].showInfo(row)
// }
},
destroyed() {
this.clickStopRealPlay();
this.onLogout();
//
handleCheck(row) {
this.viewState = 4
this.$refs['divinfo'].showInfo(row)
},
methods: {
videoChange() {
// setTimeout(() => {
// this.videoInitPlugin(); // video
// }, 300);
//
// doExport() {
// basefinbankExportExcel(this.sids).then((res) => {
// const blob = new Blob([res], {
// type: 'application/vnd.ms-excel'
// })
// const objectUrl = URL.createObjectURL(blob)
// window.location.href = objectUrl
// this.$notify({
// title: '',
// message: '',
// type: 'success',
// duration: 2000
// })
// })
// },
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
},
toMore() {
this.dialogImage = true
},
checkbox(item) {
// this.departmentTypeArray = this.departmentTypeArray.includes(item.value)
// ? [item.value]
// : []
},
}
}
</script>
WebVideoCtrl.init('1',"100%",'100%')
},
handleSelectionChange() {},
submitForm() {},
cancel() {},
//
async onLogin() {
console.log("onLogin>>>>")
var that = this;
that.loginLoading = true;
//
WebVideoCtrl.I_Login(
that.hkvInfo.ip,
that.iProtocol,
that.hkvInfo.port,
that.hkvInfo.username,
that.hkvInfo.password, {
<style scoped>
/* .app-container{background-color: #f5f5f5;margin: 0;} */
.shipinlisttop {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
/* padding: 0 0 0 15px; */
margin: 20px 0;
background-color: #fff;
box-shadow:0px 0px 10px #E9E9E9;border-radius: 5px;
padding: 10px;
}
.tab-header{background-color: #fff;}
.shipinscon {margin: 20px 0 0 0;
padding: 20px 50px 20px 50px;background-color: #fff;box-shadow:0px 0px 10px #E9E9E9;border-radius: 5px;
}
.shipinstu {z-index: 0;
background: url("/image/cangkutu.png") center bottom no-repeat;
background-size: 100% 100%;min-height: 580px;
padding: 0 20px;position: relative;
}
.shipinstu .jingicon {
font-size: 22px !important;
border-radius: 40px !important;
width: 40px !important;
height: 40px !important;line-height: 40px;
padding: 0px;text-align: center;
async: false,
success: (xmlDoc) => {
console.log("success>>>>")
//TODO
that.getChannelInfo();
that.getDevicePort(that.hkvInfo.ip + "_" + that.hkvInfo.port);
that.loginLoading = false;
this.clickStartRealPlay();
},
error: function(e) {
console.log("error>>>>",e)
that.loginLoading = false;
alert("当前摄像头配置不对或不在线,登录失败");
// window.opener = null;
// window.open('', '_self');
// window.close();
},
}
);
},
// 退
onLogout() {
this.videoData.forEach((element) => {
var szDeviceIdentify = element.ip + "_" + element.port;
var iRet = WebVideoCtrl.I_Logout(szDeviceIdentify);
if (0 == iRet) {
// this.$message({
// showClose: true,
// message: "退",
// type: "success",
// });
} else {
// this.$message({
// showClose: true,
// message: "退",
// type: "error",
// });
}
});
},
clickStartRealPlay() {
console.log("开始预览", this.index);
//
var that = this;
that.startPlayLoading = true;
var szDeviceIdentify = that.hkvInfo.ip + "_" + that.hkvInfo.port;
debugger
that.startRealPlay(szDeviceIdentify, this.index, that.hkvInfo.nvrPrechannel);
that.startPlayLoading = false;
},
startRealPlay(szDeviceIdentify, iWndIndex, iChannelID) {
var that = this;
WebVideoCtrl.I_StartRealPlay(szDeviceIdentify, {
iRtspPort: that.iRtspPort,
iWndIndex: iWndIndex,
iChannelID: iChannelID,
bZeroChannel: that.bZeroChannel,
iStreamType: 2, //2
success: function() {
// that.$notify({
// title: "",
// message: "" + iChannelID + "",
// type: "success",
// });
},
error(status, xmlDoc2) {
console.log(xmlDoc2); //
// that.$notify({
// title: "",
// message: "" + iChannelID + "",
// type: "error",
// });
if (status === 403) {
console.log("szInfo 设备不支持Websocket取流!");
} else {
console.log("开始预览失败 ", status, xmlDoc2);
}
},
});
},
videoInitPlugin() {
this.$nextTick(() => {
var iRet = WebVideoCtrl.I_CheckPluginInstall();
if (iRet === -1) {
// alert("WebComponentsKit.exe");
this.myFunction();
return;
} else {
// if (this.ua.match(/msie/) != null || this.ua.match(/trident/) != null) {
this.browserType = "IE";
this.initPlugin();
// } else {
// this.$notify({
// title: "",
// message: "ie",
// type: "error",
// });
// }
}
}
});
},
myFunction() {
var r = confirm("您还未安装过插件,请下载后查看摄像!");
if (r == true) {
window.location.href = "/WebComponentsKit.exe";
} else {}
},
initPlugin() {
console.log("initPlugin>>>>")
WebVideoCtrl.I_InitPlugin("100%", "100%", {
bWndFull: true, //I_CheckPluginInstall
iWndowType: this.iWndowType, //1x1 2x2
cbInitPluginComplete: function() {
WebVideoCtrl.I_InsertOBJECTPlugin("divPlugin");
//
if (WebVideoCtrl.I_CheckPluginVersion() === -1) {
return;
}
},
});
console.log("for>>>>")
for (var i = 0; i < this.videoData.length; i++) {
.redzibg {
color: #fff; background: radial-gradient(circle, #9c0808, #c50101);
border: 1px solid #eb0606;
}
.bluezibg {
color: #fff;
color: #fff; background: radial-gradient(circle, #2669f1, #327af9);
border: 1px solid #469efd;
}
.shipinstu .jingicona1{position: absolute;top: 10px;left: 1%;}
.shipinstu .jingicona2{position: absolute;top: 10px;left: 40%;}
.shipinstu .jingicona3{position: absolute;top: 10px;left: 70%;}
.shipinstu .jingicona4{position: absolute;top: 10px;left: 95%;}
.shipinstu .jingiconb1{position: absolute;top: 30%;left: 1%;}
.shipinstu .jingiconb2{position: absolute;top: 150px;left: 30%;}
.shipinstu .jingiconb3{position: absolute;top: 150px;left: 50%;}
.shipinstu .jingiconb4{position: absolute;top: 150px;left: 70%;}
.mores{padding: 0 10px;display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;align-items: center;}
.mores .more{flex: 1;font-size: 14px;padding: 0 10px;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;align-items: center;}
.mores .more p {display: inline-block;
font-size: 14px;
}
.mores .more .iconbox {display: inline-block;
border-radius: 30px;
line-height: 30px;
width: 30px;
height: 30px;
color: #fff;
font-size: 18px;text-align: center;margin: 0 5px;
}
.iconbox_red {
background-color: #df2f07;
}
this.hkvInfo = this.videoData[i];
this.index = i;
this.onLogin();
}
},
getDevicePort(szDeviceIdentify) {
var oPort = WebVideoCtrl.I_GetDevicePort(szDeviceIdentify);
this.iRtspPort = oPort.iRtspPort;
},
.iconbox_yellow {
background-color: #ff7521;
}
clickStopRealPlay: function() {
for (var i = 0; i <= this.index; i++) {
setTimeout(this.stopRealPlay(i), 1000);
}
},
stopRealPlay: function(iWndIndex) {
var that = this;
WebVideoCtrl.I_Stop({
iWndIndex: iWndIndex,
success: function() {
// that.$notify({
// title: "",
// message: "" + iWndIndex + "",
// type: "success",
// });
},
error: function() {
// that.$notify({
// title: "",
// message: "" + iWndIndex + "",
// type: "error",
// });
},
});
},
//
getChannelInfo: function() {
var that = this;
var szDeviceIdentify = this.hkvInfo.ip + ":" + this.hkvInfo.port;
//
that.hkvInfo.channels = [];
WebVideoCtrl.I_GetDigitalChannelInfo(szDeviceIdentify, {
async: false,
mysuccess: function(xmlStr) {
console.log("mysuccess I_GetDigitalChannelInfo: ", xmlStr);
var jsonObj = that.$x2js.xml2js(xmlStr);
var list = jsonObj.InputProxyChannelStatusList.InputProxyChannelStatus;
for (var x = 0; x < list.length; x++) {
that.hkvInfo.channels.push(list[x].id);
}
},
success: function(xmlDoc) {},
error: function(status, xmlDoc) {
console.log("获取数字通道失败");
},
});
//
WebVideoCtrl.I_GetAnalogChannelInfo(szDeviceIdentify, {
async: false,
mysuccess: function(xmlStr) {
var jsonObj = that.$x2js.xml2js(xmlStr);
console.log("模拟通道mysuccess", xmlStr);
var id = jsonObj.VideoInputChannelList.VideoInputChannel.id;
that.hkvInfo.channels.push(id);
},
success: function(xmlStr) {
console.log("模拟通道success", xmlStr);
},
error: function(status, xmlDoc) {
console.log("模拟通道error", xmlDoc);
},
});
// TODO
},
},
};
</script>
<style scoped>
.video_box {
width: 100%;
height: 100%;
}
.plugin {
width: 100%;
height: 100%;
}
.iconbox_green {
background-color: #07C160;
}
.iconbox_blue {
background-color: #3f9bfa;
}
.iconbox_hui {
background-color: #373739;
}
.huizi{color: #373739;}
.my-tag {
margin-left: 3px;
}
.my-group-btn {
margin-top: 5px;
}
/* // 底部导航 */
.tabhead {
position: fixed;
bottom: 50px;
left: 230px;
z-index: 900;
/* background-color: rgba( #04154d, 0.8); */
/* box-shadow: 0px 0px 6px #0d27c2; */
}
.iconfontyuan {
font-size: 18px !important;
margin: 0 3px 0 3px;
border-radius: 60px !important;
width: 60px !important;
height: 60px !important;
padding: 5px;
}
.yellowziyuan {
color: #fff;
background-color: #f57c13;
}
.redziyuan {
color: #fff;
background-color: #ff0000;
}
.blueziyuan {
color: #fff;
background-color: #5b9cf7;
}
.greenziyuan {
color: #fff;
background-color: #06be4d;
}
.ziziyuan {
color: #fff;
background-color: #683afd;
}
/* // .tabhead .bar{background-color: #0b5394;color: #f5f7fa;border-right: 1px solid #fff;padding: 11px 0;text-align: center;display: inline-block;vertical-align: top;
// width: calc((100% - 1px) / 4 );box-sizing: border-box;font-size:18px;}
// .tabhead .bar:last-of-type{border-right: 0px solid #eeeeee;width: calc((100% - 0px) / 4 );}
// .tabhead .barb {background-color: #fff;color: #0b5394;} */
</style>

606
src/views/renlianshibie/renlianshibieList.vue

@ -0,0 +1,606 @@
<template>
<div class="app-container">
<div v-show="viewState == 1">
<button-bar view-title="人脸识别" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle"/>
<div class="main-content">
<div class="tops">
<!-- 第1个 -->
<div class="topbox">
<div class="toptitle">
<span class="icon myiconfont iconbox greenzi">&#xe608;</span>
<p>人员类型统计</p>
</div>
<div class="mids">
<div class="note"><span class="bluezi">360</span>路人</div>
<div class="note"><span class="yellowzi">360</span>工作人员</div>
<div class="note"><span class="redzi">360</span>路人</div>
</div>
</div>
<!-- 第2个 -->
<div class="topbox">
<div class="toptitle iconbox_red">
<span class="icon myiconfont iconbox redzi">&#xe627;</span>
<p>重点关注人员</p>
</div>
<div class="mids rensnote">
<!-- <div class="rensnote"> -->
<span class="tit">图库照</span>
<img class="rentu" src="../../../public/image/ren1.jpg" alt="">
<div class="yuans">
<p>98%</p><span>相似度</span>
</div>
<span class="tit">图库照</span>
<img class="rentu" src="../../../public/image/ren2.jpg" alt="">
<div class="rightzi">
<p>位置东门出口</p>
<p>日期2022-05-16</p>
<p>时间182636</p>
<p class="redzi">事件重点关注人员</p>
<p>姓名刘小明</p>
</div>
<!-- </div> -->
</div>
</div>
<!-- 11 -->
</div>
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button>
<div v-show="isSearchShow" class="search">
<el-form ref="listQueryform" :inline="true" :model="listQuery" label-width="110px" class="tab-header">
<el-form-item label="人员姓名">
<el-input v-model="listQuery.params.manufacturerName" clearable placeholder="" class="addinputw"></el-input>
</el-form-item>
<el-form-item label="选择楼层">
<el-select v-model="listQuery.params.supplierType" filterable clearable placeholder="请选择楼层">
<el-option v-for="item in supplierType_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/>
</el-select>
</el-form-item>
<!-- <el-form-item label="厂商办公电话">
<el-input v-model="listQuery.params.manufacturerTelePhone" maxlength="130" placeholder="" class="addinputw" clearable/>
</el-form-item>
<el-form-item label="联系人">
<el-input v-model="listQuery.params.contactName" maxlength="125" placeholder="" class="addinputw" clearable/>
</el-form-item> -->
</el-form>
<div class="btn">
<el-button type="primary" icon="el-icon-search" size="small" @click="handleFilter">查询</el-button>
<el-button type="primary" icon="el-icon-refresh" size="small" @click="handleReset">重置</el-button>
</div>
</div>
</div>
<div class="listtop">
<div class="tit">人脸识别信息列表</div>
<!-- 翻页分页 -->
<pageye v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
</div>
<div class="renlianlists">
<!-- 第3行 -->
<div class="con">
<!-- 第1 -->
<div class="news" v-for="(item, index) in Datalista" :key="index">
<div class="title">
<div class="more myiconfont" @click="toMore()">&#xe682;</div>
<div class="newstits">{{item.xiaoqu}}</div>
</div>
<div class="contents">
<div class="newsli">
<div class="tu"><img :src="item.tuUrl" alt="" /></div>
<div class="rightwen">
<div class="tit">位置{{item.weizhi}}</div>
<div class="time">日期{{item.createTime}}</div>
<div class="time">时间{{item.createTime2}}</div>
<div class="time">事件{{item.shijian}}</div>
<div class="time">姓名{{item.name}}</div>
</div>
</div>
</div>
</div>
</div>
<!-- 列表结束 -->
</div>
<div class="pages">
<!-- 翻页 -->
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
</div>
</div>
</div>
<!-- 查看视频 -->
<el-dialog v-el-drag-dialog title="查看视频" :visible.sync="dialogImage" width="800px">
<div class="shipin">
<video :preload="preload" autoplay :height="height" :width="width" align="center" :controls="controls">
<source :src="videoSrc" type="video/mp4">
</video>
</div>
</el-dialog>
</div>
</template>
<script>
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import ButtonBar from '@/components/ButtonBar'
// import { typeValues, getOrgSidByPath } from '@/api/cheliang/dictcommons'
// import baojingchaxunAdd from './baojingchaxunAdd'
// import baojingchaxunInfo from './baojingchaxunInfo'
// import req from '@/api/baojingchaxun/baojingchaxun'
export default {
name: 'baojingchaxunList',
components: {
Pagination,
pageye,
ButtonBar
},
data() {
return {
btndisabled: false,
btnList: [
// {
// type: 'primary',
// size: 'small',
// icon: 'plus',
// btnKey: 'toAdd',
// btnLabel: ''
// },
// {
// type: 'danger',
// size: 'small',
// icon: 'del',
// btnKey: 'doDel',
// btnLabel: ''
// },
// {
// type: 'primary',
// size: 'small',
// icon: '',
// btnKey: 'toChangShang',
// btnLabel: ''
// },
// {
// type: 'primary',
// size: 'small',
// icon: '',
// btnKey: 'toGain',
// btnLabel: ''
// },
// {
// type: 'success',
// size: 'small',
// icon: 'export',
// btnKey: 'build',
// btnLabel: ''
// },
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
viewState: 1,
isSearchShow: false,
searchxianshitit: '显示查询条件',
sids: [],
// -----------
tableKey: 0,
list: [{bianma:'212233433',supplierTypeValue:'222',weizhi:'212233433',time:'2023-02-26',anzhuangtime:'2023-02-26',gonghuashang:'222'
,supplierTypeValue:'222',zhuangtai:'222'}
],
listLoading: false,
listQuery: {
params: {
manufacturerName: '',
supplierType: '',
useOrgSid: '',
createOrgSid: '',
manufacturerTelePhone: '',
contactName: ''
},
current: 1,
size: 5,
total: 0
},
supplierType_list: [],
Datalista: [
{xiaoqu:'和平家园小区南门出口',tuUrl:'./image/ren1.jpg', weizhi: '南门出口', createTime: '2023-05-03', createTime2: '18:26:38', shijian: '社区户主', name: '李明华' },
{xiaoqu:'和平家园小区东门出口',tuUrl:'./image/ren2.jpg', weizhi: '东门出口', createTime: '2023-05-08', createTime2: '18:26:38', shijian: '社区户主', name: '李明华' },
{xiaoqu:'和平家园小区西门出口',tuUrl:'./image/ren1.jpg', weizhi: '西门出口', createTime: '2023-05-12', createTime2: '19:32:38', shijian: '社区户主', name: '李明华' },
{xiaoqu:'和平家园小区东门出口',tuUrl:'./image/ren2.jpg', weizhi: '东门出口', createTime: '2023-05-23', createTime2: '18:26:38', shijian: '社区户主', name: '李明华' },
{xiaoqu:'和平家园小区南门出口',tuUrl:'./image/ren1.jpg', weizhi: '南门出口', createTime: '2023-05-03', createTime2: '18:26:38', shijian: '社区户主', name: '李明华' },
{xiaoqu:'和平家园小区东门出口',tuUrl:'./image/ren2.jpg', weizhi: '东门出口', createTime: '2023-05-08', createTime2: '18:26:38', shijian: '社区户主', name: '李明华' },
{xiaoqu:'和平家园小区西门出口',tuUrl:'./image/ren1.jpg', weizhi: '西门出口', createTime: '2023-05-12', createTime2: '19:32:38', shijian: '社区户主', name: '李明华' },
{xiaoqu:'和平家园小区东门出口',tuUrl:'./image/ren2.jpg', weizhi: '东门出口', createTime: '2023-05-23', createTime2: '18:26:38', shijian: '社区户主', name: '李明华' },
],
dialogImage: false,
//
videoSrc: '../../../image/cangkushipin.mp4',
playStatus: '',
muteStatus: '',
isMute: true,
isPlay: true,
width: '100%', //
height: '430', //
preload: 'auto', // <video>
controls: true, // 使autoplayPlayer API
autoplay: true,
//
rules: {}
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
//
// this.init()
},
methods: {
resetState() {
this.viewState = 1
},
btnHandle(btnKey) {
console.log('XXXXXXXXXXXXXXX ' + btnKey)
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'doDel':
this.doDel()
break
case 'toChangShang':
this.toChangShang()
break
case 'toGain':
this.toGain()
break
case 'doExport':
this.doExport()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
// init() {
// getOrgSidByPath({ orgPath: window.sessionStorage.getItem('defaultOrgPath') }).then((res) => {
// if (res.success) {
// this.listQuery.params.createOrgSid = res.data
// this.getType()
// this.getList()
// }
// })
// },
// getType() {
// typeValues({
// type: 'supplierType'
// }).then((res) => {
// if (res.code === '200') {
// this.supplierType_list = res.data
// console.log('', this.supplierType_list)
// }
// })
// },
//
indexMethod(index) {
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
var pageindex = index + 1 + pagestart
return pageindex
},
//
getList() {
// this.listLoading = true
// req.gysPagerList(this.listQuery).then((response) => {
// this.listLoading = false
// if (response.code === '200' && response.data && response.data.total > 0) {
// this.list = response.data.records
// this.listQuery.total = response.data.total
// } else {
// this.list = []
// this.listQuery.total = 0
// }
// })
},
//
handleFilter() {
this.listQuery.current = 1
this.getList()
},
handleReset() {
// this.listQuery = {
// params: {
// manufacturerName: '',
// supplierType: '',
// useOrgSid: '',
// createOrgSid: '',
// manufacturerTelePhone: '',
// contactName: ''
// },
// current: 1,
// size: 5
// }
// this.init()
},
//
toAdd() {
this.viewState = 2
this.$refs['divadd'].showAdd(this.listQuery.params.createOrgSid)
},
handleSelectionChange(row) {
const aa = []
row.forEach((element) => {
aa.push(element.sid)
})
this.sids = aa
},
// ID
doDel() {
if (this.sids.length > 0) {
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.delBySids(this.sids.toString()).then(resp => {
if (resp.success) {
loading.close()
this.$message({ type: 'success', message: resp.msg, showClose: true })
this.getList()
} else {
loading.close()
}
}).catch(e => {
loading.close()
})
}).catch(() => {
})
} else {
this.$message({ type: 'error', message: '没有选择!!', showClose: true })
return
}
},
// toChangShang() {
// req.saveGysByOrgSid(this.listQuery.params.createOrgSid).then((resp) => {
// if (resp.success) {
// this.$message({ showClose: true, type: 'success', message: '' })
// this.getList()
// }
// })
// },
// toGain() {
// req.saveAllByOrgSid({ orgSid: this.listQuery.params.createOrgSid }).then((resp) => {
// if (resp.success) {
// this.$message({ showClose: true, type: 'success', message: '' })
// this.getList()
// }
// })
// },
handleEdit(row) {
this.viewState = 3
this.$refs['divadd'].showEdit(row)
// if (row.supplierTypeValue !== '' && row.supplierTypeValue !== '') {
// this.viewState = 3
// this.$refs['divadd'].showEdit(row)
// } else {
// this.viewState = 5
// this.$refs['divHosts'].showInfo(row)
// }
},
//
handleCheck(row) {
this.viewState = 4
this.$refs['divinfo'].showInfo(row)
},
//
// doExport() {
// basefinbankExportExcel(this.sids).then((res) => {
// const blob = new Blob([res], {
// type: 'application/vnd.ms-excel'
// })
// const objectUrl = URL.createObjectURL(blob)
// window.location.href = objectUrl
// this.$notify({
// title: '',
// message: '',
// type: 'success',
// duration: 2000
// })
// })
// },
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
},
toMore() {
this.dialogImage = true
}
}
}
</script>
<style scoped>
.rensnote{padding: 10px 30px; display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: space-around;align-items: center;}
.rensnote .tit{padding: 0;width: 20px;color: #8e8e8e;}
.rensnote .rentu{padding: 0;width: 80px;height: 80px;border-radius: 5px;border: 1px solid #ff2424;margin: 0 20px;}
.rensnote .yuans{padding: 0;margin: 0 20px;width: 80px;height: 80px;border-radius: 80px;border: 1px solid #ff2424;text-align: center;}
.rensnote .yuans p{padding: 13px 0 3px 0;color: #ff2424;font-size: 26px;margin: 0;}
.rensnote .yuans span{padding: 0;margin: 0;color: #8e8e8e;font-size: 14px;}
.rensnote .rightzi{padding: 0 10px;color: #8e8e8e;text-align: left;}
.rensnote .rightzi p{padding: 1px 0;color: #8e8e8e;font-size: 12px;margin: 0;}
.tops {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;align-items: flex-start;
padding: 0px;
margin: 20px 0;
}
.tops .topbox {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;align-items: flex-start;
width: 50%;
margin: 0 20px 0 0;
background-color: #fff;
box-shadow:0px 0px 10px #E9E9E9;border-radius: 5px;
padding: 0px;
}
.tops .topbox:last-of-type {
margin: 0;
}
.tops .topbox .toptitle {width: 140px;background-color: #e8feed;
font-size: 20px;
padding: 10px 10px;margin: 0 auto;
}
.tops .topbox .toptitle span{display: block;
padding: 0px 10px;margin: 0 auto;font-size: 36px !important;
/* font-weight: bold; font-size: 16px; */
}
.iconbox {
/* border-radius: 10px;
line-height: 80px;
width: 80px;
height: 80px;
color: #fff; */
font-size: 36px !important;text-align: center;
}
.tops .topbox .toptitle p{
padding: 0px 10px;
color: #333;font-size: 14px;
}
.tops .topbox .mids {flex: 1;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: space-between;align-items: center;
/* margin: 0 auto;text-align: center;
padding: 0px ; */
}
.tops .topbox .mids .note {margin: 0 auto;text-align: center;
color: #333;
font-size: 14px;
padding: 16px 0 0px 0;
}
.tops .topbox .mids .note span {
font-size: 32px;display: block;
padding: 3px 0px;
}
.iconbox_red {
background-color: #ffe9e9 !important;
}
.con {
padding: 20px 0;background-color: #fff;
}
.news {display: inline-block;
width: calc(25% - 20px);
margin: 10px 10px;
background-color: #fff;
box-shadow:0px 0px 10px #E9E9E9;border-radius: 5px;
padding: 0px;
}
/* .news:nth-of-type(4n) {
margin: 0 !important;
} */
.news:nth-of-type(4n) { width: calc(25% - 10px);
margin: 10px 0 10px 10px;
}
.news:nth-of-type(4n - 3) {width: calc(25% - 10px);
margin: 10px 10px 10px 0px;
}
.news .title {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: space-around;
align-items: center;
padding: 3px 10px 3px 20px;text-align: center;
border-bottom: 1px solid #ececee;background-color: #f7f9fb;
}
.news .title .newstits {text-align: left;flex: 1;
font-weight: bold; color: #333;font-size: 16px;
}
.news .title .more {width: 80px;
cursor: pointer;color: #519deb;font-size: 28px;
}
.news .contents {
padding: 10px 0;
/* height: 210px;
overflow: hidden; */
}
.news .contents .newsli {display: inline-block;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: space-between;
margin: 0px 0px;
padding: 5px 10px;
/* border-bottom: 1px solid #ececee; */
}
.news .contents .newsli .tu {
padding: 0px 0 0 0;
width: 120px;height: 120px;border-radius: 5px;border: 1px solid #f5f5f5;
}
.news .contents .newsli .tu img {
width: 100%;height: 100%;border-radius: 5px;border: 1px solid #f5f5f5;
}
.news .contents .newsli .rightwen {
padding: 0px 0 0 20px;
flex: 3;
}
.news .contents .newsli .rightwen .tit {
padding: 3px 0;
font-size: 14px;font-weight: bold;
/* height: 25px;
overflow: hidden;
line-height: 25px; */
}
/* .news .contents .newsli .tel{padding: 10px 0;color: #84d1f5;flex: 1;text-align: center;} */
.news .contents .newsli .rightwen .time {
padding: 3px 0;
color: #848383;
font-size: 14px;
/* height: 25px;
line-height: 25px; */
}
</style>
Loading…
Cancel
Save