6363 <el-button @click =" close" >{{ $t('common.cancel') }}</el-button >
6464 <el-button type =" primary" @click =" run" > {{ $t('views.tool.form.debug.run') }}</el-button >
6565 </template >
66- <ResultDrawer ref =" ToolResultDrawerRef" />
66+ <ResultDrawer @close = " closeResult " :key = " index " ref =" ToolResultDrawerRef" />
6767 </el-drawer >
6868</template >
6969<script setup lang="ts">
@@ -73,7 +73,8 @@ import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
7373import JsonInput from ' @/components/dynamics-form/items/JsonInput.vue'
7474import { type FormInstance } from ' element-plus'
7575import ResultDrawer from ' ./ResultDrawer.vue'
76-
76+ import { number } from ' echarts'
77+ const index = ref <number >(0 )
7778const route = useRoute ()
7879const {
7980 params : { folderId },
@@ -103,7 +104,9 @@ const userInputFieldList = computed(() => {
103104 ?.properties ?.user_input_field_list || []
104105 )
105106})
106-
107+ const closeResult = () => {
108+ index .value ++
109+ }
107110function getDetail(toolId : string ) {
108111 loadSharedApi ({ type: ' tool' , isShared: isShared .value , systemType: apiType .value })
109112 .getToolById (toolId )
@@ -117,10 +120,14 @@ const userInputForm = ref<any>({})
117120const ToolResultDrawerRef = ref ()
118121
119122const run = () => {
120- formRef .value ?.validate ((valid : boolean ) => {
121- if (! valid ) return
123+ if (userInputFieldList .value .length === 0 ) {
122124 ToolResultDrawerRef .value ?.open (toolDetail .value .id , userInputForm .value )
123- })
125+ } else {
126+ formRef .value ?.validate ((valid : boolean ) => {
127+ if (! valid ) return
128+ ToolResultDrawerRef .value ?.open (toolDetail .value .id , userInputForm .value )
129+ })
130+ }
124131}
125132
126133const drawer = ref <boolean >(false )
0 commit comments