feat(setting): 移除「AI 助手设置」,悬浮按钮开关迁至 AI 助手插件

悬浮按钮显示偏好改在「应用 → AI 助手」的「个人偏好」中设置,主程序删除
setting/assistant.vue、对应路由与菜单项,并清理不再使用的翻译与保存方法;
同步更新 ai-kb 与事件对照表。
This commit is contained in:
kuaifan 2026-10-01 07:59:04 +00:00
parent dd84a0d18e
commit 621017c0c6
21 changed files with 32 additions and 160 deletions

View File

@ -3,11 +3,11 @@
> **本文件由脚本自动生成,请勿手改。**
>
> - 生成命令: `node scripts/gen-events-map.mjs`
> - 扫描范围: `resources/assets/js` 下所有 `.js` / `.vue` 文件(共 285 个)
> - 扫描范围: `resources/assets/js` 下所有 `.js` / `.vue` 文件(共 284 个)
> - 事件总线: `resources/assets/js/store/events.js`(mitt 实例)
> - 仅匹配裸 `emitter.emit/on/off(` 调用;`xxx.emitter.emit(`(如 Quill 内部 emitter)不属于本总线,已排除
共 **30** 个静态可解析事件,**126** 处 `emitter.emit/on/off` 调用。
共 **30** 个静态可解析事件,**125** 处 `emitter.emit/on/off` 调用。
## 事件清单
@ -51,8 +51,7 @@
### `aiAssistantFloatButtonVisibilityChanged`
- **emit(1)**
- `resources/assets/js/pages/manage/setting/assistant.vue:59`
- **emit(0)**:无(疑似死事件)
- **on(1)**
- `resources/assets/js/components/AIAssistant/float-button.vue:157`
- **off(1)**
@ -277,7 +276,7 @@
- **emit(2)**
- `resources/assets/js/pages/manage.vue:1153`
- `resources/assets/js/pages/manage/setting/index.vue:211`
- `resources/assets/js/pages/manage/setting/index.vue:198`
- **on(1)**
- `resources/assets/js/components/RightBottom.vue:65`
- **off(1)**
@ -326,5 +325,5 @@
- 事件总数(静态可解析): **30**
- 只 emit 无 on(疑似死事件): **0**
- 只 on 无 emit(无人发射): **0**
- 只 on 无 emit(无人发射): **1** — `aiAssistantFloatButtonVisibilityChanged`
- 动态事件名调用: **1**

View File

@ -2656,8 +2656,6 @@ LDAP 用户禁止修改邮箱
[weekday].四
[weekday].五
[weekday].六
AI 助手设置
显示悬浮按钮
(*) · 任务文件
(*) · 项目群聊文件
(*) · 全部文件

View File

@ -38783,30 +38783,6 @@
"id": "Tidak ada data departemen yang dapat dilihat",
"ru": "Нет данных отдела для просмотра"
},
{
"key": "AI 助手设置",
"zh": "",
"zh-CHT": "AI 助手設定",
"en": "AI Assistant Settings",
"ko": "AI 어시스턴트 설정",
"ja": "AIアシスタント設定",
"de": "KI-Assistent-Einstellungen",
"fr": "Paramètres de l’assistant IA",
"id": "Pengaturan Asisten AI",
"ru": "Настройки ИИ-помощника"
},
{
"key": "显示悬浮按钮",
"zh": "",
"zh-CHT": "顯示懸浮按鈕",
"en": "Show floating button",
"ko": "플로팅 버튼 표시",
"ja": "フローティングボタンを表示",
"de": "Schwebende Schaltfläche anzeigen",
"fr": "Afficher le bouton flottant",
"id": "Tampilkan tombol mengambang",
"ru": "Показывать плавающую кнопку"
},
{
"key": "(%T1) · 任务文件",
"zh": "",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -45,5 +45,5 @@ last_verified: v1.7.90
## 没有 AI 入口怎么办
- 确认应用商店已安装 ai 插件
- 确认管理员已在 AI 助手设置中配置可用模型([[system-setting.ai-model.howto]])
- 确认管理员已在「AI 助手」应用的设置面板中配置可用模型([[system-setting.ai-model.howto]])
- 详细排查见 [[report.permission.faq]]

View File

@ -11,29 +11,30 @@ aliases:
- 恢复 AI 助手浮球
- AI 悬浮按钮设置
related_tools: []
related_pages: [setting]
related_pages: []
prerequisites:
- 应用市场已安装 ai 插件
- 应用市场已安装 ai 插件(需升级到包含「个人偏好」开关的版本)
negative:
- 隐藏悬浮按钮不会禁用 AI 助手或卸载 ai 插件
- 未安装 ai 插件时不显示「AI 助手设置」菜单
last_verified: v1.8.89
- 该开关不在「设置」菜单里,「设置 → AI 助手设置」入口已移除,未安装 ai 插件时也没有该开关
- 旧版 ai 插件没有此开关,需在应用商店升级插件
last_verified: v1.9.36
---
# 显示或隐藏 AI 助手悬浮按钮
## 入口
- 桌面端 Web / Electron:右上角头像 →「设置」→「AI 助手设置」
- 移动端:底部 Tabbar「我的」→「设置」→「AI 助手设置」
- 只有系统已安装 ai 插件时,设置菜单才会出现。
- 桌面端 Web / Electron:左侧栏「应用」→「AI 助手」,页面中的「个人偏好」卡片
- 移动端:「应用」→「AI 助手」,页面中的「个人偏好」卡片
- 只有系统已安装 ai 插件时才有该入口。
## 操作步骤
1. 进入「AI 助手设置」。
2. 打开或关闭「显示悬浮按钮」开关。
3. 点击「提交」保存并应用;点击「重置」可恢复进入页面时的值。
4. 关闭后如需恢复,返回同一页面重新打开开关并提交。
1. 进入「应用」→「AI 助手」。
2. 在「个人偏好」卡片中打开或关闭「显示悬浮按钮」开关。
3. 切换后立即保存并生效,无需点击提交。
4. 关闭后如需恢复,回到同一位置重新打开开关。
## 影响范围

View File

@ -18,10 +18,10 @@ prerequisites:
- 管理员已在「系统设置 → AI 设置」配置至少一个模型
negative:
- 未安装 ai 插件时右上「+」菜单不出现「AI 助手」一项,悬浮按钮也不渲染
- 用户可在「设置 → AI 助手设置」关闭悬浮按钮,关闭后其他入口仍可使用
- 用户可在「应用 → AI 助手」页的「个人偏好」中关闭悬浮按钮,关闭后其他入口仍可使用
- 没有左侧栏一级菜单,AI 助手是浮窗形态
- 移动端首次加载会自动收起浮按钮
last_verified: v1.8.89
last_verified: v1.9.36
---
# AI 助手入口在哪
@ -33,7 +33,7 @@ last_verified: v1.8.89
- 移动端:屏幕侧边浮动按钮(默认贴边收起,触摸唤起)
- 桌面快捷键:Cmd/Ctrl + I
悬浮按钮可在「设置 → AI 助手设置」中显示或隐藏,详见 [[user-settings.ai-assistant-float.howto]]。
悬浮按钮可在「应用 → AI 助手」页的「个人偏好」中显示或隐藏,详见 [[user-settings.ai-assistant-float.howto]]。
## 权限要求
- 任何登录用户可用

View File

@ -40,7 +40,6 @@ last_verified: v1.9.36
- 语言设置 → [[user-settings.language.howto]]
- 主题设置 → [[user-settings.theme.howto]]
- 键盘设置(仅 Electron / 移动端)→ [[user-settings.shortcut.concept]]
- AI 助手设置(仅安装 ai 插件后显示)→ [[user-settings.ai-assistant-float.howto]]
- 系统设置 / License Key(仅系统管理员可见)
- 系统更新(仅系统管理员可见,有系统新版本时显示新版本号)→ [[system-update.online-update.howto]]
- 更新日志(桌面端有新版本时显示为「更新客户端」,点击打开客户端更新弹窗) / 版本 / 登录设备 / 清除缓存 / 退出登录

View File

@ -8,10 +8,3 @@ export function loadFloatButtonVisible(userId) {
}
return $A.IDBBoolean(cacheKey(userId), true).catch(() => true);
}
export function saveFloatButtonVisible(userId, visible) {
if (userId <= 0) {
return Promise.resolve();
}
return $A.IDBSet(cacheKey(userId), visible);
}

View File

@ -1,76 +0,0 @@
<template>
<div class="setting-item submit">
<Form ref="formData" :model="formData" v-bind="formOptions" @submit.native.prevent>
<FormItem :label="$L('显示悬浮按钮')">
<iSwitch
v-model="formData.floatButtonVisible"
:disabled="loading"/>
</FormItem>
</Form>
<div class="setting-footer">
<Button :loading="loadIng > 0" :disabled="loading" type="primary" @click="submitForm">{{$L('提交')}}</Button>
<Button :loading="loadIng > 0" :disabled="loading" @click="resetForm">{{$L('重置')}}</Button>
</div>
</div>
</template>
<script>
import {mapState} from "vuex";
import emitter from "../../../store/events";
import {
loadFloatButtonVisible,
saveFloatButtonVisible,
} from "../../../components/AIAssistant/float-button-preference";
export default {
data() {
return {
loadIng: 0,
loading: true,
formData: {
floatButtonVisible: true,
},
};
},
computed: {
...mapState(['userId', 'formOptions']),
},
mounted() {
this.loadPreference();
},
methods: {
async loadPreference() {
try {
this.$set(this.formData, 'floatButtonVisible', await loadFloatButtonVisible(this.userId));
this.formData_bak = $A.cloneJSON(this.formData);
} finally {
this.loading = false;
}
},
async submitForm() {
const visible = this.formData.floatButtonVisible;
this.loadIng++;
try {
await saveFloatButtonVisible(this.userId, visible);
emitter.emit('aiAssistantFloatButtonVisibilityChanged', {
userId: this.userId,
visible,
});
$A.messageSuccess('保存成功');
} catch (error) {
$A.modalError(error.message);
} finally {
this.loadIng--;
}
},
resetForm() {
this.formData = $A.cloneJSON(this.formData_bak);
},
},
};
</script>

View File

@ -50,7 +50,7 @@
</template>
<script>
import {mapGetters, mapState} from "vuex";
import {mapState} from "vuex";
import axios from "axios";
import MobileNavTitle from "../../../components/Mobile/NavTitle.vue";
import emitter from "../../../store/events";
@ -76,8 +76,6 @@ export default {
},
computed: {
...mapGetters(['aiVisible']),
...mapState(['userInfo', 'userIsAdmin', 'clientNewVersion', 'systemNewVersion', 'systemConfig']),
showContent() {
@ -97,10 +95,6 @@ export default {
menu.push({path: 'keyboard', name: '键盘设置'})
}
if (this.aiVisible) {
menu.push({path: 'assistant', name: 'AI 助手设置'})
}
if ($A.isDooServer() && this.$isEEUIApp) {
menu.push(...[
{path: 'privacy', name: '隐私政策', divided: true},
@ -152,17 +146,10 @@ export default {
handler(name) {
if (name === 'manage-setting' && this.windowLandscape) {
this.goForward({name: 'manage-setting-personal'}, true);
} else if (name === 'manage-setting-assistant' && !this.aiVisible) {
this.goForward({name: 'manage-setting-personal'}, true);
}
},
immediate: true
},
aiVisible(visible) {
if (this.routeName === 'manage-setting-assistant' && !visible) {
this.goForward({name: 'manage-setting-personal'}, true);
}
},
},
methods: {

View File

@ -64,11 +64,6 @@ export default [
path: 'keyboard',
component: () => import('./pages/manage/setting/keyboard.vue'),
},
{
name: 'manage-setting-assistant',
path: 'assistant',
component: () => import('./pages/manage/setting/assistant.vue'),
},
{
name: 'manage-setting-license',
path: 'license',