From 5982043afdf7b0944d724ce5fdd37a5d33fc3df1 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 10:19:25 +0800 Subject: [PATCH 1/5] 'tj' --- src/api/AI.js | 8 ++++++++ .../bigData/components/digitalMarketing.vue | 4 ++-- .../components/clusterAnalysis.vue | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/api/AI.js b/src/api/AI.js index 4b56e0e..6cb66b4 100644 --- a/src/api/AI.js +++ b/src/api/AI.js @@ -96,4 +96,12 @@ export function logisticRegression(data) { method: 'post', data:data, }) +} +//实训任务提交 +export function submit(data) { + return request({ + url: "/api/userBehavior/practicalTrainingSubmission", + method: "post", + params: data, + }); } \ No newline at end of file diff --git a/src/views/digitalMarketTech/bigData/components/digitalMarketing.vue b/src/views/digitalMarketTech/bigData/components/digitalMarketing.vue index b420dea..be563da 100644 --- a/src/views/digitalMarketTech/bigData/components/digitalMarketing.vue +++ b/src/views/digitalMarketTech/bigData/components/digitalMarketing.vue @@ -1068,9 +1068,9 @@ const sendTask=async()=>{ } try{ const sendData={ - module:'数字金融', + module:'Apriori关联算法', numberOfErrors:errorNumber > 10 ? 10 : errorNumber, - taskName:'数字营销', + taskName:'Apriori关联算法', userId:JSON.parse(getUserInfo()).userId } const res=await submitTrainingTask(sendData) diff --git a/src/views/digitalMarketingAlgorithms/components/clusterAnalysis.vue b/src/views/digitalMarketingAlgorithms/components/clusterAnalysis.vue index eb5fa34..3330e6c 100644 --- a/src/views/digitalMarketingAlgorithms/components/clusterAnalysis.vue +++ b/src/views/digitalMarketingAlgorithms/components/clusterAnalysis.vue @@ -298,7 +298,7 @@ const formInline2=reactive({ const task=()=>{ dialogVisible.value = false proxy.$modal.msgSuccess("提交完成!"); -} +} const algorithmicKnowledge = () => { runResultShow.value = true; }; From b4afe5585623581ed0fdb6ca3538a599def9ab4e 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 13:39:23 +0800 Subject: [PATCH 2/5] 'tj' --- src/api/AI.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/AI.js b/src/api/AI.js index 6cb66b4..80816f5 100644 --- a/src/api/AI.js +++ b/src/api/AI.js @@ -14,7 +14,7 @@ export function selectionMetrics(data) { return request({ url: '/api/model/dropdownBox', method: 'post', - data:data, + params:data, }) } //选择指标--查看指标 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 3/5] '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 @@
分析结果: 下载 - +