fix: 排查并修复对无数据未做处理的问题

This commit is contained in:
刘洪洪
2023-09-07 11:35:01 +08:00
parent 6072bd0479
commit 0b859bda88
3 changed files with 24 additions and 14 deletions

View File

@@ -467,6 +467,7 @@ export default {
}
},
changeMode () {
if (this.metaList.length > 0) {
const parser = new Parser(this.columnList)
const errorList = parser.validateMeta(this.metaList)
if (_.isEmpty(errorList)) {
@@ -478,6 +479,10 @@ export default {
this.reloadUrl({ mode: 'text' })
this.$emit('changeMode', 'text', { metaList: [], str: '' })
}
} else {
this.reloadUrl({ mode: 'text' })
this.$emit('changeMode', 'text', { metaList: [], str: '' })
}
},
// 处理value例如转换IN的值
handleValue (value, column, operator, flag) {

View File

@@ -23,7 +23,7 @@
<span class="data-column-ips">{{ $t(scope.row[item.prop]) }}</span>
</template>
<!--超过3个ip就省略号显示移动鼠标block块展示并换行-->
<pre style="max-height: 152px;margin: 0px -10px -15px 0;overflow: scroll;"><span style="height: 24px;line-height: 24px;color: #046ECA;">{{scope.row[item.prop].replace(/,/g, '\n')}}</span></pre>
<pre style="max-height: 152px;margin: 0 -10px -15px 0;overflow: scroll;"><span style="height: 24px;line-height: 24px;color: #046ECA;">{{scope.row[item.prop].replace(/,/g, '\n')}}</span></pre>
</el-popover>
<span v-else class="data-column-ips">{{ $t(scope.row[item.prop]) }}</span>
</template>
@@ -103,9 +103,11 @@ export default {
watch: {
timeFilter: {
handler (n) {
if (n) {
this.initData()
}
}
}
},
mounted () {
this.initData()
@@ -128,6 +130,7 @@ export default {
this.tableData = res.data.result
} else {
this.isNoData = true
this.tableData = []
}
}).finally(() => {
this.toggleLoading(false)

View File

@@ -114,11 +114,13 @@ export default {
if (response.status === 200) {
this.showError = false
this.isNoData = res.data.result.length === 0
if (!this.isNoData) {
res.data.result.forEach(e => {
if (e.startTime) {
e.startTime = dateFormatByAppearance(e.startTime)
}
})
}
this.tableData = res.data.result
} else {
this.httpError(res)