wujingjing
2025-02-17 4ccab78831409decc3148668449dedc778380f07
Node 宽度基本一致
已修改9个文件
94 ■■■■■ 文件已修改
src/components/vue-flow/ui/nodes/AgentNode.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/vue-flow/ui/nodes/AnalysisNode.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/vue-flow/ui/nodes/FuncNode.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/vue-flow/ui/nodes/LLMNode.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/vue-flow/ui/nodes/OutputNode.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/vue-flow/ui/nodes/StartNode.vue 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/vue-flow/ui/nodes/components/FieldLayout.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/vue-flow/ui/nodes/components/NodeBasicLayout.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vite.config.ts 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/vue-flow/ui/nodes/AgentNode.vue
@@ -9,7 +9,7 @@
        <FieldLayout :title="VueFlowHelper.getConfigValue(VueFlowHelper.getGroupParam(data), 'name', '代理名称')">
            <el-select
                class="w-[340px]"
                class="w-full"
                filterable
                :disabled="isViewMode"
                :placeholder="VueFlowHelper.getConfigValue(agentParams, 'placeholder', '代理名称')"
src/components/vue-flow/ui/nodes/AnalysisNode.vue
@@ -2,7 +2,7 @@
    <NodeBasicLayout v-model:title="data.title" :type="NodeType.Analysis" :isViewMode="isViewMode">
        <Handle :id="targetHandleId" type="target" :position="Position.Left" />
        <FieldLayout :title="modelSetting.name">
            <div class="w-[340px] flex-items-center gap-x-2">
            <div class="w-full flex-items-center gap-x-2">
                <div class="flex-column gap-y-1.5">
                    <span class="text-gray-500">{{ VueFlowHelper.getParams(modelSetting, 'llm_model').label }}</span>
@@ -24,7 +24,8 @@
                    <el-input-number
                        :readonly="isViewMode"
                        v-model="VueFlowHelper.getParams(modelSetting, 'temperature').value"
                        class="w-[180px]"
                        class="w-full"
                        controls-position="right"
                        placeholder=""
                    ></el-input-number>
                </div>
src/components/vue-flow/ui/nodes/FuncNode.vue
@@ -3,7 +3,7 @@
        <Handle :id="targetHandleId" type="target" :position="Position.Left" />
        <FieldLayout :title="VueFlowHelper.getConfigValue(VueFlowHelper.getGroupParam(data), 'name', '函数名称')">
            <el-select
                class="w-[340px]"
                class="w-full"
                filterable
                :placeholder="funcNameParams.placeholder"
                v-model="funcNameParams.value"
src/components/vue-flow/ui/nodes/LLMNode.vue
@@ -8,7 +8,7 @@
        <Handle :id="targetHandleId" type="target" :position="Position.Left" />
        <FieldLayout :title="VueFlowHelper.getConfigValue(modelSetting, 'name', '模型设置')">
            <div class="w-[340px] flex-items-center gap-x-2">
            <div class="w-full flex-items-center gap-x-2">
                <div class="flex-column gap-y-1.5">
                    <span class="text-gray-500">{{ VueFlowHelper.getParams(modelSetting, 'llm_model').label }}</span>
                    <el-tree-select
@@ -27,8 +27,9 @@
                <div class="flex-column gap-y-1.5">
                    <span class="text-gray-500">{{ VueFlowHelper.getParams(modelSetting, 'temperature').label }}</span>
                    <el-input-number
                        class="w-full"
                        controls-position="right"
                        v-model="VueFlowHelper.getParams(modelSetting, 'temperature').value"
                        class="w-[180px]"
                        :readonly="isViewMode"
                        placeholder=""
                    ></el-input-number>
src/components/vue-flow/ui/nodes/OutputNode.vue
@@ -1,6 +1,5 @@
<template>
    <NodeBasicLayout
        :maxWidth="520"
        v-model:title="data.title"
        :type="NodeType.Output"
        :description="VueFlowHelper.getConfigValue(data, 'description', '可向用户发送消息...')"
@@ -21,6 +20,8 @@
                v-model="VueFlowHelper.getParams(outputParams, 'output_result').value.type"
                @change="interactionTypeChange"
                :disabled="isViewMode"
                class="flex-items-center justify-between interaction-radio-group"
            >
                <el-radio v-for="item in Object.keys(interactionTypeMap)" :key="item" :value="item">
                    {{ interactionTypeMap[item] }}
