|
|
@@ -1,5 +1,15 @@
|
|
|
<script>
|
|
|
import Vue from 'vue'
|
|
|
+
|
|
|
+import hugerte from 'hugerte'
|
|
|
+import 'hugerte/models/dom'
|
|
|
+import 'hugerte/icons/default'
|
|
|
+import 'hugerte/themes/silver'
|
|
|
+import 'hugerte/skins/ui/oxide/skin.js'
|
|
|
+import 'hugerte/skins/ui/oxide/content.js'
|
|
|
+import 'hugerte/skins/content/default/content.js'
|
|
|
+import 'hugerte/plugins/autoresize'
|
|
|
+
|
|
|
import { saveExpo, getMyExpoInfo } from '@/api/expo'
|
|
|
import { getFormList } from '@/api/form'
|
|
|
import { upload } from '@/api/system'
|
|
|
@@ -27,7 +37,7 @@ export default Vue.extend({
|
|
|
seo_title: '',
|
|
|
seo_description: '',
|
|
|
seo_keywords: '',
|
|
|
- show_official_footer: '1'
|
|
|
+ show_official_footer: 1
|
|
|
},
|
|
|
isShowMore: false,
|
|
|
formList: [],
|
|
|
@@ -47,6 +57,7 @@ export default Vue.extend({
|
|
|
this.exhibitorSetting = res.data
|
|
|
this.exhibitorSetting.images = JSON.parse(this.exhibitorSetting.images)
|
|
|
this.exhibitorSetting.social_links = JSON.parse(this.exhibitorSetting.social_links)
|
|
|
+ this.initEditor()
|
|
|
this.loading = false
|
|
|
}).catch(err => {
|
|
|
this.$notify({
|
|
|
@@ -64,6 +75,7 @@ export default Vue.extend({
|
|
|
this.exhibitorSetting.images = JSON.parse(this.exhibitorSetting.images)
|
|
|
this.exhibitorSetting.social_links = JSON.parse(this.exhibitorSetting.social_links)
|
|
|
this.exhibitorSetting.id = ''
|
|
|
+ this.initEditor()
|
|
|
this.loading = false
|
|
|
}).catch(err => {
|
|
|
this.$notify({
|
|
|
@@ -84,6 +96,50 @@ export default Vue.extend({
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
+ initEditor() {
|
|
|
+ hugerte.PluginManager.add('insertImage', (editor) => {
|
|
|
+ editor.ui.registry.addButton('insertImage', {
|
|
|
+ icon: 'image',
|
|
|
+ onAction: () => {
|
|
|
+ const input = document.createElement('input')
|
|
|
+ input.setAttribute('type', 'file')
|
|
|
+ input.setAttribute('accept', 'image/*')
|
|
|
+ input.onchange = () => {
|
|
|
+ upload(input.files[0]).then(res => {
|
|
|
+ let image = this.ossUrl + res.data.file
|
|
|
+ editor.insertContent(`<img src="${image}" />`)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ input.click()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ hugerte.remove()
|
|
|
+ hugerte.init({
|
|
|
+ selector: '#expoManangeEditor',
|
|
|
+ skin_url: 'default',
|
|
|
+ content_css: 'default',
|
|
|
+ inline: true,
|
|
|
+ statusbar: false,
|
|
|
+ plugins: 'insertImage',
|
|
|
+ toolbar: [
|
|
|
+ 'undo redo | bold italic underline | fontsize',
|
|
|
+ 'forecolor backcolor | alignleft aligncenter alignright | insertImage'
|
|
|
+ ],
|
|
|
+ menubar: false,
|
|
|
+ height: '100%',
|
|
|
+ width: '100%',
|
|
|
+ setup: editor => {
|
|
|
+ console.log(editor)
|
|
|
+ editor.on('init', () => {
|
|
|
+ editor.setContent(this.exhibitorSetting.content)
|
|
|
+ })
|
|
|
+ editor.on('change', () => {
|
|
|
+ this.exhibitorSetting.content = editor.getContent()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
uploadImage(event, type) {
|
|
|
this.loading = true
|
|
|
upload(event.target.files[0]).then(res => {
|
|
|
@@ -144,6 +200,7 @@ export default Vue.extend({
|
|
|
this.exhibitorSetting.form_template_id,
|
|
|
this.exhibitorSetting.page_template_id,
|
|
|
this.exhibitorSetting.urla,
|
|
|
+ this.exhibitorSetting.show_official_footer,
|
|
|
this.exhibitorSetting.seo_title,
|
|
|
this.exhibitorSetting.seo_description,
|
|
|
this.exhibitorSetting.seo_keywords
|
|
|
@@ -278,7 +335,7 @@ export default Vue.extend({
|
|
|
</div>
|
|
|
<div v-permission="'exhibitor.copyright'" class="form-item required">
|
|
|
<div class="label">表单底部显示系统信息</div>
|
|
|
- <el-switch v-model="exhibitorSetting.show_official_footer" active-value="1" inactive-value="0" class="input" />
|
|
|
+ <el-switch v-model="exhibitorSetting.show_official_footer" :active-value="1" :inactive-value="0" class="input" />
|
|
|
</div>
|
|
|
<div class="form-item">
|
|
|
<div class="label">高级设置</div>
|
|
|
@@ -334,12 +391,13 @@ export default Vue.extend({
|
|
|
<input type="file" class="uploader" @change="uploadImage($event,'cover')">
|
|
|
</div>
|
|
|
</div>
|
|
|
- <el-input v-model="exhibitorSetting.content" rows="12" type="textarea" class="text-area" placeholder="请输入展会介绍" />
|
|
|
+ <div class="text-area">
|
|
|
+ <div id="expoManangeEditor" />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
-
|
|
|
<style scoped lang="scss">
|
|
|
.main-box{
|
|
|
height: 100%;
|
|
|
@@ -420,6 +478,8 @@ export default Vue.extend({
|
|
|
overflow-y: auto;
|
|
|
}
|
|
|
.text-area{
|
|
|
+ padding: 0 16px;
|
|
|
+ width: 100%;
|
|
|
margin-top: 24px;
|
|
|
}
|
|
|
.vision-cont{
|