|
|
@@ -69,13 +69,21 @@
|
|
|
<el-form-item prop="collections" label="藏品">
|
|
|
<el-table :data="formData.collections">
|
|
|
<el-table-column type="index" label="#"></el-table-column>
|
|
|
- <el-table-column prop="collection" label="ID" width="80"></el-table-column>
|
|
|
- <el-table-column prop="pic" label="图"></el-table-column>
|
|
|
+ <el-table-column prop="collectionId" label="ID" width="110"></el-table-column>
|
|
|
+ <el-table-column prop="pic" label="图">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <el-image
|
|
|
+ style="width: 30px; height: 30px"
|
|
|
+ :src="row.pic"
|
|
|
+ fit="cover"
|
|
|
+ ></el-image>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column width="80" align="center">
|
|
|
<template v-slot="{ $index }">
|
|
|
- <el-button type="danger" plain @click="delCollection($index)" size="mini">
|
|
|
+ <el-link type="danger" plain @click="delCollection($index)" size="mini">
|
|
|
删除
|
|
|
- </el-button>
|
|
|
+ </el-link>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -240,11 +248,19 @@ export default {
|
|
|
.then(() => {
|
|
|
if (!this.formData.collections.find(i => i.id === this.collectionId)) {
|
|
|
let data = this.collections.find(i => i.id === this.collectionId);
|
|
|
- this.formData.collections.push(item => {
|
|
|
- item.showroomId = this.formData.id;
|
|
|
- item.collectionId = data.id;
|
|
|
- });
|
|
|
- // console.log(this.formData.collections);
|
|
|
+ if (data.pic[0].type == 'video/mp4') {
|
|
|
+ this.formData.collections.push({
|
|
|
+ showroomId: this.formData.id,
|
|
|
+ collectionId: data.id,
|
|
|
+ pic: data.pic[0].thumb
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.formData.collections.push({
|
|
|
+ showroomId: this.formData.id,
|
|
|
+ collectionId: data.id,
|
|
|
+ pic: data.pic[0].url
|
|
|
+ });
|
|
|
+ }
|
|
|
this.showCollectionDialog = false;
|
|
|
} else {
|
|
|
this.$message.error('请勿重复添加');
|