Perfect code.

pull/40/head
ruibaby 2019-09-03 20:25:29 +08:00
parent 4f1d8ccccb
commit 054354d357
36 changed files with 162 additions and 174 deletions

View File

@ -1,6 +1,12 @@
<template> <template>
<div class="footer"> <div
<div class="copyright"> class="footer"
style="padding: 0 16px;margin: 48px 0 0;text-align: center;"
>
<div
class="copyright"
style="color: rgba(0, 0, 0, 0.45);font-size: 14px;"
>
Proudly power by Proudly power by
<router-link :to="{ name:'About' }"> <router-link :to="{ name:'About' }">
<a href="javascript:void(0);">Halo</a> <a href="javascript:void(0);">Halo</a>
@ -19,13 +25,4 @@ export default {
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.footer {
padding: 0 16px;
margin: 48px 0 0;
text-align: center;
.copyright {
color: rgba(0, 0, 0, 0.45);
font-size: 14px;
}
}
</style> </style>

View File

@ -730,3 +730,41 @@ body {
left: 0; left: 0;
} }
} }
.analysis-card-container {
position: relative;
overflow: hidden;
width: 100%;
.meta {
position: relative;
overflow: hidden;
width: 100%;
color: rgba(0, 0, 0, 0.45);
font-size: 14px;
line-height: 22px;
.analysis-card-action {
cursor: pointer;
position: absolute;
top: 0;
right: 0;
}
}
.number {
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
white-space: nowrap;
color: #000;
margin-top: 4px;
margin-bottom: 0;
font-size: 32px;
line-height: 38px;
height: 38px;
}
}
.ant-tree-child-tree {
li {
overflow: hidden;
}
}

View File

@ -160,8 +160,8 @@
</template> </template>
<script> <script>
import { PageView } from '@/layouts'
import { mixin, mixinDevice } from '@/utils/mixin.js' import { mixin, mixinDevice } from '@/utils/mixin.js'
import { PageView } from '@/layouts'
import AttachmentDetailDrawer from './components/AttachmentDetailDrawer' import AttachmentDetailDrawer from './components/AttachmentDetailDrawer'
import attachmentApi from '@/api/attachment' import attachmentApi from '@/api/attachment'
@ -209,6 +209,17 @@ export default {
this.loadAttachments() this.loadAttachments()
this.loadMediaTypes() this.loadMediaTypes()
}, },
destroyed: function() {
if (this.drawerVisible) {
this.drawerVisible = false
}
},
beforeRouteLeave(to, from, next) {
if (this.drawerVisible) {
this.drawerVisible = false
}
next()
},
methods: { methods: {
loadAttachments() { loadAttachments() {
this.queryParam.page = this.pagination.page - 1 this.queryParam.page = this.pagination.page - 1

View File

@ -22,6 +22,7 @@
<img <img
:src="attachment.path" :src="attachment.path"
v-show="photoPreviewVisible" v-show="photoPreviewVisible"
style="width: 100%;"
> >
<video-player <video-player
class="video-player-box" class="video-player-box"
@ -29,6 +30,7 @@
ref="videoPlayer" ref="videoPlayer"
:options="playerOptions" :options="playerOptions"
:playsinline="true" :playsinline="true"
style="width: 100%;"
> >
</video-player> </video-player>
</div> </div>
@ -158,10 +160,10 @@
<script> <script>
import { mixin, mixinDevice } from '@/utils/mixin.js' import { mixin, mixinDevice } from '@/utils/mixin.js'
import { videoPlayer } from 'vue-video-player'
import 'video.js/dist/video-js.css'
import attachmentApi from '@/api/attachment' import attachmentApi from '@/api/attachment'
import photoApi from '@/api/photo' import photoApi from '@/api/photo'
import 'video.js/dist/video-js.css'
import { videoPlayer } from 'vue-video-player'
export default { export default {
name: 'AttachmentDetailDrawer', name: 'AttachmentDetailDrawer',
@ -352,12 +354,3 @@ export default {
} }
} }
</script> </script>
<style scope>
.attach-detail-img img {
width: 100%;
}
.video-player-box {
width: 100%;
}
</style>

View File

@ -88,8 +88,8 @@
<script> <script>
import { mixin, mixinDevice } from '@/utils/mixin.js' import { mixin, mixinDevice } from '@/utils/mixin.js'
import attachmentApi from '@/api/attachment'
import AttachmentDetailDrawer from './AttachmentDetailDrawer' import AttachmentDetailDrawer from './AttachmentDetailDrawer'
import attachmentApi from '@/api/attachment'
export default { export default {
name: 'AttachmentDrawer', name: 'AttachmentDrawer',
@ -195,6 +195,3 @@ export default {
} }
} }
</script> </script>
<style lang="less" scope>
</style>

View File

@ -183,6 +183,3 @@ export default {
} }
} }
</script> </script>
<style lang="less" scope>
</style>

