fix/non-blocking-route-navigation
方佳 博 2 years ago
commit fc94993f7f

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

@ -1,3 +1,11 @@
###
# @Author: qinzhenpen qzp1807@126.com
# @Date: 2024-08-27 10:39:50
# @LastEditors: qinzhenpen qzp1807@126.com
# @LastEditTime: 2024-08-28 17:15:51
# @FilePath: \digital-marketing\.env.production
# @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
###
# 页面标题
VITE_APP_TITLE = 数字营销实训系统
@ -5,7 +13,7 @@ VITE_APP_TITLE = 数字营销实训系统
VITE_APP_ENV = 'production'
# 若依管理系统/生产环境
VITE_APP_BASE_API = 'http://118.31.7.2:9868'
VITE_APP_BASE_API = 'http://120.79.54.255:9868'
# 是否在打包时开启压缩,支持 gzip 和 brotli
VITE_BUILD_COMPRESS = gzip

Binary file not shown.

@ -1,3 +1,11 @@
<!--
* @Author: qinzhenpen qzp1807@126.com
* @Date: 2024-08-28 14:21:24
* @LastEditors: qinzhenpen qzp1807@126.com
* @LastEditTime: 2024-08-29 08:57:36
* @FilePath: \digital-marketing\src\App.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<router-view />
</template>
@ -5,11 +13,16 @@
<script setup>
import useSettingsStore from "@/store/modules/settings";
import { handleThemeStyle } from "@/utils/theme";
import cache from "@/plugins/cache";
import { removeUserInfo, removeToken } from "@/utils/auth.js";
onMounted(() => {
nextTick(() => {
// 初始化主题样式
handleThemeStyle(useSettingsStore().theme);
});
if (cache.session.getJSON("sessionObj") === undefined) {
removeToken();
removeUserInfo();
}
});
</script>
</script>

@ -0,0 +1,99 @@
<!--
* @Author: qinzhenpen qzp1807@126.com
* @Date: 2024-08-28 17:09:02
* @LastEditors: qinzhenpen qzp1807@126.com
* @LastEditTime: 2024-08-28 18:37:43
* @FilePath: \digital-marketing\src\components\video\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="el-Aitools">
<div class="video-title">{{ videlinfo.resourcesName }}</div>
<video-player v-if="playerOptions.sources[0].src" class="video-player" :options="playerOptions"
:volume="0.6" @mounted="handleMounted" @ready="handleEvent($event)" @play="handleEvent($event)" @pause="handleEvent($event)" @ended="handleEvent($event)" @loadeddata="handleEvent($event)" @waiting="handleEvent($event)" @playing="handleEvent($event)" @canplay="handleEvent($event)" @canplaythrough="handleEvent($event)" @timeupdate="handleEvent(player?.currentTime())" />
</div>
</template>
<script setup name="video">
import cache from "@/plugins/cache";
import useAlgorithmStore from "@/store/modules/algorithm.js";
const algorithmStore = useAlgorithmStore();
import { VideoPlayer } from "@videojs-player/vue";
import "video.js/dist/video-js.css";
import { nextTick, onMounted } from "vue";
const router = useRouter();
const player = shallowRef();
const videlinfo = ref({});
const videoSrc = ref("");
const playerOptions = ref({
playbackRates: [0.7, 1.0, 1.5, 2.0],
sources: [
{
type: "video/mp4",
src: videoSrc.value,
},
],
height: 750,
autoplay: "any",
muted: true,
loop: false,
preload: "auto",
language: "zh-CN",
playsinline: true,
notSupportedMessage: "此视频暂无法播放,请稍后再试",
controls: true,
muted: false, // 确保这里设置为 false
controlBar: {
timeDivider: true,
durationDisplay: true,
remainingTimeDisplay: false,
fullscreenToggle: true,
},
});
const handleMounted = (payload) => {
player.value = payload.player;
// console.log("Basic player mounted", payload);
};
const handleEvent = (log) => {
// console.log("Basic player event", log);
};
onMounted(() => {
videlinfo.value = cache.session.getJSON("video_history");
videlinfo.value.resourcesName = videlinfo.value.resourcesName.replace(/.mp4/g, "");
videoSrc.value = `http://120.79.54.255:8042/file${videlinfo.value.resourcesUrl}`;
nextTick(() => {
playerOptions.value.sources[0].src = videoSrc.value;
});
});
</script>
<style scoped lang="scss">
.el-Aitools {
position: relative;
// padding: 20px 20px 0;
min-height: 100vh;
background: #020002;
.video-title {
color: #fff;
height: 50px;
padding: 10px;
font-size: 22px;
font-weight: normal;
}
.video-player {
position: absolute;
top: 50%;
left: 50%;
// width: 100%;
// height: 100%;
border: none;
transform: translate(-50%, -50%);
border-radius: 4px;
transition: all 0.3s ease-in-out;
&:hover {
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}
}
}
</style>

