Explorar el Código

在线文档-更换全屏方式以支持IE浏览器

fan hace 2 años
padre
commit
f555dd3375
Se han modificado 2 ficheros con 33 adiciones y 3 borrados
  1. 20 1
      public/static/views/onlineShareExcel.html
  2. 13 2
      src/pages/main/onlineExcel/index.vue

+ 20 - 1
public/static/views/onlineShareExcel.html

@@ -124,6 +124,7 @@
     var toolBar = '';
     var type = '';
     var emptyExcel = false;
+    var fullScreenState = false;
     $(function () {
         userId = JSON.parse(window.top.sessionStorage.userInfo).loginNo
     })
@@ -403,7 +404,15 @@
                 window.parent['backToExcelList']('true');
             })
             $("#fullScreen").on("click", function () {
-                fullScreen();
+                if (fullScreenState){
+                    fullScreenState = false;
+                    $("#fullScreen").html('全屏显示');
+                } else {
+                    fullScreenState = true;
+                    $("#fullScreen").html('退出全屏');
+                }
+                window.parent['fullScreen']('true');
+                //fullScreen();
             })
             //退出全屏
             $("#exitFullScreen").on("click", function () {
@@ -411,10 +420,20 @@
             })
             //分享
             $('#share').off("click").click(function () {
+                if (fullScreenState){
+                    fullScreenState = false;
+                    $("#fullScreen").html('全屏显示');
+                    window.parent['fullScreen']('true');
+                }
                 processShare(1);
             });
             //新增分享
             $('#newShare').off("click").click(function () {
+                if (fullScreenState){
+                    fullScreenState = false;
+                    $("#fullScreen").html('全屏显示');
+                    window.parent['fullScreen']('true');
+                }
                 processShare(2);
             });
             // 保存

+ 13 - 2
src/pages/main/onlineExcel/index.vue

@@ -91,9 +91,13 @@
                                        :total="total">
                         </el-pagination>
                     </div>
+
                     <div class="container" id="container" v-else>
-                        <iframe id="excelIframe" height="100%" width="100%" src="/marketfront/static/views/onlineShareExcel.html"
-                                frameborder="0"></iframe>
+                        <fullscreen :fullscreen.sync="excelFullScreen" class="container">
+                            <iframe id="excelIframe" height="100%" width="100%"
+                                    src="/marketfront/static/views/onlineShareExcel.html"
+                                    frameborder="0"></iframe>
+                        </fullscreen>
                     </div>
                 </div>
             </div>
@@ -264,6 +268,7 @@ export default {
             woNo: '',
             moveMenuList: [],
             addShareType: 0,
+            excelFullScreen: false,
         }
     },
     methods: {
@@ -743,6 +748,9 @@ export default {
                 ) || null
             );
         },
+        processFullScreen() {
+            this.excelFullScreen = !this.excelFullScreen;
+        }
     },
     mounted() {
         this.woNo = this.getUrlKey("id")//获取地址栏参数
@@ -760,6 +768,9 @@ export default {
         this.getTreeData();
     },
     created() {
+        window['fullScreen'] = (rp) => {
+            this.processFullScreen(rp);
+        }
         window['backToExcelList'] = (rp) => {
             this.closeExcel(rp);
         }