CN-906 fix: 知识库列表排序字段名更正
This commit is contained in:
@@ -126,7 +126,8 @@ export default {
|
|||||||
{
|
{
|
||||||
label: this.$t('overall.createTime'),
|
label: this.$t('overall.createTime'),
|
||||||
prop: 'ctime',
|
prop: 'ctime',
|
||||||
show: false
|
show: false,
|
||||||
|
sortable: 'custom'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('overall.updatedBy'),
|
label: this.$t('overall.updatedBy'),
|
||||||
@@ -136,7 +137,8 @@ export default {
|
|||||||
{
|
{
|
||||||
label: this.$t('overall.updateTime'),
|
label: this.$t('overall.updateTime'),
|
||||||
prop: 'utime',
|
prop: 'utime',
|
||||||
show: false
|
show: false,
|
||||||
|
sortable: 'custom'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,13 +55,14 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
tableDataSort (item) {
|
tableDataSort (item) {
|
||||||
let orderBy = ''
|
/*let orderBy = ''
|
||||||
if (item.order === 'ascending') {
|
if (item.order === 'ascending') {
|
||||||
if (item.prop === 'lastTime') {
|
if (item.prop === 'lastTime') {
|
||||||
orderBy = chartTableOrderOptionsMapping[item.prop]
|
orderBy = chartTableOrderOptionsMapping[item.prop]
|
||||||
} else {
|
} else {
|
||||||
orderBy = item.prop
|
orderBy = item.prop
|
||||||
}
|
}
|
||||||
|
orderBy = chartTableOrderOptionsMapping[item.prop] || item.prop
|
||||||
}
|
}
|
||||||
if (item.order === 'descending') {
|
if (item.order === 'descending') {
|
||||||
if (item.prop === 'lastTime') {
|
if (item.prop === 'lastTime') {
|
||||||
@@ -69,7 +70,8 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
orderBy = '-' + item.prop
|
orderBy = '-' + item.prop
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
const orderBy = (item.order === 'descending' ? '-' : '') + (chartTableOrderOptionsMapping[item.prop] || item.prop)
|
||||||
this.$emit('orderBy', orderBy)
|
this.$emit('orderBy', orderBy)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,7 +122,8 @@ export const chartTableColumnMapping = {
|
|||||||
ip: 'IP'
|
ip: 'IP'
|
||||||
}
|
}
|
||||||
export const chartTableOrderOptionsMapping = {
|
export const chartTableOrderOptionsMapping = {
|
||||||
lastTime: 'last_time'
|
lastTime: 'last_time',
|
||||||
|
tagName: 'tag_name'
|
||||||
}
|
}
|
||||||
export const chartPieTableTopOptions = [
|
export const chartPieTableTopOptions = [
|
||||||
{ name: 'Sessions', value: 'sessions' },
|
{ name: 'Sessions', value: 'sessions' },
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ import cnDataList from '@/components/table/CnDataList'
|
|||||||
import dataListMixin from '@/mixins/data-list'
|
import dataListMixin from '@/mixins/data-list'
|
||||||
import KnowledgeBaseTable from '@/components/table/setting/KnowledgeBaseTable'
|
import KnowledgeBaseTable from '@/components/table/setting/KnowledgeBaseTable'
|
||||||
import { api } from '@/utils/api'
|
import { api } from '@/utils/api'
|
||||||
import { get } from '@/utils/http'
|
import {del, get} from '@/utils/http'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'knowledgeBase',
|
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 () {
|
jumpToCreatePage () {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: '/knowledgeBase/form',
|
path: '/knowledgeBase/form',
|
||||||
|
|||||||
Reference in New Issue
Block a user