Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c06de809
authored
May 21, 2024
by
cherishsince
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【解决todo】AI 角色仓库,增加全部分类筛选
parent
0803e33d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
13 deletions
+12
-13
src/views/ai/chat/role/RoleCategoryList.vue
+5
-4
src/views/ai/chat/role/index.vue
+7
-9
No files found.
src/views/ai/chat/role/RoleCategoryList.vue
View file @
c06de809
<
template
>
<div
class=
"category-list"
>
<div
class=
"category"
v-for=
"
category
in categoryList"
:key=
"category"
>
<el-button
plain
v-if=
"category !== active"
@
click=
"handleCategoryClick(category)"
>
{{
category
}}
</el-button>
<el-button
plain
type=
"primary"
v-else
@
click=
"handleCategoryClick(category)"
>
{{
category
}}
</el-button>
<div
class=
"category"
v-for=
"
(category)
in categoryList"
:key=
"category"
>
<el-button
plain
round
size=
"small"
v-if=
"category !== active"
@
click=
"handleCategoryClick(category)"
>
{{
category
}}
</el-button>
<el-button
plain
round
size=
"small"
v-else
type=
"primary"
@
click=
"handleCategoryClick(category)"
>
{{
category
}}
</el-button>
</div>
</div>
</
template
>
...
...
@@ -17,7 +17,8 @@ defineProps({
},
active
:
{
type
:
String
,
required
:
false
required
:
false
,
default
:
'全部'
}
})
...
...
src/views/ai/chat/role/index.vue
View file @
c06de809
...
...
@@ -83,7 +83,7 @@ const myRoleList = ref<ChatRoleVO[]>([]) // my 分页大小
const
publicPageNo
=
ref
<
number
>
(
1
)
// public 分页下标
const
publicPageSize
=
ref
<
number
>
(
50
)
// public 分页大小
const
publicRoleList
=
ref
<
ChatRoleVO
[]
>
([])
// public 分页大小
const
activeCategory
=
ref
<
string
>
(
''
)
// 选择中的分类
const
activeCategory
=
ref
<
string
>
(
'
全部
'
)
// 选择中的分类
const
categoryList
=
ref
<
string
[]
>
([])
// 角色分类类别
/** 添加/修改操作 */
const
formRef
=
ref
()
...
...
@@ -101,14 +101,12 @@ const getMyRole = async (append?: boolean) => {
const
params
:
ChatRolePageReqVO
=
{
pageNo
:
myPageNo
.
value
,
pageSize
:
myPageSize
.
value
,
category
:
activeCategory
.
value
,
name
:
search
.
value
,
publicStatus
:
false
}
const
{
total
,
list
}
=
await
ChatRoleApi
.
getMyPage
(
params
)
if
(
append
)
{
myRoleList
.
value
.
push
.
apply
(
myRoleList
.
value
,
list
)
console
.
log
(
'myRoleList.value.push'
,
myRoleList
.
value
)
}
else
{
myRoleList
.
value
=
list
}
...
...
@@ -119,7 +117,7 @@ const getPublicRole = async (append?: boolean) => {
const
params
:
ChatRolePageReqVO
=
{
pageNo
:
publicPageNo
.
value
,
pageSize
:
publicPageSize
.
value
,
category
:
activeCategory
.
value
,
category
:
activeCategory
.
value
===
'全部'
?
''
:
activeCategory
.
value
,
name
:
search
.
value
,
publicStatus
:
true
}
...
...
@@ -144,16 +142,16 @@ const getActiveTabsRole = async () => {
// 获取角色分类列表
const
getRoleCategoryList
=
async
()
=>
{
categoryList
.
value
=
await
ChatRoleApi
.
getCategoryList
()
const
res
=
await
ChatRoleApi
.
getCategoryList
()
const
defaultRole
=
[
'全部'
]
categoryList
.
value
=
[...
defaultRole
,
...
res
]
}
// 处理分类点击
const
handlerCategoryClick
=
async
(
category
:
string
)
=>
{
if
(
activeCategory
.
value
===
category
)
{
activeCategory
.
value
=
''
}
else
{
// 切换选择的分类
activeCategory
.
value
=
category
}
// 筛选
await
getActiveTabsRole
()
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment