Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
930 changes: 160 additions & 770 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions template/tinyvue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,10 @@
"dependencies": {
"@babel/core": "^7.25.2",
"@gaonengwww/mock-server": "^1.0.5",
"@mcp-b/webmcp-polyfill":"^2.0.0",
"@mcp-b/webmcp-types":"^2.0.0",
"@mcp-b/webmcp-polyfill": "^3.0.0",
"@mcp-b/webmcp-types": "^3.0.0",
"@opentiny/icons": "^0.1.3",
"@opentiny/next-remoter": "0.2.7",
"@opentiny/next-sdk": "0.2.7",
"@opentiny/next-sdk": "^0.4.1",
"@opentiny/vue": "^3.28.0",
"@opentiny/vue-huicharts": "~3.28.0",
"@opentiny/vue-icon": "~3.28.0",
Expand Down
5 changes: 2 additions & 3 deletions template/tinyvue/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import GlobalSetting from '@/components/global-setting/index.vue'
import { tinyProOperatorSkillText } from '@/skills'
import { sleep } from '@/utils/base-utils'
import { useTheme } from './hooks/useTheme'
import '@opentiny/next-remoter/dist/style.css'

const theme = new TinyThemeTool()
useTheme(theme)
Expand All @@ -25,7 +24,7 @@ const design = {
},
}
onMounted(() => {
navigator.modelContext.registerTool({
document.modelContext.registerTool({
name: 'navigate_url',
title: '导航到指定URL',
description: '当需要的工具在当前页面不可用时,使用此工具跳转到特定页面。例如:要跳转到 "/vue-pro/order/allOrder",要创建价保时跳转到 "/vue-pro/price-protection/allPriceProtection"。',
Expand All @@ -43,7 +42,7 @@ onMounted(() => {
},
})

navigator.modelContext.registerTool({
document.modelContext.registerTool({
name: 'system-overview',
title: '系统概览',
description: '整体介绍网站的模块、路由、页面工具、使用规范等等内容',
Expand Down
14 changes: 9 additions & 5 deletions template/tinyvue/src/views/locale/components/add-locale.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,14 @@ async function addLang() {
const { data } = await createLang({ name: lang.name })
locales.pushLang(data)
emits('langChange')
} catch (reason: any) {
}
catch (reason: any) {
Notify({
type: 'error',
message: reason.response.data.message,
})
} finally {
}
finally {
lang.name = ''
setLangPopoverClose()
}
Expand All @@ -111,13 +113,15 @@ async function addLocale() {
})
emits('localChange')
return true
} catch (reason: any) {
}
catch (reason: any) {
Notify({
type: 'error',
message: reason.response.data.message,
})
return false
} finally {
}
finally {
onClose()
}
}
Expand All @@ -131,7 +135,7 @@ watch(open, (value) => {
const toolAbortController = new AbortController()

onMounted(async () => {
navigator.modelContext.registerTool({
document.modelContext.registerTool({
name: 'add-i18n-entry',
title: '添加国际化词条',
description: '添加国际化词条',
Expand Down
9 changes: 5 additions & 4 deletions template/tinyvue/src/views/menu/info/components/info-tab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,17 @@ async function onClickAdd() {
addModal.value = false
await updateUserMenu()
await fetchMenu()
} catch (error: any) {
}
catch (error: any) {
if (error.response && error.response.data) {
const errorMessage = error.response.data.message || '未知错误'
TinyModal.message({
message: errorMessage,
status: 'error',
})
}
} finally {
}
finally {
setAddLoading(false)
}
}
Expand Down Expand Up @@ -232,14 +234,13 @@ watch(locale, () => {
fetchLocalItems()
})


const toolAbortController = new AbortController()

onMounted(async () => {
Promise.all([fetchMenu(), fetchLocalItems()]).finally(() => {
treeLoading.value = false
})
navigator.modelContext.registerTool({
document.modelContext.registerTool({
name: 'add-menu',
title: '添加菜单',
description: '添加菜单',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ async function handlePermissionAddCancel() {
const toolAbortController = new AbortController()

onMounted(async () => {
navigator.modelContext.registerTool({
document.modelContext.registerTool({
name: 'add-permission',
title: '添加权限',
description: '添加权限',
Expand Down
10 changes: 6 additions & 4 deletions template/tinyvue/src/views/role/info/components/info-tab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,17 @@ async function onConfirm(ids: number[]) {
menus: data.menus,
})
await flushRouter()
} catch (error: any) {
}
catch (error: any) {
if (error.response && error.response.data) {
const errorMessage = error.response.data.message || '未知错误'
TinyModal.message({
message: errorMessage,
status: 'error',
})
}
} finally {
}
finally {
roleTableRef.value.reload()
flushTabs()
reloadMenu()
Expand Down Expand Up @@ -203,7 +205,7 @@ function onRoleDelete() {
const toolAbortController = new AbortController()

onMounted(async () => {
navigator.modelContext.registerTool({
document.modelContext.registerTool({
name: 'add-role',
title: '添加角色',
description: '添加角色,不需要生成角色卡片',
Expand All @@ -228,7 +230,7 @@ onMounted(async () => {
},
}, { signal: toolAbortController.signal })

navigator.modelContext.registerTool({
document.modelContext.registerTool({
name: 'bind-menu-for-role',
title: '绑定菜单',
description: '给某个角色绑定菜单',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ fetchRole()
const toolAbortController = new AbortController()

onMounted(async () => {
navigator.modelContext.registerTool({
document.modelContext.registerTool({
name: 'add-user',
title: '添加用户',
description: '添加用户,可选参数不需要用户提供,也不用创建表单卡片,直接根据用户提供的信息添加用户即可',
Expand Down
Loading