CN-906 fix: 知识库列表排序字段名更正
This commit is contained in:
@@ -126,7 +126,8 @@ export default {
|
||||
{
|
||||
label: this.$t('overall.createTime'),
|
||||
prop: 'ctime',
|
||||
show: false
|
||||
show: false,
|
||||
sortable: 'custom'
|
||||
},
|
||||
{
|
||||
label: this.$t('overall.updatedBy'),
|
||||
@@ -136,7 +137,8 @@ export default {
|
||||
{
|
||||
label: this.$t('overall.updateTime'),
|
||||
prop: 'utime',
|
||||
show: false
|
||||
show: false,
|
||||
sortable: 'custom'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -55,13 +55,14 @@ export default {
|
||||
})
|
||||
},
|
||||
tableDataSort (item) {
|
||||
let orderBy = ''
|
||||
/*let orderBy = ''
|
||||
if (item.order === 'ascending') {
|
||||
if (item.prop === 'lastTime') {
|
||||
orderBy = chartTableOrderOptionsMapping[item.prop]
|
||||
} else {
|
||||
orderBy = item.prop
|
||||
}
|
||||
orderBy = chartTableOrderOptionsMapping[item.prop] || item.prop
|
||||
}
|
||||
if (item.order === 'descending') {
|
||||
if (item.prop === 'lastTime') {
|
||||
@@ -69,7 +70,8 @@ export default {
|
||||
} else {
|
||||
orderBy = '-' + item.prop
|
||||
}
|
||||
}
|
||||
}*/
|
||||
const orderBy = (item.order === 'descending' ? '-' : '') + (chartTableOrderOptionsMapping[item.prop] || item.prop)
|
||||
this.$emit('orderBy', orderBy)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,7 +122,8 @@ export const chartTableColumnMapping = {
|
||||
ip: 'IP'
|
||||
}
|
||||
export const chartTableOrderOptionsMapping = {
|
||||
lastTime: 'last_time'
|
||||
lastTime: 'last_time',
|
||||
tagName: 'tag_name'
|
||||
}
|
||||
export const chartPieTableTopOptions = [
|
||||
{ name: 'Sessions', value: 'sessions' },
|
||||
|
||||
@@ -42,7 +42,7 @@ import cnDataList from '@/components/table/CnDataList'
|
||||
import dataListMixin from '@/mixins/data-list'
|
||||
import KnowledgeBaseTable from '@/components/table/setting/KnowledgeBaseTable'
|
||||
import { api } from '@/utils/api'
|
||||
import { get } from '@/utils/http'
|
||||
import {del, get} from '@/utils/http'
|
||||
|
||||
export default {
|
||||
name: 'knowledgeBase',
|
||||
@@ -67,6 +67,23 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
del (row) {
|
||||
this.$confirm(this.$t('tip.confirmDelete'), {
|
||||
confirmButtonText: this.$t('tip.yes'),
|
||||
cancelButtonText: this.$t('tip.no'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
del(this.url + '?ids=' + row.knowledgeId).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.delFlag = true
|
||||
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.deleteSuccess') })
|
||||
this.getTableData()
|
||||
} else {
|
||||
this.$message.error(response.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
jumpToCreatePage () {
|
||||
this.$router.push({
|
||||
path: '/knowledgeBase/form',
|
||||
|
||||
Reference in New Issue
Block a user