提交修改

dev
dsh 11 months ago
parent cbf94f773e
commit 0ec7a17e8d

@ -22,7 +22,7 @@
<span class="el-icon-document"> {{ getFileName(scope.row.fileName) }} </span>
</el-link>
</template>
</el-table-column>
</el-table-column>
<el-table-column v-if="isShowUploadButton">
</el-table-column>
@ -35,10 +35,10 @@
</el-table-column>
<el-table-column label="操作" align="center" >
<template slot-scope="scope" v-if="isShowButton">
<el-button size="small" type="text" @click="downloadFile(scope.row.fileId,scope.row.name)"></el-button>
<el-button size="small" type="text" @click="filePassMethod(scope.row,'pass')" v-if="templateType==='aduit'"></el-button>
<el-button size="small" type="text" @click="filePassMethod(scope.row,'nopass')" v-if="templateType==='aduit'"></el-button>
<el-button size="small" type="text" @click="deleteHandle(scope.row.fileId,scope)" v-if="templateType==='apply'"></el-button>
<el-button size="small" type="text" icon="el-icon-download" @click="downloadFile(scope.row.fileId,scope.row.name)"></el-button>
<el-button size="small" type="text" icon="el-icon-check" @click="filePassMethod(scope.row,'pass')" v-if="templateType==='aduit'"></el-button>
<el-button size="small" type="text" icon="el-icon-close" @click="filePassMethod(scope.row,'nopass')" v-if="templateType==='aduit'"></el-button>
<el-button size="small" type="text" icon="el-icon-delete" @click="deleteHandle(scope.row.fileId,scope)" v-if="templateType==='apply'"></el-button>
</template>
</el-table-column>
</el-table>
@ -190,6 +190,41 @@ export default {
return name;
}
},
previewFile(file) {
debugger
const fileType = this.getFileType(file.name);
switch (fileType) {
case 'image':
this.$router.push(`${this.baseUrl}/${file.url}`);
break;
case 'pdf':
this.$router.push(`/preview/pdf/${file.url}`);
break;
case 'excel':
this.$router.push(`/preview/excel/${file.url}`);
break;
case 'word':
this.$router.push(`/preview/word/${file.url}`);
break;
default:
//
break;
}
},
getFileType(fileName) {
const extension = fileName.split('.').pop().toLowerCase();
if (['jpg', 'jpeg', 'png', 'gif'].includes(extension)) {
return 'image';
} else if (['pdf'].includes(extension)) {
return 'pdf';
} else if (['xlsx', 'xls'].includes(extension)) {
return 'excel';
} else if (['doc', 'docx'].includes(extension)) {
return 'word';
} else {
return 'unknown';
}
},
//
listToString(list, separator) {
let strs = "";

Loading…
Cancel
Save