Browse Source

素材库-发布

dev
xuhuajiao 5 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()方法判断是否包含某一元素,返回true或false表示是否包含元素,对NaN一样有效
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