fix/non-blocking-route-navigation
HeHaonan 2 years ago
parent e0ce12d2a5
commit 3198995fa3

@ -1235,12 +1235,13 @@ const submitData = () => {
.catch((error) => {});
};
const retrain = () => {
portraitModel
.retrain({
userId: JSON.parse(getUserInfo()).userId,
module: "AARRR用户运营分析",
})
.then((res) => {
showAnswerFlag.value = false;
// portraitModel
// .retrain({
// userId: JSON.parse(getUserInfo()).userId,
// module: "AARRR用户运营分析",
// })
// .then((res) => {
proxy.$modal.msgSuccess("重新实训成功");
step1Params1.value = "";
step1Params2.value = "";
@ -1253,8 +1254,8 @@ const retrain = () => {
step4Params3.value = "";
step4Params4.value = "";
step5Params.value = "";
})
.catch((error) => {});
// })
// .catch((error) => {});
};
defineExpose({
submitData,

@ -1024,7 +1024,7 @@ const getData = () => {
step4Data.value[1].data3 = step3Data.value[1].params2;
step4Data.value[2].data3 = step3Data.value[2].params2;
step4Data.value[3].data3 = step3Data.value[3].params2;
step2AnswerFlag.value =true
step2AnswerFlag.value = true;
step3AnswerFlag.value = true;
initCharts();
}
@ -1164,12 +1164,13 @@ const submitData = () => {
.catch((error) => {});
};
const retrain = () => {
portraitModel
.retrain({
userId: JSON.parse(getUserInfo()).userId,
module: "帕累托/ABC分析",
})
.then((res) => {
showAnswerFlag.value = false;
// portraitModel
// .retrain({
// userId: JSON.parse(getUserInfo()).userId,
// module: "帕累托/ABC分析",
// })
// .then((res) => {
proxy.$modal.msgSuccess("重新实训成功");
for (let i in step1Data.value) {
step1Data.value[i].params = "";
@ -1186,8 +1187,12 @@ const retrain = () => {
// step5Data.value[i].params2 = "";
// step5Data.value[i].params3 = "";
// }
})
.catch((error) => {});
chartParam1.value = "";
chartParam2.value = "";
chartParam3.value = "";
chartParam4.value = "";
// })
// .catch((error) => {});
};
defineExpose({
submitData,

@ -1102,13 +1102,14 @@ const submitData = () => {
.catch((error) => {});
};
const retrain = () => {
showAnswerFlag.value = false;
// console.log(66);
portraitModel
.retrain({
userId: JSON.parse(getUserInfo()).userId,
module: "购物篮分析",
})
.then((res) => {
// portraitModel
// .retrain({
// userId: JSON.parse(getUserInfo()).userId,
// module: "购物篮分析",
// })
// .then((res) => {
proxy.$modal.msgSuccess("重新实训成功");
list.value = ["-"];
for (let i in step2Data.value) {
@ -1129,8 +1130,8 @@ const retrain = () => {
// step2Select5.value = "";
// step3Select1.value = "";
// step3Select2.value = "";
})
.catch((error) => {});
// })
// .catch((error) => {});
};
defineExpose({
submitData,

@ -194,19 +194,20 @@
<div class="submit" @click="step4Submit">提交</div>
<div class="drawPoint">
<div class="point">
<div class="pointItem" @click="drawPointStep4('E', '#009FF1')">绘制平均消费次数X,平均消费金额Y</div>
<span>(5,1000)</span>
<div class="pointItem" @click="drawPointStep4('y', '#009FF1')">绘制平均消费次数X:5</div>
<div v-if="showAnswerFlag" style="margin-left: 3px; display: inline-block">
<span v-if="centerPointError" style="color: red">X</span>
<span v-if="!centerPointError" style="color: #00bb00">√</span>
</div>
</div>
<!-- <div class="point">
<div class="pointItem" @click="drawPointStep4('Y', '#FB54A1')">
绘制平均消费金额Y
<div class="point">
<div class="pointItem" @click="drawPointStep4('x', '#FB54A1')">绘制平均消费金额Y:1000</div>
<div v-if="showAnswerFlag" style="margin-left: 3px; display: inline-block">
<span v-if="centerPointError2" style="color: red">X</span>
<span v-if="!centerPointError2" style="color: #00bb00">√</span>
</div>
</div>
<span>1000</span>
</div> -->
</div>
</div>
</div>
@ -363,6 +364,7 @@ const pointBError = ref(false);
const pointCError = ref(false);
const pointDError = ref(false);
const centerPointError = ref(false);
const centerPointError2 = ref(false);
const markArea1Error = ref(false);
const markArea2Error = ref(false);
const markArea3Error = ref(false);
@ -684,6 +686,7 @@ const drawPoint = (point, color) => {
// option.value && myChart.setOption(option.value);
};
const drawPointStep4 = (point, color) => {
// markCenterLineStep4.value.splice(0, 2);
drawPointNameStep4.value = point;
drawPointColorStep4.value = color;
};
@ -939,7 +942,10 @@ const step4EchartInit = () => {
chart2OptionData.value.splice(i, 1);
}
}
if (markCenterLineStep4.value.length >= 2) {
markCenterLineStep4.value.splice(0, 2);
}
const pointInPixel = [param.offsetX, param.offsetY];
console.log("pointInPixel4", pointInPixel);
//将偏移值转化为坐标值
@ -955,17 +961,31 @@ const step4EchartInit = () => {
name: drawPointNameStep4.value,
color: drawPointColorStep4.value,
});
if (drawPointNameStep4.value == "y") {
markCenterLineStep4.value.push(
// {
// name: "y",
// xAxis: pointInGridStep4.value[0],
// },
{
name: "y",
name: "",
xAxis: pointInGridStep4.value[0],
},
}
);
} else if (drawPointNameStep4.value == "x") {
markCenterLineStep4.value.push(
// {
// name: "y",
// xAxis: pointInGridStep4.value[0],
// },
{
name: "x",
name: "",
yAxis: pointInGridStep4.value[1],
}
);
console.log(markCenterLineStep4.value);
}
console.log(markCenterLineStep4.value, "-----");
// console.log(markCenterLineStep4.value);
option2.value && myChart.setOption(option2.value);
});
@ -997,18 +1017,18 @@ const step5EchartInit = () => {
// 中心线
const centerLine = [
{
name: "y",
name: "",
xAxis: 5,
},
{
name: "x",
name: "",
yAxis: 1000,
},
];
// 中心点
const centerMark = [
{
value: "中心点",
value: "",
coord: [5, 1000],
},
];
@ -1411,18 +1431,37 @@ const step3Submit = () => {
};
const step4Submit = () => {
step4Error.value = 0;
for (let i in chart2OptionData.value) {
// console.log(option2.value.series[0].data[i]);
// for (let i in chart2OptionData.value) {
// // console.log(option2.value.series[0].data[i]);
// if (chart2OptionData.value[i].name == "E") {
// if (Math.round(chart2OptionData.value[i].value[0]) != 5 || Math.round(chart2OptionData.value[i].value[1]) != 1000) {
// console.log(chart2OptionData.value[i]);
// step4Error.value++;
// centerPointError.value = true;
// } else {
// centerPointError.value = false;
// }
// }
// }
// if (markCenterLineStep4.value[0].xAxis != 5 || markCenterLineStep4.value[1].yAxis != 1000) {
// step4Error.value++;
// centerPointError.value = true;
// } else {
// centerPointError.value = false;
// }
if (chart2OptionData.value[i].name == "E") {
if (Math.round(chart2OptionData.value[i].value[0]) != 5 || Math.round(chart2OptionData.value[i].value[1]) != 1000) {
console.log(chart2OptionData.value[i]);
if (markCenterLineStep4.value[0].xAxis != 5) {
step4Error.value++;
centerPointError.value = true;
} else {
centerPointError.value = false;
}
}
if (markCenterLineStep4.value[1].yAxis != 1000) {
step4Error.value++;
centerPointError2.value = true;
} else {
centerPointError2.value = false;
}
console.log(step4Error.value, "错误数");
proxy.$modal.msgSuccess("提交成功");
@ -1637,7 +1676,49 @@ const getData = () => {
quadrant2Color.value = res.data.stepNineB;
quadrant3Color.value = res.data.stepNineC;
quadrant4Color.value = res.data.stepNineD;
// console.log(chart1OptionData.value,'666');
for (let i in chart2OptionData.value) {
console.log(chart2OptionData.value[i], "asdas");
if (chart2OptionData.value[i].name == "x") {
console.log(1);
markCenterLineStep4.value.push(
// {
// name: "y",
// xAxis: pointInGridStep4.value[0],
// },
{
name: "",
yAxis: chart2OptionData.value[i].value[1],
}
);
} else if (chart2OptionData.value[i].name == "y") {
console.log(2);
markCenterLineStep4.value.push(
// {
// name: "y",
// xAxis: pointInGridStep4.value[0],
// },
{
name: "",
xAxis: chart2OptionData.value[i].value[0],
}
);
}
}
// else {
// console.log(789);
// chart1OptionData.value = JSON.parse('[]');
// // console.log(JSON.parse(res.data.stepSevenC),'666');
// chart2OptionData.value = JSON.parse('[]');
// quadrant1.value = "";
// quadrant2.value = "";
// quadrant3.value = "";
// quadrant4.value = "";
// quadrant1Color.value = "";
// quadrant2Color.value = "";
// quadrant3Color.value = "";
// quadrant4Color.value = "";
// }
// step2Data.value[14].params = res.data.stepTenA;
// step2Data.value[15].params = res.data.stepTenB;
@ -1666,6 +1747,10 @@ const getData = () => {
// step5DataTable3.value[4].params1 = res.data.stepNewSix;
// step5DataTable3.value[4].params2 = res.data.stepNewEight;
// console.log(JSON.parse(res.data.stepSevenC));
step3EchartInit();
step4EchartInit();
step5EchartInit();
if (res.data.subState & (res.data.subState == 1)) {
showAnswerFlag.value = true;
if (step1Data.value[0].params1 && step1Data.value[0].params1 !== "3") {
@ -1752,17 +1837,27 @@ const getData = () => {
}
}
for (let i in chart2OptionData.value) {
// console.log(option2.value.series[0].data[i]);
if (chart2OptionData.value[i].name == "E") {
if (Math.round(chart2OptionData.value[i].value[0]) != 5 || Math.round(chart2OptionData.value[i].value[1]) != 1000) {
if (markCenterLineStep4.value[0].xAxis != 5) {
centerPointError.value = true;
} else {
centerPointError.value = false;
}
if (markCenterLineStep4.value[1].yAxis != 1000) {
centerPointError2.value = true;
} else {
centerPointError2.value = false;
}
}
// for (let i in chart2OptionData.value) {
// // console.log(option2.value.series[0].data[i]);
// if (chart2OptionData.value[i].name == "E") {
// if (Math.round(chart2OptionData.value[i].value[0]) != 5 || Math.round(chart2OptionData.value[i].value[1]) != 1000) {
// centerPointError.value = true;
// } else {
// centerPointError.value = false;
// }
// }
// }
if (quadrant1.value != "明星客户") {
markArea1Error.value = true;
@ -1785,20 +1880,19 @@ const getData = () => {
markArea4Error.value = false;
}
}
step3EchartInit();
step4EchartInit();
step5EchartInit();
}
})
.catch((error) => {});
};
const retrain = () => {
showAnswerFlag.value = false;
// console.log(666);
portraitModel
.retrain({
userId: JSON.parse(getUserInfo()).userId,
module: "波士顿矩阵分析",
})
.then((res) => {
// portraitModel
// .retrain({
// userId: JSON.parse(getUserInfo()).userId,
// module: "波士顿矩阵分析",
// })
// .then((res) => {
proxy.$modal.msgSuccess("重新实训成功");
for (let i in step1Data.value) {
step1Data.value[i].params1 = "";
@ -1806,8 +1900,24 @@ const retrain = () => {
}
step2Data.value[4].params1 = "";
step2Data.value[4].params2 = "";
})
.catch((error) => {});
chart1OptionData.value = JSON.parse("[]");
// console.log(JSON.parse(res.data.stepSevenC),'666');
chart2OptionData.value = JSON.parse("[]");
markCenterLineStep4.value.splice(0, 2);
quadrant1.value = "";
quadrant2.value = "";
quadrant3.value = "";
quadrant4.value = "";
quadrant1Color.value = "";
quadrant2Color.value = "";
quadrant3Color.value = "";
quadrant4Color.value = "";
// })
// .catch((error) => {});
step3EchartInit();
step4EchartInit();
step5EchartInit();
};
defineExpose({
submitData,

@ -314,7 +314,9 @@ import * as echarts from "echarts";
import { downBlobFile } from "@/utils/index.js";
import { onMounted } from "vue";
const { proxy } = getCurrentInstance();
const funnelData = ref([223, 235, 284, 622, 2071]);
// const funnelData = ref([223, 235, 284, 622, 2071]);
const funnelData = ref(["", "", "", "", ""]);
const funnelYAxis = ref(["", "", "", "", ""]);
const dialogVisible = ref(false);
const step2Select1 = ref("");
const step2Select2 = ref("");
@ -586,7 +588,26 @@ const typeData = ref([
// },
// ],
// };
const option = ref({
const step1Error = ref(0);
const step2Error = ref(0);
const step3Error = ref(0);
const step1AnswerFlag = ref(false);
const step2AnswerFlag = ref(false);
const step3AnswerFlag = ref(false);
const showAnswerFlag = ref(false);
const errorNum = ref(0);
const option = ref({});
const baseUrl = import.meta.env.VITE_APP_BASE_API;
onBeforeUnmount(() => {
saveData();
});
onMounted(() => {
getData();
initEchart()
});
const initEchart = () => {
option.value = {
title: {
text: "漏斗图",
textStyle: {
@ -618,7 +639,8 @@ const option = ref({
},
yAxis: {
type: "category",
data: ["", "", "", "", ""],
// data: ["1", "2", "3", "4", "5"],
data: funnelYAxis.value,
position: "center",
},
series: [
@ -640,6 +662,10 @@ const option = ref({
},
},
{
label: {
show: true, // 显示数值
// position: 'top' // 在柱状图上方显示
},
stack: "one",
name: "",
type: "bar",
@ -660,45 +686,37 @@ const option = ref({
},
},
],
});
const step1Error = ref(0);
const step2Error = ref(0);
const step3Error = ref(0);
const step1AnswerFlag = ref(false);
const step2AnswerFlag = ref(false);
const step3AnswerFlag = ref(false);
const showAnswerFlag = ref(false);
const errorNum = ref(0);
const baseUrl = import.meta.env.VITE_APP_BASE_API;
onBeforeUnmount(() => {
saveData();
});
onMounted(() => {
getData();
};
var chartDom = document.getElementById("funnel");
var myChart = echarts.init(chartDom);
option.value && myChart.setOption(option.value);
});
};
const selectData = (item, index) => {
console.log(item, index);
if (item == "浏览2071") {
funnelData.value[index] = 2071;
funnelYAxis.value[index] = "浏览";
}
if (item == "购物车622") {
funnelData.value[index] = 622;
funnelYAxis.value[index] = "购物车";
}
if (item == "订单284") {
funnelData.value[index] = 284;
funnelYAxis.value[index] = "订单";
}
if (item == "支付235") {
funnelData.value[index] = 235;
funnelYAxis.value[index] = "支付";
}
if (item == "完成交易223") {
funnelData.value[index] = 223;
funnelYAxis.value[index] = "完成交易";
}
var chartDom = document.getElementById("funnel");
var myChart = echarts.init(chartDom);
option.value && myChart.setOption(option.value);
// var chartDom = document.getElementById("funnel");
// var myChart = echarts.init(chartDom);
// option.value && myChart.setOption(option.value);
initEchart();
};
const moveUp = (index, row) => {
console.log("上移", index, row);
@ -902,11 +920,11 @@ const saveData = () => {
stepNineD: step2Select5.value,
stepTenA: step3Select1.value,
stepTenB: step3Select2.value,
// stepTenC: step4Data.value[2].params1,
// stepTenD: step4Data.value[2].params2,
// stepElevenA: step4Data.value[2].params3,
// stepOneA: step5Data.value[0].params1,
// stepOneB: step5Data.value[0].params2,
stepTenC: funnelData.value[0],
stepTenD: funnelData.value[1],
stepElevenA: funnelData.value[2],
stepOneA: funnelData.value[3],
stepOneB: funnelData.value[4],
// stepOneC: step5Data.value[0].params3,
// stepOneD: step6Data.value[0].params1,
// stepTwoA: step6Data.value[0].params2,
@ -959,11 +977,25 @@ const getData = () => {
step2Select5.value = res.data.stepNineD;
step3Select1.value = res.data.stepTenA;
step3Select2.value = res.data.stepTenB;
// step4Data.value[2].params1 = res.data.stepTenC;
// step4Data.value[2].params2 = res.data.stepTenD;
// step4Data.value[2].params3 = res.data.stepElevenA;
// step5Data.value[0].params1 = res.data.stepOneA;
// step5Data.value[0].params2 = res.data.stepOneB;
funnelYAxis.value[4] = step2Select1.value;
funnelYAxis.value[3] = step2Select2.value;
funnelYAxis.value[2] = step2Select3.value;
funnelYAxis.value[1] = step2Select4.value;
funnelYAxis.value[0] = step2Select5.value;
funnelData.value[0] = res.data.stepTenC;
funnelData.value[1] = res.data.stepTenD;
funnelData.value[2] = res.data.stepElevenA;
funnelData.value[3] = res.data.stepOneA;
funnelData.value[4] = res.data.stepOneB;
// var chartDom = document.getElementById("funnel");
// var myChart = echarts.init(chartDom);
// option.value && myChart.setOption(option.value);
initEchart();
// step5Data.value[0].params3 = res.data.stepOneC;
// step6Data.value[0].params1 = res.data.stepOneD;
// step6Data.value[0].params2 = res.data.stepTwoA;
@ -1137,12 +1169,13 @@ const saveDataSubmit = () => {
.catch((error) => {});
};
const retrain = () => {
portraitModel
.retrain({
userId: JSON.parse(getUserInfo()).userId,
module: "转化分析-漏斗模型",
})
.then((res) => {
showAnswerFlag.value = false;
// portraitModel
// .retrain({
// userId: JSON.parse(getUserInfo()).userId,
// module: "转化分析-漏斗模型",
// })
// .then((res) => {
proxy.$modal.msgSuccess("重新实训成功");
for (let i in step1Data.value) {
step1Data.value[i].params1 = "";
@ -1158,8 +1191,14 @@ const retrain = () => {
step2Select5.value = "";
step3Select1.value = "";
step3Select2.value = "";
})
.catch((error) => {});
funnelData.value = ["", "", "", "", ""];
funnelYAxis.value = ["", "", "", "", ""];
// var chartDom = document.getElementById("funnel");
// var myChart = echarts.init(chartDom);
// option.value && myChart.setOption(option.value);
initEchart();
// })
// .catch((error) => {});
};
defineExpose({
submitData,

@ -1200,13 +1200,14 @@ const submitData = () => {
.catch((error) => {});
};
const retrain = () => {
showAnswerFlag.value = false;
// console.log(66666);
portraitModel
.retrain({
userId: JSON.parse(getUserInfo()).userId,
module: "用户画像分析",
})
.then((res) => {
// portraitModel
// .retrain({
// userId: JSON.parse(getUserInfo()).userId,
// module: "用户画像分析",
// })
// .then((res) => {
proxy.$modal.msgSuccess("重新实训成功");
step1SelectParams1.value = "";
step1SelectParams2.value = "";
@ -1217,8 +1218,8 @@ const retrain = () => {
for (let i in step2Data.value) {
step2Data.value[i].params = "";
}
})
.catch((error) => {});
// })
// .catch((error) => {});
};
defineExpose({
submitData,

@ -2201,12 +2201,13 @@ const submitData = () => {
// console.log(666);
};
const retrain = () => {
portraitModel
.retrain({
userId: JSON.parse(getUserInfo()).userId,
module: "复购分析",
})
.then((res) => {
showAnswerFlag.value = false;
// portraitModel
// .retrain({
// userId: JSON.parse(getUserInfo()).userId,
// module: "复购分析",
// })
// .then((res) => {
proxy.$modal.msgSuccess("重新实训成功");
for (let i in step1Data.value) {
step1Data.value[i].params = "";
@ -2227,8 +2228,8 @@ const retrain = () => {
step5DataTable3.value[i].params1 = "";
step5DataTable3.value[i].params2 = "";
}
})
.catch((error) => {});
// })
// .catch((error) => {});
};
defineExpose({
submitData,

@ -1727,12 +1727,13 @@ const submitData = () => {
.catch((error) => {});
};
const retrain = () => {
portraitModel
.retrain({
userId: JSON.parse(getUserInfo()).userId,
module: "留存分析",
})
.then((res) => {
showAnswerFlag.value = false;
// portraitModel
// .retrain({
// userId: JSON.parse(getUserInfo()).userId,
// module: "留存分析",
// })
// .then((res) => {
proxy.$modal.msgSuccess("重新实训成功");
for (let i in step1Data.value.slice(0, step1Data.value.length - 1)) {
@ -1745,8 +1746,8 @@ const retrain = () => {
step2Data.value[i].params4 = "";
}
dayValue.value = "";
})
.catch((error) => {});
// })
// .catch((error) => {});
};
defineExpose({
submitData,

@ -1233,7 +1233,7 @@ const saveDataSubmit = () => {
})
.then((res) => {})
.catch((error) => {});
}
};
const getData = () => {
portraitModel
.getData({
@ -1458,12 +1458,13 @@ const getData = () => {
.catch((error) => {});
};
const retrain = () => {
portraitModel
.retrain({
userId: JSON.parse(getUserInfo()).userId,
module: "RFM分析",
})
.then((res) => {
showAnswerFlag.value = false;
// portraitModel
// .retrain({
// userId: JSON.parse(getUserInfo()).userId,
// module: "RFM分析",
// })
// .then((res) => {
proxy.$modal.msgSuccess("重新实训成功");
for (let i in fileTable1.value) {
fileTable1.value[i].params = "";
@ -1489,8 +1490,8 @@ const retrain = () => {
for (let i in step7Data.value) {
step7Data.value[i].params = "";
}
})
.catch((error) => {});
// })
// .catch((error) => {});
};
defineExpose({
submitData,

@ -1888,12 +1888,13 @@ const submitData = () => {
.catch((error) => {});
};
const retrain = () => {
portraitModel
.retrain({
userId: JSON.parse(getUserInfo()).userId,
module: "用户粘性分析",
})
.then((res) => {
showAnswerFlag.value = false;
// portraitModel
// .retrain({
// userId: JSON.parse(getUserInfo()).userId,
// module: "用户粘性分析",
// })
// .then((res) => {
proxy.$modal.msgSuccess("重新实训成功");
for (let i in step1Data.value) {
@ -1920,8 +1921,8 @@ const retrain = () => {
analysisConclusionStep3.value = "";
analysisConclusionStep4.value = "";
// dayValue.value = "";
})
.catch((error) => {});
// })
// .catch((error) => {});
};
defineExpose({
submitData,

Loading…
Cancel
Save