Authored by 李奇

资源位上报组件修改

... ... @@ -15,7 +15,7 @@ export default {
data() {
return {
componentStatus: {},
waitingForReport: []
waiting: []
};
},
computed: {
... ... @@ -47,9 +47,9 @@ export default {
// 每隔三秒钟上报一次数据
setInterval(() => {
if (this.waitingForReport.length) {
this.report(this.waitingForReport);
this.waitingForReport = [];
if (this.waiting.length) {
this.report(this.waiting);
this.waiting = [];
}
}, 3000);
},
... ... @@ -81,17 +81,47 @@ export default {
record(component, index) {
const reportData = _.get(component, '$options.propsData.value');
// TODO 区分不通组件记录以楼层内item为单位、而不是以整个楼层为单位组织数据上报
let param;
if (reportData) {
const param = {
P_NAME: this.$route.name,
F_NAME: reportData.template_name,
F_ID: reportData.template_id,
F_INDEX: index,
ACTION_URL: '',
PRD_SKN: ''
};
console.log('push', param);
this.waitingForReport.push(param);
switch (reportData.template_name) {
case 'goods':
break;
case 'twoPicture':
param = [];
_.each(reportData.data.list, item => {
param.push({
P_NAME: this.$route.name,
F_NAME: reportData.template_name,
F_ID: reportData.template_id,
F_INDEX: index,
ACTION_URL: item.url
})
});
break;
case 'focus':
break;
case 'tfGoodsList':
break;
case 'newSingleImage':
param = {
P_NAME: this.$route.name,
F_NAME: reportData.template_name,
F_ID: reportData.template_id,
F_INDEX: index,
ACTION_URL: reportData.data.list[0].url
};
break;
case 'BlkNewProductFloorResource':
break;
default:
break;
}
if (param) {
console.log('push', param);
_.isArray(param) ? (this.waiting = this.waiting.concat(param)) : this.waiting.push(param);
}
}
},
isVisiable($el, $parent) {
... ...