|
@@ -8,7 +8,7 @@
|
|
|
<div style="display: flex; position: relative; align-items: flex-start">
|
|
|
<el-image class="bg" :src="img" />
|
|
|
<div :class="['item', active === index ? 'active' : '']"
|
|
|
- :style="{top: item.top + 'px', height: item.height + 'px'}" v-for="(item, index) in style[tabIndex]"
|
|
|
+ :style="{ top: item.top + 'px', height: item.height + 'px' }" v-for="(item, index) in style[tabIndex]"
|
|
|
:key="index" @click="getActive(index)" />
|
|
|
|
|
|
<div class="form">
|
|
@@ -32,8 +32,7 @@
|
|
|
<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)" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="时间段:">
|
|
|
<el-time-picker is-range v-model="item.date" start-placeholder="开始时间" end-placeholder="结束时间"
|
|
@@ -68,13 +67,16 @@
|
|
|
</el-form>
|
|
|
|
|
|
<!-- 内容列表模块 -->
|
|
|
- <div v-else :style="{'display': tabIndex === 1 && active === 0 ? 'inline-block' : 'block'}">
|
|
|
+ <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="item.sort.toString()" />
|
|
|
+ <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-form-item>
|
|
|
|
|
|
<el-form-item label="时间:" v-if="time()">
|
|
|
- <el-date-picker v-model="item.date" type="datetimerange" start-placeholder="开始日期"
|
|
|
- end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" />
|
|
|
+ <el-date-picker v-model="item.date" type="datetimerange" start-placeholder="开始日期" end-placeholder="结束日期"
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss" />
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="标题:" v-if="title()">
|
|
@@ -83,7 +85,7 @@
|
|
|
|
|
|
<el-form-item label="模式:" v-if="model()">
|
|
|
<el-select v-model="item.model" placeholder="请选择模式">
|
|
|
- <el-option v-for="item in dict.type.content_model" :key="item.value" :label="item.label"
|
|
|
+ <el-option v-for="item in contentOptions" :key="item.value" :label="item.label"
|
|
|
:value="Number(item.value)" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
@@ -110,7 +112,7 @@
|
|
|
|
|
|
<el-form-item label="封面模式:" v-if="isCustom(item)">
|
|
|
<el-select v-model="item.isCustom" placeholder="选择封面模式">
|
|
|
- <el-option v-for="item in dict.type.is_custom" :key="item.value" :label="item.label"
|
|
|
+ <el-option v-for="item in coverOptions" :key="item.value" :label="item.label"
|
|
|
:value="Number(item.value)" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
@@ -119,6 +121,10 @@
|
|
|
<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-input-number v-model="item.sort" />
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
<el-form-item label="列表:" v-if="isList()">
|
|
|
<el-button type="primary" @click="getDialog(index)" v-hasPermi="['operation:recommend:add']">
|
|
|
添加内容
|
|
@@ -147,6 +153,8 @@
|
|
|
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"
|
|
|
+ v-hasPermi="['operation:recommend:add']">新增</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -156,14 +164,12 @@
|
|
|
<el-form inline size="mini">
|
|
|
<el-form-item label="音频类型:">
|
|
|
<el-select v-model="form.audioType" placeholder="请选择类型" :disabled="disabled">
|
|
|
- <el-option v-for="item in audioOptions" :key="item.value" :label="item.label"
|
|
|
- :value="item.value" />
|
|
|
+ <el-option v-for="item in audioOptions" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="资源平台:">
|
|
|
<el-select v-model="form.platformId" placeholder="请选择平台">
|
|
|
- <el-option v-for="item in platformOptions" :key="item.value" :label="item.label"
|
|
|
- :value="item.value" />
|
|
|
+ <el-option v-for="item in platformOptions" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="内容:">
|
|
@@ -184,13 +190,11 @@
|
|
|
<el-image :src="scope.row.audioPic" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="音频类型" prop="audioType" align="center" key="audioType"
|
|
|
- :formatter="audioFormatter" />
|
|
|
+ <el-table-column label="音频类型" prop="audioType" align="center" key="audioType" :formatter="audioFormatter" />
|
|
|
<el-table-column label="音频数量" prop="programCount" align="center" key="programCount" />
|
|
|
<el-table-column label="付费类型" align="center" key="isFree" :formatter="freeFormatter" width="100px" />
|
|
|
<el-table-column label="当前状态" align="center" key="status" :formatter="statusFormatter" />
|
|
|
- <el-table-column label="操作" align="center" key="change"
|
|
|
- v-if="tabIndex === 2 && active === 1 ? false : true">
|
|
|
+ <el-table-column label="操作" align="center" key="change" v-if="tabIndex === 2 && active === 1 ? false : true">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button type="text" @click="getSelect(scope.row)">
|
|
|
选择
|
|
@@ -198,7 +202,7 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
- <pagination v-show="total>0" :total="total" :page.sync="form.pageNum" :limit.sync="form.pageSize"
|
|
|
+ <pagination v-show="total > 0" :total="total" :page.sync="form.pageNum" :limit.sync="form.pageSize"
|
|
|
@pagination="getContentList" />
|
|
|
</el-dialog>
|
|
|
|
|
@@ -219,18 +223,15 @@ import {
|
|
|
upOrDown,
|
|
|
timeList,
|
|
|
submitTime,
|
|
|
- changeTime
|
|
|
+ changeTime,
|
|
|
+ expandSave,
|
|
|
+ removeList
|
|
|
} from '@/api/operation/recommend'
|
|
|
import Upload from '@/components/Upload/index'
|
|
|
-import { isFreeMixin, audioMixin, platformMixin, onOrOffMixin } from '@/mixin/index'
|
|
|
+import { isFreeMixin, audioMixin, platformMixin, onOrOffMixin, coverMixin } from '@/mixin/index'
|
|
|
|
|
|
export default {
|
|
|
- dicts: [
|
|
|
- 'platform_type',
|
|
|
- 'is_custom',
|
|
|
- 'content_model'
|
|
|
- ],
|
|
|
- mixins: [isFreeMixin, audioMixin, platformMixin, onOrOffMixin],
|
|
|
+ mixins: [isFreeMixin, audioMixin, platformMixin, onOrOffMixin, coverMixin],
|
|
|
components: {
|
|
|
Upload
|
|
|
},
|
|
@@ -270,7 +271,8 @@ export default {
|
|
|
{ top: 2460, height: 295 },
|
|
|
{ top: 2760, height: 600 },
|
|
|
{ top: 3370, height: 260 },
|
|
|
- { top: 3635, height: 600 }
|
|
|
+ { top: 3635, height: 600 },
|
|
|
+ { top: 4245, height: 215 }
|
|
|
],
|
|
|
'2': [
|
|
|
{ top: 135, height: 165 },
|
|
@@ -373,17 +375,26 @@ export default {
|
|
|
}, {
|
|
|
value: 6,
|
|
|
label: 'H5外链'
|
|
|
+ }],
|
|
|
+ contentOptions: [{
|
|
|
+ value: 0,
|
|
|
+ label: '自动推荐内容'
|
|
|
+ }, {
|
|
|
+ value: 1,
|
|
|
+ label: '手动推荐内容'
|
|
|
}]
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
async 'form.audioType'(val) {
|
|
|
- await this.getPlatform({
|
|
|
- audioType: val
|
|
|
- })
|
|
|
- this.form.platformId = this.platformOptions[0].value
|
|
|
- this.getContentList()
|
|
|
- },
|
|
|
+ if (this.tabIndex !== 1 || this.active !== 12) {
|
|
|
+ await this.getPlatform({
|
|
|
+ audioType: val
|
|
|
+ })
|
|
|
+ this.platformId = this.platformOptions[0].value
|
|
|
+ this.getContentList()
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
mounted() {
|
|
|
this.getTab()
|
|
@@ -492,23 +503,46 @@ export default {
|
|
|
|
|
|
// 内容列表提交
|
|
|
getSubmit(item) {
|
|
|
- item.startTime = item.date[0]
|
|
|
- item.endTime = item.date[1]
|
|
|
- delete item.date
|
|
|
- submit(item).then(res => {
|
|
|
- if (res.code === 0) {
|
|
|
- this.$message.success('提交成功!')
|
|
|
- this.getContentDetail(item.moduleId)
|
|
|
- }
|
|
|
- })
|
|
|
+ if (this.tabIndex === 2 && this.active === 1) {
|
|
|
+ expandSave(item).then(res => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ this.$message.success('提交成功!')
|
|
|
+ this.getContentDetail(item.moduleId)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } 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('提交成功!')
|
|
|
+ this.getContentDetail(item.moduleId)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
// 弹窗
|
|
|
- getDialog(index) {
|
|
|
+ async getDialog(index) {
|
|
|
this.dialogVisible = true
|
|
|
this.index = index
|
|
|
- this.form.audioType = this.list[index].forwardType !== null ? this.typeOptions.find(i => i.value === this.list[index].forwardType).type : 2
|
|
|
- this.disabled = this.tabIndex == 2 && this.active === 1 || this.list[index].forwardType !== null ? true : false
|
|
|
+ if (this.tabIndex === 1 && this.active === 12) {
|
|
|
+ await this.getAudioType(9)
|
|
|
+ this.audioOptions = this.audioTypeOptions
|
|
|
+ this.platformOptions = [{
|
|
|
+ value: 9,
|
|
|
+ label: '酷狗音乐'
|
|
|
+ }]
|
|
|
+ this.form.platformId = 9
|
|
|
+ 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.getContentList()
|
|
|
},
|
|
|
|
|
@@ -525,8 +559,7 @@ export default {
|
|
|
if (res.code === 0) {
|
|
|
this.tableData = res.data.records
|
|
|
this.total = res.data.total
|
|
|
- this.$refs.tableData.clearSelection()
|
|
|
- if (this.tableData.length > 0) {
|
|
|
+ if (this.list[this.index].childList && this.list[this.index].childList.length > 0) {
|
|
|
this.list[this.index].childList.map(i => {
|
|
|
let row = res.data.records.find(j => j.audioId === i.contentId)
|
|
|
if (row) {
|
|
@@ -595,12 +628,10 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- // 上下架
|
|
|
+ // 上下架内容模块
|
|
|
handleChange(item, status) {
|
|
|
let tips = status === 0 ? '上架' : '下架'
|
|
|
this.$confirm(`是否要${tips}?`, '提醒', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
upOrDown(item.id, status).then(res => {
|
|
@@ -612,6 +643,24 @@ export default {
|
|
|
}).catch(() => { })
|
|
|
},
|
|
|
|
|
|
+ // 删除内容模块
|
|
|
+ getRemoveList(item, index) {
|
|
|
+ if (item.id) {
|
|
|
+ this.$confirm(`是否要删除${item.title}?`, '提醒', {
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ removeList(item.id, 2).then(res => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ this.$message.success(`删除成功!`)
|
|
|
+ this.getContentDetail(item.moduleId)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }).catch(() => { })
|
|
|
+ } else {
|
|
|
+ this.list.splice(index, 1)
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
// 提交场景电台时间段
|
|
|
getSubmitTime(item) {
|
|
|
item.startTime = item.date[0]
|
|
@@ -632,22 +681,33 @@ export default {
|
|
|
|
|
|
// 新增时间段
|
|
|
getAdd() {
|
|
|
- this.timeList.push({})
|
|
|
+ if (this.tabIndex === 2 && this.active === 1) {
|
|
|
+ this.list.push({
|
|
|
+ moduleId: this.module[this.active].id,
|
|
|
+ childList: []
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.timeList.push({})
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
- // 上下架 / 删除 时间段
|
|
|
- getChangeTime(id, status) {
|
|
|
- let title = status === 0 ? '下架' : status === 1 ? '上架' : '删除'
|
|
|
- this.$confirm(`是否${title}?`, '提醒', {
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- changeTime(id, status).then(res => {
|
|
|
- if (res.code === 0) {
|
|
|
- this.$message.success(`${title}成功!`)
|
|
|
- this.getTimeList()
|
|
|
- }
|
|
|
+ // 上下架 / 删除时间段
|
|
|
+ getChangeTime(id, status, index) {
|
|
|
+ if (id) {
|
|
|
+ let title = status === 0 ? '下架' : status === 1 ? '上架' : '删除'
|
|
|
+ this.$confirm(`是否${title}?`, '提醒', {
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ changeTime(id, status).then(res => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ this.$message.success(`${title}成功!`)
|
|
|
+ this.getTimeList()
|
|
|
+ }
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
+ } else {
|
|
|
+ this.timeList.splice(index, 1)
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
// 字典翻译
|
|
@@ -665,7 +725,7 @@ export default {
|
|
|
// 标题模块
|
|
|
content() {
|
|
|
let rules = {
|
|
|
- '1': [3, 4, 5, 6, 7, 8].includes(this.active),
|
|
|
+ '1': [3, 4, 5, 6, 7, 8, 12].includes(this.active),
|
|
|
'2': [1, 3].includes(this.active),
|
|
|
'3': [2, 4, 6, 7, 8, 9].includes(this.active),
|
|
|
'4': [2, 4, 6, 8, 9, 10, 11].includes(this.active),
|
|
@@ -690,7 +750,7 @@ export default {
|
|
|
// 时间
|
|
|
time() {
|
|
|
let rules = {
|
|
|
- '1': this.active !== 3 && this.active !== 8,
|
|
|
+ '1': ![3, 8].includes(this.active),
|
|
|
'2': [0, 3].includes(this.active),
|
|
|
'3': this.active !== 1,
|
|
|
'4': this.active !== 1 || this.active !== 5,
|
|
@@ -741,7 +801,7 @@ export default {
|
|
|
// 内容
|
|
|
contentName(item) {
|
|
|
let rules = {
|
|
|
- '1': [0, 6, 8, 10].includes(this.active),
|
|
|
+ '1': [0, 6, 8, 10, 12].includes(this.active),
|
|
|
'3': [2, 3, 5, 6, 9].includes(this.active),
|
|
|
'4': [7].includes(this.active),
|
|
|
'5': [5].includes(this.active),
|
|
@@ -777,7 +837,7 @@ export default {
|
|
|
// 图片
|
|
|
pic(item) {
|
|
|
let rules = {
|
|
|
- '1': [1, 2, 6, 8, 10].includes(this.active),
|
|
|
+ '1': [1, 2, 6, 8, 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),
|
|
@@ -798,6 +858,7 @@ export default {
|
|
|
<style lang="scss" scoped>
|
|
|
.bg {
|
|
|
width: 365px;
|
|
|
+
|
|
|
.el-image__error,
|
|
|
.el-image__placeholder,
|
|
|
.el-image__inner {
|