View File

@ -26,10 +26,6 @@ export default {
components: { components: {
PageView, PageView,
CommentTab CommentTab
}, }
data() {
return {}
},
methods: {}
} }
</script> </script>

View File

@ -202,5 +202,3 @@ export default {
} }
} }
</script> </script>
<style lang="less" scoped>
</style>

View File

@ -263,9 +263,9 @@
</template> </template>
<script> <script>
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import commentApi from '@/api/comment'
import marked from 'marked'
import CommentDetail from './CommentDetail' import CommentDetail from './CommentDetail'
import marked from 'marked'
import commentApi from '@/api/comment'
const postColumns = [ const postColumns = [
{ {
title: '昵称', title: '昵称',

View File

@ -328,13 +328,13 @@
</template> </template>
<script> <script>
import { mixin, mixinDevice } from '@/utils/mixin.js'
import { mapGetters } from 'vuex'
import { PageView } from '@/layouts' import { PageView } from '@/layouts'
import AnalysisCard from './components/AnalysisCard' import AnalysisCard from './components/AnalysisCard'
import RecentCommentTab from './components/RecentCommentTab' import RecentCommentTab from './components/RecentCommentTab'
import countTo from 'vue-count-to' import countTo from 'vue-count-to'
import UploadPhoto from '../../components/Upload/UploadPhoto.vue' import UploadPhoto from '../../components/Upload/UploadPhoto.vue'
import { mixin, mixinDevice } from '@/utils/mixin.js'
import { mapGetters } from 'vuex'
import postApi from '@/api/post' import postApi from '@/api/post'
import logApi from '@/api/log' import logApi from '@/api/log'

View File

@ -15,7 +15,6 @@
</div> </div>
<div class="number"> <div class="number">
<slot name="number"> <slot name="number">
<!-- <span>{{ typeof number === 'function' && number() || number }}</span> -->
<countTo <countTo
:startVal="startNumber" :startVal="startNumber"
:endVal="typeof number === 'function' && number() || number" :endVal="typeof number === 'function' && number() || number"
@ -64,37 +63,3 @@ export default {
} }
} }
</script> </script>
<style lang="less" scoped>
.analysis-card-container {
position: relative;
overflow: hidden;
width: 100%;
.meta {
position: relative;
overflow: hidden;
width: 100%;
color: rgba(0, 0, 0, 0.45);
font-size: 14px;
line-height: 22px;
.analysis-card-action {
cursor: pointer;
position: absolute;
top: 0;
right: 0;
}
}
}
.number {
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
white-space: nowrap;
color: #000;
margin-top: 4px;
margin-bottom: 0;
font-size: 32px;
line-height: 38px;
height: 38px;
}
</style>

View File

@ -11,6 +11,3 @@ export default {
} }
} }
</script> </script>
<style scoped>
</style>

View File

@ -11,6 +11,3 @@ export default {
} }
} }
</script> </script>
<style scoped>
</style>

View File

@ -237,6 +237,3 @@ export default {
} }
} }
</script> </script>
<style scoped>
</style>

View File

@ -46,7 +46,12 @@
v-for="(theme,index) in themes" v-for="(theme,index) in themes"
:key="index" :key="index"
:value="theme.id" :value="theme.id"
>{{ theme.name }} <a-icon v-if="theme.activated" type="check"/></a-select-option> >{{ theme.name }}
<a-icon
v-if="theme.activated"
type="check"
/>
</a-select-option>
</a-select> </a-select>
</template> </template>
<theme-file <theme-file

View File

