dev-QQq
HeHaonan 2 years ago
parent f781cba9d0
commit fd6ac8f001

@ -5,4 +5,4 @@ VITE_APP_TITLE = 数字营销实训系统
VITE_APP_ENV = 'development'
# 若依管理系统/开发环境
VITE_APP_BASE_API = 'http://192.168.2.28:9868'
VITE_APP_BASE_API = 'http://192.168.2.16:9868'

File diff suppressed because one or more lines are too long

@ -272,49 +272,59 @@
以分析表的商品名称为X轴销售额为左侧Y轴累计销售额占比为右侧Y轴绘制帕累托图
</span>
<div style="margin-top: 10px; display: flex">
<el-table
:data="step5Data"
style="width: 680px"
border
:header-cell-style="{
color: '#fff',
fontSize: '14px',
backgroundColor: '#6A7DE9!important',
}"
<div id="echarts" style="width: 500px; height: 400px"></div>
<div class="submit" @click="step5Submit"></div>
</div>
<div class="chartXData">
<el-select
v-model="chartParam1"
placeholder="请选择"
style="width: 85px"
class="XdataItem"
size="small"
>
<el-table-column label="" align="center" prop="title" />
<el-table-column label="R值打分" align="center">
<template #default="scope">
<el-input
v-model="scope.row.params1"
placeholder="请输入"
style="width: 100px"
<el-option :label="'男士配饰'" :value="'男士配饰'" />
<el-option :label="'床上用品'" :value="'床上用品'" />
<el-option :label="'婴儿用品'" :value="'婴儿用品'" />
<el-option :label="'儿童服装'" :value="'儿童服装'" />
</el-select>
<el-select
v-model="chartParam2"
placeholder="请选择"
style="width: 85px"
class="XdataItem"
size="small"
>
</el-input>
</template>
</el-table-column>
<el-table-column label="F值打分" align="center">
<template #default="scope">
<el-input
v-model="scope.row.params2"
placeholder="请输入"
style="width: 100px"
<el-option :label="'男士配饰'" :value="'男士配饰'" />
<el-option :label="'床上用品'" :value="'床上用品'" />
<el-option :label="'婴儿用品'" :value="'婴儿用品'" />
<el-option :label="'儿童服装'" :value="'儿童服装'" />
</el-select>
<el-select
v-model="chartParam3"
placeholder="请选择"
style="width: 85px"
class="XdataItem"
size="small"
>
</el-input>
</template>
</el-table-column>
<el-table-column label="M值打分" align="center">
<template #default="scope">
<el-input
v-model="scope.row.params3"
placeholder="请输入"
style="width: 100px"
<el-option :label="'男士配饰'" :value="'男士配饰'" />
<el-option :label="'床上用品'" :value="'床上用品'" />
<el-option :label="'婴儿用品'" :value="'婴儿用品'" />
<el-option :label="'儿童服装'" :value="'儿童服装'" />
</el-select>
<el-select
v-model="chartParam4"
placeholder="请选择"
style="width: 85px"
class="XdataItem"
size="small"
@change="selectChange"
>
</el-input>
</template>
</el-table-column>
</el-table>
<div class="submit">提交</div>
<el-option :label="'男士配饰'" :value="'男士配饰'" />
<el-option :label="'床上用品'" :value="'床上用品'" />
<el-option :label="'婴儿用品'" :value="'婴儿用品'" />
<el-option :label="'儿童服装'" :value="'儿童服装'" />
</el-select>
</div>
</div>
<div class="line"></div>
@ -364,11 +374,13 @@
</template>
<script setup>
import * as echarts from "echarts";
import popModal from "@/views/components/popModal.vue";
import { getUserInfo } from "@/utils/auth";
import * as portraitModel from "@/api/portraitModel";
import { downBlobFile } from "@/utils/index.js";
const { proxy } = getCurrentInstance();
const baseUrl = import.meta.env.VITE_APP_BASE_API;
const dialogVisible = ref(false);
const knowledgeFlag = ref(false);
const errorNum = ref(0);
@ -376,10 +388,16 @@ 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);
const chartParam1 = ref("");
const chartParam2 = ref("");
const chartParam3 = ref("");
const chartParam4 = ref("");
const step1Data = ref([
{
name: "男士配饰",
@ -601,7 +619,96 @@ onBeforeUnmount(() => {
});
onMounted(() => {
getData();
initCharts();
});
const initCharts = () => {
var chartDom = document.getElementById("echarts");
var myChart = echarts.init(chartDom, "dark");
var option;
option = {
title: {
text: "帕累托图",
left: "center",
top: "10px",
textStyle: {
color: "#fff",
// fontSize:16
},
},
tooltip: {
trigger: "axis",
axisPointer: {
type: "cross",
crossStyle: {
color: "#999",
},
},
},
legend: {
data: ["销售额", "累计销售占比"],
bottom: 5,
},
xAxis: [
{
show: false,
type: "category",
data: ["", "", "", ""],
axisPointer: {
type: "shadow",
},
},
],
yAxis: [
{
type: "value",
name: "销售额",
// min: 0,
// max: 250,
// interval: 50,
axisLabel: {
formatter: "{value}",
},
},
{
type: "value",
name: "累计销售占比",
min: 0,
max: 120,
interval: 20,
axisLabel: {
formatter: "{value} %",
},
},
],
series: [
{
name: "销售额",
type: "bar",
tooltip: {
valueFormatter: function (value) {
return value + " 元";
},
},
data: [5900, 2400, 1100, 600],
},
{
name: "累计销售占比",
type: "line",
yAxisIndex: 1,
tooltip: {
valueFormatter: function (value) {
return value + " %";
},
},
data: [59, 83, 94, 100],
},
],
};
option && myChart.setOption(option);
};
const moveUp = (index, row) => {
console.log("上移", index, row);
if (index > 0) {
@ -624,14 +731,15 @@ const moveDown = (index, row) => {
};
const downloadData = () => {
// console.log(666);
portraitModel
.downloadDataByABC({})
.then((res) => {
// console.log(res,'--');
const blob = new Blob([res], { type: "application/vnd.ms-excel" });
downBlobFile(`案例数据-帕累托分析`, blob);
})
.catch((error) => {});
// portraitModel
// .downloadDataByABC({})
// .then((res) => {
// // console.log(res,'--');
// const blob = new Blob([res], { type: "application/vnd.ms-excel" });
// downBlobFile(`-`, blob);
// })
// .catch((error) => {});
window.open(baseUrl + "/api/downDataByUserPortrait/analysisByPareto");
};
const step1Submit = () => {
step1Error.value = 0;
@ -753,6 +861,33 @@ const step4Submit = () => {
proxy.$modal.msgSuccess("提交成功");
step4AnswerFlag.value = true;
};
const step5Submit = () => {
step5Error.value = 0;
if (
chartParam1.value == "" ||
chartParam2.value == "" ||
chartParam3.value == "" ||
chartParam4.value == ""
) {
proxy.$modal.msgError("请先完成所有填空");
return;
}
if (chartParam1.value != "男士配饰") {
step5Error.value++;
}
if (chartParam2.value != "床上用品") {
step5Error.value++;
}
if (chartParam3.value != "婴儿用品") {
step5Error.value++;
}
if (chartParam4.value != "儿童服装") {
step5Error.value++;
}
console.log("错误数", step5Error.value);
proxy.$modal.msgSuccess("提交成功");
step5AnswerFlag.value = true;
};
const saveData = () => {
const params = {
stepFiveA: step1Data.value[0].params,
@ -855,6 +990,10 @@ const getData = () => {
})
.catch((error) => {});
};
const selectChange = (item) => {
// console.log(22);
// initCharts();
};
const submitData = () => {
console.log("tj");
if (
@ -987,6 +1126,14 @@ defineExpose({
margin-right: 10px;
}
}
.chartXData {
position: relative;
top: -58px;
left: 60px;
.XdataItem {
margin-right: 15px;
}
}
}
.line {
width: 1400px;

File diff suppressed because one or more lines are too long

@ -107,7 +107,7 @@
<span style="line-height: 25px; font-size: 14px">
以客户ID为统计单元分别计算各个客户的平均消费次数平均消费金额
</span>
<div style="margin-top: 10px; display: flex">
<div style="margin-top: 10px; display: flex" v-if="step1AnswerFlag">
<el-table
:data="step2Data"
style="width: 650px"
@ -344,6 +344,7 @@ import * as portraitModel from "@/api/portraitModel";
import { downBlobFile } from "@/utils/index.js";
import { onMounted } from "vue";
const { proxy } = getCurrentInstance();
const baseUrl = import.meta.env.VITE_APP_BASE_API;
const dialogVisible = ref(false);
const knowledgeFlag = ref(false);
const step1Data = ref([
@ -1307,14 +1308,15 @@ const step5Submit = () => {
};
const downloadData = () => {
// console.log(666);
portraitModel
.downloadDataByBoston({})
.then((res) => {
// console.log(res,'--');
const blob = new Blob([res], { type: "application/vnd.ms-excel" });
downBlobFile(`案例数据-波士顿矩阵分析`, blob);
})
.catch((error) => {});
// portraitModel
// .downloadDataByBoston({})
// .then((res) => {
// // console.log(res,'--');
// const blob = new Blob([res], { type: "application/vnd.ms-excel" });
// downBlobFile(`-`, blob);
// })
// .catch((error) => {});
window.open(baseUrl + "/api/downDataByUserPortrait/bostonMatrixAnalysisData");
};
const submitData = () => {
if (

@ -603,6 +603,7 @@ const step1AnswerFlag = ref(false);
const step2AnswerFlag = ref(false);
const step3AnswerFlag = ref(false);
const errorNum = ref(0);
const baseUrl = import.meta.env.VITE_APP_BASE_API;
onBeforeUnmount(() => {
saveData();
});
@ -755,14 +756,15 @@ const step3Submit = () => {
step3AnswerFlag.value = true;
};
const downloadData = () => {
portraitModel
.downloadDataByFunnel({})
.then((res) => {
// console.log(res,'--');
const blob = new Blob([res], { type: "application/vnd.ms-excel" });
downBlobFile(`案例数据-漏斗模型`, blob);
})
.catch((error) => {});
// portraitModel
// .downloadDataByFunnel({})
// .then((res) => {
// // console.log(res,'--');
// const blob = new Blob([res], { type: "application/vnd.ms-excel" });
// downBlobFile(`-`, blob);
// })
// .catch((error) => {});
window.open(baseUrl + "/api/downDataByUserPortrait/analysisByFunnelModel");
};
const saveData = () => {
const params = {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -105,7 +105,11 @@
</el-table-column>
<el-table-column label="用户名称" align="center" prop="userName">
</el-table-column>
<el-table-column label="最近一次消费时间间隔R" align="center" width="210">
<el-table-column
label="最近一次消费时间间隔R"
align="center"
width="210"
>
<template #default="scope">
<el-input
v-model="scope.row.params1"
@ -532,11 +536,16 @@
</div>
<img class="xtImg" src="../../../assets/images/线条.png" alt="" />
</template>
<div style="color:#fff;margin-top:-35px;padding:10px;padding-left:20px">
<div
style="
color: #fff;
margin-top: -35px;
padding: 10px;
padding-left: 20px;
"
>
<el-scrollbar height="650px">
<div v-html="knowledge">
</div>
<div v-html="knowledge"></div>
</el-scrollbar>
</div>
<!-- <template #footer>
@ -556,6 +565,8 @@ import { getUserInfo } from "@/utils/auth";
import * as portraitModel from "@/api/portraitModel";
import { downBlobFile } from "@/utils/index.js";
import { onBeforeUnmount, onMounted } from "vue";
// const baseURL = "http://192.168.2.16:9868/";
const baseUrl = import.meta.env.VITE_APP_BASE_API;
const dialogVisible = ref(false);
const { proxy } = getCurrentInstance();
const errorNum = ref(0); //
@ -834,14 +845,17 @@ onMounted(() => {
getData();
});
const downloadData = () => {
portraitModel
.downloadDataByRFM({})
.then((res) => {
// console.log(res,'--');
const blob = new Blob([res], { type: "application/vnd.ms-excel" });
downBlobFile(`案例数据-RFM分析`, blob);
})
.catch((error) => {});
// portraitModel
// .downloadDataByRFM({})
// .then((res) => {
// // console.log(res,'--');
// const blob = new Blob([res], {
// type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
// });
// downBlobFile(`-RFM`, blob);
// })
// .catch((error) => {});
window.open(baseUrl + "/api/downDataByUserPortrait/analysisByRfmDown");
};
const step1Submit = () => {
// errorNum.value = 0;

File diff suppressed because one or more lines are too long

@ -289,7 +289,7 @@ import { onMounted } from "vue";
const { proxy } = getCurrentInstance();
const currentComponent = ref(null);
const contentRef = ref(null);
const menuIndex = ref(1);
const menuIndex = ref(0);
const tabIndex = ref(0);
const fileTable = ref([]);
const tabList = ref([
@ -356,7 +356,8 @@ const tabList = ref([
]);
// defineExpose({ submitMethod });
onMounted(() => {
getTableData("用户属性表");
// getTableData("");
currentComponent.value = tabList.value[0].key
});
const getTableData = (name) => {
fileTable.value = [];
@ -413,8 +414,8 @@ const retrain = () => {
// width: 1060px;
.tabs {
cursor: pointer;
font-size: 12px;
margin-right: 4px;
font-size: 13px;
margin-right: 13px;
margin-bottom: 20px;
width: 159px;
height: 56px;
@ -434,9 +435,6 @@ const retrain = () => {
.tabs:nth-of-type(9) {
background-image: url("@/assets/images/itembg2.png");
}
.tabs:nth-of-type(9) {
font-size: 11px;
}
.tabs:nth-of-type(3),
.tabs:nth-of-type(10) {
background-image: url("@/assets/images/itembg3.png");
@ -459,6 +457,51 @@ const retrain = () => {
margin-right: 5px;
}
}
.tabs:nth-of-type(1) {
// background-image: url("@/assets/images/itembg1.png");
width: 130px;
background-size: 130px 56px;
}
.tabs:nth-of-type(2) {
// background-image: url("@/assets/images/itembg1.png");
width: 153px;
background-size: 153px 56px;
}
.tabs:nth-of-type(3) {
// background-image: url("@/assets/images/itembg1.png");
width: 150px;
background-size: 150px 56px;
}
.tabs:nth-of-type(4) {
// background-image: url("@/assets/images/itembg1.png");
width: 172px;
background-size: 172px 56px;
}
.tabs:nth-of-type(6),.tabs:nth-of-type(7) {
// background-image: url("@/assets/images/itembg1.png");
width: 133px;
background-size: 133px 56px;
}
.tabs:nth-of-type(5) {
// background-image: url("@/assets/images/itembg1.png");
width: 133px;
background-size: 133px 56px;
}
.tabs:nth-of-type(8) {
// background-image: url("@/assets/images/itembg1.png");
width: 135px;
background-size: 135px 56px;
}
.tabs:nth-of-type(9) {
// background-image: url("@/assets/images/itembg1.png");
width: 185px;
background-size: 185px 56px;
}
.tabs:nth-of-type(10) {
// background-image: url("@/assets/images/itembg1.png");
width: 138px;
background-size: 138px 56px;
}
}
.btn {
width: 220px;

Loading…
Cancel
Save