Commit cda4ae8b by 王志慧

Merge branch 'v3.11.0' of http://192.168.3.233:8090/saas/scrm-micro-home into v3.11.0

2 parents b730dc0c 5397179e
export default {
namespaced: true,
state: {
activityInfo: {},
activityId: '',
activityDate: '',
activityProject: {}
},
mutations: {
// 设置活动信息
SET_ACTIVITY_INFO(state, data) {
state.activityInfo = data
},
// 设置活动ID
SET_ACTIVITY_ID(state, data) {
state.activityId = data
},
// 设置活动日期
SET_ACTIVITY_DATE(state, data) {
state.activityDate = data
},
// 设置活动项
SET_ACTIVITY_PEOJECT(state, data) {
state.activityProject = data
}
},
actions: {
setActivityInfo({ commit }, data) {
commit('SET_ACTIVITY_INFO', data)
},
setActivityId({ commit }, data) {
commit('SET_TOKEN', data)
},
setActivityDate({ commit }, data) {
commit('SET_ACTIVITY_DATE', data)
},
setActivityProject({ commit }, data) {
commit('SET_ACTIVITY_PEOJECT', data)
}
}
}
<!-- <!--
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2023-05-16 10:20:01 * @Date: 2023-05-16 10:20:01
* @LastEditors: yangming qianduan01@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-16 13:41:12 * @LastEditTime: 2023-05-16 16:37:59
* @FilePath: \scrm-micro-home\src\views\home\components\Marketing\ChatGPT.vue * @FilePath: \scrm-micro-home\src\views\home\components\Marketing\ChatGPT.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -25,35 +25,30 @@ ...@@ -25,35 +25,30 @@
</div> </div>
</div> </div>
<div class="gpt-body"> <div class="gpt-body">
<div class="error-tips flex-center"> <div class="error-tips flex-center" v-if="isError">
<i class="el-icon-error"></i> <i class="el-icon-error"></i>
<span>无法识别营销场景,请重新输入</span> <span>无法识别营销场景,请重新输入</span>
<i class="el-icon-close"></i> <i class="el-icon-close"></i>
</div> </div>
<div class="chat-panel" ref="chatRef" v-else>
<div class="chat-panel-b" ref="chatBRef">
<div :class="['chat-item', item.type == 2 ? 'is-left' : 'is-right']" v-for="(item, i) in chatItem" :key="i">
<div class="item-content left-item" v-if="item.type == 2">{{ item.content }}</div>
<div class="item-content right-item" v-else>{{ item.content }}</div>
</div>
</div>
</div>
</div> </div>
<div class="gpt-footer"> <div class="gpt-footer">
<div class="input-box" contenteditable="true"></div> <div class="input-box" contenteditable="true" v-html="contentHtml" ref="inputRef"></div>
<div class="input-operate"> <div class="input-operate">
<div class="select-box"> <div class="select-box">
<el-button size="mini">常用语</el-button> <el-button size="mini" @click="phrasesShow = true" ref="phrases">常用语</el-button>
<div class="select-panel"> <div class="select-panel" v-show="phrasesShow">
<div class="select-item"> <div class="select-item" v-for="(item, index) in phrases" :key="index" v-html="item" @click="selectText(item)"></div>
创建一个
<label>端午节</label>
的营销活动,活动时间为
<label>6月份</label>
。
</div>
<div class="select-item">
创建一个
<label>端午节</label>
的营销活动,活动时间为
<label>6月份</label>
。
</div>
</div> </div>
</div> </div>
<el-button type="primary" size="small">发送</el-button> <el-button type="primary" size="small" @click="sendMsg">发送</el-button>
</div> </div>
</div> </div>
</div> </div>
...@@ -62,7 +57,21 @@ ...@@ -62,7 +57,21 @@
export default { export default {
data() { data() {
return { return {
isError: false,
phrasesShow: false,
importNum: 1, importNum: 1,
contentHtml: '',
phrases: ['创建一个<span>端午节</span>的营销活动,活动时间为<span>6月份</span>', '我需要一个<span>立夏</span>的节日关怀营销活动', '建立一个<span>父亲节</span>的节日关怀活动'],
chatItem: [
{
type: 1,
content: '我需要制定一套续保营销方案,活动时间为5月份'
},
{
type: 2,
content: '我们为您生成以下方案,请查看“营销模型解析”'
}
],
importItem: [ importItem: [
{ {
title: '基盘总客户数' title: '基盘总客户数'
...@@ -75,6 +84,46 @@ export default { ...@@ -75,6 +84,46 @@ export default {
} }
] ]
} }
},
watch: {
chatItem() {
const chatRef = this.$refs.chatRef
this.$nextTick(() => {
const height = this.$refs.chatBRef.offsetHeight - chatRef.offsetHeight + 40
chatRef.scrollTop = height //滚动到最底部
})
}
},
methods: {
selectText(html) {
this.contentHtml = html
this.phrasesShow = false
},
//发送消息
sendMsg() {
const content = this.$refs.inputRef.textContent
if (!content.trim()) return
this.chatItem.push({
type: 1,
content
})
this.$refs.inputRef.textContent = ''
},
/**点击空白处隐藏下拉框 */
bodyCloseMenus(e) {
const self = this
if (this.$refs.phrases && !this.$refs.phrases.$el.contains(e.target)) {
if (self.phrasesShow === true) {
self.phrasesShow = false
}
}
}
},
mounted() {
document.addEventListener('click', this.bodyCloseMenus)
},
beforeDestroy() {
document.removeEventListener('click', this.bodyCloseMenus)
} }
} }
</script> </script>
...@@ -96,6 +145,12 @@ export default { ...@@ -96,6 +145,12 @@ export default {
padding-left: 16px; padding-left: 16px;
display: flex; display: flex;
align-items: center; align-items: center;
.import-item {
margin-right: 80px;
span {
color: #5850ff;
}
}
} }
} }
.gpt-body { .gpt-body {
...@@ -118,6 +173,30 @@ export default { ...@@ -118,6 +173,30 @@ export default {
color: #666666; color: #666666;
} }
} }
.chat-panel {
padding-top: 12px;
height: 150px;
overflow: auto;
.chat-item {
margin-top: 8px;
display: flex;
&.is-left {
justify-content: flex-start;
}
&.is-right {
justify-content: flex-end;
}
.item-content {
font-size: 14px;
display: inline-block;
padding: 12px 8px;
border: 1px solid #e5e5e5;
border-radius: 4px 4px 4px 0;
background: #fafbfe;
max-width: 500px;
}
}
}
} }
.gpt-footer { .gpt-footer {
height: 98px; height: 98px;
...@@ -150,7 +229,7 @@ export default { ...@@ -150,7 +229,7 @@ export default {
color: #666666ff; color: #666666ff;
font-size: 14px; font-size: 14px;
cursor: pointer; cursor: pointer;
label { span {
color: #eb4e4e; color: #eb4e4e;
} }
&:hover { &:hover {
...@@ -163,3 +242,9 @@ export default { ...@@ -163,3 +242,9 @@ export default {
} }
} }
</style> </style>
<style>
.select-item span,
.input-box span {
color: #eb4e4e;
}
</style>
<!-- <!--
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2023-05-15 15:08:32 * @Date: 2023-05-15 15:08:32
* @LastEditors: 前端 qianduan01@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-15 15:32:26 * @LastEditTime: 2023-05-16 17:10:29
* @FilePath: \scrm-micro-home\src\views\home\components\Marketing\MarketingRight.vue * @FilePath: \scrm-micro-home\src\views\home\components\Marketing\MarketingRight.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
<template> <template>
<div class="review-box"></div> <div class="review-box">
<div class="review-title">预览营销方案</div>
<div class="review-body">
<img src="@/assets/img/phone.png" alt="" />
</div>
<div class="review-refresh">更新预览图</div>
<div class="review-save">保存方案</div>
</div>
</template> </template>
<script> <script>
export default {} export default {}
...@@ -15,5 +22,43 @@ export default {} ...@@ -15,5 +22,43 @@ export default {}
<style lang="scss" scoped> <style lang="scss" scoped>
.review-box { .review-box {
background: #fff; background: #fff;
margin-top: 10px;
padding: 8px;
.review-title {
padding: 8px;
font-size: 16px;
color: #333333;
}
.review-body {
margin: 10px auto;
width: 100%;
img {
width: 100%;
}
}
.review-refresh {
margin: 18px auto 0px;
width: 274px;
height: 36px;
line-height: 36px;
text-align: center;
background: #685bff;
font-size: 14px;
color: #ffffff;
border-radius: 4px;
}
.review-save {
margin: 8px auto;
width: 274px;
height: 36px;
background: #ffffff;
line-height: 36px;
text-align: center;
border: 1px solid #c8c8c8;
border-radius: 4px;
font-size: 14px;
color: #666666;
border-radius: 4px;
}
} }
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!