feat: 数据预测

This commit is contained in:
JiangSheng
2025-11-07 14:03:30 +08:00
parent 451578810a
commit 9c6ebf66d4

View File

@@ -370,7 +370,6 @@ const handleChangeStep = (type: string) => {
if (props.modelForm.status === ModelStatus.NoStart) {
beginRefreshLog();
} else {
initCurveLog();
getTrainingResultFun();
}
}
@@ -381,11 +380,6 @@ const handleChangeStep = (type: string) => {
emit('back');
} else {
currentStep.value--;
// if (currentStep.value === 0) {
// nextTick(() => {
// initCurveSource();
// });
// }
}
}
};
@@ -416,24 +410,7 @@ const importFileFun = async (file: any) => {
ElMessage.success('文件上传成功,正在处理数据,请稍后...');
createConnection();
}
// if (file.status !== 'error') return;
// if (props.modelForm.status !== ModelStatus.NoStart) {
// ElMessage.warning('当前代理模型无法导入数据!');
// return;
// }
// if (props.modelForm.algorithmType === AlgorithmType.Steady) {
// sourceFileList.value = file;
// if (props.modelForm?.files?.length > 0) {
// delModelTrainingFileApi([props.modelForm?.files[0].id]);
// }
// } else {
// sourceFileList.value.push(file);
// }
currentFileName.value = file.name;
getSourceData();
// const path = ModelFile.getSourceFilePath(props.modelForm.id);
// await fragmentUpload(false, file.originFileObj, path, file.name);
// addModelTrainingFileApi({ fileName: file.name, fileType: FileUtil.getSuffixName(file.name), fileSize: file.size, path: path });
};
const getImportedFileResultFun = async () => {
const req = {
@@ -466,45 +443,9 @@ const setTableColumnsFun = (sourceTitle: any) => {
});
columns.value = cols;
};
// 渲染记录的文件信息
const renderOldInfo = () => {
// 回显文件信息
if (props.modelForm?.files?.length > 0) {
sourceFileList.value = props.modelForm.files.map((item) => {
return {
...item,
name: item.fileName,
};
});
currentFileName.value = props.modelForm.files[0].fileName;
getSourceData();
}
// 回显训练数据
if (props.modelForm.columnParam?.length > 2) {
const oldColumnParam = JSON.parse(props.modelForm.columnParam);
disposeForm.inputColumn = oldColumnParam.inputColumn;
disposeForm.outputColumn = oldColumnParam.outputColumn;
}
console.log('disposeForm', disposeForm);
};
const getSourceData = () => {
// setColumns();
trainDataTableRef.value.setDataFun(sourceData);
// trainingSourceData.value = sourceData;
nextTick(() => {
if (props.modelForm.algorithmType === AlgorithmType.Steady) {
getSteadyAverageData();
// reloadSourceTable();
} else {
initCurveSource();
}
});
};
const steadyAverageData = ref<any[]>([]);
const getSteadyAverageData = () => {
steadyAverageData.value = averageData;
};
const disposeForm = reactive({
inputColumn: [], // 输入列
outputColumn: [], // 输出列
@@ -555,47 +496,6 @@ const confirmSetColumnFun = async () => {
};
/** 数据处理 */
const sourceChartRef = ref<HTMLDivElement | null>(null);
// const { setOptions: sourceSetOptions } = useECharts(sourceChartRef as Ref<HTMLDivElement>);
// 数据源曲线
const initCurveSource = () => {
// sourceSetOptions({
// title: {
// text: '',
// },
// tooltip: {
// trigger: 'axis',
// },
// legend: {
// data: sourceCurveData.legend,
// },
// grid: {
// left: '3%',
// right: '4%',
// bottom: '3%',
// containLabel: true,
// },
// xAxis: {
// type: 'category',
// boundaryGap: false,
// data: sourceCurveData.xAxis,
// },
// yAxis: {
// type: 'value',
// },
// series: sourceCurveData.series.map((item) => {
// return {
// name: item.name,
// type: 'line',
// stack: 'Total',
// smooth: true,
// data: item.data,
// symbol: 'none',
// };
// }),
// });
};
// const algorithmParamForm = reactive({
// /** 算法名 */
// algorithm: '',
@@ -628,18 +528,7 @@ const initCurveSource = () => {
// });
// #endregion
const algorithmParamForm = reactive<any>({});
// const basicModelList = [
// {
// label: 'xxx模型1',
// value: '1',
// },
// {
// label: 'xxxx模型2',
// value: '2',
// },
// ];
// #region 训练板块
const paramSettingRef: any = ref(null);
const beginTrainingFun = async () => {
const formData = await paramSettingRef.value?.getFormDataFun();
@@ -667,46 +556,6 @@ const stopTrainingFun = async () => {
// #region 训练板块 训练曲线
const logChartRef = ref<HTMLDivElement | null>(null);
const initCurveLog = () => {
// logSetOptions({
// title: {
// text: '',
// },
// tooltip: {
// trigger: 'axis',
// },
// legend: {
// data: logCurveData.legend,
// },
// grid: {
// left: '3%',
// right: '4%',
// bottom: '3%',
// containLabel: true,
// },
// xAxis: {
// type: 'category',
// boundaryGap: false,
// data: logCurveData.xAxis,
// },
// yAxis: {
// type: 'value',
// },
// series: logCurveData.series.map((item) => {
// return {
// name: item.name,
// type: 'line',
// stack: 'Total',
// smooth: true,
// data: item.data,
// symbol: 'none',
// };
// }),
// });
};
// #endregion
// #region 训练板块 训练日志
const lastLogContent = ref('');
const allLogContent = ref('');
const logStatus = ref('refresh');
@@ -856,6 +705,7 @@ const renderCurveFun = (curveData: any) => {
trigger: 'axis',
},
legend: {
top: 0,
data: curveData.legend,
},
grid: {