From e9d5ca0ce726b52d098422c4023b98b2d7755eec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E4=BD=B3=20=E5=8D=9A?= <12742597+fang-jiabo@user.noreply.gitee.com> Date: Thu, 22 Aug 2024 14:17:26 +0800 Subject: [PATCH] 'tj' --- .../components/associationRuleMining.vue | 24 +++++++++++++++-- .../components/clusterAnalysis.vue | 27 ++++++++++++++++--- .../components/regressionAnalysis.vue | 21 +++++++++++++-- 3 files changed, 64 insertions(+), 8 deletions(-) diff --git a/src/views/digitalMarketingAlgorithms/components/associationRuleMining.vue b/src/views/digitalMarketingAlgorithms/components/associationRuleMining.vue index de71cb8..90b6d06 100644 --- a/src/views/digitalMarketingAlgorithms/components/associationRuleMining.vue +++ b/src/views/digitalMarketingAlgorithms/components/associationRuleMining.vue @@ -78,7 +78,7 @@
- +
分析数据: @@ -89,7 +89,7 @@
分析结果: 下载 - + @@ -344,6 +344,8 @@ const task=()=>{ dialogVisible.value = false proxy.$modal.msgSuccess("提交完成!"); } +const scrollbar = ref(null); +const loading1=ref(false) const dialogVisible = ref(false); const runResultShow = ref(false); const tableLabel = reactive([{ prop: "date", label: "" }]); @@ -550,6 +552,7 @@ const computation = () => { return; } if (input5.value && input6.value && input4.value) { + loading1.value=true const sendData = { confidence: parseFloat(input5.value) / 100, support: parseFloat(input6.value) / 100, @@ -567,6 +570,23 @@ const computation = () => { }); } tableData3.value = res.data; + //一秒后执行 + setTimeout(() => { + loading1.value=false + },500) + nextTick(() => { + setTimeout(() => { + const scrollContainer = scrollbar.value?.$el.querySelector(".el-scrollbar__wrap"); + if (scrollContainer) { + scrollContainer.scrollTo({ + top: scrollContainer.scrollHeight, + behavior: "smooth", // 平滑滚动 + }); + } + }, 500); + }); + }).catch(()=>{ + loading1.value=false }); } else { proxy.$modal.msgWarning("请模型参数进行设置!"); diff --git a/src/views/digitalMarketingAlgorithms/components/clusterAnalysis.vue b/src/views/digitalMarketingAlgorithms/components/clusterAnalysis.vue index 3330e6c..735b2d5 100644 --- a/src/views/digitalMarketingAlgorithms/components/clusterAnalysis.vue +++ b/src/views/digitalMarketingAlgorithms/components/clusterAnalysis.vue @@ -28,7 +28,7 @@
- + @@ -82,7 +82,7 @@
分析数据: - + @@ -90,7 +90,7 @@
分析结果: 下载 - + @@ -282,6 +282,9 @@ import JSZip from "jszip"; import * as API from "@/api/AI.js"; import { getUserInfo } from "@/utils/auth"; import { onMounted, reactive } from "vue"; +const loading1=ref(false) +const loading2=ref(false) +const loading3=ref(false) const runResultShow = ref(false); const { proxy } = getCurrentInstance(); const dialogVisible = ref(false); @@ -379,7 +382,7 @@ onMounted(() => { { type: "scatter", encode: { tooltip: [0, 1] }, - symbolSize: 15, + symbolSize: 8, itemStyle: { borderColor: "#555", }, @@ -393,6 +396,7 @@ onMounted(() => { }); const optionData=()=>{ + loading1.value=true API.viewingMetrics({userId:JSON.parse(getUserInfo()).userId,tableName:input.value,algorithmName:'聚类分析'}).then((res)=>{ tableData.value=[] input3.value='' @@ -401,6 +405,9 @@ onMounted(() => { text:element }) }) + loading1.value=false + }).catch(()=>{ + loading1.value=false }) } const selectedRows = ref([]); @@ -491,11 +498,17 @@ const optionData2 = () => { method: input3.value, userId: JSON.parse(getUserInfo()).userId, }); + loading2.value=true API.dataPreprocessing(sendData.value).then((res) => { resTable2.value = res.data; tableData2.value = []; tableData2.value = res.data; proxy.$modal.msgSuccess("预处理成功!"); + setTimeout(() => { + loading1.value=false + },500) + }).catch(()=>{ + loading2.value=false }); } }; @@ -509,6 +522,7 @@ const computation = () => { return; } if (input5.value && input6.value && input4.value) { + loading3.value=true const sendData = { k: input5.value, t: input6.value, @@ -571,7 +585,12 @@ const computation = () => { Object.keys(res.data.centroid).forEach((key) => { addData(myChart2, res.data.centroid[key], "red"); }); + setTimeout(() => { + loading1.value=false + },500) }); + }).catch(()=>{ + loading3.value=false }); nextTick(() => { setTimeout(() => { diff --git a/src/views/digitalMarketingAlgorithms/components/regressionAnalysis.vue b/src/views/digitalMarketingAlgorithms/components/regressionAnalysis.vue index edd79e2..18bc42e 100644 --- a/src/views/digitalMarketingAlgorithms/components/regressionAnalysis.vue +++ b/src/views/digitalMarketingAlgorithms/components/regressionAnalysis.vue @@ -86,7 +86,7 @@
分析数据: - + @@ -94,7 +94,7 @@
分析结果: 下载 - +