Skip to content

Commit ed0fa0d

Browse files
committed
fix: [Trigger] After referencing the event request parameters in the agent parameters of an event trigger, and changing the trigger type to a timed trigger, it becomes impossible to input parameter values.
1 parent d1c2def commit ed0fa0d

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

ui/src/views/trigger/component/ToolParameter.vue

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,34 @@
6060
</el-form>
6161
</template>
6262
<script setup lang="ts">
63-
import { computed, ref } from 'vue'
63+
import { computed, ref, watch } from 'vue'
6464
import { type FormInstance } from 'element-plus'
6565
const toolParameterFormRef = ref<FormInstance>()
6666
const props = defineProps<{ tool?: any; modelValue: any; trigger: any }>()
6767
const emit = defineEmits(['update:modelValue'])
68+
const showSource = computed(() => {
69+
return props.trigger.trigger_type === 'EVENT' && props.trigger.trigger_setting.body.length > 0
70+
})
6871
72+
watch(
73+
() => showSource.value,
74+
() => {
75+
if (!showSource.value) {
76+
const parameter: any = {}
77+
input_field_list.value.forEach((f) => {
78+
if (props.modelValue[f.field]) {
79+
parameter[f.field] = {
80+
...props.modelValue[f.field],
81+
source: 'custom',
82+
}
83+
} else {
84+
parameter[f.field] = { source: 'custom', value: f.default_value }
85+
}
86+
})
87+
emit('update:modelValue', { ...parameter })
88+
}
89+
},
90+
)
6991
const options = computed(() => {
7092
if (props.trigger.trigger_type === 'EVENT') {
7193
const body = props.trigger.trigger_setting.body

0 commit comments

Comments
 (0)