|
|
|
@ -15,7 +15,6 @@
|
|
|
|
</el-button>
|
|
|
|
</el-button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="app-main">
|
|
|
|
<div class="app-main">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="main-left">
|
|
|
|
<div class="main-left">
|
|
|
|
<el-scrollbar height="550px" style="padding: 0 10px" min-size="5">
|
|
|
|
<el-scrollbar height="550px" style="padding: 0 10px" min-size="5">
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
@ -65,7 +64,7 @@
|
|
|
|
<span style="font-weight: 400; font-size: 12px; color: #ffffff">最大迭代次数:</span>
|
|
|
|
<span style="font-weight: 400; font-size: 12px; color: #ffffff">最大迭代次数:</span>
|
|
|
|
<el-input v-model="input6" style="width: 180px; margin-top: 5px" />
|
|
|
|
<el-input v-model="input6" style="width: 180px; margin-top: 5px" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<el-button @click="computation">计算</el-button>
|
|
|
|
<el-button @click="clusterAnalysisCalculation">计算</el-button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</el-scrollbar>
|
|
|
|
</el-scrollbar>
|
|
|
|
@ -77,7 +76,6 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="main-right">
|
|
|
|
<div class="main-right">
|
|
|
|
<el-scrollbar height="500px" ref="scrollbar" style="padding: 20px">
|
|
|
|
<el-scrollbar height="500px" ref="scrollbar" style="padding: 20px">
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
@ -274,6 +272,8 @@
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
<script setup>
|
|
|
|
|
|
|
|
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";
|
|
|
|
@ -287,18 +287,33 @@ const { proxy } = getCurrentInstance();
|
|
|
|
const dialogVisible = ref(false);
|
|
|
|
const dialogVisible = ref(false);
|
|
|
|
const tableLabel = reactive([{ prop: "date", label: "" }]);
|
|
|
|
const tableLabel = reactive([{ prop: "date", label: "" }]);
|
|
|
|
const isFlag = ref(false);
|
|
|
|
const isFlag = ref(false);
|
|
|
|
const formInline2=reactive({
|
|
|
|
const formInline2 = reactive({
|
|
|
|
value1:'',
|
|
|
|
value1: "",
|
|
|
|
value2:'',
|
|
|
|
value2: "",
|
|
|
|
value3:'',
|
|
|
|
value3: "",
|
|
|
|
value4:'',
|
|
|
|
value4: "",
|
|
|
|
value5:'',
|
|
|
|
value5: "",
|
|
|
|
value6:'',
|
|
|
|
value6: "",
|
|
|
|
})
|
|
|
|
});
|
|
|
|
const task=()=>{
|
|
|
|
const task = () => {
|
|
|
|
dialogVisible.value = false
|
|
|
|
for(let key in formInline2){
|
|
|
|
proxy.$modal.msgSuccess("提交完成!");
|
|
|
|
if(formInline2[key] == ""){
|
|
|
|
}
|
|
|
|
proxy.$modal.msgError("请填写完整!");
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
portraitModel
|
|
|
|
|
|
|
|
.submit({
|
|
|
|
|
|
|
|
userId: JSON.parse(getUserInfo()).userId,
|
|
|
|
|
|
|
|
taskName: "聚类分析",
|
|
|
|
|
|
|
|
numberOfErrors: 0,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.then((res) => {
|
|
|
|
|
|
|
|
dialogVisible.value = false;
|
|
|
|
|
|
|
|
proxy.$modal.msgSuccess("提交成功");
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
const algorithmicKnowledge = () => {
|
|
|
|
const algorithmicKnowledge = () => {
|
|
|
|
runResultShow.value = true;
|
|
|
|
runResultShow.value = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
@ -361,7 +376,8 @@ onMounted(() => {
|
|
|
|
getList();
|
|
|
|
getList();
|
|
|
|
var chartDom = document.getElementById("main");
|
|
|
|
var chartDom = document.getElementById("main");
|
|
|
|
var chartDom2 = document.getElementById("main2");
|
|
|
|
var chartDom2 = document.getElementById("main2");
|
|
|
|
myChart = echarts.init(chartDom);472
|
|
|
|
myChart = echarts.init(chartDom);
|
|
|
|
|
|
|
|
472;
|
|
|
|
myChart2 = echarts.init(chartDom2);
|
|
|
|
myChart2 = echarts.init(chartDom2);
|
|
|
|
// 初始化图表配置
|
|
|
|
// 初始化图表配置
|
|
|
|
var option = {
|
|
|
|
var option = {
|
|
|
|
@ -389,46 +405,46 @@ onMounted(() => {
|
|
|
|
// 设置初始的配置
|
|
|
|
// 设置初始的配置
|
|
|
|
myChart.setOption(option);
|
|
|
|
myChart.setOption(option);
|
|
|
|
myChart2.setOption(option);
|
|
|
|
myChart2.setOption(option);
|
|
|
|
})
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const optionData=()=>{
|
|
|
|
const optionData = () => {
|
|
|
|
API.viewingMetrics({userId:JSON.parse(getUserInfo()).userId,tableName:input.value,algorithmName:'聚类分析'}).then((res)=>{
|
|
|
|
API.viewingMetrics({ userId: JSON.parse(getUserInfo()).userId, tableName: input.value, algorithmName: "聚类分析" }).then((res) => {
|
|
|
|
tableData.value=[]
|
|
|
|
tableData.value = [];
|
|
|
|
input3.value=''
|
|
|
|
input3.value = "";
|
|
|
|
res.data.forEach(element => {
|
|
|
|
res.data.forEach((element) => {
|
|
|
|
tableData.value.push({
|
|
|
|
tableData.value.push({
|
|
|
|
text:element
|
|
|
|
text: element,
|
|
|
|
})
|
|
|
|
});
|
|
|
|
})
|
|
|
|
});
|
|
|
|
})
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
const selectedRows = ref([]);
|
|
|
|
const selectedRows = ref([]);
|
|
|
|
const handleSelectionChange = (selection) => {
|
|
|
|
const handleSelectionChange = (selection) => {
|
|
|
|
selectedRows.value = selection;
|
|
|
|
selectedRows.value = selection;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
const tableData2 = ref([]);
|
|
|
|
|
|
|
|
const tableData3 = ref([]);
|
|
|
|
|
|
|
|
const resTable2 = ref();
|
|
|
|
|
|
|
|
const taskZB = () => {
|
|
|
|
|
|
|
|
flag.value = true;
|
|
|
|
|
|
|
|
if (selectedRows.value.length === 0) {
|
|
|
|
|
|
|
|
return proxy.$modal.msgWarning("请选择指标!");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
const sendData = {
|
|
|
|
|
|
|
|
tableName: input.value,
|
|
|
|
|
|
|
|
userId: JSON.parse(getUserInfo()).userId,
|
|
|
|
|
|
|
|
fieldList: selectedRows.value.map((item) => item.text),
|
|
|
|
};
|
|
|
|
};
|
|
|
|
const tableData2=ref([])
|
|
|
|
API.analysisDataDisplay(sendData).then((res) => {
|
|
|
|
const tableData3=ref([])
|
|
|
|
tableLabel.length = 0;
|
|
|
|
const resTable2=ref()
|
|
|
|
|
|
|
|
const taskZB=()=>{
|
|
|
|
|
|
|
|
flag.value=true
|
|
|
|
|
|
|
|
if(selectedRows.value.length===0){
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
const sendData={
|
|
|
|
|
|
|
|
tableName:input.value,
|
|
|
|
|
|
|
|
userId:JSON.parse(getUserInfo()).userId,
|
|
|
|
|
|
|
|
fieldList:selectedRows.value.map(item=>item.text)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
API.analysisDataDisplay(sendData).then((res)=>{
|
|
|
|
|
|
|
|
tableLabel.length=0
|
|
|
|
|
|
|
|
for (const key in res.data[0]) {
|
|
|
|
for (const key in res.data[0]) {
|
|
|
|
tableLabel.push({
|
|
|
|
tableLabel.push({
|
|
|
|
label:key,
|
|
|
|
label: key,
|
|
|
|
prop:key
|
|
|
|
prop: key,
|
|
|
|
})
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tableData2.value=res.data
|
|
|
|
tableData2.value = res.data;
|
|
|
|
flag.value=true
|
|
|
|
flag.value = true;
|
|
|
|
proxy.$modal.msgSuccess("计算完成!");
|
|
|
|
proxy.$modal.msgSuccess("计算完成!");
|
|
|
|
tableData2.value = res.data;
|
|
|
|
tableData2.value = res.data;
|
|
|
|
flag.value = true;
|
|
|
|
flag.value = true;
|
|
|
|
@ -497,12 +513,12 @@ const optionData2 = () => {
|
|
|
|
proxy.$modal.msgSuccess("预处理成功!");
|
|
|
|
proxy.$modal.msgSuccess("预处理成功!");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
const showChart = ref(false);
|
|
|
|
const showChart = ref(false);
|
|
|
|
//生产表格
|
|
|
|
//生产表格
|
|
|
|
const nowData = ref([]);
|
|
|
|
const nowData = ref([]);
|
|
|
|
const computation = () => {
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -585,9 +601,9 @@ const computation = () => {
|
|
|
|
} 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;
|
|
|
|
@ -601,9 +617,9 @@ const upLoad = () => {
|
|
|
|
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: [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -630,14 +646,15 @@ const startOver = () => {
|
|
|
|
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>
|
|
|
|
|