CN-1134 fix:知识库切换展示记录数由20/页切换为50/页时,展示No Date

This commit is contained in:
hyx
2023-07-03 15:54:32 +08:00
parent 07156f9e03
commit d841118ad9
3 changed files with 20 additions and 19 deletions

View File

@@ -105,14 +105,12 @@ export default {
if (isAll) { if (isAll) {
this.searchLabel = null this.searchLabel = null
} else if (isClearType) { } else if (isClearType) {
// this.searchLabel.tagType = ''
this.searchLabel.type = ''// 换新接口需要修改的属性名称 this.searchLabel.type = ''// 换新接口需要修改的属性名称
} }
if (params) { if (params) {
this.searchLabel = { ...this.searchLabel, ...params } this.searchLabel = { ...this.searchLabel, ...params }
} }
this.searchLabel = { ...this.searchLabel, ...this.pageObj } this.searchLabel = { ...this.searchLabel, ...this.pageObj }
// this.tableData = []
this.isNoData = false this.isNoData = false
this.toggleLoading(true) this.toggleLoading(true)
delete this.searchLabel.total delete this.searchLabel.total
@@ -124,6 +122,11 @@ export default {
if (response.code === 200) { if (response.code === 200) {
this.tableData = response.data.list this.tableData = response.data.list
this.pageObj.total = response.data.total this.pageObj.total = response.data.total
if (!this.tableData || this.tableData.length === 0) {
this.isNoData = true
} else {
this.isNoData = false
}
} else { } else {
console.error(response) console.error(response)
this.isNoData = true this.isNoData = true
@@ -133,13 +136,10 @@ export default {
this.$message.error('Something went wrong...') this.$message.error('Something went wrong...')
} }
} }
}).catch(() => {
this.isNoData = true
}).finally(() => { }).finally(() => {
this.toggleLoading(false) this.toggleLoading(false)
if (!this.tableData || this.tableData.length === 0) {
this.isNoData = true
} else {
this.isNoData = false
}
}) })
}, },
del (row) { del (row) {
@@ -217,6 +217,7 @@ export default {
}, },
pageSize (val) { pageSize (val) {
this.pageObj.pageSize = val this.pageObj.pageSize = val
this.pageObj.pageNo = 1
localStorage.setItem(storageKey.pageSize + '-' + localStorage.getItem(storageKey.username) + '-' + this.tableId, val) localStorage.setItem(storageKey.pageSize + '-' + localStorage.getItem(storageKey.username) + '-' + this.tableId, val)
this.getTableData() this.getTableData()
}, },
@@ -402,9 +403,9 @@ export default {
this.pageObj.pageSize = pageSize this.pageObj.pageSize = pageSize
} }
const userId = localStorage.getItem(storageKey.userId) const userId = localStorage.getItem(storageKey.userId)
let tableName = dbTableColumnCustomizeConfigPre + '-' + this.tableId const tableName = dbTableColumnCustomizeConfigPre + '-' + this.tableId
let localStorageTableTitle = [] let localStorageTableTitle = []
if(indexedDBUtils.selectTable(tableName)){ if (indexedDBUtils.selectTable(tableName)) {
localStorageTableTitle = await indexedDBUtils.selectTable(tableName).get({ id: userId }) localStorageTableTitle = await indexedDBUtils.selectTable(tableName).get({ id: userId })
} }

View File

@@ -111,7 +111,7 @@ export default {
axios.get(`${api.entity.informationAggregation}/${this.entity.entityType}?resource=${this.entity.entityName}&pageSize=100&pageNo=1`).then(response => { axios.get(`${api.entity.informationAggregation}/${this.entity.entityType}?resource=${this.entity.entityName}&pageSize=100&pageNo=1`).then(response => {
const res = response.data const res = response.data
if (res.code === 200) { if (res.code === 200) {
//this.isNoData = res.data.result.length === 0 // this.isNoData = res.data.result.length === 0
this.showError = false this.showError = false
if (res.data.result.length > 0) { if (res.data.result.length > 0) {
res.data.result.forEach(r => { res.data.result.forEach(r => {
@@ -148,9 +148,9 @@ export default {
this.showError = true this.showError = true
this.errorMsg = this.errorMsgHandler(e) this.errorMsg = this.errorMsgHandler(e)
}).finally(() => { }).finally(() => {
if(this.informationAggregationList.length > 0){ if (this.informationAggregationList.length > 0) {
this.isNoData = false this.isNoData = false
}else { } else {
this.isNoData = true this.isNoData = true
} }
this.loading = false this.loading = false

View File

@@ -314,12 +314,12 @@ export default {
this.showImportedData[index].isValid = 0 this.showImportedData[index].isValid = 0
callback(new Error()) callback(new Error())
} }
} else if(formal.indexOf('-') !== -1) { } else if (formal.indexOf('-') !== -1) {
let split2 = formal.split('-') let split2 = formal.split('-')
let startIp = split2[0].replace(/\s+/g, ''); let startIp = split2[0].replace(/\s+/g, '')
let endIp = split2[1].replace(/\s+/g, ''); let endIp = split2[1].replace(/\s+/g, '')
if (regular.ipv4Range.test(startIp) && regular.ipv4Range.test(endIp)) { if (regular.ipv4Range.test(startIp) && regular.ipv4Range.test(endIp)) {
//ipv4对比大小 // ipv4对比大小
if (!(regular.compareIP4(startIp) <= regular.compareIP4(endIp))) { if (!(regular.compareIP4(startIp) <= regular.compareIP4(endIp))) {
validate = false validate = false
this.editTagErrorTip = rule.message this.editTagErrorTip = rule.message
@@ -328,7 +328,7 @@ export default {
callback(new Error()) callback(new Error())
} }
} else if (regular.ipv6Range.test(startIp) && regular.ipv6Range.test(endIp)) { } else if (regular.ipv6Range.test(startIp) && regular.ipv6Range.test(endIp)) {
//ipv6对比大小 // ipv6对比大小
if (!regular.ipv6Reg(startIp, endIp)) { if (!regular.ipv6Reg(startIp, endIp)) {
validate = false validate = false
this.editTagErrorTip = rule.message this.editTagErrorTip = rule.message
@@ -953,7 +953,7 @@ export default {
ip1: data.tagName.substring(0, sepCidrIndex), ip1: data.tagName.substring(0, sepCidrIndex),
ip2: data.tagName.substring(sepCidrIndex + 1) ip2: data.tagName.substring(sepCidrIndex + 1)
} }
} else if(sepRangeIndex > -1){ } else if (sepRangeIndex > -1) {
updateItemData = { updateItemData = {
...updateItemData, ...updateItemData,
addrFormat: 'Range', addrFormat: 'Range',
@@ -1002,7 +1002,7 @@ export default {
ip1: data.tagName.substring(0, sepCidrIndex), ip1: data.tagName.substring(0, sepCidrIndex),
ip2: data.tagName.substring(sepCidrIndex + 1) ip2: data.tagName.substring(sepCidrIndex + 1)
} }
} else if(sepRangeIndex > -1){ } else if (sepRangeIndex > -1) {
addItem = { addItem = {
...addItem, ...addItem,
addrFormat: 'Range', addrFormat: 'Range',