@@ -152,3 +153,10 @@
const isEditStatus = ref(false);
const tmpEditValue = ref('');
</script>
<style scoped lang="scss">
.interaction-radio-group {
    :deep(.el-radio) {
        margin-right: 0;
    }
}
</style>
src/components/vue-flow/ui/nodes/StartNode.vue
@@ -6,52 +6,27 @@
        :isViewMode="isViewMode"
    >
        <FieldLayout :title="VueFlowHelper.getConfigValue(varListConfig, 'name', '流程参数')">
            <el-table class="flex-auto" :data="varList" border>
                <el-table-column prop="name" width="170" label="参数名" fixed>
                    <template #default="scope">
                        <el-input v-model="scope.row.name" :readonly="isViewMode"></el-input>
            <div v-for="(item, index) in varList" :key="index" class="group/varItem">
                <FieldLayout level="2" title="参数名">
                    <template #right v-if="!isViewMode">
                        <span
                            class="ywifont ywicon-shanchu text-red-400 invisible group-hover/varItem:visible cursor-pointer"
                            @click="handleClickDeleteBtn(index)"
                        ></span>
                    </template>
                </el-table-column>
                <!-- <el-table-column prop="type" width="220" label="类型">
                    <template #default="scope">
                        <el-select v-model="scope.row.type">
                            <el-option
                                v-for="item in Object.keys(parameterTypeMap)"
                                :key="item"
                                :value="item"
                                :label="parameterTypeMap[item]"
                            ></el-option>
                        </el-select>
                    </template>
                </el-table-column> -->
                <el-table-column prop="description" width="380" label="描述">
                    <template #default="scope">
                        <el-input
                            class="nowheel"
                            type="textarea"
                            :autosize="{ minRows: 1, maxRows: 6 }"
                            v-model="scope.row.description"
                            :readonly="isViewMode"
                        ></el-input>
                    </template>
                </el-table-column>
                <!-- <el-table-column prop="isRequired" width="56" label="必填">
                    <template #default="scope">
                        <el-checkbox v-model="scope.row.isRequired"></el-checkbox>
                    </template>
                </el-table-column> -->
                    <el-input v-model="item.name" :readonly="isViewMode"></el-input>
                </FieldLayout>
                <FieldLayout level="2" title="描述">
                    <el-input
                        class="nowheel"
                        type="textarea"
                        :autosize="{ minRows: 2, maxRows: 6 }"
                        v-model="item.description"
                        :readonly="isViewMode"
                    ></el-input>
                </FieldLayout>
            </div>
                <el-table-column label="操作" width="55" fixed="right" v-if="!isViewMode">
                    <template #default="scope">
                        <el-tooltip effect="dark" content="删除" placement="top">
                            <i
                                class="ywifont ywicon-shanchu !text-[17px] text-red-400 cursor-pointer"
                                @click="handleClickDeleteBtn(scope.$index)"
                            ></i>
                        </el-tooltip>
                    </template>
                </el-table-column>
            </el-table>
            <el-button v-if="!isViewMode" class="w-fit" type="primary" @click="handleClickAddBtn">添加参数</el-button>
        </FieldLayout>
        <Handle :id="handleId" type="source" :position="Position.Right" />
src/components/vue-flow/ui/nodes/components/FieldLayout.vue
@@ -1,7 +1,7 @@
<template>
    <div class="flex flex-col" :class="[`gap-${gapLen}`]">
        <div class="flex-items-center justify-between">
            <div class="text-base" :class="[level === '1' ? 'font-bold' : 'text-secondary']">{{ title }}</div>
            <div class="text-base" :class="[level === '1' ? 'font-bold' : 'text-secondary font-bold']">{{ title }}</div>
            <div class="flex-items-center gap-3" v-if="$slots.right">
                <slot name="right"></slot>
            </div>
src/components/vue-flow/ui/nodes/components/NodeBasicLayout.vue
@@ -1,6 +1,6 @@
<template>
    <div
        :style="{ maxHeight: `${maxHeight}px`, maxWidth: `${maxWidth}px`, minHeight: `${minHeight}px`, minWidth: minWidth }"
        :style="{ maxHeight: `${maxHeight}px`, maxWidth: `${maxWidth}px`, minHeight: `${minHeight}px`, minWidth: `320px` }"
        class="order-2 rounded-lg border-solid border-gray-100 bg-white p-3 shadow-md relative hover:border-blue-500 group h-fit"
    >
        <div
@@ -74,7 +74,6 @@
const props = defineProps({
    maxWidth: { type: Number },
    maxHeight: { type: Number },
    minWidth: { type: Number },
    minHeight: { type: Number },
    type: { type: String as PropType<NodeType>, required: true },
    description: { type: String },
vite.config.ts
@@ -45,7 +45,7 @@
            host: '0.0.0.0',
            port: env.VITE_PORT as unknown as number,
            open: JSON.parse(env.VITE_OPEN),
            hmr: false,
            hmr: true,
            proxy: {
                '/gitee': {
                    target: 'https://gitee.com',