feat:CN-1522 插件管理界面与接口调试

This commit is contained in:
hanyuxia
2023-12-29 18:04:50 +08:00
parent ca3b9d926c
commit 467b2c27b7
3 changed files with 13 additions and 12 deletions

View File

@@ -30,16 +30,11 @@
<template #default="scope" :column="item">
<template v-if="item.prop === 'status'">
<el-switch
v-if="hasPermission('editUser')"
v-model="scope.row.status"
active-value="1"
inactive-value="0"
@change="()=>{statusChange(scope.row)}">
</el-switch>
<template v-else>
<span v-if="scope.row.status === '1'">{{$t('detection.create.enabled')}}</span>
<span v-else>{{$t('detection.create.disabled')}}</span>
</template>
</template>
<template v-else-if="item.prop === 'type'">
<span class="type-tag">{{tagSourceText(scope.row[item.prop])}}</span>
@@ -133,15 +128,17 @@ export default {
},
methods: {
statusChange (plugin) {
/*
axios.put('sys/plugin', user).then(response => {
let status = plugin.status
let statusUrl = status === 0 ? api.pluginStatusEnable : api.pluginStatusDisable
axios.put(statusUrl,{id:plugin.id}).then(response => {
if (response.status === 200) {
this.$message({ duration: 1000, type: 'success', message: this.$t('tip.saveSuccess') })
} else {
this.$message.error(response.data.message)
}
this.$emit('reload')
}) */
})
}
}
}

View File

@@ -44,6 +44,10 @@ export const api = {
updateKnowledgeUrl: apiVersion + '/knowledgeBase/items/batch',
knowledgeBaseLog: apiVersion + '/knowledgeBase/audit/log',
knowledgeBaseTimedistribution: apiVersion + '/knowledgeBase/{{knowledgeId}}/{{type}}/timedistribution',
//插件
pluginList: apiVersion + '/plugin/intelligence-learning/list',
pluginStatusEnable: apiVersion + '/plugin/intelligence-learning/{id}/start',
pluginStatusDisable: apiVersion + '/plugin/intelligence-learning/{id}/stop',
// 报告相关
reportJob: '/report/job',

View File

@@ -47,7 +47,7 @@ export default {
},
data () {
return {
url: api.knowledgeBaseList,
url: api.pluginList,
blankObject: { // 空白对象
id: '',
name: '',
@@ -69,16 +69,16 @@ export default {
if (params) {
this.searchLabel = { ...this.searchLabel, ...params }
}
this.searchLabel = { ...this.searchLabel, ...this.pageObj }
//this.searchLabel = { ...this.searchLabel, ...this.pageObj }
//this.searchLabel = {...this.searchLabel,jobGroup:3}
this.isNoData = false
// this.tableData = []
this.toggleLoading(true)
delete this.searchLabel.total
let listUrl = this.url
if (this.listUrl) {
listUrl = this.listUrl
}
this.searchLabel.category = 'ai_tagging'
//this.searchLabel.category = 'ai_tagging'
axios.get(listUrl, { params: this.searchLabel }).then(response => {
if (response.status === 200) {
for (let i = 0; i < response.data.data.list.length; i++) {