|
|
@ -11,7 +11,7 @@ |
|
|
|
<div class="material_item cont_upload"> |
|
|
|
<Upload ref="uploadMaterial" @saveMaterial="saveMaterial" /> |
|
|
|
<el-button v-if="!isToFolder" class="mkdir_btn" round type="primary" @click="handleMkdir(0)">创建文件夹</el-button> |
|
|
|
<el-button v-else class="mkdir_btn" round type="primary"><a href="/content">返回</a></el-button> |
|
|
|
<el-button v-else class="return_btn" round type="primary"><a href="/content">返回</a></el-button> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- 文件夹list --> |
|
|
@ -38,7 +38,7 @@ |
|
|
|
<span v-if="item.material_type !== '0'" class="item_time">{{ item.duration | getSeconds }}</span> |
|
|
|
</div> |
|
|
|
<div class="file_name">{{ item.material_name }}</div> |
|
|
|
<span v-if="isMultiSelected" class="checked_btn" @click="selectedItem(item.material_id, item.material_type)"></span> |
|
|
|
<span v-if="isMultiSelected" class="checked_btn" @click="selectedItem(item.material_id, item.in_folder_id, item.material_type)"></span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
@ -74,8 +74,8 @@ |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- 多选操作 --> |
|
|
|
<div v-if="selectedList.length !== 0 || folderChecked != -1" class="multi_handle"> |
|
|
|
<div v-if="isEditFolder != true"> |
|
|
|
<div v-if="selectedList.length != 0 || folderChecked != -1" class="multi_handle"> |
|
|
|
<div v-if="isEditFolder != true && folderChecked == -1 && isMultiSelected"> |
|
|
|
<el-button type="button" class="mulit_btn" @click="publishHandle(0)">即时发布</el-button> |
|
|
|
<el-button type="button" class="mulit_btn" @click="publishHandle(1)">定时发布</el-button> |
|
|
|
<el-button |
|
|
@ -85,7 +85,7 @@ |
|
|
|
@click="editContent()" |
|
|
|
>编辑</el-button> |
|
|
|
<el-button type="button" class="mulit_btn">下载</el-button> |
|
|
|
<el-button v-if="!isToFolder" type="button" class="mulit_btn" @click="moveingTo()">移动</el-button> |
|
|
|
<el-button type="button" class="mulit_btn" @click="moveingTo()">移动</el-button> |
|
|
|
<el-button type="button" class="mulit_btn mulit_delt_btn" @click="deleteMyMaterial">删除</el-button> |
|
|
|
</div> |
|
|
|
<div v-else> |
|
|
@ -96,7 +96,6 @@ |
|
|
|
>编辑</el-button> |
|
|
|
<el-button type="button" class="mulit_btn mulit_delt_btn" @click="deleteMaterialFolder">删除</el-button> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- 移动至layer --> |
|
|
@ -112,7 +111,7 @@ |
|
|
|
> |
|
|
|
<div class="wjj_list"> |
|
|
|
<div |
|
|
|
v-for="(item, index) in materialFolders" |
|
|
|
v-for="(item, index) in folderList" |
|
|
|
:key="index" |
|
|
|
:class="['wjj_item', { 'wjj_item_active': folderListChecked == index }]" |
|
|
|
@click="wjjSelected(item,index)" |
|
|
@ -149,18 +148,15 @@ export default { |
|
|
|
isMultiSelected: { |
|
|
|
type: Boolean, |
|
|
|
required: true |
|
|
|
}, |
|
|
|
mulitText: { |
|
|
|
type: String, |
|
|
|
required: true |
|
|
|
} |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
orga_id: '133221333123111', // 机构ID |
|
|
|
rootFolderId: null, // 根目录文件夹ID |
|
|
|
thisFoldId: null, // 当前父文件夹ID |
|
|
|
folderList: [], // 文件夹list |
|
|
|
materialFolders: [], // 文件夹list |
|
|
|
materialList: [], // 素材库list |
|
|
|
folderForm: { // form |
|
|
|
fid: '', |
|
|
|
id: '', |
|
|
@ -171,6 +167,8 @@ export default { |
|
|
|
isEditFolder: false, // 是否编辑文件夹 |
|
|
|
mkdirVisible: false, // 新建编辑layer |
|
|
|
folderChecked: -1, // 文件夹是否单击选中 |
|
|
|
materialList: [], // 素材库list |
|
|
|
isPropMultiSelected: this.isMultiSelected, |
|
|
|
isEditMaterial: false, // 是否是编辑素材 |
|
|
|
formatType: null, // 上传素材类型 0 img 1 video 2 audio |
|
|
|
materialId: null, // 编辑时需要参数 id |
|
|
@ -179,7 +177,8 @@ export default { |
|
|
|
materialDuration: 0, // 时长 |
|
|
|
materialName: '', // 素材名称 |
|
|
|
uploadFileUrl: null, // 素材保存路径 |
|
|
|
selectedList: [], // 素材选中的 |
|
|
|
selectedList: [], // 素材选中的material_id |
|
|
|
selectinFolderid: [], // 素材选中的和文件关联表id -- in_folder_id |
|
|
|
layerTitle: '创建文件夹', // 文件夹/素材编辑框title |
|
|
|
labelTxt: '文件夹名称', |
|
|
|
isToFolder: false, // 是否进入文件夹 |
|
|
@ -200,9 +199,11 @@ export default { |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
isMultiSelected(newName, oldName) { |
|
|
|
console.log('newName', newName) |
|
|
|
if (newName === false) { |
|
|
|
this.selectedList = [] |
|
|
|
} |
|
|
|
this.isPropMultiSelected = newName |
|
|
|
}, |
|
|
|
'$route.query.folderTag'(Val) { |
|
|
|
console.log(Val) |
|
|
@ -246,6 +247,9 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
getMaterialList(params).then(res => { |
|
|
|
if (!this.$route.query.folderTag) { |
|
|
|
localStorage.setItem('rootFolderId', res.data.thisFoldId) |
|
|
|
} |
|
|
|
this.materialFolders = res.data.materialFolders |
|
|
|
this.materialList = res.data.pageThemeVO |
|
|
|
// 创建文件夹获取data |
|
|
@ -281,7 +285,7 @@ export default { |
|
|
|
// 文件夹双击操作 |
|
|
|
floderDbClick(item, index) { |
|
|
|
this.isEditMaterial = false |
|
|
|
this.$router.push( |
|
|
|
this.$router.replace( |
|
|
|
{ |
|
|
|
path: '/content', query: { folderTag: 1 } |
|
|
|
} |
|
|
@ -291,15 +295,22 @@ export default { |
|
|
|
localStorage.setItem('currentFolder', this.currentFolder) |
|
|
|
localStorage.setItem('currentFolderId', this.currentFolderId) |
|
|
|
this.getMaterialList() |
|
|
|
this.selectedList = [] |
|
|
|
this.folderChecked = -1 |
|
|
|
this.isEditFolder = false |
|
|
|
}, |
|
|
|
// 点击其他区域选中的文件夹 去掉选中样式 |
|
|
|
hiddenFolderActiveClick() { |
|
|
|
this.folderChecked = -1 |
|
|
|
this.isEditFolder = false |
|
|
|
}, |
|
|
|
// 选择 编辑 文件夹 |
|
|
|
editFolder(item, index) { |
|
|
|
this.isEditMaterial = false |
|
|
|
if (index !== this.folderChecked) { |
|
|
|
this.selectedList = [] |
|
|
|
// 有选择中的文件夹时,同时存在素材多选操作时 |
|
|
|
this.$emit('changedMultiSelected') |
|
|
|
if (index != this.folderChecked) { |
|
|
|
this.folderChecked = index |
|
|
|
this.isEditFolder = true |
|
|
|
this.folderForm = { |
|
|
@ -471,18 +482,17 @@ export default { |
|
|
|
}, 200) |
|
|
|
}, |
|
|
|
// 素材 - 多选 |
|
|
|
selectedItem(id, type) { |
|
|
|
console.log(id) |
|
|
|
console.log(type) |
|
|
|
selectedItem(id, inFolderId, type) { |
|
|
|
const arr = this.selectedList |
|
|
|
if (arr.includes(id)) { |
|
|
|
const index = arr.indexOf(id) |
|
|
|
console.log(index) |
|
|
|
if (index > -1) { |
|
|
|
arr.splice(index, 1) |
|
|
|
this.selectinFolderid.splice(index, 1) |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.selectedList.push(id) |
|
|
|
this.selectinFolderid.push(inFolderId) |
|
|
|
this.formatType = type |
|
|
|
} |
|
|
|
}, |
|
|
@ -518,21 +528,41 @@ export default { |
|
|
|
}, |
|
|
|
// 点击-移动btn |
|
|
|
moveingTo(index) { |
|
|
|
this.folderList = [] |
|
|
|
if (this.materialFolders.length > 0) { |
|
|
|
this.folderList = this.materialFolders.slice(0, this.materialFolders.length) |
|
|
|
} |
|
|
|
this.rootFolderId = localStorage.getItem('rootFolderId') |
|
|
|
const returnFolder = { |
|
|
|
id: this.rootFolderId, |
|
|
|
name: '返回上一级' |
|
|
|
} |
|
|
|
this.folderList.unshift(returnFolder) |
|
|
|
this.movingVisible = true |
|
|
|
}, |
|
|
|
// 文件夹list - 选中操作 |
|
|
|
wjjSelected(item, index) { |
|
|
|
console.log(item) |
|
|
|
this.folderListChecked = index |
|
|
|
this.thisFoldId = item.id |
|
|
|
console.log(this.folderListChecked) |
|
|
|
}, |
|
|
|
// 点击确定 - 移动素材 |
|
|
|
moveFile() { |
|
|
|
if (this.materialFolders.length > 0) { |
|
|
|
console.log(this.materialFolders) |
|
|
|
if (this.thisFoldId == this.rootFolderId) { |
|
|
|
this.$message({ |
|
|
|
message: '不能讲文件移动到自身目录下哦~', |
|
|
|
type: 'error' |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.thisFoldId = this.rootFolderId |
|
|
|
} |
|
|
|
const params = { |
|
|
|
'folder_id': this.thisFoldId, |
|
|
|
'ids': this.selectedList, |
|
|
|
'material_id': null |
|
|
|
'ids': this.selectinFolderid, |
|
|
|
'material_ids': this.selectedList |
|
|
|
} |
|
|
|
moveMyMaterial(params).then(res => { |
|
|
|
if (res.code === 200) { |
|
|
@ -541,6 +571,8 @@ export default { |
|
|
|
type: 'success' |
|
|
|
}) |
|
|
|
this.movingVisible = false |
|
|
|
this.getMaterialList() |
|
|
|
this.selectedList = [] |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|