|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
<el-tabs v-model="activeTab" @tab-click="handleClick">
|
|
|
- <el-tab-pane v-for="item in tabs" :key="item.id" :label="item.name" :name="item.id.toString()" />
|
|
|
+ <el-tab-pane v-for="item in tabs" :key="item.id" :label="item.name" :name="item.tabIndex.toString()" />
|
|
|
</el-tabs>
|
|
|
|
|
|
<!-- 内容 -->
|
|
@@ -32,7 +32,8 @@
|
|
|
<el-form label-width="auto" v-for="(item, index) in timeList" :key="item.id">
|
|
|
<el-form-item label-width="0">
|
|
|
<span style="font-weight: bold">场景电台时间设置</span>
|
|
|
- <el-link icon="el-icon-close" :underline="false" style="float:right" @click="getChangeTime(item.id, 2)" />
|
|
|
+ <el-link icon="el-icon-close" :underline="false" style="float:right" @click="getChangeTime(item.id, 2)"
|
|
|
+ v-hasPermi="['operation:recommend:delete']" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="时间段:">
|
|
|
<el-time-picker is-range v-model="item.date" start-placeholder="开始时间" end-placeholder="结束时间"
|
|
@@ -55,7 +56,7 @@
|
|
|
v-hasPermi="['operation:recommend:down']">下架</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
- <el-button type="primary" style="margin-left: 30px" @click="getAdd"
|
|
|
+ <el-button type="primary" style="margin-left: 30px" @click="getAddTime"
|
|
|
v-hasPermi="['operation:recommend:add']">新增</el-button>
|
|
|
</div>
|
|
|
|
|
@@ -70,8 +71,8 @@
|
|
|
<div v-else :style="{ 'display': tabIndex === 1 && active === 0 ? 'inline-block' : 'block' }">
|
|
|
<el-form label-width="auto" v-for="(item, index) in list" :key="item.id">
|
|
|
<el-form-item label-width="0" :label="(index + 1).toString()">
|
|
|
- <el-link v-if="tabIndex === 2 && active === 1" icon="el-icon-close" :underline="false" style="float:right"
|
|
|
- @click="getRemoveList(item, index)" />
|
|
|
+ <el-link v-if="close()" icon="el-icon-close" :underline="false" style="float:right"
|
|
|
+ @click="getRemoveList(item, index)" v-hasPermi="['operation:recommend:delete']" />
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="时间:" v-if="time()">
|
|
@@ -84,19 +85,25 @@
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="模式:" v-if="model()">
|
|
|
- <el-select v-model="item.model" placeholder="请选择模式">
|
|
|
+ <el-select v-model="item.model" placeholder="请选择模式" @change="getModel(item)">
|
|
|
<el-option v-for="item in contentOptions" :key="item.value" :label="item.label"
|
|
|
:value="Number(item.value)" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="跳转方式:" v-if="forwardType()">
|
|
|
- <el-select v-model="item.forwardType" placeholder="请选择跳转方式">
|
|
|
+ <el-select v-model="item.forwardType" placeholder="请选择跳转方式" @change="getForwardType(item)">
|
|
|
<el-option v-for="item in typeOptions" :key="item.value" :label="item.label"
|
|
|
:value="Number(item.value)" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
|
|
|
+ <el-form-item label="专区页面:" v-if="forwardType() && item.forwardType === 7">
|
|
|
+ <el-select v-model="item.contentId" placeholder="请选择跳转专区">
|
|
|
+ <el-option v-for="item in sceneOptions" :key="item.value" :value="item.value" :label="item.label" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
<el-form-item label="内容:" v-if="contentName(item)">
|
|
|
<el-input v-model="item.contentName" prefix-icon="el-icon-search" placeholder="选择内容"
|
|
|
@focus="getDialog(index)" />
|
|
@@ -121,7 +128,7 @@
|
|
|
<Upload listType="picture-card" :url="item.pic" @upload="getUpload($event, index)" />
|
|
|
</el-form-item>
|
|
|
|
|
|
- <el-form-item label="排序:" v-if="tabIndex === 2 && active === 1">
|
|
|
+ <el-form-item label="排序:" v-if="sort()">
|
|
|
<el-input-number v-model="item.sort" />
|
|
|
</el-form-item>
|
|
|
|
|
@@ -153,7 +160,7 @@
|
|
|
v-hasPermi="['operation:recommend:down']">下架</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
- <el-button v-if="tabIndex === 2 && active === 1" type="primary" style="margin-left: 30px" @click="getAdd"
|
|
|
+ <el-button v-if="add()" type="primary" style="margin-left: 30px" @click="getAdd"
|
|
|
v-hasPermi="['operation:recommend:add']">新增</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -227,14 +234,11 @@ import {
|
|
|
expandSave,
|
|
|
removeList
|
|
|
} from '@/api/operation/recommend'
|
|
|
-import Upload from '@/components/Upload/index'
|
|
|
import { isFreeMixin, audioMixin, platformMixin, onOrOffMixin, coverMixin } from '@/mixin/index'
|
|
|
+import { list } from '@/api/operation/scene'
|
|
|
|
|
|
export default {
|
|
|
mixins: [isFreeMixin, audioMixin, platformMixin, onOrOffMixin, coverMixin],
|
|
|
- components: {
|
|
|
- Upload
|
|
|
- },
|
|
|
data() {
|
|
|
return {
|
|
|
// 遮罩层
|
|
@@ -242,19 +246,21 @@ export default {
|
|
|
// 分类列表
|
|
|
tabs: [],
|
|
|
// 选中分类
|
|
|
- activeTab: '77',
|
|
|
+ activeTab: '1',
|
|
|
// 分类排序
|
|
|
tabIndex: 1,
|
|
|
+ categoryId: '77',
|
|
|
// 模板列表
|
|
|
module: [],
|
|
|
// 模板图
|
|
|
imgOptions: {
|
|
|
- '0': require('@/assets/images/operation/recommend.svg'),
|
|
|
- '1': require('@/assets/images/operation/radio.svg'),
|
|
|
- '2': require('@/assets/images/operation/music.svg'),
|
|
|
- '3': require('@/assets/images/operation/story.svg'),
|
|
|
- '4': require('@/assets/images/operation/kid.svg'),
|
|
|
- '5': require('@/assets/images/operation/other.svg')
|
|
|
+ '1': require('@/assets/images/operation/recommend.svg'),
|
|
|
+ '2': require('@/assets/images/operation/radio.svg'),
|
|
|
+ '3': require('@/assets/images/operation/music.svg'),
|
|
|
+ '4': require('@/assets/images/operation/story.svg'),
|
|
|
+ '5': require('@/assets/images/operation/kid.svg'),
|
|
|
+ '6': require('@/assets/images/operation/other.svg'),
|
|
|
+ '7': require('@/assets/images/operation/kugou.png')
|
|
|
},
|
|
|
img: require('@/assets/images/operation/recommend.svg'),
|
|
|
// 选中模块
|
|
@@ -327,6 +333,13 @@ export default {
|
|
|
{ top: 1885, height: 385 },
|
|
|
{ top: 2480, height: 390 },
|
|
|
{ top: 2875, height: 590 }
|
|
|
+ ],
|
|
|
+ '7': [
|
|
|
+ { top: 130, height: 160 },
|
|
|
+ { top: 375, height: 205 },
|
|
|
+ { top: 585, height: 205 },
|
|
|
+ { top: 800, height: 150 },
|
|
|
+ { top: 960, height: 300 }
|
|
|
]
|
|
|
},
|
|
|
active: 0,
|
|
@@ -367,9 +380,13 @@ export default {
|
|
|
type: 8
|
|
|
}, {
|
|
|
value: 4,
|
|
|
- label: 'APP内打开节目',
|
|
|
+ label: 'APP内容跳转节目',
|
|
|
type: 6
|
|
|
}, {
|
|
|
+ value: 7,
|
|
|
+ label: 'APP内容跳转专区',
|
|
|
+ type: 16
|
|
|
+ }, {
|
|
|
value: 5,
|
|
|
label: 'H5内链'
|
|
|
}, {
|
|
@@ -382,7 +399,9 @@ export default {
|
|
|
}, {
|
|
|
value: 1,
|
|
|
label: '手动推荐内容'
|
|
|
- }]
|
|
|
+ }],
|
|
|
+ // 专区
|
|
|
+ sceneOptions: []
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
@@ -398,6 +417,7 @@ export default {
|
|
|
},
|
|
|
mounted() {
|
|
|
this.getTab()
|
|
|
+ this.getSceneList()
|
|
|
},
|
|
|
methods: {
|
|
|
// 分类列表
|
|
@@ -405,7 +425,7 @@ export default {
|
|
|
listAll().then(res => {
|
|
|
if (res.code === 0) {
|
|
|
this.tabs = res.data
|
|
|
- this.getModule(this.activeTab)
|
|
|
+ this.getModule(this.categoryId)
|
|
|
this.getTimeList()
|
|
|
}
|
|
|
})
|
|
@@ -413,13 +433,13 @@ export default {
|
|
|
|
|
|
// 切换分类
|
|
|
handleClick(e) {
|
|
|
- this.activeTab = this.tabs[e.index].id.toString()
|
|
|
- this.tabIndex = this.tabs[e.index].tabIndex
|
|
|
- e.index >= 5 ? e.index = 5 : e.index
|
|
|
- this.img = this.imgOptions[e.index]
|
|
|
+ this.activeTab = e.name
|
|
|
+ this.tabIndex = Number(e.name)
|
|
|
+ this.categoryId = this.tabs[e.index].id
|
|
|
+ this.img = this.imgOptions[e.name]
|
|
|
this.active = 0
|
|
|
this.list = []
|
|
|
- this.getModule(this.activeTab)
|
|
|
+ this.getModule(this.categoryId)
|
|
|
},
|
|
|
|
|
|
// 模块列表
|
|
@@ -503,7 +523,16 @@ export default {
|
|
|
|
|
|
// 内容列表提交
|
|
|
getSubmit(item) {
|
|
|
- if (this.tabIndex === 2 && this.active === 1) {
|
|
|
+ let rules = {
|
|
|
+ '1': this.active === 1,
|
|
|
+ '2': this.active === 1,
|
|
|
+ '3': this.active === 0,
|
|
|
+ '7': this.active !== 3
|
|
|
+ }
|
|
|
+ item.startTime = item.date[0]
|
|
|
+ item.endTime = item.date[1]
|
|
|
+ delete item.date
|
|
|
+ if (rules[this.tabIndex]) {
|
|
|
expandSave(item).then(res => {
|
|
|
if (res.code === 0) {
|
|
|
this.$message.success('提交成功!')
|
|
@@ -511,9 +540,6 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
} else {
|
|
|
- item.startTime = item.date[0]
|
|
|
- item.endTime = item.date[1]
|
|
|
- delete item.date
|
|
|
submit(item).then(res => {
|
|
|
if (res.code === 0) {
|
|
|
this.$message.success('提交成功!')
|
|
@@ -538,10 +564,7 @@ export default {
|
|
|
this.form.audioType = this.audioOptions[0].value
|
|
|
} else {
|
|
|
this.form.audioType = this.list[index].forwardType ? this.typeOptions.find(i => i.value === this.list[index].forwardType).type : 2
|
|
|
- // await this.getPlatform({
|
|
|
- // audioType: this.form.audioType
|
|
|
- // })
|
|
|
- this.disabled = this.tabIndex == 2 && this.active === 1 || this.list[index].forwardType !== null ? true : false
|
|
|
+ this.disabled = this.tabIndex === 2 && this.active === 1 || this.list[index].forwardType !== null ? true : false
|
|
|
}
|
|
|
this.getContentList()
|
|
|
},
|
|
@@ -680,15 +703,17 @@ export default {
|
|
|
},
|
|
|
|
|
|
// 新增时间段
|
|
|
+ getAddTime() {
|
|
|
+ this.timeList.push({})
|
|
|
+ },
|
|
|
+
|
|
|
+ // 新增列表
|
|
|
getAdd() {
|
|
|
- if (this.tabIndex === 2 && this.active === 1) {
|
|
|
- this.list.push({
|
|
|
- moduleId: this.module[this.active].id,
|
|
|
- childList: []
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.timeList.push({})
|
|
|
- }
|
|
|
+ this.list.push({
|
|
|
+ moduleId: this.module[this.active].id,
|
|
|
+ childList: [],
|
|
|
+ forwardType: null
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
// 上下架 / 删除时间段
|
|
@@ -710,6 +735,30 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
|
|
|
+ // 监听模式模块
|
|
|
+ getModel(item) {
|
|
|
+ item.isCustom = item.model === 0 ? 1 : 0
|
|
|
+ },
|
|
|
+
|
|
|
+ // 监听跳转方式
|
|
|
+ getForwardType(item) {
|
|
|
+ item.contentType = item.forwardType === 7 ? 16 : null
|
|
|
+ },
|
|
|
+
|
|
|
+ // 爱听专区
|
|
|
+ getSceneList() {
|
|
|
+ list().then(res => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ res.data.map(i => {
|
|
|
+ this.sceneOptions.push({
|
|
|
+ value: i.id,
|
|
|
+ label: i.name
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
// 字典翻译
|
|
|
audioFormatter(row) {
|
|
|
return this.selectDictLabel(this.audioOptions, row.audioType)
|
|
@@ -730,7 +779,8 @@ export default {
|
|
|
'3': [2, 4, 6, 7, 8, 9].includes(this.active),
|
|
|
'4': [2, 4, 6, 8, 9, 10, 11].includes(this.active),
|
|
|
'5': [2, 4, 5, 6, 7].includes(this.active),
|
|
|
- '6': [2, 3, 5, 7, 8, 9].includes(this.active)
|
|
|
+ '6': [2, 3, 5, 7, 8, 9].includes(this.active),
|
|
|
+ '7': ![0].includes(this.active)
|
|
|
}
|
|
|
return rules[this.tabIndex]
|
|
|
},
|
|
@@ -738,11 +788,22 @@ export default {
|
|
|
// 标签模块
|
|
|
label() {
|
|
|
let rules = {
|
|
|
- '2': this.tabIndex === 2 && this.active === 2,
|
|
|
- '3': this.tabIndex === 3 && this.active === 1,
|
|
|
- '4': [1, 5].includes(this.active) && this.tabIndex === 4,
|
|
|
- '5': [1, 3].includes(this.active) && this.tabIndex === 5,
|
|
|
- '6': [1, 4].includes(this.active) && this.tabIndex === 6
|
|
|
+ '2': this.active === 2,
|
|
|
+ '3': this.active === 1,
|
|
|
+ '4': [1, 5].includes(this.active),
|
|
|
+ '5': [1, 3].includes(this.active),
|
|
|
+ '6': [1, 4].includes(this.active),
|
|
|
+ }
|
|
|
+ return rules[this.tabIndex]
|
|
|
+ },
|
|
|
+
|
|
|
+ // 删除按钮
|
|
|
+ close() {
|
|
|
+ let rules = {
|
|
|
+ '1': [1].includes(this.active),
|
|
|
+ '2': [0, 1].includes(this.active),
|
|
|
+ '3': [0].includes(this.active),
|
|
|
+ '7': ![3].includes(this.active)
|
|
|
}
|
|
|
return rules[this.tabIndex]
|
|
|
},
|
|
@@ -752,10 +813,11 @@ export default {
|
|
|
let rules = {
|
|
|
'1': ![3, 8].includes(this.active),
|
|
|
'2': [0, 3].includes(this.active),
|
|
|
- '3': this.active !== 1,
|
|
|
- '4': this.active !== 1 || this.active !== 5,
|
|
|
- '5': this.active !== 1 || this.active !== 3,
|
|
|
- '6': this.active !== 1 || this.active !== 4
|
|
|
+ '3': ![1].includes(this.active),
|
|
|
+ '4': ![1, 5].includes(this.active),
|
|
|
+ '5': ![1, 3].includes(this.active),
|
|
|
+ '6': ![1, 4].includes(this.active),
|
|
|
+ '7': [0, 1, 2, 3, 4].includes(this.active)
|
|
|
}
|
|
|
return rules[this.tabIndex]
|
|
|
},
|
|
@@ -763,8 +825,8 @@ export default {
|
|
|
// 标题
|
|
|
title() {
|
|
|
let rules = {
|
|
|
- '1': this.active === 10,
|
|
|
- '2': this.active === 1,
|
|
|
+ '1': [10].includes(this.active),
|
|
|
+ '2': [1].includes(this.active),
|
|
|
'3': [3, 5, 9].includes(this.active),
|
|
|
'4': [7].includes(this.active),
|
|
|
'5': [5].includes(this.active)
|
|
@@ -780,7 +842,8 @@ export default {
|
|
|
'3': [4, 7, 8].includes(this.active),
|
|
|
'4': [2, 4, 6, 8, 9, 10, 11].includes(this.active),
|
|
|
'5': [2, 4, 6, 7].includes(this.active),
|
|
|
- '6': [2, 3, 5, 7, 8, 9].includes(this.active)
|
|
|
+ '6': [2, 3, 5, 7, 8, 9].includes(this.active),
|
|
|
+ '7': [4].includes(this.active)
|
|
|
}
|
|
|
return rules[this.tabIndex]
|
|
|
},
|
|
@@ -793,7 +856,8 @@ export default {
|
|
|
'3': [0].includes(this.active),
|
|
|
'4': [0, 3].includes(this.active),
|
|
|
'5': [0].includes(this.active),
|
|
|
- '6': [0].includes(this.active)
|
|
|
+ '6': [0].includes(this.active),
|
|
|
+ '7': [0].includes(this.active)
|
|
|
}
|
|
|
return rules[this.tabIndex]
|
|
|
},
|
|
@@ -805,7 +869,8 @@ export default {
|
|
|
'3': [2, 3, 5, 6, 9].includes(this.active),
|
|
|
'4': [7].includes(this.active),
|
|
|
'5': [5].includes(this.active),
|
|
|
- '6': [6].includes(this.active)
|
|
|
+ '6': [6].includes(this.active),
|
|
|
+ '7': ![0, 4].includes(this.active)
|
|
|
}
|
|
|
return rules[this.tabIndex] || [0, 1, 2, 3, 4].includes(item.forwardType) || item.model === 1
|
|
|
},
|
|
@@ -813,11 +878,12 @@ export default {
|
|
|
// 简介
|
|
|
description(item) {
|
|
|
let rules = {
|
|
|
- '1': (this.active === 7 && item.model === 1) || this.active === 10,
|
|
|
- '3': [3, 5].includes(this.active) || [4, 7, 8].includes(this.active) && item.model === 1,
|
|
|
- '4': [7].includes(this.active)
|
|
|
+ '1': [7, 10].includes(this.active),
|
|
|
+ '3': [3, 4, 5, 7, 8].includes(this.active),
|
|
|
+ '4': [7].includes(this.active),
|
|
|
+ '7': [3].includes(this.active)
|
|
|
}
|
|
|
- return rules[this.tabIndex]
|
|
|
+ return rules[this.tabIndex] || item.model === 1
|
|
|
},
|
|
|
|
|
|
// 跳转连接
|
|
@@ -829,7 +895,7 @@ export default {
|
|
|
isCustom(item) {
|
|
|
let rules = {
|
|
|
'1': [0, 8].includes(this.active),
|
|
|
- '5': [5].includes(this.active),
|
|
|
+ '5': [5].includes(this.active)
|
|
|
}
|
|
|
return rules[this.tabIndex] || item.model === 1
|
|
|
},
|
|
@@ -837,19 +903,42 @@ export default {
|
|
|
// 图片
|
|
|
pic(item) {
|
|
|
let rules = {
|
|
|
- '1': [1, 2, 6, 8, 10, 12].includes(this.active),
|
|
|
+ '1': [1, 2, 6, 10, 12].includes(this.active),
|
|
|
'2': [0, 1].includes(this.active),
|
|
|
'3': [0, 2, 3, 5, 6, 9].includes(this.active),
|
|
|
'4': [0, 3, 7].includes(this.active),
|
|
|
'5': [0, 5].includes(this.active),
|
|
|
- '6': [0, 6].includes(this.active)
|
|
|
+ '6': [0, 6].includes(this.active),
|
|
|
+ '7': ![4].includes(this.active)
|
|
|
}
|
|
|
return rules[this.tabIndex] || item.isCustom === 0
|
|
|
},
|
|
|
|
|
|
+ // 排序
|
|
|
+ sort() {
|
|
|
+ let rules = {
|
|
|
+ '1': [1].includes(this.active),
|
|
|
+ '2': [0, 1].includes(this.active),
|
|
|
+ '3': [0].includes(this.active),
|
|
|
+ '7': ![3].includes(this.active)
|
|
|
+ }
|
|
|
+ return rules[this.tabIndex]
|
|
|
+ },
|
|
|
+
|
|
|
// 列表
|
|
|
isList() {
|
|
|
return this.tabIndex === 2 && this.active === 1
|
|
|
+ },
|
|
|
+
|
|
|
+ // 新增
|
|
|
+ add() {
|
|
|
+ let rules = {
|
|
|
+ '1': [1].includes(this.active),
|
|
|
+ '2': [0, 1].includes(this.active),
|
|
|
+ '3': [0].includes(this.active),
|
|
|
+ '7': ![3].includes(this.active)
|
|
|
+ }
|
|
|
+ return rules[this.tabIndex]
|
|
|
}
|
|
|
}
|
|
|
}
|