|
@@ -1,13 +1,13 @@
|
|
|
<template>
|
|
|
<div class="m-container">
|
|
|
- <h2>
|
|
|
+ <h2 v-if="type === 'DEFAULT'">
|
|
|
<el-page-header @back="onCancel" :content="detailName"></el-page-header>
|
|
|
</h2>
|
|
|
<div class="m-core">
|
|
|
<div class="buttons">
|
|
|
- <el-button type="primary" @click="openUpload()">上传照片</el-button>
|
|
|
- <el-button type="primary" :disabled="list.length == 0" v-if="!editing" @click="changeMode()">编辑照片</el-button>
|
|
|
- <el-button type="danger" v-if="editing" @click="remove()">删除照片</el-button>
|
|
|
+ <el-button type="primary" @click="openUpload()">{{type === 'DEFAULT' ? '上传照片' : '上传证书'}}</el-button>
|
|
|
+ <el-button type="primary" :disabled="list.length == 0" v-if="!editing" @click="changeMode()">{{type === 'DEFAULT' ? '编辑照片' : '编辑证书'}}</el-button>
|
|
|
+ <el-button type="danger" v-if="editing" @click="remove()">{{type === 'DEFAULT' ? '删除照片' : '删除证书'}}</el-button>
|
|
|
<el-button type="primary" v-if="editing" @click="confirm()">确定</el-button>
|
|
|
<el-button type="primary" v-if="editing" @click="cancel()">取消</el-button>
|
|
|
</div>
|
|
@@ -35,7 +35,8 @@
|
|
|
</div>
|
|
|
<div v-else class="ctrl-bar-view">
|
|
|
<el-tooltip effect="dark" content="设为封面" placement="top" :open-delay=".5">
|
|
|
- <i class="el-icon-picture-outline-round" @click="setCover(item)"></i>
|
|
|
+ <i class="el-icon-picture-outline-round" @click="setCover(item)" v-if="type === 'DEFAULT'"></i>
|
|
|
+ <i v-else></i>
|
|
|
</el-tooltip>
|
|
|
<el-tooltip effect="dark" :content="views.includes(item.id) ? '设为不可见' : '设为可见'" placement="top" :open-delay=".5">
|
|
|
<i class="el-icon-view" :class="{active: views.includes(item.id)}" @click="setViewItem(item)"></i>
|
|
@@ -49,14 +50,14 @@
|
|
|
<el-tooltip v-if="!editing" class="item" effect="dark" :content="item.name" placement="top" :open-delay=".5">
|
|
|
<div class="name">{{item.name}}</div>
|
|
|
</el-tooltip>
|
|
|
- <el-input class="nameinput" v-else v-model="item.name" size="mini" placeholder="请输入照片名称" clearable/>
|
|
|
+ <el-input class="nameinput" v-else v-model="item.name" size="mini" :placeholder="'请输入' + (type === 'DEFAULT' ? '照片' : '证书') + '名称'" clearable/>
|
|
|
</div>
|
|
|
</draggable>
|
|
|
</el-checkbox-group>
|
|
|
<empty v-if="list.length == 0"/>
|
|
|
</div>
|
|
|
<el-dialog
|
|
|
- title="上传照片"
|
|
|
+ :title="type === 'DEFAULT' ? '上传照片' : '上传证书'"
|
|
|
:visible.sync="uploadVisible"
|
|
|
v-if="uploadVisible"
|
|
|
>
|
|
@@ -73,6 +74,12 @@ import draggable from 'vuedraggable'
|
|
|
import uploadPopup from '@/views/resetTeaming/components/training-photos/upload'
|
|
|
import { photoQueryPage, photoDel, photoUpdate, photoAlbumUpdate } from '@/views/resetTeaming/components/training-photos/api'
|
|
|
export default {
|
|
|
+ props: {
|
|
|
+ type: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
+ },
|
|
|
components: {
|
|
|
'upload-popup': uploadPopup,
|
|
|
draggable,
|
|
@@ -80,7 +87,20 @@ export default {
|
|
|
computed: {
|
|
|
detailName() {
|
|
|
return this.$route.query.name || '相册详情'
|
|
|
- }
|
|
|
+ },
|
|
|
+ queryIdOrType() {
|
|
|
+ const id = this.$route.params.id
|
|
|
+ if (this.type === 'DEFAULT') {
|
|
|
+ return {
|
|
|
+ id,
|
|
|
+ type: this.type,
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ type: this.type,
|
|
|
+ musicGroupId: this.$route.query.id,
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -111,7 +131,7 @@ export default {
|
|
|
try {
|
|
|
await this.$confirm('是否确认设置为封面?', '提示')
|
|
|
await photoAlbumUpdate({
|
|
|
- id: this.$route.params.id,
|
|
|
+ ...this.queryIdOrType,
|
|
|
coverUrl: item.url
|
|
|
})
|
|
|
this.$message.success('设置成功')
|
|
@@ -154,7 +174,7 @@ export default {
|
|
|
},
|
|
|
async FetchList() {
|
|
|
try {
|
|
|
- const res = await photoQueryPage({photoAlbumId: this.$route.params.id})
|
|
|
+ const res = await photoQueryPage({...this.queryIdOrType, photoAlbumId: this.queryIdOrType.id})
|
|
|
// console.log(res.data.rows)
|
|
|
this.setInitViwes()
|
|
|
this.list = res.data.rows
|