Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-marketing
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 2c4b1845
authored
Jan 09, 2023
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
处理营销素材空值问题
1 parent
54023140
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
154 additions
and
115 deletions
src/views/material/index.vue
src/views/material/index.vue
View file @
2c4b184
...
...
@@ -5,7 +5,9 @@
<i
class=
"el-icon-plus"
></i>
创建营销素材
</el-button>
-->
<GLButton
:size=
"size"
type=
"primary"
fn=
"新增营销素材"
class=
"el-icon-plus"
@
click=
"addMaterial(1)"
>
创建营销素材
</GLButton>
<GLButton
:size=
"size"
type=
"primary"
fn=
"新增营销素材"
class=
"el-icon-plus"
@
click=
"addMaterial(1)"
>
创建营销素材
</GLButton>
</div>
<span
@
click=
"showIntroductionDialog"
class=
"introduc-word"
>
功能介绍
...
...
@@ -13,59 +15,64 @@
</span>
<div
class=
"container"
>
<div
class=
"search-form"
>
<GLCombiForm
ref=
"showSearch"
:rowNumber=
"1"
:formObj=
"searchForm"
:formData=
"materialFormData"
@
handleOk=
"getListApi"
@
handleRest=
"handleReset"
></GLCombiForm>
<GLCombiForm
ref=
"showSearch"
:rowNumber=
"1"
:formObj=
"searchForm"
:formData=
"materialFormData"
@
handleOk=
"getListApi"
@
handleRest=
"handleReset"
></GLCombiForm>
</div>
<div
class=
"tabelList"
>
<el-row>
<el-col
:span=
"5"
>
<div
class=
"left"
>
<MaterialGroup
ref=
"materialGroup"
@
openAddDialog=
"addDialogShow"
:groupHeight=
"boxHeight"
:eventBus=
"eventBus"
@
getList=
"getList"
@
getListApi=
"getListApi"
></MaterialGroup>
<MaterialGroup
ref=
"materialGroup"
@
openAddDialog=
"addDialogShow"
:groupHeight=
"boxHeight"
:eventBus=
"eventBus"
@
getList=
"getList"
@
getListApi=
"getListApi"
></MaterialGroup>
</div>
</el-col>
<el-col
:span=
"19"
>
<div
class=
"right"
:style=
"
{ height: boxHeight + 'px' }">
<div
class=
"groupTitle"
>
{{
materialGroupName
}}
(共
{{
tableTotal
}}
条数据)
</div>
<GLTable
ref=
"materialRef"
:hasPage=
"false"
:noDataImg=
"url"
@
refreshTable=
"getListApi"
:layout=
"layout"
:searchForm=
"searchForm"
:tableParams=
"tableParams"
:tableData=
"materialTableData"
:pageConf=
"pageConf"
:tableTotal=
"tableTotal"
@
sortChange=
"sortChange"
:isCustomHead=
"true"
:customHeadShowList=
"customHeadShowList"
>
<GLTable
ref=
"materialRef"
:hasPage=
"false"
:noDataImg=
"url"
@
refreshTable=
"getListApi"
:layout=
"layout"
:searchForm=
"searchForm"
:tableParams=
"tableParams"
:tableData=
"materialTableData"
:pageConf=
"pageConf"
:tableTotal=
"tableTotal"
@
sortChange=
"sortChange"
:isCustomHead=
"true"
:customHeadShowList=
"customHeadShowList"
>
<!-- 素材内容 -->
<div
slot=
"materialContentRpcResponse"
slot-scope=
"scope"
>
<span
class=
"hide-content"
>
{{
scope
.
scope
.
materialContentRpcResponse
.
materialName
}}
</span>
<!-- 素材为PDF -->
<!--
<span
v-if=
"scope.scope.materialType == 1"
class=
"material-content"
>
-->
<!--
<img
src=
"@/assets/material/pdf.png"
style=
"margin-right:8px"
alt=
""
/>
-->
<!--
<el-tooltip
effect=
"dark"
placement=
"top"
:content=
"scope.scope.materialContentRpcResponse.materialName"
:disabled=
"scope.scope.materialContentRpcResponse.materialName.length
< 12
"
>
-->
<!--
<span
class=
"hide-content"
>
{{
scope
.
scope
.
materialContentRpcResponse
.
materialName
}}
</span>
-->
<!--
</el-tooltip>
-->
<!--
</span>
-->
<!--
<span
v-if=
"scope.scope.materialType == 1"
class=
"material-content"
>
-->
<!--
<img
src=
"@/assets/material/pdf.png"
style=
"margin-right:8px"
alt=
""
/>
-->
<!--
<el-tooltip
effect=
"dark"
placement=
"top"
:content=
"scope.scope.materialContentRpcResponse.materialName"
:disabled=
"scope.scope.materialContentRpcResponse.materialName.length
< 12
"
>
-->
<!--
<span
class=
"hide-content"
>
{{
scope
.
scope
.
materialContentRpcResponse
.
materialName
}}
</span>
-->
<!--
</el-tooltip>
-->
<!--
</span>
-->
<!-- 素材为自定义链接 -->
<!--
<span
v-if=
"scope.scope.materialType == 2"
></span>
-->
<!--
<span
v-if=
"scope.scope.materialType == 2"
></span>
-->
<!-- 素材为图文 -->
<!--
<span
v-if=
"scope.scope.materialType == 3 || scope.scope.materialType == 4 || scope.scope.materialType == 5 || scope.scope.materialType == 6"
class=
"material-content"
>
-->
<!-- 图片 -->
<!--
<el-popover
placement=
"top"
trigger=
"hover"
v-if=
"scope.scope.urlType == 'img'"
>
-->
<!--
<div>
-->
<!--
<img
class=
"img-plus"
:src=
"scope.scope.materialContentRpcResponse.materialUrl"
alt=
""
/>
-->
<!--
</div>
-->
<!--
<div
slot=
"reference"
class=
"urlContent"
>
-->
<!--
<img
style=
"margin-right:8px"
:src=
"scope.scope.materialContentRpcResponse.materialUrl"
alt=
""
/>
-->
<!--
<div
class=
"videoMask"
v-if=
"scope.scope.imgCount > 1"
>
-->
<!--
<img
src=
"@/assets/material/multi.png"
alt=
""
/>
-->
<!--
<span>
{{
scope
.
scope
.
imgCount
}}
</span>
-->
<!--
</div>
-->
<!--
</div>
-->
<!--
</el-popover>
-->
<!-- 视频 -->
<!--
<div
class=
"urlContent"
v-if=
"scope.scope.urlType == 'video'"
@
click=
"videoOpen(scope.scope)"
>
-->
<!--
<video
preload
loop
muted
width=
"36"
height=
"36"
>
-->
<!--
<source
:src=
"scope.scope.materialContentRpcResponse.materialUrl"
type=
"video/mp4"
/>
-->
<!--
</video>
-->
<!--
<div
class=
"videoMask"
>
-->
<!--
<img
src=
"@/assets/material/videoIcon.png"
style=
"width: 22px;height: 22px;"
alt=
""
/>
-->
<!--
</div>
-->
<!--
</div>
-->
<!--
<el-tooltip
effect=
"dark"
placement=
"top"
:content=
"scope.scope.materialContentRpcResponse.materialName"
:disabled=
"scope.scope.materialContentRpcResponse.materialName.length
< 14
"
>
-->
<!--
<span
class=
"hide-content"
>
{{
scope
.
scope
.
materialContentRpcResponse
.
materialName
}}
</span>
-->
<!--
</el-tooltip>
-->
<!--
</span>
-->
<!--
<span
v-if=
"scope.scope.materialType == 3 || scope.scope.materialType == 4 || scope.scope.materialType == 5 || scope.scope.materialType == 6"
class=
"material-content"
>
-->
<!-- 图片 -->
<!--
<el-popover
placement=
"top"
trigger=
"hover"
v-if=
"scope.scope.urlType == 'img'"
>
-->
<!--
<div>
-->
<!--
<img
class=
"img-plus"
:src=
"scope.scope.materialContentRpcResponse.materialUrl"
alt=
""
/>
-->
<!--
</div>
-->
<!--
<div
slot=
"reference"
class=
"urlContent"
>
-->
<!--
<img
style=
"margin-right:8px"
:src=
"scope.scope.materialContentRpcResponse.materialUrl"
alt=
""
/>
-->
<!--
<div
class=
"videoMask"
v-if=
"scope.scope.imgCount > 1"
>
-->
<!--
<img
src=
"@/assets/material/multi.png"
alt=
""
/>
-->
<!--
<span>
{{
scope
.
scope
.
imgCount
}}
</span>
-->
<!--
</div>
-->
<!--
</div>
-->
<!--
</el-popover>
-->
<!-- 视频 -->
<!--
<div
class=
"urlContent"
v-if=
"scope.scope.urlType == 'video'"
@
click=
"videoOpen(scope.scope)"
>
-->
<!--
<video
preload
loop
muted
width=
"36"
height=
"36"
>
-->
<!--
<source
:src=
"scope.scope.materialContentRpcResponse.materialUrl"
type=
"video/mp4"
/>
-->
<!--
</video>
-->
<!--
<div
class=
"videoMask"
>
-->
<!--
<img
src=
"@/assets/material/videoIcon.png"
style=
"width: 22px;height: 22px;"
alt=
""
/>
-->
<!--
</div>
-->
<!--
</div>
-->
<!--
<el-tooltip
effect=
"dark"
placement=
"top"
:content=
"scope.scope.materialContentRpcResponse.materialName"
:disabled=
"scope.scope.materialContentRpcResponse.materialName.length
< 14
"
>
-->
<!--
<span
class=
"hide-content"
>
{{
scope
.
scope
.
materialContentRpcResponse
.
materialName
}}
</span>
-->
<!--
</el-tooltip>
-->
<!--
</span>
-->
</div>
<!-- 状态 -->
<div
slot=
"status"
class=
"dot"
slot-scope=
"scope"
>
...
...
@@ -92,8 +99,10 @@
</el-row>
</div>
</div>
<AddMaterialGroupDia
:businessTypes=
"businessTypes"
ref=
"addMaterialGroup"
:dialogVisible=
"materialGroupDialog"
:eventBus=
"eventBus"
></AddMaterialGroupDia>
<FunctionIntroduc
:introductionDialog=
"introductionDialog"
@
closeIntroductDia=
"closeIntroductDia"
></FunctionIntroduc>
<AddMaterialGroupDia
:businessTypes=
"businessTypes"
ref=
"addMaterialGroup"
:dialogVisible=
"materialGroupDialog"
:eventBus=
"eventBus"
></AddMaterialGroupDia>
<FunctionIntroduc
:introductionDialog=
"introductionDialog"
@
closeIntroductDia=
"closeIntroductDia"
></FunctionIntroduc>
<VideoShowDia
ref=
"VideoShowDia"
:dialogVisible=
"dialogVisibleImg"
></VideoShowDia>
</div>
</
template
>
...
...
@@ -111,6 +120,7 @@ import AddMaterialGroupDia from '@/views/material/components/addMaterialGroupDia
import
MaterialGroup
from
'@/views/material/components/materialGroup'
import
FunctionIntroduc
from
'@/views/material/components/functionIntroduc'
import
VideoShowDia
from
'./components/videoDia.vue'
export
default
{
name
:
'materialList'
,
components
:
{
...
...
@@ -132,7 +142,7 @@ export default {
status
:
''
,
// 状态
materialName
:
''
// 素材名称
},
pageConf
:
{
pageSize
:
'pageSize'
,
pageNum
:
'pageNum'
,
totalCount
:
'total'
},
pageConf
:
{
pageSize
:
'pageSize'
,
pageNum
:
'pageNum'
,
totalCount
:
'total'
},
layout
:
'sizes, prev, pager, next, jumper, ->, total'
,
// 表格数据
materialTableData
:
[],
...
...
@@ -147,7 +157,7 @@ export default {
businessTypes
:
[],
// 素材组名称
materialGroupName
:
''
,
changeName
:
'编辑'
,
changeName
:
'编辑'
,
materialFormData
:
[
{
label
:
'业务类型'
,
...
...
@@ -313,43 +323,43 @@ export default {
formatter
:
cellVal
=>
{
return
cellVal
.
sendNum
},
renderHeader
:
(
h
,
{
column
,
$index
})
=>
{
renderHeader
:
(
h
,
{
column
,
$index
})
=>
{
return
h
(
'div'
,
{
style
:
{
display
:
'inline-flex'
,
'align-items'
:
'center'
,
padding
:
0
}
},
[
'发送次数'
,
h
(
'el-popover'
,
{
attrs
:
{
placement
:
'top-start'
,
width
:
'240'
,
trigger
:
'hover'
,
content
:
'统计该素材的发送次数(不包含在系统外部的转发次数)'
}
},
[
h
(
'img'
,
{
style
:
{
width
:
'17px'
,
height
:
'17px'
,
'vertical-align'
:
'middle'
},
attrs
:
{
src
:
iconUrl
'div'
,
{
style
:
{
display
:
'inline-flex'
,
'align-items'
:
'center'
,
padding
:
0
}
},
[
'发送次数'
,
h
(
'el-popover'
,
{
attrs
:
{
placement
:
'top-start'
,
width
:
'240'
,
trigger
:
'hover'
,
content
:
'统计该素材的发送次数(不包含在系统外部的转发次数)'
}
},
slot
:
'reference'
})
]
)
]
[
h
(
'img'
,
{
style
:
{
width
:
'17px'
,
height
:
'17px'
,
'vertical-align'
:
'middle'
},
attrs
:
{
src
:
iconUrl
},
slot
:
'reference'
})
]
)
]
)
}
},
...
...
@@ -361,43 +371,43 @@ export default {
formatter
:
cellVal
=>
{
return
cellVal
.
readNum
},
renderHeader
:
(
h
,
{
column
,
$index
})
=>
{
renderHeader
:
(
h
,
{
column
,
$index
})
=>
{
return
h
(
'div'
,
{
style
:
{
display
:
'inline-flex'
,
'align-items'
:
'center'
,
padding
:
0
}
},
[
'阅读人数'
,
h
(
'el-popover'
,
{
attrs
:
{
placement
:
'top-start'
,
width
:
'240'
,
trigger
:
'hover'
,
content
:
'阅读该素材的人数,内部员工除外。'
}
},
[
h
(
'img'
,
{
style
:
{
width
:
'17px'
,
height
:
'17px'
,
'vertical-align'
:
'middle'
'div'
,
{
style
:
{
display
:
'inline-flex'
,
'align-items'
:
'center'
,
padding
:
0
}
},
[
'阅读人数'
,
h
(
'el-popover'
,
{
attrs
:
{
placement
:
'top-start'
,
width
:
'240'
,
trigger
:
'hover'
,
content
:
'阅读该素材的人数,内部员工除外。'
}
},
attrs
:
{
src
:
iconUrl
},
slot
:
'reference'
})
]
)
]
[
h
(
'img'
,
{
style
:
{
width
:
'17px'
,
height
:
'17px'
,
'vertical-align'
:
'middle'
},
attrs
:
{
src
:
iconUrl
},
slot
:
'reference'
})
]
)
]
)
}
},
...
...
@@ -516,7 +526,7 @@ export default {
},
// 素材删除
handleDelete
(
scope
)
{
this
.
secondConfirm
(
'提示'
,
'删除素材,该素材将不再可以使用,是否继续删除?'
,
'material'
,
'materialDelete'
,
{
id
:
scope
.
id
})
this
.
secondConfirm
(
'提示'
,
'删除素材,该素材将不再可以使用,是否继续删除?'
,
'material'
,
'materialDelete'
,
{
id
:
scope
.
id
})
},
// 1-新增素材,2-编辑素材
addMaterial
(
addOrEdit
,
scope
)
{
...
...
@@ -548,13 +558,13 @@ export default {
let
videoHtml
=
html
.
match
(
/<video.*
?(?:
>|
\/
>
)
/g
)
if
(
imgHtml
)
{
let
imgSrc
=
imgHtml
[
0
].
match
(
'<img[^<>]*? src="([^<>]*?)"'
)
item
.
materialContentRpcResponse
.
materialUrl
=
imgSrc
[
1
]
item
.
materialContentRpcResponse
.
materialUrl
=
imgSrc
?
imgSrc
[
1
]
:
''
item
.
urlType
=
'img'
item
.
imgCount
=
imgHtml
.
length
}
if
(
videoHtml
)
{
let
videoSrc
=
videoHtml
[
0
].
match
(
'<video[^<>]*? src="([^<>]*?)"'
)
item
.
materialContentRpcResponse
.
materialUrl
=
videoSrc
[
1
]
item
.
materialContentRpcResponse
.
materialUrl
=
videoSrc
?
videoSrc
[
1
]
:
''
item
.
urlType
=
'video'
}
}
...
...
@@ -626,35 +636,43 @@ export default {
right
:
0
;
width
:
100%
;
height
:
100%
;
img
{
position
:
relative
;
align-self
:
center
;
margin
:
auto
;
}
span
{
position
:
absolute
;
top
:
12px
;
right
:
15px
;
}
}
.urlContent
{
margin-right
:
8px
;
position
:
relative
;
width
:
36px
;
height
:
36px
;
}
.search-form
,
.left
,
.right
{
background-color
:
#fff
;
}
.el-popover
{
min-width
:
100px
;
}
.main-container
{
height
:
100%
;
.top
{
display
:
inline-flex
;
span
{
margin-left
:
16px
;
font-size
:
16px
;
...
...
@@ -662,44 +680,55 @@ export default {
}
}
}
ul
{
text-align
:
center
;
li
{
list-style
:
none
;
&:first-child
{
padding-bottom
:
10px
;
}
}
}
.container
{
margin-top
:
10px
;
height
:
100%
;
.search-form
{
padding
:
20px
0
0
20px
;
}
.tabelList
{
margin-top
:
10px
;
height
:
100%
;
.left
{
height
:
100%
;
position
:
relative
;
border-right
:
1px
solid
#e8e8ea
;
}
.right
{
//
overflow
:
auto
;
.groupTitle
{
padding
:
20px
0
16px
19px
;
font-weight
:
600
;
}
.glsx-table
{
margin
:
0
20px
;
}
}
}
}
.btn-more
{
margin-left
:
10px
;
}
.material-content
{
display
:
flex
;
align-items
:
center
;
...
...
@@ -713,39 +742,49 @@ ul {
overflow
:
hidden
;
white-space
:
nowrap
;
}
img
{
width
:
36px
;
height
:
36px
;
}
}
.img-plus
{
width
:
200px
;
height
:
200px
;
}
.introduc-word
{
font-size
:
14px
;
margin-left
:
16px
;
color
:
#5850ff
;
}
.pdf-title
{
text-align
:
right
!important
;
}
/
deep
/
.el-table
.ascending
.sort-caret.ascending
{
border-bottom-color
:
#5850ff
;
}
/
deep
/
.el-table
.descending
.sort-caret.descending
{
border-top-color
:
#5850ff
;
}
.select-pro
{
display
:
inline-block
;
padding-bottom
:
20px
;
}
/
deep
/
.el-switch__core
{
width
:
32px
!important
;
}
/
deep
/
.el-table
::before
{
background-color
:
transparent
;
}
/
deep
/
.el-table__fixed-right
::before
{
background-color
:
transparent
;
}
...
...
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