Skip to content

Commit 4ade65e

Browse files
fix: style optimize
1 parent c4c0ba0 commit 4ade65e

File tree

2 files changed

+30
-4
lines changed

2 files changed

+30
-4
lines changed

ui/src/components/dynamics-form/items/upload/UploadInput.vue

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@
88
:on-change="(file: any, fileList: any) => uploadFile(file, fileList)"
99
v-model:file-list="model_value"
1010
multiple
11+
:show-file-list="false"
1112
>
1213
<el-button type="primary">{{ $t('chat.uploadFile.label') }}</el-button>
13-
<template #file="{ file }">
14-
<el-card style="--el-card-padding: 0" shadow="never" class="upload_content">
14+
</el-upload>
15+
<el-space wrap class="w-full media-file-width upload_content mt-16">
16+
<template v-for="(file, index) in model_value" :key="index">
17+
<el-card style="--el-card-padding: 0" shadow="never">
1518
<div
1619
class="flex-between"
1720
:class="[inputDisabled ? 'is-disabled' : '']"
@@ -33,7 +36,7 @@
3336
</div>
3437
</el-card>
3538
</template>
36-
</el-upload>
39+
</el-space>
3740
</template>
3841
<script setup lang="ts">
3942
import { computed, inject, ref, useAttrs } from 'vue'
@@ -122,5 +125,28 @@ const uploadFile = async (file: any, fileList: Array<any>) => {
122125
cursor: not-allowed;
123126
}
124127
}
128+
&.media-file-width {
129+
:deep(.el-space__item) {
130+
width: calc(50% - 4px) !important;
131+
}
132+
}
133+
}
134+
@media only screen and (max-width: 768px) {
135+
.upload_content {
136+
&.media-file-width {
137+
:deep(.el-space__item) {
138+
min-width: 100% !important;
139+
}
140+
}
141+
}
142+
}
143+
.debug-ai-chat {
144+
.upload_content {
145+
&.media-file-width {
146+
:deep(.el-space__item) {
147+
min-width: 100% !important;
148+
}
149+
}
150+
}
125151
}
126152
</style>

ui/src/views/tool/ToolFormDrawer.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ function submitCodemirrorEditor(val: string) {
335335
}
336336
337337
function close() {
338-
if (isEdit.value || !areAllValuesNonEmpty(form.value)) {
338+
if (!areAllValuesNonEmpty(form.value)) {
339339
visible.value = false
340340
} else {
341341
MsgConfirm(t('common.tip'), t('views.tool.tip.saveMessage'), {

0 commit comments

Comments
 (0)