提交 496acca8 编写于 作者: huangwensu's avatar huangwensu

test1问题修复

上级 32c862e4
......@@ -46,7 +46,7 @@
<el-col :span="11">
<el-form-item label="触发事件">
<el-input
v-show="!showEvent && funnelId"
v-show="!showEvent"
:class="{'red-b': item.unchecked}"
@focus="getEventData"
v-model="item.eventName"
......@@ -54,7 +54,7 @@
:title="item.eventName"
placeholder="请选择用户触发事件"></el-input>
<el-select
v-show="!funnelId || showEvent"
v-show="showEvent"
v-model="item.eventId"
filterable
placeholder="请选择用户触发事件"
......@@ -148,11 +148,6 @@ export default {
res => {
if(res.code == '000000') {
this.searchParam = res.data;
for(let i = 0; i < this.searchParam.actionModelList.length; i++) {
if(!this.searchParam.actionModelList[i].actionName) {
this.searchParam.actionModelList[i].actionName = this.searchParam.actionModelList[i].eventName;
}
}
}
}
);
......@@ -205,13 +200,23 @@ export default {
if(this.searchParam.actionModelList[i].nameCheck || this.searchParam.actionModelList[i].unchecked) { // 有步骤名称重复
return;
}
this.eventSelect.forEach(item => {
if(this.searchParam.actionModelList[i].eventId == item.eventId) {
this.$set(this.searchParam.actionModelList[i], 'eventName', item.eventName);
}
});
}
let req = this.searchParam;
for(let i = 0; i < req.actionModelList.length; i++) {
if(!req.actionModelList[i].actionName) {
req.actionModelList[i].actionName = req.actionModelList[i].eventName;
}
}
this.getData(
"post", `/session/funnel/save`, req,
res => {
if(res.code == '000000') {
this.$message.success('转化漏斗创建成功');
this.$message.success('转化漏斗保存成功');
this.$router.push({ path: 'path-data', query: {id: res.data.id, name: res.data.name} });
}else if(res.code == '227002' || res.code == '227003'){
this.disabledSave = true;
......
......@@ -9,7 +9,7 @@
<el-row :gutter="30" class="row search" type="flex" style="margin-bottom:0;">
<el-form ref="form" :model="searchParam" label-suffix=":" style="width:100%;">
<el-col :span="10">
<el-form-item label="时间">
<el-form-item label="时间" required>
<el-date-picker
type="date"
placeholder="开始时间"
......@@ -45,7 +45,7 @@
</el-col>
<el-col :span="6" style="padding:0;text-align:right;padding-right:15px;">
<el-button type="default" size="small" @click="reset">重置</el-button>
<el-button type="primary" size="small" @click="getAnalysisData">筛选</el-button>
<el-button type="primary" size="small" @click="getAnalysisData(searchParam)">筛选</el-button>
</el-col>
</el-form>
</el-row>
......@@ -69,7 +69,7 @@
</div>
<div class="data-analysis">
<div class="map-title">转化漏斗详情</div>
<div ref="chart" class="echart"></div>
<div ref="chart" class="echart" :class="{'eh': moreStep}"></div>
<el-table
class="data-table"
:data="funnelData.funnelReportModels"
......@@ -91,6 +91,7 @@ import { openLoading, closeLoading } from "../../common/utils";
export default {
data() {
return {
moreStep: false,
funnelId: '',
name: '',
searchParam: {
......@@ -153,13 +154,17 @@ export default {
if(res.code == '000000') {
this.versionSelect = res.data;
this.searchParam.version = this.versionSelect[0];
this.getAnalysisData(this.searchParam)
this.getAnalysisData(this.searchParam);
}
}
);
},
// 获取漏斗分析数据
getAnalysisData(req) {
if(!req.startDate || !req.endDate) {
this.$message.info('请选择时间');
return;
}
this.getData(
"get", `/session/funnel/report?endDate=${req.endDate}&funnelId=${this.funnelId}&startDate=${req.startDate}&version=${req.version}`, {},
res => {
......@@ -173,6 +178,7 @@ export default {
},
// 初始化图标--漏斗图
initCharts() {
this.moreStep = false;
let lineargroup = this.funnelData.funnelReportModels;
let len = lineargroup.length;
let colorObj = {
......@@ -201,37 +207,40 @@ export default {
arrowTop = 115;
arrowH = 130;
lineTop = 30;
lineLeft = 400;
lineLeft = 450;
lineHeight = 306;
}else if(len == 4) {
arrowTop = 88;
arrowH = 210;
lineTop = 30;
lineLeft = 400;
lineLeft = 550;
lineHeight = 306;
}else if(len == 5) {
arrowTop = 70;
arrowH = 260;
lineTop = 20;
lineLeft = 400;
lineLeft = 570;
lineHeight = 346;
}else if(len == 6) {
this.moreStep = true;
arrowTop = 60;
arrowH = 300;
lineTop = 20;
lineLeft = 400;
lineLeft = 570;
lineHeight = 366;
}else if(len == 7) {
this.moreStep = true;
arrowTop = 50;
arrowH = 340;
lineTop = 10;
lineLeft = 400;
lineLeft = 450;
lineHeight = 406;
}else {
this.moreStep = true;
arrowTop = 40;
arrowH = 360;
lineTop = 10;
lineLeft = 400;
lineLeft = 450;
lineHeight = 436;
}
for (let i = 0; i < lineargroup.length; i++) {
......@@ -267,7 +276,7 @@ export default {
backgroundColor: '#ffffff',
grid: {
top: arrowTop, // 箭头距离顶部高度 3-115 4-
left: "-54%",
left: "-44%",
right: 20,
height: arrowH, // 箭头之间的距离 3-145 4-
bottom: '0'
......@@ -288,7 +297,7 @@ export default {
gap: 40, // 块间距
minSize: 150, // 块两边斜度
left: '5%', // 块左边距离
width: '35%', // 块宽度
width: '45%', // 块宽度
label: {
show: true,
position: 'inside',
......@@ -344,7 +353,7 @@ export default {
padding: [30, 20, 5, 10],
formatter: function(d) {
if (d.value) {
var ins = '{img1|} ' + '{words|' + d.value + '%}';
var ins = '{img1|} ' + '{words|' + d.value + '}';
return ins;
}
},
......@@ -516,7 +525,10 @@ export default {
.echart {
padding-top: 20px;
width: 100%;
min-height: 400px;
height: 400px;
}
.eh {
height: 500px;
}
.data-table {
margin-top: 20px;
......
......@@ -11,7 +11,7 @@
</el-form-item>
</el-col>
<el-col :span="3" style="padding:0;text-align:right;padding-right:15px;">
<el-button type="primary" size="small" @click="search">搜索</el-button>
<el-button type="primary" size="small" @click="search(1)">搜索</el-button>
</el-col>
</el-form>
</el-row>
......@@ -100,7 +100,8 @@ export default {
}
})
},
search() {
search(param) {
if(param) this.searchParam.pageNo = 1;
let req = this.searchParam;
this.getData(
"get", `/session/funnel/list?searchName=${this.searchParam.searchName}&pageNo=${this.searchParam.pageNo}&pageSize=${this.searchParam.pageSize}`, {},
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册