复购分析、留存分析、用户粘性分析

fix/non-blocking-route-navigation
HeHaonan 2 years ago
parent 3c9304b7a8
commit 8418d9eac9

@ -35,8 +35,32 @@ export function downloadDataByBoston(data) {
}
//数据下载-漏斗分析
export function downloadDataByFunnel(data) {
return request({
url: "/api/downDataByUserPortrait/analysisByFunnelModel",
method: "get",
params: data,
});
}
//数据下载-购物篮分析
export function downloadDataByBasket(data) {
return request({
url: "/api/downDataByUserPortrait/analysisByShopBasket",
method: "get",
params: data,
});
}
//数据下载-复购分析
export function downloadDataByRepurchase(data) {
return request({
url: "/api/downDataByUserPortrait/analysisByRepurchase",
method: "get",
params: data,
});
}
//数据下载-留存分析
export function downloadDataByRetain(data) {
return request({
url: "/api/downDataByUserPortrait/analysisByFunnelModel",
url: "/api/downDataByUserPortrait/analysisByRetention",
method: "get",
params: data,
});
@ -75,9 +99,9 @@ export function retrain(data) {
}
//实训任务提交
export function submit(data) {
return request({
url: "/api/userBehavior/practicalTrainingSubmission",
method: "post",
params: data,
});
}
return request({
url: "/api/userBehavior/practicalTrainingSubmission",
method: "post",
params: data,
});
}

@ -35,7 +35,7 @@
<el-table-column label="商品3" align="center" prop="goods3">
</el-table-column>
</el-table>
<div class="download">下载数据</div>
<div class="download" @click="downloadData">下载数据</div>
</div>
<p style="line-height: 25px; font-size: 14px">
计算公式如下:<br />
@ -825,6 +825,16 @@ const getData = () => {
})
.catch((error) => {});
};
const downloadData = () => {
portraitModel
.downloadDataByBasket({})
.then((res) => {
// console.log(res,'--');
const blob = new Blob([res], { type: "application/vnd.ms-excel" });
downBlobFile(`案例数据-购物篮分析`, blob);
})
.catch((error) => {});
};
const submitData = () => {
// console.log("asdasdasdsdsds");
if (

@ -66,7 +66,7 @@
<el-table-column label="订单日期" align="center" prop="date">
</el-table-column>
</el-table>
<div class="download">下载数据</div>
<div class="download" @click="downloadData">下载数据</div>
</div>
</div>
<div class="line"></div>
@ -171,10 +171,11 @@
>
</el-input
><span v-if="scope.$index == 2">%</span>
<span v-else>个</span>
</template>
</el-table-column>
</el-table>
<div class="submit">提交</div>
<div class="submit" @click="step2Submit">提交</div>
</div>
</div>
<div class="line"></div>
@ -288,7 +289,7 @@
</template>
</el-table-column>
</el-table>
<div class="submit">提交</div>
<div class="submit" @click="step4Submit">提交</div>
</div>
<div style="display: flex; align-items: center">
<p style="line-height: 25px; font-size: 14px">
@ -442,7 +443,7 @@
</el-table-column>
</el-table>
</div>
<div class="submit">提交</div>
<div class="submit" @click="step5Submit">提交</div>
</div>
<!-- <div class="customerType" style="width: 887px">
<img src="@/assets/images/促销.png" alt="" />
@ -543,14 +544,23 @@
</template>
<script setup>
import * as portraitModel from "@/api/portraitModel";
import { downBlobFile } from "@/utils/index.js";
import * as echarts from "echarts";
const { proxy } = getCurrentInstance();
const knowledgeHtml = ref(
`<p style="text-align: left;">复购率分析是评估消费者对某一品牌或产品忠诚度的重要指标,它反映了消费者满意度和重复购买的行为。通过复购率分析,企业可以更好地了解消费者的购买行为和需求,从而制定更精准的营销策略和产品优化方向。</p><p style="text-align: left;">复购率的计算有两种主要方法:</p><p style="text-align: left;">按客户计算:一定时间内再次购买的客户的人数除以购买的总人数。这种方法不考虑客户购买的次数,只关注是否有重复购买行为。</p><p style="text-align: left;">按订单计算:一定时间内再次购买的客户的订单数除以购买的总订单数。这种方法会统计多次购买的客户订单,区分每次购买的订单。</p><p style="text-align: left;">推荐企业采取按客户计算的复购率算法,因为它更能反映消费者的忠诚度。然而,按订单计算的复购率可能会因为多次购买的客户产生的订单数较多而显得更高。</p><p style="text-align: left;">复购率分析的重要性体现在以下几个方面:</p><p style="text-align: left;">反映客户忠诚度:高复购率意味着消费者对产品的认可度高,愿意再次购买,从而反映出较高的客户忠诚度。</p><p style="text-align: left;">预测销售趋势:通过分析复购率的变化趋势,企业可以预测产品的未来表现,做出更明智的选品决策。</p><p style="text-align: left;">指导选品策略:结合其他指标如销售额、转化率等,对复购率进行综合分析,可以帮助企业筛选出具有潜力的爆款产品。</p><p style="text-align: left;">为了进行复购率分析,企业可以采用以下步骤:</p><p style="text-align: left;">1.收集数据:收集包括订单ID、订单日期、客户名称等指标的数据。</p><p style="text-align: left;">2.计算复购率:根据收集的数据计算一个月内每个用户的购买次数、统计一个月内的购买人数、统计每个月内多次购买的人数并计算月复购率。</p><p style="text-align: left;">3.可视化展示:通过可视化图表的形式展示复购率数据,发现数据规律和问题,如复购时间间隔分析、商品复购分析等。</p><p style="text-align: left;">4.结论分析:根据复购率和用户总数的变化趋势,分析用户黏性的健康度,制定相应的运营策略。</p><p style="text-align: left;">通过复购率分析,企业不仅可以评估现有客户的忠诚度和满意度,还可以预测未来的销售趋势,为产品优化和营销策略提供有力支持。</p>`
);
const list = ref(["-"]);
const errorNum = ref(0);
const step1Error = ref(0);
const step2Error = ref(0);
const step4Error = ref(0);
const step5Error = ref(0);
const step1AnswerFlag = ref(false);
const step2AnswerFlag = ref(false);
const step4AnswerFlag = ref(false);
const step5AnswerFlag = ref(false);
const combinationValue1 = ref("");
const combinationValue2 = ref("");
const knowledgeFlag = ref(false);
@ -1479,8 +1489,286 @@ const step1Submit = () => {
return;
}
}
console.log(1);
if (step1Data.value[0].params && step1Data.value[0].params != "1") {
step1Error.value++;
}
if (step1Data.value[1].params && step1Data.value[1].params != "2") {
step1Error.value++;
}
if (step1Data.value[2].params && step1Data.value[2].params != "1") {
step1Error.value++;
}
if (step1Data.value[3].params && step1Data.value[3].params != "2") {
step1Error.value++;
}
if (step1Data.value[4].params && step1Data.value[4].params != "3") {
step1Error.value++;
}
if (step1Data.value[5].params && step1Data.value[5].params != "1") {
step1Error.value++;
}
if (step1Data.value[6].params && step1Data.value[6].params != "2") {
step1Error.value++;
}
if (step1Data.value[7].params && step1Data.value[7].params != "3") {
step1Error.value++;
}
if (step1Data.value[8].params && step1Data.value[8].params != "4") {
step1Error.value++;
}
if (step1Data.value[9].params && step1Data.value[9].params != "1") {
step1Error.value++;
}
if (step1Data.value[10].params && step1Data.value[10].params != "2") {
step1Error.value++;
}
if (step1Data.value[11].params && step1Data.value[11].params != "2") {
step1Error.value++;
}
if (step1Data.value[12].params && step1Data.value[12].params != "3") {
step1Error.value++;
}
if (step1Data.value[13].params && step1Data.value[13].params != "4") {
step1Error.value++;
}
if (step1Data.value[14].params && step1Data.value[14].params != "1") {
step1Error.value++;
}
if (step1Data.value[15].params && step1Data.value[15].params != "1") {
step1Error.value++;
}
if (step1Data.value[16].params && step1Data.value[16].params != "1") {
step1Error.value++;
}
if (step1Data.value[17].params && step1Data.value[17].params != "1") {
step1Error.value++;
}
if (step1Data.value[18].params && step1Data.value[18].params != "1") {
step1Error.value++;
}
if (step1Data.value[19].params && step1Data.value[19].params != "1") {
step1Error.value++;
}
console.log(step1Error.value, "错误数");
proxy.$modal.msgSuccess("提交成功");
step1AnswerFlag.value = true;
step4Data.value[0].data6 = step1Data.value[0].params;
step4Data.value[1].data6 = step1Data.value[1].params;
step4Data.value[2].data6 = step1Data.value[3].params;
step4Data.value[3].data6 = step1Data.value[4].params;
step4Data.value[4].data6 = step1Data.value[7].params;
step4Data.value[5].data6 = step1Data.value[8].params;
step4Data.value[6].data6 = step1Data.value[9].params;
step4Data.value[7].data6 = step1Data.value[10].params;
};
const step2Submit = () => {
step2Error.value = 0;
for (let i in step2Data.value) {
// console.log(fileTable1.value[i]);
if (!step2Data.value[i].params) {
proxy.$modal.msgError("请先完成所有填空");
return;
}
}
if (step2Data.value[0].params && step2Data.value[0].params != "10") {
step2Error.value++;
}
if (step2Data.value[1].params && step2Data.value[1].params != "4") {
step2Error.value++;
}
if (step2Data.value[2].params && step2Data.value[2].params != "40") {
step2Error.value++;
}
console.log(step2Error.value, "错误数");
proxy.$modal.msgSuccess("提交成功");
step2AnswerFlag.value = true;
};
const step4Submit = () => {
// console.log(9);
step4Error.value = 0;
if (!step4Data.value[0].params1 || !step4Data.value[0].params2) {
proxy.$modal.msgError("请先完成所有填空");
return;
}
if (!step4Data.value[2].params1 || !step4Data.value[2].params2) {
proxy.$modal.msgError("请先完成所有填空");
return;
}
if (!step4Data.value[4].params1 || !step4Data.value[4].params2) {
proxy.$modal.msgError("请先完成所有填空");
return;
}
if (!step4Data.value[6].params1 || !step4Data.value[6].params2) {
proxy.$modal.msgError("请先完成所有填空");
return;
}
if (step4Data.value[0].params1 && step4Data.value[0].params1 != "22") {
step4Error.value++;
}
if (step4Data.value[0].params2 && step4Data.value[0].params2 != "30天内") {
step4Error.value++;
}
if (step4Data.value[2].params1 && step4Data.value[2].params1 != "10") {
step4Error.value++;
}
if (step4Data.value[2].params2 && step4Data.value[2].params2 != "15天内") {
step4Error.value++;
}
if (step4Data.value[4].params1 && step4Data.value[4].params1 != "4") {
step4Error.value++;
}
if (step4Data.value[4].params2 && step4Data.value[4].params2 != "7天内") {
step4Error.value++;
}
if (step4Data.value[6].params1 && step4Data.value[6].params1 != "2") {
step4Error.value++;
}
if (step4Data.value[6].params2 && step4Data.value[6].params2 != "7天内") {
step4Error.value++;
}
console.log(step4Error.value, "错误数");
proxy.$modal.msgSuccess("提交成功");
step4AnswerFlag.value = true;
};
const step5Submit = () => {
// console.log(1313);
step5Error.value = 0;
if (!step5DataTable2.value[0].params) {
proxy.$modal.msgError("请先完成所有填空");
return;
}
if (!step5DataTable2.value[1].params) {
proxy.$modal.msgError("请先完成所有填空");
return;
}
for (let i in step5DataTable3.value) {
// console.log(fileTable1.value[i]);
if (
!step5DataTable3.value[i].params1 ||
!step5DataTable3.value[i].params2
) {
proxy.$modal.msgError("请先完成所有填空");
return;
}
}
if (
step5DataTable2.value[0].params &&
step5DataTable2.value[0].params != "裤子" &&
step5DataTable2.value[0].params != "外套"
) {
step5Error.value++;
}
if (
step5DataTable2.value[1].params &&
step5DataTable2.value[1].params != "衬衫" &&
step5DataTable2.value[1].params != "短袖" &&
step5DataTable2.value[1].params != "睡衣"
) {
step5Error.value++;
}
if (
step5DataTable3.value[0].params1 &&
step5DataTable3.value[0].params1 != "无"
) {
step5Error.value++;
}
if (
step5DataTable3.value[0].params2 &&
step5DataTable3.value[0].params2 != "0"
) {
step5Error.value++;
}
if (
step5DataTable3.value[1].params1 &&
step5DataTable3.value[1].params1 != "无"
) {
step5Error.value++;
}
if (
step5DataTable3.value[1].params2 &&
step5DataTable3.value[1].params2 != "0"
) {
step5Error.value++;
}
if (
step5DataTable3.value[2].params1 &&
step5DataTable3.value[2].params1 != "无"
) {
step5Error.value++;
}
if (
step5DataTable3.value[2].params2 &&
step5DataTable3.value[2].params2 != "0"
) {
step5Error.value++;
}
if (
step5DataTable3.value[3].params1 &&
step5DataTable3.value[3].params1 != "C"
) {
step5Error.value++;
}
if (
step5DataTable3.value[3].params2 &&
step5DataTable3.value[3].params2 != "1"
) {
step5Error.value++;
}
if (
step5DataTable3.value[4].params1 &&
step5DataTable3.value[4].params1 != "D"
) {
step5Error.value++;
}
if (
step5DataTable3.value[4].params2 &&
step5DataTable3.value[4].params2 != "2"
) {
step5Error.value++;
}
console.log(step5Error.value, "错误数");
proxy.$modal.msgSuccess("提交成功");
step5AnswerFlag.value = true;
};
const downloadData = () => {
portraitModel
.downloadDataByRepurchase({})
.then((res) => {
// console.log(res,'--');
const blob = new Blob([res], { type: "application/vnd.ms-excel" });
downBlobFile(`案例数据-复购分析`, blob);
})
.catch((error) => {});
};
const submitData = () => {
if (
!step1AnswerFlag.value ||
!step2AnswerFlag.value ||
!step4AnswerFlag.value ||
!step5AnswerFlag.value
) {
proxy.$modal.msgError("请先完成所有步骤!");
return;
}
errorNum.value =
step1Error.value + step2Error.value + step4Error.value + step5Error.value;
console.log(errorNum.value, "总错误次数");
portraitModel
.submit({
userId: 492,
taskName: "复购分析",
numberOfErrors: errorNum.value,
})
.then((res) => {
proxy.$modal.msgSuccess("提交成功");
})
.catch((error) => {});
// console.log(666);
};
defineExpose({
submitData,
// practicalTraining,
});
</script>
<style scoped lang="scss">

