From 06cad76ce0df1cf48edfe63abc7754d00ed6d44d Mon Sep 17 00:00:00 2001 From: jmal Date: Thu, 1 Aug 2024 16:04:22 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E7=A9=BA=E6=A0=BC?= =?UTF-8?q?=E9=94=AE=E5=BF=AB=E9=80=9F=E9=A2=84=E8=A7=88docx=E5=92=8Cexcel?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 4 + public/resource/font_2024484_jfax4gppvg.js | 1 - public/resource/font_2024484_yd6mpe5qfy.js | 1 + src/components/Icon/Icon.vue | 2 +- src/components/Icon/IconFile.vue | 5 +- src/components/ShowFile/ShowFile.vue | 32 ++-- src/components/preview/FileDetails.vue | 162 +++++++++++++++++---- src/utils/file-type.js | 2 + 8 files changed, 164 insertions(+), 45 deletions(-) delete mode 100644 public/resource/font_2024484_jfax4gppvg.js create mode 100644 public/resource/font_2024484_yd6mpe5qfy.js diff --git a/package.json b/package.json index b13ddef..2eab659 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,9 @@ "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml" }, "dependencies": { + "@vue-office/docx": "^1.6.2", + "@vue-office/excel": "^1.7.11", + "@vue/composition-api": "^1.7.2", "ant-design-vue": "^1.6.5", "clipboard": "^2.0.6", "cropperjs": "^1.5.6", @@ -52,6 +55,7 @@ "vditor": "3.10.4", "vue-aplayer": "^1.6.1", "vue-color": "^2.8.1", + "vue-demi": "^0.14.6", "vue-runtime-helpers": "^1.1.2", "vue-simple-uploader": "0.7.6", "vuedraggable": "^2.23.2", diff --git a/public/resource/font_2024484_jfax4gppvg.js b/public/resource/font_2024484_jfax4gppvg.js deleted file mode 100644 index 9bb7434..0000000 --- a/public/resource/font_2024484_jfax4gppvg.js +++ /dev/null @@ -1 +0,0 @@ -window._iconfont_svg_string_2024484='',function(c){var l=(l=document.getElementsByTagName("script"))[l.length-1],a=l.getAttribute("data-injectcss"),l=l.getAttribute("data-disable-injectsvg");if(!l){var h,t,p,i,M,d=function(l,a){a.parentNode.insertBefore(l,a)};if(a&&!c.__iconfont__svg__cssinject__){c.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(l){console&&console.log(l)}}h=function(){var l,a=document.createElement("div");a.innerHTML=c._iconfont_svg_string_2024484,(a=a.getElementsByTagName("svg")[0])&&(a.setAttribute("aria-hidden","true"),a.style.position="absolute",a.style.width=0,a.style.height=0,a.style.overflow="hidden",a=a,(l=document.body).firstChild?d(a,l.firstChild):l.appendChild(a))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(h,0):(t=function(){document.removeEventListener("DOMContentLoaded",t,!1),h()},document.addEventListener("DOMContentLoaded",t,!1)):document.attachEvent&&(p=h,i=c.document,M=!1,F(),i.onreadystatechange=function(){"complete"==i.readyState&&(i.onreadystatechange=null,z())})}function z(){M||(M=!0,p())}function F(){try{i.documentElement.doScroll("left")}catch(l){return void setTimeout(F,50)}z()}}(window); diff --git a/public/resource/font_2024484_yd6mpe5qfy.js b/public/resource/font_2024484_yd6mpe5qfy.js new file mode 100644 index 0000000..4ba0fed --- /dev/null +++ b/public/resource/font_2024484_yd6mpe5qfy.js @@ -0,0 +1 @@ +window._iconfont_svg_string_2024484='',function(c){var l=(l=document.getElementsByTagName("script"))[l.length-1],a=l.getAttribute("data-injectcss"),l=l.getAttribute("data-disable-injectsvg");if(!l){var h,t,p,i,M,z=function(l,a){a.parentNode.insertBefore(l,a)};if(a&&!c.__iconfont__svg__cssinject__){c.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(l){console&&console.log(l)}}h=function(){var l,a=document.createElement("div");a.innerHTML=c._iconfont_svg_string_2024484,(a=a.getElementsByTagName("svg")[0])&&(a.setAttribute("aria-hidden","true"),a.style.position="absolute",a.style.width=0,a.style.height=0,a.style.overflow="hidden",a=a,(l=document.body).firstChild?z(a,l.firstChild):l.appendChild(a))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(h,0):(t=function(){document.removeEventListener("DOMContentLoaded",t,!1),h()},document.addEventListener("DOMContentLoaded",t,!1)):document.attachEvent&&(p=h,i=c.document,M=!1,F(),i.onreadystatechange=function(){"complete"==i.readyState&&(i.onreadystatechange=null,d())})}function d(){M||(M=!0,p())}function F(){try{i.documentElement.doScroll("left")}catch(l){return void setTimeout(F,50)}d()}}(window); diff --git a/src/components/Icon/Icon.vue b/src/components/Icon/Icon.vue index bb33a19..82e8eea 100644 --- a/src/components/Icon/Icon.vue +++ b/src/components/Icon/Icon.vue @@ -5,7 +5,7 @@ import { Icon } from 'ant-design-vue' const IconFont = Icon.createFromIconfontCN({ - scriptUrl: document.location.protocol + '/resource/font_2024484_jfax4gppvg.js' + scriptUrl: document.location.protocol + '/resource/font_2024484_yd6mpe5qfy.js' }) // 把此段代码贴到iconfont项目页面的控制台中, 以获取图标列表 diff --git a/src/components/Icon/IconFile.vue b/src/components/Icon/IconFile.vue index 6d8df3b..52ea9af 100644 --- a/src/components/Icon/IconFile.vue +++ b/src/components/Icon/IconFile.vue @@ -93,7 +93,7 @@
+ fit="contain" :src="item.fileId ? (imageUrl+item.fileId) : (imageUrl+item.id)" :class="item.showCover ? 'cover' : ''">
@@ -309,5 +309,8 @@ export default { padding: 0 2px; line-height: 12px; } +>>> .el-image.cover { + box-shadow: 0 2px 12px 0 rgba(0,0,0,.1); +} diff --git a/src/components/ShowFile/ShowFile.vue b/src/components/ShowFile/ShowFile.vue index e4dede4..a997d41 100644 --- a/src/components/ShowFile/ShowFile.vue +++ b/src/components/ShowFile/ShowFile.vue @@ -603,7 +603,7 @@ :status.sync="iframePreviewVisible" > - + count + this.getCharLength(char), - 0 - ) - + let chineseLength = Array.from(base).reduce((count, char) => count + this.getCharLength(char), 0) return suffix ? chineseLength + suffix.length + 1 : chineseLength }, checkCmdKey(event) { @@ -1397,9 +1401,13 @@ export default { const isCmd = this.checkCmdKey(event) const checkPreviewVisible = this.checkPreviewVisible() // space - if (keyCode === 32 && this.selectRowData.length > 0 && !this.drawer && !checkPreviewVisible) { - this.drawer = true - this.drawerShowTime = Date.now() + if (keyCode === 32 && this.selectRowData.length > 0 && !checkPreviewVisible) { + if (!this.drawer) { + this.drawer = true + this.drawerShowTime = Date.now() + } else { + this.drawer = false + } event.preventDefault() event.stopPropagation() } @@ -4206,6 +4214,7 @@ export default { }, // 点击文件或文件夹 fileClick(row, event) { + this.drawer = false if (this.queryFileType === 'trash') { return } @@ -4582,5 +4591,4 @@ export default { .mt-5 { margin-top: 5px; } - diff --git a/src/components/preview/FileDetails.vue b/src/components/preview/FileDetails.vue index e461412..5005ca7 100644 --- a/src/components/preview/FileDetails.vue +++ b/src/components/preview/FileDetails.vue @@ -1,16 +1,31 @@