Commit 29204cfa by 前端

恢复营销素材

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