diff --git a/dbm-ui/frontend/src/locales/zh-cn.json b/dbm-ui/frontend/src/locales/zh-cn.json
index 569ac4af87..00a7ec1ffb 100644
--- a/dbm-ui/frontend/src/locales/zh-cn.json
+++ b/dbm-ui/frontend/src/locales/zh-cn.json
@@ -3655,5 +3655,8 @@
"全站搜索,支持多对象,Shift + Enter 换行,Enter键开启搜索": "全站搜索,支持多对象,Shift + Enter 换行,Enter键开启搜索",
"全站搜索,支持多对象,Enter开启搜索": "全站搜索,支持多对象,Enter开启搜索",
"同主机关联的其他集群,勾选后一并添加": "同主机关联的其他集群,勾选后一并添加",
+ "点击上传": "点击上传",
+ "请选择本地 SQL 文件": "请选择本地 SQL 文件",
"这行勿动!新增翻译请在上一行添加!": ""
+
}
diff --git a/dbm-ui/frontend/src/views/db-manage/common/sql-execute/common/RenderSql/components/sql-content/components/RenderFileList.vue b/dbm-ui/frontend/src/views/db-manage/common/sql-execute/common/RenderSql/components/sql-content/components/RenderFileList.vue
index 8878440965..a8260f8e60 100644
--- a/dbm-ui/frontend/src/views/db-manage/common/sql-execute/common/RenderSql/components/sql-content/components/RenderFileList.vue
+++ b/dbm-ui/frontend/src/views/db-manage/common/sql-execute/common/RenderSql/components/sql-content/components/RenderFileList.vue
@@ -163,10 +163,12 @@
watch(
filenameList,
() => {
- localList.value = filenameList.value.map((fileName) => ({
- id: fileName,
- name: fileName,
- }));
+ if (filenameList.value.length) {
+ localList.value = filenameList.value.map((fileName) => ({
+ id: fileName,
+ name: fileName,
+ }));
+ }
},
{
immediate: true,
@@ -182,6 +184,7 @@
};
const handleRemove = (filename: string) => {
+ modelValue.value = filename;
const lastesfilenameList = [...filenameList.value];
_.remove(lastesfilenameList, (item) => item === filename);
filenameList.value = lastesfilenameList;
@@ -208,18 +211,18 @@
.sql-execute-render-file-list {
height: 100%;
- border-right: 1px solid #3d3d40;
background: #2e2e2e;
+ border-right: 1px solid #3d3d40;
.file-list-header {
+ display: flex;
height: 40px;
padding: 0 16px;
+ margin-bottom: 16px;
font-weight: bold;
line-height: 16px;
color: #fff;
- display: flex;
align-items: center;
- margin-bottom: 16px;
}
.file-list-wrapper {
diff --git a/dbm-ui/frontend/src/views/db-manage/common/sql-execute/common/RenderSql/components/sql-content/components/local-file/Index.vue b/dbm-ui/frontend/src/views/db-manage/common/sql-execute/common/RenderSql/components/sql-content/components/local-file/Index.vue
index 77b9ceb271..b8d55b2bd6 100644
--- a/dbm-ui/frontend/src/views/db-manage/common/sql-execute/common/RenderSql/components/sql-content/components/local-file/Index.vue
+++ b/dbm-ui/frontend/src/views/db-manage/common/sql-execute/common/RenderSql/components/sql-content/components/local-file/Index.vue
@@ -160,9 +160,11 @@
}
isInnerChange = true;
- modelValue.value = uploadFileNameList.value.map(
- (localFileName) => uploadFileDataMap.value[localFileName].realFilePath,
- );
+ if (uploadFileNameList.value.length) {
+ modelValue.value = uploadFileNameList.value.map(
+ (localFileName) => uploadFileDataMap.value[localFileName].realFilePath,
+ );
+ }
emits('grammar-check', true, true);
};
@@ -279,7 +281,7 @@
delete lastUploadFileDataMap[fileName];
uploadFileDataMap.value = lastUploadFileDataMap;
- // 如果删除的是当前选中的文件,则重新选择第一个文件
+ // // 如果删除的是当前选中的文件,则重新选择第一个文件
if (fileName === selectFileName.value && uploadFileNameList.value.length > 0) {
[selectFileName.value] = uploadFileNameList.value;
} else {
diff --git a/dbm-ui/frontend/src/views/tickets/common/components/demand-factory/mysql/import-sql-file/components/SqlFileList.vue b/dbm-ui/frontend/src/views/tickets/common/components/demand-factory/mysql/import-sql-file/components/SqlFileList.vue
index 4ff22d31e6..03ba57fddf 100644
--- a/dbm-ui/frontend/src/views/tickets/common/components/demand-factory/mysql/import-sql-file/components/SqlFileList.vue
+++ b/dbm-ui/frontend/src/views/tickets/common/components/demand-factory/mysql/import-sql-file/components/SqlFileList.vue
@@ -28,7 +28,11 @@
active: fileItemData.name === modelValue,
}"
@click="handleClick(fileItemData.name)">
- {{ getSQLFilename(fileItemData.name) }}
+
+ {{ getSQLFilename(fileItemData.name) }}
+
@@ -84,10 +88,13 @@
}
.sql-execute-sql-file-list {
+ display: flex;
width: 238px;
- height: 500px;
+ height: calc(100vh - 120px);
padding-top: 18px;
+ overflow-y: auto;
border-right: 1px solid #3d3d40;
+ flex-direction: column;
.file-list-title {
padding: 0 16px;
@@ -131,6 +138,13 @@
& ~ .file-item {
margin-top: 8px;
}
+
+ .file-name {
+ width: 100%;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
}
}
}