feat(intelligent-agent): 添加智能体可见权限功能

- 在智能体列表和详情页面添加可见权限相关功能
- 实现可见权限的 cascader 选择组件
- 添加用户选择功能,支持多选- 优化智能体创建和编辑页面,增加可见权限相关字段- 调整首页布局,移除不必要的元素
This commit is contained in:
陈昱达
2025-05-09 17:56:55 +08:00
parent 5fde533a6d
commit dd71e1c818
9 changed files with 60 additions and 50 deletions

View File

@@ -1,11 +1,11 @@
module.exports = {
presets: ['@vue/app'],
plugins: [
// [
// 'transform-remove-console',
// {
// exclude: ['warn', 'error'] // 可选:保留 warn 和 error
// }
// ]
[
'transform-remove-console',
{
exclude: ['warn', 'error'] // 可选:保留 warn 和 error
}
]
]
}

View File

@@ -8,7 +8,7 @@ import getUrl from '@/assets/js/utils/get-url'
*/
const agentList = (data = {}) => {
return request({
url: getUrl('/intelligent/app/page'),
url: getUrl('/intelligent/ex/list'),
method: 'post',
data
})

View File

@@ -225,7 +225,11 @@
}
}
}
.rate90 {
.rate360 {
transform: rotateY(180deg);
transition: all 0.2s;
}
.rate180 {
transform: rotateY(0deg);
transition: all 0.2s;
}

View File

@@ -1,13 +1,5 @@
<template>
<div class="home-container pl50 pr50 pb50 pt90 text-center">
<!--<p>易商阜极管理系统模版欢迎您的登入{{ uerName }}</p>-->
<!--<el-button @click="visable = true">测试文件</el-button>-->
<!--<r-view :visable.sync="visable" :title="title" :filePath="filePath"> </r-view>-->
<img class="homeImg mt60" alt="" src="../../assets/images/home.png" />
<div class="fs20 fwb mv20">
&nbsp;&nbsp;&nbsp;&nbsp;访&nbsp;&nbsp;&nbsp;&nbsp;
</div>
</div>
<div class="home-container pl50 pr50 pb50 pt90 text-center"></div>
</template>
<script>
@@ -16,12 +8,9 @@ import { mapGetters, mapActions } from 'vuex'
export default {
name: 'Home',
data() {
return {
}
},
created() {
return {}
},
created() {},
mounted() {},
methods: {
success() {}

View File

@@ -11,7 +11,7 @@
style="font-size: 20px;margin:0;cursor: pointer"
@click.native="findMouseEnter"
icon-class="hide"
:class-name="sidebar.opened ? '' : 'rate90'"
:class-name="sidebar.opened ? 'rate360' : 'rate180'"
></svg-icon>
</div>

View File

@@ -4,10 +4,12 @@ import { VEmojiPicker } from 'v-emoji-picker'
import cropper from '@/components/RenderCropper/components/cropper.vue'
import { uploadImage } from '@/api/generatedApi'
import { agentType } from '@/assets/js/utils/utilOptions'
import otherSelect from '@/views/knowledge/detail/components/otherSelect/otherIndex.vue'
export default {
name: 'info',
inject: ['dialog', 'fetchAgentList', 'resetList'],
components: {
otherSelect,
VEmojiPicker,
cropper
},
@@ -242,6 +244,9 @@ export default {
</div>
</el-form-item>
<el-form-item label="可见权限" prop="visibleRange">
<otherSelect :model="dialog.agent" propKey="visibleRange"></otherSelect>
</el-form-item>
<el-form-item label="描述" prop="description">
<el-input
size="medium"
@@ -269,7 +274,7 @@ export default {
line-height: 50px;
font-size: 20px;
cursor: pointer;
background: #d1e9f;
background: #d1e9ff;
}
.back-content {

View File

@@ -22,7 +22,8 @@ export default {
visible: false,
agent: {
id: '',
thirdAppId: ''
thirdAppId: '',
visibleRange: 0
}
},
searchOption: {
@@ -65,13 +66,13 @@ export default {
resetList() {
this.list = []
this.page = 0
this.page = 1
},
load() {
if (this.total === this.list.length) {
return false
}
this.page += 1
this.page = 1
this.fetchAgentList({
page: this.page,
pageSize: this.pageSize
@@ -87,7 +88,7 @@ export default {
appNameLike: params.nameLike ? params.nameLike : '',
appType: params.appType ? params.appType : ''
})
this.list.push(...content.content.list)
this.list.push(...content.content)
this.total = content.content.total
},
@@ -108,6 +109,9 @@ export default {
if (!content.content.backgroundColor) {
content.content.backgroundColor = '#d1e9ff'
}
if (!content.content.visibleRange) {
content.content.visibleRange = 0
}
this.$set(this.dialog, 'agent', content.content)
this.dialog.type = 'edit'
this.dialog.title = '编辑智能体'
@@ -144,7 +148,9 @@ export default {
description: '',
imageType: '',
image: '',
backgroundColor: '#d1e9ff'
backgroundColor: '#d1e9ff',
visibleRange: 0,
userIds: []
}
this.dialog.title = '创建智能体'
this.dialog.visible = true

View File

@@ -66,6 +66,10 @@ export default {
userIds: []
}
}
},
propKey: {
type: String,
default: 'visibleRange'
}
},
computed: {
@@ -168,10 +172,10 @@ export default {
watch: {
model: {
handler(newVal) {
if (newVal.visibleRange === 0) {
if (newVal[this.propKey] === 0) {
this.values = [0]
this.cascaderProps.multiple = false
} else if (newVal.visibleRange === 1) {
} else if (newVal[this.propKey] === 1) {
this.values = [1]
this.cascaderProps.multiple = false
} else {
@@ -183,12 +187,13 @@ export default {
})
}
}
}
},
immediate: true
},
values: {
handler(newVal) {
if (!this.cascaderProps.multiple) {
this.model.visibleRange = newVal[0]
this.model[this.propKey] = newVal[0]
if (newVal[0] === 0) {
this.model.userIds = []
} else {
@@ -201,7 +206,7 @@ export default {
}
}
} else {
this.model.visibleRange = 2
this.model[this.propKey] = 2
this.model.userIds = newVal.map(item => {
return item[1]
})

View File

@@ -692,21 +692,21 @@ export default {
},
'删除'
),
h(
'el-button',
{
class: 'normal-button',
props: {
type: 'primary',
size: 'mini',
disabled: true,
icon: 'el-icon-edit-outline',
title: '编辑'
},
on: {}
},
'编辑'
),
// h(
// 'el-button',
// {
// class: 'normal-button',
// props: {
// type: 'primary',
// size: 'mini',
// disabled: true,
// icon: 'el-icon-edit-outline',
// title: '编辑'
// },
// on: {}
// },
// '编辑'
// ),
h(
'el-button',
@@ -716,7 +716,8 @@ export default {
type: 'primary',
size: 'mini',
icon: 'el-icon-tickets',
title: '添加元数据'
title: '添加元数据',
disabled: params.row.documentStatus !== 1
},
on: {
click: () => this.handleAddMetadata(params.row)