修复数字营销算法页面bug

dev-QQq
方佳 博 2 years ago
parent 69497fed71
commit 7760909153

Binary file not shown.

@ -15,7 +15,7 @@ const useAlgorithmStore = defineStore("algorithm", {
userDatabase: [], userDatabase: [],
tableData: [], tableData: [],
tableKey:[], tableKey:[],
userDataLabel:["用户属性表", "用户登录活跃表", "用户消费能力表", "用户行为表", "用户评论表"], //用户数据标签 userDataLabel:["用户属性表"], //用户数据标签
userDataLabel2:["用户商品评论数据"], userDataLabel2:["用户商品评论数据"],
indexLibrary: [], indexLibrary: [],
analysisData: [], analysisData: [],

@ -1,5 +1,5 @@
<template> <template>
<div class="rgzn_top app-container2"> <div class="rgzn_top app-container2" v-loading="loading" element-loading-text="Loading..." :element-loading-spinner="svg" element-loading-svg-view-box="-10, -10, 50, 50" element-loading-background="rgba(122, 122, 122, 0.8)">
<div class="top_item"> <div class="top_item">
<el-button :class="{ active: isActive === 1 }" @click="activeIndex(1)"></el-button> <el-button :class="{ active: isActive === 1 }" @click="activeIndex(1)"></el-button>
<el-button :class="{ active: isActive === 2 }" @click="activeIndex(2)"></el-button> <el-button :class="{ active: isActive === 2 }" @click="activeIndex(2)"></el-button>
@ -14,6 +14,27 @@
</div> </div>
</template> </template>
<script setup> <script setup>
import * as portraitModel from "@/api/portraitModel";
import useAlgorithmStore from "@/store/modules/algorithm.js";
import { getUserInfo } from "@/utils/auth";
const userInfo = JSON.parse(getUserInfo());
const algorithmStore = useAlgorithmStore();
const selectZJ = (item) => {
loading.value = true
portraitModel.getUserTableInfo({ userId: userInfo.userId }).then((res) => {
algorithmStore.userDataLabel = [...res?.data.tableNames, ...res.data.selfBuiltTable].filter((item) => item !== "用户评论表");
if (algorithmStore.userDataLabel.length > 1) {
setTimeout(() => {
loading.value = false;
}, 500);
} else {
setTimeout(() => {
loading.value = false;
}, 500);
}
});
};
const loading = ref(false);
const route = useRoute(); const route = useRoute();
const pageData = [defineAsyncComponent(() => import("./components/bigData.vue")), defineAsyncComponent(() => import("./components/descriptiveStatistics.vue")), defineAsyncComponent(() => import("./components/clusterAnalysis.vue")), defineAsyncComponent(() => import("./components/associationRuleMining.vue")), defineAsyncComponent(() => import("./components/regressionAnalysis.vue")), defineAsyncComponent(() => import("./components/emotion-analysis.vue"))]; const pageData = [defineAsyncComponent(() => import("./components/bigData.vue")), defineAsyncComponent(() => import("./components/descriptiveStatistics.vue")), defineAsyncComponent(() => import("./components/clusterAnalysis.vue")), defineAsyncComponent(() => import("./components/associationRuleMining.vue")), defineAsyncComponent(() => import("./components/regressionAnalysis.vue")), defineAsyncComponent(() => import("./components/emotion-analysis.vue"))];
const component = ref(pageData[0]); const component = ref(pageData[0]);
@ -23,17 +44,18 @@ const activeIndex = (index) => {
component.value = pageData[index - 1]; component.value = pageData[index - 1];
}; };
const map = { const map = {
'用户数据库': 1, 用户数据库: 1,
'描述性统计': 2, 描述性统计: 2,
'关联规则挖掘': 3, 关联规则挖掘: 3,
'聚类分析': 4, 聚类分析: 4,
'回归分析': 5, 回归分析: 5,
'情感分析': 6, 情感分析: 6,
}; };
onMounted(()=>{ onMounted(() => {
isActive.value= map[route.meta.title]; isActive.value = map[route.meta.title];
component.value= pageData[map[route.meta.title]-1]; component.value = pageData[map[route.meta.title] - 1];
}) selectZJ();
});
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -42,6 +64,7 @@ onMounted(()=>{
} }
.rgzn_top { .rgzn_top {
margin-top: 20px; margin-top: 20px;
height: calc(100vh - 100px);
.top_item { .top_item {
img { img {
margin-right: 5px; margin-right: 5px;

Loading…
Cancel
Save