Commit e5b5b2b8 by 前端

Merge branch 'saas+v4.25.0' into 'master'

合并Saas+v4.25.0

See merge request !21
2 parents 0807eec2 f1e806e7
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
"autoprefixer": "^8.0.0", "autoprefixer": "^8.0.0",
"core-js": "^3.6.4", "core-js": "^3.6.4",
"dayjs": "^1.10.5", "dayjs": "^1.10.5",
"emoji-regex": "^10.2.1",
"glsx-common": "^2.1.0", "glsx-common": "^2.1.0",
"lib-flexible": "^0.3.2", "lib-flexible": "^0.3.2",
"postcss-loader": "^6.2.0", "postcss-loader": "^6.2.0",
......
const url = '/rop-scrm-marketing/router'
import { utils } from 'glsx-common'
export default {
/**查询喜报战报推送日志分页列表 */
issueChatGpt (data) {
const method = 'scrm.api.knowledge.gptchat'
return httpRequest(method, data)
},
/**
* 获取AI id
*/
getAiId (data) {
data.method = 'marketing.api.scriptlibrary.ai.id'
return window.$HTTP({
url,
data,
returnAll: true
})
},
/**
* 新增聊天记录
*/
updatedAiRecord (data) {
data.method = 'marketing.api.scriptlibrary.ai.record.add'
return window.$HTTP({
url,
data
})
},
}
const httpRequest = (method, data) => {
const { secret, sign, request } = window.$fetchConfig
Object.assign(data, {
method,
...sign
})
return new Promise((resolve, reject) => {
window.fetch(`${request.chatGptURL}/router/${method}/1.0.0`, {
method: 'POST',
headers: { 'Content-Type': 'application/json;charset=UTF-8' },
body: JSON.stringify(utils.createSign(data, secret))
}).then(res => {
resolve(res.json())
}).catch(err => {
reject(err)
})
})
}
\ No newline at end of file \ No newline at end of file
...@@ -11,11 +11,12 @@ import merchantsApi from './merchantsApi' ...@@ -11,11 +11,12 @@ import merchantsApi from './merchantsApi'
import wxConfig from './wxConfig' import wxConfig from './wxConfig'
import marketingApi from './marketingApi' import marketingApi from './marketingApi'
import entmicroApi from './entmicroApi' import entmicroApi from './entmicroApi'
import chatgptApi from './chatgptApi'
export { export {
ssoApi, ssoApi,
wxConfig, wxConfig,
merchantsApi, merchantsApi,
marketingApi, marketingApi,
entmicroApi entmicroApi,
chatgptApi
} }
\ No newline at end of file \ No newline at end of file
...@@ -16,6 +16,11 @@ body .app { ...@@ -16,6 +16,11 @@ body .app {
--envSafeAreaInsetBottom: env(safe-area-inset-bottom); --envSafeAreaInsetBottom: env(safe-area-inset-bottom);
} }
.isFullSucreen {
padding-bottom: var(--constantSafeAreaInsetBottom) !important;
padding-bottom: var(--envSafeAreaInsetBottom) !important;
}
img { img {
width: 100%; width: 100%;
height: 100%; height: 100%;
...@@ -79,6 +84,7 @@ img { ...@@ -79,6 +84,7 @@ img {
.van-dropdown-menu { .van-dropdown-menu {
margin-left: auto; margin-left: auto;
.icon-down { .icon-down {
transition: all 0.25s; transition: all 0.25s;
} }
...@@ -95,6 +101,7 @@ img { ...@@ -95,6 +101,7 @@ img {
.van-dropdown-menu__title { .van-dropdown-menu__title {
color: #545454 !important; color: #545454 !important;
font-size: 16px; font-size: 16px;
&::after { &::after {
display: none; display: none;
} }
...@@ -108,8 +115,9 @@ img { ...@@ -108,8 +115,9 @@ img {
color: #5F5F5F !important; color: #5F5F5F !important;
font-size: 12px; font-size: 12px;
} }
.van-dropdown-menu__title--active { .van-dropdown-menu__title--active {
color: var(--themeColor) !important; color: var(--themeColor) !important;
} }
} }
} }
\ No newline at end of file \ No newline at end of file
.sprite-icon { background-image: url(../images/sprite.png);background-size: 105px 90px;} .sprite-icon { background-image: url(../images/sprite.png);background-size: 133px 94px;}
.icon-down { width: 12px; height: 12px; background-position: -26px -74px;} .icon-ai { width: 20px; height: 20px; background-position: -84px -30px;}
.icon-eye { width: 13px; height: 8px; background-position: -48px -74px;} .icon-close { width: 20px; height: 20px; background-position: 0px -74px;}
.icon-gift-del { width: 18px; height: 18px; background-position: -84px -30px;} .icon-down { width: 12px; height: 12px; background-position: -115px -54px;}
.icon-grctx { width: 16px; height: 16px; background-position: 0px -74px;} .icon-eye { width: 13px; height: 8px; background-position: -115px -76px;}
.icon-gift-del { width: 18px; height: 18px; background-position: -115px 0px;}
.icon-grctx { width: 16px; height: 16px; background-position: -115px -28px;}
.icon-link { width: 32px; height: 32px; background-position: -42px 0px;} .icon-link { width: 32px; height: 32px; background-position: -42px 0px;}
.icon-menu-active { width: 22px; height: 20px; background-position: 0px -44px;} .icon-menu-active { width: 22px; height: 20px; background-position: 0px -44px;}
.icon-menu { width: 22px; height: 20px; background-position: -32px -44px;} .icon-menu { width: 22px; height: 20px; background-position: -32px -44px;}
.icon-more { width: 20px; height: 20px; background-position: -30px -74px;}
.icon-pdf { width: 32px; height: 34px; background-position: 0px 0px;} .icon-pdf { width: 32px; height: 34px; background-position: 0px 0px;}
.icon-profile { width: 20px; height: 20px; background-position: -60px -74px;}
.icon-PYQ { width: 21px; height: 20px; background-position: -84px 0px;} .icon-PYQ { width: 21px; height: 20px; background-position: -84px 0px;}
.icon-send { width: 10px; height: 10px; background-position: -64px -44px;} .icon-send { width: 10px; height: 10px; background-position: -64px -44px;}
\ No newline at end of file \ No newline at end of file

10 KB | W: | H:

16 KB | W: | H:

src/assets/images/sprite.png
src/assets/images/sprite.png
src/assets/images/sprite.png
src/assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
<template>
<div
class="chat-gpt-box"
v-show="show"
>
<div
:class="['view',{'show-tips':showTips&& issuesList.length}]"
ref="contentView"
>
<div class="content-item left">
<div class="sprite-icon icon-ai icon"></div>
<div class="content">
您可以向我提问公司的业务产品或销售等相关问题,我将给您组织语言并提供建议,您可以复制段落稍作润色并答复给您的客户。
</div>
</div>
<template v-for="(i,index) in contentList">
<div :key="index">
<template v-if="i.contentType == 1">
<div class="content-item left">
<div class="sprite-icon icon-ai icon"></div>
<div class="content">
<template v-if="!i.content">
<van-loading
class="loading"
color="#3582EE"
/>
</template>
<template v-else>
{{ i.content }}
</template>
</div>
</div>
</template>
<template v-else>
<div class="content-item right">
<div class="content">{{i.content}}</div>
<div class="sprite-icon icon-profile icon"></div>
</div>
</template>
</div>
</template>
</div>
<template v-if="showTips && issuesList.length">
<div class="tips-box">
<div class="tips-title flex">
您可以这样向我提问
<div
class="sprite-icon icon-close"
@click="showTips = false"
></div>
</div>
<div class="tips-view">
<template v-for="(i,index) in issuesList">
<div
:key="index"
class="tips-item flex"
@click="send(i)"
>
{{ i }}
<div class="sprite-icon icon-more"></div>
</div>
</template>
</div>
</div>
</template>
<div :class="['input-box flex isFullSucreen']">
<van-field
v-model="issue"
:border="false"
placeholder="请输入文字向AI提问"
enterKeyhint="send"
@keydown="onkeydown"
ref="input"
maxlength="1000"
></van-field>
<van-button @click="send()">发送</van-button>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import { chatgptApi } from '@/api'
import * as dayjs from 'dayjs'
import emojiRegex from 'emoji-regex'
export default {
name: 'ChatGpt',
props: {
show: Boolean
},
data () {
return {
contentList: [],
issuesList: window.$fetchConfig.issuesList || [],
showTips: true,
issue: '',
scriptLibraryAIId: '',
todayQuestionLeft: 0,
questionCountTotal: 20,
lastQuestionTime: '',
padding: false
}
},
watch: {
issue (newText) {
this.issue = this.filterText(newText);
}
},
mounted () {
this.getAiId()
},
methods: {
filterText (text) {
const whitespaceRegex = /^\s+$/g
return text.replace(emojiRegex(), '').replace(whitespaceRegex, '')
},
async getAiId () {
this.showLoading()
const { merchantId, uuid, merchantName, userName, loginList } = this.getLocalStorage('dj_scrm_userInfo')
let { phone } = loginList.find(e => e.merchantNo == merchantId)
try {
const { code, data, message } = await chatgptApi.getAiId({
merchantId,
merchantName,
staffUuid: uuid,
staffName: userName,
staffPhone: phone
})
if (code == 0 && data) {
this.scriptLibraryAIId = data.scriptLibraryAIId
this.todayQuestionLeft = data.todayQuestionLeft
this.questionCountTotal = data.questionCountTotal
}
else throw message
this.hideLoading()
} catch (error) {
console.log(error)
this.showToast(error)
}
},
onkeydown (e) {
if (e.keyCode == 13) {
this.send()
}
},
send (val) {
const { issue, todayQuestionLeft, questionCountTotal, padding } = this,
content = val || issue
try {
if (!content) throw false
if (padding) throw '请等待回复后再试'
if (todayQuestionLeft < 1) throw `每天每个用户最多发送提问${questionCountTotal}个问题`
} catch (error) {
if (error) this.showToast(error)
return
}
const id = Date.now()
this.contentList.push({
contentType: 0,
content,
chatTime: dayjs(id).format('YYYY-MM-DD HH:mm:ss'),
id
})
this.padding = true
this.lastQuestionTime = dayjs().format('YYYY-MM-DD HH:mm:ss')
if (!val) {
this.issue = ''
this.$refs.input.blur()
}
this.$nextTick(() => {
this.addRecord(id)
this.toQuestionChatGPT(content)
})
},
toBottom () {
this.$nextTick(() => {
this.$refs.contentView.scrollTop = 999999999
})
},
async toQuestionChatGPT (question) {
const id = Date.now()
this.contentList.push({
contentType: 1,
content: '',
id
})
this.toBottom()
try {
const { response } = await chatgptApi.issueChatGpt({
question,
history: ''
})
this.padding = false
this.contentList.find(i => i.id == id).chatTime = dayjs().format('YYYY-MM-DD HH:mm:ss')
let index = 0, speed = 10
const typeWriter = () => {
if (index < response.length) {
this.contentList.find(i => i.id == id).content += response.charAt(index)
index++
setTimeout(typeWriter, speed)
this.toBottom()
} else this.addRecord(id)
}
typeWriter()
} catch (error) {
this.padding = false
}
},
addRecord (id) {
const { contentList, scriptLibraryAIId, lastQuestionTime } = this,
item = contentList.find(i => i.id == id)
delete item.id
let params = {
lastQuestionTime,
aiRecordList: [item],
scriptLibraryAIId
}
if (item.contentType == 1 && item.content.indexOf('很抱歉') == -1) params.questionEffectiveCount = 1
if (item.contentType != 1) params.questionCount = 1
chatgptApi.updatedAiRecord(params).then(res => {
this.getAiId()
})
}
}
}
</script>
<style scoped lang='scss'>
.chat-gpt-box {
height: calc(100vh - 50px - var(--constantSafeAreaInsetBottom));
height: calc(100vh - 50px - var(--envSafeAreaInsetBottom));
.view {
height: calc(100% - 52px);
overflow-y: scroll;
position: relative;
box-sizing: border-box;
padding-bottom: 12px;
background-color: #fff;
.content-item {
margin-top: 12px;
padding: 0 12px;
display: flex;
.icon {
width: 20px;
height: 20px;
user-select: none;
}
.content {
max-width: 290px;
background: #f8f9f9;
box-sizing: border-box;
padding: 10px;
font-size: 16px;
color: #333333;
line-height: 22px;
word-break: break-all;
}
}
@keyframes typing {
from {
width: 0;
}
to {
width: 100%;
}
}
.left {
.icon {
margin-right: 6px;
}
.content {
border-radius: 0 10px 10px 10px;
}
}
.right {
.icon {
margin-left: 6px;
}
.content {
margin-left: auto;
background: #c9e7fe;
border: 1px solid #3582ee33;
border-radius: 10px 0 10px 10px;
}
}
}
.show-tips {
height: calc(100% - 262px);
}
.tips-box {
width: 100%;
height: 210px;
background-image: linear-gradient(180deg, #d6e6fb 0%, #ffffff 14%);
position: relative;
box-sizing: border-box;
.tips-title {
padding: 14px 16px 7px;
font-weight: 600;
font-size: 16px;
color: #3582ee;
.icon-close {
margin-left: auto;
}
}
.tips-view {
height: calc(100% - 42px);
overflow-y: scroll;
padding: 0 16px;
.tips-item {
border-bottom: 1px solid #e4e6ee;
line-height: 18px;
padding: 7px 0;
font-size: 13px;
color: #333333;
.icon-more {
margin-left: auto;
flex-shrink: 0;
// background-position: -60px -72px;
// transform: translateY(-2px);
}
&:last-of-type {
border: none;
}
}
}
}
.input-box {
padding: 7px 11px 7px 16px;
background: #ffffff;
.van-field {
width: 278px;
padding: 9px 16px;
font-size: 14px;
color: #c8c9cc;
line-height: 20px;
background: #f7f8fa;
border-radius: 19px;
}
.van-button {
width: 60px;
height: 38px;
background: #3582ee;
border-radius: 19px;
margin-left: auto;
font-weight: 500;
font-size: 16px;
color: #ffffff;
padding: 0;
}
}
.fixedKeyboard {
// position: fixed;
// width: 100%;
// box-sizing: border-box;
// bottom: 0;
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
v-model="tabIndex" v-model="tabIndex"
color="#3975C6" color="#3975C6"
title-inactive-color="#BBB" title-inactive-color="#BBB"
title-active-color="#2c2c2c" title-active-color="#3975C6"
@click="click" @click="click"
:key="updata" :key="updata"
v-bind="$attrs" v-bind="$attrs"
......
...@@ -8,16 +8,23 @@ ...@@ -8,16 +8,23 @@
*/ */
// 本地环境配置 // 本地环境配置
module.exports = { module.exports = {
title: '嘀加企微助手', title: '嘻嘻',
envVersion: 'trial', envVersion: 'trial',
request: { request: {
// baseURL: '//192.168.3.191:7860', // 本地测试项目地址,
baseURL: '//scrm.test.glsx.com.cn', // 本地测试项目地址, baseURL: '//scrm.test.glsx.com.cn', // 本地测试项目地址,
// 设置超时时间 // 设置超时时间
timeout: 180000, timeout: 180000,
// 携带凭证 // 携带凭证
withCredentials: true, withCredentials: true,
// 返回数据类型 // 返回数据类型
responseType: 'json', responseType: 'json',
chatGptURL:'//chatgpt.dev.glsx.com.cn',
/**
* 开发//chatgpt.dev.glsx.com.cn
* 测试//chatgpt.dev.glsx.com.cn
*/
ropMerchantURL: 'http://rop-merchant.dev.glsx.com.cn' ropMerchantURL: 'http://rop-merchant.dev.glsx.com.cn'
/** /**
* 开发:http://rop-merchant.dev.glsx.com.cn * 开发:http://rop-merchant.dev.glsx.com.cn
...@@ -44,5 +51,18 @@ module.exports = { ...@@ -44,5 +51,18 @@ module.exports = {
source: "scrm-main", source: "scrm-main",
v: "1.0.0", v: "1.0.0",
}, },
vconsole: true vconsole: true,
issuesList: [
'你这个保险有点贵啊,好像别人那里都没有那么高的价格。',
'我这个保险在外面朋友买没那么便宜。',
'这个保费怎么那么贵,我第二年的保费多少钱?',
'座位险/驾乘险可以不要吗?',
'第三者怎么要买300万,我买200万/100万就可以了?',
'这个保险我可以不买吗?', '这个保险怎么理赔的?',
'你说的那些服务我也不一定能用上啊',
'我之前开车那么多年,没有过爆胎这些情况的。',
'我家里有其他车了,你们的补贴我不需要。',
'这个保险我买2年的话,第二年你买其他保险也可以的吗?',
'我这个车用车比较少,车辆那么新,不会爆胎的。'
]
} }
\ No newline at end of file \ No newline at end of file
...@@ -16,15 +16,15 @@ const state = { ...@@ -16,15 +16,15 @@ const state = {
lastPath: '' lastPath: ''
} }
const mutations = { const mutations = {
SET_PAGE_META(state, meta) { SET_PAGE_META (state, meta) {
state.pageMeta = meta state.pageMeta = meta
}, },
PUSH_KEEP(state, name) { PUSH_KEEP (state, name) {
if (!state.keepAlives.includes(name)) { if (!state.keepAlives.includes(name)) {
state.keepAlives.push(name) state.keepAlives.push(name)
} }
}, },
REMOVE_KEEP(state, names) { REMOVE_KEEP (state, names) {
state.keepAlives = state.keepAlives.reduce((arr, name) => { state.keepAlives = state.keepAlives.reduce((arr, name) => {
if (!names.includes(name)) { if (!names.includes(name)) {
return arr.push(name) return arr.push(name)
...@@ -32,28 +32,28 @@ const mutations = { ...@@ -32,28 +32,28 @@ const mutations = {
return arr return arr
}, []) }, [])
}, },
SET_LAST_PATH(state, path) { SET_LAST_PATH (state, path) {
state.lastPath = path state.lastPath = path
} }
} }
const actions = { const actions = {
setPageMeta({ commit }, meta) { setPageMeta ({ commit }, meta) {
document.title = meta.title document.title = meta.title
commit('SET_PAGE_META', meta) commit('SET_PAGE_META', meta)
}, },
setLoginToken({ commit }, val) { setLoginToken ({ commit }, val) {
commit('SET_LOGIN_TOKEN', val) commit('SET_LOGIN_TOKEN', val)
}, },
setAccountList({ commit }, list) { setAccountList ({ commit }, list) {
commit('SET_ACCOUNT_LIST', list) commit('SET_ACCOUNT_LIST', list)
}, },
pushKeep({ commit }, name) { pushKeep ({ commit }, name) {
commit('PUSH_KEEP', name) commit('PUSH_KEEP', name)
}, },
removeKeep({ commit }, names) { removeKeep ({ commit }, names) {
commit('REMOVE_KEEP', names) commit('REMOVE_KEEP', names)
}, },
login({ dispatch }) { login ({ dispatch }) {
let [redirectUrl] = window.location.href.split('?') let [redirectUrl] = window.location.href.split('?')
// 以下是 本地调试 // 以下是 本地调试
if (process.env.NODE_ENV == 'development') { if (process.env.NODE_ENV == 'development') {
...@@ -114,7 +114,7 @@ const actions = { ...@@ -114,7 +114,7 @@ const actions = {
} else { } else {
util.showLoading() util.showLoading()
let appid = getParams('corpId') //从链接获取 let appid = getParams('corpId') //从链接获取
let dj_scrm = util.getLocalStorage('dj_scrm_corpId') let dj_scrm = util.getLocalStorage('dj_scrm_corpId')
if (!appid) appid = (dj_scrm && dj_scrm.corpId) || 'wwc33bc9a3c72d45f3' if (!appid) appid = (dj_scrm && dj_scrm.corpId) || 'wwc33bc9a3c72d45f3'
util.setLocalStorage('dj_scrm_corpId', { corpId: appid }) util.setLocalStorage('dj_scrm_corpId', { corpId: appid })
// 'ww657a2d4ae89a4424' // 'ww657a2d4ae89a4424'
...@@ -128,7 +128,7 @@ const actions = { ...@@ -128,7 +128,7 @@ const actions = {
window.location.href = `${url}?redirect_uri=${encodeURIComponent(redirectUrl)}&corpId=${corpId}&agentId=${agentId}` window.location.href = `${url}?redirect_uri=${encodeURIComponent(redirectUrl)}&corpId=${corpId}&agentId=${agentId}`
} }
}, },
navigation({ dispatch }) { navigation ({ dispatch }) {
let { sessionId, corpId, agentId } = getParams() let { sessionId, corpId, agentId } = getParams()
const storage_corpId = util.getLocalStorage('dj_scrm_corpId') const storage_corpId = util.getLocalStorage('dj_scrm_corpId')
if (!corpId) corpId = storage_corpId && storage_corpId.corpId if (!corpId) corpId = storage_corpId && storage_corpId.corpId
...@@ -154,7 +154,7 @@ const actions = { ...@@ -154,7 +154,7 @@ const actions = {
} }
state.showWindow = true state.showWindow = true
}, },
registerHttp({}, sessionId = '') { registerHttp ({ }, sessionId = '') {
window.$HTTP = new Http({ ...window.$fetchConfig, alert: Notify, headers: { token: sessionId } }) window.$HTTP = new Http({ ...window.$fetchConfig, alert: Notify, headers: { token: sessionId } })
} }
} }
......
<template> <template>
<div class="layout"> <div class="layout">
<div class="sticky"> <div class="sticky">
<tab
:list="tabList"
@change="change"
>
</tab>
<search-box <search-box
v-show="tabIndex == 1"
@search="search" @search="search"
placeholder="输入关键词搜索" placeholder="输入关键词搜索"
:showDropdown="false" :showDropdown="false"
></search-box> ></search-box>
<template v-if="groupList.length">
<tab
:list="groupList"
@change="change"
>
</tab>
</template>
</div> </div>
<template v-if="flag"> <chat-gpt :show="tabIndex == 0"></chat-gpt>
<template v-if="list.length"> <template v-if="tabIndex == 1">
<scroll-view <template v-if="flag">
class="list-box" <template v-if="list.length">
@ReachBottom="onReachBottom" <scroll-view
ref="scrollView" class="list-box"
> @ReachBottom="onReachBottom"
<div class="box"> ref="scrollView"
<template v-for="(i,index) in list"> >
<div <div class="box">
class="item" <template v-for="(i,index) in list">
:key="index"
>
<div <div
v-html="decodeURIComponent(i.text)" class="item"
:class="['content',{'line-clamp':i.moreState}]" :key="index"
></div> >
<div class="chat-btns flex"> <div
<template v-if="i.moreBtn"> v-html="decodeURIComponent(i.text)"
<div :class="['content',{'line-clamp':i.moreState}]"
class="more" ></div>
@click="i.moreState = !i.moreState" <div class="chat-btns flex">
>{{ i.moreState ? '展开' :'收起' }}</div> <template v-if="i.moreBtn">
</template> <div
<van-button class="more"
class="send" @click="i.moreState = !i.moreState"
block >{{ i.moreState ? '展开' :'收起' }}</div>
round </template>
color="#3975C6" <van-button
:disabled="sendChatMessageDisabled" class="send"
@click="sendChatMessage(i.scriptContent)" block
>发送</van-button> round
color="#3975C6"
:disabled="sendChatMessageDisabled"
@click="sendChatMessage(i.scriptContent)"
>发送</van-button>
</div>
</div> </div>
</div> </template>
</template> </div>
</div> </scroll-view>
</scroll-view> </template>
</template> <template v-else>
<template v-else> <nothing
<nothing class="nothing-box"
class="nothing-box" image="https://img01.glsx.com.cn/weapp/resource/scrm-mobile/psd/list-nothing.png"
image="https://img01.glsx.com.cn/weapp/resource/scrm-mobile/psd/list-nothing.png" >暂无可用话术</nothing>
>暂无可用话术</nothing> </template>
</template> </template>
</template> </template>
</div> </div>
...@@ -69,7 +71,7 @@ export default { ...@@ -69,7 +71,7 @@ export default {
name: 'library', name: 'library',
data () { data () {
return { return {
groupList: [], tabList: ['智能AI话术', '企业话术'],
flag: false, flag: false,
list: [], list: [],
pageNum: 1, pageNum: 1,
...@@ -80,7 +82,8 @@ export default { ...@@ -80,7 +82,8 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10
}, },
total: 0 total: 0,
tabIndex: 0
} }
}, },
async mounted () { async mounted () {
...@@ -89,8 +92,6 @@ export default { ...@@ -89,8 +92,6 @@ export default {
} catch (error) { } catch (error) {
this.sendChatMessageDisabled = true this.sendChatMessageDisabled = true
} }
this.getChatGroupList()
this.getChatLibraryList()
}, },
methods: { methods: {
/**发送 */ /**发送 */
...@@ -127,18 +128,20 @@ export default { ...@@ -127,18 +128,20 @@ export default {
}, },
/**切换tab */ /**切换tab */
change (index) { change (index) {
const { groupList, params: { scriptGroup } } = this this.tabIndex = index
if (scriptGroup == groupList[index] || (index == 0 && scriptGroup == '')) return if (index == 1) this.clearData()
this.params.scriptGroup = index == 0 ? '' : groupList[index] // const { groupList, params: { scriptGroup } } = this
this.clearData() // if (scriptGroup == groupList[index] || (index == 0 && scriptGroup == '')) return
// this.params.scriptGroup = index == 0 ? '' : groupList[index]
// this.clearData()
}, },
/**话术组 */ /**话术组 */
async getChatGroupList () { // async getChatGroupList () {
let res = await marketingApi.getChatGroupList() || [], // let res = await marketingApi.getChatGroupList() || [],
maxLength = 10 // maxLength = 10
if (res.length > maxLength) res = res.splice(0, maxLength) // if (res.length > maxLength) res = res.splice(0, maxLength)
this.groupList = ['全部', ...res] // this.groupList = ['全部', ...res]
}, // },
/**话术 */ /**话术 */
async getChatLibraryList () { async getChatLibraryList () {
const { params, list, $refs: { const { params, list, $refs: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!