Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
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 acda2c75
authored
Jan 11, 2021
by
xinlaa
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
聊天工具栏后台管理端调试基本完成
1 parent
81eb7247
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
410 additions
and
49 deletions
linkwe-ui/src/api/appTool/chatBar.js
linkwe-ui/src/components/SelectMaterialMult/index.vue
linkwe-ui/src/components/SelectMaterialMult/list.vue
linkwe-ui/src/views/appTool/chatToolbar/list.vue
linkwe-ui/src/views/material/image.vue
linkwe-ui/src/api/appTool/chatBar.js
View file @
acda2c7
...
@@ -46,7 +46,7 @@ export function update(data) {
...
@@ -46,7 +46,7 @@ export function update(data) {
export
function
getMaterial
(
data
)
{
export
function
getMaterial
(
data
)
{
return
request
({
return
request
({
url
:
service
+
'/item'
,
url
:
service
+
'/item'
,
method
:
'
POST
'
,
method
:
'
put
'
,
data
,
data
,
})
})
}
}
linkwe-ui/src/components/SelectMaterialMult/index.vue
0 → 100644
View file @
acda2c7
<
script
>
import
{
getList
}
from
'@/api/customer/tag'
import
list
from
'./list'
export
default
{
components
:
{
list
},
props
:
{
// 添加标签显隐
visible
:
{
type
:
Boolean
,
default
:
false
,
},
// title: {
// type: String,
// default: '',
// },
// 素材类型 0:'文本', 1:'图片'
type
:
{
type
:
String
,
default
:
'0'
,
},
// 显示哪些素材类型标签
showArr
:
{
type
:
Array
,
default
:
()
=>
[
0
,
1
],
},
},
data
()
{
return
{
text
:
{},
image
:
{},
file
:
{},
}
},
watch
:
{},
computed
:
{
Pvisible
:
{
get
()
{
return
this
.
visible
},
set
(
val
)
{
this
.
$emit
(
'update:visible'
,
val
)
},
},
Ptype
:
{
get
()
{
return
this
.
type
},
set
(
val
)
{
this
.
$emit
(
'update:type'
,
val
)
},
},
},
created
()
{},
mounted
()
{},
methods
:
{
submit
()
{
this
.
Pvisible
=
false
this
.
$emit
(
'success'
,
this
.
text
,
this
.
image
,
this
.
file
)
},
changeText
(
data
)
{
this
.
text
=
data
},
changeImage
(
data
)
{
this
.
image
=
data
},
},
}
</
script
>
<
template
>
<el-dialog
title=
"选择素材"
:visible
.
sync=
"Pvisible"
width=
"650px"
>
<div>
<el-tabs
v-model=
"Ptype"
>
<el-tab-pane
name=
"0"
v-if=
"showArr.includes(0)"
>
<span
slot=
"label"
>
<i
class=
"el-icon-date"
></i>
文本
</span>
<list
type=
"4"
@
change=
"changeText"
>
</list>
</el-tab-pane>
<el-tab-pane
name=
"1"
v-if=
"showArr.includes(1)"
>
<span
slot=
"label"
>
<i
class=
"el-icon-date"
></i>
图片
</span>
<list
type=
"0"
@
change=
"changeImage"
>
</list>
</el-tab-pane>
<!--
<el-tab-pane
name=
"2"
>
<span
slot=
"label"
>
<i
class=
"el-icon-date"
></i>
文件
</span>
<list>
<el-table
:data=
"list"
style=
"width: 100%"
>
<el-table-column
width=
"50"
>
<template
slot-scope=
"scope"
>
<el-radio
v-model=
"radio"
:label=
"scope.row.id"
></el-radio>
</
template
>
</el-table-column>
<el-table-column
prop=
"content"
>
</el-table-column>
</el-table>
</list>
</el-tab-pane>
-->
</el-tabs>
</div>
<div
slot=
"footer"
>
<el-button
@
click=
"Pvisible = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"submit"
>
确 定
</el-button>
</div>
</el-dialog>
</template>
<
style
lang=
"scss"
scoped
>
.user-list
{
.el-row
{
line-height
:
26px
;
}
}
.mr30
{
margin-right
:
30px
;
}
</
style
>
linkwe-ui/src/components/SelectMaterialMult/list.vue
0 → 100644
View file @
acda2c7
<
script
>
import
{
getTree
,
getList
}
from
'@/api/material'
export
default
{
components
:
{},
props
:
{
type
:
{
type
:
String
,
default
:
'4'
,
},
multiple
:
{
type
:
Boolean
,
default
:
false
,
},
selected
:
{
type
:
Array
,
default
:
()
=>
[],
},
},
data
()
{
return
{
loading
:
true
,
// 遮罩层
// 查询条件
query
:
{
pageNum
:
1
,
pageSize
:
10
,
categoryId
:
''
,
search
:
''
,
mediaType
:
'4'
,
},
list
:
[],
// 列表
total
:
0
,
// 总条数
treeData
:
[],
// 树
// 树props
treeProps
:
{
children
:
'children'
,
label
:
'name'
,
},
// 分组props
groupProps
:
{
// expandTrigger: 'hover',
checkStrictly
:
true
,
children
:
'children'
,
label
:
'name'
,
value
:
'id'
,
emitPath
:
false
,
},
radio
:
''
,
// 树props
treeProps
:
{
children
:
'children'
,
label
:
'name'
,
},
}
},
watch
:
{
radio
(
val
)
{
this
.
$emit
(
'change'
,
val
)
},
},
computed
:
{},
created
()
{
this
.
query
.
mediaType
=
this
.
type
this
.
getTree
()
this
.
getList
()
},
mounted
()
{},
methods
:
{
// 获取类目树
getTree
()
{
getTree
(
this
.
type
).
then
(({
data
})
=>
{
this
.
treeData
=
data
})
},
// 获取素材列表
getList
(
page
)
{
page
&&
(
this
.
query
.
pageNum
=
page
)
this
.
loading
=
true
getList
(
this
.
query
)
.
then
(({
rows
,
total
})
=>
{
this
.
list
=
rows
this
.
total
=
+
total
this
.
loading
=
false
this
.
$emit
(
'listChange'
,
this
.
list
)
})
.
catch
(()
=>
{
this
.
loading
=
false
})
},
// 节点单击事件
handleNodeClick
(
data
)
{
this
.
query
.
categoryId
=
data
.
id
this
.
getList
(
1
)
},
// 多选框选中数据
handleSelectionChange
(
selection
)
{
this
.
$emit
(
'update:selected'
,
selection
)
},
},
}
</
script
>
<
template
>
<div>
<template
v-if=
"false"
>
<el-form
ref=
"form"
:model=
"query"
label-width=
"80px"
>
<el-form-item
label=
"选择分组"
>
<el-cascader
v-model=
"query.categoryId"
:options=
"treeData"
:props=
"groupProps"
></el-cascader>
<el-input
v-model=
"query.search"
class=
"ml10 mr10"
style=
"width: 150px;"
@
keydown
.
enter=
"getList(1)"
></el-input>
<el-button
v-hasPermi=
"['contacts:organization:query']"
icon=
"el-icon-search"
circle
@
click=
"getList(1)"
></el-button>
<el-pagination
class=
"fr"
@
current-change=
"getList"
:current-page=
"query.pageNum"
:page-size=
"query.pageSize"
layout=
"prev, pager, next"
:total=
"total"
></el-pagination>
</el-form-item>
</el-form>
<!-- 文本 -->
<el-table
v-if=
"type == 4"
v-loading=
"loading"
:data=
"list"
:show-header=
"false"
>
<el-table-column
width=
"30"
>
<template
slot-scope=
"scope"
>
<el-radio
v-model=
"radio"
:label=
"scope.row"
>
'
</el-radio>
</
template
>
</el-table-column>
<el-table-column
prop=
"content"
>
</el-table-column>
</el-table>
<!-- 图片 -->
<el-radio-group
v-if=
"type == 0"
v-loading=
"loading"
class=
"img-wrap"
v-model=
"radio"
>
<el-radio
v-for=
"(item, index) in list"
:label=
"item"
:key=
"index"
>
<img
class=
"img-li"
:src=
"item.materialUrl"
alt
/>
<div
class=
"ac mt5"
>
{{ item.materialName }}
</div>
</el-radio>
</el-radio-group>
</template>
<el-row
:gutter=
"10"
>
<el-col
:span=
"6"
>
<el-tree
ref=
"tree"
:data=
"treeData"
:props=
"treeProps"
:expand-on-click-node=
"false"
highlight-current
default-expand-all
@
node-click=
"handleNodeClick"
>
</el-tree>
</el-col>
<el-col
:span=
"18"
>
<div
class=
"fxbw"
>
素材库更新本分类素材后,自动同步到聊天工具栏
<el-pagination
class=
"fr"
@
current-change=
"getList"
:current-page=
"query.pageNum"
:page-size=
"query.pageSize"
layout=
"prev, pager, next"
:total=
"total"
></el-pagination>
</div>
<el-table
v-if=
"[3, 4].includes(+type)"
:data=
"list"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
prop=
"content"
label=
"文本内容"
></el-table-column>
<el-table-column
prop=
"createTime"
label=
"时间"
></el-table-column>
</el-table>
<el-row
v-else
:gutter=
"20"
>
<el-col
:span=
"6"
style=
"margin-bottom: 24px;min-width: 220px;"
v-for=
"(item, index) in list"
:key=
"index"
>
<el-card
shadow=
"hover"
body-style=
"padding: 0px;"
>
<div
class=
"img-wrap"
>
<el-image
:src=
"item.materialUrl"
fit=
"contain"
></el-image>
</div>
<div
style=
"padding: 14px;"
>
<el-checkbox
v-model=
"ids"
:label=
"item.id"
>
{{
item.materialName
}}
</el-checkbox>
</div>
</el-card>
</el-col>
</el-row>
</el-col>
</el-row>
</div>
</template>
<
style
lang=
"scss"
scoped
>
//
.img-wrap
{
//
/deep/.el-radio__input
{
//
position
:
absolute
;
//
left
:
50%
;
//
top
:
50%
;
//
transform
:
translate
(
-50%
,
-50%
);
//
}
//
}
.img-li
{
width
:
160px
;
height
:
160px
;
border-radius
:
8px
;
border
:
1px
solid
#e6ebf5
;
}
.img-wrap
{
position
:
relative
;
height
:
0
;
padding
:
70%
0
0
0
;
border-bottom
:
1px
solid
#e6ebf5
;
.el-image
{
position
:
absolute
;
width
:
100%
;
height
:
100%
;
top
:
0
;
}
}
</
style
>
linkwe-ui/src/views/appTool/chatToolbar/list.vue
View file @
acda2c7
<
script
>
<
script
>
import
{
getList
,
update
,
getMaterial
}
from
'@/api/appTool/chatBar'
import
{
getList
,
update
,
getMaterial
}
from
'@/api/appTool/chatBar'
import
SelectMaterialMult
from
'@/components/SelectMaterialMult/list'
export
default
{
export
default
{
components
:
{},
components
:
{
SelectMaterialMult
},
props
:
{},
props
:
{},
data
()
{
data
()
{
return
{
return
{
...
@@ -17,6 +18,14 @@ export default {
...
@@ -17,6 +18,14 @@ export default {
4
:
'文本'
,
4
:
'文本'
,
5
:
'海报'
,
5
:
'海报'
,
}),
}),
metarialParams
:
{
sideId
:
''
,
materialIds
:
[],
// '素材id列表',
mediaType
:
''
,
// '素材类型 0 图片(image)、1 语音(voice)、2 视频(video),3 普通文件(file) 4 文本 5 海报',
checkAll
:
'1'
,
// '是否全选 0 全选 1 非全选',
},
selectedMaterial
:
[],
}
}
},
},
watch
:
{},
watch
:
{},
...
@@ -37,21 +46,33 @@ export default {
...
@@ -37,21 +46,33 @@ export default {
this
.
loading
=
false
this
.
loading
=
false
})
})
},
},
getMaterial
(
data
)
{
openDialog
(
data
)
{
this
.
dialogVisible
=
true
this
.
metarialParams
.
sideId
=
data
.
sideId
this
.
metarialParams
.
mediaType
=
data
.
mediaType
},
// 抓取素材
getMaterial
()
{
const
loading
=
this
.
$loading
({
const
loading
=
this
.
$loading
({
lock
:
true
,
lock
:
true
,
text
:
'Loading'
,
text
:
'Loading'
,
spinner
:
'el-icon-loading'
,
spinner
:
'el-icon-loading'
,
background
:
'rgba(0, 0, 0, 0.7)'
,
background
:
'rgba(0, 0, 0, 0.7)'
,
})
})
// this.loading = true
this
.
metarialParams
.
materialIds
=
this
.
selectedMaterial
.
map
((
d
)
=>
d
.
id
)
getMaterial
(
data
)
if
(
metarialParams
.
checkAll
==
0
)
{
this
.
metarialParams
.
materialIds
=
[]
}
getMaterial
(
this
.
metarialParams
)
.
then
(({
rows
,
total
})
=>
{
.
then
(({
rows
,
total
})
=>
{
this
.
list
=
rows
// this.list = rows
this
.
loading
=
false
loading
.
close
()
this
.
msgSuccess
(
'操作成功'
)
this
.
dialogVisible
=
false
this
.
getList
()
})
})
.
catch
(()
=>
{
.
catch
(()
=>
{
this
.
loading
=
false
loading
.
close
()
})
})
},
},
update
(
data
)
{
update
(
data
)
{
...
@@ -113,7 +134,7 @@ export default {
...
@@ -113,7 +134,7 @@ export default {
</el-table-column>
</el-table-column>
<el-table-column
label=
"操作"
align=
"center"
prop=
"operId"
>
<el-table-column
label=
"操作"
align=
"center"
prop=
"operId"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"text"
@
click=
"
handleView(scope.row, scope.index
)"
<el-button
type=
"text"
@
click=
"
openDialog(scope.row
)"
>
抓取素材
</el-button
>
抓取素材
</el-button
>
>
</
template
>
</
template
>
...
@@ -121,8 +142,7 @@ export default {
...
@@ -121,8 +142,7 @@ export default {
</el-table>
</el-table>
</el-card>
</el-card>
<el-card
class=
"mt20"
shadow=
"never"
header=
"红包工具栏"
>
<!-- <el-card class="mt20" shadow="never" header="红包工具栏">
<!-- <div slot="header"></div> -->
<el-row :gutter="10">
<el-row :gutter="10">
<el-col :span="10">
<el-col :span="10">
<div>
<div>
...
@@ -168,52 +188,25 @@ export default {
...
@@ -168,52 +188,25 @@ export default {
>
>
<div class="el-image logo" style>
<div class="el-image logo" style>
<div class="el-image__error">加载失败</div>
<div class="el-image__error">加载失败</div>
<!---->
</div>
</div>
<el-image
class=
"logo"
:src=
"url"
:
fit=
"fit"
></el-image>
<el-image class="logo" :src="url" fit="fit"></el-image>
<div class="company-name">脑白金</div>
<div class="company-name">脑白金</div>
</div>
</div>
</el-col>
</el-col>
</el-row>
</el-row>
</el-card>
</el-card>
-->
<el-dialog
<el-dialog
title=
"抓取文本类型素材库
"
:title=
"`抓取${mediaType[metarialParams.mediaType]}类型素材库`
"
:visible
.
sync=
"dialogVisible"
:visible
.
sync=
"dialogVisible"
:before-close=
"dialogBeforeClose"
>
>
<el-row
:gutter=
"10"
>
<SelectMaterialMult
<el-col
:span=
"6"
>
:selected
.
sync=
"selectedMaterial"
<el-tree
:data=
"d"
:props=
"d"
@
node-click=
"d"
></el-tree>
:type=
"metarialParams.mediaType"
</el-col>
></SelectMaterialMult>
<el-col
:span=
"18"
>
<div
class=
"fxbw"
>
素材库更新本分类素材后,自动同步到聊天工具栏
<div
class=
"filter-right"
>
<i
class=
"el-icon-arrow-left"
></i>
1/1
<i
class=
"el-icon-arrow-right"
></i>
</div>
</div>
<el-table
:data=
"data"
style=
"width: 100%"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
prop=
"prop"
label=
"文本内容"
width=
"width"
></el-table-column>
<el-table-column
prop=
"prop"
label=
"时间"
width=
"width"
></el-table-column>
</el-table>
</el-col>
</el-row>
<div
slot=
"footer"
>
<div
slot=
"footer"
>
<el-button
@
click=
"dialogVisible = false"
>
取 消
</el-button>
<el-button
@
click=
"dialogVisible = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"dialogVisible = false"
<el-button
type=
"primary"
@
click=
"getMaterial"
>
确 定
</el-button>
>
确 定
</el-button
>
</div>
</div>
</el-dialog>
</el-dialog>
</div>
</div>
...
...
linkwe-ui/src/views/material/image.vue
View file @
acda2c7
...
@@ -4,16 +4,16 @@ import MaPage from '@/views/material/components/MaPage'
...
@@ -4,16 +4,16 @@ import MaPage from '@/views/material/components/MaPage'
export
default
{
export
default
{
name
:
'Image'
,
name
:
'Image'
,
components
:
{
MaPage
},
components
:
{
MaPage
},
data
()
{
data
()
{
return
{
return
{
srcList
:
[],
srcList
:
[],
ids
:
[],
// 选中数组
ids
:
[],
// 选中数组
}
}
},
},
watch
:
{},
watch
:
{},
created
()
{
},
created
()
{
},
methods
:
{
methods
:
{
listChange
(
data
)
{
listChange
(
data
)
{
this
.
srcList
=
data
.
map
((
item
)
=>
item
.
materialUrl
)
this
.
srcList
=
data
.
map
((
item
)
=>
item
.
materialUrl
)
},
},
},
},
...
...
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