refactor(项目设置): 公共脚本执行过程优化

This commit is contained in:
fit2-zhao 2024-03-07 12:28:20 +08:00 committed by Craftsman
parent 294a017bdf
commit 9969a973e0
1 changed files with 3 additions and 0 deletions

View File

@ -56,6 +56,7 @@
v-permission="['PROJECT_CUSTOM_FUNCTION:READ+EXECUTE']" v-permission="['PROJECT_CUSTOM_FUNCTION:READ+EXECUTE']"
type="outline" type="outline"
:loading="loading" :loading="loading"
:disabled="!form.script"
@click="testScript" @click="testScript"
>{{ t('project.commonScript.scriptTest') }}</a-button >{{ t('project.commonScript.scriptTest') }}</a-button
> >
@ -267,6 +268,7 @@
} }
function debugSocket() { function debugSocket() {
loading.value = true;
websocket.value = getSocket(reportId.value); websocket.value = getSocket(reportId.value);
websocket.value.onopen = onOpen; websocket.value.onopen = onOpen;
websocket.value.addEventListener('message', (event: any) => { websocket.value.addEventListener('message', (event: any) => {
@ -275,6 +277,7 @@
form.value.result = result.taskResult.console; form.value.result = result.taskResult.console;
scriptType.value = 'executionResult'; scriptType.value = 'executionResult';
websocket.value.close(); websocket.value.close();
loading.value = false;
} }
}); });
} }