dev-QQq
qinzhenpen 2 years ago
parent eb7d300d54
commit 25b8c2a2a3

@ -2,4 +2,4 @@
{ {
"htmlWhitespaceSensitivity": "ignore", "htmlWhitespaceSensitivity": "ignore",
"printWidth": 1000 "printWidth": 1000
} }

Binary file not shown.

@ -2,7 +2,7 @@
* @Author: qinzhenpen qzp1807@126.com * @Author: qinzhenpen qzp1807@126.com
* @Date: 2024-08-16 10:14:59 * @Date: 2024-08-16 10:14:59
* @LastEditors: qinzhenpen qzp1807@126.com * @LastEditors: qinzhenpen qzp1807@126.com
* @LastEditTime: 2024-08-19 15:07:27 * @LastEditTime: 2024-08-22 11:40:05
* @FilePath: \vue3\src\api\marketing-algorithm.js * @FilePath: \vue3\src\api\marketing-algorithm.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
@ -73,3 +73,11 @@ export function getMarketingAlgorithmSentiment(data) {
data, data,
}); });
} }
// 情感倾向分析
export function getMarketingAlgorithmSentimentAnalysis(data) {
return request({
url: "/api/python/sentimentAnaly",
method: "POST",
data,
});
}

@ -7,6 +7,14 @@ export function getUserTableData(data) {
params: data, params: data,
}); });
} }
// 查询用户数据基本信息
export function getUserTableInfo(params) {
return request({
url: "/api/userprofile/getBaseInfo",
method: "get",
params,
});
}
//数据下载-RFM分析 //数据下载-RFM分析
export function downloadDataByRFM(data) { export function downloadDataByRFM(data) {
return request({ return request({

@ -135,7 +135,10 @@ aside {
.pagination-container { .pagination-container {
margin-top: 30px; margin-top: 30px;
background-color: transparent !important; background-color: transparent !important;
.el-pagination__total,.el-pagination__goto,.el-pagination__classifier{
.el-pagination__total,
.el-pagination__goto,
.el-pagination__classifier {
color: #ffffff !important; color: #ffffff !important;
} }
} }
@ -211,7 +214,8 @@ aside {
.el-button--large.is-round { .el-button--large.is-round {
padding: 12px 20px 12px 40px !important; padding: 12px 20px 12px 40px !important;
} }
.el-button{
.el-button {
width: 89px; width: 89px;
height: 31px; height: 31px;
padding: 12px 20px 12px 40px !important; padding: 12px 20px 12px 40px !important;
@ -223,36 +227,43 @@ aside {
.app-container2 { .app-container2 {
margin: 10px; margin: 10px;
box-shadow: 0px 0px 13px 0px #0452C6; // box-shadow: 0px 0px 13px 0px #0452C6;
border-radius: 10px; border-radius: 10px;
padding: 25px 25px 10px 25px; // padding: 25px 25px 10px 25px;
} }
.dialogClass{
background:url('@/assets/images/弹框.png') !important; .dialogClass {
background: url('@/assets/images/弹框.png') !important;
background-size: 100% 100% !important; background-size: 100% 100% !important;
.el-dialog__header{
.el-dialog__header {
padding: 5px 0px; padding: 5px 0px;
margin-right: 5px !important; margin-right: 5px !important;
.gbImg{
.gbImg {
cursor: pointer; cursor: pointer;
width: 51px; width: 51px;
height: 31px; height: 31px;
background-size: 100% 100%; background-size: 100% 100%;
} }
} }
.xtImg{
.xtImg {
margin-left: 18px; margin-left: 18px;
width: 530px; width: 530px;
}
} }
}
.my-header { .my-header {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: space-between; justify-content: space-between;
gap: 16px; gap: 16px;
text-align: center; text-align: center;
span{
span {
color: #FFFFFF; color: #FFFFFF;
padding: 38px 20px 0; padding: 38px 20px 0;
}
} }
}

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

@ -1,95 +1,102 @@
import axios from 'axios' import axios from "axios";
import { ElNotification , ElMessageBox, ElMessage, ElLoading } from 'element-plus' import { ElNotification, ElMessageBox, ElMessage, ElLoading } from "element-plus";
import { getToken } from '@/utils/auth' import { getToken } from "@/utils/auth";
import errorCode from '@/utils/errorCode' import errorCode from "@/utils/errorCode";
import { tansParams, blobValidate } from '@/utils/ruoyi' import { tansParams, blobValidate } from "@/utils/ruoyi";
import cache from '@/plugins/cache' import cache from "@/plugins/cache";
import { saveAs } from 'file-saver' import { saveAs } from "file-saver";
import useUserStore from '@/store/modules/user' import useUserStore from "@/store/modules/user";
let downloadLoadingInstance; let downloadLoadingInstance;
// 是否显示重新登录 // 是否显示重新登录
export let isRelogin = { show: false }; export let isRelogin = { show: false };
axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8' axios.defaults.headers["Content-Type"] = "application/json;charset=utf-8";
// 创建axios实例 // 创建axios实例
const service = axios.create({ const service = axios.create({
// axios中请求配置有baseURL选项表示请求URL公共部分 // axios中请求配置有baseURL选项表示请求URL公共部分
// baseURL: import.meta.env.VITE_APP_BASE_API, // baseURL: import.meta.env.VITE_APP_BASE_API,
// baseURL:'http://118.31.7.2:9868/', // baseURL: "http://118.31.7.2:9868/",
baseURL:'http://192.168.2.28:9868/', baseURL: "http://192.168.2.4:9868/",
// 超时 // 超时
timeout: 100000 timeout: 100000,
}) });
// request拦截器 // request拦截器
service.interceptors.request.use(config => { service.interceptors.request.use(
(config) => {
// 是否需要设置 token // 是否需要设置 token
const isToken = (config.headers || {}).isToken === false const isToken = (config.headers || {}).isToken === false;
// 是否需要防止数据重复提交 // 是否需要防止数据重复提交
const isRepeatSubmit = (config.headers || {}).repeatSubmit === false const isRepeatSubmit = (config.headers || {}).repeatSubmit === false;
if (getToken() && !isToken) { if (getToken() && !isToken) {
config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 config.headers["Authorization"] = "Bearer " + getToken(); // 让每个请求携带自定义token 请根据实际情况自行修改
} }
// get请求映射params参数 // get请求映射params参数
if (config.method === 'get' && config.params) { if (config.method === "get" && config.params) {
let url = config.url + '?' + tansParams(config.params); let url = config.url + "?" + tansParams(config.params);
url = url.slice(0, -1); url = url.slice(0, -1);
config.params = {}; config.params = {};
config.url = url; config.url = url;
} }
if (!isRepeatSubmit && (config.method === 'post' || config.method === 'put')) { if (!isRepeatSubmit && (config.method === "post" || config.method === "put")) {
const requestObj = { const requestObj = {
url: config.url, url: config.url,
data: typeof config.data === 'object' ? JSON.stringify(config.data) : config.data, data: typeof config.data === "object" ? JSON.stringify(config.data) : config.data,
time: new Date().getTime() time: new Date().getTime(),
};
const sessionObj = cache.session.getJSON("sessionObj");
} }
const sessionObj = cache.session.getJSON('sessionObj') return config;
},
(error) => {
console.log(error);
Promise.reject(error);
} }
return config );
}, error => {
console.log(error)
Promise.reject(error)
})
// 响应拦截器 // 响应拦截器
service.interceptors.response.use(res => { service.interceptors.response.use(
(res) => {
// 未设置状态码则默认成功状态 // 未设置状态码则默认成功状态
const code = res.data.code || 200; const code = res.data.code || 200;
// console.log(code); // console.log(code);
// 获取错误信息 // 获取错误信息
const msg = errorCode[code] || res.data.msg || errorCode['default'] const msg = errorCode[code] || res.data.msg || errorCode["default"];
// 二进制数据则直接返回 // 二进制数据则直接返回
if (res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer') { if (res.request.responseType === "blob" || res.request.responseType === "arraybuffer") {
return res.data return res.data;
} }
if (code === 401) { if (code === 401) {
if (!isRelogin.show) { if (!isRelogin.show) {
isRelogin.show = true; isRelogin.show = true;
ElMessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { confirmButtonText: '重新登录', cancelButtonText: '取消', type: 'warning' }).then(() => { ElMessageBox.confirm("登录状态已过期,您可以继续留在该页面,或者重新登录", "系统提示", { confirmButtonText: "重新登录", cancelButtonText: "取消", type: "warning" })
.then(() => {
isRelogin.show = false; isRelogin.show = false;
useUserStore().logOut().then(() => { useUserStore()
location.href = '/index'; .logOut()
.then(() => {
location.href = "/index";
});
}) })
}).catch(() => { .catch(() => {
isRelogin.show = false; isRelogin.show = false;
}); });
} }
return Promise.reject('无效的会话,或者会话已过期,请重新登录。') return Promise.reject("无效的会话,或者会话已过期,请重新登录。");
} else if (code === 500) { } else if (code === 500) {
ElMessage({ message: msg, type: 'error' }) ElMessage({ message: msg, type: "error" });
return Promise.reject(new Error(msg)) return Promise.reject(new Error(msg));
} else if (code === 601) { } else if (code === 601) {
ElMessage({ message: msg, type: 'warning' }) ElMessage({ message: msg, type: "warning" });
return Promise.reject(new Error(msg)) return Promise.reject(new Error(msg));
} else if (code !== 200) { } else if (code !== 200) {
ElNotification.error({ title: msg }) ElNotification.error({ title: msg });
return Promise.reject('error') return Promise.reject("error");
} else { } else {
return Promise.resolve(res.data) return Promise.resolve(res.data);
} }
}, },
error => { (error) => {
console.log('err' + error) console.log("err" + error);
let { message } = error; let { message } = error;
if (message == "Network Error") { if (message == "Network Error") {
message = "后端接口连接异常"; message = "后端接口连接异常";
@ -97,50 +104,61 @@ service.interceptors.response.use(res => {
message = "系统接口请求超时"; message = "系统接口请求超时";
} else if (message.includes("Request failed with status code")) { } else if (message.includes("Request failed with status code")) {
if (message.includes("401")) { if (message.includes("401")) {
ElMessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { confirmButtonText: '重新登录', cancelButtonText: '取消', type: 'warning' }).then(() => { ElMessageBox.confirm("登录状态已过期,您可以继续留在该页面,或者重新登录", "系统提示", { confirmButtonText: "重新登录", cancelButtonText: "取消", type: "warning" })
.then(() => {
isRelogin.show = true; isRelogin.show = true;
useUserStore().logOut().then(() => { useUserStore()
location.href = '/login'; .logOut()
.then(() => {
location.href = "/login";
});
}) })
}).catch(() => { .catch(() => {
isRelogin.show = false; isRelogin.show = false;
}); });
} else if (message.includes("code 400")) { } else if (message.includes("code 400")) {
// ElNotification.error({ title: error.response.data }) // ElNotification.error({ title: error.response.data })
ElMessage({ message: error.response.data.msg, type: 'error' }) ElMessage({ message: error.response.data.msg, type: "error" });
} }
message = "系统接口" + message.substr(message.length - 3) + "异常"; message = "系统接口" + message.substr(message.length - 3) + "异常";
} }
// ElMessage({ message: message, type: 'error', duration: 5 * 1000 }) // ElMessage({ message: message, type: 'error', duration: 5 * 1000 })
return Promise.reject(error) return Promise.reject(error);
} }
) );
// 通用下载方法 // 通用下载方法
export function download(url, params, filename, config) { export function download(url, params, filename, config) {
downloadLoadingInstance = ElLoading.service({ text: "正在下载数据,请稍候", background: "rgba(0, 0, 0, 0.7)", }) downloadLoadingInstance = ElLoading.service({ text: "正在下载数据,请稍候", background: "rgba(0, 0, 0, 0.7)" });
return service.post(url, params, { return service
transformRequest: [(params) => { return tansParams(params) }], .post(url, params, {
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, transformRequest: [
responseType: 'blob', (params) => {
...config return tansParams(params);
}).then(async (data) => { },
],
headers: { "Content-Type": "application/x-www-form-urlencoded" },
responseType: "blob",
...config,
})
.then(async (data) => {
const isBlob = blobValidate(data); const isBlob = blobValidate(data);
if (isBlob) { if (isBlob) {
const blob = new Blob([data]) const blob = new Blob([data]);
saveAs(blob, filename) saveAs(blob, filename);
} else { } else {
const resText = await data.text(); const resText = await data.text();
const rspObj = JSON.parse(resText); const rspObj = JSON.parse(resText);
const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default'] const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode["default"];
ElMessage.error(errMsg); ElMessage.error(errMsg);
} }
downloadLoadingInstance.close(); downloadLoadingInstance.close();
}).catch((r) => {
console.error(r)
ElMessage.error('下载文件出现错误,请联系管理员!')
downloadLoadingInstance.close();
}) })
.catch((r) => {
console.error(r);
ElMessage.error("下载文件出现错误,请联系管理员!");
downloadLoadingInstance.close();
});
} }
export default service export default service;

@ -1,20 +1,7 @@
<template> <template>
<div> <div>
<el-dialog <el-dialog :title="title" style="width: 1308px; height: 838px" custom-class="dialog" v-model="props.showModel" :before-close="close">
:title="title" <div class="diaMain" style="margin-top: -35px; padding: 10px; padding-left: 20px">
style="width: 1308px; height: 838px"
custom-class="dialog"
v-model="props.showModel"
:before-close="close"
>
<div
class="diaMain"
style="
margin-top: -35px;
padding: 10px;
padding-left: 20px;
"
>
<el-scrollbar height="730px"> <el-scrollbar height="730px">
<slot name="content" class="main"></slot> <slot name="content" class="main"></slot>
</el-scrollbar> </el-scrollbar>
@ -61,15 +48,12 @@ const submit = () => {
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.diaMain {
</style> img {
<style lang="scss">
.diaMain{
img{
max-height: 1200px; max-height: 1200px;
max-width: 1200px; max-width: 1200px;
} }
p{ p {
font-size: 15px; font-size: 15px;
} }
} }
@ -102,11 +86,14 @@ const submit = () => {
.el-dialog__footer { .el-dialog__footer {
text-align: center; text-align: center;
} }
.tj{ .tj {
color: #FFFFFF; color: #ffffff;
} }
.cxks{ .cxks {
background: url('@/assets/images/szjj/重新开始.png') no-repeat; background: url("@/assets/images/szjj/重新开始.png") no-repeat;
} }
} }
p {
// color: #1d2528 !important;
}
</style> </style>

@ -2,12 +2,12 @@
* @Author: qinzhenpen qzp1807@126.com * @Author: qinzhenpen qzp1807@126.com
* @Date: 2024-08-20 17:50:08 * @Date: 2024-08-20 17:50:08
* @LastEditors: qinzhenpen qzp1807@126.com * @LastEditors: qinzhenpen qzp1807@126.com
* @LastEditTime: 2024-08-21 17:25:35 * @LastEditTime: 2024-08-22 17:12:34
* @FilePath: \vue3\src\views\digitalMarketTech\index.vue * @FilePath: \vue3\src\views\digitalMarketTech\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
<template> <template>
<div class="rgzn_top app-container2"> <div class="rgzn_top app-container">
<div class="top_item"> <div class="top_item">
<el-button :class="{ active: isActive === 1 }" @click="activeIndex(1)"> <el-button :class="{ active: isActive === 1 }" @click="activeIndex(1)">
<img src="@/assets/images/大数据.png" /> <img src="@/assets/images/大数据.png" />

@ -2,7 +2,7 @@
<!-- <el-scrollbar ref="scrollbar" height="800px"> --> <!-- <el-scrollbar ref="scrollbar" height="800px"> -->
<div class="main-top"> <div class="main-top">
<span style="font-weight: bold; font-size: 18px; color: #3596eb">任务描述</span> <span style="font-weight: bold; font-size: 18px; color: #3596eb">任务描述</span>
<p style="font-weight: 400; font-size: 12px; color: #e6e6e6">给出任务清单参考做哪些数据的统计分析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.</p> <p style="font-weight: 400; font-size: 12px; color: #e2e7ee !important">给出任务清单参考做哪些数据的统计分析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.</p>
</div> </div>
<div class="main-but"> <div class="main-but">
<el-button @click="runResultShow = true"> <el-button @click="runResultShow = true">

@ -60,7 +60,7 @@ const n_dataTableQuery = ref({
}); });
const datatotal = ref(0); const datatotal = ref(0);
const nzIndex = ref(0); const nzIndex = ref(0);
const nzData = ["用户属性表", "用户登录活跃表", "用户消费能力表", "用户行为表", "用户评论表"]; const nzData = ref([]);
const zjIndex = ref(-1); const zjIndex = ref(-1);
const zjData = ref([]); const zjData = ref([]);
const tableLabel = ref([ const tableLabel = ref([
@ -77,6 +77,7 @@ const tableLabel = ref([
{ prop: "updateTime", label: "注册时间" }, { prop: "updateTime", label: "注册时间" },
{ prop: "location", label: "所在地" }, { prop: "location", label: "所在地" },
]); ]);
const tableLabel2 = ref([]); const tableLabel2 = ref([]);
const arrhander = ref([]); const arrhander = ref([]);
const arrhanderkey = ref([]); const arrhanderkey = ref([]);
@ -119,9 +120,11 @@ const selectType = (type) => {
}; };
const getSurface = () => { const getSurface = () => {
loading.value = true; loading.value = true;
portraitModel.getUserTableData(n_dataTableQuery.value).then((res) => { portraitModel
tableData.value = res?.data?.list .getUserTableData(n_dataTableQuery.value)
datatotal.value = res?.data?.total .then((res) => {
tableData.value = res?.data?.list;
datatotal.value = res?.data?.total;
tableLabel2.value = []; tableLabel2.value = [];
if (tableData.value[0]?.stepOneA) { if (tableData.value[0]?.stepOneA) {
arrhander.value = JSON.parse(tableData.value[0].stepOneA); arrhander.value = JSON.parse(tableData.value[0].stepOneA);
@ -134,13 +137,14 @@ const getSurface = () => {
}); });
tableLabel.value = tableLabel2.value; tableLabel.value = tableLabel2.value;
} }
setTimeout(()=>{ setTimeout(() => {
loading.value = false;
},1000)
}).catch(err=>{
loading.value = false; loading.value = false;
tableData.value=[] }, 1000);
}) })
.catch((err) => {
loading.value = false;
tableData.value = [];
});
}; };
// //
const importData = (e) => { const importData = (e) => {
@ -157,7 +161,10 @@ const importData = (e) => {
}; };
// //
const selectZJ = (item) => { const selectZJ = (item) => {
marketingAlgorithmApi.getMarketingAlgorithmTable(); portraitModel.getUserTableInfo({ userId: userInfo.userId }).then((res) => {
nzData.value = res.data.tableNames;
algorithmStore.userDataLabel = [...res?.data.tableNames, ...res.data.selfBuiltTable];
});
}; };
// //
const getZJData = () => { const getZJData = () => {
@ -166,6 +173,7 @@ const getZJData = () => {
}); });
}; };
onMounted(() => { onMounted(() => {
selectZJ();
getSurface(); getSurface();
getZJData(); getZJData();
}); });

@ -273,7 +273,6 @@
<script setup> <script setup>
import * as portraitModel from "@/api/portraitModel"; import * as portraitModel from "@/api/portraitModel";
import popModel from "@/views/components/popModal.vue"; import popModel from "@/views/components/popModal.vue";
import { htmlPdf } from "@/utils/pdf.js"; import { htmlPdf } from "@/utils/pdf.js";
import * as echarts from "echarts"; import * as echarts from "echarts";
@ -296,8 +295,8 @@ const formInline2 = reactive({
value6: "", value6: "",
}); });
const task = () => { const task = () => {
for(let key in formInline2){ for (let key in formInline2) {
if(formInline2[key] == ""){ if (formInline2[key] == "") {
proxy.$modal.msgError("请填写完整!"); proxy.$modal.msgError("请填写完整!");
return; return;
} }
@ -312,7 +311,6 @@ const task = () => {
dialogVisible.value = false; dialogVisible.value = false;
proxy.$modal.msgSuccess("提交成功"); proxy.$modal.msgSuccess("提交成功");
}); });
}; };
const algorithmicKnowledge = () => { const algorithmicKnowledge = () => {
runResultShow.value = true; runResultShow.value = true;
@ -513,11 +511,11 @@ const optionData2 = () => {
proxy.$modal.msgSuccess("预处理成功!"); proxy.$modal.msgSuccess("预处理成功!");
}); });
} }
} };
const showChart = ref(false); const showChart = ref(false);
// //
const nowData = ref([]); const nowData = ref([]);
const clusterAnalysisCalculation = () => { const clusterAnalysisCalculation = () => {
if (tableData2.value.length === 0 || input2.value == "" || input3.value == "") { if (tableData2.value.length === 0 || input2.value == "" || input3.value == "") {
proxy.$modal.msgWarning("请先计算/对数据进行预处理!"); proxy.$modal.msgWarning("请先计算/对数据进行预处理!");
return; return;
@ -601,9 +599,9 @@ const optionData2 = () => {
} else { } else {
proxy.$modal.msgWarning("请模型参数进行设置!"); proxy.$modal.msgWarning("请模型参数进行设置!");
} }
}; };
const exportTableRef = ref(null); const exportTableRef = ref(null);
const upLoad = () => { const upLoad = () => {
const tableDom = exportTableRef.value?.$el; const tableDom = exportTableRef.value?.$el;
if (!tableDom) { if (!tableDom) {
return; return;
@ -617,9 +615,9 @@ const optionData2 = () => {
zip.generateAsync({ type: "blob" }).then((content) => { zip.generateAsync({ type: "blob" }).then((content) => {
saveAs(content, "聚类分析.zip"); saveAs(content, "聚类分析.zip");
}); });
}; };
const startOver = () => { const startOver = () => {
myChart.setOption({ myChart.setOption({
series: [ series: [
{ {
@ -646,15 +644,14 @@ const optionData2 = () => {
showChart.value = false; showChart.value = false;
tableLabel.length = 0; tableLabel.length = 0;
nowData.value = []; nowData.value = [];
}; };
//pdf //pdf
const handleExport = async (name) => { const handleExport = async (name) => {
var fileName = "聚类分析图表"; var fileName = "聚类分析图表";
const fileList = document.getElementsByClassName("pdfRef"); // const fileList = document.getElementsByClassName("pdfRef"); //
const pdfBlob = await htmlPdf(fileName, document.querySelector("#pdfRef"), fileList, true); const pdfBlob = await htmlPdf(fileName, document.querySelector("#pdfRef"), fileList, true);
return pdfBlob; return pdfBlob;
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

@ -1,7 +1,7 @@
<template> <template>
<div class="main-top"> <div class="main-top">
<span style="font-weight: bold; font-size: 18px; color: #3596eb">任务描述</span> <span style="font-weight: bold; font-size: 18px; color: #3596eb">任务描述</span>
<p style="font-weight: 400; font-size: 12px; color: #e6e6e6">给出任务清单参考做哪些数据的统计分析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.</p> <p style="font-weight: 400; font-size: 12px; color: #e2e7ee !important">给出任务清单参考做哪些数据的统计分析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.</p>
</div> </div>
<div class="main-but"> <div class="main-but">
<el-button @click="knowledgeImport"> <el-button @click="knowledgeImport">
@ -70,7 +70,11 @@
<div> <div>
<span style="font-weight: bold; font-size: 18px; color: #3596eb">分析数据</span> <span style="font-weight: bold; font-size: 18px; color: #3596eb">分析数据</span>
<el-table :data="analysisData" style="width: 100%; margin-top: 10px" :header-cell-style="headerCellStyle"> <el-table :data="analysisData" style="width: 100%; margin-top: 10px" :header-cell-style="headerCellStyle">
<el-table-column v-for="column in analysisHanderKry" :key="column" :prop="column" :label="column" align="center" /> <el-table-column v-for="column in analysisHanderKry" :key="column" :prop="column" :label="column" align="center">
<template #default="scope">
<span>{{ scope.row[column] ?? "..." }}</span>
</template>
</el-table-column>
</el-table> </el-table>
<pagination v-show="n_analyzeTheNumberOfDataItems > 0" :total="n_analyzeTheNumberOfDataItems" v-model:page="n_dataTableQuery.index" v-model:limit="n_dataTableQuery.size" @pagination="analyzeDataNext" /> <pagination v-show="n_analyzeTheNumberOfDataItems > 0" :total="n_analyzeTheNumberOfDataItems" v-model:page="n_dataTableQuery.index" v-model:limit="n_dataTableQuery.size" @pagination="analyzeDataNext" />
</div> </div>
@ -78,7 +82,11 @@
<span style="font-weight: bold; font-size: 18px; color: #3596eb; display: block">分析结果</span> <span style="font-weight: bold; font-size: 18px; color: #3596eb; display: block">分析结果</span>
<el-button @click="download"></el-button> <el-button @click="download"></el-button>
<el-table :data="tableData" style="width: 100%; margin-top: 10px" :header-cell-style="headerCellStyle" height="350" v-loading="loading"> <el-table :data="tableData" style="width: 100%; margin-top: 10px" :header-cell-style="headerCellStyle" height="350" v-loading="loading">
<el-table-column v-for="column in tableLabel" :key="column.label" :prop="column.prop" :label="column.label" align="center"></el-table-column> <el-table-column v-for="column in tableLabel" :key="column.label" :prop="column.prop" :label="column.label" align="center">
<template #default="scope">
<span>{{ scope.row[column.prop] ?? "..." }}</span>
</template>
</el-table-column>
</el-table> </el-table>
<pagination v-show="nNumberOfAnalysisResults > 0" :total="nNumberOfAnalysisResults" v-model:page="gAnalysisResults.index" v-model:limit="gAnalysisResults.size" @pagination="updatePageAnalysisResults" /> <pagination v-show="nNumberOfAnalysisResults > 0" :total="nNumberOfAnalysisResults" v-model:page="gAnalysisResults.index" v-model:limit="gAnalysisResults.size" @pagination="updatePageAnalysisResults" />
</div> </div>
@ -428,7 +436,7 @@ function processArrayData(keys, data) {
// //
keys.forEach((key) => { keys.forEach((key) => {
// data // data
const values = data.map((item) => item[key]); const values = data.map((item) => item[key] ?? "0");
// //
result[key] = values; result[key] = values;
}); });
@ -484,14 +492,14 @@ const restart = () => {
observations: "", observations: "",
}; };
analysisData.value = []; analysisData.value = [];
analysisHanderKry.value = []; analysisHanderKry.value = [""];
tableData.value = []; tableData.value = [];
g_indicatorData.value = []; g_indicatorData.value = [];
g_modelParameter.value = []; g_modelParameter.value = [];
preProcessText.value.text2 = ""; preProcessText.value.text2 = "";
n_dataTableQuery.value.tableName = "用户属性表"; n_dataTableQuery.value.tableName = "用户属性表";
getIndicator(); getIndicator();
proxy.$modal.msgSuccess("重新开始成功"); proxy.$modal.msgSuccess("重新开始!");
multipleTableRef.value.clearSelection(); multipleTableRef.value.clearSelection();
}; };
// //

@ -1,7 +1,7 @@
<template> <template>
<div class="main-top"> <div class="main-top">
<span style="font-weight: bold; font-size: 18px; color: #3596eb">任务描述</span> <span style="font-weight: bold; font-size: 18px; color: #3596eb">任务描述</span>
<p style="font-weight: 400; font-size: 12px; color: #e6e6e6">给出任务清单参考做哪些数据的统计分析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.</p> <p style="font-weight: 400; font-size: 12px; color: #e2e7ee !important">给出任务清单参考做哪些数据的统计分析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.</p>
</div> </div>
<div class="main-but"> <div class="main-but">
<el-button @click="knowledgeImport"> <el-button @click="knowledgeImport">
@ -21,7 +21,7 @@
</div> </div>
<div class="metrics"> <div class="metrics">
<el-select v-model="n_dataTableQuery.tableName" placeholder="请选择数据" style="width: 180px" @change="selectType"> <el-select v-model="n_dataTableQuery.tableName" placeholder="请选择数据" style="width: 180px" @change="selectType">
<el-option v-for="item in algorithmStore.userDataLabel" :key="item" :label="item" :value="item" /> <el-option v-for="item in algorithmStore.userDataLabel2" :key="item" :label="item" :value="item" />
</el-select> </el-select>
</div> </div>
<div class="metrics-table" style="margin-top: 10px"> <div class="metrics-table" style="margin-top: 10px">
@ -107,15 +107,15 @@
<div class="div" v-if="preProcessText.text3 == '词云生成'"> <div class="div" v-if="preProcessText.text3 == '词云生成'">
<div id="mywordcloud_positive" style="width: 50%; height: 600px"></div> <div id="mywordcloud_positive" style="width: 50%; height: 600px"></div>
</div> </div>
<div ref="captureElement" v-if="preProcessText.text3 == '情感倾向分析' && n_emotiveTendency == 0 ? true : g_emotionAnalysis"> <div ref="captureElement" v-if="preProcessText.text3 == '情感倾向分析' && n_emotiveTendency == 0 ? true : n_emotiveTendency">
<div class="emotion_analysis"> <div class="emotion_analysis">
<div class="emotion_analysis-ani-in-le"> <div class="emotion_analysis-ani-in-le">
<span>正向情感</span> <span>正向情感</span>
<img src="../../../assets/images/笑脸.png" alt="" /> <img src="../../../assets/images/笑脸.png" alt="" />
</div> </div>
<el-progress style="width: 480px" :text-inside="true" :stroke-width="20" :percentage="n_emotiveTendency" :color="'#ff540a'" /> <el-progress :class="[g_emotionAnalysis == 0 ? 'negPercentage ' : '']" style="width: 480px" :text-inside="true" :stroke-width="20" :percentage="n_emotiveTendency" :color="'#ff540a'" />
<div class="emotion_analysis-ani-in-ri"> <div class="emotion_analysis-ani-in-ri">
<img src="" alt="" /> <img src="../../../assets/images/哭脸.png" alt="" />
<span>负向情感</span> <span>负向情感</span>
</div> </div>
<div class="emotion_analysis_title">{{ g_emotionAnalysis == 0 ? "情感偏负向" : g_emotionAnalysis == 1 ? "情感偏中性" : "情感偏正向" }}</div> <div class="emotion_analysis_title">{{ g_emotionAnalysis == 0 ? "情感偏负向" : g_emotionAnalysis == 1 ? "情感偏中性" : "情感偏正向" }}</div>
@ -162,7 +162,7 @@
</el-form-item> </el-form-item>
</el-form-item> </el-form-item>
<el-form-item label="情感倾向分析: " label-width="120px"> <el-form-item label="情感倾向分析: " label-width="120px">
<el-radio-group v-model="formInline.emotional" style="margin-left: 31px"> <el-radio-group v-model="formInline.emotional" style="margin-left: 31px" fill="red" text-color="#ffffff">
<el-radio value="1" label="正向" size="large"></el-radio> <el-radio value="1" label="正向" size="large"></el-radio>
<el-radio value="2" label="负向" size="large"></el-radio> <el-radio value="2" label="负向" size="large"></el-radio>
</el-radio-group> </el-radio-group>
@ -184,7 +184,7 @@
<popModel :showModel="b_algorithmKnowledge" title="情感分析" @closePop="b_algorithmKnowledge = false"> <popModel :showModel="b_algorithmKnowledge" title="情感分析" @closePop="b_algorithmKnowledge = false">
<template v-slot:content> <template v-slot:content>
<!-- 情感分析 --> <!-- 情感分析 -->
<div> <div style="color: #000000 !important">
<p style="font-weight: 700; font-size: 22px">总览</p> <p style="font-weight: 700; font-size: 22px">总览</p>
<p> <p>
文本分析指对文本数据进行表示 (representation)处理(processing)和建模(modeling)来获得有用的见解(insight) 文本分析指对文本数据进行表示 (representation)处理(processing)和建模(modeling)来获得有用的见解(insight)
@ -413,7 +413,6 @@
</template> </template>
<script setup> <script setup>
import popModel from "@/views/components/popModal.vue"; import popModel from "@/views/components/popModal.vue";
import { paginate } from "@/utils/index.js"; import { paginate } from "@/utils/index.js";
import * as echarts from "echarts"; import * as echarts from "echarts";
import * as XLSX from "XLSX"; import * as XLSX from "XLSX";
@ -424,7 +423,6 @@ import * as API from "@/api/AI.js";
import * as marketingAlgorithmApi from "@/api/marketing-algorithm.js"; import * as marketingAlgorithmApi from "@/api/marketing-algorithm.js";
import html2canvas from "html2canvas"; import html2canvas from "html2canvas";
import useAlgorithmStore from "@/store/modules/algorithm.js"; import useAlgorithmStore from "@/store/modules/algorithm.js";
import useUserStore from "@/store/modules/user";
import { getUserInfo } from "@/utils/auth"; import { getUserInfo } from "@/utils/auth";
// //
const b_algorithmKnowledge = ref(false); const b_algorithmKnowledge = ref(false);
@ -434,7 +432,6 @@ const loading2 = ref(false);
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const algorithmStore = useAlgorithmStore(); const algorithmStore = useAlgorithmStore();
const multipleTableRef = ref(null); const multipleTableRef = ref(null);
const b_introductionOfAlgorithmKnowledge = ref(false);
const n_dataTableQuery = ref({ const n_dataTableQuery = ref({
index: 1, index: 1,
size: 5, size: 5,
@ -487,7 +484,6 @@ const preProcessText = ref({
const aOriginalDataOfAnalysisResults2 = ref({}); const aOriginalDataOfAnalysisResults2 = ref({});
const nOriginalWordFrequency = ref([]); // const nOriginalWordFrequency = ref([]); //
const nOriginalWordFrequencyNum = ref(0); // const nOriginalWordFrequencyNum = ref(0); //
const nOriginalWordFrequencySearch = ref([]); //
const mWordFrequency = ref({ const mWordFrequency = ref({
index: 1, index: 1,
size: 10, size: 10,
@ -498,10 +494,13 @@ const mWordFrequency = ref({
// //
const g_analyzeTheNumberOfDataItems = ref(""); const g_analyzeTheNumberOfDataItems = ref("");
// //
const g_modelParameter = ref([]);
const n_emotiveTendency = ref(0); const n_emotiveTendency = ref(0);
const g_emotionAnalysis = ref(0); const g_emotionAnalysis = ref(0);
const aCommentOpinion = ref([]); const aCommentOpinion = ref([]);
//
const downloadStatus = ref(false);
//
// //
const preProcess = (tetx) => { const preProcess = (tetx) => {
if (g_indicatorData.value.length == 0) { if (g_indicatorData.value.length == 0) {
@ -523,7 +522,6 @@ const preProcess = (tetx) => {
const taskSubmit = () => { const taskSubmit = () => {
dialogVisible.value = true; dialogVisible.value = true;
}; };
const tableData = ref([]);
const headerCellStyle = () => { const headerCellStyle = () => {
return { return {
backgroundColor: "#1882DE !important", // backgroundColor: "#1882DE !important", //
@ -544,47 +542,25 @@ const submit = () => {
if (g_indicatorData.value.length == 0) return proxy.$modal.msgWarning("请选择指标"); if (g_indicatorData.value.length == 0) return proxy.$modal.msgWarning("请选择指标");
loading.value = true; loading.value = true;
marketingAlgorithmApi.getMarketingAlgorithm({ userId: n_dataTableQuery.value.userId, tableName: n_dataTableQuery.value.tableName, fieldList: g_indicatorData.value }).then((res) => { marketingAlgorithmApi.getMarketingAlgorithm({ userId: n_dataTableQuery.value.userId, tableName: n_dataTableQuery.value.tableName, fieldList: g_indicatorData.value }).then((res) => {
// g_analyzeTheNumberOfDataItems.value =
if (
res.data
.map((item) => (item ? item.text : ""))
.every((item) => {
return item !== "";
})
) {
g_analyzeTheNumberOfDataItems.value = res.data.map((item) => (item ? item.text : "")).join(","); g_analyzeTheNumberOfDataItems.value = res.data.map((item) => (item ? item.text : "")).join(",");
analysisData.value = res.data.filter((item) => item !== null); } else {
g_analyzeTheNumberOfDataItems.value = "";
loading.value = false; loading.value = false;
proxy.$modal.msgSuccess("分析数据成功");
});
};
//
const handlemodelSelectionChange = (type) => {
g_modelParameter.value = type.map((item) => item.name);
};
//
const modelCalculation = () => {
if (analysisData.value.length == 0 && g_modelParameter.value.length == 0) {
proxy.$modal.msgWarning("请先分析数据/未选择模型参数!");
return; return;
} }
const processedData = processArrayData(["text"], analysisData.value); analysisData.value = res.data.filter((item) => item !== null);
marketingAlgorithmApi.getMarketingAlgorithmPreprocessing(JSON.stringify({ map: processedData, statistic: [preProcessText.value.text3 == "词云生成" ? "词频分析" : preProcessText.value.text3], userId: n_dataTableQuery.value.userId })).then((res) => { loading.value = false;
aOriginalDataOfAnalysisResults2.value = res.data; proxy.$modal.msgSuccess("分析数据成功");
tableData.value = res.data.map((item) => item.statistics);
if (res.data.length > 5) {
nNumberOfAnalysisResults.value = res.data.length;
aOriginalDataOfAnalysisResults.value = res.data.map((item) => item.statistics);
tableData.value = res.data.map((item) => item.statistics).slice(0, 5);
}
}); });
}; };
function processArrayData(keys, data) {
//
const result = {};
//
keys.forEach((key) => {
// data
const values = data.map((item) => item[key]);
//
result[key] = values;
});
return result;
}
onMounted(() => { onMounted(() => {
getIndicator(); getIndicator();
}); });
@ -620,35 +596,42 @@ const submitTask = () => {
const restart = () => { const restart = () => {
// //
formInline.value = { formInline.value = {
average: "",
median: "",
mode: "",
standardDeviation: "",
variance: "",
standardError: "",
kurtosis: "",
skewness: "",
max: "", max: "",
min: "", frequency: "",
summation: "", text1: "",
observations: "", text2: "",
emotional: "",
prominent: "",
}; };
analysisData.value = []; analysisData.value = [];
g_analyzeTheNumberOfDataItems.value = "";
analysisHanderKry.value = []; analysisHanderKry.value = [];
tableData.value = [];
g_indicatorData.value = []; g_indicatorData.value = [];
g_modelParameter.value = []; preProcessText.value = {
preProcessText.value.text2 = ""; text1: "数据去重",
n_dataTableQuery.value.tableName = "用户属性表"; text2: "",
getIndicator(); text3: "",
proxy.$modal.msgSuccess("重新开始成功"); };
aOriginalDataOfAnalysisResults2.value = {};
mWordFrequency.value = {
index: 1,
size: 10,
namenum: "",
frequency: "",
};
n_emotiveTendency.value = 0;
aCommentOpinion.value = [];
nOriginalWordFrequencyNum.value = 0;
aWordFrequency.value = [];
nOriginalWordFrequency.value = [];
s_commentType.value = "";
proxy.$modal.msgSuccess("重新开始!");
multipleTableRef.value.clearSelection(); multipleTableRef.value.clearSelection();
}; };
const captureElement = ref(null); const captureElement = ref(null);
// //
const download = async () => { const download = async () => {
// let tableData = ["", ""]; if (!downloadStatus.value) return proxy.$modal.msgWarning("请先分析数据!");
// XLSX.utils.aoa_to_sheet(tableData);
if (preProcessText.value.text3 == "情感倾向分析" || preProcessText.value.text3 == "评论观点抽取") { if (preProcessText.value.text3 == "情感倾向分析" || preProcessText.value.text3 == "评论观点抽取") {
if (captureElement.value) { if (captureElement.value) {
try { try {
@ -703,6 +686,33 @@ const sentimentAnalysis = () => {
} }
if (g_analyzeTheNumberOfDataItems.value == "") return proxy.$modal.msgWarning("请先选择指标/手动输入进行情感分析!"); if (g_analyzeTheNumberOfDataItems.value == "") return proxy.$modal.msgWarning("请先选择指标/手动输入进行情感分析!");
loading.value = true; loading.value = true;
if (preProcessText.value.text3 === "情感倾向分析") {
marketingAlgorithmApi
.getMarketingAlgorithmSentimentAnalysis(JSON.stringify({ text: g_analyzeTheNumberOfDataItems.value }))
.then((res) => {
g_emotionAnalysisinfo = res.data;
const pos = parseFloat(g_emotionAnalysisinfo.pos);
const neg = parseFloat(g_emotionAnalysisinfo.neg);
const total = pos + neg;
const posPercentage = total !== 0 ? (pos / total) * 100 : 0;
const negPercentage = total !== 0 ? (neg / total) * 100 : 0;
if (posPercentage > negPercentage) {
g_emotionAnalysis.value = 2;
n_emotiveTendency.value = posPercentage;
} else if (negPercentage > posPercentage) {
g_emotionAnalysis.value = 0;
n_emotiveTendency.value = negPercentage;
}
if (posPercentage == negPercentage) {
g_emotionAnalysis.value = 1;
n_emotiveTendency.value = 50;
}
loading.value = false;
})
.catch((err) => {
loading.value = false;
});
} else {
marketingAlgorithmApi marketingAlgorithmApi
.getMarketingAlgorithmSentiment({ id: s_commentType.value, userId: n_dataTableQuery.value.userId, content: g_analyzeTheNumberOfDataItems.value, modelType: preProcessText.value.text3 == "词云生成" ? "词频分析" : preProcessText.value.text3 }) .getMarketingAlgorithmSentiment({ id: s_commentType.value, userId: n_dataTableQuery.value.userId, content: g_analyzeTheNumberOfDataItems.value, modelType: preProcessText.value.text3 == "词云生成" ? "词频分析" : preProcessText.value.text3 })
.then((res) => { .then((res) => {
@ -713,11 +723,6 @@ const sentimentAnalysis = () => {
nOriginalWordFrequency.value = res.data; nOriginalWordFrequency.value = res.data;
aWordFrequency.value = res.data.slice(0, 5); aWordFrequency.value = res.data.slice(0, 5);
nOriginalWordFrequencyNum.value = res.data.length; nOriginalWordFrequencyNum.value = res.data.length;
} else if (preProcessText.value.text3 === "情感倾向分析") {
g_emotionAnalysisinfo = JSON.parse(res.data);
g_emotionAnalysis.value = JSON.parse(res.data)?.items[0]?.sentiment;
n_emotiveTendency.value = Math.round(g_emotionAnalysisinfo.items[0].positive_prob * 100);
console.log(n_emotiveTendency.value, " n_emotiveTendency.value");
} else { } else {
aCommentOpinion.value = JSON.parse(res.data).items.reduce((groups, item) => { aCommentOpinion.value = JSON.parse(res.data).items.reduce((groups, item) => {
// sentiment // sentiment
@ -729,15 +734,18 @@ const sentimentAnalysis = () => {
return groups; return groups;
}, {}); }, {});
} }
downloadStatus.value = true;
loading.value = false; loading.value = false;
proxy.$modal.msgSuccess("分析成功"); proxy.$modal.msgSuccess("分析成功");
}) })
.catch((err) => { .catch((err) => {
loading.value = false; loading.value = false;
}); });
}
}; };
// //
const clear = () => { const clear = () => {
if (!g_analyzeTheNumberOfDataItems.value) return proxy.$modal.msgWarning("请先分析数据!");
g_analyzeTheNumberOfDataItems.value = ""; g_analyzeTheNumberOfDataItems.value = "";
aWordFrequency.value = []; aWordFrequency.value = [];
proxy.$modal.msgSuccess("清空成功"); proxy.$modal.msgSuccess("清空成功");
@ -966,6 +974,24 @@ const switchingModels = () => {
.footer { .footer {
padding-top: 20px; padding-top: 20px;
text-align: center; text-align: center;
.el-button {
width: 110px;
height: 31px;
color: #333333;
border: none;
//
&:focus {
outline: none;
}
}
.el-button:nth-child(1) {
background: url("../../../assets/images/情感分析.png") no-repeat;
background-size: 100% 100%;
}
.el-button:nth-child(2) {
background: url("../../../assets/images/取消.png") no-repeat;
background-size: 100% 100%;
}
} }
} }
.metrics, .metrics,
@ -1055,9 +1081,17 @@ const switchingModels = () => {
font-size: 24px; font-size: 24px;
font-weight: normal; font-weight: normal;
} }
:deep(.el-progress) {
position: relative;
}
:deep(.el-progress-bar__outer) { :deep(.el-progress-bar__outer) {
background-color: #036fe2; background-color: #036fe2;
} }
:deep(.negPercentage) {
.el-progress-bar__inner {
background-color: #036fe2 !important;
}
}
} }
.comment-opinion { .comment-opinion {
padding: 30px 20px 0px 90px !important; padding: 30px 20px 0px 90px !important;
@ -1152,8 +1186,8 @@ const switchingModels = () => {
} }
h4, h4,
p { p {
color: #ffffff !important; // color: #ffffff !important;
font-size: 14px; // font-size: 14px;
} }
:deep(.pagination-container .el-pagination) { :deep(.pagination-container .el-pagination) {
// //
@ -1164,4 +1198,22 @@ p {
flex-wrap: nowrap !important; flex-wrap: nowrap !important;
} }
} }
:deep(.el-radio-group) {
//
.is-checked.el-radio__label {
color: #ffffff !important;
}
.el-radio__input.is-checked .el-radio__inner {
background: #2d5c8f !important;
border-color: #2d5c8f !important;
}
.el-radio__label {
color: #ffffff !important;
}
.el-radio__input .el-radio__inner {
background: #2d5c8f !important;
border-color: #2d5c8f !important;
border-color: #6fa8de !important;
}
}
</style> </style>

@ -2,7 +2,7 @@
<!-- <el-scrollbar ref="scrollbar" height="800px"> --> <!-- <el-scrollbar ref="scrollbar" height="800px"> -->
<div class="main-top"> <div class="main-top">
<span style="font-weight: bold; font-size: 18px; color: #3596eb">任务描述</span> <span style="font-weight: bold; font-size: 18px; color: #3596eb">任务描述</span>
<p style="font-weight: 400; font-size: 12px; color: #e6e6e6">给出任务清单参考做哪些数据的统计分析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.</p> <p style="font-weight: 400; font-size: 12px; color: #e2e7ee !important">给出任务清单参考做哪些数据的统计分析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.</p>
</div> </div>
<div class="main-but"> <div class="main-but">
<el-button @click="runResultShow = true"> <el-button @click="runResultShow = true">

@ -36,9 +36,9 @@
import { getCodeImg } from "@/api/login"; import { getCodeImg } from "@/api/login";
import Cookies from "js-cookie"; import Cookies from "js-cookie";
import { encrypt, decrypt } from "@/utils/jsencrypt"; import { encrypt, decrypt } from "@/utils/jsencrypt";
import useUserStore from '@/store/modules/user' import useUserStore from "@/store/modules/user";
const userStore = useUserStore() const userStore = useUserStore();
const route = useRoute(); const route = useRoute();
const router = useRouter(); const router = useRouter();
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
@ -48,13 +48,13 @@ const loginForm = ref({
password: "", password: "",
rememberMe: false, rememberMe: false,
code: "", code: "",
uuid: "" uuid: "",
}); });
const loginRules = { const loginRules = {
username: [{ required: true, trigger: "blur", message: "请输入您的账号" }], username: [{ required: true, trigger: "blur", message: "请输入您的账号" }],
password: [{ required: true, trigger: "blur", message: "请输入您的密码" }], password: [{ required: true, trigger: "blur", message: "请输入您的密码" }],
code: [{ required: true, trigger: "change", message: "请输入验证码" }] code: [{ required: true, trigger: "change", message: "请输入验证码" }],
}; };
const codeUrl = ref(""); const codeUrl = ref("");
@ -65,9 +65,13 @@ const captchaEnabled = ref(true);
const register = ref(false); const register = ref(false);
const redirect = ref(undefined); const redirect = ref(undefined);
watch(route, (newRoute) => { watch(
route,
(newRoute) => {
redirect.value = newRoute.query && newRoute.query.redirect; redirect.value = newRoute.query && newRoute.query.redirect;
}, { immediate: true }); },
{ immediate: true }
);
function handleLogin() { function handleLogin() {
// proxy.$refs.loginRef.validate(valid => { // proxy.$refs.loginRef.validate(valid => {
@ -87,13 +91,13 @@ function handleLogin() {
// //
const params = { const params = {
username: loginForm.value.username, username: loginForm.value.username,
password: loginForm.value.password !== '' ? encrypt(loginForm.value.password) : loginForm.value.password, password: loginForm.value.password !== "" ? encrypt(loginForm.value.password) : loginForm.value.password,
token: loginForm.value.TOKEN, token: loginForm.value.TOKEN,
}; };
userStore userStore
.login(params) .login(params)
.then(res => { .then((res) => {
router.push({ path: redirect.value || '/index' }); router.push({ path: redirect.value || "/index" });
if (params.token) { if (params.token) {
setTimeout(() => { setTimeout(() => {
loading.value = false; loading.value = false;
@ -101,7 +105,8 @@ function handleLogin() {
} else { } else {
loading.value = false; loading.value = false;
} }
}).catch(() => { })
.catch(() => {
loading.value = false; loading.value = false;
}); });
// } // }
@ -125,7 +130,7 @@ function getCookie() {
loginForm.value = { loginForm.value = {
username: username === undefined ? loginForm.value.username : username, username: username === undefined ? loginForm.value.username : username,
password: password === undefined ? loginForm.value.password : decrypt(password), password: password === undefined ? loginForm.value.password : decrypt(password),
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe) rememberMe: rememberMe === undefined ? false : Boolean(rememberMe),
}; };
} }
@ -133,30 +138,30 @@ function getCookie() {
getCookie(); getCookie();
</script> </script>
<style lang='scss' scoped> <style lang="scss" scoped>
.login { .login {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
height: 100%; height: 100%;
background-image: url('@/assets/images/login-background.0dded3b4.webp'); background-image: url("@/assets/images/login-background.0dded3b4.webp");
background-size: 100% 100%; background-size: 100% 100%;
} }
.title { .title {
margin: 0px auto 30px auto; margin: 0px auto 30px auto;
text-align: center; text-align: center;
color: rgb(48, 50, 52); color: rgb(48, 50, 52);
font-size: 22px; font-size: 22px;
font-weight: 500; font-weight: 500;
} }
.login-main { .login-main {
width: 85%; width: 85%;
height: 100%; height: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: end; justify-content: end;
} }
.login-form { .login-form {
border-radius: 6px; border-radius: 6px;
background: #ffffff; background: #ffffff;
width: 400px; width: 400px;
@ -172,13 +177,13 @@ getCookie();
width: 14px; width: 14px;
margin-left: 0px; margin-left: 0px;
} }
} }
.login-tip { .login-tip {
font-size: 13px; font-size: 13px;
text-align: center; text-align: center;
color: #bfbfbf; color: #bfbfbf;
} }
.login-code { .login-code {
width: 33%; width: 33%;
height: 40px; height: 40px;
float: right; float: right;
@ -186,8 +191,8 @@ getCookie();
cursor: pointer; cursor: pointer;
vertical-align: middle; vertical-align: middle;
} }
} }
.el-login-footer { .el-login-footer {
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
position: fixed; position: fixed;
@ -198,9 +203,9 @@ getCookie();
font-family: Arial; font-family: Arial;
font-size: 12px; font-size: 12px;
letter-spacing: 1px; letter-spacing: 1px;
} }
.login-code-img { .login-code-img {
height: 40px; height: 40px;
padding-left: 12px; padding-left: 12px;
} }
</style> </style>

Loading…
Cancel
Save