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:
parent
f82ba3c4b8
commit
286552d54b
@ -48,9 +48,6 @@ const emit = defineEmits(['refresh'])
|
|||||||
const dynamicsFormRef = ref()
|
const dynamicsFormRef = ref()
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const debugVisible = ref(false)
|
const debugVisible = ref(false)
|
||||||
const showResult = ref(false)
|
|
||||||
const isSuccess = ref(false)
|
|
||||||
const result = ref('')
|
|
||||||
|
|
||||||
const form = ref<any>({
|
const form = ref<any>({
|
||||||
init_params: {}
|
init_params: {}
|
||||||
@ -58,11 +55,9 @@ const form = ref<any>({
|
|||||||
|
|
||||||
watch(debugVisible, (bool) => {
|
watch(debugVisible, (bool) => {
|
||||||
if (!bool) {
|
if (!bool) {
|
||||||
showResult.value = false
|
|
||||||
isSuccess.value = false
|
|
||||||
result.value = ''
|
|
||||||
form.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) {
|
if (data) {
|
||||||
form.value = cloneDeep(data)
|
form.value = cloneDeep(data)
|
||||||
|
form.value.is_active = is_active
|
||||||
}
|
}
|
||||||
const init_params = form.value.init_field_list
|
const init_params = form.value.init_field_list
|
||||||
.map((item: any) => {
|
.map((item: any) => {
|
||||||
|
|||||||
@ -405,7 +405,7 @@ async function changeState(bool: Boolean, row: any) {
|
|||||||
} else {
|
} else {
|
||||||
const res = await functionLibApi.getFunctionLibById(row.id, changeStateloading)
|
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) {
|
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
|
row.is_active = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user