@ -140,7 +140,7 @@ export const dynamicRoutes = [
},
],
},
{
path: "",
component: Layout,
@ -180,6 +180,21 @@ export const dynamicRoutes = [
},
],
},
// 资源视频
{
path: "",
// component: Layout,
hidden: true,
redirect: "/video",
children: [
{
path: "/video",
component: () => import("@/components/video/index.vue"),
name: "video",
meta: { title: "视频中心", icon: "视频中心", affix: true },
},
],
},
];
const router = createRouter({

@ -2,7 +2,7 @@
* @Author: qinzhenpen qzp1807@126.com
* @Date: 2024-08-16 17:56:32
* @LastEditors: qinzhenpen qzp1807@126.com
* @LastEditTime: 2024-08-26 15:26:20
* @LastEditTime: 2024-08-28 14:59:50
* @FilePath: \digital-marketing\src\store\modules\algorithm.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
@ -16,7 +16,7 @@ const useAlgorithmStore = defineStore("algorithm", {
tableData: [],
tableKey:[],
userDataLabel:["用户属性表", "用户登录活跃表", "用户消费能力表", "用户行为表", "用户评论表"], //用户数据标签
userDataLabel2:["用户评论表"],
userDataLabel2:["用户商品评论数据"],
indexLibrary: [],
analysisData: [],
}),

@ -1,4 +1,3 @@
import axios from "axios";
import { ElNotification, ElMessageBox, ElMessage, ElLoading } from "element-plus";
import { getToken } from "@/utils/auth";
@ -17,7 +16,7 @@ axios.defaults.headers["Content-Type"] = "application/json;charset=utf-8";
const service = axios.create({
// axios中请求配置有baseURL选项,表示请求URL公共部分
// baseURL: import.meta.env.VITE_APP_BASE_API,
baseURL: "http://118.31.7.2:9868/",
baseURL: "http://120.79.54.255:9868/",
// baseURL:'http://192.168.2.14:9868/',
// 超时
timeout: 100000,
@ -46,6 +45,10 @@ service.interceptors.request.use(
time: new Date().getTime(),
};
const sessionObj = cache.session.getJSON("sessionObj");
if (sessionObj === undefined || sessionObj === null || sessionObj === "") {
cache.session.setJSON("sessionObj", requestObj);
} else {
}
}
return config;
},

@ -128,7 +128,7 @@ const sendText = async () => {
const messageId = Date.now();
const newMessage = reactive({ id: messageId, type: "ai-main", displayContent: "" });
messages.push(newMessage);
const resp = await fetch("http://118.31.7.2:9868/api/bigModule/createArticleByAi", {
const resp = await fetch("http://120.79.54.255:9868/api/bigModule/createArticleByAi", {
method: "POST",
headers: {
"Content-Type": "application/json",

@ -213,7 +213,7 @@ const downloadArticle=()=>{
return proxy.$modal.msgWarning("请先完成上一步")
}
answerRecord.value=2
window.open(`http://118.31.7.2:9868/api/stu/experimental/downloadImg?userId=${JSON.parse(getUserInfo()).userId}&TOKEN=${getToken()}`)
window.open(`http://120.79.54.255:9868/api/stu/experimental/downloadImg?userId=${JSON.parse(getUserInfo()).userId}&TOKEN=${getToken()}`)
}
// 识别文字

@ -2,7 +2,7 @@
<!-- <el-scrollbar ref="scrollbar" height="800px"> -->
<div class="main-top">
<span style="font-weight: bold; font-size: 18px; color: #3596eb">任务描述</span>
<p style="font-weight: 400; font-size: 12px; color: #e2e7ee !important">使用“购物车数据”,对所购商品进行购物篮分析(关联规则挖掘),其中min_support = 0.4,
<p style="font-weight: 400; font-size: 15px; color: #e2e7ee !important">使用“购物车数据”,对所购商品进行购物篮分析(关联规则挖掘),其中min_support = 0.4,
min_confidence = 0.5,最后将运行结果提交实训任务。</p>
</div>
<div class="main-but">
@ -363,6 +363,9 @@ const task = () => {
if(input.value!=="购物车数据表"){
errorNumber=1
}
if(input.value!=="购物车数据"){
errorNumber=1
}
portraitModel
.submit({
userId: JSON.parse(getUserInfo()).userId,

@ -27,14 +27,16 @@
</div>
</div>
<div class="main-right">
<el-table :data="tableData" style="width: 100%" :header-cell-style="headerCellStyle">
<el-table-column v-for="column in tableLabel" :key="column" :prop="column.prop" :label="column.label" align="center">
<template #default="{ row }">
{{ formatDate(row[column.prop]) ?? "..." }}
</template>
</el-table-column>
</el-table>
<pagination v-show="datatotal > 0" :total="datatotal" v-model:page="n_dataTableQuery.index" v-model:limit="n_dataTableQuery.size" @pagination="getSurface" style="margin-top: 10px" />
<el-scrollbar height="740px" style="padding: 20px">
<el-table :data="tableData" style="width: 100%" :header-cell-style="headerCellStyle">
<el-table-column v-for="column in tableLabel" :key="column" :prop="column" :label="column" align="center">
<template #default="{ row }">
{{ formatDate(row[column]) ?? "..." }}
</template>
</el-table-column>
</el-table>
<pagination v-show="datatotal > 0" :total="datatotal" v-model:page="n_dataTableQuery.index" v-model:limit="n_dataTableQuery.size" @pagination="getSurface" style="margin-top: 10px" />
</el-scrollbar>
</div>
</div>
</template>
@ -46,14 +48,16 @@ import useUserStore from "@/store/modules/user";
import useAlgorithmStore from "@/store/modules/algorithm.js";
const { proxy } = getCurrentInstance();
import { getUserInfo } from "@/utils/auth";
import { warn } from "vue";
const userInfo = JSON.parse(getUserInfo());
const loading = ref(false);
const fileData = ref(null);
const scrollbarHeight = ref(0);
const algorithmStore = useAlgorithmStore();
// 数据表query
const n_dataTableQuery = ref({
index: 1,
size: 7,
size: 15,
tableName: "",
userId: userInfo.userId,
});
@ -62,42 +66,19 @@ const nzIndex = ref(0);
const nzData = ref([]);
const zjIndex = ref(-1);
const zjData = ref([]);
const tableLabel = ref([
{ prop: "id", label: "ID" },
{ prop: "age", label: "年龄" },
{ prop: "annualIncome", label: "年收入" },
{ prop: "spendingScore", label: "消费水平" },
]);
const tableLabel3 = ref([
{ prop: "id", label: "ID" },
{ prop: "content", label: "评论内容" },
{ prop: "creationTime", label: "评论时间" },
{ prop: "nickName", label: "昵称" },
{ prop: "referenceName", label: "评论对象" },
{ prop: "contentType", label: "评论类型" },
]);
const tableLabel4 = ref([
{ prop: "id", label: "ID" },
{ prop: "salesVolume", label: "销售量" },
{ prop: "salesForehead", label: "销售额" },
]);
const tableLabel5 = ref([
{ prop: "id", label: "ID" },
{ prop: "consumerGoods", label: "消费商品" },
]);
const tableLabel = ref([]);
const tableLabel2 = ref([]);
const arrhander = ref([]);
const arrhanderkey = ref([]);
const arrMap = {
客户细分数据表: tableLabel.value,
销售预测数据表: tableLabel4.value,
购物车数据表: tableLabel5.value,
用户评论表: tableLabel3.value,
};
// const arrMap = {
// 客户细分数据表: tableLabel.value,
// 销售预测数据表: tableLabel4.value,
// 购物车数据表: tableLabel5.value,
// 用户评论表: tableLabel3.value,
// };
const goNZ = (index, item) => {
nzIndex.value = index;
tableLabel.value = arrMap[item];
// tableLabel.value = arrMap[item];
n_dataTableQuery.value.tableName = item;
delete n_dataTableQuery.value.selfTableName;
getSurface();
@ -125,6 +106,7 @@ const getSurface = () => {
portraitModel
.getUserTableData(n_dataTableQuery.value)
.then((res) => {
tableLabel.value = Object.keys(res?.data?.list[0]);
tableData.value = res?.data?.list;
datatotal.value = res?.data?.total;
tableLabel2.value = [];
@ -137,7 +119,7 @@ const getSurface = () => {
label: item,
});
});
tableLabel.value = tableLabel2.value;
tableLabel.value = arrhanderkey.value;
}
setTimeout(() => {
loading.value = false;
@ -172,6 +154,7 @@ const importData = (e) => {
const selectZJ = (item) => {
portraitModel.getUserTableInfo({ userId: userInfo.userId }).then((res) => {
nzData.value = res.data.tableNames;
console.log(tableLabel.value, " tableLabel.value");
n_dataTableQuery.value.tableName = nzData.value[0];
getSurface();
algorithmStore.userDataLabel = [...res?.data.tableNames, ...res.data.selfBuiltTable].filter((item) => item !== "用户评论表");
@ -191,13 +174,12 @@ onMounted(() => {
<style lang="scss" scoped>
.app-main {
// background-color: #f5f5f5;
margin: 20px 20px 0;
height: calc(100vh - 150px);
display: flex;
overflow: auto;
// width: 100%;
.main-left {
width: 205px;
width: 12.3rem;
height: 100%;
background: #041c49;
.left-top {
@ -273,12 +255,9 @@ onMounted(() => {
}
}
.main-right {
width: 1639px;
width: calc(100% - 12.3rem);
height: 100%;
padding: 20px;
// background: #001D40;
border: 1px solid #0452c6;
// opacity: 0.5;
}
}
:deep(.el-table__header) {
@ -294,4 +273,8 @@ onMounted(() => {
color: #e6e6e6;
}
}
:deep(.pagination-container .el-pagination) {
// 去除定位
position: static;
}
</style>

@ -2,7 +2,7 @@
<!-- <el-scrollbar ref="scrollbar" height="800px"> -->
<div class="main-top">
<span style="font-weight: bold; font-size: 18px; color: #3596eb">任务描述</span>
<p style="font-weight: 400; font-size: 12px; color: #e6e6e6">使用“客户细分数据”,对客户进行聚类分析,并提交实训任务。</p>
<p style="font-weight: 400; font-size: 15px; color: #e6e6e6">使用“客户细分数据”,对客户进行聚类分析,并提交实训任务。</p>
</div>
<div class="main-but">
<el-button @click="algorithmicKnowledge()">

@ -1,7 +1,7 @@
<template>
<div class="main-top">
<span style="font-weight: bold; font-size: 18px; color: #3596eb">任务描述</span>
<p style="font-weight: 400; font-size: 12px; color: #e2e7ee !important">使用“客户细分数据”,对“消费得分(Spending Score)”指标进行描述性统计分析,并提交实训任务。</p>
<p style="font-weight: 400; font-size: 15px; color: #e2e7ee !important">使用“客户细分数据”,对“消费得分(Spending Score)”指标进行描述性统计分析,并提交实训任务。</p>
</div>
<div class="main-but">
<el-button @click="knowledgeImport">
@ -93,7 +93,7 @@
</el-scrollbar>
</div>
</div>
<el-dialog v-model="dialogVisible" title="实训任务提交" width="565" custom-class="dialogClass" :show-close="false">
<el-dialog v-model="dialogVisible" title="实训任务提交" width="565" custom-class="dialogClass" :show-close="false" @close="closeDialog">
<template #header="{ close, titleId, titleClass }">
<div class="my-header">
<span :id="titleId" :class="titleClass">实训任务提交</span>
@ -254,13 +254,13 @@ const b_introductionOfAlgorithmKnowledge = ref(false);
const runResultShow = ref(false);
const n_dataTableQuery = ref({
index: 1,
size: 5,
size: 10,
tableName: algorithmStore.userDataLabel[0],
userId: userInfo.userId,
});
const gAnalysisResults = ref({
index: 1,
size: 5,
size: 10,
});
const dialogVisible = ref(false);
// 模型参数
@ -409,7 +409,7 @@ const submit = () => {
if (res.data.length > 5) {
n_analyzeTheNumberOfDataItems.value = res.data.length;
aAnalyzeTheRawData.value = res.data;
analysisData.value = res.data.slice(0, 5);
analysisData.value = res.data.slice(0, 10);
}
proxy.$modal.msgSuccess("分析数据成功");
});
@ -481,7 +481,7 @@ const submitTask = () => {
if (Number(formInline.value[key]) != g_taskAnswer.value[key]) {
const label = tableLabel.find((item) => item.prop == key);
flat.value = true;
proxy.$modal.msgWarning(`${label.label}错误`);
// proxy.$modal.msgWarning(`${label.label}错误`);
}
}
}
@ -493,7 +493,11 @@ const submitTask = () => {
})
.then((res) => {
dialogVisible.value = false;
flat.value = false;
proxy.$modal.msgSuccess("提交成功");
})
.catch((err) => {
flat.value = false;
});
};
// 重新开始
@ -533,6 +537,7 @@ const updatePageAnalysisResults = () => {
};
// 下载
const download = () => {
if (tableData.value.length == 0) return proxy.$modal.msgWarning("请先计算数据!");
aOriginalDataOfAnalysisResults2.value.forEach((item) => {
item.statistics.field = item.field;
for (let key in item.statistics) {
@ -553,6 +558,13 @@ const download = () => {
proxy.$modal.msgSuccess("下载成功");
});
};
const closeDialog=()=>{
dialogVisible.value = false;
flat.value = false
for (let key in formInline.value) {
formInline.value[key] = "";
}
}
</script>
<style lang="scss" scoped>

@ -1,7 +1,7 @@
<template>
<div class="main-top">
<span style="font-weight: bold; font-size: 18px; color: #3596eb">任务描述</span>
<p style="font-weight: 400; font-size: 12px; color: #e2e7ee !important">使用“用户商品评论数据”,进行各类文本挖掘任务,分析评论情感情绪,最后提交实训任务。</p>
<p style="font-weight: 400; font-size: 15px; color: #e2e7ee !important">使用“用户商品评论数据”,进行各类文本挖掘任务,分析评论情感情绪,最后提交实训任务。</p>
</div>
<div class="main-but">
<el-button @click="knowledgeImport">
@ -69,7 +69,9 @@
<el-scrollbar height="550px" style="padding: 20px">
<div>
<span style="font-weight: bold; font-size: 18px; color: #3596eb">分析数据:</span>
<div class="text-type" v-show="preProcessText.text3 == '评论观点抽取'">
<el-button :class="s_commentType == text.id ? 'btnActive' : ''" v-for="text in textType" :key="text" type="primary" plain @click="commentType(text)">{{ text.name }}</el-button>
</div>
<div class="analysis">
<el-input v-model="g_analyzeTheNumberOfDataItems" :rows="2" type="textarea" placeholder="" />
</div>
@ -120,7 +122,7 @@
<div class="emotion_analysis_title">{{ g_emotionAnalysis == 0 ? "情感偏负向" : g_emotionAnalysis == 1 ? "情感偏中性" : "情感偏正向" }}</div>
</div>
</div>
<div ref="captureElement" class="comment-opinion" v-if="preProcessText.text3 == '评论观点抽取'">
<!-- <div ref="captureElement" class="comment-opinion" v-if="preProcessText.text3 == '评论观点抽取'">
<div class="result" v-for="(item, sentiment) in aCommentOpinion" :key="item.abstract">
<div class="result-pos" :class="sentiment == 0 ? 'result-neg' : sentiment == 1 ? 'result-neutral' : 'result-img'"></div>
<div class="result-title">{{ sentiment == 0 ? "负向评价" : sentiment == 1 ? "中性评价" : "正向评价" }}:</div>
@ -133,12 +135,22 @@
<div class="result-bar"></div>
</div>
</div>
</div> -->
<div ref="captureElement" class="comment-opinion" v-if="preProcessText.text3 == '评论观点抽取'">
<div class="result" v-for="(item, sentiment) in aCommentOpinion" :key="item.abstract">
<div class="result-pos" :class="sentiment == 0 ? 'result-neg' : sentiment == 1 ? 'result-neutral' : 'result-img'"></div>
<div class="result-title">{{ sentiment == 0 ? "负向评价" : sentiment == 1 ? "中性评价" : "正向评价" }}:</div>
<div class="result-view" v-for="items in item" :key="items">
{{ items.prop + items.adj }}
<div class="result-bar"></div>
</div>
</div>
</div>
</div>
</el-scrollbar>
</div>
</div>
<el-dialog v-model="dialogVisible" title="实训任务提交" width="700" custom-class="dialogClass" :show-close="false">
<el-dialog v-model="dialogVisible" title="实训任务提交" width="700" custom-class="dialogClass" :show-close="false" @close="closeDialog">
<template #header="{ close, titleId, titleClass }">
<div class="my-header">
<span :id="titleId" :class="titleClass">实训任务提交</span>
@ -503,13 +515,14 @@ const downloadStatus = ref(false);
//提交校验
const flat = ref(false);
const g_submitVerification = ref({
max: "13",
frequency: "3",
text1: "质量",
text2: "包装好",
max: "安装",
frequency: "6",
text1: "",
text2: "",
emotional: "负向",
prominent: "的",
prominent: "安装",
});
const s_commentType = ref("");
// 预处理
const preProcess = (tetx) => {
if (g_indicatorData.value.length == 0) {
@ -598,9 +611,15 @@ const submitTask = () => {
return;
} else {
if (formInline.value[key] != g_submitVerification.value[key]) {
const label = tableLabel.find((item) => item.prop == key);
proxy.$modal.msgWarning(`${label.label}错误`);
flat.value = true;
// 判断text1或text2只要输入包装好,好评少就行顺序不重要
if (key == "text1" || key == "text2") {
const validTexts = ["text1", "text2"];
if (validTexts.includes(key) && !["包装好", "好评少"].includes(formInline.value[key])) {
flat.value = true;
}
} else {
flat.value = true;
}
}
}
}
@ -648,6 +667,8 @@ const restart = () => {
nOriginalWordFrequencyNum.value = 0;
aWordFrequency.value = [];
nOriginalWordFrequency.value = [];
s_commentType.value = "";
aCommentOpinion.value = "";
proxy.$modal.msgSuccess("重新开始!");
multipleTableRef.value.clearSelection();
};
@ -709,7 +730,9 @@ const sentimentAnalysis = () => {
if (preProcessText.value.text2 == "") return proxy.$modal.msgWarning("请先对数据进行预处理!");
}
if (preProcessText.value.text3 == "") return proxy.$modal.msgWarning("请先选择模型!");
if (preProcessText.value.text3 === "评论观点抽取" && s_commentType.value == "") {
return proxy.$modal.msgWarning("请先选择评论类型!");
}
if (g_analyzeTheNumberOfDataItems.value == "") return proxy.$modal.msgWarning("请先选择指标/手动输入进行情感分析!");
loading.value = true;
if (preProcessText.value.text3 === "情感倾向分析") {
@ -740,7 +763,7 @@ const sentimentAnalysis = () => {
.catch((err) => {
loading.value = false;
});
} else if (preProcessText.value.text3 !== "评论观点抽取") {
} else if (preProcessText.value.text3 !== "情感倾向分析") {
marketingAlgorithmApi
.getMarketingAlgorithmSentiment({ userId: n_dataTableQuery.value.userId, content: g_analyzeTheNumberOfDataItems.value, modelType: preProcessText.value.text3 == "词云生成" ? "词频分析" : preProcessText.value.text3 })
.then((res) => {
@ -751,33 +774,18 @@ const sentimentAnalysis = () => {
nOriginalWordFrequency.value = res.data;
aWordFrequency.value = res.data.slice(0, 5);
nOriginalWordFrequencyNum.value = res.data.length;
} else {
aCommentOpinion.value = JSON.parse(res.data).items.reduce((groups, item) => {
// 如果该 sentiment 的组不存在,则创建
if (!groups[item.sentiment]) {
groups[item.sentiment] = [];
}
// 将 item 加入到相应的组中
groups[item.sentiment].push(item);
return groups;
}, {});
}
downloadStatus.value = true;
g_submitVerification.value.n_maximumQuantity = nOriginalWordFrequency.value.reduce((longest, current) => {
return current.keyword.length > longest.keyword.length ? current.keyword : longest.keyword;
}, nOriginalWordFrequency.value[0]);
g_submitVerification.value.n_frequency = nOriginalWordFrequency.value.reduce((longest, current) => {
return item.frequency > max.frequency ? item.n_frequency : max.n_frequency;
}, nOriginalWordFrequency.value[0]);
console.log(g_submitVerification.value, "g_submitVerification.value.");
loading.value = false;
proxy.$modal.msgSuccess("分析成功");
})
.catch((err) => {
loading.value = false;
});
} else {
portraitModel
.getCommentPoint(JSON.stringify({ text: g_analyzeTheNumberOfDataItems.value }))
.then((res) => {
aCommentOpinion.value = res.singleAnalysisResult.reduce((groups, item) => {
if (!groups[item.sentiment == "正向" ? 2 : 0]) {
groups[item.sentiment == "正向" ? 2 : 0] = [];
}
groups[item.sentiment == "正向" ? 2 : 0].push(item);
return groups;
}, {});
downloadStatus.value = true;
loading.value = false;
proxy.$modal.msgSuccess("分析成功");
})
@ -785,6 +793,25 @@ const sentimentAnalysis = () => {
loading.value = false;
});
}
// else {
// portraitModel
// .getCommentPoint(JSON.stringify({ text: g_analyzeTheNumberOfDataItems.value }))
// .then((res) => {
// aCommentOpinion.value = res.singleAnalysisResult.reduce((groups, item) => {
// if (!groups[item.sentiment == "正向" ? 2 : 0]) {
// groups[item.sentiment == "正向" ? 2 : 0] = [];
// }
// groups[item.sentiment == "正向" ? 2 : 0].push(item);
// return groups;
// }, {});
// downloadStatus.value = true;
// loading.value = false;
// proxy.$modal.msgSuccess("分析成功");
// })
// .catch((err) => {
// loading.value = false;
// });
// }
};
// 清空
const clear = () => {
@ -793,6 +820,8 @@ const clear = () => {
aWordFrequency.value = [];
loading.value = false;
downloadStatus.value = false;
aCommentOpinion.value = [];
s_commentType.value = "";
proxy.$modal.msgSuccess("清空成功");
};
const initChart = () => {
@ -809,6 +838,8 @@ const initChart = () => {
x: "center",
textStyle: {
fontSize: 23,
color: "#000000",
},
},
backgroundColor: "#ffffff",
@ -826,24 +857,24 @@ const initChart = () => {
},
},
},
series: [
{
name: "词云分析",
type: "wordCloud",
// //size: ['9%', '99%'],
sizeRange: [6, 66],
// //textRotation: [0, 45, 90, -45],
rotationRange: [-45, 90],
// //shape: 'circle',
// gridSize: 5,
// sizeRange: [12, 32],
width: "90%",
height: "86%",
textPadding: 0,
size: ["9%", "99%"],
sizeRange: [33, 80], // 调整大小范围
textRotation: [0, 45, 90, -45],
rotationRange: [-90, 90], // 增大旋转角度范围
shape: "circle",
gridSize: 5, // 减小间距
sizeRange: [33, 80], // 调整大小范围
width: "100%", // 铺满容器宽度
height: "100%", // 铺满容器高度
textPadding: 10, // 减少内边距
autoSize: {
enable: true,
minSize: 16,
minSize: 33, // 设置最小尺寸
maxSize: 80, // 设置最大尺寸
},
textStyle: {
color: function () {
@ -859,7 +890,6 @@ const initChart = () => {
],
});
};
const wordFrequencyNext = () => {
if (mWordFrequency.value.frequency !== "" || mWordFrequency.value.namenum !== "") {
wordFrequencySearch();
@ -892,7 +922,18 @@ const switchingModels = () => {
mWordFrequency.value.size = 5;
mWordFrequency.value.frequency = "";
mWordFrequency.value.namenum = "";
s_commentType.value = "";
};
const commentType = (text) => {
s_commentType.value = text.id;
};
const closeDialog=()=>{
dialogVisible.value = false;
flat.value = false
for (let key in formInline.value) {
formInline.value[key] = "";
}
}
</script>
<style lang="scss" scoped>

@ -2,7 +2,7 @@
<!-- <el-scrollbar ref="scrollbar" height="800px"> -->
<div class="main-top">
<span style="font-weight: bold; font-size: 18px; color: #3596eb">任务描述</span>
<p style="font-weight: 400; font-size: 12px; color: #e6e6e6">使用“销售预测数据”,建立回归模型,并预测销量是84610下的销售额,最后提交实训任务。</p>
<p style="font-weight: 400; font-size: 15px; color: #e6e6e6">使用“销售预测数据”,建立回归模型,并预测销量是84610下的销售额,最后提交实训任务。</p>
</div>
<div class="main-but">
<el-button @click="runResultShow = true">

@ -476,7 +476,7 @@ const uploadReport = async (id) => {
if (!id) {
return;
}
window.open(`http://118.31.7.2:9868/api/stu/concept/block/download?TOKEN=${"Bearer " + getToken()}&id=${id}`);
window.open(`http://120.79.54.255:9868/api/stu/concept/block/download?TOKEN=${"Bearer " + getToken()}&id=${id}`);
// window.open(`http://202.97.179.126:8800/api/stu/concept/block/download?reportName=${tableData2.value[0].reportName}&TOKEN= ${'Bearer '+getToken()}&module=${data2.module}&userId=${data.userId}`)
// window.open(`http://202.199.90.115:8800/api/stu/concept/block/download?reportName=${tableData2.value[0].reportName}&TOKEN= ${'Bearer '+getToken()}&module=${data2.module}&userId=${data.userId}`)
};

@ -3,15 +3,15 @@
<el-scrollbar :height="height + 'px'" always style="padding-right: 15px">
<div class="main">
<el-row :gutter="40">
<el-col :span="3" v-for="i in item" :key="i">
<el-col :span="3" v-for="i in item" :key="i" @click="showResource(i)">
<div class="zs">
<div class="el_top">
<a target="_blank" @click="showResource(i.resourcesUrl)">
<a target="_blank">
<span>{{ i.resourcesName }}</span>
</a>
</div>
<div class="el_bon">
<a target="_blank" @click="showResource(i.resourcesUrl)">
<a target="_blank">
<img data-src="https://jrdsj.sztzjy.com:598/assets/%E5%AD%A6%E4%B9%A0%E8%B5%84%E6%BA%90-1.a6a80357.png" :src="getImg(i.resourcesImg)" />
</a>
</div>
@ -22,11 +22,12 @@
</el-scrollbar>
</div>
</template>
<script setup>
<script setup name="learningResources">
import cache from "@/plugins/cache";
import * as API from "@/api/prtrait/prtrait.js";
import { getAssetsFile } from "@/utils";
import { getUserInfo } from "@/utils/auth";
import { computed, onMounted } from "vue";
const getImg = (i) => {
return getAssetsFile(i);
};
@ -50,42 +51,43 @@ onMounted(() => {
});
const showResource = async (i) => {
await cache.session.set("video_history", JSON.stringify(i));
setTimeout(() => {
window.open("/video", "_blank");
}, 300);
// const newWindow=window.open(`http://192.168.2.4:8800/api/stu/concept/block/getResource?`+`module=${data2.module}`+`&name=${i}`)
// window.open(`http://qkljr.sztzjy.com:90/api/stu/concept/block/getResource?`+`module=${data2.module}`+`&name=${i}`)
if (i.includes("mp4")) {
const newWindow = window.open("", "_blank");
newWindow.document.write(`
<html>
<head>
<title>视频播放</title>
<style>
body {
margin: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #333333;
}
video {
width: 90%;
// max-width: 800px;
}
</style>
</head>
<body>
<video controls autoplay controlsList="nodownload">
<source src="http://118.31.7.2:8042/file/${i}" type="video/mp4">
</video>
</body>
</html>
`);
}
if (i.includes("pdf")) {
// window.open(`http://qkljr.sztzjy.com:90/api/stu/concept/block/getResource?`+`module=${data2.module}`+`&name=${i}#toolbar=0`)
window.open(`http://118.31.7.2:8042/file/${i}#toolbar=0`);
// window.open(`http://202.199.90.115:8800/api/stu/concept/block/getResource?`+`module=${data2.module}`+`&name=${i}`)
}
// if (i.includes("mp4")) {
// const newWindow = window.open("", "_blank");
// newWindow.document.write(`
// <html>
// <head>
// <title>视频播放</title>
// <style>
// // body {
// // margin: 0;
// // display: flex;
// // justify-content: center;
// // align-items: center;
// // height: 100vh;
// // background-color: #333333;
// // }
// </style>
// </head>
// <body>
// // <video controls autoplay controlsList="nodownload">
// // <source src="http://118.31.7.2:8042/file/${i}" type="video/mp4">
// // </video>
// </body>
// </html>
// `);
// }
// if (i.includes("pdf")) {
// // window.open(`http://qkljr.sztzjy.com:90/api/stu/concept/block/getResource?`+`module=${data2.module}`+`&name=${i}#toolbar=0`)
// window.open(`http://118.31.7.2:8042/file/${i}#toolbar=0`);
// // window.open(`http://202.199.90.115:8800/api/stu/concept/block/getResource?`+`module=${data2.module}`+`&name=${i}`)
// }
};
const timer = ref(null);
let seconds = 0;

@ -1,5 +1,5 @@
<template>
<div class="login" v-loading="loading">
<div class="login" v-loading="loadpage">
<div class="login-main">
<el-form ref="loginRef" :model="loginForm" :rules="loginRules" class="login-form">
<h3 class="title">数字营销</h3>
@ -47,32 +47,34 @@ const loginForm = ref({
username: "",
password: "",
rememberMe: false,
code: "",
uuid: "",
TOKEN: "",
});
const loginRules = {
username: [{ required: true, trigger: "blur", message: "请输入您的账号" }],
password: [{ required: true, trigger: "blur", message: "请输入您的密码" }],
code: [{ required: true, trigger: "change", message: "请输入验证码" }],
};
const codeUrl = ref("");
const loading = ref(false);
const loadpage = ref(false);
// 验证码开关
const captchaEnabled = ref(true);
// 注册开关
const register = ref(false);
const redirect = ref(undefined);
watch(
route,
(newRoute) => {
redirect.value = newRoute.query && newRoute.query.redirect;
if (newRoute.query.token) {
loadpage.value = true;
setTimeout(() => {
loginForm.value.TOKEN = newRoute.query.token;
return handleLogin();
}, 1000);
}
},
{ immediate: true }
);
function handleLogin() {
// proxy.$refs.loginRef.validate(valid => {
// if (valid) {
@ -100,29 +102,19 @@ function handleLogin() {
router.push({ path: redirect.value || "/index" });
if (params.token) {
setTimeout(() => {
loadpage.value = false;
loading.value = false;
}, 3000);
} else {
loadpage.value = false;
loading.value = false;
}
})
.catch(() => {
loadpage.value = false;
loading.value = false;
});
// }
// });
}
// function getCode() {
// getCodeImg().then(res => {
// captchaEnabled.value = res.captchaEnabled === undefined ? true : res.captchaEnabled;
// if (captchaEnabled.value) {
// codeUrl.value = "data:image/gif;base64," + res.img;
// loginForm.value.uuid = res.uuid;
// }
// });
// }
function getCookie() {
const username = Cookies.get("username");
const password = Cookies.get("password");
@ -133,7 +125,6 @@ function getCookie() {
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe),
};
}
// getCode();
getCookie();
</script>

File diff suppressed because one or more lines are too long

@ -896,10 +896,10 @@ const saveData = () => {
stepEightB: step4Data.value[1].params,
stepEightC: step4Data.value[2].params,
stepEightD: step4Data.value[3].params,
// stepNineA: step4Data.value[0].params1,
// stepNineB: step4Data.value[0].params2,
// stepNineC: step4Data.value[0].params3,
// stepNineD: step4Data.value[1].params1,
stepNineA: chartParam1.value,
stepNineB: chartParam2.value,
stepNineC: chartParam3.value,
stepNineD: chartParam4.value,
// stepTenA: step4Data.value[1].params2,
// stepTenB: step4Data.value[1].params3,
// stepTenC: step4Data.value[2].params1,
@ -930,6 +930,59 @@ const saveData = () => {
.then((res) => {})
.catch((error) => {});
};
const saveDataSubmit = () => {
const params = {
stepFiveA: step1Data.value[0].params,
stepFiveB: step1Data.value[1].params,
stepFiveC: step1Data.value[2].params,
stepFiveD: step1Data.value[3].params,
stepSixA: step3Data.value[0].params1,
stepSixB: step3Data.value[0].params2,
stepSixC: step3Data.value[1].params1,
stepSixD: step3Data.value[1].params2,
stepSevenA: step3Data.value[2].params1,
stepSevenB: step3Data.value[2].params2,
stepSevenC: step3Data.value[3].params1,
stepSevenD: step3Data.value[3].params2,
stepEightA: step4Data.value[0].params,
stepEightB: step4Data.value[1].params,
stepEightC: step4Data.value[2].params,
stepEightD: step4Data.value[3].params,
stepNineA: chartParam1.value,
stepNineB: chartParam2.value,
stepNineC: chartParam3.value,
stepNineD: chartParam4.value,
// stepTenA: step4Data.value[1].params2,
// stepTenB: step4Data.value[1].params3,
// stepTenC: step4Data.value[2].params1,
// stepTenD: step4Data.value[2].params2,
// stepElevenA: step4Data.value[2].params3,
// stepOneA: step5Data.value[0].params1,
// stepOneB: step5Data.value[0].params2,
// stepOneC: step5Data.value[0].params3,
// stepOneD: step6Data.value[0].params1,
// stepTwoA: step6Data.value[0].params2,
// stepTwoB: step6Data.value[0].params3,
// stepTwoC: step6Data.value[1].params1,
// stepThreeA: step6Data.value[1].params2,
// stepThreeB: step6Data.value[1].params3,
// stepThreeC: step6Data.value[2].params1,
// stepThreeD: step6Data.value[2].params2,
// stepFourA: step6Data.value[2].params3,
// stepFourB: step7Data.value[0].params,
// stepFourC: step7Data.value[1].params,
// stepFourD: step7Data.value[2].params,
};
portraitModel
.saveData({
userId: JSON.parse(getUserInfo()).userId,
module: "帕累托/ABC分析",
...params,
subState: 1,
})
.then((res) => {})
.catch((error) => {});
};
const getData = () => {
portraitModel
.getData({
@ -953,10 +1006,28 @@ const getData = () => {
step4Data.value[1].params = res.data.stepEightB;
step4Data.value[2].params = res.data.stepEightC;
step4Data.value[3].params = res.data.stepEightD;
// step4Data.value[0].params1 = res.data.stepNineA;
// step4Data.value[0].params2 = res.data.stepNineB;
// step4Data.value[0].params3 = res.data.stepNineC;
// step4Data.value[1].params1 = res.data.stepNineD;
chartParam1.value = res.data.stepNineA;
chartParam2.value = res.data.stepNineB;
chartParam3.value = res.data.stepNineC;
chartParam4.value = res.data.stepNineD;
//将所填值同步到第二步表格
step2Data.value[0].amount = step1Data.value[0].params;
step2Data.value[1].amount = step1Data.value[1].params;
step2Data.value[2].amount = step1Data.value[2].params;
step2Data.value[3].amount = step1Data.value[3].params;
if (res.data.subState & (res.data.subState == 1)) {
step4Data.value[0].data2 = step3Data.value[0].data2;
step4Data.value[1].data2 = step3Data.value[1].data2;
step4Data.value[2].data2 = step3Data.value[2].data2;
step4Data.value[3].data2 = step3Data.value[3].data2;
step4Data.value[0].data3 = step3Data.value[0].params2;
step4Data.value[1].data3 = step3Data.value[1].params2;
step4Data.value[2].data3 = step3Data.value[2].params2;
step4Data.value[3].data3 = step3Data.value[3].params2;
step2AnswerFlag.value = true;
step3AnswerFlag.value = true;
initCharts();
}
// step4Data.value[1].params2 = res.data.stepTenA;
// step4Data.value[1].params3 = res.data.stepTenB;
// step4Data.value[2].params1 = res.data.stepTenC;
@ -977,6 +1048,92 @@ const getData = () => {
// step7Data.value[0].params = res.data.stepFourB;
// step7Data.value[1].params = res.data.stepFourC;
// step7Data.value[2].params = res.data.stepFourD;
//回显答案
if (res.data.subState & (res.data.subState == 1)) {
showAnswerFlag.value = true;
if (step1Data.value[0].params && step1Data.value[0].params !== "5900") {
step1Data.value[0].isError = true;
} else {
step1Data.value[0].isError = false;
}
if (step1Data.value[1].params && step1Data.value[1].params !== "600") {
step1Data.value[1].isError = true;
} else {
step1Data.value[1].isError = false;
}
if (step1Data.value[2].params && step1Data.value[2].params !== "1100") {
step1Data.value[2].isError = true;
} else {
step1Data.value[2].isError = false;
}
if (step1Data.value[3].params && step1Data.value[3].params !== "2400") {
step1Data.value[3].isError = true;
} else {
step1Data.value[3].isError = false;
}
if (step3Data.value[0].params1 && step3Data.value[0].params1 !== "59") {
step3Data.value[0].isError1 = true;
} else {
step3Data.value[0].isError1 = false;
}
if (step3Data.value[0].params2 && step3Data.value[0].params2 !== "59") {
step3Data.value[0].isError2 = true;
} else {
step3Data.value[0].isError2 = false;
}
if (step3Data.value[1].params1 && step3Data.value[1].params1 !== "24") {
step3Data.value[1].isError1 = true;
} else {
step3Data.value[1].isError1 = false;
}
if (step3Data.value[1].params2 && step3Data.value[1].params2 !== "83") {
step3Data.value[1].isError2 = true;
} else {
step3Data.value[1].isError2 = false;
}
if (step3Data.value[2].params1 && step3Data.value[2].params1 !== "11") {
step3Data.value[2].isError1 = true;
} else {
step3Data.value[2].isError1 = false;
}
if (step3Data.value[2].params2 && step3Data.value[2].params2 !== "94") {
step3Data.value[2].isError2 = true;
} else {
step3Data.value[2].isError2 = false;
}
if (step3Data.value[3].params1 && step3Data.value[3].params1 !== "6") {
step3Data.value[3].isError1 = true;
} else {
step3Data.value[3].isError1 = false;
}
if (step3Data.value[3].params2 && step3Data.value[3].params2 !== "100") {
step3Data.value[3].isError2 = true;
} else {
step3Data.value[3].isError2 = false;
}
if (step4Data.value[0].params && step4Data.value[0].params !== "A类商品") {
step4Data.value[0].isError = true;
} else {
step4Data.value[0].isError = false;
}
if (step4Data.value[1].params && step4Data.value[1].params !== "B类商品") {
step4Data.value[1].isError = true;
} else {
step4Data.value[1].isError = false;
}
if (step4Data.value[2].params && step4Data.value[2].params !== "C类商品") {
step4Data.value[2].isError = true;
} else {
step4Data.value[2].isError = false;
}
if (step4Data.value[3].params && step4Data.value[3].params !== "C类商品") {
step4Data.value[3].isError = true;
} else {
step4Data.value[3].isError = false;
}
}
})
.catch((error) => {});
};
@ -1002,34 +1159,40 @@ const submitData = () => {
.then((res) => {
proxy.$modal.msgSuccess("提交成功");
showAnswerFlag.value = true;
saveDataSubmit();
})
.catch((error) => {});
};
const retrain = () => {
portraitModel
.retrain({
userId: JSON.parse(getUserInfo()).userId,
module: "帕累托/ABC分析",
})
.then((res) => {
proxy.$modal.msgSuccess("重新实训成功");
for (let i in step1Data.value) {
step1Data.value[i].params = "";
}
for (let i in step3Data.value) {
step3Data.value[i].params1 = "";
step3Data.value[i].params2 = "";
}
for (let i in step4Data.value) {
step4Data.value[i].params = "";
}
// for (let i in step5Data.value) {
// step5Data.value[i].params1 = "";
// step5Data.value[i].params2 = "";
// step5Data.value[i].params3 = "";
// }
})
.catch((error) => {});
showAnswerFlag.value = false;
// portraitModel
// .retrain({
// userId: JSON.parse(getUserInfo()).userId,
// module: "帕累托/ABC分析",
// })
// .then((res) => {
proxy.$modal.msgSuccess("重新实训成功");
for (let i in step1Data.value) {
step1Data.value[i].params = "";
}
for (let i in step3Data.value) {
step3Data.value[i].params1 = "";
step3Data.value[i].params2 = "";
}
for (let i in step4Data.value) {
step4Data.value[i].params = "";
}
// for (let i in step5Data.value) {
// step5Data.value[i].params1 = "";
// step5Data.value[i].params2 = "";
// step5Data.value[i].params3 = "";
// }
chartParam1.value = "";
chartParam2.value = "";
chartParam3.value = "";
chartParam4.value = "";
// })
// .catch((error) => {});
};
defineExpose({
submitData,

@ -749,7 +749,7 @@ const step4Submit = () => {
if (step4Data.value[5].params && step4Data.value[5].params !== "负向效果") {
step4Error.value++;
step4Data.value[5].isError = true;
}else{
} else {
step4Data.value[5].isError = false;
}
// console.log(666);
@ -809,6 +809,59 @@ const saveData = () => {
.then((res) => {})
.catch((error) => {});
};
const saveDataSubmit = () => {
const params = {
stepFiveA: list.value.join(","),
stepFiveB: step2Data.value[0].params,
stepFiveC: step2Data.value[1].params,
stepFiveD: step2Data.value[2].params,
stepSixA: step2Data.value[3].params,
stepSixB: step3Data.value[0].params1,
stepSixC: step3Data.value[0].params2,
stepSixD: step3Data.value[0].params3,
stepSevenA: step3Data.value[1].params1,
stepSevenB: step3Data.value[1].params2,
stepSevenC: step3Data.value[1].params3,
stepSevenD: step3Data.value[2].params1,
stepEightA: step3Data.value[2].params2,
stepEightB: step3Data.value[2].params3,
stepEightC: step3Data.value[3].params1,
stepEightD: step3Data.value[3].params2,
stepNineA: step3Data.value[3].params3,
stepNineB: step3Data.value[4].params1,
stepNineC: step3Data.value[4].params2,
stepNineD: step3Data.value[4].params3,
stepTenA: step3Data.value[5].params1,
stepTenB: step3Data.value[5].params2,
stepTenC: step3Data.value[5].params3,
stepTenD: step4Data.value[0].params,
stepElevenA: step4Data.value[1].params,
stepOneA: step4Data.value[2].params,
stepOneB: step4Data.value[3].params,
stepOneC: step4Data.value[4].params,
stepOneD: step4Data.value[5].params,
// stepTwoA: step6Data.value[0].params2,
// stepTwoB: step6Data.value[0].params3,
// stepTwoC: step6Data.value[1].params1,
// stepThreeA: step6Data.value[1].params2,
// stepThreeB: step6Data.value[1].params3,
// stepThreeC: step6Data.value[2].params1,
// stepThreeD: step6Data.value[2].params2,
// stepFourA: step6Data.value[2].params3,
// stepFourB: step7Data.value[0].params,
// stepFourC: step7Data.value[1].params,
// stepFourD: step7Data.value[2].params,
};
portraitModel
.saveData({
userId: JSON.parse(getUserInfo()).userId,
module: "购物篮分析",
...params,
subState: 1,
})
.then((res) => {})
.catch((error) => {});
};
const getData = () => {
portraitModel
.getData({
@ -860,6 +913,158 @@ const getData = () => {
// step7Data.value[1].params = res.data.stepFourC;
// step7Data.value[2].params = res.data.stepFourD;
// console.log(list.value);
//回显答案
if (res.data.subState & (res.data.subState == 1)) {
showAnswerFlag.value = true;
if (!isArrayContained(list.value, combinationRight.value)) {
comListError.value = true;
} else {
comListError.value = false;
}
if (step2Data.value[0].params && step2Data.value[0].params !== "60") {
step2Data.value[0].isError = true;
} else {
step2Data.value[0].isError = false;
}
if (step2Data.value[1].params && step2Data.value[1].params !== "60") {
step2Data.value[1].isError = true;
} else {
step2Data.value[1].isError = false;
}
if (step2Data.value[2].params && step2Data.value[2].params !== "80") {
step2Data.value[2].isError = true;
} else {
step2Data.value[2].isError = false;
}
if (step2Data.value[3].params && step2Data.value[3].params !== "60") {
step2Data.value[3].isError = true;
} else {
step2Data.value[3].isError = false;
}
if (step3Data.value[0].params1 && step3Data.value[0].params1 !== "40" && step3Data.value[0].params1 !== "40.00") {
step3Data.value[0].isError1 = true;
} else {
step3Data.value[0].isError1 = false;
}
if (step3Data.value[0].params2 && step3Data.value[0].params2 !== "66.67") {
step3Data.value[0].isError2 = true;
} else {
step3Data.value[0].isError2 = false;
}
if (step3Data.value[0].params3 && step3Data.value[0].params3 !== "111.11") {
step3Data.value[0].isError3 = true;
} else {
step3Data.value[0].isError3 = false;
}
if (step3Data.value[1].params1 && step3Data.value[1].params1 !== "20" && step3Data.value[1].params1 !== "20.00") {
step3Data.value[1].isError1 = true;
} else {
step3Data.value[1].isError1 = false;
}
if (step3Data.value[1].params2 && step3Data.value[1].params2 !== "33.33") {
step3Data.value[1].isError2 = true;
} else {
step3Data.value[1].isError2 = false;
}
if (step3Data.value[1].params3 && step3Data.value[1].params3 !== "41.67") {
step3Data.value[1].isError3 = true;
} else {
step3Data.value[1].isError3 = false;
}
if (step3Data.value[2].params1 && step3Data.value[2].params1 !== "40" && step3Data.value[2].params1 !== "40.00") {
step3Data.value[2].isError1 = true;
} else {
step3Data.value[2].isError1 = false;
}
if (step3Data.value[2].params2 && step3Data.value[2].params2 !== "60.00" && step3Data.value[2].params2 !== "60") {
step3Data.value[2].isError2 = true;
} else {
step3Data.value[2].isError2 = false;
}
if (step3Data.value[2].params3 && step3Data.value[2].params3 !== "100.00" && step3Data.value[2].params3 !== "100") {
step3Data.value[2].isError3 = true;
} else {
step3Data.value[2].isError3 = false;
}
if (step3Data.value[3].params1 && step3Data.value[3].params1 !== "20" && step3Data.value[3].params1 !== "20.00") {
step3Data.value[3].isError1 = true;
} else {
step3Data.value[3].isError1 = false;
}
if (step3Data.value[3].params2 && step3Data.value[3].params2 !== "33.33") {
step3Data.value[3].isError2 = true;
} else {
step3Data.value[3].isError2 = false;
}
if (step3Data.value[3].params3 && step3Data.value[3].params3 !== "41.67") {
step3Data.value[3].isError3 = true;
} else {
step3Data.value[3].isError3 = false;
}
if (step3Data.value[4].params1 && step3Data.value[4].params1 !== "20" && step3Data.value[4].params1 !== "20.00") {
step3Data.value[4].isError1 = true;
} else {
step3Data.value[4].isError1 = false;
}
if (step3Data.value[4].params2 && step3Data.value[4].params2 !== "33.33") {
step3Data.value[4].isError2 = true;
} else {
step3Data.value[4].isError2 = false;
}
if (step3Data.value[4].params3 && step3Data.value[4].params3 !== "55.56") {
step3Data.value[4].isError3 = true;
} else {
step3Data.value[4].isError3 = false;
}
if (step3Data.value[5].params1 && step3Data.value[5].params1 !== "40" && step3Data.value[5].params1 !== "40.00") {
step3Data.value[5].isError1 = true;
} else {
step3Data.value[5].isError1 = false;
}
if (step3Data.value[5].params2 && step3Data.value[5].params2 !== "50.00" && step3Data.value[5].params2 !== "50") {
step3Data.value[5].isError2 = true;
} else {
step3Data.value[5].isError2 = false;
}
if (step3Data.value[5].params3 && step3Data.value[5].params3 !== "83.33") {
step3Data.value[5].isError3 = true;
} else {
step3Data.value[5].isError3 = false;
}
if (step4Data.value[0].params && step4Data.value[0].params !== "提升效果") {
step4Data.value[0].isError = true;
} else {
step4Data.value[0].isError = false;
}
if (step4Data.value[1].params && step4Data.value[1].params !== "负向效果") {
step4Data.value[1].isError = true;
} else {
step4Data.value[1].isError = false;
}
if (step4Data.value[2].params && step4Data.value[2].params !== "没有影响") {
step4Data.value[2].isError = true;
} else {
step4Data.value[2].isError = false;
}
if (step4Data.value[3].params && step4Data.value[3].params !== "负向效果") {
step4Data.value[3].isError = true;
} else {
step4Data.value[3].isError = false;
}
if (step4Data.value[4].params && step4Data.value[4].params !== "负向效果") {
step4Data.value[4].isError = true;
} else {
step4Data.value[4].isError = false;
}
if (step4Data.value[5].params && step4Data.value[5].params !== "负向效果") {
step4Data.value[5].isError = true;
} else {
step4Data.value[5].isError = false;
}
}
})
.catch((error) => {});
};
@ -892,17 +1097,19 @@ const submitData = () => {
.then((res) => {
proxy.$modal.msgSuccess("提交成功");
showAnswerFlag.value = true;
saveDataSubmit();
})
.catch((error) => {});
};
const retrain = () => {
showAnswerFlag.value = false;
// console.log(66);
portraitModel
.retrain({
userId: JSON.parse(getUserInfo()).userId,
module: "购物篮分析",
})
.then((res) => {
// portraitModel
// .retrain({
// userId: JSON.parse(getUserInfo()).userId,
// module: "购物篮分析",
// })
// .then((res) => {
proxy.$modal.msgSuccess("重新实训成功");
list.value = ["-"];
for (let i in step2Data.value) {
@ -923,8 +1130,8 @@ const retrain = () => {
// step2Select5.value = "";
// step3Select1.value = "";
// step3Select2.value = "";
})
.catch((error) => {});
// })
// .catch((error) => {});
};
defineExpose({
submitData,

@ -194,19 +194,20 @@
<div class="submit" @click="step4Submit">提交</div>
<div class="drawPoint">
<div class="point">
<div class="pointItem" @click="drawPointStep4('E', '#009FF1')">绘制平均消费次数X,平均消费金额Y</div>
<span>(5,1000)</span>
<div class="pointItem" @click="drawPointStep4('y', '#009FF1')">绘制平均消费次数X:5</div>
<div v-if="showAnswerFlag" style="margin-left: 3px; display: inline-block">
<span v-if="centerPointError" style="color: red">X</span>
<span v-if="!centerPointError" style="color: #00bb00">√</span>
</div>
</div>
<!-- <div class="point">
<div class="pointItem" @click="drawPointStep4('Y', '#FB54A1')">
绘制平均消费金额Y
<div class="point">
<div class="pointItem" @click="drawPointStep4('x', '#FB54A1')">绘制平均消费金额Y:1000</div>
<div v-if="showAnswerFlag" style="margin-left: 3px; display: inline-block">
<span v-if="centerPointError2" style="color: red">X</span>
<span v-if="!centerPointError2" style="color: #00bb00">√</span>
</div>
<span>1000</span>
</div> -->
</div>
</div>
</div>
</div>
@ -242,21 +243,21 @@
</div>
<div class="point">
<div class="pointItem" @click="drawQuadrant('现金流客户', 'rgba(0, 184, 105, 0.8)')">现金流客户</div>
<div v-if="showAnswerFlag" style="margin-left: 3px; display: inline-block">
<div v-if="showAnswerFlag" style="margin-left: 3px; display: inline-block">
<span v-if="markArea4Error" style="color: red">X</span>
<span v-if="!markArea4Error" style="color: #00bb00">√</span>
</div>
</div>
<div class="point">
<div class="pointItem" @click="drawQuadrant('问题客户', 'rgba(177, 130, 192, 0.8)')">问题客户</div>
<div v-if="showAnswerFlag" style="margin-left: 3px; display: inline-block">
<div v-if="showAnswerFlag" style="margin-left: 3px; display: inline-block">
<span v-if="markArea2Error" style="color: red">X</span>
<span v-if="!markArea2Error" style="color: #00bb00">√</span>
</div>
</div>
<div class="point">
<div class="pointItem" @click="drawQuadrant('瘦狗客户', 'rgba(254, 141, 42, 0.8)')">瘦狗客户</div>
<div v-if="showAnswerFlag" style="margin-left: 3px; display: inline-block">
<div v-if="showAnswerFlag" style="margin-left: 3px; display: inline-block">
<span v-if="markArea3Error" style="color: red">X</span>
<span v-if="!markArea3Error" style="color: #00bb00">√</span>
</div>
@ -363,6 +364,7 @@ const pointBError = ref(false);
const pointCError = ref(false);
const pointDError = ref(false);
const centerPointError = ref(false);
const centerPointError2 = ref(false);
const markArea1Error = ref(false);
const markArea2Error = ref(false);
const markArea3Error = ref(false);
@ -684,6 +686,7 @@ const drawPoint = (point, color) => {
// option.value && myChart.setOption(option.value);
};
const drawPointStep4 = (point, color) => {
// markCenterLineStep4.value.splice(0, 2);
drawPointNameStep4.value = point;
drawPointColorStep4.value = color;
};
@ -939,7 +942,10 @@ const step4EchartInit = () => {
chart2OptionData.value.splice(i, 1);
}
}
markCenterLineStep4.value.splice(0, 2);
if (markCenterLineStep4.value.length >= 2) {
markCenterLineStep4.value.splice(0, 2);
}
const pointInPixel = [param.offsetX, param.offsetY];
console.log("pointInPixel4", pointInPixel);
//将偏移值转化为坐标值
@ -955,17 +961,31 @@ const step4EchartInit = () => {
name: drawPointNameStep4.value,
color: drawPointColorStep4.value,
});
markCenterLineStep4.value.push(
{
name: "y",
xAxis: pointInGridStep4.value[0],
},
{
name: "x",
yAxis: pointInGridStep4.value[1],
}
);
console.log(markCenterLineStep4.value);
if (drawPointNameStep4.value == "y") {
markCenterLineStep4.value.push(
// {
// name: "y",
// xAxis: pointInGridStep4.value[0],
// },
{
name: "",
xAxis: pointInGridStep4.value[0],
}
);
} else if (drawPointNameStep4.value == "x") {
markCenterLineStep4.value.push(
// {
// name: "y",
// xAxis: pointInGridStep4.value[0],
// },
{
name: "",
yAxis: pointInGridStep4.value[1],
}
);
}
console.log(markCenterLineStep4.value, "-----");
// console.log(markCenterLineStep4.value);
option2.value && myChart.setOption(option2.value);
});
@ -997,18 +1017,18 @@ const step5EchartInit = () => {
// 中心线
const centerLine = [
{
name: "y",
name: "",
xAxis: 5,
},
{
name: "x",
name: "",
yAxis: 1000,
},
];
// 中心点
const centerMark = [
{
value: "中心点",
value: "",
coord: [5, 1000],
},
];
@ -1411,18 +1431,37 @@ const step3Submit = () => {
};
const step4Submit = () => {
step4Error.value = 0;
for (let i in chart2OptionData.value) {
// console.log(option2.value.series[0].data[i]);
// for (let i in chart2OptionData.value) {
// // console.log(option2.value.series[0].data[i]);
if (chart2OptionData.value[i].name == "E") {
if (Math.round(chart2OptionData.value[i].value[0]) != 5 || Math.round(chart2OptionData.value[i].value[1]) != 1000) {
console.log(chart2OptionData.value[i]);
step4Error.value++;
centerPointError.value = true;
} else {
centerPointError.value = false;
}
}
// if (chart2OptionData.value[i].name == "E") {
// if (Math.round(chart2OptionData.value[i].value[0]) != 5 || Math.round(chart2OptionData.value[i].value[1]) != 1000) {
// console.log(chart2OptionData.value[i]);
// step4Error.value++;
// centerPointError.value = true;
// } else {
// centerPointError.value = false;
// }
// }
// }
// if (markCenterLineStep4.value[0].xAxis != 5 || markCenterLineStep4.value[1].yAxis != 1000) {
// step4Error.value++;
// centerPointError.value = true;
// } else {
// centerPointError.value = false;
// }
if (markCenterLineStep4.value[0].xAxis != 5) {
step4Error.value++;
centerPointError.value = true;
} else {
centerPointError.value = false;
}
if (markCenterLineStep4.value[1].yAxis != 1000) {
step4Error.value++;
centerPointError2.value = true;
} else {
centerPointError2.value = false;
}
console.log(step4Error.value, "错误数");
proxy.$modal.msgSuccess("提交成功");
@ -1487,6 +1526,7 @@ const submitData = () => {
.then((res) => {
proxy.$modal.msgSuccess("提交成功");
showAnswerFlag.value = true;
saveDataSubmit();
})
.catch((error) => {});
};
@ -1548,6 +1588,65 @@ const saveData = () => {
.then((res) => {})
.catch((error) => {});
};
const saveDataSubmit = () => {
const params = {
stepFiveA: step1Data.value[0].params1,
stepFiveB: step1Data.value[0].params2,
stepFiveC: step1Data.value[1].params1,
stepFiveD: step1Data.value[1].params2,
stepSixA: step1Data.value[2].params1,
stepSixB: step1Data.value[2].params2,
stepSixC: step1Data.value[3].params1,
stepSixD: step1Data.value[3].params2,
stepSevenA: step2Data.value[4].params1,
stepSevenB: step2Data.value[4].params2,
stepSevenC: JSON.stringify(chart1OptionData.value),
stepSevenD: JSON.stringify(chart2OptionData.value),
stepEightA: optionStep5.value.series[0].markArea.data[0][0].name,
stepEightB: optionStep5.value.series[0].markArea.data[1][0].name,
stepEightC: optionStep5.value.series[0].markArea.data[2][0].name,
stepEightD: optionStep5.value.series[0].markArea.data[3][0].name,
stepNineA: optionStep5.value.series[0].markArea.data[0][0].itemStyle.color,
stepNineB: optionStep5.value.series[0].markArea.data[1][0].itemStyle.color,
stepNineC: optionStep5.value.series[0].markArea.data[2][0].itemStyle.color,
stepNineD: optionStep5.value.series[0].markArea.data[3][0].itemStyle.color,
// stepTenA: step2Data.value[14].params,
// stepTenB: step2Data.value[15].params,
// stepTenC: step2Data.value[16].params,
// stepTenD: step2Data.value[17].params,
// stepElevenA: step2Data.value[18].params,
// stepOneA: step2Data.value[19].params,
// stepOneB: step2Data.value[20].params,
// stepOneC: step2Data.value[21].params,
// stepOneD: step2Data.value[22].params,
// stepTwoA: step2Data.value[23].params,
// stepTwoB: step2Data.value[24].params,
// stepTwoC: step2Data.value[25].params,
// stepThreeA: step2Data.value[26].params,
// stepThreeB: step2Data.value[27].params,
// stepThreeC: step2Data.value[28].params,
// stepThreeD: step2Data.value[29].params,
// stepFourA: step2Data.value[30].params,
// stepFourB: step2Data.value[31].params,
// stepFourC: step2Data.value[32].params,
// stepFourD: step2Data.value[33].params,
// stepNewOne: step2Data.value[34].params,
// stepNewTwo: step2Data.value[35].params,
// stepNewThree: step2Data.value[36].params,
// stepNewFive: step5DataTable3.value[3].params2,
// stepNewSix: step5DataTable3.value[4].params1,
// stepNewEight: step5DataTable3.value[4].params2,
};
portraitModel
.saveData({
userId: JSON.parse(getUserInfo()).userId,
module: "波士顿矩阵分析",
...params,
subState: 1,
})
.then((res) => {})
.catch((error) => {});
};
const getData = () => {
portraitModel
.getData({
@ -1577,58 +1676,251 @@ const getData = () => {
quadrant2Color.value = res.data.stepNineB;
quadrant3Color.value = res.data.stepNineC;
quadrant4Color.value = res.data.stepNineD;
}
// console.log(chart1OptionData.value,'666');
for (let i in chart2OptionData.value) {
console.log(chart2OptionData.value[i], "asdas");
if (chart2OptionData.value[i].name == "x") {
console.log(1);
markCenterLineStep4.value.push(
// {
// name: "y",
// xAxis: pointInGridStep4.value[0],
// },
{
name: "",
yAxis: chart2OptionData.value[i].value[1],
}
);
} else if (chart2OptionData.value[i].name == "y") {
console.log(2);
markCenterLineStep4.value.push(
// {
// name: "y",
// xAxis: pointInGridStep4.value[0],
// },
{
name: "",
xAxis: chart2OptionData.value[i].value[0],
}
);
}
}
// step2Data.value[14].params = res.data.stepTenA;
// step2Data.value[15].params = res.data.stepTenB;
// step2Data.value[16].params = res.data.stepTenC;
// step2Data.value[17].params = res.data.stepTenD;
// step2Data.value[18].params = res.data.stepElevenA;
// step2Data.value[19].params = res.data.stepOneA;
// step2Data.value[20].params = res.data.stepOneB;
// step2Data.value[21].params = res.data.stepOneC;
// step2Data.value[22].params = res.data.stepOneD;
// step2Data.value[23].params = res.data.stepTwoA;
// step2Data.value[24].params = res.data.stepTwoB;
// step2Data.value[25].params = res.data.stepTwoC;
// step2Data.value[26].params = res.data.stepThreeA;
// step2Data.value[27].params = res.data.stepThreeB;
// step2Data.value[28].params = res.data.stepThreeC;
// step2Data.value[29].params = res.data.stepThreeD;
// step2Data.value[30].params = res.data.stepFourA;
// step2Data.value[31].params = res.data.stepFourB;
// step2Data.value[32].params = res.data.stepFourC;
// step2Data.value[33].params = res.data.stepFourD;
// step2Data.value[34].params = res.data.stepNewOne;
// step2Data.value[35].params = res.data.stepNewTwo;
// step2Data.value[36].params = res.data.stepNewThree;
// step5DataTable3.value[3].params2 = res.data.stepNewFive;
// step5DataTable3.value[4].params1 = res.data.stepNewSix;
// step5DataTable3.value[4].params2 = res.data.stepNewEight;
// console.log(JSON.parse(res.data.stepSevenC));
// step2Data.value[14].params = res.data.stepTenA;
// step2Data.value[15].params = res.data.stepTenB;
// step2Data.value[16].params = res.data.stepTenC;
// step2Data.value[17].params = res.data.stepTenD;
// step2Data.value[18].params = res.data.stepElevenA;
// step2Data.value[19].params = res.data.stepOneA;
// step2Data.value[20].params = res.data.stepOneB;
// step2Data.value[21].params = res.data.stepOneC;
// step2Data.value[22].params = res.data.stepOneD;
// step2Data.value[23].params = res.data.stepTwoA;
// step2Data.value[24].params = res.data.stepTwoB;
// step2Data.value[25].params = res.data.stepTwoC;
// step2Data.value[26].params = res.data.stepThreeA;
// step2Data.value[27].params = res.data.stepThreeB;
// step2Data.value[28].params = res.data.stepThreeC;
// step2Data.value[29].params = res.data.stepThreeD;
// step2Data.value[30].params = res.data.stepFourA;
// step2Data.value[31].params = res.data.stepFourB;
// step2Data.value[32].params = res.data.stepFourC;
// step2Data.value[33].params = res.data.stepFourD;
// step2Data.value[34].params = res.data.stepNewOne;
// step2Data.value[35].params = res.data.stepNewTwo;
// step2Data.value[36].params = res.data.stepNewThree;
// step5DataTable3.value[3].params2 = res.data.stepNewFive;
// step5DataTable3.value[4].params1 = res.data.stepNewSix;
// step5DataTable3.value[4].params2 = res.data.stepNewEight;
// console.log(JSON.parse(res.data.stepSevenC));
step3EchartInit();
step4EchartInit();
step5EchartInit();
step3EchartInit();
step4EchartInit();
step5EchartInit();
if (res.data.subState & (res.data.subState == 1)) {
showAnswerFlag.value = true;
if (step1Data.value[0].params1 && step1Data.value[0].params1 !== "3") {
step1Data.value[0].isError1 = true;
} else {
step1Data.value[0].isError1 = false;
}
if (step1Data.value[0].params2 && step1Data.value[0].params2 !== "800") {
step1Data.value[0].isError2 = true;
} else {
step1Data.value[0].isError2 = false;
}
if (step1Data.value[1].params1 && step1Data.value[1].params1 !== "4") {
step1Data.value[1].isError1 = true;
} else {
step1Data.value[1].isError1 = false;
}
if (step1Data.value[1].params2 && step1Data.value[1].params2 !== "1200") {
step1Data.value[1].isError2 = true;
} else {
step1Data.value[1].isError2 = false;
}
if (step1Data.value[2].params1 && step1Data.value[2].params1 !== "6") {
step1Data.value[2].isError1 = true;
} else {
step1Data.value[2].isError1 = false;
}
if (step1Data.value[2].params2 && step1Data.value[2].params2 !== "600") {
step1Data.value[2].isError2 = true;
} else {
step1Data.value[2].isError2 = false;
}
if (step1Data.value[3].params1 && step1Data.value[3].params1 !== "7") {
step1Data.value[3].isError1 = true;
} else {
step1Data.value[3].isError1 = false;
}
if (step1Data.value[3].params2 && step1Data.value[3].params2 !== "1400") {
step1Data.value[3].isError2 = true;
} else {
step1Data.value[3].isError2 = false;
}
if (step2Data.value[4].params1 && step2Data.value[4].params1 !== "5") {
step2Data.value[4].isError1 = true;
} else {
step2Data.value[4].isError1 = false;
}
if (step2Data.value[4].params2 && step2Data.value[4].params2 !== "1000") {
step2Data.value[4].isError2 = true;
} else {
step2Data.value[4].isError2 = false;
}
for (let i in chart1OptionData.value) {
// console.log(option.value.series[0].data[i]);
if (chart1OptionData.value[i].name == "A") {
if (Math.round(chart1OptionData.value[i].value[0]) != 3 || Math.round(chart1OptionData.value[i].value[1]) != 800) {
pointAError.value = true;
} else {
pointAError.value = false;
}
}
if (chart1OptionData.value[i].name == "B") {
if (Math.round(chart1OptionData.value[i].value[0]) != 4 || Math.round(chart1OptionData.value[i].value[1]) != 1200) {
pointBError.value = true;
} else {
pointBError.value = false;
}
}
if (chart1OptionData.value[i].name == "C") {
if (Math.round(chart1OptionData.value[i].value[0]) != 6 || Math.round(chart1OptionData.value[i].value[1]) != 600) {
pointCError.value = true;
} else {
pointCError.value = false;
}
}
if (chart1OptionData.value[i].name == "D") {
if (Math.round(chart1OptionData.value[i].value[0]) != 7 || Math.round(chart1OptionData.value[i].value[1]) != 1400) {
pointDError.value = true;
} else {
pointDError.value = false;
}
}
}
if (markCenterLineStep4.value[0].xAxis != 5) {
centerPointError.value = true;
} else {
centerPointError.value = false;
}
if (markCenterLineStep4.value[1].yAxis != 1000) {
centerPointError2.value = true;
} else {
centerPointError2.value = false;
}
// for (let i in chart2OptionData.value) {
// // console.log(option2.value.series[0].data[i]);
// if (chart2OptionData.value[i].name == "E") {
// if (Math.round(chart2OptionData.value[i].value[0]) != 5 || Math.round(chart2OptionData.value[i].value[1]) != 1000) {
// centerPointError.value = true;
// } else {
// centerPointError.value = false;
// }
// }
// }
if (quadrant1.value != "明星客户") {
markArea1Error.value = true;
} else {
markArea1Error.value = false;
}
if (quadrant2.value != "问题客户") {
markArea2Error.value = true;
} else {
markArea2Error.value = false;
}
if (quadrant3.value != "瘦狗客户") {
markArea3Error.value = true;
} else {
markArea3Error.value = false;
}
if (quadrant4.value != "现金流客户") {
markArea4Error.value = true;
} else {
markArea4Error.value = false;
}
}
}else {
console.log(789);
chart1OptionData.value = JSON.parse('[]');
// console.log(JSON.parse(res.data.stepSevenC),'666');
chart2OptionData.value = JSON.parse('[]');
quadrant1.value = "";
quadrant2.value = "";
quadrant3.value = "";
quadrant4.value = "";
quadrant1Color.value = "";
quadrant2Color.value = "";
quadrant3Color.value = "";
quadrant4Color.value = "";
step3EchartInit();
step4EchartInit();
step5EchartInit();
}
})
.catch((error) => {});
};
const retrain = () => {
showAnswerFlag.value = false;
// console.log(666);
portraitModel
.retrain({
userId: JSON.parse(getUserInfo()).userId,
module: "波士顿矩阵分析",
})
.then((res) => {
proxy.$modal.msgSuccess("重新实训成功");
for (let i in step1Data.value) {
step1Data.value[i].params1 = "";
step1Data.value[i].params2 = "";
}
step2Data.value[4].params1 = "";
step2Data.value[4].params2 = "";
})
.catch((error) => {});
// portraitModel
// .retrain({
// userId: JSON.parse(getUserInfo()).userId,
// module: "波士顿矩阵分析",
// })
// .then((res) => {
proxy.$modal.msgSuccess("重新实训成功");
for (let i in step1Data.value) {
step1Data.value[i].params1 = "";
step1Data.value[i].params2 = "";
}
step2Data.value[4].params1 = "";
step2Data.value[4].params2 = "";
chart1OptionData.value = JSON.parse("[]");
// console.log(JSON.parse(res.data.stepSevenC),'666');
chart2OptionData.value = JSON.parse("[]");
markCenterLineStep4.value.splice(0, 2);
quadrant1.value = "";
quadrant2.value = "";
quadrant3.value = "";
quadrant4.value = "";
quadrant1Color.value = "";
quadrant2Color.value = "";
quadrant3Color.value = "";
quadrant4Color.value = "";
// })
// .catch((error) => {});
step3EchartInit();
step4EchartInit();
step5EchartInit();
};
defineExpose({
submitData,

@ -230,10 +230,10 @@
<el-option :label="'订单--支付'" :value="'订单--支付'" />
<el-option :label="'支付--完成交易'" :value="'付--完成交易'" />
</el-select>
<div v-if="showAnswerFlag" style="margin-left: 3px;display:inline-block">
<span v-if="step3Select1 != '浏览--购物车'" style="color: red">X</span>
<span v-if="step3Select1 == '浏览--购物车'" style="color: #00bb00">√</span>
</div>
<div v-if="showAnswerFlag" style="margin-left: 3px; display: inline-block">
<span v-if="step3Select1 != '浏览--购物车'" style="color: red">X</span>
<span v-if="step3Select1 == '浏览--购物车'" style="color: #00bb00">√</span>
</div>
</div>
<br />
<div>
@ -244,10 +244,10 @@
<el-option :label="'订单--支付'" :value="'订单--支付'" />
<el-option :label="'支付--完成交易'" :value="'付--完成交易'" />
</el-select>
<div v-if="showAnswerFlag" style="margin-left: 3px;display:inline-block">
<span v-if="step3Select2 != '购物车--订单'" style="color: red">X</span>
<span v-if="step3Select2 == '购物车--订单'" style="color: #00bb00">√</span>
</div>
<div v-if="showAnswerFlag" style="margin-left: 3px; display: inline-block">
<span v-if="step3Select2 != '购物车--订单'" style="color: red">X</span>
<span v-if="step3Select2 == '购物车--订单'" style="color: #00bb00">√</span>
</div>
</div>
<p>注:实际运用时 ,转化率需要与不同时期比较、与竞争对手、行业平均水平比较,分析的结果相对准确些。</p>
</div>
@ -314,7 +314,9 @@ import * as echarts from "echarts";
import { downBlobFile } from "@/utils/index.js";
import { onMounted } from "vue";
const { proxy } = getCurrentInstance();
const funnelData = ref([223, 235, 284, 622, 2071]);
// const funnelData = ref([223, 235, 284, 622, 2071]);
const funnelData = ref(["", "", "", "", ""]);
const funnelYAxis = ref(["", "", "", "", ""]);
const dialogVisible = ref(false);
const step2Select1 = ref("");
const step2Select2 = ref("");
@ -586,81 +588,7 @@ const typeData = ref([
// },
// ],
// };
const option = ref({
title: {
text: "漏斗图",
textStyle: {
color: "#fff",
},
},
tooltip: {
// trigger: 'axis',
// axisPointer: {
// type: 'shadow'
// }
},
legend: {
data: [],
textStyle: {
color: "#fff",
},
},
grid: {
left: "3%",
right: "4%",
bottom: "3%",
containLabel: true,
},
xAxis: {
show: false,
// type: 'value',
// boundaryGap: [0, 0.01]
},
yAxis: {
type: "category",
data: ["", "", "", "", ""],
position: "center",
},
series: [
{
name: "",
stack: "one",
type: "bar",
barWidth: "60%",
data: [1120, 1113, 1090, 920, 220],
itemStyle: {
normal: {
//这里是重点
color: function (params) {
// 颜色设置透明
var colorList = ["rgba(0,0,0,0)", "rgba(0,0,0,0)", "rgba(0,0,0,0)", "rgba(0,0,0,0)", "rgba(0,0,0,0)", "rgba(0,0,0,0)"];
return colorList[params.dataIndex];
},
},
},
},
{
stack: "one",
name: "",
type: "bar",
barWidth: "60%",
data: funnelData.value,
// data: [223, 235, 284, 622, 2071],
itemStyle: {
normal: {
//这里是重点
color: function (params) {
// 颜色设置透明
var colorList = ["#009FF1", "#003DA3", "#00B869", "#FE8D2A", "#FB54A1"];
return colorList[params.dataIndex];
},
},
borderColor: "#fff",
borderWidth: 1,
},
},
],
});
const step1Error = ref(0);
const step2Error = ref(0);
const step3Error = ref(0);
@ -669,36 +597,126 @@ const step2AnswerFlag = ref(false);
const step3AnswerFlag = ref(false);
const showAnswerFlag = ref(false);
const errorNum = ref(0);
const option = ref({});
const baseUrl = import.meta.env.VITE_APP_BASE_API;
onBeforeUnmount(() => {
saveData();
});
onMounted(() => {
getData();
initEchart()
});
const initEchart = () => {
option.value = {
title: {
text: "漏斗图",
textStyle: {
color: "#fff",
},
},
tooltip: {
// trigger: 'axis',
// axisPointer: {
// type: 'shadow'
// }
},
legend: {
data: [],
textStyle: {
color: "#fff",
},
},
grid: {
left: "3%",
right: "4%",
bottom: "3%",
containLabel: true,
},
xAxis: {
show: false,
// type: 'value',
// boundaryGap: [0, 0.01]
},
yAxis: {
type: "category",
// data: ["1", "2", "3", "4", "5"],
data: funnelYAxis.value,
position: "center",
},
series: [
{
name: "",
stack: "one",
type: "bar",
barWidth: "60%",
data: [1120, 1113, 1090, 920, 220],
itemStyle: {
normal: {
//这里是重点
color: function (params) {
// 颜色设置透明
var colorList = ["rgba(0,0,0,0)", "rgba(0,0,0,0)", "rgba(0,0,0,0)", "rgba(0,0,0,0)", "rgba(0,0,0,0)", "rgba(0,0,0,0)"];
return colorList[params.dataIndex];
},
},
},
},
{
label: {
show: true, // 显示数值
// position: 'top' // 在柱状图上方显示
},
stack: "one",
name: "",
type: "bar",
barWidth: "60%",
data: funnelData.value,
// data: [223, 235, 284, 622, 2071],
itemStyle: {
normal: {
//这里是重点
color: function (params) {
// 颜色设置透明
var colorList = ["#009FF1", "#003DA3", "#00B869", "#FE8D2A", "#FB54A1"];
return colorList[params.dataIndex];
},
},
borderColor: "#fff",
borderWidth: 1,
},
},
],
};
var chartDom = document.getElementById("funnel");
var myChart = echarts.init(chartDom);
option.value && myChart.setOption(option.value);
});
};
const selectData = (item, index) => {
console.log(item, index);
if (item == "浏览2071") {
funnelData.value[index] = 2071;
funnelYAxis.value[index] = "浏览";
}
if (item == "购物车622") {
funnelData.value[index] = 622;
funnelYAxis.value[index] = "购物车";
}
if (item == "订单284") {
funnelData.value[index] = 284;
funnelYAxis.value[index] = "订单";
}
if (item == "支付235") {
funnelData.value[index] = 235;
funnelYAxis.value[index] = "支付";
}
if (item == "完成交易223") {
funnelData.value[index] = 223;
funnelYAxis.value[index] = "完成交易";
}
var chartDom = document.getElementById("funnel");
var myChart = echarts.init(chartDom);
option.value && myChart.setOption(option.value);
// var chartDom = document.getElementById("funnel");
// var myChart = echarts.init(chartDom);
// option.value && myChart.setOption(option.value);
initEchart();
};
const moveUp = (index, row) => {
console.log("上移", index, row);
@ -902,11 +920,11 @@ const saveData = () => {
stepNineD: step2Select5.value,
stepTenA: step3Select1.value,
stepTenB: step3Select2.value,
// stepTenC: step4Data.value[2].params1,
// stepTenD: step4Data.value[2].params2,
// stepElevenA: step4Data.value[2].params3,
// stepOneA: step5Data.value[0].params1,
// stepOneB: step5Data.value[0].params2,
stepTenC: funnelData.value[0],
stepTenD: funnelData.value[1],
stepElevenA: funnelData.value[2],
stepOneA: funnelData.value[3],
stepOneB: funnelData.value[4],
// stepOneC: step5Data.value[0].params3,
// stepOneD: step6Data.value[0].params1,
// stepTwoA: step6Data.value[0].params2,
@ -959,11 +977,25 @@ const getData = () => {
step2Select5.value = res.data.stepNineD;
step3Select1.value = res.data.stepTenA;
step3Select2.value = res.data.stepTenB;
// step4Data.value[2].params1 = res.data.stepTenC;
// step4Data.value[2].params2 = res.data.stepTenD;
// step4Data.value[2].params3 = res.data.stepElevenA;
// step5Data.value[0].params1 = res.data.stepOneA;
// step5Data.value[0].params2 = res.data.stepOneB;
funnelYAxis.value[4] = step2Select1.value;
funnelYAxis.value[3] = step2Select2.value;
funnelYAxis.value[2] = step2Select3.value;
funnelYAxis.value[1] = step2Select4.value;
funnelYAxis.value[0] = step2Select5.value;
funnelData.value[0] = res.data.stepTenC;
funnelData.value[1] = res.data.stepTenD;
funnelData.value[2] = res.data.stepElevenA;
funnelData.value[3] = res.data.stepOneA;
funnelData.value[4] = res.data.stepOneB;
// var chartDom = document.getElementById("funnel");
// var myChart = echarts.init(chartDom);
// option.value && myChart.setOption(option.value);
initEchart();
// step5Data.value[0].params3 = res.data.stepOneC;
// step6Data.value[0].params1 = res.data.stepOneD;
// step6Data.value[0].params2 = res.data.stepTwoA;
@ -977,6 +1009,87 @@ const getData = () => {
// step7Data.value[0].params = res.data.stepFourB;
// step7Data.value[1].params = res.data.stepFourC;
// step7Data.value[2].params = res.data.stepFourD;
//回显答案
if (res.data.subState & (res.data.subState == 1)) {
showAnswerFlag.value = true;
const step1DataSlice = step1Data.value.slice(1);
//判断对错
if (step1DataSlice[0].params1 && step1DataSlice[0].params1 !== "100") {
step1DataSlice[0].isError1 = true;
} else {
step1DataSlice[0].isError1 = false;
}
if (step1DataSlice[0].params2 && step1DataSlice[0].params2 !== "30.0" && step1DataSlice[0].params2 !== "30") {
step1DataSlice[0].isError2 = true;
} else {
step1DataSlice[0].isError2 = false;
}
if (step1DataSlice[0].params3 && step1DataSlice[0].params3 !== "45.7") {
step1DataSlice[0].isError3 = true;
} else {
step1DataSlice[0].isError3 = false;
}
if (step1DataSlice[0].params4 && step1DataSlice[0].params4 !== "82.7") {
step1DataSlice[0].isError4 = true;
} else {
step1DataSlice[0].isError4 = false;
}
if (step1DataSlice[0].params5 && step1DataSlice[0].params5 !== "94.9") {
step1DataSlice[0].isError5 = true;
} else {
step1DataSlice[0].isError5 = false;
}
if (step1DataSlice[1].params1 && step1DataSlice[1].params1 !== "0") {
step1DataSlice[1].isError1 = true;
} else {
step1DataSlice[1].isError1 = false;
}
if (step1DataSlice[1].params2 && step1DataSlice[1].params2 !== "70") {
step1DataSlice[1].isError2 = true;
} else {
step1DataSlice[1].isError2 = false;
}
if (step1DataSlice[1].params3 && step1DataSlice[1].params3 !== "54.3") {
step1DataSlice[1].isError3 = true;
} else {
step1DataSlice[1].isError3 = false;
}
if (step1DataSlice[1].params4 && step1DataSlice[1].params4 !== "17.3") {
step1DataSlice[1].isError4 = true;
} else {
step1DataSlice[1].isError4 = false;
}
if (step1DataSlice[1].params5 && step1DataSlice[1].params5 !== "5.1") {
step1DataSlice[1].isError5 = true;
} else {
step1DataSlice[1].isError5 = false;
}
if (step1DataSlice[2].params1 && step1DataSlice[2].params1 !== "100") {
step1DataSlice[2].isError1 = true;
} else {
step1DataSlice[2].isError1 = false;
}
if (step1DataSlice[2].params2 && step1DataSlice[2].params2 !== "30.0" && step1DataSlice[2].params2 !== "30") {
step1DataSlice[2].isError2 = true;
} else {
step1DataSlice[2].isError2 = false;
}
if (step1DataSlice[2].params3 && step1DataSlice[2].params3 !== "13.7") {
step1DataSlice[2].isError3 = true;
} else {
step1DataSlice[2].isError3 = false;
}
if (step1DataSlice[2].params4 && step1DataSlice[2].params4 !== "11.3") {
step1DataSlice[2].isError4 = true;
} else {
step1DataSlice[2].isError4 = false;
}
if (step1DataSlice[2].params5 && step1DataSlice[2].params5 !== "10.8") {
step1DataSlice[2].isError5 = true;
} else {
step1DataSlice[2].isError5 = false;
}
}
})
.catch((error) => {});
};
@ -997,35 +1110,96 @@ const submitData = () => {
.then((res) => {
proxy.$modal.msgSuccess("提交成功");
showAnswerFlag.value = true;
saveDataSubmit();
})
.catch((error) => {});
// console.log(666);
};
const retrain = () => {
const saveDataSubmit = () => {
const params = {
stepFiveA: step1Data.value[1].params1,
stepFiveB: step1Data.value[1].params2,
stepFiveC: step1Data.value[1].params3,
stepFiveD: step1Data.value[1].params4,
stepSixA: step1Data.value[1].params5,
stepSixB: step1Data.value[2].params1,
stepSixC: step1Data.value[2].params2,
stepSixD: step1Data.value[2].params3,
stepSevenA: step1Data.value[2].params4,
stepSevenB: step1Data.value[2].params5,
stepSevenC: step1Data.value[3].params1,
stepSevenD: step1Data.value[3].params2,
stepEightA: step1Data.value[3].params3,
stepEightB: step1Data.value[3].params4,
stepEightC: step1Data.value[3].params5,
stepEightD: step2Select1.value,
stepNineA: step2Select2.value,
stepNineB: step2Select3.value,
stepNineC: step2Select4.value,
stepNineD: step2Select5.value,
stepTenA: step3Select1.value,
stepTenB: step3Select2.value,
// stepTenC: step4Data.value[2].params1,
// stepTenD: step4Data.value[2].params2,
// stepElevenA: step4Data.value[2].params3,
// stepOneA: step5Data.value[0].params1,
// stepOneB: step5Data.value[0].params2,
// stepOneC: step5Data.value[0].params3,
// stepOneD: step6Data.value[0].params1,
// stepTwoA: step6Data.value[0].params2,
// stepTwoB: step6Data.value[0].params3,
// stepTwoC: step6Data.value[1].params1,
// stepThreeA: step6Data.value[1].params2,
// stepThreeB: step6Data.value[1].params3,
// stepThreeC: step6Data.value[2].params1,
// stepThreeD: step6Data.value[2].params2,
// stepFourA: step6Data.value[2].params3,
// stepFourB: step7Data.value[0].params,
// stepFourC: step7Data.value[1].params,
// stepFourD: step7Data.value[2].params,
};
portraitModel
.retrain({
.saveData({
userId: JSON.parse(getUserInfo()).userId,
module: "转化分析-漏斗模型",
...params,
subState: 1,
})
.then((res) => {
proxy.$modal.msgSuccess("重新实训成功");
for (let i in step1Data.value) {
step1Data.value[i].params1 = "";
step1Data.value[i].params2 = "";
step1Data.value[i].params3 = "";
step1Data.value[i].params4 = "";
step1Data.value[i].params5 = "";
}
step2Select1.value = "";
step2Select2.value = "";
step2Select3.value = "";
step2Select4.value = "";
step2Select5.value = "";
step3Select1.value = "";
step3Select2.value = "";
})
.then((res) => {})
.catch((error) => {});
};
const retrain = () => {
showAnswerFlag.value = false;
// portraitModel
// .retrain({
// userId: JSON.parse(getUserInfo()).userId,
// module: "转化分析-漏斗模型",
// })
// .then((res) => {
proxy.$modal.msgSuccess("重新实训成功");
for (let i in step1Data.value) {
step1Data.value[i].params1 = "";
step1Data.value[i].params2 = "";
step1Data.value[i].params3 = "";
step1Data.value[i].params4 = "";
step1Data.value[i].params5 = "";
}
step2Select1.value = "";
step2Select2.value = "";
step2Select3.value = "";
step2Select4.value = "";
step2Select5.value = "";
step3Select1.value = "";
step3Select2.value = "";
funnelData.value = ["", "", "", "", ""];
funnelYAxis.value = ["", "", "", "", ""];
// var chartDom = document.getElementById("funnel");
// var myChart = echarts.init(chartDom);
// option.value && myChart.setOption(option.value);
initEchart();
// })
// .catch((error) => {});
};
defineExpose({
submitData,
retrain,

File diff suppressed because one or more lines are too long

@ -1817,6 +1817,65 @@ const saveData = () => {
.then((res) => {})
.catch((error) => {});
};
const saveSubmitData = () => {
const params = {
stepFiveA: step1Data.value[0].params,
stepFiveB: step1Data.value[1].params,
stepFiveC: step1Data.value[2].params,
stepFiveD: step1Data.value[3].params,
stepSixA: step1Data.value[4].params,
stepSixB: step1Data.value[5].params,
stepSixC: step1Data.value[6].params,
stepSixD: step1Data.value[7].params,
stepSevenA: step1Data.value[8].params,
stepSevenB: step1Data.value[9].params,
stepSevenC: step1Data.value[10].params,
stepSevenD: step1Data.value[11].params,
stepEightA: step1Data.value[12].params,
stepEightB: step1Data.value[13].params,
stepEightC: step1Data.value[14].params,
stepEightD: step1Data.value[15].params,
stepNineA: step1Data.value[16].params,
stepNineB: step1Data.value[17].params,
stepNineC: step1Data.value[18].params,
stepNineD: step1Data.value[19].params,
stepTenA: step2Data.value[0].params,
stepTenB: step2Data.value[1].params,
stepTenC: step2Data.value[2].params,
stepTenD: step4Data.value[0].params1,
stepElevenA: step4Data.value[0].params2,
stepOneA: step4Data.value[2].params1,
stepOneB: step4Data.value[2].params2,
stepOneC: step4Data.value[4].params1,
stepOneD: step4Data.value[4].params2,
stepTwoA: step4Data.value[6].params1,
stepTwoB: step4Data.value[6].params2,
stepTwoC: step5DataTable2.value[0].params,
stepThreeA: step5DataTable2.value[1].params,
stepThreeB: step5DataTable2.value[2].params,
stepThreeC: step5DataTable2.value[3].params,
stepThreeD: step5DataTable2.value[4].params,
stepFourA: step5DataTable3.value[0].params1,
stepFourB: step5DataTable3.value[0].params2,
stepFourC: step5DataTable3.value[1].params1,
stepFourD: step5DataTable3.value[1].params2,
stepNewOne: step5DataTable3.value[2].params1,
stepNewTwo: step5DataTable3.value[2].params2,
stepNewThree: step5DataTable3.value[3].params1,
stepNewFive: step5DataTable3.value[3].params2,
stepNewSix: step5DataTable3.value[4].params1,
stepNewEight: step5DataTable3.value[4].params2,
};
portraitModel
.saveData({
userId: JSON.parse(getUserInfo()).userId,
module: "复购分析",
...params,
subState: 1,
})
.then((res) => {})
.catch((error) => {});
};
const getData = () => {
portraitModel
.getData({
@ -1870,6 +1929,241 @@ const getData = () => {
step5DataTable3.value[3].params2 = res.data.stepNewFive;
step5DataTable3.value[4].params1 = res.data.stepNewSix;
step5DataTable3.value[4].params2 = res.data.stepNewEight;
//回显答案
if (res.data.subState & (res.data.subState == 1)) {
showAnswerFlag.value = true;
if (step1Data.value[0].params && step1Data.value[0].params != "1") {
step1Data.value[0].isError = true;
} else {
step1Data.value[0].isError = false;
}
if (step1Data.value[1].params && step1Data.value[1].params != "2") {
step1Data.value[1].isError = true;
} else {
step1Data.value[1].isError = false;
}
if (step1Data.value[2].params && step1Data.value[2].params != "1") {
step1Data.value[2].isError = true;
} else {
step1Data.value[2].isError = false;
}
if (step1Data.value[3].params && step1Data.value[3].params != "2") {
step1Data.value[3].isError = true;
} else {
step1Data.value[3].isError = false;
}
if (step1Data.value[4].params && step1Data.value[4].params != "3") {
step1Data.value[4].isError = true;
} else {
step1Data.value[4].isError = false;
}
if (step1Data.value[5].params && step1Data.value[5].params != "1") {
step1Data.value[5].isError = true;
} else {
step1Data.value[5].isError = false;
}
if (step1Data.value[6].params && step1Data.value[6].params != "2") {
step1Data.value[6].isError = true;
} else {
step1Data.value[6].isError = false;
}
if (step1Data.value[7].params && step1Data.value[7].params != "3") {
step1Data.value[7].isError = true;
} else {
step1Data.value[7].isError = false;
}
if (step1Data.value[8].params && step1Data.value[8].params != "4") {
step1Data.value[8].isError = true;
} else {
step1Data.value[8].isError = false;
}
if (step1Data.value[9].params && step1Data.value[9].params != "1") {
step1Data.value[9].isError = true;
} else {
step1Data.value[9].isError = false;
}
if (step1Data.value[10].params && step1Data.value[10].params != "2") {
step1Data.value[10].isError = true;
} else {
step1Data.value[10].isError = false;
}
if (step1Data.value[11].params && step1Data.value[11].params != "2") {
step1Data.value[11].isError = true;
} else {
step1Data.value[11].isError = false;
}
if (step1Data.value[12].params && step1Data.value[12].params != "3") {
step1Data.value[12].isError = true;
} else {
step1Data.value[12].isError = false;
}
if (step1Data.value[13].params && step1Data.value[13].params != "4") {
step1Data.value[13].isError = true;
} else {
step1Data.value[13].isError = false;
}
if (step1Data.value[14].params && step1Data.value[14].params != "1") {
step1Data.value[14].isError = true;
} else {
step1Data.value[14].isError = false;
}
if (step1Data.value[15].params && step1Data.value[15].params != "1") {
step1Data.value[15].isError = true;
} else {
step1Data.value[15].isError = false;
}
if (step1Data.value[16].params && step1Data.value[16].params != "1") {
step1Data.value[16].isError = true;
} else {
step1Data.value[16].isError = false;
}
if (step1Data.value[17].params && step1Data.value[17].params != "1") {
step1Data.value[17].isError = true;
} else {
step1Data.value[17].isError = false;
}
if (step1Data.value[18].params && step1Data.value[18].params != "1") {
step1Data.value[18].isError = true;
} else {
step1Data.value[18].isError = false;
}
if (step1Data.value[19].params && step1Data.value[19].params != "1") {
step1Data.value[19].isError = true;
} else {
step1Data.value[19].isError = false;
}
if (step2Data.value[0].params && step2Data.value[0].params != "10") {
step2Data.value[0].isError = true;
} else {
step2Data.value[0].isError = false;
}
if (step2Data.value[1].params && step2Data.value[1].params != "4") {
step2Data.value[1].isError = true;
} else {
step2Data.value[1].isError = false;
}
if (step2Data.value[2].params && step2Data.value[2].params != "40") {
step2Data.value[2].isError = true;
} else {
step2Data.value[2].isError = false;
}
if (step4Data.value[0].params1 && step4Data.value[0].params1 != "22") {
step4Data.value[0].isError1 = true;
} else {
step4Data.value[0].isError1 = false;
}
if (step4Data.value[0].params2 && step4Data.value[0].params2 != "30天内") {
step4Data.value[0].isError2 = true;
} else {
step4Data.value[0].isError2 = false;
}
if (step4Data.value[2].params1 && step4Data.value[2].params1 != "10") {
step4Data.value[2].isError1 = true;
} else {
step4Data.value[2].isError1 = false;
}
if (step4Data.value[2].params2 && step4Data.value[2].params2 != "15天内") {
step4Data.value[2].isError2 = true;
} else {
step4Data.value[2].isError2 = false;
}
if (step4Data.value[4].params1 && step4Data.value[4].params1 != "4") {
step4Data.value[4].isError1 = true;
} else {
step4Data.value[4].isError1 = false;
}
if (step4Data.value[4].params2 && step4Data.value[4].params2 != "7天内") {
step4Data.value[4].isError2 = true;
} else {
step4Data.value[4].isError2 = false;
}
if (step4Data.value[6].params1 && step4Data.value[6].params1 != "2") {
step4Data.value[6].isError1 = true;
} else {
step4Data.value[6].isError1 = false;
}
if (step4Data.value[6].params2 && step4Data.value[6].params2 != "7天内") {
step4Data.value[6].isError2 = true;
} else {
step4Data.value[6].isError2 = false;
}
if (step5DataTable2.value[0].params && step5DataTable2.value[0].params != "裤子" && step5DataTable2.value[0].params != "外套") {
step5DataTable2.value[0].isError = true;
} else {
step5DataTable2.value[0].isError = false;
}
if (step5DataTable2.value[1].params && step5DataTable2.value[1].params != "衬衫" && step5DataTable2.value[1].params != "短袖" && step5DataTable2.value[1].params != "睡衣") {
step5DataTable2.value[1].isError = true;
} else {
step5DataTable2.value[1].isError = false;
}
if (step5DataTable3.value[0].params1 && step5DataTable3.value[0].params1 != "无") {
step5DataTable3.value[0].isError1 = true;
} else {
step5DataTable3.value[0].isError1 = false;
}
if (step5DataTable3.value[0].params2 && step5DataTable3.value[0].params2 != "0") {
step5DataTable3.value[0].isError2 = true;
} else {
step5DataTable3.value[0].isError2 = false;
}
if (step5DataTable3.value[1].params1 && step5DataTable3.value[1].params1 != "无") {
step5DataTable3.value[1].isError1 = true;
} else {
step5DataTable3.value[1].isError1 = false;
}
if (step5DataTable3.value[1].params2 && step5DataTable3.value[1].params2 != "0") {
step5DataTable3.value[1].isError2 = true;
} else {
step5DataTable3.value[1].isError2 = false;
}
if (step5DataTable3.value[2].params1 && step5DataTable3.value[2].params1 != "无") {
step5DataTable3.value[2].isError1 = true;
} else {
step5DataTable3.value[2].isError1 = false;
}
if (step5DataTable3.value[2].params2 && step5DataTable3.value[2].params2 != "0") {
step5DataTable3.value[2].isError2 = true;
} else {
step5DataTable3.value[2].isError2 = false;
}
if (step5DataTable3.value[3].params1 && step5DataTable3.value[3].params1 != "C") {
step5DataTable3.value[3].isError1 = true;
} else {
step5DataTable3.value[3].isError1 = false;
}
if (step5DataTable3.value[3].params2 && step5DataTable3.value[3].params2 != "1") {
step5DataTable3.value[3].isError2 = true;
} else {
step5DataTable3.value[3].isError2 = false;
}
if (step5DataTable3.value[4].params1 && step5DataTable3.value[4].params1 != "D") {
step5DataTable3.value[4].isError1 = true;
} else {
step5DataTable3.value[4].isError1 = false;
}
if (step5DataTable3.value[4].params2 && step5DataTable3.value[4].params2 != "2") {
;
step5DataTable3.value[4].isError2 = true;
} else {
step5DataTable3.value[4].isError2 = false;
}
}
})
.catch((error) => {});
};
@ -1901,17 +2195,19 @@ const submitData = () => {
.then((res) => {
proxy.$modal.msgSuccess("提交成功");
showAnswerFlag.value = true;
saveSubmitData();
})
.catch((error) => {});
// console.log(666);
};
const retrain = () => {
portraitModel
.retrain({
userId: JSON.parse(getUserInfo()).userId,
module: "复购分析",
})
.then((res) => {
showAnswerFlag.value = false;
// portraitModel
// .retrain({
// userId: JSON.parse(getUserInfo()).userId,
// module: "复购分析",
// })
// .then((res) => {
proxy.$modal.msgSuccess("重新实训成功");
for (let i in step1Data.value) {
step1Data.value[i].params = "";
@ -1932,8 +2228,8 @@ const retrain = () => {
step5DataTable3.value[i].params1 = "";
step5DataTable3.value[i].params2 = "";
}
})
.catch((error) => {});
// })
// .catch((error) => {});
};
defineExpose({
submitData,

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -201,7 +201,7 @@ https://blog.csdn.net/kevin1993best/article/details/106329573"
<el-table-column label="月活跃用户(个)" align="center" prop="description">
<template #default="scope">
<el-input v-model="scope.row.params1" placeholder="请输入" style="width: 90px"></el-input>
<div v-if="showAnswerFlag" style="margin-left: 3px; display: inline-block">
<div v-if="showAnswerFlag" style="margin-left: 3px; display: inline-block">
<span v-if="scope.row.isError1" style="color: red">X</span>
<span v-if="!scope.row.isError1" style="color: #00bb00">√</span>
</div>
@ -211,7 +211,7 @@ https://blog.csdn.net/kevin1993best/article/details/106329573"
<template #default="scope">
<el-input v-model="scope.row.params2" placeholder="请输入" style="width: 90px"></el-input>
%
<div v-if="showAnswerFlag" style="margin-left: 3px; display: inline-block">
<div v-if="showAnswerFlag" style="margin-left: 3px; display: inline-block">
<span v-if="scope.row.isError2" style="color: red">X</span>
<span v-if="!scope.row.isError2" style="color: #00bb00">√</span>
</div>
@ -1538,13 +1538,13 @@ const step3Submit = () => {
if (step3Data.value[0].params1 != "10") {
step3Error.value++;
step3Data.value[0].isError1 = true;
}else{
} else {
step3Data.value[0].isError1 = false;
}
if (step3Data.value[0].params2 != "100") {
step3Error.value++;
step3Data.value[0].isError2 = true;
}else{
} else {
step3Data.value[0].isError2 = false;
}
// console.log(89);
@ -1572,20 +1572,20 @@ const step4Submit = () => {
if (step4Data.value[i].params1 != step4RightAnswer.value[i]) {
step4Error.value++;
step4Data.value[i].isError = true;
}else{
} else {
step4Data.value[i].isError = false;
}
}
if (step4DataTable2.value[0].params1 != "20") {
step4Error.value++;
step4DataTable2.value[0].isError = true;
}else{
} else {
step4DataTable2.value[0].isError = false;
}
if (step4DataTable2.value[1].params1 != "3") {
step4Error.value++;
step4DataTable2.value[1].isError = true;
}else{
} else {
step4DataTable2.value[1].isError = false;
}
console.log(step4Error.value, "错误数");
@ -1660,6 +1660,75 @@ const saveData = () => {
.then((res) => {})
.catch((error) => {});
};
const saveSubmitData = () => {
let infoList = [];
for (let i in step1Data.value) {
infoList.push({
loginTime: step1Data.value[i].date,
activeUser: parseInt(step1Data.value[i].params1),
activeUserRate: parseFloat(step1Data.value[i].params2),
activeUserTime: parseFloat(step1Data.value[i].params3),
});
}
const params = {
stepFiveA: step2Data.value[0].params1,
stepFiveB: step2Data.value[0].params2,
stepFiveC: step2Data.value[1].params1,
stepFiveD: step2Data.value[1].params2,
stepSixA: step2Data.value[2].params1,
stepSixB: step2Data.value[2].params2,
stepSixC: step2Data.value[3].params1,
stepSixD: step2Data.value[3].params2,
stepSevenA: step3Data.value[0].params1,
stepSevenB: step3Data.value[0].params2,
stepSevenC: step4Data.value[0].params1,
stepSevenD: step4Data.value[1].params1,
stepEightA: step4Data.value[2].params1,
stepEightB: step4Data.value[3].params1,
stepEightC: step4Data.value[4].params1,
stepEightD: step4Data.value[5].params1,
stepNineA: step4Data.value[6].params1,
stepNineB: step4Data.value[7].params1,
stepNineC: step4Data.value[8].params1,
stepNineD: step4Data.value[9].params1,
stepTenA: step4DataTable2.value[0].params1,
stepTenB: step4DataTable2.value[1].params1,
stepTenC: analysisConclusionStep1.value,
stepTenD: analysisConclusionStep2.value,
stepElevenA: analysisConclusionStep3.value,
stepOneA: analysisConclusionStep4.value,
// stepOneB: step1Data.value[8].params3,
// stepOneC: step1Data.value[9].params1,
// stepOneD: step1Data.value[9].params2,
// stepTwoA: step1Data.value[9].params3,
// stepTwoB: step4Data.value[6].params2,
// stepTwoC: step5DataTable2.value[0].params,
// stepThreeA: step5DataTable2.value[1].params,
// stepThreeB: step5DataTable2.value[2].params,
// stepThreeC: step5DataTable2.value[3].params,
// stepThreeD: step5DataTable2.value[4].params,
// stepFourA: step5DataTable3.value[0].params1,
// stepFourB: step5DataTable3.value[0].params2,
// stepFourC: step5DataTable3.value[1].params1,
// stepFourD: step5DataTable3.value[1].params2,
// stepNewOne: step5DataTable3.value[2].params1,
// stepNewTwo: step5DataTable3.value[2].params2,
// stepNewThree: step5DataTable3.value[3].params1,
// stepNewFive: step5DataTable3.value[3].params2,
// stepNewSix: step5DataTable3.value[4].params1,
// stepNewEight: step5DataTable3.value[4].params2,
stuMachineLearningInfoDTOList: infoList,
};
portraitModel
.saveData({
userId: JSON.parse(getUserInfo()).userId,
module: "用户粘性分析",
...params,
subState: 1,
})
.then((res) => {})
.catch((error) => {});
};
const getData = () => {
portraitModel
.getData({
@ -1720,6 +1789,69 @@ const getData = () => {
// step5DataTable3.value[3].params2 = res.data.stepNewFive;
// step5DataTable3.value[4].params1 = res.data.stepNewSix;
// step5DataTable3.value[4].params2 = res.data.stepNewEight;
//回显答案
if (res.data.subState & (res.data.subState == 1)) {
showAnswerFlag.value = true;
for (let i in step1Data.value) {
if (step1Data.value[i].params1 != step1RightAnswer.value[i].activeNum) {
step1Data.value[i].isError1 = true;
} else {
step1Data.value[i].isError1 = false;
}
if (step1Data.value[i].params2 != step1RightAnswer.value[i].activeRate) {
step1Data.value[i].isError2 = true;
} else {
step1Data.value[i].isError2 = false;
}
if (step1Data.value[i].params3 != step1RightAnswer.value[i].activeTime) {
step1Data.value[i].isError3 = true;
} else {
step1Data.value[i].isError3 = false;
}
}
for (let i in step2Data.value) {
if (step2Data.value[i].params1 != step2RightAnswer.value[i].num) {
step2Data.value[i].isError1 = true;
} else {
step2Data.value[i].isError1 = false;
}
if (step2Data.value[i].params2 != step2RightAnswer.value[i].ratio) {
step2Data.value[i].isError2 = true;
} else {
step2Data.value[i].isError2 = false;
}
}
if (step3Data.value[0].params1 != "10") {
step3Data.value[0].isError1 = true;
} else {
step3Data.value[0].isError1 = false;
}
if (step3Data.value[0].params2 != "100") {
step3Data.value[0].isError2 = true;
} else {
step3Data.value[0].isError2 = false;
}
for (let i in step4Data.value) {
if (step4Data.value[i].params1 != step4RightAnswer.value[i]) {
step4Data.value[i].isError = true;
} else {
step4Data.value[i].isError = false;
}
}
if (step4DataTable2.value[0].params1 != "20") {
step4DataTable2.value[0].isError = true;
} else {
step4DataTable2.value[0].isError = false;
}
if (step4DataTable2.value[1].params1 != "3") {
step4DataTable2.value[1].isError = true;
} else {
step4DataTable2.value[1].isError = false;
}
}
})
.catch((error) => {});
};
@ -1751,16 +1883,18 @@ const submitData = () => {
.then((res) => {
proxy.$modal.msgSuccess("提交成功");
showAnswerFlag.value = true;
saveSubmitData();
})
.catch((error) => {});
};
const retrain = () => {
portraitModel
.retrain({
userId: JSON.parse(getUserInfo()).userId,
module: "用户粘性分析",
})
.then((res) => {
showAnswerFlag.value = false;
// portraitModel
// .retrain({
// userId: JSON.parse(getUserInfo()).userId,
// module: "用户粘性分析",
// })
// .then((res) => {
proxy.$modal.msgSuccess("重新实训成功");
for (let i in step1Data.value) {
@ -1787,8 +1921,8 @@ const retrain = () => {
analysisConclusionStep3.value = "";
analysisConclusionStep4.value = "";
// dayValue.value = "";
})
.catch((error) => {});
// })
// .catch((error) => {});
};
defineExpose({
submitData,

@ -3,7 +3,7 @@
<div class="tabList">
<div class="tabs" v-for="item in tabList" :key="item.id" @click="changeTab(item)">
<div style="display: flex; align-items: center">
<img :src="item.backImg" alt="" />
<img :src="getAssetsFile(item.backImg)" alt="" />
<span>{{ item.title }}</span>
</div>
</div>
@ -143,6 +143,7 @@
<script setup>
import * as portraitModel from "@/api/portraitModel";
import mainContent from "@/views/components/mainContent.vue";
import {getAssetsFile} from '@/utils/index.js'
import { onMounted } from "vue";
const { proxy } = getCurrentInstance();
const currentComponent = ref(null);
@ -155,61 +156,61 @@ const tabList = ref([
id: "1",
key: () => import("./components/rfmAnalysis.vue"),
title: "RFM分析",
backImg: "/src/assets/images/icon1.png",
backImg: "icon1.png",
},
{
id: "2",
key: () => import("./components/abcAnalysis.vue"),
title: "帕累托/ABC分析",
backImg: "/src/assets/images/icon2.png",
backImg: "icon2.png",
},
{
id: "3",
key: () => import("./components/bostonAnalysis.vue"),
title: "波士顿矩阵分析",
backImg: "/src/assets/images/icon3.png",
backImg: "icon3.png",
},
{
id: "4",
key: () => import("./components/funnelAnalysis.vue"),
title: "转化分析-漏斗模型",
backImg: "/src/assets/images/icon4.png",
backImg: "icon4.png",
},
{
id: "5",
key: () => import("./components/basketAnalysis.vue"),
title: "购物篮分析",
backImg: "/src/assets/images/icon5.png",
backImg: "icon5.png",
},
{
id: "6",
key: () => import("./components/repurchaseAnalysis.vue"),
title: "复购分析",
backImg: "/src/assets/images/icon6.png",
backImg: "icon6.png",
},
{
id: "7",
key: () => import("./components/retainAnalysis.vue"),
title: "留存分析",
backImg: "/src/assets/images/icon7.png",
backImg: "icon7.png",
},
{
id: "8",
key: () => import("./components/viscosityAnalysis.vue"),
title: "用户粘性分析",
backImg: "/src/assets/images/icon8.png",
backImg: "icon8.png",
},
{
id: "9",
key: () => import("./components/AARRRAnalysis.vue"),
title: "AARRR用户运营分析",
backImg: "/src/assets/images/icon9.png",
backImg: "icon9.png",
},
{
id: "10",
key: () => import("./components/portraitAnalysis.vue"),
title: "用户画像分析",
backImg: "/src/assets/images/icon10.png",
backImg: "icon10.png",
},
]);
// defineExpose({ submitMethod });

@ -2,7 +2,7 @@
* @Author: qinzhenpen qzp1807@126.com
* @Date: 2024-08-16 09:16:26
* @LastEditors: qinzhenpen qzp1807@126.com
* @LastEditTime: 2024-08-27 10:15:10
* @LastEditTime: 2024-08-28 17:51:46
* @FilePath: \vue3\src\views\visual-analysis\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->

Loading…
Cancel
Save