Browse Source

主题库

dev
xuhuajiao 3 years ago
parent
commit
003cc27eea
  1. 32
      src/views/ThemeGallery/index.vue
  2. 16
      src/views/components/MyAlbum.vue
  3. 44
      src/views/components/ThemeGalleryList.vue
  4. 15
      src/views/publishContent/urgentMessage/index.vue

32
src/views/ThemeGallery/index.vue

@ -15,8 +15,11 @@
:mulit-text="mulitText"
:show-item-info="showItemInfo"
:tab-item="tabItem"
:is-my-album="isMyAlbum"
@pf="parent"
@changedMultiSelected="changedMultiSelected"
/>
<MyAlbum v-show="isMyAlbum" ref="MyAlbum" :is-multi-selected="isMultiSelected" />
<div class="material_btn">
<el-button round type="primary" @click="uploadHistoryVisible=true">上传历史</el-button>
<el-button round @click="multiSelectBtn">{{ mulitText }}</el-button>
@ -158,36 +161,20 @@
<el-pagination style="margin-top: 20px;" background :current-page="page" :total="total" :page-size="size" :pager-count="5" :page-sizes="[3, 5, 10]" layout="prev, pager, next, jumper,->,sizes,total" @current-change="getThemeHistoryList" @size-change="handleSizeChange" />
</el-dialog>
</div>
<!-- <div class="release_layer upload_layer">
<el-dialog :close-on-click-modal="false" :show-close="false" :visible.sync="selectContVisible" width="1200px">
<div slot="title" class="layer_tab_title">
<span>主题库</span>
</div>
<ThemeGalleryList
ref="ThemeGalleryList"
:is-multi-selected="isMultiSelected"
:mulit-text="mulitText"
:show-item-info="showItemInfo"
:tab-item="tabItem"
@changedMultiSelected="changedMultiSelected"
/>
</el-dialog>
</div> -->
</div>
</template>
<script>
import { FetchAddOrEdit, FetchThemeHistoryList, FetchUpdateThemeState, FetchFindThemeClassDetails } from '@/api/theme/theme.js'
import { saveMaterial } from '@/api/material/material'
import ThemeGalleryList from '../components/ThemeGalleryList.vue'
import ThemeGalleryList from '../components/ThemeGalleryList'
import MyAlbum from '../components/MyAlbum'
import Upload from '../components/upload'
import UploadCover from '../components/upload_cover'
import { parseTime } from '@/utils/index.js'
export default {
name: 'ThemeGallery',
components: { ThemeGalleryList, UploadCover, Upload },
components: { ThemeGalleryList, MyAlbum, UploadCover, Upload },
filters: {
parseTime(time, cFormat) {
return parseTime(time, cFormat)
@ -195,6 +182,7 @@ export default {
},
data() {
return {
isMyAlbum: false,
isTheme: true,
orga_id: '133221333123111', // ID
addDialogVisible: false, // -
@ -269,6 +257,12 @@ export default {
this.getThemeHistoryList()
},
methods: {
parent() {
this.isMyAlbum = this.$refs.ThemeGalleryList.themeItemActive == 2
console.log(this.$refs.ThemeGalleryList.themeItemActive)
this.$refs.MyAlbum.selectInFolderid = []
this.$refs.MyAlbum.getMyAlbum()
},
// /
changeSelect(val) {
const allValues = []

16
src/views/components/MyAlbum.vue

@ -1,5 +1,5 @@
<template>
<div>
<div class="theme_img">
<!-- 我的画册-创建文件夹btn -->
<div v-if="isToFolder" class="material_crumbs">
<el-breadcrumb separator-class="el-icon-arrow-right">
@ -97,7 +97,6 @@
</div>
</el-dialog>
</div>
</div>
</template>
@ -106,9 +105,8 @@ import { FetchMyAlbum, FetchDeleteMyAlbum, FetchSaveThemeFolder, FetchDeleteThem
import { getSeconds, getFileFormat } from '@/utils/index.js'
import UploadCover from './upload_cover'
export default {
name: 'ThemeGalleryList',
name: 'MyAlbum',
components: { UploadCover },
// inject: ['selectContVisible'],
filters: {
getSeconds(s) {
return getSeconds(s)
@ -151,8 +149,8 @@ export default {
img_path: '',
name: '',
orga_id: ''
}
// selectContVisible2: 0
},
selectContVisible: false
}
},
computed: {
@ -173,9 +171,9 @@ export default {
document.addEventListener('click', this.hiddenFolderActiveClick)
},
methods: {
// addThemeToAlbum() {
// this.$emit('test', this.selectContVisible2)
// },
addThemeToAlbum() {
this.selectContVisible = true
},
breadcrumbToAlbum() {
this.$router.push('/theme')
this.getMyAlbum()

44
src/views/components/ThemeGalleryList.vue

@ -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()
}
},

15
src/views/publishContent/urgentMessage/index.vue

@ -408,20 +408,8 @@ export default {
},
//
tagHandle(tag) {
//
// if (this.form.notice_devices.length == 0) {
// this.form.notice_devices.push({ deviceId: tag.device_id })
// } else {
// const result = this.form.notice_devices.some((item) => {
// return item.deviceId == tag.device_id
// })
// if (!result) {
// this.form.notice_devices.push({ deviceId: tag.device_id })
// }
// }
//
if (this.deviceTags.length == 0) {
// this.form.notice_devices.push({ deviceId: tag.device_id })
this.deviceTags.push(tag)
} else {
const current =
@ -429,12 +417,9 @@ export default {
this.deviceTags.some((item) => item.device_id == tag.device_id)
if (!current) {
this.deviceTags.push(tag)
// this.form.notice_devices.push({ deviceId: tag.device_id })
} else {
this.$message('请勿添加重复的设备!')
}
// !this.deviceTags.some(item => item.device_name === tag.device_name)
// && this.deviceTags.push(tag)
}
},
//

Loading…
Cancel
Save