Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion ui/src/components/business/folder-tree/MoveToDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ const emit = defineEmits<{ submit: [targetFolderId: string] }>()

const visible = ref(false)
const selectedTargetId = ref<string>(FOLDER_ENTRY_ID.ALL)
const initialFolderId = ref<string>(FOLDER_ENTRY_ID.ALL)

const canSubmit = computed(() => Boolean(selectedTargetId.value) && selectedTargetId.value !== FOLDER_ENTRY_ID.ALL)
const canSubmit = computed(
() => Boolean(selectedTargetId.value) && selectedTargetId.value !== FOLDER_ENTRY_ID.ALL && selectedTargetId.value !== initialFolderId.value,
)

/* 移动提交 */
function handleSubmit() {
Expand All @@ -22,11 +25,13 @@ function handleSubmit() {
}

function open(currentFolderId = FOLDER_ENTRY_ID.ALL) {
initialFolderId.value = currentFolderId
selectedTargetId.value = currentFolderId
visible.value = true
}

function resetData() {
initialFolderId.value = FOLDER_ENTRY_ID.ALL
selectedTargetId.value = FOLDER_ENTRY_ID.ALL
}

Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/business/folder-tree/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ const movingFolder = ref<FolderItem>()

function handleOpenMoveFolder(folder: FolderItem) {
movingFolder.value = folder
moveToDialogRef.value?.open(folder.parent_id ?? FOLDER_ENTRY_ID.ALL)
moveToDialogRef.value?.open(folder.id ?? FOLDER_ENTRY_ID.ALL)
}

function handleMoveFolder(targetFolderId: string) {
Expand Down
9 changes: 5 additions & 4 deletions ui/src/components/mk-echart/LineCharts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { computed } from 'vue'
import { use, type ComposeOption } from 'echarts/core'
import { LineChart, type LineSeriesOption } from 'echarts/charts'
import { LegacyGridContainLabel } from 'echarts/features'
import {
GridComponent,
LegendComponent,
Expand All @@ -14,7 +15,7 @@ import { numberFormat } from '@/utils/number'
import MkEchart from './index.vue'
import type { MkLineChartOption } from './types'

use([LineChart, GridComponent, LegendComponent, TooltipComponent])
use([LineChart, GridComponent, LegendComponent, TooltipComponent, LegacyGridContainLabel])
defineOptions({ name: 'MkLineChart' })
const props = withDefaults(
defineProps<{
Expand Down Expand Up @@ -44,15 +45,15 @@ const chartOption = computed<LineOption>(() => ({
itemHeight: 8,
textStyle: { color: '#646A73' },
},
// 为居中显示的日期预留两端空间,避免裁切或挤掉相邻标签。
grid: { left: 0, right: 0, top: 56, bottom: 0, outerBoundsMode: 'same', outerBoundsContain: 'axisLabel' },
// 保留纵轴和底部标签空间,右端日期超出画布时直接裁切。
grid: { left: 0, right: 0, top: 56, bottom: 0, containLabel: true },
xAxis: {
type: 'category',
data: props.option.xData,
boundaryGap: false,
axisLine: { lineStyle: { color: '#EFF0F1' } },
axisTick: { show: false },
axisLabel: { color: '#646A73', margin: 16 },
axisLabel: { color: '#646A73', margin: 16, align: 'left' },
},
yAxis: {
type: 'value',
Expand Down
21 changes: 14 additions & 7 deletions ui/src/views/application-detail/setting/index.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed, onMounted, provide, ref, useTemplateRef, watch } from 'vue'
import { cloneDeep } from 'lodash'
import type { FormInstance } from 'element-plus'
import type { FormInstance, FormItemRule } from 'element-plus'
import type { ResourceDetailPageProps } from '@/layout/ResourceDetailLayout.vue'
import type { ApplicationDetail, ModelItem, ModelProviderItem, ToolItem } from '@/api/types'
import ModelApi from '@/api/admin/workspace/model'
Expand Down Expand Up @@ -97,6 +97,12 @@ watch(
)

/* 长期记忆配置确认后合并到表单草稿。 */
// 固定校验规则,避免启用开关时因规则变化提前校验;保存、发布时仍检查模型。
const longTermModelRule: FormItemRule = {
validator: (_rule, value, callback) => {
callback(settings.value.long_term_enable && !value ? new Error('请选择长期记忆模型') : undefined)
},
}
const longTermSetting = computed<LongTermSettingData>({
get: (): LongTermSettingData => ({
long_term_model_id: settings.value.long_term_model_id,
Expand Down Expand Up @@ -419,11 +425,7 @@ onMounted(() => {
</template>
<div class="p-2">
<!-- 长期记忆 -->
<el-form-item
class="mk-hide-asterisk mb-2!"
prop="long_term_model_id"
:rules="{ required: settings.long_term_enable, message: '请选择长期记忆模型', trigger: 'change' }"
>
<el-form-item class="mk-hide-asterisk mb-2!" prop="long_term_model_id" :rules="longTermModelRule">
<template #label>
<div class="flex-between">
<span class="flex-align-center gap-1">
Expand All @@ -443,7 +445,12 @@ onMounted(() => {
:model-options="llmModels"
:provider-options="providerOptions"
/>
<el-switch v-model="settings.long_term_enable" size="small" />
<el-switch
v-model="settings.long_term_enable"
size="small"
:validate-event="false"
@change="formRef?.clearValidate('long_term_model_id')"
/>
</span>
</div>
</template>
Expand Down
2 changes: 2 additions & 0 deletions ui/src/workflow-canvas/core/node-container/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ watch(enable_exception, () => {
})

const openNodeMenu = (anchorValue: Model.AnchorConfig) => {
// 将所属节点置顶,避免添加菜单被其他节点遮挡。
model.graphModel.toFront(model.id)
nodeMenuDragClosing.value = false
showAnchor.value = true
anchorData.value = anchorValue
Expand Down
4 changes: 4 additions & 0 deletions ui/src/workflow-canvas/icons/output-icon.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<template>
<img src="@/assets/workflow/icon_global-variables_color.svg" style="width: 16px" alt="" />
</template>
<script setup lang="ts"></script>
Loading