|  | @ -10,19 +10,30 @@ | 
		
	
		
			
				|  |  |       </div> |  |  |       </div> | 
		
	
		
			
				|  |  |       <editor mode="design" @after-init.native="onAfterInit" /> |  |  |       <editor mode="design" @after-init.native="onAfterInit" /> | 
		
	
		
			
				|  |  |     </div> |  |  |     </div> | 
		
	
		
			
				|  |  |  |  |  |     <img-editor | 
		
	
		
			
				|  |  |  |  |  |       v-if="editorShow" | 
		
	
		
			
				|  |  |  |  |  |       ref="imgEditorRef" | 
		
	
		
			
				|  |  |  |  |  |       :default-bg="curImgSrc" | 
		
	
		
			
				|  |  |  |  |  |       @closeDialog="closeDialog" | 
		
	
		
			
				|  |  |  |  |  |       @fullImgBack="fullImgBack" | 
		
	
		
			
				|  |  |  |  |  |     /> | 
		
	
		
			
				|  |  |   </div> |  |  |   </div> | 
		
	
		
			
				|  |  | </template> |  |  | </template> | 
		
	
		
			
				|  |  | <script> |  |  | <script> | 
		
	
		
			
				|  |  | 
 |  |  | 
 | 
		
	
		
			
				|  |  | import Editor from '@/components/formEditor/Editor.vue' |  |  | import Editor from '@/components/formEditor/Editor.vue' | 
		
	
		
			
				|  |  |  |  |  | import ImgEditor from '@/components/360View/img-editor.vue' | 
		
	
		
			
				|  |  | 
 |  |  | 
 | 
		
	
		
			
				|  |  | export default { |  |  | export default { | 
		
	
		
			
				|  |  |   name: 'Index', |  |  |   name: 'Index', | 
		
	
		
			
				|  |  |   components: { Editor }, |  |  |  | 
		
	
		
			
				|  |  |  |  |  |   components: { ImgEditor, Editor }, | 
		
	
		
			
				|  |  |   data() { |  |  |   data() { | 
		
	
		
			
				|  |  |     return { |  |  |     return { | 
		
	
		
			
				|  |  |       editor: null, |  |  |       editor: null, | 
		
	
		
			
				|  |  |       formList: [] |  |  |  | 
		
	
		
			
				|  |  |  |  |  |       formList: [], | 
		
	
		
			
				|  |  |  |  |  |       editorShow: false, | 
		
	
		
			
				|  |  |  |  |  |       curImgSrc: '', | 
		
	
		
			
				|  |  |  |  |  |       curKey: '' | 
		
	
		
			
				|  |  |     } |  |  |     } | 
		
	
		
			
				|  |  |   }, |  |  |   }, | 
		
	
		
			
				|  |  |   methods: { |  |  |   methods: { | 
		
	
	
		
			
				|  | @ -37,13 +48,33 @@ export default { | 
		
	
		
			
				|  |  |         // }) |  |  |         // }) | 
		
	
		
			
				|  |  |       } |  |  |       } | 
		
	
		
			
				|  |  |     }, |  |  |     }, | 
		
	
		
			
				|  |  |  |  |  |     closeDialog() { | 
		
	
		
			
				|  |  |  |  |  |       this.editorShow = false | 
		
	
		
			
				|  |  |  |  |  |     }, | 
		
	
		
			
				|  |  |  |  |  |     fullImgBack(value) { | 
		
	
		
			
				|  |  |  |  |  |       if (this.curKey) { | 
		
	
		
			
				|  |  |  |  |  |         this.editor.$(`#${this.curKey}`)[0].src = value | 
		
	
		
			
				|  |  |  |  |  |       } | 
		
	
		
			
				|  |  |  |  |  |     }, | 
		
	
		
			
				|  |  |     imageChange() { |  |  |     imageChange() { | 
		
	
		
			
				|  |  |       const data = this.editor.getBindObject().BODY |  |  |       const data = this.editor.getBindObject().BODY | 
		
	
		
			
				|  |  |       const keys = Object.keys(data) |  |  |       const keys = Object.keys(data) | 
		
	
		
			
				|  |  |       this.editor.$('#img_editor').click(() => { |  |  |  | 
		
	
		
			
				|  |  |         this.editor.$('#img_editor')[0].src = require('@/assets/img/od.png') |  |  |  | 
		
	
		
			
				|  |  |  |  |  |       // 筛选出图片编辑的字段 | 
		
	
		
			
				|  |  |  |  |  |       const imgEditorList = keys.filter(item => item.includes('imgEditor')) | 
		
	
		
			
				|  |  |  |  |  |       // 遍历图片编辑 | 
		
	
		
			
				|  |  |  |  |  |       imgEditorList.forEach(item => { | 
		
	
		
			
				|  |  |  |  |  |         // 点击打开编辑器 | 
		
	
		
			
				|  |  |  |  |  |         this.editor.$('#' + item).click(() => { | 
		
	
		
			
				|  |  |  |  |  |           this.curKey = item | 
		
	
		
			
				|  |  |  |  |  |           this.curImgSrc = data[item] // 编辑器默认背景图带入 | 
		
	
		
			
				|  |  |  |  |  |           this.editorShow = true | 
		
	
		
			
				|  |  |  |  |  |           this.$nextTick(() => { | 
		
	
		
			
				|  |  |  |  |  |             this.$refs.imgEditorRef.init() | 
		
	
		
			
				|  |  |  |  |  |           }) | 
		
	
		
			
				|  |  |  |  |  |           // this.editor.$('#img_editor')[0].src = require('@/assets/img/od.png') | 
		
	
		
			
				|  |  |  |  |  |         }) | 
		
	
		
			
				|  |  |       }) |  |  |       }) | 
		
	
		
			
				|  |  |       console.log(keys) |  |  |  | 
		
	
		
			
				|  |  |  |  |  |       // console.log(keys) | 
		
	
		
			
				|  |  |     }, |  |  |     }, | 
		
	
		
			
				|  |  |     saveForm() { |  |  |     saveForm() { | 
		
	
		
			
				|  |  |       const html = this.editor.getHtml() |  |  |       const html = this.editor.getHtml() | 
		
	
	
		
			
				|  | 
 |