feat:CN-1522 删除内置知识库列表的“智能情报学习”栏

This commit is contained in:
hyx
2023-12-28 09:23:00 +08:00
parent fc24f6bbfb
commit 83971fa08b

View File

@@ -1,41 +1,5 @@
<template> <template>
<template v-if="!isNoData"> <template v-if="!isNoData">
<div class="card-type-title" v-if="aiTaggingList.length > 0">{{$t('knowledgeBase.intelligenceLearning')}}</div>
<el-checkbox-group v-model="checkList" >
<div class="card-box" v-for="data in aiTaggingList" :key="data.knowledgeId">
<div @click="isSelectedStatus && data.isBuiltIn !== 1 && clickCard(data,$event)" @mouseenter="mouseenter(data)" @mouseleave="mouseleave(data)" class="card-item" :class="data.isSelected ? 'card-selected' : ''">
<div class="card-content">
<div class="card-operate">
<el-switch v-model="data.status"
v-if="hasPermission('editBuiltInKnowledgeBase')"
class="card-enable"
active-color="#38ACD2"
inactive-color="#C0CEDB"
:active-value="1"
:inactive-value="0"
:before-change="(knowledgeId) => confirmSwitchLearning(data.knowledgeId)"
>
</el-switch>
</div>
<div class="card-icon">
<img :src="data.iconUrl"/>
</div>
<div class="card-title">
<div class="card-title-name" :title="$t(data.label)">{{$t(data.label)}}</div>
</div>
<div class="card-desc" :title="$t(data.desc)">{{$t(data.desc) || '—'}}</div>
</div>
<div class="card-operate__footer">
<button v-if="data.showUpdate && hasPermission('editBuiltInKnowledgeBase')"
class="top-tool-btn--update"
@click="jumpToUpdatePage(data,true)">
<i class="cn-icon-update-knowledge-base cn-icon"></i>
<span>{{$t('overall.update')}}</span>
</button>
</div>
</div>
</div>
</el-checkbox-group>
<div class="card-type-title" style="margin-top:4px;" v-if="websketchList.length > 0">{{$t('knowledgeBase.websketchIntegration')}}</div> <div class="card-type-title" style="margin-top:4px;" v-if="websketchList.length > 0">{{$t('knowledgeBase.websketchIntegration')}}</div>
<el-checkbox-group v-model="checkList" > <el-checkbox-group v-model="checkList" >
<div class="card-box" v-for="data in websketchList" :key="data.knowledgeId"> <div class="card-box" v-for="data in websketchList" :key="data.knowledgeId">
@@ -275,38 +239,24 @@
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
<el-dialog
v-model="showConfirmSwitch"
:width="330"
custom-class="confirm-knowledge-switch"
:title="$t('overall.hint')"
>
<div class="dialog-message">{{ confirmSwitchLearningTip }}</div>
<template #footer>
<span class="dialog-footer">
<el-button @click="cancleSwitch">{{ $t('overall.cancel') }}</el-button>
<el-button type="primary" @click="switchLearning">{{$t('tip.confirm')}}</el-button>
</span>
</template>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import table from '@/mixins/table' import table from '@/mixins/table'
import Loading from '@/components/common/Loading' import Loading from '@/components/common/Loading'
import { getSecond, getMillisecond, xAxisTimeFormatter, xAxisTimeRich } from '@/utils/date-util' import { getSecond, getMillisecond, xAxisTimeFormatter, xAxisTimeRich } from '@/utils/date-util'
import { knowledgeCategoryValue, unitTypes, storageKey, builtInKnowledgeBaseBasicInfo, knowledgeCardUpdateRecordType } from '@/utils/constants' import { knowledgeCategoryValue, unitTypes, storageKey, builtInKnowledgeBaseBasicInfo, knowledgeCardUpdateRecordType } from '@/utils/constants'
import { ref, shallowRef } from 'vue' import { ref, shallowRef } from 'vue'
import { api } from '@/utils/api' import { api } from '@/utils/api'
import { detectionTooltipFormatter } from '@/views/charts/charts/tools' import { detectionTooltipFormatter } from '@/views/charts/charts/tools'
import ChartNoData from '@/views/charts/charts/ChartNoData' import ChartNoData from '@/views/charts/charts/ChartNoData'
import axios from 'axios' import axios from 'axios'
import _ from 'lodash' import _ from 'lodash'
import * as echarts from 'echarts' import * as echarts from 'echarts'
import unitConvert from '@/utils/unit-convert' import unitConvert from '@/utils/unit-convert'
export default { export default {
name: 'knowledgeBaseTableForCard', name: 'knowledgeBaseTableForCard',
mixins: [table], mixins: [table],
props: { props: {
@@ -326,7 +276,6 @@ export default {
return { return {
tableTitle: [], tableTitle: [],
checkList: [], checkList: [],
aiTaggingList: [],
websketchList: [], websketchList: [],
showUpdateDialog: false, showUpdateDialog: false,
showConfirmDialog: false, showConfirmDialog: false,
@@ -790,7 +739,6 @@ export default {
tableData: { tableData: {
handler (n) { handler (n) {
if (this.tableData && this.tableData.length > 0) { if (this.tableData && this.tableData.length > 0) {
this.aiTaggingList = []
this.websketchList = [] this.websketchList = []
this.tableData.forEach(item => { this.tableData.forEach(item => {
item.showUpdate = false item.showUpdate = false
@@ -800,9 +748,7 @@ export default {
...item, ...item,
...basicInfo ...basicInfo
} }
if (item.category === knowledgeCategoryValue.aiTagging) { if (item.category === knowledgeCategoryValue.webSketch) {
this.aiTaggingList.push(item)
} else if (item.category === knowledgeCategoryValue.webSketch) {
this.websketchList.push(item) this.websketchList.push(item)
} }
} }
@@ -837,13 +783,10 @@ export default {
this.chartOption = null this.chartOption = null
window.addEventListener('resize', this.resize) window.addEventListener('resize', this.resize)
this.aiTaggingList = []
this.websketchList = [] this.websketchList = []
this.tableData.forEach(item => { this.tableData.forEach(item => {
item.showUpdate = false item.showUpdate = false
if (item.category === knowledgeCategoryValue.aiTagging) { if (item.category === knowledgeCategoryValue.webSketch) {
this.aiTaggingList.push(item)
} else if (item.category === knowledgeCategoryValue.webSketch) {
this.websketchList.push(item) this.websketchList.push(item)
} }
}) })
@@ -871,21 +814,7 @@ export default {
action: 'overwrite', action: 'overwrite',
description: this.updateObject.description description: this.updateObject.description
} }
},
confirmSwitchLearningTip () {
let tip = ''
if (this.switchKnowledgeId) {
const find = this.aiTaggingList.find(item => item.knowledgeId === this.switchKnowledgeId)
if (find) {
if (find.status === 0) {
tip = this.$t('tip.confirmEnablePsiphon3') + '?'
} else if (find.status === 1) {
tip = this.$t('tip.confirmDisablePsiphon3') + '?'
} }
} }
} }
return tip
}
}
}
</script> </script>