From 6cc467699f029fc3c084e6b16f4b4ab466e98e2c Mon Sep 17 00:00:00 2001 From: Aicirou <2643053021@qq.com> Date: Tue, 30 Jun 2020 17:06:12 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8Update=20icons?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dependencies-cdn.js | 2 +- src/views/page/GoList.vue | 105 +++++++++++++++++++------------------- 2 files changed, 54 insertions(+), 53 deletions(-) diff --git a/dependencies-cdn.js b/dependencies-cdn.js index 7c9b1f2..d076721 100644 --- a/dependencies-cdn.js +++ b/dependencies-cdn.js @@ -9,7 +9,7 @@ module.exports = [ { name: 'js-cookie', library: 'Cookies', js: 'https://cdn.jsdelivr.net/npm/js-cookie@2.2.1/src/js.cookie.min.js', css: '' }, { name: 'lowdb', library: 'low', js: 'https://cdn.jsdelivr.net/npm/lowdb@1.0.0/dist/low.min.js', css: '' }, { name: 'lowdb/adapters/LocalStorage', library: 'LocalStorage', js: 'https://cdn.jsdelivr.net/npm/lowdb@1.0.0/dist/LocalStorage.min.js', css: '' }, - { name: '', library: '', js: 'https://at.alicdn.com/t/font_1760192_axq33n6snd.js', css: '' }, + { name: '', library: '', js: 'https://at.alicdn.com/t/font_1760192_8add3xcxs4u.js', css: '' }, { name: '', library: '', js: '', css: 'https://cdn.jsdelivr.net/npm/font-awesome@latest/css/font-awesome.min.css' }, { name: '', library: '', js: '', css: 'https://cdn.jsdelivr.net/npm/font-awesome-animation@0.2.1/dist/font-awesome-animation.min.css' }, ] \ No newline at end of file diff --git a/src/views/page/GoList.vue b/src/views/page/GoList.vue index ab12c20..e50d8eb 100644 --- a/src/views/page/GoList.vue +++ b/src/views/page/GoList.vue @@ -27,10 +27,7 @@
-
+
- + file.mimeType.startsWith("image/") ); }, - renderHeadMD() { + renderHeadMD () { return window.themeOptions.render.head_md || false; }, - renderReadMeMD() { + renderReadMeMD () { return window.themeOptions.render.readme_md || false; }, }, - created() { + created () { this.render(); }, methods: { - infiniteHandler($state) { + infiniteHandler ($state) { // 首次进入页面不执行滚动事件 if (!this.page.page_token) { return; @@ -154,7 +155,7 @@ export default { this.page.page_index++; this.render($state); }, - render($state) { + render ($state) { this.headmd = { display: false, file: {}, path: "" }; this.readmemd = { display: false, file: {}, path: "" }; var path = this.$route.path; @@ -202,32 +203,32 @@ export default { console.log(e); }); }, - buildFiles(files) { + buildFiles (files) { var path = this.$route.path; return !files ? [] : files - .map((item) => { - var p = path + checkoutPath(item.name, item); - let isFolder = - item.mimeType === "application/vnd.google-apps.folder"; - let size = isFolder ? "-" : formatFileSize(item.size); - return { - path: p, - ...item, - modifiedTime: formatDate(item.modifiedTime), - size: size, - isFolder: isFolder, - }; - }) - .sort((a, b) => { - if (a.isFolder && b.isFolder) { - return 0; - } - return a.isFolder ? -1 : 1; - }); + .map((item) => { + var p = path + checkoutPath(item.name, item); + let isFolder = + item.mimeType === "application/vnd.google-apps.folder"; + let size = isFolder ? "-" : formatFileSize(item.size); + return { + path: p, + ...item, + modifiedTime: formatDate(item.modifiedTime), + size: size, + isFolder: isFolder, + }; + }) + .sort((a, b) => { + if (a.isFolder && b.isFolder) { + return 0; + } + return a.isFolder ? -1 : 1; + }); }, - checkPassword(path) { + checkPassword (path) { var pass = prompt(this.$t("list.auth"), ""); localStorage.setItem("password" + path, pass); if (pass != null && pass != "") { @@ -236,7 +237,7 @@ export default { this.$router.go(-1); } }, - copy(path) { + copy (path) { let origin = window.location.origin; path = origin + encodeURI(path); this.$copyText(path) @@ -254,13 +255,13 @@ export default { }); }); }, - thum(url) { + thum (url) { return url ? `/${this.$route.params.id}:view?url=${url}` : ""; }, - inited(viewer) { + inited (viewer) { this.$viewer = viewer; }, - action(file, target) { + action (file, target) { if (file.mimeType.startsWith("image/")) { this.viewer = true; this.$nextTick(() => { @@ -276,7 +277,7 @@ export default { } this.target(file, target); }, - target(file, target) { + target (file, target) { let path = file.path; if (target === "_blank") { window.open(path); @@ -303,7 +304,7 @@ export default { return; } }, - renderMd(files, path) { + renderMd (files, path) { var cmd = this.$route.params.cmd; if (cmd) { return; @@ -327,7 +328,7 @@ export default { } }); }, - goSearchResult(file, target) { + goSearchResult (file, target) { this.loading = true; let id = this.$route.params.id; this.axios @@ -345,8 +346,8 @@ export default { console.log(e); }); }, - getIcon(type) { - return "#" + (this.icon[type] ? this.icon[type] : "icon-weizhi"); + getIcon (type) { + return "#" + (this.icon[type] ? this.icon[type] : "icon-file"); }, }, };