继续优化页面

This commit is contained in:
qxz 2020-05-07 14:54:04 +08:00
parent a9cae08aa2
commit f83cfaba0d
11 changed files with 163 additions and 89 deletions

View File

@ -1,5 +1,6 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
@ -13,6 +14,7 @@
<title><%= htmlWebpackPlugin.options.title %></title>
<script>
var authConfig = {
version: '1.1.0',
roots: [
{
id: "0AEofxddwF4bAUk9PVA",
@ -26,6 +28,11 @@
},
],
};
var themeOptions = {
// en/zh-chs/zh-cht
languages: 'en'
}
window.gdconfig = JSON.parse(JSON.stringify({ version: authConfig.version, themeOptions: themeOptions }));
window.gds = JSON.parse(
JSON.stringify(authConfig.roots.map((it) => it.name))
);
@ -42,4 +49,5 @@
<body>
</body>
</html>

View File

@ -25,7 +25,7 @@ Vue.prototype.$languages = Object.keys(messages).map(langlage => ({
}))
export default new VueI18n({
locale: util.cookies.get('lang') || process.env.VUE_APP_I18N_LOCALE,
locale: util.cookies.get('lang') || window.gdconfig.themeOptions.languages || process.env.VUE_APP_I18N_LOCALE,
fallbackLocale: process.env.VUE_APP_I18N_FALLBACK_LOCALE,
messages
})

View File

@ -30,7 +30,7 @@ const router = new VueRouter({
*/
router.beforeEach(async (to, from, next) => {
console.log("before:");
console.log(to);
console.log(to,from);
next();
});

View File

@ -1,12 +1,50 @@
// 由于懒加载页面太多的话会造成webpack热更新太慢所以开发环境不使用懒加载只有生产环境使用懒加载
const _import = require("@/libs/util.import." + process.env.NODE_ENV);
const frameIn = [
{ path: "/:id:(text)/:path", component: _import("page/GoText"), props: true },
{ path: "/:id:(pdf)/:path", component: _import("page/GoPdf"), props: true },
{ path: "/:id:(video)/:path", component: _import("page/GoVideo") },
{ path: "/:id:(image)/:path", component: _import("page/GoImg") },
{ path: "/:id::cmd?(/?/??.*/)", component: _import("page/GoList") },
const meta = {
keepAlive: true
}
const frameIn = [{
path: "/:id:(text)/:path",
component: _import("page/GoText"),
meta: {
...meta,
view: 'text'
}
},
{
path: "/:id:(pdf)/:path",
component: _import("page/GoPdf"),
meta: {
...meta,
view: 'pdf'
}
},
{
path: "/:id:(video)/:path",
component: _import("page/GoVideo"),
meta: {
...meta,
view: 'video'
}
},
{
path: "/:id:(image)/:path",
component: _import("page/GoImg"),
meta: {
...meta,
view: 'image'
}
},
{
path: "/:id::cmd?(/?/??.*)",
component: _import("page/GoList"),
meta: {
...meta,
view: 'list'
}
},
];
export default frameIn;

View File

@ -4,9 +4,9 @@
<section class="section">
<div class="container">
<bread-crumb ref="breadcrumb"></bread-crumb>
<!-- <keep-alive> -->
<keep-alive>
<router-view></router-view>
<!-- </keep-alive> -->
</keep-alive>
<Footer></Footer>
</div>
</section>

View File

@ -38,7 +38,7 @@
<div class="navbar-end">
<!-- is-hidden-desktop -->
<!-- <div class="navbar-item">
<div class="navbar-item">
<div class="field is-grouped">
<p class="control has-icons-left" style="width:100%;">
<input
@ -53,8 +53,8 @@
</span>
</p>
</div>
</div> -->
<header-search />
</div>
<!-- <header-search /> -->
<header-locales />
<div class="navbar-item">
<header-color/>

View File

@ -23,8 +23,11 @@ export default {
},
computed: {
url() {
if (this.$route.params.path) {
return decode64(this.$route.params.path);
}
return ''
}
},
created() {
this.render();
@ -33,7 +36,7 @@ export default {
render() {
let path = this.url;
// 便
path = process.env.NODE_ENV === "development" ? "/api" + path : "";
// path = process.env.NODE_ENV === "development" ? "/api" + path : "";
this.imgurl = path;
},
loading(event) {

View File

@ -25,6 +25,11 @@
<svg class="iconfont" aria-hidden="true">
<use :xlink:href="getIcon(file.mimeType)" />
</svg>
<!-- <span class="icon">
<figure class="image is-24x24">
<img :src="file.thumbnailLink" />
</figure>
</span>-->
{{file.name}}
</td>
<td class="is-hidden-mobile is-hidden-touch">{{file.modifiedTime}}</td>
@ -138,7 +143,7 @@ export default {
},
{
name: this.$t("list.title.operation"),
style: "width:13%",
style: "width:13.5%",
class: "is-hidden-mobile is-hidden-touch"
}
];
@ -292,14 +297,20 @@ export default {
},
watch: {
$route (to, from) {
if (!to.path.indexOf(':search')) {
// 退page_token
if (to.path.length < from.path.length) {
this.page.page_token = null;
}
if (to.path.substr(-1) === '/') {
this.render();
if (to.path.substr(-1) !== '/' && from.meta.view !== "list") {
return
}
}
this.headmd = { display: false, file: {}, path: "" },
this.readmemd = { display: false, file: {}, path: "" }
this.render();
}
}
};
</script>

View File

@ -14,8 +14,11 @@ export default {
},
computed: {
url() {
if (this.$route.params.path) {
return decode64(this.$route.params.path);
}
return ''
}
},
methods: {}
};

View File

@ -21,13 +21,21 @@ export default {
content: ""
};
},
watch: {
$route (to, from) {
this.render();
}
},
created () {
this.render();
},
computed: {
url () {
if (this.$route.params.path) {
return decode64(this.$route.params.path);
}
return ''
}
},
components: {
editor: require("@/components/ace-editor")

View File

@ -107,7 +107,10 @@ export default {
},
computed: {
url () {
if (this.$route.params.path) {
return decode64(this.$route.params.path);
}
return ''
},
getThunder () {
return Buffer.from("AA" + this.videourl + "ZZ").toString("base64");