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/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..5449abf --- /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..ab2cb43 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({ @@ -180,6 +191,14 @@ export default { params }) }, + // 挂载文件夹 + mountFolder: function(data) { + return request({ + url: '/share/mount-folder', + method: 'put', + data: data + }) + }, // 验证提取码 validShareCode: function(data) { return request({ @@ -302,5 +321,5 @@ export default { method: 'get', params }) - }, + } } diff --git a/src/api/user.js b/src/api/user.js index cfd24f3..f1a06c7 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -54,6 +54,14 @@ export function getInfo(params) { }) } +export function getUsername(params) { + return request({ + url: 'user/username', + method: 'get', + params + }) +} + export function userList(params) { return request({ url: 'user/userList', diff --git a/src/components/FileTree/index.vue b/src/components/FileTree/index.vue index 39680fe..2dfec22 100644 --- a/src/components/FileTree/index.vue +++ b/src/components/FileTree/index.vue @@ -3,7 +3,7 @@ - + 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/Icon/IconFile.vue b/src/components/Icon/IconFile.vue index 6af407a..7876819 100644 --- a/src/components/Icon/IconFile.vue +++ b/src/components/Icon/IconFile.vue @@ -10,6 +10,16 @@ +
+
+ + +
+
+ + +
+
diff --git a/src/components/Minder/minder.vue b/src/components/Minder/minder.vue index 8c4b06c..c21ced8 100644 --- a/src/components/Minder/minder.vue +++ b/src/components/Minder/minder.vue @@ -178,7 +178,7 @@ export default { return } let request = 'previewText' - if (this.hasReadOnly) { + if (!this.$store.state.user.token) { request = 'sharePreviewText' } this.content = null @@ -411,6 +411,7 @@ export default { relativePath: encodeURI(this.file.path + this.file.name), userId: this.$store.state.user.userId, username: this.$store.state.user.name, + mountFileId: this.$store.state.user.userId !== this.file.userId ? this.file.id : '', contentText: value }).then(() => { this.saveBtnUpdating = false diff --git a/src/components/ShareDialog/index.vue b/src/components/ShareDialog/index.vue index b4b26c3..d0b966b 100644 --- a/src/components/ShareDialog/index.vue +++ b/src/components/ShareDialog/index.vue @@ -10,14 +10,15 @@ :audio-cover-url="audioCoverUrl">
-
@@ -180,6 +192,7 @@ export default { expiresDateOption: 1, isPrivacy: false, expiresDate: '', + operationPermissionList: undefined }, shareLink: "", qrCodeshareLink: "", @@ -187,18 +200,32 @@ export default { shareOptionConfig: { shared: false, linkLabel: "选择有效期", - } + }, + filename: '',// 文件名 + } + }, + computed: { + filenamePath() { + return this.filename.slice(0, this.filename.lastIndexOf('/')) } }, watch: { status(visible) { if (visible) { + this.filename = this.file.name this.shareDialogVisible = true if (this.file.shareId) { + api.getFileInfoById({ + id: this.file.fileId + }).then(res => { + this.filename = res.data.path + this.file.name + }) + this.shareOptionConfig.shared = true this.shareOptionConfig.linkLabel = '分享链接' this.setShareLink(this.getShareLink(this.file.shareId)) this.shareOption.isPrivacy = this.file.isPrivacy + this.shareOption.operationPermissionList = this.file.operationPermissionList || [] if (this.file.expireDate) { this.shareOption.expiresDate = moment(this.file.expireDate).format('x') } @@ -215,9 +242,12 @@ export default { } }, methods: { - setShareLink(sahreLink) { - this.shareLink = sahreLink - QRCode.toDataURL(sahreLink) + permissionActionChange() { + this.createShare() + }, + setShareLink(shareLink) { + this.shareLink = shareLink + QRCode.toDataURL(shareLink) .then(url => { this.qrCodeshareLink = url }) @@ -247,6 +277,7 @@ export default { submitShare() { this.$refs.form.validate((valid) => { if (valid) { + this.shareOption.operationPermissionList = undefined this.createShare() } else { console.log('error submit!!'); @@ -279,16 +310,18 @@ export default { fileId: this.file.fileId, isFolder: this.file.isFolder, expireDate: expireDate, - isPrivacy: this.shareOption.isPrivacy + isPrivacy: this.shareOption.isPrivacy, + operationPermissionList: this.shareOption.operationPermissionList }).then(res => { if (res.data) { - let {shareId, extractionCode} = res.data + let {shareId, extractionCode, operationPermissionList} = res.data this.setShareLink(this.getShareLink(shareId)) this.generateShareLinkLoading = false this.shareOptionConfig.shared = true this.shareOption.expiresDateOption = 2 this.shareOptionConfig.linkLabel = "分享链接" this.extractionCode = extractionCode + this.shareOption.operationPermissionList = operationPermissionList || [] this.$emit('onSuccess', shareId) if (update) { if (!expireDate) { @@ -385,13 +418,14 @@ export default { } > > > .el-form-item__label { + text-align: left; line-height: 32px; } .shared-expires-text { text-align: right; line-height: 32px; - padding-right: 5px; + padding-right: 10px; } } @@ -428,5 +462,9 @@ export default { text-align: center; padding: 0 10px; } + + >>> .el-collapse { + border-top: 0; + } } diff --git a/src/components/ShowFile/ShowFile.vue b/src/components/ShowFile/ShowFile.vue index f8a5fd8..2a164ae 100644 --- a/src/components/ShowFile/ShowFile.vue +++ b/src/components/ShowFile/ShowFile.vue @@ -1,23 +1,42 @@