From f1827fab683d67e76240a8f49717c4fe7d831609 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=9C=E5=BB=BA=E8=B6=85?= <3182967682@qq.com> Date: Sun, 27 Sep 2020 09:49:23 +0800 Subject: [PATCH] fix --- src/api/api_report.js | 13 ++- src/router/index.js | 24 +++-- .../componments/chart-bar-form/index.vue | 10 ++- .../chart/componments/chart-form/index.vue | 10 +++ .../chart/componments/query-form/index.vue | 6 +- src/views/modules/result/chart/index.vue | 4 +- .../report/componments/query-form/index.vue | 89 ++++++++++++++++++- src/views/modules/result/report/index.vue | 40 ++++++--- 8 files changed, 165 insertions(+), 31 deletions(-) diff --git a/src/api/api_report.js b/src/api/api_report.js index 1af1d47..de4151d 100644 --- a/src/api/api_report.js +++ b/src/api/api_report.js @@ -1,11 +1,20 @@ import http from '../utils/http' // 业绩看板 -export const apiReportChart = data => { +export const apiResultChart = data => { return http({ url: '/lz_management/result/chart', method: 'get', params: data }) } // 业绩列表 -export const apiReportList = data => { +export const apiResultReport = data => { return http({ url: '/lz_management/result/report', method: 'post', params: data }) } + +// 业绩列分布 +export const apiResultDistribution = data => { + return http({ url: '/lz_management/result/distribution', method: 'post', params: data }) +} + +export const apiDepartmentSelfList = data => { + return http({ url: '/lz_management/result/departmentTreeByStaffId', method: 'post', data }) +} diff --git a/src/router/index.js b/src/router/index.js index 40bddf8..b841060 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -33,7 +33,7 @@ const dingtalkRoutes=[ { path: '/devicemark', component: _import('modules/device/device-mark'), name: 'devicemark', meta: { title: '设备备注' } }, { path: '/devicestaff', component: _import('modules/device/device-staff-device'), name: 'devicestaff', meta: { title: '人员资产信息' } }, { path: '/devicestaffdepat', component: _import('modules/device/device-staff-depat'), name: 'devicestaffdepat', meta: { title: '搜索人员' } }, - + { path: '/devicedetail', component: _import('modules/device/device-detail'), name: 'devicedetail', meta: { title: '资产盘点设备详情页' } } ] @@ -43,6 +43,18 @@ const configRoutes = [ component: _import('modules/result/record/recorddetail'), name: 'recorddetail', meta: {title: '绩效详情', isDynamic: true, isTab: true} + }, + { + path: '/resultDistribution', + component: _import('modules/result/distribution/index'), + name: 'resultDistribution', + meta: {title: '绩效结果分布', isDynamic: true, isTab: true} + }, + { + path: '/resultReport', + component: _import('modules/result/report/index'), + name: 'resultReport', + meta: {title: '绩效列表', isDynamic: true, isTab: true} } ] @@ -59,8 +71,8 @@ const mainRoutes = { // 2. iframeUrl: 是否通过iframe嵌套展示内容, '以http[s]://开头': 是, '': 否 // 提示: 如需要通过iframe嵌套展示内容, 但不通过tab打开, 请自行创建组件使用iframe处理! { path: '/home', component: _import('common/home'), name: 'home', meta: { title: '首页' } }, - - + + { path: '/theme', component: _import('common/theme'), name: 'theme', meta: { title: '主题' } } ], beforeEnter (to, from, next) { @@ -86,7 +98,7 @@ function fnCheckToken() { let token = Vue.cookie.get('token') if (!token || !/\S/.test(token)) { return false; - } + } return true } @@ -113,11 +125,11 @@ router.beforeEach((to, from, next) => { } //next() /*console.log(to) - let newpage = router.resolve({ + let newpage = router.resolve({ name: to.path, query:to.query }) - + console.log(newpage.href) window.open(newpage.href, '_blank')*/ //next() diff --git a/src/views/modules/result/chart/componments/chart-bar-form/index.vue b/src/views/modules/result/chart/componments/chart-bar-form/index.vue index a321d77..8055209 100644 --- a/src/views/modules/result/chart/componments/chart-bar-form/index.vue +++ b/src/views/modules/result/chart/componments/chart-bar-form/index.vue @@ -39,7 +39,10 @@ methods: { jump: function (e) { if (this.clickAble) { - console.log('跳转') + // 目前逻辑一致 跳转相同 + this.$router.push({name: 'resultDistribution'}, () => { + this.mainTabsActiveName = this.$route.name + }) } else { this.clickAble = true } @@ -105,7 +108,10 @@ this.chartBar.setOption(option) this.chartBar.on('click', function (param) { this.clickAble = false - console.log(param) + // 目前逻辑一致 跳转相同 + this.$router.push({name: 'resultDistribution'}, () => { + this.mainTabsActiveName = this.$route.name + }) }.bind(this)) window.addEventListener('resize', () => { this.chartBar.resize() diff --git a/src/views/modules/result/chart/componments/chart-form/index.vue b/src/views/modules/result/chart/componments/chart-form/index.vue index 50f165a..234dd65 100644 --- a/src/views/modules/result/chart/componments/chart-form/index.vue +++ b/src/views/modules/result/chart/componments/chart-form/index.vue @@ -7,6 +7,7 @@ :data="dataInfo" :extend="color.length>0?Object.assign({},chartExtend,{color}):chartExtend" :settings="chartSettings" + :events="chartEvents" > @@ -64,6 +65,15 @@ }, labelLine: { } + }, + chartEvents: { + click: (e) => { // resultDistribution + this.$router.push({name: 'resultReport'}, () => { + this.mainTabsActiveName = this.$route.name + }) + console.log('---------' + e.name) + console.log(e) + } } } }, diff --git a/src/views/modules/result/chart/componments/query-form/index.vue b/src/views/modules/result/chart/componments/query-form/index.vue index 309f57e..62dca0b 100644 --- a/src/views/modules/result/chart/componments/query-form/index.vue +++ b/src/views/modules/result/chart/componments/query-form/index.vue @@ -46,7 +46,7 @@