feat(应用管理):增加应用管理介绍描述及自定义常见问题
refactor(chat):chat页面接口获取应用管理中的应用介绍及常见问题
This commit is contained in:
1 parent
01173e0a0e
commit
a3123cd602
4 files changed
+241
-47
No files matched your search
@@ -37,6 +37,8 @@ const {
|
||||
resetForm,
|
||||
selectAgent,
|
||||
submitAgent,
|
||||
addSuggestedQuestion,
|
||||
removeSuggestedQuestion,
|
||||
deleteAgent,
|
||||
openTestModal,
|
||||
runAgentTest,
|
||||
@@ -133,6 +135,66 @@ onMounted(() => {
|
||||
:placeholder="t('admin.agent.fields.descPlaceholder')"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-span-1 md:col-span-2 space-y-3">
|
||||
<div class="flex items-center justify-between gap-3">
|
||||
<label class="text-xs font-bold text-muted uppercase tracking-wider">常见问题</label>
|
||||
<button
|
||||
type="button"
|
||||
class="inline-flex items-center gap-1 rounded-lg border border-default px-3 py-1.5 text-xs font-medium text-secondary transition-colors hover:bg-surface-soft"
|
||||
@click="addSuggestedQuestion"
|
||||
>
|
||||
<Plus class="h-4 w-4" />
|
||||
添加问题
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center gap-3 text-sm">
|
||||
<label class="inline-flex items-center gap-2 text-secondary">
|
||||
<input v-model="form.suggested_questions_style" type="radio" value="plain" class="accent-brand-600" />
|
||||
<span>无样式</span>
|
||||
</label>
|
||||
<label class="inline-flex items-center gap-2 text-secondary">
|
||||
<input v-model="form.suggested_questions_style" type="radio" value="styled" class="accent-brand-600" />
|
||||
<span>有样式</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div v-if="form.suggested_questions.length === 0" class="rounded-xl border border-dashed border-default px-4 py-5 text-sm text-muted">
|
||||
暂未配置常见问题,点击“添加问题”后会同步到对应 Agent 的 Chat 欢迎页。
|
||||
</div>
|
||||
|
||||
<div v-else class="space-y-3">
|
||||
<div
|
||||
v-for="(item, index) in form.suggested_questions"
|
||||
:key="index"
|
||||
class="rounded-2xl border border-default bg-surface-soft/50 p-4"
|
||||
>
|
||||
<div class="grid grid-cols-1 gap-3 md:grid-cols-[1fr_220px_auto]">
|
||||
<input
|
||||
v-model="item.question"
|
||||
type="text"
|
||||
class="w-full input-field"
|
||||
placeholder="请输入常见问题,例如:查询我有多少假期?"
|
||||
/>
|
||||
<input
|
||||
v-model="item.group"
|
||||
type="text"
|
||||
class="w-full input-field"
|
||||
:disabled="form.suggested_questions_style !== 'styled'"
|
||||
:placeholder="form.suggested_questions_style === 'styled' ? '可选:分组标题,例如:考勤与休假' : '无样式下无需分组'"
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
class="inline-flex items-center justify-center rounded-xl border border-red-200 bg-red-50 px-3 py-2 text-red-600 transition-colors hover:bg-red-100"
|
||||
@click="removeSuggestedQuestion(index)"
|
||||
>
|
||||
<Trash2 class="h-4 w-4" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end">
|
||||
<button type="button" class="btn-primary btn-lg" @click="submitAgent">
|
||||
|
||||
Reference in new issue
Block a user