From 2a88651610d74c20b17f695b737e5325dadcd607 Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Tue, 17 Dec 2024 17:36:58 +0800 Subject: [PATCH] perf: Optimize markdown image style --- ui/src/styles/element-plus.scss | 6 +++ ui/src/styles/md-editor.scss | 9 +++++ ui/src/views/application/index.vue | 32 ++++++++-------- .../template/component/CreateModelDialog.vue | 37 +++++++++++++------ 4 files changed, 57 insertions(+), 27 deletions(-) diff --git a/ui/src/styles/element-plus.scss b/ui/src/styles/element-plus.scss index 683936874..251671f0b 100644 --- a/ui/src/styles/element-plus.scss +++ b/ui/src/styles/element-plus.scss @@ -31,6 +31,12 @@ border: none; } } +.el-button--text { + border: none !important; + &:focus { + border: none !important; + } +} .el-button--large { font-size: 16px; } diff --git a/ui/src/styles/md-editor.scss b/ui/src/styles/md-editor.scss index 06a6ab887..ad41acae9 100644 --- a/ui/src/styles/md-editor.scss +++ b/ui/src/styles/md-editor.scss @@ -14,6 +14,15 @@ } img { border: 0 !important; + max-width: 360px !important; + } +} + +@media only screen and (max-width: 768px) { + .md-editor-preview { + img { + max-width: 100% !important; + } } } diff --git a/ui/src/views/application/index.vue b/ui/src/views/application/index.vue index 468c2fbd2..ad21e3be1 100644 --- a/ui/src/views/application/index.vue +++ b/ui/src/views/application/index.vue @@ -5,7 +5,7 @@
app.id === id)[0]?.work_flow?.nodes - ?.filter((v: any) => v.id === 'base-node') - .map((v: any) => { - apiInputParams.value = v.properties.api_input_field_list - ? v.properties.api_input_field_list - .map((v: any) => { - return { - name: v.variable, - value: v.default_value - } - }) - : v.properties.input_field_list + applicationList.value + .filter((app) => app.id === id)[0] + ?.work_flow?.nodes?.filter((v: any) => v.id === 'base-node') + .map((v: any) => { + apiInputParams.value = v.properties.api_input_field_list + ? v.properties.api_input_field_list.map((v: any) => { + return { + name: v.variable, + value: v.default_value + } + }) + : v.properties.input_field_list ? v.properties.input_field_list .filter((v: any) => v.assignment_method === 'api_input') .map((v: any) => { @@ -296,9 +296,11 @@ function getAccessToken(id: string) { } }) : [] - }) + }) - const apiParams = mapToUrlParams(apiInputParams.value) ? '?' + mapToUrlParams(apiInputParams.value) : '' + const apiParams = mapToUrlParams(apiInputParams.value) + ? '?' + mapToUrlParams(apiInputParams.value) + : '' application.asyncGetAccessToken(id, loading).then((res: any) => { window.open(application.location + res?.data?.access_token + apiParams) }) diff --git a/ui/src/views/template/component/CreateModelDialog.vue b/ui/src/views/template/component/CreateModelDialog.vue index de8537e60..282f64501 100644 --- a/ui/src/views/template/component/CreateModelDialog.vue +++ b/ui/src/views/template/component/CreateModelDialog.vue @@ -88,7 +88,9 @@