mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-12-11 21:06:08 +08:00
fix: 解决排序之后获取文件夹大小导致排序失效的问题 (#2804)
This commit is contained in:
parent
dedfe1e1e1
commit
1fc75ac000
2 changed files with 13 additions and 11 deletions
|
|
@ -254,7 +254,6 @@ const getAppDetail = async (version: string) => {
|
|||
req.appDetailId = res.data.id;
|
||||
req.dockerCompose = res.data.dockerCompose;
|
||||
isHostMode.value = res.data.hostMode;
|
||||
console.log(res.data);
|
||||
installData.value.params = res.data.params;
|
||||
paramKey.value++;
|
||||
} catch (error) {
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@
|
|||
<div class="btn-container">
|
||||
<div class="left-section">
|
||||
<el-dropdown @command="handleCreate">
|
||||
<el-button type="primary">
|
||||
<el-button type="primary" size="small">
|
||||
{{ $t('commons.button.create') }}
|
||||
<el-icon><arrow-down /></el-icon>
|
||||
</el-button>
|
||||
|
|
@ -69,7 +69,7 @@
|
|||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
<el-button-group>
|
||||
<el-button-group size="small">
|
||||
<el-button plain @click="openUpload">{{ $t('file.upload') }}</el-button>
|
||||
<el-button plain @click="openWget">{{ $t('file.remoteFile') }}</el-button>
|
||||
<el-button plain @click="openMove('copy')" :disabled="selects.length === 0">
|
||||
|
|
@ -89,11 +89,11 @@
|
|||
</el-button>
|
||||
</el-button-group>
|
||||
|
||||
<el-button class="btn" @click="toTerminal">
|
||||
<el-button class="btn" @click="toTerminal" size="small">
|
||||
{{ $t('menu.terminal') }}
|
||||
</el-button>
|
||||
|
||||
<el-button-group class="copy-button" v-if="moveOpen">
|
||||
<el-button-group class="copy-button" v-if="moveOpen" size="small">
|
||||
<el-tooltip class="box-item" effect="dark" :content="$t('file.paste')" placement="bottom">
|
||||
<el-button plain @click="openPaste">{{ $t('file.paste') }}</el-button>
|
||||
</el-tooltip>
|
||||
|
|
@ -108,7 +108,7 @@
|
|||
<div class="right-section">
|
||||
<el-popover placement="bottom" :width="200" trigger="hover" @before-enter="getFavoriates">
|
||||
<template #reference>
|
||||
<el-button @click="openFavorite" :icon="Star">
|
||||
<el-button @click="openFavorite" :icon="Star" size="small">
|
||||
{{ $t('file.favorite') }}
|
||||
</el-button>
|
||||
</template>
|
||||
|
|
@ -139,7 +139,7 @@
|
|||
</div>
|
||||
</el-popover>
|
||||
|
||||
<el-button class="btn" @click="openRecycleBin" :icon="Delete">
|
||||
<el-button class="btn" @click="openRecycleBin" :icon="Delete" size="small">
|
||||
{{ $t('file.recycleBin') }}
|
||||
</el-button>
|
||||
<div class="search-button">
|
||||
|
|
@ -149,6 +149,7 @@
|
|||
@clear="search()"
|
||||
@keydown.enter="search()"
|
||||
:placeholder="$t('file.search')"
|
||||
size="small"
|
||||
>
|
||||
<template #prepend>
|
||||
<el-checkbox v-model="req.containSub">
|
||||
|
|
@ -240,9 +241,9 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('file.size')" prop="size" max-width="50" sortable>
|
||||
<template #default="{ row }">
|
||||
<template #default="{ row, $index }">
|
||||
<span v-if="row.isDir">
|
||||
<el-button type="primary" link small @click="getDirSize(row)">
|
||||
<el-button type="primary" link small @click="getDirSize(row, $index)">
|
||||
<span v-if="row.dirSize == undefined">
|
||||
{{ $t('file.calculate') }}
|
||||
</span>
|
||||
|
|
@ -564,14 +565,16 @@ const getFileSize = (size: number) => {
|
|||
return computeSize(size);
|
||||
};
|
||||
|
||||
const getDirSize = async (row: any) => {
|
||||
const getDirSize = async (row: any, index: number) => {
|
||||
const req = {
|
||||
path: row.path,
|
||||
};
|
||||
loading.value = true;
|
||||
await ComputeDirSize(req)
|
||||
.then(async (res) => {
|
||||
row.dirSize = res.data.size;
|
||||
let newData = [...data.value];
|
||||
newData[index].dirSize = res.data.size;
|
||||
data.value = newData;
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue