Merge pull request #439 from dataease/pr@dev@refactor_数据预览接口延长请求时间

refactor: 数据预览接口延长请求时间
This commit is contained in:
XiaJunjie2020 2021-07-30 17:45:39 +08:00 committed by GitHub
commit 0a55b754de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 3 deletions

View File

@ -111,11 +111,12 @@ export function batchEdit(data) {
}) })
} }
export function post(url, data, showLoading = true) { export function post(url, data, showLoading = true, timeout = 10000) {
return request({ return request({
url: url, url: url,
method: 'post', method: 'post',
loading: showLoading, loading: showLoading,
timeout: timeout,
data data
}) })
} }

View File

@ -72,7 +72,7 @@ export default {
if (this.table.id) { if (this.table.id) {
this.dataLoading = true this.dataLoading = true
this.table.row = 100 this.table.row = 100
post('/dataset/table/getPreviewData/1/100', this.table, false).then(response => { post('/dataset/table/getPreviewData/1/100', this.table, false,30000).then(response => {
this.fields = response.data.fields this.fields = response.data.fields
this.data = response.data.data this.data = response.data.data
const datas = this.data const datas = this.data

View File

@ -134,7 +134,7 @@ export default {
initPreviewData(page) { initPreviewData(page) {
if (this.table.id) { if (this.table.id) {
this.table.row = this.tableViewRowForm.row this.table.row = this.tableViewRowForm.row
post('/dataset/table/getPreviewData/' + page.page + '/' + page.pageSize, this.table).then(response => { post('/dataset/table/getPreviewData/' + page.page + '/' + page.pageSize, this.table, true, 30000).then(response => {
this.fields = response.data.fields this.fields = response.data.fields
this.data = response.data.data this.data = response.data.data
this.page = response.data.page this.page = response.data.page