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

View File

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