Skip to content

Commit 3c35a3a

Browse files
dataeaseShuulleo
authored andcommitted
feat(prompt): add prompt
1 parent 213d318 commit 3c35a3a

File tree

6 files changed

+915
-0
lines changed

6 files changed

+915
-0
lines changed

frontend/src/api/prompt.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { request } from '@/utils/request'
2+
3+
export const promptApi = {
4+
getList: (pageNum: any, pageSize: any, type: any, params: any) =>
5+
request.get(`/system/custom_prompt/${type}/page/${pageNum}/${pageSize}`, {
6+
params,
7+
}),
8+
updateEmbedded: (data: any) => request.put(`/system/custom_prompt`, data),
9+
deleteEmbedded: (params: any) => request.delete('/system/custom_prompt', { data: params }),
10+
getOne: (id: any) => request.get(`/system/custom_prompt/${id}`),
11+
}

frontend/src/components/layout/Menu.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ const routerList = computed(() => {
5151
!route.path.includes('member') &&
5252
!route.path.includes('professional') &&
5353
!route.path.includes('training') &&
54+
!route.path.includes('prompt') &&
5455
!route.path.includes('permission') &&
5556
!route.path.includes('preview') &&
5657
route.path !== '/login' &&

frontend/src/i18n/en.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,22 @@
66
"Dashboard": "Dashboard",
77
"AI Model Configuration": "AI Model Configuration"
88
},
9+
"prompt": {
10+
"no_prompt_words": "No prompt words",
11+
"customize_prompt_words": "Customize prompt words",
12+
"ask_sql": "Ask SQL",
13+
"data_analysis": "Data Analysis",
14+
"data_prediction": "Data Prediction",
15+
"add_prompt_word": "Add prompt word",
16+
"prompt_word_name": "Prompt word name",
17+
"prompt_word_content": "Prompt word content",
18+
"training_data_details": "Training data details",
19+
"selected_prompt_words": "Do you want to delete the {msg} selected prompt words?",
20+
"replaced_with": "Please enter a prompt word. Example: When returning names, only the last name will be displayed, and the first name will be replaced with *.",
21+
"loss_exercise_caution": "Entering high-risk operations such as deleting a database or table or modifying the table structure may result in permanent data loss. Exercise caution!",
22+
"edit_prompt_word": "Edit prompt word",
23+
"prompt_word_name_de": "Do you want to delete the prompt word: {msg}?"
24+
},
925
"training": {
1026
"effective_data_sources": "Effective data sources",
1127
"all_data_sources": "All data sources",

frontend/src/i18n/zh-CN.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,22 @@
66
"Dashboard": "仪表盘",
77
"AI Model Configuration": "模型配置"
88
},
9+
"prompt": {
10+
"no_prompt_words": "暂无提示词",
11+
"customize_prompt_words": "自定义提示词",
12+
"ask_sql": "问数 SQL",
13+
"data_analysis": "数据分析",
14+
"data_prediction": "数据预测",
15+
"add_prompt_word": "添加提示词",
16+
"prompt_word_name": "提示词名称",
17+
"prompt_word_content": "提示词内容",
18+
"training_data_details": "训练数据详情",
19+
"selected_prompt_words": "是否删除选中的 {msg} 条提示词?",
20+
"replaced_with": "请输入提示词,示例:返回姓名时,只显示姓氏,名字用*代替",
21+
"loss_exercise_caution": "若输入删除数据库、数据表或修改表结构等高风险的操作指令,可能导致数据永久丢失,请务必谨慎!",
22+
"edit_prompt_word": "编辑提示词",
23+
"prompt_word_name_de": "是否删除提示词:{msg}?"
24+
},
925
"training": {
1026
"effective_data_sources": "生效数据源",
1127
"all_data_sources": "所有数据源",

frontend/src/router/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import EmbeddedPage from '@/views/embedded/page.vue'
1717
import Member from '@/views/system/member/index.vue'
1818
import Professional from '@/views/system/professional/index.vue'
1919
import Training from '@/views/system/training/index.vue'
20+
import Prompt from '@/views/system/prompt/index.vue'
2021
import Appearance from '@/views/system/appearance/index.vue'
2122
import Permission from '@/views/system/permission/index.vue'
2223
import User from '@/views/system/user/User.vue'
@@ -120,6 +121,12 @@ export const routes = [
120121
component: Training,
121122
meta: { title: t('training.data_training') },
122123
},
124+
{
125+
path: '/set/prompt',
126+
name: 'prompt',
127+
component: Prompt,
128+
meta: { title: t('prompt.customize_prompt_words') },
129+
},
123130
],
124131
},
125132
{

0 commit comments

Comments
 (0)