duy 2 лет назад
Родитель
Сommit
d26df585d6
1 измененных файлов с 22 добавлено и 9 удалено
  1. 22 9
      src/views/system/menu.vue

+ 22 - 9
src/views/system/menu.vue

@@ -20,7 +20,8 @@
                @on-load="onLoad"
                @tree-load="treeLoad"
                :uploadExceed="uploadExceed"
-                :upload-preview="uploadPreview"
+               :upload-preview="uploadPreview"
+               @cell-click="clickCell"
                >
       <template slot="menuLeft">
         <el-button type="danger"
@@ -56,14 +57,19 @@
         </div>
       </template>
        <template slot="excelUrl" slot-scope="scope" >
-        
-         <el-link type="primary" :href="scope.row.excelUrl" target="_blank">
-            <avue-text-ellipsis :text="scope.row.excelUrl" :height="100" >
+         <el-link>
+           <avue-text-ellipsis :text="scope.row.excelUrl" :height="100">
               <small slot="more">...</small>
             </avue-text-ellipsis>
          </el-link>
+            
       </template>
+    
     </avue-crud>
+      <!-- PDF预览 -->
+      <el-dialog title="文件预览" :visible.sync="dialogVisible4" width="70%" append-to-body center>
+          <iframe :src="pdfSrc" frameborder="0" style="width: 100%; height: 500px"></iframe>
+      </el-dialog>
   </basic-container>
 </template>
 
@@ -77,6 +83,8 @@
   export default {
     data() {
       return {
+        dialogVisible4:false,//pdf预览
+        pdfSrc:'',
         form: {},
         query: {},
         loading: true,
@@ -392,13 +400,18 @@
       },
         //上传后进行点击预览
       uploadPreview(file, column, done) {
-          //默认执行打开方法
-          window.open(file.url, 'baidu').then(()=>{
-            done();
-          })
+          this.dialogVisible4=true;
+          this.pdfSrc=file.url
+         
           
       },
-    
+    // 点击第文档信息列的单元格
+    clickCell(row, column, cell, event) {
+      if (column.label === "文档信息") {
+        this.dialogVisible4=true;
+        this.pdfSrc=row.excelUrl
+      }
+    },
       initData() {
         getMenuTree().then(res => {
           const column = this.findObject(this.option.column, "parentId");