diff --git a/src/views/chart/pages/Predict.vue b/src/views/chart/pages/Predict.vue index 0cb30b5..3985fe8 100644 --- a/src/views/chart/pages/Predict.vue +++ b/src/views/chart/pages/Predict.vue @@ -99,7 +99,8 @@ export default { chartData: { datasetSource: [] }, - outPath: '' + outPath: '', + output_path: '' } }, created() { @@ -119,12 +120,14 @@ export default { formData.append("model_types", this.queryParams.model_types) // this.$axios.post(window.CONFIG.baseUrl + '/train-oneday/predict', formData, { headers: { "Content-Type": "multipart/form-data" } }).then((res) => { this.$axios.post(window.CONFIG.baseUrl + '/train-oneday/predict', formData, { headers: { "Content-Type": "multipart/form-data" } }).then((res) => { - this.chartData.dataset = res.echart_data - this.myChart.setOption({ - dataset: { - source: res.echart_data - }, - }) + // this.chartData.dataset = res.echart_data + // this.myChart.setOption({ + // dataset: { + // source: res.echart_data + // }, + // }) + console.log('Predict_output_path', res.output_path) + this.output_path = res?.output_path }).finally(() => { this.loading = false }) @@ -169,10 +172,10 @@ export default { onDownload() { const arr = this.queryParams.model_types.split(',') arr.forEach(item => { - const url = this.outPath + '\\' + this.queryParams.case_no + '_' + item + '_ROC.json' - const path = url.replace(/\\/g, '/') + // const url = this.outPath + '\\' + this.queryParams.case_no + '_' + item + '_ROC.json' + // const path = url.replace(/\\/g, '/') // this.$axios.get(window.CONFIG.baseUrl + '/download', { params: { path: path }}) - this.downloadFile(path, this.queryParams.case_no + '_' + item + '_ROC.json') + this.downloadFile(this.output_path, this.queryParams.case_no + '_' + item + '_ROC.json') }) }, chart() { diff --git a/src/views/chart/pages/Test.vue b/src/views/chart/pages/Test.vue index 547fcc6..6ac5525 100644 --- a/src/views/chart/pages/Test.vue +++ b/src/views/chart/pages/Test.vue @@ -12,55 +12,41 @@ --> - - + + - - + + - - + + - - Upload + + Upload - Select - Download + Select + Download @@ -115,10 +101,11 @@ export default { chartData: { datasetSource: [] }, - outPath: '' + outPath: '', + output_path: '' } }, - created () { + created() { // color: ['#0A4072', '#683F14', '#0F605A', '#0F5A7A', '#5C5F25'] // this.onSearch() this.getDataset() @@ -127,7 +114,7 @@ export default { this.chart() }, methods: { - onSearch () { + onSearch() { this.loading = true const formData = new FormData() formData.append("file", this.currentFile) @@ -135,6 +122,8 @@ export default { formData.append("model_types", this.queryParams.model_types) // this.$axios.post(window.CONFIG.baseUrl + '/train-oneday/predict', formData, { headers: { "Content-Type": "multipart/form-data" } }).then((res) => { this.$axios.post(window.CONFIG.baseUrl + '/train-oneday/predict_with_label', formData, { headers: { "Content-Type": "multipart/form-data" } }).then((res) => { + console.log('Predict_output_path', res.output_path) + this.output_path = res?.output_path this.chartData.dataset = res.echart_data this.myChart.setOption({ dataset: { @@ -165,7 +154,7 @@ export default { }, caseChange(id) { const arr = this.caseOptions.filter(item => item.case_no === id) - if(arr.length) { + if (arr.length) { this.outPath = arr[0].out_path } }, @@ -183,10 +172,11 @@ export default { onDownload() { const arr = this.queryParams.model_types.split(',') arr.forEach(item => { - const url = this.outPath + '\\' + this.queryParams.case_no + '_' + item + '_ROC.json' - const path = url.replace(/\\/g, '/') + // const url = this.outPath + '\\' + this.queryParams.case_no + '_' + item + '_ROC.json' + // const path = url.replace(/\\/g, '/') + const path = this.output_path // this.$axios.get(window.CONFIG.baseUrl + '/download', { params: { path: path }}) - this.downloadFile(path, this.queryParams.case_no + '_' + item + '_ROC.json') + this.downloadFile(path, this.queryParams.case_no + '_' + item + '_ROC.json') }) }, chart() { @@ -284,6 +274,7 @@ export default { color: #fff; display: flex; flex-direction: column; + .section-head { height: 32px; padding: 0 13px; @@ -293,18 +284,22 @@ export default { font-size: 20px; font-weight: bold; } + .list-box { flex: 1; display: flex; flex-direction: column; + .filter-wrap { height: 50px; margin-top: 16px; + ::v-deep .el-form-item__label { font-size: 16px; color: #a7bacf; } } + .chart-wrap { flex: 1; }