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>
<div class="footer">
<div class="copyright">
<div
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
<router-link :to="{ name:'About' }">
<a href="javascript:void(0);">Halo</a>
@ -19,13 +25,4 @@ export default {
</script>
<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>

View File

@ -729,4 +729,42 @@ body {
top: 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>
<script>
import { PageView } from '@/layouts'
import { mixin, mixinDevice } from '@/utils/mixin.js'
import { PageView } from '@/layouts'
import AttachmentDetailDrawer from './components/AttachmentDetailDrawer'
import attachmentApi from '@/api/attachment'
@ -209,6 +209,17 @@ export default {
this.loadAttachments()
this.loadMediaTypes()
},
destroyed: function() {
if (this.drawerVisible) {
this.drawerVisible = false
}
},
beforeRouteLeave(to, from, next) {
if (this.drawerVisible) {
this.drawerVisible = false
}
next()
},
methods: {
loadAttachments() {
this.queryParam.page = this.pagination.page - 1

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -15,7 +15,6 @@
</div>
<div class="number">
<slot name="number">
<!-- <span>{{ typeof number === 'function' && number() || number }}</span> -->
<countTo
:startVal="startNumber"
:endVal="typeof number === 'function' && number() || number"
@ -64,37 +63,3 @@ export default {
}
}
</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>
<style scoped>
</style>

View File

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

View File

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

View File

@ -46,7 +46,12 @@
v-for="(theme,index) in themes"
:key="index"
: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>
</template>
<theme-file

View File

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

View File

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

View File

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

View File

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

View File

@ -239,6 +239,3 @@ export default {
}
}
</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: {
handleSaveDraft() {
this.postToStage.status = 'DRAFT'
@ -177,6 +194,3 @@ export default {
}
}
</script>
<style lang="less">
</style>

View File

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

View File

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

View File

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

View File

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

View File

@ -105,6 +105,3 @@ export default {
}
}
</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: {
handleSaveDraft() {
this.sheetToStage.status = 'DRAFT'
@ -158,5 +175,3 @@ export default {
}
}
</script>
<style lang="less">
</style>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -749,6 +749,23 @@ export default {
mounted() {
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: {
...mapActions(['loadUser', 'loadOptions']),
loadFormOptions() {

View File

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

View File

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

View File

@ -1,30 +1,14 @@
const path = require('path')
const webpack = require('webpack')
// const GenerateAssetPlugin = require('generate-asset-webpack-plugin')
function resolve(dir) {
return path.join(__dirname, dir)
}
// var createServerConfig = function(compilation) {
// const configJson = {
// apiUrl: 'http://localhost:8090'
// }
// return JSON.stringify(configJson)
// }
// vue.config.js
module.exports = {
configureWebpack: {
plugins: [
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: {
loaderOptions: {
less: {
modifyVars: {
/*
'primary-color': '#F5222D',
'link-color': '#F5222D',
'border-radius-base': '4px',
*/
},
javascriptEnabled: true
}
}