文件显示

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

No files matched your search

+8 -4
View File
@@ -1,17 +1,17 @@
<template id="file-upload">
<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"
label="请选择文件"></v-file-input>
label="请选择文件" :disabled="disabled"></v-file-input>
<v-card outlined class="mt-2" v-if="value && value.length > 0">
<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}"
class="elevation-0 mt-0 flex-fill d-flex flex-column">
<template v-slot:item.download-path="{ item }">
<preview-file-group :file-list="[item]" />
</template>
<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 })">
<v-icon size="14" class="success--text">mdi-trash-can-outline</v-icon>删除
</span>
@@ -39,6 +39,10 @@
type: Array,
default: () => [],
},
disabled: {
type: Boolean,
default: false,
},
},
vuetify: new Vuetify(),
data: () => ({
@@ -98,7 +102,7 @@
window.vtoast.loading(`${file.name} 上传进度: 0.00%`);
const result = await window.jianghuAxios.httpUploadByStream({
file,
fileDirectory: `test`,
fileDirectory: `task`,
onProgress: (total, loaded) => {
const progress = Number((loaded * 100 / total).toFixed(2));
window.vtoast.loading(`${file.name} 上传进度: ${progress}%`);
@@ -33,8 +33,7 @@
<!-- 文件 -->
<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 v-else :file-biz-id="taskId" v-model="formItem.answer"></file-upload>
<file-upload :file-biz-id="taskId" v-model="formItem.answer" :disabled='disabled'></file-upload>
</v-list-item-content>
<!-- 数字 -->
+2 -2
View File
@@ -8,7 +8,7 @@
"framework": "@jianghujs/jianghu"
},
"dependencies": {
"@jianghujs/jianghu": "4.1.0",
"@jianghujs/jianghu": "5.1.4",
"dayjs": "^1.11.4",
"dotenv": "^16.3.1",
"egg": "^2.15.1",
@@ -42,4 +42,4 @@
},
"author": "",
"license": "Apache-2.0"
}
}