Commit 29204cfa by 前端

恢复营销素材

1 parent e8ccf220
......@@ -3,7 +3,7 @@
<el-button class="add_btn" icon="el-icon-plus" :size="size" @click="handleAddGroup(1)">素材组</el-button>
<div class="all-group">
<div @click="getList">
<img src="@/assets/material/groupIcon.png" alt="" />
<img src="@/assets/material/groupIcon.png" alt=""/>
全部素材组 ({{ groupCounter.length }})
</div>
<div @click="groupVisible = !groupVisible">
......@@ -12,9 +12,10 @@
</div>
</div>
<ul v-show="groupVisible" :style="{ height: groupHeight - 110 + 'px' }">
<li class="group-list" v-for="(item, index) in groupCounter" :class="index === currentIndex ? 'active' : ''" :key="index" @click="handleGroup(item, index)">
<li class="group-list" v-for="(item, index) in groupCounter" :class="index === currentIndex ? 'active' : ''"
:key="index" @click="handleGroup(item, index)">
<div>
<img src="@/assets/material/file.png" alt="" style="vertical-align: middle;height:24px;width:24px" />
<img src="@/assets/material/file.png" alt="" style="vertical-align: middle;height:24px;width:24px"/>
<div class="group-name">{{ item.materialGroupName }}</div>
</div>
<div>
......@@ -23,12 +24,17 @@
<!-- <GLButton class="group-btn" :size="size" type="text" fn="置顶" @click="handleStick(item)">{{ item.orderTime ? '取消置顶' : '置顶' }}</GLButton>
<GLButton class="group-btn" :size="size" type="text" fn="修改" @click="handleAddGroup(2, item)">修改</GLButton>
<GLButton class="group-btn" :size="size" type="text" fn="删除" v-if="item.isDefault == -1" @click="handleDeleteGroup(item.id)">删除</GLButton> -->
<el-button class="group-btn" :size="size" type="text" fn="置顶" @click="handleStick(item)">{{ item.orderTime ? '取消置顶' : '置顶' }}</el-button>
<el-button class="group-btn" :size="size" type="text" fn="修改" @click="handleAddGroup(2, item)">修改</el-button>
<el-button class="group-btn" :size="size" type="text" fn="删除" v-if="item.isDefault == -1" @click="handleDeleteGroup(item.id)">删除</el-button>
<el-button class="group-btn" :size="size" type="text" fn="置顶" @click="handleStick(item)">
{{ item.orderTime ? '取消置顶' : '置顶' }}
</el-button>
<el-button class="group-btn" :size="size" type="text" fn="修改" @click="handleAddGroup(2, item)">修改
</el-button>
<el-button class="group-btn" :size="size" type="text" fn="删除" v-if="item.isDefault == -1"
@click="handleDeleteGroup(item.id)">删除
</el-button>
</div>
<div slot="reference">
<img class="more-icon" src="@/assets/material/more.png" alt="" />
<img class="more-icon" src="@/assets/material/more.png" alt=""/>
</div>
</el-popover>
</div>
......@@ -36,12 +42,11 @@
</ul>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
export default {
name: 'materialGroup',
props: { eventBus: Object, groupHeight: Number },
props: {eventBus: Object, groupHeight: Number},
data() {
return {
// 素材组数量
......@@ -102,6 +107,7 @@ export default {
params.groupId = item.id
params.pageNum = 1
params.pageSize = 1000
params.createdType = 2
this.$emit('getList', params, item)
},
// 打开1-新增, 2-编辑 素材组弹框
......@@ -133,7 +139,7 @@ export default {
cancelButtonText: '否',
type: 'warning'
}).then(() => {
this.$apis.material.deleteMaterialList({ id: rowId }).then(res => {
this.$apis.material.deleteMaterialList({id: rowId}).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : '操作失败',
type: res.code == '0' ? 'success' : 'error'
......@@ -176,13 +182,12 @@ export default {
}
}
</script>
<style lang="scss" scoped>
.status-words {
margin-left: 5px;
}
.material-group {
/deep/.el-popover {
/deep/ .el-popover {
min-width: 50px;
&:hover {
cursor: pointer;
......
......@@ -3,7 +3,6 @@
<div id="div-demo"></div>
</div>
</template>
<script>
import E from 'wangeditor'
export default {
......@@ -18,7 +17,7 @@ export default {
props: {
excludeMenus: {
type: Array,
default: () => ['code']
default: () => ['code','video']
},
boxHeight:{
type: Number,
......@@ -113,7 +112,6 @@ export default {
}
}
</script>
<style lang="scss" scoped>
#div-demo {
// margin: 16px 300px 0 0;
......
......@@ -106,7 +106,6 @@
<VideoShowDia ref="VideoShowDia" :dialogVisible="dialogVisibleImg"></VideoShowDia>
</div>
</template>
<script>
const materialStatus = {
'0': 'normal',
......@@ -120,7 +119,6 @@ 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: {
......@@ -140,7 +138,8 @@ export default {
materialType: '', // 素材类型
businessType: '', // 业务类型
status: '', // 状态
materialName: '' // 素材名称
materialName: '', // 素材名称
createdType:'2'
},
pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total'},
layout: 'sizes, prev, pager, next, jumper, ->, total',
......@@ -265,7 +264,7 @@ export default {
fn: '编辑'
},
listeners: {
click: row => this.addMaterial(2, row)
click: row => row.createdType == 1 ? this.addMaterial(3, row) : this.addMaterial(2, row)
}
},
{
......@@ -445,14 +444,12 @@ export default {
window.sessionStorage.setItem('firstLogin', 'true')
}
},
videoOpen(scope) {
console.log(scope)
this.dialogVisibleImg = true
let dialogSrc = scope.materialContentRpcResponse.materialUrl
this.$refs.VideoShowDia.init(dialogSrc)
},
// 重置
handleReset() {
this.searchForm = {
......@@ -460,7 +457,8 @@ export default {
materialType: '',
businessType: '',
status: '',
materialName: ''
materialName: '',
createdType:'2'
}
this.getListApi()
this.$refs.materialGroup.currentIndex = null
......@@ -532,7 +530,7 @@ export default {
addMaterial(addOrEdit, scope) {
var params = {
addOrEdit: addOrEdit,
$title: encodeURI(addOrEdit == 1 ? '创建营销素材' : '编辑营销素材')
$title: encodeURI(addOrEdit == 1 ? '创建营销素材' : addOrEdit == 2 ? '编辑营销素材' : '查看营销素材')
}
addOrEdit != 1 && (params.id = scope.id)
addOrEdit != 1 && (params.status = scope.status)
......@@ -558,13 +556,13 @@ export default {
let videoHtml = html.match(/<video.*?(?:>|\/>)/g)
if (imgHtml) {
let imgSrc = imgHtml[0].match('<img[^<>]*? src="([^<>]*?)"')
item.materialContentRpcResponse.materialUrl = imgSrc ? imgSrc[1] : ''
item.materialContentRpcResponse.materialUrl = imgSrc[1]
item.urlType = 'img'
item.imgCount = imgHtml.length
}
if (videoHtml) {
let videoSrc = videoHtml[0].match('<video[^<>]*? src="([^<>]*?)"')
item.materialContentRpcResponse.materialUrl = videoSrc ? videoSrc[1] : ''
item.materialContentRpcResponse.materialUrl = videoSrc[1]
item.urlType = 'video'
}
}
......@@ -625,7 +623,6 @@ export default {
}
}
</script>
<style lang="scss" scoped>
.videoMask {
position: absolute;
......@@ -636,43 +633,35 @@ 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;
......@@ -680,55 +669,44 @@ 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;
......@@ -742,49 +720,39 @@ 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;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!