@ -275,17 +275,17 @@ export default {
created() { created() {
this.loadThemes() this.loadThemes()
}, },
// destroyed: function() { destroyed: function() {
// if (this.visible) { if (this.themeSettingVisible) {
// this.visible = false this.themeSettingVisible = false
// } }
// }, },
// beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) {
// if (this.visible) { if (this.themeSettingVisible) {
// this.visible = false this.themeSettingVisible = false
// } }
// next() next()
// }, },
methods: { methods: {
loadThemes() { loadThemes() {
this.themeLoading = true this.themeLoading = true

View File

@ -55,6 +55,3 @@ export default {
} }
} }
</script> </script>
<style>
</style>

View File

@ -56,11 +56,3 @@ export default {
} }
} }
</script> </script>
<style lang="less" scoped>
.ant-tree-child-tree {
li {
overflow: hidden;
}
}
</style>

View File

@ -219,9 +219,9 @@
</template> </template>
<script> <script>
import { mixin, mixinDevice } from '@/utils/mixin.js' import { mixin, mixinDevice } from '@/utils/mixin.js'
import { mapGetters } from 'vuex'
import AttachmentSelectDrawer from '../../attachment/components/AttachmentSelectDrawer' import AttachmentSelectDrawer from '../../attachment/components/AttachmentSelectDrawer'
import FooterToolBar from '@/components/FooterToolbar' import FooterToolBar from '@/components/FooterToolbar'
import { mapGetters } from 'vuex'
import Verte from 'verte' import Verte from 'verte'
import 'verte/dist/verte.css' import 'verte/dist/verte.css'
import themeApi from '@/api/theme' import themeApi from '@/api/theme'
@ -343,5 +343,3 @@ export default {
} }
} }
</script> </script>
<style lang="less" scoped>
</style>

View File

@ -239,6 +239,3 @@ export default {
} }
} }
</script> </script>
<style>
</style>

View File

@ -108,6 +108,23 @@ export default {
} }
}) })
}, },
destroyed: function() {
if (this.postSettingVisible) {
this.postSettingVisible = false
}
if (this.attachmentDrawerVisible) {
this.attachmentDrawerVisible = false
}
},
beforeRouteLeave(to, from, next) {
if (this.postSettingVisible) {
this.postSettingVisible = false
}
if (this.attachmentDrawerVisible) {
this.attachmentDrawerVisible = false
}
next()
},
methods: { methods: {
handleSaveDraft() { handleSaveDraft() {
this.postToStage.status = 'DRAFT' this.postToStage.status = 'DRAFT'
@ -177,6 +194,3 @@ export default {
} }
} }
</script> </script>
<style lang="less">
</style>

View File

@ -408,6 +408,17 @@ export default {
this.loadPosts() this.loadPosts()
this.loadCategories() this.loadCategories()
}, },
destroyed: function() {
if (this.postSettingVisible) {
this.postSettingVisible = false
}
},
beforeRouteLeave(to, from, next) {
if (this.postSettingVisible) {
this.postSettingVisible = false
}
next()
},
methods: { methods: {
loadPosts() { loadPosts() {
this.postsLoading = true this.postsLoading = true
@ -537,5 +548,3 @@ export default {
} }
} }
</script> </script>
<style scoped>
</style>

View File

@ -58,6 +58,3 @@ export default {
} }
} }
</script> </script>
<style>
</style>

View File

@ -52,6 +52,3 @@ export default {
} }
} }
</script> </script>
<style>
</style>

View File

@ -401,5 +401,3 @@ export default {
} }
} }
</script> </script>
<style lang="less">
</style>

View File

@ -105,6 +105,3 @@ export default {
} }
} }
</script> </script>
<style>
</style>

View File

