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 64623ddc
authored
Oct 09, 2021
by
ext.shengxiyong1
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'master' of
https://gitee.com/LinkWeChat/link-wechat
2 parents
15c35290
d6626035
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
115 additions
and
215 deletions
linkwe-mobile/src/App.vue
linkwe-mobile/src/views/chat/index.vue
linkwe-ui/src/api/appTool/chatBar.js
linkwe-ui/src/api/customer/index.js
linkwe-ui/src/components/SelectMaterialMult/list.vue
linkwe-ui/src/views/appTool/chatToolbar/list.vue
linkwe-ui/src/views/customerManage/lossRemind.vue
linkwe-ui/src/views/material/components/MaPage.vue
linkwe-mobile/src/App.vue
View file @
64623dd
...
@@ -31,9 +31,7 @@ export default {
...
@@ -31,9 +31,7 @@ export default {
// this.$toast('agentId:' + this.agentId)
// this.$toast('agentId:' + this.agentId)
this
.
$router
.
onReady
(()
=>
{
this
.
$router
.
onReady
(()
=>
{
const
noAuth
=
this
.
$router
.
app
.
$route
.
meta
const
noAuth
=
this
.
$router
.
app
.
$route
.
meta
?
this
.
$router
.
app
.
$route
.
meta
.
noAuth
:
false
?
this
.
$router
.
app
.
$route
.
meta
.
noAuth
:
false
if
(
!
code
&&
!
noAuth
)
{
if
(
!
code
&&
!
noAuth
)
{
this
.
$toast
(
'未获得授权'
)
this
.
$toast
(
'未获得授权'
)
...
@@ -67,10 +65,7 @@ export default {
...
@@ -67,10 +65,7 @@ export default {
async
wxConfig
()
{
async
wxConfig
()
{
this
.
$store
.
state
.
agentConfigStatus
=
false
this
.
$store
.
state
.
agentConfigStatus
=
false
try
{
try
{
let
{
data
}
=
await
getAgentTicket
(
let
{
data
}
=
await
getAgentTicket
(
window
.
location
.
href
.
split
(
'#'
)[
0
],
this
.
agentId
)
window
.
location
.
href
.
split
(
'#'
)[
0
],
this
.
agentId
)
let
{
timestamp
,
nonceStr
,
signature
}
=
data
let
{
timestamp
,
nonceStr
,
signature
}
=
data
wx
.
agentConfig
({
wx
.
agentConfig
({
beta
:
true
,
// 必须这么写,否则wx.invoke调用形式的jsapi会有问题
beta
:
true
,
// 必须这么写,否则wx.invoke调用形式的jsapi会有问题
...
@@ -90,7 +85,7 @@ export default {
...
@@ -90,7 +85,7 @@ export default {
],
//必填
],
//必填
success
:
(
res
)
=>
{
success
:
(
res
)
=>
{
// 回调
// 回调
this
.
$toast
(
'agentId成功:'
)
//
this.$toast('agentId成功:')
this
.
$store
.
state
.
agentConfigStatus
=
true
this
.
$store
.
state
.
agentConfigStatus
=
true
},
},
fail
:
(
res
)
=>
{
fail
:
(
res
)
=>
{
...
...
linkwe-mobile/src/views/chat/index.vue
View file @
64623dd
...
@@ -15,7 +15,11 @@ export default {
...
@@ -15,7 +15,11 @@ export default {
// userId: this.$store.state.userId,
// userId: this.$store.state.userId,
}
}
},
},
watch
:
{},
watch
:
{
userId
()
{
this
.
getList
()
}
},
computed
:
{
computed
:
{
userId
()
{
userId
()
{
return
this
.
$store
.
state
.
userId
return
this
.
$store
.
state
.
userId
...
@@ -29,6 +33,7 @@ export default {
...
@@ -29,6 +33,7 @@ export default {
mounted
()
{},
mounted
()
{},
methods
:
{
methods
:
{
getList
()
{
getList
()
{
this
.
list
=
[]
getTypeList
().
then
(({
rows
,
total
})
=>
{
getTypeList
().
then
(({
rows
,
total
})
=>
{
this
.
userId
&&
this
.
userId
&&
this
.
list
.
push
({
this
.
list
.
push
({
...
...
linkwe-ui/src/api/appTool/chatBar.js
View file @
64623dd
...
@@ -7,11 +7,23 @@ const service = window.CONFIG.services.wecom + '/chat'
...
@@ -7,11 +7,23 @@ const service = window.CONFIG.services.wecom + '/chat'
*/
*/
export
function
getList
()
{
export
function
getList
()
{
return
request
({
return
request
({
url
:
service
+
'/side/list'
,
url
:
service
+
'/side/list'
})
})
}
}
/**
/**
* 查询素材列表
* @param {*} params
* { categoryId:类目id
search:搜索的值
mediaType: '' 0 图片(image)、1 语音(voice)、2 视频(video),3 普通文件(file), 4 文本
}
*/
export
function
getMaterialList
(
params
)
{
return
request
({
url
:
'/wecom/chat/item/mList'
,
params
})
}
/**
* 更新侧边栏信息
* 更新侧边栏信息
* @param {*} data
* @param {*} data
* {
* {
...
@@ -26,7 +38,7 @@ export function update(data) {
...
@@ -26,7 +38,7 @@ export function update(data) {
return
request
({
return
request
({
url
:
service
+
'/side'
,
url
:
service
+
'/side'
,
method
:
'put'
,
method
:
'put'
,
data
,
data
})
})
}
}
...
@@ -44,6 +56,6 @@ export function getMaterial(data) {
...
@@ -44,6 +56,6 @@ export function getMaterial(data) {
return
request
({
return
request
({
url
:
service
+
'/item'
,
url
:
service
+
'/item'
,
method
:
'put'
,
method
:
'put'
,
data
,
data
})
})
}
}
linkwe-ui/src/api/customer/index.js
View file @
64623dd
...
@@ -12,7 +12,7 @@ const service = window.CONFIG.services.wecom + '/customer'
...
@@ -12,7 +12,7 @@ const service = window.CONFIG.services.wecom + '/customer'
"tagIds": "标签id,多个标签,id使用逗号隔开",
"tagIds": "标签id,多个标签,id使用逗号隔开",
"beginTime": "开始时间",
"beginTime": "开始时间",
"endTime": "结束时间"
"endTime": "结束时间"
status
: 0 客户状态 0正常 1删除
delFlag
: 0 客户状态 0正常 1删除
}
}
*/
*/
export
function
getListNew
(
params
)
{
export
function
getListNew
(
params
)
{
...
@@ -23,6 +23,20 @@ export function getListNew(params) {
...
@@ -23,6 +23,20 @@ export function getListNew(params) {
})
})
}
}
/**
* 客户列表
* @param {*} params
* {
"pageNum": "当前页",
"pageSize": "每页显示条数",
"name": "客户名称",
"userId": "添加人id",
"tagIds": "标签id,多个标签,id使用逗号隔开",
"beginTime": "开始时间",
"endTime": "结束时间"
status: 0 客户状态 0正常 1删除
}
*/
export
function
getList
(
params
)
{
export
function
getList
(
params
)
{
return
request
({
return
request
({
url
:
service
+
'/list'
,
url
:
service
+
'/list'
,
...
...
linkwe-ui/src/components/SelectMaterialMult/list.vue
View file @
64623dd
<
script
>
<
script
>
import
{
getTree
,
getList
}
from
'@/api/material'
import
{
getTree
,
getList
}
from
'@/api/material'
import
{
getMaterialList
}
from
'@/api/appTool/chatBar'
export
default
{
export
default
{
components
:
{},
components
:
{},
props
:
{
props
:
{
...
@@ -15,6 +16,11 @@ export default {
...
@@ -15,6 +16,11 @@ export default {
selected
:
{
selected
:
{
type
:
Array
,
type
:
Array
,
default
:
()
=>
[]
default
:
()
=>
[]
},
// 是否使用素材抓取回显选中
isCheck
:
{
type
:
Boolean
,
default
:
false
}
}
},
},
data
()
{
data
()
{
...
@@ -78,11 +84,28 @@ export default {
...
@@ -78,11 +84,28 @@ export default {
getList
(
page
)
{
getList
(
page
)
{
page
&&
(
this
.
query
.
pageNum
=
page
)
page
&&
(
this
.
query
.
pageNum
=
page
)
this
.
loading
=
true
this
.
loading
=
true
getList
(
this
.
query
)
;(
this
.
isCheck
?
getMaterialList
:
getList
)
(
this
.
query
)
.
then
(({
rows
,
total
})
=>
{
.
then
(({
rows
,
total
})
=>
{
this
.
list
=
rows
this
.
list
=
rows
this
.
total
=
+
total
this
.
total
=
+
total
this
.
loading
=
false
this
.
loading
=
false
if
(
this
.
isCheck
)
{
let
selected
=
this
.
list
.
filter
((
d
)
=>
d
.
isCheck
)
this
.
$emit
(
'update:selected'
,
selected
)
// 选中回显
if
([
1
,
3
,
4
].
includes
(
+
this
.
type
))
{
this
.
$nextTick
(()
=>
{
selected
.
forEach
((
row
)
=>
{
this
.
$refs
.
table
.
toggleRowSelection
(
row
,
true
)
})
})
}
else
{
this
.
selectedx
=
selected
}
}
this
.
$emit
(
'listChange'
,
this
.
list
)
this
.
$emit
(
'listChange'
,
this
.
list
)
})
})
.
catch
(()
=>
{
.
catch
(()
=>
{
...
@@ -178,7 +201,7 @@ export default {
...
@@ -178,7 +201,7 @@ export default {
:total=
"total"
:total=
"total"
></el-pagination>
></el-pagination>
</div>
</div>
<el-table
v-if=
"[1, 3, 4].includes(+type)"
:data=
"list"
@
selection-change=
"handleSelectionChange"
>
<el-table
ref=
"table"
v-if=
"[1, 3, 4].includes(+type)"
:data=
"list"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
v-if=
"type == 4"
prop=
"content"
label=
"文本内容"
></el-table-column>
<el-table-column
v-if=
"type == 4"
prop=
"content"
label=
"文本内容"
></el-table-column>
<el-table-column
v-else
prop=
"materialName"
label=
"素材名称"
></el-table-column>
<el-table-column
v-else
prop=
"materialName"
label=
"素材名称"
></el-table-column>
...
...
linkwe-ui/src/views/appTool/chatToolbar/list.vue
View file @
64623dd
...
@@ -100,9 +100,7 @@ export default {
...
@@ -100,9 +100,7 @@ export default {
<div>
<div>
<div>
<div>
配置聊天工具栏,方便成员在外部会话中查看和使用,提高服务效率。
配置聊天工具栏,方便成员在外部会话中查看和使用,提高服务效率。
<el-button
type=
"text"
@
click=
"$router.push('explain')"
<el-button
type=
"text"
@
click=
"$router.push('explain')"
>
图文详解
</el-button>
>
图文详解
</el-button
>
<!--
<el-button
type=
"text"
@
click=
"$router.push(
{ path: 'config' })"
<!--
<el-button
type=
"text"
@
click=
"$router.push(
{ path: 'config' })"
>查看已配置信息
</el-button
>查看已配置信息
</el-button
>
-->
>
-->
...
@@ -126,16 +124,8 @@ export default {
...
@@ -126,16 +124,8 @@ export default {
{{
row
.
sideName
}}
{{
row
.
sideName
}}
</span>
</span>
<i
<i
v-if=
"!row.isEdit"
class=
"row-icon el-icon-edit"
@
click=
"$set(row, 'isEdit', true)"
></i>
v-if=
"!row.isEdit"
<i
v-else
class=
"row-icon el-icon-circle-check"
@
click=
"update(row)"
></i>
class=
"row-icon el-icon-edit"
@
click=
"$set(row, 'isEdit', true)"
></i>
<i
v-else
class=
"row-icon el-icon-circle-check"
@
click=
"update(row)"
></i>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"已抓取素材数量"
align=
"center"
prop=
"total"
/>
<el-table-column
label=
"已抓取素材数量"
align=
"center"
prop=
"total"
/>
...
@@ -152,9 +142,7 @@ export default {
...
@@ -152,9 +142,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=
"openDialog(scope.row)"
<el-button
type=
"text"
@
click=
"openDialog(scope.row)"
>
抓取素材
</el-button>
>
抓取素材
</el-button
>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
...
@@ -213,11 +201,9 @@ export default {
...
@@ -213,11 +201,9 @@ export default {
</el-row>
</el-row>
</el-card> -->
</el-card> -->
<el-dialog
<el-dialog
:title=
"`抓取${mediaType[metarialParams.mediaType]}类型素材库`"
:visible
.
sync=
"dialogVisible"
>
:title=
"`抓取${mediaType[metarialParams.mediaType]}类型素材库`"
:visible
.
sync=
"dialogVisible"
>
<SelectMaterialMult
<SelectMaterialMult
isCheck
:selected
.
sync=
"selectedMaterial"
:selected
.
sync=
"selectedMaterial"
:type=
"metarialParams.mediaType"
:type=
"metarialParams.mediaType"
:key=
"metarialParams.mediaType"
:key=
"metarialParams.mediaType"
...
...
linkwe-ui/src/views/customerManage/lossRemind.vue
View file @
64623dd
<
script
>
<
script
>
import
{
import
{
getListNew
,
exportCustomer
,
lossRemind
,
getLossRemindStatus
}
from
'@/api/customer'
getList
,
exportCustomer
,
lossRemind
,
getLossRemindStatus
}
from
'@/api/customer'
import
{
getList
as
getListTag
}
from
'@/api/customer/tag'
import
{
getList
as
getListTag
}
from
'@/api/customer/tag'
import
{
getList
as
getListOrganization
}
from
'@/api/organization'
import
{
getList
as
getListOrganization
}
from
'@/api/organization'
import
SelectUser
from
'@/components/SelectUser'
import
SelectUser
from
'@/components/SelectUser'
...
@@ -24,7 +19,7 @@ export default {
...
@@ -24,7 +19,7 @@ export default {
tagIds
:
''
,
// "标签id,多个标签,id使用逗号隔开",
tagIds
:
''
,
// "标签id,多个标签,id使用逗号隔开",
beginTime
:
''
,
// "开始时间",
beginTime
:
''
,
// "开始时间",
endTime
:
''
,
// "结束时间"
endTime
:
''
,
// "结束时间"
status
:
1
delFlag
:
1
},
},
queryTag
:
[],
// 搜索框选择的标签
queryTag
:
[],
// 搜索框选择的标签
queryUser
:
[],
// 搜索框选择的添加人
queryUser
:
[],
// 搜索框选择的添加人
...
@@ -80,7 +75,7 @@ export default {
...
@@ -80,7 +75,7 @@ export default {
}
}
page
&&
(
this
.
query
.
pageNum
=
page
)
page
&&
(
this
.
query
.
pageNum
=
page
)
this
.
loading
=
true
this
.
loading
=
true
getList
(
this
.
query
)
getList
New
(
this
.
query
)
.
then
(({
rows
,
total
})
=>
{
.
then
(({
rows
,
total
})
=>
{
this
.
list
=
rows
this
.
list
=
rows
this
.
total
=
+
total
this
.
total
=
+
total
...
@@ -169,14 +164,7 @@ export default {
...
@@ -169,14 +164,7 @@ export default {
<
template
>
<
template
>
<div>
<div>
<el-form
<el-form
ref=
"queryForm"
:inline=
"true"
:model=
"query"
label-width=
"100px"
class=
"top-search"
size=
"small"
>
ref=
"queryForm"
:inline=
"true"
:model=
"query"
label-width=
"100px"
class=
"top-search"
size=
"small"
>
<el-form-item
label=
"客户名称"
prop=
"name"
>
<el-form-item
label=
"客户名称"
prop=
"name"
>
<el-input
v-model=
"query.name"
placeholder=
"请输入"
></el-input>
<el-input
v-model=
"query.name"
placeholder=
"请输入"
></el-input>
</el-form-item>
</el-form-item>
...
@@ -184,12 +172,7 @@ export default {
...
@@ -184,12 +172,7 @@ export default {
<div
class=
"tag-input"
@
click=
"dialogVisibleSelectUser = true"
>
<div
class=
"tag-input"
@
click=
"dialogVisibleSelectUser = true"
>
<span
class=
"tag-place"
v-if=
"!queryUser.length"
>
请选择
</span>
<span
class=
"tag-place"
v-if=
"!queryUser.length"
>
请选择
</span>
<template
v-else
>
<template
v-else
>
<el-tag
<el-tag
type=
"info"
v-for=
"(unit, unique) in queryUser"
:key=
"unique"
>
{{
unit
.
name
}}
</el-tag>
type=
"info"
v-for=
"(unit, unique) in queryUser"
:key=
"unique"
>
{{
unit
.
name
}}
</el-tag
>
</
template
>
</
template
>
</div>
</div>
</el-form-item>
</el-form-item>
...
@@ -209,32 +192,14 @@ export default {
...
@@ -209,32 +192,14 @@ export default {
<div
class=
"tag-input"
@
click=
"showTagDialog"
>
<div
class=
"tag-input"
@
click=
"showTagDialog"
>
<span
class=
"tag-place"
v-if=
"!queryTag.length"
>
请选择
</span>
<span
class=
"tag-place"
v-if=
"!queryTag.length"
>
请选择
</span>
<
template
v-else
>
<
template
v-else
>
<el-tag
<el-tag
type=
"info"
v-for=
"(unit, unique) in queryTag"
:key=
"unique"
>
{{
unit
.
name
}}
</el-tag>
type=
"info"
v-for=
"(unit, unique) in queryTag"
:key=
"unique"
>
{{
unit
.
name
}}
</el-tag
>
</
template
>
</
template
>
</div>
</div>
</el-form-item>
</el-form-item>
<el-form-item
label=
" "
>
<el-form-item
label=
" "
>
<el-button
<el-button
v-hasPermi=
"['customerManage:customer:query']"
type=
"primary"
@
click=
"getList(1)"
>
查询
</el-button>
v-hasPermi=
"['customerManage:customer:query']"
<el-button
v-hasPermi=
"['customerManage:customer:query']"
type=
"success"
@
click=
"resetForm()"
>
重置
</el-button>
type=
"primary"
<el-button
v-hasPermi=
"['customerManage:customer:export']"
type=
"info"
@
click=
"exportCustomer"
@
click=
"getList(1)"
>
查询
</el-button
>
<el-button
v-hasPermi=
"['customerManage:customer:query']"
type=
"success"
@
click=
"resetForm()"
>
重置
</el-button
>
<el-button
v-hasPermi=
"['customerManage:customer:export']"
type=
"info"
@
click=
"exportCustomer"
>
导出列表
</el-button
>
导出列表
</el-button
>
>
</el-form-item>
</el-form-item>
...
@@ -264,53 +229,29 @@ export default {
...
@@ -264,53 +229,29 @@ export default {
style=
"width: 100%"
style=
"width: 100%"
@
selection-change=
"handleSelectionChange"
@
selection-change=
"handleSelectionChange"
>
>
<el-table-column
<el-table-column
type=
"selection"
align=
"center"
width=
"55"
></el-table-column>
type=
"selection"
align=
"center"
width=
"55"
></el-table-column>
<el-table-column
label=
"客户"
prop=
"name"
align=
"center"
>
<el-table-column
label=
"客户"
prop=
"name"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
name
}}
{{
scope
.
row
.
name
}}
<span
<span
:style=
"
{ color: scope.row.type === 1 ? '#4bde03' : '#f9a90b' }">
{{
:style=
"
{ color: scope.row.type === 1 ? '#4bde03' : '#f9a90b' }"
{
1
:
'@微信'
,
2
:
'@企业微信'
}
[
scope
.
row
.
type
]
>
{{
{
1
:
'@微信'
,
2
:
'@企业微信'
}
[
scope
.
row
.
type
]
}}
<
/spa
n
}}
<
/span
>
>
<
i
:
class
=
"
[
'el-icon-s-custom'
,
{
1
:
'man'
,
2
:
'woman'
}
[
scope
.
row
.
gender
]]
"></i>
<
i
:
class
=
"
[
'el-icon-s-custom'
,
{
1
:
'man'
,
2
:
'woman'
}
[
scope
.
row
.
gender
]
]
"
></i>
</template>
</template>
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column prop="
corpName
" label="
公司名称
" align="
center
"></el-table-column>
prop="
corpName
"
label="
公司名称
"
align="
center
"
></el-table-column>
<el-table-column prop="
userName
" label="
添加人(首位)
" align="
center
">
<el-table-column prop="
userName
" label="
添加人(首位)
" align="
center
">
<template slot-scope="
scope
"
>
{{
<template slot-scope="
scope
"
>
{{
scope
.
row
.
weFlowerCustomerRels
[
0
].
userName
}}
<
/template
>
scope
.
row
.
weFlowerCustomerRels
[
0
].
userName
}}
<
/template
>
<
/el-table-column
>
<
/el-table-column
>
<
el
-
table
-
column
prop
=
"createTime"
label
=
"添加时间"
align
=
"center"
>
<
el
-
table
-
column
prop
=
"createTime"
label
=
"添加时间"
align
=
"center"
>
<
template
slot
-
scope
=
"scope"
>
{{
<
template
slot
-
scope
=
"scope"
>
{{
scope
.
row
.
weFlowerCustomerRels
[
0
].
createTime
}}
<
/template
>
scope
.
row
.
weFlowerCustomerRels
[
0
].
createTime
}}
<
/template
>
<
/el-table-column
>
<
/el-table-column
>
<
el
-
table
-
column
prop
=
"address"
label
=
"标签"
align
=
"center"
>
<
el
-
table
-
column
prop
=
"address"
label
=
"标签"
align
=
"center"
>
<
template
slot
-
scope
=
"scope"
>
<
template
slot
-
scope
=
"scope"
>
<
div
<
div
v
-
for
=
"(item, index) in scope.row.weFlowerCustomerRels"
:
key
=
"index"
>
v
-
for
=
"(item, index) in scope.row.weFlowerCustomerRels"
<
el
-
tag
type
=
"info"
v
-
for
=
"(unit, unique) in item.weFlowerCustomerTagRels"
:
key
=
"unique"
>
{{
:
key
=
"index"
unit
.
tagName
>
}}
<
/el-tag
>
<
el
-
tag
type
=
"info"
v
-
for
=
"(unit, unique) in item.weFlowerCustomerTagRels"
:
key
=
"unique"
>
{{
unit
.
tagName
}}
<
/el-ta
g
>
<
/div
>
<
/div
>
<
/template
>
<
/template
>
<
/el-table-column
>
<
/el-table-column
>
...
@@ -352,11 +293,7 @@ export default {
...
@@ -352,11 +293,7 @@ export default {
</SelectTag>
</SelectTag>
<!-- 选择添加人弹窗 -->
<!-- 选择添加人弹窗 -->
<SelectUser
<SelectUser :visible.sync="
dialogVisibleSelectUser
" title="
选择添加人
" @success="
selectedUser
"></SelectUser>
:visible.sync="
dialogVisibleSelectUser
"
title="
选择添加人
"
@success="
selectedUser
"
></SelectUser>
</div>
</div>
</template>
</template>
...
...
linkwe-ui/src/views/material/components/MaPage.vue
View file @
64623dd
...
@@ -71,16 +71,10 @@ export default {
...
@@ -71,16 +71,10 @@ export default {
dialogVisible
:
false
,
// 素材表格对话框显隐
dialogVisible
:
false
,
// 素材表格对话框显隐
// 表单校验
// 表单校验
rules
:
Object
.
freeze
({
rules
:
Object
.
freeze
({
categoryId
:
[
categoryId
:
[{
required
:
true
,
message
:
'不能为空'
,
trigger
:
'change'
}],
{
required
:
true
,
message
:
'不能为空'
,
trigger
:
'change'
}
],
content
:
[{
required
:
true
,
message
:
'不能为空'
,
trigger
:
'blur'
}],
content
:
[{
required
:
true
,
message
:
'不能为空'
,
trigger
:
'blur'
}],
materialUrl
:
[
materialUrl
:
[{
required
:
true
,
message
:
'不能为空'
,
trigger
:
'change'
}],
{
required
:
true
,
message
:
'不能为空'
,
trigger
:
'change'
}
materialName
:
[{
required
:
true
,
message
:
'不能为空'
,
trigger
:
'blur'
}],
],
materialName
:
[
{
required
:
true
,
message
:
'不能为空'
,
trigger
:
'blur'
}
],
digest
:
[{
required
:
true
,
message
:
'不能为空'
,
trigger
:
'blur'
}],
digest
:
[{
required
:
true
,
message
:
'不能为空'
,
trigger
:
'blur'
}],
coverUrl
:
[{
required
:
true
,
message
:
'不能为空'
,
trigger
:
'blur'
}]
coverUrl
:
[{
required
:
true
,
message
:
'不能为空'
,
trigger
:
'blur'
}]
})
})
...
@@ -112,7 +106,6 @@ export default {
...
@@ -112,7 +106,6 @@ export default {
},
},
// 获取素材列表
// 获取素材列表
getList
(
page
)
{
getList
(
page
)
{
console
.
log
(
'getList'
,
page
,
JSON
.
stringify
(
this
.
query
))
page
&&
(
this
.
query
.
pageNum
=
page
)
page
&&
(
this
.
query
.
pageNum
=
page
)
this
.
loading
=
true
this
.
loading
=
true
getList
(
this
.
query
)
getList
(
this
.
query
)
...
@@ -138,10 +131,7 @@ export default {
...
@@ -138,10 +131,7 @@ export default {
},
},
// 类目树节点添加/编辑 0: 添加, 1:编辑
// 类目树节点添加/编辑 0: 添加, 1:编辑
treeEdit
(
data
,
type
)
{
treeEdit
(
data
,
type
)
{
this
.
treeForm
=
Object
.
assign
(
this
.
treeForm
=
Object
.
assign
({},
type
?
data
:
{
parentId
:
data
.
id
||
'0'
,
mediaType
:
this
.
type
})
{},
type
?
data
:
{
parentId
:
data
.
id
||
'0'
,
mediaType
:
this
.
type
}
)
this
.
treeDialogVisible
=
true
this
.
treeDialogVisible
=
true
},
},
// 类目树节点提交
// 类目树节点提交
...
@@ -179,10 +169,7 @@ export default {
...
@@ -179,10 +169,7 @@ export default {
this
.
$parent
.
dialog
.
edit
=
true
this
.
$parent
.
dialog
.
edit
=
true
break
break
default
:
default
:
this
.
form
=
Object
.
assign
(
this
.
form
=
Object
.
assign
({},
data
||
{
categoryId
:
this
.
query
.
categoryId
})
{},
data
||
{
categoryId
:
this
.
query
.
categoryId
}
)
this
.
dialogVisible
=
true
this
.
dialogVisible
=
true
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'form'
].
clearValidate
()
this
.
$refs
[
'form'
].
clearValidate
()
...
@@ -245,11 +232,7 @@ export default {
...
@@ -245,11 +232,7 @@ export default {
<el-row
type=
"flex"
justify=
"space-between"
>
<el-row
type=
"flex"
justify=
"space-between"
>
<el-col
:span=
"6"
>
<el-col
:span=
"6"
>
<div>
<div>
<el-button
<el-button
v-hasPermi=
"['wechat:category:add']"
slot=
"reference"
type=
"primary"
@
click=
"treeEdit(
{}, 0)"
v-hasPermi=
"['wechat:category:add']"
slot=
"reference"
type=
"primary"
@
click=
"treeEdit(
{}, 0)"
>添加分类
</el-button
>添加分类
</el-button
>
>
</div>
</div>
...
@@ -307,34 +290,18 @@ export default {
...
@@ -307,34 +290,18 @@ export default {
prefix-icon=
"el-icon-search"
prefix-icon=
"el-icon-search"
style=
"width: 300px;"
style=
"width: 300px;"
/>
/>
<el-button
<el-button
class=
"ml10"
@
click=
"getList(1)"
v-hasPermi=
"['wecom:material:list']"
>
搜索
</el-button>
class=
"ml10"
<el-button
v-hasPermi=
"['wechat:material:remove']"
@
click=
"remove()"
:disabled=
"selected.length === 0"
@
click=
"getList(1)"
v-hasPermi=
"['wecom:material:list']"
>
搜索
</el-button
>
<el-button
v-hasPermi=
"['wechat:material:remove']"
@
click=
"remove()"
:disabled=
"selected.length === 0"
>
删除
</el-button
>
删除
</el-button
>
>
<el-popover
placement=
"top"
width=
"260"
v-model=
"groupDialogVisible"
>
<el-popover
placement=
"top"
width=
"260"
v-model=
"groupDialogVisible"
>
<div>
选择分组
</div>
<div>
选择分组
</div>
<div
style=
"position: relative; margin: 10px 0;"
>
<div
style=
"position: relative; margin: 10px 0;"
>
<el-cascader
<el-cascader
v-model=
"group"
:options=
"treeData[0].children"
:props=
"groupProps"
></el-cascader>
v-model=
"group"
:options=
"treeData[0].children"
:props=
"groupProps"
></el-cascader>
</div>
</div>
<div
style=
"text-align: right;"
>
<div
style=
"text-align: right;"
>
<el-button
size=
"mini"
@
click=
"groupDialogVisible = false"
<el-button
size=
"mini"
@
click=
"groupDialogVisible = false"
>
取消
</el-button>
>
取消
</el-button
<el-button
type=
"primary"
size=
"mini"
@
click=
"moveGroup"
>
确定
</el-button>
>
<el-button
type=
"primary"
size=
"mini"
@
click=
"moveGroup"
>
确定
</el-button
>
</div>
</div>
<el-button
<el-button
v-hasPermi=
"['wechat:material:resetCategory']"
v-hasPermi=
"['wechat:material:resetCategory']"
...
@@ -346,10 +313,7 @@ export default {
...
@@ -346,10 +313,7 @@ export default {
</el-popover>
</el-popover>
<div
class=
"fr"
>
<div
class=
"fr"
>
<el-button
<el-button
v-hasPermi=
"['wechat:material:add']"
type=
"primary"
@
click=
"edit(1, ~~type)"
v-hasPermi=
"['wechat:material:add']"
type=
"primary"
@
click=
"edit(1, ~~type)"
>
添加
{{
typeTitle
[
type
]
}}
</el-button
>
添加
{{
typeTitle
[
type
]
}}
</el-button
>
>
</div>
</div>
...
@@ -364,17 +328,13 @@ export default {
...
@@ -364,17 +328,13 @@ export default {
:total=
"total"
:total=
"total"
:page
.
sync=
"query.pageNum"
:page
.
sync=
"query.pageNum"
:limit
.
sync=
"query.pageSize"
:limit
.
sync=
"query.pageSize"
@
pagination=
"getList(
1
)"
@
pagination=
"getList()"
/>
/>
</el-col>
</el-col>
</el-row>
</el-row>
<!-- 分类树添加/编辑弹窗 -->
<!-- 分类树添加/编辑弹窗 -->
<el-dialog
<el-dialog
:title=
"(treeForm.id ? '修改' : '添加') + '分类'"
:visible
.
sync=
"treeDialogVisible"
width=
"400px"
>
:title=
"(treeForm.id ? '修改' : '添加') + '分类'"
:visible
.
sync=
"treeDialogVisible"
width=
"400px"
>
<el-form
ref=
"treeForm"
:model=
"treeForm"
>
<el-form
ref=
"treeForm"
:model=
"treeForm"
>
<el-form-item>
<el-form-item>
<el-input
<el-input
...
@@ -404,11 +364,7 @@ export default {
...
@@ -404,11 +364,7 @@ export default {
>
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<el-form-item
label=
"分类"
prop=
"categoryId"
>
<el-form-item
label=
"分类"
prop=
"categoryId"
>
<el-cascader
<el-cascader
v-model=
"form.categoryId"
:options=
"treeData[0].children"
:props=
"groupProps"
></el-cascader>
v-model=
"form.categoryId"
:options=
"treeData[0].children"
:props=
"groupProps"
></el-cascader>
</el-form-item>
</el-form-item>
<el-form-item
label=
"文本内容"
prop=
"content"
v-if=
"type === '4'"
>
<el-form-item
label=
"文本内容"
prop=
"content"
v-if=
"type === '4'"
>
...
@@ -430,61 +386,40 @@ export default {
...
@@ -430,61 +386,40 @@ export default {
>
</el-input>
>
</el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"图片"
prop=
"materialUrl"
>
<el-form-item
label=
"图片"
prop=
"materialUrl"
>
<upload
<upload
:fileUrl
.
sync=
"form.materialUrl"
:fileName
.
sync=
"form.materialName"
:type=
"type"
>
:fileUrl
.
sync=
"form.materialUrl"
:fileName
.
sync=
"form.materialName"
:type=
"type"
>
<div
slot=
"tip"
>
<div
slot=
"tip"
>
支持JPG,PNG格式,图片大小不超过2M,建议上传宽高1:1的图片
支持JPG,PNG格式,图片大小不超过2M,建议上传宽高1:1的图片
</div>
</div>
</upload>
</upload>
</el-form-item>
</el-form-item>
<el-form-item
label=
"名称"
prop=
"materialName"
>
<el-form-item
label=
"名称"
prop=
"materialName"
>
<el-input
<el-input
v-model=
"form.materialName"
placeholder=
"请输入"
></el-input>
v-model=
"form.materialName"
placeholder=
"请输入"
></el-input>
</el-form-item>
</el-form-item>
</
template
>
</
template
>
<
template
v-else-if=
"type === '1'"
>
<
template
v-else-if=
"type === '1'"
>
<el-form-item
label=
"语音"
prop=
"materialUrl"
>
<el-form-item
label=
"语音"
prop=
"materialUrl"
>
<upload
<upload
:fileUrl
.
sync=
"form.materialUrl"
:fileName
.
sync=
"form.materialName"
:type=
"type"
>
:fileUrl
.
sync=
"form.materialUrl"
:fileName
.
sync=
"form.materialName"
:type=
"type"
>
<div
slot=
"tip"
>
<div
slot=
"tip"
>
只能上传amr格式的语音文件。单个文件大小不超过2M,时长不超过1分钟
只能上传amr格式的语音文件。单个文件大小不超过2M,时长不超过1分钟
</div>
</div>
</upload>
</upload>
</el-form-item>
</el-form-item>
<el-form-item
label=
"名称"
prop=
"materialName"
>
<el-form-item
label=
"名称"
prop=
"materialName"
>
<el-input
<el-input
v-model=
"form.materialName"
placeholder=
"请输入"
></el-input>
v-model=
"form.materialName"
placeholder=
"请输入"
></el-input>
</el-form-item>
</el-form-item>
</
template
>
</
template
>
<
template
v-else-if=
"type === '2'"
>
<
template
v-else-if=
"type === '2'"
>
<el-form-item
label=
"视频"
prop=
"materialUrl"
>
<el-form-item
label=
"视频"
prop=
"materialUrl"
>
<upload
<upload
:fileUrl
.
sync=
"form.materialUrl"
:fileName
.
sync=
"form.materialName"
:type=
"type"
>
:fileUrl
.
sync=
"form.materialUrl"
:fileName
.
sync=
"form.materialName"
:type=
"type"
>
<div
slot=
"tip"
>
<div
slot=
"tip"
>
不超过10M, 文件格式: mp4
不超过10M, 文件格式: mp4
</div>
</div>
</upload>
</upload>
</el-form-item>
</el-form-item>
<el-form-item
label=
"名称"
prop=
"materialName"
>
<el-form-item
label=
"名称"
prop=
"materialName"
>
<el-input
<el-input
v-model=
"form.materialName"
placeholder=
"请输入"
></el-input>
v-model=
"form.materialName"
placeholder=
"请输入"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"封面"
>
<el-form-item
label=
"封面"
>
<upload
:fileUrl
.
sync=
"form.coverUrl"
type=
"0"
>
<upload
:fileUrl
.
sync=
"form.coverUrl"
type=
"0"
>
...
@@ -504,21 +439,14 @@ export default {
...
@@ -504,21 +439,14 @@ export default {
<
template
v-else-if=
"type === '3'"
>
<
template
v-else-if=
"type === '3'"
>
<el-form-item
label=
"文件"
prop=
"materialUrl"
>
<el-form-item
label=
"文件"
prop=
"materialUrl"
>
<upload
<upload
:fileUrl
.
sync=
"form.materialUrl"
:fileName
.
sync=
"form.materialName"
:type=
"type"
>
:fileUrl
.
sync=
"form.materialUrl"
:fileName
.
sync=
"form.materialName"
:type=
"type"
>
<div
slot=
"tip"
>
<div
slot=
"tip"
>
单个文件大小不超过20M
单个文件大小不超过20M
</div>
</div>
</upload>
</upload>
</el-form-item>
</el-form-item>
<el-form-item
label=
"名称"
prop=
"materialName"
>
<el-form-item
label=
"名称"
prop=
"materialName"
>
<el-input
<el-input
v-model=
"form.materialName"
placeholder=
"请输入"
></el-input>
v-model=
"form.materialName"
placeholder=
"请输入"
></el-input>
</el-form-item>
</el-form-item>
</
template
>
</
template
>
</el-form>
</el-form>
...
...
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