动态散点图问题

dev-QQq
HeHaonan 2 years ago
parent 2d9c97bc24
commit 539eac3f34

@ -15,6 +15,7 @@
"url": "https://gitee.com/y_project/RuoYi-Vue.git"
},
"dependencies": {
"@antv/g2": "^5.2.3",
"@element-plus/icons-vue": "2.0.10",
"@vueup/vue-quill": "1.1.0",
"@vueuse/core": "9.5.0",

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

@ -402,6 +402,7 @@ https://help.fanruan.com/finebi5.1/doc-view-1256.html"
</template>
<script setup>
import { getUserInfo } from '@/utils/auth'
import * as portraitModel from "@/api/portraitModel";
import { downBlobFile } from "@/utils/index.js";
import * as echarts from "echarts";
@ -1171,7 +1172,7 @@ const saveData = () => {
};
portraitModel
.saveData({
userId: 492,
userId: JSON.parse(getUserInfo()).userId,
module: "AARRR用户运营分析",
...params,
})
@ -1181,7 +1182,7 @@ const saveData = () => {
const getData = () => {
portraitModel
.getData({
userId: 492,
userId: JSON.parse(getUserInfo()).userId,
module: "AARRR用户运营分析",
})
.then((res) => {
@ -1254,7 +1255,7 @@ const submitData = () => {
console.log(errorNum.value, "总错误次数");
portraitModel
.submit({
userId: 492,
userId: JSON.parse(getUserInfo()).userId,
taskName: "AARRR用户运营分析",
numberOfErrors: errorNum.value,
})
@ -1266,7 +1267,7 @@ const submitData = () => {
const retrain = () => {
portraitModel
.retrain({
userId: 492,
userId: JSON.parse(getUserInfo()).userId,
module: "AARRR用户运营分析",
})
.then((res) => {
@ -1308,7 +1309,7 @@ defineExpose({
font-weight: bold;
width: 180px;
height: 56px;
background-image: url("@/assets/images/01.png");
background-image: url("@/assets/images/taskImport.png");
background-size: 180px 56px;
text-align: center;
align-items: center;

@ -348,6 +348,7 @@
</template>
<script setup>
import { getUserInfo } from '@/utils/auth'
import * as portraitModel from "@/api/portraitModel";
import { downBlobFile } from "@/utils/index.js";
const { proxy } = getCurrentInstance();
@ -779,7 +780,7 @@ const saveData = () => {
};
portraitModel
.saveData({
userId: 492,
userId: JSON.parse(getUserInfo()).userId,
module: "帕累托/ABC分析",
...params,
})
@ -789,7 +790,7 @@ const saveData = () => {
const getData = () => {
portraitModel
.getData({
userId: 492,
userId: JSON.parse(getUserInfo()).userId,
module: "帕累托/ABC分析",
})
.then((res) => {
@ -852,7 +853,7 @@ const submitData = () => {
console.log(errorNum.value, "总错误次数");
portraitModel
.submit({
userId: 492,
userId: JSON.parse(getUserInfo()).userId,
taskName: "帕累托/ABC分析",
numberOfErrors: errorNum.value,
})
@ -864,7 +865,7 @@ const submitData = () => {
const retrain = () => {
portraitModel
.retrain({
userId: 492,
userId: JSON.parse(getUserInfo()).userId,
module: "帕累托/ABC分析",
})
.then((res) => {
@ -908,7 +909,7 @@ defineExpose({
font-weight: bold;
width: 180px;
height: 56px;
background-image: url("@/assets/images/01.png");
background-image: url("@/assets/images/taskImport.png");
background-size: 180px 56px;
text-align: center;
align-items: center;

@ -281,6 +281,7 @@
</template>
<script setup>
import { getUserInfo } from '@/utils/auth'
import * as portraitModel from "@/api/portraitModel";
import * as echarts from "echarts";
import { downBlobFile } from "@/utils/index.js";
@ -768,7 +769,7 @@ const saveData = () => {
};
portraitModel
.saveData({
userId: 492,
userId: JSON.parse(getUserInfo()).userId,
module: "购物篮分析",
...params,
})
@ -778,7 +779,7 @@ const saveData = () => {
const getData = () => {
portraitModel
.getData({
userId: 492,
userId: JSON.parse(getUserInfo()).userId,
module: "购物篮分析",
})
.then((res) => {
@ -851,7 +852,7 @@ const submitData = () => {
console.log(errorNum.value, "总错误次数");
portraitModel
.submit({
userId: 492,
userId: JSON.parse(getUserInfo()).userId,
taskName: "购物篮分析",
numberOfErrors: errorNum.value,
})
@ -864,7 +865,7 @@ const retrain = () => {
// console.log(66);
portraitModel
.retrain({
userId: 492,
userId: JSON.parse(getUserInfo()).userId,
module: "购物篮分析",
})
.then((res) => {
@ -912,7 +913,7 @@ defineExpose({
font-weight: bold;
width: 180px;
height: 56px;
background-image: url("@/assets/images/01.png");
background-image: url("@/assets/images/taskImport.png");
background-size: 180px 56px;
text-align: center;
align-items: center;

@ -95,7 +95,7 @@
</template>
</el-table-column>
</el-table>
<div class="submit"></div>
<div class="submit" @click="step1Submit"></div>
</div>
</div>
<div class="line"></div>
@ -121,11 +121,29 @@
<el-table-column label="客户ID" align="center" prop="name">
</el-table-column>
<el-table-column label="消费次数" align="center" prop="amount">
<template #default="scope">
<el-input
v-model="scope.row.params1"
placeholder="请输入"
style="width: 130px"
v-if="scope.$index == 4"
>
</el-input>
</template>
</el-table-column>
<el-table-column label="消费金额" align="center" prop="account">
<template #default="scope">
<el-input
v-model="scope.row.params2"
placeholder="请输入"
style="width: 130px"
v-if="scope.$index == 4"
>
</el-input>
</template>
</el-table-column>
</el-table>
<div class="submit">提交</div>
<div class="submit" @click="step2Submit"></div>
</div>
</div>
<div class="line"></div>
@ -138,7 +156,36 @@
以消费金额为纵轴消费次数为横轴将第一步的客户数据绘制于坐标轴中
</span>
<div style="margin-top: 10px; display: flex">
<div class="submit">提交</div>
<div id="charts1" style="width: 500px; height: 400px"></div>
<div>
<div class="submit" @click="step3Submit"></div>
<div class="drawPoint">
<div class="point">
<div class="pointItem" @click="drawPoint('A', '#009FF1')">
绘制A
</div>
<span>3,800</span>
</div>
<div class="point">
<div class="pointItem" @click="drawPoint('B', '#FB54A1')">
绘制B
</div>
<span>4,1200</span>
</div>
<div class="point">
<div class="pointItem" @click="drawPoint('C', '#FE8D2A')">
绘制C
</div>
<span>6,600</span>
</div>
<div class="point">
<div class="pointItem" @click="drawPoint('D', '#6E70F0')">
绘制D
</div>
<span>7,1400</span>
</div>
</div>
</div>
</div>
</div>
<div class="line"></div>
@ -151,41 +198,24 @@
将计算出的客户的平均消费次数平均消费金额绘制在坐标轴中
</span>
<div style="margin-top: 10px; display: flex">
<!-- <el-table
:data="step4Data"
style="width: 680px"
border
:header-cell-style="{
color: '#fff',
fontSize: '14px',
backgroundColor: '#6A7DE9!important',
}"
>
<el-table-column label="商品名称" align="center" prop="data1">
</el-table-column>
<el-table-column label="销售额" align="center" prop="data2">
</el-table-column>
<el-table-column
label="累计销售额占比(%"
align="center"
prop="data3"
>
</el-table-column>
<el-table-column label="划分商品类型" align="center" prop="data4">
<template #default="scope">
<el-select
v-model="scope.row.params"
placeholder="请选择"
style="width: 100px"
>
<el-option :label="'A类商品'" :value="'A类商品'" />
<el-option :label="'B类商品'" :value="'B类商品'" />
<el-option :label="'C类商品'" :value="'C类商品'" />
</el-select>
</template>
</el-table-column>
</el-table> -->
<div class="submit">提交</div>
<div id="charts2" style="width: 500px; height: 400px"></div>
<div>
<div class="submit" @click="step4Submit"></div>
<div class="drawPoint">
<div class="point">
<div class="pointItem" @click="drawPointStep4('A', '#009FF1')">
绘制平均消费次数X,平均消费金额Y
</div>
<span>5,1000</span>
</div>
<!-- <div class="point">
<div class="pointItem" @click="drawPointStep4('Y', '#FB54A1')">
绘制平均消费金额Y
</div>
<span>1000</span>
</div> -->
</div>
</div>
</div>
</div>
<div class="line"></div>
@ -202,7 +232,44 @@
4消费未达到平均值消费力度也未达到平均水平的客户属于瘦狗客户
</span>
<div style="margin-top: 10px; display: flex">
<div class="submit">提交</div>
<div id="charts3" style="width: 500px; height: 400px"></div>
<div>
<div class="submit" @click="step5Submit"></div>
<div class="drawPoint">
<div class="point">
<div
class="pointItem"
@click="drawQuadrant('明星客户', 'rgba(52, 134, 207, 0.8)')"
>
明星客户
</div>
</div>
<div class="point">
<div
class="pointItem"
@click="drawQuadrant('现金流客户', 'rgba(0, 184, 105, 0.8)')"
>
现金流客户
</div>
</div>
<div class="point">
<div
class="pointItem"
@click="drawQuadrant('问题客户', 'rgba(177, 130, 192, 0.8)')"
>
问题客户
</div>
</div>
<div class="point">
<div
class="pointItem"
@click="drawQuadrant('瘦狗客户', 'rgba(254, 141, 42, 0.8)')"
>
瘦狗客户
</div>
</div>
</div>
</div>
</div>
</div>
<div class="line"></div>
@ -242,8 +309,13 @@
</template>
<script setup>
import { getUserInfo } from '@/utils/auth'
import * as echarts from "echarts";
import { Chart } from "@antv/g2";
import * as portraitModel from "@/api/portraitModel";
import { downBlobFile } from "@/utils/index.js";
import { onMounted } from "vue";
const { proxy } = getCurrentInstance();
const knowledgeFlag = ref(false);
const step1Data = ref([
{
@ -374,6 +446,7 @@ const step2Data = ref([
{ name: "B", amount: "4", account: "1200" },
{ name: "C", amount: "6", account: "600" },
{ name: "D", amount: "7", account: "1400" },
{ name: "平均值", amount: "7", account: "1400" },
]);
const step3Data = ref([
{
@ -512,38 +585,738 @@ const typeData = ref([
data2: "占总销售额的10%,给予一般关注",
},
]);
const moveUp = (index, row) => {
console.log("上移", index, row);
if (index > 0) {
const upDate = step2Data.value[index - 1];
step2Data.value.splice(index - 1, 1);
step2Data.value.splice(index, 0, upDate);
} else {
alert("已经是第一条,不可上移");
//
const option = ref({});
const drawPointName = ref("");
const drawPointColor = ref("");
const pointInGrid = ref([]);
//
const option2 = ref({});
const drawPointNameStep4 = ref("");
const drawPointColorStep4 = ref("");
const pointInGridStep4 = ref([]);
//
const optionStep5 = ref({});
const drawPointNameStep5 = ref("");
const drawPointColorStep5 = ref("");
const pointInGridStep5 = ref([]);
const errorNum = ref(0);
const step1Error = ref(0);
const step2Error = ref(0);
const step3Error = ref(0);
const step4Error = ref(0);
const step5Error = ref(0);
const step1AnswerFlag = ref(false);
const step2AnswerFlag = ref(false);
const step3AnswerFlag = ref(false);
const step4AnswerFlag = ref(false);
const step5AnswerFlag = ref(false);
onMounted(() => {
step3EchartInit();
step4EchartInit();
step5EchartInit();
});
const drawPoint = (point, color) => {
// console.log(point);
// let Apoint = point
// if(Apoint == drawPointName.value){
// proxy.$modal.msgError("");
// return;
// }
drawPointName.value = point;
drawPointColor.value = color;
// option.value.series[0].data.push(pointInGrid);
// option.value && myChart.setOption(option.value);
};
const drawPointStep4 = (point, color) => {
drawPointNameStep4.value = point;
drawPointColorStep4.value = color;
};
const step3EchartInit = () => {
var chartDom = document.getElementById("charts1");
var myChart = echarts.init(chartDom, "dark");
// var option;
option.value = {
xAxis: {
name: "X",
show: true,
max: 10,
min: 0,
interval: 1,
axisPointer: {
show: true,
label: {
precision: 0,
},
// snap: true,
},
},
yAxis: {
name: "Y",
show: true,
interval: 200,
max: 2000,
min: 0,
axisPointer: {
show: true,
// snap: true,
label: {
precision: 0,
},
},
},
series: [
{
symbolSize: 20,
label: {
show: true, //
formatter: function (params) {
// params
return params.data.name;
},
position: "top", // 'top', 'left', 'right', 'bottom', 'inside', {top, left}
},
itemStyle: {
color: function (params) {
// params
return params.data.color;
},
borderColor: "#fff",
},
data: [
// { value: [3, 800], name: "A" },
// { value: [4, 1200], name: "B" },
// { value: [6, 600], name: "C" },
// { value: [7, 1400], name: "D" },
// { value: [10, 1400], },
// [4, 1200],
// [6, 600],
// [7, 1400],
],
type: "scatter",
},
],
};
option.value && myChart.setOption(option.value);
myChart.getZr().on("click", function (param) {
if (drawPointName.value == "") {
proxy.$modal.msgError("请选择要绘制的点");
return;
}
const pointInPixel = [param.offsetX, param.offsetY];
console.log("pointInPixel", pointInPixel);
// 使 convertFromPixel x
// X
// let pointInGrid = myChart.convertFromPixel(
// { seriesIndex: 0 },
// pointInPixel
// );
pointInGrid.value = myChart.convertFromPixel(
{ seriesIndex: 0 },
pointInPixel
);
// Y
// let pointInGrid2 = myChart.convertFromPixel({ seriesIndex: 1 }, pointInPixel);
// x
console.log("pointInGrid", pointInGrid.value);
option.value.series[0].data.push({
value: pointInGrid.value,
name: drawPointName.value,
color: drawPointColor.value,
});
option.value && myChart.setOption(option.value);
// console.log();
// XXdata
// let xIndex = pointInGrid[0];
// // Y
// let yIndex = pointInGrid2[1];
// // 使getOption() option
// let op = myChart.getOption();
// //xoption
// // X
// var time = op.xAxis[0].data[xIndex];
// // series -- data
// var value = op.series[0].data[xIndex];
// console.log("val", time);
});
};
const step4EchartInit = () => {
var chartDom = document.getElementById("charts2");
var myChart = echarts.init(chartDom, "dark");
// var option;
option2.value = {
xAxis: {
name: "X",
show: true,
max: 10,
min: 0,
interval: 1,
axisPointer: {
show: true,
label: {
precision: 0,
},
// snap: true,
},
},
yAxis: {
name: "Y",
show: true,
interval: 200,
max: 2000,
min: 0,
axisPointer: {
show: true,
// snap: true,
label: {
precision: 0,
},
},
},
series: [
{
symbolSize: 20,
label: {
show: true, //
formatter: function (params) {
// params
return params.data.name;
},
position: "top", // 'top', 'left', 'right', 'bottom', 'inside', {top, left}
},
itemStyle: {
color: function (params) {
// params
return params.data.color;
},
borderColor: "#fff",
},
data: [
// { value: [3, 800], name: "A" },
// { value: [4, 1200], name: "B" },
// { value: [6, 600], name: "C" },
// { value: [7, 1400], name: "D" },
// { value: [10, 1400], },
// [4, 1200],
// [6, 600],
// [7, 1400],
],
type: "scatter",
},
],
};
option2.value && myChart.setOption(option2.value);
myChart.getZr().on("click", function (param) {
if (drawPointNameStep4.value == "") {
proxy.$modal.msgError("请选择要绘制的点");
return;
}
const pointInPixel = [param.offsetX, param.offsetY];
console.log("pointInPixel4", pointInPixel);
//
pointInGridStep4.value = myChart.convertFromPixel(
{ seriesIndex: 0 },
pointInPixel
);
console.log("pointInGrid4", pointInGridStep4.value);
option2.value.series[0].data.push({
value: pointInGridStep4.value,
name: drawPointNameStep4.value,
color: drawPointColorStep4.value,
});
option2.value && myChart.setOption(option2.value);
});
};
const step5EchartInit = () => {
//
const marksData = [
{
name: "A",
value: [3, 800],
color: "#009FF1",
},
{
name: "B",
value: [4, 1200],
color: "#FB54A1",
},
{
name: "C",
value: [6, 600],
color: "#FE8D2A",
},
{
name: "D",
value: [7, 1400],
color: "#6E70F0",
},
];
// 线
const centerLine = [
{
name: "y",
xAxis: 5,
},
{
name: "x",
yAxis: 1000,
},
];
//
const centerMark = [
{
value: "中心点",
coord: [5, 1000],
},
];
optionStep5.value = {
tooltip: {
axisPointer: {
show: true,
type: "cross",
lineStyle: {
type: "dashed",
width: 1,
},
label: {
backgroundColor: "#555",
},
},
},
grid: {
left: 50,
right: 50,
bottom: "4%",
top: "6%",
containLabel: true,
},
xAxis: {
scale: true,
max: 10,
min: 0,
interval: 1,
axisLine: {
lineStyle: {
color: "#ddd",
},
},
axisLabel: {
color: "#666",
},
axisPointer: {
show: true,
label: {
precision: 0,
},
// snap: true,
},
splitLine: {
lineStyle: {
color: "#eee",
},
},
},
yAxis: {
max: 2000,
min: 0,
interval: 200,
scale: true,
axisLine: {
lineStyle: {
color: "#ddd",
},
},
axisPointer: {
show: true,
label: {
precision: 0,
},
// snap: true,
},
axisLabel: {
color: "#666",
},
splitLine: {
lineStyle: {
color: "#eee",
},
},
},
series: [
{
type: "scatter",
data: marksData,
label: {
show: true,
position: "bottom",
formatter: "{b}",
},
itemStyle: {
shadowBlur: 2,
shadowColor: "rgba(120, 36, 50, 0.5)",
shadowOffsetY: 1,
color: function (params) {
// params
return params.data.color;
},
// color: function (e) {
// let randomColor =
// "rgba(" +
// Math.floor(Math.random() * 240) +
// "," +
// Math.floor(Math.random() * 240) +
// "," +
// Math.floor(Math.random() * 240) +
// "," +
// ".8" +
// ")";
// return randomColor.substring();
// },
},
// 线markArea
markArea: {
silent: true,
data: [
//
[
{
//
name: "第一象限",
xAxis: 5, // x 线
yAxis: 2000, // y (y)
itemStyle: {
// color: "rgba(52, 134, 207, 0.6)",
},
label: {
position: "inside",
color: "#fff",
fontSize: 22,
},
},
{
//
yAxis: 1000, // y 线
},
],
//
[
{
name: "第二象限",
yAxis: 2000, // y (y)
itemStyle: {
// color: "rgba(177, 130, 192, 0.6)",
},
label: {
position: "inside",
color: "#fff",
fontSize: 22,
},
},
{
xAxis: 5, // x 线
yAxis: 1000, // y 线
},
],
//
[
{
name: "第三象限",
yAxis: 1000, // y 线
itemStyle: {
// color: "rgba(254, 141, 42, 0.6)",
},
label: {
position: "inside",
color: "#fff",
fontSize: 22,
},
},
{
xAxis: 5, // x 线
yAxis: 0, // y (y
},
],
//
[
{
name: "第四象限",
xAxis: 5, // x 线
yAxis: 1000, // y 线
itemStyle: {
// color: "rgba(0, 184, 105, 0.6)",
},
label: {
position: "inside",
color: "#FFF",
fontSize: 22,
},
},
{
yAxis: 0, // y(y
},
],
],
},
//
markLine: {
silent: true, //
precision: 2, //
lineStyle: {
type: "solid",
color: "#00aca6",
},
label: {
color: "#00aca6",
position: "end",
formatter: "{b}",
},
data: centerLine,
},
//
markPoint: {
symbol: "roundRect",
symbolSize: 15,
itemStyle: {
color: "rgba(234, 85, 6, .8)",
},
label: {
position: "top",
},
data: centerMark,
},
},
],
};
var chartDom = document.getElementById("charts3");
var myChart = echarts.init(chartDom, "dark");
optionStep5.value && myChart.setOption(optionStep5.value);
myChart.getZr().on("click", function (param) {
if (drawPointColorStep5.value == "") {
proxy.$modal.msgError("请选择要绘制的点");
return;
}
const pointInPixel = [param.offsetX, param.offsetY];
console.log("pointInPixel5", pointInPixel);
//
pointInGridStep5.value = myChart.convertFromPixel(
{ seriesIndex: 0 },
pointInPixel
);
console.log("pointInGrid5", pointInGridStep5.value);
if (pointInGridStep5.value[0] > 5 && pointInGridStep5.value[1] > 1000) {
optionStep5.value.series[0].markArea.data[0][0].itemStyle.color =
drawPointColorStep5.value;
optionStep5.value.series[0].markArea.data[0][0].name =
drawPointNameStep5.value;
console.log(optionStep5.value);
}
if (pointInGridStep5.value[0] < 5 && pointInGridStep5.value[1] > 1000) {
optionStep5.value.series[0].markArea.data[1][0].itemStyle.color =
drawPointColorStep5.value;
optionStep5.value.series[0].markArea.data[1][0].name =
drawPointNameStep5.value;
console.log(optionStep5.value);
}
if (pointInGridStep5.value[0] < 5 && pointInGridStep5.value[1] < 1000) {
optionStep5.value.series[0].markArea.data[2][0].itemStyle.color =
drawPointColorStep5.value;
optionStep5.value.series[0].markArea.data[2][0].name =
drawPointNameStep5.value;
console.log(optionStep5.value);
}
if (pointInGridStep5.value[0] > 5 && pointInGridStep5.value[1] < 1000) {
optionStep5.value.series[0].markArea.data[3][0].itemStyle.color =
drawPointColorStep5.value;
optionStep5.value.series[0].markArea.data[3][0].name =
drawPointNameStep5.value;
console.log(optionStep5.value);
}
optionStep5.value && myChart.setOption(optionStep5.value);
});
};
const drawQuadrant = (name, color) => {
drawPointColorStep5.value = color;
drawPointNameStep5.value = name;
console.log(drawPointColorStep5.value);
};
const step1Submit = () => {
step1Error.value = 0;
for (let i in step1Data.value) {
if (!step1Data.value[i].params1 || !step1Data.value[i].params2) {
proxy.$modal.msgError("请先完成所有填空");
return;
}
}
if (step1Data.value[0].params1 && step1Data.value[0].params1 !== "3") {
step1Error.value++;
}
if (step1Data.value[0].params2 && step1Data.value[0].params2 !== "800") {
step1Error.value++;
}
if (step1Data.value[1].params1 && step1Data.value[1].params1 !== "4") {
step1Error.value++;
}
if (step1Data.value[1].params2 && step1Data.value[1].params2 !== "1200") {
step1Error.value++;
}
if (step1Data.value[2].params1 && step1Data.value[2].params1 !== "6") {
step1Error.value++;
}
if (step1Data.value[2].params2 && step1Data.value[2].params2 !== "600") {
step1Error.value++;
}
if (step1Data.value[3].params1 && step1Data.value[3].params1 !== "7") {
step1Error.value++;
}
if (step1Data.value[3].params2 && step1Data.value[3].params2 !== "1400") {
step1Error.value++;
}
console.log(step1Error.value, "错误数");
proxy.$modal.msgSuccess("提交成功");
step1AnswerFlag.value = true;
};
const moveDown = (index, row) => {
console.log("下移", index, row);
if (index + 1 === step2Data.value.length) {
alert("已经是最后一条,不可下移");
} else {
const downDate = step2Data.value[index + 1];
step2Data.value.splice(index + 1, 1);
step2Data.value.splice(index, 0, downDate);
const step2Submit = () => {
step2Error.value = 0;
if (!step2Data.value[4].params1 || !step2Data.value[4].params2) {
proxy.$modal.msgError("请先完成所有填空");
return;
}
if (step2Data.value[4].params1 && step2Data.value[4].params1 !== "5") {
step2Error.value++;
}
if (step2Data.value[4].params2 && step2Data.value[4].params2 !== "1000") {
step2Error.value++;
}
console.log(step2Error.value, "错误数");
proxy.$modal.msgSuccess("提交成功");
step2AnswerFlag.value = true;
};
const step3Submit = () => {
step3Error.value = 0;
for (let i in option.value.series[0].data) {
console.log(option.value.series[0].data[i]);
if (option.value.series[0].data[i].name == "A") {
if (
Math.round(option.value.series[0].data[i].value[0]) != 3 ||
Math.round(option.value.series[0].data[i].value[1]) != 800
) {
step3Error.value++;
}
}
if (option.value.series[0].data[i].name == "B") {
if (
Math.round(option.value.series[0].data[i].value[0]) != 4 ||
Math.round(option.value.series[0].data[i].value[1]) != 1200
) {
step3Error.value++;
}
}
if (option.value.series[0].data[i].name == "C") {
if (
Math.round(option.value.series[0].data[i].value[0]) != 6 ||
Math.round(option.value.series[0].data[i].value[1]) != 600
) {
step3Error.value++;
}
}
if (option.value.series[0].data[i].name == "D") {
if (
Math.round(option.value.series[0].data[i].value[0]) != 7 ||
Math.round(option.value.series[0].data[i].value[1]) != 1400
) {
step3Error.value++;
}
}
}
console.log(step3Error.value, "错误数");
proxy.$modal.msgSuccess("提交成功");
step3AnswerFlag.value = true;
};
const step4Submit = () => {
step4Error.value = 0;
for (let i in option2.value.series[0].data) {
console.log(option2.value.series[0].data[i]);
if (option2.value.series[0].data[i].name == "A") {
if (
Math.round(option2.value.series[0].data[i].value[0]) != 5 ||
Math.round(option2.value.series[0].data[i].value[1]) != 1000
) {
step4Error.value++;
}
}
}
console.log(step4Error.value, "错误数");
proxy.$modal.msgSuccess("提交成功");
step4AnswerFlag.value = true;
};
const step5Submit = () => {
step5Error.value = 0;
if (optionStep5.value.series[0].markArea.data[0][0].name != "明星客户") {
step5Error.value++;
}
if (optionStep5.value.series[0].markArea.data[1][0].name != "问题客户") {
step5Error.value++;
}
if (optionStep5.value.series[0].markArea.data[2][0].name != "瘦狗客户") {
step5Error.value++;
}
if (optionStep5.value.series[0].markArea.data[3][0].name != "现金流客户") {
step5Error.value++;
}
console.log(step5Error.value, "错误数");
proxy.$modal.msgSuccess("提交成功");
step5AnswerFlag.value = true;
};
const downloadData = () => {
// console.log(666);
portraitModel
.downloadDataByBoston({
})
.downloadDataByBoston({})
.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 ||
!step3AnswerFlag.value ||
!step4AnswerFlag.value ||
!step5AnswerFlag.value
) {
proxy.$modal.msgError("请先完成所有步骤!");
return;
}
errorNum.value =
step1Error.value +
step2Error.value +
step3Error.value +
step4Error.value +
step5Error.value;
console.log(errorNum.value, "总错误次数");
portraitModel
.submit({
userId: JSON.parse(getUserInfo()).userId,
taskName: "波士顿矩阵分析",
numberOfErrors: errorNum.value,
})
.then((res) => {
proxy.$modal.msgSuccess("提交成功");
})
.catch((error) => {});
};
defineExpose({
submitData,
// retrain,
// practicalTraining,
});
</script>
<style scoped lang="scss">
@ -560,7 +1333,7 @@ const downloadData = () => {
font-weight: bold;
width: 180px;
height: 56px;
background-image: url("@/assets/images/01.png");
background-image: url("@/assets/images/taskImport.png");
background-size: 180px 56px;
text-align: center;
align-items: center;
@ -620,6 +1393,31 @@ const downloadData = () => {
margin-right: 10px;
}
}
.drawPoint {
margin-left: 20px;
.point {
display: flex;
align-items: center;
margin-top: 15px;
.pointItem {
// width: 73px;
height: 19px;
padding-left: 10px;
padding-right: 10px;
background: #002651;
border: 1px solid #67b3d6;
text-align: center;
line-height: 19px;
font-size: 12px;
cursor: pointer;
}
span {
font-size: 12px;
color: #6e70f0;
margin-left: 10px;
}
}
}
}
.line {
width: 1400px;

@ -309,6 +309,7 @@
</template>
<script setup>
import { getUserInfo } from '@/utils/auth'
import * as portraitModel from "@/api/portraitModel";
import * as echarts from "echarts";
import { downBlobFile } from "@/utils/index.js";
@ -797,7 +798,7 @@ const saveData = () => {
};
portraitModel
.saveData({
userId: 492,
userId: JSON.parse(getUserInfo()).userId,
module: "转化分析-漏斗模型",
...params,
})
@ -807,7 +808,7 @@ const saveData = () => {
const getData = () => {
portraitModel
.getData({
userId: 492,
userId: JSON.parse(getUserInfo()).userId,
module: "转化分析-漏斗模型",
})
.then((res) => {
@ -867,7 +868,7 @@ const submitData = () => {
console.log(errorNum.value, "总错误次数");
portraitModel
.submit({
userId: 492,
userId: JSON.parse(getUserInfo()).userId,
taskName: "转化分析-漏斗模型",
numberOfErrors: errorNum.value,
})
@ -880,7 +881,7 @@ const submitData = () => {
const retrain = () => {
portraitModel
.retrain({
userId: 492,
userId: JSON.parse(getUserInfo()).userId,
module: "转化分析-漏斗模型",
})
.then((res) => {
@ -923,7 +924,7 @@ defineExpose({
font-weight: bold;
width: 180px;
height: 56px;
background-image: url("@/assets/images/01.png");
background-image: url("@/assets/images/taskImport.png");
background-size: 180px 56px;
text-align: center;
align-items: center;

@ -283,6 +283,7 @@ https://help.fanruan.com/finebi5.1/doc-view-1256.html"
</template>
<script setup>
import { getUserInfo } from '@/utils/auth'
import * as portraitModel from "@/api/portraitModel";
import { downBlobFile } from "@/utils/index.js";
import * as echarts from "echarts";
@ -1138,7 +1139,7 @@ const saveData = () => {
};
portraitModel
.saveData({
userId: 492,
userId: JSON.parse(getUserInfo()).userId,
module: "用户画像分析",
...params,
})
@ -1148,7 +1149,7 @@ const saveData = () => {
const getData = () => {
portraitModel
.getData({
userId: 492,
userId: JSON.parse(getUserInfo()).userId,
module: "用户画像分析",
})
.then((res) => {
@ -1211,7 +1212,7 @@ const submitData = () => {
console.log(errorNum.value, "总错误次数");
portraitModel
.submit({
userId: 492,
userId: JSON.parse(getUserInfo()).userId,
taskName: "用户画像分析",
numberOfErrors: errorNum.value,
})
@ -1224,7 +1225,7 @@ const retrain = () => {
// console.log(66666);
portraitModel
.retrain({
userId: 492,
userId: JSON.parse(getUserInfo()).userId,
module: "用户画像分析",
})
.then((res) => {
@ -1263,7 +1264,7 @@ defineExpose({
font-weight: bold;
width: 180px;
height: 56px;
background-image: url("@/assets/images/01.png");
background-image: url("@/assets/images/taskImport.png");
background-size: 180px 56px;
text-align: center;
align-items: center;

@ -544,6 +544,7 @@
</template>
<script setup>
import { getUserInfo } from '@/utils/auth'
import * as portraitModel from "@/api/portraitModel";
import { downBlobFile } from "@/utils/index.js";
import * as echarts from "echarts";
@ -1787,7 +1788,7 @@ const saveData = () => {
};
portraitModel
.saveData({
userId: 492,
userId: JSON.parse(getUserInfo()).userId,
module: "复购分析",
...params,
})
@ -1797,7 +1798,7 @@ const saveData = () => {
const getData = () => {
portraitModel
.getData({
userId: 492,
userId: JSON.parse(getUserInfo()).userId,
module: "复购分析",
})
.then((res) => {
@ -1875,7 +1876,7 @@ const submitData = () => {
console.log(errorNum.value, "总错误次数");
portraitModel
.submit({
userId: 492,
userId: JSON.parse(getUserInfo()).userId,
taskName: "复购分析",
numberOfErrors: errorNum.value,
})
@ -1888,7 +1889,7 @@ const submitData = () => {
const retrain = () => {
portraitModel
.retrain({
userId: 492,
userId: JSON.parse(getUserInfo()).userId,
module: "复购分析",
})
.then((res) => {
@ -1938,7 +1939,7 @@ defineExpose({
font-weight: bold;
width: 180px;
height: 56px;
background-image: url("@/assets/images/01.png");
background-image: url("@/assets/images/taskImport.png");
background-size: 180px 56px;
text-align: center;
align-items: center;

@ -450,6 +450,7 @@
</template>
<script setup>
import { getUserInfo } from '@/utils/auth'
import * as portraitModel from "@/api/portraitModel";
import { downBlobFile } from "@/utils/index.js";
import * as echarts from "echarts";
@ -1578,7 +1579,7 @@ const saveData = () => {
};
portraitModel
.saveData({
userId: 492,
userId: JSON.parse(getUserInfo()).userId,
module: "留存分析",
...params,
})
@ -1588,7 +1589,7 @@ const saveData = () => {
const getData = () => {
portraitModel
.getData({
userId: 492,
userId: JSON.parse(getUserInfo()).userId,
module: "留存分析",
})
.then((res) => {
@ -1654,7 +1655,7 @@ const submitData = () => {
console.log(errorNum.value, "总错误次数");
portraitModel
.submit({
userId: 492,
userId: JSON.parse(getUserInfo()).userId,
taskName: "留存分析",
numberOfErrors: errorNum.value,
})
@ -1666,7 +1667,7 @@ const submitData = () => {
const retrain = () => {
portraitModel
.retrain({
userId: 492,
userId: JSON.parse(getUserInfo()).userId,
module: "留存分析",
})
.then((res) => {
@ -1708,7 +1709,7 @@ defineExpose({
font-weight: bold;
width: 180px;
height: 56px;
background-image: url("@/assets/images/01.png");
background-image: url("@/assets/images/taskImport.png");
background-size: 180px 56px;
text-align: center;
align-items: center;

@ -515,6 +515,7 @@
</template>
<script setup>
import { getUserInfo } from '@/utils/auth'
import * as portraitModel from "@/api/portraitModel";
import { downBlobFile } from "@/utils/index.js";
import { onBeforeUnmount, onMounted } from "vue";
@ -1067,7 +1068,7 @@ const submitData = () => {
console.log(errorNum.value, "总错误次数");
portraitModel
.submit({
userId: 492,
userId: JSON.parse(getUserInfo()).userId,
taskName: "RFM分析",
numberOfErrors: errorNum.value,
})
@ -1121,7 +1122,7 @@ const saveData = () => {
};
portraitModel
.saveData({
userId: 492,
userId: JSON.parse(getUserInfo()).userId,
module: "RFM分析",
...params,
})
@ -1131,7 +1132,7 @@ const saveData = () => {
const getData = () => {
portraitModel
.getData({
userId: 492,
userId: JSON.parse(getUserInfo()).userId,
module: "RFM分析",
})
.then((res) => {
@ -1181,7 +1182,7 @@ const getData = () => {
const retrain = () => {
portraitModel
.retrain({
userId: 492,
userId: JSON.parse(getUserInfo()).userId,
module: "RFM分析",
})
.then((res) => {
@ -1243,7 +1244,7 @@ const tableSpanMethod = ({ row, column, rowIndex, columnIndex }) => {
font-weight: bold;
width: 180px;
height: 56px;
background-image: url("@/assets/images/01.png");
background-image: url("@/assets/images/taskImport.png");
background-size: 180px 56px;
text-align: center;
align-items: center;

@ -390,6 +390,7 @@ https://blog.csdn.net/kevin1993best/article/details/106329573"
</template>
<script setup>
import { getUserInfo } from '@/utils/auth'
import * as portraitModel from "@/api/portraitModel";
import { downBlobFile } from "@/utils/index.js";
import * as echarts from "echarts";
@ -1720,7 +1721,7 @@ const saveData = () => {
};
portraitModel
.saveData({
userId: 492,
userId: JSON.parse(getUserInfo()).userId,
module: "用户粘性分析",
...params,
})
@ -1730,7 +1731,7 @@ const saveData = () => {
const getData = () => {
portraitModel
.getData({
userId: 492,
userId: JSON.parse(getUserInfo()).userId,
module: "用户粘性分析",
})
.then((res) => {
@ -1821,7 +1822,7 @@ const submitData = () => {
console.log(errorNum.value, "总错误次数");
portraitModel
.submit({
userId: 492,
userId: JSON.parse(getUserInfo()).userId,
taskName: "用户粘性分析",
numberOfErrors: errorNum.value,
})
@ -1833,7 +1834,7 @@ const submitData = () => {
const retrain = () => {
portraitModel
.retrain({
userId: 492,
userId: JSON.parse(getUserInfo()).userId,
module: "用户粘性分析",
})
.then((res) => {
@ -1889,7 +1890,7 @@ defineExpose({
font-weight: bold;
width: 180px;
height: 56px;
background-image: url("@/assets/images/01.png");
background-image: url("@/assets/images/taskImport.png");
background-size: 180px 56px;
text-align: center;
align-items: center;

Loading…
Cancel
Save