|
|
@ -2,7 +2,7 @@ |
|
|
|
<div> |
|
|
|
<div v-if="isToFolder" class="material_crumbs"> |
|
|
|
<el-breadcrumb separator-class="el-icon-arrow-right"> |
|
|
|
<el-breadcrumb-item :to="{ path: '/content' }">素材库</el-breadcrumb-item> |
|
|
|
<el-breadcrumb-item><a href="/content">素材库</a></el-breadcrumb-item> |
|
|
|
<el-breadcrumb-item>{{ currentFolder }}</el-breadcrumb-item> |
|
|
|
</el-breadcrumb> |
|
|
|
</div> |
|
|
@ -10,11 +10,12 @@ |
|
|
|
<!-- 上传 / 创建文件夹 --> |
|
|
|
<div class="material_item cont_upload"> |
|
|
|
<Upload ref="uploadMaterial" @saveMaterial="saveMaterial" /> |
|
|
|
<el-button class="mkdir_btn" round type="primary" @click="handleMkdir(0)">创建文件夹</el-button> |
|
|
|
<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> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- 文件夹list --> |
|
|
|
<div v-for="(item,index) in materialFolders" :key="item.id" :class="['material_item', 'folder', { 'item_multi': folderChecked == index }]" @click="editFolder(item,index)" @dblclick="dbHandle"> |
|
|
|
<div v-for="(item,index) in materialFolders" :key="item.id" :class="['material_item', 'folder', { 'item_multi': folderChecked == index }]" @click="editFolder(item,index)" @dblclick="floderDbClick(item,index)"> |
|
|
|
<div class="icon_bg"> |
|
|
|
<svg v-if="!item.imgPath" class="font-icon icon" aria-hidden="true"> |
|
|
|
<use xlink:href="#icon-wenjianjia" /> |
|
|
@ -66,7 +67,7 @@ |
|
|
|
</el-form> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button v-if="!isEditMaterial" type="primary" round @click="submitForm('folderForm')">保 存</el-button> |
|
|
|
<el-button v-else type="primary" round @click="saveMaterial">保 存2</el-button> |
|
|
|
<el-button v-else type="primary" round @click="saveMaterial">保 存</el-button> |
|
|
|
<el-button round @click="resetForm()">取 消</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
@ -182,7 +183,9 @@ export default { |
|
|
|
layerTitle: '创建文件夹', // 文件夹/素材编辑框title |
|
|
|
labelTxt: '文件夹名称', |
|
|
|
isToFolder: false, // 是否进入文件夹 |
|
|
|
isToFolderRouter: null, |
|
|
|
currentFolder: '', // 当前进入的文件夹名 |
|
|
|
currentFolderId: null, |
|
|
|
movingVisible: false, |
|
|
|
uploadListData: [ // 上传列表 |
|
|
|
], |
|
|
@ -208,23 +211,47 @@ export default { |
|
|
|
if (newName === false) { |
|
|
|
this.selectedList = [] |
|
|
|
} |
|
|
|
}, |
|
|
|
'$route.query.folderTag'(Val) { |
|
|
|
console.log(Val) |
|
|
|
// if (Val) { |
|
|
|
// this.isToFolder = true |
|
|
|
// } else { |
|
|
|
// this.isToFolder = false |
|
|
|
// } |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted: function() { |
|
|
|
this.start() |
|
|
|
console.log(this.$route.query.folderTag) |
|
|
|
this.getMaterialList() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
dbHandle() { |
|
|
|
alert('双击了') |
|
|
|
}, |
|
|
|
|
|
|
|
// 获取素材库list |
|
|
|
getMaterialList() { |
|
|
|
const params = { |
|
|
|
'folder_id': null, |
|
|
|
'material_name': null, |
|
|
|
'material_type': null, |
|
|
|
'orga_id': this.orga_id |
|
|
|
let params |
|
|
|
if (this.$route.query.folderTag) { |
|
|
|
console.log('文件夹内') |
|
|
|
this.isToFolder = true |
|
|
|
this.currentFolder = localStorage.getItem('currentFolder') |
|
|
|
this.currentFolderId = localStorage.getItem('currentFolderId') |
|
|
|
params = { |
|
|
|
'folder_id': this.currentFolderId, |
|
|
|
'material_name': null, |
|
|
|
'material_type': null, |
|
|
|
'orga_id': this.orga_id |
|
|
|
} |
|
|
|
} else { |
|
|
|
console.log('文件夹外') |
|
|
|
this.isToFolder = false |
|
|
|
localStorage.removeItem('currentFolder') |
|
|
|
localStorage.removeItem('currentFolderId') |
|
|
|
params = { |
|
|
|
'folder_id': null, |
|
|
|
'material_name': null, |
|
|
|
'material_type': null, |
|
|
|
'orga_id': this.orga_id |
|
|
|
} |
|
|
|
} |
|
|
|
getMaterialList(params).then(res => { |
|
|
|
this.materialFolders = res.data.materialFolders |
|
|
@ -259,6 +286,20 @@ export default { |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
// 文件夹双击操作 |
|
|
|
floderDbClick(item, index) { |
|
|
|
this.isEditMaterial = false |
|
|
|
this.$router.push( |
|
|
|
{ |
|
|
|
path: '/content', query: { folderTag: 1 } |
|
|
|
} |
|
|
|
) |
|
|
|
this.currentFolder = item.name |
|
|
|
this.currentFolderId = item.id |
|
|
|
localStorage.setItem('currentFolder', this.currentFolder) |
|
|
|
localStorage.setItem('currentFolderId', this.currentFolderId) |
|
|
|
this.getMaterialList() |
|
|
|
}, |
|
|
|
// 选择 编辑 文件夹 |
|
|
|
editFolder(item, index) { |
|
|
|
this.isEditMaterial = false |
|
|
|