Skip to content

Commit

Permalink
fix: 解决选择单个文件复制再选多个文件之后显示异常的问题 (#2852)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengkunwang223 authored Nov 8, 2023
1 parent 7082e2f commit 253776d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion frontend/src/lang/modules/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,7 @@ const message = {
downloading: 'Downloading...',
infoDetail: 'File Properties',
list: 'File List',
sub: 'Include subdirectory',
sub: 'Subdirectory',
downlodSuccess: 'Download Success',
theme: 'Theme',
language: 'Language',
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lang/modules/tw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ const message = {
infoDetail: '文件屬性',
root: '根目錄',
list: '文件列表',
sub: '含子目錄',
sub: '目錄',
downlodSuccess: '下載完成',
theme: '主',
language: '語',
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lang/modules/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,7 @@ const message = {
infoDetail: '文件属性',
root: '根目录',
list: '文件列表',
sub: '含子目录',
sub: '目录',
downlodSuccess: '下载完成',
theme: '主',
language: '语',
Expand Down
9 changes: 7 additions & 2 deletions frontend/src/views/host/file-management/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@

<el-button-group class="copy-button" v-if="moveOpen">
<el-tooltip class="box-item" effect="dark" :content="$t('file.paste')" placement="bottom">
<el-button plain @click="openPaste">{{ $t('file.paste') }}</el-button>
<el-button plain @click="openPaste">
{{ $t('file.paste') }}({{ fileMove.count }})
</el-button>
</el-tooltip>
<el-tooltip class="box-item" effect="dark" :content="$t('file.cancel')" placement="bottom">
<el-button plain class="close" @click="closeMove">
Expand Down Expand Up @@ -369,7 +371,7 @@ const codeReq = reactive({ path: '', expand: false, page: 1, pageSize: 100 });
const fileUpload = reactive({ path: '' });
const fileRename = reactive({ path: '', oldName: '' });
const fileWget = reactive({ path: '' });
const fileMove = reactive({ oldPaths: [''], type: '', path: '', name: '' });
const fileMove = reactive({ oldPaths: [''], type: '', path: '', name: '', count: 0 });
const processPage = reactive({ open: false });
const createRef = ref();
Expand Down Expand Up @@ -690,10 +692,12 @@ const openRename = (item: File.File) => {
const openMove = (type: string) => {
fileMove.type = type;
fileMove.name = '';
const oldpaths = [];
for (const s of selects.value) {
oldpaths.push(s['path']);
}
fileMove.count = selects.value.length;
fileMove.oldPaths = oldpaths;
if (selects.value.length == 1) {
fileMove.name = selects.value[0].name;
Expand All @@ -706,6 +710,7 @@ const closeMove = () => {
tableRef.value.clearSelects();
fileMove.oldPaths = [];
fileMove.name = '';
fileMove.count = 0;
moveOpen.value = false;
};
Expand Down
1 change: 1 addition & 0 deletions frontend/src/views/host/file-management/move/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ const acceptParams = async (props: MoveProps) => {
addForm.oldPaths = props.oldPaths;
addForm.type = props.type;
addForm.newPath = props.path;
addForm.name = '';
type.value = props.type;
if (props.name && props.name != '') {
oldName.value = props.name;
Expand Down

0 comments on commit 253776d

Please sign in to comment.