mirror of https://github.com/halo-dev/halo
feat: support set internal sheet's title.
parent
c524d43f9a
commit
5c49bba25d
|
@ -125,7 +125,6 @@
|
|||
</template>
|
||||
<script>
|
||||
import { mixin, mixinDevice } from '@/utils/mixin.js'
|
||||
import { mapGetters } from 'vuex'
|
||||
import commentApi from '@/api/comment'
|
||||
export default {
|
||||
name: 'CommentDetail',
|
||||
|
|
|
@ -429,7 +429,6 @@
|
|||
</template>
|
||||
<script>
|
||||
import { mixin, mixinDevice } from '@/utils/mixin.js'
|
||||
import { mapGetters } from 'vuex'
|
||||
import CommentDetail from './CommentDetail'
|
||||
import marked from 'marked'
|
||||
import commentApi from '@/api/comment'
|
||||
|
|
|
@ -322,7 +322,6 @@
|
|||
|
||||
<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'
|
||||
|
|
|
@ -71,7 +71,6 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
import commentApi from '@/api/comment'
|
||||
import postApi from '@/api/post'
|
||||
import sheetApi from '@/api/sheet'
|
||||
|
|
|
@ -311,7 +311,7 @@ export default {
|
|||
},
|
||||
handleCategoryToMenu(category) {
|
||||
this.menu['name'] = category.name
|
||||
this.menu['url'] = `/categories/${category.slugName}`
|
||||
this.menu['url'] = `${category.fullPath}`
|
||||
menuApi.create(this.menu).then(response => {
|
||||
this.$message.success('添加到菜单成功!')
|
||||
this.menu = {}
|
||||
|
|
|
@ -518,7 +518,6 @@ import TargetCommentDrawer from '../comment/components/TargetCommentDrawer'
|
|||
import AttachmentSelectDrawer from '../attachment/components/AttachmentSelectDrawer'
|
||||
import TagSelect from './components/TagSelect'
|
||||
import CategoryTree from './components/CategoryTree'
|
||||
import { mapGetters } from 'vuex'
|
||||
import categoryApi from '@/api/category'
|
||||
import postApi from '@/api/post'
|
||||
const columns = [
|
||||
|
|
|
@ -62,12 +62,12 @@
|
|||
style="max-width: 300px;display: block;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"
|
||||
>
|
||||
<a
|
||||
:href="options.blog_url+item.url"
|
||||
:href="item.url"
|
||||
target="_blank"
|
||||
v-if="item.status"
|
||||
>{{ item.title }}</a>
|
||||
<a
|
||||
:href="options.blog_url+item.url"
|
||||
:href="item.url"
|
||||
target="_blank"
|
||||
disabled
|
||||
v-else
|
||||
|
@ -124,12 +124,12 @@
|
|||
</router-link>
|
||||
<a-divider type="vertical" />
|
||||
<a
|
||||
:href="options.blog_url+record.url"
|
||||
:href="record.url"
|
||||
target="_blank"
|
||||
v-if="record.status"
|
||||
>访问</a>
|
||||
<a
|
||||
:href="options.blog_url+record.url"
|
||||
:href="record.url"
|
||||
target="_blank"
|
||||
disabled
|
||||
v-else
|
||||
|
@ -637,7 +637,7 @@ export default {
|
|||
},
|
||||
handleSheetToMenu(sheet) {
|
||||
this.menu['name'] = sheet.title
|
||||
this.menu['url'] = `/s/${sheet.url}`
|
||||
this.menu['url'] = `${sheet.fullPath}`
|
||||
menuApi.create(this.menu).then(response => {
|
||||
this.$message.success('添加到菜单成功!')
|
||||
this.menu = {}
|
||||
|
|
|
@ -126,7 +126,10 @@
|
|||
|
||||
<a-list-item-meta>
|
||||
<template slot="description">
|
||||
<p v-html="item.content" class="journal-list-content"></p>
|
||||
<p
|
||||
v-html="item.content"
|
||||
class="journal-list-content"
|
||||
></p>
|
||||
</template>
|
||||
<span slot="title">{{ item.createTime | moment }}</span>
|
||||
<a-avatar
|
||||
|
@ -154,6 +157,40 @@
|
|||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<div style="position: fixed;bottom: 30px;right: 30px;">
|
||||
<a-button
|
||||
type="primary"
|
||||
shape="circle"
|
||||
icon="setting"
|
||||
size="large"
|
||||
@click="()=>this.optionFormVisible=true"
|
||||
></a-button>
|
||||
</div>
|
||||
<a-modal
|
||||
v-model="optionFormVisible"
|
||||
title="页面设置"
|
||||
:afterClose="onOptionFormClose"
|
||||
>
|
||||
<template slot="footer">
|
||||
<a-button
|
||||
key="submit"
|
||||
type="primary"
|
||||
@click="handleSaveOptions()"
|
||||
>保存</a-button>
|
||||
</template>
|
||||
<a-form layout="vertical">
|
||||
<a-form-item label="页面标题:">
|
||||
<a-input v-model="options.journals_title" />
|
||||
</a-form-item>
|
||||
<a-form-item label="每页显示条数:">
|
||||
<a-input
|
||||
type="number"
|
||||
v-model="options.journals_page_size"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
|
||||
<!-- 编辑日志弹窗 -->
|
||||
<a-modal v-model="visible">
|
||||
<template slot="title">
|
||||
|
@ -211,9 +248,10 @@
|
|||
import TargetCommentDrawer from '../../comment/components/TargetCommentDrawer'
|
||||
import AttachmentDrawer from '../../attachment/components/AttachmentDrawer'
|
||||
import { mixin, mixinDevice } from '@/utils/mixin.js'
|
||||
import { mapGetters } from 'vuex'
|
||||
import { mapGetters, mapActions } from 'vuex'
|
||||
import journalApi from '@/api/journal'
|
||||
import journalCommentApi from '@/api/journalComment'
|
||||
import optionApi from '@/api/option'
|
||||
export default {
|
||||
mixins: [mixin, mixinDevice],
|
||||
components: { TargetCommentDrawer, AttachmentDrawer },
|
||||
|
@ -225,6 +263,7 @@ export default {
|
|||
visible: false,
|
||||
journalCommentVisible: false,
|
||||
attachmentDrawerVisible: false,
|
||||
optionFormVisible: false,
|
||||
pagination: {
|
||||
page: 1,
|
||||
size: 10,
|
||||
|
@ -241,16 +280,19 @@ export default {
|
|||
comments: [],
|
||||
journal: {},
|
||||
isPublic: true,
|
||||
replyComment: {}
|
||||
replyComment: {},
|
||||
options: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.loadJournals()
|
||||
this.loadFormOptions()
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['user'])
|
||||
},
|
||||
methods: {
|
||||
...mapActions(['loadOptions']),
|
||||
loadJournals() {
|
||||
this.listLoading = true
|
||||
this.queryParam.page = this.pagination.page - 1
|
||||
|
@ -262,6 +304,11 @@ export default {
|
|||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
loadFormOptions() {
|
||||
optionApi.listAll().then(response => {
|
||||
this.options = response.data.data
|
||||
})
|
||||
},
|
||||
handleQuery() {
|
||||
this.handlePaginationChange(1, this.pagination.size)
|
||||
},
|
||||
|
@ -332,6 +379,17 @@ export default {
|
|||
this.queryParam.keyword = null
|
||||
this.queryParam.type = null
|
||||
this.handlePaginationChange(1, this.pagination.size)
|
||||
},
|
||||
handleSaveOptions() {
|
||||
optionApi.save(this.options).then(response => {
|
||||
this.loadFormOptions()
|
||||
this.loadOptions()
|
||||
this.$message.success('保存成功!')
|
||||
this.optionFormVisible = false
|
||||
})
|
||||
},
|
||||
onOptionFormClose() {
|
||||
this.optionFormVisible = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -195,11 +195,40 @@
|
|||
</a-card>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<div style="position: fixed;bottom: 30px;right: 30px;">
|
||||
<a-button
|
||||
type="primary"
|
||||
shape="circle"
|
||||
icon="setting"
|
||||
size="large"
|
||||
@click="()=>this.optionFormVisible=true"
|
||||
></a-button>
|
||||
</div>
|
||||
<a-modal
|
||||
v-model="optionFormVisible"
|
||||
title="页面设置"
|
||||
:afterClose="onOptionFormClose"
|
||||
>
|
||||
<template slot="footer">
|
||||
<a-button
|
||||
key="submit"
|
||||
type="primary"
|
||||
@click="handleSaveOptions()"
|
||||
>保存</a-button>
|
||||
</template>
|
||||
<a-form layout="vertical">
|
||||
<a-form-item label="页面标题:">
|
||||
<a-input v-model="options.links_title" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapActions } from 'vuex'
|
||||
import { mixin, mixinDevice } from '@/utils/mixin.js'
|
||||
import optionApi from '@/api/option'
|
||||
import linkApi from '@/api/link'
|
||||
const columns = [
|
||||
{
|
||||
|
@ -231,12 +260,14 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
formType: 'create',
|
||||
optionFormVisible: false,
|
||||
data: [],
|
||||
loading: false,
|
||||
columns,
|
||||
links: [],
|
||||
link: {},
|
||||
teams: []
|
||||
teams: [],
|
||||
options: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
@ -250,8 +281,10 @@ export default {
|
|||
created() {
|
||||
this.loadLinks()
|
||||
this.loadTeams()
|
||||
this.loadFormOptions()
|
||||
},
|
||||
methods: {
|
||||
...mapActions(['loadOptions']),
|
||||
loadLinks() {
|
||||
this.loading = true
|
||||
linkApi.listAll().then(response => {
|
||||
|
@ -264,6 +297,11 @@ export default {
|
|||
this.teams = response.data.data
|
||||
})
|
||||
},
|
||||
loadFormOptions() {
|
||||
optionApi.listAll().then(response => {
|
||||
this.options = response.data.data
|
||||
})
|
||||
},
|
||||
handleSaveClick() {
|
||||
this.createOrUpdateLink()
|
||||
},
|
||||
|
@ -318,6 +356,17 @@ export default {
|
|||
})
|
||||
}
|
||||
this.handleAddLink()
|
||||
},
|
||||
handleSaveOptions() {
|
||||
optionApi.save(this.options).then(response => {
|
||||
this.loadFormOptions()
|
||||
this.loadOptions()
|
||||
this.$message.success('保存成功!')
|
||||
this.optionFormVisible = false
|
||||
})
|
||||
},
|
||||
onOptionFormClose() {
|
||||
this.optionFormVisible = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,7 +59,10 @@
|
|||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<div class="table-operator" style="margin-bottom: 0;">
|
||||
<div
|
||||
class="table-operator"
|
||||
style="margin-bottom: 0;"
|
||||
>
|
||||
<a-button
|
||||
type="primary"
|
||||
icon="plus"
|
||||
|
@ -85,7 +88,10 @@
|
|||
@click="showDrawer(item)"
|
||||
>
|
||||
<div class="photo-thumb">
|
||||
<img :src="item.thumbnail" loading="lazy">
|
||||
<img
|
||||
:src="item.thumbnail"
|
||||
loading="lazy"
|
||||
>
|
||||
</div>
|
||||
<a-card-meta style="padding: 0.8rem;">
|
||||
<ellipsis
|
||||
|
@ -110,6 +116,39 @@
|
|||
@showSizeChange="handlePaginationChange"
|
||||
/>
|
||||
</div>
|
||||
<div style="position: fixed;bottom: 30px;right: 30px;">
|
||||
<a-button
|
||||
type="primary"
|
||||
shape="circle"
|
||||
icon="setting"
|
||||
size="large"
|
||||
@click="()=>this.optionFormVisible=true"
|
||||
></a-button>
|
||||
</div>
|
||||
<a-modal
|
||||
v-model="optionFormVisible"
|
||||
title="页面设置"
|
||||
:afterClose="onOptionFormClose"
|
||||
>
|
||||
<template slot="footer">
|
||||
<a-button
|
||||
key="submit"
|
||||
type="primary"
|
||||
@click="handleSaveOptions()"
|
||||
>保存</a-button>
|
||||
</template>
|
||||
<a-form layout="vertical">
|
||||
<a-form-item label="页面标题:">
|
||||
<a-input v-model="options.photos_title" />
|
||||
</a-form-item>
|
||||
<a-form-item label="每页显示条数:">
|
||||
<a-input
|
||||
type="number"
|
||||
v-model="options.photos_page_size"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
<a-drawer
|
||||
title="图片详情"
|
||||
:width="isMobile()?'100%':'460'"
|
||||
|
@ -289,9 +328,11 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { mapActions } from 'vuex'
|
||||
import { mixin, mixinDevice } from '@/utils/mixin.js'
|
||||
import AttachmentSelectDrawer from '../../attachment/components/AttachmentSelectDrawer'
|
||||
import photoApi from '@/api/photo'
|
||||
import optionApi from '@/api/option'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
@ -304,6 +345,7 @@ export default {
|
|||
drawerLoading: false,
|
||||
listLoading: true,
|
||||
thumDrawerVisible: false,
|
||||
optionFormVisible: false,
|
||||
photo: {},
|
||||
photos: [],
|
||||
teams: [],
|
||||
|
@ -319,14 +361,17 @@ export default {
|
|||
sort: null,
|
||||
keyword: null,
|
||||
team: null
|
||||
}
|
||||
},
|
||||
options: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.loadPhotos()
|
||||
this.loadTeams()
|
||||
this.loadFormOptions()
|
||||
},
|
||||
methods: {
|
||||
...mapActions(['loadOptions']),
|
||||
loadPhotos() {
|
||||
this.listLoading = true
|
||||
this.queryParam.page = this.pagination.page - 1
|
||||
|
@ -338,6 +383,11 @@ export default {
|
|||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
loadFormOptions() {
|
||||
optionApi.listAll().then(response => {
|
||||
this.options = response.data.data
|
||||
})
|
||||
},
|
||||
handleQuery() {
|
||||
this.handlePaginationChange(1, this.pagination.size)
|
||||
},
|
||||
|
@ -406,6 +456,17 @@ export default {
|
|||
this.drawerVisible = false
|
||||
this.photo = {}
|
||||
this.editable = false
|
||||
},
|
||||
handleSaveOptions() {
|
||||
optionApi.save(this.options).then(response => {
|
||||
this.loadFormOptions()
|
||||
this.loadOptions()
|
||||
this.$message.success('保存成功!')
|
||||
this.optionFormVisible = false
|
||||
})
|
||||
},
|
||||
onOptionFormClose() {
|
||||
this.optionFormVisible = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -637,6 +637,24 @@
|
|||
</template>
|
||||
<a-input v-model="options.sheet_prefix" />
|
||||
</a-form-item>
|
||||
<a-form-item label="友情链接页面前缀:">
|
||||
<template slot="help">
|
||||
<span>{{ options.blog_url }}/{{ options.links_prefix }}</span>
|
||||
</template>
|
||||
<a-input v-model="options.links_prefix" />
|
||||
</a-form-item>
|
||||
<a-form-item label="图库页面前缀:">
|
||||
<template slot="help">
|
||||
<span>{{ options.blog_url }}/{{ options.photos_prefix }}</span>
|
||||
</template>
|
||||
<a-input v-model="options.photos_prefix" />
|
||||
</a-form-item>
|
||||
<a-form-item label="日志页面前缀:">
|
||||
<template slot="help">
|
||||
<span>{{ options.blog_url }}/{{ options.journals_prefix }}</span>
|
||||
</template>
|
||||
<a-input v-model="options.journals_prefix" />
|
||||
</a-form-item>
|
||||
<a-form-item label="归档前缀:">
|
||||
<template slot="help">
|
||||
<span>{{ options.blog_url }}/{{ options.archives_prefix }}{{ options.path_suffix }}</span>
|
||||
|
|
Loading…
Reference in New Issue