修正Test Predict接口超时和下载问题
This commit is contained in:
parent
c17568b04b
commit
3c47855f3f
|
|
@ -119,7 +119,7 @@ export default {
|
||||||
formData.append("case_no", this.queryParams.case_no)
|
formData.append("case_no", this.queryParams.case_no)
|
||||||
formData.append("model_types", this.queryParams.model_types)
|
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.$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, { timeout: 1800000, headers: { "Content-Type": "multipart/form-data" } }).then((res) => {
|
||||||
// this.chartData.dataset = res.echart_data
|
// this.chartData.dataset = res.echart_data
|
||||||
// this.myChart.setOption({
|
// this.myChart.setOption({
|
||||||
// dataset: {
|
// dataset: {
|
||||||
|
|
@ -170,12 +170,14 @@ export default {
|
||||||
this.queryParams.model_types = data.join(',')
|
this.queryParams.model_types = data.join(',')
|
||||||
},
|
},
|
||||||
onDownload() {
|
onDownload() {
|
||||||
const arr = this.queryParams.model_types.split(',')
|
// const arr = this.queryParams.model_types.split(',')
|
||||||
arr.forEach(item => {
|
// arr.forEach(item => {
|
||||||
// const url = this.outPath + '\\' + this.queryParams.case_no + '_' + item + '_ROC.json'
|
// // const url = this.outPath + '\\' + this.queryParams.case_no + '_' + item + '_ROC.json'
|
||||||
// const path = url.replace(/\\/g, '/')
|
// // const path = url.replace(/\\/g, '/')
|
||||||
// this.$axios.get(window.CONFIG.baseUrl + '/download', { params: { path: path }})
|
// // this.$axios.get(window.CONFIG.baseUrl + '/download', { params: { path: path }})
|
||||||
// this.downloadFile(this.output_path, this.queryParams.case_no + '_' + item + '_ROC.json')
|
// // this.downloadFile(this.output_path, this.queryParams.case_no + '_' + item + '_ROC.json')
|
||||||
|
|
||||||
|
// })
|
||||||
this.$axios.get(window.CONFIG.baseUrl + '/download', { params: { path: this.output_path }, responseType: 'blob', }).then(res => {
|
this.$axios.get(window.CONFIG.baseUrl + '/download', { params: { path: this.output_path }, responseType: 'blob', }).then(res => {
|
||||||
const downLoadName = 'pred.xlsx'
|
const downLoadName = 'pred.xlsx'
|
||||||
// 通过a标签打开新页面下载文件
|
// 通过a标签打开新页面下载文件
|
||||||
|
|
@ -187,7 +189,6 @@ export default {
|
||||||
a.click()
|
a.click()
|
||||||
document.body.removeChild(a)
|
document.body.removeChild(a)
|
||||||
})
|
})
|
||||||
})
|
|
||||||
},
|
},
|
||||||
chart() {
|
chart() {
|
||||||
this.myChart = this.$echarts.init(this.$refs.chartDom)
|
this.myChart = this.$echarts.init(this.$refs.chartDom)
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,10 @@
|
||||||
</el-upload>
|
</el-upload>
|
||||||
<el-button type="primary" icon="search"
|
<el-button type="primary" icon="search"
|
||||||
style="background-color: #7393b7; border-color: #7393b7; border-radius: 0; margin-left: 12px;"
|
style="background-color: #7393b7; border-color: #7393b7; border-radius: 0; margin-left: 12px;"
|
||||||
@click="onSearch">Select</el-button>
|
@click="onSearch">
|
||||||
|
<span v-if="!loading">Select</span>
|
||||||
|
<span v-else>识别中...</span>
|
||||||
|
</el-button>
|
||||||
<el-button type="primary" icon="document"
|
<el-button type="primary" icon="document"
|
||||||
style="background-color: #7393b7; border-color: #7393b7; border-radius: 0; margin-left: 12px;"
|
style="background-color: #7393b7; border-color: #7393b7; border-radius: 0; margin-left: 12px;"
|
||||||
@click="onDownload">Download</el-button>
|
@click="onDownload">Download</el-button>
|
||||||
|
|
@ -121,7 +124,7 @@ export default {
|
||||||
formData.append("case_no", this.queryParams.case_no)
|
formData.append("case_no", this.queryParams.case_no)
|
||||||
formData.append("model_types", this.queryParams.model_types)
|
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.$axios.post(window.CONFIG.baseUrl + '/train-oneday/predict_with_label', formData, { headers: { "Content-Type": "multipart/form-data" } }).then((res) => {
|
this.$axios.post(window.CONFIG.baseUrl + '/train-oneday/predict_with_label', formData, { timeout: 1800000, headers: { "Content-Type": "multipart/form-data" } }).then((res) => {
|
||||||
console.log('Predict_output_path', res.output_path)
|
console.log('Predict_output_path', res.output_path)
|
||||||
this.output_path = res?.output_path
|
this.output_path = res?.output_path
|
||||||
this.chartData.dataset = res.echart_data
|
this.chartData.dataset = res.echart_data
|
||||||
|
|
@ -170,12 +173,14 @@ export default {
|
||||||
this.queryParams.model_types = data.join(',')
|
this.queryParams.model_types = data.join(',')
|
||||||
},
|
},
|
||||||
onDownload() {
|
onDownload() {
|
||||||
const arr = this.queryParams.model_types.split(',')
|
// const arr = this.queryParams.model_types.split(',')
|
||||||
arr.forEach(item => {
|
// arr.forEach(item => {
|
||||||
// const url = this.outPath + '\\' + this.queryParams.case_no + '_' + item + '_ROC.json'
|
// // const url = this.outPath + '\\' + this.queryParams.case_no + '_' + item + '_ROC.json'
|
||||||
// const path = url.replace(/\\/g, '/')
|
// // const path = url.replace(/\\/g, '/')
|
||||||
// this.$axios.get(window.CONFIG.baseUrl + '/download', { params: { path: 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')
|
||||||
|
// })
|
||||||
|
if(this.loading) return false
|
||||||
this.$axios.get(window.CONFIG.baseUrl + '/download', { params: { path: this.output_path }, responseType: 'blob', }).then(res => {
|
this.$axios.get(window.CONFIG.baseUrl + '/download', { params: { path: this.output_path }, responseType: 'blob', }).then(res => {
|
||||||
const downLoadName = 'test.xlsx'
|
const downLoadName = 'test.xlsx'
|
||||||
// 通过a标签打开新页面下载文件
|
// 通过a标签打开新页面下载文件
|
||||||
|
|
@ -187,7 +192,6 @@ export default {
|
||||||
a.click()
|
a.click()
|
||||||
document.body.removeChild(a)
|
document.body.removeChild(a)
|
||||||
})
|
})
|
||||||
})
|
|
||||||
},
|
},
|
||||||
chart() {
|
chart() {
|
||||||
this.myChart = this.$echarts.init(this.$refs.chartDom)
|
this.myChart = this.$echarts.init(this.$refs.chartDom)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user