@ -64,7 +64,7 @@
<el-table-column label="14日" align="center" prop="day14">
</el-table-column>
</el-table>
<div class="download">下载数据</div>
<div class="download" @click="downloadData">下载数据</div>
</div>
<span style="line-height: 25px; font-size: 14px">
表格列指标释义:<br />
@ -103,147 +103,160 @@
<template #default="scope">
<el-input
v-model="scope.row.params"
placeholder="请输入"
style="width: 70px"
placeholder="输入"
style="width: 50px"
v-if="scope.$index == 12"
>
</el-input>
</el-input
><span v-if="scope.$index == 12">%</span>
</template>
</el-table-column>
<el-table-column label="3日" align="center" prop="day3">
<template #default="scope">
<el-input
v-model="scope.row.params"
placeholder="请输入"
style="width: 70px"
placeholder="输入"
style="width: 50px"
v-if="scope.$index == 11"
>
</el-input>
</el-input
><span v-if="scope.$index == 11">%</span>
</template>
</el-table-column>
<el-table-column label="4日" align="center" prop="day4">
<template #default="scope">
<el-input
v-model="scope.row.params"
placeholder="请输入"
style="width: 70px"
placeholder="输入"
style="width: 50px"
v-if="scope.$index == 10"
>
</el-input>
</el-input
><span v-if="scope.$index == 10">%</span>
</template>
</el-table-column>
<el-table-column label="5日" align="center" prop="day5">
<template #default="scope">
<el-input
v-model="scope.row.params"
placeholder="请输入"
style="width: 70px"
placeholder="输入"
style="width: 50px"
v-if="scope.$index == 9"
>
</el-input>
</el-input
><span v-if="scope.$index == 9">%</span>
</template>
</el-table-column>
<el-table-column label="6日" align="center" prop="day6">
<template #default="scope">
<el-input
v-model="scope.row.params"
placeholder="请输入"
style="width: 70px"
placeholder="输入"
style="width: 50px"
v-if="scope.$index == 8"
>
</el-input>
</el-input
><span v-if="scope.$index == 8">%</span>
</template>
</el-table-column>
<el-table-column label="7日" align="center" prop="day7">
<template #default="scope">
<el-input
v-model="scope.row.params"
placeholder="请输入"
style="width: 70px"
placeholder="输入"
style="width: 50px"
v-if="scope.$index == 7"
>
</el-input>
</el-input
><span v-if="scope.$index == 7">%</span>
</template>
</el-table-column>
<el-table-column label="8日" align="center" prop="day8">
<template #default="scope">
<el-input
v-model="scope.row.params"
placeholder="请输入"
style="width: 70px"
placeholder="输入"
style="width: 50px"
v-if="scope.$index == 6"
>
</el-input>
</el-input
><span v-if="scope.$index == 6">%</span>
</template>
</el-table-column>
<el-table-column label="9日" align="center" prop="day9">
<template #default="scope">
<el-input
v-model="scope.row.params"
placeholder="请输入"
style="width: 70px"
placeholder="输入"
style="width: 50px"
v-if="scope.$index == 5"
>
</el-input>
</el-input
><span v-if="scope.$index == 5">%</span>
</template>
</el-table-column>
<el-table-column label="10日" align="center" prop="day10">
<template #default="scope">
<el-input
v-model="scope.row.params"
placeholder="请输入"
style="width: 70px"
placeholder="输入"
style="width: 50px"
v-if="scope.$index == 4"
>
</el-input>
</el-input
><span v-if="scope.$index == 4">%</span>
</template>
</el-table-column>
<el-table-column label="11日" align="center" prop="day11">
<template #default="scope">
<el-input
v-model="scope.row.params"
placeholder="请输入"
style="width: 70px"
placeholder="输入"
style="width: 50px"
v-if="scope.$index == 3"
>
</el-input>
</el-input
><span v-if="scope.$index == 3">%</span>
</template>
</el-table-column>
<el-table-column label="12日" align="center" prop="day12">
<template #default="scope">
<el-input
v-model="scope.row.params"
placeholder="请输入"
style="width: 70px"
placeholder="输入"
style="width: 50px"
v-if="scope.$index == 2"
>
</el-input>
</el-input
><span v-if="scope.$index == 2">%</span>
</template>
</el-table-column>
<el-table-column label="13日" align="center" prop="day13">
<template #default="scope">
<el-input
v-model="scope.row.params"
placeholder="请输入"
style="width: 70px"
placeholder="输入"
style="width: 50px"
v-if="scope.$index == 1"
>
</el-input>
</el-input
><span v-if="scope.$index == 1">%</span>
</template>
</el-table-column>
<el-table-column label="14日" align="center" prop="day14">
<template #default="scope">
<el-input
v-model="scope.row.params"
placeholder="请输入"
style="width: 70px"
placeholder="输入"
style="width: 50px"
v-if="scope.$index == 0"
>
</el-input>
</el-input
><span v-if="scope.$index == 0">%</span>
</template>
</el-table-column>
</el-table>
<div class="submit">提交</div>
<div class="submit" @click="step1Submit">提交</div>
</div>
</div>
<div class="line"></div>
@ -277,7 +290,8 @@
placeholder="请输入"
style="width: 70px"
>
</el-input>
</el-input
><span>%</span>
</template>
</el-table-column>
<el-table-column label="3日" align="center" prop="description">
@ -287,7 +301,8 @@
placeholder="请输入"
style="width: 70px"
>
</el-input>
</el-input
><span>%</span>
</template>
</el-table-column>
<el-table-column label="7日" align="center" prop="description">
@ -297,7 +312,8 @@
placeholder="请输入"
style="width: 70px"
>
</el-input>
</el-input
><span>%</span>
</template>
</el-table-column>
<el-table-column label="14日" align="center" prop="amount">
@ -307,11 +323,12 @@
placeholder="请输入"
style="width: 70px"
>
</el-input>
</el-input
><span>%</span>
</template>
</el-table-column>
</el-table>
<div class="submit">提交</div>
<div class="submit" @click="step2Submit">提交</div>
</div>
</div>
<div class="line"></div>
@ -350,6 +367,13 @@
3、14日的留存率,每天一直下降,需要找出原因。
</span>
</div>
<div
class="submit"
@click="step3Submit"
style="margin-top: 20px; margin-left: 0px"
>
提交
</div>
</div>
</div>
</div>
@ -426,6 +450,8 @@
</template>
<script setup>
import * as portraitModel from "@/api/portraitModel";
import { downBlobFile } from "@/utils/index.js";
import * as echarts from "echarts";
const { proxy } = getCurrentInstance();
const knowledgeHtml = ref(
@ -435,6 +461,13 @@ const list = ref(["-"]);
const dayValue = ref("");
const combinationValue1 = ref("");
const combinationValue2 = ref("");
const errorNum = ref(0);
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 knowledgeFlag = ref(false);
//时间间隔分组数-7天内
const sevenNum = ref(0);
@ -1273,6 +1306,21 @@ const dayOptions = ref([
label: "14日",
},
]);
const step1RightAnswer = ref([
"4",
"5",
"6",
"7",
"9",
"14",
"18",
"19",
"30",
"41",
"57",
"72",
"79",
]);
const moveUp = (index, row) => {
console.log("上移", index, row);
if (index > 0) {
@ -1399,6 +1447,106 @@ const draw = () => {
option && myChart.setOption(option);
};
const downloadData = () => {
portraitModel
.downloadDataByRetain({})
.then((res) => {
// console.log(res,'--');
const blob = new Blob([res], { type: "application/vnd.ms-excel" });
downBlobFile(`案例数据-留存分析`, blob);
})
.catch((error) => {});
};
const step1Submit = () => {
// console.log(65);
step1Error.value = 0;
for (let i in step1Data.value.slice(0, step1Data.value.length - 1)) {
// console.log(fileTable1.value[i]);
if (!step1Data.value[i].params) {
proxy.$modal.msgError("请先完成所有填空");
return;
}
}
for (let i in step1Data.value.slice(0, step1Data.value.length - 1)) {
if (step1Data.value[i].params != step1RightAnswer.value[i]) {
step1Error.value++;
}
}
console.log(step1Error.value, "错误数");
proxy.$modal.msgSuccess("提交成功");
step1AnswerFlag.value = true;
};
const step2Submit = () => {
step2Error.value = 0;
if (
!step2Data.value[0].params1 ||
!step2Data.value[0].params2 ||
!step2Data.value[0].params3 ||
!step2Data.value[0].params4
) {
proxy.$modal.msgError("请先完成所有填空");
return;
}
if (step2Data.value[0].params1 && step2Data.value[0].params1 != "85") {
step2Error.value++;
}
if (step2Data.value[0].params2 && step2Data.value[0].params2 != "73") {
step2Error.value++;
}
if (step2Data.value[0].params3 && step2Data.value[0].params3 != "27") {
step2Error.value++;
}
if (step2Data.value[0].params4 && step2Data.value[0].params4 != "4") {
step2Error.value++;
}
console.log(step2Error.value, "错误数");
proxy.$modal.msgSuccess("提交成功");
step2AnswerFlag.value = true;
step4Data.value[0].data1 = step2Data.value[0].params1 + "%";
step4Data.value[0].data2 = step2Data.value[0].params2 + "%";
step4Data.value[0].data3 = step2Data.value[0].params3 + "%";
step4Data.value[0].data4 = step2Data.value[0].params4 + "%";
};
const step3Submit = () => {
// console.log(1132);
step3Error.value = 0;
if (dayValue.value == "") {
proxy.$modal.msgError("请先完成选择");
return;
}
if (dayValue.value != "10日") {
step3Error.value++;
}
console.log(step3Error.value, "错误数");
proxy.$modal.msgSuccess("提交成功");
step3AnswerFlag.value = true;
};
const submitData = () => {
if (
!step1AnswerFlag.value ||
!step2AnswerFlag.value ||
!step3AnswerFlag.value
) {
proxy.$modal.msgError("请先完成所有步骤!");
return;
}
errorNum.value = step1Error.value + step2Error.value + step3Error.value;
console.log(errorNum.value, "总错误次数");
portraitModel
.submit({
userId: 492,
taskName: "留存分析",
numberOfErrors: errorNum.value,
})
.then((res) => {
proxy.$modal.msgSuccess("提交成功");
})
.catch((error) => {});
};
defineExpose({
submitData,
// practicalTraining,
});
</script>
<style scoped lang="scss">

@ -37,7 +37,7 @@ https://blog.csdn.net/kevin1993best/article/details/106329573"
<div style="margin-top: 10px; display: flex">
<el-table
:data="fileTable1"
style="width: 650px"
style="width: 1000px"
border
:header-cell-style="{
color: '#fff',
@ -45,14 +45,24 @@ https://blog.csdn.net/kevin1993best/article/details/106329573"
backgroundColor: '#6A7DE9!important',
}"
>
<el-table-column label="用户ID" align="center" prop="date">
<el-table-column label="用户ID" align="center" prop="id1">
</el-table-column>
<el-table-column label="登录时间" align="center" prop="addNum">
<el-table-column label="登录时间" align="center" prop="time1">
</el-table-column>
<el-table-column
label="登录时长(分钟)"
align="center"
prop="day2"
prop="duration1"
>
</el-table-column>
<el-table-column label="用户ID" align="center" prop="id2">
</el-table-column>
<el-table-column label="登录时间" align="center" prop="time2">
</el-table-column>
<el-table-column
label="登录时长(分钟)"
align="center"
prop="duration2"
>
</el-table-column>
</el-table>
@ -144,7 +154,7 @@ https://blog.csdn.net/kevin1993best/article/details/106329573"
type="textarea"
placeholder="请输入"
/>
<div class="submit">提交</div>
<div class="submit" @click="step1Submit">提交</div>
</div>
</div>
</div>
@ -390,6 +400,11 @@ const dayValue = ref("");
const combinationValue1 = ref("");
const combinationValue2 = ref("");
const analysisConclusion = ref("");
const errorNum = ref(0);
const step1Error = ref(0);
const step2Error = ref(0);
const step3Error = ref(0);
const step4Error = ref(0);
const knowledgeFlag = ref(false);
//时间间隔分组数-7天内
const sevenNum = ref(0);
@ -493,225 +508,245 @@ const step1Data = ref([
]);
const fileTable1 = ref([
{
date: "2021/8/1",
addNum: "1668",
day2: "1472",
day3: "1214",
day4: "1002",
day5: "901",
day6: "631",
day7: "556",
day8: "417",
day9: "295",
day10: "205",
day11: "172",
day12: "145",
day13: "108",
day14: "68",
},
{
date: "2021/8/2",
addNum: "1692",
day2: "1435",
day3: "1165",
day4: "946",
day5: "607",
day6: "534",
day7: "346",
day8: "300",
day9: "214",
day10: "165",
day11: "143",
day12: "126",
day13: "91",
day14: "",
},
{
date: "2021/8/3",
addNum: "1669",
day2: "1402",
day3: "1232",
day4: "1083",
day5: "897",
day6: "756",
day7: "518",
day8: "382",
day9: "258",
day10: "199",
day11: "121",
day12: "106",
day13: "",
day14: "",
},
{
date: "2021/8/4",
addNum: "1301",
day2: "1077",
day3: "883",
day4: "724",
day5: "651",
day6: "494",
day7: "299",
day8: "230",
day9: "155",
day10: "133",
day11: "91",
day12: "",
day13: "",
day14: "",
},
{
date: "2021/8/5",
addNum: "2049",
day2: "1748",
day3: "1515",
day4: "1314",
day5: "1046",
day6: "831",
day7: "658",
day8: "498",
day9: "442",
day10: "189",
day11: "",
day12: "",
day13: "",
day14: "",
},
{
date: "2021/8/6",
addNum: "2670",
day2: "2312",
day3: "2039",
day4: "1799",
day5: "1290",
day6: "922",
day7: "828",
day8: "543",
day9: "373",
day10: "",
day11: "",
day12: "",
day13: "",
day14: "",
},
{
date: "2021/8/7",
addNum: "1999",
day2: "1765",
day3: "1573",
day4: "1401",
day5: "988",
day6: "783",
day7: "514",
day8: "356",
day9: "",
day10: "",
day11: "",
day12: "",
day13: "",
day14: "",
},
{
date: "2021/8/8",
addNum: "2099",
day2: "1874",
day3: "1515",
day4: "1224",
day5: "765",
day6: "578",
day7: "402",
day8: "",
day9: "",
day10: "",
day11: "",
day12: "",
day13: "",
day14: "",
},
{
date: "2021/8/9",
addNum: "2509",
day2: "2050",
day3: "1808",
day4: "1595",
day5: "1370",
day6: "752",
day7: "",
day8: "",
day9: "",
day10: "",
day11: "",
day12: "",
day13: "",
day14: "",
},
{
date: "2021/8/10",
addNum: "1011",
day2: "839",
day3: "740",
day4: "653",
day5: "410",
day6: "",
day7: "",
day8: "",
day9: "",
day10: "",
day11: "",
day12: "",
day13: "",
day14: "",
},
{
date: "2021/8/11",
addNum: "2128",
day2: "1894",
day3: "1566",
day4: "1214",
day5: "",
day6: "",
day7: "",
day8: "",
day9: "",
day10: "",
day11: "",
day12: "",
day13: "",
day14: "",
},
{
date: "2021/8/12",
addNum: "1366",
day2: "1145",
day3: "983",
day4: "",
day5: "",
day6: "",
day7: "",
day8: "",
day9: "",
day10: "",
day11: "",
day12: "",
day13: "",
day14: "",
},
{
date: "2021/8/13",
addNum: "2971",
day2: "2335",
day3: "",
day4: "",
day5: "",
day6: "",
day7: "",
day8: "",
day9: "",
day10: "",
day11: "",
day12: "",
day13: "",
day14: "",
id1: "A",
time1: "2024-03-01",
duration1: "35",
id2: "F",
time2: "2024-03-11",
duration2: "11",
},
{
id1: "E",
time1: "2024-03-01",
duration1: "22",
id2: "C",
time2: "2024-03-12",
duration2: "33",
},
{
id1: "B",
time1: "2024-03-01",
duration1: "11",
id2: "D",
time2: "2024-03-12",
duration2: "22",
},
{
id1: "H",
time1: "2024-03-01",
duration1: "27",
id2: "H",
time2: "2024-03-13",
duration2: "25",
},
{
id1: "F",
time1: "2024-03-02",
duration1: "35",
id2: "D",
time2: "2024-03-14",
duration2: "19",
},
{
id1: "C",
time1: "2024-03-02",
duration1: "16",
id2: "B",
time2: "2024-03-15",
duration2: "38",
},
{
id1: "D",
time1: "2024-03-03",
duration1: "16",
id2: "D",
time2: "2024-03-17",
duration2: "35",
},
{
id1: "B",
time1: "2024-03-03",
duration1: "25",
id2: "C",
time2: "2024-03-17",
duration2: "43",
},
{
id1: "G",
time1: "2024-03-03",
duration1: "30",
id2: "C",
time2: "2024-03-18",
duration2: "36",
},
{
id1: "D",
time1: "2024-03-03",
duration1: "43",
id2: "K",
time2: "2024-03-19",
duration2: "31",
},
{
id1: "C",
time1: "2024-03-04",
duration1: "32",
id2: "A",
time2: "2024-03-20",
duration2: "5",
},
{
id1: "D",
time1: "2024-03-04",
duration1: "43",
id2: "D",
time2: "2024-03-20",
duration2: "8",
},
{
id1: "B",
time1: "2024-03-05",
duration1: "8",
id2: "C",
time2: "2024-03-21",
duration2: "29",
},
{
id1: "D",
time1: "2024-03-06",
duration1: "4",
id2: "D",
time2: "2024-03-22",
duration2: "35",
},
{
id1: "C",
time1: "2024-03-06",
duration1: "25",
id2: "C",
time2: "2024-03-23",
duration2: "35",
},
{
id1: "K",
time1: "2024-03-06",
duration1: "36",
id2: "K",
time2: "2024-03-23",
duration2: "40",
},
{
id1: "A",
time1: "2024-03-06",
duration1: "12",
id2: "A",
time2: "2024-03-24",
duration2: "27",
},
{
id1: "D",
time1: "2024-03-07",
duration1: "38",
id2: "D",
time2: "2024-03-25",
duration2: "4",
},
{
id1: "C",
time1: "2024-03-07",
duration1: "35",
id2: "B",
time2: "2024-03-25",
duration2: "16",
},
{
id1: "J",
time1: "2024-03-07",
duration1: "6",
id2: "G",
time2: "2024-03-25",
duration2: "16",
},
{
id1: "B",
time1: "2024-03-08",
duration1: "39",
id2: "B",
time2: "2024-03-25",
duration2: "29",
},
{
id1: "A",
time1: "2024-03-08",
duration1: "4",
id2: "D",
time2: "2024-03-26",
duration2: "17",
},
{
id1: "E",
time1: "2024-03-08",
duration1: "3",
id2: "C",
time2: "2024-03-27",
duration2: "32",
},
{
id1: "B",
time1: "2024-03-08",
duration1: "10",
id2: "K",
time2: "2024-03-28",
duration2: "8",
},
{
id1: "H",
time1: "2024-03-08",
duration1: "18",
id2: "H",
time2: "2024-03-29",
duration2: "20",
},
{
id1: "F",
time1: "2024-03-09",
duration1: "20",
id2: "B",
time2: "2024-03-29",
duration2: "20",
},
{
id1: "F",
time1: "2024-03-09",
duration1: "24",
id2: "G",
time2: "2024-03-29",
duration2: "40",
},
{
id1: "B",
time1: "2024-03-10",
duration1: "21",
id2: "D",
time2: "2024-03-29",
duration2: "29",
},
{
id1: "H",
time1: "2024-03-11",
duration1: "10",
id2: "A",
time2: "2024-03-30",
duration2: "4",
},
{
id1: "F",
time1: "2024-03-11",
duration1: "34",
id2: "C",
time2: "2024-03-30",
duration2: "45",
},
]);
const step2Data = ref([
@ -1086,6 +1121,158 @@ const dayOptions = ref([
label: "14日",
},
]);
const step1RightAnswer = ref([
{
activeNum: "4",
activeRate: "40",
activeTime: "23.75",
},
{
activeNum: "2",
activeRate: "20",
activeTime: "25.50",
},
{
activeNum: "4",
activeRate: "40",
activeTime: "28.50",
},
{
activeNum: "2",
activeRate: "20",
activeTime: "37.50",
},
{
activeNum: "1",
activeRate: "10",
activeTime: "8.00",
},
{
activeNum: "4",
activeRate: "40",
activeTime: "19.25",
},
{
activeNum: "3",
activeRate: "30",
activeTime: "26.33",
},
{
activeNum: "5",
activeRate: "50",
activeTime: "14.80",
},
{
activeNum: "2",
activeRate: "20",
activeTime: "22.00",
},
{
activeNum: "1",
activeRate: "10",
activeTime: "21.00",
},
{
activeNum: "3",
activeRate: "30",
activeTime: "18.33",
},
{
activeNum: "2",
activeRate: "20",
activeTime: "27.50",
},
{
activeNum: "1",
activeRate: "10",
activeTime: "25.00",
},
{
activeNum: "1",
activeRate: "10",
activeTime: "19.00",
},
{
activeNum: "1",
activeRate: "10",
activeTime: "38.00",
},
{
activeNum: "0",
activeRate: "0",
activeTime: "0.00",
},
{
activeNum: "2",
activeRate: "20",
activeTime: "39.00",
},
{
activeNum: "1",
activeRate: "10",
activeTime: "36.00",
},
{
activeNum: "1",
activeRate: "10",
activeTime: "31.00",
},
{
activeNum: "2",
activeRate: "20",
activeTime: "6.50",
},
{
activeNum: "1",
activeRate: "10",
activeTime: "29.00",
},
{
activeNum: "1",
activeRate: "10",
activeTime: "35.00",
},
{
activeNum: "2",
activeRate: "20",
activeTime: "37.50",
},
{
activeNum: "1",
activeRate: "10",
activeTime: "27.00",
},
{
activeNum: "4",
activeRate: "40",
activeTime: "16.25",
},
{
activeNum: "1",
activeRate: "10",
activeTime: "17.00",
},
{
activeNum: "1",
activeRate: "10",
activeTime: "32.00",
},
{
activeNum: "1",
activeRate: "10",
activeTime: "8.00",
},
{
activeNum: "4",
activeRate: "40",
activeTime: "27.25",
},
{
activeNum: "2",
activeRate: "20",
activeTime: "24.50",
},
]);
const moveUp = (index, row) => {
console.log("上移", index, row);
if (index > 0) {
@ -1326,6 +1513,33 @@ const drawEcharts = () => {
option && myChart.setOption(option);
};
const step1Submit = () => {
step1Error.value++;
for (let i in step1Data.value) {
// console.log(fileTable1.value[i]);
if (
!step1Data.value[i].params1 ||
!step1Data.value[i].params2 ||
!step1Data.value[i].params3
) {
proxy.$modal.msgError("请先完成所有填空");
return;
}
}
for (let i in step1Data.value) {
if (step1Data.value[i].params1 != step1RightAnswer.value[i].activeNum) {
step1Error.value++;
}
if (step1Data.value[i].params2 != step1RightAnswer.value[i].activeRate) {
step1Error.value++;
}
if (step1Data.value[i].params3 != step1RightAnswer.value[i].activeTime) {
step1Error.value++;
}
}
console.log(step1Error.value, "错误数");
proxy.$modal.msgSuccess("提交成功");
};
</script>
<style scoped lang="scss">

Loading…
Cancel
Save