Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

refactor: theme setting page #380

Merged
merged 5 commits into from
Jan 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@codemirror/basic-setup": "^0.19.0",
"@codemirror/lang-html": "^0.19.3",
"@codemirror/lang-java": "^0.19.1",
"@halo-dev/admin-api": "^1.0.0-alpha.44",
"@halo-dev/admin-api": "^1.0.0-alpha.46",
"ant-design-vue": "^1.7.8",
"crypto-js": "^4.1.1",
"dayjs": "^1.10.7",
Expand Down
33 changes: 15 additions & 18 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 47 additions & 0 deletions src/components/Input/AttachmentInput.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<template>
<div>
<a-input :defaultValue="defaultValue" :placeholder="placeholder" :value="value" @change="onInputChange">
<a slot="addonAfter" href="javascript:void(0);" @click="attachmentDrawerVisible = true">
<a-icon type="picture" />
</a>
</a-input>
<AttachmentSelectDrawer
v-model="attachmentDrawerVisible"
title="选择附件"
@listenToSelect="handleSelectAttachment"
/>
</div>
</template>
<script>
export default {
name: 'AttachmentInput',
props: {
value: {
type: String,
default: ''
},
defaultValue: {
type: String,
default: ''
},
placeholder: {
type: String,
default: ''
}
},
data() {
return {
attachmentDrawerVisible: false
}
},
methods: {
onInputChange(e) {
this.$emit('input', e.target.value)
},
handleSelectAttachment(data) {
this.$emit('input', encodeURI(data.path))
this.attachmentDrawerVisible = false
}
}
}
</script>
4 changes: 3 additions & 1 deletion src/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import AttachmentSelectDrawer from './Attachment/AttachmentSelectDrawer'
import AttachmentUploadModal from './Attachment/AttachmentUploadModal'
import ReactiveButton from './Button/ReactiveButton'
import PostTag from './Post/PostTag'
import AttachmentInput from './Input/AttachmentInput'

const _components = {
Ellipsis,
Expand All @@ -15,7 +16,8 @@ const _components = {
AttachmentSelectDrawer,
AttachmentUploadModal,
ReactiveButton,
PostTag
PostTag,
AttachmentInput
}

const components = {}
Expand Down
14 changes: 10 additions & 4 deletions src/config/router.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,16 +141,22 @@ export const asyncRouterMap = [
meta: { title: '主题', hiddenHeaderContent: false }
},
{
path: '/interface/menus',
name: 'MenuList',
component: () => import('@/views/interface/MenuList'),
meta: { title: '菜单', hiddenHeaderContent: false }
path: '/interface/themes/setting',
name: 'ThemeSetting',
component: () => import('@/views/interface/ThemeSetting'),
meta: { title: '主题设置', hiddenHeaderContent: false }
},
{
path: '/interface/themes/edit',
name: 'ThemeEdit',
component: () => import('@/views/interface/ThemeEdit'),
meta: { title: '主题编辑', hiddenHeaderContent: false }
},
{
path: '/interface/menus',
name: 'MenuList',
component: () => import('@/views/interface/MenuList'),
meta: { title: '菜单设置', hiddenHeaderContent: false }
}
]
},
Expand Down
4 changes: 3 additions & 1 deletion src/core/lazy_lib/components_use.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ import {
TimePicker,
Tooltip,
Tree,
TreeSelect
TreeSelect,
Descriptions
} from 'ant-design-vue'

Vue.use(Affix)
Expand Down Expand Up @@ -106,6 +107,7 @@ Vue.use(Steps)
Vue.use(Empty)
Vue.use(Result)
Vue.use(Space)
Vue.use(Descriptions)

// message config
message.config({
Expand Down
2 changes: 2 additions & 0 deletions src/layouts/PageView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<a-page-header :breadcrumb="{ props: { routes: breadList } }" :sub-title="subTitle" :title="title">
<slot slot="extra" name="extra"></slot>
<slot slot="footer" name="footer"></slot>
<slot name="content" />
</a-page-header>
</div>
</div>
Expand All @@ -15,6 +16,7 @@
<a-page-header :breadcrumb="{ props: { routes: breadList } }" :sub-title="subTitle" :title="title">
<slot slot="extra" name="extra"></slot>
<slot slot="footer" name="footer"></slot>
<slot name="content" />
</a-page-header>
</div>
</div>
Expand Down
Loading