Browse Source

素材库-发布

dev
xuhuajiao 3 years ago
parent
commit
cad2638991
  1. 76
      src/views/components/ThemeGalleryList.vue
  2. 2
      src/views/dashboard/HomeThemeGallery.vue
  3. 6
      src/views/immediateRelease/index.vue

76
src/views/components/ThemeGalleryList.vue

@ -11,14 +11,14 @@
<el-form-item label="设备方向" prop="direction"> <el-form-item label="设备方向" prop="direction">
<el-radio-group v-model="classifyForm.direction" @change="clearCheckbox"> <el-radio-group v-model="classifyForm.direction" @change="clearCheckbox">
<el-radio :label="1" value="across">横屏</el-radio> <el-radio :label="1" value="across">横屏</el-radio>
<el-radio :label="2" value='vertical'>竖屏</el-radio>
<el-radio :label="2" value="vertical">竖屏</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<!-- <el-form-item label="文件名称"> <!-- <el-form-item label="文件名称">
<el-input v-model="classifyForm.name" style="width:336px" /> <el-input v-model="classifyForm.name" style="width:336px" />
</el-form-item> --> </el-form-item> -->
<el-form-item label="上传内容" prop="img_path"> <el-form-item label="上传内容" prop="img_path">
<img v-if="formatType==0" :src="imgSrc" alt="" width="200" height="150">
<img v-if="formatType==0" :src="imgSrc" alt="" width="200" height="150" />
<video v-else-if="formatType==1" width="320" height="240" controls> <video v-else-if="formatType==1" width="320" height="240" controls>
<source :src="videoSrc" type="video/mp4" /> <source :src="videoSrc" type="video/mp4" />
</video> </video>
@ -27,7 +27,7 @@
</audio> </audio>
<Upload ref="uploadMaterial" @saveMaterial="saveMaterial" /> <Upload ref="uploadMaterial" @saveMaterial="saveMaterial" />
</el-form-item> </el-form-item>
<el-form-item el-form-item v-if="formatType != 0" label="上传封面" prop="img_path">
<el-form-item v-if="formatType != 0" el-form-item label="上传封面" prop="img_path">
<UploadCover ref="childUpload" /> <UploadCover ref="childUpload" />
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -117,9 +117,13 @@
<div class="publish_layer"> <div class="publish_layer">
<el-dialog title="创建文件夹" :close-on-click-modal="false" :show-close="false" :visible.sync="mkdirVisible" width="616px" height="384px"> <el-dialog title="创建文件夹" :close-on-click-modal="false" :show-close="false" :visible.sync="mkdirVisible" width="616px" height="384px">
<el-form ref="form" :inline="true" :model="form" size="small" label-width="100px"> <el-form ref="form" :inline="true" :model="form" size="small" label-width="100px">
<el-form-item label="文件夹名称" prop="name" :rules="[
<el-form-item
label="文件夹名称"
prop="name"
:rules="[
{ required: true, message: '请输入名称', trigger: 'blur' } { required: true, message: '请输入名称', trigger: 'blur' }
]">
]"
>
<el-input v-model="form.name" style="width: 336px" /> <el-input v-model="form.name" style="width: 336px" />
</el-form-item> </el-form-item>
<el-form-item label="封面" prop="file"> <el-form-item label="封面" prop="file">
@ -160,7 +164,7 @@
</div> </div>
</template> </template>
<script> <script>
import { reqThemeGallery, reqHeaderList } from "@/api/theme/theme.js";
import { reqThemeGallery, reqHeaderList } from '@/api/theme/theme.js'
import { saveMaterial } from '@/api/material/material' import { saveMaterial } from '@/api/material/material'
import Upload from './upload' import Upload from './upload'
import UploadCover from './upload_cover' import UploadCover from './upload_cover'
@ -181,17 +185,17 @@ export default {
required: true required: true
} }
}, },
data () {
data() {
return { return {
orga_id: '133221333123111', // ID orga_id: '133221333123111', // ID
queryInfo: { queryInfo: {
theme_name: '',//
theme_class: '', //
device_direction: null,//
theme_name: '', //
theme_class: '', //
device_direction: null, //
orga_id: 133221333123111, orga_id: 133221333123111,
start_time: '', //
end_time: '', //
folder_id: '',//id
start_time: '', //
end_time: '', //
folder_id: '', // id
page: 1, page: 1,
size: 3 size: 3
}, },
@ -205,9 +209,9 @@ export default {
is_all_name: '', is_all_name: '',
is_all: false, is_all: false,
id: '', id: '',
orga_ids: ["133221333123111"],
orga_ids: ['133221333123111'],
selectName: null, selectName: null,
direction: 1, //
direction: 1, //
selectNameList: [], selectNameList: [],
img_path: '' img_path: ''
}, },
@ -221,12 +225,12 @@ export default {
name: '', name: '',
file: null file: null
}, },
themeGalleryList: [],//
themeGalleryList: [], //
formatType: null, // 0 img 1 video 2 audio formatType: null, // 0 img 1 video 2 audio
materialImgPath: '', // materialImgPath: '', //
materialDuration: 0, // materialDuration: 0, //
materialName: '', // materialName: '', //
fileSize: '',//
fileSize: '', //
listThemeData: [ listThemeData: [
{ {
id: '1', id: '1',
@ -325,19 +329,19 @@ export default {
} }
}, },
watch: { watch: {
isMultiSelected (newName, oldName) {
isMultiSelected(newName, oldName) {
if (newName === false) { if (newName === false) {
this.selectedListIds = [] this.selectedListIds = []
} }
} }
}, },
mounted () {
mounted() {
this.getThemeGallery() this.getThemeGallery()
this.getHeaderList() this.getHeaderList()
}, },
methods: { methods: {
// list // list
getThemeGallery () {
getThemeGallery() {
const params = this.queryInfo const params = this.queryInfo
reqThemeGallery(params).then(res => { reqThemeGallery(params).then(res => {
console.log(res) console.log(res)
@ -348,7 +352,7 @@ export default {
} }
}) })
}, },
getHeaderList () {
getHeaderList() {
const { orga_id } = this const { orga_id } = this
reqHeaderList(orga_id).then(res => { reqHeaderList(orga_id).then(res => {
if (res.code == 200) { if (res.code == 200) {
@ -356,12 +360,12 @@ export default {
} }
}) })
}, },
clearCheckbox (label) {
clearCheckbox(label) {
this.classifyForm.direction = label this.classifyForm.direction = label
console.log(this.classifyForm.direction) console.log(this.classifyForm.direction)
}, },
// //
handleCheckedCitiesChange (val) {
handleCheckedCitiesChange(val) {
const class_ids = [] const class_ids = []
val.forEach(item => { val.forEach(item => {
class_ids.push(item) class_ids.push(item)
@ -369,7 +373,7 @@ export default {
// console.log(class_ids) // console.log(class_ids)
}, },
// //
saveMaterial () {
saveMaterial() {
console.log('-----------') console.log('-----------')
console.log(this.formatType) console.log(this.formatType)
this.uploadDialogVisible = true this.uploadDialogVisible = true
@ -392,40 +396,40 @@ export default {
console.log(this.$refs.uploadMaterial.uploadFileUrl) console.log(this.$refs.uploadMaterial.uploadFileUrl)
}) })
const params = { const params = {
class_ids: this.class_ids, //id
deposit_url: this.uploadFileUrl, //
device_direction: this.classifyForm.direction, //
class_ids: this.class_ids, // id
deposit_url: this.uploadFileUrl, //
device_direction: this.classifyForm.direction, //
material_id: null, material_id: null,
folder_id: null,//id
img_path: this.materialImgPath, //id
folder_id: null, // id
img_path: this.materialImgPath, // id
material_type: this.formatType, material_type: this.formatType,
file_size: this.fileSize, // file_size: this.fileSize, //
orga_id: this.queryInfo.orga_id, // id orga_id: this.queryInfo.orga_id, // id
store_type: 2// 1. 2. store_type: 2// 1. 2.
} }
}, },
resetForm () {
resetForm() {
this.addDialogVisible = false this.addDialogVisible = false
this.uploadDialogVisible = false this.uploadDialogVisible = false
this.$refs.classifyForm.resetFields() this.$refs.classifyForm.resetFields()
}, },
// //
handleMkdir () {
handleMkdir() {
this.mkdirVisible = true this.mkdirVisible = true
}, },
// //
moveingTo (index) {
moveingTo(index) {
this.movingVisible = true this.movingVisible = true
// this.movingChecked = index // this.movingChecked = index
}, },
// //
wjjSelected (index) {
wjjSelected(index) {
this.movingChecked = index this.movingChecked = index
console.log(this.movingChecked) console.log(this.movingChecked)
}, },
// //
selectedItem (id) {
selectedItem(id) {
const arr = this.selectedListIds const arr = this.selectedListIds
// includes(),truefalseNaN // includes(),truefalseNaN
if (arr.includes(id)) { if (arr.includes(id)) {
@ -439,13 +443,13 @@ export default {
} }
}, },
// / // /
publishHandle (index) {
publishHandle(index) {
this.$router.push( this.$router.push(
{ {
path: '/release', query: { tag: index } path: '/release', query: { tag: index }
} }
) )
},
}
} }
} }

2
src/views/dashboard/HomeThemeGallery.vue

@ -42,6 +42,8 @@ export default {
} }
}, },
publishHandle(index) { publishHandle(index) {
localStorage.removeItem('selectedMaterial')
localStorage.removeItem('releaseId')
this.$router.push( this.$router.push(
{ {
path: '/release', query: { tag: index } path: '/release', query: { tag: index }

6
src/views/immediateRelease/index.vue

@ -465,7 +465,7 @@ export default {
FetchFindMaterialById(params).then(res => { FetchFindMaterialById(params).then(res => {
if (res.code == 200) { if (res.code == 200) {
this.selectedMaterial = res.data this.selectedMaterial = res.data
// ranking
this.selectedMaterial.filter((item, index) => { this.selectedMaterial.filter((item, index) => {
this.isEditMaterial.some(items => { this.isEditMaterial.some(items => {
if (item.material_id == items.material_id) { if (item.material_id == items.material_id) {
@ -693,7 +693,7 @@ export default {
} }
}) })
} }
localStorage.setItem('selectedMaterial', JSON.stringify(this.selectedMaterial))
// localStorage.setItem('selectedMaterial', JSON.stringify(this.selectedMaterial))
}, },
// //
clickMaterialItem(id, item) { clickMaterialItem(id, item) {
@ -779,7 +779,7 @@ export default {
}) })
} }
} }
localStorage.setItem('selectedMaterial', JSON.stringify(this.selectedMaterial))
// localStorage.setItem('selectedMaterial', JSON.stringify(this.selectedMaterial))
} else { } else {
this.selectedEditData[this.thisEditIndex].showAudioName = this.audioListData[index].material_name this.selectedEditData[this.thisEditIndex].showAudioName = this.audioListData[index].material_name
this.selectedEditData[this.thisEditIndex].showAudioUrl = this.audioListData[index].deposit_url this.selectedEditData[this.thisEditIndex].showAudioUrl = this.audioListData[index].deposit_url

Loading…
Cancel
Save