2025-08-22 23:17:48 +08:00
|
|
|
|
<template>
|
2026-05-24 00:47:08 +08:00
|
|
|
|
<div class="agent-runtime-config-form">
|
|
|
|
|
|
<div class="runtime-config-content">
|
2025-08-25 01:46:31 +08:00
|
|
|
|
<div class="agent-info" v-if="selectedAgent">
|
2026-05-24 00:47:08 +08:00
|
|
|
|
<div class="config-segment" v-if="props.showSegmented && !isEmptyConfig">
|
2026-03-24 22:37:03 +08:00
|
|
|
|
<a-segmented v-model:value="currentSegment" :options="segmentOptions" block />
|
2026-03-24 02:32:35 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-03-20 03:21:52 +08:00
|
|
|
|
<div
|
|
|
|
|
|
v-if="selectedAgentId && configurableItems"
|
|
|
|
|
|
class="config-form-content"
|
|
|
|
|
|
:class="{ 'is-readonly': isReadOnlyConfig }"
|
|
|
|
|
|
>
|
2025-08-22 23:17:48 +08:00
|
|
|
|
<!-- 配置表单 -->
|
|
|
|
|
|
<a-form :model="agentConfig" layout="vertical" class="config-form">
|
|
|
|
|
|
<a-alert
|
|
|
|
|
|
v-if="isEmptyConfig"
|
|
|
|
|
|
type="warning"
|
|
|
|
|
|
message="该智能体没有配置项"
|
|
|
|
|
|
show-icon
|
|
|
|
|
|
class="config-alert"
|
|
|
|
|
|
/>
|
|
|
|
|
|
<!-- 统一显示所有配置项 -->
|
2026-05-31 13:40:15 +08:00
|
|
|
|
<a-empty v-if="isCurrentSegmentEmpty" description="暂无配置项" class="config-empty" />
|
2026-03-24 02:32:35 +08:00
|
|
|
|
<template v-for="(value, key) in filteredConfigurableItems" :key="key">
|
2026-04-26 18:51:38 +08:00
|
|
|
|
<a-form-item :label="getConfigLabel(key, value)" :name="key" class="config-item">
|
2025-08-22 23:17:48 +08:00
|
|
|
|
<p v-if="value.description" class="config-description">{{ value.description }}</p>
|
|
|
|
|
|
|
2025-08-31 00:34:26 +08:00
|
|
|
|
<!-- <div>{{ value }}</div> -->
|
2025-08-22 23:17:48 +08:00
|
|
|
|
<!-- 模型选择 -->
|
2026-03-20 03:21:52 +08:00
|
|
|
|
<div
|
2026-05-17 13:06:25 +08:00
|
|
|
|
v-if="value.kind === 'llm'"
|
2026-03-20 03:21:52 +08:00
|
|
|
|
class="model-selector"
|
|
|
|
|
|
:class="{ 'is-readonly': isReadOnlyConfig }"
|
|
|
|
|
|
>
|
2025-08-22 23:17:48 +08:00
|
|
|
|
<ModelSelectorComponent
|
2025-12-28 22:55:42 +08:00
|
|
|
|
@select-model="(spec) => handleModelChange(key, spec)"
|
2025-10-14 02:27:15 +08:00
|
|
|
|
:model_spec="agentConfig[key] || ''"
|
2025-08-22 23:17:48 +08:00
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 系统提示词 -->
|
2026-05-19 14:53:28 +08:00
|
|
|
|
<div v-else-if="value.kind === 'prompt'" class="system-prompt-container">
|
2026-03-18 20:01:09 +08:00
|
|
|
|
<div class="system-prompt-display" @click="openSystemPromptModal(key)">
|
2025-09-06 14:04:33 +08:00
|
|
|
|
<div
|
|
|
|
|
|
class="system-prompt-content"
|
|
|
|
|
|
:class="{ 'is-placeholder': !agentConfig[key] }"
|
|
|
|
|
|
>
|
|
|
|
|
|
{{ agentConfig[key] || getPlaceholder(key, value) }}
|
|
|
|
|
|
</div>
|
2026-03-20 03:21:52 +08:00
|
|
|
|
<div class="edit-hint">
|
|
|
|
|
|
{{ isReadOnlyConfig ? '查看' : '点击查看并编辑' }}
|
2025-08-22 23:17:48 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2026-03-20 03:21:52 +08:00
|
|
|
|
</div>
|
2025-08-22 23:17:48 +08:00
|
|
|
|
|
|
|
|
|
|
<!-- 布尔类型 -->
|
|
|
|
|
|
<a-switch
|
|
|
|
|
|
v-else-if="typeof agentConfig[key] === 'boolean'"
|
2025-08-25 01:46:31 +08:00
|
|
|
|
:checked="agentConfig[key]"
|
2026-03-20 03:21:52 +08:00
|
|
|
|
:disabled="isReadOnlyConfig"
|
|
|
|
|
|
@update:checked="(val) => updateConfigValue(key, val)"
|
2025-08-22 23:17:48 +08:00
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 单选 -->
|
|
|
|
|
|
<a-select
|
2026-01-15 06:01:34 +08:00
|
|
|
|
v-else-if="
|
2026-05-21 19:33:00 +08:00
|
|
|
|
getConfigOptions(value).length > 0 &&
|
|
|
|
|
|
(value?.type === 'str' || value?.type === 'select')
|
2026-01-15 06:01:34 +08:00
|
|
|
|
"
|
2025-08-25 01:46:31 +08:00
|
|
|
|
:value="agentConfig[key]"
|
2026-03-20 03:21:52 +08:00
|
|
|
|
:disabled="isReadOnlyConfig"
|
|
|
|
|
|
@update:value="(val) => updateConfigValue(key, val)"
|
2025-08-22 23:17:48 +08:00
|
|
|
|
class="config-select"
|
|
|
|
|
|
>
|
2026-05-21 19:33:00 +08:00
|
|
|
|
<a-select-option
|
|
|
|
|
|
v-for="option in getConfigOptions(value)"
|
|
|
|
|
|
:key="getOptionValue(option)"
|
|
|
|
|
|
:value="getOptionValue(option)"
|
|
|
|
|
|
>
|
|
|
|
|
|
{{ getOptionLabel(option) }}
|
2025-08-22 23:17:48 +08:00
|
|
|
|
</a-select-option>
|
|
|
|
|
|
</a-select>
|
|
|
|
|
|
|
2026-01-22 11:40:09 +08:00
|
|
|
|
<!-- 多选 / 工具列表 (统一处理) -->
|
|
|
|
|
|
<div v-else-if="isListConfig(key, value)" class="list-config-container">
|
|
|
|
|
|
<!-- Case 1: <= 5 options, inline list -->
|
|
|
|
|
|
<div v-if="getConfigOptions(value).length <= 5" class="multi-select-cards">
|
|
|
|
|
|
<div class="multi-select-label">
|
2026-03-20 03:21:52 +08:00
|
|
|
|
<span
|
|
|
|
|
|
>已选择 {{ getSelectedCount(key) }} 项 | 共
|
|
|
|
|
|
{{ getConfigOptions(value).length }} 项</span
|
|
|
|
|
|
>
|
|
|
|
|
|
<div v-if="!isReadOnlyConfig" class="label-actions">
|
2026-03-06 11:46:32 +08:00
|
|
|
|
<a-button
|
|
|
|
|
|
type="link"
|
|
|
|
|
|
size="small"
|
|
|
|
|
|
class="clear-btn"
|
|
|
|
|
|
@click="clearSelection(key)"
|
|
|
|
|
|
v-if="getSelectedCount(key) > 0"
|
|
|
|
|
|
>
|
|
|
|
|
|
清空
|
|
|
|
|
|
</a-button>
|
2026-05-17 13:06:25 +08:00
|
|
|
|
<template v-if="isToolsKind(value.kind)">
|
2026-03-06 11:46:32 +08:00
|
|
|
|
<a-divider type="vertical" />
|
|
|
|
|
|
<a-button
|
|
|
|
|
|
type="link"
|
|
|
|
|
|
size="small"
|
2026-05-17 13:06:25 +08:00
|
|
|
|
@click="refreshConfigOptions(key, value.kind)"
|
2026-03-20 03:21:52 +08:00
|
|
|
|
class="inline-action-btn lucide-icon-btn"
|
2026-03-06 11:46:32 +08:00
|
|
|
|
>
|
|
|
|
|
|
<RotateCw :size="12" />
|
|
|
|
|
|
刷新
|
|
|
|
|
|
</a-button>
|
|
|
|
|
|
<a-button
|
|
|
|
|
|
type="link"
|
|
|
|
|
|
size="small"
|
2026-05-17 13:06:25 +08:00
|
|
|
|
@click="navigateToConfigPage(value.kind)"
|
2026-03-20 03:21:52 +08:00
|
|
|
|
class="inline-action-btn lucide-icon-btn"
|
2026-03-06 11:46:32 +08:00
|
|
|
|
>
|
|
|
|
|
|
<Settings :size="12" />
|
|
|
|
|
|
配置
|
|
|
|
|
|
</a-button>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</div>
|
2026-01-22 11:40:09 +08:00
|
|
|
|
</div>
|
2026-03-06 11:46:32 +08:00
|
|
|
|
|
2026-01-22 11:40:09 +08:00
|
|
|
|
<div class="options-grid">
|
|
|
|
|
|
<div
|
2026-03-20 03:21:52 +08:00
|
|
|
|
v-for="option in isReadOnlyConfig
|
|
|
|
|
|
? getConfigOptions(value).filter((opt) =>
|
|
|
|
|
|
isOptionSelected(key, getOptionValue(opt))
|
|
|
|
|
|
)
|
|
|
|
|
|
: getConfigOptions(value)"
|
2026-01-22 11:40:09 +08:00
|
|
|
|
:key="getOptionValue(option)"
|
|
|
|
|
|
class="option-card"
|
|
|
|
|
|
:class="{
|
|
|
|
|
|
selected: isOptionSelected(key, getOptionValue(option)),
|
2026-03-20 03:21:52 +08:00
|
|
|
|
unselected: !isOptionSelected(key, getOptionValue(option)),
|
|
|
|
|
|
readonly: isReadOnlyConfig
|
2026-01-22 11:40:09 +08:00
|
|
|
|
}"
|
2026-03-20 03:21:52 +08:00
|
|
|
|
@click="!isReadOnlyConfig && toggleOption(key, getOptionValue(option))"
|
2026-01-22 11:40:09 +08:00
|
|
|
|
>
|
|
|
|
|
|
<div class="option-content">
|
|
|
|
|
|
<span class="option-text">{{ getOptionLabel(option) }}</span>
|
|
|
|
|
|
<div class="option-indicator">
|
|
|
|
|
|
<Check
|
|
|
|
|
|
v-if="isOptionSelected(key, getOptionValue(option))"
|
|
|
|
|
|
:size="16"
|
|
|
|
|
|
/>
|
|
|
|
|
|
<Plus v-else :size="16" />
|
|
|
|
|
|
</div>
|
2025-08-22 23:17:48 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2026-01-22 11:40:09 +08:00
|
|
|
|
|
|
|
|
|
|
<!-- Case 2: > 5 options, Modal trigger -->
|
|
|
|
|
|
|
|
|
|
|
|
<div v-else class="selection-container">
|
|
|
|
|
|
<div class="selection-summary">
|
|
|
|
|
|
<div class="selection-summary-info">
|
2026-03-20 03:21:52 +08:00
|
|
|
|
<span class="selection-count"
|
|
|
|
|
|
>已选择 {{ getSelectedCount(key) }} 项 | 共
|
|
|
|
|
|
{{ getConfigOptions(value).length }} 项</span
|
|
|
|
|
|
>
|
2026-01-22 11:40:09 +08:00
|
|
|
|
|
|
|
|
|
|
<a-button
|
2026-03-20 03:21:52 +08:00
|
|
|
|
v-if="!isReadOnlyConfig && getSelectedCount(key) > 0"
|
2026-01-22 11:40:09 +08:00
|
|
|
|
type="link"
|
|
|
|
|
|
size="small"
|
|
|
|
|
|
class="clear-btn"
|
|
|
|
|
|
@click="clearSelection(key)"
|
|
|
|
|
|
>
|
|
|
|
|
|
清空
|
|
|
|
|
|
</a-button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<a-button
|
2026-03-20 03:21:52 +08:00
|
|
|
|
v-if="!isReadOnlyConfig"
|
2026-01-22 11:40:09 +08:00
|
|
|
|
type="primary"
|
|
|
|
|
|
size="small"
|
|
|
|
|
|
class="selection-trigger-btn"
|
|
|
|
|
|
@click="openSelectionModal(key)"
|
|
|
|
|
|
>
|
|
|
|
|
|
选择...
|
|
|
|
|
|
</a-button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Selected Preview Tags -->
|
|
|
|
|
|
|
|
|
|
|
|
<div v-if="getSelectedCount(key) > 0" class="selection-preview">
|
|
|
|
|
|
<a-tag
|
2026-05-19 18:37:29 +08:00
|
|
|
|
v-for="val in ensureArray(key)"
|
2026-01-22 11:40:09 +08:00
|
|
|
|
:key="val"
|
2026-03-20 03:21:52 +08:00
|
|
|
|
:closable="!isReadOnlyConfig"
|
2026-01-22 11:40:09 +08:00
|
|
|
|
@close="toggleOption(key, val)"
|
|
|
|
|
|
class="selection-tag"
|
|
|
|
|
|
>
|
|
|
|
|
|
{{ getOptionLabelFromValue(key, val) }}
|
|
|
|
|
|
</a-tag>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2025-08-22 23:17:48 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 数字 -->
|
|
|
|
|
|
<a-input-number
|
2026-03-20 03:21:52 +08:00
|
|
|
|
v-else-if="
|
|
|
|
|
|
value?.type === 'number' || value?.type === 'int' || value?.type === 'float'
|
|
|
|
|
|
"
|
2025-08-25 01:46:31 +08:00
|
|
|
|
:value="agentConfig[key]"
|
2026-03-20 03:21:52 +08:00
|
|
|
|
:disabled="isReadOnlyConfig"
|
|
|
|
|
|
@update:value="(val) => updateConfigValue(key, val)"
|
2025-08-22 23:17:48 +08:00
|
|
|
|
:placeholder="getPlaceholder(key, value)"
|
|
|
|
|
|
class="config-input-number"
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 滑块 -->
|
|
|
|
|
|
<a-slider
|
|
|
|
|
|
v-else-if="value?.type === 'slider'"
|
2025-08-25 01:46:31 +08:00
|
|
|
|
:value="agentConfig[key]"
|
2026-03-20 03:21:52 +08:00
|
|
|
|
:disabled="isReadOnlyConfig"
|
|
|
|
|
|
@update:value="(val) => updateConfigValue(key, val)"
|
2025-08-22 23:17:48 +08:00
|
|
|
|
:min="value.min"
|
|
|
|
|
|
:max="value.max"
|
|
|
|
|
|
:step="value.step"
|
|
|
|
|
|
class="config-slider"
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 其他类型 -->
|
|
|
|
|
|
<a-input
|
|
|
|
|
|
v-else
|
2025-08-25 01:46:31 +08:00
|
|
|
|
:value="agentConfig[key]"
|
2026-03-20 03:21:52 +08:00
|
|
|
|
:disabled="isReadOnlyConfig"
|
|
|
|
|
|
@update:value="(val) => updateConfigValue(key, val)"
|
2025-08-22 23:17:48 +08:00
|
|
|
|
:placeholder="getPlaceholder(key, value)"
|
|
|
|
|
|
class="config-input"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</a-form-item>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</a-form>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2026-01-15 05:59:13 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
|
2025-08-22 23:17:48 +08:00
|
|
|
|
<a-modal
|
2026-01-22 11:40:09 +08:00
|
|
|
|
v-model:open="selectionModalOpen"
|
|
|
|
|
|
:title="`选择${configurableItems[currentConfigKey]?.name || '项目'}`"
|
2025-10-14 01:46:43 +08:00
|
|
|
|
:width="800"
|
2025-08-22 23:17:48 +08:00
|
|
|
|
:footer="null"
|
|
|
|
|
|
:maskClosable="false"
|
2026-01-22 11:40:09 +08:00
|
|
|
|
class="selection-modal"
|
2025-08-22 23:17:48 +08:00
|
|
|
|
>
|
2026-01-22 11:40:09 +08:00
|
|
|
|
<div class="selection-modal-content">
|
|
|
|
|
|
<div class="selection-search">
|
2025-08-22 23:17:48 +08:00
|
|
|
|
<a-input
|
2026-01-22 11:40:09 +08:00
|
|
|
|
v-model:value="selectionSearchText"
|
|
|
|
|
|
placeholder="搜索..."
|
2025-08-22 23:17:48 +08:00
|
|
|
|
allow-clear
|
|
|
|
|
|
class="search-input"
|
|
|
|
|
|
>
|
|
|
|
|
|
<template #prefix>
|
2026-01-22 05:57:13 +08:00
|
|
|
|
<Search :size="16" class="search-icon" />
|
2025-08-22 23:17:48 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
</a-input>
|
2026-03-20 03:21:52 +08:00
|
|
|
|
<template v-if="!isReadOnlyConfig && isToolsKind(currentConfigKind)">
|
2026-03-06 11:46:32 +08:00
|
|
|
|
<a-button
|
|
|
|
|
|
type="text"
|
|
|
|
|
|
size="small"
|
|
|
|
|
|
@click="refreshConfigOptions(currentConfigKey, currentConfigKind)"
|
2026-03-20 03:21:52 +08:00
|
|
|
|
class="inline-action-btn lucide-icon-btn"
|
2026-03-06 11:46:32 +08:00
|
|
|
|
title="刷新列表"
|
|
|
|
|
|
>
|
|
|
|
|
|
<RotateCw :size="14" />
|
|
|
|
|
|
刷新
|
|
|
|
|
|
</a-button>
|
|
|
|
|
|
<a-button
|
|
|
|
|
|
type="text"
|
|
|
|
|
|
size="small"
|
|
|
|
|
|
@click="navigateToConfigPage(currentConfigKind)"
|
2026-03-20 03:21:52 +08:00
|
|
|
|
class="inline-action-btn lucide-icon-btn"
|
2026-03-06 11:46:32 +08:00
|
|
|
|
title="跳转配置"
|
|
|
|
|
|
>
|
|
|
|
|
|
<Settings :size="14" />
|
|
|
|
|
|
配置
|
|
|
|
|
|
</a-button>
|
|
|
|
|
|
</template>
|
2025-08-22 23:17:48 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-01-22 11:40:09 +08:00
|
|
|
|
<div class="selection-list">
|
2025-08-22 23:17:48 +08:00
|
|
|
|
<div
|
2026-01-22 11:40:09 +08:00
|
|
|
|
v-for="option in filteredOptions"
|
|
|
|
|
|
:key="getOptionValue(option)"
|
|
|
|
|
|
class="selection-item"
|
|
|
|
|
|
:class="{ selected: tempSelectedValues.includes(getOptionValue(option)) }"
|
2026-03-20 03:21:52 +08:00
|
|
|
|
@click="!isReadOnlyConfig && toggleModalSelection(getOptionValue(option))"
|
2025-08-22 23:17:48 +08:00
|
|
|
|
>
|
2026-01-22 11:40:09 +08:00
|
|
|
|
<div class="selection-item-content">
|
|
|
|
|
|
<div class="selection-item-header">
|
|
|
|
|
|
<span class="selection-item-name">{{ getOptionLabel(option) }}</span>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="selection-item-indicator">
|
|
|
|
|
|
<Check v-if="tempSelectedValues.includes(getOptionValue(option))" :size="16" />
|
|
|
|
|
|
|
2026-01-22 05:57:13 +08:00
|
|
|
|
<Plus v-else :size="16" />
|
2025-08-22 23:17:48 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2026-01-22 11:40:09 +08:00
|
|
|
|
|
|
|
|
|
|
<div v-if="getOptionDescription(option)" class="selection-item-description">
|
|
|
|
|
|
{{ getOptionDescription(option) }}
|
|
|
|
|
|
</div>
|
2025-08-22 23:17:48 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-01-22 11:40:09 +08:00
|
|
|
|
<div class="selection-modal-footer">
|
|
|
|
|
|
<div class="selected-count">已选择 {{ tempSelectedValues.length }} 项</div>
|
|
|
|
|
|
|
2025-08-22 23:17:48 +08:00
|
|
|
|
<div class="modal-actions">
|
2026-01-22 11:40:09 +08:00
|
|
|
|
<a-button @click="closeSelectionModal">取消</a-button>
|
|
|
|
|
|
|
2026-03-20 03:21:52 +08:00
|
|
|
|
<a-button v-if="!isReadOnlyConfig" type="primary" @click="confirmSelection">
|
|
|
|
|
|
确认
|
|
|
|
|
|
</a-button>
|
2025-08-22 23:17:48 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</a-modal>
|
2026-03-18 20:01:09 +08:00
|
|
|
|
|
|
|
|
|
|
<a-modal
|
|
|
|
|
|
v-model:open="systemPromptModalOpen"
|
|
|
|
|
|
:title="systemPromptModalTitle"
|
|
|
|
|
|
:width="620"
|
|
|
|
|
|
:maskClosable="false"
|
|
|
|
|
|
@cancel="closeSystemPromptModal"
|
|
|
|
|
|
class="system-prompt-modal"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div class="system-prompt-modal-content">
|
|
|
|
|
|
<a-textarea
|
|
|
|
|
|
v-model:value="systemPromptDraft"
|
|
|
|
|
|
:rows="14"
|
2026-03-20 03:21:52 +08:00
|
|
|
|
:disabled="isReadOnlyConfig"
|
2026-03-18 20:01:09 +08:00
|
|
|
|
:placeholder="systemPromptModalPlaceholder"
|
|
|
|
|
|
class="system-prompt-modal-input"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<template #footer>
|
2026-03-20 03:21:52 +08:00
|
|
|
|
<a-button @click="closeSystemPromptModal">{{
|
|
|
|
|
|
isReadOnlyConfig ? '关闭' : '取消'
|
|
|
|
|
|
}}</a-button>
|
|
|
|
|
|
<a-button v-if="!isReadOnlyConfig" type="primary" @click="saveSystemPrompt">
|
|
|
|
|
|
保存
|
|
|
|
|
|
</a-button>
|
2026-03-18 20:01:09 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
</a-modal>
|
2025-08-22 23:17:48 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup>
|
2026-05-24 00:47:08 +08:00
|
|
|
|
import { ref, computed } from 'vue'
|
|
|
|
|
|
import { message } from 'ant-design-vue'
|
2026-03-06 11:46:32 +08:00
|
|
|
|
import { useRouter } from 'vue-router'
|
2026-05-24 00:47:08 +08:00
|
|
|
|
import { Check, Plus, Search, RotateCw, Settings } from 'lucide-vue-next'
|
2026-01-15 06:01:34 +08:00
|
|
|
|
import ModelSelectorComponent from '@/components/ModelSelectorComponent.vue'
|
|
|
|
|
|
import { useAgentStore } from '@/stores/agent'
|
2026-05-21 19:33:00 +08:00
|
|
|
|
import {
|
|
|
|
|
|
getAgentConfigOptionDescription as getOptionDescription,
|
|
|
|
|
|
getAgentConfigOptionLabel as getOptionLabel,
|
|
|
|
|
|
getAgentConfigOptions as getConfigOptions,
|
|
|
|
|
|
getAgentConfigOptionValue as getOptionValue,
|
|
|
|
|
|
isDefaultAllAgentResourceKind
|
|
|
|
|
|
} from '@/utils/agentConfigUtils'
|
2026-01-15 06:01:34 +08:00
|
|
|
|
import { storeToRefs } from 'pinia'
|
2025-08-22 23:17:48 +08:00
|
|
|
|
|
2026-01-22 12:15:46 +08:00
|
|
|
|
const props = defineProps({
|
2026-05-24 00:47:08 +08:00
|
|
|
|
segment: {
|
|
|
|
|
|
type: String,
|
|
|
|
|
|
default: 'model'
|
2026-01-22 05:57:13 +08:00
|
|
|
|
},
|
2026-05-24 00:47:08 +08:00
|
|
|
|
showSegmented: {
|
2026-01-22 05:57:13 +08:00
|
|
|
|
type: Boolean,
|
2026-05-24 00:47:08 +08:00
|
|
|
|
default: true
|
2025-08-22 23:17:48 +08:00
|
|
|
|
}
|
2026-01-15 06:01:34 +08:00
|
|
|
|
})
|
2025-08-22 23:17:48 +08:00
|
|
|
|
|
2026-01-15 06:01:34 +08:00
|
|
|
|
const agentStore = useAgentStore()
|
2026-03-06 11:46:32 +08:00
|
|
|
|
const router = useRouter()
|
2026-01-22 12:15:46 +08:00
|
|
|
|
|
2026-05-24 00:47:08 +08:00
|
|
|
|
const { selectedAgent, selectedAgentId, agentConfig, configurableItems } = storeToRefs(agentStore)
|
2025-08-25 01:46:31 +08:00
|
|
|
|
|
|
|
|
|
|
// console.log(availableTools.value)
|
|
|
|
|
|
|
2025-08-22 23:17:48 +08:00
|
|
|
|
// 本地状态
|
2026-01-22 11:40:09 +08:00
|
|
|
|
const selectionModalOpen = ref(false)
|
|
|
|
|
|
const currentConfigKey = ref(null)
|
|
|
|
|
|
const tempSelectedValues = ref([])
|
|
|
|
|
|
const selectionSearchText = ref('')
|
2026-03-18 20:01:09 +08:00
|
|
|
|
const systemPromptModalOpen = ref(false)
|
|
|
|
|
|
const currentSystemPromptKey = ref(null)
|
|
|
|
|
|
const systemPromptDraft = ref('')
|
2026-03-24 02:32:35 +08:00
|
|
|
|
const currentSegment = ref('model')
|
|
|
|
|
|
const segmentOptions = [
|
|
|
|
|
|
{ label: '模型', value: 'model' },
|
|
|
|
|
|
{ label: '工具', value: 'tools' },
|
|
|
|
|
|
{ label: '其他', value: 'other' }
|
|
|
|
|
|
]
|
2026-05-24 00:47:08 +08:00
|
|
|
|
const activeSegment = computed(() => (props.showSegmented ? currentSegment.value : props.segment))
|
2026-05-19 18:37:29 +08:00
|
|
|
|
const isToolResourceKind = (kind) => isDefaultAllAgentResourceKind(kind)
|
2025-08-22 23:17:48 +08:00
|
|
|
|
|
|
|
|
|
|
const isEmptyConfig = computed(() => {
|
2026-01-15 06:01:34 +08:00
|
|
|
|
return !selectedAgentId.value || Object.keys(configurableItems.value).length === 0
|
|
|
|
|
|
})
|
2025-08-22 23:17:48 +08:00
|
|
|
|
|
2026-05-24 00:47:08 +08:00
|
|
|
|
const canManageCurrentAgent = computed(() => !!selectedAgent.value?.can_manage)
|
|
|
|
|
|
const isReadOnlyConfig = computed(() => !canManageCurrentAgent.value)
|
2026-01-22 05:57:13 +08:00
|
|
|
|
|
2026-03-24 02:32:35 +08:00
|
|
|
|
const segmentConfigKeys = computed(() => {
|
|
|
|
|
|
const keys = Object.keys(configurableItems.value)
|
|
|
|
|
|
return {
|
2026-03-24 22:37:03 +08:00
|
|
|
|
model: keys.filter((key) => {
|
2026-05-17 13:06:25 +08:00
|
|
|
|
const meta = configurableItems.value[key]?.kind
|
2026-03-24 02:32:35 +08:00
|
|
|
|
return meta === 'llm' || meta === 'prompt'
|
|
|
|
|
|
}),
|
2026-03-24 22:37:03 +08:00
|
|
|
|
tools: keys.filter((key) => {
|
2026-05-17 13:06:25 +08:00
|
|
|
|
const meta = configurableItems.value[key]?.kind
|
2026-05-19 18:37:29 +08:00
|
|
|
|
return isToolResourceKind(meta)
|
2026-03-24 02:32:35 +08:00
|
|
|
|
}),
|
2026-03-24 22:37:03 +08:00
|
|
|
|
other: keys.filter((key) => {
|
2026-05-17 13:06:25 +08:00
|
|
|
|
const meta = configurableItems.value[key]?.kind
|
2026-05-19 18:37:29 +08:00
|
|
|
|
return meta !== 'llm' && meta !== 'prompt' && !isToolResourceKind(meta)
|
2026-03-24 02:32:35 +08:00
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const filteredConfigurableItems = computed(() => {
|
|
|
|
|
|
if (isEmptyConfig.value) return {}
|
2026-05-24 00:47:08 +08:00
|
|
|
|
const keys = segmentConfigKeys.value[activeSegment.value] || []
|
2026-03-24 02:32:35 +08:00
|
|
|
|
const filtered = {}
|
2026-03-24 22:37:03 +08:00
|
|
|
|
keys.forEach((key) => {
|
2026-03-24 02:32:35 +08:00
|
|
|
|
filtered[key] = configurableItems.value[key]
|
|
|
|
|
|
})
|
|
|
|
|
|
return filtered
|
|
|
|
|
|
})
|
|
|
|
|
|
|
2026-05-24 00:47:08 +08:00
|
|
|
|
const isCurrentSegmentEmpty = computed(
|
|
|
|
|
|
() => !isEmptyConfig.value && Object.keys(filteredConfigurableItems.value).length === 0
|
|
|
|
|
|
)
|
|
|
|
|
|
|
2026-03-06 11:46:32 +08:00
|
|
|
|
// 判断是否为需要跳转的配置类型
|
|
|
|
|
|
const isToolsKind = (kind) => {
|
2026-05-19 18:37:29 +08:00
|
|
|
|
return isToolResourceKind(kind)
|
2026-03-06 11:46:32 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 强制刷新对应配置项的选项列表
|
2026-05-21 19:33:00 +08:00
|
|
|
|
const refreshConfigOptions = async () => {
|
|
|
|
|
|
if (isReadOnlyConfig.value || !selectedAgentId.value) return
|
2026-03-06 11:46:32 +08:00
|
|
|
|
try {
|
2026-05-21 19:33:00 +08:00
|
|
|
|
await agentStore.fetchAgentDetail(selectedAgentId.value, true)
|
|
|
|
|
|
message.success('配置选项已刷新')
|
2026-03-06 11:46:32 +08:00
|
|
|
|
} catch (error) {
|
|
|
|
|
|
console.error('刷新配置选项失败:', error)
|
|
|
|
|
|
message.error('刷新失败')
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 跳转到对应管理页面
|
|
|
|
|
|
const navigateToConfigPage = (kind) => {
|
2026-03-20 03:21:52 +08:00
|
|
|
|
if (isReadOnlyConfig.value) return
|
2026-03-06 11:46:32 +08:00
|
|
|
|
// 先关闭选择弹窗
|
|
|
|
|
|
closeSelectionModal()
|
|
|
|
|
|
// 延迟跳转,确保弹窗先关闭
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
switch (kind) {
|
|
|
|
|
|
case 'knowledges':
|
2026-05-17 14:28:50 +08:00
|
|
|
|
router.push({ path: '/extensions', query: { tab: 'knowledge' } })
|
2026-03-06 11:46:32 +08:00
|
|
|
|
break
|
|
|
|
|
|
case 'tools':
|
|
|
|
|
|
router.push({ path: '/extensions', query: { tab: 'tools' } })
|
|
|
|
|
|
break
|
|
|
|
|
|
case 'mcps':
|
|
|
|
|
|
router.push({ path: '/extensions', query: { tab: 'mcp' } })
|
|
|
|
|
|
break
|
|
|
|
|
|
case 'skills':
|
|
|
|
|
|
router.push({ path: '/extensions', query: { tab: 'skills' } })
|
|
|
|
|
|
break
|
2026-03-20 01:42:38 +08:00
|
|
|
|
case 'subagents':
|
2026-06-01 22:29:18 +08:00
|
|
|
|
router.push({ path: '/model-manage', query: { tab: 'agents' } })
|
2026-03-20 01:42:38 +08:00
|
|
|
|
break
|
2026-03-06 11:46:32 +08:00
|
|
|
|
}
|
|
|
|
|
|
}, 100)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-22 11:40:09 +08:00
|
|
|
|
const isListConfig = (key, value) => {
|
2026-05-19 18:37:29 +08:00
|
|
|
|
const isDefaultAllKind = isDefaultAllAgentResourceKind(value?.kind)
|
2026-01-22 11:40:09 +08:00
|
|
|
|
const isList = value?.type === 'list'
|
2026-05-19 18:37:29 +08:00
|
|
|
|
return isDefaultAllKind || isList || key === 'skills' || key === 'subagents'
|
2026-01-22 11:40:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-03-06 11:46:32 +08:00
|
|
|
|
const currentConfigKind = computed(() => {
|
|
|
|
|
|
if (!currentConfigKey.value) return null
|
2026-05-17 13:06:25 +08:00
|
|
|
|
return configurableItems.value[currentConfigKey.value]?.kind
|
2026-03-06 11:46:32 +08:00
|
|
|
|
})
|
|
|
|
|
|
|
2026-03-18 20:01:09 +08:00
|
|
|
|
const systemPromptModalTitle = computed(() => {
|
|
|
|
|
|
if (!currentSystemPromptKey.value) return 'System Prompt'
|
|
|
|
|
|
return configurableItems.value[currentSystemPromptKey.value]?.name || currentSystemPromptKey.value
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const systemPromptModalPlaceholder = computed(() => {
|
|
|
|
|
|
if (!currentSystemPromptKey.value) return '请输入系统提示词'
|
|
|
|
|
|
const currentItem = configurableItems.value[currentSystemPromptKey.value]
|
|
|
|
|
|
if (!currentItem) return '请输入系统提示词'
|
|
|
|
|
|
return getPlaceholder(currentSystemPromptKey.value, currentItem)
|
|
|
|
|
|
})
|
|
|
|
|
|
|
2026-01-22 11:40:09 +08:00
|
|
|
|
const filteredOptions = computed(() => {
|
|
|
|
|
|
if (!currentConfigKey.value) return []
|
|
|
|
|
|
const key = currentConfigKey.value
|
|
|
|
|
|
const configItem = configurableItems.value[key]
|
|
|
|
|
|
const options = getConfigOptions(configItem)
|
|
|
|
|
|
|
|
|
|
|
|
if (!selectionSearchText.value) return options
|
|
|
|
|
|
|
|
|
|
|
|
const search = selectionSearchText.value.toLowerCase()
|
|
|
|
|
|
return options.filter((opt) => {
|
|
|
|
|
|
const label = String(getOptionLabel(opt)).toLowerCase()
|
|
|
|
|
|
const desc = String(getOptionDescription(opt) || '').toLowerCase()
|
|
|
|
|
|
return label.includes(search) || desc.includes(search)
|
|
|
|
|
|
})
|
2026-01-15 06:01:34 +08:00
|
|
|
|
})
|
2025-08-22 23:17:48 +08:00
|
|
|
|
|
|
|
|
|
|
// 方法
|
2026-03-20 03:21:52 +08:00
|
|
|
|
const updateConfigValue = (key, value) => {
|
|
|
|
|
|
if (isReadOnlyConfig.value) return
|
|
|
|
|
|
agentStore.updateAgentConfig({
|
|
|
|
|
|
[key]: value
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-08-22 23:17:48 +08:00
|
|
|
|
const getConfigLabel = (key, value) => {
|
2025-08-25 01:46:31 +08:00
|
|
|
|
// console.log(configurableItems)
|
2025-08-22 23:17:48 +08:00
|
|
|
|
if (value.description && value.name !== key) {
|
2026-01-15 06:01:34 +08:00
|
|
|
|
return `${value.name}`
|
2025-11-23 19:42:51 +08:00
|
|
|
|
// return `${value.name}(${key})`;
|
2025-08-22 23:17:48 +08:00
|
|
|
|
}
|
2026-01-15 06:01:34 +08:00
|
|
|
|
return key
|
|
|
|
|
|
}
|
2025-08-22 23:17:48 +08:00
|
|
|
|
|
2026-03-20 03:21:52 +08:00
|
|
|
|
const getPlaceholder = (_key, value) => {
|
2026-01-15 06:01:34 +08:00
|
|
|
|
return `(默认: ${value.default})`
|
|
|
|
|
|
}
|
2025-08-22 23:17:48 +08:00
|
|
|
|
|
2025-12-28 22:55:42 +08:00
|
|
|
|
const handleModelChange = (key, spec) => {
|
2026-03-20 03:21:52 +08:00
|
|
|
|
if (isReadOnlyConfig.value) return
|
2026-01-15 06:01:34 +08:00
|
|
|
|
if (typeof spec !== 'string' || !spec) return
|
2025-08-25 01:46:31 +08:00
|
|
|
|
agentStore.updateAgentConfig({
|
2025-12-28 22:55:42 +08:00
|
|
|
|
[key]: spec
|
2026-01-15 06:01:34 +08:00
|
|
|
|
})
|
|
|
|
|
|
}
|
2025-08-22 23:17:48 +08:00
|
|
|
|
|
|
|
|
|
|
// 多选相关方法
|
|
|
|
|
|
const ensureArray = (key) => {
|
2026-01-15 06:01:34 +08:00
|
|
|
|
const config = agentConfig.value || {}
|
2026-05-19 18:37:29 +08:00
|
|
|
|
const configItem = configurableItems.value[key]
|
|
|
|
|
|
if (config[key] === null && isDefaultAllAgentResourceKind(configItem?.kind)) {
|
|
|
|
|
|
return getConfigOptions(configItem).map((option) => getOptionValue(option))
|
2026-05-12 13:40:44 +08:00
|
|
|
|
}
|
2025-08-22 23:17:48 +08:00
|
|
|
|
if (!config[key] || !Array.isArray(config[key])) {
|
2026-01-15 06:01:34 +08:00
|
|
|
|
return []
|
2025-08-22 23:17:48 +08:00
|
|
|
|
}
|
2026-01-15 06:01:34 +08:00
|
|
|
|
return config[key]
|
|
|
|
|
|
}
|
2025-08-22 23:17:48 +08:00
|
|
|
|
|
|
|
|
|
|
const isOptionSelected = (key, option) => {
|
2026-01-15 06:01:34 +08:00
|
|
|
|
const currentOptions = ensureArray(key)
|
|
|
|
|
|
return currentOptions.includes(option)
|
|
|
|
|
|
}
|
2025-08-22 23:17:48 +08:00
|
|
|
|
|
|
|
|
|
|
const getSelectedCount = (key) => {
|
2026-01-15 06:01:34 +08:00
|
|
|
|
const currentOptions = ensureArray(key)
|
|
|
|
|
|
return currentOptions.length
|
|
|
|
|
|
}
|
2025-08-22 23:17:48 +08:00
|
|
|
|
|
|
|
|
|
|
const toggleOption = (key, option) => {
|
2026-03-20 03:21:52 +08:00
|
|
|
|
if (isReadOnlyConfig.value) return
|
2026-01-15 06:01:34 +08:00
|
|
|
|
const currentOptions = [...ensureArray(key)]
|
|
|
|
|
|
const index = currentOptions.indexOf(option)
|
2025-08-22 23:17:48 +08:00
|
|
|
|
|
|
|
|
|
|
if (index > -1) {
|
2026-01-15 06:01:34 +08:00
|
|
|
|
currentOptions.splice(index, 1)
|
2025-08-22 23:17:48 +08:00
|
|
|
|
} else {
|
2026-01-15 06:01:34 +08:00
|
|
|
|
currentOptions.push(option)
|
2025-08-22 23:17:48 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-08-25 01:46:31 +08:00
|
|
|
|
agentStore.updateAgentConfig({
|
|
|
|
|
|
[key]: currentOptions
|
2026-01-15 06:01:34 +08:00
|
|
|
|
})
|
|
|
|
|
|
}
|
2025-08-22 23:17:48 +08:00
|
|
|
|
|
|
|
|
|
|
const clearSelection = (key) => {
|
2026-03-20 03:21:52 +08:00
|
|
|
|
if (isReadOnlyConfig.value) return
|
2025-08-25 01:46:31 +08:00
|
|
|
|
agentStore.updateAgentConfig({
|
|
|
|
|
|
[key]: []
|
2026-01-15 06:01:34 +08:00
|
|
|
|
})
|
|
|
|
|
|
}
|
2025-08-22 23:17:48 +08:00
|
|
|
|
|
2026-01-22 11:40:09 +08:00
|
|
|
|
// 统一选择弹窗相关方法
|
|
|
|
|
|
const getOptionLabelFromValue = (key, val) => {
|
|
|
|
|
|
const options = getConfigOptions(configurableItems.value[key])
|
|
|
|
|
|
const option = options.find((opt) => getOptionValue(opt) === val)
|
|
|
|
|
|
return option ? getOptionLabel(option) : val
|
2026-01-15 06:01:34 +08:00
|
|
|
|
}
|
2025-08-22 23:17:48 +08:00
|
|
|
|
|
2026-05-21 19:33:00 +08:00
|
|
|
|
const openSelectionModal = (key) => {
|
2026-03-20 03:21:52 +08:00
|
|
|
|
if (isReadOnlyConfig.value) return
|
2026-01-22 11:40:09 +08:00
|
|
|
|
currentConfigKey.value = key
|
2026-05-12 13:40:44 +08:00
|
|
|
|
tempSelectedValues.value = [...ensureArray(key)]
|
2026-01-22 11:40:09 +08:00
|
|
|
|
selectionModalOpen.value = true
|
2026-01-15 06:01:34 +08:00
|
|
|
|
}
|
2025-08-22 23:17:48 +08:00
|
|
|
|
|
2026-01-22 11:40:09 +08:00
|
|
|
|
const toggleModalSelection = (optionValue) => {
|
2026-03-20 03:21:52 +08:00
|
|
|
|
if (isReadOnlyConfig.value) return
|
2026-01-22 11:40:09 +08:00
|
|
|
|
const index = tempSelectedValues.value.indexOf(optionValue)
|
2025-08-22 23:17:48 +08:00
|
|
|
|
if (index > -1) {
|
2026-01-22 11:40:09 +08:00
|
|
|
|
tempSelectedValues.value.splice(index, 1)
|
2025-08-22 23:17:48 +08:00
|
|
|
|
} else {
|
2026-01-22 11:40:09 +08:00
|
|
|
|
tempSelectedValues.value.push(optionValue)
|
2025-08-22 23:17:48 +08:00
|
|
|
|
}
|
2026-01-15 06:01:34 +08:00
|
|
|
|
}
|
2025-08-22 23:17:48 +08:00
|
|
|
|
|
2026-01-22 11:40:09 +08:00
|
|
|
|
const confirmSelection = () => {
|
2026-03-20 03:21:52 +08:00
|
|
|
|
if (isReadOnlyConfig.value) {
|
|
|
|
|
|
closeSelectionModal()
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
2026-01-22 11:40:09 +08:00
|
|
|
|
if (currentConfigKey.value) {
|
2025-08-25 01:46:31 +08:00
|
|
|
|
agentStore.updateAgentConfig({
|
2026-01-22 11:40:09 +08:00
|
|
|
|
[currentConfigKey.value]: [...tempSelectedValues.value]
|
2026-01-15 06:01:34 +08:00
|
|
|
|
})
|
2025-08-22 23:17:48 +08:00
|
|
|
|
}
|
2026-01-22 11:40:09 +08:00
|
|
|
|
closeSelectionModal()
|
2026-01-15 06:01:34 +08:00
|
|
|
|
}
|
2025-08-22 23:17:48 +08:00
|
|
|
|
|
2026-01-22 11:40:09 +08:00
|
|
|
|
const closeSelectionModal = () => {
|
|
|
|
|
|
selectionModalOpen.value = false
|
|
|
|
|
|
currentConfigKey.value = null
|
|
|
|
|
|
tempSelectedValues.value = []
|
|
|
|
|
|
selectionSearchText.value = ''
|
2026-01-15 06:01:34 +08:00
|
|
|
|
}
|
2025-08-22 23:17:48 +08:00
|
|
|
|
|
2026-03-18 20:01:09 +08:00
|
|
|
|
// 系统提示词弹窗编辑相关方法
|
|
|
|
|
|
const openSystemPromptModal = (key) => {
|
|
|
|
|
|
currentSystemPromptKey.value = key
|
|
|
|
|
|
systemPromptDraft.value = agentConfig.value[key] || ''
|
|
|
|
|
|
systemPromptModalOpen.value = true
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const closeSystemPromptModal = () => {
|
|
|
|
|
|
systemPromptModalOpen.value = false
|
|
|
|
|
|
currentSystemPromptKey.value = null
|
|
|
|
|
|
systemPromptDraft.value = ''
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const saveSystemPrompt = () => {
|
2026-03-20 03:21:52 +08:00
|
|
|
|
if (isReadOnlyConfig.value) return
|
2026-03-18 20:01:09 +08:00
|
|
|
|
if (!currentSystemPromptKey.value) return
|
|
|
|
|
|
agentStore.updateAgentConfig({
|
|
|
|
|
|
[currentSystemPromptKey.value]: systemPromptDraft.value
|
2026-01-15 06:01:34 +08:00
|
|
|
|
})
|
2026-03-18 20:01:09 +08:00
|
|
|
|
closeSystemPromptModal()
|
2026-01-15 06:01:34 +08:00
|
|
|
|
}
|
2025-09-06 14:04:33 +08:00
|
|
|
|
|
2025-09-01 22:28:07 +08:00
|
|
|
|
// 验证和过滤配置项
|
|
|
|
|
|
const validateAndFilterConfig = () => {
|
2026-01-15 06:01:34 +08:00
|
|
|
|
const validatedConfig = { ...agentConfig.value }
|
|
|
|
|
|
const configItems = configurableItems.value
|
2025-09-02 19:53:12 +08:00
|
|
|
|
|
2025-09-01 22:28:07 +08:00
|
|
|
|
// 遍历所有配置项
|
2026-01-15 06:01:34 +08:00
|
|
|
|
Object.keys(configItems).forEach((key) => {
|
|
|
|
|
|
const configItem = configItems[key]
|
|
|
|
|
|
const currentValue = validatedConfig[key]
|
2025-09-02 19:53:12 +08:00
|
|
|
|
|
2026-03-04 04:13:05 +08:00
|
|
|
|
if (
|
|
|
|
|
|
Array.isArray(currentValue) &&
|
2026-05-17 13:06:25 +08:00
|
|
|
|
(configItem.kind === 'tools' || configItem.type === 'list')
|
2026-03-04 04:13:05 +08:00
|
|
|
|
) {
|
2026-02-21 02:48:20 +08:00
|
|
|
|
const options = getConfigOptions(configItem)
|
|
|
|
|
|
const validValues = new Set(options.map((opt) => String(getOptionValue(opt))))
|
|
|
|
|
|
if (validValues.size === 0) return
|
2025-09-02 19:53:12 +08:00
|
|
|
|
|
2026-02-21 02:48:20 +08:00
|
|
|
|
validatedConfig[key] = currentValue.filter((value) => validValues.has(String(value)))
|
2025-09-01 22:28:07 +08:00
|
|
|
|
if (validatedConfig[key].length !== currentValue.length) {
|
2026-02-21 02:48:20 +08:00
|
|
|
|
console.warn(`配置项 ${key} 中包含无效选项,已自动过滤`)
|
2025-09-01 22:28:07 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2026-01-15 06:01:34 +08:00
|
|
|
|
})
|
2025-09-02 19:53:12 +08:00
|
|
|
|
|
2026-01-15 06:01:34 +08:00
|
|
|
|
return validatedConfig
|
|
|
|
|
|
}
|
2025-09-01 22:28:07 +08:00
|
|
|
|
|
2026-05-24 00:47:08 +08:00
|
|
|
|
defineExpose({ validateAndFilterConfig })
|
2025-08-22 23:17:48 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="less" scoped>
|
2026-05-24 00:47:08 +08:00
|
|
|
|
.agent-runtime-config-form {
|
2025-11-23 01:39:44 +08:00
|
|
|
|
background: var(--gray-0);
|
2025-08-22 23:17:48 +08:00
|
|
|
|
|
2026-05-24 00:47:08 +08:00
|
|
|
|
.runtime-config-content {
|
2025-08-22 23:17:48 +08:00
|
|
|
|
flex: 1;
|
|
|
|
|
|
overflow-y: auto;
|
2026-03-20 03:21:52 +08:00
|
|
|
|
padding: 10px 12px 8px;
|
2026-04-26 20:59:40 +08:00
|
|
|
|
min-width: 360px;
|
2025-08-22 23:17:48 +08:00
|
|
|
|
|
|
|
|
|
|
.agent-info {
|
|
|
|
|
|
.agent-basic-info {
|
|
|
|
|
|
.agent-description {
|
|
|
|
|
|
margin: 0 0 12px 0;
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
color: var(--gray-700);
|
|
|
|
|
|
line-height: 1.5;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-03-24 02:32:35 +08:00
|
|
|
|
.config-segment {
|
|
|
|
|
|
margin: 0 auto;
|
|
|
|
|
|
margin-bottom: 6px;
|
|
|
|
|
|
padding: 4px 0;
|
|
|
|
|
|
width: 80%;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-08-22 23:17:48 +08:00
|
|
|
|
.config-form-content {
|
2026-01-15 05:59:13 +08:00
|
|
|
|
margin-bottom: 20px;
|
2026-03-20 03:21:52 +08:00
|
|
|
|
|
|
|
|
|
|
&.is-readonly {
|
|
|
|
|
|
.config-item {
|
|
|
|
|
|
background: var(--gray-20);
|
|
|
|
|
|
|
|
|
|
|
|
.model-selector.is-readonly {
|
|
|
|
|
|
opacity: 0.78;
|
|
|
|
|
|
pointer-events: none;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.system-prompt-display {
|
|
|
|
|
|
cursor: default;
|
|
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
|
border-color: var(--gray-200);
|
|
|
|
|
|
background: transparent;
|
|
|
|
|
|
|
|
|
|
|
|
.edit-hint {
|
|
|
|
|
|
opacity: 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.edit-hint {
|
|
|
|
|
|
color: var(--gray-500);
|
|
|
|
|
|
opacity: 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.option-card.readonly {
|
|
|
|
|
|
cursor: default;
|
|
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
|
border-color: var(--gray-300);
|
|
|
|
|
|
background: var(--gray-0);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
&.selected:hover {
|
|
|
|
|
|
border-color: var(--main-color);
|
|
|
|
|
|
background: var(--main-10);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-08-22 23:17:48 +08:00
|
|
|
|
.config-form {
|
2026-05-24 00:47:08 +08:00
|
|
|
|
.config-alert,
|
|
|
|
|
|
.config-empty {
|
2025-08-22 23:17:48 +08:00
|
|
|
|
margin-bottom: 16px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.config-item {
|
2025-12-07 23:38:20 +08:00
|
|
|
|
background-color: var(--gray-25);
|
2025-11-23 19:42:51 +08:00
|
|
|
|
padding: 12px;
|
|
|
|
|
|
border-radius: 8px;
|
2025-12-23 01:51:05 +08:00
|
|
|
|
border: 1px solid var(--gray-100);
|
|
|
|
|
|
// box-shadow: 0px 0px 2px var(--shadow-3);
|
2025-11-23 19:42:51 +08:00
|
|
|
|
|
2026-01-22 12:15:46 +08:00
|
|
|
|
:deep(.ant-form-item-label > label) {
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-11-23 19:42:51 +08:00
|
|
|
|
:deep(label.form_item_model) {
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
}
|
2025-08-22 23:17:48 +08:00
|
|
|
|
|
|
|
|
|
|
.config-description {
|
|
|
|
|
|
margin: 4px 0 8px 0;
|
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
|
color: var(--gray-600);
|
|
|
|
|
|
line-height: 1.4;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.model-selector {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-09-06 14:04:33 +08:00
|
|
|
|
.system-prompt-container {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.system-prompt-display {
|
|
|
|
|
|
min-height: 60px;
|
2026-03-18 20:01:09 +08:00
|
|
|
|
border: 1px solid var(--gray-200);
|
|
|
|
|
|
padding: 10px 12px;
|
2025-09-06 14:04:33 +08:00
|
|
|
|
border-radius: 6px;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
transition: all 0.2s ease;
|
|
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
|
border-color: var(--main-color);
|
|
|
|
|
|
background: var(--gray-25);
|
|
|
|
|
|
|
|
|
|
|
|
.edit-hint {
|
|
|
|
|
|
opacity: 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.system-prompt-content {
|
2026-03-18 20:01:09 +08:00
|
|
|
|
white-space: pre-line;
|
2026-01-15 06:01:34 +08:00
|
|
|
|
word-break: break-word;
|
|
|
|
|
|
line-height: 1.5;
|
|
|
|
|
|
color: var(--gray-900);
|
2026-03-18 20:01:09 +08:00
|
|
|
|
font-size: 13px;
|
|
|
|
|
|
display: -webkit-box;
|
|
|
|
|
|
line-clamp: 4;
|
|
|
|
|
|
-webkit-line-clamp: 4;
|
|
|
|
|
|
-webkit-box-orient: vertical;
|
|
|
|
|
|
overflow: hidden;
|
2025-09-06 14:04:33 +08:00
|
|
|
|
|
2026-01-15 06:01:34 +08:00
|
|
|
|
&.is-placeholder {
|
|
|
|
|
|
color: var(--gray-400);
|
|
|
|
|
|
font-style: italic;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-09-06 14:04:33 +08:00
|
|
|
|
|
|
|
|
|
|
.edit-hint {
|
|
|
|
|
|
position: absolute;
|
2026-01-15 06:01:34 +08:00
|
|
|
|
top: -32px;
|
|
|
|
|
|
right: 0px;
|
2025-09-06 14:04:33 +08:00
|
|
|
|
font-size: 12px;
|
2026-01-15 06:01:34 +08:00
|
|
|
|
color: var(--main-800);
|
2025-09-06 14:04:33 +08:00
|
|
|
|
opacity: 0;
|
|
|
|
|
|
transition: opacity 0.2s ease;
|
2025-11-25 22:34:44 +08:00
|
|
|
|
background: var(--gray-0);
|
2025-09-06 14:04:33 +08:00
|
|
|
|
padding: 2px 6px;
|
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-08-22 23:17:48 +08:00
|
|
|
|
.config-select,
|
|
|
|
|
|
.config-input,
|
|
|
|
|
|
.config-input-number {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.config-slider {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-22 11:40:09 +08:00
|
|
|
|
// 选择器样式
|
|
|
|
|
|
.selection-container {
|
|
|
|
|
|
.selection-summary {
|
2025-08-22 23:17:48 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
align-items: center;
|
2026-02-02 21:44:10 +08:00
|
|
|
|
padding: 4px 10px;
|
|
|
|
|
|
background: var(--gray-0);
|
2025-08-22 23:17:48 +08:00
|
|
|
|
border-radius: 8px;
|
2026-02-02 21:44:10 +08:00
|
|
|
|
border: 1px solid var(--gray-150);
|
2025-08-22 23:17:48 +08:00
|
|
|
|
margin-bottom: 8px;
|
|
|
|
|
|
|
2026-01-22 11:40:09 +08:00
|
|
|
|
.selection-summary-info {
|
2025-08-22 23:17:48 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 8px;
|
|
|
|
|
|
font-size: 13px;
|
2025-10-02 19:59:35 +08:00
|
|
|
|
color: var(--gray-900);
|
2025-08-22 23:17:48 +08:00
|
|
|
|
|
2026-01-22 11:40:09 +08:00
|
|
|
|
.selection-count {
|
2025-08-22 23:17:48 +08:00
|
|
|
|
color: var(--gray-900);
|
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-22 11:40:09 +08:00
|
|
|
|
.selection-trigger-btn {
|
2025-10-02 19:59:35 +08:00
|
|
|
|
border-radius: 4px;
|
2025-08-22 23:17:48 +08:00
|
|
|
|
height: 28px;
|
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-22 11:40:09 +08:00
|
|
|
|
.selection-preview {
|
2025-08-22 23:17:48 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
|
gap: 6px;
|
|
|
|
|
|
|
2026-01-22 11:40:09 +08:00
|
|
|
|
.selection-tag {
|
2025-08-22 23:17:48 +08:00
|
|
|
|
margin: 0;
|
|
|
|
|
|
padding: 4px 8px;
|
2026-01-22 11:40:09 +08:00
|
|
|
|
border-radius: 8px;
|
2026-02-02 21:44:10 +08:00
|
|
|
|
background: var(--gray-150);
|
|
|
|
|
|
border: none;
|
2025-08-22 23:17:48 +08:00
|
|
|
|
color: var(--gray-900);
|
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
|
|
|
|
|
|
|
:deep(.anticon-close) {
|
|
|
|
|
|
color: var(--gray-600);
|
|
|
|
|
|
margin-left: 4px;
|
|
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
|
color: var(--gray-900);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 多选卡片样式
|
|
|
|
|
|
.multi-select-cards {
|
|
|
|
|
|
.multi-select-label {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
margin-bottom: 12px;
|
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
|
color: var(--gray-600);
|
2026-03-06 11:46:32 +08:00
|
|
|
|
|
|
|
|
|
|
.label-actions {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 4px;
|
|
|
|
|
|
}
|
2025-08-22 23:17:48 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.options-grid {
|
|
|
|
|
|
display: grid;
|
2026-05-24 00:47:08 +08:00
|
|
|
|
grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
|
2025-08-22 23:17:48 +08:00
|
|
|
|
gap: 8px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.option-card {
|
2026-05-24 00:47:08 +08:00
|
|
|
|
min-width: 0;
|
2025-08-22 23:17:48 +08:00
|
|
|
|
border: 1px solid var(--gray-300);
|
2025-11-25 22:34:44 +08:00
|
|
|
|
border-radius: 8px;
|
|
|
|
|
|
padding: 8px 12px;
|
2025-08-22 23:17:48 +08:00
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
transition: all 0.2s ease;
|
2025-11-23 01:39:44 +08:00
|
|
|
|
background: var(--gray-0);
|
2025-08-22 23:17:48 +08:00
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
|
border-color: var(--main-color);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
&.selected {
|
|
|
|
|
|
border-color: var(--main-color);
|
|
|
|
|
|
background: var(--main-10);
|
|
|
|
|
|
|
|
|
|
|
|
.option-indicator {
|
|
|
|
|
|
color: var(--main-color);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.option-text {
|
|
|
|
|
|
color: var(--main-color);
|
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
&.unselected {
|
|
|
|
|
|
.option-indicator {
|
|
|
|
|
|
color: var(--gray-400);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.option-text {
|
|
|
|
|
|
color: var(--gray-700);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.option-content {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 8px;
|
2026-05-24 00:47:08 +08:00
|
|
|
|
min-width: 0;
|
2025-08-22 23:17:48 +08:00
|
|
|
|
|
|
|
|
|
|
.option-text {
|
|
|
|
|
|
flex: 1;
|
2026-05-24 00:47:08 +08:00
|
|
|
|
min-width: 0;
|
2025-08-22 23:17:48 +08:00
|
|
|
|
font-size: 13px;
|
|
|
|
|
|
line-height: 1.4;
|
2026-05-24 00:47:08 +08:00
|
|
|
|
overflow-wrap: anywhere;
|
2025-08-22 23:17:48 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.option-indicator {
|
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
|
font-size: 14px;
|
2026-01-24 12:06:49 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
2025-08-22 23:17:48 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-22 11:40:09 +08:00
|
|
|
|
// 选择弹窗样式
|
|
|
|
|
|
.selection-modal {
|
|
|
|
|
|
.selection-modal-content {
|
|
|
|
|
|
.selection-search {
|
2025-08-22 23:17:48 +08:00
|
|
|
|
margin-bottom: 16px;
|
2026-03-06 11:46:32 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
gap: 8px;
|
|
|
|
|
|
align-items: center;
|
2025-08-22 23:17:48 +08:00
|
|
|
|
|
|
|
|
|
|
.search-input {
|
2026-03-06 11:46:32 +08:00
|
|
|
|
flex: 1;
|
2025-08-22 23:17:48 +08:00
|
|
|
|
border-radius: 8px;
|
|
|
|
|
|
border: 1px solid var(--gray-300);
|
|
|
|
|
|
height: 36px;
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
transition: all 0.2s ease;
|
2025-11-23 01:39:44 +08:00
|
|
|
|
background: var(--gray-0);
|
2025-08-22 23:17:48 +08:00
|
|
|
|
|
|
|
|
|
|
.search-icon {
|
|
|
|
|
|
color: var(--gray-500);
|
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
&:focus-within {
|
|
|
|
|
|
border-color: var(--main-color);
|
2026-03-20 03:21:52 +08:00
|
|
|
|
box-shadow: 0 0 0 2px rgba(1, 97, 121, 0.1);
|
2025-08-24 20:12:15 +08:00
|
|
|
|
|
2025-08-22 23:17:48 +08:00
|
|
|
|
.search-icon {
|
|
|
|
|
|
color: var(--main-color);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
|
border-color: var(--gray-400);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-22 11:40:09 +08:00
|
|
|
|
.selection-list {
|
2025-08-24 20:12:15 +08:00
|
|
|
|
display: grid;
|
|
|
|
|
|
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
|
|
|
|
|
|
gap: 12px;
|
2026-03-20 03:21:52 +08:00
|
|
|
|
max-height: 60vh;
|
2025-08-22 23:17:48 +08:00
|
|
|
|
overflow-y: auto;
|
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
|
margin-bottom: 16px;
|
2025-08-24 20:12:15 +08:00
|
|
|
|
|
|
|
|
|
|
// 在小屏幕下调整为单列布局
|
|
|
|
|
|
@media (max-width: 480px) {
|
|
|
|
|
|
grid-template-columns: 1fr;
|
|
|
|
|
|
}
|
2025-08-22 23:17:48 +08:00
|
|
|
|
|
2026-01-22 11:40:09 +08:00
|
|
|
|
.selection-item {
|
2025-08-22 23:17:48 +08:00
|
|
|
|
padding: 12px 16px;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
transition: all 0.2s ease;
|
|
|
|
|
|
border-radius: 8px;
|
2025-11-23 01:39:44 +08:00
|
|
|
|
background: var(--gray-0);
|
2025-08-22 23:17:48 +08:00
|
|
|
|
border: 1px solid var(--gray-200);
|
|
|
|
|
|
|
|
|
|
|
|
&:hover {
|
2025-08-24 20:12:15 +08:00
|
|
|
|
border-color: var(--gray-300);
|
|
|
|
|
|
background: var(--gray-20);
|
2025-08-22 23:17:48 +08:00
|
|
|
|
}
|
2026-01-22 11:40:09 +08:00
|
|
|
|
.selection-item-content {
|
|
|
|
|
|
.selection-item-header {
|
2025-08-22 23:17:48 +08:00
|
|
|
|
display: flex;
|
2025-08-24 20:12:15 +08:00
|
|
|
|
align-items: center;
|
2025-08-22 23:17:48 +08:00
|
|
|
|
gap: 8px;
|
|
|
|
|
|
|
2026-01-22 11:40:09 +08:00
|
|
|
|
.selection-item-name {
|
2025-08-22 23:17:48 +08:00
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
|
color: var(--gray-900);
|
|
|
|
|
|
line-height: 1.3;
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-22 11:40:09 +08:00
|
|
|
|
.selection-item-indicator {
|
2025-08-22 23:17:48 +08:00
|
|
|
|
color: var(--gray-400);
|
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
|
transition: all 0.2s ease;
|
|
|
|
|
|
flex-shrink: 0;
|
2026-01-24 12:06:49 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
2025-08-22 23:17:48 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-22 11:40:09 +08:00
|
|
|
|
.selection-item-description {
|
2025-08-22 23:17:48 +08:00
|
|
|
|
font-size: 12px;
|
|
|
|
|
|
color: var(--gray-600);
|
|
|
|
|
|
line-height: 1.4;
|
2026-01-22 11:40:09 +08:00
|
|
|
|
margin-top: 6px;
|
2025-08-22 23:17:48 +08:00
|
|
|
|
display: -webkit-box;
|
2026-03-18 20:01:09 +08:00
|
|
|
|
line-clamp: 2;
|
2025-08-22 23:17:48 +08:00
|
|
|
|
-webkit-line-clamp: 2;
|
|
|
|
|
|
-webkit-box-orient: vertical;
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-08-24 20:12:15 +08:00
|
|
|
|
|
|
|
|
|
|
&.selected {
|
2026-01-22 11:40:09 +08:00
|
|
|
|
background: var(--main-10);
|
|
|
|
|
|
border-color: var(--main-color);
|
2025-08-24 20:12:15 +08:00
|
|
|
|
|
2026-01-22 11:40:09 +08:00
|
|
|
|
.selection-item-content {
|
|
|
|
|
|
.selection-item-name {
|
2025-11-25 22:34:44 +08:00
|
|
|
|
color: var(--main-800);
|
2025-08-24 20:12:15 +08:00
|
|
|
|
}
|
2026-01-22 11:40:09 +08:00
|
|
|
|
.selection-item-indicator {
|
2025-11-25 22:34:44 +08:00
|
|
|
|
color: var(--main-800);
|
2025-08-24 20:12:15 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2026-01-22 11:40:09 +08:00
|
|
|
|
.selection-item-description {
|
2025-11-25 22:34:44 +08:00
|
|
|
|
color: var(--gray-900);
|
2025-08-24 20:12:15 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-08-22 23:17:48 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-22 11:40:09 +08:00
|
|
|
|
.selection-modal-footer {
|
2025-08-22 23:17:48 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
padding-top: 16px;
|
|
|
|
|
|
border-top: 1px solid var(--gray-200);
|
|
|
|
|
|
|
|
|
|
|
|
.selected-count {
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
color: var(--gray-700);
|
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
|
padding: 6px 12px;
|
|
|
|
|
|
background: var(--gray-50);
|
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
|
border: 1px solid var(--gray-200);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.modal-actions {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
gap: 12px;
|
|
|
|
|
|
|
|
|
|
|
|
:deep(.ant-btn) {
|
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
|
height: 36px;
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
|
padding: 0 16px;
|
|
|
|
|
|
transition: all 0.2s ease;
|
|
|
|
|
|
|
|
|
|
|
|
&.ant-btn-default {
|
|
|
|
|
|
border: 1px solid var(--gray-300);
|
|
|
|
|
|
color: var(--gray-700);
|
2025-11-23 01:39:44 +08:00
|
|
|
|
background: var(--gray-0);
|
2025-08-22 23:17:48 +08:00
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
|
border-color: var(--main-color);
|
|
|
|
|
|
color: var(--main-color);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
&.ant-btn-primary {
|
|
|
|
|
|
background: var(--main-color);
|
|
|
|
|
|
border: none;
|
2025-11-23 01:39:44 +08:00
|
|
|
|
color: var(--gray-0);
|
2025-08-22 23:17:48 +08:00
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
|
background: var(--main-color);
|
|
|
|
|
|
opacity: 0.9;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-03-18 20:01:09 +08:00
|
|
|
|
.system-prompt-modal {
|
|
|
|
|
|
.system-prompt-modal-content {
|
|
|
|
|
|
.system-prompt-modal-input {
|
|
|
|
|
|
resize: vertical;
|
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
|
line-height: 1.6;
|
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-12-30 19:01:45 +08:00
|
|
|
|
.clear-btn {
|
|
|
|
|
|
padding: 0;
|
|
|
|
|
|
height: auto;
|
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
color: var(--main-700);
|
|
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
|
color: var(--main-800);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-03-20 03:21:52 +08:00
|
|
|
|
.inline-action-btn {
|
|
|
|
|
|
padding: 2px 6px;
|
|
|
|
|
|
height: auto;
|
|
|
|
|
|
line-height: 1;
|
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
|
color: var(--gray-600);
|
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
|
color: var(--main-color);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.selection-search .inline-action-btn {
|
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
|
}
|
2025-10-14 01:46:43 +08:00
|
|
|
|
</style>
|