Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
V
VS_OUTSOURCE
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵炳峰
VS_OUTSOURCE
Commits
33a312be
Commit
33a312be
authored
Nov 29, 2020
by
fangshupeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新进度
parent
34c9189c
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
514 additions
and
379 deletions
+514
-379
schoolBasedResourcesApi.js
VSSCMP_WEB/src/api/schoolBasedResourcesApi.js
+16
-0
Index.vue
...ges/education/schoolBasedResources/folderManage/Index.vue
+118
-154
ManageCtxMenu.vue
...lBasedResources/folderManage/components/ManageCtxMenu.vue
+103
-34
MyUpload.vue
...s/education/schoolBasedResources/myResources/MyUpload.vue
+93
-19
MyuploadCtxMenu.vue
...BasedResources/myResources/components/MyuploadCtxMenu.vue
+34
-12
SmallFolder.vue
...hoolBasedResources/myResources/components/SmallFolder.vue
+24
-6
Index.vue
.../education/schoolBasedResources/schoolResources/Index.vue
+1
-17
ResourcesInSchoold.vue
...hoolBasedResources/schoolResources/ResourcesInSchoold.vue
+125
-137
No files found.
VSSCMP_WEB/src/api/schoolBasedResourcesApi.js
View file @
33a312be
...
...
@@ -45,8 +45,24 @@ export default {
deleteFolder
(
params
)
{
return
http
.
get
(
'/api/Education/SchoolResource/PersonalFolderInfo/Delete'
,
{
params
:
params
})
},
// 删除文件
deleteFile
(
params
)
{
return
http
.
get
(
'/api/Education/SchoolResource/FileInfo/DeleteFile'
,
{
params
:
params
})
},
// 修改文件名称
updateFileName
(
params
)
{
return
http
.
post
(
'/api/Education/SchoolResource/FileInfo/UpdateFileName'
,
{
params
:
params
})
},
// 获取学校文件夹List
GetSchoolFolderList
()
{
return
http
.
post
(
'/api/Education/SchoolResource/SchoolFolderInfo/GetSchoolFolderList'
)
},
// 新增编辑学校文件夹
createOrUpdateSchool
(
params
)
{
return
http
.
post
(
'/api/Education/SchoolResource/SchoolFolderInfo/CreateOrUpdate'
,
{
params
:
params
})
},
// 获取校内资源文件夹List
getSchoolResourceFolderList
()
{
return
http
.
post
(
'/api/Education/SchoolResource/GetFolderList'
)
}
}
VSSCMP_WEB/src/pages/education/schoolBasedResources/folderManage/Index.vue
View file @
33a312be
...
...
@@ -8,7 +8,7 @@
v-for=
"(breadcrumbItem, index) of breadcrumb"
:key=
"index"
@
click
.
native=
"backCrumb(index)"
>
{{
breadcrumbItem
.
name
}}
{{
breadcrumbItem
.
label
}}
</el-breadcrumb-item>
</el-breadcrumb>
</div>
...
...
@@ -18,7 +18,9 @@
<div
class=
"smallCtn"
>
<small-folder
:file-list=
"currentFileList"
:currentIsFiLe=
"currentIsFiLe"
:manage-mode=
"true"
:mode=
"'school'"
@
showMenu=
"showMenu"
@
tableIntoFile=
"intoFolder"
>
</small-folder>
...
...
@@ -27,21 +29,15 @@
<!-- 右键菜单栏 -->
<manage-ctx-menu
ref=
"contextMenu"
:menuVisible=
"menuVisible"
:rightMenuData=
"rightMenuData"
:rightMenuFolder=
"rightMenuFolder"
:coordinate=
"coordinate"
:menuMode=
"menuMode"
@
menuOpenFile=
"intoFolder"
>
@
menuOpenFile=
"intoFolder"
@
createOrUpdateFolder=
"createOrUpdateFolder"
>
</manage-ctx-menu>
<!-- 侧滑块查看普通文档 -->
<el-drawer
title=
"查看"
:visible
.
sync=
"documentDrawer"
:size=
"'60%'"
>
<span>
文档内容
</span>
</el-drawer>
<button
v-show=
"false"
ref=
"btn"
@
click=
"currentIsFiLe = true"
>
设置当前页面为文件模式
</button>
</div>
</
template
>
...
...
@@ -57,129 +53,18 @@ export default {
return
{
menuVisible
:
false
,
// 右键菜单栏
menuMode
:
''
,
// 菜单根据模式显示对于内容
documentDrawer
:
false
,
// 查看文档抽屉
rightMenuData
:
{},
// 右键选中文件夹或文件数据
rightMenuFolder
:
[],
// 右键空白储存当前文件夹数据
currentIsFiLe
:
false
,
// 当前层次是否为文档列表
coordinate
:
{
// 菜单栏坐标
menuX
:
'0px'
,
menuY
:
'0px'
},
breadcrumb
:
[
// 面包屑
{
name
:
'首页'
,
isFolder
:
true
,
folderName
:
'firstLevelData'
}
],
breadcrumb
:
[],
currentFileList
:
[],
fileListData
:
{
firstLevelData
:
[
{
id
:
1201
,
name
:
'教案文件夹'
,
typeName
:
'任务文件夹'
,
type
:
'folder'
,
icon
:
'el-icon-folder'
,
descript
:
'我上传了10个文档'
,
documentCount
:
'1000'
,
private
:
'不公开'
,
isFocus
:
false
,
isFolder
:
true
,
folderData
:
'secondLevelData'
,
nextIsFolder
:
false
,
uploadCount
:
'10'
,
author
:
'张三'
,
updateTime
:
'2020-08-22 12:00'
},
{
id
:
1202
,
name
:
'教案文件夹'
,
typeName
:
'常规文件夹'
,
type
:
'folder'
,
icon
:
'el-icon-folder'
,
descript
:
'我上传了10个文档'
,
documentCount
:
'220'
,
private
:
'对所有教师公开'
,
isFocus
:
false
,
isFolder
:
true
,
folderData
:
'secondLevelData'
,
nextIsFolder
:
false
,
uploadCount
:
'10'
,
author
:
'张三'
,
updateTime
:
'2020-08-22 12:00'
},
{
id
:
1203
,
name
:
'教案文件夹'
,
typeName
:
'常规文件夹'
,
type
:
'folder'
,
icon
:
'el-icon-folder'
,
descript
:
'我上传了10个文档'
,
documentCount
:
'80'
,
private
:
'对所有教师公开'
,
isFocus
:
false
,
isFolder
:
true
,
folderData
:
'secondLevelData'
,
nextIsFolder
:
false
,
uploadCount
:
'10'
,
author
:
'张三'
,
updateTime
:
'2020-08-22 12:00'
}
],
secondLevelData
:
[
{
id
:
1001
,
name
:
'第二级文件夹'
,
typeName
:
'常规文件夹'
,
type
:
'folder'
,
icon
:
'el-icon-folder'
,
descript
:
'我上传了10个文档'
,
documentCount
:
'80'
,
private
:
'对所有教师公开'
,
isFocus
:
false
,
isFolder
:
true
,
folderData
:
'thirdLevelData'
,
nextIsFolder
:
false
,
uploadCount
:
'10'
,
author
:
'张三'
,
updateTime
:
'2020-08-22 12:00'
},
{
id
:
1002
,
name
:
'第二级文件夹'
,
typeName
:
'教案文件夹'
,
type
:
'folder'
,
icon
:
'el-icon-folder'
,
descript
:
'我上传了10个文档'
,
documentCount
:
'80'
,
private
:
'对所有教师公开'
,
isFocus
:
false
,
isFolder
:
true
,
folderData
:
'thirdLevelData'
,
nextIsFolder
:
false
,
uploadCount
:
'10'
,
author
:
'张三'
,
updateTime
:
'2020-08-22 12:00'
}
],
thirdLevelData
:
[
{
id
:
1101
,
name
:
'第三级文件.txt'
,
typeName
:
'文件'
,
type
:
'folder'
,
icon
:
'el-icon-document'
,
descript
:
'我上传了10个文档'
,
documentCount
:
'80'
,
private
:
'对所有教师公开'
,
isFocus
:
false
,
isFolder
:
false
,
nextIsFolder
:
false
,
uploadCount
:
'10'
,
author
:
'张三'
,
updateTime
:
'2020-08-22 12:00'
}
]
paginationQuery
:
{
// 分页信息
amount
:
0
,
pageSize
:
50
,
pageIndex
:
1
}
}
},
...
...
@@ -190,51 +75,131 @@ export default {
getFolderList
()
{
this
.
$api
.
schoolBasedResourcesApi
.
GetSchoolFolderList
().
then
(
res
=>
{
this
.
$handleResponse
(
res
).
then
(
data
=>
{
console
.
log
(
data
)
// this.folderListData = data
// this.currentFileList = data
// this.breadcrumb = [{ label: '首页', listData: data, parent: { b_id: '0' }, currentIsFiLe: false }]
// this.initFromBreadcrumb(data)
this
.
initFromBreadcrumb
(
data
)
})
})
},
initFromBreadcrumb
(
data
)
{
/* 通过面包屑初始化数据 */
this
.
currentIsFile
=
false
let
breadcrumb
=
this
.
breadcrumb
if
(
breadcrumb
.
length
<=
1
)
{
this
.
breadcrumb
=
[{
label
:
'首页'
,
listData
:
data
,
parent
:
{
b_id
:
'0'
,
parent_id
:
'0'
},
currentIsFiLe
:
false
}]
this
.
currentFileList
=
data
}
else
{
let
newBreadcrumb
=
[{
label
:
'首页'
,
listData
:
data
,
parent
:
{
b_id
:
'0'
,
parent_id
:
'0'
},
currentIsFiLe
:
false
}]
let
currentList
=
data
for
(
let
i
=
1
;
i
<
breadcrumb
.
length
;
i
++
)
{
let
hasThisFile
=
false
for
(
let
j
=
0
;
j
<
currentList
.
length
;
j
++
)
{
if
(
currentList
[
j
].
b_id
===
breadcrumb
[
i
].
parent
.
b_id
)
{
let
isFile
=
(
!
currentList
[
j
].
children
||
currentList
[
j
].
children
.
length
===
0
)
&&
currentList
[
j
].
file_count
>
0
this
.
currentIsFile
=
isFile
this
.
addCrumb
(
newBreadcrumb
,
currentList
[
j
],
isFile
)
if
(
isFile
)
{
this
.
getFileList
(
currentList
[
j
])
}
else
{
currentList
=
currentList
[
j
].
children
}
hasThisFile
=
true
break
}
}
if
(
hasThisFile
===
false
)
{
break
}
}
this
.
breadcrumb
=
newBreadcrumb
if
(
!
this
.
currentIsFile
)
{
this
.
currentFileList
=
currentList
}
}
},
getFileList
(
file
)
{
/* 根据文件夹ID获取对应文件列表 */
this
.
$refs
.
btn
.
click
()
const
folderId
=
file
.
b_id
const
selType
=
file
.
folder_type
let
data
=
{
data
:
{
folder_id
:
folderId
,
sel_type
:
selType
},
PageSize
:
this
.
paginationQuery
.
pageSize
,
PageNumber
:
this
.
paginationQuery
.
pageIndex
}
this
.
$api
.
schoolBasedResourcesApi
.
GetFileList
(
data
).
then
(
res
=>
{
this
.
$handleResponse
(
res
).
then
(
data
=>
{
this
.
currentFileList
=
data
.
Data
this
.
paginationQuery
.
amount
=
data
.
TotalRecords
})
})
},
backCrumb
(
index
)
{
this
.
isFileMode
=
false
/* 点击面包屑返回前几级 */
let
breadcrumb
=
this
.
breadcrumb
let
item
=
breadcrumb
[
index
]
this
.
currentIsFiLe
=
false
if
(
index
<
breadcrumb
.
length
-
1
)
{
let
folderName
=
breadcrumb
[
index
].
folderName
this
.
currentFileList
=
this
.
fileListData
[
folderName
]
this
.
currentFileList
=
item
.
listData
this
.
breadcrumb
=
breadcrumb
.
slice
(
0
,
index
+
1
)
}
},
addCrumb
(
breadcrumb
,
file
,
currentIsFiLe
)
{
/* 添加面包屑 */
breadcrumb
.
push
({
label
:
file
.
folder_name
,
listData
:
file
.
children
,
parent
:
file
,
currentIsFiLe
})
},
intoFolder
(
file
)
{
/* 进入下一级文件夹 */
if
(
file
.
isFolder
)
{
// 双击文件夹
let
breadcrumbData
=
{
name
:
file
.
name
,
isFolder
:
file
.
isFolder
,
folderName
:
file
.
folderData
}
this
.
breadcrumb
.
push
(
breadcrumbData
)
this
.
currentFileList
=
this
.
fileListData
[
file
.
folderData
]
/* 进入下一级文件夹 */
if
((
file
.
children
&&
file
.
children
.
length
>
0
&&
this
.
currentIsFiLe
===
false
)
||
(
file
.
file_count
===
0
&&
this
.
breadcrumb
.
length
<
3
))
{
// 进入文件夹
this
.
currentIsFiLe
=
false
this
.
addCrumb
(
this
.
breadcrumb
,
file
,
this
.
currentIsFiLe
)
this
.
currentFileList
=
file
.
children
}
else
{
// 获取当前文件夹的文档列表
if
(
this
.
currentIsFiLe
===
false
)
{
this
.
currentIsFiLe
=
true
this
.
addCrumb
(
this
.
breadcrumb
,
file
,
this
.
currentIsFiLe
)
this
.
getFileList
(
file
)
}
else
{
// 双击文件
let
url
=
'https://onlinepreview.vschool100.cn/onlinePreview?url='
+
encodeURIComponent
(
file
.
file_path
)
this
.
documentUrl
=
url
this
.
documentDrawer
=
true
}
}
},
showMenu
(
MouseEvent
,
type
,
row
)
{
createOrUpdateFolder
(
params
)
{
/* 新增编辑学校文件夹 */
this
.
$api
.
schoolBasedResourcesApi
.
createOrUpdateSchool
(
params
).
then
(
res
=>
{
if
(
res
.
data
.
Status
===
true
)
{
this
.
$message
({
message
:
'操作成功'
,
type
:
'success'
})
this
.
$refs
.
contextMenu
.
userSelector
.
visible
=
false
this
.
getFolderList
()
}
else
{
this
.
$message
({
message
:
res
.
data
.
ResponseError
.
LongMessage
,
type
:
'error'
})
}
})
},
showMenu
(
MouseEvent
,
currentIsFiLe
,
row
)
{
/* 右键文件夹或文件时触发 */
if
(
type
)
{
if
(
row
)
{
// 右键文件夹或者文件
this
.
menuMode
=
type
if
(
currentIsFiLe
)
{
this
.
menuMode
=
''
}
else
{
this
.
menuMode
=
'personal'
}
this
.
rightMenuData
=
row
this
.
rightMenuFolder
=
[]
//
this.rightMenuFolder = []
}
else
{
// 右键空白处
this
.
menuMode
=
'blank'
this
.
rightMenuFolder
=
this
.
currentFileList
this
.
rightMenuData
=
{}
this
.
rightMenuData
=
this
.
breadcrumb
[
this
.
breadcrumb
.
length
-
1
].
parent
}
this
.
menuVisible
=
false
this
.
menuVisible
=
true
...
...
@@ -255,7 +220,6 @@ export default {
<
style
lang=
"less"
scoped
>
.container {
.headerNav {
display: flex;
justify-content: space-between;
...
...
VSSCMP_WEB/src/pages/education/schoolBasedResources/folderManage/components/ManageCtxMenu.vue
View file @
33a312be
...
...
@@ -6,15 +6,15 @@
<li
class=
"menu_item padding_35"
v-show=
"menuMode !== 'blank'"
@
click=
"clickFile"
>
打开
</li>
<li
class=
"menu_item padding_35"
v-show=
"menuMode !== 'blank'"
>
编辑
</li>
<li
class=
"menu_item padding_35"
v-show=
"menuMode !== 'blank'"
@
click=
"deleteVisible = true"
>
删除
</li>
<li
class=
"menu_item"
style=
"text-align:center"
v-show=
"menuMode === 'blank' &&
rightMenuFolder[0].isFolder
"
@
click=
"newFolderVisible = true"
>
新建文件夹
</li>
<li
class=
"menu_item"
style=
"text-align:center"
v-show=
"menuMode === 'blank' &&
!currentIsFiLe
"
@
click=
"newFolderVisible = true"
>
新建文件夹
</li>
</ul>
<
ul
class=
"menu"
style=
'width:230px'
v-show=
"menuMode === 'blank' && !rightMenuFolder[0].isFolder
"
>
<
!--
<ul
class=
"menu"
style=
'width:230px'
v-show=
"menuMode === 'blank' && currentIsFiLe
"
>
<li
class=
"menu_item"
style=
"text-align:center"
>
合并所有文档到新文件夹
</li>
</ul>
</ul>
-->
</div>
<!-- 新建文件夹窗口 -->
<el-dialog
title=
"新建个人文件夹"
class=
"newfile-dialog"
:visible
.
sync=
"newFolderVisible"
width=
"7
0
0px"
:close-on-click-modal=
"false"
>
<el-dialog
title=
"新建个人文件夹"
class=
"newfile-dialog"
:visible
.
sync=
"newFolderVisible"
width=
"7
5
0px"
:close-on-click-modal=
"false"
>
<el-form
:model=
"ruleForm"
:rules=
"ruleForm.folderType === 'usual'?usualRules:taskRules"
ref=
"ruleForm"
label-width=
"100px"
class=
"demo-ruleForm"
>
<el-form-item
label=
"文件夹名称"
prop=
"name"
>
<el-input
placeholder=
"请输入..."
v-model=
"ruleForm.name"
></el-input>
...
...
@@ -37,22 +37,23 @@
<el-radio
label=
"private"
>
不公开
</el-radio>
<el-radio
label=
"publicToAll"
>
对所有教师公开
</el-radio>
<el-radio
label=
"publickToPart"
>
对部分教师公开
</el-radio>
<span
style=
"display:inline-block"
class=
"add-teacher-ctn"
v-if=
"ruleForm.private === 'publickToPart'"
>
<el-button
class=
"person-btn"
icon=
"el-icon-plus"
@
click=
"teacherSelectorOptions.isBlock = true"
>
添加教师
</el-button>
</span>
</el-radio-group>
<span
style=
"display:inline-block;margin:0 10px;"
class=
"add-teacher-ctn"
v-if=
"ruleForm.private === 'publickToPart'"
>
<el-button
class=
"person-btn"
icon=
"el-icon-plus"
@
click=
"handleSelect('publicTeacher')"
>
添加教师
</el-button>
<span
class=
"person-count"
>
已选择
<span
style=
"color:blue"
>
{{
ruleForm
.
publicTeacher
.
length
}}
</span>
人
</span>
</span>
</el-form-item>
<el-form-item
class=
"limit-ctn"
v-if=
"ruleForm.folderType === 'task'"
label=
"每人上传数"
prop=
"limitCount"
>
<el-radio-group
v-model=
"ruleForm.limitCount"
>
<el-radio
label=
"limit"
>
限制数量
</el-radio>
<span
style=
"display:inline-block;width:100px"
v-if=
"ruleForm.limitCount === 'limit'"
><el-input
v-model=
"input
"
placeholder=
"请输入..."
></el-input></span>
<span
style=
"display:inline-block;width:100px"
v-if=
"ruleForm.limitCount === 'limit'"
><el-input
type=
"number"
v-model=
"ruleForm.limitCountNumber
"
placeholder=
"请输入..."
></el-input></span>
<el-radio
label=
"noLimit"
>
不限制数量
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"管理者"
prop=
"manager"
>
<div
class=
"header-ctn"
>
<el-button
class=
"person-btn"
icon=
"el-icon-plus"
@
click=
"
teacherSelectorOptions.isBlock = true
"
>
添加教师
</el-button>
<span
class=
"person-count"
>
已选择
<span
style=
"color:blue"
>
2
</span>
人
</span>
<el-button
class=
"person-btn"
icon=
"el-icon-plus"
@
click=
"
handleSelect('manager')
"
>
添加教师
</el-button>
<span
class=
"person-count"
>
已选择
<span
style=
"color:blue"
>
{{
ruleForm
.
manager
.
length
}}
</span>
人
</span>
</div>
<div
class=
"tag-ctn"
>
<el-tag
...
...
@@ -62,17 +63,18 @@
type=
"info"
color=
"#F2F2F2"
size=
"medium"
@
close=
"deleteManagerUser(index)"
closable
>
{{
tag
.
name
}}
{{
tag
.
real
name
}}
</el-tag>
</div>
</el-form-item>
<el-form-item
v-if=
"ruleForm.folderType === 'task'"
label=
"教师"
prop=
"uploadTeacher"
>
<el-form-item
v-if=
"ruleForm.folderType === 'task'"
label=
"
上传
教师"
prop=
"uploadTeacher"
>
<div
class=
"header-ctn"
>
<el-button
class=
"person-btn"
icon=
"el-icon-plus"
@
click=
"
teacherSelectorOptions.isBlock = true
"
>
添加教师
</el-button>
<span
class=
"person-count"
>
已选择
<span
style=
"color:blue"
>
2
</span>
人
</span>
<el-button
class=
"person-btn"
icon=
"el-icon-plus"
@
click=
"
handleSelect('uploadTeacher')
"
>
添加教师
</el-button>
<span
class=
"person-count"
>
已选择
<span
style=
"color:blue"
>
{{
ruleForm
.
uploadTeacher
.
length
}}
</span>
人
</span>
</div>
<div
class=
"tag-ctn"
>
<
!--
<
div
class=
"tag-ctn"
>
<el-tag
v-for=
"(tag, index) in ruleForm.uploadTeacher"
:key=
"index"
...
...
@@ -83,16 +85,12 @@
closable
>
{{
tag
.
name
}}
</el-tag>
</div>
</div>
-->
</el-form-item>
<el-form-item
class=
"submit-ctn"
>
<el-button
size=
"medium"
type=
"primary"
@
click=
"
newFolderVisible = false
"
>
保存
</el-button>
<el-button
size=
"medium"
type=
"primary"
@
click=
"
hanlderCreateOrUpdate('ruleForm')
"
>
保存
</el-button>
</el-form-item>
</el-form>
<teacher-selector
:teacherSelectorOptions=
"teacherSelectorOptions"
@
closeTeacherSelector=
"teacherSelectorOptions.isBlock = false"
>
</teacher-selector>
</el-dialog>
<!-- 删除文件窗口 -->
...
...
@@ -103,6 +101,12 @@
<el-button
type=
"primary"
@
click=
"deleteVisible = false"
>
确 定
</el-button>
</div>
</el-dialog>
<userselector
:mode=
"userSelector.mode"
:list=
"userSelector.list"
:visible
.
sync=
"userSelector.visible"
@
submit=
"selectUser"
/>
</div>
</
template
>
...
...
@@ -115,6 +119,10 @@ export default {
type
:
Boolean
,
default
:
false
},
currentIsFiLe
:
{
// 当前层次是否为文档列表
type
:
Boolean
,
default
:
false
},
rightMenuData
:
{
// 右键文件的数据
type
:
Object
,
default
:
()
=>
{
...
...
@@ -139,14 +147,16 @@ export default {
}
},
components
:
{
TeacherSelector
:
()
=>
import
(
'@/common/Teach
erSelector'
)
userselector
:
()
=>
import
(
'@/common/userSelector/Us
erSelector'
)
},
data
()
{
return
{
teacherSelectorOptions
:
{
isBlock
:
false
,
isShow
:
true
userSelector
:
{
mode
:
'teacherCheckbox'
,
list
:
[],
visible
:
false
},
seletorListName
:
''
,
// 当前需要选人的用户列表名
newFolderVisible
:
false
,
newFolderName
:
''
,
deleteVisible
:
false
,
...
...
@@ -160,15 +170,11 @@ export default {
folderType
:
'usual'
,
private
:
'private'
,
limitCount
:
'limit'
,
limitCountNumber
:
0
,
uploadCount
:
''
,
manager
:
[
{
name
:
'标某某'
},
{
name
:
'某某某'
}
],
uploadTeacher
:
[
{
name
:
'标某某'
},
{
name
:
'某某某'
}
]
publicTeacher
:
[],
manager
:
[],
uploadTeacher
:
[]
},
usualRules
:
{
name
:
[
...
...
@@ -199,6 +205,69 @@ export default {
clickFile
()
{
let
file
=
this
.
rightMenuData
this
.
$emit
(
'menuOpenFile'
,
file
)
},
handleSelect
(
listName
)
{
/* 根据选择教师按钮类型来定义接收list的值 */
this
.
seletorListName
=
listName
this
.
userSelector
.
list
=
this
.
ruleForm
[
listName
]
this
.
userSelector
.
visible
=
true
},
deleteManagerUser
(
index
)
{
this
.
ruleForm
.
manager
.
splice
(
index
,
1
)
},
selectUser
(
list
)
{
this
.
ruleForm
[
this
.
seletorListName
]
=
list
},
hanlderCreateOrUpdate
(
formName
)
{
/* 新建或修改学校文件夹 */
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
let
data
let
form
=
this
.
ruleForm
let
folderType
=
form
.
folderType
===
'usual'
?
1
:
2
let
isPublic
=
form
.
private
===
'private'
?
1
:
(
form
.
private
===
'publicToAll'
?
2
:
3
)
let
publicTeacher
=
this
.
userListToString
(
form
.
publicTeacher
)
let
manager
=
this
.
userListToString
(
form
.
manager
)
let
uploadTeacher
=
this
.
userListToString
(
form
.
uploadTeacher
)
let
uploadCount
=
folderType
===
1
?
0
:
(
form
.
limitCount
===
'limit'
?
1
:
2
)
data
=
{
b_id
:
undefined
,
parent_id
:
this
.
rightMenuData
.
b_id
,
step_number
:
this
.
rightMenuData
.
step_number
+
1
||
1
,
folder_name
:
form
.
name
,
folder_type
:
folderType
,
is_public
:
isPublic
,
public_user_ids
:
isPublic
===
3
?
publicTeacher
.
userIds
:
undefined
,
public_user_names
:
isPublic
===
3
?
publicTeacher
.
userNames
:
undefined
,
manage_user_ids
:
manager
.
userIds
,
manage_user_names
:
manager
.
userNames
,
upload_count
:
uploadCount
,
limit_count
:
uploadCount
===
1
?
parseInt
(
form
.
limitCountNumber
)
:
undefined
,
teacher_user_ids
:
folderType
===
2
?
uploadTeacher
.
userIds
:
undefined
,
teacher_user_names
:
folderType
===
2
?
uploadTeacher
.
userNames
:
undefined
}
this
.
$emit
(
'createOrUpdateFolder'
,
data
)
}
else
{
console
.
log
(
'error submit!!'
)
return
false
}
})
},
userListToString
(
userList
)
{
let
data
=
{
userIds
:
''
,
userNames
:
''
}
for
(
let
i
=
0
;
i
<
userList
.
length
;
i
++
)
{
if
(
i
===
0
)
{
data
.
userIds
+=
userList
[
i
].
id
data
.
userNames
+=
userList
[
i
].
realname
}
else
{
data
.
userIds
+=
','
+
userList
[
i
].
id
data
.
userNames
+=
','
+
userList
[
i
].
realname
}
}
return
data
}
}
}
...
...
@@ -268,7 +337,7 @@ export default {
/deep/ .submit-ctn {
.el-button {
margin-left:
145
px;
margin-left:
220
px;
margin-top: 50px;
}
}
...
...
VSSCMP_WEB/src/pages/education/schoolBasedResources/myResources/MyUpload.vue
View file @
33a312be
...
...
@@ -6,12 +6,20 @@
<el-breadcrumb-item
v-for=
"(breadcrumbItem, index) of breadcrumb"
:key=
"index"
@
click
.
native=
"backCrumb(
breadcrumbItem,
index)"
>
@
click
.
native=
"backCrumb(index)"
>
{{
breadcrumbItem
.
label
}}
</el-breadcrumb-item>
</el-breadcrumb>
</div>
<div
class=
"rightNav"
>
<el-select
style=
"margin:2px 15px 0 0"
class=
"timer-select"
v-show=
"currentIsFiLe"
v-model=
"timeSelect"
placeholder=
"请选择"
>
<el-option
v-for=
"item in termOptions"
:key=
"item.ID"
:label=
"item.TeamName"
:value=
"item.ID"
>
</el-option>
</el-select>
<search></search>
<div
class=
"feature"
v-show=
"!currentIsFiLe"
>
<div
:class=
"
{'icon-sel': bigMode}" class="icon-ctn" @click="bigMode = true">
...
...
@@ -27,10 +35,13 @@
<component
:is=
"(bigMode && currentIsFiLe === false)?'big-folder':'small-folder'"
:file-list=
"currentFileList"
:currentIsFiLe=
"currentIsFiLe"
:pagination-query=
"paginationQuery"
@
showMenu=
"showMenu"
@
intoFolder=
"intoFolder"
@
dragUploadFile=
"dragUploadFile"
@
tableIntoFile=
"intoFolder"
>
@
tableIntoFile=
"intoFolder"
@
getSizeChange=
"handleSizeChange"
@
getCurrentPage=
"handleCurrentChange"
>
</component>
</div>
...
...
@@ -67,7 +78,7 @@
</el-drawer>
<input
v-show=
"false"
type=
"file"
ref=
"fileUpload"
@
change=
"uploadfileChange"
/>
<
!--
<button
@
click=
"getFolderList"
>
重排
</button>
--
>
<
button
v-show=
"false"
ref=
"btn"
@
click=
"currentIsFiLe = true"
>
设置当前页面为文件模式
</button
>
</div>
</
template
>
...
...
@@ -89,6 +100,11 @@ export default {
currentComponent
:
'BigFolder'
,
// BigFolder 大图标模式,SmallFolder 小图标模式
bigMode
:
true
,
// 文件夹大小图标模式
currentIsFiLe
:
false
,
// 当前层次是否为文档列表
timeSelect
:
'allItem'
,
// 学期选择框数据
termOptions
:
[{
// 学期选择options
value
:
'allItem'
,
label
:
'全部学期'
}],
menuVisible
:
false
,
// 右键菜单栏
menuMode
:
''
,
// 菜单根据模式显示对于内容
uploadVisible
:
false
,
// 上传菜单栏
...
...
@@ -110,11 +126,17 @@ export default {
file
:
null
,
folderId
:
''
,
isdrag
:
false
// 当时是否是拖拽获得文件信息
},
paginationQuery
:
{
// 分页信息
amount
:
0
,
pageSize
:
50
,
pageIndex
:
1
}
}
},
mounted
()
{
this
.
getFolderList
()
this
.
getTermList
()
},
created
()
{
},
...
...
@@ -122,13 +144,19 @@ export default {
getFolderList
()
{
this
.
$api
.
schoolBasedResourcesApi
.
GetFolderList
().
then
(
res
=>
{
this
.
$handleResponse
(
res
).
then
(
data
=>
{
// this.folderListData = data
// this.currentFileList = data
// this.breadcrumb = [{ label: '首页', listData: data, parent: { b_id: '0' }, currentIsFiLe: false }]
this
.
initFromBreadcrumb
(
data
)
})
})
},
getTermList
()
{
/* 获取学期列表 */
this
.
$api
.
commonApi
.
getTermInfoList
().
then
(
res
=>
{
this
.
$handleResponse
(
res
).
then
(
data
=>
{
this
.
termOptions
=
data
this
.
timeSelect
=
data
[
0
].
ID
})
})
},
initFromBreadcrumb
(
data
)
{
/* 通过面包屑初始化数据 */
this
.
currentIsFile
=
false
...
...
@@ -143,9 +171,10 @@ export default {
let
hasThisFile
=
false
for
(
let
j
=
0
;
j
<
currentList
.
length
;
j
++
)
{
if
(
currentList
[
j
].
b_id
===
breadcrumb
[
i
].
parent
.
b_id
)
{
this
.
currentIsFile
=
breadcrumb
[
i
].
currentIsFiLe
this
.
addCrumb
(
newBreadcrumb
,
currentList
[
j
],
breadcrumb
[
i
].
currentIsFiLe
)
if
(
breadcrumb
[
i
].
currentIsFiLe
===
true
)
{
let
isFile
=
(
!
currentList
[
j
].
children
||
currentList
[
j
].
children
.
length
===
0
)
&&
currentList
[
j
].
file_count
>
0
this
.
currentIsFile
=
isFile
this
.
addCrumb
(
newBreadcrumb
,
currentList
[
j
],
isFile
)
if
(
isFile
)
{
this
.
getFileList
(
currentList
[
j
])
}
else
{
currentList
=
currentList
[
j
].
children
...
...
@@ -165,22 +194,25 @@ export default {
}
},
getFileList
(
file
)
{
this
.
$refs
.
btn
.
click
()
const
folderId
=
file
.
b_id
const
selType
=
file
.
folder_type
let
data
=
{
data
:
{
folder_id
:
folderId
,
sel_type
:
selType
},
PageSize
:
50
,
PageNumber
:
1
PageSize
:
this
.
paginationQuery
.
pageSize
,
PageNumber
:
this
.
paginationQuery
.
pageIndex
}
this
.
$api
.
schoolBasedResourcesApi
.
GetFileList
(
data
).
then
(
res
=>
{
this
.
$handleResponse
(
res
).
then
(
data
=>
{
this
.
currentFileList
=
data
.
Data
this
.
paginationQuery
.
amount
=
data
.
TotalRecords
})
})
},
backCrumb
(
i
tem
,
i
ndex
)
{
backCrumb
(
index
)
{
/* 点击面包屑返回前几级 */
let
breadcrumb
=
this
.
breadcrumb
let
item
=
breadcrumb
[
index
]
this
.
currentIsFiLe
=
false
if
(
index
<
breadcrumb
.
length
-
1
)
{
this
.
currentFileList
=
item
.
listData
...
...
@@ -193,7 +225,6 @@ export default {
},
intoFolder
(
file
)
{
/* 进入下一级文件夹 */
console
.
log
(
this
.
breadcrumb
.
length
)
if
((
file
.
children
&&
file
.
children
.
length
>
0
&&
this
.
currentIsFiLe
===
false
)
||
(
file
.
file_count
===
0
&&
this
.
breadcrumb
.
length
<
3
))
{
// 进入文件夹
this
.
currentIsFiLe
=
false
...
...
@@ -206,7 +237,6 @@ export default {
this
.
addCrumb
(
this
.
breadcrumb
,
file
,
this
.
currentIsFiLe
)
this
.
getFileList
(
file
)
}
else
{
console
.
log
(
1111111
,
file
)
let
url
=
'https://onlinepreview.vschool100.cn/onlinePreview?url='
+
encodeURIComponent
(
file
.
file_path
)
this
.
documentUrl
=
url
this
.
documentDrawer
=
true
...
...
@@ -286,6 +316,11 @@ export default {
type
:
'success'
})
this
.
getFolderList
()
}
else
{
this
.
$message
({
message
:
res
.
data
.
ResponseError
.
LongMessage
,
type
:
'error'
})
}
})
},
...
...
@@ -298,12 +333,24 @@ export default {
type
:
'success'
})
this
.
$refs
.
contextMenu
.
shareVisible
=
false
}
else
{
this
.
$message
({
message
:
res
.
data
.
ResponseError
.
LongMessage
,
type
:
'error'
})
}
})
},
updateOrCreateFolder
(
params
,
message
)
{
updateOrCreateFolder
(
isFile
,
params
,
message
)
{
/* 新增或编辑个人文件夹 */
this
.
$api
.
schoolBasedResourcesApi
.
CreateOrUpdateFolder
(
params
).
then
(
res
=>
{
let
updateApi
if
(
isFile
)
{
// 对象是文件
updateApi
=
this
.
$api
.
schoolBasedResourcesApi
.
updateFileName
params
.
folder_info_id
=
this
.
breadcrumb
[
this
.
breadcrumb
.
length
-
1
].
parent
.
b_id
}
else
{
// 对象是文件夹
updateApi
=
this
.
$api
.
schoolBasedResourcesApi
.
CreateOrUpdateFolder
}
updateApi
(
params
).
then
(
res
=>
{
if
(
res
.
data
.
Status
===
true
)
{
this
.
$message
({
message
:
message
,
...
...
@@ -312,19 +359,38 @@ export default {
this
.
$refs
.
contextMenu
.
newFolderVisible
=
false
this
.
$refs
.
contextMenu
.
renameVisible
=
false
this
.
getFolderList
()
}
else
{
this
.
$message
({
message
:
res
.
data
.
ResponseError
.
LongMessage
,
type
:
'error'
})
}
})
},
handleDeleteFolder
(
params
)
{
/* 删除个人文件夹 */
this
.
$api
.
schoolBasedResourcesApi
.
deleteFolder
(
params
).
then
(
res
=>
{
handleDeleteFolder
(
isFile
,
params
)
{
/* 删除文件或文件夹 */
let
deleteApi
if
(
isFile
)
{
// 对象是文件
deleteApi
=
this
.
$api
.
schoolBasedResourcesApi
.
deleteFile
}
else
{
// 对象是文件夹
deleteApi
=
this
.
$api
.
schoolBasedResourcesApi
.
deleteFolder
}
deleteApi
(
params
).
then
(
res
=>
{
if
(
res
.
data
.
Status
===
true
)
{
this
.
$message
({
message
:
'删除成功'
,
type
:
'success'
})
if
(
isFile
&&
this
.
currentFileList
.
length
===
1
)
{
this
.
backCrumb
(
this
.
breadcrumb
.
length
-
2
)
}
this
.
$refs
.
contextMenu
.
deleteVisible
=
false
this
.
getFolderList
()
}
else
{
this
.
$message
({
message
:
res
.
data
.
ResponseError
.
LongMessage
,
type
:
'error'
})
}
})
},
...
...
@@ -363,6 +429,14 @@ export default {
},
showUploadMenu
()
{
this
.
uploadVisible
=
!
this
.
uploadVisible
},
handleSizeChange
(
val
)
{
this
.
paginationQuery
.
pageSize
=
val
this
.
getFileList
(
this
.
breadcrumb
[
this
.
breadcrumb
.
length
-
1
].
parent
)
},
handleCurrentChange
(
val
)
{
this
.
paginationQuery
.
pageIndex
=
val
this
.
getFileList
(
this
.
breadcrumb
[
this
.
breadcrumb
.
length
-
1
].
parent
)
}
}
}
...
...
VSSCMP_WEB/src/pages/education/schoolBasedResources/myResources/components/MyuploadCtxMenu.vue
View file @
33a312be
...
...
@@ -210,33 +210,55 @@ export default {
let
data
=
{
// b_id: this.rightMenuData.b_id,
parent_id
:
this
.
rightMenuData
.
b_id
,
folder_name
:
folderName
folder_name
:
folderName
,
step_number
:
this
.
rightMenuData
.
step_number
+
1
||
undefined
}
this
.
$emit
(
'updateOrCreateFolder'
,
data
,
'创建文件夹成功'
)
this
.
$emit
(
'updateOrCreateFolder'
,
false
,
data
,
'创建文件夹成功'
)
this
.
newFolderName
=
''
},
clickRenameBtn
()
{
/* 点击重命名按钮 */
this
.
rename
=
this
.
rightMenuData
.
folder_name
this
.
rename
=
this
.
rightMenuData
.
folder_name
||
this
.
rightMenuData
.
file_name
this
.
renameVisible
=
true
},
handleUpdate
()
{
/* 修改个人文件夹名称 */
let
folderName
=
this
.
rename
let
data
=
{
let
data
=
{}
if
(
this
.
currentIsFiLe
)
{
/* 修改文件名称 */
data
=
{
b_id
:
this
.
rightMenuData
.
file_info_id
,
file_name
:
this
.
rename
}
this
.
$emit
(
'updateOrCreateFolder'
,
true
,
data
,
'修改文件名称成功'
)
}
else
{
/* 修改文件名称 */
data
=
{
b_id
:
this
.
rightMenuData
.
b_id
,
parent_id
:
this
.
rightMenuData
.
parent_id
,
folder_name
:
folderName
folder_name
:
this
.
rename
,
step_number
:
this
.
rightMenuData
.
step_number
}
this
.
$emit
(
'updateOrCreateFolder'
,
false
,
data
,
'修改文件夹名称成功'
)
}
this
.
$emit
(
'updateOrCreateFolder'
,
data
,
'修改文件夹名称成功'
)
this
.
rename
=
''
},
handleDelete
()
{
/* 删除个人文件夹 */
let
data
=
{
let
data
=
{}
if
(
this
.
currentIsFiLe
)
{
/* 删除文件 */
data
=
{
b_id
:
this
.
rightMenuData
.
file_info_id
}
this
.
$emit
(
'handleDeleteFolder'
,
true
,
data
)
}
else
{
/* 删除文件夹 */
data
=
{
b_id
:
this
.
rightMenuData
.
b_id
}
this
.
$emit
(
'handleDeleteFolder'
,
data
)
this
.
$emit
(
'handleDeleteFolder'
,
false
,
data
)
}
}
}
}
...
...
VSSCMP_WEB/src/pages/education/schoolBasedResources/myResources/components/SmallFolder.vue
View file @
33a312be
...
...
@@ -33,13 +33,15 @@
</el-table-column>
<el-table-column
v-if=
"manageMode"
prop=
"private"
label=
"公开/不公开"
width=
"180"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
is_public
==
1
?
'不公开'
:
(
scope
.
row
.
is_public
==
2
?
'对所有教师公开'
:
'对部分教师公开'
)
}}
</
template
>
</el-table-column>
<el-table-column
v-if=
"manageMode"
prop=
"
documentC
ount"
prop=
"
file_c
ount"
label=
"文档数量"
width=
"150"
>
</el-table-column>
...
...
@@ -54,8 +56,14 @@
min-width=
"220"
>
</el-table-column>
</el-table>
<div
class=
"pagination"
v-if=
"!(fileList[0] && fileList[0].isFolder)"
>
<pagination
:amount=
"50"
></pagination>
<div
class=
"pagination"
v-if=
"currentIsFiLe"
>
<pagination
:amount=
"paginationQuery.amount"
:page-size=
"paginationQuery.pageSize"
:page-index=
"paginationQuery.pageIndex"
@
getCurrentPage=
"handleCurrentChange"
@
getSizeChange=
"handleSizeChange"
/>
</div>
</div>
</template>
...
...
@@ -84,12 +92,19 @@ export default {
manageMode
:
{
// 是否为我管理的页面使用
type
:
Boolean
,
default
:
false
},
paginationQuery
:
{
type
:
Object
,
default
:
()
=>
{
return
{
amount
:
0
,
pageSize
:
50
,
pageIndex
:
1
}
}
}
},
computed
:
{
folderTypeOptions
()
{
/* 根据foderType来判断显示哪种options */
const
uploadType
=
{
1
:
'学校文件夹'
,
2
:
'个人文件夹'
}
const
school
=
{
1
:
'常规文件夹'
,
2
:
'任务文件夹'
}
const
favorType
=
{
1
:
'我收藏的'
,
2
:
'我分享的'
,
3
:
'分享给我的'
}
let
folderTypeOptions
=
{}
switch
(
this
.
mode
)
{
...
...
@@ -99,6 +114,9 @@ export default {
case
'favor'
:
folderTypeOptions
=
favorType
break
case
'school'
:
folderTypeOptions
=
school
break
}
return
folderTypeOptions
}
...
...
@@ -117,10 +135,10 @@ export default {
this
.
$emit
(
'tableIntoFile'
,
row
)
},
handleSizeChange
(
val
)
{
console
.
log
(
`每页
${
val
}
条`
)
this
.
$emit
(
'getSizeChange'
,
val
)
},
handleCurrentChange
(
val
)
{
console
.
log
(
`当前页:
${
val
}
`
)
this
.
$emit
(
'getCurrentPage'
,
val
)
}
}
}
...
...
VSSCMP_WEB/src/pages/education/schoolBasedResources/schoolResources/Index.vue
View file @
33a312be
...
...
@@ -16,7 +16,7 @@ export default {
},
data
()
{
return
{
isShowPrevPage
:
tru
e
,
isShowPrevPage
:
fals
e
,
menus
:
[
{
name
:
'校内资源'
,
...
...
@@ -28,24 +28,8 @@ export default {
}
},
methods
:
{
initDataFromRoute
(
route
)
{
/* 根据路由参数来显示对应数据 */
if
(
route
.
query
.
folderName
)
{
// 有参数说明不是首页,显示返回上一页
this
.
isShowPrevPage
=
true
}
else
{
this
.
isShowPrevPage
=
false
}
}
},
mounted
()
{
},
created
()
{
this
.
initDataFromRoute
(
this
.
$route
)
},
watch
:
{
$route
(
to
,
from
)
{
this
.
initDataFromRoute
(
to
)
}
}
}
...
...
VSSCMP_WEB/src/pages/education/schoolBasedResources/schoolResources/ResourcesInSchoold.vue
View file @
33a312be
...
...
@@ -7,17 +7,17 @@
v-for=
"(breadcrumbItem, index) of breadcrumb"
:key=
"index"
@
click
.
native=
"backCrumb(index)"
>
{{
breadcrumbItem
}}
{{
breadcrumbItem
.
label
}}
</el-breadcrumb-item>
</el-breadcrumb>
</div>
<div
class=
"rightNav"
>
<el-select
v-
if=
"!(currentFileList[0] && currentFileList[0].isFolder)
"
class=
"timer-select"
v-model=
"timeSelect"
placeholder=
"请选择"
>
<el-select
v-
show=
"currentIsFiLe
"
class=
"timer-select"
v-model=
"timeSelect"
placeholder=
"请选择"
>
<el-option
v-for=
"item in
o
ptions"
:key=
"item.
value
"
:label=
"item.
label
"
:value=
"item.
value
"
>
v-for=
"item in
termO
ptions"
:key=
"item.
ID
"
:label=
"item.
TeamName
"
:value=
"item.
ID
"
>
</el-option>
</el-select>
<search></search>
...
...
@@ -27,7 +27,11 @@
<div
class=
"smallCtn"
>
<small-folder
:file-list=
"currentFileList"
:currentIsFiLe=
"currentIsFiLe"
:pagination-query=
"paginationQuery"
@
tableIntoFile=
"intoFolder"
@
getSizeChange=
"handleSizeChange"
@
getCurrentPage=
"handleCurrentChange"
>
</small-folder>
</div>
...
...
@@ -37,10 +41,12 @@
<el-drawer
title=
"查看"
:visible
.
sync=
"documentDrawer"
:size=
"'
6
0%'"
>
<
span>
文档内容
</span
>
:size=
"'
8
0%'"
>
<
iframe
:src=
"documentUrl"
width=
"100%"
height=
"100%"
name=
"topFrame"
noresize=
"noresize"
frameborder=
"0"
id=
"topFrame"
></iframe
>
</el-drawer>
<button
v-show=
"false"
ref=
"btn"
@
click=
"currentIsFiLe = true"
>
设置当前页面为文件模式
</button>
</div>
</
template
>
...
...
@@ -55,157 +61,139 @@ export default {
data
()
{
return
{
timeSelect
:
'allItem'
,
// 学期选择框数据
options
:
[{
termOptions
:
[{
// 学期选择options
value
:
'allItem'
,
label
:
'全部学期'
}],
documentDrawer
:
false
,
// 查看文档抽屉
currentIsFiLe
:
false
,
// 当前层次是否为文档列表
currentFileList
:
[],
selectFolderVisible
:
false
,
// 查看文件侧滑框
breadcrumb
:
[
'首页'
],
// 面包屑
fileListData
:
{
firstLevelData
:
[
{
id
:
991
,
name
:
'第一级文件夹'
,
typeName
:
'学校文件夹'
,
type
:
'school'
,
icon
:
'el-icon-folder'
,
descript
:
'我上传了10个文档'
,
isFocus
:
false
,
isFolder
:
true
,
folderData
:
'secondLevelData'
,
nextIsFolder
:
true
,
uploadCount
:
'10'
,
author
:
'张三'
,
updateTime
:
'2020-08-22 12:00'
breadcrumb
:
[],
// 面包屑
documentUrl
:
''
,
// 文档在线地址
paginationQuery
:
{
// 分页信息
amount
:
0
,
pageSize
:
20
,
pageIndex
:
1
}
}
},
{
id
:
992
,
name
:
'第一级文件夹'
,
typeName
:
'个人文件夹'
,
type
:
'personal'
,
icon
:
'el-icon-folder'
,
descript
:
'我上传了10个文档'
,
isFocus
:
false
,
isFolder
:
true
,
folderData
:
'secondLevelData'
,
nextIsFolder
:
true
,
uploadCount
:
'10'
,
author
:
'张三'
,
updateTime
:
'2020-08-22 12:00'
mounted
()
{
this
.
getFolderList
()
this
.
getTermList
()
},
{
id
:
993
,
name
:
'第一级文件夹'
,
typeName
:
'个人文件夹'
,
type
:
'personal'
,
icon
:
'el-icon-folder'
,
descript
:
'我上传了10个文档'
,
isFocus
:
false
,
isFolder
:
true
,
folderData
:
'secondLevelData'
,
nextIsFolder
:
true
,
uploadCount
:
'10'
,
author
:
'张三'
,
updateTime
:
'2020-08-22 12:00'
}
],
secondLevelData
:
[
{
id
:
1001
,
name
:
'第二级文件夹'
,
typeName
:
'学校文件夹'
,
type
:
'school'
,
icon
:
'el-icon-folder'
,
descript
:
'我上传了10个文档'
,
isFocus
:
false
,
isFolder
:
true
,
folderData
:
'thirdLevelData'
,
nextIsFolder
:
false
,
uploadCount
:
'10'
,
author
:
'张三'
,
updateTime
:
'2020-08-22 12:00'
watch
:
{
},
{
id
:
1002
,
name
:
'第二级文件夹'
,
typeName
:
'学校文件夹'
,
type
:
'school'
,
icon
:
'el-icon-folder'
,
descript
:
'我上传了10个文档'
,
isFocus
:
false
,
isFolder
:
true
,
folderData
:
'thirdLevelData'
,
nextIsFolder
:
false
,
uploadCount
:
'10'
,
author
:
'张三'
,
updateTime
:
'2020-08-22 12:00'
methods
:
{
getFolderList
()
{
this
.
$api
.
schoolBasedResourcesApi
.
getSchoolResourceFolderList
().
then
(
res
=>
{
this
.
$handleResponse
(
res
).
then
(
data
=>
{
this
.
initFromBreadcrumb
(
data
)
})
})
},
getTermList
()
{
/* 获取学期列表 */
this
.
$api
.
commonApi
.
getTermInfoList
().
then
(
res
=>
{
this
.
$handleResponse
(
res
).
then
(
data
=>
{
this
.
termOptions
=
data
this
.
timeSelect
=
data
[
0
].
ID
})
})
},
initFromBreadcrumb
(
data
)
{
/* 通过面包屑初始化数据 */
this
.
currentIsFile
=
false
let
breadcrumb
=
this
.
breadcrumb
if
(
breadcrumb
.
length
<=
1
)
{
this
.
breadcrumb
=
[{
label
:
'首页'
,
listData
:
data
,
parent
:
{
b_id
:
'0'
,
parent_id
:
'0'
},
currentIsFiLe
:
false
}]
this
.
currentFileList
=
data
}
else
{
let
newBreadcrumb
=
[{
label
:
'首页'
,
listData
:
data
,
parent
:
{
b_id
:
'0'
,
parent_id
:
'0'
},
currentIsFiLe
:
false
}]
let
currentList
=
data
for
(
let
i
=
1
;
i
<
breadcrumb
.
length
;
i
++
)
{
let
hasThisFile
=
false
for
(
let
j
=
0
;
j
<
currentList
.
length
;
j
++
)
{
if
(
currentList
[
j
].
b_id
===
breadcrumb
[
i
].
parent
.
b_id
)
{
let
isFile
=
(
!
currentList
[
j
].
children
||
currentList
[
j
].
children
.
length
===
0
)
&&
currentList
[
j
].
file_count
>
0
this
.
currentIsFile
=
isFile
this
.
addCrumb
(
newBreadcrumb
,
currentList
[
j
],
isFile
)
if
(
isFile
)
{
this
.
getFileList
(
currentList
[
j
])
}
else
{
currentList
=
currentList
[
j
].
children
}
],
thirdLevelData
:
[
{
id
:
1101
,
name
:
'第三级文件.txt'
,
typeName
:
'文件'
,
type
:
'file'
,
icon
:
'el-icon-document'
,
descript
:
'我上传了10个文档'
,
isFocus
:
false
,
isFolder
:
false
,
nextIsFolder
:
false
,
uploadCount
:
'10'
,
author
:
'张三'
,
updateTime
:
'2020-08-22 12:00'
hasThisFile
=
true
break
}
]
}
if
(
hasThisFile
===
false
)
{
break
}
}
this
.
breadcrumb
=
newBreadcrumb
if
(
!
this
.
currentIsFile
)
{
this
.
currentFileList
=
currentList
}
}
},
methods
:
{
initDataFromRoute
(
route
)
{
/* 根据路由参数初始化数据 */
if
(
route
.
query
.
folderName
)
{
this
.
currentFileList
=
this
.
fileListData
[
route
.
query
.
folderName
]
this
.
breadcrumb
=
JSON
.
parse
(
route
.
query
.
breadcrumb
)
}
else
{
this
.
currentFileList
=
this
.
fileListData
.
firstLevelData
this
.
breadcrumb
=
[
'首页'
]
getFileList
(
file
)
{
this
.
$refs
.
btn
.
click
()
const
folderId
=
file
.
b_id
const
selType
=
file
.
folder_type
let
data
=
{
data
:
{
folder_id
:
folderId
,
sel_type
:
selType
},
PageSize
:
this
.
paginationQuery
.
pageSize
,
PageNumber
:
this
.
paginationQuery
.
pageIndex
}
this
.
$api
.
schoolBasedResourcesApi
.
GetFileList
(
data
).
then
(
res
=>
{
this
.
$handleResponse
(
res
).
then
(
data
=>
{
this
.
currentFileList
=
data
.
Data
this
.
paginationQuery
.
amount
=
data
.
TotalRecords
})
})
},
backCrumb
(
index
)
{
/* 点击面包屑返回前几级 */
if
(
index
<
this
.
breadcrumb
.
length
-
1
)
{
let
backPageCount
=
index
-
this
.
breadcrumb
.
length
+
1
this
.
$router
.
go
(
backPageCount
)
let
breadcrumb
=
this
.
breadcrumb
let
item
=
breadcrumb
[
index
]
this
.
currentIsFiLe
=
false
if
(
index
<
breadcrumb
.
length
-
1
)
{
this
.
currentFileList
=
item
.
listData
this
.
breadcrumb
=
breadcrumb
.
slice
(
0
,
index
+
1
)
}
},
addCrumb
(
breadcrumb
,
file
,
currentIsFiLe
)
{
/* 添加面包屑 */
breadcrumb
.
push
({
label
:
file
.
folder_name
,
listData
:
file
.
children
,
parent
:
file
,
currentIsFiLe
})
},
intoFolder
(
file
)
{
/* 进入下一级文件夹 */
if
(
file
.
isFolder
)
{
if
(
(
file
.
children
&&
file
.
children
.
length
>
0
&&
this
.
currentIsFiLe
===
false
)
||
(
file
.
file_count
===
0
&&
this
.
breadcrumb
.
length
<
3
)
)
{
// 进入文件夹
this
.
breadcrumb
.
push
(
file
.
name
)
this
.
$router
.
push
({
path
:
'/education/schoolResources/index'
,
query
:
{
folderName
:
file
.
folderData
,
breadcrumb
:
JSON
.
stringify
(
this
.
breadcrumb
)
}
})
this
.
currentIsFiLe
=
false
this
.
addCrumb
(
this
.
breadcrumb
,
file
,
this
.
currentIsFiLe
)
this
.
currentFileList
=
file
.
children
}
else
{
// 获取当前文件夹的文档列表
if
(
this
.
currentIsFiLe
===
false
)
{
this
.
currentIsFiLe
=
true
this
.
addCrumb
(
this
.
breadcrumb
,
file
,
this
.
currentIsFiLe
)
this
.
getFileList
(
file
)
}
else
{
// 查看文件
let
url
=
'https://onlinepreview.vschool100.cn/onlinePreview?url='
+
encodeURIComponent
(
file
.
file_path
)
this
.
documentUrl
=
url
this
.
documentDrawer
=
true
}
}
},
mounted
()
{
},
created
()
{
this
.
initDataFromRoute
(
this
.
$route
)
handleSizeChange
(
val
)
{
this
.
paginationQuery
.
pageSize
=
val
this
.
getFileList
(
this
.
breadcrumb
[
this
.
breadcrumb
.
length
-
1
].
parent
)
},
watch
:
{
$route
(
to
,
from
)
{
this
.
initDataFromRoute
(
to
)
handleCurrentChange
(
val
)
{
this
.
paginationQuery
.
pageIndex
=
val
this
.
getFileList
(
this
.
breadcrumb
[
this
.
breadcrumb
.
length
-
1
].
parent
)
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment