diff --git a/src/views/intelligent-agent/components/info/index.vue b/src/views/intelligent-agent/components/info/index.vue index a542d14..8fed2a7 100644 --- a/src/views/intelligent-agent/components/info/index.vue +++ b/src/views/intelligent-agent/components/info/index.vue @@ -20,9 +20,25 @@ export default { } } }, + + watch: { + 'dialog.agent': { + handler(val) { + console.log(val) + this.image = val.image + this.imageType = val.imageType + this.background = val.backgroundColor + }, + immediate: true, + deep: true + } + }, + data() { return { isImage: '0', + image: '', + imageType: '', popover: false, background: '', chooseBack: [ @@ -79,8 +95,17 @@ export default { }, chooseGround(colors) { - this.$set(this.dialog.agent, 'backgroundColor', colors) + this.background = colors }, + + saveEmoji() { + this.dialog.agent.image = this.image + this.dialog.agent.imageType = this.imageType + this.$set(this.dialog.agent, 'backgroundColor', this.background) + + this.popover = false + }, + /** * 提交表单 */ @@ -104,8 +129,9 @@ export default { }, // 选择emoji selectEmoji(e) { - this.dialog.agent.image = e.data - this.dialog.agent.imageType = 'emoji' + this.image = e.data + this.imageType = 'emoji' + // this.dialog.agent.imageType = 'emoji' }, // 选择是否是上传图片 changeUploadImage(e) { @@ -129,11 +155,8 @@ export default { label-position="top" label-width="80px" > -