Commit bcbc2f1a by 前端

Merge branch 'SAAS+V4.25.0' into 'master'

合并Saas+v4.25.0

See merge request !15
2 parents 4dd09ea3 0cea0c31
...@@ -77,4 +77,35 @@ export default { ...@@ -77,4 +77,35 @@ export default {
returnAll: true returnAll: true
}) })
}, },
/**
* AI话术库-分页列表
*/
getAILibraryList(params = {}){
params.method = 'marketing.api.scriptlibrary.ai.page'
return http({
url: 'rop-scrm-marketing/router',
data: params
})
},
/**
* AI话术库-查询聊天记录详情
*/
getStaffChatRecordDetail(params = {}){
params.method = 'marketing.api.scriptlibrary.ai.info'
return http({
url: 'rop-scrm-marketing/router',
data: params
})
},
/**
* AI话术库-分页查询聊天记录
*/
getStaffChatRecordPage(params = {}){
params.method = 'marketing.api.scriptlibrary.ai.recordPage'
return http({
url: 'rop-scrm-marketing/router',
data: params
})
},
} }
\ No newline at end of file \ No newline at end of file
...@@ -624,10 +624,11 @@ html { ...@@ -624,10 +624,11 @@ html {
.el-tooltip__popper.is-light { .el-tooltip__popper.is-light {
background: #ffffff; background: #ffffff;
box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.08); width: fit-content;
border: 1px solid #e4e7ed !important; max-width: 410px;
width: 177px;
box-sizing: border-box; box-sizing: border-box;
border: 1px solid #E5E5E5 !important;
box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.078);
} }
.el-tooltip__popper[x-placement^='top'] .popper__arrow { .el-tooltip__popper[x-placement^='top'] .popper__arrow {
...@@ -821,4 +822,9 @@ html { ...@@ -821,4 +822,9 @@ html {
.active { .active {
color: #5850FF; color: #5850FF;
} }
}
.popper-class {
font-size: 12px;
color: #666666;
} }
\ No newline at end of file \ No newline at end of file
...@@ -18,7 +18,7 @@ module.exports = { ...@@ -18,7 +18,7 @@ module.exports = {
code_message_map: {} code_message_map: {}
}, },
request: { request: {
baseURL: 'http://scrm.dev.glsx.com.cn/', baseURL: '//scrm.dev.glsx.com.cn/',
// baseURL: 'http://192.168.2.42:8064/', // baseURL: 'http://192.168.2.42:8064/',
// 设置超时时间 // 设置超时时间
timeout: 180000, timeout: 180000,
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
// 根据环境引入不同配置 process.env.VUE_APP_ENV // 根据环境引入不同配置 process.env.VUE_APP_ENV
// let request = require('@/http/request.js') // let request = require('@/http/request.js')
let cfg = require('./conf.js') let cfg = require('./conf.js')
import { Http } from 'glsx-common' import { Http,utils } from 'glsx-common'
let timeout = 30000 //超时时间 let timeout = 30000 //超时时间
export const fetchConfig = function(isEnv = true) { export const fetchConfig = function(isEnv = true) {
// if (isEnv) { // if (isEnv) {
...@@ -17,9 +17,9 @@ export const fetchConfig = function(isEnv = true) { ...@@ -17,9 +17,9 @@ export const fetchConfig = function(isEnv = true) {
// Object.assign(request, { timeout }) // Object.assign(request, { timeout })
// return Promise.resolve(cfg) // return Promise.resolve(cfg)
// } // }
return new Http().get('https://oss-config.glsx.com.cn/mock/63c129a528a4279537834035/content/config') // return new Http().get('https://oss-config.glsx.com.cn/mock/63c129a528a4279537834035/content/config')
// let params = { moduleName: 'content', mockUrl: 'https://oss-config.glsx.com.cn/mock/63c129a528a4279537834035/content/config', httpOptions: { Headers: { refererurl: location.href }, request: { timeout: 30000 } } } let params = { moduleName: 'content', mockUrl: 'https://oss-config.glsx.com.cn/mock/63c129a528a4279537834035/content/config', httpOptions: { Headers: { refererurl: location.href }, request: { timeout: 30000 } } }
// return utils.getConfig(params) return utils.getConfig(params)
} }
export const config = { export const config = {
install(vue, cfg) { install(vue, cfg) {
......
<template>
<div class="container">
<GLCombiForm
ref="showSearch"
:rowNumber="1"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
@handleRest="handleReset"
></GLCombiForm>
<div class="tabelList">
<div class="table-title">提问列表</div>
<GLTable
ref="listRef"
:getListApi="getListApi"
:searchForm="searchForm"
:noDataImg="url"
:tableParams="tableParams"
:pageConf="pageConf"
>
<div
slot-scope="scope"
slot="merchantName"
>
{{ scope.scope.merchantName || '' }} {{ scope.scope.merchantId || '' }}
</div>
<span
slot="auth-button"
slot-scope="scope"
>
<GLTableButton
:buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"
></GLTableButton>
</span>
</GLTable>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import url from '@/assets/empty.png'
import * as dayjs from 'dayjs'
import { utils } from 'glsx-common'
export default {
name: 'ai',
data () {
return {
url,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
searchForm: {
merchantName: '',
merchantId: '',
staffName: ''
},
searchFormData: [
{
label: '商户名',
name: 'merchantName',
type: 'input',
maxlength: 100
},
{
label: '商户号',
name: 'merchantId',
type: 'input',
maxlength: 8
},
{
label: '用户企微名',
name: 'staffName',
type: 'input',
maxlength: 100
},
],
getListApi: this.$apis.chatLibrary.getAILibraryList,
tableParams: {
listName: 'data',
tableOption: true,
tableColumns: [
{
label: '商户',
addHtml: 'merchantName',
},
{
label: '用户企微名',
prop: 'staffName',
width: 200
},
{
label: '提问次数',
prop: 'questionCount',
width: 100
},
{
label: '有效提问',
prop: 'questionEffectiveCount',
width: 100
},
{
label: '最后提问时间',
prop: 'lastQuestionTime',
width: 210,
formatter: cellVal => {
return cellVal.lastQuestionTime ? dayjs(cellVal.lastQuestionTime).format('YYYY-MM-DD HH:mm:ss') : '--'
}
}
]
},
// 表格按钮
tableButtonList: [
{
type: 'el-button',
name: '详情',
attrs: {
type: 'text',
},
listeners: {
click: row => this.jumpDetail(row.staffUuid)
}
}
],
}
},
mounted () {
},
methods: {
handleSearch () {
this.$refs.listRef.refreshTable()
},
handleReset () {
this.searchForm = this.$options.data.call(this).searchForm
this.handleSearch()
},
jumpDetail (id) {
this.$router.push({
path: '/ChatLibrary/iusseDetail',
query: { id }
})
}
}
}
</script>
<style scoped lang='scss'>
.container {
height: 100%;
background-color: #fff;
-webkit-box-sizing: border-box;
box-sizing: border-box;
padding: 20px;
.table-title {
font-weight: 700;
font-size: 16px;
color: #333333;
padding-bottom: 18px;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="main-container">
<div class="top">
<el-button
type="primary"
@click="jumpDetail()"
:size="size"
>
<i class="el-icon-plus"></i>
创建话术
</el-button>
</div>
<div class="container">
<div class="tabelList">
<GLTable
ref="listRef"
:getListApi="getListApi"
:searchForm="tableSearchForm"
:noDataImg="url"
:tableParams="tableParams"
:pageConf="pageConf"
>
<div
slot-scope="scope"
slot="scriptContent"
>
<el-tooltip
placement="top"
:content="scope.scope.scriptContent"
>
<div class="tooltip-content">{{ scope.scope.scriptContent }}</div>
</el-tooltip>
</div>
<div
slot="state"
slot-scope="scope"
class="chat-switch"
>
<el-switch
:value="scope.scope.state == 0 ? true : false"
@change="changeState(scope.scope)"
></el-switch>
<span>
{{ CHAT_STATE[scope.scope.state] }}
</span>
</div>
<span
slot="auth-button"
slot-scope="scope"
>
<GLTableButton
:buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"
></GLTableButton>
</span>
</GLTable>
</div>
</div>
</div>
</template>
<script>
import url from '@/assets/empty.png'
import * as dayjs from 'dayjs'
import { utils } from 'glsx-common'
const CHAT_STATE = {
0: '启用',
1: '停用'
}
export default {
name: 'wock',
components: {
},
data () {
return {
CHAT_STATE,
url,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
// 表格按钮
tableButtonList: [
{
type: 'el-button',
name: '编辑',
attrs: {
type: 'text',
},
listeners: {
click: row => this.jumpDetail(row.id)
}
},
{
type: 'el-button',
name: '删除',
attrs: {
type: 'text',
},
listeners: {
click: row => {
this.showConfirm({
title: '删除',
txt: '确定要删除此话术?',
apiModule: 'chatLibrary',
apiName: 'delChatLibrary',
apiParams: {
id: row.id
}
})
}
}
}
],
tableSearchForm: {
},
getListApi: this.$apis.chatLibrary.getChatLibraryList,
tableParams: {
listName: 'data',
tableOption: true,
tableColumns: [
{
label: '话术组',
prop: 'scriptGroup',
},
{
label: '话术内容',
prop: 'scriptContent',
addHtml: 'scriptContent'
},
{
label: '状态',
prop: 'state',
addHtml: 'state',
width: 170
},
{
label: '更新时间',
prop: 'updatedTime',
width: 210,
formatter: cellVal => {
return dayjs(cellVal.updatedTime).format('YYYY-MM-DD HH:mm:ss')
}
}
]
}
}
},
mounted () {
},
methods: {
/**跳转 */
jumpDetail (id) {
this.$router.push({
path: '/ChatLibrary/detail',
query: id ? { id, $title: '编辑话术' } : { $title: '创建话术' }
})
},
/**搜索 */
handleSearch () {
this.$refs.listRef.refreshTable()
},
/**二次弹框 */
showConfirm ({
title,
txt,
apiModule,
apiName,
apiParams,
fn
}) {
this.$confirm(txt, title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: utils.debounce((action) => {
if (action == 'confirm') {
this.$apis[apiModule][apiName](apiParams).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
fn && fn()
this.handleSearch()
}
})
}
}, 500)
})
},
/**改变状态 */
changeState ({
id,
state
}) {
state = state == 0 ? 1 : 0
this.showConfirm({
title: '',
txt: `确定要${CHAT_STATE[state]}此话术?`,
apiModule: 'chatLibrary',
apiName: 'updateChatLibraryState',
apiParams: {
id,
state
}
})
}
}
}
</script>
<style lang="scss" scoped>
.container {
margin-top: 10px;
height: 100%;
.tabelList {
margin-top: 10px;
height: 100%;
background-color: #fff;
box-sizing: border-box;
padding: 20px;
.chat-switch {
span {
font-size: 14px;
color: #666666;
margin-left: 8px;
}
}
.tooltip-content {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
}
}
</style>
<template> <template>
<div class="main-container"> <div class="chat-layout">
<div class="top"> <GLTabs
<el-button v-model="cName"
type="primary" :tabPaneList="tabPaneList"
@click="jumpDetail()" @tab-click="handleClick"
:size="size" ></GLTabs>
> <div class="component">
<i class="el-icon-plus"></i> <component
创建话术 :is="currentComponent"
</el-button> ref="componentRef"
</div> ></component>
<div class="container">
<div class="tabelList">
<GLTable
ref="listRef"
:getListApi="getListApi"
:searchForm="tableSearchForm"
:noDataImg="url"
:tableParams="tableParams"
:pageConf="pageConf"
>
<div
slot-scope="scope"
slot="scriptContent"
>
<el-tooltip
placement="top"
:content="scope.scope.scriptContent"
>
<div class="tooltip-content">{{ scope.scope.scriptContent }}</div>
</el-tooltip>
</div>
<div
slot="state"
slot-scope="scope"
class="chat-switch"
>
<el-switch
:value="scope.scope.state == 0 ? true : false"
@change="changeState(scope.scope)"
></el-switch>
<span>
{{ CHAT_STATE[scope.scope.state] }}
</span>
</div>
<span
slot="auth-button"
slot-scope="scope"
>
<GLTableButton
:buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"
></GLTableButton>
</span>
</GLTable>
</div>
</div> </div>
</div> </div>
</template> </template>
<script> <script type='text/ecmascript-6'>
import url from '@/assets/empty.png' import ai from './components/AI/index.vue'
import * as dayjs from 'dayjs' import work from './components/Work/index.vue'
import { utils } from 'glsx-common'
const CHAT_STATE = {
0: '启用',
1: '停用'
}
export default { export default {
name: 'materialList',
components: { components: {
ai,
work,
}, },
name: '',
data () { data () {
return { return {
CHAT_STATE, cName: '1',
url, currentComponent: 'ai',
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' }, tabPaneList: [
// 表格按钮
tableButtonList: [
{ {
type: 'el-button', label: '智能AI话术',
name: '编辑', name: '1'
attrs: {
type: 'text',
},
listeners: {
click: row => this.jumpDetail(row.id)
}
}, },
{ {
type: 'el-button', label: '企业话术',
name: '删除', name: '2'
attrs: { },
type: 'text', ]
},
listeners: {
click: row => {
this.showConfirm({
title: '删除',
txt: '确定要删除此话术?',
apiModule: 'chatLibrary',
apiName: 'delChatLibrary',
apiParams: {
id: row.id
}
})
}
}
}
],
tableSearchForm: {
},
getListApi: this.$apis.chatLibrary.getChatLibraryList,
tableParams: {
listName: 'data',
tableOption: true,
tableColumns: [
{
label: '话术组',
prop: 'scriptGroup',
},
{
label: '话术内容',
prop: 'scriptContent',
addHtml: 'scriptContent'
},
{
label: '状态',
prop: 'state',
addHtml: 'state',
width: 170
},
{
label: '更新时间',
prop: 'updatedTime',
width: 210,
formatter: cellVal => {
return dayjs(cellVal.updatedTime).format('YYYY-MM-DD HH:mm:ss')
}
}
]
}
} }
}, },
mounted () { mounted () {
}, },
methods: { methods: {
/**跳转 */ handleClick () {
jumpDetail (id) { this.currentComponent = {
this.$router.push({ 1: 'ai',
path: '/ChatLibrary/detail', 2: 'work',
query: id ? { id, $title: '编辑话术' } : { $title: '创建话术' } }[this.cName]
})
},
/**搜索 */
handleSearch () {
this.$refs.listRef.refreshTable()
},
/**二次弹框 */
showConfirm ({
title,
txt,
apiModule,
apiName,
apiParams,
fn
}) {
this.$confirm(txt, title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: utils.debounce((action) => {
if (action == 'confirm') {
this.$apis[apiModule][apiName](apiParams).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
fn && fn()
this.handleSearch()
}
})
}
}, 500)
})
},
/**改变状态 */
changeState ({
id,
state
}) {
state = state == 0 ? 1 : 0
this.showConfirm({
title: '',
txt: `确定要${CHAT_STATE[state]}此话术?`,
apiModule: 'chatLibrary',
apiName: 'updateChatLibraryState',
apiParams: {
id,
state
}
})
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style scoped lang='scss'>
.container { .component{
margin-top: 10px; margin-top: 16px;
height: 100%;
.tabelList {
margin-top: 10px;
height: 100%;
background-color: #fff;
box-sizing: border-box;
padding: 20px;
.chat-switch {
span {
font-size: 14px;
color: #666666;
margin-left: 8px;
}
}
.tooltip-content {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
}
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
<template>
<div>
<div class="container">
<div class="title flex">用户详情</div>
<div class="user-box flex">
<div class="item flex">
<div class="label">用户企微名:</div>
{{staffDetail.staffName}}
</div>
<div class="item flex">
<div class="label">登录商户:</div>
{{ staffDetail.merchantName }}{{ staffDetail.merchantId }}
</div>
</div>
<div class="title flex">提问记录</div>
<div class="table-box">
<div class="date-box flex">
<div class="label">日期搜索:</div>
<el-date-picker
v-model="searchDate"
type="daterange"
unlink-panels
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:picker-options="beforeRangePickerOptions"
@change="changeDate"
>
</el-date-picker>
</div>
<GLTable
ref="listRef"
:getListApi="getListApi"
:searchForm="searchForm"
:noDataImg="url"
:tableParams="tableParams"
:pageConf="pageConf"
>
<div
slot-scope="scope"
slot="content"
>
<el-tooltip
placement="bottom"
:content="scope.scope.content"
effect="light"
:tabindex="100868"
popper-class="popper-class"
>
<div class="tooltip-content flex">
<div :class="['icon flex',scope.scope.contentType == 0?'question':'answering']">{{ scope.scope.contentType == 0?'问':'答'}}</div>
<div class="text"> {{ scope.scope.content }}</div>
</div>
</el-tooltip>
</div>
</GLTable>
</div>
</div>
<GLFooter class="gl-footer">
<el-button
@click="$router.back()"
type="primary"
>返回</el-button>
</GLFooter>
</div>
</template>
<script type='text/ecmascript-6'>
import url from '@/assets/empty.png'
import * as dayjs from 'dayjs'
export default {
name: '',
data () {
return {
url,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
searchForm: {
beginDate: '',
endDate: '',
staffUuid: this.$route.query.id
},
searchDate: '',
getListApi: this.$apis.chatLibrary.getStaffChatRecordPage,
tableParams: {
listName: 'data',
tableColumns: [
{
label: '更新时间',
width: 210,
prop: 'chatTime'
// formatter: cellVal => {
// return dayjs(cellVal.chatTime).format('YYYY-MM-DD HH:mm')
// }
},
{
label: '用户问题及AI答复',
addHtml: 'content',
},
]
},
beforeRangePickerOptions: {},
staffDetail: {
staffName: '',
merchantName: '',
merchantId: ''
}
}
},
mounted () {
this.getStaffChatRecordDetail()
},
methods: {
changeDate (e) {
let beginDate = '',
endDate = ''
if (e) {
beginDate = dayjs(e[0]).format('YYYY-MM-DD')
endDate = dayjs(e[1]).format('YYYY-MM-DD')
}
this.searchForm.beginDate = beginDate
this.searchForm.endDate = endDate
this.$refs.listRef.refreshTable()
},
async getStaffChatRecordDetail () {
const res = await this.$apis.chatLibrary.getStaffChatRecordDetail({
staffUuid: this.$route.query.id
})
this.staffDetail = res || {}
this.beforeRangePickerOptions = {
disabledDate (date) {
let disabled = true
try {
res.dateList.map(e => {
if (dayjs(date).format('YYYY-MM-DD') == e) throw false
})
} catch (error) {
disabled = false
}
return disabled
}
}
}
}
}
</script>
<style scoped lang='scss'>
.flex {
display: flex;
align-items: center;
}
.container {
background: #ffffff;
min-height: calc(100vh - 136px);
margin-bottom: 16px;
.title {
height: 58px;
padding: 0 20px;
font-weight: 700;
font-size: 16px;
color: #333333;
border-bottom: 1px solid #e5e5e5;
}
.user-box {
min-height: 84px;
padding: 0 20px;
gap: 0 192px;
.item {
font-size: 14px;
color: #333333;
line-height: 20px;
.label {
color: #666666;
width: 154px;
text-align: right;
}
}
}
.table-box {
padding: 0 20px 78px;
.date-box {
height: 64px;
padding-left: 16px;
}
.el-date-editor--daterange.el-input__inner {
width: 232px;
}
.el-range-editor.is-active:hover {
border-color: #5850ff;
width: 232px;
}
.tooltip-content {
.icon {
width: 22px;
height: 22px;
border: 1px solid transparent;
border-radius: 4px;
font-weight: 600;
font-size: 14px;
justify-content: center;
letter-spacing: 0;
margin-right: 9px;
}
.question {
border-color: #fdb7574d;
color: #fdb757;
background: #fdb7571a;
}
.answering {
border-color: #5850ff4d;
color: #5850ff;
background: #5850ff1a;
}
.text {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
max-width: 90%;
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!