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

View File

@@ -44,6 +44,10 @@ export const api = {
updateKnowledgeUrl: apiVersion + '/knowledgeBase/items/batch', updateKnowledgeUrl: apiVersion + '/knowledgeBase/items/batch',
knowledgeBaseLog: apiVersion + '/knowledgeBase/audit/log', knowledgeBaseLog: apiVersion + '/knowledgeBase/audit/log',
knowledgeBaseTimedistribution: apiVersion + '/knowledgeBase/{{knowledgeId}}/{{type}}/timedistribution', 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', reportJob: '/report/job',

View File

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