Browse Source

增加浏览过可以下载

Limengbo 6 years ago
parent
commit
7a99c5f8a5
1 changed files with 9 additions and 8 deletions
  1. 9 8
      src/views/browse/index.vue

+ 9 - 8
src/views/browse/index.vue

@@ -4,8 +4,7 @@
       ref="multipleTable"
       :data="logList.logList"
       tooltip-effect="dark"
-      style="width: 100%"
-      @row-click="detail">
+      style="width: 100%">
       <el-table-column
         :label="title">
         <template slot-scope="scope">
@@ -19,6 +18,11 @@
         show-overflow-tooltip>
         <template slot-scope="scope">{{ scope.row.taskFile.gmtCreated }}</template>
       </el-table-column>
+      <el-table-column
+        label="操作"
+        width="80">
+        <template slot-scope="scope"><i class="el-icon-download" @click="detail(scope.row)"/></template>
+      </el-table-column>
     </el-table>
     <div v-if="logList.logList.length !== 0" class="page">
       <el-pagination
@@ -33,10 +37,7 @@
 <script>
 import { mapGetters } from 'vuex'
 import { parseTime } from '@/utils/index'
-import { addViewLog } from '@/api/table'
-// const xls = require('@/assets/fileimg/xls.png')
-// console.log(1111, xls)
-// import axios from 'axios'
+// import { addViewLog } from '@/api/table'
 
 export default {
   data() {
@@ -74,11 +75,11 @@ export default {
     detail(row) {
       const link = document.createElement('a')
       link.style.display = 'none'
-      link.href = `https://whiteboardtest.ai160.com/download?path=${row.path}&fileName=${row.fileName}`
+      link.href = `https://whiteboardtest.ai160.com/download?path=${row.taskFile.path}&fileName=${row.taskFile.fileName}`
       link.setAttribute('download', 'excel.xlsx')
       document.body.appendChild(link)
       link.click()
-      addViewLog(row.id, row.taskId)
+      // addViewLog(row.id, row.taskId)
     },
     handleCurrentChange(page) {
       this.$store.dispatch('GetViewLogList', page).then((res) => {