|
|
@ -9,17 +9,18 @@ |
|
|
|
<el-tab-pane label="我的画册" name="2" /> |
|
|
|
</el-tabs> |
|
|
|
|
|
|
|
<div class="theme_img"> |
|
|
|
<div v-show="themeItemActive==2"> |
|
|
|
<div v-if="themeItemActive!=2 || !isMyAlbum" class="theme_img"> |
|
|
|
<!-- <div v-show="themeItemActive==2"> |
|
|
|
<MyAlbum ref="myAlbum" :is-multi-selected="isMultiSelected" /> |
|
|
|
</div> |
|
|
|
<div v-if="themeItemActive!=2" style="display:flex"> |
|
|
|
</div> --> |
|
|
|
<div style="display:flex"> |
|
|
|
<!-- 主题库list --> |
|
|
|
<div v-for="(item, index) in themeGalleryList" :key="index" :class="['theme_item', {'set_radio': !item.img_path && item.material_type == 2}, { 'item_multi': selectedListId.includes(item.material_id) }]"> |
|
|
|
<!-- :onerror="defaultImg" --> |
|
|
|
<div class="img_box"> |
|
|
|
<img v-if="item.img_path || item.material_type == 1" :src="item.img_path" alt /> |
|
|
|
</div> |
|
|
|
<!-- <div v-if="!item.img_path && item.material_type == 1 " class="error_img"></div> --> |
|
|
|
<div v-if="!item.img_path && item.material_type == 2" class="radio_img"></div> |
|
|
|
<div v-if="showItemInfo" class="item_format"> |
|
|
|
<span class="item_type">{{ item.deposit_url | getFileFormat }}</span> |
|
|
@ -41,19 +42,17 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- <List ref="list" :select-cont-visible="selectContVisible" :tab-item="tabItem" :is-multi-selected="isMultiSelected" :mulit-text="mulitText" /> --> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { FetchThemeClassList, FetchThemeGallery, FetchAddToMyAlbum } from '@/api/theme/theme.js' |
|
|
|
import { getSeconds, getFileFormat } from '@/utils/index.js' |
|
|
|
import MyAlbum from './MyAlbum' |
|
|
|
// import MyAlbum from './MyAlbum' |
|
|
|
// import List from './list2' |
|
|
|
export default { |
|
|
|
name: 'ThemeGalleryList', |
|
|
|
components: { MyAlbum }, |
|
|
|
components: { }, |
|
|
|
filters: { |
|
|
|
getSeconds(s) { |
|
|
|
return getSeconds(s) |
|
|
@ -74,6 +73,10 @@ export default { |
|
|
|
showItemInfo: { |
|
|
|
type: Boolean, |
|
|
|
required: true |
|
|
|
}, |
|
|
|
isMyAlbum: { |
|
|
|
type: Boolean, |
|
|
|
required: true |
|
|
|
} |
|
|
|
}, |
|
|
|
data() { |
|
|
@ -99,8 +102,8 @@ export default { |
|
|
|
themeGalleryList: [], // 主题库的列表 |
|
|
|
selectedListId: [], |
|
|
|
selectInFolderid: [], // 关联素材得主键得ID |
|
|
|
selectedMaterial: [] // 素材选中 |
|
|
|
// selectContVisible: false |
|
|
|
selectedMaterial: [], // 素材选中 |
|
|
|
selectContVisible: false |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
@ -112,8 +115,11 @@ export default { |
|
|
|
isMultiSelected(newName, oldName) { |
|
|
|
if (newName === false) { |
|
|
|
this.selectedListId = [] |
|
|
|
this.$refs.myAlbum.selectInFolderid = [] |
|
|
|
// this.$refs.myAlbum.selectInFolderid = [] |
|
|
|
} |
|
|
|
}, |
|
|
|
isMyAlbum(newName, oldName) { |
|
|
|
console.log(newName) |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted() { |
|
|
@ -135,8 +141,9 @@ export default { |
|
|
|
this.activeIndex = tab.index |
|
|
|
if (this.themeItemActive == 2) { |
|
|
|
this.selectedListId = [] |
|
|
|
this.$refs.myAlbum.selectInFolderid = [] |
|
|
|
this.$refs.myAlbum.getMyAlbum() |
|
|
|
|
|
|
|
// this.$refs.myAlbum.selectInFolderid = [] |
|
|
|
this.$emit('pf') |
|
|
|
} else { |
|
|
|
this.themeGalleryList = [] |
|
|
|
this.getThemeGallery() |
|
|
@ -147,13 +154,16 @@ export default { |
|
|
|
this.themeItemActive = tab.index |
|
|
|
if (this.themeItemActive == 2) { |
|
|
|
this.selectedListId = [] |
|
|
|
this.$refs.myAlbum.selectInFolderid = [] |
|
|
|
this.$router.push('/theme') |
|
|
|
this.$nextTick(function() { |
|
|
|
this.$refs.myAlbum.getMyAlbum() |
|
|
|
}) |
|
|
|
this.$emit('pf') |
|
|
|
// this.$root.bus.$emit('getMyAlbum') |
|
|
|
|
|
|
|
// this.$nextTick(function() { |
|
|
|
// this.$refs.myAlbum.getMyAlbum() |
|
|
|
// }) |
|
|
|
} else { |
|
|
|
this.themeGalleryList = [] |
|
|
|
// this.isMyAlbum = false |
|
|
|
this.getThemeGallery() |
|
|
|
} |
|
|
|
}, |
|
|
|