From f586e83125a2fc624c24f59c9d42958bd0ad06f2 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Thu, 1 Oct 2026 13:03:08 +0000 Subject: [PATCH] =?UTF-8?q?feat(micro-app):=20=E6=8F=92=E4=BB=B6=20menu=5F?= =?UTF-8?q?items=20=E6=94=AF=E6=8C=81=20width=20=E6=8C=87=E5=AE=9A?= =?UTF-8?q?=E6=8A=BD=E5=B1=89=E9=BB=98=E8=AE=A4=E5=AE=BD=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 仅 inline/iframe 生效:≤100 按百分比,>100 按像素(最小 300),缺省 1200。同步 ai-kb 微应用概览。 --- resources/ai-kb/zh/concept/micro-app/overview.md | 3 ++- resources/assets/js/components/MicroApps/index.vue | 2 +- resources/assets/js/store/actions.js | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/resources/ai-kb/zh/concept/micro-app/overview.md b/resources/ai-kb/zh/concept/micro-app/overview.md index d50ac92a9..02a779957 100644 --- a/resources/ai-kb/zh/concept/micro-app/overview.md +++ b/resources/ai-kb/zh/concept/micro-app/overview.md @@ -18,7 +18,7 @@ negative: - 微应用不是 DooTask 主程序代码,是独立插件提供 - 微应用与「应用商店(应用市场 / AppStore)」不是同一个东西,应用商店是用来安装它们的入口 - 不是所有微应用都被自动安装,未装时菜单不会出现 -last_verified: v1.7.90 +last_verified: v1.9.36 --- # 微应用是什么 @@ -37,6 +37,7 @@ last_verified: v1.7.90 ## 关键属性 - **登录态继承**:打开微应用时自动带上当前用户 token,无需再次登录 - **菜单注入**:插件通过 `microapp_menu` 接口或自带 `menu_items` 配置注册到 `location: application`、`application/admin` 或 `main/menu` +- **抽屉默认宽度**:插件在 `menu_items` 中可用 `width` 指定打开时抽屉的默认宽度,≤100 按百分比、>100 按像素(最小 300),不填默认 1200px,仅 `inline` / `iframe` 类型生效(`*_blank` 独立窗口不适用);用户仍可拖拽调整,小屏幕下始终全屏 - **显示条件**:受 `visible_to`(all / admin)与系统管理员身份共同控制 - **生命周期**:独立容器;主程序与微应用之间通过 nginx 反代和 token 鉴权交互 diff --git a/resources/assets/js/components/MicroApps/index.vue b/resources/assets/js/components/MicroApps/index.vue index f1f35938e..ae4da7c78 100644 --- a/resources/assets/js/components/MicroApps/index.vue +++ b/resources/assets/js/components/MicroApps/index.vue @@ -5,7 +5,7 @@ :key="key" :open="app.isOpen" :ref="`ref-${app.name}`" - :size="1200" + :size="app.width || 1200" :options="app" :windowType="windowType" :forceCapsuleVisible="loadErrors[app.name] != null" diff --git a/resources/assets/js/store/actions.js b/resources/assets/js/store/actions.js index e00a46bb4..d875a1f37 100644 --- a/resources/assets/js/store/actions.js +++ b/resources/assets/js/store/actions.js @@ -5399,6 +5399,7 @@ export default { * - auto_dark_theme 是否自动适配深色主题 (true/false),默认 true * - keep_alive 是否开启微应用保活 (true/false),默认 true * - immersive 是否开启沉浸式模式 (true/false),默认 false + * - width 抽屉默认宽度(可选,number,仅 inline/iframe 生效,*_blank 独立窗口不适用);≤100 按百分比,>100 按 px(最小 300),缺省 1200 * - props 传递参数 * 更多说明详见 https://appstore.dootask.com/development/manual */ @@ -5461,6 +5462,7 @@ export default { auto_dark_theme: typeof data.auto_dark_theme == 'boolean' ? data.auto_dark_theme : true, keep_alive: typeof data.keep_alive == 'boolean' ? data.keep_alive : true, immersive: typeof data.immersive == 'boolean' ? data.immersive : false, + width: typeof data.width == 'number' && data.width > 0 ? (data.width > 100 ? Math.max(300, data.width) : data.width) : 0, badge_clear_on_open: typeof data.badge_clear_on_open == 'boolean' ? data.badge_clear_on_open : false, props: $A.isJson(data.props) ? data.props : {}, }