Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-content
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 4f1c43b2
authored
Jul 20, 2023
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
0804需求
1 parent
4dd09ea3
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
619 additions
and
216 deletions
src/config/env.development.js
src/config/index.js
src/views/ChatLibrary/components/AI/index.vue
src/views/ChatLibrary/components/Work/index.vue
src/views/ChatLibrary/index.vue
src/views/ChatLibrary/iusseDetail.vue
src/config/env.development.js
View file @
4f1c43b
...
@@ -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
,
...
...
src/config/index.js
View file @
4f1c43b
...
@@ -12,11 +12,11 @@ let cfg = require('./conf.js')
...
@@ -12,11 +12,11 @@ let cfg = require('./conf.js')
import
{
Http
}
from
'glsx-common'
import
{
Http
}
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
)
{
//
let { request } = cfg
let
{
request
}
=
cfg
//
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)
...
...
src/views/ChatLibrary/components/AI/index.vue
0 → 100644
View file @
4f1c43b
<
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"
>
<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
:
''
,
name
:
''
},
searchFormData
:
[
{
label
:
'商户名'
,
name
:
'merchantName'
,
type
:
'input'
,
maxlength
:
20
},
{
label
:
'商户号'
,
name
:
'merchantId'
,
type
:
'input'
,
maxlength
:
20
},
{
label
:
'用户企微名'
,
name
:
'name'
,
type
:
'input'
,
maxlength
:
20
},
],
getListApi
:
this
.
$apis
.
chatLibrary
.
getChatLibraryList
,
tableParams
:
{
listName
:
'data'
,
tableOption
:
true
,
tableColumns
:
[
{
label
:
'商户'
,
prop
:
'scriptGroup'
,
},
{
label
:
'用户企微名'
,
prop
:
'scriptContent'
,
width
:
200
},
{
label
:
'提问次数'
,
prop
:
'state'
,
addHtml
:
'state'
,
width
:
100
},
{
label
:
'有效提问'
,
prop
:
'state'
,
addHtml
:
'state'
,
width
:
100
},
{
label
:
'最后提问时间'
,
prop
:
'updatedTime'
,
width
:
210
,
formatter
:
cellVal
=>
{
return
dayjs
(
cellVal
.
updatedTime
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
}
}
]
},
// 表格按钮
tableButtonList
:
[
{
type
:
'el-button'
,
name
:
'详情'
,
attrs
:
{
type
:
'text'
,
},
listeners
:
{
click
:
row
=>
this
.
jumpDetail
(
row
.
id
)
}
}
],
}
},
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
:
500
;
font-size
:
16px
;
color
:
#333333
;
padding-bottom
:
18px
;
}
}
</
style
>
\ No newline at end of file
\ No newline at end of file
src/views/ChatLibrary/components/Work/index.vue
0 → 100644
View file @
4f1c43b
<
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
>
src/views/ChatLibrary/index.vue
View file @
4f1c43b
<
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'
,
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
:
'话术组
'
,
label
:
'智能Ai话术
'
,
prop
:
'scriptGroup'
,
name
:
'1'
},
},
{
{
label
:
'话术内容'
,
label
:
'企业话术'
,
prop
:
'scriptContent'
,
name
:
'2'
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
src/views/ChatLibrary/iusseDetail.vue
0 → 100644
View file @
4f1c43b
<
template
>
<div>
<div
class=
"container"
>
<div
class=
"title flex"
>
用户详情
</div>
<div
class=
"user-box flex"
>
<div
class=
"item flex"
>
<div
class=
"label"
>
用户微信名:
</div>
冲冲冲
</div>
<div
class=
"item flex"
>
<div
class=
"label"
>
登录商户:
</div>
佛山市顺德区世界汽车贸易有限公司44202977
</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=
"searchForm.date"
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=
"scriptContent"
>
<el-tooltip
placement=
"bottom"
:content=
"scope.scope.scriptContent"
effect=
"light"
>
<div
class=
"tooltip-content flex"
>
<div
:class=
"['icon flex',true?'question':'answering']"
>
{{
true
?
'问'
:
'答'
}}
</div>
<div
class=
"text"
>
{{
scope
.
scope
.
scriptContent
}}
</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
:
{
date
:
''
},
getListApi
:
this
.
$apis
.
chatLibrary
.
getChatLibraryList
,
tableParams
:
{
listName
:
'data'
,
tableColumns
:
[
{
label
:
'更新时间'
,
width
:
210
,
formatter
:
cellVal
=>
{
return
dayjs
(
cellVal
.
updatedTime
).
format
(
'YYYY-MM-DD HH:mm'
)
}
},
{
label
:
'用户问题及AI答复'
,
addHtml
:
'scriptContent'
,
},
]
},
beforeRangePickerOptions
:
{
disabledDate
(
date
)
{
return
date
>
new
Date
()
}
}
}
},
mounted
()
{
},
methods
:
{
changeDate
(
e
)
{
this
.
$refs
.
listRef
.
refreshTable
()
}
}
}
</
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
:
500
;
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
:
#fdb7574
d
;
color
:
#fdb757
;
background
:
#fdb7571
a
;
}
.answering
{
border-color
:
#5850ff4
d
;
color
:
#5850ff
;
background
:
#5850ff1
a
;
}
.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
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment