文件显示

This commit is contained in:
ChenXinXin committed 2024-04-28 10:16:25 +08:00
1 parent 16e446e50f
commit 36b5ebce51
3 files changed
+10 -7

No files matched your search

+8 -4
View File
@@ -1,17 +1,17 @@
<template id="file-upload"> <template id="file-upload">
<v-container class="fullScreen d-flex flex-column pa-xs-0 pa-0"> <v-container class="fullScreen d-flex flex-column pa-xs-0 pa-0">
<v-file-input multiple v-model="inputFile" hide-input dense filled single-line style="width: 10px;" color="red" <v-file-input multiple v-model="inputFile" hide-input dense filled single-line style="width: 10px;" color="red"
label="请选择文件"></v-file-input> label="请选择文件" :disabled="disabled"></v-file-input>
<v-card outlined class="mt-2" v-if="value && value.length > 0"> <v-card outlined class="mt-2" v-if="value && value.length > 0">
<v-data-table :headers="headers" :items="value" <v-data-table :headers="headers" :items="value"
:footer-props="{ itemsPerPageOptions: [20, 40, 60, 100, -1] }" :items-per-page="100" :loading="isTableLoading" :footer-props="{ itemsPerPageOptions: [20, 40, 60, 100, -1] }" :items-per-page="20" :loading="isTableLoading"
mobile-breakpoint="0" :class="{'mx-2': isMobile}" mobile-breakpoint="0" :class="{'mx-2': isMobile}"
class="elevation-0 mt-0 flex-fill d-flex flex-column"> class="elevation-0 mt-0 flex-fill d-flex flex-column">
<template v-slot:item.download-path="{ item }"> <template v-slot:item.download-path="{ item }">
<preview-file-group :file-list="[item]" /> <preview-file-group :file-list="[item]" />
</template> </template>
<template v-slot:item.action="{ item, index }"> <template v-slot:item.action="{ item, index }">
<span role="button" class="success--text font-weight-medium font-size-2" <span v-if="!disabled" role="button" class="success--text font-weight-medium font-size-2"
@click="doUiAction('deleteItem', { item, index })"> @click="doUiAction('deleteItem', { item, index })">
<v-icon size="14" class="success--text">mdi-trash-can-outline</v-icon>删除 <v-icon size="14" class="success--text">mdi-trash-can-outline</v-icon>删除
</span> </span>
@@ -39,6 +39,10 @@
type: Array, type: Array,
default: () => [], default: () => [],
}, },
disabled: {
type: Boolean,
default: false,
},
}, },
vuetify: new Vuetify(), vuetify: new Vuetify(),
data: () => ({ data: () => ({
@@ -98,7 +102,7 @@
window.vtoast.loading(`${file.name} 上传进度: 0.00%`); window.vtoast.loading(`${file.name} 上传进度: 0.00%`);
const result = await window.jianghuAxios.httpUploadByStream({ const result = await window.jianghuAxios.httpUploadByStream({
file, file,
fileDirectory: `test`, fileDirectory: `task`,
onProgress: (total, loaded) => { onProgress: (total, loaded) => {
const progress = Number((loaded * 100 / total).toFixed(2)); const progress = Number((loaded * 100 / total).toFixed(2));
window.vtoast.loading(`${file.name} 上传进度: ${progress}%`); window.vtoast.loading(`${file.name} 上传进度: ${progress}%`);
@@ -33,8 +33,7 @@
<!-- 文件 --> <!-- 文件 -->
<v-list-item-content v-if="formItem.type === 'file'" class="py-0"> <v-list-item-content v-if="formItem.type === 'file'" class="py-0">
<v-file-input v-if="disabled" chips multiple :disabled='disabled' ></v-file-input> <file-upload :file-biz-id="taskId" v-model="formItem.answer" :disabled='disabled'></file-upload>
<file-upload v-else :file-biz-id="taskId" v-model="formItem.answer"></file-upload>
</v-list-item-content> </v-list-item-content>
<!-- 数字 --> <!-- 数字 -->
+1 -1
View File
@@ -8,7 +8,7 @@
"framework": "@jianghujs/jianghu" "framework": "@jianghujs/jianghu"
}, },
"dependencies": { "dependencies": {
"@jianghujs/jianghu": "4.1.0", "@jianghujs/jianghu": "5.1.4",
"dayjs": "^1.11.4", "dayjs": "^1.11.4",
"dotenv": "^16.3.1", "dotenv": "^16.3.1",
"egg": "^2.15.1", "egg": "^2.15.1",