Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
poc-fe
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
poc
poc-fe
Commits
aa907fa3
Commit
aa907fa3
authored
Jan 15, 2025
by
tyyin lan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: 插件中心操作导航跳转
parent
3dc6fb7e
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
66 additions
and
12 deletions
+66
-12
en.yaml
src/locales/langs/en.yaml
+1
-0
zh-cn.yaml
src/locales/langs/zh-cn.yaml
+1
-0
zh-hk.yaml
src/locales/langs/zh-hk.yaml
+1
-0
personal-app-config.ts
src/store/modules/personal-app-config.ts
+1
-0
personal-app-config.ts
src/store/types/personal-app-config.ts
+1
-0
application-selection-modal.vue
src/views/plugin-center/application-selection-modal.vue
+56
-11
plugin-center.vue
src/views/plugin-center/plugin-center.vue
+4
-1
locales.d.ts
types/locales.d.ts
+1
-0
No files found.
src/locales/langs/en.yaml
View file @
aa907fa3
...
...
@@ -136,6 +136,7 @@ common_module:
copy_link
:
'
Copy
link'
or
:
'
or'
search_keyword_empty_tip
:
'
The
search
content
cannot
be
empty'
added
:
'
Added'
dialogue_module
:
continue_question_message
:
'
You
can
keep
asking
questions'
...
...
src/locales/langs/zh-cn.yaml
View file @
aa907fa3
...
...
@@ -135,6 +135,7 @@ common_module:
copy_link
:
'
复制链接'
or
:
'
或'
search_keyword_empty_tip
:
'
搜索内容不能为空'
added
:
'
已添加'
dialogue_module
:
continue_question_message
:
'
你可以继续提问'
...
...
src/locales/langs/zh-hk.yaml
View file @
aa907fa3
...
...
@@ -135,6 +135,7 @@ common_module:
copy_link
:
'
複製鏈接'
or
:
'
或'
search_keyword_empty_tip
:
'
搜索內容不能為空'
added
:
'
已添加'
dialogue_module
:
continue_question_message
:
'
你可以繼續提問'
...
...
src/store/modules/personal-app-config.ts
View file @
aa907fa3
...
...
@@ -41,6 +41,7 @@ export function defaultPersonalAppConfigState(): PersonalAppConfigState {
isCollect
:
''
,
isSale
:
''
,
agentPublishId
:
1
,
unitIds
:
[],
}
}
...
...
src/store/types/personal-app-config.ts
View file @
aa907fa3
...
...
@@ -48,4 +48,5 @@ export interface PersonalAppConfigState {
isSale
:
string
isCopy
?:
string
agentPublishId
:
number
unitIds
:
string
[]
}
src/views/plugin-center/application-selection-modal.vue
View file @
aa907fa3
<
script
setup
lang=
"ts"
>
import
{
ref
,
watch
}
from
'vue'
import
{
Search
}
from
'@icon-park/vue-next'
import
{
fetchGetApplicationList
}
from
'@/apis/agent-application'
import
{
fetchGetApplicationList
,
fetchGetDebugApplicationInfo
,
fetchSaveAgentApplication
,
}
from
'@/apis/agent-application'
import
{
useI18n
}
from
'vue-i18n'
import
type
{
PersonalAppConfigState
}
from
'@/store/types/personal-app-config'
import
{
useRouter
}
from
'vue-router'
interface
Props
{
currentSelectPluginId
:
string
}
interface
ApplicationInfoInterface
{
agentId
:
string
...
...
@@ -13,25 +23,24 @@ interface ApplicationInfoInterface {
interface
ApplicationItemInfoInterface
{
baseInfo
:
ApplicationInfoInterface
unitIds
:
string
[]
}
defineProps
<
Props
>
()
const
showModal
=
defineModel
<
boolean
>
(
'showModal'
,
{
default
:
false
})
const
{
t
}
=
useI18n
()
const
router
=
useRouter
()
const
searchKeyword
=
ref
(
''
)
const
applicationList
=
ref
<
ApplicationInfoInterface
[]
>
([])
const
getApplicationListLoading
=
ref
(
true
)
const
currentApplicationPluginOperationLoading
=
ref
(
''
)
watch
(
showModal
,
(
newVal
)
=>
{
newVal
&&
getApplicationList
()
})
/* created */
;(
function
()
{
getApplicationList
()
})()
function
getApplicationList
()
{
getApplicationListLoading
.
value
=
true
...
...
@@ -46,6 +55,7 @@ function getApplicationList() {
agentTitle
:
itemInfo
.
baseInfo
.
agentTitle
,
agentAvatar
:
itemInfo
.
baseInfo
.
agentAvatar
,
agentDesc
:
itemInfo
.
baseInfo
.
agentDesc
,
unitIds
:
itemInfo
.
unitIds
||
[],
}
})
...
...
@@ -73,12 +83,39 @@ function handleSearchAppKeywordClear() {
}
function
handleAppAddPlugin
(
agentId
:
string
)
{
console
.
log
(
'🐽🐽🐽🐽🐽🐽插件使用🐽🐽🐽🐽🐽🐽'
)
console
.
log
(
agentId
)
currentApplicationPluginOperationLoading
.
value
=
agentId
fetchGetDebugApplicationInfo
<
PersonalAppConfigState
>
(
agentId
)
.
then
((
res
)
=>
{
if
(
res
.
code
!==
0
)
return
''
const
payload
=
{
...
res
.
data
,
unitIds
:
[...(
res
.
data
.
unitIds
||
[]),
agentId
]
}
fetchSaveAgentApplication
(
payload
)
.
then
((
SaveRes
)
=>
{
if
(
SaveRes
.
code
!==
0
)
return
''
getApplicationList
()
window
.
$message
.
success
(
t
(
'common_module.successful_update'
))
router
.
push
({
name
:
'PersonalAppSetting'
,
params
:
{
agentId
}
})
})
.
finally
(()
=>
{
currentApplicationPluginOperationLoading
.
value
=
''
})
})
.
catch
(()
=>
{
currentApplicationPluginOperationLoading
.
value
=
''
})
}
function
handleCreateNewApplication
()
{
console
.
log
(
'💥💥💥💥💥💥创建新应用💥💥💥💥💥💥'
)
router
.
push
({
name
:
'PersonalAppSetting'
})
}
function
handleNavigateToAppSetting
(
agentId
:
string
)
{
router
.
push
({
name
:
'PersonalAppSetting'
,
params
:
{
agentId
}
})
}
</
script
>
...
...
@@ -116,7 +153,8 @@ function handleCreateNewApplication() {
<
template
#
default=
"{ item }"
>
<div
:key=
"item.agentId"
class=
"mb-[18px] box-border flex h-[88px] items-center rounded-[10px] border-[1px] border-solid border-[#ccc] px-[21px]"
class=
"hover:!border-theme-color mb-[18px] box-border flex h-[88px] cursor-pointer select-none items-center rounded-[10px] border-[1px] border-solid border-[#ccc] px-[21px] transition"
@
click=
"handleNavigateToAppSetting(item.agentId)"
>
<img
class=
"h-[46px] w-[46px] rounded-[6px] object-cover"
:src=
"item.agentAvatar"
alt=
"app-cover"
/>
...
...
@@ -133,7 +171,14 @@ function handleCreateNewApplication() {
</div>
</div>
<n-button
type=
"primary"
@
click=
"handleAppAddPlugin(item.agentId)"
>
{{
t
(
'common_module.add'
)
}}
</n-button>
<n-button
type=
"primary"
:loading=
"currentApplicationPluginOperationLoading === item.agentId"
:disabled=
"item.unitIds.includes(currentSelectPluginId)"
@
click
.
stop=
"handleAppAddPlugin(item.agentId)"
>
{{
t
(
'common_module.add'
)
}}
</n-button>
</div>
</
template
>
</n-virtual-list>
...
...
src/views/plugin-center/plugin-center.vue
View file @
aa907fa3
...
...
@@ -176,6 +176,9 @@ function handlePluginUse(pluginId: string) {
<n-spin
size=
"large"
/>
</section>
<ApplicationSelectionModal
v-model:show-modal=
"isShowApplicationSelectionModal"
/>
<ApplicationSelectionModal
v-model:show-modal=
"isShowApplicationSelectionModal"
:current-select-plugin-id=
"currentSelectPluginId"
/>
</div>
</
template
>
types/locales.d.ts
View file @
aa907fa3
...
...
@@ -135,6 +135,7 @@ declare namespace I18n {
copy_link
:
string
or
:
string
search_keyword_empty_tip
:
string
added
:
string
dialogue_module
:
{
continue_question_message
:
string
...
...
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