Skip to content

Commit 3210c28

Browse files
authored
fix(ai): code style error (#317)
* fix(ai): code style error * feat(.vscode): settings.json 增加 按 Tab 键 → 插入指定数量的空格 * feat: createActionMenu 逻辑错误修复
1 parent 1327426 commit 3210c28

File tree

7 files changed

+353
-322
lines changed

7 files changed

+353
-322
lines changed

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"editor.formatOnSave": false,
55
"editor.formatOnType": false,
66
"editor.tabSize": 2,
7+
"editor.insertSpaces": true,
78
"editor.codeActionsOnSave": {
89
"source.fixAll.eslint": "explicit",
910
"source.organizeImports": "never"

packages/docs/fluent-editor/demos/ai.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const TOOLBAR_CONFIG = [
77
['ai', { header: [] }],
88
['bold', 'italic', 'underline', 'link'],
99
[{ list: 'ordered' }, { list: 'bullet' }],
10-
['clean']
10+
['clean'],
1111
]
1212
1313
onMounted(() => {
@@ -19,15 +19,15 @@ onMounted(() => {
1919
theme: 'snow',
2020
modules: {
2121
toolbar: {
22-
container: TOOLBAR_CONFIG
22+
container: TOOLBAR_CONFIG,
2323
},
2424
ai: {
2525
host: 'http://localhost:11434',
2626
model: 'deepseek-r1:8b',
2727
apiKey: '',
28-
contentMaxLength: 1000
29-
}
30-
}
28+
contentMaxLength: 1000,
29+
},
30+
},
3131
})
3232
})
3333
})
Lines changed: 37 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,43 @@
1-
21
import {
3-
RICH_CONTENT_ICON,
4-
STREAMLINE_CONTENT_ICON,
5-
SYMBOL_ICON,
6-
TRANSLATE_ICON,
7-
} from './icons'
2+
RICH_CONTENT_ICON,
3+
STREAMLINE_CONTENT_ICON,
4+
SYMBOL_ICON,
5+
TRANSLATE_ICON,
6+
} from './icons'
87

9-
export const INPUT_PLACEHOLDER = '请输入问题或"/"获取提示词';
10-
export const SELECT_PLACEHOLDER = '向我提问/选择操作';
11-
export const STOP_ANSWER = '停止回答';
12-
export const REPLACE_SELECT = '替换选中内容';
13-
export const INSERT_TEXT = '插入内容';
14-
export const INSERT_SUB_CONTENT_TEXT = '插入内容下方';
15-
export const REGENERATE = '重新生成';
16-
export const CLOSE = '关闭';
17-
export const THINK_TEXT = '正在为您分析并总结答案';
18-
export const RESULT_HEADER_TEXT = '根据您的诉求,已为您解答,具体如下:';
8+
export const INPUT_PLACEHOLDER = '请输入问题或"/"获取提示词'
9+
export const SELECT_PLACEHOLDER = '向我提问/选择操作'
10+
export const STOP_ANSWER = '停止回答'
11+
export const REPLACE_SELECT = '替换选中内容'
12+
export const INSERT_TEXT = '插入内容'
13+
export const INSERT_SUB_CONTENT_TEXT = '插入内容下方'
14+
export const REGENERATE = '重新生成'
15+
export const CLOSE = '关闭'
16+
export const THINK_TEXT = '正在为您分析并总结答案'
17+
export const RESULT_HEADER_TEXT = '根据您的诉求,已为您解答,具体如下:'
1918

2019
export const MENU_TITLE_DATA = {
21-
editor: [
22-
{ id: '1-1', text: '丰富内容', icon: RICH_CONTENT_ICON },
23-
{ id: '1-2', text: '精简内容', icon: STREAMLINE_CONTENT_ICON },
24-
{ id: '1-3', text: '修改标点符号', icon: SYMBOL_ICON },
25-
{ id: '1-4', text: '翻译', icon: TRANSLATE_ICON },
26-
],
27-
tone: [
28-
{ id: '2-1', text: '更专业的' },
29-
{ id: '2-2', text: '更直接的' },
30-
{ id: '2-3', text: '更友善的' },
31-
{ id: '2-4', text: '更口语化的' },
32-
],
33-
adjust: [
34-
{ id: '3-1', text: '提炼要点' },
35-
{ id: '3-2', text: '归纳总结' },
36-
{ id: '3-3', text: '转写成[代码块]' },
37-
]
38-
};
20+
editor: [
21+
{ id: '1-1', text: '丰富内容', icon: RICH_CONTENT_ICON },
22+
{ id: '1-2', text: '精简内容', icon: STREAMLINE_CONTENT_ICON },
23+
{ id: '1-3', text: '修改标点符号', icon: SYMBOL_ICON },
24+
{ id: '1-4', text: '翻译', icon: TRANSLATE_ICON },
25+
],
26+
tone: [
27+
{ id: '2-1', text: '更专业的' },
28+
{ id: '2-2', text: '更直接的' },
29+
{ id: '2-3', text: '更友善的' },
30+
{ id: '2-4', text: '更口语化的' },
31+
],
32+
adjust: [
33+
{ id: '3-1', text: '提炼要点' },
34+
{ id: '3-2', text: '归纳总结' },
35+
{ id: '3-3', text: '转写成[代码块]' },
36+
],
37+
}
3938

4039
export const MENU_ID_MAP = {
41-
editor: 'subMenuEditorEl',
42-
tone: 'subMenuToneEl',
43-
adjust: 'subMenuAdjustEl',
44-
};
40+
editor: 'subMenuEditorEl',
41+
tone: 'subMenuToneEl',
42+
adjust: 'subMenuAdjustEl',
43+
}

0 commit comments

Comments
 (0)