feat:http数据集修改输出字段

main
liu.shiyi 2 years ago
parent 3dd519c1fe
commit 9949277310

@ -1115,7 +1115,7 @@ export default {
this.dataPreviewList = res && Array.isArray(res) ? res : [{ ...res }] this.dataPreviewList = res && Array.isArray(res) ? res : [{ ...res }]
// //
console.log(res) console.log(res)
this.updateOoutputFieldList(res?.data) this.updateOoutputFieldList(this.dataPreviewList)
this.$message.success('解析并执行成功') this.$message.success('解析并执行成功')
}) })
} else { } else {

@ -77,6 +77,7 @@ export default {
if (res.executionByFrontend) { if (res.executionByFrontend) {
if (res.data.datasetType === 'http') { if (res.data.datasetType === 'http') {
_res = await axiosFormatting(res.data) _res = await axiosFormatting(res.data)
_res = this.httpDataFormatting(res, _res)
} }
if (res.data.datasetType === 'js') { if (res.data.datasetType === 'js') {
try { try {
@ -123,6 +124,7 @@ export default {
if (res.executionByFrontend) { if (res.executionByFrontend) {
if (res.data.datasetType === 'http') { if (res.data.datasetType === 'http') {
_res = await axiosFormatting(res.data) _res = await axiosFormatting(res.data)
_res = this.httpDataFormatting(res, _res)
} }
if (res.data.datasetType === 'js') { if (res.data.datasetType === 'js') {
try { try {
@ -154,6 +156,17 @@ export default {
}) })
}) })
}, },
// http前台代理需要对返回的数据进行重新组装
httpDataFormatting (chartRes, httpRes) {
let result = {}
result = {
columnData: chartRes.columnData,
data: httpRes,
success: chartRes.success
}
return result
},
dataFormatting (config, data) { dataFormatting (config, data) {
// 覆盖 // 覆盖
}, },

Loading…
Cancel
Save