update 图片卡片增加重命名

This commit is contained in:
2026-03-24 15:48:28 +08:00
parent 2700bed4e7
commit b2c96b7631
2 changed files with 43 additions and 5 deletions

View File

@@ -65,9 +65,25 @@
>
{{ $t('通用.删除') }}
</el-button>
<el-button
v-if="showDelete"
size="small"
type="primary"
link
@click.stop="renameFun(item.id, item)"
>
重命名
</el-button>
</div>
</div>
</div>
<FileRename
v-model="renameVisible"
:fileId="currentRenameId"
fileNameField="originalName"
:fileData="currentRenameData"
@finish="renameFinishFun"
/>
</div>
</template>
@@ -77,6 +93,7 @@ import { ElMessageBox } from 'element-plus';
import { useI18n } from 'vue-i18n';
import { Check, WarningFilled, Loading } from '@element-plus/icons-vue';
import { FileUtil } from '@/utils/file';
import FileRename from '@/components/common/fileTable/fileRename.vue';
const { t } = useI18n();
@@ -97,6 +114,7 @@ const emits = defineEmits<{
(e: 'preview', item: any): void;
(e: 'delete', item: any): void;
(e: 'selectionChange', ids: string[]): void;
(e: 'refresh'): void;
}>();
const selectedIds = ref<string[]>([]);
@@ -110,9 +128,26 @@ const showDeleteConfirmFun = (item: any) => {
confirmButtonText: t('通用.确定'),
cancelButtonText: t('通用.取消'),
type: 'warning',
}).then(() => {
emits('delete', item);
}).catch(() => {});
})
.then(() => {
emits('delete', item);
})
.catch(() => {});
};
// 文件重命名
const renameVisible = ref(false);
const currentRenameId = ref<any>();
const currentRenameData = ref<any>({});
const renameFun = (id: any, row: any) => {
currentRenameId.value = id;
currentRenameData.value = { ...row };
renameVisible.value = true;
};
const renameFinishFun = () => {
// 刷新数据
emits('refresh');
};
const getImageSrcFun = (id: string) => {

View File

@@ -52,6 +52,7 @@
@download="downloadFileFun"
@preview="previewFileFun"
@delete="deleteFun"
@refresh="refreshFun"
/>
</template>
@@ -81,7 +82,7 @@ import {
getFileUploadAcceptFun,
queryFileIdByNodeIdFun,
} from '@/utils/file';
import BaseTable from '@/components/common/table/baseTable.vue';
// import BaseTable from '@/components/common/table/baseTable.vue';
import FileTable from '@/components/common/fileTable/index.vue';
import FilePreview from '@/components/common/filePreview/index.vue';
import AddFile from '@/components/common/addFile/index.vue';
@@ -127,7 +128,9 @@ const columnCount = ref(4);
const exampleList = ref<any>([]);
const nodeFIleId = ref<any>('');
const accept = ref<any>('');
const refreshFun = () => {
baseTableRef.value.resetFun();
};
const queryTaskRunFun = async (id: any) => {
const res: any = await queryTaskRunApi({ taskId: id });
if (res && res.code === 200) {