|
@@ -2,15 +2,12 @@
|
|
<div class='app-container'>
|
|
<div class='app-container'>
|
|
<el-form class="form" label-width="100px" ref="form" :model="data.form" :rules="data.rules">
|
|
<el-form class="form" label-width="100px" ref="form" :model="data.form" :rules="data.rules">
|
|
<el-form-item class="chooseAudio" label="插播音频:" prop="audioList">
|
|
<el-form-item class="chooseAudio" label="插播音频:" prop="audioList">
|
|
- <div class="audioList" v-for="(item, index) in data.form.audioList" :key="item.id" :style="{'height': item.type !== 2 ? '45px' : ''}">
|
|
|
|
- <el-tag v-show="item.type === 0 || item.type === 1" size="large" :closable="checkClose()"
|
|
|
|
|
|
+ <div class="audioList" v-for="(item, index) in data.form.audioList" :key="item.id"
|
|
|
|
+ :style="{ 'height': item.type !== 2 ? '45px' : '' }">
|
|
|
|
+ <el-tag size="large" :closable="checkClose()"
|
|
@close="handleClose(index)">
|
|
@close="handleClose(index)">
|
|
{{ item.audioName }}
|
|
{{ item.audioName }}
|
|
</el-tag>
|
|
</el-tag>
|
|
- <div v-show="item.type === 2" class="audio">
|
|
|
|
- <img src="@/assets/icons/svg/file.svg" width="70" height="70" />
|
|
|
|
- <span>{{ item.audioName }}</span>
|
|
|
|
- </div>
|
|
|
|
</div>
|
|
</div>
|
|
<div style="width: 100%;">
|
|
<div style="width: 100%;">
|
|
<el-button v-if="checkClose()" icon="Plus" @click="getDialog">新增</el-button>
|
|
<el-button v-if="checkClose()" icon="Plus" @click="getDialog">新增</el-button>
|
|
@@ -38,7 +35,8 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item v-if="data.form.id" label="当前状态:" prop="status">
|
|
<el-form-item v-if="data.form.id" label="当前状态:" prop="status">
|
|
<el-select v-model="data.form.status" placeholder="请选择当前状态">
|
|
<el-select v-model="data.form.status" placeholder="请选择当前状态">
|
|
- <el-option v-for="item in sys_change_status" :key="item.value" :value="Number(item.value)" :label="item.label" />
|
|
|
|
|
|
+ <el-option v-for="item in sys_change_status" :key="item.value" :value="Number(item.value)"
|
|
|
|
+ :label="item.label" />
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
@@ -72,8 +70,8 @@
|
|
<el-button icon="Refresh" @click="getRefresh">重置</el-button>
|
|
<el-button icon="Refresh" @click="getRefresh">重置</el-button>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
- <el-table v-if="audioData.form.type !== 2" ref="table" :data="audioData.tableData" :row-key="rowKey"
|
|
|
|
- @selection-change="handleSelectionChange" v-loading="audioData.loading">
|
|
|
|
|
|
+ <el-table ref="table" :data="audioData.tableData" :row-key="rowKey" @selection-change="handleSelectionChange"
|
|
|
|
+ v-loading="audioData.loading">
|
|
<el-table-column type="selection" width="55" />
|
|
<el-table-column type="selection" width="55" />
|
|
<el-table-column label="ID" prop="id" align="center" show-overflow-tooltip />
|
|
<el-table-column label="ID" prop="id" align="center" show-overflow-tooltip />
|
|
<el-table-column label="名称" prop="name" align="center" show-overflow-tooltip />
|
|
<el-table-column label="名称" prop="name" align="center" show-overflow-tooltip />
|
|
@@ -86,12 +84,6 @@
|
|
<el-table-column label="当前状态" prop="status" align="center" :formatter="statusFormatter" />
|
|
<el-table-column label="当前状态" prop="status" align="center" :formatter="statusFormatter" />
|
|
<el-table-column label="更新时间" prop="updateTime" align="center" show-overflow-tooltip />
|
|
<el-table-column label="更新时间" prop="updateTime" align="center" show-overflow-tooltip />
|
|
</el-table>
|
|
</el-table>
|
|
- <div class="audio_table" v-else>
|
|
|
|
- <div class="audio" v-for="item in audioData.tableData" :key="item.id" @click="handleChooseAudio(item)">
|
|
|
|
- <img src="@/assets/icons/svg/file.svg" width="70" height="70" />
|
|
|
|
- <span>{{ item.name }}</span>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
<pagination v-show="audioData.total > 0" :total="audioData.total" v-model:page="audioData.form.pageNum"
|
|
<pagination v-show="audioData.total > 0" :total="audioData.total" v-model:page="audioData.form.pageNum"
|
|
v-model:limit="audioData.form.pageSize" @pagination="getAudio" />
|
|
v-model:limit="audioData.form.pageSize" @pagination="getAudio" />
|
|
<template #footer>
|
|
<template #footer>
|
|
@@ -157,9 +149,6 @@ const data = reactive({
|
|
}, {
|
|
}, {
|
|
value: 1,
|
|
value: 1,
|
|
label: 'Ohplay音频'
|
|
label: 'Ohplay音频'
|
|
- }, {
|
|
|
|
- value: 2,
|
|
|
|
- label: '场景预设'
|
|
|
|
}],
|
|
}],
|
|
// 多选
|
|
// 多选
|
|
selectionList: [],
|
|
selectionList: [],
|
|
@@ -245,8 +234,9 @@ function getDialog() {
|
|
if (audioData.form.type !== 2) {
|
|
if (audioData.form.type !== 2) {
|
|
nextTick(() => {
|
|
nextTick(() => {
|
|
proxy.$refs.table.clearSelection()
|
|
proxy.$refs.table.clearSelection()
|
|
- if (val && data.form.audioList.length > 0) {
|
|
|
|
- data.form.audioList.map(i => {
|
|
|
|
|
|
+ data.selectionList = data.form.audioList
|
|
|
|
+ if (val && data.selectionList.length > 0) {
|
|
|
|
+ data.selectionList.map(i => {
|
|
let row = val.find(j => j.id === i.audioId)
|
|
let row = val.find(j => j.id === i.audioId)
|
|
if (row) {
|
|
if (row) {
|
|
proxy.$refs.table.toggleRowSelection(row, true)
|
|
proxy.$refs.table.toggleRowSelection(row, true)
|
|
@@ -292,9 +282,8 @@ const rowKey = (e) => {
|
|
|
|
|
|
// 多选
|
|
// 多选
|
|
const handleSelectionChange = (e) => {
|
|
const handleSelectionChange = (e) => {
|
|
- data.selectionList = []
|
|
|
|
e.map(i => {
|
|
e.map(i => {
|
|
- if (data.selectionList.findIndex(j => j.id === i.id) === -1) {
|
|
|
|
|
|
+ if (data.selectionList.findIndex(j => j.audioId === i.id) === -1) {
|
|
data.selectionList.push({
|
|
data.selectionList.push({
|
|
audioId: i.id,
|
|
audioId: i.id,
|
|
audioName: i.name,
|
|
audioName: i.name,
|
|
@@ -306,21 +295,6 @@ const handleSelectionChange = (e) => {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
-// 单选
|
|
|
|
-const handleChooseAudio = (e) => {
|
|
|
|
- data.form.audioList = []
|
|
|
|
- data.form.audioList.push({
|
|
|
|
- audioId: e.id,
|
|
|
|
- audioName: e.name,
|
|
|
|
- audioType: e.audioType,
|
|
|
|
- categoryId: e.sceneId,
|
|
|
|
- type: e.type
|
|
|
|
- })
|
|
|
|
- getPushTime(e)
|
|
|
|
- proxy.$modal.msgSuccess('选择成功!')
|
|
|
|
- dialogVisible_audio.value = false
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
// 选择时段
|
|
// 选择时段
|
|
const handleCheckTime = (e) => {
|
|
const handleCheckTime = (e) => {
|
|
data.form.timeId = e.timeId
|
|
data.form.timeId = e.timeId
|
|
@@ -473,15 +447,6 @@ watch(() => audioData.form.type, (val) => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-.audio_table {
|
|
|
|
- display: flex;
|
|
|
|
- flex-wrap: wrap;
|
|
|
|
-
|
|
|
|
- .audio {
|
|
|
|
- margin: 10px;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
.audio {
|
|
.audio {
|
|
width: 200px;
|
|
width: 200px;
|
|
height: 200px;
|
|
height: 200px;
|