8 changed files with 473 additions and 283 deletions
-
63src/assets/styles/adminIndex.scss
-
11src/router/routers.js
-
94src/views/ThemeGallery/index.vue
-
157src/views/components/ThemeGalleryList.vue
-
80src/views/dashboard/HomeThemeGallery.vue
-
206src/views/dashboard/ThemeGallery.vue
-
6src/views/home.vue
-
139src/views/immediateRelease/index.vue
@ -0,0 +1,94 @@ |
|||
<template> |
|||
<div class="theme"> |
|||
<!-- 右上角btn --> |
|||
<div class="home_publish_btn"> |
|||
<el-button round @click="publishHandle(0)">即时发布</el-button> |
|||
<el-button round type="primary" @click="publishHandle(1)">定时发布</el-button> |
|||
<el-button round class="publish_muilt_btn" @click="multiSelectBtn">{{ mulitText }}</el-button> |
|||
</div> |
|||
<!-- tab-btn --> |
|||
<!-- <el-tabs v-model="activeName" @tab-click="handleClick"> |
|||
<el-tab-pane label="为你推荐" name="1" /> |
|||
<el-tab-pane label="人工智能" name="2" /> |
|||
<el-tab-pane label="党建文化" name="3" /> |
|||
<el-tab-pane label="节日节气" name="4" /> |
|||
<el-tab-pane label="艺术鉴赏" name="5" /> |
|||
<el-tab-pane label="名人介绍" name="6" /> |
|||
<el-tab-pane label="摄影" name="7" /> |
|||
<el-tab-pane label="书法" name="8" /> |
|||
</el-tabs> --> |
|||
<!-- 主题库list --> |
|||
<ThemeGalleryList |
|||
ref="ThemeGalleryList" |
|||
:is-multi-selected="isMultiSelected" |
|||
:mulit-text="mulitText" |
|||
:show-item-info="showItemInfo" |
|||
/> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import ThemeGalleryList from '../components/ThemeGalleryList.vue' |
|||
export default { |
|||
name: 'ThemeGallery', |
|||
components: { ThemeGalleryList }, |
|||
data() { |
|||
return { |
|||
activeName: '1', |
|||
mulitText: '多选', |
|||
isMultiSelected: false, |
|||
showItemInfo: true |
|||
} |
|||
}, |
|||
mounted() { |
|||
}, |
|||
methods: { |
|||
// 多选btn |
|||
multiSelectBtn() { |
|||
this.isMultiSelected = !this.isMultiSelected |
|||
if (this.isMultiSelected) { |
|||
this.mulitText = '取消' |
|||
} else { |
|||
this.mulitText = '多选' |
|||
} |
|||
}, |
|||
publishHandle(index) { |
|||
this.$router.push( |
|||
{ |
|||
path: '/release', query: { tag: index } |
|||
} |
|||
) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
<style lang="scss" scoped> |
|||
.theme { |
|||
position: relative; |
|||
width: 100%; |
|||
background: #fff; |
|||
margin-top: 24px; |
|||
padding-top: 8px; |
|||
border-radius: 4px; |
|||
min-height: calc(100vh - 384px); |
|||
::v-deep .el-tabs__header { |
|||
padding: 0 26px; |
|||
} |
|||
.el-tabs{ |
|||
margin-bottom: 0; |
|||
} |
|||
::v-deep .el-tabs__item { |
|||
font-size: 16px; |
|||
height: 50px; |
|||
line-height: 50px; |
|||
} |
|||
::v-deep .el-tabs__active-bar { |
|||
height: 3px; |
|||
} |
|||
.publish_muilt_btn{ |
|||
padding: 6px 20px; |
|||
border: 1px solid #3a8aeb; |
|||
color: #3a8aeb; |
|||
} |
|||
} |
|||
</style> |
@ -0,0 +1,157 @@ |
|||
<template> |
|||
<div> |
|||
<el-tabs v-model="activeName" @tab-click="handleClick"> |
|||
<el-tab-pane label="为你推荐" name="1" /> |
|||
<el-tab-pane label="人工智能" name="2" /> |
|||
<el-tab-pane label="党建文化" name="3" /> |
|||
<el-tab-pane label="节日节气" name="4" /> |
|||
<el-tab-pane label="艺术鉴赏" name="5" /> |
|||
<el-tab-pane label="名人介绍" name="6" /> |
|||
<el-tab-pane label="摄影" name="7" /> |
|||
<el-tab-pane label="书法" name="8" /> |
|||
</el-tabs> |
|||
<div class="theme_img"> |
|||
<div |
|||
v-for="(item, index) in listThemeData" |
|||
:key="index" |
|||
:class="['theme_item', { 'item_multi': selectedListIds.includes(item.id) }]" |
|||
> |
|||
<img |
|||
:src="item.coverImg" |
|||
alt |
|||
/> |
|||
<div v-if="showItemInfo" class="item_format"> |
|||
<span class="item_type">{{ item.type }}</span> |
|||
<span v-if="item.type !== 'JPG'" class="item_time">03:00</span> |
|||
</div> |
|||
<div v-if="showItemInfo" class="file_name">{{ item.name }}</div> |
|||
<span v-if="isMultiSelected" class="checked_btn" @click="selectedItem(item.id, item.type)"></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
<script> |
|||
export default { |
|||
name: 'ThemeGalleryList', |
|||
props: { |
|||
isMultiSelected: { |
|||
type: Boolean, |
|||
required: true |
|||
}, |
|||
mulitText: { |
|||
type: String, |
|||
required: true |
|||
}, |
|||
showItemInfo: { |
|||
type: Boolean, |
|||
required: true |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
activeName: '1', |
|||
listThemeData: [ |
|||
{ |
|||
id: '1', |
|||
name: '人工智能', |
|||
type: 'JPG', |
|||
coverImg: require('@/assets/images//home/theme_Img_03.png'), |
|||
time: '' |
|||
}, |
|||
{ |
|||
id: '2', |
|||
name: '防控疫情小贴士', |
|||
type: 'vedio', |
|||
coverImg: require('@/assets/images/background.jpg'), |
|||
time: '03:00' |
|||
}, |
|||
{ |
|||
id: '3', |
|||
name: '人工智能', |
|||
type: 'JPG', |
|||
coverImg: require('@/assets/images//home/theme_Img_03.png'), |
|||
time: '' |
|||
}, |
|||
{ |
|||
id: '4', |
|||
name: '防控疫情小贴士', |
|||
type: 'vedio', |
|||
coverImg: require('@/assets/images/background.jpg'), |
|||
time: '03:00' |
|||
}, |
|||
{ |
|||
id: '5', |
|||
name: '人工智能', |
|||
type: 'JPG', |
|||
coverImg: require('@/assets/images//home/theme_Img_03.png'), |
|||
time: '' |
|||
}, |
|||
{ |
|||
id: '6', |
|||
name: '防控疫情小贴士', |
|||
type: 'vedio', |
|||
coverImg: require('@/assets/images/background.jpg'), |
|||
time: '03:00' |
|||
}, |
|||
{ |
|||
id: '7', |
|||
name: '人工智能', |
|||
type: 'JPG', |
|||
coverImg: require('@/assets/images//home/theme_Img_03.png'), |
|||
time: '' |
|||
} |
|||
], |
|||
selectedListIds: [] |
|||
} |
|||
}, |
|||
watch: { |
|||
isMultiSelected(newName, oldName) { |
|||
if (newName === false) { |
|||
this.selectedListIds = [] |
|||
} |
|||
} |
|||
}, |
|||
mounted() { |
|||
}, |
|||
methods: { |
|||
// tabClick |
|||
handleClick(tab, event) { |
|||
console.log(tab, event) |
|||
}, |
|||
// 多选选中 |
|||
selectedItem(id) { |
|||
const arr = this.selectedListIds |
|||
// includes()方法判断是否包含某一元素,返回true或false表示是否包含元素,对NaN一样有效 |
|||
if (arr.includes(id)) { |
|||
// 判断数组中是否有选中的id,如果有则去掉 |
|||
const index = arr.indexOf(id) |
|||
if (index > -1) { |
|||
arr.splice(index, 1) |
|||
} |
|||
} else { |
|||
this.selectedListIds.push(id) |
|||
} |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
<style lang="scss" scoped> |
|||
.el-tabs{ |
|||
margin-bottom: 0; |
|||
} |
|||
.theme_img { |
|||
padding-left: 26px; |
|||
height: calc(100vh - 449px); |
|||
overflow-y: auto; |
|||
.file_name{ |
|||
position: absolute; |
|||
left: 0; |
|||
bottom: 0; |
|||
width: 100%; |
|||
height: 30px; |
|||
background: rgba(255,255,255,0.6); |
|||
line-height: 30px; |
|||
} |
|||
} |
|||
|
|||
</style> |
@ -0,0 +1,80 @@ |
|||
<template> |
|||
<div class="theme"> |
|||
<!-- 右上角btn --> |
|||
<div class="home_publish_btn"> |
|||
<el-button round @click="publishHandle(0)">即时发布</el-button> |
|||
<el-button round type="primary" @click="publishHandle(1)">定时发布</el-button> |
|||
<el-button round class="publish_muilt_btn" @click="multiSelectBtn">{{ mulitText }}</el-button> |
|||
</div> |
|||
<!-- tab-btn --> |
|||
|
|||
<!-- 主题库list --> |
|||
<ThemeGalleryList |
|||
ref="ThemeGalleryList" |
|||
:is-multi-selected="isMultiSelected" |
|||
:mulit-text="mulitText" |
|||
/> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import ThemeGalleryList from '../components/ThemeGalleryList.vue' |
|||
export default { |
|||
name: 'ThemeGallery', |
|||
components: { ThemeGalleryList }, |
|||
data() { |
|||
return { |
|||
mulitText: '多选', |
|||
isMultiSelected: false |
|||
} |
|||
}, |
|||
mounted() { |
|||
}, |
|||
methods: { |
|||
// 多选btn |
|||
multiSelectBtn() { |
|||
this.isMultiSelected = !this.isMultiSelected |
|||
if (this.isMultiSelected) { |
|||
this.mulitText = '取消' |
|||
} else { |
|||
this.mulitText = '多选' |
|||
} |
|||
}, |
|||
publishHandle(index) { |
|||
this.$router.push( |
|||
{ |
|||
path: '/release', query: { tag: index } |
|||
} |
|||
) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
<style lang="scss" scoped> |
|||
.theme { |
|||
position: relative; |
|||
width: 100%; |
|||
background: #fff; |
|||
margin-top: 24px; |
|||
padding-top: 8px; |
|||
border-radius: 4px; |
|||
min-height: calc(100vh - 384px); |
|||
::v-deep .el-tabs__header { |
|||
padding: 0 26px; |
|||
} |
|||
|
|||
::v-deep .el-tabs__item { |
|||
font-size: 16px; |
|||
height: 50px; |
|||
line-height: 50px; |
|||
} |
|||
::v-deep .el-tabs__active-bar { |
|||
height: 3px; |
|||
} |
|||
.publish_muilt_btn{ |
|||
padding: 6px 20px; |
|||
border: 1px solid #3a8aeb; |
|||
color: #3a8aeb; |
|||
} |
|||
} |
|||
</style> |
@ -1,206 +0,0 @@ |
|||
<template> |
|||
<div class="theme"> |
|||
<el-tabs v-model="activeName" @tab-click="handleClick"> |
|||
<el-tab-pane label="为你推荐" name="1"> |
|||
<div class="theme_img"> |
|||
<div |
|||
v-for="(item, index) in listData" |
|||
:key="index" |
|||
:class="['theme_item', { 'item_multi': contentIds.includes(item.id) }]" |
|||
> |
|||
<img |
|||
:src="item.coverImg" |
|||
alt |
|||
/> |
|||
<span v-if="isMultiSelected" class="checked_btn" @click="selectedItem(item.id, item.type)"></span> |
|||
</div> |
|||
</div> |
|||
</el-tab-pane> |
|||
<el-tab-pane label="人工智能" name="2">人工智能</el-tab-pane> |
|||
<el-tab-pane label="党建文化" name="3">党建文化</el-tab-pane> |
|||
<el-tab-pane label="节日节气" name="4">节日节气</el-tab-pane> |
|||
<el-tab-pane label="艺术鉴赏" name="5">艺术鉴赏</el-tab-pane> |
|||
<el-tab-pane label="名人介绍" name="6">名人介绍</el-tab-pane> |
|||
<el-tab-pane label="摄影" name="7">摄影</el-tab-pane> |
|||
<el-tab-pane label="书法" name="8">书法</el-tab-pane> |
|||
</el-tabs> |
|||
<div class="home_publish_btn"> |
|||
<el-button round @click="publishHandle(0)">即时发布</el-button> |
|||
<el-button round type="primary" @click="publishHandle(1)">定时发布</el-button> |
|||
<el-button round class="publish_muilt_btn" @click="multiSelectBtn">{{ mulitText }}</el-button> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
name: 'ThemeGallery', |
|||
data() { |
|||
return { |
|||
activeName: '1', |
|||
mulitText: '多选', |
|||
isMultiSelected: false, |
|||
listData: [ |
|||
{ |
|||
id: '1', |
|||
name: '人工智能', |
|||
type: 'JPG', |
|||
coverImg: require('@/assets/images//home/theme_Img_03.png'), |
|||
time: '' |
|||
}, |
|||
{ |
|||
id: '2', |
|||
name: '防控疫情小贴士', |
|||
type: 'vedio', |
|||
coverImg: require('@/assets/images/background.jpg'), |
|||
time: '03:00' |
|||
}, |
|||
{ |
|||
id: '3', |
|||
name: '人工智能', |
|||
type: 'JPG', |
|||
coverImg: require('@/assets/images//home/theme_Img_03.png'), |
|||
time: '' |
|||
}, |
|||
{ |
|||
id: '4', |
|||
name: '防控疫情小贴士', |
|||
type: 'vedio', |
|||
coverImg: require('@/assets/images/background.jpg'), |
|||
time: '03:00' |
|||
}, |
|||
{ |
|||
id: '5', |
|||
name: '人工智能', |
|||
type: 'JPG', |
|||
coverImg: require('@/assets/images//home/theme_Img_03.png'), |
|||
time: '' |
|||
}, |
|||
{ |
|||
id: '6', |
|||
name: '防控疫情小贴士', |
|||
type: 'vedio', |
|||
coverImg: require('@/assets/images/background.jpg'), |
|||
time: '03:00' |
|||
}, |
|||
{ |
|||
id: '7', |
|||
name: '人工智能', |
|||
type: 'JPG', |
|||
coverImg: require('@/assets/images//home/theme_Img_03.png'), |
|||
time: '' |
|||
}, |
|||
{ |
|||
id: '8', |
|||
name: '防控疫情小贴士', |
|||
type: 'vedio', |
|||
coverImg: require('@/assets/images/background.jpg'), |
|||
time: '03:00' |
|||
}, |
|||
{ |
|||
id: '9', |
|||
name: '人工智能', |
|||
type: 'JPG', |
|||
coverImg: require('@/assets/images//home/theme_Img_03.png'), |
|||
time: '' |
|||
}, |
|||
{ |
|||
id: '10', |
|||
name: '防控疫情小贴士', |
|||
type: 'vedio', |
|||
coverImg: require('@/assets/images/background.jpg'), |
|||
time: '03:00' |
|||
} |
|||
], |
|||
contentIds: [] |
|||
} |
|||
}, |
|||
mounted() { |
|||
}, |
|||
methods: { |
|||
handleClick(tab, event) { |
|||
console.log(tab, event) |
|||
}, |
|||
// 多选btn |
|||
multiSelectBtn() { |
|||
this.isMultiSelected = !this.isMultiSelected |
|||
if (this.isMultiSelected) { |
|||
this.mulitText = '取消' |
|||
} else { |
|||
this.mulitText = '多选' |
|||
} |
|||
// this.$refs.MaterialList.multiSelectList() |
|||
}, |
|||
// 多选选中 |
|||
selectedItem(id) { |
|||
const arr = this.contentIds |
|||
// includes()方法判断是否包含某一元素,返回true或false表示是否包含元素,对NaN一样有效 |
|||
if (arr.includes(id)) { |
|||
// 判断数组中是否有选中的id,如果有则去掉 |
|||
const index = arr.indexOf(id) |
|||
if (index > -1) { |
|||
arr.splice(index, 1) |
|||
} |
|||
} else { |
|||
this.contentIds.push(id) |
|||
} |
|||
}, |
|||
publishHandle(index) { |
|||
this.$router.push( |
|||
{ |
|||
path: '/release', query: { tag: index } |
|||
} |
|||
) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
<style lang="scss" scoped> |
|||
.theme { |
|||
position: relative; |
|||
width: 100%; |
|||
background: #fff; |
|||
margin-top: 24px; |
|||
padding-top: 8px; |
|||
border-radius: 4px; |
|||
min-height: calc(100vh - 384px); |
|||
::v-deep .el-tabs__header { |
|||
padding: 0 26px; |
|||
} |
|||
::v-deep .el-tabs__item { |
|||
font-size: 16px; |
|||
height: 50px; |
|||
line-height: 50px; |
|||
} |
|||
::v-deep .el-tabs__active-bar { |
|||
height: 3px; |
|||
} |
|||
|
|||
.theme_img { |
|||
display: flex; |
|||
flex-wrap: wrap; |
|||
padding-left: 26px; |
|||
height: calc(100vh - 449px); |
|||
overflow-y: auto; |
|||
.theme_item{ |
|||
position: relative; |
|||
width: 160px; |
|||
height: 284px; |
|||
border: 1px solid #f0f0f0; |
|||
border-radius: 4px; |
|||
margin: 0 24px 24px 0; |
|||
overflow: hidden; |
|||
} |
|||
img { |
|||
display: block; |
|||
width: 100%; |
|||
height: 100%; |
|||
} |
|||
} |
|||
.publish_muilt_btn{ |
|||
padding: 6px 20px; |
|||
border: 1px solid #3a8aeb; |
|||
color: #3a8aeb; |
|||
} |
|||
} |
|||
</style> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue