Commit 2ea674e6 by 夏新然

图表视频版本

1 parent bfaadc58
Showing 82 changed files with 2634 additions and 590 deletions
const baseUrl = 'https://store.keliuyun.com/report'; // window.url; const baseUrl = window.url; // window.url;
export default { export default {
LOAD_ACCOUNT_LIST: `${baseUrl}/accounts`, LOAD_ACCOUNT_LIST: `${baseUrl}/accounts`,
LOAD_MALL_LIST: `${baseUrl}/malls`, LOAD_MALL_LIST: `${baseUrl}/malls`,
......
// 定义一些公共的属性和方法
export default function permissionsFun(key) {
var list=JSON.parse(localStorage.getItem('menus'))
console.log(list)
var flag=false;
try {
list.forEach(item=>{
if(item.name==key){
flag=true
throw new Error("EndIterative");
}
})
} catch(e) {
if(e.message!="EndIterative") throw e;
};
return flag;
}
\ No newline at end of file \ No newline at end of file
<template>
<view class="linechart">
<div :id='bindId' class="chart"></div>
</view>
</template>
<script>
export default {
data () {
return {
yMax:0
}
},
mounted() {
},
watch:{
bindId:function(newValue,oldValue){
},
chartData:{
handler:function(newValue,oldValue){
this.drawBar();
},
deep:true
},
},
props:{
bindId:{
type:String,
default:''
},
chartData: {
type: Object,
default: function(){
return {}
}
}
},
methods: {
drawBar() {
var yMax=0;
let myChart = {};
let chartDom = document.getElementById(this.bindId);
myChart = this.echarts.init(chartDom);
myChart.showLoading('default', {
text: '',
color: '#409eff'
});
var option = {
title:{
show:true,
text:this.chartData.title,
left: uni.upx2px(18.11),
top: uni.upx2px(10.86),
textStyle: {
fontWeight: "normal",
fontSize: uni.upx2px(25.4),
color: '#4A4A4A'
}
},
backgroundColor: '#fff',
color: ["#0069FF", "#3BB8FF", "#6784e3", "#ff9631", "#ffc62e","#7460ee","#eb6100"],
tooltip:{
renderMode:'richText'
},
grid: {
left:uni.upx2px(76.08),
right: uni.upx2px(40.98),
top: uni.upx2px(83.33),
bottom: uni.upx2px(9.05)+uni.upx2px(21.74)+12+uni.upx2px(21.74)+12
},
yAxis: {
minInterval :1,
scale: true,
axisLabel: {
textStyle: {
color: '#9B9B9B',
fontSize:uni.upx2px(21.74)
},
formatter:function(value){
if(value>yMax){
yMax=value;
}
return value
}
},
axisLine : {
show: false,
lineStyle: {
color: '#888'
}
},
axisTick:{
show:false
},
splitLine:{
lineStyle: {
color: '#f3f3f3'
}
}
},
xAxis: {
axisTick:{
show:false
},
axisLine : {
show: false,
lineStyle: {
color: '#888'
}
},
axisLabel : {
textStyle: {
color: '#9B9B9B',
fontSize:uni.upx2px(21.74)
}
},
splitLine : {
show: false
}
},
legend : {
type:"scroll",
orient: "horizontal",
textStyle: {
fontSize: uni.upx2px(21.74),
color:'rgba(74,74,74,1)'
},
itemWidth: uni.upx2px(12.7),
itemHeight: uni.upx2px(12.7),
itemGap: uni.upx2px(5.62),
bottom: uni.upx2px(9.05),
data: [],
selected:{}
},
series:JSON.parse(JSON.stringify(this.chartData.series))
}
if(this.chartData.series.length>1){
this.chartData.series.forEach((item,index)=>{
var legendObj = {};
if(index<2){
option.legend.selected[item.name]=true
}else{
option.legend.selected[item.name]=false
}
legendObj.name = item.name;
legendObj.icon="emptyCircle"
option.legend.data.push(legendObj);
item.symbol="emptyCircle";
item.symbolSize=uni.upx2px(12.7)
})
}
option.xAxis.data =JSON.parse(JSON.stringify(this.chartData.xaxis.data));
// myChart.clear();
setTimeout(() => {
myChart.hideLoading();
}, 500);
myChart.setOption(option);
// option.grid.left=uni.upx2px(String(yMax).length*uni.upx2px(21.74))+uni.upx2px(18.11)
option.grid.left=uni.upx2px(18.11)+30+String(yMax).length*uni.upx2px(9.05)
myChart.setOption(option);
}
}
}
</script>
<style>
.chart{
width:706.52upx;
height:438.4upx;
margin: 0 auto;
background: #FFFFFF;
margin-bottom: 18.2upx;
border-radius:7.24upx;
overflow: hidden;
}
</style>
<template>
<view :class="setCollapseCellClass" :hover-class="disabled === true || disabled === 'true' ? '' : 'uni-collapse-cell--hover'">
<view class="uni-collapse-cell__title" @click="onClick">
<view class="uni-collapse-cell__title-extra" v-if="thumb">
<image class="uni-collapse-cell__title-img" :src="thumb"></image>
</view>
<view class="uni-collapse-cell__title-inner">
<view class="uni-collapse-cell__title-text">{{title}}</view>
</view>
<view class="uni-collapse-cell__title-arrow" :class="setActive">
<uni-icon color="#bbb" size="20" type="arrowdown"></uni-icon>
</view>
</view>
<view class="uni-collapse-cell__content" :class="animation==='outer' ? 'uni-collapse-cell--animation' : ''" :style="{height:isOpen==='true' || isOpen=== true ? height + 'px' : '0px'}">
<view :class="setContClass" :id="elId">
<slot />
</view>
</view>
</view>
</template>
<script>
import uniIcon from '../uni-icon/uni-icon.vue'
export default {
name: 'uni-collapse-item',
components: {
uniIcon
},
data() {
const elId = `Uni_${Math.ceil(Math.random() * 10e5).toString(36)}`
return {
isOpen: this.open,
height: 0,
elId: elId
};
},
watch: {
open(val) {
this.isOpen = val
}
},
computed: {
index() {
return this.$parent.$children.indexOf(this)
},
nameSync() {
return this.name === 0 ? this.index : this.name
},
setCollapseCellClass() {
let classList = ['uni-collapse-cell']
if (this.disabled === true || this.disabled === 'true') {
classList.push('uni-collapse-cell--disabled')
}
if (this.isOpen === true || this.isOpen === 'true') {
classList.push('uni-collapse-cell--open')
}
return classList
},
setActive() {
let classList = []
if (this.isOpen === true || this.isOpen === 'true') {
classList.push('uni-active')
}
return classList
},
setContClass() {
let classList = []
if (this.isOpen === true || this.isOpen === 'true') {
classList.push('uni-active')
}
if (this.animation === 'inner') {
classList.push('uni-collapse-cell__inner')
}
return classList
}
},
props: {
animation: { //动画效果:inner内容动;outer容器动
type: String,
default: 'outer'
},
title: String, //列表标题
name: { //唯一标识符
type: [Number, String],
default: 0
},
disabled: { //是否禁用
type: [Boolean, String],
default: false
},
open: { //是否展开
type: [Boolean, String],
default: false
},
thumb: String //缩略图
},
created() {
let parent = this.$parent || this.$root
let name = parent.$options.name
while (parent && name !== 'uni-collapse') {
parent = parent.$parent
if (parent) {
name = parent.$options.name
}
}
this.parent = parent
},
// #ifdef H5
mounted() {
let view = uni.createSelectorQuery().select(`#${this.elId}`);
view.fields({
size: true
}, data => {
this.height = data.height
}).exec();
},
// #endif
// #ifndef H5
onReady() {
let view = uni.createSelectorQuery().select(`#${this.elId}`);
view.fields({
size: true
}, data => {
this.height = data.height
}).exec();
},
// #endif
methods: {
onClick() {
if (this.disabled) {
return
}
let accordion = this.parent.accordion ? this.parent.accordion : false
if (accordion === true || accordion === 'true') {
this.$parent.$children.forEach(vm => {
if (vm === this) {
return
}
vm.isOpen = false
})
}
this.isOpen = !this.isOpen
this.parent.onChange && this.parent.onChange(this)
}
}
}
</script>
<style lang="scss">
@mixin collapse-hover {
background-color: $uni-bg-color-hover;
}
@mixin collapse-disabled {
opacity: 0.3;
}
$collapse-title-pd:$uni-spacing-col-lg $uni-spacing-row-lg;
.uni-collapse-cell {
position: relative;
&--hover {
@include collapse-hover;
}
&--open {
@include collapse-hover;
}
&--disabled {
@include collapse-disabled;
}
&--animation {
transition: all 0.3s;
}
&:after {
position: absolute;
z-index: 3;
right: 0;
bottom: 0;
left: 0px;
height: 1px;
content: '';
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
background-color: $uni-border-color;
}
&__title {
padding: $collapse-title-pd;
width: 100%;
box-sizing: border-box;
flex: 1;
position: relative;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
&-extra {
margin-right: 18upx;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
}
&-img {
height: $uni-img-size-base;
width: $uni-img-size-base;
}
&-arrow {
width: 20px;
height: 20px;
transform: rotate(0deg);
transform-origin: center center;
transition: transform 0.3s;
&.uni-active {
transform: rotate(-180deg);
}
}
&-inner {
flex: 1;
overflow: hidden;
display: flex;
flex-direction: column;
}
&-text {
font-size: $uni-font-size-lg;
text-overflow: ellipsis;
white-space: nowrap;
color: inherit;
line-height: 1.5;
overflow: hidden;
}
}
&__content {
position: relative;
width: 100%;
overflow: hidden;
background: $uni-bg-color;
view {
font-size: $uni-font-size-base;
}
}
&__inner {
opacity: 0;
transform: translateY(-50%);
transition: all 0.3s;
transform-origin: center center;
&.uni-active {
opacity: 1;
transform: translateY(0px);
}
}
}
</style>
<template>
<view class="uni-collapse">
<slot></slot>
</view>
</template>
<script>
export default {
name: 'uni-collapse',
props: {
accordion: { //是否开启手风琴效果
type: [Boolean, String],
default: false
}
},
data() {
return {}
},
mounted() {
let children = this.$children
let childrens = []
this.getChildren(children, childrens)
this.childrens = childrens
if (this.accordion === true || this.accordion === 'true') {
childrens.forEach((vm, index) => {
childrens.forEach((v, i) => {
if (index >= i) {
return
}
if (v.isOpen) {
vm.isOpen = false
}
})
})
}
},
methods: {
onChange(e) {
let activeItem = []
this.childrens.forEach((vm, index) => {
if (vm.isOpen) {
activeItem.push(vm.nameSync)
}
})
this.$emit('change', activeItem)
},
getChildren(arr, childrens) {
for (let i = 0, length = arr.length; i < length; i++) {
let name = arr[i].$options.name
if (name !== 'uni-collapse-item') {
arr[i].$children && this.getChildren(arr[i].$children, childrens)
} else {
childrens.push(arr[i])
}
}
}
}
}
</script>
<style lang="scss">
.uni-collapse {
background-color: $uni-bg-color;
position: relative;
width: 100%;
display: flex;
flex-direction: column;
&:after {
position: absolute;
z-index: 10;
right: 0;
bottom: 0;
left: 0;
height: 1px;
content: '';
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
background-color: $uni-border-color;
}
&:before {
position: absolute;
z-index: 10;
right: 0;
top: 0;
left: 0;
height: 1px;
content: '';
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
background-color: $uni-border-color;
}
}
</style>
\ No newline at end of file \ No newline at end of file
### Icon 图标
用于展示 icon,组件名:``uni-icon``,代码块: uIcon。
**使用方式:**
``script`` 中引用组件
```javascript
import uniIcon from "@/components/uni-icon/uni-icon.vue"
export default {
components: {uniIcon}
}
```
``template`` 中使用组件
```html
<uni-icon type="contact" size="30"></uni-icon>
```
实际效果参考:[https://github.com/dcloudio/uni-ui](https://github.com/dcloudio/uni-ui)
**Icon 属性说明:**
|属性名 |类型|默认值 |说明|
|---|----|---|---|
|type |String |-|图标图案,参考下表|
|color |String |-|图标颜色 |
|size |Number |24|图标大小|
|@click |EventHandle|-|点击 Icon 触发事件|
**type 类型:**
![icon](https://img-cdn-qiniu.dcloud.net.cn/img/icon.png)
\ No newline at end of file \ No newline at end of file
<template>
<view class="linechart">
<div :id='bindId' class="chart"></div>
</view>
</template>
<script>
export default {
data () {
return {
yMax:0
}
},
mounted() {
},
watch:{
bindId:function(newValue,oldValue){
},
chartData:{
handler:function(newValue,oldValue){
this.drawLineBar();
},
deep:true
},
},
props:{
bindId:{
type:String,
default:''
},
chartData: {
type: Object,
default: function(){
return {}
}
}
},
methods: {
drawLineBar() {
var yMax=0;
let myChart = {};
let chartDom = document.getElementById(this.bindId);
myChart = this.echarts.init(chartDom);
myChart.showLoading('default', {
text: '',
color: '#409eff'
});
var option = {
title:{
show:true,
text:this.chartData.title,
left: uni.upx2px(18.11),
top: uni.upx2px(10.86),
textStyle: {
fontWeight: "normal",
fontSize: uni.upx2px(25.4),
color: '#4A4A4A'
}
},
backgroundColor: '#fff',
color: ["#0069FF", "#3BB8FF", "#6784e3", "#ff9631", "#ffc62e","#7460ee","#eb6100"],
tooltip:{
renderMode:'richText'
},
grid: {
left:uni.upx2px(76.08),
right: uni.upx2px(76.08),
top: uni.upx2px(100.33),
bottom: uni.upx2px(9.05)+uni.upx2px(21.74)+12+uni.upx2px(21.74)+12
},
yAxis: [{
minInterval :1,
name:'客流量',
scale: true,
axisLabel: {
textStyle: {
color: '#9B9B9B',
fontSize:uni.upx2px(21.74)
},
formatter:function(value){
if(value>yMax){
yMax=value;
}
return value
}
},
axisLine : {
show: false,
lineStyle: {
color: '#888'
}
},
axisTick:{
show:false
},
splitLine:{
lineStyle: {
color: '#f3f3f3'
}
}
},{
name:'百分比',
scale: true,
axisLabel: {
textStyle: {
color: '#9B9B9B',
fontSize:uni.upx2px(21.74)
}
},
axisLine : {
show: false,
lineStyle: {
color: '#888'
}
},
axisTick:{
show:false
},
splitLine:{
lineStyle: {
color: '#f3f3f3'
}
}
}],
xAxis: {
axisTick:{
show:false
},
axisLine : {
show: false,
lineStyle: {
color: '#888'
}
},
axisLabel : {
textStyle: {
color: '#9B9B9B',
fontSize:uni.upx2px(21.74)
}
},
splitLine : {
show: false
}
},
legend : {
type:"scroll",
orient: "horizontal",
textStyle: {
fontSize: uni.upx2px(21.74),
color:'rgba(74,74,74,1)'
},
itemWidth: uni.upx2px(12.7),
itemHeight: uni.upx2px(12.7),
itemGap: uni.upx2px(5.62),
bottom: uni.upx2px(9.05),
data: [],
selected:{}
},
series:JSON.parse(JSON.stringify(this.chartData.series))
}
if(option.series.length>1){
option.series.forEach((item,index)=>{
if(index==1){
item.yAxisIndex=1;
}
var legendObj = {};
if(index<2){
option.legend.selected[item.name]=true
}else{
option.legend.selected[item.name]=false
}
legendObj.name = item.name;
legendObj.icon="emptyCircle"
option.legend.data.push(legendObj);
item.symbol="emptyCircle";
item.symbolSize=uni.upx2px(12.7)
})
}
option.xAxis.data =JSON.parse(JSON.stringify(this.chartData.xaxis.data));
// myChart.clear();
setTimeout(() => {
myChart.hideLoading();
}, 500);
myChart.setOption(option);
// option.grid.left=uni.upx2px(String(yMax).length*uni.upx2px(21.74))+uni.upx2px(18.11)
option.grid.left=uni.upx2px(18.11)+30+String(yMax).length*uni.upx2px(9.05)
myChart.setOption(option);
}
}
}
</script>
<style>
.chart{
width:706.52upx;
height:438.4upx;
margin: 0 auto;
background: #FFFFFF;
margin-bottom: 18.2upx;
border-radius:7.24upx;
overflow: hidden;
}
</style>
...@@ -12,14 +12,14 @@ ...@@ -12,14 +12,14 @@
} }
}, },
mounted() { mounted() {
console.log('chartData',this.chartData)
}, },
watch:{ watch:{
bindId:function(newValue,oldValue){ bindId:function(newValue,oldValue){
}, },
chartData:{ chartData:{
handler(newValue,oldValue){ handler:function(newValue,oldValue){
this.drawLine(); this.drawLine();
}, },
deep:true deep:true
}, },
...@@ -37,17 +37,11 @@ ...@@ -37,17 +37,11 @@
} }
}, },
methods: { methods: {
initChartInstance(domId) {
let chartInstance = null,
chartDom = document.getElementById(domId);
chartInstance = this.echarts.getInstanceByDom(chartDom) || this.echarts.init(chartDom);
console.log(chartInstance.geOption())
return chartInstance;
},
drawLine() { drawLine() {
var yMax=0; var yMax=0;
let myChart = {}; let myChart = {};
let chartDom = document.getElementById(this.bindId); let chartDom = document.getElementById(this.bindId);
console.log('line',chartDom)
myChart = this.echarts.init(chartDom); myChart = this.echarts.init(chartDom);
myChart.showLoading('default', { myChart.showLoading('default', {
text: '', text: '',
...@@ -127,6 +121,7 @@ ...@@ -127,6 +121,7 @@
} }
}, },
legend : { legend : {
type:'scroll',
orient: "horizontal", orient: "horizontal",
x: "center", x: "center",
textStyle: { textStyle: {
...@@ -172,7 +167,7 @@ ...@@ -172,7 +167,7 @@
myChart.hideLoading(); myChart.hideLoading();
}, 500); }, 500);
myChart.setOption(option); myChart.setOption(option);
console.log('option', JSON.stringify(option)) console.log('option', String(yMax).length)
// option.grid.left=uni.upx2px(String(yMax).length*uni.upx2px(21.74))+uni.upx2px(18.11) // option.grid.left=uni.upx2px(String(yMax).length*uni.upx2px(21.74))+uni.upx2px(18.11)
option.grid.left=uni.upx2px(18.11)+15+String(yMax).length*uni.upx2px(9.05) option.grid.left=uni.upx2px(18.11)+15+String(yMax).length*uni.upx2px(9.05)
myChart.setOption(option); myChart.setOption(option);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<title> <title>
<%= htmlWebpackPlugin.options.title %> <%= htmlWebpackPlugin.options.title %>
</title> </title>
<script src="static/common.js"></script> <script src="./static/common.js"></script>
<script> <script>
document.addEventListener('DOMContentLoaded', function() { document.addEventListener('DOMContentLoaded', function() {
document.documentElement.style.fontSize = document.documentElement.clientWidth / 20 + 'px' document.documentElement.style.fontSize = document.documentElement.clientWidth / 20 + 'px'
......
...@@ -12,6 +12,7 @@ import mallzh from 'i18n/langs/mallCN' ...@@ -12,6 +12,7 @@ import mallzh from 'i18n/langs/mallCN'
import 'vue-easytable/libs/themes-base/index.css' import 'vue-easytable/libs/themes-base/index.css'
// 导入 table 和 分页组件 // 导入 table 和 分页组件
import {VTable,VPagination} from 'vue-easytable' import {VTable,VPagination} from 'vue-easytable'
import permissionsFun from './common/common'
//引入弹窗组件 //引入弹窗组件
import MobileMessage from 'mobile-message' import MobileMessage from 'mobile-message'
...@@ -22,13 +23,14 @@ import 'mobile-message/dist/message.css' ...@@ -22,13 +23,14 @@ import 'mobile-message/dist/message.css'
// vue prototype // vue prototype
import './common/vproto.js' import './common/vproto.js'
Vue.prototype.permissionsFun = permissionsFun
// 注册到全局 // 注册到全局
Vue.component(VTable.name, VTable) Vue.component(VTable.name, VTable)
Vue.component(VPagination.name, VPagination) Vue.component(VPagination.name, VPagination)
Vue.use(VueI18n) Vue.use(VueI18n)
Vue.use(AwesomePicker); Vue.use(AwesomePicker);
Vue.use(MobileMessage) Vue.use(MobileMessage);
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.prototype.echarts=echarts; Vue.prototype.echarts=echarts;
App.mpType = 'app' App.mpType = 'app'
...@@ -58,9 +60,9 @@ const i18n = new VueI18n({ ...@@ -58,9 +60,9 @@ const i18n = new VueI18n({
} }
}) })
Vue.prototype._i18n = i18n; Vue.prototype._i18n = i18n;
if(process.env.NODE_ENV === 'development') { // if(process.env.NODE_ENV === 'development') {
window.url = 'https://store.keliuyun.com/report' // window.url = 'https://store.keliuyun.com/report'
} // }
const app = new Vue({ const app = new Vue({
i18n, i18n,
store, store,
......
...@@ -5,6 +5,12 @@ ...@@ -5,6 +5,12 @@
"versionName" : "1.0.0", "versionName" : "1.0.0",
"versionCode" : "100", "versionCode" : "100",
"transformPx" : false, "transformPx" : false,
"networkTimeout":{
"request":30000,
"connectSocket":30000,
"uploadFile":30000,
"downloadFile":30000
},
"app-plus" : { "app-plus" : {
/* 5+App特有相关 */ /* 5+App特有相关 */
"splashscreen" : { "splashscreen" : {
......
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
...@@ -22,7 +22,12 @@ ...@@ -22,7 +22,12 @@
},{ },{
"path": "pages/profile/profile", "path": "pages/profile/profile",
"style": { "style": {
"navigationBarTitleText": "我的" "navigationBarTitleText": "更多"
}
},{
"path": "pages/profile/video/video",
"style": {
"navigationBarTitleText": "视频巡店"
} }
},{ },{
"path": "pages/list/mallList", "path": "pages/list/mallList",
...@@ -175,6 +180,11 @@ ...@@ -175,6 +180,11 @@
"navigationBarTitleText": "客群分时统计" "navigationBarTitleText": "客群分时统计"
} }
}, { }, {
"path": "pages/analysis/inrateReport/inrateReport",
"style": {
"navigationBarTitleText": "进店率统计"
}
}, {
"path":"pages/passenger/conditions/groupTimeOption", "path":"pages/passenger/conditions/groupTimeOption",
"style": { "style": {
"navigationBarTitleText": "" "navigationBarTitleText": ""
...@@ -226,24 +236,24 @@ ...@@ -226,24 +236,24 @@
"backgroundColor": "#ffffff", "backgroundColor": "#ffffff",
"list": [{ "list": [{
"pagePath": "pages/index/index", "pagePath": "pages/index/index",
"iconPath": "static/index/index.png", "iconPath": "static/index/index.svg",
"selectedIconPath": "static/index/indexSelect.png", "selectedIconPath": "static/index/indexSelect.svg",
"text": "首页" "text": "首页"
}, { }, {
"pagePath": "pages/analysis/index", "pagePath": "pages/analysis/index",
"iconPath": "static/index/sny.png", "iconPath": "static/index/sny.svg",
"selectedIconPath": "static/index/snySelect.png", "selectedIconPath": "static/index/snySelect.svg",
"text": "综合分析" "text": "综合分析"
}, { }, {
"pagePath": "pages/passenger/passenger", "pagePath": "pages/passenger/passenger",
"iconPath": "static/index/flow.png", "iconPath": "static/index/flow.svg",
"selectedIconPath": "static/index/flowSelect.png", "selectedIconPath": "static/index/flowSelect.svg",
"text": "精准客流" "text": "精准客流"
}, { }, {
"pagePath": "pages/profile/profile", "pagePath": "pages/profile/profile",
"iconPath": "static/index/my.png", "iconPath": "static/index/my.svg",
"selectedIconPath": "static/index/mySelect.png", "selectedIconPath": "static/index/mySelect.svg",
"text": "我的" "text": "更多"
}] }]
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -185,6 +185,7 @@ ...@@ -185,6 +185,7 @@
getChartData(){ getChartData(){
this.orgIds='' this.orgIds=''
var data={} var data={}
var url=''
var holidayEventId=''; var holidayEventId='';
uni.getStorage({ uni.getStorage({
key:'eventIdArr', key:'eventIdArr',
...@@ -194,15 +195,68 @@ ...@@ -194,15 +195,68 @@
complete: (res) => { complete: (res) => {
} }
}) })
this.accountId.forEach(item=>{ if(this.reportType=='mall'){
this.orgIds+=item+',' url=window.url+'/report/holidayObject/mall';
}) this.accountId.forEach(item=>{
this.orgIds=this.orgIds.substring(0,this.orgIds.length-1); this.orgIds+=item+','
if(holidayEventId==''){ })
this.orgIds=this.orgIds.substring(0,this.orgIds.length-1);
data={
orgIds:this.orgIds,
chartIds:this.chartIds,
date:this.date.split(',')[0],
holidayEventId:holidayEventId,
kpiType:'TRAFFIC',
_t:Date.parse(new Date())/1000
}
}else if(this.reportType=='gate'){
url=window.url+'/report/holidayObject/gate';
this.gateId.forEach(item=>{
this.orgIds+=item+','
})
this.orgIds=this.orgIds.substring(0,this.orgIds.length-1);
data={
orgIds:this.orgIds,
chartIds:this.chartIds,
date:this.date.split(',')[0],
holidayEventId:holidayEventId,
kpiType:'TRAFFIC',
_t:Date.parse(new Date())/1000
}
}else if(this.reportType=='floor'){
url=window.url+'/report/holidayObject/floor';
this.floorId.forEach(item=>{
this.orgIds+=item+','
})
this.orgIds=this.orgIds.substring(0,this.orgIds.length-1);
data={
orgIds:this.orgIds,
chartIds:this.chartIds,
date:this.date.split(',')[0],
holidayEventId:holidayEventId,
kpiType:'TRAFFIC',
_t:Date.parse(new Date())/1000
}
}else if(this.reportType=='area'){
url=window.url+'/report/holidayObject/zone';
this.storeId.forEach(item=>{
this.orgIds+=item+','
})
this.orgIds=this.orgIds.substring(0,this.orgIds.length-1);
data={
orgIds:this.orgIds,
chartIds:this.chartIds,
date:this.date.split(',')[0],
holidayEventId:holidayEventId,
kpiType:'TRAFFIC',
_t:Date.parse(new Date())/1000
}
}
if(!holidayEventId){
uni.request({ uni.request({
url:window.url+'/events/getEvent', url:window.url+'/events/getEvent',
data:{ data:{
mallId: this.orgIds, mallId: this.accountId[0],
year: this.date.split(',')[0], year: this.date.split(',')[0],
_t:Date.parse(new Date())/1000 _t:Date.parse(new Date())/1000
}, },
...@@ -211,19 +265,7 @@ ...@@ -211,19 +265,7 @@
}, },
method:'GET', method:'GET',
success:(res) =>{ success:(res) =>{
holidayEventId=res.data.data[0].id; data.holidayEventId=res.data.data[0].id;
var url=window.url+'/report/holidayObject/mall';
if(this.reportType=='mall'){
url=window.url+'/report/holidayObject/mall';
data={
orgIds:this.orgIds,
chartIds:this.chartIds,
date:this.date.split(',')[0],
holidayEventId:holidayEventId,
kpiType:'TRAFFIC',
_t:Date.parse(new Date())/1000
}
}
uni.request({ uni.request({
url:url, url:url,
header: { header: {
...@@ -241,18 +283,6 @@ ...@@ -241,18 +283,6 @@
} }
}) })
}else{ }else{
var url=window.url+'/report/holidayObject/mall';
if(this.reportType=='mall'){
url=window.url+'/report/holidayObject/mall';
data={
orgIds:this.orgIds,
chartIds:this.chartIds,
date:this.date.split(',')[0],
holidayEventId:holidayEventId,
kpiType:'TRAFFIC',
_t:Date.parse(new Date())/1000
}
}
uni.request({ uni.request({
url:url, url:url,
header: { header: {
......
...@@ -68,6 +68,11 @@ ...@@ -68,6 +68,11 @@
<span class="selectItem">{{oneGateText}}</span> <span class="selectItem">{{oneGateText}}</span>
<image class="rArrow" src="../../static/analysis/rArrow.png" mode="widthFix"></image> <image class="rArrow" src="../../static/analysis/rArrow.png" mode="widthFix"></image>
</div> </div>
<div class="conditionItem" @tap="goEventList" v-show="showList['gate']['event']">
<span class="cTitle">活动</span>
<span class="selectItem">{{eventText}}</span>
<image class="rArrow" src="../../static/analysis/rArrow.png" mode="widthFix"></image>
</div>
<div class="conditionItem" @tap="dateShow"> <div class="conditionItem" @tap="dateShow">
<span class="cTitle">日期</span> <span class="cTitle">日期</span>
<span class="selectItem">{{dateText}}</span> <span class="selectItem">{{dateText}}</span>
...@@ -95,6 +100,11 @@ ...@@ -95,6 +100,11 @@
<span class="selectItem">{{oneFloorText}}</span> <span class="selectItem">{{oneFloorText}}</span>
<image class="rArrow" src="../../static/analysis/rArrow.png" mode="widthFix"></image> <image class="rArrow" src="../../static/analysis/rArrow.png" mode="widthFix"></image>
</div> </div>
<div class="conditionItem" @tap="goEventList" v-show="showList['floor']['event']">
<span class="cTitle">活动</span>
<span class="selectItem">{{eventText}}</span>
<image class="rArrow" src="../../static/analysis/rArrow.png" mode="widthFix"></image>
</div>
<div class="conditionItem" @tap="dateShow"> <div class="conditionItem" @tap="dateShow">
<span class="cTitle">日期</span> <span class="cTitle">日期</span>
<span class="selectItem">{{dateText}}</span> <span class="selectItem">{{dateText}}</span>
...@@ -122,6 +132,11 @@ ...@@ -122,6 +132,11 @@
<span class="selectItem">{{oneStoreText}}</span> <span class="selectItem">{{oneStoreText}}</span>
<image class="rArrow" src="../../static/analysis/rArrow.png" mode="widthFix"></image> <image class="rArrow" src="../../static/analysis/rArrow.png" mode="widthFix"></image>
</div> </div>
<div class="conditionItem" @tap="goEventList" v-show="showList['area']['event']">
<span class="cTitle">活动</span>
<span class="selectItem">{{eventText}}</span>
<image class="rArrow" src="../../static/analysis/rArrow.png" mode="widthFix"></image>
</div>
<div class="conditionItem" @tap="dateShow"> <div class="conditionItem" @tap="dateShow">
<span class="cTitle">日期</span> <span class="cTitle">日期</span>
<span class="selectItem">{{dateText}}</span> <span class="selectItem">{{dateText}}</span>
...@@ -168,8 +183,8 @@ ...@@ -168,8 +183,8 @@
data(){ data(){
return{ return{
showList:{}, showList:{},
objText:'对象', objText:'对象',
objId:'one', objId:'more',
pageType:'mall', pageType:'mall',
leftImg:leftImg, leftImg:leftImg,
rightText:'保存', rightText:'保存',
...@@ -446,11 +461,6 @@ ...@@ -446,11 +461,6 @@
}, },
method:'GET', method:'GET',
success:(res) =>{ success:(res) =>{
var idArr=[this.oneAccountId];
uni.setStorage({
key:'selectAccountIdArr',
data:JSON.stringify(idArr)
})
this.oneGateText=res.data.data[0].name; this.oneGateText=res.data.data[0].name;
this.oneGateId=res.data.data[0].id; this.oneGateId=res.data.data[0].id;
this.gateText=res.data.data[0].name; this.gateText=res.data.data[0].name;
...@@ -477,11 +487,6 @@ ...@@ -477,11 +487,6 @@
}, },
method:'GET', method:'GET',
success:(res) =>{ success:(res) =>{
var idArr=[this.oneAccountId];
uni.setStorage({
key:'selectAccountIdArr',
data:JSON.stringify(idArr)
})
this.oneGateText=res.data.data[0].name; this.oneGateText=res.data.data[0].name;
this.oneGateId=res.data.data[0].id; this.oneGateId=res.data.data[0].id;
} }
...@@ -501,11 +506,6 @@ ...@@ -501,11 +506,6 @@
}, },
method:'GET', method:'GET',
success:(res) =>{ success:(res) =>{
var idArr=[this.oneAccountId];
uni.setStorage({
key:'selectAccountIdArr',
data:JSON.stringify(idArr)
})
this.oneFloorText=res.data.data[0].name; this.oneFloorText=res.data.data[0].name;
this.oneFloorId=res.data.data[0].id; this.oneFloorId=res.data.data[0].id;
this.floorText=res.data.data[0].name; this.floorText=res.data.data[0].name;
...@@ -533,11 +533,6 @@ ...@@ -533,11 +533,6 @@
}, },
method:'GET', method:'GET',
success:(res) =>{ success:(res) =>{
var idArr=[this.oneAccountId];
uni.setStorage({
key:'selectAccountIdArr',
data:JSON.stringify(idArr)
})
this.storeText=res.data.data[0].name; this.storeText=res.data.data[0].name;
this.oneStoreText=res.data.data[0].name; this.oneStoreText=res.data.data[0].name;
var storeidArr=[]; var storeidArr=[];
...@@ -563,11 +558,6 @@ ...@@ -563,11 +558,6 @@
}, },
method:'GET', method:'GET',
success:(res) =>{ success:(res) =>{
var idArr=[this.oneAccountId];
uni.setStorage({
key:'selectAccountIdArr',
data:JSON.stringify(idArr)
})
this.oneStoreText=res.data.data[0].name; this.oneStoreText=res.data.data[0].name;
} }
}) })
...@@ -606,11 +596,6 @@ ...@@ -606,11 +596,6 @@
}, },
method:'GET', method:'GET',
success:(res) =>{ success:(res) =>{
var idArr=[this.oneAccountId];
uni.setStorage({
key:'selectAccountIdArr',
data:JSON.stringify(idArr)
})
if(res.data.data[0]){ if(res.data.data[0]){
this.eventText=res.data.data[0].name; this.eventText=res.data.data[0].name;
this.eventidArr=[]; this.eventidArr=[];
...@@ -715,10 +700,21 @@ ...@@ -715,10 +700,21 @@
urls='weekReport/weekReport' urls='weekReport/weekReport'
} }
break; break;
case 9:{
urls='inrateReport/inrateReport'
}
break;
} }
uni.navigateTo({ if(this.backUrl==3){
url:urls+"?types="+this.activeType, uni.navigateTo({
}) url:urls+"?types="+this.activeType+'&report=rank',
})
}else{
uni.navigateTo({
url:urls+"?types="+this.activeType,
})
}
}, },
goMallList(){ goMallList(){
uni.navigateTo({ uni.navigateTo({
...@@ -743,49 +739,49 @@ ...@@ -743,49 +739,49 @@
}, },
goEventList(){ goEventList(){
uni.navigateTo({ uni.navigateTo({
url:"../list/eventList?url=../analysis/condition&type="+this.activeType, url:"../list/eventList?url=../analysis/condition&type="+this.activeType+'&mallId='+this.oneAccountId,
animationType: 'slide-in-right', animationType: 'slide-in-right',
animationDuration: 200 animationDuration: 200
}) })
}, },
goMoreGateList(){ goMoreGateList(){
uni.navigateTo({ uni.navigateTo({
url:"../list/moreGateList?url=../analysis/condition&type="+this.activeType, url:"../list/moreGateList?url=../analysis/condition&type="+this.activeType+'&mallId='+this.oneAccountId,
animationType: 'slide-in-right', animationType: 'slide-in-right',
animationDuration: 200 animationDuration: 200
}) })
}, },
goOneGateList(){ goOneGateList(){
uni.navigateTo({ uni.navigateTo({
url:"../list/oneGateList?url=../analysis/condition&type="+this.activeType, url:"../list/oneGateList?url=../analysis/condition&type="+this.activeType+'&mallId='+this.oneAccountId,
animationType: 'slide-in-right', animationType: 'slide-in-right',
animationDuration: 200 animationDuration: 200
}) })
}, },
goMoreFloorList(){ goMoreFloorList(){
uni.navigateTo({ uni.navigateTo({
url:"../list/moreFloorList?url=../analysis/condition&type="+this.activeType, url:"../list/moreFloorList?url=../analysis/condition&type="+this.activeType+'&mallId='+this.oneAccountId,
animationType: 'slide-in-right', animationType: 'slide-in-right',
animationDuration: 200 animationDuration: 200
}) })
}, },
goOneFloorList(){ goOneFloorList(){
uni.navigateTo({ uni.navigateTo({
url:"../list/oneFloorList?url=../analysis/condition&type="+this.activeType, url:"../list/oneFloorList?url=../analysis/condition&type="+this.activeType+'&mallId='+this.oneAccountId,
animationType: 'slide-in-right', animationType: 'slide-in-right',
animationDuration: 200 animationDuration: 200
}) })
}, },
goMoreStoreList(){ goMoreStoreList(){
uni.navigateTo({ uni.navigateTo({
url:"../list/moreStoreList?url=../analysis/condition&type="+this.activeType, url:"../list/moreStoreList?url=../analysis/condition&type="+this.activeType+'&mallId='+this.oneAccountId,
animationType: 'slide-in-right', animationType: 'slide-in-right',
animationDuration: 200 animationDuration: 200
}) })
}, },
goOneStoreList(){ goOneStoreList(){
uni.navigateTo({ uni.navigateTo({
url:"../list/oneStoreList?url=../analysis/condition&type="+this.activeType, url:"../list/oneStoreList?url=../analysis/condition&type="+this.activeType+'&mallId='+this.oneAccountId,
animationType: 'slide-in-right', animationType: 'slide-in-right',
animationDuration: 200 animationDuration: 200
}) })
...@@ -1137,11 +1133,11 @@ ...@@ -1137,11 +1133,11 @@
this.eventText=''; this.eventText='';
this.eventidArr=[]; this.eventidArr=[];
} }
var idArr=[this.oneAccountId]; // var idArr=[this.oneAccountId];
uni.setStorage({ // uni.setStorage({
key:'selectAccountIdArr', // key:'selectAccountIdArr',
data:JSON.stringify(idArr) // data:JSON.stringify(idArr)
}) // })
uni.setStorage({ uni.setStorage({
key:'eventIdArr', key:'eventIdArr',
data:JSON.stringify(this.eventidArr) data:JSON.stringify(this.eventidArr)
......
...@@ -252,6 +252,39 @@ ...@@ -252,6 +252,39 @@
kpiType:'TRAFFIC', kpiType:'TRAFFIC',
_t:Date.parse(new Date())/1000 _t:Date.parse(new Date())/1000
} }
}else if(this.reportType=='gate'){
this.orgIds=this.gateId[0]
url=window.url+'/report/holidayeEvent/gate';
data={
orgIds:this.orgIds,
startDate:this.date.split(',')[0],
endDate:this.date.split(',')[1],
chartIds:this.chartIds,
kpiType:'TRAFFIC',
_t:Date.parse(new Date())/1000
}
}else if(this.reportType=='floor'){
this.orgIds=this.floorId[0]
url=window.url+'/report/holidayeEvent/floor';
data={
orgIds:this.orgIds,
startDate:this.date.split(',')[0],
endDate:this.date.split(',')[1],
chartIds:this.chartIds,
kpiType:'TRAFFIC',
_t:Date.parse(new Date())/1000
}
}else if(this.reportType=='area'){
this.orgIds=this.storeId[0]
url=window.url+'/report/holidayeEvent/zone';
data={
orgIds:this.orgIds,
startDate:this.date.split(',')[0],
endDate:this.date.split(',')[1],
chartIds:this.chartIds,
kpiType:'TRAFFIC',
_t:Date.parse(new Date())/1000
}
} }
uni.request({ uni.request({
url:url, url:url,
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div> <div>
<headerComp :title="titleStr"></headerComp> <headerComp :title="titleStr"></headerComp>
<div class="listBox"> <div class="listBox">
<view class="itemBox" v-for="item in listData" @tap="goReport(item.src,item.showList)"> <view class="itemBox" v-for="item in listData" @tap="goReport(item.src,item.showList)" v-if="permissionsFun(item.name)">
<img class="icons" :src="item.iconSrc"/> <img class="icons" :src="item.iconSrc"/>
<span class="texts">{{item.text}}</span> <span class="texts">{{item.text}}</span>
<img class="arrows" :src="item.rArrow" alt=""/> <img class="arrows" :src="item.rArrow" alt=""/>
...@@ -36,19 +36,20 @@ ...@@ -36,19 +36,20 @@
titleStr:'综合分析', titleStr:'综合分析',
listData:[{ listData:[{
text:"基础统计", text:"基础统计",
name:'baseasis',
iconSrc:baseIcon, iconSrc:baseIcon,
rArrow:arrow, rArrow:arrow,
src:'staticReport/staticDayReport', src:'staticReport/staticDayReport',
showList:{ showList:{
gateTab:true, gateTab:true,
mall:{ mall:{
obj:false, obj:true,
oneMall:false, oneMall:false,
moreMall:true, moreMall:true,
event:false event:false
}, },
gate:{ gate:{
obj:false, obj:true,
oneMall:true, oneMall:true,
moreMall:false, moreMall:false,
oneGate:false, oneGate:false,
...@@ -79,6 +80,7 @@ ...@@ -79,6 +80,7 @@
} }
},{ },{
text:"进出客流对比", text:"进出客流对比",
name:"ioflow",
iconSrc:inout, iconSrc:inout,
rArrow:arrow, rArrow:arrow,
src:'inoutReport/inoutDayReport', src:'inoutReport/inoutDayReport',
...@@ -122,6 +124,7 @@ ...@@ -122,6 +124,7 @@
} }
},{ },{
text:"排行榜统计", text:"排行榜统计",
name:'rankasis',
iconSrc:rank, iconSrc:rank,
rArrow:arrow, rArrow:arrow,
src:'rankReport/rankDayReport', src:'rankReport/rankDayReport',
...@@ -165,6 +168,7 @@ ...@@ -165,6 +168,7 @@
} }
},{ },{
text:"同环比分析", text:"同环比分析",
name:'seqasis',
iconSrc:yoy, iconSrc:yoy,
rArrow:arrow, rArrow:arrow,
src:'yoyReport/yoyDayReport', src:'yoyReport/yoyDayReport',
...@@ -209,6 +213,7 @@ ...@@ -209,6 +213,7 @@
}, },
{ {
text:"时段客流分布", text:"时段客流分布",
name:'timeheat',
iconSrc:timeFlow, iconSrc:timeFlow,
rArrow:arrow, rArrow:arrow,
src:'timeFlowReport/timeFlowReport', src:'timeFlowReport/timeFlowReport',
...@@ -251,13 +256,60 @@ ...@@ -251,13 +256,60 @@
} }
} }
}, },
// {
// text:"周中周末对比分析",
// name:'weekComp',
// iconSrc:week,
// rArrow:arrow,
// src:'weekReport/weekReport',
// showList:{
// gateTab:true,
// mall:{
// obj:false,
// oneMall:true,
// moreMall:false,
// event:false
// },
// gate:{
// obj:false,
// oneMall:true,
// moreMall:false,
// oneGate:true,
// moreGate:false
// },
// floor:{
// obj:false,
// oneMall:true,
// moreMall:false,
// oneFloor:true,
// moreFloor:false
// },
// area:{
// obj:false,
// oneMall:true,
// moreMall:false,
// oneFloor:true,
// moreFloor:false,
// oneStore:true,
// moreStore:false
// },
// date:{
// day:false,
// week:true,
// month:false,
// year:false,
// week2:true
// }
// }
// },
{ {
text:"周中周末对比分析", text:"节假日活动对比",
iconSrc:week, name:'holidayAsis',
iconSrc:active,
rArrow:arrow, rArrow:arrow,
src:'weekReport/weekReport', src:'holidayReport/holidayReport',
showList:{ showList:{
gateTab:true, gateTab:false,
mall:{ mall:{
obj:false, obj:false,
oneMall:true, oneMall:true,
...@@ -289,39 +341,41 @@ ...@@ -289,39 +341,41 @@
}, },
date:{ date:{
day:false, day:false,
week:true, week:false,
month:false, month:false,
year:false, year:true
week2:true
} }
} }
}, },
{ {
text:"节假日活动对比", text:"同节日对象对比",
iconSrc:active, name:'actAsis',
iconSrc:identical,
rArrow:arrow, rArrow:arrow,
src:'holidayReport/holidayReport', src:'actObjReport/actObjReport',
showList:{ showList:{
gateTab:false, gateTab:false,
mall:{ mall:{
obj:false, obj:false,
oneMall:true, oneMall:false,
moreMall:false, moreMall:true,
event:false event:true
}, },
gate:{ gate:{
obj:false, obj:false,
oneMall:true, oneMall:true,
moreMall:false, moreMall:false,
oneGate:true, oneGate:false,
moreGate:false moreGate:true,
event:true
}, },
floor:{ floor:{
obj:false, obj:false,
oneMall:true, oneMall:true,
moreMall:false, moreMall:false,
oneFloor:true, oneFloor:false,
moreFloor:false moreFloor:true,
event:true
}, },
area:{ area:{
obj:false, obj:false,
...@@ -329,8 +383,9 @@ ...@@ -329,8 +383,9 @@
moreMall:false, moreMall:false,
oneFloor:true, oneFloor:true,
moreFloor:false, moreFloor:false,
oneStore:true, oneStore:false,
moreStore:false moreStore:true,
event:true
}, },
date:{ date:{
day:false, day:false,
...@@ -341,31 +396,34 @@ ...@@ -341,31 +396,34 @@
} }
}, },
{ {
text:"同节日对象对比", text:"进店率统计",
iconSrc:identical, name:'storerate',
iconSrc:storeRate,
rArrow:arrow, rArrow:arrow,
src:'actObjReport/actObjReport', src:'inrateReport/inrateReport',
showList:{ showList:{
gateTab:false, gateTab:false,
mall:{ mall:{
obj:false, obj:true,
oneMall:false, oneMall:true,
moreMall:true, moreMall:false,
event:true event:false
}, },
gate:{ gate:{
obj:false, obj:false,
oneMall:true, oneMall:true,
moreMall:false, moreMall:false,
oneGate:false, oneGate:false,
moreGate:true moreGate:true,
event:true
}, },
floor:{ floor:{
obj:false, obj:false,
oneMall:true, oneMall:true,
moreMall:false, moreMall:false,
oneFloor:false, oneFloor:false,
moreFloor:true moreFloor:true,
event:true
}, },
area:{ area:{
obj:false, obj:false,
...@@ -374,13 +432,14 @@ ...@@ -374,13 +432,14 @@
oneFloor:true, oneFloor:true,
moreFloor:false, moreFloor:false,
oneStore:false, oneStore:false,
moreStore:true moreStore:true,
event:true
}, },
date:{ date:{
day:false, day:true,
week:false, week:true,
month:false, month:true,
year:true year:false
} }
} }
} }
...@@ -393,10 +452,6 @@ ...@@ -393,10 +452,6 @@
// iconSrc:weather, // iconSrc:weather,
// rArrow:arrow // rArrow:arrow
// },{ // },{
// text:"进店率统计",
// iconSrc:storeRate,
// rArrow:arrow
// },{
// text:"时间对比分析", // text:"时间对比分析",
// iconSrc:timePair, // iconSrc:timePair,
// rArrow:arrow // rArrow:arrow
......
...@@ -3,10 +3,11 @@ ...@@ -3,10 +3,11 @@
<headerComp :leftImgSrc="leftImg" :title="titleStr" :rightImgSrc="rightImg" @leftClick="backFun" @rightClick="conditionFun"></headerComp> <headerComp :leftImgSrc="leftImg" :title="titleStr" :rightImgSrc="rightImg" @leftClick="backFun" @rightClick="conditionFun"></headerComp>
<div style="height: 18.11upx;"></div> <div style="height: 18.11upx;"></div>
<div class="selectBox"> <div class="selectBox">
<div class="sItem" :class="{ checkedItem: isDay}" @tap="checkFun('day')">天汇总</div>
<div class="sItem" :class="{ checkedItem: isHour}" @click="checkFun('hour')">小时级</div> <div class="sItem" :class="{ checkedItem: isHour}" @click="checkFun('hour')">小时级</div>
<div class="sItem" :class="{ checkedItem: isMin}" @click="checkFun('min')">分钟级</div> <div class="sItem" :class="{ checkedItem: isMin}" @click="checkFun('min')">分钟级</div>
</div> </div>
<v-table v-if="columns.length>0" <!-- <v-table v-if="columns.length>0"
is-horizontal-resize is-horizontal-resize
style="width:100%" style="width:100%"
:columns="columns" :columns="columns"
...@@ -15,7 +16,9 @@ ...@@ -15,7 +16,9 @@
:title-rows="titleRows" :title-rows="titleRows"
row-click-color="#edf7ff" row-click-color="#edf7ff"
:height='600' :height='600'
></v-table> ></v-table> -->
<barchart v-if="isDay" :chart-data="chartDatas" :bind-id='chartId'></barchart>
<linechart v-else-if="isHour||isMin" :chart-data="chartDatas" :bind-id='chartId'></linechart>
</div> </div>
</template> </template>
...@@ -24,6 +27,8 @@ ...@@ -24,6 +27,8 @@
import backArrow from '../../../static/header/backArrow.png' import backArrow from '../../../static/header/backArrow.png'
import other from '../../../static/header/other.png' import other from '../../../static/header/other.png'
import tables from '../../../components/table' import tables from '../../../components/table'
import barchart from '../../../components/barChart'
import linechart from '../../../components/lineChart'
export default{ export default{
data(){ data(){
return{ return{
...@@ -37,7 +42,8 @@ ...@@ -37,7 +42,8 @@
accountId:[], accountId:[],
orgIds:'', orgIds:'',
date:'', date:'',
isHour:true, isDay:true,
isHour:false,
isMin:false, isMin:false,
chartDatas:{}, chartDatas:{},
chartData:{}, chartData:{},
...@@ -46,7 +52,8 @@ ...@@ -46,7 +52,8 @@
gateId:[], gateId:[],
floorId:[], floorId:[],
storeId:[], storeId:[],
titleRows:[] titleRows:[],
chartId:'trafficInAndOut'
} }
}, },
onLoad: function (option) { onLoad: function (option) {
...@@ -128,13 +135,22 @@ ...@@ -128,13 +135,22 @@
} }
}, },
components:{ components:{
headerComp,tables headerComp,tables,barchart,linechart
}, },
methods: { methods: {
checkFun(val){ checkFun(val){
switch (val) switch (val)
{ {
case 'day':{
this.isDay=true;
this.isHour=false;
this.isMin=false;
this.getChartData()
// this.$emit('handleFun','7');
}
break;
case 'hour':{ case 'hour':{
this.isDay=false;
this.isHour=true; this.isHour=true;
this.isMin=false; this.isMin=false;
this.getChartData() this.getChartData()
...@@ -142,6 +158,7 @@ ...@@ -142,6 +158,7 @@
} }
break; break;
case 'min':{ case 'min':{
this.isDay=false;
this.isHour=false; this.isHour=false;
this.isMin=true; this.isMin=true;
this.getChartData() this.getChartData()
...@@ -166,7 +183,7 @@ ...@@ -166,7 +183,7 @@
}, },
getReportKey(){ getReportKey(){
var report='trafficInAndOut'; var report='trafficInAndOut';
this.keyArr=['trafficInAndOutTable']; this.keyArr=['trafficInAndOut'];
uni.showLoading({ uni.showLoading({
title: '加载中' title: '加载中'
...@@ -189,7 +206,7 @@ ...@@ -189,7 +206,7 @@
} }
}) })
this.chartIds=this.chartIds.substring(0,this.chartIds.length-1); this.chartIds=this.chartIds.substring(0,this.chartIds.length-1);
this.getChartData(); this.getChartData('TAB_DAY');
} }
}) })
}, },
...@@ -214,7 +231,6 @@ ...@@ -214,7 +231,6 @@
}) })
this.titleRows.push(oneArr) this.titleRows.push(oneArr)
this.titleRows.push(twoArr) this.titleRows.push(twoArr)
console.log(JSON.stringify(this.titleRows))
this.chartDatas.series.forEach((item,index)=>{ this.chartDatas.series.forEach((item,index)=>{
var obj={} var obj={}
item.data.forEach((item,index)=>{ item.data.forEach((item,index)=>{
...@@ -286,7 +302,9 @@ ...@@ -286,7 +302,9 @@
_t:Date.parse(new Date())/1000 _t:Date.parse(new Date())/1000
} }
} }
if(this.isHour){ if(this.isDay){
data.option='TAB_DAY'
}else if(this.isHour){
data.option='TAB_HOUR' data.option='TAB_HOUR'
}else{ }else{
data.option='TAB_MINUTE' data.option='TAB_MINUTE'
...@@ -302,8 +320,7 @@ ...@@ -302,8 +320,7 @@
uni.hideLoading() uni.hideLoading()
var datas=res.data.data; var datas=res.data.data;
this.chartData=datas.body; this.chartData=datas.body;
this.chartDatas=datas.body.trafficInAndOutTable; this.chartDatas=datas.body.trafficInAndOut;
this.setTabelData()
} }
}) })
......
<template>
<div>
<headerComp :leftImgSrc="leftImg" :title="titleStr" :rightImgSrc="rightImg" @leftClick="backFun" @rightClick="conditionFun"></headerComp>
<div style="height: 18.11upx;"></div>
<!-- <div class="selectBox">
<div class="sItem" :class="{ checkedItem: isDay}" @click="checkFun('day')">天汇总</div>
<div class="sItem" :class="{ checkedItem: isHour}" @click="checkFun('hour')">小时级</div>
<div class="sItem" :class="{ checkedItem: isMin}" @click="checkFun('min')">分钟级</div>
</div> -->
<div v-if="objId=='one'">
<linechart :chart-data="chartDatas" :bind-id='chartId'></linechart>
<v-table v-if="columns.length>0"
is-horizontal-resize
style="width:100%"
:columns="columns"
:table-data="tableData"
row-hover-color="#eee"
row-click-color="#edf7ff"
:height='600'
></v-table>
</div>
<div v-else-if="objId=='more'">
<barchart :chart-data="chartDatas" :bind-id='chartId'></barchart>
<v-table v-if="columns.length>0"
is-horizontal-resize
style="width:100%"
:columns="columns"
:table-data="tableData"
row-hover-color="#eee"
row-click-color="#edf7ff"
:height='600'
></v-table>
</div>
</div>
</template>
<script>
import headerComp from '../../../components/header'
import backArrow from '../../../static/header/backArrow.png'
import other from '../../../static/header/other.png'
import tables from '../../../components/table'
import linechart from '../../../components/lineChart'
import barchart from '../../../components/barChart'
export default{
data(){
return{
titleStr:'进店率统计',
leftImg:backArrow,
rightImg:other,
atoken:'',
keyArr:[],
chartIds:'',
reportType:'mall',
accountId:[],
orgIds:'',
date:'',
isDay:true,
isHour:false,
isMin:false,
chartDatas:{},
chartData:{},
tableData:[],
columns:[],
objId:'one',
currentDateType:'day',
option:'TAB_DAY',
chartId:'',
tableChart:{}
}
},
onLoad: function (option) {
uni.getStorage({
key:'objId',
success:(res)=> {
this.objId=JSON.parse(res.data)[0];
},
complete: (res) => {
}
})
uni.getStorage({
key:'currentDateType',
success:(res)=> {
this.currentDateType=res.data;
},
complete: (res) => {
}
})
if(option.types){
this.reportType=option.types;
}
uni.getStorage({
key:'atoken',
success:(res)=>{
this.atoken=res.data;
}
})
uni.getStorage({
key:'accountList',
success:(res)=>{
if(res.data){
var list=JSON.parse(res.data);
list.forEach((item,index)=>{
if(index==0){
this.accountId.push(item.id)
}
})
uni.getStorage({
key:'selectAccountIdArr',
success:(res)=> {
this.accountId=JSON.parse(res.data);
},
complete: (res) => {
}
})
}
}
})
const date = new Date();
var year = date.getFullYear();
var monthIndex = date.getMonth();
var month = monthIndex+1 > 9 ? monthIndex+1 : '0' + (monthIndex+1);
const d = date.getDate();
var day= d > 9 ? d : '0' + d;
this.date=year+'-'+month+'-'+day;
uni.getStorage({
key:'selectDate',
success:(res)=> {
this.date=res.data
},
complete: (res) => {
}
})
this.chartId = this.objId == 'more'
? 'multiObjectDayChart'
: this.currentDateType === 'day'
? 'singleObjectHourChart'
: 'singleObjectDayChart';
this.getReportKey();
},
computed: {
i18n() {
return this.$t("index")
}
},
components:{
headerComp,tables,linechart,barchart
},
methods: {
backFun(){
uni.reLaunch({
url:"../index",
})
},
conditionFun(){
uni.setStorage({
key:'backUrl',
data:9
})
uni.navigateTo({
url:'../condition'
})
},
getReportKey(){
var report='enteringRate';
if(this.objId=='one'&&this.currentDateType=='day'){
this.keyArr=['singleObjectHourChart','singleObjectHourTable'];
}else if(this.objId=='one'&&this.currentDateType!='day'){
this.keyArr=['singleObjectDayChart','singleObjectDayTable'];
}else if(this.objId=='more'){
this.keyArr=['multiObjectDayChart','multiObjectDayTable'];
}
if(this.currentDateType=='day'){
this.option='TAB_DAY'
}else if(this.currentDateType=='week'){
this.option='TAB_WEEK'
}else if(this.currentDateType=='month'){
this.option='TAB_MONTH'
}
uni.showLoading({
title: '加载中'
});
uni.request({
url:window.url+'/reportCharts',
data:{
report:report,
_t:Date.parse(new Date())/1000
},
header: {
'Authorization': this.atoken //自定义请求头信息
},
method:'GET',
success:(res) =>{
this.chartIds='';
res.data.data.forEach(item=>{
if(this.keyArr.indexOf(item.key)!='-1'){
this.chartIds+=item.id+','
}
})
this.chartIds=this.chartIds.substring(0,this.chartIds.length-1);
this.getChartData();
}
})
},
setTabelData(){
this.columns=[];
this.tableData=[];
this.tableChart.xaxis.data.forEach((item,index)=>{
this.columns.push( {field: item, title:item, width: 20, titleAlign: 'center',columnAlign:'center',isResize:true})
})
this.tableChart.series.forEach((item,index)=>{
var obj={}
item.data.forEach((item,index)=>{
obj[this.tableChart.xaxis.data[index]]=item;
})
this.tableData.push(obj)
})
},
getChartData(){
this.orgIds=''
var data={}
var url=window.url+'/report/enteringRate/mall';
this.accountId.forEach(item=>{
this.orgIds+=item+','
})
this.orgIds=this.orgIds.substring(0,this.orgIds.length-1);
var startDate='',endDate='';
if(this.date.indexOf(',')!=-1){
startDate=this.date.split(',')[0];
endDate=this.date.split(',')[1];
}else{
startDate=this.date;
endDate=this.date;
}
data={
orgIds:this.orgIds,
startDate:startDate,
endDate: endDate,
chartIds:this.chartIds,
option:this.option,
_t:Date.parse(new Date())/1000
}
uni.request({
url:url,
header: {
'Authorization': this.atoken //自定义请求头信息
},
data:data,
method:'GET',
success:(res) =>{
uni.hideLoading()
var datas=res.data.data;
this.chartData=datas.body;
if(this.objId=='one'&&this.currentDateType=='day'){
this.chartDatas=this.chartData.singleObjectHourChart;
this.chartId='singleObjectHourChart';
this.tableChart=this.chartData.singleObjectHourTable;
}else if(this.objId=='one'&&this.currentDateType!='day'){
this.chartDatas=this.chartData.singleObjectDayChart;
this.chartId='singleObjectDayChart';
this.tableChart=this.chartData.singleObjectDayTable;
}else if(this.objId=='more'){
this.chartDatas=this.chartData.multiObjectDayChart;
this.chartId='multiObjectDayChart';
this.tableChart=this.chartData.multiObjectDayTable;
}
this.setTabelData()
}
})
}
},
}
</script>
<style>
.selectBox{
width: 646.73upx;
height: 61.59upx;
font-size: 18.11upx;
line-height: 61.59upx;
display: flex;
flex-direction: row;
margin: 0 auto;
margin-bottom: 18.11upx;
}
.sItem{
flex: 1;
background:#FFFFFF;
text-align: center;
cursor: pointer;
border-right:1px solid #DBDBDB ;
}
.sItem:last-of-type{
border-right:none
}
.checkedItem{
background: #0069FF;
color: #FFFFFF;
border: #0069FF;
}
</style>
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<div class="sItem" :class="{ checkedItem: isHour}" @click="checkFun('hour')">小时级</div> <div class="sItem" :class="{ checkedItem: isHour}" @click="checkFun('hour')">小时级</div>
<div class="sItem" :class="{ checkedItem: isMin}" @click="checkFun('min')">分钟级</div> <div class="sItem" :class="{ checkedItem: isMin}" @click="checkFun('min')">分钟级</div>
</div> --> </div> -->
<v-table v-if="columns.length>0" <!-- <v-table v-if="columns.length>0"
is-horizontal-resize is-horizontal-resize
style="width:100%" style="width:100%"
:columns="columns" :columns="columns"
...@@ -15,7 +15,8 @@ ...@@ -15,7 +15,8 @@
row-hover-color="#eee" row-hover-color="#eee"
row-click-color="#edf7ff" row-click-color="#edf7ff"
:height='600' :height='600'
></v-table> ></v-table> -->
<rankchart :chart-data="chartDatas" :bind-id='chartId'></rankchart>
</div> </div>
</template> </template>
...@@ -24,6 +25,7 @@ ...@@ -24,6 +25,7 @@
import backArrow from '../../../static/header/backArrow.png' import backArrow from '../../../static/header/backArrow.png'
import other from '../../../static/header/other.png' import other from '../../../static/header/other.png'
import tables from '../../../components/table' import tables from '../../../components/table'
import rankchart from '../../../components/rankChart'
export default{ export default{
data(){ data(){
return{ return{
...@@ -46,7 +48,8 @@ ...@@ -46,7 +48,8 @@
columns:[], columns:[],
gateId:[], gateId:[],
floorId:[], floorId:[],
storeId:[] storeId:[],
chartId:'rankingList'
} }
}, },
onLoad: function (option) { onLoad: function (option) {
...@@ -65,21 +68,31 @@ ...@@ -65,21 +68,31 @@
if(res.data){ if(res.data){
var list=JSON.parse(res.data); var list=JSON.parse(res.data);
list.forEach((item,index)=>{ list.forEach((item,index)=>{
if(index==0){ this.accountId.push(item.id)
this.accountId.push(item.id)
}
}) })
if(!option.report){
uni.setStorage({
key:'selectAccountIdArr',
data:JSON.stringify(this.accountId)
})
uni.setStorage({
key:"selectAccountNameArr",
data:JSON.stringify(['全部'])
})
}
} }
} }
}) })
uni.getStorage({ if(option.report){
key:'selectAccountIdArr', uni.getStorage({
success:(res)=> { key:'selectAccountIdArr',
this.accountId=JSON.parse(res.data); success:(res)=> {
}, this.accountId=JSON.parse(res.data);
complete: (res) => { },
} complete: (res) => {
}) }
})
}
uni.getStorage({ uni.getStorage({
key:'selectGateIdArr', key:'selectGateIdArr',
success:(res)=> { success:(res)=> {
...@@ -128,7 +141,7 @@ ...@@ -128,7 +141,7 @@
} }
}, },
components:{ components:{
headerComp,tables headerComp,tables,rankchart
}, },
methods: { methods: {
checkFun(val){ checkFun(val){
...@@ -303,7 +316,24 @@ ...@@ -303,7 +316,24 @@
var datas=res.data.data; var datas=res.data.data;
this.chartData=datas.body; this.chartData=datas.body;
this.chartDatas=datas.body.rankingList; this.chartDatas=datas.body.rankingList;
this.setTabelData() var obj={
title:datas.body.rankingList.title
}
var series=[{
type:'bar',
name:'客流量',
data:[]
}]
var yaxis={
data:[]
}
datas.body.rankingList.series.forEach(item=>{
series[0].data.push(item.data[0])
yaxis.data.push(item.name)
})
obj.series=series;
obj.yaxis=yaxis;
this.chartDatas=obj;
} }
}) })
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<div class="sItem" :class="{ checkedItem: isHour}" @click="checkFun('hour')">小时级</div> <div class="sItem" :class="{ checkedItem: isHour}" @click="checkFun('hour')">小时级</div>
<div class="sItem" :class="{ checkedItem: isMin}" @click="checkFun('min')">分钟级</div> <div class="sItem" :class="{ checkedItem: isMin}" @click="checkFun('min')">分钟级</div>
</div> --> </div> -->
<v-table v-if="columns.length>0" <!-- <v-table v-if="columns.length>0"
is-horizontal-resize is-horizontal-resize
style="width:100%" style="width:100%"
:columns="columns" :columns="columns"
...@@ -15,7 +15,8 @@ ...@@ -15,7 +15,8 @@
row-hover-color="#eee" row-hover-color="#eee"
row-click-color="#edf7ff" row-click-color="#edf7ff"
:height='600' :height='600'
></v-table> ></v-table> -->
<rankchart :chart-data="chartDatas" :bind-id='chartId'></rankchart>
</div> </div>
</template> </template>
...@@ -24,6 +25,7 @@ ...@@ -24,6 +25,7 @@
import backArrow from '../../../static/header/backArrow.png' import backArrow from '../../../static/header/backArrow.png'
import other from '../../../static/header/other.png' import other from '../../../static/header/other.png'
import tables from '../../../components/table' import tables from '../../../components/table'
import rankchart from '../../../components/rankChart'
export default{ export default{
data(){ data(){
return{ return{
...@@ -46,7 +48,8 @@ ...@@ -46,7 +48,8 @@
columns:[], columns:[],
gateId:[], gateId:[],
floorId:[], floorId:[],
storeId:[] storeId:[],
chartId:'rankingList'
} }
}, },
onLoad: function (option) { onLoad: function (option) {
...@@ -65,21 +68,31 @@ ...@@ -65,21 +68,31 @@
if(res.data){ if(res.data){
var list=JSON.parse(res.data); var list=JSON.parse(res.data);
list.forEach((item,index)=>{ list.forEach((item,index)=>{
if(index==0){ this.accountId.push(item.id)
this.accountId.push(item.id)
}
}) })
if(!option.report){
uni.setStorage({
key:'selectAccountIdArr',
data:JSON.stringify(this.accountId)
})
uni.setStorage({
key:"selectAccountNameArr",
data:JSON.stringify(['全部'])
})
}
} }
} }
}) })
uni.getStorage({ if(option.report){
key:'selectAccountIdArr', uni.getStorage({
success:(res)=> { key:'selectAccountIdArr',
this.accountId=JSON.parse(res.data); success:(res)=> {
}, this.accountId=JSON.parse(res.data);
complete: (res) => { },
} complete: (res) => {
}) }
})
}
uni.getStorage({ uni.getStorage({
key:'selectGateIdArr', key:'selectGateIdArr',
success:(res)=> { success:(res)=> {
...@@ -128,7 +141,7 @@ ...@@ -128,7 +141,7 @@
} }
}, },
components:{ components:{
headerComp,tables headerComp,tables,rankchart
}, },
methods: { methods: {
checkFun(val){ checkFun(val){
...@@ -233,11 +246,12 @@ ...@@ -233,11 +246,12 @@
this.orgIds=this.orgIds.substring(0,this.orgIds.length-1) this.orgIds=this.orgIds.substring(0,this.orgIds.length-1)
var startDate=this.date.split(',')[0]; var startDate=this.date.split(',')[0];
var endDate=this.date.split(',')[1]; var endDate=this.date.split(',')[1];
console.log(this.date)
url=window.url+'/report/ranking/mall'; url=window.url+'/report/ranking/mall';
data={ data={
orgIds:this.orgIds, orgIds:this.orgIds,
startDate:startDate, startDate:startDate,
endDate: endDate, endDate: '2019-05-23',
chartIds:this.chartIds, chartIds:this.chartIds,
kpiTypes:'TRAFFIC', kpiTypes:'TRAFFIC',
_t:Date.parse(new Date())/1000 _t:Date.parse(new Date())/1000
...@@ -303,7 +317,24 @@ ...@@ -303,7 +317,24 @@
var datas=res.data.data; var datas=res.data.data;
this.chartData=datas.body; this.chartData=datas.body;
this.chartDatas=datas.body.rankingList; this.chartDatas=datas.body.rankingList;
this.setTabelData() var obj={
title:datas.body.rankingList.title
}
var series=[{
type:'bar',
name:'客流量',
data:[]
}]
var yaxis={
data:[]
}
datas.body.rankingList.series.forEach(item=>{
series[0].data.push(item.data[0])
yaxis.data.push(item.name)
})
obj.series=series;
obj.yaxis=yaxis;
this.chartDatas=obj;
} }
}) })
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<div class="sItem" :class="{ checkedItem: isHour}" @tap="checkFun('hour')">小时级</div> <div class="sItem" :class="{ checkedItem: isHour}" @tap="checkFun('hour')">小时级</div>
<div class="sItem" :class="{ checkedItem: isMin}" @tap="checkFun('min')">分钟级</div> <div class="sItem" :class="{ checkedItem: isMin}" @tap="checkFun('min')">分钟级</div>
</div> </div>
<v-table v-if="columns.length>0" <!-- <v-table v-if="columns.length>0"
is-horizontal-resize is-horizontal-resize
style="width:100%" style="width:100%"
:columns="columns" :columns="columns"
...@@ -15,7 +15,9 @@ ...@@ -15,7 +15,9 @@
row-hover-color="#eee" row-hover-color="#eee"
row-click-color="#edf7ff" row-click-color="#edf7ff"
:height='600' :height='600'
></v-table> ></v-table> -->
<barchart v-if="isDay" :chart-data="chartDatas" :bind-id='chartId'></barchart>
<linechart v-else-if="isHour||isMin" :chart-data="chartDatas" :bind-id='chartId'></linechart>
</div> </div>
</template> </template>
...@@ -24,6 +26,8 @@ ...@@ -24,6 +26,8 @@
import backArrow from '../../../static/header/backArrow.png' import backArrow from '../../../static/header/backArrow.png'
import other from '../../../static/header/other.png' import other from '../../../static/header/other.png'
import tables from '../../../components/table' import tables from '../../../components/table'
import barchart from '../../../components/barChart'
import linechart from '../../../components/lineChart'
export default{ export default{
data(){ data(){
return{ return{
...@@ -46,7 +50,9 @@ ...@@ -46,7 +50,9 @@
columns:[], columns:[],
gateId:[], gateId:[],
floorId:[], floorId:[],
storeId:[] storeId:[],
chartId:'detailData',
objId:'more'
} }
}, },
onLoad: function (option) { onLoad: function (option) {
...@@ -60,6 +66,12 @@ ...@@ -60,6 +66,12 @@
} }
}) })
uni.getStorage({ uni.getStorage({
key:'objId',
success:(res)=>{
this.objId=JSON.parse(res.data)[0];
}
})
uni.getStorage({
key:'accountList', key:'accountList',
success:(res)=>{ success:(res)=>{
if(res.data){ if(res.data){
...@@ -128,7 +140,7 @@ ...@@ -128,7 +140,7 @@
} }
}, },
components:{ components:{
headerComp,tables headerComp,tables,barchart,linechart
}, },
methods: { methods: {
checkFun(val){ checkFun(val){
...@@ -138,8 +150,11 @@ ...@@ -138,8 +150,11 @@
this.isDay=true; this.isDay=true;
this.isHour=false; this.isHour=false;
this.isMin=false; this.isMin=false;
this.chartDatas=this.chartData.kpiData; this.chartId='detailData';
this.setTabelData() this.chartDatas={}
setTimeout(()=>{
this.chartDatas=this.chartData.detailData;
},10)
// this.$emit('handleFun','7'); // this.$emit('handleFun','7');
} }
break; break;
...@@ -147,8 +162,11 @@ ...@@ -147,8 +162,11 @@
this.isDay=false; this.isDay=false;
this.isHour=true; this.isHour=true;
this.isMin=false; this.isMin=false;
this.chartDatas=this.chartData.trafficHour; this.chartId='trafficHour';
this.setTabelData() this.chartDatas={}
setTimeout(()=>{
this.chartDatas=this.chartData.trafficHour;
},10)
// this.$emit('handleFun','15'); // this.$emit('handleFun','15');
} }
break; break;
...@@ -156,8 +174,11 @@ ...@@ -156,8 +174,11 @@
this.isDay=false; this.isDay=false;
this.isHour=false; this.isHour=false;
this.isMin=true; this.isMin=true;
this.chartDatas=this.chartData.traffic10Min; this.chartId='traffic10Min';
this.setTabelData() this.chartDatas={}
setTimeout(()=>{
this.chartDatas=this.chartData.traffic10Min;
},10)
// this.$emit('handleFun','30'); // this.$emit('handleFun','30');
} }
break; break;
...@@ -179,7 +200,7 @@ ...@@ -179,7 +200,7 @@
}, },
getReportKey(){ getReportKey(){
var report='BasicDayReport'; var report='BasicDayReport';
this.keyArr=['kpiData','trafficHour','traffic10Min']; this.keyArr=['detailData','trafficHour','traffic10Min'];
uni.showLoading({ uni.showLoading({
title: '加载中' title: '加载中'
...@@ -229,55 +250,71 @@ ...@@ -229,55 +250,71 @@
var data={} var data={}
var url=window.url+'/report/basics/day/mall'; var url=window.url+'/report/basics/day/mall';
if(this.reportType=='mall'){ if(this.reportType=='mall'){
this.accountId.forEach(item=>{ if(this.objId=='one'){
this.orgIds+=item+',' this.orgIds=this.accountId[0]
}) }else{
this.orgIds=this.orgIds.substring(0,this.orgIds.length-1) this.accountId.forEach(item=>{
this.orgIds+=item+','
})
this.orgIds=this.orgIds.substring(0,this.orgIds.length-1)
}
url=window.url+'/report/basics/day/mall'; url=window.url+'/report/basics/day/mall';
data={ data={
orgIds:this.orgIds, orgIds:this.orgIds,
date:this.date, date:this.date,
chartIds:this.chartIds, chartIds:this.chartIds,
option:'TAB_TABLE', option:'TAB_CHART',
_t:Date.parse(new Date())/1000 _t:Date.parse(new Date())/1000
} }
}else if(this.reportType=='gate'){ }else if(this.reportType=='gate'){
this.gateId.forEach(item=>{ if(this.objId=='one'){
this.orgIds+=item+',' this.orgIds=this.accountId[0]
}) }else{
this.orgIds=this.orgIds.substring(0,this.orgIds.length-1) this.gateId.forEach(item=>{
this.orgIds+=item+','
})
this.orgIds=this.orgIds.substring(0,this.orgIds.length-1)
}
url=window.url+'/report/basics/day/gate'; url=window.url+'/report/basics/day/gate';
data={ data={
orgIds:this.orgIds, orgIds:this.orgIds,
date:this.date, date:this.date,
chartIds:this.chartIds, chartIds:this.chartIds,
option:'TAB_TABLE', option:'TAB_CHART',
_t:Date.parse(new Date())/1000 _t:Date.parse(new Date())/1000
} }
}else if(this.reportType=='floor'){ }else if(this.reportType=='floor'){
this.floorId.forEach(item=>{ if(this.objId=='one'){
this.orgIds+=item+',' this.orgIds=this.accountId[0]
}) }else{
this.orgIds=this.orgIds.substring(0,this.orgIds.length-1) this.floorId.forEach(item=>{
this.orgIds+=item+','
})
this.orgIds=this.orgIds.substring(0,this.orgIds.length-1)
}
url=window.url+'/report/basics/day/floor'; url=window.url+'/report/basics/day/floor';
data={ data={
orgIds:this.orgIds, orgIds:this.orgIds,
date:this.date, date:this.date,
chartIds:this.chartIds, chartIds:this.chartIds,
option:'TAB_TABLE', option:'TAB_CHART',
_t:Date.parse(new Date())/1000 _t:Date.parse(new Date())/1000
} }
}else if(this.reportType=='area'){ }else if(this.reportType=='area'){
this.storeId.forEach(item=>{ if(this.objId=='one'){
this.orgIds+=item+',' this.orgIds=this.accountId[0]
}) }else{
this.orgIds=this.orgIds.substring(0,this.orgIds.length-1) this.storeId.forEach(item=>{
this.orgIds+=item+','
})
this.orgIds=this.orgIds.substring(0,this.orgIds.length-1)
}
url=window.url+'/report/basics/day/zone'; url=window.url+'/report/basics/day/zone';
data={ data={
orgIds:this.orgIds, orgIds:this.orgIds,
date:this.date, date:this.date,
chartIds:this.chartIds, chartIds:this.chartIds,
option:'TAB_TABLE', option:'TAB_CHART',
_t:Date.parse(new Date())/1000 _t:Date.parse(new Date())/1000
} }
} }
...@@ -292,8 +329,7 @@ ...@@ -292,8 +329,7 @@
uni.hideLoading() uni.hideLoading()
var datas=res.data.data; var datas=res.data.data;
this.chartData=datas.body; this.chartData=datas.body;
this.chartDatas=datas.body.kpiData; this.chartDatas=datas.body.detailData;
this.setTabelData()
} }
}) })
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
<div> <div>
<headerComp :leftImgSrc="leftImg" :title="titleStr" :rightImgSrc="rightImg" @leftClick="backFun" @rightClick="conditionFun"></headerComp> <headerComp :leftImgSrc="leftImg" :title="titleStr" :rightImgSrc="rightImg" @leftClick="backFun" @rightClick="conditionFun"></headerComp>
<div style="height: 18.11upx;"></div> <div style="height: 18.11upx;"></div>
<!-- <div class="selectBox"> <div class="selectBox" v-show="objId=='one'">
<div class="sItem" :class="{ checkedItem: isDay}" @click="checkFun('day')">天汇总</div> <div class="sItem" :class="{ checkedItem: isDay}" @click="checkFun('day')">天汇总</div>
<div class="sItem" :class="{ checkedItem: isHour}" @click="checkFun('hour')">小时级</div> <div class="sItem" :class="{ checkedItem: isHour}" @click="checkFun('hour')">小时级</div>
<div class="sItem" :class="{ checkedItem: isMin}" @click="checkFun('min')">分钟级</div> <div class="sItem" :class="{ checkedItem: isMin}" @click="checkFun('min')">分钟级</div>
</div> --> </div>
<v-table v-if="columns.length>0" <!-- <v-table v-if="columns.length>0"
is-horizontal-resize is-horizontal-resize
style="width:100%" style="width:100%"
:columns="columns" :columns="columns"
...@@ -15,7 +15,8 @@ ...@@ -15,7 +15,8 @@
row-hover-color="#eee" row-hover-color="#eee"
row-click-color="#edf7ff" row-click-color="#edf7ff"
:height='600' :height='600'
></v-table> ></v-table> -->
<linechart :chart-data="chartDatas" :bind-id='chartId'></linechart>
</div> </div>
</template> </template>
...@@ -24,6 +25,7 @@ ...@@ -24,6 +25,7 @@
import backArrow from '../../../static/header/backArrow.png' import backArrow from '../../../static/header/backArrow.png'
import other from '../../../static/header/other.png' import other from '../../../static/header/other.png'
import tables from '../../../components/table' import tables from '../../../components/table'
import linechart from '../../../components/lineChart'
export default{ export default{
data(){ data(){
return{ return{
...@@ -32,7 +34,7 @@ ...@@ -32,7 +34,7 @@
rightImg:other, rightImg:other,
atoken:'', atoken:'',
keyArr:[], keyArr:[],
chartIds:'', chartIds:[],
reportType:'mall', reportType:'mall',
accountId:[], accountId:[],
orgIds:'', orgIds:'',
...@@ -46,7 +48,9 @@ ...@@ -46,7 +48,9 @@
columns:[], columns:[],
gateId:[], gateId:[],
floorId:[], floorId:[],
storeId:[] storeId:[],
chartId:'detailData',
objId:"more"
} }
}, },
onLoad: function (option) { onLoad: function (option) {
...@@ -60,6 +64,12 @@ ...@@ -60,6 +64,12 @@
} }
}) })
uni.getStorage({ uni.getStorage({
key:'objId',
success:(res)=>{
this.objId=JSON.parse(res.data)[0];
}
})
uni.getStorage({
key:'accountList', key:'accountList',
success:(res)=>{ success:(res)=>{
if(res.data){ if(res.data){
...@@ -128,7 +138,7 @@ ...@@ -128,7 +138,7 @@
} }
}, },
components:{ components:{
headerComp,tables headerComp,tables,linechart
}, },
methods: { methods: {
checkFun(val){ checkFun(val){
...@@ -138,27 +148,27 @@ ...@@ -138,27 +148,27 @@
this.isDay=true; this.isDay=true;
this.isHour=false; this.isHour=false;
this.isMin=false; this.isMin=false;
this.chartDatas=this.chartData.kpiData; this.chartId='detailData';
this.setTabelData() this.chartDatas={}
// this.$emit('handleFun','7'); this.getChartData('detailData',this.chartIds[0],true)
} }
break; break;
case 'hour':{ case 'hour':{
this.isDay=false; this.isDay=false;
this.isHour=true; this.isHour=true;
this.isMin=false; this.isMin=false;
this.chartDatas=this.chartData.trafficHour; this.chartId='trafficHourForDates';
this.setTabelData() this.chartDatas={}
// this.$emit('handleFun','15'); this.getChartData('trafficHourForDates',this.chartIds[1])
} }
break; break;
case 'min':{ case 'min':{
this.isDay=false; this.isDay=false;
this.isHour=false; this.isHour=false;
this.isMin=true; this.isMin=true;
this.chartDatas=this.chartData.traffic10Min; this.chartId='trafficMinuteForDates';
this.setTabelData() this.chartDatas={}
// this.$emit('handleFun','30'); this.getChartData('trafficMinuteForDates',this.chartIds[2])
} }
break; break;
} }
...@@ -178,8 +188,13 @@ ...@@ -178,8 +188,13 @@
}) })
}, },
getReportKey(){ getReportKey(){
var report='BasicReport'; var report='';
this.keyArr=['kpiData','detailData']; if(this.objId=='more'){
report='BasicReport';
}else{
report='BasicDayReport';
}
this.keyArr=['detailData','trafficHourForDates','trafficMinuteForDates'];
uni.showLoading({ uni.showLoading({
title: '加载中' title: '加载中'
...@@ -195,14 +210,13 @@ ...@@ -195,14 +210,13 @@
}, },
method:'GET', method:'GET',
success:(res) =>{ success:(res) =>{
this.chartIds=''; this.chartIds=[];
res.data.data.forEach(item=>{ res.data.data.forEach(item=>{
if(this.keyArr.indexOf(item.key)!='-1'){ if(this.keyArr.indexOf(item.key)!='-1'){
this.chartIds+=item.id+',' this.chartIds.push(item.id)
} }
}) })
this.chartIds=this.chartIds.substring(0,this.chartIds.length-1); this.getChartData('detailData',this.chartIds[0],true);
this.getChartData();
} }
}) })
}, },
...@@ -216,7 +230,6 @@ ...@@ -216,7 +230,6 @@
this.columns.push( {field: item, title:item, width: 80, titleAlign: 'center',columnAlign:'center',isResize:true}) this.columns.push( {field: item, title:item, width: 80, titleAlign: 'center',columnAlign:'center',isResize:true})
} }
}) })
console.log(JSON.stringify(this.columns))
this.chartDatas.series.forEach((item,index)=>{ this.chartDatas.series.forEach((item,index)=>{
var obj={} var obj={}
item.data.forEach((item,index)=>{ item.data.forEach((item,index)=>{
...@@ -225,74 +238,126 @@ ...@@ -225,74 +238,126 @@
this.tableData.push(obj) this.tableData.push(obj)
}) })
}, },
getChartData(){ getChartData(objName,chartids,isTraffic){
this.orgIds='' this.orgIds=''
var data={} var data={}
var url=window.url+'/report/basics/mall'; var url=window.url+'/report/basics/day/mall';
if(this.reportType=='mall'){ if(this.reportType=='mall'){
this.accountId.forEach(item=>{ if(this.objId=='one'){
this.orgIds+=item+',' this.orgIds=this.accountId[0]
}) }else{
this.orgIds=this.orgIds.substring(0,this.orgIds.length-1) this.accountId.forEach(item=>{
this.orgIds+=item+','
})
this.orgIds=this.orgIds.substring(0,this.orgIds.length-1)
}
var startDate=this.date.split(',')[0]; var startDate=this.date.split(',')[0];
var endDate=this.date.split(',')[1]; var endDate=this.date.split(',')[1];
url=window.url+'/report/basics/mall'; if(this.isDay){
url=window.url+'/report/basics/mall';
}else if(this.isHour||this.isMin){
url=window.url+'/report/basics/day/mall';
}
data={ data={
orgIds:this.orgIds, orgIds:this.orgIds,
startDate:startDate, startDate:startDate,
endDate: endDate, endDate: endDate,
chartIds:this.chartIds, chartIds:chartids,
option:'TAB_TABLE', option:'TAB_CHART',
_t:Date.parse(new Date())/1000 _t:Date.parse(new Date())/1000
} }
if(isTraffic){
data.kpiType='TRAFFIC'
}else{
data.kpiType=''
}
}else if(this.reportType=='gate'){ }else if(this.reportType=='gate'){
this.gateId.forEach(item=>{ if(this.objId=='one'){
this.orgIds+=item+',' this.orgIds=this.accountId[0]
}) }else{
this.orgIds=this.orgIds.substring(0,this.orgIds.length-1) this.gateId.forEach(item=>{
this.orgIds+=item+','
})
this.orgIds=this.orgIds.substring(0,this.orgIds.length-1)
}
var startDate=this.date.split(',')[0]; var startDate=this.date.split(',')[0];
var endDate=this.date.split(',')[1]; var endDate=this.date.split(',')[1];
url=window.url+'/report/basics/gate'; if(this.isDay){
url=window.url+'/report/basics/gate';
}else if(this.isHour||this.isMin){
url=window.url+'/report/basics/day/gate';
}
data={ data={
orgIds:this.orgIds, orgIds:this.orgIds,
startDate:startDate, startDate:startDate,
endDate: endDate, endDate: endDate,
chartIds:this.chartIds, chartIds:chartids,
option:'TAB_TABLE', option:'TAB_CHART',
_t:Date.parse(new Date())/1000 _t:Date.parse(new Date())/1000
} }
if(isTraffic){
data.kpiType='TRAFFIC'
}else{
data.kpiType=''
}
}else if(this.reportType=='floor'){ }else if(this.reportType=='floor'){
this.floorId.forEach(item=>{ if(this.objId=='one'){
this.orgIds+=item+',' this.orgIds=this.accountId[0]
}) }else{
this.orgIds=this.orgIds.substring(0,this.orgIds.length-1) this.floorId.forEach(item=>{
url=window.url+'/report/basics/floor'; this.orgIds+=item+','
})
this.orgIds=this.orgIds.substring(0,this.orgIds.length-1)
}
if(this.isDay){
url=window.url+'/report/basics/floor';
}else if(this.isHour||this.isMin){
url=window.url+'/report/basics/day/floor';
}
var startDate=this.date.split(',')[0]; var startDate=this.date.split(',')[0];
var endDate=this.date.split(',')[1]; var endDate=this.date.split(',')[1];
data={ data={
orgIds:this.orgIds, orgIds:this.orgIds,
startDate:startDate, startDate:startDate,
endDate: endDate, endDate: endDate,
chartIds:this.chartIds, chartIds:chartids,
option:'TAB_TABLE', option:'TAB_CHART',
_t:Date.parse(new Date())/1000 _t:Date.parse(new Date())/1000
} }
if(isTraffic){
data.kpiType='TRAFFIC'
}else{
data.kpiType=''
}
}else if(this.reportType=='area'){ }else if(this.reportType=='area'){
this.storeId.forEach(item=>{ if(this.objId=='one'){
this.orgIds+=item+',' this.orgIds=this.accountId[0]
}) }else{
this.orgIds=this.orgIds.substring(0,this.orgIds.length-1) this.storeId.forEach(item=>{
url=window.url+'/report/basics/zone'; this.orgIds+=item+','
})
this.orgIds=this.orgIds.substring(0,this.orgIds.length-1)
}
if(this.isDay){
url=window.url+'/report/basics/zone';
}else if(this.isHour||this.isMin){
url=window.url+'/report/basics/day/zone';
}
var startDate=this.date.split(',')[0]; var startDate=this.date.split(',')[0];
var endDate=this.date.split(',')[1]; var endDate=this.date.split(',')[1];
data={ data={
orgIds:this.orgIds, orgIds:this.orgIds,
startDate:startDate, startDate:startDate,
endDate: endDate, endDate: endDate,
chartIds:this.chartIds, chartIds:chartids,
option:'TAB_TABLE', option:'TAB_CHART',
_t:Date.parse(new Date())/1000 _t:Date.parse(new Date())/1000
} }
if(isTraffic){
data.kpiType='TRAFFIC'
}else{
data.kpiType=''
}
} }
uni.request({ uni.request({
url:url, url:url,
...@@ -305,8 +370,7 @@ ...@@ -305,8 +370,7 @@
uni.hideLoading() uni.hideLoading()
var datas=res.data.data; var datas=res.data.data;
this.chartData=datas.body; this.chartData=datas.body;
this.chartDatas=datas.body.detailData; this.chartDatas=datas.body[objName];
this.setTabelData()
} }
}) })
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
<div> <div>
<headerComp :leftImgSrc="leftImg" :title="titleStr" :rightImgSrc="rightImg" @leftClick="backFun" @rightClick="conditionFun"></headerComp> <headerComp :leftImgSrc="leftImg" :title="titleStr" :rightImgSrc="rightImg" @leftClick="backFun" @rightClick="conditionFun"></headerComp>
<div style="height: 18.11upx;"></div> <div style="height: 18.11upx;"></div>
<!-- <div class="selectBox"> <div class="selectBox" v-show="objId=='one'">
<div class="sItem" :class="{ checkedItem: isDay}" @click="checkFun('day')">天汇总</div> <div class="sItem" :class="{ checkedItem: isDay}" @click="checkFun('day')">天汇总</div>
<div class="sItem" :class="{ checkedItem: isHour}" @click="checkFun('hour')">小时级</div> <div class="sItem" :class="{ checkedItem: isHour}" @click="checkFun('hour')">小时级</div>
<div class="sItem" :class="{ checkedItem: isMin}" @click="checkFun('min')">分钟级</div> <div class="sItem" :class="{ checkedItem: isMin}" @click="checkFun('min')">分钟级</div>
</div> --> </div>
<v-table v-if="columns.length>0" <!-- <v-table v-if="columns.length>0"
is-horizontal-resize is-horizontal-resize
style="width:100%" style="width:100%"
:columns="columns" :columns="columns"
...@@ -15,7 +15,8 @@ ...@@ -15,7 +15,8 @@
row-hover-color="#eee" row-hover-color="#eee"
row-click-color="#edf7ff" row-click-color="#edf7ff"
:height='600' :height='600'
></v-table> ></v-table> -->
<linechart :chart-data="chartDatas" :bind-id='chartId'></linechart>
</div> </div>
</template> </template>
...@@ -24,6 +25,7 @@ ...@@ -24,6 +25,7 @@
import backArrow from '../../../static/header/backArrow.png' import backArrow from '../../../static/header/backArrow.png'
import other from '../../../static/header/other.png' import other from '../../../static/header/other.png'
import tables from '../../../components/table' import tables from '../../../components/table'
import linechart from '../../../components/lineChart'
export default{ export default{
data(){ data(){
return{ return{
...@@ -32,7 +34,7 @@ ...@@ -32,7 +34,7 @@
rightImg:other, rightImg:other,
atoken:'', atoken:'',
keyArr:[], keyArr:[],
chartIds:'', chartIds:[],
reportType:'mall', reportType:'mall',
accountId:[], accountId:[],
orgIds:'', orgIds:'',
...@@ -46,7 +48,9 @@ ...@@ -46,7 +48,9 @@
columns:[], columns:[],
gateId:[], gateId:[],
floorId:[], floorId:[],
storeId:[] storeId:[],
chartId:'detailData',
objId:"more"
} }
}, },
onLoad: function (option) { onLoad: function (option) {
...@@ -60,6 +64,12 @@ ...@@ -60,6 +64,12 @@
} }
}) })
uni.getStorage({ uni.getStorage({
key:'objId',
success:(res)=>{
this.objId=JSON.parse(res.data)[0];
}
})
uni.getStorage({
key:'accountList', key:'accountList',
success:(res)=>{ success:(res)=>{
if(res.data){ if(res.data){
...@@ -128,7 +138,7 @@ ...@@ -128,7 +138,7 @@
} }
}, },
components:{ components:{
headerComp,tables headerComp,tables,linechart
}, },
methods: { methods: {
checkFun(val){ checkFun(val){
...@@ -138,27 +148,27 @@ ...@@ -138,27 +148,27 @@
this.isDay=true; this.isDay=true;
this.isHour=false; this.isHour=false;
this.isMin=false; this.isMin=false;
this.chartDatas=this.chartData.kpiData; this.chartId='detailData';
this.setTabelData() this.chartDatas={}
// this.$emit('handleFun','7'); this.getChartData('detailData',this.chartIds[0],true)
} }
break; break;
case 'hour':{ case 'hour':{
this.isDay=false; this.isDay=false;
this.isHour=true; this.isHour=true;
this.isMin=false; this.isMin=false;
this.chartDatas=this.chartData.trafficHour; this.chartId='trafficHourForDates';
this.setTabelData() this.chartDatas={}
// this.$emit('handleFun','15'); this.getChartData('trafficHourForDates',this.chartIds[1])
} }
break; break;
case 'min':{ case 'min':{
this.isDay=false; this.isDay=false;
this.isHour=false; this.isHour=false;
this.isMin=true; this.isMin=true;
this.chartDatas=this.chartData.traffic10Min; this.chartId='trafficMinuteForDates';
this.setTabelData() this.chartDatas={}
// this.$emit('handleFun','30'); this.getChartData('trafficMinuteForDates',this.chartIds[2])
} }
break; break;
} }
...@@ -178,8 +188,8 @@ ...@@ -178,8 +188,8 @@
}) })
}, },
getReportKey(){ getReportKey(){
var report='BasicReport'; var report='BasicDayReport';
this.keyArr=['kpiData','detailData']; this.keyArr=['detailData','trafficHourForDates','trafficMinuteForDates'];
uni.showLoading({ uni.showLoading({
title: '加载中' title: '加载中'
...@@ -195,14 +205,13 @@ ...@@ -195,14 +205,13 @@
}, },
method:'GET', method:'GET',
success:(res) =>{ success:(res) =>{
this.chartIds=''; this.chartIds=[];
res.data.data.forEach(item=>{ res.data.data.forEach(item=>{
if(this.keyArr.indexOf(item.key)!='-1'){ if(this.keyArr.indexOf(item.key)!='-1'){
this.chartIds+=item.id+',' this.chartIds.push(item.id)
} }
}) })
this.chartIds=this.chartIds.substring(0,this.chartIds.length-1); this.getChartData('detailData',this.chartIds[0],true);
this.getChartData();
} }
}) })
}, },
...@@ -216,7 +225,6 @@ ...@@ -216,7 +225,6 @@
this.columns.push( {field: item, title:item, width: 80, titleAlign: 'center',columnAlign:'center',isResize:true}) this.columns.push( {field: item, title:item, width: 80, titleAlign: 'center',columnAlign:'center',isResize:true})
} }
}) })
console.log(JSON.stringify(this.columns))
this.chartDatas.series.forEach((item,index)=>{ this.chartDatas.series.forEach((item,index)=>{
var obj={} var obj={}
item.data.forEach((item,index)=>{ item.data.forEach((item,index)=>{
...@@ -225,74 +233,126 @@ ...@@ -225,74 +233,126 @@
this.tableData.push(obj) this.tableData.push(obj)
}) })
}, },
getChartData(){ getChartData(objName,chartids,isTraffic){
this.orgIds='' this.orgIds=''
var data={} var data={}
var url=window.url+'/report/basics/mall'; var url=window.url+'/report/basics/day/mall';
if(this.reportType=='mall'){ if(this.reportType=='mall'){
this.accountId.forEach(item=>{ if(this.objId=='one'){
this.orgIds+=item+',' this.orgIds=this.accountId[0]
}) }else{
this.orgIds=this.orgIds.substring(0,this.orgIds.length-1) this.accountId.forEach(item=>{
this.orgIds+=item+','
})
this.orgIds=this.orgIds.substring(0,this.orgIds.length-1)
}
var startDate=this.date.split(',')[0]; var startDate=this.date.split(',')[0];
var endDate=this.date.split(',')[1]; var endDate=this.date.split(',')[1];
url=window.url+'/report/basics/mall'; if(this.isDay){
url=window.url+'/report/basics/mall';
}else if(this.isHour||this.isMin){
url=window.url+'/report/basics/day/mall';
}
data={ data={
orgIds:this.orgIds, orgIds:this.orgIds,
startDate:startDate, startDate:startDate,
endDate: endDate, endDate: endDate,
chartIds:this.chartIds, chartIds:chartids,
option:'TAB_TABLE', option:'TAB_CHART',
_t:Date.parse(new Date())/1000 _t:Date.parse(new Date())/1000
} }
if(isTraffic){
data.kpiType='TRAFFIC'
}else{
data.kpiType=''
}
}else if(this.reportType=='gate'){ }else if(this.reportType=='gate'){
this.gateId.forEach(item=>{ if(this.objId=='one'){
this.orgIds+=item+',' this.orgIds=this.accountId[0]
}) }else{
this.orgIds=this.orgIds.substring(0,this.orgIds.length-1) this.gateId.forEach(item=>{
this.orgIds+=item+','
})
this.orgIds=this.orgIds.substring(0,this.orgIds.length-1)
}
var startDate=this.date.split(',')[0]; var startDate=this.date.split(',')[0];
var endDate=this.date.split(',')[1]; var endDate=this.date.split(',')[1];
url=window.url+'/report/basics/gate'; if(this.isDay){
url=window.url+'/report/basics/gate';
}else if(this.isHour||this.isMin){
url=window.url+'/report/basics/day/gate';
}
data={ data={
orgIds:this.orgIds, orgIds:this.orgIds,
startDate:startDate, startDate:startDate,
endDate: endDate, endDate: endDate,
chartIds:this.chartIds, chartIds:chartids,
option:'TAB_TABLE', option:'TAB_CHART',
_t:Date.parse(new Date())/1000 _t:Date.parse(new Date())/1000
} }
if(isTraffic){
data.kpiType='TRAFFIC'
}else{
data.kpiType=''
}
}else if(this.reportType=='floor'){ }else if(this.reportType=='floor'){
this.floorId.forEach(item=>{ if(this.objId=='one'){
this.orgIds+=item+',' this.orgIds=this.accountId[0]
}) }else{
this.orgIds=this.orgIds.substring(0,this.orgIds.length-1) this.floorId.forEach(item=>{
url=window.url+'/report/basics/floor'; this.orgIds+=item+','
})
this.orgIds=this.orgIds.substring(0,this.orgIds.length-1)
}
if(this.isDay){
url=window.url+'/report/basics/floor';
}else if(this.isHour||this.isMin){
url=window.url+'/report/basics/day/floor';
}
var startDate=this.date.split(',')[0]; var startDate=this.date.split(',')[0];
var endDate=this.date.split(',')[1]; var endDate=this.date.split(',')[1];
data={ data={
orgIds:this.orgIds, orgIds:this.orgIds,
startDate:startDate, startDate:startDate,
endDate: endDate, endDate: endDate,
chartIds:this.chartIds, chartIds:chartids,
option:'TAB_TABLE', option:'TAB_CHART',
_t:Date.parse(new Date())/1000 _t:Date.parse(new Date())/1000
} }
if(isTraffic){
data.kpiType='TRAFFIC'
}else{
data.kpiType=''
}
}else if(this.reportType=='area'){ }else if(this.reportType=='area'){
this.storeId.forEach(item=>{ if(this.objId=='one'){
this.orgIds+=item+',' this.orgIds=this.accountId[0]
}) }else{
this.orgIds=this.orgIds.substring(0,this.orgIds.length-1) this.storeId.forEach(item=>{
url=window.url+'/report/basics/zone'; this.orgIds+=item+','
})
this.orgIds=this.orgIds.substring(0,this.orgIds.length-1)
}
if(this.isDay){
url=window.url+'/report/basics/zone';
}else if(this.isHour||this.isMin){
url=window.url+'/report/basics/day/zone';
}
var startDate=this.date.split(',')[0]; var startDate=this.date.split(',')[0];
var endDate=this.date.split(',')[1]; var endDate=this.date.split(',')[1];
data={ data={
orgIds:this.orgIds, orgIds:this.orgIds,
startDate:startDate, startDate:startDate,
endDate: endDate, endDate: endDate,
chartIds:this.chartIds, chartIds:chartids,
option:'TAB_TABLE', option:'TAB_CHART',
_t:Date.parse(new Date())/1000 _t:Date.parse(new Date())/1000
} }
if(isTraffic){
data.kpiType='TRAFFIC'
}else{
data.kpiType=''
}
} }
uni.request({ uni.request({
url:url, url:url,
...@@ -305,8 +365,7 @@ ...@@ -305,8 +365,7 @@
uni.hideLoading() uni.hideLoading()
var datas=res.data.data; var datas=res.data.data;
this.chartData=datas.body; this.chartData=datas.body;
this.chartDatas=datas.body.detailData; this.chartDatas=datas.body[objName];
this.setTabelData()
} }
}) })
......
...@@ -2,12 +2,11 @@ ...@@ -2,12 +2,11 @@
<div> <div>
<headerComp :leftImgSrc="leftImg" :title="titleStr" :rightImgSrc="rightImg" @leftClick="backFun" @rightClick="conditionFun"></headerComp> <headerComp :leftImgSrc="leftImg" :title="titleStr" :rightImgSrc="rightImg" @leftClick="backFun" @rightClick="conditionFun"></headerComp>
<div style="height: 18.11upx;"></div> <div style="height: 18.11upx;"></div>
<!-- <div class="selectBox"> <div class="selectBox" v-show="objId=='one'">
<div class="sItem" :class="{ checkedItem: isMonth}" @click="checkFun('month')">天汇总</div>
<div class="sItem" :class="{ checkedItem: isDay}" @click="checkFun('day')">天汇总</div> <div class="sItem" :class="{ checkedItem: isDay}" @click="checkFun('day')">天汇总</div>
<div class="sItem" :class="{ checkedItem: isHour}" @click="checkFun('hour')">小时级</div> </div>
<div class="sItem" :class="{ checkedItem: isMin}" @click="checkFun('min')">分钟级</div> <!-- <v-table v-if="columns.length>0"
</div> -->
<v-table v-if="columns.length>0"
is-horizontal-resize is-horizontal-resize
style="width:100%" style="width:100%"
:columns="columns" :columns="columns"
...@@ -15,7 +14,8 @@ ...@@ -15,7 +14,8 @@
row-hover-color="#eee" row-hover-color="#eee"
row-click-color="#edf7ff" row-click-color="#edf7ff"
:height='600' :height='600'
></v-table> ></v-table> -->
<linechart :chart-data="chartDatas" :bind-id='chartId'></linechart>
</div> </div>
</template> </template>
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
import backArrow from '../../../static/header/backArrow.png' import backArrow from '../../../static/header/backArrow.png'
import other from '../../../static/header/other.png' import other from '../../../static/header/other.png'
import tables from '../../../components/table' import tables from '../../../components/table'
import linechart from '../../../components/lineChart'
export default{ export default{
data(){ data(){
return{ return{
...@@ -32,21 +33,22 @@ ...@@ -32,21 +33,22 @@
rightImg:other, rightImg:other,
atoken:'', atoken:'',
keyArr:[], keyArr:[],
chartIds:'', chartIds:[],
reportType:'mall', reportType:'mall',
accountId:[], accountId:[],
orgIds:'', orgIds:'',
date:'', date:'',
isDay:true, isDay:false,
isHour:false, isMonth:true,
isMin:false,
chartDatas:{}, chartDatas:{},
chartData:{}, chartData:{},
tableData:[], tableData:[],
columns:[], columns:[],
gateId:[], gateId:[],
floorId:[], floorId:[],
storeId:[] storeId:[],
chartId:'detailData',
objId:"more"
} }
}, },
onLoad: function (option) { onLoad: function (option) {
...@@ -60,6 +62,12 @@ ...@@ -60,6 +62,12 @@
} }
}) })
uni.getStorage({ uni.getStorage({
key:'objId',
success:(res)=>{
this.objId=JSON.parse(res.data)[0];
}
})
uni.getStorage({
key:'accountList', key:'accountList',
success:(res)=>{ success:(res)=>{
if(res.data){ if(res.data){
...@@ -128,7 +136,7 @@ ...@@ -128,7 +136,7 @@
} }
}, },
components:{ components:{
headerComp,tables headerComp,tables,linechart
}, },
methods: { methods: {
checkFun(val){ checkFun(val){
...@@ -136,29 +144,18 @@ ...@@ -136,29 +144,18 @@
{ {
case 'day':{ case 'day':{
this.isDay=true; this.isDay=true;
this.isHour=false; this.isMonth=false;
this.isMin=false; this.chartId='detailData';
this.chartDatas=this.chartData.kpiData; this.chartDatas={}
this.setTabelData() this.getChartData('detailData',this.chartIds[0])
// this.$emit('handleFun','7');
}
break;
case 'hour':{
this.isDay=false;
this.isHour=true;
this.isMin=false;
this.chartDatas=this.chartData.trafficHour;
this.setTabelData()
// this.$emit('handleFun','15');
} }
break; break;
case 'min':{ case 'month':{
this.isDay=false; this.isDay=false;
this.isHour=false; this.isMonth=true;
this.isMin=true; this.chartId='trafficOfMonth';
this.chartDatas=this.chartData.traffic10Min; this.chartDatas={}
this.setTabelData() this.getChartData('trafficOfMonth',this.chartIds[1])
// this.$emit('handleFun','30');
} }
break; break;
} }
...@@ -179,7 +176,7 @@ ...@@ -179,7 +176,7 @@
}, },
getReportKey(){ getReportKey(){
var report='BasicReport'; var report='BasicReport';
this.keyArr=['kpiData','detailData']; this.keyArr=['trafficOfMonth','detailData'];
uni.showLoading({ uni.showLoading({
title: '加载中' title: '加载中'
...@@ -195,14 +192,17 @@ ...@@ -195,14 +192,17 @@
}, },
method:'GET', method:'GET',
success:(res) =>{ success:(res) =>{
this.chartIds=''; this.chartIds=[];
res.data.data.forEach(item=>{ res.data.data.forEach(item=>{
if(this.keyArr.indexOf(item.key)!='-1'){ if(this.keyArr.indexOf(item.key)!='-1'){
this.chartIds+=item.id+',' this.chartIds.push(item.id)
} }
}) })
this.chartIds=this.chartIds.substring(0,this.chartIds.length-1); if(this.objId=='more'){
this.getChartData(); this.getChartData('detailData',this.chartIds[0]);
}else{
this.getChartData('trafficOfMonth',this.chartIds[1]);
}
} }
}) })
}, },
...@@ -216,7 +216,6 @@ ...@@ -216,7 +216,6 @@
this.columns.push( {field: item, title:item, width: 80, titleAlign: 'center',columnAlign:'center',isResize:true}) this.columns.push( {field: item, title:item, width: 80, titleAlign: 'center',columnAlign:'center',isResize:true})
} }
}) })
console.log(JSON.stringify(this.columns))
this.chartDatas.series.forEach((item,index)=>{ this.chartDatas.series.forEach((item,index)=>{
var obj={} var obj={}
item.data.forEach((item,index)=>{ item.data.forEach((item,index)=>{
...@@ -225,72 +224,92 @@ ...@@ -225,72 +224,92 @@
this.tableData.push(obj) this.tableData.push(obj)
}) })
}, },
getChartData(){ getChartData(objName,chartids){
this.orgIds='' this.orgIds=''
var data={} var data={}
var url=window.url+'/report/basics/mall'; var url=window.url+'/report/basics/mall';
if(this.reportType=='mall'){ if(this.reportType=='mall'){
this.accountId.forEach(item=>{ if(this.objId=='one'){
this.orgIds+=item+',' this.orgIds=this.accountId[0]
}) }else{
this.orgIds=this.orgIds.substring(0,this.orgIds.length-1) this.accountId.forEach(item=>{
this.orgIds+=item+','
})
this.orgIds=this.orgIds.substring(0,this.orgIds.length-1)
}
var startDate=this.date.split(',')[0]; var startDate=this.date.split(',')[0];
var endDate=this.date.split(',')[1]; var endDate=this.date.split(',')[1];
url=window.url+'/report/basics/mall'; url=window.url+'/report/basics/mall';
data={ data={
orgIds:this.orgIds, orgIds:this.orgIds,
startDate:startDate, startDate:startDate,
endDate: endDate, endDate: endDate,
chartIds:this.chartIds, chartIds:chartids,
option:'TAB_TABLE', option:'TAB_CHART',
kpiType:'TRAFFIC',
_t:Date.parse(new Date())/1000 _t:Date.parse(new Date())/1000
} }
}else if(this.reportType=='gate'){ }else if(this.reportType=='gate'){
this.gateId.forEach(item=>{ if(this.objId=='one'){
this.orgIds+=item+',' this.orgIds=this.accountId[0]
}) }else{
this.orgIds=this.orgIds.substring(0,this.orgIds.length-1) this.gateId.forEach(item=>{
this.orgIds+=item+','
})
this.orgIds=this.orgIds.substring(0,this.orgIds.length-1)
}
var startDate=this.date.split(',')[0]; var startDate=this.date.split(',')[0];
var endDate=this.date.split(',')[1]; var endDate=this.date.split(',')[1];
url=window.url+'/report/basics/gate'; url=window.url+'/report/basics/gate';
data={ data={
orgIds:this.orgIds, orgIds:this.orgIds,
startDate:startDate, startDate:startDate,
endDate: endDate, endDate: endDate,
chartIds:this.chartIds, chartIds:chartids,
option:'TAB_TABLE', option:'TAB_CHART',
kpiType:'TRAFFIC',
_t:Date.parse(new Date())/1000 _t:Date.parse(new Date())/1000
} }
}else if(this.reportType=='floor'){ }else if(this.reportType=='floor'){
this.floorId.forEach(item=>{ if(this.objId=='one'){
this.orgIds+=item+',' this.orgIds=this.accountId[0]
}) }else{
this.orgIds=this.orgIds.substring(0,this.orgIds.length-1) this.floorId.forEach(item=>{
url=window.url+'/report/basics/floor'; this.orgIds+=item+','
})
this.orgIds=this.orgIds.substring(0,this.orgIds.length-1)
}
url=window.url+'/report/basics/floor';
var startDate=this.date.split(',')[0]; var startDate=this.date.split(',')[0];
var endDate=this.date.split(',')[1]; var endDate=this.date.split(',')[1];
data={ data={
orgIds:this.orgIds, orgIds:this.orgIds,
startDate:startDate, startDate:startDate,
endDate: endDate, endDate: endDate,
chartIds:this.chartIds, chartIds:chartids,
option:'TAB_TABLE', option:'TAB_CHART',
kpiType:'TRAFFIC',
_t:Date.parse(new Date())/1000 _t:Date.parse(new Date())/1000
} }
}else if(this.reportType=='area'){ }else if(this.reportType=='area'){
this.storeId.forEach(item=>{ if(this.objId=='one'){
this.orgIds+=item+',' this.orgIds=this.accountId[0]
}) }else{
this.orgIds=this.orgIds.substring(0,this.orgIds.length-1) this.storeId.forEach(item=>{
url=window.url+'/report/basics/zone'; this.orgIds+=item+','
})
this.orgIds=this.orgIds.substring(0,this.orgIds.length-1)
}
url=window.url+'/report/basics/zone';
var startDate=this.date.split(',')[0]; var startDate=this.date.split(',')[0];
var endDate=this.date.split(',')[1]; var endDate=this.date.split(',')[1];
data={ data={
orgIds:this.orgIds, orgIds:this.orgIds,
startDate:startDate, startDate:startDate,
endDate: endDate, endDate: endDate,
chartIds:this.chartIds, chartIds:chartids,
option:'TAB_TABLE', option:'TAB_CHART',
kpiType:'TRAFFIC',
_t:Date.parse(new Date())/1000 _t:Date.parse(new Date())/1000
} }
} }
...@@ -305,8 +324,7 @@ ...@@ -305,8 +324,7 @@
uni.hideLoading() uni.hideLoading()
var datas=res.data.data; var datas=res.data.data;
this.chartData=datas.body; this.chartData=datas.body;
this.chartDatas=datas.body.detailData; this.chartDatas=datas.body[objName];
this.setTabelData()
} }
}) })
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div> <div>
<headerComp :leftImgSrc="leftImg" :title="titleStr" :rightImgSrc="rightImg" @leftClick="backFun" @rightClick="conditionFun"></headerComp> <headerComp :leftImgSrc="leftImg" :title="titleStr" :rightImgSrc="rightImg" @leftClick="backFun" @rightClick="conditionFun"></headerComp>
<div style="height: 18.11upx;"></div> <div style="height: 18.11upx;"></div>
<v-table v-if="columns.length>0&&objId=='one'" <!-- <v-table v-if="columns.length>0&&objId=='one'"
is-horizontal-resize is-horizontal-resize
style="width:100%;margin-bottom: 16.3upx;" style="width:100%;margin-bottom: 16.3upx;"
:columns="columns" :columns="columns"
...@@ -37,7 +37,19 @@ ...@@ -37,7 +37,19 @@
row-hover-color="#eee" row-hover-color="#eee"
row-click-color="#edf7ff" row-click-color="#edf7ff"
:height='600' :height='600'
></v-table> ></v-table> -->
<!-- <barchart v-if="isDay" :chart-data="chartDatas" :bind-id='chartId'></barchart> -->
<div v-if="objId=='one'">
<linechart :chart-data="chartDatas['15TrafficTrendLine']" bind-id='15TrafficTrendLine'></linechart>
<linechart :chart-data="chartDatas['15YOTrendLine']" bind-id='15YOTrendLine'></linechart>
<linechart :chart-data="chartDatas.realTimeTrafficTrendLine" bind-id='realTimeTrafficTrendLine'></linechart>
<linechart :chart-data="chartDatas.realTimeYOTrendLine" bind-id='realTimeYOTrendLine'></linechart>
<linechart :chart-data="chartDatas.totalTrafficTrendLine" bind-id='totalTrafficTrendLine'></linechart>
<linechart :chart-data="chartDatas.totalYOTrendLine" bind-id='totalYOTrendLine'></linechart>
</div>
<div v-else>
<barchart :chart-data="chartDatas.moreObjectBar" bind-id='moreObjectBar'></barchart>
</div>
</div> </div>
</template> </template>
...@@ -46,6 +58,8 @@ ...@@ -46,6 +58,8 @@
import backArrow from '../../../static/header/backArrow.png' import backArrow from '../../../static/header/backArrow.png'
import other from '../../../static/header/other.png' import other from '../../../static/header/other.png'
import tables from '../../../components/table' import tables from '../../../components/table'
import barchart from '../../../components/barChart'
import linechart from '../../../components/lineChart'
export default{ export default{
data(){ data(){
return{ return{
...@@ -78,7 +92,8 @@ ...@@ -78,7 +92,8 @@
gateId:[], gateId:[],
floorId:[], floorId:[],
storeId:[], storeId:[],
objId:'one' objId:'one',
chartId:''
} }
}, },
onLoad: function (option) { onLoad: function (option) {
...@@ -167,7 +182,7 @@ ...@@ -167,7 +182,7 @@
} }
}, },
components:{ components:{
headerComp,tables headerComp,tables,barchart,linechart
}, },
methods: { methods: {
backFun(){ backFun(){
...@@ -187,9 +202,9 @@ ...@@ -187,9 +202,9 @@
getReportKey(){ getReportKey(){
var report='DayYoYMoM'; var report='DayYoYMoM';
if(this.objId=='one'){ if(this.objId=='one'){
this.keyArr=['15DayCountingYoY','DayCountingYoY','DayAddYoY']; this.keyArr=['15TrafficTrendLine','15YOTrendLine','realTimeTrafficTrendLine','realTimeYOTrendLine','totalTrafficTrendLine','totalYOTrendLine'];
}else{ }else{
this.keyArr=['moreObjectTable']; this.keyArr=['moreObjectBar'];
} }
uni.showLoading({ uni.showLoading({
...@@ -371,15 +386,7 @@ ...@@ -371,15 +386,7 @@
success:(res) =>{ success:(res) =>{
uni.hideLoading() uni.hideLoading()
var datas=res.data.data; var datas=res.data.data;
this.chartData=datas.body; this.chartDatas=datas.body;
if(this.objId=='one'){
this.chartDatas=datas.body['15DayCountingYoY'];
this.chartDatas2=datas.body['DayCountingYoY'];
this.chartDatas3=datas.body['DayAddYoY'];
}else{
this.chartDatas4=datas.body['moreObjectTable'];
}
this.setTabelData()
} }
}) })
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div> <div>
<headerComp :leftImgSrc="leftImg" :title="titleStr" :rightImgSrc="rightImg" @leftClick="backFun" @rightClick="conditionFun"></headerComp> <headerComp :leftImgSrc="leftImg" :title="titleStr" :rightImgSrc="rightImg" @leftClick="backFun" @rightClick="conditionFun"></headerComp>
<div style="height: 18.11upx;"></div> <div style="height: 18.11upx;"></div>
<v-table v-if="columns.length>0&&objId=='one'" <!-- <v-table v-if="columns.length>0&&objId=='one'"
is-horizontal-resize is-horizontal-resize
style="width:100%;margin-bottom: 16.3upx;" style="width:100%;margin-bottom: 16.3upx;"
:columns="columns" :columns="columns"
...@@ -37,7 +37,16 @@ ...@@ -37,7 +37,16 @@
row-hover-color="#eee" row-hover-color="#eee"
row-click-color="#edf7ff" row-click-color="#edf7ff"
:height='600' :height='600'
></v-table> ></v-table> -->
<div v-if="objId=='one'">
<barchart :chart-data="chartDatas['recentMonthTrafficTrend']" bind-id='recentMonthTrafficTrend'></barchart>
<linechart :chart-data="chartDatas['recentMonthYTrend']" bind-id='recentMonthYTrend'></linechart>
<linechart :chart-data="chartDatas.thisMonthTrafficTrend" bind-id='thisMonthTrafficTrend'></linechart>
<linechart :chart-data="chartDatas.thisMonthYOTrend" bind-id='thisMonthYOTrend'></linechart>
</div>
<div v-else>
<barchart :chart-data="chartDatas.moreObjectBar" bind-id='moreObjectBar'></barchart>
</div>
</div> </div>
</template> </template>
...@@ -46,6 +55,8 @@ ...@@ -46,6 +55,8 @@
import backArrow from '../../../static/header/backArrow.png' import backArrow from '../../../static/header/backArrow.png'
import other from '../../../static/header/other.png' import other from '../../../static/header/other.png'
import tables from '../../../components/table' import tables from '../../../components/table'
import barchart from '../../../components/barChart'
import linechart from '../../../components/lineChart'
export default{ export default{
data(){ data(){
return{ return{
...@@ -167,7 +178,7 @@ ...@@ -167,7 +178,7 @@
} }
}, },
components:{ components:{
headerComp,tables headerComp,tables,barchart,linechart
}, },
methods: { methods: {
backFun(){ backFun(){
...@@ -187,9 +198,9 @@ ...@@ -187,9 +198,9 @@
getReportKey(){ getReportKey(){
var report='MonthYoYMoM'; var report='MonthYoYMoM';
if(this.objId=='one'){ if(this.objId=='one'){
this.keyArr=['Near3MonthYoY','WeekDayOrEndYoY','DayOfMonthYoY']; this.keyArr=['recentMonthTrafficTrend','recentMonthYTrend','thisMonthTrafficTrend','thisMonthYOTrend'];
}else{ }else{
this.keyArr=['moreObjectTable']; this.keyArr=['moreObjectBar'];
} }
uni.showLoading({ uni.showLoading({
...@@ -371,15 +382,7 @@ ...@@ -371,15 +382,7 @@
success:(res) =>{ success:(res) =>{
uni.hideLoading() uni.hideLoading()
var datas=res.data.data; var datas=res.data.data;
this.chartData=datas.body; this.chartDatas=datas.body;
if(this.objId=='one'){
this.chartDatas=datas.body['Near3MonthYoY'];
this.chartDatas2=datas.body['DayOfMonthYoY'];
this.chartDatas3=datas.body['WeekDayOrEndYoY'];
}else{
this.chartDatas4=datas.body['moreObjectTable'];
}
this.setTabelData()
} }
}) })
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div> <div>
<headerComp :leftImgSrc="leftImg" :title="titleStr" :rightImgSrc="rightImg" @leftClick="backFun" @rightClick="conditionFun"></headerComp> <headerComp :leftImgSrc="leftImg" :title="titleStr" :rightImgSrc="rightImg" @leftClick="backFun" @rightClick="conditionFun"></headerComp>
<div style="height: 18.11upx;"></div> <div style="height: 18.11upx;"></div>
<v-table v-if="columns.length>0&&objId=='one'" <!-- <v-table v-if="columns.length>0&&objId=='one'"
is-horizontal-resize is-horizontal-resize
style="width:100%;margin-bottom: 16.3upx;" style="width:100%;margin-bottom: 16.3upx;"
:columns="columns" :columns="columns"
...@@ -37,7 +37,16 @@ ...@@ -37,7 +37,16 @@
row-hover-color="#eee" row-hover-color="#eee"
row-click-color="#edf7ff" row-click-color="#edf7ff"
:height='600' :height='600'
></v-table> ></v-table> -->
<div v-if="objId=='one'">
<barchart :chart-data="chartDatas['8WeekTrafficTrendLine']" bind-id='8WeekTrafficTrendLine'></barchart>
<linechart :chart-data="chartDatas['8WeekYTrendLine']" bind-id='8WeekYTrendLine'></linechart>
<linechart :chart-data="chartDatas.thisWeekTrafficTrend" bind-id='thisWeekTrafficTrend'></linechart>
<linechart :chart-data="chartDatas.thisWeekYOTrend" bind-id='thisWeekYOTrend'></linechart>
</div>
<div v-else>
<barchart :chart-data="chartDatas.moreObjectBar" bind-id='moreObjectBar'></barchart>
</div>
</div> </div>
</template> </template>
...@@ -46,6 +55,8 @@ ...@@ -46,6 +55,8 @@
import backArrow from '../../../static/header/backArrow.png' import backArrow from '../../../static/header/backArrow.png'
import other from '../../../static/header/other.png' import other from '../../../static/header/other.png'
import tables from '../../../components/table' import tables from '../../../components/table'
import barchart from '../../../components/barChart'
import linechart from '../../../components/lineChart'
export default{ export default{
data(){ data(){
return{ return{
...@@ -89,7 +100,6 @@ ...@@ -89,7 +100,6 @@
key:'objId', key:'objId',
success:(res)=>{ success:(res)=>{
this.objId=JSON.parse(res.data)[0]; this.objId=JSON.parse(res.data)[0];
console.log(this.objId)
} }
}) })
uni.getStorage({ uni.getStorage({
...@@ -167,7 +177,7 @@ ...@@ -167,7 +177,7 @@
} }
}, },
components:{ components:{
headerComp,tables headerComp,tables,barchart,linechart
}, },
methods: { methods: {
backFun(){ backFun(){
...@@ -187,9 +197,9 @@ ...@@ -187,9 +197,9 @@
getReportKey(){ getReportKey(){
var report='WeekYoYMoM'; var report='WeekYoYMoM';
if(this.objId=='one'){ if(this.objId=='one'){
this.keyArr=['Near3WeekYoY','DayOfWeekYoY','WeekDayOrEndYoY']; this.keyArr=['8WeekTrafficTrendLine','8WeekYTrendLine','thisWeekTrafficTrend','thisWeekYOTrend'];
}else{ }else{
this.keyArr=['moreObjectTable']; this.keyArr=['moreObjectBar'];
} }
uni.showLoading({ uni.showLoading({
...@@ -371,15 +381,7 @@ ...@@ -371,15 +381,7 @@
success:(res) =>{ success:(res) =>{
uni.hideLoading() uni.hideLoading()
var datas=res.data.data; var datas=res.data.data;
this.chartData=datas.body; this.chartDatas=datas.body;
if(this.objId=='one'){
this.chartDatas=datas.body['Near3WeekYoY'];
this.chartDatas2=datas.body['DayOfWeekYoY'];
this.chartDatas3=datas.body['WeekDayOrEndYoY'];
}else{
this.chartDatas4=datas.body['moreObjectTable'];
}
this.setTabelData()
} }
}) })
......
...@@ -2,42 +2,14 @@ ...@@ -2,42 +2,14 @@
<div> <div>
<headerComp :leftImgSrc="leftImg" :title="titleStr" :rightImgSrc="rightImg" @leftClick="backFun" @rightClick="conditionFun"></headerComp> <headerComp :leftImgSrc="leftImg" :title="titleStr" :rightImgSrc="rightImg" @leftClick="backFun" @rightClick="conditionFun"></headerComp>
<div style="height: 18.11upx;"></div> <div style="height: 18.11upx;"></div>
<v-table v-if="columns.length>0&&objId=='one'" <div v-if="objId=='one'">
is-horizontal-resize <linebarchart :chart-data="chartDatas.trafficAndYO" bind-id='trafficAndYO'></linebarchart>
style="width:100%;margin-bottom: 16.3upx;" <barchart :chart-data="chartDatas.thisYearTrafficTrend" bind-id='thisYearTrafficTrend'></barchart>
:columns="columns" <linechart :chart-data="chartDatas.thisYearYTrend" bind-id='thisYearYTrend'></linechart>
:table-data="tableData" </div>
row-hover-color="#eee" <div v-else>
row-click-color="#edf7ff" <barchart :chart-data="chartDatas.moreObjectBar" bind-id='moreObjectBar'></barchart>
:height='600' </div>
></v-table>
<v-table v-if="columns2.length>0&&objId=='one'"
is-horizontal-resize
style="width:100%;margin-bottom: 16.3upx;"
:columns="columns2"
:table-data="tableData2"
row-hover-color="#eee"
row-click-color="#edf7ff"
:height='600'
></v-table>
<v-table v-if="columns3.length>0&&objId=='one'"
is-horizontal-resize
style="width:100%;margin-bottom: 16.3upx;"
:columns="columns3"
:table-data="tableData3"
row-hover-color="#eee"
row-click-color="#edf7ff"
:height='600'
></v-table>
<v-table v-if="columns4.length>0&&objId=='more'"
is-horizontal-resize
style="width:100%;margin-bottom: 16.3upx;"
:columns="columns4"
:table-data="tableData4"
row-hover-color="#eee"
row-click-color="#edf7ff"
:height='600'
></v-table>
</div> </div>
</template> </template>
...@@ -46,6 +18,10 @@ ...@@ -46,6 +18,10 @@
import backArrow from '../../../static/header/backArrow.png' import backArrow from '../../../static/header/backArrow.png'
import other from '../../../static/header/other.png' import other from '../../../static/header/other.png'
import tables from '../../../components/table' import tables from '../../../components/table'
import barchart from '../../../components/barChart'
import linechart from '../../../components/lineChart'
import linebarchart from '../../../components/lineBarChart'
export default{ export default{
data(){ data(){
return{ return{
...@@ -167,7 +143,7 @@ ...@@ -167,7 +143,7 @@
} }
}, },
components:{ components:{
headerComp,tables headerComp,tables,barchart,linechart,linebarchart
}, },
methods: { methods: {
backFun(){ backFun(){
...@@ -187,9 +163,9 @@ ...@@ -187,9 +163,9 @@
getReportKey(){ getReportKey(){
var report='YearYoYMoM'; var report='YearYoYMoM';
if(this.objId=='one'){ if(this.objId=='one'){
this.keyArr=['Near3YearYoY','MonthOfYearYoY','WeekDayOrEndYoY']; this.keyArr=['trafficAndYO','thisYearTrafficTrend','thisYearYTrend'];
}else{ }else{
this.keyArr=['moreObjectTable']; this.keyArr=['moreObjectBar'];
} }
uni.showLoading({ uni.showLoading({
...@@ -371,15 +347,7 @@ ...@@ -371,15 +347,7 @@
success:(res) =>{ success:(res) =>{
uni.hideLoading() uni.hideLoading()
var datas=res.data.data; var datas=res.data.data;
this.chartData=datas.body; this.chartDatas=datas.body;
if(this.objId=='one'){
this.chartDatas=datas.body['Near3YearYoY'];
this.chartDatas2=datas.body['MonthOfYearYoY'];
this.chartDatas3=datas.body['WeekDayOrEndYoY'];
}else{
this.chartDatas4=datas.body['moreObjectTable'];
}
this.setTabelData()
} }
}) })
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<!-- <toast :typeArr="dateTypeArr" :toastShow.sync="isShow" @handleChange="toastClick"></toast> --> <!-- <toast :typeArr="dateTypeArr" :toastShow.sync="isShow" @handleChange="toastClick"></toast> -->
<span class="selectReport" @tap="dateShow">日期</span> <span class="selectReport" @tap="dateShow">日期</span>
{{title}} {{title}}
<span class="searchBtn" @tap="goList">{{i18n.store}}</span> <span class="searchBtn" @tap="goList" v-if="permissionsFun('mall')">{{i18n.store}}</span>
</view> </view>
<div id="minirefresh" class="minirefresh-wrap" :style="{top:scrollTop+'px'}"> <div id="minirefresh" class="minirefresh-wrap" :style="{top:scrollTop+'px'}">
......
...@@ -26,6 +26,11 @@ export default{ ...@@ -26,6 +26,11 @@ export default{
this.type=res.data; this.type=res.data;
} }
}) })
console.log(this.permissionsFun('behavior'))
if(!this.permissionsFun('behavior')){
console.log('aaa')
document.getElementsByClassName('uni-tabbar__item')[2].style.display="none"
}
}, },
components:{ components:{
accountindex,mallindex,floorindex,zoneindex accountindex,mallindex,floorindex,zoneindex
......
<template>
<view>
<headerComp :leftImgSrc="leftSrc" @leftClick="backClick" :title="titleStr"></headerComp>
<!-- <div class="searchBox">
<mSearch @search="search($event,0)" backgroundColor="#0069FF" :mode="2" :show=false></mSearch>
</div> -->
<uni-list>
<uni-list-item :title="this.$t('index').allStore" @tap="selectStore(id)"></uni-list-item>
<uni-list-item :title="item.name" @tap="selectStore(item.id,item.name)" v-for="item in list"></uni-list-item>
</uni-list>
</view>
</template>
<script>
import headerComp from '../../components/header'
import uniList from '@/components/list/uni-list/uni-list.vue'
import uniListItem from '@/components/list/uni-list-item/uni-list-item.vue'
// import mSearch from '@/components/mehaotian-search/mehaotian-search'
export default{
data(){
return{
aa:"aa",
leftSrc:'../../static/header/backArrow.png',
titleStr:this.$t('index').storeSelect,
id:'',
atoken:'',
list:[],
accountName:'',
url:''
}
},
onLoad: function (option) { //option为object类型,会序列化上个页面传递的参数
// this.atoken=option.atoken;
// this.id=option.accountId;
this.url=option.url;
uni.getStorage({
key:'accountName',
success:(res)=>{
this.accountName=res.data;
}
})
uni.getStorage({
key:'accountId',
success:(res)=>{
this.id=res.data;
}
})
uni.getStorage({
key:'atoken',
success:(res)=>{
this.atoken=res.data;
}
})
this.getListData();
},
computed: {
i18n(){
return this.$t('index')
}
},
components:{
headerComp,uniList,uniListItem
},
methods: {
search(e, val) {
console.log(e);
},
selectStore(id,name){
uni.setStorage({
key:'orgIds',
data:id
})
if(id==this.id){
uni.setStorage({
key:'type',
data:'account'
})
uni.setStorage({
key:'orgName',
data:this.accountName
})
}else{
uni.setStorage({
key:'type',
data:'mall'
})
uni.setStorage({
key:'orgName',
data:name
})
}
uni.reLaunch({
url:this.url,
})
},
getListData(){
uni.request({
url:window.url+'/malls',
data:{
accountId:this.id,
_t:Date.parse(new Date())/1000
},
header: {
'Authorization': this.atoken //自定义请求头信息
},
method:'GET',
success:(res) =>{
this.list=res.data.data;
}
})
},
backClick() {
uni.navigateBack({
delta:1
})
}
},
}
</script>
<style>
</style>
<template>
<view>
<headerComp :leftImgSrc="leftSrc" @leftClick="backClick" :title="titleStr"></headerComp>
<searchBox @handleEvent="searchFun"></searchBox>
<view class="list">
<view class="listItem" @tap="itemFun(item)" v-for="item in list">
<text>{{item.name}}</text>
</view>
</view>
<!-- <uni-list>
<uni-list-item :title="this.$t('index').allStore" @click="selectStore(id)"></uni-list-item>
<uni-list-item :title="item.name" @click="selectStore(item.id,item.name)" v-for="item in list"></uni-list-item>
</uni-list> -->
</view>
</template>
<script>
import headerComp from '../../components/header'
import searchBox from '../../components/search'
export default{
data(){
return{
aa:"aa",
leftSrc:'../../static/header/backArrow.png',
titleStr:this.$t('index').storeSelect,
id:'',
atoken:'',
list:[],
allList:[],
accountName:'',
url:'',
selectSrc:'../../static/list/select.png',
unSelectSrc:'../../static/list/unselect.png',
selectIdArr:[],
selectNameArr:[],
type:''
}
},
onLoad: function (option) { //option为object类型,会序列化上个页面传递的参数
// this.atoken=option.atoken;
// this.id=option.accountId;
this.url=option.url;
this.type=option.type;
uni.getStorage({
key:'accountName',
success:(res)=>{
this.accountName=res.data;
}
})
uni.getStorage({
key:'accountId',
success:(res)=>{
this.id=res.data;
}
})
uni.getStorage({
key:'atoken',
success:(res)=>{
this.atoken=res.data;
}
})
this.getListData();
},
computed: {
i18n(){
return this.$t('index')
}
},
components:{
headerComp,searchBox
},
methods: {
searchFun(val){
this.list=[];
this.allList.forEach(item=>{
if(item.name.indexOf(val)!=-1){
this.list.push(item)
}
})
},
itemFun(item){
this.selectIdArr=[];
this.selectNameArr=[]
this.selectNameArr.push(item.name)
this.selectIdArr.push(item.id)
this.confirmFun();
},
confirmFun(){
uni.removeStorage({
key: 'selectGateNameArr',
success: function (res) {
console.log('success');
}
});
uni.removeStorage({
key: 'selectFloorNameArr',
success: function (res) {
console.log('success');
}
});
uni.setStorage({
key:'selectAccountIdArr',
data:JSON.stringify(this.selectIdArr)
})
uni.setStorage({
key:'selectAccountNameArr',
data:JSON.stringify(this.selectNameArr)
})
uni.reLaunch({
url:this.url+'?type='+this.type,
})
},
getListData(){
uni.getStorage({
key:'accountList',
success:(res)=>{
this.allList=JSON.parse(res.data);
this.list=JSON.parse(res.data);
}
})
},
backClick() {
uni.navigateBack({
delta:1
})
}
},
}
</script>
<style>
.listItem{
border-bottom: 1px solid #979797;
height: 72.46upx;
line-height: 72.46upx;
font-size: 25.37upx;
background: #FFFFFF;
position: relative;
}
.listItem>image{
width: 28.99upx;
height: 28.99upx;
position: absolute;
top:23.55upx;
left: 25.36upx;
}
.listItem text{
margin-left: 77.89upx;
}
</style>
...@@ -35,12 +35,22 @@ ...@@ -35,12 +35,22 @@
selectIdArr:[], selectIdArr:[],
selectNameArr:[], selectNameArr:[],
type:'', type:'',
showList:{} showList:{},
mallId:''
} }
}, },
onLoad: function (option) { //option为object类型,会序列化上个页面传递的参数 onLoad: function (option) { //option为object类型,会序列化上个页面传递的参数
// this.atoken=option.atoken; // this.atoken=option.atoken;
// this.id=option.accountId; // this.id=option.accountId;
uni.getStorage({
key:"selectAccountIdArr",
success: (res) => {
this.mallid=JSON.parse(res.data)[0];
}
})
if(!this.mallId){
this.mallId=option.mallId;
}
this.url=option.url; this.url=option.url;
this.type=option.type; this.type=option.type;
uni.getStorage({ uni.getStorage({
...@@ -107,15 +117,8 @@ ...@@ -107,15 +117,8 @@
}) })
}, },
getListData(){ getListData(){
var mallid='';
var year='' var year=''
uni.getStorage({
key:"selectAccountIdArr",
success: (res) => {
mallid=JSON.parse(res.data)[0];
}
})
uni.getStorage({ uni.getStorage({
key:"selectDate", key:"selectDate",
success: (res) => { success: (res) => {
...@@ -125,7 +128,7 @@ ...@@ -125,7 +128,7 @@
uni.request({ uni.request({
url:window.url+'/events/getEvent', url:window.url+'/events/getEvent',
data:{ data:{
mallId:mallid, mallId:this.mallId,
year:year, year:year,
_t:Date.parse(new Date())/1000 _t:Date.parse(new Date())/1000
}, },
......
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
<view> <view>
<headerComp :leftImgSrc="leftSrc" @leftClick="backClick" :title="titleStr"></headerComp> <headerComp :leftImgSrc="leftSrc" @leftClick="backClick" :title="titleStr"></headerComp>
<view class="hearSwich"> <view class="hearSwich">
<span class="swichButton" :class="{active:selectFloor}" @tap="tapFloor">楼层</span> <span class="swichButton" :class="{active:selectFloor}" @tap="tapFloor" v-if="permissionsFun('floor')">楼层</span>
<span class="swichButton" :class="{active:selectZone}" @tap="tapZone">{{i18n.area}}</span> <span class="swichButton" :class="{active:selectZone}" @tap="tapZone" v-if="permissionsFun('shop')">{{i18n.area}}</span>
</view> </view>
<uni-list v-show="selectFloor"> <uni-list v-show="selectFloor" v-if="permissionsFun('floor')">
<uni-list-item :title="item.name" @tap="selectItem(item.id,item.name)" v-for="item in floorList"></uni-list-item> <uni-list-item :title="item.name" @tap="selectItem(item.id,item.name)" v-for="item in floorList"></uni-list-item>
</uni-list> </uni-list>
<uni-list v-show="selectZone"> <uni-list v-show="selectZone" v-if="permissionsFun('shop')">
<uni-list-item :title="item.name" @tap="selectItem(item.id,item.name)" v-for="item in zoneList"></uni-list-item> <uni-list-item :title="item.name" @tap="selectItem(item.id,item.name)" v-for="item in zoneList"></uni-list-item>
</uni-list> </uni-list>
</view> </view>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<mSearch @search="search($event,0)" backgroundColor="#0069FF" :mode="2" :show=false></mSearch> <mSearch @search="search($event,0)" backgroundColor="#0069FF" :mode="2" :show=false></mSearch>
</div> --> </div> -->
<uni-list> <uni-list>
<uni-list-item :title="this.$t('index').allStore" @tap="selectStore(id)"></uni-list-item> <uni-list-item :title="this.$t('index').allStore" @tap="selectStore(id,'all')"></uni-list-item>
<uni-list-item :title="item.name" @tap="selectStore(item.id,item.name)" v-for="item in list"></uni-list-item> <uni-list-item :title="item.name" @tap="selectStore(item.id,item.name)" v-for="item in list"></uni-list-item>
</uni-list> </uni-list>
</view> </view>
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
key:'orgIds', key:'orgIds',
data:id data:id
}) })
if(id==this.id){ if(id==this.id&&name=='all'){
uni.setStorage({ uni.setStorage({
key:'type', key:'type',
data:'account' data:'account'
......
...@@ -36,12 +36,22 @@ ...@@ -36,12 +36,22 @@
unSelectSrc:'../../static/list/unselect.png', unSelectSrc:'../../static/list/unselect.png',
selectIdArr:[], selectIdArr:[],
selectNameArr:[], selectNameArr:[],
type:'' type:'',
mallId:''
} }
}, },
onLoad: function (option) { //option为object类型,会序列化上个页面传递的参数 onLoad: function (option) { //option为object类型,会序列化上个页面传递的参数
// this.atoken=option.atoken; // this.atoken=option.atoken;
// this.id=option.accountId; // this.id=option.accountId;
uni.getStorage({
key:"selectAccountIdArr",
success: (res) => {
this.mallid=JSON.parse(res.data)[0];
}
})
if(!this.mallId){
this.mallId=option.mallId;
}
this.type=option.type; this.type=option.type;
this.url=option.url; this.url=option.url;
uni.getStorage({ uni.getStorage({
...@@ -175,18 +185,11 @@ ...@@ -175,18 +185,11 @@
}) })
}, },
getListData(){ getListData(){
var mallid='';
uni.getStorage({
key:"selectAccountIdArr",
success: (res) => {
mallid=JSON.parse(res.data)[0];
}
})
uni.request({ uni.request({
url:window.url+'/floors', url:window.url+'/floors',
data:{ data:{
accountId: this.id, accountId: this.id,
mallId:mallid, mallId:this.mallId,
status: 1, status: 1,
_t:Date.parse(new Date())/1000 _t:Date.parse(new Date())/1000
}, },
......
...@@ -36,12 +36,22 @@ ...@@ -36,12 +36,22 @@
unSelectSrc:'../../static/list/unselect.png', unSelectSrc:'../../static/list/unselect.png',
selectIdArr:[], selectIdArr:[],
selectNameArr:[], selectNameArr:[],
type:'' type:'',
mallId:''
} }
}, },
onLoad: function (option) { //option为object类型,会序列化上个页面传递的参数 onLoad: function (option) { //option为object类型,会序列化上个页面传递的参数
// this.atoken=option.atoken; // this.atoken=option.atoken;
// this.id=option.accountId; // this.id=option.accountId;
uni.getStorage({
key:"selectAccountIdArr",
success: (res) => {
this.mallid=JSON.parse(res.data)[0];
}
})
if(!this.mallId){
this.mallId=option.mallId;
}
this.type=option.type; this.type=option.type;
this.url=option.url; this.url=option.url;
uni.getStorage({ uni.getStorage({
...@@ -175,18 +185,11 @@ ...@@ -175,18 +185,11 @@
}) })
}, },
getListData(){ getListData(){
var mallid='';
uni.getStorage({
key:"selectAccountIdArr",
success: (res) => {
mallid=JSON.parse(res.data)[0];
}
})
uni.request({ uni.request({
url:window.url+'/gates', url:window.url+'/gates',
data:{ data:{
accountId: this.id, accountId: this.id,
mallId:mallid, mallId:this.mallId,
status: 1, status: 1,
type_arr: '1,3', type_arr: '1,3',
_t:Date.parse(new Date())/1000 _t:Date.parse(new Date())/1000
......
...@@ -97,6 +97,7 @@ ...@@ -97,6 +97,7 @@
itemFun(item){ itemFun(item){
item.select=!item.select; item.select=!item.select;
if(item.id=='all'){ if(item.id=='all'){
console.log(this.list)
this.selectIdArr=[]; this.selectIdArr=[];
this.selectNameArr=[] this.selectNameArr=[]
if(item.select){ if(item.select){
...@@ -112,7 +113,6 @@ ...@@ -112,7 +113,6 @@
item.select=false; item.select=false;
}) })
} }
}else{ }else{
if(item.select){ if(item.select){
this.selectIdArr.push(item.id); this.selectIdArr.push(item.id);
...@@ -155,6 +155,7 @@ ...@@ -155,6 +155,7 @@
console.log(e); console.log(e);
}, },
confirmFun(){ confirmFun(){
console.log(this.selectIdArr)
if(this.selectIdArr.length==0){ if(this.selectIdArr.length==0){
uni.showToast({ uni.showToast({
icon:'none', icon:'none',
......
...@@ -36,12 +36,22 @@ ...@@ -36,12 +36,22 @@
unSelectSrc:'../../static/list/unselect.png', unSelectSrc:'../../static/list/unselect.png',
selectIdArr:[], selectIdArr:[],
selectNameArr:[], selectNameArr:[],
type:'' type:'',
mallId:''
} }
}, },
onLoad: function (option) { //option为object类型,会序列化上个页面传递的参数 onLoad: function (option) { //option为object类型,会序列化上个页面传递的参数
// this.atoken=option.atoken; // this.atoken=option.atoken;
// this.id=option.accountId; // this.id=option.accountId;
uni.getStorage({
key:"selectAccountIdArr",
success: (res) => {
this.mallid=JSON.parse(res.data)[0];
}
})
if(!this.mallId){
this.mallId=option.mallId;
}
this.type=option.type; this.type=option.type;
this.url=option.url; this.url=option.url;
uni.getStorage({ uni.getStorage({
...@@ -175,13 +185,6 @@ ...@@ -175,13 +185,6 @@
}) })
}, },
getListData(){ getListData(){
var mallid='';
uni.getStorage({
key:"selectAccountIdArr",
success: (res) => {
mallid=JSON.parse(res.data)[0];
}
})
var floorid=''; var floorid='';
uni.getStorage({ uni.getStorage({
key:"selectFloorIdArr", key:"selectFloorIdArr",
...@@ -193,7 +196,7 @@ ...@@ -193,7 +196,7 @@
url:window.url+'/zones', url:window.url+'/zones',
data:{ data:{
accountId: this.id, accountId: this.id,
mallId:mallid, mallId:this.mallId,
floorId:floorid, floorId:floorid,
status: 1, status: 1,
_t:Date.parse(new Date())/1000 _t:Date.parse(new Date())/1000
......
...@@ -35,12 +35,22 @@ ...@@ -35,12 +35,22 @@
selectIdArr:[], selectIdArr:[],
selectNameArr:[], selectNameArr:[],
type:'', type:'',
showList:{} showList:{},
mallId:''
} }
}, },
onLoad: function (option) { //option为object类型,会序列化上个页面传递的参数 onLoad: function (option) { //option为object类型,会序列化上个页面传递的参数
// this.atoken=option.atoken; // this.atoken=option.atoken;
// this.id=option.accountId; // this.id=option.accountId;
uni.getStorage({
key:"selectAccountIdArr",
success: (res) => {
this.mallid=JSON.parse(res.data)[0];
}
})
if(!this.mallId){
this.mallId=option.mallId;
}
this.url=option.url; this.url=option.url;
this.type=option.type; this.type=option.type;
uni.getStorage({ uni.getStorage({
...@@ -90,7 +100,15 @@ ...@@ -90,7 +100,15 @@
this.selectIdArr=[]; this.selectIdArr=[];
this.selectNameArr=[] this.selectNameArr=[]
this.selectNameArr.push(item.name) this.selectNameArr.push(item.name)
this.selectIdArr.push(item.id) if(item.id=='all'){
this.allList.forEach(item=>{
if(item.name!='全部'){
this.selectIdArr.push(item.id)
}
})
}else{
this.selectIdArr.push(item.id)
}
this.confirmFun(); this.confirmFun();
}, },
confirmFun(){ confirmFun(){
...@@ -113,18 +131,11 @@ ...@@ -113,18 +131,11 @@
}) })
}, },
getListData(){ getListData(){
var mallid='';
uni.getStorage({
key:"selectAccountIdArr",
success: (res) => {
mallid=JSON.parse(res.data)[0];
}
})
uni.request({ uni.request({
url:window.url+'/floors', url:window.url+'/floors',
data:{ data:{
accountId: this.id, accountId: this.id,
mallId:mallid, mallId:this.mallId,
status: 1, status: 1,
_t:Date.parse(new Date())/1000 _t:Date.parse(new Date())/1000
}, },
......
...@@ -34,12 +34,22 @@ ...@@ -34,12 +34,22 @@
unSelectSrc:'../../static/list/unselect.png', unSelectSrc:'../../static/list/unselect.png',
selectIdArr:[], selectIdArr:[],
selectNameArr:[], selectNameArr:[],
type:'' type:'',
mallId:''
} }
}, },
onLoad: function (option) { //option为object类型,会序列化上个页面传递的参数 onLoad: function (option) { //option为object类型,会序列化上个页面传递的参数
// this.atoken=option.atoken; // this.atoken=option.atoken;
// this.id=option.accountId; // this.id=option.accountId;
uni.getStorage({
key:"selectAccountIdArr",
success: (res) => {
this.mallid=JSON.parse(res.data)[0];
}
})
if(!this.mallId){
this.mallId=option.mallId;
}
this.url=option.url; this.url=option.url;
this.type=option.type; this.type=option.type;
uni.getStorage({ uni.getStorage({
...@@ -83,7 +93,15 @@ ...@@ -83,7 +93,15 @@
this.selectIdArr=[]; this.selectIdArr=[];
this.selectNameArr=[] this.selectNameArr=[]
this.selectNameArr.push(item.name) this.selectNameArr.push(item.name)
this.selectIdArr.push(item.id) if(item.id=='all'){
this.allList.forEach(item=>{
if(item.name!='全部'){
this.selectIdArr.push(item.id)
}
})
}else{
this.selectIdArr.push(item.id)
}
this.confirmFun(); this.confirmFun();
}, },
confirmFun(){ confirmFun(){
...@@ -114,18 +132,11 @@ ...@@ -114,18 +132,11 @@
} }
}) })
var mallid='';
uni.getStorage({
key:"selectAccountIdArr",
success: (res) => {
mallid=JSON.parse(res.data)[0];
}
})
uni.request({ uni.request({
url:window.url+'/gates', url:window.url+'/gates',
data:{ data:{
accountId: this.id, accountId: this.id,
mallId:mallid, mallId:this.mallId,
status: 1, status: 1,
_t:Date.parse(new Date())/1000 _t:Date.parse(new Date())/1000
}, },
......
...@@ -83,7 +83,15 @@ ...@@ -83,7 +83,15 @@
this.selectIdArr=[]; this.selectIdArr=[];
this.selectNameArr=[] this.selectNameArr=[]
this.selectNameArr.push(item.name) this.selectNameArr.push(item.name)
this.selectIdArr.push(item.id) if(item.id=='all'){
this.allList.forEach(item=>{
if(item.name!='全部'){
this.selectIdArr.push(item.id)
}
})
}else{
this.selectIdArr.push(item.id)
}
this.confirmFun(); this.confirmFun();
}, },
confirmFun(){ confirmFun(){
......
...@@ -35,12 +35,22 @@ ...@@ -35,12 +35,22 @@
selectIdArr:[], selectIdArr:[],
selectNameArr:[], selectNameArr:[],
type:'', type:'',
showList:{} showList:{},
mallId:""
} }
}, },
onLoad: function (option) { //option为object类型,会序列化上个页面传递的参数 onLoad: function (option) { //option为object类型,会序列化上个页面传递的参数
// this.atoken=option.atoken; // this.atoken=option.atoken;
// this.id=option.accountId; // this.id=option.accountId;
uni.getStorage({
key:"selectAccountIdArr",
success: (res) => {
this.mallid=JSON.parse(res.data)[0];
}
})
if(!this.mallId){
this.mallId=option.mallId;
}
this.url=option.url; this.url=option.url;
this.type=option.type; this.type=option.type;
uni.getStorage({ uni.getStorage({
...@@ -90,7 +100,15 @@ ...@@ -90,7 +100,15 @@
this.selectIdArr=[]; this.selectIdArr=[];
this.selectNameArr=[] this.selectNameArr=[]
this.selectNameArr.push(item.name) this.selectNameArr.push(item.name)
this.selectIdArr.push(item.id) if(item.id=='all'){
this.allList.forEach(item=>{
if(item.name!='全部'){
this.selectIdArr.push(item.id)
}
})
}else{
this.selectIdArr.push(item.id)
}
this.confirmFun(); this.confirmFun();
}, },
confirmFun(){ confirmFun(){
...@@ -115,13 +133,6 @@ ...@@ -115,13 +133,6 @@
} }
}) })
var mallid='';
uni.getStorage({
key:"selectAccountIdArr",
success: (res) => {
mallid=JSON.parse(res.data)[0];
}
})
var floorid=''; var floorid='';
uni.getStorage({ uni.getStorage({
key:"selectFloorIdArr", key:"selectFloorIdArr",
...@@ -133,7 +144,7 @@ ...@@ -133,7 +144,7 @@
url:window.url+'/zones', url:window.url+'/zones',
data:{ data:{
accountId: this.id, accountId: this.id,
mallId:mallid, mallId:this.mallId,
floorId:floorid, floorId:floorid,
status: 1, status: 1,
_t:Date.parse(new Date())/1000 _t:Date.parse(new Date())/1000
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
<image src="../../static/login/pwd.png" mode=""></image> <image src="../../static/login/pwd.png" mode=""></image>
<input class="uni-input pwdInput" placeholder="请输入密码" password v-model="password"/> <input class="uni-input pwdInput" placeholder="请输入密码" password v-model="password"/>
</view> </view>
<text class='checkUrl' @tap="switchConnect">切换服务器地址</text>
<button class="loginBtn" @tap="login">登录</button> <button class="loginBtn" @tap="login">登录</button>
</view> </view>
</view> </view>
...@@ -25,15 +26,14 @@ ...@@ -25,15 +26,14 @@
password:'', password:'',
navheight:0, navheight:0,
atoken:'', atoken:'',
id:'' id:'',
list:[]
} }
}, },
onLoad() { onLoad() {
console.log('aaa')
uni.getStorage({ uni.getStorage({
key:'user', key:'user',
success: (res) => { success: (res) => {
console.log(res)
this.username=res.data; this.username=res.data;
} }
}) })
...@@ -43,6 +43,21 @@ ...@@ -43,6 +43,21 @@
this.password=res.data; this.password=res.data;
} }
}) })
var isLoging=false;
uni.getStorage({
key:'isLoging',
success:(res)=>{
isLoging=res.data;
}
})
if(isLoging){
window.webviewPub = this.login;
try{
model.webAutoLogin()
}catch(e){
//TODO handle the exception
}
}
}, },
onReady(){ onReady(){
uni.getStorage({ uni.getStorage({
...@@ -52,14 +67,6 @@ ...@@ -52,14 +67,6 @@
} }
}) })
}, },
created() {
window.webviewPub = this.login;
try{
model.webAutoLogin()
}catch(e){
//TODO handle the exception
}
},
methods: { methods: {
getDate(){ getDate(){
var dayData=[]; var dayData=[];
...@@ -144,7 +151,6 @@ ...@@ -144,7 +151,6 @@
currentDay.push(yearIndex); currentDay.push(yearIndex);
currentDay.push(monthIndex); currentDay.push(monthIndex);
currentDay.push(dayIndex); currentDay.push(dayIndex);
console.log('login set current day:', currentDay)
uni.setStorage({ uni.setStorage({
key:'yearData', key:'yearData',
data:JSON.stringify(yearData) data:JSON.stringify(yearData)
...@@ -178,6 +184,49 @@ ...@@ -178,6 +184,49 @@
data:JSON.stringify(currentDay) data:JSON.stringify(currentDay)
}) })
}, },
constructorData(datas){
datas.forEach(item=>{
if(item.children){
this.constructorData(item.children)
}
this.list.push({name:item.name})
})
},
judgeClient() {
let client = '';
if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) { //判断iPhone|iPad|iPod|iOS
client = 'ios';
} else if (/(Android)/i.test(navigator.userAgent)) { //判断Android
client = 'android';
} else {
client = 'pc';
}
return client;
},
switchConnect() {
let that = this;
that.$message.confirm('<div class="dialog-content" style="color: #333; font-size: 17px;text-align: center;">确认切换该服务器地址?</div>', function(res, body) {
}, [{
className: 'dialog-btn',
label: '取消',
callback: function(res, $body) {
return true;
}
}, {
className: 'dialog-btn',
label: '确定',
callback: function(res, $body) {
if(that.judgeClient()=='ios'){
that.swiftFun();
}else if(that.judgeClient()=='android'){
model.switchConnectType()
}
}
}], '提示');
},
swiftFun(){
window.webkit.messageHandlers.switchConnectType.postMessage("");
},
login(){ login(){
if(this.username.length<=0){ if(this.username.length<=0){
uni.showToast({ uni.showToast({
...@@ -219,6 +268,10 @@ ...@@ -219,6 +268,10 @@
this.getDate() this.getDate()
this.dateArr() this.dateArr()
uni.setStorage({ uni.setStorage({
key:'isLoging',
data:'true'
})
uni.setStorage({
key:'user', key:'user',
data:this.username data:this.username
}) })
...@@ -227,7 +280,42 @@ ...@@ -227,7 +280,42 @@
data:this.password data:this.password
}) })
this.atoken=data.data.atoken; this.atoken=data.data.atoken;
this.id=data.data.user.accountId this.id=data.data.user.accountId;
uni.request({
url: window.url + '/auth/api/v1/auth/apps',
data:{
_t:Date.parse(new Date())/1000
},
header: {
'Authorization': this.atoken //自定义请求头信息
},
method:'GET',
success:(res) =>{
var unid=''
res.data.list_data.forEach(item=>{
if(item.name==window.pageType){
unid=item.unid;
}
})
uni.request({
url: window.url + '/auth/api/v1/auth/apps/'+unid+'/menus',
data:{
_t:Date.parse(new Date())/1000
},
header: {
'Authorization': this.atoken //自定义请求头信息
},
method:'GET',
success:(res) =>{
this.constructorData(res.data.menu_tree)
localStorage.setItem('menus',JSON.stringify(this.list))
uni.switchTab({
url:'../index/index',
})
}
})
}
})
uni.request({ uni.request({
url: window.url + '/malls', url: window.url + '/malls',
data:{ data:{
...@@ -268,9 +356,6 @@ ...@@ -268,9 +356,6 @@
data:datas[0].name data:datas[0].name
}) })
} }
uni.switchTab({
url:'../index/index',
})
} }
}) })
...@@ -380,4 +465,11 @@ ...@@ -380,4 +465,11 @@
padding: 0; padding: 0;
padding-left: 25.36upx; padding-left: 25.36upx;
} }
.checkUrl{
position: absolute;
bottom: 18.12upx;
right: 21.74upx;
font-size: 21.74upx;
color: #777;
}
</style> </style>
...@@ -198,7 +198,7 @@ ...@@ -198,7 +198,7 @@
// let dateStr = item.counttime.match(/^\d{4}\-\d{2}\-\d{2}/)[0].replace('-', ''); // let dateStr = item.counttime.match(/^\d{4}\-\d{2}\-\d{2}/)[0].replace('-', '');
item.show = false; item.show = false;
item.loaded = false; item.loaded = false;
item.pic = 'https://vion-retail.oss-cn-beijing.aliyuncs.com/picture/' + (item.facePath && item.facePic item.pic = window.picUrl+'/picture/'+ (item.facePath && item.facePic
? item.facePath + item.facePic ? item.facePath + item.facePic
: item.bodyPath + item.bodyPic); : item.bodyPath + item.bodyPic);
item.orderIdx = ++index; item.orderIdx = ++index;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view> <view>
<headerComp :title="titleStr"></headerComp> <headerComp :title="titleStr"></headerComp>
<view class="listBox"> <view class="listBox">
<view class="itemBox" v-for="item in listData" :key="item.src" @tap="goReport(item.src)"> <view class="itemBox" v-for="item in listData" :key="item.src" @tap="goReport(item.src)" v-if="permissionsFun(item.name)">
<img class="icons" :src="item.iconSrc"/> <img class="icons" :src="item.iconSrc"/>
<span class="texts">{{item.text}}</span> <span class="texts">{{item.text}}</span>
<img class="arrows" :src="item.rArrow" alt=""/> <img class="arrows" :src="item.rArrow" alt=""/>
...@@ -27,11 +27,13 @@ ...@@ -27,11 +27,13 @@
titleStr:'精准客流', titleStr:'精准客流',
listData:[{ listData:[{
text:"抓拍记录", text:"抓拍记录",
name:'capturecamera',
iconSrc:baseIcon, iconSrc:baseIcon,
rArrow:arrow, rArrow:arrow,
src:'captureReport/capture' src:'captureReport/capture'
},{ },{
text:"客群分时统计", text:"客群分时统计",
name:'grouptime',
iconSrc:inout, iconSrc:inout,
rArrow:arrow, rArrow:arrow,
src:'groupTimeReport/groupTime' src:'groupTimeReport/groupTime'
......
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
<view> <view>
<headerComp :title="titleStr"></headerComp> <headerComp :title="titleStr"></headerComp>
<view class="prefix-elem"></view> <view class="prefix-elem"></view>
<view class="profile-item" @tap="goVideo">
<span class="texts">视频巡店</span>
<img class="arrows" :src="rArrow" alt=""/>
</view>
<view class="profile-item" @tap="switchConnect"> <view class="profile-item" @tap="switchConnect">
<span class="texts">切换服务器地址</span> <span class="texts">切换服务器地址</span>
<img class="arrows" :src="rArrow" alt=""/> <img class="arrows" :src="rArrow" alt=""/>
...@@ -36,6 +40,11 @@ ...@@ -36,6 +40,11 @@
} }
}, },
methods: { methods: {
goVideo(){
uni.navigateTo({
url:'video/video',
})
},
switchConnect() { switchConnect() {
let that = this; let that = this;
that.$message.confirm('<div class="dialog-content" style="color: #333; font-size: 17px;text-align: center;">确认切换该服务器地址?</div>', function(res, body) { that.$message.confirm('<div class="dialog-content" style="color: #333; font-size: 17px;text-align: center;">确认切换该服务器地址?</div>', function(res, body) {
...@@ -50,10 +59,25 @@ ...@@ -50,10 +59,25 @@
label: '确定', label: '确定',
callback: function(res, $body) { callback: function(res, $body) {
that.clearCache(true); that.clearCache(true);
model.switchConnectType() // 调用swift 无参 if(that.judgeClient()=='ios'){
window.webkit.messageHandlers.switchConnectType.postMessage("");
}else if(that.judgeClient()=='android'){
model.switchConnectType() // 调用swift 无参
}
} }
}], '提示'); }], '提示');
}, },
judgeClient() {
let client = '';
if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) { //判断iPhone|iPad|iPod|iOS
client = 'ios';
} else if (/(Android)/i.test(navigator.userAgent)) { //判断Android
client = 'android';
} else {
client = 'pc';
}
return client;
},
logoutHandle() { logoutHandle() {
this.clearCache(); this.clearCache();
uni.reLaunch({ uni.reLaunch({
......
<template>
<div>
<headerComp :leftImgSrc="leftImg" :title="titleStr" :rightImgSrc="rightImg" @leftClick="backFun" @rightClick="conditionFun"></headerComp>
<iframe id="iframeId" :src="ifSrc" frameborder="0" width="100%" height="236" scrolling="yes"></iframe>
<uni-collapse @change="change">
<uni-collapse-item :title="item.org_name" open="true" v-for="item in deviceList">
<view style="padding: 30upx;padding-left: 60upx;" @tap="tapChannel(channelItem)" :class="[channelItem.chan_id==isActiveChannel?'focusClass':'',channelItem.status==0?'disableClass':'']" v-for="channelItem in item.channels"> {{channelItem.chan_name}} </view>
</uni-collapse-item>
</uni-collapse>
</div>
</template>
<script>
import headerComp from '../../../components/header'
import backArrow from '../../../static/header/backArrow.png'
import other from '../../../static/header/other.png'
import circlebar from '../../../components/circleBarChart'
import linechart from '../../../components/lineChart'
import uniCollapse from "../../../components/collapse/uni-collapse/uni-collapse.vue"
import uniCollapseItem from "../../../components/collapse/uni-collapse-item/uni-collapse-item.vue"
export default{
data(){
return{
titleStr:'视频巡店',
leftImg:backArrow,
rightImg:other,
atoken:'',
ifSrc:'',
isActiveChannel:'1000000001001',
accountId:[],
deviceList:[]
}
},
onLoad: function (option) {
this.ifSrc=window.location.protocol+'//'+window.location.host+'/appweb/static/video.html'
uni.getStorage({
key:'accountList',
success:(res)=>{
if(res.data){
var list=JSON.parse(res.data);
list.forEach((item,index)=>{
if(index==0){
this.accountId.push(item.id)
}
})
uni.getStorage({
key:'selectAccountIdArr',
success:(res)=> {
this.accountId=JSON.parse(res.data);
},
complete: (res) => {
}
})
}
}
})
uni.getStorage({
key:'atoken',
success:(res)=>{
this.atoken=res.data;
}
})
this.getDeviceList();
},
onReady:function(){
},
computed: {
i18n() {
return this.$t("index")
}
},
components:{
headerComp,uniCollapse,uniCollapseItem
},
methods: {
change(){
console.log('change')
},
tapChannel(item){
if(item.status==1){
this.isActiveChannel=item.chan_id;
localStorage.setItem('channelId',item.chan_id);
document.getElementById('iframeId').contentWindow.location.reload(true);
}
},
backFun(){
uni.reLaunch({
url:"../profile",
})
},
conditionFun(){
uni.navigateTo({
url:'../../list/oneMallList?url=../profile/video/video'
})
},
getDeviceList(){
//window.url+
//this.accountId[0]
uni.request({
url:window.url+'/deviceMappings/shilian/devices',
data:{
mallId:this.accountId[0],
_t:Date.parse(new Date())/1000
},
header: {
'Authorization': this.atoken //自定义请求头信息
},
method:'GET',
success:(res) =>{
this.deviceList=res.data.data;
if(this.deviceList.length>0&&this.deviceList[0].channels.length>0){
this.isActiveChannel=this.deviceList[0].channels[0].chan_id;
localStorage.setItem('channelId',this.isActiveChannel);
document.getElementById('iframeId').contentWindow.location.reload(true);
}
}
})
}
},
}
</script>
<style>
.focusClass{
color: #0069FF;
}
.disableClass{
opacity: 0.3;
}
</style>
This diff could not be displayed because it is too large.
No preview for this file type
This diff could not be displayed because it is too large.
No preview for this file type
This diff could not be displayed because it is too large.
No preview for this file type
This diff could not be displayed because it is too large.
No preview for this file type
This diff could not be displayed because it is too large.
No preview for this file type
This diff could not be displayed because it is too large.
No preview for this file type
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!