From 24697c726cc3d76f5d644178d39843fa2b643dd7 Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Mon, 21 Sep 2026 16:53:36 +0800 Subject: [PATCH] feat: portal --- ui/src/components.d.ts | 2 + ui/src/components/COMPONENT_README.md | 31 ++++--- .../components/global/mk-icon/PortalIcon.vue | 13 +++ ui/src/components/mk-edit-avatar/index.vue | 77 +++++++--------- ui/src/layout/ResourceDetailLayout.vue | 21 +---- ui/src/layout/sidebar/ResourceDetailMenu.vue | 92 +++++++++++++++++++ ui/src/router/ROUTE_README.md | 40 ++++---- ui/src/router/admin/system/index.ts | 6 +- ui/src/router/admin/types.ts | 2 + ui/src/router/admin/utils.ts | 12 +-- .../admin/workspace/modules/application.ts | 2 +- .../admin/workspace/modules/knowledge.ts | 81 ++++++++++++++-- ui/src/styles/STYLE_README.md | 9 ++ ui/src/styles/element-plus.scss | 6 ++ ui/src/styles/tailwind.css | 1 + ui/src/views/VIEW_README.md | 9 +- ui/src/views/application/ApplicationView.vue | 2 +- .../chat-user/ChatUserListView.vue | 7 ++ .../dictionary/DictionaryView.vue | 7 ++ .../ExternalRetrievalView.vue | 7 ++ .../knowledge-detail/image/ImageListView.vue | 7 ++ .../question/QuestionListView.vue | 7 ++ .../recall-test/RecallTestView.vue | 7 ++ .../tag/TagManagementView.vue | 7 ++ .../portal-setting/PortalSettingView.vue | 20 ++-- .../components/ButtonEditPortal.vue | 28 +++--- 26 files changed, 367 insertions(+), 136 deletions(-) create mode 100644 ui/src/components/global/mk-icon/PortalIcon.vue create mode 100644 ui/src/layout/sidebar/ResourceDetailMenu.vue create mode 100644 ui/src/views/knowledge-detail/chat-user/ChatUserListView.vue create mode 100644 ui/src/views/knowledge-detail/dictionary/DictionaryView.vue create mode 100644 ui/src/views/knowledge-detail/external-retrieval/ExternalRetrievalView.vue create mode 100644 ui/src/views/knowledge-detail/image/ImageListView.vue create mode 100644 ui/src/views/knowledge-detail/question/QuestionListView.vue create mode 100644 ui/src/views/knowledge-detail/recall-test/RecallTestView.vue create mode 100644 ui/src/views/knowledge-detail/tag/TagManagementView.vue diff --git a/ui/src/components.d.ts b/ui/src/components.d.ts index 6779c68675e..b900b6df53c 100644 --- a/ui/src/components.d.ts +++ b/ui/src/components.d.ts @@ -44,6 +44,7 @@ declare module 'vue' { MkTagGroup: typeof import('./components/global/mk-tag-group/index.vue')['default'] MkTooltip: typeof import('./components/global/mk-tooltip/index.vue')['default'] MkViewLayout: typeof import('./components/global/mk-view-layout/index.vue')['default'] + PortalIcon: typeof import('./components/global/mk-icon/PortalIcon.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] ToolIcon: typeof import('./components/global/mk-icon/ToolIcon.vue')['default'] @@ -85,6 +86,7 @@ declare global { const MkTagGroup: typeof import('./components/global/mk-tag-group/index.vue')['default'] const MkTooltip: typeof import('./components/global/mk-tooltip/index.vue')['default'] const MkViewLayout: typeof import('./components/global/mk-view-layout/index.vue')['default'] + const PortalIcon: typeof import('./components/global/mk-icon/PortalIcon.vue')['default'] const RouterLink: typeof import('vue-router')['RouterLink'] const RouterView: typeof import('vue-router')['RouterView'] const ToolIcon: typeof import('./components/global/mk-icon/ToolIcon.vue')['default'] diff --git a/ui/src/components/COMPONENT_README.md b/ui/src/components/COMPONENT_README.md index 5b324766df5..fbd7c3a3f77 100644 --- a/ui/src/components/COMPONENT_README.md +++ b/ui/src/components/COMPONENT_README.md @@ -355,16 +355,20 @@ Dialog、Drawer、Popover、嵌套区域等其他大、小表格均禁止开启 ### MkEditAvatar(修改头像) -手动导入 `@/components/mk-edit-avatar/index.vue`,不参与全局注册。`defaultIcon` 必填,接收默认 -图标图片 URL;字符串 `v-model` 为当前自定义头像 URL,空字符串表示使用默认图标。 -`size` 默认为 `32`(px),`editable` 默认为 `true`,设为 `false` 时仅展示头像。 - -默认插槽替换触发区的头像内容,透出 `{ icon, size }`;`icon` 为当前 `v-model` 值,空值可由 -`ToolIcon` 等资源组件自行回退。未提供插槽时展示当前头像或 `defaultIcon` 图片。 -触发按钮及悬停、聚焦、点击行为由 `MkEditAvatar` 统一维护,插槽内只放展示内容,不嵌套按钮。 -`ToolFormDrawer` 通过此插槽渲染 `ToolIcon`,并将头像绑定到 `toolForm.icon`。 - -悬停、聚焦或点击头像打开 Logo 设置,打开后保持显示以便选择本地文件;取消、点击外部或 Escape +手动导入 `@/components/mk-edit-avatar/index.vue`,不参与全局注册。字符串 `v-model` 为当前 +自定义头像 URL,空字符串表示使用默认图标;不再接收 `defaultIcon`。 +`size` 默认为 `32`(px),控制触发区传给插槽的尺寸;弹层预览和上传区域固定为 80px。 +`editable` 默认为 `true`,设为 `false` 时仅展示头像。 + +必填默认插槽同时渲染触发区和默认 Logo 预览,透出 `{ icon, size }`。触发区传入当前头像 +(空值转为 `undefined`)和 `props.size`;默认预览始终传入 `icon: undefined`、固定的 `size: 80`,不读取组件的 +`props.size`。插槽参数由调用方按需使用,不会自动覆盖插槽内组件的尺寸。 +调用方必须使用插槽的 `icon`,由 `PortalIcon`、`ToolIcon` 等资源组件自行展示默认图标, +不要在插槽内直接绑定外部头像值。 +触发区由 `MkEditAvatar` 的 `span` 容器承载,统一处理悬停,插槽内只放展示内容。 +门户编辑通过此插槽渲染 `PortalIcon`,并将头像绑定到 `portalForm.logo`。 + +悬停头像打开 Logo 设置,打开后保持显示以便选择本地文件;取消、点击外部或弹层内按 Escape 关闭并丢弃草稿,确定后才更新 `v-model` 并触发 `change(icon, file)`。 自定义图片支持 JPG、PNG、GIF,大小不超过 10MB;确认时 `icon` 为本地 Data URL,`file` 为所选 `File`,未重新选文件或使用默认 Logo 时为 `null`。组件不请求上传接口;调用方负责上传 @@ -374,13 +378,16 @@ Dialog、Drawer、Popover、嵌套区域等其他大、小表格均禁止开启 ``` diff --git a/ui/src/components/global/mk-icon/PortalIcon.vue b/ui/src/components/global/mk-icon/PortalIcon.vue new file mode 100644 index 00000000000..1028ead5082 --- /dev/null +++ b/ui/src/components/global/mk-icon/PortalIcon.vue @@ -0,0 +1,13 @@ + + + diff --git a/ui/src/components/mk-edit-avatar/index.vue b/ui/src/components/mk-edit-avatar/index.vue index a2e8b862f55..5c6c86805e7 100644 --- a/ui/src/components/mk-edit-avatar/index.vue +++ b/ui/src/components/mk-edit-avatar/index.vue @@ -1,17 +1,17 @@