提交 ec24cf3d authored 作者: junjie's avatar junjie

feat(fix):前端请求,loading配置

上级 c627f44e
...@@ -85,10 +85,10 @@ export function getPreviewData(data) { ...@@ -85,10 +85,10 @@ export function getPreviewData(data) {
}) })
} }
export function fieldList(id) { export function fieldList(id, showLoading = true) {
return request({ return request({
url: '/dataset/field/list/' + id, url: '/dataset/field/list/' + id,
loading: true, loading: showLoading,
method: 'post' method: 'post'
}) })
} }
...@@ -102,11 +102,11 @@ export function batchEdit(data) { ...@@ -102,11 +102,11 @@ export function batchEdit(data) {
}) })
} }
export function post(url, data) { export function post(url, data, showLoading = true) {
return request({ return request({
url: url, url: url,
method: 'post', method: 'post',
loading: true, loading: showLoading,
data data
}) })
} }
......
...@@ -161,7 +161,7 @@ export default { ...@@ -161,7 +161,7 @@ export default {
}, },
'table': function() { 'table': function() {
if (this.table && this.table.sceneId) { if (this.table && this.table.sceneId) {
post('dataset/group/getScene/' + this.table.sceneId, {}).then(response => { post('dataset/group/getScene/' + this.table.sceneId, {}, false).then(response => {
this.currGroup = response.data this.currGroup = response.data
this.$nextTick(function() { this.$nextTick(function() {
...@@ -213,7 +213,7 @@ export default { ...@@ -213,7 +213,7 @@ export default {
tree(group) { tree(group) {
this.dsLoading = true this.dsLoading = true
post('/dataset/group/tree', group).then(response => { post('/dataset/group/tree', group, false).then(response => {
this.data = response.data this.data = response.data
this.dsLoading = false this.dsLoading = false
}) })
...@@ -227,7 +227,7 @@ export default { ...@@ -227,7 +227,7 @@ export default {
sort: 'type asc,create_time desc,name asc', sort: 'type asc,create_time desc,name asc',
sceneId: this.currGroup.id, sceneId: this.currGroup.id,
mode: this.mode < 0 ? null : this.mode mode: this.mode < 0 ? null : this.mode
}).then(response => { }, false).then(response => {
this.tables = response.data this.tables = response.data
for (let i = 0; i < this.tables.length; i++) { for (let i = 0; i < this.tables.length; i++) {
if (this.tables[i].mode === 1 && this.kettleRunning === false) { if (this.tables[i].mode === 1 && this.kettleRunning === false) {
...@@ -278,7 +278,7 @@ export default { ...@@ -278,7 +278,7 @@ export default {
} }
// check mode=1的数据集是否创建doris表 // check mode=1的数据集是否创建doris表
if (data.mode === 1) { if (data.mode === 1) {
post('/dataset/table/checkDorisTableIsExists/' + data.id, {}).then(response => { post('/dataset/table/checkDorisTableIsExists/' + data.id, {}, false).then(response => {
if (response.data) { if (response.data) {
this.$nextTick(function() { this.$nextTick(function() {
this.$emit('getTable', data) this.$emit('getTable', data)
......
...@@ -67,7 +67,7 @@ export default { ...@@ -67,7 +67,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).then(response => { post('/dataset/table/getPreviewData/1/100', this.table, false).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
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论