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

2
src/views/dashboard/HomeThemeGallery.vue

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

6
src/views/immediateRelease/index.vue

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

Loading…
Cancel
Save