|
@@ -20,12 +20,11 @@
|
|
<el-table :data="recentFiles" highlight-current-row :height="tableHeight">
|
|
<el-table :data="recentFiles" highlight-current-row :height="tableHeight">
|
|
<el-table-column prop="documentName" :label="$t('recentdocuments')" sortable="true">
|
|
<el-table-column prop="documentName" :label="$t('recentdocuments')" sortable="true">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <!-- <el-link @click.stop.native="viewOnline(scope.row)"> -->
|
|
|
|
|
|
+ <el-link @click.stop.native="viewOnline(scope.row)">
|
|
<i v-if="scope.row.documentType == -1" class="iconfont firerock-iconfile fileTypeIcon"></i>
|
|
<i v-if="scope.row.documentType == -1" class="iconfont firerock-iconfile fileTypeIcon"></i>
|
|
<i v-if="scope.row.documentType != -1" :class="docTypeList[scope.row.documentType]+' fileTypeIcon'" ></i>
|
|
<i v-if="scope.row.documentType != -1" :class="docTypeList[scope.row.documentType]+' fileTypeIcon'" ></i>
|
|
<span style="margin-left:8px;color:#262626;" >{{scope.row.documentName}}</span>
|
|
<span style="margin-left:8px;color:#262626;" >{{scope.row.documentName}}</span>
|
|
- <!-- <span style="margin-left:8px;color:#262626;" @click="viewOnline(scope.row)">{{scope.row.documentName}}</span> -->
|
|
|
|
- <!-- </el-link> -->
|
|
|
|
|
|
+ </el-link>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column width="60">
|
|
<el-table-column width="60">
|
|
@@ -44,11 +43,11 @@
|
|
<i class="el-icon-folder fileTypeIcon"></i><span style="margin-left:8px;color:#262626;" >{{scope.row.documentName}}</span>
|
|
<i class="el-icon-folder fileTypeIcon"></i><span style="margin-left:8px;color:#262626;" >{{scope.row.documentName}}</span>
|
|
</div>
|
|
</div>
|
|
<div v-if="scope.row.isFolder==0">
|
|
<div v-if="scope.row.isFolder==0">
|
|
- <!-- <el-link @click.stop.native="viewOnline(scope.row)"> -->
|
|
|
|
|
|
+ <el-link @click.stop.native="viewOnline(scope.row)">
|
|
<i v-if="scope.row.documentType == -1" class="iconfont firerock-iconfile fileTypeIcon"></i>
|
|
<i v-if="scope.row.documentType == -1" class="iconfont firerock-iconfile fileTypeIcon"></i>
|
|
<i v-if="scope.row.documentType != -1" :class="docTypeList[scope.row.documentType]+' fileTypeIcon'"></i>
|
|
<i v-if="scope.row.documentType != -1" :class="docTypeList[scope.row.documentType]+' fileTypeIcon'"></i>
|
|
<span style="margin-left:8px;color:#262626;" >{{scope.row.documentName}}</span>
|
|
<span style="margin-left:8px;color:#262626;" >{{scope.row.documentName}}</span>
|
|
- <!-- </el-link> -->
|
|
|
|
|
|
+ </el-link>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -601,31 +600,53 @@
|
|
cursorOver(row, column, cell, event) {
|
|
cursorOver(row, column, cell, event) {
|
|
this.currentDataId = row.id;
|
|
this.currentDataId = row.id;
|
|
},
|
|
},
|
|
|
|
+ // viewOnline(row) {
|
|
|
|
+ // this.http.post('/pdf-file/getProjectFile', {fileId: row.id},
|
|
|
|
+ // res => {
|
|
|
|
+ // if (res.code == "ok") {
|
|
|
|
+ // console.log(res.data+'----'+row.documentName);
|
|
|
|
+ // let routeUrl = this.$router.resolve({
|
|
|
|
+ // path: "/viewonline",
|
|
|
|
+ // params: {serverFname:res.data, fileName:row.documentName}
|
|
|
|
+ // });
|
|
|
|
+ // sessionStorage.setItem("serverFname",res.data);
|
|
|
|
+ // sessionStorage.setItem("fileName",row.documentName);
|
|
|
|
+ // console.log(routeUrl.href);
|
|
|
|
+ // window.open(routeUrl.href, '_blank');
|
|
|
|
+ // } else {
|
|
|
|
+ // this.$message({
|
|
|
|
+ // message: res.msg,
|
|
|
|
+ // type: 'error'
|
|
|
|
+ // });
|
|
|
|
+ // }
|
|
|
|
+ // }, error => {
|
|
|
|
+ // this.$message({
|
|
|
|
+ // message: error,
|
|
|
|
+ // type: 'error'
|
|
|
|
+ // });
|
|
|
|
+ // })
|
|
|
|
+ // },
|
|
viewOnline(row) {
|
|
viewOnline(row) {
|
|
- this.http.post('/pdf-file/getProjectFile', {fileId: row.id},
|
|
|
|
- res => {
|
|
|
|
- if (res.code == "ok") {
|
|
|
|
- console.log(res.data+'----'+row.documentName);
|
|
|
|
- let routeUrl = this.$router.resolve({
|
|
|
|
- path: "/viewonline",
|
|
|
|
- params: {serverFname:res.data, fileName:row.documentName}
|
|
|
|
- });
|
|
|
|
- sessionStorage.setItem("serverFname",res.data);
|
|
|
|
- sessionStorage.setItem("fileName",row.documentName);
|
|
|
|
- console.log(routeUrl.href);
|
|
|
|
- window.open(routeUrl.href, '_blank');
|
|
|
|
- } else {
|
|
|
|
- this.$message({
|
|
|
|
- message: res.msg,
|
|
|
|
- type: 'error'
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- }, error => {
|
|
|
|
- this.$message({
|
|
|
|
- message: error,
|
|
|
|
- type: 'error'
|
|
|
|
|
|
+ sessionStorage.setItem("fileName",row.documentName);
|
|
|
|
+ sessionStorage.setItem("fileUrl",row.url);
|
|
|
|
+ let routeUrl;
|
|
|
|
+ if (row.documentName.endsWith('.doc') || row.documentName.endsWith('.docx')) {
|
|
|
|
+ routeUrl = this.$router.resolve({
|
|
|
|
+ path: "/viewWord",
|
|
|
|
+ params: {}
|
|
});
|
|
});
|
|
- })
|
|
|
|
|
|
+ } else if (row.documentName.endsWith('.xls') || row.documentName.endsWith('.xlsx')) {
|
|
|
|
+ routeUrl = this.$router.resolve({
|
|
|
|
+ path: "/viewExcel",
|
|
|
|
+ params: {}
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ if (routeUrl != null) {
|
|
|
|
+ console.log(routeUrl.href);
|
|
|
|
+ window.open(routeUrl.href, '_blank');
|
|
|
|
+ } else {
|
|
|
|
+ window.open(row.url, '_blank');
|
|
|
|
+ }
|
|
},
|
|
},
|
|
deleteItem(row) {
|
|
deleteItem(row) {
|
|
this.$confirm(this.$t('wanttomove'), this.$t('other.prompts'), {
|
|
this.$confirm(this.$t('wanttomove'), this.$t('other.prompts'), {
|