diff --git a/public/resource/font_2024484_fwthqwcsomd.js b/public/resource/font_2024484_fwthqwcsomd.js deleted file mode 100644 index 87cafde..0000000 --- a/public/resource/font_2024484_fwthqwcsomd.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_jfax4gppvg.js b/public/resource/font_2024484_jfax4gppvg.js new file mode 100644 index 0000000..9bb7434 --- /dev/null +++ b/public/resource/font_2024484_jfax4gppvg.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 9b59fed..438399d 100644 --- a/src/api/file-api.js +++ b/src/api/file-api.js @@ -100,6 +100,35 @@ export default { } }) }, + // 返回原处 + restore: function(params) { + return request({ + url: 'restore', + method: 'post', + params, + paramsSerializer: function(params) { + return qs.stringify(params, { arrayFormat: 'repeat' }) + } + }) + }, + // 彻底删除 + sweep: function(params) { + return request({ + url: 'sweep', + method: 'delete', + params, + paramsSerializer: function(params) { + return qs.stringify(params, { arrayFormat: 'repeat' }) + } + }) + }, + // 清空回收站 + clearTrash: function() { + return request({ + url: 'clear-trash', + method: 'delete' + }) + }, // 重名名 rename: function(params) { return request({ diff --git a/src/components/Icon/Icon.vue b/src/components/Icon/Icon.vue index dedbfc0..bb33a19 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_fwthqwcsomd.js' + scriptUrl: document.location.protocol + '/resource/font_2024484_jfax4gppvg.js' }) // 把此段代码贴到iconfont项目页面的控制台中, 以获取图标列表 @@ -15,7 +15,7 @@ const IconFont = Icon.createFromIconfontCN({ // console.log(iconNames.slice(80,160)) export const iconFonts = { - list: ['gengxinjindu', 'duigou', 'bars-solid', 'sort-amount-down-solid', 'sort-amount-up-alt-solid', 'tag2', 'guazai', 'duplicate', 'play1', "qrcode", "arrow1_left", "wulianwang-","zuji","disk-drive", "menu-fuzhi", "iso", "zuijinhuoyue","key", "shouquan", "sort", "grid", "list", "emoji-a", "emoji-bizui", "emoji-baiyan", "emoji-aixin", "emoji-dajing", "emoji-ziya", "emoji-daxiao", "emoji-esi", "emoji-fadai", "emoji-fankun", "emoji-ganga", "emoji-fennu", "emoji-hanyan", "emoji-jingkong", "emoji-haochi", "emoji-emo", "emoji-jingsong", "emoji-jingya", "emoji-kaixin", "emoji-lengku", "emoji-danao", "emoji-liukoushui", "emoji-liulei", "emoji-mengbi", "mianwubiaoqing", "nanguo", "shuizhuo", "taoyan", "tanchi", "siliao", "tiaopi", "xiaochulei", "wuliao", "xingxingyan", "xieyan", "xiasi", "xiaolian", "ku", "shengqi", "yousiliao", "en", "bushufu", "bianbian", "fankun1", "feiwen", "ganmao", "huaixiao", "liuhan", "outu", "keshui", "renzhe", "santiaoxian", "guaiwu", "shoushang", "tianshi", "shuai", "xianwen", "xiaodiaodaya", "xiong", "yiwen", "yun", "liubixie", "shimo", "dianzan", "biti", "fendou", "huqi", "heng", "kulou", "leng", "taoyan1", "shuixing", "aini", "aixin1", "zhadan", "xinsui", + list: ['huanyuan', 'huishouzhan', 'glb', 'gengxinjindu', 'duigou', 'bars-solid', 'sort-amount-down-solid', 'sort-amount-up-alt-solid', 'tag2', 'guazai', 'duplicate', 'play1', "qrcode", "arrow1_left", "wulianwang-","zuji","disk-drive", "menu-fuzhi", "iso", "zuijinhuoyue","key", "shouquan", "sort", "grid", "list", "emoji-a", "emoji-bizui", "emoji-baiyan", "emoji-aixin", "emoji-dajing", "emoji-ziya", "emoji-daxiao", "emoji-esi", "emoji-fadai", "emoji-fankun", "emoji-ganga", "emoji-fennu", "emoji-hanyan", "emoji-jingkong", "emoji-haochi", "emoji-emo", "emoji-jingsong", "emoji-jingya", "emoji-kaixin", "emoji-lengku", "emoji-danao", "emoji-liukoushui", "emoji-liulei", "emoji-mengbi", "mianwubiaoqing", "nanguo", "shuizhuo", "taoyan", "tanchi", "siliao", "tiaopi", "xiaochulei", "wuliao", "xingxingyan", "xieyan", "xiasi", "xiaolian", "ku", "shengqi", "yousiliao", "en", "bushufu", "bianbian", "fankun1", "feiwen", "ganmao", "huaixiao", "liuhan", "outu", "keshui", "renzhe", "santiaoxian", "guaiwu", "shoushang", "tianshi", "shuai", "xianwen", "xiaodiaodaya", "xiong", "yiwen", "yun", "liubixie", "shimo", "dianzan", "biti", "fendou", "huqi", "heng", "kulou", "leng", "taoyan1", "shuixing", "aini", "aixin1", "zhadan", "xinsui", "maren", "zhutou", "qie", "youling", "apple-fill", "attachment", "android-fill", "apple", "download", "arrow-up-circle", "arrow-right-circle", "arrow-down", "ashbin", "add", "file_music", "menu", "role", "jiaoseguanli", "yemianshezhi", "drop_down", "yuandian", "tag", "service-directory", "fabu", "wailian", "bianji-", "WEBSITE", "wangzhanguanli", "Up", "up", "fenlei", "guanlizhuanjiawenzhang", "pifu", "tuichudenglu", "shezhi", "wangzhan", "huaban", "yunshezhi", "UserSettings", "blogger", "biaoqian", "myself", "guidang", "quxiaoyulan1-copy", "yulan-copy", "quxiaoyulan1", "yulan"] } diff --git a/src/components/ShowFile/ShowFile.vue b/src/components/ShowFile/ShowFile.vue index a1f57d6..617063c 100644 --- a/src/components/ShowFile/ShowFile.vue +++ b/src/components/ShowFile/ShowFile.vue @@ -329,8 +329,6 @@ @row-contextmenu="rowContextmenu" @cell-click="cellClick" @row-dblclick="dblclick" - @cell-mouse-enter="cellMouseEnter" - @cell-mouse-leave="cellMouseLeave" @sort-change="sortChange" @table-body-scroll="tableBodyScroll" @select="pinSelect" @@ -392,69 +390,9 @@ - - - - - - - - - - { + if (this.queryFileType === 'trash') { + e.preventDefault() + e.stopPropagation() + return false + } // 正在选区获取按住关键键时禁止拖拽 if (_this.drawFlag || _this.isCmd || _this.selectPin) { e.preventDefault() @@ -1961,8 +1870,9 @@ export default { if (!_this.grid) { dragingDiv.firstChild.style.textAlign = 'center' let tds = Array.prototype.slice.call(dragingDiv.childNodes) + console.log(tds) tds.forEach((node, index) => { - if (index === 4) { + if (index === 2) { node.style.borderRadius = '0 3px 3px 0' node.style.borderRight = '1px solid #409eff' node.firstChild.style.height = '44px' @@ -1976,8 +1886,7 @@ export default { }) dragingDivStyleTop = pos.y - _this.fileListScrollTop - 51.5 } else { - dragingDivStyleTop = - pos.y - _this.fileListScrollTop - pos.h / 2 + 10 + dragingDivStyleTop = pos.y - _this.fileListScrollTop - pos.h / 2 + 10 } dragingDiv.style.top = dragingDivStyleTop + 'px' if (index === 0) { @@ -2602,10 +2511,12 @@ export default { child[0].iconClass = 'menu-point' child[1].iconClass = 'menu-empty' } - if (localStorage.getItem('showFolderSize') === 'true') { - child[2].iconClass = 'duigou' - } else { - child[2].iconClass = 'menu-empty' + if (child[2]) { + if (localStorage.getItem('showFolderSize') === 'true') { + child[2].iconClass = 'duigou' + } else { + child[2].iconClass = 'menu-empty' + } } } if (arrangementModeIndex > -1) { @@ -2859,6 +2770,7 @@ export default { order: this.sortable.order, isFolder: this.queryCondition.isFolder, isFavorite: this.queryCondition.isFavorite, + isTrash: this.queryCondition.isTrash, tagId: this.queryCondition.tagId, queryCondition: this.queryCondition, pageIndex: this.pagination.pageIndex, @@ -2996,7 +2908,8 @@ export default { if (fileSize > 0) { fileSum = fileSize + '个文件' } - return folderSum + ' ' + fileSum + const stand = folderSize > 0 && fileSize > 0 ? '、' : '' + return folderSum + stand + fileSum }, // 计算总大小 getShowSumSize(totalSize) { @@ -3047,15 +2960,13 @@ export default { selectTotalSize += item.size }) const item_name = this.tableHead[2] - const item_more = this.tableHead[4] - const item_size = this.tableHead[5] - const item_date = this.tableHead[6] + const item_size = this.tableHead[3] + const item_date = this.tableHead[4] if (rows.length > 0) { const sumFileAndFolder = this.getShowSumFileAndFolder(rows) const sizeSum = this.getShowSumSize(selectTotalSize) item_name.label = sumFileAndFolder item_name.sortable = false - item_more.name = 'more' item_size.label = sizeSum item_size.sortable = false item_date.label = '' @@ -3063,17 +2974,12 @@ export default { } else { item_name.label = '名称' item_name.sortable = true - item_more.name = '' item_size.label = '大小' item_size.sortable = true item_date.label = '修改日期' item_date.sortable = true } - if (this.selectRowData.length === this.fileList.length) { - this.allChecked = true - } else { - this.allChecked = false - } + this.allChecked = this.selectRowData.length === this.fileList.length; }, // cell-style 通过返回值可以实现样式变换利用传递过来的数组index循环改变样式 rowStyle({ row, column, rowIndex, columnIndex }) { @@ -3091,7 +2997,7 @@ export default { borderBottom: '1px solid #409eff', } } - if (columnIndex === 5) { + if (columnIndex === 3) { return { backgroundColor: '#e0f3fc !important', borderRadius: '0 3px 3px 0', @@ -3120,45 +3026,6 @@ export default { const isFavorite = this.rowContextData.isFavorite this.highlightFavorite(isFavorite, false) }, - // 单元格hover进入时事件 - cellMouseEnter(row) { - if (this.draging === 1) { - return - } - if ( - this.$refs.contextShow.locals.menuType === 'moreClick' && - this.$refs.contextShow.locals.rowIndex !== row.index - ) { - this.$refs.contextShow.hideMenu() - } - if (this.editingIndex === -1 && !this.$refs.contextShow.ctxVisible) { - if (this.selectRowData.length <= 1) { - this.cellMouseIndex = row.index - } - } - }, - // 单元格hover退出时事件 - cellMouseLeave(row) { - if (this.draging === 1) { - return - } - if ( - this.$refs.contextShow.locals.menuType === 'moreClick' && - this.$refs.contextShow.locals.rowIndex !== row.index - ) { - this.$refs.contextShow.hideMenu() - this.$refs.contextShow.locals = {} - return - } - if ( - this.$refs.contextShow.ctxVisible && - this.$refs.contextShow.locals.menuType === 'moreClick' && - this.$refs.contextShow.locals.rowIndex === row.index - ) { - return - } - this.cellMouseIndex = -1 - }, //双击 dblclick(row) { this.fileClick(row) @@ -3294,12 +3161,6 @@ export default { this.clearOnCreateFilename() } }, - // 更多操作(多选) - moreOperation(event) { - this.menusIsMultiple = true - this.menus = this.multipleMenus - this.showOperationMenus(event) - }, setMenus(row) { this.menus = JSON.parse(JSON.stringify(this.singleMenus)) // 挂载的文件 @@ -3322,12 +3183,8 @@ export default { reservations.includes(item.operation) ) } - if (!row.isFolder) { - this.menus.splice(-2, 0, { - iconClass: 'duplicate', - label: '创建副本', - operation: 'duplicate', - }) + if (!row.isFolder && this.queryFileType !== 'trash') { + this.menus.splice(-2, 0, { iconClass: 'duplicate', label: '创建副本', operation: 'duplicate'}) } if ((row.isShare && !row.shareBase) || row.ossFolder) { // 删除分享选项 @@ -3390,15 +3247,6 @@ export default { } this.setMenusCopyDownLoadLinks(file) }, - // 更多操作(单选) - moreClick(row, event) { - this.menusIsMultiple = false - this.setMenus(row) - this.showOperationMenus(event, { - menuType: 'moreClick', - rowIndex: row.index, - }) - }, // 鼠标右击 rowContextmenu(row) { if (this.selectFile) { @@ -3429,26 +3277,6 @@ export default { this.$refs.contextShow.showMenu(e) this.cellMouseIndex = -1 }, - // 显示操作菜单 - showOperationMenus(event, menuData) { - let offsetY = event.pageY - if (event.target.clientHeight > 0) { - offsetY += event.target.clientHeight / 2 - event.offsetY - } - const e = {} - if (document.body.scrollHeight - offsetY > 400) { - this.menuTriangle = 'menu-triangle-top' - e.pageX = event.pageX - 78 - e.pageY = offsetY + 25 - } else { - this.menuTriangle = 'menu-triangle-bottom' - e.pageX = event.pageX - 78 - e.pageY = offsetY - this.menus.length * 38 - 36 - } - if (!this.isJustHideMenus) { - this.$refs.contextShow.showMenu(e, menuData) - } - }, menuFavoriteOver(index, isFavorite) { this.highlightFavorite(isFavorite, false) }, @@ -3553,6 +3381,9 @@ export default { case 'createMarkdownFile': this.newDocument() break + case 'clearTrash': + this.clearTrash() + break } }, // 新建文件 @@ -3638,6 +3469,14 @@ export default { // 删除 this.deleteFile() break + case 'sweep': + // 清空回收站 + this.sweepFile() + break + case 'restore': + // 返回原处 + this.restoreFile() + break } this.$refs.contextShow.hideMenu() }, @@ -4023,32 +3862,55 @@ export default { }) } else { fileIds.push(this.rowContextData.id) + fileList.push(this.rowContextData) } const str = this.getShowSumFileAndFolder(fileList) - this.$confirm('此操作将永久删除' + str + ', 是否继续?', '提示', { + this.$confirm('将 ' + str + ' 移至回收站, 是否继续?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning', }).then(() => { - api - .delete({ + api.delete({ currentDirectory: this.getQueryPath(), username: this.$store.state.user.name, fileIds: fileIds, - }) - .then(() => { + }).then(() => { // 刷新列表 if (this.$route.query.folder) { this.getFileList() } }) - .then(() => { - this.$notify({ - title: '删除成功', - type: 'success', - duration: 1000, - }) - }) + }) + }, + restoreFile() { + const fileIds = this.getSelectIdList() + api.restore({fileIds: fileIds}).then(() => { + this.getFileList() + }) + }, + sweepFile() { + const fileIds = this.getSelectIdList() + this.$confirm(`此操作将永久删除 ${fileIds.length}个文件, 是否继续?`, '提示', { + confirmButtonText: '彻底删除', + confirmButtonClass: 'el-button--danger', + cancelButtonText: '取消', + type: 'warning', + }).then(() => { + api.sweep({fileIds: fileIds}).then(() => { + this.getFileList() + }) + }) + }, + clearTrash() { + this.$confirm(`是否清空回收站? 此操作将无法还原!!!`, '提示', { + confirmButtonText: '清空', + confirmButtonClass: 'el-button--danger', + cancelButtonText: '取消', + type: 'warning', + }).then(() => { + api.clearTrash().then(() => { + this.getFileList() + }) }) }, // 获取选中项id列表 @@ -4154,6 +4016,9 @@ export default { }, // 点击文件或文件夹 fileClick(row) { + if (this.queryFileType === 'trash') { + return + } if (this.editingIndex === row.index) { return } diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 43b7a3b..7c23be0 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -209,9 +209,11 @@ export default { let data = new FormData() data.append('username',this.loginForm.username) data.append('password',this.loginForm.password) + this.loading = true initialization(data).then(()=>{ this.initialize = false this.$message.success('创建成功') + this.loading = false }) }else{ // 登录 diff --git a/src/views/setting/sys/logList.vue b/src/views/setting/sys/logList.vue index c25b61d..1e96248 100644 --- a/src/views/setting/sys/logList.vue +++ b/src/views/setting/sys/logList.vue @@ -123,7 +123,7 @@ export default { isLoginType: this.type === 'LOGIN', // 查询条件 queryCondition: { - excludeUsername: 'other', + excludeUsername: undefined, username: undefined, ip: undefined, type: this.type, @@ -191,12 +191,7 @@ export default { } this.queryLogList() }, - queryLogList() { - if (this.queryCondition.username) { - this.queryCondition.excludeUsername = null; - } else { - this.queryCondition.excludeUsername = 'other'; - } + queryLogList(val) { this.$refs.tableList.initPageIndex() this.getLogList() }, diff --git a/src/views/trash/index.vue b/src/views/trash/index.vue new file mode 100644 index 0000000..ecbacf6 --- /dev/null +++ b/src/views/trash/index.vue @@ -0,0 +1,72 @@ + + + + + +