Browse Source

更新依赖

ZaiZai 9 months ago
parent
commit
186fca1ede
3 changed files with 21 additions and 4 deletions
  1. 1 0
      package.json
  2. 15 4
      src/views/exctab/modules/template.vue
  3. 5 0
      yarn.lock

+ 1 - 0
package.json

@@ -39,6 +39,7 @@
         "eslint": "^8.56.0",
         "eslint-plugin-vue": "^9.24.0",
         "sass": "^1.77.4",
+        "screenfull": "^6.0.2",
         "unocss": "^0.58.9",
         "unocss-preset-extra": "^0.5.3",
         "vite": "^5.2.13"

+ 15 - 4
src/views/exctab/modules/template.vue

@@ -59,7 +59,9 @@
                 <template #extra>
                     <el-button v-if="tableTempExcelProps.file" hc-btn type="primary" @click="fullScreenClick">全屏显示</el-button>
                 </template>
-                <hc-online-office v-if="isShow" ui="hc-table-temp-excel" :props="tableTempExcelProps" />
+                <div :id="tableTempExcelId" class="relative h-full">
+                    <hc-online-office v-if="isShow" ui="hc-table-temp-excel" :props="tableTempExcelProps" />
+                </div>
             </hc-card>
         </hc-body>
     </hc-drawer>
@@ -68,7 +70,8 @@
 <script setup>
 import { ref, watch } from 'vue'
 import { useAppStore } from '~src/store'
-import { getArrValue, getObjValue, isNullES } from 'js-fast-way'
+import screenfull from 'screenfull'
+import { getArrValue, getObjValue, getRandom, isNullES } from 'js-fast-way'
 import mainApi from '~api/exctab/exceltab'
 
 const props = defineProps({
@@ -99,8 +102,9 @@ watch(isShow, (val) => {
 })
 
 //处理相关数据
+const tableTempExcelId = ref('')
 const getDataApi = () => {
-
+    tableTempExcelId.value = getRandom(6)
 }
 
 //树搜索
@@ -240,7 +244,14 @@ const getDetailExcel = async (dataId) => {
 
 //全屏显示
 const fullScreenClick = () => {
-
+    // 判断是否支持
+    if (!screenfull.isEnabled) {
+        window.$message.warning('当前浏览器不支持全屏')
+        return false
+    }
+    //指定全屏区域元素
+    const element = document.getElementById(tableTempExcelId.value)
+    if (element) screenfull.request(element)
 }
 
 //关闭抽屉

+ 5 - 0
yarn.lock

@@ -2707,6 +2707,11 @@ sass@^1.77.4:
     immutable "^4.0.0"
     source-map-js ">=0.6.2 <2.0.0"
 
+screenfull@^6.0.2:
+  version "6.0.2"
+  resolved "http://39.108.216.210:9000/screenfull/-/screenfull-6.0.2.tgz#3dbe4b8c4f8f49fb8e33caa8f69d0bca730ab238"
+  integrity sha512-AQdy8s4WhNvUZ6P8F6PB21tSPIYKniic+Ogx0AacBMjKP1GUHN2E9URxQHtCusiwxudnCKkdy4GrHXPPJSkCCw==
+
 semver@^6.3.1:
   version "6.3.1"
   resolved "http://39.108.216.210:9000/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4"