@ -98,6 +98,23 @@ export default {
} }
}) })
}, },
destroyed: function() {
if (this.sheetSettingVisible) {
this.sheetSettingVisible = false
}
if (this.attachmentDrawerVisible) {
this.attachmentDrawerVisible = false
}
},
beforeRouteLeave(to, from, next) {
if (this.sheetSettingVisible) {
this.sheetSettingVisible = false
}
if (this.attachmentDrawerVisible) {
this.attachmentDrawerVisible = false
}
next()
},
methods: { methods: {
handleSaveDraft() { handleSaveDraft() {
this.sheetToStage.status = 'DRAFT' this.sheetToStage.status = 'DRAFT'
@ -158,5 +175,3 @@ export default {
} }
} }
</script> </script>
<style lang="less">
</style>

View File

@ -245,8 +245,8 @@
<script> <script>
import { mixin, mixinDevice } from '@/utils/mixin.js' import { mixin, mixinDevice } from '@/utils/mixin.js'
import SheetSetting from './components/SheetSetting'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import SheetSetting from './components/SheetSetting'
import sheetApi from '@/api/sheet' import sheetApi from '@/api/sheet'
import menuApi from '@/api/menu' import menuApi from '@/api/menu'
@ -335,6 +335,17 @@ export default {
this.loadSheets() this.loadSheets()
this.loadInternalSheets() this.loadInternalSheets()
}, },
destroyed: function() {
if (this.sheetSettingVisible) {
this.sheetSettingVisible = false
}
},
beforeRouteLeave(to, from, next) {
if (this.sheetSettingVisible) {
this.sheetSettingVisible = false
}
next()
},
methods: { methods: {
loadSheets() { loadSheets() {
this.sheetsLoading = true this.sheetsLoading = true
@ -388,5 +399,3 @@ export default {
} }
} }
</script> </script>
<style scoped>
</style>

View File

@ -125,10 +125,6 @@ export default {
customTpls: [] customTpls: []
} }
}, },
// model: {
// prop: 'visible',
// event: 'close'
// },
props: { props: {
sheet: { sheet: {
type: Object, type: Object,
@ -250,5 +246,3 @@ export default {
} }
} }
</script> </script>
<style lang="less">
</style>

View File

@ -201,6 +201,3 @@ export default {
} }
} }
</script> </script>
<style scoped>
</style>

View File

@ -272,8 +272,8 @@
</template> </template>
<script> <script>
import AttachmentSelectDrawer from '../../attachment/components/AttachmentSelectDrawer'
import { mixin, mixinDevice } from '@/utils/mixin.js' import { mixin, mixinDevice } from '@/utils/mixin.js'
import AttachmentSelectDrawer from '../../attachment/components/AttachmentSelectDrawer'
import photoApi from '@/api/photo' import photoApi from '@/api/photo'
export default { export default {

View File

@ -312,5 +312,3 @@ UA 信息:${navigator.userAgent}`
} }
} }
</script> </script>
<style lang="less">
</style>

View File

@ -749,6 +749,23 @@ export default {
mounted() { mounted() {
this.loadFormOptions() this.loadFormOptions()
}, },
destroyed: function() {
if (this.faviconDrawerVisible) {
this.faviconDrawerVisible = false
}
if (this.logoDrawerVisible) {
this.logoDrawerVisible = false
}
},
beforeRouteLeave(to, from, next) {
if (this.faviconDrawerVisible) {
this.faviconDrawerVisible = false
}
if (this.logoDrawerVisible) {
this.logoDrawerVisible = false
}
next()
},
methods: { methods: {
...mapActions(['loadUser', 'loadOptions']), ...mapActions(['loadUser', 'loadOptions']),
loadFormOptions() { loadFormOptions() {

View File

@ -73,6 +73,3 @@ export default {
} }
} }
</script> </script>
<style scoped>
</style>

View File

@ -148,7 +148,7 @@ export default {
} }
} }
</script> </script>
<style lang="less"> <style lang="less" scope>
body { body {
height: 100%; height: 100%;
background-color: #f5f5f5; background-color: #f5f5f5;

View File

@ -1,30 +1,14 @@
const path = require('path') const path = require('path')
const webpack = require('webpack') const webpack = require('webpack')
// const GenerateAssetPlugin = require('generate-asset-webpack-plugin')
function resolve(dir) { function resolve(dir) {
return path.join(__dirname, dir) return path.join(__dirname, dir)
} }
// var createServerConfig = function(compilation) {
// const configJson = {
// apiUrl: 'http://localhost:8090'
// }
// return JSON.stringify(configJson)
// }
// vue.config.js // vue.config.js
module.exports = { module.exports = {
configureWebpack: { configureWebpack: {
plugins: [ plugins: [
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/) new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/)
// new GenerateAssetPlugin({
// filename: 'config.json',
// fn: (compilation, cb) => {
// cb(null, createServerConfig(compilation))
// },
// extraFiles: []
// })
] ]
}, },
@ -58,13 +42,6 @@ module.exports = {
css: { css: {
loaderOptions: { loaderOptions: {
less: { less: {
modifyVars: {
/*
'primary-color': '#F5222D',
'link-color': '#F5222D',
'border-radius-base': '4px',
*/
},
javascriptEnabled: true javascriptEnabled: true
} }
} }