7171 <div style =" font-size :11px ;color :#909399 ;margin-top :4px " >配置输出参数后,运行时会要求模型按 JSON 返回并在结果区按参数展示。</div >
7272 </div >
7373 </el-form-item >
74+ <el-form-item label =" 辅助提问词" >
75+ <div style =" width :100% " >
76+ <div v-for =" (_q, i) in quickPrompts" :key =" i" style =" display :flex ;gap :4px ;margin-bottom :4px " >
77+ <el-input v-model =" quickPrompts[i]" :placeholder =" i === 0 ? '如 帮我写一篇本周工作总结' : '提问词'" size =" small" style =" flex :1 " />
78+ <el-button size =" small" type =" danger" link @click =" quickPrompts.splice(i,1)" >删</el-button >
79+ </div >
80+ <el-button size =" small" @click =" quickPrompts.push('')" >+添加提问词</el-button >
81+ <div style =" font-size :11px ;color :#909399 ;margin-top :4px " >运行页中显示为快捷按钮,点击即填入补充说明,方便常用提问一键发起。</div >
82+ </div >
83+ </el-form-item >
7484 <el-form-item label =" 启用" ><el-switch v-model =" form.enabled" /></el-form-item >
7585 </el-form >
7686 <template #footer >
@@ -92,6 +102,7 @@ const dialogVisible = ref(false)
92102const form = ref <any >({ id: 0 , assistantName: ' ' , description: ' ' , systemPrompt: ' ' , enabled: true })
93103const inputParams = ref <any []>([])
94104const outputParams = ref <any []>([])
105+ const quickPrompts = ref <string []>([])
95106
96107onMounted (loadData )
97108
@@ -111,19 +122,22 @@ function openAdd() {
111122 form .value = { id: 0 , assistantName: ' ' , description: ' ' , systemPrompt: ' ' , enabled: true }
112123 inputParams .value = []
113124 outputParams .value = []
125+ quickPrompts .value = []
114126 dialogVisible .value = true
115127}
116128function openEdit(row : any ) {
117129 form .value = { ... row , enabled: row .enabled === 1 }
118130 try { inputParams .value = JSON .parse (row .inputParams || ' []' ) } catch { inputParams .value = [] }
119131 try { outputParams .value = JSON .parse (row .outputParams || ' []' ) } catch { outputParams .value = [] }
132+ try { quickPrompts .value = JSON .parse (row .quickPrompts || ' []' ) } catch { quickPrompts .value = [] }
120133 dialogVisible .value = true
121134}
122135async function doSave() {
123136 await request .post (' /ai/assistant/save' , {
124137 ... form .value ,
125138 inputParams: JSON .stringify (inputParams .value ),
126- outputParams: JSON .stringify (outputParams .value )
139+ outputParams: JSON .stringify (outputParams .value ),
140+ quickPrompts: JSON .stringify (quickPrompts .value .filter ((q : string ) => q .trim ()))
127141 })
128142 ElMessage .success (' 保存成功' )
129143 dialogVisible .value = false
0 commit comments