fix: update InitParamDrawer to handle is_active state in open method

--bug=1053998 --user=刘瑞斌 【函数库】首次开启函数并设置启动参数失败 https://www.tapd.cn/57709429/s/1677086
This commit is contained in:
CaptainB 2025-03-27 11:00:23 +08:00
parent f82ba3c4b8
commit 286552d54b
2 changed files with 5 additions and 9 deletions

View File

@ -48,9 +48,6 @@ const emit = defineEmits(['refresh'])
const dynamicsFormRef = ref()
const loading = ref(false)
const debugVisible = ref(false)
const showResult = ref(false)
const isSuccess = ref(false)
const result = ref('')
const form = ref<any>({
init_params: {}
@ -58,11 +55,9 @@ const form = ref<any>({
watch(debugVisible, (bool) => {
if (!bool) {
showResult.value = false
isSuccess.value = false
result.value = ''
form.value = {
init_params: {}
init_params: {},
is_active: false
}
}
})
@ -78,9 +73,10 @@ const submit = async () => {
})
}
const open = (data: any) => {
const open = (data: any, is_active: boolean) => {
if (data) {
form.value = cloneDeep(data)
form.value.is_active = is_active
}
const init_params = form.value.init_field_list
.map((item: any) => {

View File

@ -405,7 +405,7 @@ async function changeState(bool: Boolean, row: any) {
} else {
const res = await functionLibApi.getFunctionLibById(row.id, changeStateloading)
if (!res.data.init_params && res.data.init_field_list && res.data.init_field_list.length > 0) {
InitParamDrawerRef.value.open(res.data)
InitParamDrawerRef.value.open(res.data, bool)
row.is_active = false
return
}