Support attachment type for theme setting.

pull/40/head
ruibaby 5 years ago
parent f00c808542
commit 7da2f730eb

@ -245,13 +245,9 @@
<script> <script>
import ThemeSetting from './components/ThemeSetting' import ThemeSetting from './components/ThemeSetting'
import themeApi from '@/api/theme' import themeApi from '@/api/theme'
import Verte from 'verte'
import 'verte/dist/verte.css'
export default { export default {
components: { components: {
ThemeSetting, ThemeSetting
Verte
}, },
data() { data() {
return { return {

@ -127,6 +127,19 @@
v-else-if="item.type == 'COLOR'" v-else-if="item.type == 'COLOR'"
style="display: inline-block;height: 24px;" style="display: inline-block;height: 24px;"
></verte> ></verte>
<a-input
v-model="themeSettings[item.name]"
:defaultValue="item.defaultValue"
v-else-if="item.type == 'ATTACHMENT'"
>
<a
href="javascript:void(0);"
slot="addonAfter"
@click="handleShowSelectAttachment(item.name)"
>
<a-icon type="picture" />
</a>
</a-input>
<a-input <a-input
v-model="themeSettings[item.name]" v-model="themeSettings[item.name]"
:defaultValue="item.defaultValue" :defaultValue="item.defaultValue"
@ -147,6 +160,13 @@
</a-col> </a-col>
</a-row> </a-row>
<AttachmentSelectDrawer
v-model="attachmentDrawerVisible"
@listenToSelect="handleSelectAttachment"
title="选择附件"
isChooseAvatar
/>
<footer-tool-bar <footer-tool-bar
v-if="themeConfiguration.length>0" v-if="themeConfiguration.length>0"
:style="{ width: isSideMenu() && isDesktop() ? `calc(100% - ${sidebarOpened ? 256 : 80}px)` : '100%'}" :style="{ width: isSideMenu() && isDesktop() ? `calc(100% - ${sidebarOpened ? 256 : 80}px)` : '100%'}"
@ -162,20 +182,25 @@
import { mixin, mixinDevice } from '@/utils/mixin.js' import { mixin, mixinDevice } from '@/utils/mixin.js'
import AttachmentSelectDrawer from '../../attachment/components/AttachmentSelectDrawer' import AttachmentSelectDrawer from '../../attachment/components/AttachmentSelectDrawer'
import FooterToolBar from '@/components/FooterToolbar' import FooterToolBar from '@/components/FooterToolbar'
import Verte from 'verte'
import 'verte/dist/verte.css'
import themeApi from '@/api/theme' import themeApi from '@/api/theme'
export default { export default {
name: 'ThemeSetting', name: 'ThemeSetting',
mixins: [mixin, mixinDevice], mixins: [mixin, mixinDevice],
components: { components: {
AttachmentSelectDrawer, AttachmentSelectDrawer,
FooterToolBar FooterToolBar,
Verte
}, },
data() { data() {
return { return {
attachmentDrawerVisible: false,
selectedTheme: this.theme, selectedTheme: this.theme,
themeConfiguration: [], themeConfiguration: [],
themeSettings: [], themeSettings: [],
settingLoading: true, settingLoading: true,
selectedField: '',
wrapperCol: { wrapperCol: {
xl: { span: 12 }, xl: { span: 12 },
lg: { span: 12 }, lg: { span: 12 },
@ -237,6 +262,14 @@ export default {
}, },
onClose() { onClose() {
this.$emit('close', false) this.$emit('close', false)
},
handleShowSelectAttachment(field) {
this.selectedField = field
this.attachmentDrawerVisible = true
},
handleSelectAttachment(data) {
this.themeSettings[this.selectedField] = encodeURI(data.path)
this.attachmentDrawerVisible = false
} }
} }
} }

Loading…
Cancel
Save