CRM_26-03-31#story#8372,服务商KPI看板设置埋点及支持数据导出需求--中心组
This commit is contained in:
@@ -177,3 +177,23 @@ export function getNewVersion(key){
|
|||||||
params: key
|
params: key
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getLog(data){
|
||||||
|
// 添加log
|
||||||
|
return request({
|
||||||
|
url: '/ureport/pageView/save',
|
||||||
|
method:'POST',
|
||||||
|
contentType:'application/json',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//获取最新版本
|
||||||
|
export function getUserBO(){
|
||||||
|
return request({
|
||||||
|
url: '/base/user/getUserBO',
|
||||||
|
method:'POST',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
|
import { getLog } from "@/api/order"
|
||||||
export const myMixins = {
|
export const myMixins = {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
async setLogHandler(data) {
|
||||||
|
await getLog(data)
|
||||||
|
},
|
||||||
showFun() {
|
showFun() {
|
||||||
if( localStorage.getItem('infoVerify') == 8 || localStorage.getItem('infoVerify') == 12 ) {
|
if( localStorage.getItem('infoVerify') == 8 || localStorage.getItem('infoVerify') == 12 ) {
|
||||||
return false
|
return false
|
||||||
|
|||||||
@@ -263,6 +263,7 @@ import {
|
|||||||
getDriverName,getDriverStatisticsKpi,
|
getDriverName,getDriverStatisticsKpi,
|
||||||
getRecentSupplierKpi,
|
getRecentSupplierKpi,
|
||||||
} from "@/api/kpi.js"
|
} from "@/api/kpi.js"
|
||||||
|
import { getUserBO } from "@/api/order"
|
||||||
// querySupplierDriverStatisticsScore
|
// querySupplierDriverStatisticsScore
|
||||||
import {myMixins} from "@/utils/myMixins"
|
import {myMixins} from "@/utils/myMixins"
|
||||||
import CircleChar from "@/views/kpi/components/circleChar.vue";
|
import CircleChar from "@/views/kpi/components/circleChar.vue";
|
||||||
@@ -330,6 +331,10 @@ export default {
|
|||||||
showScoreChart:true,
|
showScoreChart:true,
|
||||||
continueMonthKpi:[],
|
continueMonthKpi:[],
|
||||||
isBtn:false,//是否有信息变更申请按钮权限
|
isBtn:false,//是否有信息变更申请按钮权限
|
||||||
|
source: 'App',
|
||||||
|
currentSupplierId: '',
|
||||||
|
userId: '',
|
||||||
|
enterTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -338,13 +343,32 @@ export default {
|
|||||||
this.isZd = urlParams?.get('isZd') || ''
|
this.isZd = urlParams?.get('isZd') || ''
|
||||||
this.supplierId = urlParams?.get('supplierId') || ''
|
this.supplierId = urlParams?.get('supplierId') || ''
|
||||||
this.isBtn= Number(urlParams?.get('isBtn'))
|
this.isBtn= Number(urlParams?.get('isBtn'))
|
||||||
|
this.source = urlParams?.get('source') || 'App'
|
||||||
},
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
await this.checkMobile();
|
await this.checkMobile();
|
||||||
await this.initDate();
|
await this.initDate();
|
||||||
await this.selectSupplierNameHandle();
|
await this.selectSupplierNameHandle();
|
||||||
|
await this.getUserInfo();
|
||||||
|
this.enterTime = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
||||||
|
},
|
||||||
|
async beforeDestroy() {
|
||||||
|
await this.setLogHandler({
|
||||||
|
supplierId: this.currentSupplierId, // 服务商 id
|
||||||
|
userId: this.userId, // userId
|
||||||
|
source: '服务商KPI',
|
||||||
|
event: this.source, // 区分 App 还是 system
|
||||||
|
openTime: this.enterTime, // log 时间,其中 阅读时长是由 enter 和 leave 的时间计算而来
|
||||||
|
leaveTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
|
||||||
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
async getUserInfo() {
|
||||||
|
let res = await getUserBO();
|
||||||
|
this.userId = res.data.id;
|
||||||
|
this.currentSupplierId = res.data.supplierId
|
||||||
|
console.log('getUserBO', res)
|
||||||
|
},
|
||||||
applicateHandle() {
|
applicateHandle() {
|
||||||
if (window.parent) {
|
if (window.parent) {
|
||||||
const hasListener = window.parent.dispatchEvent(new Event('checkCloseDialog'));
|
const hasListener = window.parent.dispatchEvent(new Event('checkCloseDialog'));
|
||||||
|
|||||||
Reference in New Issue
Block a user