diff --git a/src/api/portraitModel.js b/src/api/portraitModel.js index 9800b47..bc23910 100644 --- a/src/api/portraitModel.js +++ b/src/api/portraitModel.js @@ -67,20 +67,20 @@ export function downloadDataByRepurchase(data) { } //数据下载-留存分析 export function downloadDataByRetain(data) { - return request({ - url: "/api/downDataByUserPortrait/analysisByRetention", - method: "get", - params: data, - }); - } + return request({ + url: "/api/downDataByUserPortrait/analysisByRetention", + method: "get", + params: data, + }); +} //数据下载-用户粘性分析 export function downloadDataByViscosity(data) { - return request({ - url: "/api/downDataByUserPortrait/analysisByStickiness", - method: "get", - params: data, - }); - } + return request({ + url: "/api/downDataByUserPortrait/analysisByStickiness", + method: "get", + params: data, + }); +} //筛选出统计样本 export function filterOutStatisSample(data) { return request({ @@ -129,3 +129,12 @@ export function uploadFile(data) { data: data, }); } +// 评论点抽取 +export function getCommentPoint(data) { + return request({ + url: "/v1/singleEmotionAnalysis/", + baseURL: "http://192.168.2.14:8000", + method: "post", + data: data, + }); +} diff --git a/src/store/modules/algorithm.js b/src/store/modules/algorithm.js index 6dcccd6..1363bc8 100644 --- a/src/store/modules/algorithm.js +++ b/src/store/modules/algorithm.js @@ -1,3 +1,11 @@ +/* + * @Author: qinzhenpen qzp1807@126.com + * @Date: 2024-08-16 17:56:32 + * @LastEditors: qinzhenpen qzp1807@126.com + * @LastEditTime: 2024-08-26 15:26:20 + * @FilePath: \digital-marketing\src\store\modules\algorithm.js + * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + */ import Cookies from "js-cookie"; import * as portraitModel from "@/api/portraitModel"; import * as marketingAlgorithmApi from "@/api/marketing-algorithm.js"; @@ -8,7 +16,7 @@ const useAlgorithmStore = defineStore("algorithm", { tableData: [], tableKey:[], userDataLabel:["用户属性表", "用户登录活跃表", "用户消费能力表", "用户行为表", "用户评论表"], //用户数据标签 - userDataLabel2:["用户属性表", "用户登录活跃表", "用户消费能力表", "用户行为表", "用户评论表"], + userDataLabel2:["用户评论表"], indexLibrary: [], analysisData: [], }), diff --git a/src/utils/request.js b/src/utils/request.js index 8d85d2f..ca747ea 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -1,3 +1,4 @@ + import axios from "axios"; import { ElNotification, ElMessageBox, ElMessage, ElLoading } from "element-plus"; import { getToken } from "@/utils/auth"; @@ -16,8 +17,8 @@ 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://192.168.2.16:9868/', + // baseURL: "http://118.31.7.2:9868/", + baseURL:'http://192.168.2.14:9868/', // 超时 timeout: 100000, }); diff --git a/src/views/digitalMarketingAlgorithms/components/associationRuleMining.vue b/src/views/digitalMarketingAlgorithms/components/associationRuleMining.vue index 9dd5e19..14f6413 100644 --- a/src/views/digitalMarketingAlgorithms/components/associationRuleMining.vue +++ b/src/views/digitalMarketingAlgorithms/components/associationRuleMining.vue @@ -2,7 +2,7 @@
任务描述 -

(给出任务清单参考,做哪些数据的统计分析)Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean euismod bibendum laoreet. Proin gravida dolor sit amet lacus accumsan et viverra justo commodo. Proin sodales pulvinar sic tempor. Sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam fermentum, nulla luctus pharetra vulputate, felis tellus mollis orci, sed rhoncus pronin sapien nunc accuan eget.

+

使用“购物车数据”,对所购商品进行购物篮分析(关联规则挖掘),并提交实训任务。

