Commit 9d4fab04 by 夏新然

交接

1 parent 85f4750f
No preview for this file type
...@@ -4558,11 +4558,11 @@ ...@@ -4558,11 +4558,11 @@
} }
}, },
"echarts": { "echarts": {
"version": "4.2.1", "version": "4.7.0",
"resolved": "https://registry.npmjs.org/echarts/-/echarts-4.2.1.tgz", "resolved": "https://registry.npm.taobao.org/echarts/download/echarts-4.7.0.tgz",
"integrity": "sha512-pw4xScRPsLegD/cqEcoXRKeA2SD4+s+Kyo0Na166NamOWhzNl2yI5RZ2rE97tBlAopNmhyMeBVpAeD5qb+ee1A==", "integrity": "sha1-Wzh1pML5HjkpQl+rq56s5+QJiz8=",
"requires": { "requires": {
"zrender": "4.0.7" "zrender": "4.3.0"
} }
}, },
"editorconfig": { "editorconfig": {
...@@ -15626,9 +15626,9 @@ ...@@ -15626,9 +15626,9 @@
} }
}, },
"zrender": { "zrender": {
"version": "4.0.7", "version": "4.3.0",
"resolved": "https://registry.npmjs.org/zrender/-/zrender-4.0.7.tgz", "resolved": "https://registry.npm.taobao.org/zrender/download/zrender-4.3.0.tgz",
"integrity": "sha512-TNloHe0ums6zxbHfnaCryM61J4IWDajZwNq6dHk9vfWhhysO/OeFvvR0drBs/nbXha2YxSzfQj2FiCd6RVBe+Q==" "integrity": "sha1-nwVhIbILuuREFNKHv2oRn/cEJmE="
} }
} }
} }
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
"axios": "^0.18.0", "axios": "^0.18.0",
"babel-polyfill": "^6.26.0", "babel-polyfill": "^6.26.0",
"cssnano": "^4.1.10", "cssnano": "^4.1.10",
"echarts": "^4.2.1", "echarts": "^4.7.0",
"element-ui": "^2.8.2", "element-ui": "^2.8.2",
"file-saver": "^2.0.2", "file-saver": "^2.0.2",
"ol": "^6.0.0", "ol": "^6.0.0",
......
...@@ -33,4 +33,54 @@ export default { ...@@ -33,4 +33,54 @@ export default {
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
color: #fff; color: #fff;
} }
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
width: 120px;
}
.avatar-uploader .el-upload:hover {
border-color: #409EFF;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 120px;
height: 120px;
line-height: 120px!important;
text-align: center;
}
.avatar {
width: 120px;
height: 120px;
display: block;
}
.chartTitle{
position: absolute;
color: #444;
padding-right: 20px;
left: 26px;
top: 16px;
font-weight: 400;
font-size: 18px;
}
.chartBox{
position: relative;
margin-bottom: 20px;
background: #fff;
border-radius: 6px;
}
.radioBox{
position: absolute;
font-size: 13px;
z-index: 1;
left: 50%;
top: 16px;
transform: translateX(-50%);
}
.noBackGround{
background: none!important;
}
</style> </style>
...@@ -7,7 +7,6 @@ import axios from './util/http' ...@@ -7,7 +7,6 @@ import axios from './util/http'
import store from './store/index.js' import store from './store/index.js'
import * as API from './util/api' import * as API from './util/api'
import { faceapi } from './util/initApi' import { faceapi } from './util/initApi'
import './util/permission'
import './util/vproto' import './util/vproto'
import ElementUI from 'element-ui' import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css' import 'element-ui/lib/theme-chalk/index.css'
...@@ -22,6 +21,7 @@ import VuePhotoZoomPro from 'vue-photo-zoom-pro' ...@@ -22,6 +21,7 @@ import VuePhotoZoomPro from 'vue-photo-zoom-pro'
import VideoPlayer from 'vue-video-player' import VideoPlayer from 'vue-video-player'
import { Loading } from 'element-ui' import { Loading } from 'element-ui'
import echarts from 'echarts' import echarts from 'echarts'
import common from './util/common.js'
require('video.js/dist/video-js.css') require('video.js/dist/video-js.css')
require('vue-video-player/src/custom-theme.css') require('vue-video-player/src/custom-theme.css')
...@@ -30,6 +30,8 @@ Vue.use(VideoPlayer) ...@@ -30,6 +30,8 @@ Vue.use(VideoPlayer)
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.prototype.axios = axios; Vue.prototype.axios = axios;
Vue.prototype.API = API; Vue.prototype.API = API;
Vue.prototype.common = common;
Vue.use(ElementUI); Vue.use(ElementUI);
Vue.use(selecttree); Vue.use(selecttree);
//--图片放大 //--图片放大
...@@ -39,6 +41,11 @@ Vue.prototype.loading = Loading; ...@@ -39,6 +41,11 @@ Vue.prototype.loading = Loading;
Vue.prototype.$echarts = echarts; Vue.prototype.$echarts = echarts;
Vue.prototype.faceapi = faceapi; Vue.prototype.faceapi = faceapi;
let localRoutes = localStorage.getItem('menuArr');
if(localRoutes){
store.dispatch("GetMenuRole", JSON.parse(localRoutes))
.then(res => {});
}
let vue = new Vue({ let vue = new Vue({
el: '#app', el: '#app',
router, router,
...@@ -46,4 +53,3 @@ let vue = new Vue({ ...@@ -46,4 +53,3 @@ let vue = new Vue({
components: { App }, components: { App },
template: '<App/>' template: '<App/>'
}) })
...@@ -46,22 +46,49 @@ export const constantRouterMap = [{ ...@@ -46,22 +46,49 @@ export const constantRouterMap = [{
/** /**
* 异步路由 * 异步路由
*/ */
export const asyncRouterMap = [{ export const asyncRouterMap = [
path: '/monitor', {
name: '实时视频', path: '/monitor',
component: reslove => require(['@/views/layout'], reslove), name: '报表统计',
meta: { component: reslove => require(['@/views/layout'], reslove),
icon: 'gy-icon-jianguan' meta: {
icon: 'gy-icon-jianguan'
},
children: [
{
path: '/monitor/show',
name: '报表展示',
component: reslove => require(['@/views/report/show'], reslove),
},
{
path: '/monitor/static',
name: '基础统计',
component: reslove => require(['@/views/report/static'], reslove),
},
{
path: '/monitor/timeflow',
name: '时段客流分布',
component: reslove => require(['@/views/report/timeflow'], reslove),
}
]
}, },
children: [ // {
{ // path: '/monitor',
path: '/system/playvideo', // name: '实时视频',
name: '实时视频', // component: reslove => require(['@/views/layout'], reslove),
component: reslove => require(['@/views/videos/playvideo'], reslove), // meta: {
} // icon: 'gy-icon-jianguan'
] // },
},{ // children: [
path: '/enforcelaw/config', // {
// path: '/system/playvideo',
// name: '实时视频',
// component: reslove => require(['@/views/videos/playvideo'], reslove),
// }
// ]
// },
{
path: '/system/playvideo',
name: '数据检索', name: '数据检索',
meta: { meta: {
icon: 'el-icon-search' icon: 'el-icon-search'
...@@ -72,29 +99,10 @@ export const asyncRouterMap = [{ ...@@ -72,29 +99,10 @@ export const asyncRouterMap = [{
name: '抓拍记录', name: '抓拍记录',
component: reslove => require(['@/views/Search/FilmedRecords'], reslove), component: reslove => require(['@/views/Search/FilmedRecords'], reslove),
}, },
{
path: '/search/pices',
name: '以图搜图',
component: reslove => require(['@/views/Search/Searchpic'], reslove),
}, {
path: '/search/dbs',
name: '人口库管理',
component: reslove => require(['@/views/Search/facedb/database'], reslove),
}
]
},
{
path: '/activity',
name: '活动状态',
meta: {
icon: 'el-icon-map-location'
},
component: reslove => require(['@/views/layout'], reslove),
children: [
// { // {
// path: '/activity/status', // path: '/search/pices',
// name: '轨迹查询', // name: '以图搜图',
// component: reslove => require(['@/views/activity/status'], reslove), // component: reslove => require(['@/views/Search/Searchpic'], reslove),
// }, // },
{ {
path: '/activity/report', path: '/activity/report',
...@@ -102,7 +110,28 @@ export const asyncRouterMap = [{ ...@@ -102,7 +110,28 @@ export const asyncRouterMap = [{
component: reslove => require(['@/views/activity/report'], reslove), component: reslove => require(['@/views/activity/report'], reslove),
} }
] ]
},{ },
// {
// path: '/activity',
// name: '活动状态',
// meta: {
// icon: 'el-icon-map-location'
// },
// component: reslove => require(['@/views/layout'], reslove),
// children: [
// // {
// // path: '/activity/status',
// // name: '轨迹查询',
// // component: reslove => require(['@/views/activity/status'], reslove),
// // },
// {
// path: '/activity/report',
// name: '状态报表',
// component: reslove => require(['@/views/activity/report'], reslove),
// }
// ]
// },
{
path: '/equipment', path: '/equipment',
name: '设备管理', name: '设备管理',
component: reslove => require(['@/views/layout'], reslove), component: reslove => require(['@/views/layout'], reslove),
...@@ -113,12 +142,14 @@ export const asyncRouterMap = [{ ...@@ -113,12 +142,14 @@ export const asyncRouterMap = [{
path: '/equipment/org', path: '/equipment/org',
name: '组织机构管理', name: '组织机构管理',
component: reslove => require(['@/views/Equipment/org.vue'], reslove), component: reslove => require(['@/views/Equipment/org.vue'], reslove),
},{
path: '/equipment/vchan',
name: '相机配置',
component: reslove => require(['@/views/Equipment/vchan.vue'], reslove),
} }
// ,{ // ,{
// path: '/equipment/vchan',
// name: '相机配置',
// component: reslove => require(['@/views/Equipment/vchan.vue'], reslove),
// },
// ,{
// path: '/equipment/dev', // path: '/equipment/dev',
// name: '设备状态', // name: '设备状态',
// component: reslove => require(['@/views/Equipment/dev.vue'], reslove), // component: reslove => require(['@/views/Equipment/dev.vue'], reslove),
...@@ -140,11 +171,18 @@ export const asyncRouterMap = [{ ...@@ -140,11 +171,18 @@ export const asyncRouterMap = [{
path: '/system/role', path: '/system/role',
name: '角色管理', name: '角色管理',
component: reslove => require(['@/views/System/role'], reslove), component: reslove => require(['@/views/System/role'], reslove),
},{ },
path: '/system/setting', // {
name: '其他配置', // path: '/system/setting',
component: reslove => require(['@/views/System/Setting'], reslove), // name: '其他配置',
// component: reslove => require(['@/views/System/Setting'], reslove),
// },
{
path: '/search/dbs',
name: '人口库管理',
component: reslove => require(['@/views/Search/facedb/database'], reslove),
} }
] ]
} }
] ]
......
...@@ -7,7 +7,7 @@ const info = { ...@@ -7,7 +7,7 @@ const info = {
org:[], org:[],
address:[], address:[],
facedbdata:[], facedbdata:[],
province:[] province:[],
}, },
mutations:{ mutations:{
SET_DEV: (state, dev) => { SET_DEV: (state, dev) => {
......
import axios from '../../util/http' import {asyncRouterMap, constantRouterMap } from '@/router/index.js'
import {asyncRouterMap, constantRouterMap } from '@/router' import defultrouter from "@/router/index.js";
import {url} from '../../util/api'
/**
* 获取路由列表
*/
function getMenuInfo(token) {
return new Promise((reslove, reject) =>{
axios.get(url + "/auth/apps/" + '23660e5593563b27832c2b8f490b458e' + "/menus?shape=list").then(response => {
reslove(response);
})
});
}
/**
* cyl add
* 用于判断父级菜单是否有子级菜单被选中
* 如果有,那么该父节菜单也需要选中
*/
function existsChildren(router,roles){
for(let i = 0; i < roles.length; i++){
for(let k = 0; k < router.children.length; k++){
if(router.children[k].children && router.children[k].children.length>0){
existsChildren(router.children[k],roles);
}else{
if(roles[i].path === router.children[k].path){
return true;
}
}
}
}
return false;
}
/** /**
* 判断是否有权限 * 判断是否有权限
...@@ -38,22 +8,22 @@ function existsChildren(router,roles){ ...@@ -38,22 +8,22 @@ function existsChildren(router,roles){
* @param {*} roles * @param {*} roles
*/ */
function hasPerminssion(router, roles) { function hasPerminssion(router, roles) {
if(router.children && router.children.length>0){ if (router.children && router.children.length > 0) {
if(existsChildren(router,roles)){ if (existsChildren(router, roles)) {
return true; return true;
} }
} }
let status = false let status = false;
// let status = true // let status = true
if (roles) { if (roles) {
for(let i = 0; i < roles.length; i++){ for (let i = 0; i < roles.length; i++) {
if(roles[i].path === router.path){ if (roles[i].path === router.path) {
status = true; status = true;
break; break;
} }
} }
} }
return status return status;
} }
/** /**
...@@ -63,87 +33,53 @@ function hasPerminssion(router, roles) { ...@@ -63,87 +33,53 @@ function hasPerminssion(router, roles) {
* @param {*} roles * @param {*} roles
*/ */
function filterAsyncRouter(asyncRouterMap, roles) { function filterAsyncRouter(asyncRouterMap, roles) {
const newData = []; var newData = [];
// return routers // return routers
asyncRouterMap.forEach(ele => { asyncRouterMap.forEach((ele, index) => {
let obj = {}; roles.map(m => {
if (hasPerminssion(ele, roles)) { if (ele.path == m.path) {
obj['path'] = ele.path; let obj = ele;
obj['name'] = ele.name; if (m.children && m.children.length > 0) {
obj['meta'] = ele.meta || {} obj.children = filterAsyncRouter(ele.children, m.children);
obj['component'] = ele.component; } else {
if (ele.children && ele.children.length > 0) { obj.children = []
obj['children'] = filterAsyncRouter(ele.children, roles) }
} else { newData.push(obj);
obj['children'] = []
} }
} else { });
return false
}
newData.push(obj)
}); });
return newData return newData;
}
/**
* 根据路由和当前跳转key(路由路径)
* 获取第三级路由
* @param {*} router
* @param {*} key
*/
function filterTwoMenu(router, key) {
let data = [],
state = true;
router.forEach(e => {
if(e.path == key)
if(e.children) {
data = e.children
} else {
data = [];
}
})
return data;
} }
const menu = { const menu = {
state: { state: {
routers: constantRouterMap, routers: constantRouterMap,
addRouter: [], addRouter: [],
threeMenu:[], threeMenu: []
}, },
mutations:{ mutations: {
SET_ROUTERS: (state, routers) => { SET_ROUTERS: (state, routers) => {
state.addRouter = routers; state.addRouter = routers;
state.routers = constantRouterMap.concat(routers); state.routers = constantRouterMap.concat(routers);
defultrouter.addRoutes(routers); //合并路由
}, },
SET_THREEMENU: (state, routers) => { SET_THREEMENU: (state, routers) => {
state.threeMenu = routers; state.threeMenu = routers;
} }
}, },
actions: { actions: {
GetMenuRole({ commit, state},data) { GetMenuRole({ commit, state }, data) {
if (data === ''){ if (data === "") {
commit('SET_ROUTERS', []); commit("SET_ROUTERS", []);
return return;
} else {
console.log('aaa',data)
let accessedRouters = filterAsyncRouter(asyncRouterMap, data);
console.log(accessedRouters)
commit("SET_ROUTERS", accessedRouters);
} }
return new Promise((resolve, reject) => {
getMenuInfo().then(response => {
let accessedRouters = filterAsyncRouter(asyncRouterMap,response.data.list_data);
// commit('SET_ROUTERS', accessedRouters);
commit('SET_ROUTERS', accessedRouters);
resolve(accessedRouters);
})
})
},
GetTwoMenu({commit, state},data) {
return new Promise((reslove,reject) => {
const tmenus = filterTwoMenu(state.routers, data);
commit('SET_THREEMENU', tmenus);
reslove(tmenus);
})
} }
}, }
} };
export default menu export default menu;
...@@ -3,19 +3,22 @@ ...@@ -3,19 +3,22 @@
// export let url = 'http://52.1.113.109:20080/api/v1' // export let url = 'http://52.1.113.109:20080/api/v1'
export let IP = location.host export let IP = location.host
if (IP.indexOf('9.161') > -1 ||IP.indexOf('localhost')) { if (IP.indexOf('9.161') > -1 ||IP.indexOf('localhost')) {
IP = '192.168.9.208:20080' // IP = 'https://store.keliuyun.com/report'
// IP="/report"
} }
export let url = `http://${IP}/api/v1` IP="/report"
export let menus = `${url}/auth/apps/23660e5593563b27832c2b8f490b458e/menus` export let url = `${IP}`
export let menus = `${url}/auth/api/auth/apps/23660e5593563b27832c2b8f490b458e/menus`
let timer = ()=>{ let timer = ()=>{
return new Date().getTime() return new Date().getTime()
} }
export let auth = { export let auth = {
login: `${url}/auth/users/login`, login: `${url}/users/login`,
user: `${url}/auth/users`, accountid:`${url}/accounts`,
user: `${url}/users`,
edituser(userid){ edituser(userid){
return `${url}/auth/users/${userid}` return `${url}/users/${userid}`
}, },
role: `${url}/auth/roles`, role: `${url}/auth/roles`,
editrole (roleid){ editrole (roleid){
...@@ -65,3 +68,5 @@ export let org = { ...@@ -65,3 +68,5 @@ export let org = {
} }
export let faceweb = `${url}/face_web` export let faceweb = `${url}/face_web`
// export let picUrl ="https://vion-retail.oss-cn-beijing.aliyuncs.com/"
export let picUrl ="http://192.168.9.239/"
...@@ -52,8 +52,8 @@ function formatterMoreInfo(value, options) { ...@@ -52,8 +52,8 @@ function formatterMoreInfo(value, options) {
} }
/** /**
* 对部分枚举可能值是0开头的,但是表数据不规范的时候,导致01变为1这种情况进行解决 * 对部分枚举可能值是0开头的,但是表数据不规范的时候,导致01变为1这种情况进行解决
* @param {} value * @param {} value
* @param {*} options * @param {*} options
*/ */
function formatterInfoChangInt(value, options) { function formatterInfoChangInt(value, options) {
if(value==null || value==""){ if(value==null || value==""){
...@@ -71,7 +71,7 @@ function formatterInfoChangInt(value, options) { ...@@ -71,7 +71,7 @@ function formatterInfoChangInt(value, options) {
/** /**
* 处理图片访问地址的,目的是解决谷歌高版本浏览器不支持ftp协议 * 处理图片访问地址的,目的是解决谷歌高版本浏览器不支持ftp协议
* @param {*} path * @param {*} path
*/ */
function imgPathAnalysis(serip,path){ function imgPathAnalysis(serip,path){
if(path !=null && path != "" && path.length > 10){ if(path !=null && path != "" && path.length > 10){
...@@ -86,7 +86,7 @@ function imgPathAnalysis(serip,path){ ...@@ -86,7 +86,7 @@ function imgPathAnalysis(serip,path){
} }
} }
function formatDate(date, fmt) { function formatDateFun(date, fmt) {
if (/(y+)/.test(fmt)) { if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length)); fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
} }
...@@ -131,12 +131,36 @@ function exportExcel(title) { ...@@ -131,12 +131,36 @@ function exportExcel(title) {
} }
return wbout; return wbout;
} }
function getEndDay(dateType,date) {
let newEndDay=''
switch (dateType){
case "month":{
let dateArr=date.split('-');
var maxDay = new Date(dateArr[0],dateArr[1],0).getDate(); //获取date月最大天数
var selectDate=new Date(Date.parse((date+'-'+maxDay).replace(/-/g,"/")));
var curDate=new Date();
if(selectDate > curDate){
newEndDay=formatDateFun(new Date(),'yyyy-MM-dd')
}else{
newEndDay = date+'-'+maxDay
}
return newEndDay;
}
break;
default:
break;
}
if(dateType=="month"){
}
}
export default { export default {
formatterInfo, formatterInfo,
formatterMoreInfo, formatterMoreInfo,
formatterInfoChangInt, formatterInfoChangInt,
imgPathAnalysis, imgPathAnalysis,
formatDate,
exportExcel
}
\ No newline at end of file \ No newline at end of file
formatDateFun,
exportExcel,
getEndDay
}
const FONT_FAMILY = '"PingFang SC", "Lantinghei SC", "Microsoft YaHei", "HanHei SC", "Helvetica Neue", "Open Sans", Arial, "Hiragino Sans GB", 微软雅黑, STHeiti, "WenQuanYi Micro Hei", SimSun, sans-serif'
const legend = {
type: 'scroll',
orient: "horizontal",
x: "center",
itemWidth: 12,
itemHeight: 12,
selected: {},
data: []
}
const xAxis = {
type: 'category',
axisTick: {
show: false
},
axisLabel: {
textStyle: {
color: '#888',
fontFamily: FONT_FAMILY
}
},
axisLine: {
show: true,
lineStyle: {
color: '#888'
}
},
axisTick: {
show: false
},
data: []
}
const yAxis = {
type: 'value',
nameTextStyle: {
color: '#444',
fontSize: 13,
fontFamily: FONT_FAMILY,
},
axisTick: {
show: false
},
axisLabel: {
textStyle: {
color: '#888',
fontFamily: FONT_FAMILY,
}
},
axisLine: {
show: true,
lineStyle: {
color: '#888'
}
},
splitLine: {
show: true,
lineStyle: {
color: '#f5f5f5'
}
}
}
/**
* 格式化 echarts 结构
* @param {object} data
* @return {object}
*/
export function optionFormatter(data) {
let option = {}
, emptyOption = {
isEmpty: true,
graphic: {
type: 'text',
left: 'center',
top: 'middle',
z: 100,
style: {
fill: '#444',
text: 'No Data',
font: '26px ' + FONT_FAMILY
}
},
otherConf: data ? Object.assign({}, data.otherConf || {}) : {}
}
if (!data || !Object.keys(data).length) {
return false
}
else if (!data.series) {
return emptyOption
}
else if (!data.series.length) {
return emptyOption
}
option = {
animation: false,
tooltip: {
show: true,
backgroundColor: '#fff',
textStyle: {
color: '#333'
},
extraCssText: 'box-shadow: 0px 0px 10px -4px rgba(3, 3, 3, .4)'
},
legend: legend,
grid: {},
xAxis: xAxis,
yAxis: data.yaxis || yAxis,
series: []
}
if (typeof (data.title) === 'string') {
option.title = {
text: data.title,
show: false,
textStyle: {
color: '#444',
fontSize: 18,
fontFamily: FONT_FAMILY,
fontWeight: 'normal',
},
left: 24,
top: 16
}
}
option.color = data.color
// 处理series
// 如果不清除, 页面中有多个同类型报表将叠加
option.legend.data = []
option.xAxis.data = []
data.series.forEach((item, index) => {
if (data.notSale) {
// if(index === 1 && item.name === '销售额') {
// item.yAxisIndex = 1
// }
index === 0 && option.legend.data.push(item.name)
} else {
if (item.name) {
option.legend.data.push({ name: item.name })
}
}
})
if (data.xaxis) {
option.xAxis.data = data.xaxis.data
}
option.series = data.series
// 整合特殊情况配置
/**
* isYear: 是否年报表
* hasYaxisName: 是否显示 y 轴名称
* seriesText: 单位
* isIndependent: 是否单独的排行榜
* selectedLen: legend 选中长度
* hideDataZoom: 是否隐藏缩放轴
* chartKey: 特殊报表处理字段
* grid: 网格配置
* kpiType: 指标值
* normalXAxisLabel: 是否正常显示 x 轴 label
* yAxisName: y 轴名称(计量单位)
* _color: option color
* ...
*/
option.otherConf = Object.assign({}, data.otherConf)
return JSON.parse(JSON.stringify(option))
}
...@@ -48,13 +48,13 @@ export function tryHideFullScreenLoading() { ...@@ -48,13 +48,13 @@ export function tryHideFullScreenLoading() {
* 请求前的拦截器 * 请求前的拦截器
*/ */
service.interceptors.request.use(function (config) { service.interceptors.request.use(function (config) {
console.log('request interceptors', config)
//截取API添加时间戳防止请求缓存 //截取API添加时间戳防止请求缓存
if (config.url.indexOf('?') > -1) { if (config.method == "get") {
if (config.url.split('?')[1].indexOf('&') > -1) { config.params = {
config.url = config.url + '&s=' + new Date().getTime(); _t: Date.parse(new Date()) / 1000,
} ...config.params
} else { };
config.url = config.url + '?s=' + new Date().getTime();
} }
if (config.url.indexOf('codes/countries') < 1) { if (config.url.indexOf('codes/countries') < 1) {
if (config.url.indexOf('cates') < 1) { if (config.url.indexOf('cates') < 1) {
...@@ -83,7 +83,7 @@ service.interceptors.response.use(function (res) { ...@@ -83,7 +83,7 @@ service.interceptors.response.use(function (res) {
return res; return res;
}, function (err) { }, function (err) {
//tryHideFullScreenLoading(); //tryHideFullScreenLoading();
// return Promise.reject(error); return Promise.reject(err);
}) })
export default service export default service
...@@ -14,31 +14,6 @@ import {pushws} from './socket' ...@@ -14,31 +14,6 @@ import {pushws} from './socket'
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
if (to.path === '/') { if (to.path === '/') {
next() next()
} else { } else {}
if (store.getters.permission_routers.length === 0) { //判断当前用户是否拉取了路由
store.dispatch('GetMenuRole').then(res => { //获取菜单
router.addRoutes(res);
pushws();
/**
* 初始化页面所需api
**/
faceapi.setBehaviorLocal();
faceapi.getCodeName();
faceapi.getSite();
faceapi.getOrg();
faceapi.getAddress();
faceapi.getFaceDbData();
faceapi.getProvince();
}).catch(() => {
})
} else {
}
// if (store.getters.dev_unid === ""){ //获取设备信息
// store.dispatch('GetDev')
// }
}
next() next()
}); });
...@@ -8,13 +8,14 @@ Vue.prototype.zoomImg = function (data){ ...@@ -8,13 +8,14 @@ Vue.prototype.zoomImg = function (data){
store.commit('setImgsrc',data); store.commit('setImgsrc',data);
} }
Vue.filter('sexfn', function (value) { Vue.filter('sexfn', function (value) {
if (!value)
return;
var str = ''; var str = '';
if (value == 1) if (value == 0){
str = '男' str = '女'
if (value == 2) }else if (value == 1){
str = '女' str = '男'
}else{
str = '未知'
}
return str; return str;
}); });
......
...@@ -49,7 +49,15 @@ export default { ...@@ -49,7 +49,15 @@ export default {
this.show = true this.show = true
this.titlename = '抓拍图片' this.titlename = '抓拍图片'
this.curshow = 'img' this.curshow = 'img'
this.axios.get(this.API.faceweb + '/faces/' + data.unid + '/face_events').then(res => { this.axios.get(this.API.url + '/faceRecognitions/history',{
params:{
mallId:2,
personUnid:data.personUnid,
countdate: this.common.formatDateFun(new Date(),"yyyy-MM-dd"),
sortName: "counttime",
sortOrder: "DESC"
}
}).then(res => {
if(res.data.list_data){ if(res.data.list_data){
this.imgData = res.data.list_data; this.imgData = res.data.list_data;
this.noImg=false; this.noImg=false;
......
...@@ -4,21 +4,20 @@ ...@@ -4,21 +4,20 @@
<el-form :inline="true" class="search-form" size="small"> <el-form :inline="true" class="search-form" size="small">
<el-form-item label="人口库:"> <el-form-item label="人口库:">
<el-select v-model="dbname" class="br0 bra bla"> <el-select v-model="dbname" class="br0 bra bla">
<el-option value="" label="请选择库类型"></el-option> <el-option v-for="item in crucialData" :key="item.unid" :value="item.id" :label="item.name"></el-option>
<el-option v-for="item in crucialData" :key="item.unid" :value="item.code" :label="item.name"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="姓名:"> <el-form-item label="姓名:">
<el-input type="text" class="bla bra br0" v-model="facename" placeholder=""></el-input> <el-input type="text" class="bla bra br0" v-model="facename" placeholder=""></el-input>
</el-form-item> </el-form-item>
<el-form-item label="证件号:"> <!-- <el-form-item label="证件号:">
<el-input type="text" class="bla" placeholder="请输入证件号" v-model="facecardid"></el-input> <el-input type="text" class="bla" placeholder="请输入证件号" v-model="facecardid"></el-input>
</el-form-item> </el-form-item> -->
<el-form-item label="性别:"> <el-form-item label="性别:">
<el-select v-model="facesex" class="br0 bra bla"> <el-select v-model="facesex" class="br0 bra bla">
<el-option value="" label="请选择性别"></el-option> <el-option value="" label="全部"></el-option>
<el-option :value="1" label="男"></el-option> <el-option value="1" label="男"></el-option>
<el-option :value="2" label="女"></el-option> <el-option value="0" label="女"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
...@@ -30,14 +29,14 @@ ...@@ -30,14 +29,14 @@
<el-table :data="tableData" style="width: 100%" height="680" > <el-table :data="tableData" style="width: 100%" height="680" >
<el-table-column type="index" label="#"></el-table-column> <el-table-column type="index" label="#"></el-table-column>
<el-table-column prop="name" label="姓名" align="center"></el-table-column> <el-table-column prop="name" label="姓名" align="center"></el-table-column>
<el-table-column prop="sex" label="性别" :formatter="setSex" align="center"></el-table-column> <el-table-column prop="gender" label="性别" :formatter="setSex" align="center"></el-table-column>
<el-table-column label="出生日期" property="birthday" :formatter="setBirthday"> </el-table-column> <el-table-column label="出生日期" property="email" :formatter="setBirthday"> </el-table-column>
<el-table-column label="身份证号" property="card_id"></el-table-column> <el-table-column label="身份证号" property="tel"></el-table-column>
<el-table-column label="操作" width="200" align="center"> <el-table-column label="操作" width="200" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="tab-btn-box"> <div class="tab-btn-box">
<span @click="showImg(scope.row)" class="table-btn">抓拍图片</span> <span @click="showImg(scope.row)" class="table-btn">抓拍图片</span>
<span @click="activityStatus(scope.row)" class="table-btn">活动状态</span> <!-- <span @click="activityStatus(scope.row)" class="table-btn">活动状态</span> -->
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
...@@ -76,12 +75,13 @@ export default { ...@@ -76,12 +75,13 @@ export default {
offset:0, offset:0,
limit:20, limit:20,
total:0, total:0,
currentPage:0, currentPage:1,
dbname:'', dbname:'',
facename:'', facename:'',
communityunid:'', communityunid:'',
facecardid:'', facecardid:'',
facesex:'' facesex:'',
accountId:localStorage.getItem('accountId')
}; };
}, },
...@@ -95,7 +95,7 @@ export default { ...@@ -95,7 +95,7 @@ export default {
setSex(row, column, cellValue) { setSex(row, column, cellValue) {
var sex = ""; var sex = "";
if (cellValue == "1") sex = "男"; if (cellValue == "1") sex = "男";
if (cellValue == "2") sex = "女"; if (cellValue == "0") sex = "女";
return sex; return sex;
}, },
setBirthday(row, column, cellValue) { setBirthday(row, column, cellValue) {
...@@ -104,31 +104,44 @@ export default { ...@@ -104,31 +104,44 @@ export default {
return data; return data;
}, },
initDbData(){ initDbData(){
this.axios.get(this.API.url + "/codes/custom/cates/4DD23AF66E/codes").then((response)=> { this.axios.get(this.API.url + "/personTypes",{
this.crucialData = response.data.list_data; params:{
}); accountId:this.accountId,
hasBaseType: 1
}
}).then((response)=> {
this.crucialData= response.data.data.filter(item=>{
return item.id!==0&&item.id!==1
})
this.typeData=JSON.parse(JSON.stringify(this.crucialData));
this.crucialData.unshift({
"id":"",
"name":"全部",
"unid":"alltype"
})
});
}, },
getData() { getData() {
this.axios this.axios
.get(this.API.faceweb + "/faces/crucial_faces", { .get(this.API.url + "/persons", {
params: { params: {
offset: this.offset, page:this.currentPage,
limit: this.limit, pageSize: this.limit,
is_crucial: true, status: 1,
is_active: true, accountId: this.accountId,
sex: this.facesex, gender: this.facesex,
name__like: this.facename, name_like: `%${this.facename}%`,
card_id__like: this.facecardid, type: this.dbname,
crucial_type: this.dbname,
resident_unids: this.communityunid, resident_unids: this.communityunid,
} }
}).then( (response) =>{ }).then( (response) =>{
this.tableData = response.data.list_data; this.tableData = response.data.data.list;
this.total = response.data.total_num; this.total = response.data.data.total;
}); });
}, },
handleCurrentChange(){ handleCurrentChange(val){
this.currentPage = val;
this.getData();
} }
}, },
created() { created() {
......
...@@ -189,4 +189,3 @@ ...@@ -189,4 +189,3 @@
</style> </style>
...@@ -2,16 +2,17 @@ ...@@ -2,16 +2,17 @@
<div class="template-box content_div_main org-box"> <div class="template-box content_div_main org-box">
<div class="videoleft-box"> <div class="videoleft-box">
<el-tree <el-tree
v-loading="loading" v-loading="loading"
:data="treedata" highlight-current
:props="defaultProps" :props="defaultProps"
default-expand-all :load="loadNode"
highlight-current lazy
@node-click="handleNodeClick" @node-click="handleNodeClick"
></el-tree> >
</el-tree>
</div> </div>
<div class="org-right-box"> <div class="org-right-box">
<el-button class="search-btn ml10 mt10" @click="addorg()" icon="el-icon-plus">添加</el-button> <!-- <el-button class="search-btn ml10 mt10" @click="addorg()" icon="el-icon-plus">添加</el-button> -->
<el-table <el-table
element-loading-text="拼命加载中" element-loading-text="拼命加载中"
element-loading-spinner="el-icon-loading" element-loading-spinner="el-icon-loading"
...@@ -28,13 +29,15 @@ ...@@ -28,13 +29,15 @@
</div> </div>
</div> </div>
<el-table-column type="type" width="55" label="#"></el-table-column> <el-table-column type="type" width="55" label="#"></el-table-column>
<el-table-column label="名称" prop="org_name"></el-table-column> <el-table-column label="本地IP" prop="localIp"></el-table-column>
<el-table-column label="类型" :formatter="formatHpzl" prop="org_type"></el-table-column> <el-table-column label="设备序列号" prop="serialnum"></el-table-column>
<el-table-column label="操作"> <el-table-column label="状态" :formatter="formatHpzl" prop="status"></el-table-column>
<el-table-column label="外网IP" prop="wanIp"></el-table-column>
<!-- <el-table-column label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="info" @click="handleDelete(scope.$index, scope.row)">删除</el-button> <el-button size="mini" type="info" @click="handleDelete(scope.$index, scope.row)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column> -->
</el-table> </el-table>
</div> </div>
<div class="dialog-org"> <div class="dialog-org">
...@@ -110,27 +113,33 @@ export default { ...@@ -110,27 +113,33 @@ export default {
treedata: [], treedata: [],
defaultProps: { defaultProps: {
children: "childs", children: "childs",
label: "org_name" label: "name",
isLeaf: "leaf"
}, },
dialogVisible: false, dialogVisible: false,
orgform: { orgform: {
oreType:'', oreType:'',
orgname:'' orgname:''
}, },
curOrgData: {} curOrgData: {},
accountId:localStorage.getItem('accountId')
}; };
}, },
methods: { methods: {
dialogclose(){ dialogclose(){
this.$refs.orgform.resetFields() this.$refs.orgform.resetFields()
}, },
handleNodeClick(data) { handleNodeClick(data,node) {
this.tableData = data.childs; if(node.childNodes.length>0&&data.floorId){
this.curOrgData = data; this.tableData=[]
node.childNodes.forEach(item=>{
this.tableData.push(item.data)
})
}
}, },
formatHpzl(data) { formatHpzl(data) {
if (data.org_type == "org") return "组织"; if (data.status == 0) return "离线";
if (data.org_type == "address") return "地点"; if (data.status == 1) return "在线";
}, },
buildTree(data) { buildTree(data) {
if (!data) { if (!data) {
...@@ -258,11 +267,58 @@ export default { ...@@ -258,11 +267,58 @@ export default {
} }
console.log(alldata) console.log(alldata)
}, },
loadNode(node, resolve) {
this.loading = true;
if (node.level === 0) {
this.axios.get(this.API.url+"/malls",{
params:{
accountId:this.accountId,
status:1
}
}).then((res)=>{
return resolve(res.data.data)
})
}
if (node.level === 1){
this.axios.get(this.API.url+"/gates/filter",{
params:{
mallId:node.data.id,
accountId:this.accountId,
status:1
}
}).then((res)=>{
return resolve(res.data.data)
})
}
if(node.level === 2){
let deviceArr=[];
this.axios.get(this.API.url+"/channels",{
params:{
gateId:node.data.id
}
}).then((res)=>{
const promises=res.data.data.map((item)=>{
return this.axios.get(this.API.url+"/devices/"+item.deviceId)
})
Promise.all(promises).then(res=>{
res.forEach(item=>{
item.data.data.leaf=true;
deviceArr.push(item.data.data)
})
this.tableData=deviceArr;
return resolve(deviceArr)
})
})
}
this.loading = false;
if(node.level > 2){
return resolve([])
}
},
getorgtree() { getorgtree() {
this.loading = true;
this.axios.get(this.API.org.getorgtree).then(res => { this.axios.get(this.API.org.getorgtree).then(res => {
this.treedata = res.data; this.treedata = res.data;
this.loading = false;
// if (res.data.length > 0) { // if (res.data.length > 0) {
// res.data.forEach(e => { // res.data.forEach(e => {
// this.buildTree(e); // this.buildTree(e);
......
...@@ -5,15 +5,23 @@ ...@@ -5,15 +5,23 @@
</div> </div>
<div class="org-right-box"> <div class="org-right-box">
<el-form :inline="true" class="search-form" size="small"> <el-form :inline="true" class="search-form" size="small">
<el-form-item label="组织:"> <!-- <el-form-item label="组织:">
<el-input type="text" class="bra" v-model="search.org_name" placeholder="组织名"></el-input> <el-input type="text" class="bra" v-model="search.org_name" placeholder="组织名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="地点:"> <el-form-item label="地点:">
<el-input type="text" class="bla" placeholder="相机名称" v-model="search.address_name"></el-input> <el-input type="text" class="bla" placeholder="相机名称" v-model="search.address_name"></el-input>
</el-form-item> </el-form-item> -->
<el-form-item label="相机:"> <el-form-item label="社区选择:">
<el-input type="text" class="bla" placeholder="相机名称" v-model="search.name__like"></el-input> <el-select v-model="search.mallId" placeholder="请选择">
</el-form-item> <el-option
v-for="item in mallData"
:key="item.unid" :value="item.id" :label="item.name"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="相机:">
<el-input type="text" class="bla" placeholder="相机名称" v-model="search.serialnum_like"></el-input>
</el-form-item>
<el-form-item> <el-form-item>
<el-button class="search-btn" icon="el-icon-search" @click="searchVchan">查询</el-button> <el-button class="search-btn" icon="el-icon-search" @click="searchVchan">查询</el-button>
<el-button class="search-btn" @click="addvchan()" icon="el-icon-plus">添加</el-button> <el-button class="search-btn" @click="addvchan()" icon="el-icon-plus">添加</el-button>
...@@ -21,15 +29,15 @@ ...@@ -21,15 +29,15 @@
</el-form> </el-form>
<el-table :data="tableData" style="width: 98%;margin:10px auto;" v-loading.body="loading"> <el-table :data="tableData" style="width: 98%;margin:10px auto;" v-loading.body="loading">
<el-table-column label="序号" type="index" width="120" align="center"></el-table-column> <el-table-column label="序号" type="index" width="120" align="center"></el-table-column>
<el-table-column label="相机编号" property="vchan_refid"> </el-table-column> <el-table-column label="相机编号" property="serialnum"> </el-table-column>
<el-table-column label="相机名称" property="vchan_name"> </el-table-column> <el-table-column label="相机名称" property="name"> </el-table-column>
<el-table-column label="相机属性"> <el-table-column label="相机属性">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{showent(scope.row)}}</span> <span>{{showent(scope.row)}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="IP" property="vchan_prop.ip" align="center"> </el-table-column> <el-table-column label="IP" property="localIp" align="center"> </el-table-column>
<el-table-column label="所属组织" property="org_name" align="center"> </el-table-column> <el-table-column label="所属组织" property="mall.name" align="center"> </el-table-column>
<el-table-column label="所属地点" property="address_name" align="center"> </el-table-column> <el-table-column label="所属地点" property="address_name" align="center"> </el-table-column>
<el-table-column label="操作" width="350px" align="center"> <el-table-column label="操作" width="350px" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -57,6 +65,7 @@ import addvchan from "./adddev"; ...@@ -57,6 +65,7 @@ import addvchan from "./adddev";
export default { export default {
data() { data() {
return { return {
mallData:[],
height: 900, height: 900,
tableData: [], tableData: [],
loading: false, loading: false,
...@@ -71,19 +80,33 @@ export default { ...@@ -71,19 +80,33 @@ export default {
}, },
orgData: [], orgData: [],
search:{ search:{
org_name:'', accountId:localStorage.getItem('accountId'),
address_name:'', mallId:'',
name__like:'' serialnum_like:''
}, },
page: { page: {
offset: 0, offset: 0,
limit: 18, limit: 18,
total: 0, total: 0,
currentPage: 0 currentPage: 1
} }
}; };
}, },
methods: { methods: {
initMallData(){
this.axios.get(this.API.url + "/malls",{
params:{
accountId:this.search.accountId,
status:1
}
}).then((response)=> {
this.mallData = response.data.data;
if(response.data.data.length>0){
this.search.mallId=response.data.data[0].id
}
this.getvchanlist();
});
},
handleCurrentChange(val) { handleCurrentChange(val) {
this.page.offset = (val - 1) * this.page.limit; this.page.offset = (val - 1) * this.page.limit;
this.getvchanlist(); this.getvchanlist();
...@@ -113,7 +136,7 @@ export default { ...@@ -113,7 +136,7 @@ export default {
}, },
editvchan(index, row) { editvchan(index, row) {
this.editData = row; this.editData = row;
this.$refs.vchan.editvchan(); // this.$refs.vchan.editvchan();
this.addvdialog = true; this.addvdialog = true;
this.state = 'edit'; this.state = 'edit';
}, },
...@@ -148,19 +171,21 @@ export default { ...@@ -148,19 +171,21 @@ export default {
}, },
getvchanlist() { getvchanlist() {
this.axios this.axios
.get(this.API.org.getvchanList, { .get(this.API.url+"/devices/filter", {
params:{ params:{
org_name:this.search.org_name, accountId: this.search.accountId,
address_name:this.address_name, mallId: this.search.mallId,
name__like:this.name__like, status_arr: '1,0',
offset: this.page.offset, serialnum_like: `%${this.search.serialnum_like}%`,
limit: this.page.limit, page: this.page.currentPage,
vchan_type:'vchan' pageSize: this.page.limit,
sortName: 'sort_ip',
sortOrder: 'ASC'
} }
}) })
.then(response => { .then(response => {
this.tableData = response.data.list_data; this.tableData = response.data.data.list;
this.page.total = response.data.total_num; this.page.total = response.data.data.total;
}); });
}, },
buildTree(data){ buildTree(data){
...@@ -235,7 +260,7 @@ export default { ...@@ -235,7 +260,7 @@ export default {
}, },
created() { created() {
this.getOrgData(); this.getOrgData();
this.getvchanlist(); this.initMallData();
} }
}; };
</script> </script>
...@@ -260,5 +285,3 @@ export default { ...@@ -260,5 +285,3 @@ export default {
box-shadow: 0px 0px 2px 1px rgba(0, 0, 0, 0.1); box-shadow: 0px 0px 2px 1px rgba(0, 0, 0, 0.1);
} }
</style> </style>
...@@ -5,25 +5,32 @@ ...@@ -5,25 +5,32 @@
<div class="info-box"> <div class="info-box">
<div class="info-item"> <div class="info-item">
<div class="info-header"> <div class="info-header">
<span class="icon el-icon-s-data"></span>相机抓拍总数</div> <span class="icon el-icon-s-data"></span>相机总数</div>
<div class="info-content">90</div> <div class="info-content">{{devsNum}}</div>
</div> </div>
<div class="info-item"> <div class="info-item">
<div class="info-header"> <div class="info-header">
<span class="icon el-icon-s-custom"></span>人口库数量</div> <span class="icon el-icon-s-custom"></span>人口库数量</div>
<div class="info-content">10</div> <div class="info-content">{{personTypeLength}}</div>
</div> </div>
<div class="info-item"> <div class="info-item">
<div class="info-header"> <div class="info-header">
<span class="icon el-icon-camera-solid"></span>总抓拍次数</div> <span class="icon el-icon-camera-solid"></span>总抓拍次数</div>
<div class="info-content">909</div> <div class="info-content">{{flowNum}}</div>
</div> </div>
<div class="info-item"> <div class="info-item">
<div class="info-header"> <div class="info-header">
<span class="icon el-icon-user-solid"></span>核实人数</div> <span class="icon el-icon-user-solid"></span>核实人数</div>
<div class="info-content ">230</div> <div class="info-content ">{{flowNum}}</div>
</div> </div>
</div> </div>
<div class="imgBox">
<el-image
v-for="item in imgArr"
:key="item.id"
:src="API.picUrl+'picture/'+item.facePath+item.facePic"
fit="fill"></el-image>
</div>
</div> </div>
</div> </div>
</template> </template>
...@@ -65,10 +72,77 @@ export default { ...@@ -65,10 +72,77 @@ export default {
dayfacealarm:0, dayfacealarm:0,
openstate:false, openstate:false,
unid:'', unid:'',
listData:[1,2,3,4,5,5,6,7,7,9] listData:[1,2,3,4,5,5,6,7,7,9],
accountId:localStorage.getItem("accountId"),
personTypeLength:0,
flowNum:0,
devsNum:0,
imgArr:[],
timer:''
} }
}, },
methods:{ methods:{
init(){
this.initFlow();
this.initDbData();
this.initDevs();
this.initFacePic();
this.initSetinterval();
},
initSetinterval(){
this.timer=setInterval(()=>{
this.initFacePic();
},1000)
},
initFacePic(){
this.axios.get(this.API.url + "/faceRecognitions",{
params:{
accountId:this.accountId,
direction:1,
sortName:"counttime",
sortOrder:"DESC",
age_gt:0,
page: 1,
pageSize: 21,
countdate: this.common.formatDateFun(new Date(),'yyyy-MM-dd')
}
}).then((response)=> {
this.imgArr=response.data.data.list;
})
},
initDevs(){
this.axios.get(this.API.url + "/devices",{
params:{
accountId:this.accountId,
page:1,
pageSize:99999
}
}).then((response)=> {
this.devsNum= response.data.data.total;
});
},
initFlow(){
this.axios.get(this.API.url + "/report/day/account",{
params:{
orgIds:this.accountId,
chartIds: "1",
date: this.common.formatDateFun(new Date(),'yyyy-MM-dd')
}
}).then((response)=> {
this.flowNum= response.data.data.head.dayInnum;
});
},
initDbData(){
this.axios.get(this.API.url + "/personTypes",{
params:{
accountId:this.accountId,
hasBaseType: 1
}
}).then((response)=> {
this.personTypeLength= response.data.data.length;
});
},
InitMap(){ InitMap(){
let _this = this; let _this = this;
//坐标 //坐标
...@@ -110,7 +184,8 @@ export default { ...@@ -110,7 +184,8 @@ export default {
                                                    dataProjection : 'EPSG:4326'                                                     dataProjection : 'EPSG:4326'
                                                  })                                                   })
}); });
var path = "http://192.168.9.62:20080/static/pics/qingdaoMap/roadmap/{z}/{x}/{y}.png" // var path = "http://192.168.9.62:20080/static/pics/qingdaoMap/roadmap/{z}/{x}/{y}.png"
var path = "http://19610hs911.iask.in/static/pics/qingdaoMap/roadmap/{z}/{x}/{y}.png"
var offlineMapLayer = new TileLayer({ var offlineMapLayer = new TileLayer({
source: new XYZ({ source: new XYZ({
// 设置本地离线瓦片所在路径,由于例子里面只有一张瓦片,页面显示时就只看得到一张瓦片。 // 设置本地离线瓦片所在路径,由于例子里面只有一张瓦片,页面显示时就只看得到一张瓦片。
...@@ -251,8 +326,12 @@ export default { ...@@ -251,8 +326,12 @@ export default {
}, },
}, },
beforeRouteLeave (to, from, next) {
clearInterval(this.timer);
next()
},
created(){ created(){
this.init();
}, },
mounted(){ mounted(){
this.InitMap(); this.InitMap();
...@@ -350,7 +429,7 @@ export default { ...@@ -350,7 +429,7 @@ export default {
color red color red
} }
.map{ .map{
height 88vh height 85vh
width 99% width 99%
margin 10px auto 10px margin 10px auto 10px
} }
...@@ -578,4 +657,28 @@ export default { ...@@ -578,4 +657,28 @@ export default {
.info-list { .info-list {
padding 1px 10px padding 1px 10px
} }
.imgBox{
position absolute
z-index 5000
width 370px
color #222
// display flex;
right: 0px;
top: 0px;
max-height 100%
overflow hidden;
// flex-wrap:wrap ;
}
.el-image{
width 31%;
// order:1;
// flex-grow:1;
// flex-shrink:0;
margin-left 4px
}
@media only screen and (max-width: 1366px) {
.imgBox{
width 250px
}
}
</style> </style>
...@@ -49,9 +49,7 @@ ...@@ -49,9 +49,7 @@
</div> </div>
<el-col :span="24" class="view-box"> <el-col :span="24" class="view-box">
<keep-alive>
<router-view></router-view> <router-view></router-view>
</keep-alive>
</el-col> </el-col>
</el-row> </el-row>
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
</div> </div>
</template> </template>
<script> <script>
import { mapMutations } from 'vuex'
export default { export default {
data() { data() {
return { return {
...@@ -50,15 +51,14 @@ export default { ...@@ -50,15 +51,14 @@ export default {
}, },
methods: { methods: {
login() { login() {
debugger;
//--添加验证 //--添加验证
if (this.userName == "") { if (this.userName == "") {
this.$message.error("请输入用户名"); this.$message.error("请输入用户名");
return; return;
} }
if (this.userName != "admin" && this.userName.length != 6) { if (this.userName != "admin" && this.userName.length < 2) {
this.$message.error("请输入6位用户ID"); this.$message.error("请输入至少2位用户ID");
return; return;
} }
...@@ -66,36 +66,70 @@ export default { ...@@ -66,36 +66,70 @@ export default {
this.$message.error("请输入密码在继续"); this.$message.error("请输入密码在继续");
return; return;
} }
var data = { username: this.userName, password: this.passWord }; var data = { loginName: this.userName, password: this.passWord };
this.axios this.axios
.post(this.API.auth.login, data) .post(this.API.auth.login, data)
.then(response => { .then(response => {
localStorage.setItem("atoken", response.data.atoken); localStorage.setItem("atoken", response.data.data.atoken);
localStorage.setItem("rtoken", response.data.rtoken); localStorage.setItem("rtoken", response.data.data.rtoken);
localStorage.setItem("user_id", response.data.user_unid); localStorage.setItem("user_id", response.data.data.user_unid);
localStorage.setItem("username", this.userName); localStorage.setItem("username", this.userName);
localStorage.setItem("userId", response.data.data.user.id);
sessionStorage.removeItem("threemenu"); sessionStorage.removeItem("threemenu");
sessionStorage.removeItem("menu"); sessionStorage.removeItem("menu");
localStorage.setItem("accountId", response.data.data.user.accountId);
// this.axios.get(this.API.auth.accountid,{
// params:{
// id:response.
// }
// })
//----cyl 添加获取更加详细的用户信息--- //----cyl 添加获取更加详细的用户信息---
this.axios
.get(this.API.auth.edituser(localStorage.getItem("user_id")))
.then(response => {
localStorage.setItem("namemc", response.data.name);
});
//---end //---end
this.getMenuInfo();
this.$router.push("/show");
// console.log(response.data) // console.log(response.data)
// localStorage.setItem("atoken",'dc62ae05-21be-43ad-9be2-d5f8a6bd0dac'); // localStorage.setItem("atoken",'dc62ae05-21be-43ad-9be2-d5f8a6bd0dac');
}) })
.catch(err => { .catch(err => {
console.log(err)
let info = "用户名或密码错误!"; let info = "用户名或密码错误!";
if (err.message == "Network Error") info = "网络错误!"; if (err.message == "Network Error") info = "网络错误!";
this.$message.error(info); this.$message.error(info);
}); });
},
/**
* 获取路由列表
*/
getMenuApp(){
return new Promise((reslove, reject) =>{
this.axios.get(this.API.url + "/auth/api/v1/auth/apps").then(response => {
reslove(response);
})
});
},
async getMenuInfo() {
let res =await this.getMenuApp();
let unid=''
res.data.list_data.forEach(item=>{
if(item.name=='shebao'){
unid=item.unid
}
})
this.axios.get(this.API.url + "/auth/api/v1/auth/apps/" + unid + "/menus?shape=tree").then(response => {
localStorage.setItem(
"menuArr",
JSON.stringify(response.data.menu_tree[0].children)
);
this.$store
.dispatch("GetMenuRole", response.data.menu_tree[0].children)
.then(res => {
this.$router.push("/show");
});
})
} }
} }
}; };
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
}, },
methods: { methods: {
handleSelect(key, keyPath) { handleSelect(key, keyPath) {
debugger
sessionStorage.setItem('menu',key); sessionStorage.setItem('menu',key);
this.$router.push(key); this.$router.push(key);
...@@ -45,7 +44,6 @@ ...@@ -45,7 +44,6 @@
]), ]),
}, },
created(){ created(){
debugger
console.log(this.theme) console.log(this.theme)
let menu = sessionStorage.getItem('menu'); let menu = sessionStorage.getItem('menu');
if(menu) { if(menu) {
......
...@@ -40,7 +40,6 @@ export default { ...@@ -40,7 +40,6 @@ export default {
...mapGetters(["three_menu"]) ...mapGetters(["three_menu"])
}, },
created() { created() {
debugger
let threemenu = sessionStorage.getItem("threemenu"); let threemenu = sessionStorage.getItem("threemenu");
if (threemenu) { if (threemenu) {
this.subactiveIndex = threemenu; this.subactiveIndex = threemenu;
......
...@@ -27,9 +27,9 @@ ...@@ -27,9 +27,9 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="性别" prop="region"> <el-form-item label="性别" prop="region">
<el-select v-model="faceForm.sex" placeholder=""> <el-select v-model="faceForm.gender" placeholder="">
<el-option label="男" value="shanghai"></el-option> <el-option label="男" :value="1"></el-option>
<el-option label="女" value="beijing"></el-option> <el-option label="女" :value="0"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
......
...@@ -10,41 +10,49 @@ ...@@ -10,41 +10,49 @@
</span> </span>
<span class="info-text">{{faceInfo.name}}</span> <span class="info-text">{{faceInfo.name}}</span>
</el-col> </el-col>
<el-col :span="12">
<span class="info-label">
<span class="info-label-name">年龄:</span>
</span>
<span class="info-text">{{faceInfo.age}}</span>
</el-col>
<el-col :span="12" class="mt10 clear-both"> <el-col :span="12" class="mt10 clear-both">
<span class="info-label"> <span class="info-label">
<span class="info-label-name">性别:</span> <span class="info-label-name">性别:</span>
</span> </span>
<span class="info-text">{{faceInfo.sex |sexfn}}</span> <span class="info-text">{{faceInfo.gender |sexfn}}</span>
</el-col> </el-col>
<el-col :span="12" class="mt10 clear-both"> <el-col :span="12" class="mt10 clear-both">
<span class="info-label"> <span class="info-label">
<span class="info-label-name">生日:</span> <span class="info-label-name">生日:</span>
</span> </span>
<span class="info-text">{{faceInfo.birthday}}</span> <span class="info-text">{{faceInfo.email}}</span>
</el-col> </el-col>
<el-col :span="12" class="mt10 clear-both"> <el-col :span="12" class="mt10 clear-both">
<span class="info-label"> <span class="info-label">
<span class="info-label-name">证件类型:</span> <span class="info-label-name">证件类型:</span>
</span> </span>
<span class="info-text">{{getcardtype(faceInfo.card_type)}}</span> <!-- <span class="info-text">{{getcardtype(faceInfo.card_type)}}</span> -->
<span class="info-text">身份证</span>
</el-col> </el-col>
<el-col :span="12" class="mt10 clear-both"> <el-col :span="12" class="mt10 clear-both">
<span class="info-label"> <span class="info-label">
<span class="info-label-name">证件号:</span> <span class="info-label-name">证件号:</span>
</span> </span>
<span class="info-text">{{faceInfo.card_id}}</span> <span class="info-text">{{faceInfo.tel}}</span>
</el-col> </el-col>
<el-col :span="12" class="mt10 clear-both"> <!-- <el-col :span="12" class="mt10 clear-both">
<span class="info-label"> <span class="info-label">
<span class="info-label-name">手机号:</span> <span class="info-label-name">手机号:</span>
</span> </span>
<span class="info-text">{{faceInfo.mphone}}</span> <span class="info-text">{{faceInfo.mphone}}</span>
</el-col> </el-col> -->
<el-col :span="12" class="mt10 clear-both"> <el-col :span="12" class="mt10 clear-both">
<span class="info-label"> <span class="info-label">
<span class="info-label-name">籍贯:</span> <span class="info-label-name">籍贯:</span>
</span> </span>
<span class="info-text">{{showCity(faceInfo.province,faceInfo.city)}}</span> <!-- <span class="info-text">{{showCity(faceInfo.province,faceInfo.city)}}</span> -->
<span class="info-text">{{faceInfo.personInfo}}</span>
</el-col> </el-col>
<!-- 户籍库详细信息 --> <!-- 户籍库详细信息 -->
<el-row v-show="faceInfo.extra_info" v-if="faceInfo.extra_info"> <el-row v-show="faceInfo.extra_info" v-if="faceInfo.extra_info">
...@@ -379,19 +387,18 @@ ...@@ -379,19 +387,18 @@
}, },
getFaceDetail(data) { getFaceDetail(data) {
var Vthis = this; var Vthis = this;
debugger // this.axios.get(this.API.faceweb + "/faces/" + data.unid).then(function (response) {
this.axios.get(this.API.faceweb + "/faces/" + data.unid).then(function (response) { Vthis.faceInfo = data;
Vthis.faceInfo = response.data;
Vthis.loading = false; Vthis.loading = false;
}); // });
}, },
getcardtype(data) { getcardtype(data) {
let cardname = ""; let cardname = "身份证";
this.cartypeData.forEach(function (ele) { // this.cartypeData.forEach(function (ele) {
if (ele.code == data) { // if (ele.code == data) {
cardname = ele.name; // cardname = ele.name;
} // }
}, this); // }, this);
return cardname; return cardname;
}, },
initDbData() { initDbData() {
...@@ -417,7 +424,7 @@ ...@@ -417,7 +424,7 @@
}, },
created() { created() {
this.initDbData(); this.initDbData();
this.initcartypeData(); // this.initcartypeData();
} }
}; };
...@@ -438,4 +445,3 @@ ...@@ -438,4 +445,3 @@
} }
</style> </style>
...@@ -9,10 +9,11 @@ ...@@ -9,10 +9,11 @@
</div> </div>
<el-table-column label="序号" type="index" width="120"></el-table-column> <el-table-column label="序号" type="index" width="120"></el-table-column>
<el-table-column label="姓名" property="name" type="name" width="180"></el-table-column> <el-table-column label="姓名" property="name" type="name" width="180"></el-table-column>
<el-table-column label="性别" property="sex" :formatter="setSex" width="180"></el-table-column> <el-table-column label="年龄" property="age" width="180"></el-table-column>
<el-table-column label="出生日期" property="birthday" :formatter="setBirthday"> </el-table-column> <el-table-column label="性别" property="gender" :formatter="setSex" width="180"></el-table-column>
<el-table-column label="身份证号" property="card_id"></el-table-column> <el-table-column label="出生日期" property="email" :formatter="setBirthday"> </el-table-column>
<el-table-column label="籍贯" property="provence" :formatter="setCity"> <el-table-column label="身份证号" property="tel"></el-table-column>
<el-table-column label="籍贯" property="personInfo" :formatter="setCity">
</el-table-column> </el-table-column>
<el-table-column label="操作" width="300px" align="center"> <el-table-column label="操作" width="300px" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -50,6 +51,7 @@ ...@@ -50,6 +51,7 @@
detaildialong: false, detaildialong: false,
curData: '', curData: '',
cData: '', cData: '',
accountId:localStorage.getItem('accountId')
}; };
}, },
props: { props: {
...@@ -94,15 +96,19 @@ ...@@ -94,15 +96,19 @@
.then(() => { .then(() => {
Athis = this; Athis = this;
Vthis.axios Vthis.axios
.delete(this.API.faceweb + "/faces/" + row.unid, { .delete(this.API.url + "/persons/" + row.id)
is_active: false
})
.then(function (response) { .then(function (response) {
console.log(response)
Vthis.initTable(); Vthis.initTable();
Athis.$message({ Athis.$message({
type: "success", type: "success",
message: "删除成功!" message: "删除成功!"
}); });
}).catch((err)=>{
this.$message({
type: "error",
message: err
});
}); });
}) })
.catch(() => { .catch(() => {
...@@ -113,12 +119,16 @@ ...@@ -113,12 +119,16 @@
}); });
}, },
setCity(row, column, cellValue) { setCity(row, column, cellValue) {
return this.showCity(row.province, row.city) if(!row.personInfo){
return '未知'
}else{
return cellValue
}
}, },
setSex(row, column, cellValue) { setSex(row, column, cellValue) {
var sex = ""; var sex = "";
if (cellValue == "1") sex = "男"; if (cellValue == "1") sex = "男";
if (cellValue == "2") sex = "女"; if (cellValue == "0") sex = "女";
return sex; return sex;
}, },
setBirthday(row, column, cellValue) { setBirthday(row, column, cellValue) {
...@@ -130,27 +140,27 @@ ...@@ -130,27 +140,27 @@
alert(val); alert(val);
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.offset = (val - 1) * this.limit; this.currentPage = val;
this.initTable(); this.initTable();
}, },
initTable() { initTable() {
var Vthis = this; var Vthis = this;
this.axios this.axios
.get(this.API.faceweb + "/faces/crucial_faces", { .get(this.API.url + "/persons", {
params: { params: {
offset: Vthis.offset, page:this.currentPage,
limit: this.limit, pageSize: this.limit,
is_crucial: true, status: 1,
is_active: true, accountId: this.accountId,
sex: Vthis.facesex, gender: Vthis.facesex,
name__like: Vthis.facename, name_like: `%${Vthis.facename}%`,
card_id__like: Vthis.facecardid, card_id__like: Vthis.facecardid,
crucial_type: Vthis.dbname, type: Vthis.dbname,
resident_unids: this.communityunid, resident_unids: this.communityunid,
} }
}).then( (response) =>{ }).then( (response) =>{
Vthis.tableData = response.data.list_data; Vthis.tableData = response.data.data.list;
Vthis.total = response.data.total_num; Vthis.total = response.data.data.total;
}); });
} }
}, },
...@@ -175,4 +185,3 @@ ...@@ -175,4 +185,3 @@
} }
</style> </style>
...@@ -5,18 +5,15 @@ ...@@ -5,18 +5,15 @@
:visible.sync="show" :visible.sync="show"
width="50%" width="50%"
:before-close="handleClose"> :before-close="handleClose">
<el-table :data="trackData"> <el-table :data="trackData" height="400">
<el-table-column prop="event_dt" label="日期"> <el-table-column property="counttime" label="日期">
<template slot-scope="scope">
{{showLocalTime(scope.row.event_dt)}}
</template>
</el-table-column> </el-table-column>
<el-table-column property="face.name" label="姓名"></el-table-column> <el-table-column property="name" label="姓名"></el-table-column>
<el-table-column property="camera.location" label="抓怕地址"></el-table-column> <el-table-column property="gateId" label="抓怕地址" :formatter="gateFormatter"></el-table-column>
<el-table-column property="pic_url" label="抓怕图片"> <el-table-column property="pic_url" label="抓怕图片">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="img-box"> <div class="img-box">
<img :src="scope.row.pic_url" alt=""> <img :src="API.picUrl+'picture/'+scope.row.facePath+scope.row.facePic" alt="">
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
...@@ -51,21 +48,24 @@ export default { ...@@ -51,21 +48,24 @@ export default {
}, },
props: { props: {
accunid: {}, accunid: {},
faceunid: {} faceunid: {},
gateData:{
type:Array
}
}, },
methods:{ methods:{
init(data){ init(data){
this.show = true; this.show = true;
console.log(data) this.trackData=data
this.axios.get(this.API.faceweb+ '/faces/' + data.face_unid + '/face_events',{ },
params: { gateFormatter(data){
limit: this.page.limit, let val="";
offset: this.page.offset, this.gateData.forEach(item=>{
if(item.id==data.gateId){
val=item.name;
} }
}).then(res => {
console.log(res.data)
this.trackData = res.data.list_data;
}) })
return val;
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.page.currentPage = val; this.page.currentPage = val;
......
...@@ -38,8 +38,10 @@ export default { ...@@ -38,8 +38,10 @@ export default {
addform: { addform: {
name: "" name: ""
}, },
headertitle: "添加角色" headertitle: "添加角色",
}; appsUnid:'',
hasMenu:[]
}
}, },
props: { props: {
opaddroledialog: {}, opaddroledialog: {},
...@@ -54,11 +56,10 @@ export default { ...@@ -54,11 +56,10 @@ export default {
this.$refs["addroleform"].validate(valid => { this.$refs["addroleform"].validate(valid => {
if (valid) { if (valid) {
var Url = ""; var Url = "";
if (this.curData == "") Url =this.API.auth.role; if (this.curData == "") Url =this.API.url+"/auth/api/v1/auth/roles";
if (this.curData != "")Url = this.API.auth.editrole(this.curData.role_unid); if (this.curData != "")Url = this.API.url+"/auth/api/v1/auth/roles/"+this.curData.role_unid;
this.axios.post(Url, this.addform).then(response => { this.axios.post(Url, this.addform).then(response => {
debugger
this.setPrem(response.data); this.setPrem(response.data);
this.closeroledialong(); this.closeroledialong();
this.$refs["addroleform"].resetFields(); this.$refs["addroleform"].resetFields();
...@@ -73,6 +74,17 @@ export default { ...@@ -73,6 +74,17 @@ export default {
} }
}); });
}, },
dealHasMenu(menu) {
console.log(menu)
menu.children.forEach(item => {
if(!item.children) {
this.hasMenu.push(item.perm_unid)
}else if(item.children && item.children.length > 0){
this.dealHasMenu(item)
}
})
this.$refs.roletree.setCheckedKeys(this.hasMenu);
},
// 添加权限 // 添加权限
setPrem(data) { setPrem(data) {
var permunidData = this.getCheckedNodes(); var permunidData = this.getCheckedNodes();
...@@ -85,14 +97,10 @@ export default { ...@@ -85,14 +97,10 @@ export default {
}; };
aList.push(obj); aList.push(obj);
}); });
this.axios.post(this.API.auth.menusRole(data.role_unid), this.axios.post(this.API.url+"/auth/api/v1/auth/roles/"+data.role_unid+"/apps/"+this.appsUnid+"/menus",
{ {
list_size: permunidData.length, list_size: permunidData.length,
list_data: aList list_data: aList
},{
headers:{
"authorization": localStorage.getItem("atoken"),
}
} }
) )
.then(response => { .then(response => {
...@@ -101,35 +109,38 @@ export default { ...@@ -101,35 +109,38 @@ export default {
} }
}, },
getCheckedNodes() { getCheckedNodes() {
return this.$refs.roletree.getCheckedNodes(); return [...this.$refs.roletree.getHalfCheckedNodes(),...this.$refs.roletree.getCheckedNodes()];
}, },
getmenu() { getMenuApp(){
this.axios return new Promise((reslove, reject) =>{
.get(this.API.menus +'?shape=tree', { this.axios.get(this.API.url + "/auth/api/v1/auth/apps").then(response => {
headers: { reslove(response);
authorization: localStorage.getItem("atoken") })
}
}
)
.then(response => {
this.roleData = response.data.menu_tree;
}); });
},
async getmenu() {
let res =await this.getMenuApp();
res.data.list_data.forEach(item=>{
if(item.name=='shebao'){
this.appsUnid=item.unid
}
})
this.axios.get(this.API.url + "/auth/api/v1/auth/apps/" + this.appsUnid + "/menus?shape=tree").then(response => {
this.roleData= response.data.menu_tree;
})
}, },
getRolePerms(data) { getRolePerms(data) {
debugger
var _this = this; var _this = this;
this.axios this.axios
.get(this.API.auth.perms(data.role_unid),{ headers: { .get(this.API.url+"/auth/api/v1/auth/apps/"+this.appsUnid+"/menus",{
authorization: localStorage.getItem("atoken") params:{
}}) role:data.role_unid
.then(response => {
var IDs = [];
if (response.data.list_data) {
response.data.list_data.forEach((ele, i) => {
IDs.push(ele.perm_unid);
}, this);
} }
_this.$refs.roletree.setCheckedKeys(IDs); })
.then(response => {
this.hasMenu = [];
this.dealHasMenu(response.data.menu_tree[0])
}); });
} }
}, },
......
...@@ -70,7 +70,8 @@ export default { ...@@ -70,7 +70,8 @@ export default {
currentPage: 1 currentPage: 1
}, },
loading: false, loading: false,
curData: "" curData: "",
userUnid:localStorage.getItem("user_id")
}; };
}, },
methods: { methods: {
...@@ -79,8 +80,8 @@ export default { ...@@ -79,8 +80,8 @@ export default {
if (state) this.getRolList(); if (state) this.getRolList();
}, },
searchRol() { searchRol() {
this.page.offset = 0;
this.page.currentPage = 0; this.page.currentPage = 0;
this.page.offset = 0;
this.getRolList(); this.getRolList();
}, },
addRole() { addRole() {
...@@ -116,18 +117,15 @@ export default { ...@@ -116,18 +117,15 @@ export default {
}); });
}, },
getRolList() { getRolList() {
this.axios.get(this.API.auth.role, { this.axios.get(this.API.url+"/auth/api/v1/auth/users/"+this.userUnid+"/roles", {
headers: { params: {
authorization: localStorage.getItem("atoken") order: "asc",
}, sortby: "create_dt",
params: { is_active:true,
"name__like": this.search.rolename, limit:this.page.limit,
"is_active": true, offset:this.page.offset
"limit":this.page.limit, }
"offset":this.page.offset }).then(response => {
}
}).then(response => {
debugger
this.tableData = response.data.list_data; this.tableData = response.data.list_data;
this.page.total = response.data.total_num; this.page.total = response.data.total_num;
}); });
......
<template>
<div class="template-box content_div_main noBackGround">
<el-form :inline="true" class="search-form" size="small">
<el-form-item label="查询时间:">
<el-date-picker
v-model="datatime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期"
:picker-options="pickerOptions">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button class="search-btn" @click="searchFaceCheck" icon="el-icon-search">查询</el-button>
<!-- <el-button class="search-btn ml10" @click="exportCluster()" icon="el-icon-upload">导出</el-button> -->
</el-form-item>
</el-form>
<div class="chartBox">
<!-- <div class="chartTitle">集团实时客流</div> -->
<chart chartId="chart1" chartType="AreaLine" :chartData="chartData1" class="chart"></chart>
</div>
<div class="chartBox">
<!-- <div class="chartTitle">集团实时客流</div> -->
<div class="radioBox">
<el-radio-group v-model="radioVal" size="small">
<el-radio-button label="trend7">近7天</el-radio-button>
<el-radio-button label="trend15">近15天</el-radio-button>
<el-radio-button label="trend30">近30天</el-radio-button>
</el-radio-group>
</div>
<chart chartId="chart2" chartType="AreaLine" :chartData="chartData2" class="chart"></chart>
</div>
</div>
</template>
<script>
import chart from "../public/chart.vue"
export default {
data() {
return {
pickerOptions:{
disabledDate(time) {
return time.getTime() > Date.now();
},
},
datatime:this.common.formatDateFun(new Date(), "yyyy-MM-dd"),
datas:{},
chartData1:{},
chartData2:{},
radioVal:"trend15",
accountId:localStorage.getItem("accountId")
}
},
watch:{
radioVal(newVal,oldVal){
this.radioChange(this.datas)
}
},
components:{
chart
},
methods: {
searchFaceCheck(){
this.initChart();
},
initChart(){
this.axios.get(this.API.url+"/report/day/account",{
params:{
orgIds: this.accountId,
date: this.datatime,
chartIds: '1,2,3,4,5,6,8,16,17'
}
}).then((res)=>{
this.datas=res.data.data;
this.chartData1 = this.datas.body.CustomerCounting;
this.chartData1.otherConf={
_color:["#0069FF", "#4BBEFF", "#87D14B", "#FFC62E", "#FF9631"]
}
this.radioChange(this.datas);
})
},
radioChange(res){
switch (this.radioVal){
case "trend7":
this.chartData2=res.body.trend7;
break;
case "trend15":
this.chartData2=res.body.trend15;
break;
case "trend30":
this.chartData2=res.body.trend30;
break;
default:
break;
}
this.chartData2.otherConf={
_color:["#4BBEFF", "#87D14B", "#FFC62E", "#FF9631"]
}
}
},
mounted() {
this.initChart();
}
}
</script>
<style scoped>
.chart{
height: 500px;
}
</style>
<template>
<div class="template-box content_div_main noBackGround">
<el-form :inline="true" class="search-form" size="small">
<el-form-item label="社区选择:">
<el-select v-model="mallId" placeholder="请选择">
<el-option
v-for="item in mallData"
:key="item.unid" :value="item.id" :label="item.name"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="查询时间:">
<el-date-picker
v-model="datatime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期"
:picker-options="pickerOptions">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button class="search-btn" @click="searchFaceCheck" icon="el-icon-search">查询</el-button>
<!-- <el-button class="search-btn ml10" @click="exportCluster()" icon="el-icon-upload">导出</el-button> -->
</el-form-item>
</el-form>
<div class="chartBox">
<div class="radioBox" style="left: 140px;">
<el-radio-group v-model="radioVal" size="small">
<el-radio-button label="trend7">天汇总</el-radio-button>
<el-radio-button label="trend15">小时级</el-radio-button>
<el-radio-button label="trend30">分钟级</el-radio-button>
</el-radio-group>
</div>
<chart chartId="chart2" :chartType="type" :chartData="chartData2" class="chart"></chart>
</div>
</div>
</template>
<script>
import chart from "../public/chart.vue"
export default {
data() {
return {
type:"AreaLine",
pickerOptions:{
disabledDate(time) {
return time.getTime() > Date.now();
},
},
datatime:this.common.formatDateFun(new Date(), "yyyy-MM-dd"),
datas:{},
chartData2:{},
radioVal:"trend15",
mallData:[],
mallId:'',
accountId:localStorage.getItem("accountId")
}
},
watch:{
radioVal(newVal,oldVal){
this.radioChange(this.datas)
}
},
components:{
chart
},
methods: {
searchFaceCheck(){
this.initChart();
},
getMallList(){
this.axios.get(this.API.url + "/malls",{
params:{
accountId:this.accountId,
status:1
}
}).then((response)=> {
this.mallData = response.data.data;
if(response.data.data.length>0){
this.mallId=response.data.data[0].id
}
this.initChart();
});
},
initChart(){
this.axios.get(this.API.url+"/report/basics/day/mall",{
params:{
orgIds: this.mallId,
date: this.datatime,
chartIds: '283,284,285',
option: "TAB_CHART"
}
}).then((res)=>{
this.datas=res.data.data;
this.radioChange(this.datas);
})
},
radioChange(res){
switch (this.radioVal){
case "trend7":
this.type="Bar";
this.chartData2=res.body.detailData;
break;
case "trend15":
this.type="AreaLine";
this.chartData2=res.body.trafficHour;
break;
case "trend30":
this.type="AreaLine";
this.chartData2=res.body.traffic10Min;
this.chartData2.otherConf={
isYear:true
}
break;
default:
break;
}
if(this.chartData2.otherConf){
this.chartData2.otherConf._color=["#4BBEFF", "#87D14B", "#FFC62E", "#FF9631"]
}else{
this.chartData2.otherConf={
_color:["#4BBEFF", "#87D14B", "#FFC62E", "#FF9631"]
}
}
}
},
mounted() {
this.getMallList();
}
}
</script>
<style scoped>
.chart{
height: 500px;
}
</style>
<template>
<div class="template-box content_div_main noBackGround">
<el-form :inline="true" class="search-form" size="small">
<el-form-item label="社区选择:">
<el-select v-model="mallId" placeholder="请选择">
<el-option
v-for="item in mallData"
:key="item.unid" :value="item.id" :label="item.name"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="查询时间:">
<el-date-picker
v-model="datatime"
type="month"
value-format="yyyy-MM"
placeholder="选择日期"
:picker-options="pickerOptions">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button class="search-btn" @click="searchFaceCheck" icon="el-icon-search">查询</el-button>
<!-- <el-button class="search-btn ml10" @click="exportCluster()" icon="el-icon-upload">导出</el-button> -->
</el-form-item>
</el-form>
<div class="chartBox">
<chart chartId="chart1" :chartType="type" :chartData="chartData" class="chart"></chart>
</div>
</div>
</template>
<script>
import chart from "../public/chart.vue"
export default {
data() {
return {
type:"Heatmap",
pickerOptions:{
disabledDate(time) {
return time.getTime() > Date.now();
},
},
datatime:this.common.formatDateFun(new Date(), "yyyy-MM"),
chartData:{},
mallData:[],
mallId:'',
accountId:localStorage.getItem("accountId")
}
},
watch:{
},
components:{
chart
},
methods: {
searchFaceCheck(){
this.initChart();
},
getMallList(){
this.axios.get(this.API.url + "/malls",{
params:{
accountId:this.accountId,
status:1
}
}).then((response)=> {
this.mallData = response.data.data;
if(response.data.data.length>0){
this.mallId=response.data.data[0].id
}
this.initChart();
});
},
initChart(){
this.axios.get(this.API.url+"/report/thermodynamic/mall",{
params:{
orgIds: this.mallId,
startDate: this.datatime+'-01',
endDate:this.common.getEndDay("month",this.datatime),
chartIds: '267',
}
}).then((res)=>{
this.chartData=res.data.data.body.TimeThermodynamic;
this.chartData.otherConf={
_color:["#4BBEFF", "#87D14B", "#FFC62E", "#FF9631"]
}
})
},
},
mounted() {
this.getMallList();
}
}
</script>
<style scoped>
.chart{
height: 500px;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!