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
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
84 additions
and
45 deletions
src/views/material/index.vue
src/views/material/index.vue
View file @
2c4b184
...
@@ -5,7 +5,9 @@
...
@@ -5,7 +5,9 @@
<i
class=
"el-icon-plus"
></i>
<i
class=
"el-icon-plus"
></i>
创建营销素材
创建营销素材
</el-button>
-->
</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>
</div>
<span
@
click=
"showIntroductionDialog"
class=
"introduc-word"
>
<span
@
click=
"showIntroductionDialog"
class=
"introduc-word"
>
功能介绍
功能介绍
...
@@ -13,59 +15,64 @@
...
@@ -13,59 +15,64 @@
</span>
</span>
<div
class=
"container"
>
<div
class=
"container"
>
<div
class=
"search-form"
>
<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>
<div
class=
"tabelList"
>
<div
class=
"tabelList"
>
<el-row>
<el-row>
<el-col
:span=
"5"
>
<el-col
:span=
"5"
>
<div
class=
"left"
>
<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>
</div>
</el-col>
</el-col>
<el-col
:span=
"19"
>
<el-col
:span=
"19"
>
<div
class=
"right"
:style=
"
{ height: boxHeight + 'px' }">
<div
class=
"right"
:style=
"
{ height: boxHeight + 'px' }">
<div
class=
"groupTitle"
>
{{
materialGroupName
}}
(共
{{
tableTotal
}}
条数据)
</div>
<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"
>
<div
slot=
"materialContentRpcResponse"
slot-scope=
"scope"
>
<span
class=
"hide-content"
>
{{
scope
.
scope
.
materialContentRpcResponse
.
materialName
}}
</span>
<span
class=
"hide-content"
>
{{
scope
.
scope
.
materialContentRpcResponse
.
materialName
}}
</span>
<!-- 素材为PDF -->
<!-- 素材为PDF -->
<!--
<span
v-if=
"scope.scope.materialType == 1"
class=
"material-content"
>
-->
<!--
<span
v-if=
"scope.scope.materialType == 1"
class=
"material-content"
>
-->
<!--
<img
src=
"@/assets/material/pdf.png"
style=
"margin-right:8px"
alt=
""
/>
-->
<!--
<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
"
>
-->
<!--
<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>
-->
<!--
<span
class=
"hide-content"
>
{{
scope
.
scope
.
materialContentRpcResponse
.
materialName
}}
</span>
-->
<!--
</el-tooltip>
-->
<!--
</el-tooltip>
-->
<!--
</span>
-->
<!--
</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"
>
-->
<!--
<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'"
>
-->
<!--
<el-popover
placement=
"top"
trigger=
"hover"
v-if=
"scope.scope.urlType == 'img'"
>
-->
<!--
<div>
-->
<!--
<div>
-->
<!--
<img
class=
"img-plus"
:src=
"scope.scope.materialContentRpcResponse.materialUrl"
alt=
""
/>
-->
<!--
<img
class=
"img-plus"
:src=
"scope.scope.materialContentRpcResponse.materialUrl"
alt=
""
/>
-->
<!--
</div>
-->
<!--
</div>
-->
<!--
<div
slot=
"reference"
class=
"urlContent"
>
-->
<!--
<div
slot=
"reference"
class=
"urlContent"
>
-->
<!--
<img
style=
"margin-right:8px"
:src=
"scope.scope.materialContentRpcResponse.materialUrl"
alt=
""
/>
-->
<!--
<img
style=
"margin-right:8px"
:src=
"scope.scope.materialContentRpcResponse.materialUrl"
alt=
""
/>
-->
<!--
<div
class=
"videoMask"
v-if=
"scope.scope.imgCount > 1"
>
-->
<!--
<div
class=
"videoMask"
v-if=
"scope.scope.imgCount > 1"
>
-->
<!--
<img
src=
"@/assets/material/multi.png"
alt=
""
/>
-->
<!--
<img
src=
"@/assets/material/multi.png"
alt=
""
/>
-->
<!--
<span>
{{
scope
.
scope
.
imgCount
}}
</span>
-->
<!--
<span>
{{
scope
.
scope
.
imgCount
}}
</span>
-->
<!--
</div>
-->
<!--
</div>
-->
<!--
</div>
-->
<!--
</div>
-->
<!--
</el-popover>
-->
<!--
</el-popover>
-->
<!-- 视频 -->
<!-- 视频 -->
<!--
<div
class=
"urlContent"
v-if=
"scope.scope.urlType == 'video'"
@
click=
"videoOpen(scope.scope)"
>
-->
<!--
<div
class=
"urlContent"
v-if=
"scope.scope.urlType == 'video'"
@
click=
"videoOpen(scope.scope)"
>
-->
<!--
<video
preload
loop
muted
width=
"36"
height=
"36"
>
-->
<!--
<video
preload
loop
muted
width=
"36"
height=
"36"
>
-->
<!--
<source
:src=
"scope.scope.materialContentRpcResponse.materialUrl"
type=
"video/mp4"
/>
-->
<!--
<source
:src=
"scope.scope.materialContentRpcResponse.materialUrl"
type=
"video/mp4"
/>
-->
<!--
</video>
-->
<!--
</video>
-->
<!--
<div
class=
"videoMask"
>
-->
<!--
<div
class=
"videoMask"
>
-->
<!--
<img
src=
"@/assets/material/videoIcon.png"
style=
"width: 22px;height: 22px;"
alt=
""
/>
-->
<!--
<img
src=
"@/assets/material/videoIcon.png"
style=
"width: 22px;height: 22px;"
alt=
""
/>
-->
<!--
</div>
-->
<!--
</div>
-->
<!--
</div>
-->
<!--
</div>
-->
<!--
<el-tooltip
effect=
"dark"
placement=
"top"
:content=
"scope.scope.materialContentRpcResponse.materialName"
:disabled=
"scope.scope.materialContentRpcResponse.materialName.length
< 14
"
>
-->
<!--
<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>
-->
<!--
<span
class=
"hide-content"
>
{{
scope
.
scope
.
materialContentRpcResponse
.
materialName
}}
</span>
-->
<!--
</el-tooltip>
-->
<!--
</el-tooltip>
-->
<!--
</span>
-->
<!--
</span>
-->
</div>
</div>
<!-- 状态 -->
<!-- 状态 -->
<div
slot=
"status"
class=
"dot"
slot-scope=
"scope"
>
<div
slot=
"status"
class=
"dot"
slot-scope=
"scope"
>
...
@@ -92,8 +99,10 @@
...
@@ -92,8 +99,10 @@
</el-row>
</el-row>
</div>
</div>
</div>
</div>
<AddMaterialGroupDia
:businessTypes=
"businessTypes"
ref=
"addMaterialGroup"
:dialogVisible=
"materialGroupDialog"
:eventBus=
"eventBus"
></AddMaterialGroupDia>
<AddMaterialGroupDia
:businessTypes=
"businessTypes"
ref=
"addMaterialGroup"
:dialogVisible=
"materialGroupDialog"
<FunctionIntroduc
:introductionDialog=
"introductionDialog"
@
closeIntroductDia=
"closeIntroductDia"
></FunctionIntroduc>
:eventBus=
"eventBus"
></AddMaterialGroupDia>
<FunctionIntroduc
:introductionDialog=
"introductionDialog"
@
closeIntroductDia=
"closeIntroductDia"
></FunctionIntroduc>
<VideoShowDia
ref=
"VideoShowDia"
:dialogVisible=
"dialogVisibleImg"
></VideoShowDia>
<VideoShowDia
ref=
"VideoShowDia"
:dialogVisible=
"dialogVisibleImg"
></VideoShowDia>
</div>
</div>
</
template
>
</
template
>
...
@@ -111,6 +120,7 @@ import AddMaterialGroupDia from '@/views/material/components/addMaterialGroupDia
...
@@ -111,6 +120,7 @@ import AddMaterialGroupDia from '@/views/material/components/addMaterialGroupDia
import
MaterialGroup
from
'@/views/material/components/materialGroup'
import
MaterialGroup
from
'@/views/material/components/materialGroup'
import
FunctionIntroduc
from
'@/views/material/components/functionIntroduc'
import
FunctionIntroduc
from
'@/views/material/components/functionIntroduc'
import
VideoShowDia
from
'./components/videoDia.vue'
import
VideoShowDia
from
'./components/videoDia.vue'
export
default
{
export
default
{
name
:
'materialList'
,
name
:
'materialList'
,
components
:
{
components
:
{
...
@@ -132,7 +142,7 @@ export default {
...
@@ -132,7 +142,7 @@ export default {
status
:
''
,
// 状态
status
:
''
,
// 状态
materialName
:
''
// 素材名称
materialName
:
''
// 素材名称
},
},
pageConf
:
{
pageSize
:
'pageSize'
,
pageNum
:
'pageNum'
,
totalCount
:
'total'
},
pageConf
:
{
pageSize
:
'pageSize'
,
pageNum
:
'pageNum'
,
totalCount
:
'total'
},
layout
:
'sizes, prev, pager, next, jumper, ->, total'
,
layout
:
'sizes, prev, pager, next, jumper, ->, total'
,
// 表格数据
// 表格数据
materialTableData
:
[],
materialTableData
:
[],
...
@@ -147,7 +157,7 @@ export default {
...
@@ -147,7 +157,7 @@ export default {
businessTypes
:
[],
businessTypes
:
[],
// 素材组名称
// 素材组名称
materialGroupName
:
''
,
materialGroupName
:
''
,
changeName
:
'编辑'
,
changeName
:
'编辑'
,
materialFormData
:
[
materialFormData
:
[
{
{
label
:
'业务类型'
,
label
:
'业务类型'
,
...
@@ -313,7 +323,7 @@ export default {
...
@@ -313,7 +323,7 @@ export default {
formatter
:
cellVal
=>
{
formatter
:
cellVal
=>
{
return
cellVal
.
sendNum
return
cellVal
.
sendNum
},
},
renderHeader
:
(
h
,
{
column
,
$index
})
=>
{
renderHeader
:
(
h
,
{
column
,
$index
})
=>
{
return
h
(
return
h
(
'div'
,
'div'
,
{
{
...
@@ -361,7 +371,7 @@ export default {
...
@@ -361,7 +371,7 @@ export default {
formatter
:
cellVal
=>
{
formatter
:
cellVal
=>
{
return
cellVal
.
readNum
return
cellVal
.
readNum
},
},
renderHeader
:
(
h
,
{
column
,
$index
})
=>
{
renderHeader
:
(
h
,
{
column
,
$index
})
=>
{
return
h
(
return
h
(
'div'
,
'div'
,
{
{
...
@@ -516,7 +526,7 @@ export default {
...
@@ -516,7 +526,7 @@ export default {
},
},
// 素材删除
// 素材删除
handleDelete
(
scope
)
{
handleDelete
(
scope
)
{
this
.
secondConfirm
(
'提示'
,
'删除素材,该素材将不再可以使用,是否继续删除?'
,
'material'
,
'materialDelete'
,
{
id
:
scope
.
id
})
this
.
secondConfirm
(
'提示'
,
'删除素材,该素材将不再可以使用,是否继续删除?'
,
'material'
,
'materialDelete'
,
{
id
:
scope
.
id
})
},
},
// 1-新增素材,2-编辑素材
// 1-新增素材,2-编辑素材
addMaterial
(
addOrEdit
,
scope
)
{
addMaterial
(
addOrEdit
,
scope
)
{
...
@@ -548,13 +558,13 @@ export default {
...
@@ -548,13 +558,13 @@ export default {
let
videoHtml
=
html
.
match
(
/<video.*
?(?:
>|
\/
>
)
/g
)
let
videoHtml
=
html
.
match
(
/<video.*
?(?:
>|
\/
>
)
/g
)
if
(
imgHtml
)
{
if
(
imgHtml
)
{
let
imgSrc
=
imgHtml
[
0
].
match
(
'<img[^<>]*? src="([^<>]*?)"'
)
let
imgSrc
=
imgHtml
[
0
].
match
(
'<img[^<>]*? src="([^<>]*?)"'
)
item
.
materialContentRpcResponse
.
materialUrl
=
imgSrc
[
1
]
item
.
materialContentRpcResponse
.
materialUrl
=
imgSrc
?
imgSrc
[
1
]
:
''
item
.
urlType
=
'img'
item
.
urlType
=
'img'
item
.
imgCount
=
imgHtml
.
length
item
.
imgCount
=
imgHtml
.
length
}
}
if
(
videoHtml
)
{
if
(
videoHtml
)
{
let
videoSrc
=
videoHtml
[
0
].
match
(
'<video[^<>]*? src="([^<>]*?)"'
)
let
videoSrc
=
videoHtml
[
0
].
match
(
'<video[^<>]*? src="([^<>]*?)"'
)
item
.
materialContentRpcResponse
.
materialUrl
=
videoSrc
[
1
]
item
.
materialContentRpcResponse
.
materialUrl
=
videoSrc
?
videoSrc
[
1
]
:
''
item
.
urlType
=
'video'
item
.
urlType
=
'video'
}
}
}
}
...
@@ -626,35 +636,43 @@ export default {
...
@@ -626,35 +636,43 @@ export default {
right
:
0
;
right
:
0
;
width
:
100%
;
width
:
100%
;
height
:
100%
;
height
:
100%
;
img
{
img
{
position
:
relative
;
position
:
relative
;
align-self
:
center
;
align-self
:
center
;
margin
:
auto
;
margin
:
auto
;
}
}
span
{
span
{
position
:
absolute
;
position
:
absolute
;
top
:
12px
;
top
:
12px
;
right
:
15px
;
right
:
15px
;
}
}
}
}
.urlContent
{
.urlContent
{
margin-right
:
8px
;
margin-right
:
8px
;
position
:
relative
;
position
:
relative
;
width
:
36px
;
width
:
36px
;
height
:
36px
;
height
:
36px
;
}
}
.search-form
,
.search-form
,
.left
,
.left
,
.right
{
.right
{
background-color
:
#fff
;
background-color
:
#fff
;
}
}
.el-popover
{
.el-popover
{
min-width
:
100px
;
min-width
:
100px
;
}
}
.main-container
{
.main-container
{
height
:
100%
;
height
:
100%
;
.top
{
.top
{
display
:
inline-flex
;
display
:
inline-flex
;
span
{
span
{
margin-left
:
16px
;
margin-left
:
16px
;
font-size
:
16px
;
font-size
:
16px
;
...
@@ -662,44 +680,55 @@ export default {
...
@@ -662,44 +680,55 @@ export default {
}
}
}
}
}
}
ul
{
ul
{
text-align
:
center
;
text-align
:
center
;
li
{
li
{
list-style
:
none
;
list-style
:
none
;
&:first-child
{
&:first-child
{
padding-bottom
:
10px
;
padding-bottom
:
10px
;
}
}
}
}
}
}
.container
{
.container
{
margin-top
:
10px
;
margin-top
:
10px
;
height
:
100%
;
height
:
100%
;
.search-form
{
.search-form
{
padding
:
20px
0
0
20px
;
padding
:
20px
0
0
20px
;
}
}
.tabelList
{
.tabelList
{
margin-top
:
10px
;
margin-top
:
10px
;
height
:
100%
;
height
:
100%
;
.left
{
.left
{
height
:
100%
;
height
:
100%
;
position
:
relative
;
position
:
relative
;
border-right
:
1px
solid
#e8e8ea
;
border-right
:
1px
solid
#e8e8ea
;
}
}
.right
{
.right
{
//
overflow
:
auto
;
//
overflow
:
auto
;
.groupTitle
{
.groupTitle
{
padding
:
20px
0
16px
19px
;
padding
:
20px
0
16px
19px
;
font-weight
:
600
;
font-weight
:
600
;
}
}
.glsx-table
{
.glsx-table
{
margin
:
0
20px
;
margin
:
0
20px
;
}
}
}
}
}
}
}
}
.btn-more
{
.btn-more
{
margin-left
:
10px
;
margin-left
:
10px
;
}
}
.material-content
{
.material-content
{
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
...
@@ -713,39 +742,49 @@ ul {
...
@@ -713,39 +742,49 @@ ul {
overflow
:
hidden
;
overflow
:
hidden
;
white-space
:
nowrap
;
white-space
:
nowrap
;
}
}
img
{
img
{
width
:
36px
;
width
:
36px
;
height
:
36px
;
height
:
36px
;
}
}
}
}
.img-plus
{
.img-plus
{
width
:
200px
;
width
:
200px
;
height
:
200px
;
height
:
200px
;
}
}
.introduc-word
{
.introduc-word
{
font-size
:
14px
;
font-size
:
14px
;
margin-left
:
16px
;
margin-left
:
16px
;
color
:
#5850ff
;
color
:
#5850ff
;
}
}
.pdf-title
{
.pdf-title
{
text-align
:
right
!important
;
text-align
:
right
!important
;
}
}
/
deep
/
.el-table
.ascending
.sort-caret.ascending
{
/
deep
/
.el-table
.ascending
.sort-caret.ascending
{
border-bottom-color
:
#5850ff
;
border-bottom-color
:
#5850ff
;
}
}
/
deep
/
.el-table
.descending
.sort-caret.descending
{
/
deep
/
.el-table
.descending
.sort-caret.descending
{
border-top-color
:
#5850ff
;
border-top-color
:
#5850ff
;
}
}
.select-pro
{
.select-pro
{
display
:
inline-block
;
display
:
inline-block
;
padding-bottom
:
20px
;
padding-bottom
:
20px
;
}
}
/
deep
/
.el-switch__core
{
/
deep
/
.el-switch__core
{
width
:
32px
!important
;
width
:
32px
!important
;
}
}
/
deep
/
.el-table
::before
{
/
deep
/
.el-table
::before
{
background-color
:
transparent
;
background-color
:
transparent
;
}
}
/
deep
/
.el-table__fixed-right
::before
{
/
deep
/
.el-table__fixed-right
::before
{
background-color
:
transparent
;
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