CN-906 fix: 知识库列表简版;调整一些目录名

This commit is contained in:
chenjinsong
2023-02-23 18:12:20 +08:00
parent a9fe48933c
commit 3d2623f8cf
31 changed files with 302 additions and 600 deletions

View File

@@ -0,0 +1,101 @@
<template>
<div style="height: 100%;">
<cn-data-list
ref="dataList"
:tableId="tableId"
v-model:custom-table-title="tools.customTableTitle"
:api="url"
from="knowledge-base"
:layout="['columnCustomize','elementSet','search']"
@search="search"
>
<template v-slot:top-tool-right>
<button id="roles-add" :title="$t('overall.createRole')" class="top-tool-btn margin-r-10"
type="button" @click="add">
<i class="cn-icon-add cn-icon"></i>
</button>
</template>
<template v-slot:default>
<knowledge-base-table
ref="dataTable"
v-loading="tools.loading"
:api="url"
:custom-table-title="tools.customTableTitle"
:height="mainTableHeight"
:table-data="tableData"
@delete="del"
@edit="edit"
@orderBy="tableDataSort"
@reload="getTableData"
@selectionChange="selectionChange"
></knowledge-base-table>
</template>
<!-- 分页组件 -->
<template #pagination>
<pagination ref="pagination" :page-obj="pageObj" :table-id="tableId" @pageNo='pageNo' @pageSize='pageSize'></pagination>
</template>
</cn-data-list>
</div>
</template>
<script>
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'
export default {
name: 'knowledgeBase',
components: {
cnDataList,
KnowledgeBaseTable
},
mixins: [dataListMixin],
data () {
return {
url: api.knowledgeBase,
tableId: 'knowledgeBaseTable', // 需要分页的table的id用于记录每页数量
blankObject: { // 空白对象
tagName: '',
buildIn: '',
id: '',
tagType: '',
remark: '',
updateTime: ''
}
}
},
methods: {
edit (u) {
get(`${this.url}`, { ids: u.id }).then(response => {
if (response.code === 200) {
this.object = response.data.list[0]
this.rightBox.show = true
}
})
},
getTableData () {
this.tools.loading = false
this.tableData = [
{
tagName: '我的IP库',
buildIn: 0,
id: 1,
tagType: 'ip',
remark: '我的IP库描述',
updateTime: new Date()
},
{
tagName: '我的domain库',
buildIn: 0,
id: 2,
tagType: 'domain',
remark: '我的domain库描述',
updateTime: new Date()
}
]
this.pageObj.total = 2
}
}
}
</script>