dev-QQq
HeHaonan 2 years ago
parent f781cba9d0
commit fd6ac8f001

@ -5,4 +5,4 @@ VITE_APP_TITLE = 数字营销实训系统
VITE_APP_ENV = 'development' 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轴绘制帕累托图 以分析表的商品名称为X轴销售额为左侧Y轴累计销售额占比为右侧Y轴绘制帕累托图
</span> </span>
<div style="margin-top: 10px; display: flex"> <div style="margin-top: 10px; display: flex">
<el-table <div id="echarts" style="width: 500px; height: 400px"></div>
:data="step5Data" <div class="submit" @click="step5Submit"></div>
style="width: 680px" </div>
border <div class="chartXData">
:header-cell-style="{ <el-select
color: '#fff', v-model="chartParam1"
fontSize: '14px', placeholder="请选择"
backgroundColor: '#6A7DE9!important', style="width: 85px"
}" class="XdataItem"
size="small"
> >
<el-table-column label="" align="center" prop="title" /> <el-option :label="'男士配饰'" :value="'男士配饰'" />
<el-table-column label="R值打分" align="center"> <el-option :label="'床上用品'" :value="'床上用品'" />
<template #default="scope"> <el-option :label="'婴儿用品'" :value="'婴儿用品'" />
<el-input <el-option :label="'儿童服装'" :value="'儿童服装'" />
v-model="scope.row.params1" </el-select>
placeholder="请输入" <el-select
style="width: 100px" v-model="chartParam2"
> placeholder="请选择"
</el-input> style="width: 85px"
</template> class="XdataItem"
</el-table-column> size="small"
<el-table-column label="F值打分" align="center"> >
<template #default="scope"> <el-option :label="'男士配饰'" :value="'男士配饰'" />
<el-input <el-option :label="'床上用品'" :value="'床上用品'" />
v-model="scope.row.params2" <el-option :label="'婴儿用品'" :value="'婴儿用品'" />
placeholder="请输入" <el-option :label="'儿童服装'" :value="'儿童服装'" />
style="width: 100px" </el-select>
> <el-select
</el-input> v-model="chartParam3"
</template> placeholder="请选择"
</el-table-column> style="width: 85px"
<el-table-column label="M值打分" align="center"> class="XdataItem"
<template #default="scope"> size="small"
<el-input >
v-model="scope.row.params3" <el-option :label="'男士配饰'" :value="'男士配饰'" />
placeholder="请输入" <el-option :label="'床上用品'" :value="'床上用品'" />
style="width: 100px" <el-option :label="'婴儿用品'" :value="'婴儿用品'" />
> <el-option :label="'儿童服装'" :value="'儿童服装'" />
</el-input> </el-select>
</template> <el-select
</el-table-column> v-model="chartParam4"
</el-table> placeholder="请选择"
<div class="submit">提交</div> style="width: 85px"
class="XdataItem"
size="small"
@change="selectChange"
>
<el-option :label="'男士配饰'" :value="'男士配饰'" />
<el-option :label="'床上用品'" :value="'床上用品'" />
<el-option :label="'婴儿用品'" :value="'婴儿用品'" />
<el-option :label="'儿童服装'" :value="'儿童服装'" />
</el-select>
</div> </div>
</div> </div>
<div class="line"></div> <div class="line"></div>
@ -364,11 +374,13 @@
</template> </template>
<script setup> <script setup>
import * as echarts from "echarts";
import popModal from "@/views/components/popModal.vue"; import popModal from "@/views/components/popModal.vue";
import { getUserInfo } from "@/utils/auth"; import { getUserInfo } from "@/utils/auth";
import * as portraitModel from "@/api/portraitModel"; import * as portraitModel from "@/api/portraitModel";
import { downBlobFile } from "@/utils/index.js"; import { downBlobFile } from "@/utils/index.js";
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const baseUrl = import.meta.env.VITE_APP_BASE_API;
const dialogVisible = ref(false); const dialogVisible = ref(false);
const knowledgeFlag = ref(false); const knowledgeFlag = ref(false);
const errorNum = ref(0); const errorNum = ref(0);
@ -376,10 +388,16 @@ const step1Error = ref(0);
const step2Error = ref(0); const step2Error = ref(0);
const step3Error = ref(0); const step3Error = ref(0);
const step4Error = ref(0); const step4Error = ref(0);
const step5Error = ref(0);
const step1AnswerFlag = ref(false); const step1AnswerFlag = ref(false);
const step2AnswerFlag = ref(false); const step2AnswerFlag = ref(false);
const step3AnswerFlag = ref(false); const step3AnswerFlag = ref(false);
const step4AnswerFlag = 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([ const step1Data = ref([
{ {
name: "男士配饰", name: "男士配饰",
@ -601,7 +619,96 @@ onBeforeUnmount(() => {
}); });
onMounted(() => { onMounted(() => {
getData(); 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) => { const moveUp = (index, row) => {
console.log("上移", index, row); console.log("上移", index, row);
if (index > 0) { if (index > 0) {
@ -624,14 +731,15 @@ const moveDown = (index, row) => {
}; };
const downloadData = () => { const downloadData = () => {
// console.log(666); // console.log(666);
portraitModel // portraitModel
.downloadDataByABC({}) // .downloadDataByABC({})
.then((res) => { // .then((res) => {
// console.log(res,'--'); // // console.log(res,'--');
const blob = new Blob([res], { type: "application/vnd.ms-excel" }); // const blob = new Blob([res], { type: "application/vnd.ms-excel" });
downBlobFile(`案例数据-帕累托分析`, blob); // downBlobFile(`-`, blob);
}) // })
.catch((error) => {}); // .catch((error) => {});
window.open(baseUrl + "/api/downDataByUserPortrait/analysisByPareto");
}; };
const step1Submit = () => { const step1Submit = () => {
step1Error.value = 0; step1Error.value = 0;
@ -753,6 +861,33 @@ const step4Submit = () => {
proxy.$modal.msgSuccess("提交成功"); proxy.$modal.msgSuccess("提交成功");
step4AnswerFlag.value = true; 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 saveData = () => {
const params = { const params = {
stepFiveA: step1Data.value[0].params, stepFiveA: step1Data.value[0].params,
@ -855,6 +990,10 @@ const getData = () => {
}) })
.catch((error) => {}); .catch((error) => {});
}; };
const selectChange = (item) => {
// console.log(22);
// initCharts();
};
const submitData = () => { const submitData = () => {
console.log("tj"); console.log("tj");
if ( if (
@ -987,6 +1126,14 @@ defineExpose({
margin-right: 10px; margin-right: 10px;
} }
} }
.chartXData {
position: relative;
top: -58px;
left: 60px;
.XdataItem {
margin-right: 15px;
}
}
} }
.line { .line {
width: 1400px; 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"> <span style="line-height: 25px; font-size: 14px">
以客户ID为统计单元分别计算各个客户的平均消费次数平均消费金额 以客户ID为统计单元分别计算各个客户的平均消费次数平均消费金额
</span> </span>
<div style="margin-top: 10px; display: flex"> <div style="margin-top: 10px; display: flex" v-if="step1AnswerFlag">
<el-table <el-table
:data="step2Data" :data="step2Data"
style="width: 650px" style="width: 650px"
@ -344,6 +344,7 @@ import * as portraitModel from "@/api/portraitModel";
import { downBlobFile } from "@/utils/index.js"; import { downBlobFile } from "@/utils/index.js";
import { onMounted } from "vue"; import { onMounted } from "vue";
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const baseUrl = import.meta.env.VITE_APP_BASE_API;
const dialogVisible = ref(false); const dialogVisible = ref(false);
const knowledgeFlag = ref(false); const knowledgeFlag = ref(false);
const step1Data = ref([ const step1Data = ref([
@ -1307,14 +1308,15 @@ const step5Submit = () => {
}; };
const downloadData = () => { const downloadData = () => {
// console.log(666); // console.log(666);
portraitModel // portraitModel
.downloadDataByBoston({}) // .downloadDataByBoston({})
.then((res) => { // .then((res) => {
// console.log(res,'--'); // // console.log(res,'--');
const blob = new Blob([res], { type: "application/vnd.ms-excel" }); // const blob = new Blob([res], { type: "application/vnd.ms-excel" });
downBlobFile(`案例数据-波士顿矩阵分析`, blob); // downBlobFile(`-`, blob);
}) // })
.catch((error) => {}); // .catch((error) => {});
window.open(baseUrl + "/api/downDataByUserPortrait/bostonMatrixAnalysisData");
}; };
const submitData = () => { const submitData = () => {
if ( if (

@ -603,6 +603,7 @@ const step1AnswerFlag = ref(false);
const step2AnswerFlag = ref(false); const step2AnswerFlag = ref(false);
const step3AnswerFlag = ref(false); const step3AnswerFlag = ref(false);
const errorNum = ref(0); const errorNum = ref(0);
const baseUrl = import.meta.env.VITE_APP_BASE_API;
onBeforeUnmount(() => { onBeforeUnmount(() => {
saveData(); saveData();
}); });
@ -755,14 +756,15 @@ const step3Submit = () => {
step3AnswerFlag.value = true; step3AnswerFlag.value = true;
}; };
const downloadData = () => { const downloadData = () => {
portraitModel // portraitModel
.downloadDataByFunnel({}) // .downloadDataByFunnel({})
.then((res) => { // .then((res) => {
// console.log(res,'--'); // // console.log(res,'--');
const blob = new Blob([res], { type: "application/vnd.ms-excel" }); // const blob = new Blob([res], { type: "application/vnd.ms-excel" });
downBlobFile(`案例数据-漏斗模型`, blob); // downBlobFile(`-`, blob);
}) // })
.catch((error) => {}); // .catch((error) => {});
window.open(baseUrl + "/api/downDataByUserPortrait/analysisByFunnelModel");
}; };
const saveData = () => { const saveData = () => {
const params = { 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>
<el-table-column label="用户名称" align="center" prop="userName"> <el-table-column label="用户名称" align="center" prop="userName">
</el-table-column> </el-table-column>
<el-table-column label="最近一次消费时间间隔R" align="center" width="210"> <el-table-column
label="最近一次消费时间间隔R"
align="center"
width="210"
>
<template #default="scope"> <template #default="scope">
<el-input <el-input
v-model="scope.row.params1" v-model="scope.row.params1"
@ -532,11 +536,16 @@
</div> </div>
<img class="xtImg" src="../../../assets/images/线条.png" alt="" /> <img class="xtImg" src="../../../assets/images/线条.png" alt="" />
</template> </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"> <el-scrollbar height="650px">
<div v-html="knowledge"> <div v-html="knowledge"></div>
</div>
</el-scrollbar> </el-scrollbar>
</div> </div>
<!-- <template #footer> <!-- <template #footer>
@ -556,6 +565,8 @@ import { getUserInfo } from "@/utils/auth";
import * as portraitModel from "@/api/portraitModel"; import * as portraitModel from "@/api/portraitModel";
import { downBlobFile } from "@/utils/index.js"; import { downBlobFile } from "@/utils/index.js";
import { onBeforeUnmount, onMounted } from "vue"; 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 dialogVisible = ref(false);
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const errorNum = ref(0); // const errorNum = ref(0); //
@ -834,14 +845,17 @@ onMounted(() => {
getData(); getData();
}); });
const downloadData = () => { const downloadData = () => {
portraitModel // portraitModel
.downloadDataByRFM({}) // .downloadDataByRFM({})
.then((res) => { // .then((res) => {
// console.log(res,'--'); // // console.log(res,'--');
const blob = new Blob([res], { type: "application/vnd.ms-excel" }); // const blob = new Blob([res], {
downBlobFile(`案例数据-RFM分析`, blob); // type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
}) // });
.catch((error) => {}); // downBlobFile(`-RFM`, blob);
// })
// .catch((error) => {});
window.open(baseUrl + "/api/downDataByUserPortrait/analysisByRfmDown");
}; };
const step1Submit = () => { const step1Submit = () => {
// errorNum.value = 0; // 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 { proxy } = getCurrentInstance();
const currentComponent = ref(null); const currentComponent = ref(null);
const contentRef = ref(null); const contentRef = ref(null);
const menuIndex = ref(1); const menuIndex = ref(0);
const tabIndex = ref(0); const tabIndex = ref(0);
const fileTable = ref([]); const fileTable = ref([]);
const tabList = ref([ const tabList = ref([
@ -356,7 +356,8 @@ const tabList = ref([
]); ]);
// defineExpose({ submitMethod }); // defineExpose({ submitMethod });
onMounted(() => { onMounted(() => {
getTableData("用户属性表"); // getTableData("");
currentComponent.value = tabList.value[0].key
}); });
const getTableData = (name) => { const getTableData = (name) => {
fileTable.value = []; fileTable.value = [];
@ -413,8 +414,8 @@ const retrain = () => {
// width: 1060px; // width: 1060px;
.tabs { .tabs {
cursor: pointer; cursor: pointer;
font-size: 12px; font-size: 13px;
margin-right: 4px; margin-right: 13px;
margin-bottom: 20px; margin-bottom: 20px;
width: 159px; width: 159px;
height: 56px; height: 56px;
@ -434,9 +435,6 @@ const retrain = () => {
.tabs:nth-of-type(9) { .tabs:nth-of-type(9) {
background-image: url("@/assets/images/itembg2.png"); background-image: url("@/assets/images/itembg2.png");
} }
.tabs:nth-of-type(9) {
font-size: 11px;
}
.tabs:nth-of-type(3), .tabs:nth-of-type(3),
.tabs:nth-of-type(10) { .tabs:nth-of-type(10) {
background-image: url("@/assets/images/itembg3.png"); background-image: url("@/assets/images/itembg3.png");
@ -459,6 +457,51 @@ const retrain = () => {
margin-right: 5px; 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 { .btn {
width: 220px; width: 220px;

Loading…
Cancel
Save