Skip to content

Commit 547b2bd

Browse files
committed
fix: 开启文件上传开关时设置默认值
--bug=1049087 --user=刘瑞斌 【应用编排】开启文件上传后,全局变量列表没有自动生成文件变量 https://www.tapd.cn/57709429/s/1612303
1 parent a28b55b commit 547b2bd

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

ui/src/workflow/nodes/base-node/index.vue

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
<Setting />
7171
</el-icon>
7272
</el-button>
73-
<el-switch size="small" v-model="form_data.file_upload_enable"/>
73+
<el-switch size="small" v-model="form_data.file_upload_enable" @change="switchFileUpload"/>
7474
</div>
7575
</div>
7676
</template>
@@ -382,6 +382,22 @@ const refreshTTSForm = (data: any) => {
382382
form_data.value.tts_model_params_setting = data
383383
}
384384
385+
386+
const switchFileUpload = () => {
387+
const default_upload_setting = {
388+
maxFiles: 3,
389+
fileLimit: 50,
390+
document: true,
391+
image: false,
392+
audio: false,
393+
video: false
394+
}
395+
396+
if (form_data.value.file_upload_enable) {
397+
form_data.value.file_upload_setting = form_data.value.file_upload_setting || default_upload_setting
398+
props.nodeModel.graphModel.eventCenter.emit('refreshFileUploadConfig')
399+
}
400+
}
385401
const openFileUploadSettingDialog = () => {
386402
FileUploadSettingDialogRef.value?.open(form_data.value.file_upload_setting)
387403
}

0 commit comments

Comments
 (0)