diff --git a/src/views/digitalMarketingAlgorithms/components/bigData.vue b/src/views/digitalMarketingAlgorithms/components/bigData.vue index 9f0f65e..be77274 100644 --- a/src/views/digitalMarketingAlgorithms/components/bigData.vue +++ b/src/views/digitalMarketingAlgorithms/components/bigData.vue @@ -16,9 +16,9 @@
- - - +
+ {{ item }} +
@@ -49,13 +49,12 @@ import { getUserInfo } from "@/utils/auth"; const userInfo = JSON.parse(getUserInfo()); const loading = ref(false); const fileData = ref(null); -const userStore = useUserStore(); const algorithmStore = useAlgorithmStore(); // 数据表query const n_dataTableQuery = ref({ index: 1, size: 7, - tableName: "用户属性表", + tableName: "", userId: userInfo.userId, }); const datatotal = ref(0); @@ -64,40 +63,42 @@ const nzData = ref([]); const zjIndex = ref(-1); const zjData = ref([]); const tableLabel = ref([ - { prop: "id", label: "用户ID" }, - { prop: "loginName", label: "登录名" }, - { prop: "userName", label: "用户姓名" }, - { prop: "studentId", label: "学号" }, - { prop: "stuClass", label: "班级" }, - { prop: "major", label: "专业" }, - { prop: "school", label: "学校" }, - { prop: "roleName", label: "角色名称" }, - { prop: "roleGender", label: "角色性别" }, - { prop: "roleAge", label: "角色年龄" }, - { prop: "updateTime", label: "注册时间" }, - { prop: "location", label: "所在地" }, + { prop: "id", label: "ID" }, + { prop: "age", label: "年龄" }, + { prop: "annualIncome", label: "年收入" }, + { prop: "spendingScore", label: "消费水平" }, + { prop: "consumerGoods", 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 tableLabel2 = ref([]); const arrhander = ref([]); const arrhanderkey = ref([]); +const arrMap = { + 客户细分数据表: tableLabel.value, + 销售预测数据表: tableLabel4.value, + 购物车数据表: tableLabel5.value, + 用户评论表: tableLabel3.value, +}; const goNZ = (index, item) => { nzIndex.value = index; - zjIndex.value = -1; - tableLabel.value = [ - { prop: "id", label: "用户ID" }, - { prop: "loginName", label: "登录名" }, - { prop: "userName", label: "用户姓名" }, - { prop: "studentId", label: "学号" }, - { prop: "stuClass", label: "班级" }, - { prop: "major", label: "专业" }, - { prop: "school", label: "学校" }, - { prop: "roleName", label: "角色名称" }, - { prop: "roleGender", label: "角色性别" }, - { prop: "roleAge", label: "角色年龄" }, - { prop: "updateTime", label: "注册时间" }, - { prop: "location", label: "所在地" }, - ]; + tableLabel.value = arrMap[item]; n_dataTableQuery.value.tableName = item; delete n_dataTableQuery.value.selfTableName; getSurface(); @@ -113,9 +114,11 @@ const headerCellStyle = () => { }; }; // 选择内置或自建 -const selectType = (type) => { +const selectType = (type, idx) => { delete n_dataTableQuery.value.tableName; + n_dataTableQuery.value.selfTableName = type; getSurface(); + zjIndex.value = idx; nzIndex.value = -1; }; const getSurface = () => { @@ -163,7 +166,9 @@ const importData = (e) => { const selectZJ = (item) => { portraitModel.getUserTableInfo({ userId: userInfo.userId }).then((res) => { nzData.value = res.data.tableNames; - algorithmStore.userDataLabel = [...res?.data.tableNames, ...res.data.selfBuiltTable]; + n_dataTableQuery.value.tableName = nzData.value[0]; + getSurface(); + algorithmStore.userDataLabel = [...res?.data.tableNames, ...res.data.selfBuiltTable].filter((item) => item !== "用户评论表"); }); }; // 查询自建下拉框 @@ -174,7 +179,6 @@ const getZJData = () => { }; onMounted(() => { selectZJ(); - getSurface(); getZJData(); }); diff --git a/src/views/digitalMarketingAlgorithms/components/clusterAnalysis.vue b/src/views/digitalMarketingAlgorithms/components/clusterAnalysis.vue index 53d7e31..5642e8f 100644 --- a/src/views/digitalMarketingAlgorithms/components/clusterAnalysis.vue +++ b/src/views/digitalMarketingAlgorithms/components/clusterAnalysis.vue @@ -2,7 +2,7 @@
任务描述 -

(给出任务清单参考,做哪些数据的统计分析)Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean euismod bibendum laoreet. Proin gravida dolor sit amet lacus accumsan et viverra justo commodo. Proin sodales pulvinar sic tempor. Sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam fermentum, nulla luctus pharetra vulputate, felis tellus mollis orci, sed rhoncus pronin sapien nunc accuan eget.

+

使用“客户细分数据”,对客户进行聚类分析,并提交实训任务。

diff --git a/src/views/digitalMarketingAlgorithms/components/descriptiveStatistics.vue b/src/views/digitalMarketingAlgorithms/components/descriptiveStatistics.vue index 0bc7e13..597259e 100644 --- a/src/views/digitalMarketingAlgorithms/components/descriptiveStatistics.vue +++ b/src/views/digitalMarketingAlgorithms/components/descriptiveStatistics.vue @@ -1,7 +1,7 @@