|
@@ -22,6 +22,7 @@
|
|
|
icon="el-icon-folder-add"
|
|
|
size="mini"
|
|
|
@click="handleAdd"
|
|
|
+ v-hasPermi="['file:file:add']"
|
|
|
>新建文件夹
|
|
|
</el-button>
|
|
|
</el-col>
|
|
@@ -30,6 +31,7 @@
|
|
|
type="primary"
|
|
|
icon="el-icon-upload2"
|
|
|
size="mini"
|
|
|
+ v-hasPermi="['file:file:add']"
|
|
|
@click="handleAddFile"
|
|
|
>上传文件
|
|
|
</el-button>
|
|
@@ -38,46 +40,65 @@
|
|
|
</el-row>
|
|
|
|
|
|
<el-table
|
|
|
+ ref="fileTable"
|
|
|
v-loading="loading"
|
|
|
:data="fileList"
|
|
|
row-key="id"
|
|
|
default-expand-all
|
|
|
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
|
|
+ @row-click="rowClick"
|
|
|
>
|
|
|
<el-table-column label="文件名" width="500" align="left" prop="fileName" :show-overflow-tooltip="true">
|
|
|
<template slot-scope="scope">
|
|
|
- <a v-if="scope.row.type == 1" class="link-type" @click="handleFileView(scope.row)">
|
|
|
+
|
|
|
+ <svg-icon style="font-size: 200%;" v-if="scope.row.type == '1'" iconClass="excel_1"/>
|
|
|
+ <svg-icon style="font-size: 200%;" v-else-if="scope.row.type == '2'" iconClass="ppt"/>
|
|
|
+ <svg-icon style="font-size: 200%;" v-else-if="scope.row.type == '4'" iconClass="pdf_1"/>
|
|
|
+ <svg-icon style="font-size: 200%;" v-else-if="scope.row.type == '3'" iconClass="word"/>
|
|
|
+ <svg-icon style="font-size: 200%;" v-else-if="scope.row.type == '5'" iconClass="txt"/>
|
|
|
+ <svg-icon style="font-size: 200%;" v-else-if="scope.row.type == '0'" iconClass="folder"/>
|
|
|
+ <el-image
|
|
|
+ v-else-if="scope.row.type == '6'"
|
|
|
+ style="border-radius:5px; padding:5px 5px 0 0;width: 30px; height: 30px"
|
|
|
+ :src="getImgUrl(scope.row.fileUrl)"
|
|
|
+ :preview-src-list="[getImgUrl(scope.row.fileUrl)]">
|
|
|
+ </el-image>
|
|
|
+ <svg-icon style="font-size: 200%;" v-else iconClass="unknown"/>
|
|
|
+ <span v-if="scope.row.type == 0">{{ scope.row.fileName }}</span>
|
|
|
+ <a v-else class="link-type" @click="handleFileView(scope.row)">
|
|
|
<span>{{ scope.row.fileName }}</span>
|
|
|
</a>
|
|
|
- <span v-else-if="scope.row.type == 0">{{ scope.row.fileName }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="类型" width="80" align="center" prop="type">
|
|
|
+<!-- <el-table-column label="类型" width="80" align="center" prop="type">
|
|
|
<template slot-scope="scope">
|
|
|
- <i v-if="scope.row.type == 1" class="el-icon-document"></i>
|
|
|
- <i v-else-if="scope.row.type == 0" class="el-icon-folder"></i>
|
|
|
+ <svg-icon style="font-size: 200%;" v-if="scope.row.type == '1'" iconClass="excel_1"/>
|
|
|
+ <svg-icon style="font-size: 200%;" v-else-if="scope.row.type == '2'" iconClass="ppt"/>
|
|
|
+ <svg-icon style="font-size: 200%;" v-else-if="scope.row.type == '4'" iconClass="pdf_1"/>
|
|
|
+ <svg-icon style="font-size: 200%;" v-else-if="scope.row.type == '3'" iconClass="word"/>
|
|
|
+ <svg-icon style="font-size: 200%;" v-else-if="scope.row.type == '5'" iconClass="txt"/>
|
|
|
+ <svg-icon style="font-size: 200%;" v-else-if="scope.row.type == '0'" iconClass="folder"/>
|
|
|
+ <el-image
|
|
|
+ v-else-if="scope.row.type == '6'"
|
|
|
+ style="border-radius:5px; padding:5px 5px 0 0;width: 30px; height: 30px"
|
|
|
+ :src="getImgUrl(scope.row.fileUrl)"
|
|
|
+ :preview-src-list="[getImgUrl(scope.row.fileUrl)]">
|
|
|
+ </el-image>
|
|
|
+ <svg-icon style="font-size: 200%;" v-else iconClass="unknown"/>
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
+ </el-table-column>-->
|
|
|
|
|
|
- <el-table-column label="创建人" align="center" prop="creator"/>
|
|
|
- <el-table-column label="创建时间" align="center" prop="createdate" width="180">
|
|
|
+ <el-table-column label="创建人" align="center" prop="uploader"/>
|
|
|
+ <el-table-column label="创建时间" align="center" prop="uploadDate" width="180">
|
|
|
<template slot-scope="scope">
|
|
|
- <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>
|
|
|
+ <span>{{ parseTime(scope.row.uploadDate, '{y}-{m}-{d}') }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="文件大小(Kb)" width="100" align="center" prop="fileSize"/>
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
|
- v-if="scope.row.fileName.endsWith('pdf') && scope.row.type == 1"
|
|
|
- size="mini"
|
|
|
- type="text"
|
|
|
- icon="el-icon-view"
|
|
|
- @click="handleSee(scope.row)"
|
|
|
- >预览
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- v-if="scope.row.type == 1"
|
|
|
+ v-if="scope.row.type != 0"
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-download"
|
|
@@ -88,6 +109,7 @@
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-edit"
|
|
|
+ v-hasPermi="['file:file:edit']"
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
>修改
|
|
|
</el-button>
|
|
@@ -95,21 +117,22 @@
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-delete"
|
|
|
+ v-hasPermi="['file:file:remove']"
|
|
|
@click="handleDelete(scope.row)"
|
|
|
>删除
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
-<!-- <el-dialog :close-on-click-modal="false" v-dialogDrag :title="pdf.title" :visible.sync="pdf.open" width="1300px"-->
|
|
|
-<!-- append-to-body>-->
|
|
|
-<!-- <div style="margin-top: -60px;float: right;margin-right: 40px;">-->
|
|
|
-<!-- <el-button size="mini" type="text" @click="openPdf">新页面打开PDF</el-button>-->
|
|
|
-<!-- </div>-->
|
|
|
-<!-- <div style="margin-top: -30px">-->
|
|
|
-<!-- <iframe :src="pdf.pdfUrl" frameborder="0" width="100%" height="700px"></iframe>-->
|
|
|
-<!-- </div>-->
|
|
|
-<!-- </el-dialog>-->
|
|
|
+ <!-- <el-dialog :close-on-click-modal="false" v-dialogDrag :title="pdf.title" :visible.sync="pdf.open" width="1300px"-->
|
|
|
+ <!-- append-to-body>-->
|
|
|
+ <!-- <div style="margin-top: -60px;float: right;margin-right: 40px;">-->
|
|
|
+ <!-- <el-button size="mini" type="text" @click="openPdf">新页面打开PDF</el-button>-->
|
|
|
+ <!-- </div>-->
|
|
|
+ <!-- <div style="margin-top: -30px">-->
|
|
|
+ <!-- <iframe :src="pdf.pdfUrl" frameborder="0" width="100%" height="700px"></iframe>-->
|
|
|
+ <!-- </div>-->
|
|
|
+ <!-- </el-dialog>-->
|
|
|
<!-- 添加或修改附件对话框 -->
|
|
|
<el-dialog :title="doc.title" :visible.sync="doc.open" width="500px" append-to-body>
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
@@ -119,15 +142,16 @@
|
|
|
placeholder="请选择文件夹"/>
|
|
|
</el-form-item>
|
|
|
<el-upload style="text-align: center;"
|
|
|
- ref="doc"
|
|
|
- :limit="50"
|
|
|
- :headers="doc.headers"
|
|
|
- :action="doc.url + '?linkId=' + this.$route.query.linkId + '&linkName=' + this.$route.query.linkName + '&pId=' + this.form.pId"
|
|
|
- :disabled="doc.isUploading"
|
|
|
- :on-progress="handleFileDocProgress"
|
|
|
- :on-success="handleFileDocSuccess"
|
|
|
- :auto-upload="true"
|
|
|
- drag
|
|
|
+ ref="doc"
|
|
|
+ :limit="50"
|
|
|
+ :headers="doc.headers"
|
|
|
+ :action="doc.url + '?linkId=' + this.$route.query.linkId + '&linkName=' + this.$route.query.linkName + '&pId=' + this.form.pId"
|
|
|
+ :disabled="doc.isUploading"
|
|
|
+ :on-progress="handleFileDocProgress"
|
|
|
+ :on-success="handleFileDocSuccess"
|
|
|
+ :auto-upload="true"
|
|
|
+ multiple
|
|
|
+ drag
|
|
|
>
|
|
|
<i class="el-icon-upload"></i>
|
|
|
<div class="el-upload__text">
|
|
@@ -233,13 +257,19 @@ export default {
|
|
|
},
|
|
|
created() {
|
|
|
console.log(this.$route.query)
|
|
|
- if(this.$route.query){
|
|
|
- this.queryParams.linkId=this.$route.query.linkId
|
|
|
- this.queryParams.linkName=this.$route.query.linkName
|
|
|
+ if (this.$route.query) {
|
|
|
+ this.queryParams.linkId = this.$route.query.linkId
|
|
|
+ this.queryParams.linkName = this.$route.query.linkName
|
|
|
}
|
|
|
this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
+ rowClick(row, column, event) {
|
|
|
+ this.$refs.fileTable.toggleRowExpansion(row);
|
|
|
+ },
|
|
|
+ getImgUrl(url) {
|
|
|
+ return process.env.VUE_APP_BASE_API + url;
|
|
|
+ },
|
|
|
/** 查询附件列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
@@ -389,14 +419,18 @@ export default {
|
|
|
//附件上传成功处理
|
|
|
handleFileDocSuccess(response, file, fileList) {
|
|
|
this.doc.isUploading = false;
|
|
|
- this.$alert(response.msg, '导入结果', {dangerouslyUseHTMLString: true});
|
|
|
+ // this.$alert(response.msg, '导入结果', {dangerouslyUseHTMLString: true});
|
|
|
this.form.id = this.doc.pId;
|
|
|
// addFile(this.form)
|
|
|
this.$refs.upload.clearFiles();
|
|
|
this.getList()
|
|
|
},
|
|
|
- handleFileView(row){
|
|
|
- this.$router.push({ path: '/office/edit', query: { fileId: row.id, ot: 'detail' }});
|
|
|
+ handleFileView(row) {
|
|
|
+ if (row.type == 1 || row.type == 2 || row.type == 3) {
|
|
|
+ this.$router.push({path: '/office/edit', query: {fileId: row.id, ot: 'detail'}});
|
|
|
+ } else {
|
|
|
+ window.open(process.env.VUE_APP_BASE_API + row.fileUrl);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
};
|