From 2b216cbf686092cf6215c083d2ee3ca996dae2fb Mon Sep 17 00:00:00 2001 From: jmal Date: Tue, 18 Jul 2023 16:08:00 +0800 Subject: [PATCH 01/27] refactor: Object storage management area changed to optional. --- package.json | 2 +- src/views/setting/ossManager.vue | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/package.json b/package.json index 6cc389b..3760362 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "vditor": "3.9.3", "vue-aplayer": "^1.6.1", "vue-runtime-helpers": "^1.1.2", - "vue-simple-uploader": "^0.7.4", + "vue-simple-uploader": "0.7.6", "vuedraggable": "^2.23.2", "vuex": "^3.1.0", "websocket": "^1.0.34" diff --git a/src/views/setting/ossManager.vue b/src/views/setting/ossManager.vue index d113857..014140e 100644 --- a/src/views/setting/ossManager.vue +++ b/src/views/setting/ossManager.vue @@ -124,9 +124,6 @@ export default { secretKey: [ {required: true, message: '请填写secretKey', trigger: 'submit'} ], - region: [ - {required: true, message: '请填写region', trigger: 'submit'} - ], bucket: [ {required: true, message: '请填写bucket', trigger: 'submit'} ], From 6b5cb7f7363d8bb761a3505a663b9ebbef762586 Mon Sep 17 00:00:00 2001 From: jmal Date: Tue, 18 Jul 2023 16:21:43 +0800 Subject: [PATCH 02/27] =?UTF-8?q?refactor:=20=E5=88=86=E4=BA=AB=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E5=8E=BB=E6=8E=89=E5=A4=9A=E4=BD=99=E7=9A=84=E9=83=A8?= =?UTF-8?q?=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/index.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/layout/index.vue b/src/layout/index.vue index fa28b74..a05da1e 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -70,6 +70,9 @@ export default { if(this.$route.path.startsWith('/setting')){ this.isShow = true } + if (this.$route.path.startsWith('/s/')) { + this.isShow = false + } }else{ this.isShow = false } From 67086c47ca74a120e366de64d1d5f5e98d8cd4dd Mon Sep 17 00:00:00 2001 From: jmal Date: Tue, 18 Jul 2023 17:04:16 +0800 Subject: [PATCH 03/27] =?UTF-8?q?refactor:=20=E5=8F=96=E6=B6=88=E5=88=86?= =?UTF-8?q?=E4=BA=AB=E6=B7=BB=E5=8A=A0=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/share/index.vue | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/src/views/share/index.vue b/src/views/share/index.vue index de61b82..f770d69 100644 --- a/src/views/share/index.vue +++ b/src/views/share/index.vue @@ -443,23 +443,30 @@ }, // 取消分享 cancelShare(row) { - let shareIds = [] - if(row){ - shareIds.push(row.id) - } else { - this.selectRowData.forEach(row => { - shareIds.push(row.id) - }) - } - api.cancelShareLink({ - userId: this.$store.state.user.userId, - shareId: shareIds + let title = row === false ? '确定要取消选中的' + this.selectRowData.length + '项分享吗?' : '确定要取消分享 "' + row.fileName + '" 吗?' + this.$confirm(title, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' }).then(() => { - if(shareIds.length === 1){ - this.fileList.splice(row.index,1) - }else{ - this.getFileList() + let shareIds = [] + if(row){ + shareIds.push(row.id) + } else { + this.selectRowData.forEach(row => { + shareIds.push(row.id) + }) } + api.cancelShareLink({ + userId: this.$store.state.user.userId, + shareId: shareIds + }).then(() => { + if(shareIds.length === 1){ + this.fileList.splice(row.index,1) + }else{ + this.getFileList() + } + }) }) }, // 点击文件或文件夹 From 0302ba61979b5a4fddee5f1cfdc8d4ddb40a35b2 Mon Sep 17 00:00:00 2001 From: jmal Date: Tue, 18 Jul 2023 17:43:15 +0800 Subject: [PATCH 04/27] =?UTF-8?q?style:=20=E4=BC=98=E5=8C=96=E5=88=86?= =?UTF-8?q?=E4=BA=AB=E5=9B=BE=E6=A0=87=E7=9A=84=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ShowFile/ShowFile.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ShowFile/ShowFile.vue b/src/components/ShowFile/ShowFile.vue index f8a5fd8..b9e44e9 100644 --- a/src/components/ShowFile/ShowFile.vue +++ b/src/components/ShowFile/ShowFile.vue @@ -2969,7 +2969,7 @@ export default { } this.shareDialogObject = row this.shareDialogObject.fileId = row.id - this.shareDialogObject.shareBase = undefined + this.shareDialogObject.shareBase = row.shareBase this.shareDialogVisible = true }, shareSuccess(shareBase) { From 668113308dd6ef364f7604b82c15788e368dc9eb Mon Sep 17 00:00:00 2001 From: jmal Date: Tue, 1 Aug 2023 18:07:36 +0800 Subject: [PATCH 05/27] style: Collection interface and video interface default changed to grid view --- src/views/favorite/index.vue | 2 +- src/views/fileType/video.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/favorite/index.vue b/src/views/favorite/index.vue index da1b60b..5a13f11 100644 --- a/src/views/favorite/index.vue +++ b/src/views/favorite/index.vue @@ -2,7 +2,7 @@
Date: Sat, 5 Aug 2023 16:47:19 +0800 Subject: [PATCH 06/27] style: Optimize the login interface style --- src/views/login/index.vue | 173 +++++++++++++++++++------------------- 1 file changed, 85 insertions(+), 88 deletions(-) diff --git a/src/views/login/index.vue b/src/views/login/index.vue index e8bc979..54ad7b4 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -5,100 +5,93 @@
- - - -
-


+ + + + + + + + + + {{initialize?'创建':'登录'}} + + +
+ @@ -285,6 +278,7 @@ $cursor: #409eff; } .login-container { + .el-input { display: inline-block; height: 47px; @@ -332,12 +326,15 @@ $light_gray:#eee; overflow: hidden; background: linear-gradient(#002766,30%, #0040f4); + .login-content { + display: flex; + justify-content: center; + align-items: center; + height: 100vh; + } + .box-card { - text-align: center; max-width: 316px; - margin-top: 128px; - margin-left: auto; - margin-right: auto; } .login-form { From 12622418f722c526816bcb022dbdd375b43ab158 Mon Sep 17 00:00:00 2001 From: jmal Date: Sat, 5 Aug 2023 18:01:05 +0800 Subject: [PATCH 07/27] perf: Optimize the creation of new folders in the file tree --- src/components/ShowFile/ShowFile.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/ShowFile/ShowFile.vue b/src/components/ShowFile/ShowFile.vue index b9e44e9..604d0d4 100644 --- a/src/components/ShowFile/ShowFile.vue +++ b/src/components/ShowFile/ShowFile.vue @@ -485,7 +485,7 @@ > @@ -35,6 +36,15 @@ + + + + + +
@@ -284,9 +294,11 @@ import Clipboard from "clipboard"; import OfficePreview from "@/components/preview/OfficePreview"; import Logo from "@/components/Logo"; import store from "@/store"; +import FileTree from "@/components/FileTree"; export default { components: { + FileTree, Logo, OfficePreview, IconFile, BreadcrumbFilePath, AlLoading, AudioPreview, VideoPreview, ImageViewer, SimTextPreview @@ -368,6 +380,7 @@ export default { dialogMoveOrCopyVisible: false, directoryTreeData: [], selectTreeNode: {}, + fileTreeAndNewFolderDisabled: false, directoryTreeProps: { label: 'name', children: 'children', @@ -404,13 +417,16 @@ export default { audioPreviewVisible: false, showUpdateDateItem: this.$pc,// 列表模式下是否显示修改时间 showSizeItem: this.$pc,// 列表模式下是否显示文件大小 - sharer: undefined,//分享者信息 + sharer: undefined,//分享者信息, + loginTitle: '', sharerAvatarUrl: '', netdiskName: 'JmalCloud', netdiskLogo: '', showShareCode: false, shareData: {}, - extractionCode: '' + extractionCode: '', + mountToVisible: false, + mountFileData: [], } }, computed: { @@ -674,6 +690,7 @@ export default { getSharer() { api.getSharer({shareId: this.shareId}).then(res => { this.sharer = res.data + this.setLoginTitle() if (res.data) { this.sharerAvatarUrl = window.location.origin + this.imageUrl + res.data.avatar if (this.sharer.netdiskName) { @@ -689,6 +706,17 @@ export default { } }) }, + setLoginTitle() { + if (this.$store.getters.token) { + if (this.sharer.userId === this.$store.getters.userId) { + this.loginTitle = '' + } else { + this.loginTitle = '挂载到我的云盘' + } + } else { + this.loginTitle = '登录' + } + }, currentChange(pageIndex) { this.pagination.pageIndex = pageIndex if (this.pagination.fileId) { @@ -934,6 +962,31 @@ export default { } this.$refs.contextShow.hideMenu() }, + /** + * 登录或挂载 + */ + loginOrMount() { + if (this.$store.getters.token) { + // 挂载 + this.mountToVisible = true + const that = this + // setTimeout(function () { + // that.selectTreeNode = that.$refs.directoryTree.getCurrentNode() + // that.selectTreeNode.showName = ' "' + that.selectTreeNode.name + '"' + // }, 100) + } else { + // 登录 + this.$router.push({path: '/login', query: {redirect: this.$route.fullPath}}) + } + }, + fileTreeAndNewFolder() { + this.$refs.fileTreeMount.fileTreeAndNewFolder(this.selectTreeNode) + }, + onTreeNodeClick(row) { + this.fileTreeAndNewFolderDisabled = row.hasOwnProperty('newFolder'); + this.selectTreeNode = row + this.selectTreeNode.showName = ' "' + row.name + '"' + }, downloadFile(copy) { let totalSize = 0 if (this.indexList.length > 0) { @@ -1085,8 +1138,12 @@ export default { text-align: center; font-size: 18px; font-weight: 500; - margin-top: 20px; - height: 45px; + margin-bottom: 10px; + display: flex; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + justify-content: space-between; .logo { font-size: 20px; @@ -1109,7 +1166,6 @@ export default { font-size: 14px; float: right; top: 10px; - margin-top: -34px; > > > .el-avatar { margin: 0 0 0 10px; @@ -1211,5 +1267,13 @@ export default { margin-top: 10px; } +>>> .el-input-tree { + width: 50% !important; +} + +>>> .el-input-tree-button { + margin-left: 5px !important; +} + From 2e83e58ef91c8e6e7675d9a16c78e6cbc25ed141 Mon Sep 17 00:00:00 2001 From: jmal Date: Sat, 5 Aug 2023 18:46:24 +0800 Subject: [PATCH 09/27] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E5=9C=A8grid?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E8=A7=86=E5=9B=BE=E4=B8=8B=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=90=8D=E7=9A=84=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ShowFile/ShowFile.vue | 46 +++++++++++++++++----------- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/src/components/ShowFile/ShowFile.vue b/src/components/ShowFile/ShowFile.vue index 604d0d4..1d1cb16 100644 --- a/src/components/ShowFile/ShowFile.vue +++ b/src/components/ShowFile/ShowFile.vue @@ -809,28 +809,38 @@ export default { ]), gridFilename() { return function (item) { - let filename = item.name + let filename = item.name; if (item.folder) { - return filename + return filename; } - let sliceLength = 9 - let chineseLength = 0 - for (let i = 0; i < 9; i++) { - let code = filename.charCodeAt(i); - if (code > 255) { - // 如果编码大于255,说明是中文 - chineseLength++ + + // 分离文件名和后缀 + let parts = filename.split("."); + let suffix = parts.pop(); + let base = parts.join('.'); + + let chineseLength = Array.from(base).reduce((count, char) => count + (char.charCodeAt(0) > 255 ? 2 : 1), 0); + + let effectiveLength = chineseLength + suffix.length + 1; // 计算文件名的有效长度,包括后缀和点 + if (effectiveLength <= 14) { + return filename; + } + + let sliceLength = 14 - suffix.length - 2; // 2 是 "…" 的长度 + + // 截取字符串时需要考虑中文字符 + let prev = ''; + let currentLength = 0; + for (let char of Array.from(base)) { + let charLength = char.charCodeAt(0) > 255 ? 2 : 1; + if (currentLength + charLength > sliceLength) { + break; } + currentLength += charLength; + prev += char; } - sliceLength -= Math.ceil(chineseLength / 2) - let suffix = filename.split(".").pop() - let prev = filename.slice(0, sliceLength) - let next = filename.slice(-suffix.length - 1) - let abb = prev + "…" + next - if (abb.length + 1 >= filename.length) { - return filename - } - return prev + "…" + next + + return prev + "…" + suffix; } }, getSummaries2() { From 60106bbed83afb9a5239363e35c880786d6275a8 Mon Sep 17 00:00:00 2001 From: jmal Date: Sat, 5 Aug 2023 18:56:38 +0800 Subject: [PATCH 10/27] Optimize the display of file names in grid file view --- src/components/ShowFile/ShowFile.vue | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/components/ShowFile/ShowFile.vue b/src/components/ShowFile/ShowFile.vue index 1d1cb16..27249cd 100644 --- a/src/components/ShowFile/ShowFile.vue +++ b/src/components/ShowFile/ShowFile.vue @@ -810,23 +810,27 @@ export default { gridFilename() { return function (item) { let filename = item.name; - if (item.folder) { + if (item.isFolder) { return filename; } // 分离文件名和后缀 let parts = filename.split("."); - let suffix = parts.pop(); + let suffix = parts.length > 1 ? parts.pop() : ""; let base = parts.join('.'); + // 计算基础名的中文字符长度 let chineseLength = Array.from(base).reduce((count, char) => count + (char.charCodeAt(0) > 255 ? 2 : 1), 0); - let effectiveLength = chineseLength + suffix.length + 1; // 计算文件名的有效长度,包括后缀和点 + // 如果有后缀,计算有效长度时要加上后缀和点,否则只需要基础名和后7位 + let effectiveLength = suffix ? chineseLength + suffix.length + 1 : chineseLength + 7; + if (effectiveLength <= 14) { return filename; } - let sliceLength = 14 - suffix.length - 2; // 2 是 "…" 的长度 + // 计算应当截取的长度,如果有后缀,要留出空间给后缀和省略号 + let sliceLength = 14 - (suffix ? suffix.length + 1 : 7); // 截取字符串时需要考虑中文字符 let prev = ''; @@ -840,7 +844,8 @@ export default { prev += char; } - return prev + "…" + suffix; + // 如果有后缀,返回 prev + "…" + suffix,否则返回 prev + "…" + base 的后7位 + return suffix ? prev + "…" + suffix : prev + "…" + base.slice(-7); } }, getSummaries2() { From cc4571f98c5838f7d707d463f2408b5dd5fd1c8a Mon Sep 17 00:00:00 2001 From: jmal Date: Sat, 5 Aug 2023 20:06:02 +0800 Subject: [PATCH 11/27] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E7=BC=96=E8=BE=91=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/preview/SimTextPreview.vue | 67 +++++++++++++---------- 1 file changed, 37 insertions(+), 30 deletions(-) diff --git a/src/components/preview/SimTextPreview.vue b/src/components/preview/SimTextPreview.vue index 5fb3a55..3e66ce8 100644 --- a/src/components/preview/SimTextPreview.vue +++ b/src/components/preview/SimTextPreview.vue @@ -55,16 +55,16 @@ 保存所有 - - - - - - - - - - + + +
-
+
-
+
- + editable.name === pathname) const tab = this.editableTabs[currentIndex] @@ -590,7 +591,7 @@ that.dialogWidth = dialogWidth + moveX that.editorWidth = editorWidth + moveX that.editorHieght = editorHieght + (endY - startY) - that.loadConterSize() + that.loadContentSize() } } // 鼠标松开事件 @@ -714,7 +715,7 @@ fileName: row.name, username: this.$store.state.user.name } - api.previewTextByPath(params).then((res)=>{ + api.previewTextByPath(params).then(()=>{ this.loading.close() // 添加一个tab let tab = { @@ -797,11 +798,7 @@ this.loadEditorSize() }, checkMobile() { - if (!this.$pc) { - this.moblie = true - } else { - this.moblie = false - } + this.moblie = !this.$pc; }, checkReadOnly(fileUserId){ if(this.$store.state.user.token && this.$store.state.user.userId === fileUserId){ @@ -827,12 +824,12 @@ this.editorWidth = this.dialogWidth - this.contentsWidth } this.editorHieght = document.body.clientHeight * this.dialogWidthPercent - 76 - this.loadConterSize() + this.loadContentSize() }, - loadConterSize(){ - let conter = document.querySelector('.editor-resize .editor-resize-conter'); - if(conter){ - conter.style.marginTop = ((this.editorHieght+26)/2 - conter.clientHeight/2) + 'px' + loadContentSize(){ + let content = document.querySelector('.editor-resize .editor-resize-conter'); + if(content){ + content.style.marginTop = ((this.editorHieght+26)/2 - content.clientHeight/2) + 'px' } }, handleClose(done) { @@ -866,6 +863,7 @@ } }, closeDialog() { + this.previewMode = false this.textPreviewVisible = false this.$emit('update:status', this.textPreviewVisible) this.isSaveDialogVisible = false @@ -1037,8 +1035,10 @@ this.clickTab() }, clickTab() { - // this.editorWidth += 0.001 - // this.editorHieght += 0.001 + this.editorWidth += 0.001 + this.editorHieght += 0.001 + // 加载历史版本 + this.$refs.historyPopover.loadHistoryPathList(this.editableTabsValue) }, removeTab(targetName) { let tabs = this.editableTabs; @@ -1534,13 +1534,20 @@ .nwse-resize { z-index: 99999; position: fixed; - width: 15px; - background: #00000000; + width: 12px; + margin-left: 3px; + background: #f0f0f0; height: 15px; margin-top: -15px; float: right; cursor: nwse-resize; } + .nwse-resize::before { + content: "⠿"; + display: inline-block; + padding-right: 5px; + vertical-align: middle; + } .el-button--small.is-circle { padding: 9px 9px; } From a1ce2c5b95ee9b4b428c5031e53b05ef2dc70f3d Mon Sep 17 00:00:00 2001 From: jmal Date: Sat, 5 Aug 2023 21:05:52 +0800 Subject: [PATCH 12/27] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=9C=80?= =?UTF-8?q?=E8=BF=91=E3=80=81=E6=94=B6=E8=97=8F=E3=80=81=E9=9F=B3=E4=B9=90?= =?UTF-8?q?=E7=AD=89=E7=95=8C=E9=9D=A2=E6=9C=89=E6=97=B6=E5=80=99=E7=99=BD?= =?UTF-8?q?=E5=B1=8F=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ShowFile/ShowFile.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/ShowFile/ShowFile.vue b/src/components/ShowFile/ShowFile.vue index 27249cd..07463ae 100644 --- a/src/components/ShowFile/ShowFile.vue +++ b/src/components/ShowFile/ShowFile.vue @@ -800,7 +800,8 @@ export default { showUpdateDateItem: true,// 列表模式下是否显示修改时间 showSizeItem: true,// 列表模式下是否显示文件大小 stopSortChange: false, - draging: 0,// 是否正在拖拽中,0:没有拖拽,1:拖拽中 + draging: 0,// 是否正在拖拽中,0:没有拖拽,1:拖拽中, + getFileListed: false, } }, computed: { @@ -938,6 +939,12 @@ export default { Bus.$on('msg/file/change', (msg) => this.onmessage(msg)) Bus.$on('msg/file/operation/fault', (msg) => this.onmessageFault(msg)) + + setTimeout(() => { + if (!this.getFileListed) { + this.getFileList() + } + }, 50) }, beforeDestroy() { window.removeEventListener('keydown', this.keydown, false) @@ -2120,6 +2127,7 @@ export default { this.path = this.path.replace(/\\/g, '/') }, getFileList(onLoad) { + this.getFileListed = true this.beforeLoadData(onLoad) api.fileList({ userId: this.$store.state.user.userId, From 31273289b565de7c0f835c3c5570e1de8ee3cba7 Mon Sep 17 00:00:00 2001 From: jmal Date: Wed, 9 Aug 2023 18:25:05 +0800 Subject: [PATCH 13/27] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E6=96=87=E4=BB=B6=E5=89=AF=E6=9C=AC=E7=9A=84=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/resource/font_2024484_qwtkvngfp5b.js | 1 - public/resource/font_2024484_qwtkvngfp5d.js | 1 + src/api/file-api.js | 13 +- src/components/Icon/Icon.vue | 2 +- src/components/ShowFile/ShowFile.vue | 3929 +++++++++++-------- 5 files changed, 2282 insertions(+), 1664 deletions(-) delete mode 100644 public/resource/font_2024484_qwtkvngfp5b.js create mode 100644 public/resource/font_2024484_qwtkvngfp5d.js diff --git a/public/resource/font_2024484_qwtkvngfp5b.js b/public/resource/font_2024484_qwtkvngfp5b.js deleted file mode 100644 index f2a686a..0000000 --- a/public/resource/font_2024484_qwtkvngfp5b.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_qwtkvngfp5d.js b/public/resource/font_2024484_qwtkvngfp5d.js new file mode 100644 index 0000000..ee6c9dd --- /dev/null +++ b/public/resource/font_2024484_qwtkvngfp5d.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,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/src/api/file-api.js b/src/api/file-api.js index 813951a..4e62db8 100644 --- a/src/api/file-api.js +++ b/src/api/file-api.js @@ -153,6 +153,17 @@ export default { } }) }, + /** + * 创建副本 + * @param params + */ + duplicateFile(params) { + return request({ + url: 'duplicate', + method: 'get', + params + }) + }, // 生成分享链接 generate: function(data) { return request({ @@ -302,5 +313,5 @@ export default { method: 'get', params }) - }, + } } diff --git a/src/components/Icon/Icon.vue b/src/components/Icon/Icon.vue index a838390..34a3d12 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_qwtkvngfp5b.js' + scriptUrl: document.location.protocol + '/resource/font_2024484_qwtkvngfp5d.js' }) // 把此段代码贴到iconfont项目页面的控制台中, 以获取图标列表 diff --git a/src/components/ShowFile/ShowFile.vue b/src/components/ShowFile/ShowFile.vue index 07463ae..4777598 100644 --- a/src/components/ShowFile/ShowFile.vue +++ b/src/components/ShowFile/ShowFile.vue @@ -1,23 +1,42 @@